Move card-specific game state into card definitions #66

Merged
merged 13 commits into from Jan 20, 2012

2 participants

@bilts

Fixes #21

bilts added some commits Jan 16, 2012
@bilts bilts Move Goons VP logic into its card definition
See #21
3b569d7
@bilts bilts Move Crossroads +action logic into its card definition
See #21
2c07bac
@bilts bilts Move Moat protection logic into its card definition
See #21
43b923f
@bilts bilts Move Lighthouse protection logic into its card definition
See #21
d386de0
@bilts bilts Move Fool's Gold play state into its card definition
See #21
64baaee
@bilts bilts Move Tactician active/inactive state into its card definition
See #21
a40c279
@bilts bilts Move logic for returning Treasury to the deck into its card definition
See #21
15a092e
@bilts bilts Make mat implementation more generic
Mats are now set up by the card implementations rather than coded into the game state.  Haven and Island logic has been updated accordingly and those cards no longer have logic in the game state.

See #21
b972d8e
@bilts bilts Add concepts of card-specific state and special supply, clean up Tour…
…nament

Cards can now specify their own state without the game state needing to have knowledge.  Tactician and Treasury needed to be updated to use this because their state could get messed up if the AI player was making hypothetical plays.  Tournament no longer needs code in the game state.

See #21
1b7f9c6
@bilts bilts Make logic for Highway, Bridge, etc cost reduction more generic
See #21
ca88f66
@bilts bilts Move logic for Trade Route mat into its card definition
See #21
4711978
@bilts bilts Move logic for Young Witch bane card into its card definition
See #21
5f0180b
@bilts bilts Notify Young Witch bane card that the game is starting when the card …
…is added
10135e8
@rspeer rspeer merged commit e6f3456 into rspeer:master Jan 20, 2012
@rspeer

This change let every Lighthouse double as a Moat!

Sorry about that. Good catch. Looking through your recent commits, you fixed this, right?

@rspeer

Ah, I see. At first I was concerned because the backwards iteration was removed, but now I see you're iterating over a separate list, which is a good idea.

Scrutinizing it more, I think both of us are slightly wrong in the edge case. The hand can change as the result of reaction cards, and that may introduce or remove reaction cards from the mix. I opened rspeer/dominiate#71 to handle this. For such a weak card, Secret Chamber sure does cause a lot of headaches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment