aboutsummaryrefslogtreecommitdiff
path: root/ai_weights.c
diff options
context:
space:
mode:
authorNathan Vance <nathav63@gmail.com>2015-03-11 20:51:33 -0400
committerNathan Vance <nathav63@gmail.com>2015-03-11 20:51:33 -0400
commit0d0206dd0a9a1bb53913a76b0ae6179bb627074e (patch)
tree35948bee50afb58efe124a34d3f609f721773f50 /ai_weights.c
parentStarted work on ai (diff)
download7w-0d0206dd0a9a1bb53913a76b0ae6179bb627074e.tar.gz
7w-0d0206dd0a9a1bb53913a76b0ae6179bb627074e.tar.bz2
7w-0d0206dd0a9a1bb53913a76b0ae6179bb627074e.zip
Implemented basic ai
Diffstat (limited to 'ai_weights.c')
-rw-r--r--ai_weights.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ai_weights.c b/ai_weights.c
index e76e9bf..b56fe70 100644
--- a/ai_weights.c
+++ b/ai_weights.c
@@ -109,15 +109,16 @@ int weight_buildcard(int era, int card, int player)
{
int weight = data_potentialvps(player, era, card);
weight -= data_gettotvps(player);
+ if(cards_gettype(era, card) == MILITARY)
+ weight += weight_military(era, card, player);
if(era == 2) return weight;
if(cards_gettype(era, card) == SCIENTIFIC)
weight += weight_science(era, card, player);
- if(cards_gettype(era, card) == MILITARY)
- weight += weight_military(era, card, player);
if(cards_gettype(era, card) == RESOURCE || cards_gettype(era, card) == INDUSTRY)
weight += weight_resource(era, card, player);
if(cards_gettype(era, card) == COMMERCIAL)
weight += weight_commercial(era, card, player);
+ return weight;
}
int weight_buildwonder(int player)
bgstack15