diff --git a/Mage.Sets/src/mage/cards/c/CallerOfTheHunt.java b/Mage.Sets/src/mage/cards/c/CallerOfTheHunt.java index 6b2043d66e7..8d3be4ea5e3 100644 --- a/Mage.Sets/src/mage/cards/c/CallerOfTheHunt.java +++ b/Mage.Sets/src/mage/cards/c/CallerOfTheHunt.java @@ -104,7 +104,7 @@ enum CallerOfTheHuntAdjuster implements CostAdjuster { } else { // human choose // TODO: need early target cost instead dialog here - Effect effect = new ChooseCreatureTypeEffect(Outcome.Benefit); + Effect effect = new CallerOfTheHuntChooseEffect(Outcome.Benefit); effect.apply(game, ability); } typeChoice = (SubType) game.getState().getValue(sourceObject.getId() + "_type"); @@ -125,14 +125,14 @@ enum CallerOfTheHuntAdjuster implements CostAdjuster { } } -class ChooseCreatureTypeEffect extends OneShotEffect { +class CallerOfTheHuntChooseEffect extends OneShotEffect { - ChooseCreatureTypeEffect(Outcome outcome) { + CallerOfTheHuntChooseEffect(Outcome outcome) { super(outcome); staticText = "choose a creature type"; } - private ChooseCreatureTypeEffect(final ChooseCreatureTypeEffect effect) { + private CallerOfTheHuntChooseEffect(final CallerOfTheHuntChooseEffect effect) { super(effect); } @@ -156,7 +156,7 @@ class ChooseCreatureTypeEffect extends OneShotEffect { } @Override - public ChooseCreatureTypeEffect copy() { - return new ChooseCreatureTypeEffect(this); + public CallerOfTheHuntChooseEffect copy() { + return new CallerOfTheHuntChooseEffect(this); } } diff --git a/Mage.Sets/src/mage/cards/c/CollectiveInferno.java b/Mage.Sets/src/mage/cards/c/CollectiveInferno.java new file mode 100644 index 00000000000..916d7af645b --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CollectiveInferno.java @@ -0,0 +1,95 @@ +package mage.cards.c; + +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.common.ChooseCreatureTypeEffect; +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.constants.SubType; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.util.CardUtil; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class CollectiveInferno extends CardImpl { + + public CollectiveInferno(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}{R}"); + + // Convoke + this.addAbility(new ConvokeAbility()); + + // As this enchantment enters, choose a creature type. + this.addAbility(new SimpleStaticAbility(new ChooseCreatureTypeEffect(Outcome.Benefit))); + + // Double all damage that sources you control of the chosen type would deal. + this.addAbility(new SimpleStaticAbility(new CollectiveInfernoEffect())); + } + + private CollectiveInferno(final CollectiveInferno card) { + super(card); + } + + @Override + public CollectiveInferno copy() { + return new CollectiveInferno(this); + } +} + + +class CollectiveInfernoEffect extends ReplacementEffectImpl { + + CollectiveInfernoEffect() { + super(Duration.WhileOnBattlefield, Outcome.Damage); + staticText = "double all damage that sources you control of the chosen type would deal"; + } + + private CollectiveInfernoEffect(final CollectiveInfernoEffect effect) { + super(effect); + } + + @Override + public CollectiveInfernoEffect copy() { + return new CollectiveInfernoEffect(this); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + switch (event.getType()) { + case DAMAGE_PLAYER: + case DAMAGE_PERMANENT: + return true; + default: + return false; + } + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (!source.isControlledBy(game.getControllerId(event.getSourceId()))) { + return false; + } + SubType subType = ChooseCreatureTypeEffect.getChosenCreatureType(source.getSourceId(), game); + if (subType == null) { + return false; + } + MageObject mageObject = game.getObject(event.getSourceId()); + return mageObject != null && mageObject.hasSubtype(subType, game); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + event.setAmount(CardUtil.overflowMultiply(event.getAmount(), 2)); + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/LorwynEclipsed.java b/Mage.Sets/src/mage/sets/LorwynEclipsed.java index f4639bc3968..9c6feff1fed 100644 --- a/Mage.Sets/src/mage/sets/LorwynEclipsed.java +++ b/Mage.Sets/src/mage/sets/LorwynEclipsed.java @@ -99,6 +99,10 @@ public final class LorwynEclipsed extends ExpansionSet { cards.add(new SetCardInfo("Chronicle of Victory", 346, Rarity.MYTHIC, mage.cards.c.ChronicleOfVictory.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Cinder Strike", 131, Rarity.COMMON, mage.cards.c.CinderStrike.class)); cards.add(new SetCardInfo("Clachan Festival", 10, Rarity.UNCOMMON, mage.cards.c.ClachanFestival.class)); + cards.add(new SetCardInfo("Collective Inferno", 132, Rarity.RARE, mage.cards.c.CollectiveInferno.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Collective Inferno", 363, Rarity.RARE, mage.cards.c.CollectiveInferno.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Collective Inferno", 387, Rarity.MYTHIC, mage.cards.c.CollectiveInferno.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Collective Inferno", 397, Rarity.MYTHIC, mage.cards.c.CollectiveInferno.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Creakwood Safewright", 96, Rarity.UNCOMMON, mage.cards.c.CreakwoodSafewright.class)); cards.add(new SetCardInfo("Crib Swap", 11, Rarity.UNCOMMON, mage.cards.c.CribSwap.class)); cards.add(new SetCardInfo("Crossroads Watcher", 173, Rarity.COMMON, mage.cards.c.CrossroadsWatcher.class));