diff --git a/Mage.Sets/src/mage/cards/c/CanoptekTombSentinel.java b/Mage.Sets/src/mage/cards/c/CanoptekTombSentinel.java new file mode 100644 index 0000000000..7815e8ab91 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CanoptekTombSentinel.java @@ -0,0 +1,50 @@ +package mage.cards.c; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldFromGraveyardTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.keyword.UnearthAbility; +import mage.abilities.keyword.VigilanceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.target.common.TargetNonlandPermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class CanoptekTombSentinel extends CardImpl { + + public CanoptekTombSentinel(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}"); + + this.subtype.add(SubType.INSECT); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // Vigilance + this.addAbility(VigilanceAbility.getInstance()); + + // Exile Cannon -- When Canoptek Tomb Sentinel enters the battlefield from a graveyard, exile up to one target nonland permanent. + Ability ability = new EntersBattlefieldFromGraveyardTriggeredAbility(new ExileTargetEffect()); + ability.addTarget(new TargetNonlandPermanent(0, 1)); + this.addAbility(ability.withFlavorWord("Exile Cannon")); + + // Unearth {7} + this.addAbility(new UnearthAbility(new ManaCostsImpl<>("{7}"))); + } + + private CanoptekTombSentinel(final CanoptekTombSentinel card) { + super(card); + } + + @Override + public CanoptekTombSentinel copy() { + return new CanoptekTombSentinel(this); + } +} diff --git a/Mage.Sets/src/mage/cards/t/TreacherousPitDweller.java b/Mage.Sets/src/mage/cards/t/TreacherousPitDweller.java index 92e9861a1b..7725268071 100644 --- a/Mage.Sets/src/mage/cards/t/TreacherousPitDweller.java +++ b/Mage.Sets/src/mage/cards/t/TreacherousPitDweller.java @@ -1,23 +1,21 @@ - package mage.cards.t; -import java.util.UUID; import mage.MageInt; import mage.MageObject; import mage.abilities.Ability; -import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.EntersBattlefieldFromGraveyardTriggeredAbility; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.keyword.UndyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.*; import mage.game.Game; -import mage.game.events.EntersTheBattlefieldEvent; -import mage.game.events.GameEvent; import mage.game.permanent.Permanent; import mage.players.Player; import mage.target.common.TargetOpponent; +import java.util.UUID; + /** * @author noxx */ @@ -34,7 +32,9 @@ public final class TreacherousPitDweller extends CardImpl { this.addAbility(new UndyingAbility()); // When Treacherous Pit-Dweller enters the battlefield from a graveyard, target opponent gains control of it. - this.addAbility(new TreacherousPitDwellerTriggeredAbility()); + Ability ability = new EntersBattlefieldFromGraveyardTriggeredAbility(new TreacherousPitDwellerEffect()); + ability.addTarget(new TargetOpponent()); + this.addAbility(ability); } private TreacherousPitDweller(final TreacherousPitDweller card) { @@ -47,34 +47,6 @@ public final class TreacherousPitDweller extends CardImpl { } } -class TreacherousPitDwellerTriggeredAbility extends TriggeredAbilityImpl { - - public TreacherousPitDwellerTriggeredAbility() { - super(Zone.BATTLEFIELD, new TreacherousPitDwellerEffect(), false); - addTarget(new TargetOpponent()); - setTriggerPhrase("When {this} enters the battlefield from a graveyard, "); - } - - public TreacherousPitDwellerTriggeredAbility(final TreacherousPitDwellerTriggeredAbility ability) { - super(ability); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - return event.getTargetId().equals(getSourceId()) && ((EntersTheBattlefieldEvent) event).getFromZone() == Zone.GRAVEYARD; - } - - @Override - public TreacherousPitDwellerTriggeredAbility copy() { - return new TreacherousPitDwellerTriggeredAbility(this); - } -} - class TreacherousPitDwellerEffect extends ContinuousEffectImpl { public TreacherousPitDwellerEffect() { diff --git a/Mage.Sets/src/mage/sets/Warhammer40000.java b/Mage.Sets/src/mage/sets/Warhammer40000.java index b77babc3f4..f4d68cebc0 100644 --- a/Mage.Sets/src/mage/sets/Warhammer40000.java +++ b/Mage.Sets/src/mage/sets/Warhammer40000.java @@ -55,6 +55,7 @@ public final class Warhammer40000 extends ExpansionSet { cards.add(new SetCardInfo("Caged Sun", 231, Rarity.RARE, mage.cards.c.CagedSun.class)); cards.add(new SetCardInfo("Canoptek Scarab Swarm", 150, Rarity.RARE, mage.cards.c.CanoptekScarabSwarm.class)); cards.add(new SetCardInfo("Canoptek Spyder", 151, Rarity.RARE, mage.cards.c.CanoptekSpyder.class)); + cards.add(new SetCardInfo("Canoptek Tomb Sentinel", 152, Rarity.RARE, mage.cards.c.CanoptekTombSentinel.class)); cards.add(new SetCardInfo("Cave of Temptation", 267, Rarity.COMMON, mage.cards.c.CaveOfTemptation.class)); cards.add(new SetCardInfo("Chaos Defiler", 110, Rarity.RARE, mage.cards.c.ChaosDefiler.class)); cards.add(new SetCardInfo("Chaos Warp", 205, Rarity.RARE, mage.cards.c.ChaosWarp.class)); diff --git a/Mage/src/main/java/mage/abilities/common/EntersBattlefieldFromGraveyardTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/EntersBattlefieldFromGraveyardTriggeredAbility.java new file mode 100644 index 0000000000..f46363d173 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/common/EntersBattlefieldFromGraveyardTriggeredAbility.java @@ -0,0 +1,39 @@ +package mage.abilities.common; + +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.EntersTheBattlefieldEvent; +import mage.game.events.GameEvent; + +/** + * @author TheElk801 + */ +public class EntersBattlefieldFromGraveyardTriggeredAbility extends TriggeredAbilityImpl { + + public EntersBattlefieldFromGraveyardTriggeredAbility(Effect effect) { + super(Zone.BATTLEFIELD, effect, false); + setTriggerPhrase("When {this} enters the battlefield from a graveyard, "); + } + + public EntersBattlefieldFromGraveyardTriggeredAbility(final EntersBattlefieldFromGraveyardTriggeredAbility ability) { + super(ability); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return event.getTargetId().equals(getSourceId()) + && ((EntersTheBattlefieldEvent) event).getFromZone() == Zone.GRAVEYARD; + } + + @Override + public EntersBattlefieldFromGraveyardTriggeredAbility copy() { + return new EntersBattlefieldFromGraveyardTriggeredAbility(this); + } +}