diff --git a/Mage.Sets/src/mage/cards/c/CityOnFire.java b/Mage.Sets/src/mage/cards/c/CityOnFire.java new file mode 100644 index 0000000000..b639ac841a --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CityOnFire.java @@ -0,0 +1,76 @@ +package mage.cards.c; + +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.keyword.ConvokeAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.util.CardUtil; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class CityOnFire extends CardImpl { + + public CityOnFire(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{5}{R}{R}{R}"); + + // Convoke + this.addAbility(new ConvokeAbility()); + + // If a source you control would deal damage to a permanent or player, it deals triple that damage instead. + this.addAbility(new SimpleStaticAbility(new CityOnFireEffect())); + } + + private CityOnFire(final CityOnFire card) { + super(card); + } + + @Override + public CityOnFire copy() { + return new CityOnFire(this); + } +} + +class CityOnFireEffect extends ReplacementEffectImpl { + + CityOnFireEffect() { + super(Duration.WhileOnBattlefield, Outcome.Damage); + staticText = "If a source you control would deal damage " + + "to a permanent or player, it deals triple that damage instead"; + } + + private CityOnFireEffect(final CityOnFireEffect effect) { + super(effect); + } + + @Override + public CityOnFireEffect copy() { + return new CityOnFireEffect(this); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER) + || event.getType().equals(GameEvent.EventType.DAMAGE_PERMANENT); + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + return game.getControllerId(event.getSourceId()).equals(source.getControllerId()); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + event.setAmount(CardUtil.overflowMultiply(event.getAmount(), 3)); + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/MarchOfTheMachine.java b/Mage.Sets/src/mage/sets/MarchOfTheMachine.java index de4bafdd52..c6f5fb893c 100644 --- a/Mage.Sets/src/mage/sets/MarchOfTheMachine.java +++ b/Mage.Sets/src/mage/sets/MarchOfTheMachine.java @@ -27,6 +27,7 @@ public final class MarchOfTheMachine extends ExpansionSet { cards.add(new SetCardInfo("Boon-Bringer Valkyrie", 9, Rarity.RARE, mage.cards.b.BoonBringerValkyrie.class)); cards.add(new SetCardInfo("Chandra, Hope's Beacon", 134, Rarity.MYTHIC, mage.cards.c.ChandraHopesBeacon.class)); cards.add(new SetCardInfo("Chrome Host Hulk", 188, Rarity.UNCOMMON, mage.cards.c.ChromeHostHulk.class)); + cards.add(new SetCardInfo("City on Fire", 135, Rarity.RARE, mage.cards.c.CityOnFire.class)); cards.add(new SetCardInfo("Cragsmasher Yeti", 333, Rarity.COMMON, mage.cards.c.CragsmasherYeti.class)); cards.add(new SetCardInfo("Deadly Derision", 99, Rarity.COMMON, mage.cards.d.DeadlyDerision.class)); cards.add(new SetCardInfo("Dismal Backwater", 269, Rarity.COMMON, mage.cards.d.DismalBackwater.class));