mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 10:40:06 -08:00
[ACR] Fix Ezio Auditore da Firenze to use the right triggers.
This commit is contained in:
parent
7c29b76a96
commit
09c000075a
1 changed files with 35 additions and 7 deletions
|
|
@ -5,9 +5,11 @@ import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
|
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
|
import mage.abilities.common.delayed.ReflexiveTriggeredAbility;
|
||||||
import mage.abilities.condition.Condition;
|
import mage.abilities.condition.Condition;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||||
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.DoIfCostPaid;
|
import mage.abilities.effects.common.DoIfCostPaid;
|
||||||
import mage.abilities.effects.common.LoseGameTargetPlayerEffect;
|
import mage.abilities.effects.common.LoseGameTargetPlayerEffect;
|
||||||
import mage.abilities.effects.common.continuous.GainAbilityControlledSpellsEffect;
|
import mage.abilities.effects.common.continuous.GainAbilityControlledSpellsEffect;
|
||||||
|
|
@ -19,6 +21,8 @@ import mage.cards.CardSetInfo;
|
||||||
import mage.filter.common.FilterNonlandCard;
|
import mage.filter.common.FilterNonlandCard;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
|
import mage.target.Target;
|
||||||
|
import mage.target.TargetPlayer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -48,12 +52,10 @@ public final class EzioAuditoreDaFirenze extends CardImpl {
|
||||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledSpellsEffect(new FreerunningAbility("{B}{B}"), filter)));
|
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledSpellsEffect(new FreerunningAbility("{B}{B}"), filter)));
|
||||||
// Whenever Ezio deals combat damage to a player, you may pay {W}{U}{B}{R}{G} if that player has 10 or less life. When you do, that player loses the game.
|
// Whenever Ezio deals combat damage to a player, you may pay {W}{U}{B}{R}{G} if that player has 10 or less life. When you do, that player loses the game.
|
||||||
this.addAbility(
|
this.addAbility(
|
||||||
new ConditionalTriggeredAbility(
|
|
||||||
new DealsCombatDamageToAPlayerTriggeredAbility(
|
new DealsCombatDamageToAPlayerTriggeredAbility(
|
||||||
new DoIfCostPaid(
|
new ConditionalOneShotEffect(new DoIfCostPaid(
|
||||||
new LoseGameTargetPlayerEffect(),new ManaCostsImpl<>("{W}{U}{B}{R}{G}")
|
new EzioAuditoreDaFirenzeCreateReflexiveTriggerEffect(), new ManaCostsImpl<>("{W}{U}{B}{R}{G}")
|
||||||
), false, true
|
), EzioAuditoreDaFirenzeCondition.instance, "you may pay {W}{U}{B}{R}{G} if that player has 10 or less life. When you do, that player loses the game."), false, true
|
||||||
), EzioAuditoreDaFirenzeCondition.instance, "Whenever {this} deals combat damage to a player, you may pay {W}{U}{B}{R}{G} if that player has 10 or less life. When you do, that player loses the game."
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -83,3 +85,29 @@ enum EzioAuditoreDaFirenzeCondition implements Condition {
|
||||||
return player != null && player.getLife() <= 10;
|
return player != null && player.getLife() <= 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class EzioAuditoreDaFirenzeCreateReflexiveTriggerEffect extends OneShotEffect {
|
||||||
|
EzioAuditoreDaFirenzeCreateReflexiveTriggerEffect() {
|
||||||
|
super(Outcome.Benefit);
|
||||||
|
staticText = "When you do, that player loses the game.";
|
||||||
|
}
|
||||||
|
|
||||||
|
private EzioAuditoreDaFirenzeCreateReflexiveTriggerEffect(final EzioAuditoreDaFirenzeCreateReflexiveTriggerEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public EzioAuditoreDaFirenzeCreateReflexiveTriggerEffect copy() {
|
||||||
|
return new EzioAuditoreDaFirenzeCreateReflexiveTriggerEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(new LoseGameTargetPlayerEffect(), false, "When you do, that player loses the game");
|
||||||
|
Target target = new TargetPlayer();
|
||||||
|
target.addTarget(getTargetPointer().getFirst(game, source), source, game);
|
||||||
|
ability.addTarget(target);
|
||||||
|
game.fireReflexiveTriggeredAbility(ability, source);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue