simplify Saproling token creation

This commit is contained in:
jendave
2011-08-06 08:45:50 +00:00
parent 5be7864567
commit a406c4cf82
6 changed files with 17 additions and 41 deletions

View File

@@ -6691,8 +6691,7 @@ public class CardFactory implements NewConstants {
if (AllZone.getZone(c).is(Constant.Zone.Graveyard)){
// target is still in the grave, ability resolves
AllZone.GameAction.exile(c);
CardFactoryUtil.makeToken("Saproling", "G 1 1 Saproling", card, "G", new String[] {
"Creature", "Saproling"}, 1, 1, new String[] {""});
CardFactoryUtil.makeTokenSaproling(card.getController());
}
}
@@ -6749,8 +6748,7 @@ public class CardFactory implements NewConstants {
final SpellAbility nightSoil = new Ability(card, "1") {
@Override
public void resolve() {
CardFactoryUtil.makeToken("Saproling", "G 1 1 Saproling", card, "G", new String[] {
"Creature", "Saproling"}, 1, 1, new String[] {""});
CardFactoryUtil.makeTokenSaproling(card.getController());
}
@Override

View File

@@ -4284,6 +4284,10 @@ public class CardFactoryUtil {
return list;
}
public static CardList makeTokenSaproling(String controller) {
return makeToken("Saproling", "G 1 1 Saproling", controller, "G", new String[] {"Creature", "Saproling"}, 1, 1, new String[] {""});
}
public static CardList makeToken(String name, String imageName, String controller, String manaCost, String[] types, int baseAttack, int baseDefense, String[] intrinsicKeywords) {
CardList list = new CardList();
Card c = new Card();

View File

@@ -9847,20 +9847,11 @@ public class CardFactory_Creatures {
private static final long serialVersionUID = -3882798504865405413L;
public void execute() {
makeToken();
makeToken();
makeToken();
makeToken();
for(int i = 0; i < 4; i++)
CardFactoryUtil.makeTokenSaproling(card.getController());
}//execute()
public void makeToken() {
CardFactoryUtil.makeToken("Saproling", "G 1 1 Saproling", card, "G", new String[] {
"Creature", "Saproling"}, 1, 1, new String[] {""});
}
};//Command
card.addTurnFaceUpCommand(turnsFaceUp);
}//*************** END ************ END **************************
@@ -11434,15 +11425,10 @@ public class CardFactory_Creatures {
}
for(int i = 0; i < numberTokens; i++) {
makeToken();
CardFactoryUtil.makeTokenSaproling(card.getController());
}
}
void makeToken() {
CardFactoryUtil.makeToken("Saproling", "G 1 1 Saproling", card, "G", new String[] {
"Creature", "Saproling"}, 1, 1, new String[] {""});
}//makeToken()
@Override
public boolean canPlay() {
//this is set to false, since it should only TRIGGER
@@ -11558,15 +11544,9 @@ public class CardFactory_Creatures {
final Ability ability = new Ability(card, "0") {
@Override
public void resolve() {
makeToken();
makeToken();
makeToken();
for(int i = 0; i < 3; i++)
CardFactoryUtil.makeTokenSaproling(card.getController());
}//resolve()
void makeToken() {
CardFactoryUtil.makeToken("Saproling", "G 1 1 Saproling", card, "G", new String[] {
"Creature", "Saproling"}, 1, 1, new String[] {""});
}//makeToken()
};//Ability
Command make3Tokens = new Command() {
@@ -11580,7 +11560,6 @@ public class CardFactory_Creatures {
};
card.addDestroyCommand(make3Tokens);
}//*************** END ************ END **************************

View File

@@ -708,9 +708,8 @@ public class CardFactory_Instants {
@Override
public void resolve() {
CardFactoryUtil.makeToken("Saproling", "G 1 1 Saproling", card, "G", new String[] {
"Creature", "Saproling"}, 1, 1, new String[] {""});
}//resolve()
CardFactoryUtil.makeTokenSaproling(card.getController());
}
};//SpellAbility
final SpellAbility spell_two = new Spell(card) {
@@ -718,8 +717,7 @@ public class CardFactory_Instants {
@Override
public void resolve() {
CardFactoryUtil.makeToken("Saproling", "G 1 1 Saproling", card, "G", new String[] {
"Creature", "Saproling"}, 1, 1, new String[] {""});
CardFactoryUtil.makeTokenSaproling(card.getController());
//return card to the hand
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController());
AllZone.GameAction.moveTo(hand, card);

View File

@@ -8298,8 +8298,7 @@ public class CardFactory_Sorceries {
//forest
for(int i = 0; i < numForests; i++)
CardFactoryUtil.makeToken("Saproling", "G 1 1 Saproling", player, "G",
new String[] {"Creature", "Saproling"}, 1, 1, new String[] {""});
CardFactoryUtil.makeTokenSaproling(player);
//plains
AllZone.GameAction.gainLife(player, 2*numPlains);

View File

@@ -8368,8 +8368,7 @@ public class GameActionUtil {
ability = new Ability(list.get(i), "0") {
@Override
public void resolve() {
CardFactoryUtil.makeToken("Saproling", "G 1 1 Saproling", mostLands, "G", new String[] {
"Creature", "Saproling"}, 1, 1, new String[] {""});
CardFactoryUtil.makeTokenSaproling(mostLands);
}// resolve()
};// Ability
ability.setStackDescription("Greener Pastures - " + mostLands
@@ -8628,8 +8627,7 @@ public class GameActionUtil {
}// resolve()
public void makeToken() {
CardFactoryUtil.makeToken("Saproling", "G 1 1 Saproling", card, "G", new String[] {
"Creature", "Saproling"}, 1, 1, new String[] {""});
CardFactoryUtil.makeTokenSaproling(card.getController());
}
};// Ability
ability.setStackDescription("Mycoloth - " + player