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/menu=Play Unlimited Lands This Turn
|
||||||
Display/nolandlimit/button=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/title=Downloading
|
||||||
DownloadPictures/no-more=All card pictures have been downloaded.
|
DownloadPictures/no-more=All card pictures have been downloaded.
|
||||||
|
|
||||||
|
|||||||
@@ -290,6 +290,16 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
//end DevMode UnlimitedLand
|
//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 = {
|
Object[] objDev = {
|
||||||
GuiDisplay4.canLoseByDecking,
|
GuiDisplay4.canLoseByDecking,
|
||||||
@@ -302,7 +312,8 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
|
|||||||
addCounter,
|
addCounter,
|
||||||
tapPerm,
|
tapPerm,
|
||||||
untapPerm,
|
untapPerm,
|
||||||
unlimitedLand
|
unlimitedLand,
|
||||||
|
setLife
|
||||||
};
|
};
|
||||||
for (Object o : objDev) {
|
for (Object o : objDev) {
|
||||||
if (o instanceof ForgeAction)
|
if (o instanceof ForgeAction)
|
||||||
|
|||||||
@@ -1432,5 +1432,26 @@ public class GuiDisplayUtil implements NewConstants {
|
|||||||
public static void devModeUnlimitedLand() {
|
public static void devModeUnlimitedLand() {
|
||||||
AllZone.getHumanPlayer().addMaxLandsToPlay(100);
|
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
|
}//end class GuiDisplayUtil
|
||||||
|
|||||||
@@ -363,6 +363,13 @@ public interface NewConstants {
|
|||||||
String BUTTON = "%s/Display/nolandlimit/button";
|
String BUTTON = "%s/Display/nolandlimit/button";
|
||||||
String MENU = "%s/Display/nolandlimit/menu";
|
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 {
|
public static interface Gui_DownloadPictures {
|
||||||
|
|||||||
Reference in New Issue
Block a user