diff --git a/Mage.Sets/src/mage/cards/p/PalanisHatcher.java b/Mage.Sets/src/mage/cards/p/PalanisHatcher.java new file mode 100644 index 00000000000..b7db3498c7c --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PalanisHatcher.java @@ -0,0 +1,75 @@ +package mage.cards.p; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfCombatTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; +import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.SacrificeControllerEffect; +import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; +import mage.constants.TargetController; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.game.permanent.token.DinosaurEggToken; +import mage.game.permanent.token.DinosaurVanillaToken; + +import java.util.UUID; + +/** + * @author Susucr + */ +public final class PalanisHatcher extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent(SubType.DINOSAUR, "Dinosaurs"); + private static final FilterControlledPermanent filterEgg = new FilterControlledPermanent(SubType.EGG, "egg"); + + public PalanisHatcher(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}{G}"); + + this.subtype.add(SubType.DINOSAUR); + this.power = new MageInt(5); + this.toughness = new MageInt(3); + + // Other Dinosaurs you control have haste. + this.addAbility(new SimpleStaticAbility( + new GainAbilityControlledEffect( + HasteAbility.getInstance(), + Duration.WhileOnBattlefield, + filter, true + ) + )); + + // When Palani's Hatcher enters the battlefield, create two 0/1 green Dinosaur Egg creature tokens. + this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new DinosaurEggToken(), 2))); + + // At the beginning of combat on your turn, if you control one or more Eggs, sacrifice an Egg, then create a 3/3 green Dinosaur creature token. + Ability ability = new ConditionalInterveningIfTriggeredAbility( + new BeginningOfCombatTriggeredAbility( + new SacrificeControllerEffect(filterEgg, 1, ""), + TargetController.YOU, false + ), new PermanentsOnTheBattlefieldCondition(filterEgg), + "At the beginning of combat on your turn, if you control one or more Eggs, " + + "sacrifice an Egg, then create a 3/3 green Dinosaur creature token." + ); + ability.addEffect(new CreateTokenEffect(new DinosaurVanillaToken())); + this.addAbility(ability); + } + + private PalanisHatcher(final PalanisHatcher card) { + super(card); + } + + @Override + public PalanisHatcher copy() { + return new PalanisHatcher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/TheLostCavernsOfIxalan.java b/Mage.Sets/src/mage/sets/TheLostCavernsOfIxalan.java index e16432bdc82..677151f1387 100644 --- a/Mage.Sets/src/mage/sets/TheLostCavernsOfIxalan.java +++ b/Mage.Sets/src/mage/sets/TheLostCavernsOfIxalan.java @@ -57,6 +57,7 @@ public final class TheLostCavernsOfIxalan extends ExpansionSet { cards.add(new SetCardInfo("Ojer Axonil, Deepest Might", 158, Rarity.MYTHIC, mage.cards.o.OjerAxonilDeepestMight.class)); cards.add(new SetCardInfo("Ojer Taq, Deepest Foundation", 26, Rarity.MYTHIC, mage.cards.o.OjerTaqDeepestFoundation.class)); cards.add(new SetCardInfo("Oltec Cloud Guard", 28, Rarity.COMMON, mage.cards.o.OltecCloudGuard.class)); + cards.add(new SetCardInfo("Palani's Hatcher", 237, Rarity.RARE, mage.cards.p.PalanisHatcher.class)); cards.add(new SetCardInfo("Plains", 393, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Poison Dart Frog", 207, Rarity.COMMON, mage.cards.p.PoisonDartFrog.class)); cards.add(new SetCardInfo("Rampaging Spiketail", 116, Rarity.COMMON, mage.cards.r.RampagingSpiketail.class)); diff --git a/Mage/src/main/java/mage/game/permanent/token/DinosaurEggToken.java b/Mage/src/main/java/mage/game/permanent/token/DinosaurEggToken.java new file mode 100644 index 00000000000..91934580541 --- /dev/null +++ b/Mage/src/main/java/mage/game/permanent/token/DinosaurEggToken.java @@ -0,0 +1,29 @@ +package mage.game.permanent.token; + +import mage.MageInt; +import mage.constants.CardType; +import mage.constants.SubType; + +/** + * @author Susucr + */ +public final class DinosaurEggToken extends TokenImpl { + + public DinosaurEggToken() { + super("Dinosaur Egg Token", "0/1 green Dinosaur Egg creature token"); + cardType.add(CardType.CREATURE); + subtype.add(SubType.DINOSAUR); + subtype.add(SubType.EGG); + color.setGreen(true); + power = new MageInt(0); + toughness = new MageInt(1); + } + + private DinosaurEggToken(final DinosaurEggToken token) { + super(token); + } + + public DinosaurEggToken copy() { + return new DinosaurEggToken(this); + } +}