From 0670c401e0b2d9d699f3d60eaeb819102674755d Mon Sep 17 00:00:00 2001 From: Oleg Agafonov Date: Sat, 5 Jan 2019 01:35:58 +0400 Subject: [PATCH] * Fixed Brood Of Cockroaches text --- .../src/mage/cards/b/BroodOfCockroaches.java | 2 +- Mage.Sets/src/mage/cards/c/Cessation.java | 18 ++++++--------- Mage.Sets/src/mage/cards/c/ChimeOfNight.java | 12 +++++----- Mage.Sets/src/mage/cards/c/CyclopeanTomb.java | 15 ++++++------ .../src/mage/cards/d/DunesOfTheDead.java | 10 ++++---- .../src/mage/cards/f/FlagstonesOfTrokair.java | 7 +++--- Mage.Sets/src/mage/cards/g/GoblinBoomKeg.java | 10 ++++---- .../mage/cards/g/GodsEyeGateToTheReikai.java | 11 +++++---- Mage.Sets/src/mage/cards/h/HatchingPlans.java | 13 +++++------ Mage.Sets/src/mage/cards/l/Launch.java | 16 +++++-------- Mage.Sets/src/mage/cards/l/Liability.java | 12 ++++------ Mage.Sets/src/mage/cards/m/Mortuary.java | 9 ++++---- .../mage/cards/o/OathkeeperTakenosDaisho.java | 23 ++++++++++--------- .../src/mage/cards/p/PanicSpellbomb.java | 9 ++++---- Mage.Sets/src/mage/cards/r/Ringskipper.java | 11 ++++----- .../src/mage/cards/s/SoulcatchersAerie.java | 14 +++++------ Mage.Sets/src/mage/cards/t/Terrarion.java | 11 +++++---- .../single/vis/BroodOfCockroachesTest.java | 2 -- ...FromBattlefieldSourceTriggeredAbility.java | 12 ++++++---- 19 files changed, 103 insertions(+), 114 deletions(-) diff --git a/Mage.Sets/src/mage/cards/b/BroodOfCockroaches.java b/Mage.Sets/src/mage/cards/b/BroodOfCockroaches.java index cb7d25fffe5..0c5eb3c818b 100644 --- a/Mage.Sets/src/mage/cards/b/BroodOfCockroaches.java +++ b/Mage.Sets/src/mage/cards/b/BroodOfCockroaches.java @@ -51,7 +51,7 @@ public final class BroodOfCockroaches extends CardImpl { } class BroodOfCockroachesEffect extends OneShotEffect { - private static final String effectText = "at the beginning of the next end step, you lose 1 life and return Brood of Cockroaches to your hand."; + private static final String effectText = "at the beginning of the next end step, you lose 1 life and return {this} to your hand."; BroodOfCockroachesEffect() { super(Benefit); diff --git a/Mage.Sets/src/mage/cards/c/Cessation.java b/Mage.Sets/src/mage/cards/c/Cessation.java index 1407222dcf6..c06f089f7c7 100644 --- a/Mage.Sets/src/mage/cards/c/Cessation.java +++ b/Mage.Sets/src/mage/cards/c/Cessation.java @@ -1,7 +1,5 @@ - package mage.cards.c; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.PutIntoGraveFromBattlefieldSourceTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; @@ -11,33 +9,31 @@ import mage.abilities.effects.common.combat.CantAttackAttachedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.AttachmentType; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.Outcome; -import mage.constants.Zone; +import mage.constants.*; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; +import java.util.UUID; + /** - * * @author Backfir3 */ public final class Cessation extends CardImpl { public Cessation(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); this.subtype.add(SubType.AURA); - //Enchant creature TargetPermanent auraTarget = new TargetCreaturePermanent(); this.getSpellAbility().addTarget(auraTarget); - this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment)); Ability ability = new EnchantAbility(auraTarget.getTargetName()); this.addAbility(ability); + //Enchanted creature can't attack. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackAttachedEffect(AttachmentType.AURA))); + //When Cessation is put into a graveyard from the battlefield, return Cessation to its owner's hand. this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new ReturnToHandSourceEffect())); } diff --git a/Mage.Sets/src/mage/cards/c/ChimeOfNight.java b/Mage.Sets/src/mage/cards/c/ChimeOfNight.java index 5f3a207f0b7..60ae0c61488 100644 --- a/Mage.Sets/src/mage/cards/c/ChimeOfNight.java +++ b/Mage.Sets/src/mage/cards/c/ChimeOfNight.java @@ -1,25 +1,25 @@ package mage.cards.c; -import java.util.UUID; import mage.ObjectColor; -import mage.target.common.TargetCreaturePermanent; import mage.abilities.Ability; import mage.abilities.common.PutIntoGraveFromBattlefieldSourceTriggeredAbility; import mage.abilities.effects.common.AttachEffect; import mage.abilities.effects.common.DestroyTargetEffect; -import mage.constants.Outcome; -import mage.target.TargetPermanent; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.constants.Outcome; import mage.constants.SubType; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; /** - * * @author TheElk801 */ public final class ChimeOfNight extends CardImpl { @@ -43,7 +43,7 @@ public final class ChimeOfNight extends CardImpl { this.addAbility(ability); // When Chime of Night is put into a graveyard from the battlefield, destroy target nonblack creature. - ability = new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new DestroyTargetEffect(), false); + ability = new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new DestroyTargetEffect()); ability.addTarget(new TargetPermanent(filter)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/c/CyclopeanTomb.java b/Mage.Sets/src/mage/cards/c/CyclopeanTomb.java index b37803bd255..2095015f463 100644 --- a/Mage.Sets/src/mage/cards/c/CyclopeanTomb.java +++ b/Mage.Sets/src/mage/cards/c/CyclopeanTomb.java @@ -1,9 +1,5 @@ package mage.cards.c; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Set; -import java.util.UUID; import mage.MageObjectReference; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; @@ -34,8 +30,12 @@ import mage.target.common.TargetLandPermanent; import mage.target.targetpointer.FixedTarget; import mage.watchers.Watcher; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; + /** - * * @author MTGfan */ public final class CyclopeanTomb extends CardImpl { @@ -55,6 +55,7 @@ public final class CyclopeanTomb extends CardImpl { ability.addTarget(new TargetLandPermanent(filter)); ability.addEffect(new BecomeSwampEffect(Duration.Custom, false, true, SubType.SWAMP)); this.addAbility(ability, new CyclopeanTombCounterWatcher()); + // When Cyclopean Tomb is put into a graveyard from the battlefield, at the beginning of each of your upkeeps for the rest of the game, remove all mire counters from a land that a mire counter was put onto with Cyclopean Tomb but that a mire counter has not been removed from with Cyclopean Tomb. this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new CyclopeanTombCreateTriggeredEffect())); } @@ -168,8 +169,8 @@ class CyclopeanTombEffect extends OneShotEffect { filter.add(Predicates.or(idPref)); TargetLandPermanent target = new TargetLandPermanent(1, 1, filter, true); /*Player must choose a land each upkeep. Using the message are above the player hand where frequent interactions - * take place is the most logical way to prompt for this scenario. A new constructor added to provide a not optional - * option for any cards like this where the player must choose a target in such the way this card requires. + * take place is the most logical way to prompt for this scenario. A new constructor added to provide a not optional + * option for any cards like this where the player must choose a target in such the way this card requires. */ if (controller.chooseTarget(Outcome.Neutral, target, source, game)) { Permanent chosenLand = game.getPermanent(target.getFirstTarget()); diff --git a/Mage.Sets/src/mage/cards/d/DunesOfTheDead.java b/Mage.Sets/src/mage/cards/d/DunesOfTheDead.java index 26117bd3dfc..51aa92f4616 100644 --- a/Mage.Sets/src/mage/cards/d/DunesOfTheDead.java +++ b/Mage.Sets/src/mage/cards/d/DunesOfTheDead.java @@ -1,7 +1,5 @@ - package mage.cards.d; -import java.util.UUID; import mage.abilities.common.PutIntoGraveFromBattlefieldSourceTriggeredAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.mana.ColorlessManaAbility; @@ -11,21 +9,23 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.game.permanent.token.ZombieToken; +import java.util.UUID; + /** - * * @author ciaccona007 */ public final class DunesOfTheDead extends CardImpl { public DunesOfTheDead(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); - + this.subtype.add(SubType.DESERT); // {T}: Add {C}. addAbility(new ColorlessManaAbility()); + // When Dunes of the Dead is put into a graveyard from the battlefield, create a 2/2 black Zombie creature token. - this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new CreateTokenEffect(new ZombieToken(), 1), false)); + this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new CreateTokenEffect(new ZombieToken(), 1))); } public DunesOfTheDead(final DunesOfTheDead card) { diff --git a/Mage.Sets/src/mage/cards/f/FlagstonesOfTrokair.java b/Mage.Sets/src/mage/cards/f/FlagstonesOfTrokair.java index 674adbeb784..522d33e1176 100644 --- a/Mage.Sets/src/mage/cards/f/FlagstonesOfTrokair.java +++ b/Mage.Sets/src/mage/cards/f/FlagstonesOfTrokair.java @@ -1,7 +1,5 @@ - package mage.cards.f; -import java.util.UUID; import mage.abilities.common.PutIntoGraveFromBattlefieldSourceTriggeredAbility; import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; import mage.abilities.mana.WhiteManaAbility; @@ -14,8 +12,9 @@ import mage.filter.common.FilterLandCard; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.target.common.TargetCardInLibrary; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class FlagstonesOfTrokair extends CardImpl { @@ -34,7 +33,7 @@ public final class FlagstonesOfTrokair extends CardImpl { this.addAbility(new WhiteManaAbility()); // When Flagstones of Trokair is put into a graveyard from the battlefield, you may search your library for a Plains card and put it onto the battlefield tapped. If you do, shuffle your library. - this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(FILTER), true, false), true)); + this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(FILTER), true, false), true, false)); } public FlagstonesOfTrokair(final FlagstonesOfTrokair card) { diff --git a/Mage.Sets/src/mage/cards/g/GoblinBoomKeg.java b/Mage.Sets/src/mage/cards/g/GoblinBoomKeg.java index 14007b84d9f..25eece23e9b 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinBoomKeg.java +++ b/Mage.Sets/src/mage/cards/g/GoblinBoomKeg.java @@ -1,11 +1,8 @@ - package mage.cards.g; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.PutIntoGraveFromBattlefieldSourceTriggeredAbility; -import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.SacrificeSourceEffect; import mage.cards.CardImpl; @@ -14,20 +11,21 @@ import mage.constants.CardType; import mage.constants.TargetController; import mage.target.common.TargetAnyTarget; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class GoblinBoomKeg extends CardImpl { public GoblinBoomKeg(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{4}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}"); // At the beginning of your upkeep, sacrifice Goblin Boom Keg. this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceEffect(), TargetController.YOU, false)); // When Goblin Boom Keg is put into a graveyard from the battlefield, it deals 3 damage to any target. - Ability ability = new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new DamageTargetEffect(3, "it"), false); + Ability ability = new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new DamageTargetEffect(3, "it")); ability.addTarget(new TargetAnyTarget()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/g/GodsEyeGateToTheReikai.java b/Mage.Sets/src/mage/cards/g/GodsEyeGateToTheReikai.java index 675f616ec23..52055a07e13 100644 --- a/Mage.Sets/src/mage/cards/g/GodsEyeGateToTheReikai.java +++ b/Mage.Sets/src/mage/cards/g/GodsEyeGateToTheReikai.java @@ -1,7 +1,5 @@ - package mage.cards.g; -import java.util.UUID; import mage.abilities.common.PutIntoGraveFromBattlefieldSourceTriggeredAbility; import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.mana.ColorlessManaAbility; @@ -11,19 +9,22 @@ import mage.constants.CardType; import mage.constants.SuperType; import mage.game.permanent.token.SpiritToken; +import java.util.UUID; + /** - * * @author Loki */ public final class GodsEyeGateToTheReikai extends CardImpl { public GodsEyeGateToTheReikai(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.LAND},""); + super(ownerId, setInfo, new CardType[]{CardType.LAND}, ""); addSuperType(SuperType.LEGENDARY); + // {tap}: Add {C}. this.addAbility(new ColorlessManaAbility()); + // When Gods' Eye, Gate to the Reikai is put into a graveyard from the battlefield, create a 1/1 colorless Spirit creature token. - this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new CreateTokenEffect(new SpiritToken(), 1), false)); + this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new CreateTokenEffect(new SpiritToken(), 1))); } public GodsEyeGateToTheReikai(final GodsEyeGateToTheReikai card) { diff --git a/Mage.Sets/src/mage/cards/h/HatchingPlans.java b/Mage.Sets/src/mage/cards/h/HatchingPlans.java index 586b5f0db62..ce66f5a1312 100644 --- a/Mage.Sets/src/mage/cards/h/HatchingPlans.java +++ b/Mage.Sets/src/mage/cards/h/HatchingPlans.java @@ -1,27 +1,26 @@ - - package mage.cards.h; -import java.util.UUID; import mage.abilities.common.PutIntoGraveFromBattlefieldSourceTriggeredAbility; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import java.util.UUID; + /** - * * @author Loki */ public final class HatchingPlans extends CardImpl { - public HatchingPlans (UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{U}"); + public HatchingPlans(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); + // When Hatching Plans is put into a graveyard from the battlefield, draw three cards. this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new DrawCardSourceControllerEffect(3))); } - public HatchingPlans (final HatchingPlans card) { + public HatchingPlans(final HatchingPlans card) { super(card); } diff --git a/Mage.Sets/src/mage/cards/l/Launch.java b/Mage.Sets/src/mage/cards/l/Launch.java index 9c3c984cd9d..3e0518ed3d2 100644 --- a/Mage.Sets/src/mage/cards/l/Launch.java +++ b/Mage.Sets/src/mage/cards/l/Launch.java @@ -1,7 +1,5 @@ - package mage.cards.l; -import java.util.UUID; import mage.abilities.common.PutIntoGraveFromBattlefieldSourceTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.AttachEffect; @@ -11,22 +9,18 @@ import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.AttachmentType; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Zone; +import mage.constants.*; import mage.target.common.TargetCreaturePermanent; +import java.util.UUID; + /** - * * @author Derpthemeus */ public final class Launch extends CardImpl { public Launch(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); this.subtype.add(SubType.AURA); // Enchant creature @@ -34,8 +28,10 @@ public final class Launch extends CardImpl { this.getSpellAbility().addTarget(auraTarget); this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); this.addAbility(new EnchantAbility(auraTarget.getTargetName())); + // Enchanted creature has flying. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA, Duration.WhileOnBattlefield))); + // When Launch is put into a graveyard from the battlefield, return Launch to its owner's hand. this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new ReturnToHandSourceEffect())); diff --git a/Mage.Sets/src/mage/cards/l/Liability.java b/Mage.Sets/src/mage/cards/l/Liability.java index 6973291332c..985cf2fc57e 100644 --- a/Mage.Sets/src/mage/cards/l/Liability.java +++ b/Mage.Sets/src/mage/cards/l/Liability.java @@ -1,11 +1,8 @@ - package mage.cards.l; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.PutIntoGraveFromBattlefieldAllTriggeredAbility; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; @@ -18,20 +15,21 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import java.util.UUID; + /** - * * @author L_J */ public final class Liability extends CardImpl { private static final FilterPermanent filter = new FilterPermanent("a nontoken permanent"); - + static { filter.add(Predicates.not(new TokenPredicate())); } - + public Liability(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{B}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}{B}"); // Whenever a nontoken permanent is put into a player's graveyard from the battlefield, that player loses 1 life. this.addAbility(new PutIntoGraveFromBattlefieldAllTriggeredAbility(new LiabilityEffect(), false, filter, true)); diff --git a/Mage.Sets/src/mage/cards/m/Mortuary.java b/Mage.Sets/src/mage/cards/m/Mortuary.java index f1aa17f0801..22797d4d4fa 100644 --- a/Mage.Sets/src/mage/cards/m/Mortuary.java +++ b/Mage.Sets/src/mage/cards/m/Mortuary.java @@ -1,7 +1,5 @@ - package mage.cards.m; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.PutIntoGraveFromBattlefieldAllTriggeredAbility; import mage.abilities.effects.common.PutOnLibraryTargetEffect; @@ -10,8 +8,9 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.filter.StaticFilters; +import java.util.UUID; + /** - * * @author HCrescent */ public final class Mortuary extends CardImpl { @@ -19,9 +18,9 @@ public final class Mortuary extends CardImpl { public Mortuary(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}"); - - Ability ability = new PutIntoGraveFromBattlefieldAllTriggeredAbility(new PutOnLibraryTargetEffect(true, "put that card on top of your library."), false, StaticFilters.FILTER_PERMANENT_CREATURE, true, true); + // Whenever a creature is put into your graveyard from the battlefield, put that card on top of your library. + Ability ability = new PutIntoGraveFromBattlefieldAllTriggeredAbility(new PutOnLibraryTargetEffect(true, "put that card on top of your library."), false, StaticFilters.FILTER_PERMANENT_CREATURE, true, true); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/o/OathkeeperTakenosDaisho.java b/Mage.Sets/src/mage/cards/o/OathkeeperTakenosDaisho.java index c73958f38d0..d5718d8eaba 100644 --- a/Mage.Sets/src/mage/cards/o/OathkeeperTakenosDaisho.java +++ b/Mage.Sets/src/mage/cards/o/OathkeeperTakenosDaisho.java @@ -1,7 +1,5 @@ - package mage.cards.o; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.DiesAttachedTriggeredAbility; import mage.abilities.common.PutIntoGraveFromBattlefieldSourceTriggeredAbility; @@ -22,33 +20,38 @@ import mage.filter.predicate.mageobject.SubtypePredicate; import mage.game.Game; import mage.game.permanent.Permanent; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class OathkeeperTakenosDaisho extends CardImpl { private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("it's a Samurai card"); + static { filter.add(new SubtypePredicate(SubType.SAMURAI)); } public OathkeeperTakenosDaisho(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.EQUIPMENT); // Equipped creature gets +3/+1. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(3,1, Duration.WhileOnBattlefield))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(3, 1, Duration.WhileOnBattlefield))); + // Whenever equipped creature dies, return that card to the battlefield under your control if it's a Samurai card. this.addAbility(new ConditionalInterveningIfTriggeredAbility( - new DiesAttachedTriggeredAbility(new ReturnToBattlefieldUnderYourControlAttachedEffect(),"equipped creature", false), + new DiesAttachedTriggeredAbility(new ReturnToBattlefieldUnderYourControlAttachedEffect(), "equipped creature", false), new OathkeeperEquippedMatchesFilterCondition(filter), "")); + // When Oathkeeper, Takeno's Daisho is put into a graveyard from the battlefield, exile equipped creature. this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new ExileEquippedEffect())); + // Equip {2} - this.addAbility(new EquipAbility( Outcome.BoostCreature, new ManaCostsImpl("{2}"))); + this.addAbility(new EquipAbility(Outcome.BoostCreature, new ManaCostsImpl("{2}"))); } public OathkeeperTakenosDaisho(final OathkeeperTakenosDaisho card) { @@ -114,14 +117,12 @@ class OathkeeperEquippedMatchesFilterCondition implements Condition { } } if (attachedTo == null) { - for (Effect effect :source.getEffects()) { + for (Effect effect : source.getEffects()) { attachedTo = (Permanent) effect.getValue("attachedTo"); } } if (attachedTo != null) { - if (filter.match(attachedTo, attachedTo.getId(),attachedTo.getControllerId(), game)) { - return true; - } + return filter.match(attachedTo, attachedTo.getId(), attachedTo.getControllerId(), game); } } diff --git a/Mage.Sets/src/mage/cards/p/PanicSpellbomb.java b/Mage.Sets/src/mage/cards/p/PanicSpellbomb.java index 1b44b323f97..f6fbf675d4a 100644 --- a/Mage.Sets/src/mage/cards/p/PanicSpellbomb.java +++ b/Mage.Sets/src/mage/cards/p/PanicSpellbomb.java @@ -1,7 +1,5 @@ - package mage.cards.p; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.PutIntoGraveFromBattlefieldSourceTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; @@ -18,14 +16,15 @@ import mage.constants.Duration; import mage.constants.Zone; import mage.target.common.TargetCreaturePermanent; +import java.util.UUID; + /** - * * @author North */ public final class PanicSpellbomb extends CardImpl { public PanicSpellbomb(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{1}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}"); // Tap, Sacrifice Panic Spellbomb: Target creature can't block this turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantBlockTargetEffect(Duration.EndOfTurn), new TapSourceCost()); @@ -34,7 +33,7 @@ public final class PanicSpellbomb extends CardImpl { this.addAbility(ability); // When Panic Spellbomb is put into a graveyard from the battlefield, you may pay Red. If you do, draw a card. - this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new DoIfCostPaid(new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{R}")), false)); + this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new DoIfCostPaid(new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{R}")), false, false)); } public PanicSpellbomb(final PanicSpellbomb card) { diff --git a/Mage.Sets/src/mage/cards/r/Ringskipper.java b/Mage.Sets/src/mage/cards/r/Ringskipper.java index 82e16e5b1f8..fceb01e0ce0 100644 --- a/Mage.Sets/src/mage/cards/r/Ringskipper.java +++ b/Mage.Sets/src/mage/cards/r/Ringskipper.java @@ -1,7 +1,5 @@ - package mage.cards.r; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.PutIntoGraveFromBattlefieldSourceTriggeredAbility; import mage.abilities.effects.common.DoIfClashWonEffect; @@ -12,24 +10,25 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; +import java.util.UUID; + /** - * * @author Styxo */ public final class Ringskipper extends CardImpl { public Ringskipper(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}"); this.subtype.add(SubType.FAERIE); this.subtype.add(SubType.WIZARD); this.power = new MageInt(1); this.toughness = new MageInt(1); - //Flying + // Flying this.addAbility(FlyingAbility.getInstance()); - //When {this} is put into graveyard from play, clash with an opponent. If you win return {this} to its owner's hand + // When {this} is put into graveyard from play, clash with an opponent. If you win return {this} to its owner's hand this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new DoIfClashWonEffect(new ReturnToHandSourceEffect()))); } diff --git a/Mage.Sets/src/mage/cards/s/SoulcatchersAerie.java b/Mage.Sets/src/mage/cards/s/SoulcatchersAerie.java index 6b82168d403..aec13a77cf6 100644 --- a/Mage.Sets/src/mage/cards/s/SoulcatchersAerie.java +++ b/Mage.Sets/src/mage/cards/s/SoulcatchersAerie.java @@ -1,7 +1,5 @@ - package mage.cards.s; -import java.util.UUID; import mage.abilities.common.PutIntoGraveFromBattlefieldAllTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.dynamicvalue.common.CountersSourceCount; @@ -18,8 +16,9 @@ import mage.filter.FilterPermanent; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.SubtypePredicate; +import java.util.UUID; + /** - * * @author LoneFox */ public final class SoulcatchersAerie extends CardImpl { @@ -33,15 +32,16 @@ public final class SoulcatchersAerie extends CardImpl { } public SoulcatchersAerie(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}"); // Whenever a Bird is put into your graveyard from the battlefield, put a feather counter on Soulcatchers' Aerie. this.addAbility(new PutIntoGraveFromBattlefieldAllTriggeredAbility(new AddCountersSourceEffect(CounterType.FEATHER.createInstance()), - false, filter, false, true)); + false, filter, false, true)); + // Bird creatures get +1/+1 for each feather counter on Soulcatchers' Aerie. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(new CountersSourceCount(CounterType.FEATHER), - new CountersSourceCount(CounterType.FEATHER), Duration.WhileOnBattlefield, filter2, false, - "Bird creatures get +1/+1 for each feather counter on {this}."))); + new CountersSourceCount(CounterType.FEATHER), Duration.WhileOnBattlefield, filter2, false, + "Bird creatures get +1/+1 for each feather counter on {this}."))); } public SoulcatchersAerie(final SoulcatchersAerie card) { diff --git a/Mage.Sets/src/mage/cards/t/Terrarion.java b/Mage.Sets/src/mage/cards/t/Terrarion.java index d768113a8ff..19ea4ba0bd3 100644 --- a/Mage.Sets/src/mage/cards/t/Terrarion.java +++ b/Mage.Sets/src/mage/cards/t/Terrarion.java @@ -1,37 +1,38 @@ - package mage.cards.t; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.common.PutIntoGraveFromBattlefieldSourceTriggeredAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.common.TapSourceCost; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.mana.AddManaInAnyCombinationEffect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.mana.AddManaInAnyCombinationEffect; import mage.abilities.mana.SimpleManaAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Zone; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class Terrarion extends CardImpl { public Terrarion(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{1}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}"); // Terrarion enters the battlefield tapped. this.addAbility(new EntersBattlefieldTappedAbility()); + // {2}, {T}, Sacrifice Terrarion: Add two mana in any combination of colors. Ability ability = new SimpleManaAbility(Zone.BATTLEFIELD, new AddManaInAnyCombinationEffect(2), new GenericManaCost(2)); ability.addCost(new TapSourceCost()); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); + // When Terrarion is put into a graveyard from the battlefield, draw a card. this.addAbility(new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new DrawCardSourceControllerEffect(1))); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/vis/BroodOfCockroachesTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/vis/BroodOfCockroachesTest.java index 25399e43a8f..f66f66b05c9 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/single/vis/BroodOfCockroachesTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/vis/BroodOfCockroachesTest.java @@ -1,7 +1,6 @@ package org.mage.test.cards.single.vis; import mage.game.permanent.Permanent; -import org.junit.Ignore; import org.junit.Test; import org.mage.test.serverside.base.CardTestPlayerBase; @@ -21,7 +20,6 @@ public class BroodOfCockroachesTest extends CardTestPlayerBase { private static final String SHOCK = "Shock"; @Test - @Ignore // TODO: fix "put into your graveyard from the battlefield" texts for some cards public void should_display_correct_text() { String expectedText = "When {this} is put into your graveyard from the battlefield, at the beginning of the next end step, you lose 1 life and return {this} to your hand."; diff --git a/Mage/src/main/java/mage/abilities/common/PutIntoGraveFromBattlefieldSourceTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/PutIntoGraveFromBattlefieldSourceTriggeredAbility.java index 2c6fb1139ee..0f83feefa23 100644 --- a/Mage/src/main/java/mage/abilities/common/PutIntoGraveFromBattlefieldSourceTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/PutIntoGraveFromBattlefieldSourceTriggeredAbility.java @@ -13,17 +13,21 @@ import mage.game.permanent.Permanent; */ public class PutIntoGraveFromBattlefieldSourceTriggeredAbility extends TriggeredAbilityImpl { + private boolean onlyToControllerGraveyard; + public PutIntoGraveFromBattlefieldSourceTriggeredAbility(Effect effect) { - this(effect, false); + this(effect, false, false); } - public PutIntoGraveFromBattlefieldSourceTriggeredAbility(Effect effect, boolean optional) { + public PutIntoGraveFromBattlefieldSourceTriggeredAbility(Effect effect, boolean optional, boolean onlyToControllerGraveyard) { super(Zone.ALL, effect, optional); setLeavesTheBattlefieldTrigger(true); + this.onlyToControllerGraveyard = onlyToControllerGraveyard; } public PutIntoGraveFromBattlefieldSourceTriggeredAbility(final PutIntoGraveFromBattlefieldSourceTriggeredAbility ability) { super(ability); + this.onlyToControllerGraveyard = ability.onlyToControllerGraveyard; } @Override @@ -44,7 +48,7 @@ public class PutIntoGraveFromBattlefieldSourceTriggeredAbility extends Triggered if (permanent != null && zEvent.getToZone() == Zone.GRAVEYARD && zEvent.getFromZone() == Zone.BATTLEFIELD) { - return true; + return !onlyToControllerGraveyard || this.isControlledBy(game.getOwnerId(zEvent.getTargetId())); } } return false; @@ -52,6 +56,6 @@ public class PutIntoGraveFromBattlefieldSourceTriggeredAbility extends Triggered @Override public String getRule() { - return "When {this} is put into a graveyard from the battlefield, " + super.getRule(); + return "When {this} is put into " + (onlyToControllerGraveyard ? "your" : "a") + " graveyard from the battlefield, " + super.getRule(); } }