aboutsummaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authorNathan Vance <nathav63@gmail.com>2015-02-28 00:18:29 -0500
committerNathan Vance <nathav63@gmail.com>2015-02-28 00:18:29 -0500
commit68d09777d9f188b2ac69c98ccfdcc315037224fd (patch)
tree76d41617e8ec05be2afe50a8f1b3dd6660f32332 /data.c
parentAdded battles (diff)
download7w-68d09777d9f188b2ac69c98ccfdcc315037224fd.tar.gz
7w-68d09777d9f188b2ac69c98ccfdcc315037224fd.tar.bz2
7w-68d09777d9f188b2ac69c98ccfdcc315037224fd.zip
added science to vp count; color to trades
Diffstat (limited to 'data.c')
-rw-r--r--data.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/data.c b/data.c
index fbe8dec..75df70b 100644
--- a/data.c
+++ b/data.c
@@ -11,6 +11,7 @@ void shuffle(int *deck, int n);
int* trade_buffer();
int* get_special(int era, int card, int player);
void war();
+int science(int player);
#define MISC 3
#define DATAGOLD 0
@@ -218,7 +219,7 @@ void data_build(int p, int card)
buffer[p][0] = card; //will be added to player array at end of turn
data_addgold(cards_getcost(era, card)[GOLD] * -1, p);
data_addgold(cards_getproduction(era, card)[GOLD], p);
- data_addvps(get_special(era, card, p)[0], p);
+ data_addvps(cards_getproduction(era, card)[VP], p);
data_addgold(get_special(era, card, p)[1], p);
data_discard(p, card);
}
@@ -394,3 +395,19 @@ int data_numbuilt(int p)
if(player[p][i][j] != -1) num++;
return num;
}
+
+int data_gettotvps(int p)
+{
+ int tot = 0;
+ tot += player[p][3][3] / 3; //gold
+ tot += player[p][3][4]; //military wins
+ tot -= player[p][3][5]; //military defeats
+ tot += player[p][3][6]; //vps
+ int *built = data_getbuilt(p);
+ int i;
+ for(i = 0; built[i] != -1; i += 2) {
+ tot += get_special(built[i], built[i+1], p)[0];
+ }
+ tot += science(p);
+ return tot;
+}
bgstack15