From 68d09777d9f188b2ac69c98ccfdcc315037224fd Mon Sep 17 00:00:00 2001 From: Nathan Vance Date: Sat, 28 Feb 2015 00:18:29 -0500 Subject: added science to vp count; color to trades --- data.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'data.c') 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; +} -- cgit