mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 12:49:39 -08:00
* Archangel Avacyn - Fixed check for source object of triggered ability.
This commit is contained in:
parent
46566361e7
commit
4bfac31370
6 changed files with 64 additions and 11 deletions
|
|
@ -54,7 +54,7 @@ public class PharagaxGiant extends CardImpl {
|
|||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Tribute 2
|
||||
// Tribute 2 (As this creature enters the battlefield, an opponent of your choice may place two +1/+1 counters on it.)
|
||||
this.addAbility(new TributeAbility(2));
|
||||
// When Pharagax Giant enters the battlefield, if tribute wasn't paid, Pharagax Giant deals 5 damage to each opponent.
|
||||
TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DamagePlayersEffect(5, TargetController.OPPONENT), false);
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public class EldraziDisplacer extends CardImpl {
|
|||
effect.setText("Exile another target creature");
|
||||
effect.setApplyEffectsAfter(); // Needed to let temporary continuous effects end if a permanent is blinked
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl<>("{2}{C}"));
|
||||
effect = new ReturnToBattlefieldUnderOwnerControlTargetEffect(true);
|
||||
effect = new ReturnToBattlefieldUnderOwnerControlTargetEffect(true, true);
|
||||
effect.setText(", then return it to the battlefield tapped under its owner's control");
|
||||
ability.addEffect(effect);
|
||||
ability.addTarget(new TargetCreaturePermanent(FILTER));
|
||||
|
|
|
|||
|
|
@ -29,12 +29,14 @@ package mage.sets.shadowsoverinnistrad;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DiesCreatureTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.delayed.AtTheBeginOfNextUpkeepDelayedTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.TransformSourceEffect;
|
||||
import mage.abilities.effects.common.TransformTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
|
||||
import mage.abilities.keyword.FlashAbility;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
|
|
@ -53,6 +55,8 @@ import mage.filter.predicate.Predicates;
|
|||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -124,10 +128,16 @@ class ArchangelAvacynEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
//create delayed triggered ability
|
||||
AtTheBeginOfNextUpkeepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(new TransformSourceEffect(true));
|
||||
game.addDelayedTriggeredAbility(delayedAbility, source);
|
||||
MageObject sourceObject = source.getSourceObjectIfItStillExists(game);
|
||||
if (sourceObject instanceof Permanent) {
|
||||
//create delayed triggered ability
|
||||
Effect effect = new TransformTargetEffect(false);
|
||||
effect.setTargetPointer(new FixedTarget((Permanent) sourceObject, game));
|
||||
AtTheBeginOfNextUpkeepDelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextUpkeepDelayedTriggeredAbility(effect);
|
||||
game.addDelayedTriggeredAbility(delayedAbility, source);
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue