forked from len0rd/rockbox
Superdom: added option for persistent units
Change-Id: I4c28f3c567ed435ba7aee36c8b54c76fc75e12aa Reviewed-on: http://gerrit.rockbox.org/943 Reviewed-by: Michael Giacomelli <giac2000@hotmail.com>
This commit is contained in:
parent
ad79a90e39
commit
333a82c8eb
1 changed files with 13 additions and 4 deletions
|
|
@ -176,6 +176,7 @@ static struct settings {
|
||||||
*/
|
*/
|
||||||
int compdiff;
|
int compdiff;
|
||||||
bool spoil_enabled;
|
bool spoil_enabled;
|
||||||
|
bool persistent_units;
|
||||||
} superdom_settings;
|
} superdom_settings;
|
||||||
|
|
||||||
static struct resources humanres;
|
static struct resources humanres;
|
||||||
|
|
@ -529,7 +530,7 @@ static int settings_menu(void)
|
||||||
MENUITEM_STRINGLIST(menu, "Super Domination Settings", NULL,
|
MENUITEM_STRINGLIST(menu, "Super Domination Settings", NULL,
|
||||||
"Computer starting farms", "Computer starting factories",
|
"Computer starting farms", "Computer starting factories",
|
||||||
"Human starting farms", "Human starting factories",
|
"Human starting farms", "Human starting factories",
|
||||||
"Starting cash", "Starting food", "Computer difficulty","Food spoilage", "Moves per turn");
|
"Starting cash", "Starting food", "Computer difficulty","Food spoilage", "Persistent units", "Moves per turn");
|
||||||
|
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
|
|
@ -582,6 +583,10 @@ static int settings_menu(void)
|
||||||
0, "Disabled", 0, NULL);
|
0, "Disabled", 0, NULL);
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
|
rb->set_bool_options("Persistent units", &superdom_settings.persistent_units, "Enabled", 0,
|
||||||
|
"Disabled", 0, NULL);
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
rb->set_int("Moves per turn", "", UNIT_INT,
|
rb->set_int("Moves per turn", "", UNIT_INT,
|
||||||
&superdom_settings.movesperturn, NULL,
|
&superdom_settings.movesperturn, NULL,
|
||||||
1, 1, 5, NULL);
|
1, 1, 5, NULL);
|
||||||
|
|
@ -1707,9 +1712,12 @@ static int attack_territory(int colour, int x, int y)
|
||||||
offres->inds += board[x][y].ind;
|
offres->inds += board[x][y].ind;
|
||||||
offres->nukes += board[x][y].nuke;
|
offres->nukes += board[x][y].nuke;
|
||||||
board[x][y].colour = colour;
|
board[x][y].colour = colour;
|
||||||
|
if(!superdom_settings.persistent_units)
|
||||||
|
{
|
||||||
board[x][y].men = 0;
|
board[x][y].men = 0;
|
||||||
board[x][y].tank = false;
|
board[x][y].tank = false;
|
||||||
board[x][y].plane = false;
|
board[x][y].plane = false;
|
||||||
|
}
|
||||||
draw_board();
|
draw_board();
|
||||||
if(human)
|
if(human)
|
||||||
rb->sleep(HZ*2);
|
rb->sleep(HZ*2);
|
||||||
|
|
@ -2316,6 +2324,7 @@ static void default_settings(void)
|
||||||
superdom_settings.movesperturn = 2;
|
superdom_settings.movesperturn = 2;
|
||||||
superdom_settings.compdiff=2;
|
superdom_settings.compdiff=2;
|
||||||
superdom_settings.spoil_enabled=false;
|
superdom_settings.spoil_enabled=false;
|
||||||
|
superdom_settings.persistent_units=false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int average_strength(int colour)
|
static int average_strength(int colour)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue