untapping, upkeep cost
I'll have to rewrite my untaping/upkeep costs mechanism sooner or later, and I was wondering how other applications handle it?
Right now I have a complex system of "blockers" associated to each card.
At the beginning of each turn, any blocker goes to the blockers list, and it is removed from the list only if a "cost" is paid.
A blocker is usually represented by a "cost" (man cost, creature sacrifice, ...) but can sometimes be more. That "cost" explains how to unlock the blocker.
so for example, Brass man has a blocker added to its list at the beginning of each turn. This blocker is removed only if "{3}" is paid during upkeep, and brass man can then be untapped.
Smoke puts a blocker on all creatures. Clicking on one creature during the untap phase removes the blocker and untaps the creature. clicking on other creatures after this one doesn't do anything.
The other creatures consequently have a "blocker" still active in their list, and don't get untapped.
At the end of a turn, all "blockers" are cleared from the list, and will be added again at the following turn if necessary.
This system is too complex right now and completely buggy, unfortunately. Another issue is that right now the AI doesn't handle upkeep costs at all, and is in deep trouble if a Lord of the pit makes its way to its deck
. So I'll rewrite it.
Before I start thinking, I'd like to know how other engines deal with the whole "untap/upkeep" phase. Anyone has a simple system to handle complex cases such as " Smoke is in play, I have a Brass man in play, and Grizzly bears with Paralysis " ?
Thanks in advance
Right now I have a complex system of "blockers" associated to each card.
At the beginning of each turn, any blocker goes to the blockers list, and it is removed from the list only if a "cost" is paid.
A blocker is usually represented by a "cost" (man cost, creature sacrifice, ...) but can sometimes be more. That "cost" explains how to unlock the blocker.
so for example, Brass man has a blocker added to its list at the beginning of each turn. This blocker is removed only if "{3}" is paid during upkeep, and brass man can then be untapped.
Smoke puts a blocker on all creatures. Clicking on one creature during the untap phase removes the blocker and untaps the creature. clicking on other creatures after this one doesn't do anything.
The other creatures consequently have a "blocker" still active in their list, and don't get untapped.
At the end of a turn, all "blockers" are cleared from the list, and will be added again at the following turn if necessary.
This system is too complex right now and completely buggy, unfortunately. Another issue is that right now the AI doesn't handle upkeep costs at all, and is in deep trouble if a Lord of the pit makes its way to its deck
Before I start thinking, I'd like to know how other engines deal with the whole "untap/upkeep" phase. Anyone has a simple system to handle complex cases such as " Smoke is in play, I have a Brass man in play, and Grizzly bears with Paralysis " ?
Thanks in advance