diff --git a/Mage.Sets/src/mage/cards/d/DisplacedDinosaurs.java b/Mage.Sets/src/mage/cards/d/DisplacedDinosaurs.java new file mode 100644 index 00000000000..f2cfdaf5300 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DisplacedDinosaurs.java @@ -0,0 +1,99 @@ +package mage.cards.d; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.common.continuous.AddCardSubTypeTargetEffect; +import mage.abilities.effects.common.continuous.AddCardTypeTargetEffect; +import mage.abilities.effects.common.continuous.SetBasePowerToughnessTargetEffect; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; +import mage.target.targetpointer.TargetPointer; + +/** + * + * @author Grath + */ +public final class DisplacedDinosaurs extends CardImpl { + + public DisplacedDinosaurs(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{G}{G}"); + + this.subtype.add(SubType.DINOSAUR); + this.power = new MageInt(7); + this.toughness = new MageInt(7); + + // As a historic permanent enters the battlefield under your control, it becomes a 7/7 Dinosaur creature in + // addition to its other types. + this.addAbility(new SimpleStaticAbility(new DisplacedDinosaursEntersBattlefieldEffect())); + } + + private DisplacedDinosaurs(final DisplacedDinosaurs card) { + super(card); + } + + @Override + public DisplacedDinosaurs copy() { + return new DisplacedDinosaurs(this); + } +} + +class DisplacedDinosaursEntersBattlefieldEffect extends ReplacementEffectImpl { + + DisplacedDinosaursEntersBattlefieldEffect() { + super(Duration.WhileOnBattlefield, Outcome.BoostCreature); + staticText = "As a historic permanent enters the battlefield under your control, it becomes a 7/7 Dinosaur creature in addition to its other types. (Artifacts, legendaries, and Sagas are historic.)"; + } + + private DisplacedDinosaursEntersBattlefieldEffect(mage.cards.d.DisplacedDinosaursEntersBattlefieldEffect effect) { + super(effect); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + Permanent historic = ((EntersTheBattlefieldEvent) event).getTarget(); + return historic != null && historic.isControlledBy(source.getControllerId()) + && historic.isHistoric(game) + && !event.getTargetId().equals(source.getSourceId()); + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + Permanent historic = ((EntersTheBattlefieldEvent) event).getTarget(); + if (historic != null) { + TargetPointer historicTarget = new FixedTarget(historic.getId(), historic.getZoneChangeCounter(game) + 1); + ContinuousEffect creatureEffect = new AddCardTypeTargetEffect(Duration.Custom, CardType.CREATURE); + creatureEffect.setTargetPointer(historicTarget); + game.addEffect(creatureEffect, source); + ContinuousEffect dinosaurEffect = new AddCardSubTypeTargetEffect(SubType.DINOSAUR, Duration.Custom); + dinosaurEffect.setTargetPointer(historicTarget); + game.addEffect(dinosaurEffect, source); + ContinuousEffect sevenSevenEffect = new SetBasePowerToughnessTargetEffect(7, 7, Duration.Custom); + sevenSevenEffect.setTargetPointer(historicTarget); + game.addEffect(sevenSevenEffect, source); + } + return false; + } + + @Override + public mage.cards.d.DisplacedDinosaursEntersBattlefieldEffect copy() { + return new mage.cards.d.DisplacedDinosaursEntersBattlefieldEffect(this); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/DoctorWho.java b/Mage.Sets/src/mage/sets/DoctorWho.java index f8210589ffc..764b7402e83 100644 --- a/Mage.Sets/src/mage/sets/DoctorWho.java +++ b/Mage.Sets/src/mage/sets/DoctorWho.java @@ -51,6 +51,7 @@ public final class DoctorWho extends ExpansionSet { cards.add(new SetCardInfo("Delete", 81, Rarity.RARE, mage.cards.d.Delete.class)); cards.add(new SetCardInfo("Deserted Beach", 270, Rarity.RARE, mage.cards.d.DesertedBeach.class)); cards.add(new SetCardInfo("Desolate Lighthouse", 271, Rarity.RARE, mage.cards.d.DesolateLighthouse.class)); + cards.add(new SetCardInfo("Displaced Dinosaurs", 100, Rarity.UNCOMMON, mage.cards.d.DisplacedDinosaurs.class)); cards.add(new SetCardInfo("Dragonskull Summit", 272, Rarity.RARE, mage.cards.d.DragonskullSummit.class)); cards.add(new SetCardInfo("Dreamroot Cascade", 273, Rarity.RARE, mage.cards.d.DreamrootCascade.class)); cards.add(new SetCardInfo("Drowned Catacomb", 274, Rarity.RARE, mage.cards.d.DrownedCatacomb.class));