suspend changes, suspended cards which would have a counter removed are checked for time counters and cast if no time counters are present as a statebased effect, as per MTG rules..
case changes, "Time" != "time" aparently our parser now strings all counters as lower case...so "Charge" is no longer string "Charge" and can not be compared to "Charge"..not sure if that makes any sense :) anyways removel of time counters on exiled cards by triggers or effects now happen correctly.
This commit is contained in:
@@ -332,6 +332,7 @@ AACounter::AACounter(int id, MTGCardInstance * source, MTGCardInstance * target,
|
||||
_target->counters->removeCounter(name.c_str(), power, toughness);
|
||||
}
|
||||
}
|
||||
//specail cases, indestructible creatures which recieve enough counters to kill it are destroyed as a state based effect
|
||||
if(_target->toughness <= 0 && _target->has(Constants::INDESTRUCTIBLE) && toughness < 0)
|
||||
_target->controller()->game->putInGraveyard(_target);
|
||||
return nb;
|
||||
|
||||
@@ -134,6 +134,14 @@ int Counters::removeCounter(const char * _name, int _power, int _toughness)
|
||||
return 0;
|
||||
counters[i]->removed();
|
||||
counters[i]->nb--;
|
||||
//special case:if a card is suspended and no longer has a time counter when the last is removed, the card is cast.
|
||||
if (target->suspended && !target->counters->hasCounter("time",0,0))
|
||||
{
|
||||
GameObserver * game = game->GetInstance();
|
||||
MTGCardInstance * copy = target->controller()->game->putInZone(target, target->currentZone, target->controller()->game->stack);
|
||||
Spell * spell = game->mLayers->stackLayer()->addSpell(copy, game->targetChooser, NULL,1, 0);
|
||||
game->targetChooser = NULL;
|
||||
}
|
||||
return mCount;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -551,14 +551,8 @@ int MTGSuspendRule::receiveEvent(WEvent *e)
|
||||
{
|
||||
MTGCardInstance * card = z->cards[i];
|
||||
|
||||
if (card->suspended && card->counters->hasCounter("Time",0,0))
|
||||
card->counters->removeCounter("Time",0,0);
|
||||
if (card->suspended && !card->counters->hasCounter("Time",0,0))
|
||||
{
|
||||
MTGCardInstance * copy = p->game->putInZone(card, card->currentZone, p->game->stack);
|
||||
Spell * spell = game->mLayers->stackLayer()->addSpell(copy, game->targetChooser, NULL,1, 0);
|
||||
game->targetChooser = NULL;
|
||||
}
|
||||
if (card->suspended && card->counters->hasCounter("time",0,0))
|
||||
card->counters->removeCounter("time",0,0);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -599,7 +593,7 @@ int MTGSuspendRule::reactToClick(MTGCardInstance * card)
|
||||
player->game->putInZone(card, card->currentZone, player->game->exile);
|
||||
card->next->suspended = true;
|
||||
for(signed int i = 0; i < card->suspendedTime;i++)
|
||||
card->next->counters->addCounter("Time",0,0);
|
||||
card->next->counters->addCounter("time",0,0);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user