summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
authorFranklin Wei <frankhwei536@gmail.com>2014-08-30 21:02:56 -0400
committerMichael Giacomelli <giac2000@hotmail.com>2014-09-14 04:17:05 +0200
commit333a82c8eb6888d0c6c2bca4e7a7db9603bbd0ca (patch)
tree7327977894688d49f4f9e1a338c8c93660ccf3b8 /apps/plugins
parentad79a90e39b202f1fe9bdc9105a21ebf7bebb7b5 (diff)
downloadrockbox-333a82c8eb6888d0c6c2bca4e7a7db9603bbd0ca.tar.gz
rockbox-333a82c8eb6888d0c6c2bca4e7a7db9603bbd0ca.zip
Superdom: added option for persistent units
Change-Id: I4c28f3c567ed435ba7aee36c8b54c76fc75e12aa Reviewed-on: http://gerrit.rockbox.org/943 Reviewed-by: Michael Giacomelli <giac2000@hotmail.com>
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/superdom.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/apps/plugins/superdom.c b/apps/plugins/superdom.c
index 312c48cdeb..edb432d68f 100644
--- a/apps/plugins/superdom.c
+++ b/apps/plugins/superdom.c
@@ -176,6 +176,7 @@ static struct settings {
176 */ 176 */
177 int compdiff; 177 int compdiff;
178 bool spoil_enabled; 178 bool spoil_enabled;
179 bool persistent_units;
179} superdom_settings; 180} superdom_settings;
180 181
181static struct resources humanres; 182static struct resources humanres;
@@ -529,7 +530,7 @@ static int settings_menu(void)
529 MENUITEM_STRINGLIST(menu, "Super Domination Settings", NULL, 530 MENUITEM_STRINGLIST(menu, "Super Domination Settings", NULL,
530 "Computer starting farms", "Computer starting factories", 531 "Computer starting farms", "Computer starting factories",
531 "Human starting farms", "Human starting factories", 532 "Human starting farms", "Human starting factories",
532 "Starting cash", "Starting food", "Computer difficulty","Food spoilage", "Moves per turn"); 533 "Starting cash", "Starting food", "Computer difficulty","Food spoilage", "Persistent units", "Moves per turn");
533 534
534 while(1) 535 while(1)
535 { 536 {
@@ -582,6 +583,10 @@ static int settings_menu(void)
582 0, "Disabled", 0, NULL); 583 0, "Disabled", 0, NULL);
583 break; 584 break;
584 case 8: 585 case 8:
586 rb->set_bool_options("Persistent units", &superdom_settings.persistent_units, "Enabled", 0,
587 "Disabled", 0, NULL);
588 break;
589 case 9:
585 rb->set_int("Moves per turn", "", UNIT_INT, 590 rb->set_int("Moves per turn", "", UNIT_INT,
586 &superdom_settings.movesperturn, NULL, 591 &superdom_settings.movesperturn, NULL,
587 1, 1, 5, NULL); 592 1, 1, 5, NULL);
@@ -1707,9 +1712,12 @@ static int attack_territory(int colour, int x, int y)
1707 offres->inds += board[x][y].ind; 1712 offres->inds += board[x][y].ind;
1708 offres->nukes += board[x][y].nuke; 1713 offres->nukes += board[x][y].nuke;
1709 board[x][y].colour = colour; 1714 board[x][y].colour = colour;
1710 board[x][y].men = 0; 1715 if(!superdom_settings.persistent_units)
1711 board[x][y].tank = false; 1716 {
1712 board[x][y].plane = false; 1717 board[x][y].men = 0;
1718 board[x][y].tank = false;
1719 board[x][y].plane = false;
1720 }
1713 draw_board(); 1721 draw_board();
1714 if(human) 1722 if(human)
1715 rb->sleep(HZ*2); 1723 rb->sleep(HZ*2);
@@ -2316,6 +2324,7 @@ static void default_settings(void)
2316 superdom_settings.movesperturn = 2; 2324 superdom_settings.movesperturn = 2;
2317 superdom_settings.compdiff=2; 2325 superdom_settings.compdiff=2;
2318 superdom_settings.spoil_enabled=false; 2326 superdom_settings.spoil_enabled=false;
2327 superdom_settings.persistent_units=false;
2319} 2328}
2320 2329
2321static int average_strength(int colour) 2330static int average_strength(int colour)