diff options
| author | Franklin Wei <frankhwei536@gmail.com> | 2014-08-30 21:02:56 -0400 |
|---|---|---|
| committer | Michael Giacomelli <giac2000@hotmail.com> | 2014-09-14 04:17:05 +0200 |
| commit | 333a82c8eb6888d0c6c2bca4e7a7db9603bbd0ca (patch) | |
| tree | 7327977894688d49f4f9e1a338c8c93660ccf3b8 | |
| parent | ad79a90e39b202f1fe9bdc9105a21ebf7bebb7b5 (diff) | |
| download | rockbox-333a82c8eb6888d0c6c2bca4e7a7db9603bbd0ca.zip rockbox-333a82c8eb6888d0c6c2bca4e7a7db9603bbd0ca.tar.gz rockbox-333a82c8eb6888d0c6c2bca4e7a7db9603bbd0ca.tar.bz2 rockbox-333a82c8eb6888d0c6c2bca4e7a7db9603bbd0ca.tar.xz | |
Superdom: added option for persistent units
Change-Id: I4c28f3c567ed435ba7aee36c8b54c76fc75e12aa
Reviewed-on: http://gerrit.rockbox.org/943
Reviewed-by: Michael Giacomelli <giac2000@hotmail.com>
| -rw-r--r-- | apps/plugins/superdom.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/apps/plugins/superdom.c b/apps/plugins/superdom.c index 312c48c..edb432d 100644 --- a/apps/plugins/superdom.c +++ b/apps/plugins/superdom.c @@ -176,6 +176,7 @@ static struct settings { */ int compdiff; bool spoil_enabled; + bool persistent_units; } superdom_settings; static struct resources humanres; @@ -529,7 +530,7 @@ static int settings_menu(void) MENUITEM_STRINGLIST(menu, "Super Domination Settings", NULL, "Computer starting farms", "Computer 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) { @@ -582,6 +583,10 @@ static int settings_menu(void) 0, "Disabled", 0, NULL); break; 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, &superdom_settings.movesperturn, 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->nukes += board[x][y].nuke; board[x][y].colour = colour; - board[x][y].men = 0; - board[x][y].tank = false; - board[x][y].plane = false; + if(!superdom_settings.persistent_units) + { + board[x][y].men = 0; + board[x][y].tank = false; + board[x][y].plane = false; + } draw_board(); if(human) rb->sleep(HZ*2); @@ -2316,6 +2324,7 @@ static void default_settings(void) superdom_settings.movesperturn = 2; superdom_settings.compdiff=2; superdom_settings.spoil_enabled=false; + superdom_settings.persistent_units=false; } static int average_strength(int colour) |