mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
add a Set Player Life option in DevMode
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user