From 12becca27dda4fbeb9ec9c1484b9a1004e6dea6c Mon Sep 17 00:00:00 2001 From: Marc Zwart Date: Tue, 3 Apr 2018 12:55:45 +0200 Subject: [PATCH] removed unused / bad code + fixed implementations of new tokens --- .../src/mage/cards/k/KinTreeInvocation.java | 6 ++-- Mage.Sets/src/mage/cards/o/OozeGarden.java | 2 +- .../java/mage/game/permanent/token/Token.java | 33 ++----------------- 3 files changed, 7 insertions(+), 34 deletions(-) diff --git a/Mage.Sets/src/mage/cards/k/KinTreeInvocation.java b/Mage.Sets/src/mage/cards/k/KinTreeInvocation.java index 13f9aa87196..69d1faab133 100644 --- a/Mage.Sets/src/mage/cards/k/KinTreeInvocation.java +++ b/Mage.Sets/src/mage/cards/k/KinTreeInvocation.java @@ -109,11 +109,11 @@ class SpiritWarriorToken extends Token { public SpiritWarriorToken(int x) { super("Spirit Warrior", "X/X black and green Spirit Warrior creature token, where X is the greatest toughness among creatures you control"); + this.cardType.add(CardType.CREATURE); this.subtype.add(SubType.SPIRIT); this.subtype.add(SubType.WARRIOR); - ObjectColor objectColor = new ObjectColor(); - objectColor.setBlack(true); - objectColor.setGreen(true); + this.color.setBlack(true); + this.color.setGreen(true); this.power = new MageInt(x); this.toughness = new MageInt(x); } diff --git a/Mage.Sets/src/mage/cards/o/OozeGarden.java b/Mage.Sets/src/mage/cards/o/OozeGarden.java index bf03c21859c..1ceda58a6dc 100644 --- a/Mage.Sets/src/mage/cards/o/OozeGarden.java +++ b/Mage.Sets/src/mage/cards/o/OozeGarden.java @@ -122,9 +122,9 @@ class OozeToken extends Token { public OozeToken(int x) { super("Ooze", "X/X green Ooze creature token, where X is the sacrificed creature's power"); + this.cardType.add(CardType.CREATURE); this.color.addColor(ObjectColor.GREEN); this.subtype.add(SubType.OOZE); - this.toughness = new MageInt(x); this.power = new MageInt(x); } diff --git a/Mage/src/main/java/mage/game/permanent/token/Token.java b/Mage/src/main/java/mage/game/permanent/token/Token.java index dd15c0510b4..8c0df48a6b9 100644 --- a/Mage/src/main/java/mage/game/permanent/token/Token.java +++ b/Mage/src/main/java/mage/game/permanent/token/Token.java @@ -91,19 +91,6 @@ public abstract class Token extends MageObjectImpl { this.toughness.modifyBaseValue(toughness); } - public Token(String name, String description, ObjectColor color, SubTypeList subtype, int power, int toughness, Abilities abilities) { - this(name, description); - this.cardType.add(CardType.CREATURE); - this.color = color.copy(); - this.subtype = subtype; - this.power.modifyBaseValue(power); - this.toughness.modifyBaseValue(toughness); - if (abilities != null) { - this.abilities = abilities.copy(); - } - this.expansionSetCodeChecked = false; - } - public Token(final Token token) { super(token); this.description = token.description; @@ -118,6 +105,9 @@ public abstract class Token extends MageObjectImpl { this.isAllCreatureTypes = token.isAllCreatureTypes; } + @Override + public abstract Token copy(); + private void setTokenDescriptor() { this.tokenDescriptor = tokenDescriptor(); } @@ -157,23 +147,6 @@ public abstract class Token extends MageObjectImpl { abilities.add(ability); } - //@Override - //public abstract Token copy(); - /*{ - return new Token(this); - }*/ - - @Override - public abstract Token copy(); - -// public Token copy() { -// try{ -// return this.getClass().getConstructor(this.getClass()).newInstance(this); -// } catch( Exception e) { -// -// } -// } - public boolean putOntoBattlefield(int amount, Game game, UUID sourceId, UUID controllerId) { return this.putOntoBattlefield(amount, game, sourceId, controllerId, false, false); }