set the current controller to do action
let the controller of the action do the abilty, also fix casted cards that's been casted using castcard and be put into its owner's graveyard
This commit is contained in:
@@ -567,12 +567,12 @@ int PutInGraveyard::resolve()
|
|||||||
MTGGameZone * zone = card->getCurrentZone();
|
MTGGameZone * zone = card->getCurrentZone();
|
||||||
if (card->basicAbilities[(int)Constants::EXILEDEATH])
|
if (card->basicAbilities[(int)Constants::EXILEDEATH])
|
||||||
{
|
{
|
||||||
card->owner->game->putInZone(card, zone, card->owner->game->exile);
|
card->controller()->game->putInZone(card, zone, card->owner->game->exile);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (zone == observer->players[0]->game->inPlay || zone == observer->players[1]->game->inPlay)
|
if (zone == observer->players[0]->game->inPlay || zone == observer->players[1]->game->inPlay)
|
||||||
{
|
{
|
||||||
card->owner->game->putInZone(card, zone, card->owner->game->graveyard);
|
card->controller()->game->putInZone(card, zone, card->owner->game->graveyard);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -8153,7 +8153,7 @@ int AACastCard::resolveSpell()
|
|||||||
if (putinplay && (_target->hasType(Subtypes::TYPE_ARTIFACT)||_target->hasType(Subtypes::TYPE_CREATURE)||_target->hasType(Subtypes::TYPE_ENCHANTMENT)||_target->hasType(Subtypes::TYPE_PLANESWALKER)))
|
if (putinplay && (_target->hasType(Subtypes::TYPE_ARTIFACT)||_target->hasType(Subtypes::TYPE_CREATURE)||_target->hasType(Subtypes::TYPE_ENCHANTMENT)||_target->hasType(Subtypes::TYPE_PLANESWALKER)))
|
||||||
copy =_target->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->battlefield,noEvent);
|
copy =_target->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->battlefield,noEvent);
|
||||||
else
|
else
|
||||||
copy =_target->controller()->game->putInZone(_target, _target->currentZone, _target->controller()->game->stack,noEvent);
|
copy =_target->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->stack,noEvent);
|
||||||
copy->changeController(source->controller(),true);
|
copy->changeController(source->controller(),true);
|
||||||
if(asNormalMadness)
|
if(asNormalMadness)
|
||||||
copy->MadnessPlay = true;
|
copy->MadnessPlay = true;
|
||||||
@@ -8163,7 +8163,7 @@ int AACastCard::resolveSpell()
|
|||||||
if (putinplay && (_target->hasType(Subtypes::TYPE_ARTIFACT)||_target->hasType(Subtypes::TYPE_CREATURE)||_target->hasType(Subtypes::TYPE_ENCHANTMENT)||_target->hasType(Subtypes::TYPE_PLANESWALKER)))
|
if (putinplay && (_target->hasType(Subtypes::TYPE_ARTIFACT)||_target->hasType(Subtypes::TYPE_CREATURE)||_target->hasType(Subtypes::TYPE_ENCHANTMENT)||_target->hasType(Subtypes::TYPE_PLANESWALKER)))
|
||||||
copy =_target->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->battlefield,noEvent);
|
copy =_target->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->battlefield,noEvent);
|
||||||
else
|
else
|
||||||
copy =_target->controller()->game->putInZone(_target, _target->currentZone, _target->controller()->game->stack,noEvent);
|
copy =_target->controller()->game->putInZone(_target, _target->currentZone, source->controller()->game->stack,noEvent);
|
||||||
copy->changeController(source->controller(),true);
|
copy->changeController(source->controller(),true);
|
||||||
}
|
}
|
||||||
if (game->targetChooser)
|
if (game->targetChooser)
|
||||||
|
|||||||
@@ -5250,11 +5250,11 @@ void AbilityFactory::addAbilities(int _id, Spell * spell)
|
|||||||
|
|
||||||
if (card->hasType(Subtypes::TYPE_INSTANT) || card->hasType(Subtypes::TYPE_SORCERY))
|
if (card->hasType(Subtypes::TYPE_INSTANT) || card->hasType(Subtypes::TYPE_SORCERY))
|
||||||
{
|
{
|
||||||
MTGPlayerCards * zones = card->owner->game;
|
MTGPlayerCards * zones = card->controller()->game;
|
||||||
MTGPlayerCards * Endzones = card->owner->game;//put them in thier owners respective zones as per rules.
|
MTGPlayerCards * Endzones = card->owner->game;//put them in thier owners respective zones as per rules.
|
||||||
if (card->basicAbilities[(int)Constants::EXILEDEATH])
|
if (card->basicAbilities[(int)Constants::EXILEDEATH])
|
||||||
{
|
{
|
||||||
card->owner->game->putInZone(card, card->getCurrentZone(), card->owner->game->exile);
|
card->controller()->game->putInZone(card, card->getCurrentZone(), card->owner->game->exile);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (card->alternateCostPaid[ManaCost::MANA_PAID_WITH_BUYBACK] > 0)
|
else if (card->alternateCostPaid[ManaCost::MANA_PAID_WITH_BUYBACK] > 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user