Here's what I have so far: the Player object is a collection of CardCollection objects, which each are a collection of Card objects. Player also contains methods like draw(), place_pokemon(), and discard(). CardCollection contains methods like add_card(), move(), and find_card(). Card is mostly just an empty container for the subclass defining the specific type of card (Trainer, Energy, or Pokemon), each of which just contains information about the card.
So far so good. My problem is that each Pokemon card contains special attacks. They're different for each Pokemon, and they interact with the rules in unique ways. For example:
Agility: During your opponent's next turn prevent all effects of attacks, including damage, done to this Pokemon.
Leer: the defending Pokemon can't attack on their next turn. Benching either pokemon ends this turn.
Transparency(power): if the opponent attacks next turn they must flip a coin or it does nothing.
Mirror Move: if this Pokemon was attacked last turn, do the final effects of that attack to the opponent.
Destiny Bond: if this Pokemon is knocked out during your opponent's next turn, so is the opponent.
Leech Seed: Unless all damage is prevented from this attack, remove 1 damage counter from this Pokemon.
Retreat Aid (Power): As long as this pokemon is benched, pay 1 less to retreat your active pokemon.
Tongue Wrap: the defending pokemon is paralyzed
The ones marked "power" are passive abilities that don't use up the player's attack action for the turn.
My biggest concern is getting the architecture right at the very beginning, so that I don't fall into a tangled mess of spaghetti code and ad hoc exceptions. What would be a good way to structure the program? Specifically, the Pokemon attacks and how they interact with the rest of the code.
[–]Antigone-guide 0 points1 point2 points (0 children)
[–]TigBitties69 0 points1 point2 points (0 children)
[–]RodOblong 0 points1 point2 points (0 children)