diff --git a/Mage.Sets/src/mage/cards/i/IsshinTwoHeavensAsOne.java b/Mage.Sets/src/mage/cards/i/IsshinTwoHeavensAsOne.java new file mode 100644 index 0000000000..1475e50fd3 --- /dev/null +++ b/Mage.Sets/src/mage/cards/i/IsshinTwoHeavensAsOne.java @@ -0,0 +1,89 @@ +package mage.cards.i; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.NumberOfTriggersEvent; +import mage.game.permanent.Permanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class IsshinTwoHeavensAsOne extends CardImpl { + + public IsshinTwoHeavensAsOne(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}{W}{B}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.SAMURAI); + this.power = new MageInt(3); + this.toughness = new MageInt(4); + + // If a creature attacking causes a triggered ability of a permanent you control to trigger, that ability triggers an additional time. + this.addAbility(new SimpleStaticAbility(new IsshinTwoHeavensAsOneEffect())); + } + + private IsshinTwoHeavensAsOne(final IsshinTwoHeavensAsOne card) { + super(card); + } + + @Override + public IsshinTwoHeavensAsOne copy() { + return new IsshinTwoHeavensAsOne(this); + } +} + +class IsshinTwoHeavensAsOneEffect extends ReplacementEffectImpl { + + IsshinTwoHeavensAsOneEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "if a creature attacking causes a triggered ability " + + "of a permanent you control to trigger, that ability triggers an additional time"; + } + + IsshinTwoHeavensAsOneEffect(final IsshinTwoHeavensAsOneEffect effect) { + super(effect); + } + + @Override + public IsshinTwoHeavensAsOneEffect copy() { + return new IsshinTwoHeavensAsOneEffect(this); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.NUMBER_OF_TRIGGERS; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + NumberOfTriggersEvent numberOfTriggersEvent = (NumberOfTriggersEvent) event; + Permanent sourcePermanent = game.getPermanent(numberOfTriggersEvent.getSourceId()); + if (sourcePermanent == null || !sourcePermanent.isControlledBy(source.getControllerId())) { + return false; + } + GameEvent sourceEvent = numberOfTriggersEvent.getSourceEvent(); + switch (sourceEvent.getType()) { + case ATTACKER_DECLARED: + case DECLARED_ATTACKERS: + case DEFENDER_ATTACKED: + return true; + } + return false; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + event.setAmount(event.getAmount() + 1); + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java index 962d861472..487adb233f 100644 --- a/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java +++ b/Mage.Sets/src/mage/sets/KamigawaNeonDynasty.java @@ -85,6 +85,7 @@ public final class KamigawaNeonDynasty extends ExpansionSet { cards.add(new SetCardInfo("Inkrise Infiltrator", 100, Rarity.COMMON, mage.cards.i.InkriseInfiltrator.class)); cards.add(new SetCardInfo("Invoke the Winds", 58, Rarity.RARE, mage.cards.i.InvokeTheWinds.class)); cards.add(new SetCardInfo("Island", 285, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Isshin, Two Heavens as One", 224, Rarity.RARE, mage.cards.i.IsshinTwoHeavensAsOne.class)); cards.add(new SetCardInfo("Jukai Naturalist", 225, Rarity.UNCOMMON, mage.cards.j.JukaiNaturalist.class)); cards.add(new SetCardInfo("Junji, the Midnight Sky", 102, Rarity.MYTHIC, mage.cards.j.JunjiTheMidnightSky.class)); cards.add(new SetCardInfo("Kairi, the Swirling Sky", 60, Rarity.MYTHIC, mage.cards.k.KairiTheSwirlingSky.class));