mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
add a Set Player Life option in DevMode
This commit is contained in:
@@ -71,6 +71,9 @@ Display/untapperm/button=Untap Permanent
|
||||
Display/nolandlimit/menu=Play Unlimited Lands This Turn
|
||||
Display/nolandlimit/button=Play Unlimited Lands This Turn
|
||||
|
||||
Display/setlife/menu=Set Player Life
|
||||
Display/setlife/button=Set Player Life
|
||||
|
||||
DownloadPictures/title=Downloading
|
||||
DownloadPictures/no-more=All card pictures have been downloaded.
|
||||
|
||||
|
||||
@@ -291,6 +291,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,
|
||||
viewAIHand,
|
||||
@@ -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)
|
||||
|
||||
@@ -1433,4 +1433,25 @@ public class GuiDisplayUtil implements NewConstants {
|
||||
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