add a Set Player Life option in DevMode

This commit is contained in:
slapshot5
2011-08-23 04:57:30 +00:00
parent 943057865a
commit 7ec3016fef
4 changed files with 43 additions and 1 deletions

View File

@@ -290,6 +290,16 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
}
};
//end DevMode UnlimitedLand
//DevMode SetLife
ForgeAction setLife = new ForgeAction(SETLIFE) {
private static final long serialVersionUID = -1750588303928974918L;
public void actionPerformed(ActionEvent arg0) {
GuiDisplayUtil.devModeSetLife();
}
};
//end DevMode AddCounter
Object[] objDev = {
GuiDisplay4.canLoseByDecking,
@@ -302,7 +312,8 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
addCounter,
tapPerm,
untapPerm,
unlimitedLand
unlimitedLand,
setLife
};
for (Object o : objDev) {
if (o instanceof ForgeAction)

View File

@@ -1432,5 +1432,26 @@ public class GuiDisplayUtil implements NewConstants {
public static void devModeUnlimitedLand() {
AllZone.getHumanPlayer().addMaxLandsToPlay(100);
}
/**
* <p>devModeSetLife.</p>
*
* @since 1.1.3
*/
public static void devModeSetLife() {
ArrayList<Player> players = AllZoneUtil.getPlayersInGame();
Object o = GuiUtils.getChoiceOptional("Set life for which player?", players.toArray());
if (null == o) return;
else {
Player p = (Player) o;
Integer integers[] = new Integer[99];
for(int j = 0; j < 99; j++) integers[j] = Integer.valueOf(j);
Integer i = GuiUtils.getChoiceOptional("Set life to what?", integers);
if (null == i) return;
else {
p.setLife(i, null);
}
}
}
}//end class GuiDisplayUtil

View File

@@ -363,6 +363,13 @@ public interface NewConstants {
String BUTTON = "%s/Display/nolandlimit/button";
String MENU = "%s/Display/nolandlimit/menu";
}
String SETLIFE = "%s/Display/setlife";
public static interface SETLIFE {
String BUTTON = "%s/Display/setlife/button";
String MENU = "%s/Display/setlife/menu";
}
}
public static interface Gui_DownloadPictures {