Skip to content
This repository has been archived by the owner on Oct 2, 2018. It is now read-only.

Row types #164

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
Open

Row types #164

wants to merge 16 commits into from

Conversation

Masclins
Copy link
Collaborator

@Masclins Masclins commented Sep 25, 2018

Description

New ability created: Now cards can have an ability that makes their power change when played on specific rows.

Rows can have a :type and this ability checks if the card had been played on a row of the appropriate type.

Also, I changed (add-power so all abilities recieve game-state and play.

Issues Resolved

Resolves #150

Hotspots

(rules.abilities/type-add-power is probably what's most relevant.

Still, I find it very important to double-check that we have all the tests we'd want to.

Checklist for contribution requirements

  • The tests pass
  • The code has tests
  • The tests are well-designed
  • The code is readable
  • The code is well-organized
  • Any rule changed or included is also on the Manual

@Masclins
Copy link
Collaborator Author

Errors on tests now are because it's implemented that all abilities require a target.
I'll change that when #165 is merged, since I'll use what's implemented there (that returns the number of needed targets)

#(+ % increase))

game-state))
([]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have the enormous suspicion that calling the function with no arguments to get a description is a bad idea... but I can't think of a better alternative.

Maybe to make it more reasonable we can have a function (describe ability) which simply calls ability with no parameters? I don't know, something seems very off to me.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wait, I have an idea. The function should generate both a function and a description everytime, so an ability has essentially {:function (fn ...) :description "This is the description").

This separates the concerns cleanly instead of having a function return radically different things dependent on the number of arguments.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really like it.
Therefore cards would have :ability some-function :description "ability description" and, when needed, :target 1.

Is that right?
I'll do that change when able.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Masclins Masclins dismissed kenan-rhoton’s stale review October 1, 2018 13:18

Changes applied. Please, double-check everything we wanna test is tested. (I found out a couple of tests were missing)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants