- Updated the code for Creakwood Liege, it now creates a token named "bg_1_1_worm.jpg".

This commit is contained in:
jendave
2011-08-06 13:02:58 +00:00
parent 74063f5895
commit fae09458d3

View File

@@ -11297,45 +11297,41 @@ public class GameActionUtil {
}// for }// for
}// upkeep_Fledgling_Djinn() }// upkeep_Fledgling_Djinn()
private static void upkeep_Creakwood_Liege() { private static void upkeep_Creakwood_Liege() {
final Player player = AllZone.Phase.getPlayerTurn(); final Player player = AllZone.Phase.getPlayerTurn();
PlayerZone playZone = AllZone.getZone(Constant.Zone.Play, player); PlayerZone playZone = AllZone.getZone(Constant.Zone.Play, player);
CardList list = new CardList(playZone.getCards()); CardList list = new CardList(playZone.getCards());
list = list.getName("Creakwood Liege"); list = list.getName("Creakwood Liege");
Ability ability; Ability ability;
for(int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
final Card crd = list.get(i); final Card crd = list.get(i);
ability = new Ability(list.get(i), "0") { ability = new Ability(list.get(i), "0") {
@Override @Override
public void resolve() { public void resolve() {
String[] choices = {"Yes", "No"};
Object q = null; if (player.equals(AllZone.HumanPlayer)) {
if(player.equals(AllZone.HumanPlayer)) { String question = "Put a 1/1 black and green Worm creature token onto the battlefield?";
q = AllZone.Display.getChoiceOptional("Use Creakwood Liege?", choices); if (showYesNoDialog(crd, question)) {
CardFactoryUtil.makeToken("Worm", "BG 1 1 Worm", crd.getController(), "BG",
new String[] {"Creature", "Worm"}, 1, 1, new String[] {""});
}
} else {
CardFactoryUtil.makeToken("Worm", "BG 1 1 Worm", crd.getController(), "BG",
new String[] {"Creature", "Worm"}, 1, 1, new String[] {""});
}
}// resolve()
};// Ability
if(q == null || q.equals("No")) return; StringBuilder sb = new StringBuilder();
if(q.equals("Yes")) { sb.append("Creakwood Liege - ").append(player);
CardFactoryUtil.makeToken("Worm", "B G 1 1 Worm", crd.getController(), "B G", new String[] { sb.append(" puts a 1/1 Green Black Worm creature token into play.");
"Creature", "Worm"}, 1, 1, new String[] {""}); ability.setStackDescription(sb.toString());
}
} else if(player.equals(AllZone.ComputerPlayer)) {
CardFactoryUtil.makeToken("Worm", "B G 1 1 Worm", crd.getController(), "B G", new String[] {
"Creature", "Worm"}, 1, 1, new String[] {""});
}
}// resolve()
};// Ability
StringBuilder sb = new StringBuilder(); AllZone.Stack.add(ability);
sb.append("Creakwood Liege - ").append(player); }// for
sb.append(" puts a 1/1 Green Black Worm creature token into play."); }// upkeep_Creakwood_Liege
ability.setStackDescription(sb.toString());
AllZone.Stack.add(ability);
}// for
}// upkeep_Creakwood_Liege
private static void upkeep_Murkfiend_Liege() private static void upkeep_Murkfiend_Liege()
{ {