-
Notifications
You must be signed in to change notification settings - Fork 1
Row types #164
base: develop
Are you sure you want to change the base?
Conversation
…nto abilities-to-fe
Errors on tests now are because it's implemented that all abilities require a target. |
backend/src/rules/abilities.clj
Outdated
#(+ % increase)) | ||
|
||
game-state)) | ||
([] |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Changes applied. Please, double-check everything we wanna test is tested. (I found out a couple of tests were missing)
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 recievegame-state
andplay
.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