Order of resolve and graveyard
I'm having a problem dealing with Feast of Flesh. (Testing my new damage spell code)
It needs to count the number of cards named Feast of Flesh in all graveyards. However when the first one in the game resolves, the X is calculated as 2 (1 + 1) because of the following code:
If there was explicit card code for Feast of Flesh, then it would take the number of cards and explicitly subtract 1 from it, then add the "plus 1".
But to do this generically, when the counting function shouldn't have to know about Feast of Flesh or the other similarly worded cards, that's a problem.
Any thoughts?
It needs to count the number of cards named Feast of Flesh in all graveyards. However when the first one in the game resolves, the X is calculated as 2 (1 + 1) because of the following code:
- Code: Select all
//special consideration for "Beacon of Unrest" and other "Beacon" cards
if((c.isInstant() || c.isSorcery()) &&
(! c.getName().startsWith("Beacon")) &&
(! c.getName().startsWith("Pulse")) &&
!AllZone.GameAction.isCardRemovedFromGame(c)) //hack to make flashback work
{
AllZone.GameAction.moveToGraveyard(c);
}
if (sa.getSourceCard().getKeyword().contains("Cantrip"))
AllZone.GameAction.drawCard(sa.getSourceCard().getController());
//resolve() needs to be call AFTER stuff is moved to the graveyard
//because cards like Elvish Fury are returned to hand after resolving
sa.resolve();
AllZone.GameAction.checkStateEffects();
//update all zones, something things arent' updated for some reason
AllZone.Human_Hand.updateObservers();
AllZone.Human_Play.updateObservers();
AllZone.Computer_Play.updateObservers();
If there was explicit card code for Feast of Flesh, then it would take the number of cards and explicitly subtract 1 from it, then add the "plus 1".
But to do this generically, when the counting function shouldn't have to know about Feast of Flesh or the other similarly worded cards, that's a problem.
Any thoughts?