From 6b643fbda85d27890ff1fece8e6db8ffe4cf899e Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 31 Dec 2015 18:25:51 +0100 Subject: [PATCH] * Fixed that some P/T settings were handled as character defining abilities but they were not. --- .../commander/SvogthosTheRestlessTomb.java | 3 ++- .../src/mage/sets/eventide/Primalcrux.java | 2 +- .../src/mage/sets/exodus/EntropicSpecter.java | 4 ++- .../sets/scarsofmirrodin/ChimericMass.java | 3 ++- .../mage/sets/timespiral/OpalGuardian.java | 8 +++--- .../mage/sets/urzaslegacy/HiddenGibbons.java | 8 +++--- .../mage/sets/urzaslegacy/OpalChampion.java | 8 +++--- .../mage/sets/urzassaga/HiddenAncients.java | 8 +++--- .../mage/sets/urzassaga/HiddenGuerrillas.java | 11 ++++---- .../src/mage/sets/urzassaga/HiddenSpider.java | 8 +++--- .../src/mage/sets/urzassaga/LurkingEvil.java | 7 +++-- .../mage/sets/urzassaga/OpalArchangel.java | 8 +++--- .../src/mage/sets/urzassaga/OpalCaryatid.java | 8 +++--- .../src/mage/sets/urzassaga/OpalGargoyle.java | 8 +++--- .../sets/worldwake/CelestialColonnade.java | 20 +++++++------- .../effects/ContinuousEffectImpl.java | 17 ++++++++++++ .../continuous/BecomesColorSourceEffect.java | 27 +++++++++---------- .../continuous/BecomesCreatureAllEffect.java | 2 +- .../BecomesCreatureSourceEffect.java | 14 +++++----- .../BecomesCreatureTargetEffect.java | 2 +- .../SetPowerToughnessSourceEffect.java | 1 + 21 files changed, 98 insertions(+), 79 deletions(-) diff --git a/Mage.Sets/src/mage/sets/commander/SvogthosTheRestlessTomb.java b/Mage.Sets/src/mage/sets/commander/SvogthosTheRestlessTomb.java index 20295e5b611..7220c443068 100644 --- a/Mage.Sets/src/mage/sets/commander/SvogthosTheRestlessTomb.java +++ b/Mage.Sets/src/mage/sets/commander/SvogthosTheRestlessTomb.java @@ -58,7 +58,8 @@ public class SvogthosTheRestlessTomb extends CardImpl { // {tap}: Add {C} to your mana pool. 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. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new SvogthosToken(), "land", Duration.EndOfTurn), new ManaCostsImpl<>("{3}{B}{G}")); + // 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}")); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/sets/eventide/Primalcrux.java b/Mage.Sets/src/mage/sets/eventide/Primalcrux.java index 53084edc7ad..e9f024123fa 100644 --- a/Mage.Sets/src/mage/sets/eventide/Primalcrux.java +++ b/Mage.Sets/src/mage/sets/eventide/Primalcrux.java @@ -65,7 +65,7 @@ public class Primalcrux extends CardImpl { // Chroma - Primalcrux's power and toughness are each equal to the number of green mana symbols in the mana costs of permanents you control. Effect effect = new SetPowerToughnessSourceEffect(new ChromaPrimalcruxCount(), Duration.WhileOnBattlefield); effect.setText("Chroma - Primalcrux's power and toughness are each equal to the number of green mana symbols in the mana costs of permanents you control."); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + this.addAbility(new SimpleStaticAbility(Zone.ALL, effect)); } public Primalcrux(final Primalcrux card) { diff --git a/Mage.Sets/src/mage/sets/exodus/EntropicSpecter.java b/Mage.Sets/src/mage/sets/exodus/EntropicSpecter.java index acbe6da3679..33a392b611b 100644 --- a/Mage.Sets/src/mage/sets/exodus/EntropicSpecter.java +++ b/Mage.Sets/src/mage/sets/exodus/EntropicSpecter.java @@ -71,7 +71,9 @@ public class EntropicSpecter extends CardImpl { this.addAbility(new AsEntersBattlefieldAbility(new ChooseOpponentEffect(Outcome.Detriment))); // Entropic Specter's power and toughness are each equal to the number of cards in the chosen player's hand. - this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new CardsInTargetPlayerHandCount(), Duration.WhileOnBattlefield, SubLayer.SetPT_7b))); + this.addAbility(new SimpleStaticAbility(Zone.ALL, + // back to the graveyard or if the choosen player left the gane it's again a 0/0 + new SetPowerToughnessSourceEffect(new CardsInTargetPlayerHandCount(), Duration.WhileOnBattlefield, SubLayer.CharacteristicDefining_7a))); // Whenever Entropic Specter deals damage to a player, that player discards a card. this.addAbility(new DealsDamageToAPlayerTriggeredAbility(new DiscardTargetEffect(1, false), false, true)); diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/ChimericMass.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/ChimericMass.java index ed95ec8d7af..6fef0b8fcdf 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/ChimericMass.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/ChimericMass.java @@ -58,7 +58,8 @@ public class ChimericMass extends CardImpl { this.addAbility(new EntersBattlefieldAbility(new EntersBattlefieldWithXCountersEffect(CounterType.CHARGE.createInstance()))); // {1}: Until end of turn, Chimeric Mass becomes a Construct artifact creature with "This creature's power and toughness are each equal to the number of charge counters on it." - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new ChimericMassToken(), "", Duration.EndOfTurn), new GenericManaCost(1))); + // set to character defining to prevent setting P/T again to 0 becuase already set by CDA of the token + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new ChimericMassToken(), "", Duration.EndOfTurn, false, true), new GenericManaCost(1))); } public ChimericMass(final ChimericMass card) { diff --git a/Mage.Sets/src/mage/sets/timespiral/OpalGuardian.java b/Mage.Sets/src/mage/sets/timespiral/OpalGuardian.java index 56c436d813c..9721f8fc7fd 100644 --- a/Mage.Sets/src/mage/sets/timespiral/OpalGuardian.java +++ b/Mage.Sets/src/mage/sets/timespiral/OpalGuardian.java @@ -50,7 +50,7 @@ import mage.game.permanent.token.Token; /** * * @author LoneFox - + * */ public class OpalGuardian extends CardImpl { @@ -59,10 +59,10 @@ public class OpalGuardian extends CardImpl { this.expansionSetCode = "TSP"; // 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), - new FilterCreatureSpell(), false); + TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new OpalGuardianGargoyle(), "", Duration.WhileOnBattlefield, true, false), + new FilterCreatureSpell(), false); this.addAbility(new ConditionalTriggeredAbility(ability, new SourceMatchesFilterCondition(new FilterEnchantmentPermanent()), - "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.")); + "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.")); } public OpalGuardian(final OpalGuardian card) { diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/HiddenGibbons.java b/Mage.Sets/src/mage/sets/urzaslegacy/HiddenGibbons.java index a2c33c01ae4..1bb78323b90 100644 --- a/Mage.Sets/src/mage/sets/urzaslegacy/HiddenGibbons.java +++ b/Mage.Sets/src/mage/sets/urzaslegacy/HiddenGibbons.java @@ -46,7 +46,7 @@ import mage.game.permanent.token.Token; /** * * @author LoneFox - + * */ public class HiddenGibbons extends CardImpl { @@ -61,10 +61,10 @@ public class HiddenGibbons extends CardImpl { this.expansionSetCode = "ULG"; // 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), - filter, false); + TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new HiddenGibbonsApe(), "", Duration.WhileOnBattlefield, true, false), + filter, false); this.addAbility(new ConditionalTriggeredAbility(ability, new SourceMatchesFilterCondition(new FilterEnchantmentPermanent()), - "When an opponent casts an instant spell, if {this} is an enchantment, {this} becomes a 4/4 Ape creature.")); + "When an opponent casts an instant spell, if {this} is an enchantment, {this} becomes a 4/4 Ape creature.")); } public HiddenGibbons(final HiddenGibbons card) { diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/OpalChampion.java b/Mage.Sets/src/mage/sets/urzaslegacy/OpalChampion.java index a0975dbf769..8aea8384717 100644 --- a/Mage.Sets/src/mage/sets/urzaslegacy/OpalChampion.java +++ b/Mage.Sets/src/mage/sets/urzaslegacy/OpalChampion.java @@ -46,7 +46,7 @@ import mage.game.permanent.token.Token; /** * * @author LoneFox - + * */ public class OpalChampion extends CardImpl { @@ -55,10 +55,10 @@ public class OpalChampion extends CardImpl { this.expansionSetCode = "ULG"; // 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), - new FilterCreatureSpell(), false); + TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new OpalChampionKnight(), "", Duration.WhileOnBattlefield, true, false), + new FilterCreatureSpell(), false); this.addAbility(new ConditionalTriggeredAbility(ability, new SourceMatchesFilterCondition(new FilterEnchantmentPermanent()), - "When an opponent casts a creature spell, if {this} is an enchantment, {this} becomes a 3/3 Knight creature with first strike.")); + "When an opponent casts a creature spell, if {this} is an enchantment, {this} becomes a 3/3 Knight creature with first strike.")); } public OpalChampion(final OpalChampion card) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/HiddenAncients.java b/Mage.Sets/src/mage/sets/urzassaga/HiddenAncients.java index 14a081bac10..29827a7ee6d 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/HiddenAncients.java +++ b/Mage.Sets/src/mage/sets/urzassaga/HiddenAncients.java @@ -46,7 +46,7 @@ import mage.game.permanent.token.Token; /** * * @author LoneFox - + * */ public class HiddenAncients extends CardImpl { @@ -61,10 +61,10 @@ public class HiddenAncients extends CardImpl { this.expansionSetCode = "USG"; // 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 HiddenAncientsTreefolk(), "", Duration.WhileOnBattlefield, true), - filter, false); + TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new HiddenAncientsTreefolk(), "", Duration.WhileOnBattlefield, true, false), + filter, false); this.addAbility(new ConditionalTriggeredAbility(ability, new SourceMatchesFilterCondition(new FilterEnchantmentPermanent()), - "When an opponent casts an enchantment spell, if {this} is an enchantment, {this} becomes a 5/5 Treefolk creature.")); + "When an opponent casts an enchantment spell, if {this} is an enchantment, {this} becomes a 5/5 Treefolk creature.")); } public HiddenAncients(final HiddenAncients card) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/HiddenGuerrillas.java b/Mage.Sets/src/mage/sets/urzassaga/HiddenGuerrillas.java index b17c0756bde..12c1a911118 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/HiddenGuerrillas.java +++ b/Mage.Sets/src/mage/sets/urzassaga/HiddenGuerrillas.java @@ -41,13 +41,12 @@ import mage.constants.Duration; import mage.constants.Rarity; import mage.filter.common.FilterArtifactSpell; import mage.filter.common.FilterEnchantmentPermanent; -import mage.filter.predicate.mageobject.CardTypePredicate; import mage.game.permanent.token.Token; /** * * @author LoneFox - + * */ public class HiddenGuerrillas extends CardImpl { @@ -56,11 +55,11 @@ public class HiddenGuerrillas extends CardImpl { this.expansionSetCode = "USG"; // 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), - new FilterArtifactSpell(), false); + TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new HiddenGuerrillasSoldier(), "", Duration.WhileOnBattlefield, true, false), + new FilterArtifactSpell(), false); this.addAbility(new ConditionalTriggeredAbility(ability, new SourceMatchesFilterCondition(new FilterEnchantmentPermanent()), - "When an opponent casts an artifact spell, if {this} is an enchantment, {this} becomes a 5/3 Soldier creature with trample.")); - } + "When an opponent casts an artifact spell, if {this} is an enchantment, {this} becomes a 5/3 Soldier creature with trample.")); + } public HiddenGuerrillas(final HiddenGuerrillas card) { super(card); diff --git a/Mage.Sets/src/mage/sets/urzassaga/HiddenSpider.java b/Mage.Sets/src/mage/sets/urzassaga/HiddenSpider.java index 06338dcf649..42bb8178529 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/HiddenSpider.java +++ b/Mage.Sets/src/mage/sets/urzassaga/HiddenSpider.java @@ -48,7 +48,7 @@ import mage.game.permanent.token.Token; /** * * @author LoneFox - + * */ public class HiddenSpider extends CardImpl { @@ -63,10 +63,10 @@ public class HiddenSpider extends CardImpl { this.expansionSetCode = "USG"; // 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), - filter, false); + TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new HiddenSpiderToken(), "", Duration.WhileOnBattlefield, true, false), + filter, false); this.addAbility(new ConditionalTriggeredAbility(ability, new SourceMatchesFilterCondition(new FilterEnchantmentPermanent()), - "When an opponent casts a creature spell with flying, if {this} is an enchantment, {this} becomes a 3/5 Spider creature with reach.")); + "When an opponent casts a creature spell with flying, if {this} is an enchantment, {this} becomes a 3/5 Spider creature with reach.")); } public HiddenSpider(final HiddenSpider card) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/LurkingEvil.java b/Mage.Sets/src/mage/sets/urzassaga/LurkingEvil.java index d3958d12dc1..ce966c161d2 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/LurkingEvil.java +++ b/Mage.Sets/src/mage/sets/urzassaga/LurkingEvil.java @@ -55,7 +55,7 @@ public class LurkingEvil extends CardImpl { this.expansionSetCode = "USG"; // 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); + Effect effect = new BecomesCreatureSourceEffect(new LurkingEvilToken(), null, Duration.EndOfGame, true, false); effect.setText("{this} becomes a 4/4 Horror creature with flying"); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new LurkingEvilCost())); } @@ -91,11 +91,10 @@ class LurkingEvilCost extends CostImpl { Player controller = game.getPlayer(controllerId); if (controller != null) { int currentLife = controller.getLife(); - int lifeToPay = (currentLife + currentLife%2) / 2; // Divide by two and round up. + int lifeToPay = (currentLife + currentLife % 2) / 2; // Divide by two and round up. if (lifeToPay < 0) { this.paid = true; - } - else { + } else { this.paid = (controller.loseLife(lifeToPay, game) == lifeToPay); } return this.paid; diff --git a/Mage.Sets/src/mage/sets/urzassaga/OpalArchangel.java b/Mage.Sets/src/mage/sets/urzassaga/OpalArchangel.java index 69bf74d4ce9..12c9becacd7 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/OpalArchangel.java +++ b/Mage.Sets/src/mage/sets/urzassaga/OpalArchangel.java @@ -47,7 +47,7 @@ import mage.game.permanent.token.Token; /** * * @author LoneFox - + * */ public class OpalArchangel extends CardImpl { @@ -56,10 +56,10 @@ public class OpalArchangel extends CardImpl { this.expansionSetCode = "USG"; // 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), - new FilterCreatureSpell(), false); + TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new OpalArchangelToken(), "", Duration.WhileOnBattlefield, true, false), + new FilterCreatureSpell(), false); this.addAbility(new ConditionalTriggeredAbility(ability, new SourceMatchesFilterCondition(new FilterEnchantmentPermanent()), - "When an opponent casts a creature spell, if {this} is an enchantment, {this} becomes a 5/5 Angel creature with flying and vigilance.")); + "When an opponent casts a creature spell, if {this} is an enchantment, {this} becomes a 5/5 Angel creature with flying and vigilance.")); } public OpalArchangel(final OpalArchangel card) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/OpalCaryatid.java b/Mage.Sets/src/mage/sets/urzassaga/OpalCaryatid.java index 3981a15928c..523c33d4b7d 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/OpalCaryatid.java +++ b/Mage.Sets/src/mage/sets/urzassaga/OpalCaryatid.java @@ -45,7 +45,7 @@ import mage.game.permanent.token.Token; /** * * @author LoneFox - + * */ public class OpalCaryatid extends CardImpl { @@ -54,10 +54,10 @@ public class OpalCaryatid extends CardImpl { this.expansionSetCode = "USG"; // 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 OpalCaryatidSoldier(), "", Duration.WhileOnBattlefield, true), - new FilterCreatureSpell(), false); + TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new OpalCaryatidSoldier(), "", Duration.WhileOnBattlefield, true, false), + new FilterCreatureSpell(), false); this.addAbility(new ConditionalTriggeredAbility(ability, new SourceMatchesFilterCondition(new FilterEnchantmentPermanent()), - "When an opponent casts a creature spell, if {this} is an enchantment, {this} becomes a 2/2 Soldier creature.")); + "When an opponent casts a creature spell, if {this} is an enchantment, {this} becomes a 2/2 Soldier creature.")); } public OpalCaryatid(final OpalCaryatid card) { diff --git a/Mage.Sets/src/mage/sets/urzassaga/OpalGargoyle.java b/Mage.Sets/src/mage/sets/urzassaga/OpalGargoyle.java index 5575a46eef3..53212ca31b2 100644 --- a/Mage.Sets/src/mage/sets/urzassaga/OpalGargoyle.java +++ b/Mage.Sets/src/mage/sets/urzassaga/OpalGargoyle.java @@ -46,7 +46,7 @@ import mage.game.permanent.token.Token; /** * * @author LoneFox - + * */ public class OpalGargoyle extends CardImpl { @@ -55,10 +55,10 @@ public class OpalGargoyle extends CardImpl { this.expansionSetCode = "USG"; // 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), - new FilterCreatureSpell(), false); + TriggeredAbility ability = new SpellCastOpponentTriggeredAbility(new BecomesCreatureSourceEffect(new OpalGargoyleToken(), "", Duration.WhileOnBattlefield, true, false), + new FilterCreatureSpell(), false); this.addAbility(new ConditionalTriggeredAbility(ability, new SourceMatchesFilterCondition(new FilterEnchantmentPermanent()), - "When an opponent casts a creature spell, if {this} is an enchantment, {this} becomes a 2/2 Gargoyle creature with flying.")); + "When an opponent casts a creature spell, if {this} is an enchantment, {this} becomes a 2/2 Gargoyle creature with flying.")); } public OpalGargoyle(final OpalGargoyle card) { diff --git a/Mage.Sets/src/mage/sets/worldwake/CelestialColonnade.java b/Mage.Sets/src/mage/sets/worldwake/CelestialColonnade.java index faa890e7933..9357fa5980f 100644 --- a/Mage.Sets/src/mage/sets/worldwake/CelestialColonnade.java +++ b/Mage.Sets/src/mage/sets/worldwake/CelestialColonnade.java @@ -1,16 +1,16 @@ /* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. - * + * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR @@ -20,19 +20,14 @@ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.sets.worldwake; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; -import mage.constants.Zone; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTappedAbility; import mage.abilities.common.SimpleActivatedAbility; @@ -43,6 +38,10 @@ import mage.abilities.keyword.VigilanceAbility; import mage.abilities.mana.BlueManaAbility; import mage.abilities.mana.WhiteManaAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; import mage.game.permanent.token.Token; /** @@ -57,6 +56,7 @@ public class CelestialColonnade extends CardImpl { this.addAbility(new EntersBattlefieldTappedAbility()); this.addAbility(new BlueManaAbility()); this.addAbility(new WhiteManaAbility()); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new CelestialColonnadeToken(), "land", Duration.EndOfTurn), new ManaCostsImpl("{3}{W}{U}"))); } diff --git a/Mage/src/main/java/mage/abilities/effects/ContinuousEffectImpl.java b/Mage/src/main/java/mage/abilities/effects/ContinuousEffectImpl.java index 0d2a81670be..83e04a6493d 100644 --- a/Mage/src/main/java/mage/abilities/effects/ContinuousEffectImpl.java +++ b/Mage/src/main/java/mage/abilities/effects/ContinuousEffectImpl.java @@ -72,6 +72,14 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu protected List affectedObjectList = new ArrayList<>(); protected boolean temporary = false; protected EnumSet dependencyTypes; + /* + A Characteristic Defining Ability (CDA) is an ability that defines a characteristic of a card or token. + There are 3 specific rules that distinguish a CDA from other abilities. + 1) A CDA can only define a characteristic of either the card or token it comes from. + 2) A CDA can not be triggered, activated, or conditional. + 3) A CDA must define a characteristic. Usually color, power and/or toughness, or sub-type. + */ + protected boolean characterDefining = false; // until your next turn protected int startingTurn; @@ -105,6 +113,7 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu this.startingTurn = effect.startingTurn; this.startingControllerId = effect.startingControllerId; this.dependencyTypes = effect.dependencyTypes; + this.characterDefining = effect.characterDefining; } @Override @@ -256,6 +265,14 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu this.temporary = temporary; } + public boolean isCharacterDefining() { + return characterDefining; + } + + public void setCharacterDefining(boolean characterDefining) { + this.characterDefining = characterDefining; + } + @Override public Set isDependentTo(List allEffectsInLayer) { return null; diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesColorSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesColorSourceEffect.java index 89f5c58ad6d..c945fbcd2a8 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesColorSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesColorSourceEffect.java @@ -30,7 +30,6 @@ */ package mage.abilities.effects.common.continuous; -import java.util.UUID; import mage.MageObject; import mage.ObjectColor; import mage.abilities.Ability; @@ -73,24 +72,23 @@ public class BecomesColorSourceEffect extends ContinuousEffectImpl { @Override public void init(Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); - if(controller == null) { + if (controller == null) { return; } - if(setColor == null) { + if (setColor == null) { ChoiceColor choice = new ChoiceColor(); - while(!choice.isChosen()) { + while (!choice.isChosen()) { controller.choose(Outcome.PutManaInPool, choice, game); - if(!controller.canRespond()) { + if (!controller.canRespond()) { return; } } - if(choice.getColor() != null) { + if (choice.getColor() != null) { setColor = choice.getColor(); - } - else { + } else { return; } - if(!game.isSimulation()) { + if (!game.isSimulation()) { game.informPlayers(controller.getLogName() + " has chosen the color: " + setColor.toString()); } } @@ -103,12 +101,11 @@ public class BecomesColorSourceEffect extends ContinuousEffectImpl { if (controller == null) { return false; } - if(setColor != null) { + if (setColor != null) { MageObject sourceObject = game.getObject(source.getSourceId()); - if(sourceObject != null) { + if (sourceObject != null) { sourceObject.getColor(game).setColor(setColor); - } - else { + } else { this.discard(); } return true; @@ -119,10 +116,10 @@ public class BecomesColorSourceEffect extends ContinuousEffectImpl { @Override public String getText(Mode mode) { - if(staticText != null && !staticText.isEmpty()) { + if (staticText != null && !staticText.isEmpty()) { return staticText; } return "{this} becomes " + (setColor == null ? "the color of your choice" : setColor.getDescription()) - + " " + duration.toString(); + + " " + duration.toString(); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAllEffect.java index b01e282fb33..54fff31ff99 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureAllEffect.java @@ -102,7 +102,7 @@ public class BecomesCreatureAllEffect extends ContinuousEffectImpl { if (sublayer == SubLayer.NA) { if (token.getAbilities().size() > 0) { for (Ability ability : token.getAbilities()) { - permanent.addAbility(ability, game); + permanent.addAbility(ability, source.getSourceId(), game); } } } 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 b751dd98092..c8606d07b8b 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 @@ -51,18 +51,19 @@ public class BecomesCreatureSourceEffect extends ContinuousEffectImpl implements protected String type; protected boolean losePreviousTypes; - public BecomesCreatureSourceEffect(Token token, String type, Duration duration, boolean losePreviousTypes) { + public BecomesCreatureSourceEffect(Token token, String type, Duration duration) { + this(token, type, duration, false, false); + } + + public BecomesCreatureSourceEffect(Token token, String type, Duration duration, boolean losePreviousTypes, boolean characterDefining) { super(duration, Outcome.BecomeCreature); + this.characterDefining = characterDefining; this.token = token; this.type = type; this.losePreviousTypes = losePreviousTypes; setText(); } - public BecomesCreatureSourceEffect(Token token, String type, Duration duration) { - this(token, type, duration, false); - } - public BecomesCreatureSourceEffect(final BecomesCreatureSourceEffect effect) { super(effect); this.token = effect.token.copy(); @@ -130,7 +131,8 @@ public class BecomesCreatureSourceEffect extends ContinuousEffectImpl implements } break; case PTChangingEffects_7: - if (sublayer == SubLayer.CharacteristicDefining_7a) { + if ((sublayer == SubLayer.CharacteristicDefining_7a && isCharacterDefining()) + || (sublayer == SubLayer.SetPT_7b && !isCharacterDefining())) { MageInt power = token.getPower(); MageInt toughness = token.getToughness(); if (power != null && toughness != null) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTargetEffect.java index 56495fa1932..25181520e27 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/BecomesCreatureTargetEffect.java @@ -136,7 +136,7 @@ public class BecomesCreatureTargetEffect extends ContinuousEffectImpl { } break; case PTChangingEffects_7: - if (sublayer == SubLayer.CharacteristicDefining_7a) { + if (sublayer == SubLayer.SetPT_7b) { // CDA can only define a characteristic of either the card or token it comes from. permanent.getToughness().setValue(token.getToughness().getValue()); permanent.getPower().setValue(token.getPower().getValue()); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java index 85333968831..36e4ec09c10 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java @@ -53,6 +53,7 @@ public class SetPowerToughnessSourceEffect extends ContinuousEffectImpl { public SetPowerToughnessSourceEffect(DynamicValue amount, Duration duration, SubLayer subLayer) { super(duration, Layer.PTChangingEffects_7, subLayer, Outcome.BoostCreature); + setCharacterDefining(subLayer.equals(SubLayer.CharacteristicDefining_7a)); this.amount = amount; staticText = "{this}'s power and toughness are each equal to the number of " + amount.getMessage(); }