updating a bunch of calls to makeToken to pass in the Player instead of a Card.

This commit is contained in:
jendave
2011-08-06 09:29:40 +00:00
parent c12b17affb
commit 0dcc77620c
6 changed files with 39 additions and 38 deletions

View File

@@ -6883,7 +6883,7 @@ public class CardFactory implements NewConstants {
@Override
public void resolve() {
CardFactoryUtil.makeToken(t, in, card, col, new String[] {"Creature", t}, 1, 1,
CardFactoryUtil.makeToken(t, in, card.getController(), col, new String[] {"Creature", t}, 1, 1,
new String[] {""});
}
@@ -7502,7 +7502,7 @@ public class CardFactory implements NewConstants {
@Override
public void resolve() {
for(int i = 0; i < card.getCounters(Counters.VERSE); i++) {
CardFactoryUtil.makeToken("Beast", "G 3 3 Beast", card, "G", new String[] {
CardFactoryUtil.makeToken("Beast", "G 3 3 Beast", card.getController(), "G", new String[] {
"Creature", "Beast"}, 3, 3, new String[] {""});
}
AllZone.GameAction.sacrifice(card);
@@ -7789,7 +7789,7 @@ public class CardFactory implements NewConstants {
@Override
public void resolve() {
card.subtractCounter(Counters.HOOFPRINT, 4);
CardFactoryUtil.makeToken("Elemental", "W 4 4 Elemental", card, "W", new String[] {
CardFactoryUtil.makeToken("Elemental", "W 4 4 Elemental", card.getController(), "W", new String[] {
"Creature", "Elemental"}, 4, 4, new String[] {"Flying"});
}
@@ -9703,7 +9703,7 @@ public class CardFactory implements NewConstants {
}//resolve
public void makeToken() {
CardFactoryUtil.makeToken("Thopter", "U 1 1 Thopter", card, "U", new String[] {
CardFactoryUtil.makeToken("Thopter", "U 1 1 Thopter", card.getController(), "U", new String[] {
"Artifact", "Creature", "Thopter"}, 1, 1, new String[] {"Flying"});
}
};
@@ -9800,7 +9800,7 @@ public class CardFactory implements NewConstants {
CardFactoryUtil.makeToken(
"Snake",
"C 1 1 Snake",
card,
card.getController(),
"",
new String[] {"Artifact", "Creature", "Snake"},
1,
@@ -10142,7 +10142,7 @@ public class CardFactory implements NewConstants {
if( (flip == true && choice.equals("heads")) || (flip == false && choice.equals("tails"))) {
JOptionPane.showMessageDialog(null, "Bottle of Suleiman - Win! - "+player+" puts a 5/5 Flying Djinn in play.", "Bottle of Suleiman", JOptionPane.PLAIN_MESSAGE);
CardFactoryUtil.makeToken("Djinn", "C 5 5 Djinn", card, "", new String[] {"Creature", "Artifact", "Djinn"}, 5, 5, new String[] {"Flying"});
CardFactoryUtil.makeToken("Djinn", "C 5 5 Djinn", card.getController(), "", new String[] {"Creature", "Artifact", "Djinn"}, 5, 5, new String[] {"Flying"});
}
else{
JOptionPane.showMessageDialog(null, "Bottle of Suleiman - Lose - Bottle does 5 damage to "+player+".", "Bottle of Suleiman", JOptionPane.PLAIN_MESSAGE);

View File

@@ -11,8 +11,6 @@ import java.util.Map.Entry;
import com.esotericsoftware.minlog.Log;
import forge.Constant.Zone;
public class CardFactoryUtil {
private static Random random = new Random();
@@ -4440,6 +4438,10 @@ public class CardFactoryUtil {
return makeToken("Soldier", "W 1 1 Soldier", controller, "W", new String[] {"Creature", "Soldier"}, 1, 1, new String[] {""});
}
public static CardList makeToken11BRat(Player controller) {
return makeToken("Rat", "B 1 1 Rat", controller, "B", new String[] {"Creature", "Rat"}, 1, 1, new String[] {""});
}
public static CardList makeToken(String name, String imageName, Player controller, String manaCost, String[] types, int baseAttack, int baseDefense, String[] intrinsicKeywords) {
CardList list = new CardList();
Card c = new Card();

View File

@@ -115,7 +115,7 @@ class CardFactory_Auras {
@Override
public void resolve() {
//makeToken();
CardFactoryUtil.makeToken("Caribou", "W 0 1 Caribou", spell.getTargetCard(), "W", new String[] {
CardFactoryUtil.makeToken("Caribou", "W 0 1 Caribou", spell.getTargetCard().getController(), "W", new String[] {
"Creature", "Caribou"}, 0, 1, new String[] {""});
}
/*
@@ -347,7 +347,7 @@ class CardFactory_Auras {
@Override
public void resolve() {
CardFactoryUtil.makeToken("Drake", "GU 2 2 Drake", spell.getTargetCard(), "G U", new String[] {
CardFactoryUtil.makeToken("Drake", "GU 2 2 Drake", spell.getTargetCard().getController(), "G U", new String[] {
"Creature", "Drake"}, 2, 2, new String[] {"Flying"});
//makeToken();
}
@@ -485,7 +485,7 @@ class CardFactory_Auras {
@Override
public void resolve() {
//makeToken();
CardFactoryUtil.makeToken("Squirrel", "G 1 1 Squirrel", spell.getTargetCard(), "G", new String[] {
CardFactoryUtil.makeToken("Squirrel", "G 1 1 Squirrel", spell.getTargetCard().getController(), "G", new String[] {
"Creature", "Squirrel"}, 1, 1, new String[] {""});
}

View File

@@ -1374,7 +1374,7 @@ class CardFactory_Lands {
if(card.getCounters(Counters.ICE) == 0)
{CardFactoryUtil.makeToken("Marit Lage",
"B 20 20 Marit Lage", card, "B", new String[] {"Legendary", "Creature", "Avatar"}, 20,
"B 20 20 Marit Lage", card.getController(), "B", new String[] {"Legendary", "Creature", "Avatar"}, 20,
20, new String[] {"Flying", "Indestructible"});
AllZone.GameAction.sacrifice(card);
}
@@ -1398,7 +1398,7 @@ class CardFactory_Lands {
public void resolve() {
if(card.getCounters(Counters.ICE) == 0) {
CardFactoryUtil.makeToken("Marit Lage",
"B 20 20 Marit Lage", card, "B", new String[] {"Legendary", "Creature", "Avatar"}, 20,
"B 20 20 Marit Lage", card.getController(), "B", new String[] {"Legendary", "Creature", "Avatar"}, 20,
20, new String[] {"Flying", "Indestructible"});
}
AllZone.GameAction.sacrifice(card);
@@ -2055,7 +2055,7 @@ class CardFactory_Lands {
final Ability ability = new Ability(card, "0") {
@Override
public void resolve() {
CardFactoryUtil.makeToken("Spirit", "C 1 1 Spirit", card, "", new String[] {
CardFactoryUtil.makeToken("Spirit", "C 1 1 Spirit", card.getController(), "", new String[] {
"Creature", "Spirit"}, 1, 1, new String[] {""});
}//resolve()
};//Ability

View File

@@ -202,7 +202,7 @@ class CardFactory_Planeswalkers {
card2.addCounterFromNonEffect(Counters.LOYALTY, 1);
turn[0] = AllZone.Phase.getTurn();
CardFactoryUtil.makeToken("Soldier", "W 1 1 Soldier", card2, "W", new String[] {
CardFactoryUtil.makeToken("Soldier", "W 1 1 Soldier", card2.getController(), "W", new String[] {
"Creature", "Soldier"}, 1, 1, new String[] {""});
}
@@ -960,7 +960,7 @@ class CardFactory_Planeswalkers {
//Create token
int n = card.getController().getLife();
CardFactoryUtil.makeToken("Avatar", "W N N Avatar", card2, "W", new String[] {
CardFactoryUtil.makeToken("Avatar", "W N N Avatar", card2.getController(), "W", new String[] {
"Creature", "Avatar"}, n, n,
new String[] {"This creature's power and toughness are each equal to your life total"});
}
@@ -1688,7 +1688,7 @@ class CardFactory_Planeswalkers {
card2.subtractCounter(Counters.LOYALTY, 1);
turn[0] = AllZone.Phase.getTurn();
CardFactoryUtil.makeToken("Beast", "G 3 3 Beast", card2, "G", new String[] {
CardFactoryUtil.makeToken("Beast", "G 3 3 Beast", card2.getController(), "G", new String[] {
"Creature", "Beast"}, 3, 3, new String[] {""});
}
@@ -2693,7 +2693,7 @@ class CardFactory_Planeswalkers {
turn[0] = AllZone.Phase.getTurn();
for(int i = 0; i < 5; i++)
CardFactoryUtil.makeToken("Dragon", "R 4 4 Dragon", card2, "R", new String[] {
CardFactoryUtil.makeToken("Dragon", "R 4 4 Dragon", card2.getController(), "R", new String[] {
"Creature", "Dragon"}, 4, 4, new String[] {"Flying"});
}
@@ -3058,7 +3058,7 @@ class CardFactory_Planeswalkers {
Card target = getTargetCard();
AllZone.GameAction.sacrifice(target);
//in makeToken, use target for source, so it goes into the correct Zone
CardFactoryUtil.makeToken("Dragon", "R 5 5 Dragon", target, "", new String[] {"Creature", "Dragon"}, 5, 5, new String[] {"Flying"});
CardFactoryUtil.makeToken("Dragon", "R 5 5 Dragon", target.getController(), "", new String[] {"Creature", "Dragon"}, 5, 5, new String[] {"Flying"});
}//resolve()
@@ -3317,7 +3317,7 @@ class CardFactory_Planeswalkers {
turn[0] = AllZone.Phase.getTurn();
for (int i=0;i<3;i++)
CardFactoryUtil.makeToken("Soldier", "W 1 1 Soldier", card2, "W", new String[] {
CardFactoryUtil.makeToken("Soldier", "W 1 1 Soldier", card2.getController(), "W", new String[] {
"Creature", "Soldier"}, 1, 1, new String[] {""});
}

View File

@@ -631,8 +631,7 @@ public class CardFactory_Sorceries {
@Override
public void resolve() {
CardFactoryUtil.makeToken("Rat", "B 1 1 Rat", card, "B", new String[] {"Creature", "Rat"}, 1,
1, new String[] {""});
CardFactoryUtil.makeToken11BRat(card.getController());
}//resolve()
};//SpellAbility
@@ -641,8 +640,7 @@ public class CardFactory_Sorceries {
@Override
public void resolve() {
CardFactoryUtil.makeToken("Rat", "B 1 1 Rat", card, "B", new String[] {"Creature", "Rat"}, 1,
1, new String[] {""});
CardFactoryUtil.makeToken11BRat(card.getController());
//return card to the hand
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController());
@@ -1780,7 +1778,7 @@ public class CardFactory_Sorceries {
}//resolve()
void makeToken() {
CardFactoryUtil.makeToken("Giant Warrior", "W 5 5 Giant Warrior", card, "W", new String[] {
CardFactoryUtil.makeToken("Giant Warrior", "W 5 5 Giant Warrior", card.getController(), "W", new String[] {
"Creature", "Giant", "Warrior"}, 5, 5, new String[] {""});
}//makeToken()
@@ -2451,7 +2449,7 @@ public class CardFactory_Sorceries {
for(int i = 0; i < c.length; i++) {
if(c[i].isCreature()) {
AllZone.GameAction.destroyNoRegeneration(c[i]);
CardFactoryUtil.makeToken("Spirit", "W 1 1 Spirit", c[i], "W", new String[] {
CardFactoryUtil.makeToken("Spirit", "W 1 1 Spirit", c[i].getController(), "W", new String[] {
"Creature", "Spirit"}, 1, 1, new String[] {"Flying"});
}
}
@@ -2474,7 +2472,7 @@ public class CardFactory_Sorceries {
all.addAll(AllZone.Computer_Play.getCards());
int Soldiers = card.getXManaCostPaid();
for(int i = 0; i < Soldiers; i++) {
CardFactoryUtil.makeToken("Soldier", "W 1 1 Soldier", card, "W", new String[] {
CardFactoryUtil.makeToken("Soldier", "W 1 1 Soldier", card.getController(), "W", new String[] {
"Creature", "Soldier"}, 1, 1, new String[] {""});
}
if(Soldiers >= 5) {
@@ -3129,7 +3127,7 @@ public class CardFactory_Sorceries {
@Override
public void resolve() {
CardFactoryUtil.makeToken("Beast", "G 3 3 Beast", card, "G",
CardFactoryUtil.makeToken("Beast", "G 3 3 Beast", card.getController(), "G",
new String[] {"Creature", "Beast"}, 3, 3, new String[] {""});
//return card to hand if necessary
@@ -3335,7 +3333,7 @@ public class CardFactory_Sorceries {
}
public void makeToken() {
CardFactoryUtil.makeToken("Bear", "G 2 2 Bear", card, "G", new String[] {"Creature", "Bear"},
CardFactoryUtil.makeToken("Bear", "G 2 2 Bear", card.getController(), "G", new String[] {"Creature", "Bear"},
2, 2, new String[] {""});
}//resolve()
};//SpellAbility
@@ -4394,7 +4392,7 @@ public class CardFactory_Sorceries {
@Override
public void resolve() {
for(int i = 0; i < 6; i++) {
CardFactoryUtil.makeToken("Kor Soldier", "W 1 1 Kor Soldier", card, "W", new String[] {
CardFactoryUtil.makeToken("Kor Soldier", "W 1 1 Kor Soldier", card.getController(), "W", new String[] {
"Creature", "Kor", "Soldier"}, 1, 1, new String[] {""});
}//for
}//resolve()
@@ -4411,7 +4409,7 @@ public class CardFactory_Sorceries {
public void resolve() {
card.setKicked(true);
for(int i = 0; i < 12; i++) {
CardFactoryUtil.makeToken("Kor Soldier", "W 1 1 Kor Soldier", card, "W", new String[] {
CardFactoryUtil.makeToken("Kor Soldier", "W 1 1 Kor Soldier", card.getController(), "W", new String[] {
"Creature", "Kor", "Soldier"}, 1, 1, new String[] {""});
}//for
}//resolve()
@@ -5005,11 +5003,11 @@ public class CardFactory_Sorceries {
@Override
public void resolve() {
CardFactoryUtil.makeToken("Snake", "G 1 1 Snake", card, "G",
CardFactoryUtil.makeToken("Snake", "G 1 1 Snake", card.getController(), "G",
new String[] {"Creature", "Snake"}, 1, 1, new String[] {""});
CardFactoryUtil.makeToken("Wolf", "G 2 2 Wolf", card, "G", new String[] {"Creature", "Wolf"},
CardFactoryUtil.makeToken("Wolf", "G 2 2 Wolf", card.getController(), "G", new String[] {"Creature", "Wolf"},
2, 2, new String[] {""});
CardFactoryUtil.makeToken("Elephant", "G 3 3 Elephant", card, "G", new String[] {
CardFactoryUtil.makeToken("Elephant", "G 3 3 Elephant", card.getController(), "G", new String[] {
"Creature", "Elephant"}, 3, 3, new String[] {""});
}//resolve()
};
@@ -5388,7 +5386,8 @@ public class CardFactory_Sorceries {
public void makeToken()
{
CardFactoryUtil.makeToken("Insect", "G 1 1 Insect", card, "G", new String[]{"Creature", "Insect"}, 1, 1, new String[] {""});
CardFactoryUtil.makeToken("Insect", "G 1 1 Insect", card.getController(), "G",
new String[]{"Creature", "Insect"}, 1, 1, new String[] {""});
}
};
card.clearSpellAbility();
@@ -6003,7 +6002,7 @@ public class CardFactory_Sorceries {
for(int i = 0; i < c.length; i++) {
if(c[i].isCreature()) {
AllZone.GameAction.sacrifice(c[i]);
CardFactoryUtil.makeToken("Hellion", "R 4 4 hellion", c[i], "R", new String[] {
CardFactoryUtil.makeToken("Hellion", "R 4 4 hellion", c[i].getController(), "R", new String[] {
"Creature", "Hellion"}, 4, 4, new String[] {""});
}
}
@@ -6207,7 +6206,7 @@ public class CardFactory_Sorceries {
times = 3;
for (int i=0;i<times;i++)
{
cl = CardFactoryUtil.makeToken("Eldrazi Spawn", "C 0 1 Eldrazi Spawn", card, "", new String[] {
cl = CardFactoryUtil.makeToken("Eldrazi Spawn", "C 0 1 Eldrazi Spawn", card.getController(), "", new String[] {
"Creature", "Eldrazi", "Spawn"}, 0, 1, new String[] {"Sacrifice CARDNAME: Add 1 to your mana pool."});
for (Card crd:cl)
crd.addSpellAbility(CardFactoryUtil.getEldraziSpawnAbility(crd));
@@ -6231,7 +6230,7 @@ public class CardFactory_Sorceries {
AllZone.GameAction.searchLibraryBasicLand(card.getController(),
Constant.Zone.Play, true);
CardList cl = CardFactoryUtil.makeToken("Eldrazi Spawn", "C 0 1 Eldrazi Spawn", card, "", new String[] {
CardList cl = CardFactoryUtil.makeToken("Eldrazi Spawn", "C 0 1 Eldrazi Spawn", card.getController(), "", new String[] {
"Creature", "Eldrazi", "Spawn"}, 0, 1, new String[] {"Sacrifice CARDNAME: Add 1 to your mana pool."});
for (Card crd:cl)
crd.addSpellAbility(CardFactoryUtil.getEldraziSpawnAbility(crd));