diff --git a/Mage.Sets/src/mage/sets/Commander2017.java b/Mage.Sets/src/mage/sets/Commander2017.java index b8c087fde0f..44bdb8329c9 100644 --- a/Mage.Sets/src/mage/sets/Commander2017.java +++ b/Mage.Sets/src/mage/sets/Commander2017.java @@ -222,6 +222,7 @@ public class Commander2017 extends ExpansionSet { cards.add(new SetCardInfo("Nazahn, Revered Bladesmith", 44, Rarity.MYTHIC, mage.cards.n.NazahnReveredBladesmith.class)); cards.add(new SetCardInfo("Necromantic Selection", 117, Rarity.RARE, mage.cards.n.NecromanticSelection.class)); cards.add(new SetCardInfo("Nevinyrral's Disk", 217, Rarity.RARE, mage.cards.n.NevinyrralsDisk.class)); + cards.add(new SetCardInfo("New Blood", 19, Rarity.RARE, mage.cards.n.NewBlood.class)); cards.add(new SetCardInfo("Nihil Spellbomb", 218, Rarity.COMMON, mage.cards.n.NihilSpellbomb.class)); cards.add(new SetCardInfo("Nin, the Pain Artist", 183, Rarity.RARE, mage.cards.n.NinThePainArtist.class)); cards.add(new SetCardInfo("Nissa's Pilgrimage", 155, Rarity.COMMON, mage.cards.n.NissasPilgrimage.class)); diff --git a/Mage/src/main/java/mage/MageObject.java b/Mage/src/main/java/mage/MageObject.java index 7be5a06d3e1..2569ca1acfd 100644 --- a/Mage/src/main/java/mage/MageObject.java +++ b/Mage/src/main/java/mage/MageObject.java @@ -1,10 +1,15 @@ package mage; +import java.io.Serializable; +import java.util.EnumSet; +import java.util.List; +import java.util.UUID; import mage.abilities.Abilities; import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCosts; import mage.abilities.keyword.ChangelingAbility; +import mage.abilities.text.TextPart; import mage.cards.Card; import mage.cards.FrameStyle; import mage.constants.CardType; @@ -14,10 +19,6 @@ import mage.game.Game; import mage.game.events.ZoneChangeEvent; import mage.util.SubTypeList; -import java.io.Serializable; -import java.util.EnumSet; -import java.util.UUID; - public interface MageObject extends MageItem, Serializable { String getName(); @@ -58,7 +59,6 @@ public interface MageObject extends MageItem, Serializable { int getStartingLoyalty(); - void adjustCosts(Ability ability, Game game); void adjustTargets(Ability ability, Game game); @@ -85,7 +85,6 @@ public interface MageObject extends MageItem, Serializable { void setZoneChangeCounter(int value, Game game); - default boolean isCreature() { return getCardType().contains(CardType.CREATURE); } @@ -163,7 +162,6 @@ public interface MageObject extends MageItem, Serializable { return false; } - default boolean shareSubtypes(Card otherCard, Game game) { if (otherCard == null) { @@ -191,7 +189,15 @@ public interface MageObject extends MageItem, Serializable { void setIsAllCreatureTypes(boolean value); - default void addCardTypes(EnumSet cardType){ + default void addCardTypes(EnumSet cardType) { getCardType().addAll(cardType); } + + List getTextParts(); + + TextPart addTextPart(TextPart textPart); + + default void changeSubType(SubType fromSubType, SubType toSubType) { + + } } diff --git a/Mage/src/main/java/mage/MageObjectImpl.java b/Mage/src/main/java/mage/MageObjectImpl.java index 461a3fccd6b..b7b897cb4ff 100644 --- a/Mage/src/main/java/mage/MageObjectImpl.java +++ b/Mage/src/main/java/mage/MageObjectImpl.java @@ -27,6 +27,10 @@ */ package mage; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.List; +import java.util.UUID; import mage.abilities.Abilities; import mage.abilities.AbilitiesImpl; import mage.abilities.Ability; @@ -36,6 +40,8 @@ import mage.abilities.costs.mana.ManaCosts; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.keyword.ChangelingAbility; import mage.abilities.mana.ActivatedManaAbilityImpl; +import mage.abilities.text.TextPart; +import mage.abilities.text.TextPartSubType; import mage.cards.FrameStyle; import mage.constants.CardType; import mage.constants.SubType; @@ -46,10 +52,6 @@ import mage.game.events.ZoneChangeEvent; import mage.util.GameLog; import mage.util.SubTypeList; -import java.util.EnumSet; -import java.util.List; -import java.util.UUID; - public abstract class MageObjectImpl implements MageObject { protected UUID objectId; @@ -68,6 +70,7 @@ public abstract class MageObjectImpl implements MageObject { protected MageInt power; protected MageInt toughness; protected boolean copy; + protected List textParts; public MageObjectImpl() { this(UUID.randomUUID()); @@ -82,6 +85,7 @@ public abstract class MageObjectImpl implements MageObject { frameStyle = FrameStyle.M15_NORMAL; manaCost = new ManaCostsImpl<>(""); abilities = new AbilitiesImpl<>(); + textParts = new ArrayList<>(); } public MageObjectImpl(final MageObjectImpl object) { @@ -99,6 +103,7 @@ public abstract class MageObjectImpl implements MageObject { this.subtype.addAll(object.subtype); supertype.addAll(object.supertype); this.copy = object.copy; + textParts = new ArrayList<>(object.textParts); } @Override @@ -303,13 +308,33 @@ public abstract class MageObjectImpl implements MageObject { } @Override - public boolean isAllCreatureTypes(){ + public boolean isAllCreatureTypes() { return isAllCreatureTypes; } @Override - public void setIsAllCreatureTypes(boolean value){ + public void setIsAllCreatureTypes(boolean value) { isAllCreatureTypes = value; } + @Override + public List getTextParts() { + return textParts; + } + + @Override + public TextPart addTextPart(TextPart textPart) { + textParts.add(textPart); + return textPart; + } + + @Override + public void changeSubType(SubType fromSubType, SubType toSubType) { + for (TextPart textPart : textParts) { + if (textPart instanceof TextPartSubType && textPart.getCurrentValue().equals(fromSubType)) { + textPart.replaceWith(toSubType); + } + } + } + } diff --git a/Mage/src/main/java/mage/abilities/text/TextPart.java b/Mage/src/main/java/mage/abilities/text/TextPart.java new file mode 100644 index 00000000000..03778cb53ed --- /dev/null +++ b/Mage/src/main/java/mage/abilities/text/TextPart.java @@ -0,0 +1,52 @@ +/* + * 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 + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * 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.abilities.text; + +import java.io.Serializable; +import java.util.UUID; +import mage.util.Copyable; + +/** + * + * @author LevelX2 + * @param + */ +public interface TextPart extends Serializable, Copyable { + + UUID getId(); + + String getText(); + + E getBaseValue(); + + E getCurrentValue(); + + void replaceWith(E o); + + void reset(); +} diff --git a/Mage/src/main/java/mage/abilities/text/TextPartColor.java b/Mage/src/main/java/mage/abilities/text/TextPartColor.java new file mode 100644 index 00000000000..280ad78e029 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/text/TextPartColor.java @@ -0,0 +1,90 @@ +/* + * 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 + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * 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.abilities.text; + +import mage.ObjectColor; + +/** + * + * This implementation is not finished yet. There is no support to also change + * the rules text of an object. + * + * @author LevelX2 + */ +public class TextPartColor extends TextPartImpl { + + private final ObjectColor objectColorBase; + private ObjectColor objectColorCurrent; + + public TextPartColor(ObjectColor objectColor) { + this.objectColorBase = objectColor; + this.objectColorCurrent = objectColor; + } + + public TextPartColor(final TextPartColor textPartColor) { + super(); + this.objectColorBase = textPartColor.objectColorBase; + this.objectColorCurrent = textPartColor.objectColorCurrent; + } + + @Override + public String getText() { + return objectColorCurrent.getDescription(); + } + + @Override + public ObjectColor getCurrentValue() { + return objectColorCurrent; + } + + @Override + public ObjectColor getBaseValue() { + return objectColorBase; + } + + @Override + public void replaceWith(ObjectColor objectColor) { + this.objectColorCurrent = objectColor; + } + + @Override + public void reset() { + this.objectColorCurrent = this.objectColorBase; + } + + @Override + public TextPartColor copy() { + return new TextPartColor(this); + } + + @Override + public String toString() { + return objectColorCurrent.toString(); + } + +} diff --git a/Mage/src/main/java/mage/abilities/text/TextPartImpl.java b/Mage/src/main/java/mage/abilities/text/TextPartImpl.java new file mode 100644 index 00000000000..abc79ebfb99 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/text/TextPartImpl.java @@ -0,0 +1,32 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.abilities.text; + +import java.util.UUID; + +/** + * + * @author LevelX2 + * @param + */ +public abstract class TextPartImpl implements TextPart { + + private final UUID id; + + public TextPartImpl() { + this.id = UUID.randomUUID(); + } + + public TextPartImpl(final TextPartImpl textPartimpl) { + this.id = textPartimpl.id; + } + + @Override + public UUID getId() { + return id; + } + +} diff --git a/Mage/src/main/java/mage/abilities/text/TextPartSubType.java b/Mage/src/main/java/mage/abilities/text/TextPartSubType.java new file mode 100644 index 00000000000..ae067fbe062 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/text/TextPartSubType.java @@ -0,0 +1,90 @@ +/* + * 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 + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * 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.abilities.text; + +import mage.constants.SubType; + +/** + * This implementation is not finished yet. There is no support to also change + * the rules text of an object. Also all the cards that user subtypes in the + * text have to be updated with the new elements. + * + * @author LevelX2 + */ +public class TextPartSubType extends TextPartImpl { + + private final SubType subTypeBase; + private SubType subTypeCurrent; + + public TextPartSubType(SubType subType) { + this.subTypeBase = subType; + this.subTypeCurrent = subType; + } + + public TextPartSubType(final TextPartSubType textPartSubType) { + super(); + this.subTypeBase = textPartSubType.subTypeBase; + this.subTypeCurrent = textPartSubType.subTypeCurrent; + } + + @Override + public String getText() { + return subTypeCurrent.getDescription(); + } + + @Override + public SubType getCurrentValue() { + return subTypeCurrent; + } + + @Override + public SubType getBaseValue() { + return subTypeBase; + } + + @Override + public void replaceWith(SubType subType) { + this.subTypeCurrent = subType; + } + + @Override + public void reset() { + this.subTypeCurrent = this.subTypeBase; + } + + @Override + public TextPartSubType copy() { + return new TextPartSubType(this); + } + + @Override + public String toString() { + return subTypeCurrent.toString(); + } + +} diff --git a/Mage/src/main/java/mage/designations/Monarch.java b/Mage/src/main/java/mage/designations/Monarch.java index 7563f8956b2..6f6cd57404e 100644 --- a/Mage/src/main/java/mage/designations/Monarch.java +++ b/Mage/src/main/java/mage/designations/Monarch.java @@ -27,11 +27,14 @@ */ package mage.designations; +import java.util.List; +import java.util.UUID; import mage.MageObject; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.BeginningOfEndStepTriggeredAbility; import mage.abilities.effects.common.BecomesMonarchTargetEffect; import mage.abilities.effects.common.DrawCardTargetEffect; +import mage.abilities.text.TextPart; import mage.constants.TargetController; import mage.constants.Zone; import mage.game.Game; @@ -40,8 +43,6 @@ import mage.game.events.GameEvent; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; -import java.util.UUID; - /** * * @author LevelX2 @@ -73,6 +74,16 @@ public class Monarch extends Designation { public void setIsAllCreatureTypes(boolean value) { } + + @Override + public List getTextParts() { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public TextPart addTextPart(TextPart textPart) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } } // At the beginning of the monarch’s end step, that player draws a card @@ -159,5 +170,4 @@ class MonarchDealsCombatDamageToAPlayerTriggeredAbility extends TriggeredAbility return "Whenever a creature deals combat damage to the monarch, its controller becomes the monarch."; } - } diff --git a/Mage/src/main/java/mage/filter/predicate/mageobject/TextPartSubtypePredicate.java b/Mage/src/main/java/mage/filter/predicate/mageobject/TextPartSubtypePredicate.java new file mode 100644 index 00000000000..a00c4166347 --- /dev/null +++ b/Mage/src/main/java/mage/filter/predicate/mageobject/TextPartSubtypePredicate.java @@ -0,0 +1,34 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.filter.predicate.mageobject; + +import mage.MageObject; +import mage.abilities.text.TextPartSubType; +import mage.filter.predicate.Predicate; +import mage.game.Game; + +/** + * + * @author LevelX2 + */ +public class TextPartSubtypePredicate implements Predicate { + + private final TextPartSubType textPartSubtype; + + public TextPartSubtypePredicate(TextPartSubType textPartSubtype) { + this.textPartSubtype = textPartSubtype; + } + + @Override + public boolean apply(MageObject input, Game game) { + return input.hasSubtype(textPartSubtype.getCurrentValue(), game); + } + + @Override + public String toString() { + return "Subtype(" + textPartSubtype.getCurrentValue() + ')'; + } +} diff --git a/Mage/src/main/java/mage/game/command/Commander.java b/Mage/src/main/java/mage/game/command/Commander.java index 6fe81c42817..b0ee9693dfb 100644 --- a/Mage/src/main/java/mage/game/command/Commander.java +++ b/Mage/src/main/java/mage/game/command/Commander.java @@ -27,6 +27,9 @@ */ package mage.game.command; +import java.util.EnumSet; +import java.util.List; +import java.util.UUID; import mage.MageInt; import mage.ObjectColor; import mage.abilities.Abilities; @@ -36,6 +39,7 @@ import mage.abilities.SpellAbility; import mage.abilities.common.CastCommanderAbility; import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCosts; +import mage.abilities.text.TextPart; import mage.cards.Card; import mage.cards.FrameStyle; import mage.constants.CardType; @@ -46,9 +50,6 @@ import mage.game.events.ZoneChangeEvent; import mage.util.GameLog; import mage.util.SubTypeList; -import java.util.EnumSet; -import java.util.UUID; - public class Commander implements CommandObject { private final Card sourceObject; @@ -229,7 +230,23 @@ public class Commander implements CommandObject { sourceObject.setZoneChangeCounter(value, game); } - public boolean isAllCreatureTypes() { return false;} + @Override + public boolean isAllCreatureTypes() { + return false; + } + + @Override + public void setIsAllCreatureTypes(boolean value) { + } + + @Override + public List getTextParts() { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public TextPart addTextPart(TextPart textPart) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } - public void setIsAllCreatureTypes(boolean value){} } diff --git a/Mage/src/main/java/mage/game/command/Emblem.java b/Mage/src/main/java/mage/game/command/Emblem.java index b0c0e671075..63746bdf6a0 100644 --- a/Mage/src/main/java/mage/game/command/Emblem.java +++ b/Mage/src/main/java/mage/game/command/Emblem.java @@ -27,6 +27,10 @@ */ package mage.game.command; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.List; +import java.util.UUID; import mage.MageInt; import mage.MageObject; import mage.ObjectColor; @@ -36,6 +40,7 @@ import mage.abilities.Ability; import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCosts; import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.text.TextPart; import mage.cards.Card; import mage.cards.FrameStyle; import mage.constants.CardType; @@ -46,18 +51,13 @@ import mage.game.events.ZoneChangeEvent; import mage.util.GameLog; import mage.util.SubTypeList; -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.List; -import java.util.UUID; - /** * @author nantuko */ public class Emblem implements CommandObject { private static EnumSet emptySet = EnumSet.noneOf(CardType.class); - private static List emptyList = new ArrayList(); + private static List emptyList = new ArrayList(); private static ObjectColor emptyColor = new ObjectColor(); private static ManaCosts emptyCost = new ManaCostsImpl(); @@ -268,8 +268,21 @@ public class Emblem implements CommandObject { throw new UnsupportedOperationException("Unsupported operation"); } - public boolean isAllCreatureTypes(){ return false;} + public boolean isAllCreatureTypes() { + return false; + } - public void setIsAllCreatureTypes(boolean value){} + public void setIsAllCreatureTypes(boolean value) { + } + + @Override + public List getTextParts() { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public TextPart addTextPart(TextPart textPart) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } } diff --git a/Mage/src/main/java/mage/game/permanent/PermanentImpl.java b/Mage/src/main/java/mage/game/permanent/PermanentImpl.java index 106e61bcdf2..b0afa82a082 100644 --- a/Mage/src/main/java/mage/game/permanent/PermanentImpl.java +++ b/Mage/src/main/java/mage/game/permanent/PermanentImpl.java @@ -27,6 +27,7 @@ */ package mage.game.permanent; +import java.util.*; import mage.MageObject; import mage.MageObjectReference; import mage.ObjectColor; @@ -36,6 +37,7 @@ import mage.abilities.effects.ContinuousEffect; import mage.abilities.effects.Effect; import mage.abilities.effects.RestrictionEffect; import mage.abilities.keyword.*; +import mage.abilities.text.TextPart; import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.*; @@ -55,8 +57,6 @@ import mage.players.Player; import mage.util.GameLog; import mage.util.ThreadLocalStringBuilder; -import java.util.*; - /** * @author BetaSteward_at_googlemail.com */ @@ -204,6 +204,9 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { this.minBlockedBy = 1; this.maxBlockedBy = 0; this.copy = false; + for (TextPart textPart : textParts) { + textPart.reset(); + } } @Override @@ -1210,7 +1213,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent { @Override public boolean imprint(UUID imprintedCard, Game game) { - if (!game.getExile().containsId(imprintedCard, game)){ + if (!game.getExile().containsId(imprintedCard, game)) { return false; } if (connectedCards.containsKey("imprint")) { diff --git a/Mage/src/main/java/mage/game/stack/Spell.java b/Mage/src/main/java/mage/game/stack/Spell.java index 288f757d9f9..b0815b2ffad 100644 --- a/Mage/src/main/java/mage/game/stack/Spell.java +++ b/Mage/src/main/java/mage/game/stack/Spell.java @@ -45,6 +45,7 @@ import mage.abilities.costs.mana.ManaCost; import mage.abilities.costs.mana.ManaCosts; import mage.abilities.keyword.BestowAbility; import mage.abilities.keyword.MorphAbility; +import mage.abilities.text.TextPart; import mage.cards.Card; import mage.cards.CardsImpl; import mage.cards.FrameStyle; @@ -927,10 +928,23 @@ public class Spell extends StackObjImpl implements Card { return copy; } + @Override public boolean isAllCreatureTypes() { return false; } + @Override public void setIsAllCreatureTypes(boolean value) { } + + @Override + public List getTextParts() { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public TextPart addTextPart(TextPart textPart) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + } diff --git a/Mage/src/main/java/mage/game/stack/StackAbility.java b/Mage/src/main/java/mage/game/stack/StackAbility.java index 3a6158ede3b..8af807bf2df 100644 --- a/Mage/src/main/java/mage/game/stack/StackAbility.java +++ b/Mage/src/main/java/mage/game/stack/StackAbility.java @@ -27,6 +27,10 @@ */ package mage.game.stack; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.List; +import java.util.UUID; import mage.MageInt; import mage.MageObject; import mage.ObjectColor; @@ -39,6 +43,7 @@ import mage.abilities.costs.mana.ManaCosts; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.Effect; import mage.abilities.effects.Effects; +import mage.abilities.text.TextPart; import mage.cards.Card; import mage.cards.FrameStyle; import mage.constants.*; @@ -52,11 +57,6 @@ import mage.util.GameLog; import mage.util.SubTypeList; import mage.watchers.Watcher; -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.List; -import java.util.UUID; - /** * * @author BetaSteward_at_googlemail.com @@ -593,9 +593,23 @@ public class StackAbility extends StackObjImpl implements Ability { return newStackAbility; } - public boolean isAllCreatureTypes(){ + @Override + public boolean isAllCreatureTypes() { return false; } - public void setIsAllCreatureTypes(boolean value){} + @Override + public void setIsAllCreatureTypes(boolean value) { + } + + @Override + public List getTextParts() { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public TextPart addTextPart(TextPart textPart) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + }