-fix for issue 604 (Land play limitation should not apply in all cases)
-- this adds a "castMehod" variable to MTGCardInstance. IF this variable is 0, the card was not "cast" (or for lands, "put into play" as part of the lands rule), but "added" to the battlefield with some other effect. On the other hand, if this variable is set, it means the card was cast 
-- as we discussed, I did not touch the "alternateCostPaid" variable, as I'm still not really sure these two concepts are actually the same
This commit is contained in:
wagic.the.homebrew@gmail.com
2011-03-02 13:41:24 +00:00
parent 8f9b1d5b8d
commit b021417324
12 changed files with 95 additions and 15 deletions
+4 -4
View File
@@ -130,7 +130,7 @@ int MTGPutInPlayRule::reactToClick(MTGCardInstance * card)
if (card->hasType("land"))
{
MTGCardInstance * copy = player->game->putInZone(card, player->game->hand, player->game->temp);
Spell * spell = NEW Spell(copy);
Spell * spell = NEW Spell(0,copy,NULL,NULL, payResult);
spell->resolve();
delete spellCost;
delete spell;
@@ -151,7 +151,7 @@ int MTGPutInPlayRule::reactToClick(MTGCardInstance * card)
if (card->has(Constants::STORM))
{
int storm = player->game->stack->seenThisTurn("*") + player->opponent()->game->stack->seenThisTurn("*");
int storm = player->game->stack->seenThisTurn("*", Constants::CAST_ALL) + player->opponent()->game->stack->seenThisTurn("*", Constants::CAST_ALL);
ManaCost * spellCost = player->getManaPool();
for (int i = storm; i > 1; i--)
{
@@ -298,7 +298,7 @@ int MTGAlternativeCostRule::reactToClick(MTGCardInstance * card, ManaCost *alter
if (card->hasType("land"))
{
MTGCardInstance * copy = player->game->putInZone(card, card->currentZone, player->game->temp);
Spell * spell = NEW Spell(copy);
Spell * spell = NEW Spell(0,copy,NULL,NULL, alternateCostType);
copy->alternateCostPaid[alternateCostType] = 1;
spell->resolve();
SAFE_DELETE(spell);
@@ -316,7 +316,7 @@ int MTGAlternativeCostRule::reactToClick(MTGCardInstance * card, ManaCost *alter
if (card->has(Constants::STORM))
{
int storm = player->game->stack->seenThisTurn("*") + player->opponent()->game->stack->seenThisTurn("*");
int storm = player->game->stack->seenThisTurn("*", Constants::CAST_ALL) + player->opponent()->game->stack->seenThisTurn("*", Constants::CAST_ALL);
for (int i = storm; i > 1; i--)
{
game->mLayers->stackLayer()->addSpell(copy, NULL, playerMana, alternateCostType, 1);