diff options
author | Nathan Vance <nathav63@gmail.com> | 2015-03-11 22:31:44 -0400 |
---|---|---|
committer | Nathan Vance <nathav63@gmail.com> | 2015-03-11 22:31:44 -0400 |
commit | 1a39ccc3088dd3fbc6da9571a17060cc50f432e4 (patch) | |
tree | f8e4973ac8044535d64526f2281b8953484e261a /ai_weights.c | |
parent | Implemented basic ai (diff) | |
download | 7w-1a39ccc3088dd3fbc6da9571a17060cc50f432e4.tar.gz 7w-1a39ccc3088dd3fbc6da9571a17060cc50f432e4.tar.bz2 7w-1a39ccc3088dd3fbc6da9571a17060cc50f432e4.zip |
Squelched some bugs, more to go!
Diffstat (limited to 'ai_weights.c')
-rw-r--r-- | ai_weights.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ai_weights.c b/ai_weights.c index b56fe70..bd7cd0c 100644 --- a/ai_weights.c +++ b/ai_weights.c @@ -3,12 +3,14 @@ int data_getdir(int dir, int p); //0 is east, 1 is west, 2 returns player int* cards_getproduction(int era, int card); int* cards_getcost(int era, int card); -int data_canafford(int p, int *cost); +int data_canafford(int p, int era, int card); int* data_getdefinites(int p); int** data_getindefinites(int p); int* data_gettradables(int p); int data_productiontype(int e, int card); int data_getwonderstages(int p); +int data_getwonder(int p); +int data_getnextwonderstage(int p); int* get_special(int era, int card, int player); int get_trade(int player, int type, int direction); int cards_gettype(int era, int card); @@ -123,5 +125,6 @@ int weight_buildcard(int era, int card, int player) int weight_buildwonder(int player) { + if(! data_canafford(player, data_getwonder(player), data_getnextwonderstage(player))) return 0; return (data_getwonderstages(player)+2) * 2; } |