aboutsummaryrefslogtreecommitdiff
path: root/player_turn.c
diff options
context:
space:
mode:
authorNathan Vance <nathav63@gmail.com>2015-04-02 13:10:41 -0400
committerNathan Vance <nathav63@gmail.com>2015-04-02 13:10:41 -0400
commitc9bec9ecc7dc8d0ccc8b0331b4cdf2bd8c77011f (patch)
tree3f8a1b0daf0e34b6e072d0f7e669fb5d3ba92b56 /player_turn.c
parentAdded more special actions (diff)
download7w-c9bec9ecc7dc8d0ccc8b0331b4cdf2bd8c77011f.tar.gz
7w-c9bec9ecc7dc8d0ccc8b0331b4cdf2bd8c77011f.tar.bz2
7w-c9bec9ecc7dc8d0ccc8b0331b4cdf2bd8c77011f.zip
Halicarnassus bug fixes
Diffstat (limited to 'player_turn.c')
-rw-r--r--player_turn.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/player_turn.c b/player_turn.c
index 84a02e3..da2e6f7 100644
--- a/player_turn.c
+++ b/player_turn.c
@@ -14,7 +14,7 @@ int data_canafford(int p, int era, int card);
int data_getwonder(int p);
int data_getnextwonderstage(int p);
int data_hasbuiltname(int p, int era, int card);
-int view_refresh(int focus, int cursor, int player);
+int view_refresh(int focus, int cursor, int player, int mode);
int wonder_numstages(int player);
int* cards_getcost(int era, int card);
int data_numbuilt(int p);
@@ -26,6 +26,7 @@ int trade_routine(int x, int y, int player);
void trade_commit(int player);
int data_spendfreebuild();
int postyn(int x, int y, char *message);
+void halt();
int player_build(int focus, int cursor, int player, int y)
{
@@ -68,7 +69,7 @@ void player_turn(int player)
int focus = data_numplayers();
while(1) {
numcards = data_numcards(player)+1; //include trade option in hand
- tradey = view_refresh(focus, cursor, player);
+ tradey = view_refresh(focus, cursor, player, 0);
switch(io_getkey()) {
case UP: cursor--;
break;
@@ -92,6 +93,9 @@ void player_turn(int player)
break;
case 'h': posthelp();
break;
+ case 'q':
+ if(postyn(61, tradey, "Are you sure you want to quit?")) halt();
+ break;
default: break;
}
if(focus < 0) focus = data_numplayers();
@@ -99,7 +103,7 @@ void player_turn(int player)
if(focus == data_numplayers()) {
if(cursor < 0) cursor = numcards-2;
if(cursor >= numcards-1) {
- if(trade_routine(61, view_refresh(focus, cursor, player), player)) cursor = 0;
+ if(trade_routine(61, view_refresh(focus, cursor, player, 0), player)) cursor = 0;
else cursor = numcards-2;
}
}
bgstack15