mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
* Fixed that some P/T settings were handled as character defining abilities but they were not.
This commit is contained in:
parent
0ff6dc1a59
commit
6b643fbda8
21 changed files with 98 additions and 79 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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("<i>Chroma</i> - 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) {
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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}")));
|
||||
}
|
||||
|
||||
|
|
|
@ -72,6 +72,14 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu
|
|||
protected List<MageObjectReference> affectedObjectList = new ArrayList<>();
|
||||
protected boolean temporary = false;
|
||||
protected EnumSet<DependencyType> 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<UUID> isDependentTo(List<ContinuousEffect> allEffectsInLayer) {
|
||||
return null;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue