Overlooked this

Should be fine now, reverted the test
This commit is contained in:
Anthony Calosa
2016-06-18 21:20:30 +08:00
parent f57bba22cc
commit a73030ac9b

View File

@@ -3010,73 +3010,73 @@ int AAMover::resolve()
//inplay is a special zone ! //inplay is a special zone !
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; i++)
{ {
if (destZone == game->players[i]->game->inPlay && fromZone != game->players[i]->game->inPlay && fromZone if (!_target->hasSubtype(Subtypes::TYPE_AURA) && destZone == game->players[i]->game->inPlay && fromZone != game->players[i]->game->inPlay && fromZone
!= game->players[i]->opponent()->game->inPlay) != game->players[i]->opponent()->game->inPlay)
{ {
if(_target->hasSubtype(Subtypes::TYPE_AURA) && destZone == game->players[i]->game->inPlay) MTGCardInstance * copy = game->players[i]->game->putInZone(_target, fromZone, game->players[i]->game->temp);
{//put into play aura if there is no valid targets then it will be in its current zone Spell * spell = NEW Spell(game, copy);
MTGAbility *a = NEW AACastCard(game, game->mLayers->actionLayer()->getMaxId(), _target, _target,false,false,false,"","Put in play",false,true); spell->resolve();
a->oneShot = false; if(andAbility)
a->canBeInterrupted = false;
a->addToGame();
if(andAbility)
{
MTGAbility * andAbilityClone = andAbility->clone();
andAbilityClone->target = _target->next;
if(andAbility->oneShot)
{
andAbilityClone->resolve();
SAFE_DELETE(andAbilityClone);
}
else
{
andAbilityClone->addToGame();
}
}
}
else
{ {
MTGCardInstance * copy = game->players[i]->game->putInZone(_target, fromZone, game->players[i]->game->temp); MTGAbility * andAbilityClone = andAbility->clone();
Spell * spell = NEW Spell(game, copy); andAbilityClone->target = spell->source;
spell->resolve(); if(andAbility->oneShot)
if(andAbility)
{ {
MTGAbility * andAbilityClone = andAbility->clone(); andAbilityClone->resolve();
andAbilityClone->target = spell->source; SAFE_DELETE(andAbilityClone);
if(andAbility->oneShot) }
{ else
andAbilityClone->resolve(); {
SAFE_DELETE(andAbilityClone); andAbilityClone->addToGame();
}
else
{
andAbilityClone->addToGame();
}
} }
if(persist)
spell->source->counters->addCounter(-1,-1);
if(undying)
spell->source->counters->addCounter(1,1);
delete spell;
} }
if(persist)
spell->source->counters->addCounter(-1,-1);
if(undying)
spell->source->counters->addCounter(1,1);
delete spell;
return 1; return 1;
} }
} }
p->game->putInZone(_target, fromZone, destZone); if(_target->hasSubtype(Subtypes::TYPE_AURA) && (destZone == game->players[0]->game->inPlay || destZone == game->players[1]->game->inPlay))
while(_target->next) {//put into play aura if there is no valid targets then it will be in its current zone
_target = _target->next; MTGAbility *a = NEW AACastCard(game, game->mLayers->actionLayer()->getMaxId(), _target, _target,false,false,false,"","Put in play",false,true);
if(andAbility) a->oneShot = false;
{ a->canBeInterrupted = false;
MTGAbility * andAbilityClone = andAbility->clone(); a->addToGame();
andAbilityClone->target = _target; if(andAbility && _target->next)
if(andAbility->oneShot) {//if successful target->next should be valid
{ MTGAbility * andAbilityClone = andAbility->clone();
andAbilityClone->resolve(); andAbilityClone->target = _target->next;
SAFE_DELETE(andAbilityClone); if(andAbility->oneShot)
{
andAbilityClone->resolve();
SAFE_DELETE(andAbilityClone);
}
else
{
andAbilityClone->addToGame();
}
} }
else }
else
{
p->game->putInZone(_target, fromZone, destZone);
while(_target->next)
_target = _target->next;
if(andAbility)
{ {
andAbilityClone->addToGame(); MTGAbility * andAbilityClone = andAbility->clone();
andAbilityClone->target = _target;
if(andAbility->oneShot)
{
andAbilityClone->resolve();
SAFE_DELETE(andAbilityClone);
}
else
{
andAbilityClone->addToGame();
}
} }
} }
return 1; return 1;