From 0bc473f4b2c6b3bfc0f585432a0a741e94c071c6 Mon Sep 17 00:00:00 2001 From: xenohedron Date: Sat, 20 May 2023 23:55:49 -0400 Subject: [PATCH] Clean up constructors and add comments --- Mage.Sets/src/mage/cards/c/ChimericMass.java | 4 ++-- Mage.Sets/src/mage/cards/e/EbonyFly.java | 2 +- .../src/mage/cards/h/HiddenAncients.java | 2 +- Mage.Sets/src/mage/cards/h/HiddenGibbons.java | 2 +- .../src/mage/cards/h/HiddenGuerrillas.java | 2 +- Mage.Sets/src/mage/cards/h/HiddenHerd.java | 2 +- .../src/mage/cards/h/HiddenPredators.java | 2 +- Mage.Sets/src/mage/cards/h/HiddenSpider.java | 2 +- Mage.Sets/src/mage/cards/h/HiddenStag.java | 2 +- Mage.Sets/src/mage/cards/l/LurkingEvil.java | 2 +- .../src/mage/cards/l/LurkingJackals.java | 2 +- Mage.Sets/src/mage/cards/l/LurkingSkirge.java | 2 +- Mage.Sets/src/mage/cards/o/OpalAcrolith.java | 2 +- Mage.Sets/src/mage/cards/o/OpalArchangel.java | 2 +- Mage.Sets/src/mage/cards/o/OpalAvenger.java | 2 +- Mage.Sets/src/mage/cards/o/OpalCaryatid.java | 2 +- Mage.Sets/src/mage/cards/o/OpalChampion.java | 2 +- Mage.Sets/src/mage/cards/o/OpalGargoyle.java | 2 +- Mage.Sets/src/mage/cards/o/OpalGuardian.java | 2 +- .../mage/cards/s/SvogthosTheRestlessTomb.java | 2 +- Mage.Sets/src/mage/cards/v/VeilOfBirds.java | 2 +- .../src/mage/cards/v/VeiledApparition.java | 4 ++-- .../src/mage/cards/v/VeiledCrocodile.java | 2 +- Mage.Sets/src/mage/cards/v/VeiledSerpent.java | 2 +- .../BecomesCreatureSourceEffect.java | 23 +++++++++++++++---- 25 files changed, 45 insertions(+), 30 deletions(-) diff --git a/Mage.Sets/src/mage/cards/c/ChimericMass.java b/Mage.Sets/src/mage/cards/c/ChimericMass.java index fe060ca598e..34b310a3908 100644 --- a/Mage.Sets/src/mage/cards/c/ChimericMass.java +++ b/Mage.Sets/src/mage/cards/c/ChimericMass.java @@ -38,7 +38,7 @@ public final class ChimericMass extends CardImpl { .withType(CardType.ARTIFACT) .withSubType(SubType.CONSTRUCT) .withAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SetBasePowerToughnessSourceEffect(new CountersSourceCount(CounterType.CHARGE)))), - "", Duration.EndOfTurn, false, true), new GenericManaCost(1))); + "", Duration.EndOfTurn, false, true, false), new GenericManaCost(1))); } private ChimericMass(final ChimericMass card) { @@ -50,4 +50,4 @@ public final class ChimericMass extends CardImpl { return new ChimericMass(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/e/EbonyFly.java b/Mage.Sets/src/mage/cards/e/EbonyFly.java index 2453171c93d..86a7baa0107 100644 --- a/Mage.Sets/src/mage/cards/e/EbonyFly.java +++ b/Mage.Sets/src/mage/cards/e/EbonyFly.java @@ -103,7 +103,7 @@ class EbonyFlyEffect extends OneShotEffect { new CreatureToken(result, result) .withType(CardType.ARTIFACT) .withAbility(FlyingAbility.getInstance()), - "", Duration.EndOfTurn, false, false + "", Duration.EndOfTurn, false, false, false ), source); return true; } diff --git a/Mage.Sets/src/mage/cards/h/HiddenAncients.java b/Mage.Sets/src/mage/cards/h/HiddenAncients.java index 93d9df66244..4ca9f3a1269 100644 --- a/Mage.Sets/src/mage/cards/h/HiddenAncients.java +++ b/Mage.Sets/src/mage/cards/h/HiddenAncients.java @@ -35,7 +35,7 @@ public final class HiddenAncients extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{G}"); // When an opponent casts an enchantment spell, if Hidden Ancients is an enchantment, Hidden Ancients becomes a 5/5 Treefolk creature. - TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new HiddenAncientsTreefolkToken(), "", Duration.WhileOnBattlefield, true, false), + TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new HiddenAncientsTreefolkToken(), Duration.WhileOnBattlefield), filter, false); this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new SourceMatchesFilterCondition(StaticFilters.FILTER_PERMANENT_ENCHANTMENT), "When an opponent casts an enchantment spell, if {this} is an enchantment, {this} becomes a 5/5 Treefolk creature.")); diff --git a/Mage.Sets/src/mage/cards/h/HiddenGibbons.java b/Mage.Sets/src/mage/cards/h/HiddenGibbons.java index 52a9622ad85..a1b3c8fce1d 100644 --- a/Mage.Sets/src/mage/cards/h/HiddenGibbons.java +++ b/Mage.Sets/src/mage/cards/h/HiddenGibbons.java @@ -35,7 +35,7 @@ public final class HiddenGibbons extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{G}"); // When an opponent casts an instant spell, if Hidden Gibbons is an enchantment, Hidden Gibbons becomes a 4/4 Ape creature. - TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new HiddenGibbonsApe(), "", Duration.WhileOnBattlefield, true, false), + TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new HiddenGibbonsApe(), Duration.WhileOnBattlefield), filter, false); this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new SourceMatchesFilterCondition(StaticFilters.FILTER_PERMANENT_ENCHANTMENT), "When an opponent casts an instant spell, if {this} is an enchantment, {this} becomes a 4/4 Ape creature.")); diff --git a/Mage.Sets/src/mage/cards/h/HiddenGuerrillas.java b/Mage.Sets/src/mage/cards/h/HiddenGuerrillas.java index ac57ba650ca..15a3d3ca610 100644 --- a/Mage.Sets/src/mage/cards/h/HiddenGuerrillas.java +++ b/Mage.Sets/src/mage/cards/h/HiddenGuerrillas.java @@ -30,7 +30,7 @@ public final class HiddenGuerrillas extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{G}"); // When an opponent casts an artifact spell, if Hidden Guerrillas is an enchantment, Hidden Guerrillas becomes a 5/3 Soldier creature with trample. - TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new HiddenGuerrillasSoldier(), "", Duration.WhileOnBattlefield, true, false), + TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new HiddenGuerrillasSoldier(), Duration.WhileOnBattlefield), new FilterArtifactSpell(), false); this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new SourceMatchesFilterCondition(StaticFilters.FILTER_PERMANENT_ENCHANTMENT), "When an opponent casts an artifact spell, if {this} is an enchantment, {this} becomes a 5/3 Soldier creature with trample.")); diff --git a/Mage.Sets/src/mage/cards/h/HiddenHerd.java b/Mage.Sets/src/mage/cards/h/HiddenHerd.java index ed5565a6896..641c0da28d2 100644 --- a/Mage.Sets/src/mage/cards/h/HiddenHerd.java +++ b/Mage.Sets/src/mage/cards/h/HiddenHerd.java @@ -50,7 +50,7 @@ public final class HiddenHerd extends CardImpl { class HiddenHerdAbility extends TriggeredAbilityImpl { public HiddenHerdAbility() { - super(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new HiddenHerdBeast(), "", Duration.WhileOnBattlefield, true, false), false); + super(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new HiddenHerdBeast(), Duration.WhileOnBattlefield), false); } public HiddenHerdAbility(final HiddenHerdAbility ability) { diff --git a/Mage.Sets/src/mage/cards/h/HiddenPredators.java b/Mage.Sets/src/mage/cards/h/HiddenPredators.java index da7b23d222f..5930c6cc9b8 100644 --- a/Mage.Sets/src/mage/cards/h/HiddenPredators.java +++ b/Mage.Sets/src/mage/cards/h/HiddenPredators.java @@ -46,7 +46,7 @@ class HiddenPredatorsStateTriggeredAbility extends StateTriggeredAbility { } public HiddenPredatorsStateTriggeredAbility() { - super(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new HiddenPredatorsToken(), "", Duration.Custom, true, false)); + super(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new HiddenPredatorsToken(), Duration.Custom)); setTriggerPhrase("When an opponent controls a creature with power 4 or greater, if {this} is an enchantment"); } diff --git a/Mage.Sets/src/mage/cards/h/HiddenSpider.java b/Mage.Sets/src/mage/cards/h/HiddenSpider.java index 7b8742030a2..d1e5fdc2ebc 100644 --- a/Mage.Sets/src/mage/cards/h/HiddenSpider.java +++ b/Mage.Sets/src/mage/cards/h/HiddenSpider.java @@ -38,7 +38,7 @@ public final class HiddenSpider extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{G}"); // When an opponent casts a creature spell with flying, if Hidden Spider is an enchantment, Hidden Spider becomes a 3/5 Spider creature with reach. - TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new HiddenSpiderToken(), "", Duration.WhileOnBattlefield, true, false), + TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new HiddenSpiderToken(), Duration.WhileOnBattlefield), filter, false); this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new SourceMatchesFilterCondition(StaticFilters.FILTER_PERMANENT_ENCHANTMENT), "When an opponent casts a creature spell with flying, if {this} is an enchantment, {this} becomes a 3/5 Spider creature with reach.")); diff --git a/Mage.Sets/src/mage/cards/h/HiddenStag.java b/Mage.Sets/src/mage/cards/h/HiddenStag.java index 25a595200b8..94ffd351737 100644 --- a/Mage.Sets/src/mage/cards/h/HiddenStag.java +++ b/Mage.Sets/src/mage/cards/h/HiddenStag.java @@ -29,7 +29,7 @@ public final class HiddenStag extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); // Whenever an opponent plays a land, if Hidden Stag is an enchantment, Hidden Stag becomes a 3/2 Elk Beast creature. - Effect effect = new BecomesCreatureSourceEffect(new ElkBeastToken(), "", Duration.WhileOnBattlefield, true, false); + Effect effect = new BecomesCreatureSourceEffect(new ElkBeastToken(), Duration.WhileOnBattlefield); TriggeredAbility ability = new OpponentPlaysLandTriggeredAbility(Zone.BATTLEFIELD, effect, false); this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new SourceMatchesFilterCondition(StaticFilters.FILTER_PERMANENT_ENCHANTMENT), "Whenever an opponent plays a land, if Hidden Stag is an enchantment, Hidden Stag becomes a 3/2 Elk Beast creature.")); diff --git a/Mage.Sets/src/mage/cards/l/LurkingEvil.java b/Mage.Sets/src/mage/cards/l/LurkingEvil.java index ac141cce36b..543e63a436d 100644 --- a/Mage.Sets/src/mage/cards/l/LurkingEvil.java +++ b/Mage.Sets/src/mage/cards/l/LurkingEvil.java @@ -32,7 +32,7 @@ public final class LurkingEvil extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{B}{B}{B}"); // Pay half your life, rounded up: Lurking Evil becomes a 4/4 Horror creature with flying. - Effect effect = new BecomesCreatureSourceEffect(new LurkingEvilToken(), null, Duration.EndOfGame, true, false); + Effect effect = new BecomesCreatureSourceEffect(new LurkingEvilToken(), Duration.EndOfGame); effect.setText("{this} becomes a 4/4 Phyrexian Horror creature with flying"); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new LurkingEvilCost())); } diff --git a/Mage.Sets/src/mage/cards/l/LurkingJackals.java b/Mage.Sets/src/mage/cards/l/LurkingJackals.java index d2581a5eabc..3023bd792d3 100644 --- a/Mage.Sets/src/mage/cards/l/LurkingJackals.java +++ b/Mage.Sets/src/mage/cards/l/LurkingJackals.java @@ -40,7 +40,7 @@ public final class LurkingJackals extends CardImpl { class LurkingJackalsStateTriggeredAbility extends StateTriggeredAbility { public LurkingJackalsStateTriggeredAbility() { - super(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new LurkingJackalsToken(), "", Duration.Custom, true, false)); + super(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new LurkingJackalsToken(), Duration.Custom)); setTriggerPhrase("When an opponent has 10 or less life, if {this} is an enchantment, "); } diff --git a/Mage.Sets/src/mage/cards/l/LurkingSkirge.java b/Mage.Sets/src/mage/cards/l/LurkingSkirge.java index 26df79c78af..837ade572fd 100644 --- a/Mage.Sets/src/mage/cards/l/LurkingSkirge.java +++ b/Mage.Sets/src/mage/cards/l/LurkingSkirge.java @@ -34,7 +34,7 @@ public final class LurkingSkirge extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); // When a creature is put into an opponent's graveyard from the battlefield, if Lurking Skirge is an enchantment, Lurking Skirge becomes a 3/2 Imp creature with flying. - TriggeredAbility ability = new PutIntoGraveFromBattlefieldAllTriggeredAbility(new BecomesCreatureSourceEffect(new LurkingSkirgeToken(), "", Duration.WhileOnBattlefield, true, false), false, filter, false); + TriggeredAbility ability = new PutIntoGraveFromBattlefieldAllTriggeredAbility(new BecomesCreatureSourceEffect(new LurkingSkirgeToken(), Duration.WhileOnBattlefield), false, filter, false); this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new SourceMatchesFilterCondition(StaticFilters.FILTER_PERMANENT_ENCHANTMENT), "When a creature is put into an opponent's graveyard from the battlefield, if {this} is an enchantment, {this} becomes a 3/2 Phyrexian Imp creature with flying.")); } diff --git a/Mage.Sets/src/mage/cards/o/OpalAcrolith.java b/Mage.Sets/src/mage/cards/o/OpalAcrolith.java index 9aaf7582a15..ed884314094 100644 --- a/Mage.Sets/src/mage/cards/o/OpalAcrolith.java +++ b/Mage.Sets/src/mage/cards/o/OpalAcrolith.java @@ -36,7 +36,7 @@ public final class OpalAcrolith extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}"); // Whenever an opponent casts a creature spell, if Opal Acrolith is an enchantment, Opal Acrolith becomes a 2/4 Soldier creature. - TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new OpalAcrolithToken(), "", Duration.WhileOnBattlefield, true, false), + TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new OpalAcrolithToken(), Duration.WhileOnBattlefield), filter, false); this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new SourceMatchesFilterCondition(StaticFilters.FILTER_PERMANENT_ENCHANTMENT), "Whenever an opponent casts a creature spell, if Opal Acrolith is an enchantment, Opal Acrolith becomes a 2/4 Soldier creature.")); diff --git a/Mage.Sets/src/mage/cards/o/OpalArchangel.java b/Mage.Sets/src/mage/cards/o/OpalArchangel.java index c60880b8a2a..9506378bf9d 100644 --- a/Mage.Sets/src/mage/cards/o/OpalArchangel.java +++ b/Mage.Sets/src/mage/cards/o/OpalArchangel.java @@ -31,7 +31,7 @@ public final class OpalArchangel extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{4}{W}"); // When an opponent casts a creature spell, if Opal Archangel is an enchantment, Opal Archangel becomes a 5/5 Angel creature with flying and vigilance. - TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new OpalArchangelToken(), "", Duration.WhileOnBattlefield, true, false), + TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new OpalArchangelToken(), Duration.WhileOnBattlefield), new FilterCreatureSpell(), false); this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new SourceMatchesFilterCondition(StaticFilters.FILTER_PERMANENT_ENCHANTMENT), "When an opponent casts a creature spell, if {this} is an enchantment, {this} becomes a 5/5 Angel creature with flying and vigilance.")); diff --git a/Mage.Sets/src/mage/cards/o/OpalAvenger.java b/Mage.Sets/src/mage/cards/o/OpalAvenger.java index 870ee72841b..d578c0512a2 100644 --- a/Mage.Sets/src/mage/cards/o/OpalAvenger.java +++ b/Mage.Sets/src/mage/cards/o/OpalAvenger.java @@ -40,7 +40,7 @@ public final class OpalAvenger extends CardImpl { class OpalAvengerStateTriggeredAbility extends StateTriggeredAbility { public OpalAvengerStateTriggeredAbility() { - super(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new OpalAvengerToken(), "", Duration.Custom, true, false)); + super(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new OpalAvengerToken(), Duration.Custom)); setTriggerPhrase("When you have 10 or less life, if {this} is an enchantment, "); } diff --git a/Mage.Sets/src/mage/cards/o/OpalCaryatid.java b/Mage.Sets/src/mage/cards/o/OpalCaryatid.java index 260197fb7d2..fa183b0e161 100644 --- a/Mage.Sets/src/mage/cards/o/OpalCaryatid.java +++ b/Mage.Sets/src/mage/cards/o/OpalCaryatid.java @@ -29,7 +29,7 @@ public final class OpalCaryatid extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{W}"); // When an opponent casts a creature spell, if Opal Caryatid is an enchantment, Opal Caryatid becomes a 2/2 Soldier creature. - TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new OpalCaryatidSoldierToken(), "", Duration.WhileOnBattlefield, true, false), + TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new OpalCaryatidSoldierToken(), Duration.WhileOnBattlefield), new FilterCreatureSpell(), false); this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new SourceMatchesFilterCondition(StaticFilters.FILTER_PERMANENT_ENCHANTMENT), "When an opponent casts a creature spell, if {this} is an enchantment, {this} becomes a 2/2 Soldier creature.")); diff --git a/Mage.Sets/src/mage/cards/o/OpalChampion.java b/Mage.Sets/src/mage/cards/o/OpalChampion.java index 72b542a2f81..6e12c4dc805 100644 --- a/Mage.Sets/src/mage/cards/o/OpalChampion.java +++ b/Mage.Sets/src/mage/cards/o/OpalChampion.java @@ -30,7 +30,7 @@ public final class OpalChampion extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{W}"); // When an opponent casts a creature spell, if Opal Champion is an enchantment, Opal Champion becomes a 3/3 Knight creature with first strike. - TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new OpalChampionKnight(), "", Duration.WhileOnBattlefield, true, false), + TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new OpalChampionKnight(), Duration.WhileOnBattlefield), new FilterCreatureSpell(), false); this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new SourceMatchesFilterCondition(StaticFilters.FILTER_PERMANENT_ENCHANTMENT), "When an opponent casts a creature spell, if {this} is an enchantment, {this} becomes a 3/3 Knight creature with first strike.")); diff --git a/Mage.Sets/src/mage/cards/o/OpalGargoyle.java b/Mage.Sets/src/mage/cards/o/OpalGargoyle.java index f0ecedee085..82ee5f640a5 100644 --- a/Mage.Sets/src/mage/cards/o/OpalGargoyle.java +++ b/Mage.Sets/src/mage/cards/o/OpalGargoyle.java @@ -30,7 +30,7 @@ public final class OpalGargoyle extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{W}"); // When an opponent casts a creature spell, if Opal Gargoyle is an enchantment, Opal Gargoyle becomes a 2/2 Gargoyle creature with flying. - TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new OpalGargoyleToken(), "", Duration.WhileOnBattlefield, true, false), + TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new OpalGargoyleToken(), Duration.WhileOnBattlefield), new FilterCreatureSpell(), false); this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new SourceMatchesFilterCondition(StaticFilters.FILTER_PERMANENT_ENCHANTMENT), "When an opponent casts a creature spell, if {this} is an enchantment, {this} becomes a 2/2 Gargoyle creature with flying.")); diff --git a/Mage.Sets/src/mage/cards/o/OpalGuardian.java b/Mage.Sets/src/mage/cards/o/OpalGuardian.java index 10cd59bb6c9..d1d15ad528f 100644 --- a/Mage.Sets/src/mage/cards/o/OpalGuardian.java +++ b/Mage.Sets/src/mage/cards/o/OpalGuardian.java @@ -32,7 +32,7 @@ public final class OpalGuardian extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{W}{W}{W}"); // When an opponent casts a creature spell, if Opal Guardian is an enchantment, Opal Guardian becomes a 3/4 Gargoyle creature with flying and protection from red. - TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new OpalGuardianGargoyle(), "", Duration.WhileOnBattlefield, true, false), + TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new OpalGuardianGargoyle(), Duration.WhileOnBattlefield), new FilterCreatureSpell(), false); this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new SourceMatchesFilterCondition(StaticFilters.FILTER_PERMANENT_ENCHANTMENT), "When an opponent casts a creature spell, if {this} is an enchantment, {this} becomes a 3/4 Gargoyle creature with flying and protection from red.")); diff --git a/Mage.Sets/src/mage/cards/s/SvogthosTheRestlessTomb.java b/Mage.Sets/src/mage/cards/s/SvogthosTheRestlessTomb.java index 0eac8ebcdda..36c0efe8a42 100644 --- a/Mage.Sets/src/mage/cards/s/SvogthosTheRestlessTomb.java +++ b/Mage.Sets/src/mage/cards/s/SvogthosTheRestlessTomb.java @@ -33,7 +33,7 @@ public final class SvogthosTheRestlessTomb extends CardImpl { this.addAbility(new ColorlessManaAbility()); // {3}{B}{G}: Until end of turn, Svogthos, the Restless Tomb becomes a black and green Plant Zombie creature with "This creature's power and toughness are each equal to the number of creature cards in your graveyard." It's still a land. // set to character defining to prevent setting P/T again to 0 becuase already set by CDA of the token - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new SvogthosToken(), "land", Duration.EndOfTurn, false, true), new ManaCostsImpl<>("{3}{B}{G}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new SvogthosToken(), "land", Duration.EndOfTurn, false, true, false), new ManaCostsImpl<>("{3}{B}{G}")); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/v/VeilOfBirds.java b/Mage.Sets/src/mage/cards/v/VeilOfBirds.java index 6c21620d77f..e3a61f8a918 100644 --- a/Mage.Sets/src/mage/cards/v/VeilOfBirds.java +++ b/Mage.Sets/src/mage/cards/v/VeilOfBirds.java @@ -29,7 +29,7 @@ public final class VeilOfBirds extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{U}"); // When an opponent casts a spell, if Veil of Birds is an enchantment, Veil of Birds becomes a 1/1 Bird creature with flying. - TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new VeilOfBirdsToken(), "", Duration.WhileOnBattlefield, true, false), + TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new VeilOfBirdsToken(), Duration.WhileOnBattlefield), filter, false); this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new SourceMatchesFilterCondition(StaticFilters.FILTER_PERMANENT_ENCHANTMENT), "Whenever an opponent casts a spell, if Veil of Birds is an enchantment, Veil of Birds becomes a 1/1 Bird creature with flying.")); diff --git a/Mage.Sets/src/mage/cards/v/VeiledApparition.java b/Mage.Sets/src/mage/cards/v/VeiledApparition.java index 8b3ef04ef29..53ddbaf2693 100644 --- a/Mage.Sets/src/mage/cards/v/VeiledApparition.java +++ b/Mage.Sets/src/mage/cards/v/VeiledApparition.java @@ -35,7 +35,7 @@ public final class VeiledApparition extends CardImpl { // When an opponent casts a spell, if Veiled Apparition is an enchantment, Veiled Apparition becomes a 3/3 Illusion creature with flying and "At the beginning of your upkeep, sacrifice Veiled Apparition unless you pay {1}{U}." - TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new VeilApparitionToken(), "", Duration.WhileOnBattlefield, true, false), + TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new VeilApparitionToken(), Duration.WhileOnBattlefield), filter, false); this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new SourceMatchesFilterCondition(StaticFilters.FILTER_PERMANENT_ENCHANTMENT), "Whenever an opponent casts a spell, if Veiled Apparition is an enchantment, Veiled Apparition becomes a 3/3 Illusion creature with flying and \"At the beginning of your upkeep, sacrifice Veiled Apparition unless you pay {1}{U}.")); @@ -71,4 +71,4 @@ class VeilApparitionToken extends TokenImpl { public VeilApparitionToken copy() { return new VeilApparitionToken(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/v/VeiledCrocodile.java b/Mage.Sets/src/mage/cards/v/VeiledCrocodile.java index fba61bace7f..547dcb8af62 100644 --- a/Mage.Sets/src/mage/cards/v/VeiledCrocodile.java +++ b/Mage.Sets/src/mage/cards/v/VeiledCrocodile.java @@ -41,7 +41,7 @@ public final class VeiledCrocodile extends CardImpl { class VeiledCrocodileStateTriggeredAbility extends StateTriggeredAbility { public VeiledCrocodileStateTriggeredAbility() { - super(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new VeilCrocodileToken(), "", Duration.Custom, true, false)); + super(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new VeilCrocodileToken(), Duration.Custom)); setTriggerPhrase("When a player has no cards in hand, if {this} is an enchantment, "); } diff --git a/Mage.Sets/src/mage/cards/v/VeiledSerpent.java b/Mage.Sets/src/mage/cards/v/VeiledSerpent.java index 06660de7454..8167f787a86 100644 --- a/Mage.Sets/src/mage/cards/v/VeiledSerpent.java +++ b/Mage.Sets/src/mage/cards/v/VeiledSerpent.java @@ -32,7 +32,7 @@ public final class VeiledSerpent extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}"); // When an opponent casts a spell, if Veiled Serpent is an enchantment, Veiled Serpent becomes a 4/4 Serpent creature that can't attack unless defending player controls an Island. - TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new VeiledSerpentToken(), "", Duration.WhileOnBattlefield, true, false), + TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new VeiledSerpentToken(), Duration.WhileOnBattlefield), new FilterSpell(), false); this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, new SourceMatchesFilterCondition(StaticFilters.FILTER_PERMANENT_ENCHANTMENT), "Whenever an opponent casts a spell, if Veiled Serpent is an enchantment, Veiled Serpent becomes a 4/4 Serpent creature that can't attack unless defending player controls an Island.")); diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java index e30ce2b5b34..68a9341273a 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureSourceEffect.java @@ -22,18 +22,33 @@ public class BecomesCreatureSourceEffect extends ContinuousEffectImpl implements protected DynamicValue toughness = null; protected boolean durationRuleAtStart = false; // put duration rule at the start of the rules text rather than the end + /** + Becomes a creature retaining its previous types + @param token Token as blueprint for creature to become + @param theyAreStillType String for rules text generation + @param duration Duration for the effect + */ public BecomesCreatureSourceEffect(Token token, String theyAreStillType, Duration duration) { this(token, theyAreStillType, duration, false, false, false); } + /** + Becomes a creature losing its previous types + @param token Token as blueprint for creature to become + @param duration Duration for the effect + */ public BecomesCreatureSourceEffect(Token token, Duration duration) { this(token, "", duration, true, false, false); } - public BecomesCreatureSourceEffect(Token token, String theyAreStillType, Duration duration, boolean losePreviousTypes, boolean characterDefining) { - this(token, theyAreStillType, duration, losePreviousTypes, characterDefining, false); - } - + /** + @param token Token as blueprint for creature to become + @param theyAreStillType String for rules text generation + @param duration Duration for the effect + @param losePreviousTypes if true, permanent loses its previous types + @param characterDefining if true, effect applies on layer 7a (it probably shouldn't) + @param loseAbilities if true, permanent loses its other abilities + */ public BecomesCreatureSourceEffect(Token token, String theyAreStillType, Duration duration, boolean losePreviousTypes, boolean characterDefining, boolean loseAbilities) { super(duration, Outcome.BecomeCreature); this.characterDefining = characterDefining;