diff --git a/Mage.Sets/src/mage/cards/d/DinosaursOnASpaceship.java b/Mage.Sets/src/mage/cards/d/DinosaursOnASpaceship.java new file mode 100644 index 00000000000..39d86485a63 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DinosaursOnASpaceship.java @@ -0,0 +1,78 @@ +package mage.cards.d; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.CounterRemovedFromSourceWhileExiledTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.continuous.BoostControlledEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.SuspendAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.counters.CounterType; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.permanent.token.DinosaurFlyingHasteToken; + +import java.util.UUID; + +/** + * @author Susucr + */ +public final class DinosaursOnASpaceship extends CardImpl { + + // The +1/+1 effect wants a FilterCreaturePermanent + private static final FilterCreaturePermanent filterCreature = + new FilterCreaturePermanent(SubType.DINOSAUR, "Other Dinosaurs you control"); + private static final FilterControlledPermanent filter = + new FilterControlledPermanent(SubType.DINOSAUR, "Other Dinosaurs you control"); + + public DinosaursOnASpaceship(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}{W}"); + + this.subtype.add(SubType.DINOSAUR); + this.power = new MageInt(7); + this.toughness = new MageInt(7); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + + // Trample + this.addAbility(TrampleAbility.getInstance()); + + // Other Dinosaurs you control get +1/+1 and have vigilance and trample. + Effect effect = new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filterCreature, true); + Ability ability = new SimpleStaticAbility(effect.setText("Other Dinosaurs you control get +1/+1")); + effect = new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Duration.WhileOnBattlefield, filter, true); + ability.addEffect(effect.setText("and have vigilance")); + effect = new GainAbilityControlledEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield, filter, true); + ability.addEffect(effect.setText("and trample")); + this.addAbility(ability); + + // Suspend 4--{3}{R}{W} + this.addAbility(new SuspendAbility(4, new ManaCostsImpl<>("{3}{R}{W}"), this)); + + // Whenever a time counter is removed from Dinosaurs on a Spaceship while it's exiled, create a 2/2 red and white Dinosaur creature token with flying and haste. + this.addAbility(new CounterRemovedFromSourceWhileExiledTriggeredAbility( + CounterType.TIME, + new CreateTokenEffect(new DinosaurFlyingHasteToken()) + )); + } + + private DinosaursOnASpaceship(final DinosaursOnASpaceship card) { + super(card); + } + + @Override + public DinosaursOnASpaceship copy() { + return new DinosaursOnASpaceship(this); + } +} diff --git a/Mage.Sets/src/mage/sets/DoctorWho.java b/Mage.Sets/src/mage/sets/DoctorWho.java index 8c71a9a329a..f0c24d38811 100644 --- a/Mage.Sets/src/mage/sets/DoctorWho.java +++ b/Mage.Sets/src/mage/sets/DoctorWho.java @@ -67,6 +67,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("Dinosaurs on a Spaceship", 122, Rarity.RARE, mage.cards.d.DinosaursOnASpaceship.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)); diff --git a/Mage/src/main/java/mage/game/permanent/token/DinosaurFlyingHasteToken.java b/Mage/src/main/java/mage/game/permanent/token/DinosaurFlyingHasteToken.java new file mode 100644 index 00000000000..91bf958bf7f --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/DinosaurFlyingHasteToken.java @@ -0,0 +1,34 @@ +package mage.game.permanent.token; + +import mage.MageInt; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.HasteAbility; +import mage.constants.CardType; +import mage.constants.SubType; + +/** + * @author Susucr + */ +public final class DinosaurFlyingHasteToken extends TokenImpl { + + public DinosaurFlyingHasteToken() { + super("Dinosaur Token", "2/2 red and white Dinosaur creature token with flying and haste"); + cardType.add(CardType.CREATURE); + color.setRed(true); + color.setWhite(true); + subtype.add(SubType.DINOSAUR); + power = new MageInt(2); + toughness = new MageInt(2); + + addAbility(FlyingAbility.getInstance()); + addAbility(HasteAbility.getInstance()); + } + + private DinosaurFlyingHasteToken(final DinosaurFlyingHasteToken token) { + super(token); + } + + public DinosaurFlyingHasteToken copy() { + return new DinosaurFlyingHasteToken(this); + } +}