Refactor - moved OozeToken to shared area

This commit is contained in:
JOAC69 2016-09-25 00:16:01 -05:00
parent d3160fb861
commit a5c6cdd9cf
8 changed files with 49 additions and 96 deletions

View file

@ -27,21 +27,21 @@
*/
package mage.sets.gatecrash;
import java.util.List;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.Token;
import mage.game.permanent.token.OozeToken;
import mage.players.Player;
import java.util.List;
import java.util.UUID;
/**
*
* @author LevelX2
@ -103,15 +103,3 @@ class MimingSlimeEffect extends OneShotEffect {
return false;
}
}
class OozeToken extends Token {
public OozeToken() {
super("Ooze", "X/X green Ooze creature token");
cardType.add(CardType.CREATURE);
subtype.add("Ooze");
color.setGreen(true);
power = new MageInt(0);
toughness = new MageInt(0);
setOriginalExpansionSetCode("RTR");
}
}

View file

@ -42,6 +42,7 @@ import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.token.OozeToken;
import mage.game.permanent.token.Token;
/**

View file

@ -35,6 +35,7 @@ import mage.MageInt;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.game.permanent.token.OozeToken;
import mage.game.permanent.token.Token;
/**
@ -74,18 +75,6 @@ class Ooze2Token extends Token {
color.setGreen(true);
power = new MageInt(2);
toughness = new MageInt(2);
this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new Ooze1Token(), 2), false));
}
}
class Ooze1Token extends Token {
public Ooze1Token() {
super("Ooze", "1/1 green Ooze creature tokens");
cardType.add(CardType.CREATURE);
subtype.add("Ooze");
color.setGreen(true);
power = new MageInt(1);
toughness = new MageInt(1);
this.addAbility(new DiesTriggeredAbility(new CreateTokenEffect(new OozeToken(new MageInt(1), new MageInt(1)), 2), false));
}
}

View file

@ -27,17 +27,16 @@
*/
package mage.sets.returntoravnica;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.game.Game;
import mage.game.permanent.token.Token;
import mage.game.permanent.token.OozeToken;
import java.util.UUID;
/**
*
@ -91,16 +90,3 @@ class SlimeMoldingEffect extends OneShotEffect {
return new SlimeMoldingEffect(this);
}
}
class OozeToken extends Token {
public OozeToken() {
super("Ooze", "X/X green ooze creature token");
cardType.add(CardType.CREATURE);
color.setGreen(true);
subtype.add("Ooze");
power = new MageInt(0);
toughness = new MageInt(0);
}
}

View file

@ -31,13 +31,12 @@ import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.constants.Outcome;
import mage.game.Game;
import mage.game.permanent.token.Token;
import mage.game.permanent.token.OozeToken;
/**
*
@ -92,14 +91,3 @@ class GelatinousGenesisEffect extends OneShotEffect {
}
}
class OozeToken extends Token {
public OozeToken() {
super("Ooze", "X/X green ooze creature token");
cardType.add(CardType.CREATURE);
color.setGreen(true);
subtype.add("Ooze");
power = new MageInt(0);
toughness = new MageInt(0);
}
}

View file

@ -27,7 +27,6 @@
*/
package mage.sets.shadowsoverinnistrad;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.condition.common.DeliriumCondition;
@ -36,7 +35,9 @@ import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.game.permanent.token.Token;
import mage.game.permanent.token.OozeToken;
import java.util.UUID;
/**
*
@ -53,7 +54,7 @@ public class InexorableBlob extends CardImpl {
// <i>Delirium</i> &mdash; Whenever Inexorable Blob attacks and there are at least four card types among cards in your graveyard,
// put a 3/3 green Ooze creature token onto the battlefield tapped and attacking.
this.addAbility(new ConditionalTriggeredAbility(new AttacksTriggeredAbility(new CreateTokenEffect(new OozeToken(), 1, true, true), false),
this.addAbility(new ConditionalTriggeredAbility(new AttacksTriggeredAbility(new CreateTokenEffect(new OozeToken(new MageInt(3), new MageInt(3)), 1, true, true), false),
DeliriumCondition.getInstance(),
"<i>Delirium</i> &mdash; Whenever {this} attacks and there are at least four card types among cards in your graveyard, "
+ "put a 3/3 green Ooze creature token onto the battlefield tapped and attacking."));
@ -68,15 +69,3 @@ public class InexorableBlob extends CardImpl {
return new InexorableBlob(this);
}
}
class OozeToken extends Token {
public OozeToken() {
super("Ooze", "3/3 green Ooze creature token");
cardType.add(CardType.CREATURE);
subtype.add("Ooze");
color.setGreen(true);
power = new MageInt(3);
toughness = new MageInt(3);
}
}

View file

@ -27,9 +27,6 @@
*/
package mage.sets.worldwake;
import java.util.UUID;
import mage.constants.*;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DiesAttachedTriggeredAbility;
@ -39,10 +36,13 @@ import mage.abilities.effects.common.ReturnToHandAttachedEffect;
import mage.abilities.effects.common.continuous.BecomesCreatureAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.game.permanent.token.Token;
import mage.constants.*;
import mage.game.permanent.token.OozeToken;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
import java.util.UUID;
/**
*
* @author jeffwadsworth
@ -65,7 +65,7 @@ public class CorruptedZendikon extends CardImpl {
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
Ability ability2 = new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesCreatureAttachedEffect(new OozeToken(), "Enchanted land is a 3/3 black Ooze creature. It's still a land.", Duration.WhileOnBattlefield));
Ability ability2 = new SimpleStaticAbility(Zone.BATTLEFIELD, new BecomesCreatureAttachedEffect(new OozeToken(new MageInt(3), new MageInt(3)), "Enchanted land is a 3/3 black Ooze creature. It's still a land.", Duration.WhileOnBattlefield));
this.addAbility(ability2);
Ability ability3 = new DiesAttachedTriggeredAbility(new ReturnToHandAttachedEffect(), "enchanted land", false, false);
@ -81,15 +81,3 @@ public class CorruptedZendikon extends CardImpl {
return new CorruptedZendikon(this);
}
}
class OozeToken extends Token {
OozeToken() {
super("Ooze", "3/3 black Ooze creature");
cardType.add(CardType.CREATURE);
color.setBlack(true);
subtype.add("Ooze");
power = new MageInt(3);
toughness = new MageInt(3);
}
}

View file

@ -0,0 +1,24 @@
package mage.game.permanent.token;
import mage.MageInt;
import mage.constants.CardType;
public class OozeToken extends Token {
public OozeToken(MageInt power, MageInt toughness) {
super("Ooze", power + "/" + toughness + " green ooze creature token");
cardType.add(CardType.CREATURE);
color.setGreen(true);
subtype.add("Ooze");
power = new MageInt(0);
toughness = new MageInt(0);
}
public OozeToken() {
super("Ooze", "X/X green ooze creature token");
cardType.add(CardType.CREATURE);
color.setGreen(true);
subtype.add("Ooze");
power = new MageInt(0);
toughness = new MageInt(0);
}
}