aboutsummaryrefslogtreecommitdiff
path: root/player_turn.c
diff options
context:
space:
mode:
authorNathan Vance <nathav63@gmail.com>2015-03-30 21:16:17 -0400
committerNathan Vance <nathav63@gmail.com>2015-03-30 21:16:17 -0400
commit84a9208b7f7713d9c94b23d60757051ffde586a4 (patch)
treec66d37b8519d8d11029da6e1b10112ae62bdd5e8 /player_turn.c
parentStarted work on special wonder actions (diff)
download7w-84a9208b7f7713d9c94b23d60757051ffde586a4.tar.gz
7w-84a9208b7f7713d9c94b23d60757051ffde586a4.tar.bz2
7w-84a9208b7f7713d9c94b23d60757051ffde586a4.zip
Added more special actions
Diffstat (limited to 'player_turn.c')
-rw-r--r--player_turn.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/player_turn.c b/player_turn.c
index f4bf19e..84a02e3 100644
--- a/player_turn.c
+++ b/player_turn.c
@@ -24,10 +24,13 @@ void clearmessage();
int postoptions(int x, int y);
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);
int player_build(int focus, int cursor, int player, int y)
{
int *hand = data_gethand(player);
+ int afford = data_canafford(player, data_getera(), hand[cursor]);
if(focus == data_numplayers()) {
if(hand[cursor] == -1) return 0;
int choice = postoptions(61, y);
@@ -36,8 +39,9 @@ int player_build(int focus, int cursor, int player, int y)
postmessage("Cannot have two of the same card!");
return 0;
}
- if(data_canafford(player, data_getera(), hand[cursor])) {
+ if(afford == 1 || (afford == 2 && postyn(61, y, "Spend free build?"))) {
data_build(player, hand[cursor]);
+ if(afford == 2) data_spendfreebuild();
return 1;
}
else postmessage("Can't afford this!");
bgstack15