aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Vance <nathav63@gmail.com>2015-04-21 15:12:21 -0400
committerNathan Vance <nathav63@gmail.com>2015-04-21 15:12:21 -0400
commit310d54db9cc665ee3a6d015ff7cfa23ebe9f4d83 (patch)
treeb13e2368da08464945b0d201a769222b544faf14
parentUI bug fixes (diff)
download7w-310d54db9cc665ee3a6d015ff7cfa23ebe9f4d83.tar.gz
7w-310d54db9cc665ee3a6d015ff7cfa23ebe9f4d83.tar.bz2
7w-310d54db9cc665ee3a6d015ff7cfa23ebe9f4d83.zip
Bug fixes
-rw-r--r--data.c5
-rw-r--r--special_actions.c14
2 files changed, 16 insertions, 3 deletions
diff --git a/data.c b/data.c
index 29be94d..cc80dcd 100644
--- a/data.c
+++ b/data.c
@@ -86,7 +86,7 @@ void data_distributewonders()
for(i = 0; i < numplayers; i++) {
player[i][3][0] = wonders[i];
player[i][3][1] = rand()%2;
- player[0][3][0] = 6; //delete these lines later
+ player[0][3][0] = 8; //delete these lines later
player[0][3][1] = 1; //this one too!
}
}
@@ -152,6 +152,9 @@ void data_endturn()
data_flushbuffers();
} else data_discard((i+numplayers-turn)%numplayers, hands[i][0]);
}
+ for(i = 0; i < numplayers; i++) {
+ special_action(i, data_getwonder(i), data_getwonderside(i)*3+data_getwonderstages(i));
+ }
data_nextera();
return;
}
diff --git a/special_actions.c b/special_actions.c
index 6680434..925fe42 100644
--- a/special_actions.c
+++ b/special_actions.c
@@ -28,6 +28,10 @@ void Halicarnassus(int player)
int bottom = 0;
while(discards[numcards++] != -1 && numcards < 50);
numcards /= 2;
+ if(numcards == 0) {
+ postmessage("No cards in the discard pile. Sucks to suck.");
+ return;
+ }
while(1) {
view_refresh(focus, cursor, player, 1);
switch(io_getkey()) {
@@ -70,16 +74,22 @@ void Halicarnassus(int player)
}
}
+static int hal = 0;
+static int oly = 0;
+
void special_action(int player, int wonder, int stage)
{
if(wonder == 8) { //Halicarnassus
- if(stage == 2 || stage == 4 || stage == 5 || stage == 6)
+ if(stage == 2 && hal == 0 || stage == 4 && hal == 0 || stage == 5 && hal == 1 || stage == 6 && hal == 2) {
if(data_isai(player));
else Halicarnassus(player);
+ hal++;
+ }
}
if(wonder == 7) { //Olympia
- if(stage == 2) {
+ if(stage == 2 && ! oly) {
data_setfreebuild(player);
+ oly = 1;
}
}
}
bgstack15