diff --git a/Mage.Sets/src/mage/cards/k/KinTreeInvocation.java b/Mage.Sets/src/mage/cards/k/KinTreeInvocation.java index ce2d9bad3cb..13f9aa87196 100644 --- a/Mage.Sets/src/mage/cards/k/KinTreeInvocation.java +++ b/Mage.Sets/src/mage/cards/k/KinTreeInvocation.java @@ -28,6 +28,8 @@ package mage.cards.k; import java.util.UUID; + +import mage.MageInt; import mage.ObjectColor; import mage.abilities.AbilitiesImpl; import mage.abilities.Ability; @@ -91,18 +93,36 @@ class KinTreeInvocationCreateTokenEffect extends OneShotEffect { value = permanent.getToughness().getValue(); } } - - SubTypeList list = new SubTypeList(); - list.add(SubType.SPIRIT); - list.add(SubType.WARRIOR); - ObjectColor objectColor = new ObjectColor(); - objectColor.setBlack(true); - objectColor.setGreen(true); - Token token = new Token("Spirit Warrior", "X/X black and green Spirit Warrior creature token, where X is the greatest toughness among creatures you control", - objectColor, list, value, value, new AbilitiesImpl<>()); + Token token = new SpiritWarriorToken(value); token.getAbilities().newId(); // neccessary if token has ability like DevourAbility() token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); return true; } } + +class SpiritWarriorToken extends Token { + + public SpiritWarriorToken() { + this(1); + } + + 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.subtype.add(SubType.SPIRIT); + this.subtype.add(SubType.WARRIOR); + ObjectColor objectColor = new ObjectColor(); + objectColor.setBlack(true); + objectColor.setGreen(true); + this.power = new MageInt(x); + this.toughness = new MageInt(x); + } + + public SpiritWarriorToken(final SpiritWarriorToken token) { + super(token); + } + + public SpiritWarriorToken copy() { + return new SpiritWarriorToken(this); + } +} diff --git a/Mage.Sets/src/mage/cards/o/OozeGarden.java b/Mage.Sets/src/mage/cards/o/OozeGarden.java index 6968753340b..bf03c21859c 100644 --- a/Mage.Sets/src/mage/cards/o/OozeGarden.java +++ b/Mage.Sets/src/mage/cards/o/OozeGarden.java @@ -28,6 +28,8 @@ package mage.cards.o; import java.util.UUID; + +import mage.MageInt; import mage.ObjectColor; import mage.abilities.AbilitiesImpl; import mage.abilities.Ability; @@ -105,17 +107,33 @@ class OozeGardenCreateTokenEffect extends OneShotEffect { value = ((SacrificeTargetCost)cost).getPermanents().get(0).getPower().getValue(); } } - SubTypeList list = new SubTypeList(); - list.add(SubType.OOZE); - Token token = new Token("Ooze", "X/X green Ooze creature token, where X is the sacrificed creature's power", ObjectColor.GREEN, list, value, value, new AbilitiesImpl<>()) { - - - }; + Token token = new OozeToken(value); token.getAbilities().newId(); // neccessary if token has ability like DevourAbility() token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId()); return true; } - - } +class OozeToken extends Token { + + public OozeToken() { + this(1); + } + + public OozeToken(int x) { + super("Ooze", "X/X green Ooze creature token, where X is the sacrificed creature's power"); + this.color.addColor(ObjectColor.GREEN); + this.subtype.add(SubType.OOZE); + + this.toughness = new MageInt(x); + this.power = new MageInt(x); + } + + public OozeToken(final OozeToken token) { + super(token); + } + + public OozeToken copy() { + return new OozeToken(this); + } +} \ No newline at end of file