69#define LOG_BUY LOG_DEBUG
70#define LOG_EMERGENCY LOG_VERBOSE
71#define LOG_WANT LOG_VERBOSE
75#define AI_CITY_RECALC_SPEED 5
77#define AI_BA_RECALC_SPEED 5
79#define SPECVEC_TAG tech
80#define SPECVEC_TYPE struct advance *
83#define SPECVEC_TAG impr
84#define SPECVEC_TYPE const struct impr_type *
89#define city_range_iterate(city_here, list, range, city) \
91 city_list_iterate(list, city) { \
92 if (range == REQ_RANGE_PLAYER \
93 || range == REQ_RANGE_TEAM \
94 || range == REQ_RANGE_ALLIANCE \
95 || (range == REQ_RANGE_TRADE_ROUTE \
96 && (city == city_here \
97 || have_cities_trade_route(city, city_here))) \
98 || ((range == REQ_RANGE_CITY || range == REQ_RANGE_LOCAL) \
99 && city == city_here) \
100 || (range == REQ_RANGE_CONTINENT \
101 && tile_continent(city->tile) == \
102 tile_continent(city_here->tile))) {
104#define city_range_iterate_end \
106 } city_list_iterate_end; \
109#define CITY_EMERGENCY(pcity) \
110 (pcity->surplus[O_SHIELD] < 0 || city_unhappy(pcity) \
111 || pcity->food_stock + pcity->surplus[O_FOOD] < 0)
131 const struct city *pcity,
145 "wanted by %s for building: %d -> %d",
147 building_want, tech_want);
160 const struct city *pcity,
162 struct tech_vector *needed_techs,
166 int n_needed_techs = tech_vector_size(needed_techs);
168 for (t = 0; t < n_needed_techs; t++) {
170 *tech_vector_get(needed_techs, t),
181 const struct city *pcity,
186 if (pobs->source.kind == VUT_ADVANCE && pobs->present) {
188 pobs->source.value.advance,
207 int i, bestattack = 0;
284 " workers, caravans, settlers, or buildings!");
296 &(city_data->
choice), 0)) {
306 "(caravan/coinage/settlers). Fix the ruleset!");
317#ifdef ADV_CHOICE_TRACK
318 if (city_data->
choice.log_if_chosen) {
335 build_new.
kind = VUT_UTYPE;
339 build_new.
kind = VUT_IMPROVEMENT;
343 build_new.
kind = VUT_NONE;
346 build_new.
kind = universals_n_invalid();
413 if (punittype == NULL) {
421 int real_limit = limit;
428 real_limit = expenses;
435 military ?
"military" :
"civilian");
455 const enum action_requester requester)
457 const int punit_id_stored =
punit->
id;
465 struct city *tgt_city;
474 0, NULL, ACTION_HELP_WONDER, requester)) {
489 struct city *tgt_city;
498 0, NULL, ACTION_DISBAND_UNIT_RECOVER, requester)) {
514 0, NULL, ACTION_DISBAND_UNIT, requester)) {
536 struct tile *ptile = pcity->tile;
553 int limit = cached_limit;
554 struct city *pcity = NULL;
588 int upgrade_limit = limit;
591 upgrade_limit = expenses;
620 }
else if (city_list_size(pplayer->
cities) > 6) {
625 }
else if (war_footing) {
655 || (bestchoice.
want > 200 && city_data->
urgency > 1))) {
666 CITY_LOG(
LOG_BUY, pcity,
"must have %s but can't afford it (%d < %d)!",
730 foodloss_pct =
CLIP(0, foodloss_pct, 100);
734 for (i = pop_cost; i > 0 ; i--) {
754 struct unit *virtualunit;
756 enum unit_activity best_act;
758 struct tile *best_tile = NULL;
769 if (!private->contemplace_workers) {
779 log_debug(
"No UTYF_SETTLERS role unit available");
789 &best_act, &best_target,
822 "we have %d workers and %d cities on the continent",
831 "we have %d workers and %d cities on the ocean",
844 place >= 0 ? TC_LAND : TC_OCEAN);
873 int count = city_list_size(pplayer->
cities);
874 struct city *sellers[count + 1];
880 sellers[count++] = pcity;
883 for (i = 0; i < count; i++) {
888 sellers[i] = sellers[replace];
889 sellers[replace] = tmp;
940 }
else if (pcity->server.debug) {
969 const struct city *pcity)
972 if (ai_wants_no_science(plr)
1001 PL_(
"%s is selling %s for %d.",
1002 "%s is selling %s for %d.", gain),
1039 "Emergency in %s (%s, angry%d, unhap%d food%d, prod%d)",
1054#ifndef FREECIV_NDEBUG
1101 "Emergency in %s resolved by disbanding unit(s)",
1130 if (city_data != NULL) {
1142 const char *citystr)
1169 struct city *pcity,
const char *citystr)
1183 "%s.%s.building_wait", citystr, aitstr);
1194 "%s.%s.founder_boat", citystr, aitstr);
1210 const struct city *pcity)
1215 "Action %d don't exist.", act_id);
1222 switch (paction->
result) {
1223 case ACTRES_SPY_INCITE_CITY:
1231 case ACTRES_SPY_NUKE:
1232 case ACTRES_CONQUER_CITY:
1235 case ACTRES_DESTROY_CITY:
1239 case ACTRES_SPY_POISON:
1240 case ACTRES_SPY_SPREAD_PLAGUE:
1241 case ACTRES_SPY_SABOTAGE_CITY:
1242 case ACTRES_SPY_TARGETED_SABOTAGE_CITY:
1243 case ACTRES_SPY_SABOTAGE_CITY_PRODUCTION:
1244 case ACTRES_STRIKE_BUILDING:
1245 case ACTRES_STRIKE_PRODUCTION:
1246 case ACTRES_SPY_STEAL_GOLD:
1252 case ACTRES_SPY_STEAL_TECH:
1253 case ACTRES_SPY_TARGETED_STEAL_TECH:
1254 case ACTRES_STEAL_MAPS:
1259 case ACTRES_ESTABLISH_EMBASSY:
1260 case ACTRES_SPY_INVESTIGATE_CITY:
1261 case ACTRES_MARKETPLACE:
1266 case ACTRES_TRADE_ROUTE:
1267 case ACTRES_HELP_WONDER:
1268 case ACTRES_JOIN_CITY:
1269 case ACTRES_DISBAND_UNIT_RECOVER:
1270 case ACTRES_HOME_CITY:
1271 case ACTRES_UPGRADE_UNIT:
1272 case ACTRES_AIRLIFT:
1281 case ACTRES_PARADROP_CONQUER:
1283 case ACTRES_SPY_BRIBE_UNIT:
1284 case ACTRES_SPY_SABOTAGE_UNIT:
1285 case ACTRES_SPY_ATTACK:
1286 case ACTRES_EXPEL_UNIT:
1287 case ACTRES_DISBAND_UNIT:
1288 case ACTRES_CAPTURE_UNITS:
1289 case ACTRES_BOMBARD:
1290 case ACTRES_FOUND_CITY:
1291 case ACTRES_NUKE_UNITS:
1292 case ACTRES_PARADROP:
1294 case ACTRES_HEAL_UNIT:
1295 case ACTRES_TRANSFORM_TERRAIN:
1296 case ACTRES_CULTIVATE:
1298 case ACTRES_PILLAGE:
1299 case ACTRES_CLEAN_POLLUTION:
1300 case ACTRES_CLEAN_FALLOUT:
1301 case ACTRES_FORTIFY:
1303 case ACTRES_CONVERT:
1306 case ACTRES_IRRIGATE:
1307 case ACTRES_TRANSPORT_ALIGHT:
1308 case ACTRES_TRANSPORT_BOARD:
1309 case ACTRES_TRANSPORT_UNLOAD:
1310 case ACTRES_TRANSPORT_DISEMBARK:
1311 case ACTRES_TRANSPORT_EMBARK:
1312 case ACTRES_CONQUER_EXTRAS:
1313 case ACTRES_HUT_ENTER:
1314 case ACTRES_HUT_FRIGHTEN:
1315 case ACTRES_UNIT_MOVE:
1316 case ACTRES_HOMELESS:
1318 "Action not aimed at cities");
1340 bool all_met =
TRUE;
1341 int n_needed_techs = 0;
1342 int n_needed_improvements = 0;
1343 struct tech_vector needed_techs;
1344 struct impr_vector needed_improvements;
1350 .building = pimprove,
1353 tech_vector_init(&needed_techs);
1354 impr_vector_init(&needed_improvements);
1359 if (VUT_ADVANCE == preq->source.kind && preq->present && !active) {
1361 tech_vector_append(&needed_techs, preq->source.value.advance);
1362 }
else if (VUT_IMPROVEMENT == preq->source.kind && preq->present && !active) {
1366 impr_vector_append(&needed_improvements, preq->source.value.building);
1368 all_met = all_met && active;
1375 n_needed_techs = tech_vector_size(&needed_techs);
1376 if (0 < v && 0 < n_needed_techs) {
1379 const adv_want dv = v / n_needed_techs;
1389 n_needed_improvements = impr_vector_size(&needed_improvements);
1390 if (0 < v && 0 < n_needed_improvements) {
1393 const adv_want dv = v / (n_needed_improvements * 4);
1396 for (i = 0; i < n_needed_improvements; i++) {
1397 const struct impr_type *needed_impr = *impr_vector_get(&needed_improvements, i);
1408 tech_vector_free(&needed_techs);
1409 impr_vector_free(&needed_improvements);
1426 memset(prod, 0,
O_LAST *
sizeof(*prod));
1427 if (NULL != pimprove
1450 prod[
O_TRADE] += proute->value;
1455 waste[o] =
city_waste(acity, o, prod[o] * bonus[o] / 100, NULL);
1461 prod[o] = prod[o] * bonus[o] / 100 - waste[o];
1579 int cities[REQ_RANGE_COUNT];
1583 bool can_build =
TRUE;
1585 .
kind = VUT_IMPROVEMENT,
1586 .value = {.building = pimprove}
1597 .building = pimprove,
1615 && aplayer->team == pplayer->
team
1616 && aplayer != pplayer) {
1631 v +=
base_want(ait, pplayer, pcity, pimprove);
1648 cities[REQ_RANGE_PLAYER] = city_list_size(pplayer->
cities);
1651 =
cities[REQ_RANGE_PLAYER];
1654 cities[REQ_RANGE_CONTINENT] = 1;
1665 cities[REQ_RANGE_ADJACENT] =
cities[REQ_RANGE_CADJACENT] = 0;
1668 int potential = (aplayer->server.bulbs_last_turn
1669 + city_list_size(aplayer->cities) + 1);
1671 if (potential > 0) {
1673 if (pobs->source.kind == VUT_ADVANCE && pobs->present) {
1686 int n_needed_techs = 0;
1687 struct tech_vector needed_techs;
1688 bool present =
TRUE;
1689 bool impossible_to_get =
FALSE;
1691 tech_vector_init(&needed_techs);
1696 if (VUT_IMPROVEMENT == preq->source.kind
1697 && preq->source.value.building == pimprove) {
1698 if (preq->range <
range) {
1700 range = preq->range;
1702 present = preq->present;
1707 if (VUT_ADVANCE == preq->source.kind && preq->present) {
1712 tech_vector_append(&needed_techs, preq->source.value.advance);
1714 impossible_to_get =
TRUE;
1719 n_needed_techs = tech_vector_size(&needed_techs);
1720 if ((active || n_needed_techs) && !impossible_to_get) {
1722 turns, peffect,
range, nplayers);
1736 }
else if (v1 > 0) {
1747 const int a = already? 5: 4;
1748 const adv_want dv = v1 * a / (4 * n_needed_techs);
1755 tech_vector_free(&needed_techs);
1761 bool will_be_possible =
FALSE;
1762 enum req_range max_range;
1771 max_range = REQ_RANGE_LOCAL;
1783 enum req_range
range = REQ_RANGE_LOCAL;
1786 if (VUT_IMPROVEMENT == preq->source.kind
1787 && preq->source.value.building == pimprove) {
1789 if (preq->present) {
1790 range = preq->range;
1803 will_be_possible =
TRUE;
1806 if (max_range <
range) {
1818 if (is_possible == will_be_possible) {
1829 act_neg_util =
cities[max_range] * act_neg_util;
1833 if (will_be_possible) {
1850 can_build = can_build && all_met;
1853 if (is_coinage && can_build) {
1857 }
else if (!already && can_build) {
1879 if (pobs->source.kind == VUT_ADVANCE && pobs->present) {
1883 v -= v /
MAX(1, num_tech);
1974 if (pcity != wonder_city &&
is_wonder(pimprove)) {
1989 && 0 < pcity->server.adv->building_want[idx]));
1994 pcity->server.adv->building_want[idx] *= 1.5;
1996 if (pcity->production.kind == VUT_IMPROVEMENT
2000 pcity->server.adv->building_want[idx] *= 1.25;
2005 if (pcity->server.adv->building_want[idx] > 0) {
2006 pcity->server.adv->building_want[idx]
2007 = pcity->server.adv->building_want[idx]
2073 case VUT_TERRAINCLASS:
2075 case VUT_TERRAINALTER:
2135 if (preq->range >= REQ_RANGE_PLAYER
2153 enum effect_type effect_type,
2156 int greatest_value = 0;
2157 const struct impr_type *best_building = NULL;
2166 if (peffect->value > greatest_value) {
2167 const struct impr_type *building = NULL;
2168 bool wrong_unit =
FALSE;
2171 if (VUT_IMPROVEMENT == preq->source.kind && preq->present) {
2172 building = preq->source.value.building;
2179 }
else if (utype != NULL
2186 if (!wrong_unit && building != NULL) {
2187 best_building = building;
2188 greatest_value = peffect->value;
2193 if (best_building) {
bool is_action_possible_on_city(action_id act_id, const struct player *actor_player, const struct city *target_city)
void action_list_end(action_id *act_list, int size)
bool action_ever_possible(action_id action)
bool is_action_enabled_unit_on_city(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct city *target_city)
void action_list_add_all_by_result(action_id *act_list, int *position, enum action_result result)
bool action_id_exists(const action_id act_id)
enum action_target_kind action_get_target_kind(const struct action *paction)
bool is_action_enabled_unit_on_self(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit)
struct action_enabler_list * action_enablers_for_action(action_id action)
static struct action * action_by_number(action_id act_id)
#define action_enabler_list_iterate_end
#define action_id_get_role(act_id)
#define action_array_iterate(_act_list_, _act_id_)
#define action_array_iterate_end
#define action_iterate_end
#define action_enabler_list_iterate(action_enabler_list, aenabler)
#define action_iterate(_act_)
#define action_id_get_target_kind(act_id)
void building_advisor(struct player *pplayer)
void adv_deinit_choice(struct adv_choice *choice)
void adv_init_choice(struct adv_choice *choice)
void adv_free_choice(struct adv_choice *choice)
struct adv_choice * adv_better_choice(struct adv_choice *first, struct adv_choice *second)
bool is_unit_choice_type(enum choice_type type)
const char * adv_choice_rule_name(const struct adv_choice *choice)
#define adv_choice_set_use(_choice, _use)
#define ADV_CHOICE_ASSERT(c)
static void adv_choice_copy(struct adv_choice *dest, struct adv_choice *src)
struct adv_data * adv_data_get(struct player *pplayer, bool *caller_closes)
@ ADV_IMPR_CALCULATE_FULL
struct ai_plr * dai_plr_data_get(struct ai_type *ait, struct player *pplayer, bool *caller_closes)
void dai_calc_data(const struct player *pplayer, int *trade, int *expenses, int *income)
#define TECH_LOG(ait, loglevel, pplayer, padvance, msg,...)
static struct ai_plr * def_ai_player_data(const struct player *pplayer, struct ai_type *deftype)
static struct ai_city * def_ai_city_data(const struct city *pcity, struct ai_type *deftype)
static struct unit_ai * def_ai_unit_data(const struct unit *punit, struct ai_type *deftype)
int ai_trait_get_value(enum trait tr, struct player *pplayer)
struct unit_type * dai_role_utype_for_terrain_class(struct city *pcity, int role, enum terrain_class tc)
#define IS_ATTACKER(ptype)
adv_want settler_evaluate_improvements(const struct civ_map *nmap, struct unit *punit, enum unit_activity *best_act, struct extra_type **best_target, struct tile **best_tile, struct pf_path **path, struct settlermap *state)
bool base_city_celebrating(const struct city *pcity)
bool is_free_worked(const struct city *pcity, const struct tile *ptile)
int city_granary_size(int city_size)
void city_set_ai_data(struct city *pcity, const struct ai_type *ai, void *data)
bool city_built_last_turn(const struct city *pcity)
int city_waste(const struct city *pcity, Output_type_id otype, int total, int *breakdown)
bool city_has_building(const struct city *pcity, const struct impr_type *pimprove)
bool is_capital(const struct city *pcity)
const char * city_name_get(const struct city *pcity)
void city_remove_improvement(struct city *pcity, const struct impr_type *pimprove)
int city_improvement_upkeep(const struct city *pcity, const struct impr_type *b)
void add_tax_income(const struct player *pplayer, int trade, int *output)
bool can_city_build_improvement_now(const struct city *pcity, const struct impr_type *pimprove)
int get_city_tithes_bonus(const struct city *pcity)
bool city_unhappy(const struct city *pcity)
int get_final_city_output_bonus(const struct city *pcity, Output_type_id otype)
int city_pollution(const struct city *pcity, int shield_total)
void city_add_improvement(struct city *pcity, const struct impr_type *pimprove)
int city_map_radius_sq_get(const struct city *pcity)
bool city_base_to_city_map(int *city_map_x, int *city_map_y, const struct city *const pcity, const struct tile *map_tile)
void add_specialist_output(const struct city *pcity, int *output)
int city_tile_output(const struct city *pcity, const struct tile *ptile, bool is_celebrating, Output_type_id otype)
bool can_city_build_unit_now(const struct civ_map *nmap, const struct city *pcity, const struct unit_type *punittype)
#define city_list_iterate(citylist, pcity)
#define city_tile(_pcity_)
static citizens city_size_get(const struct city *pcity)
#define output_type_iterate(output)
#define city_owner(_pcity_)
#define city_list_iterate_end
#define city_tile_iterate(_nmap, _radius_sq, _city_tile, _tile)
#define city_tile_iterate_end
#define city_built_iterate(_pcity, _p)
#define city_built_iterate_end
#define output_type_iterate_end
void really_handle_city_buy(struct player *pplayer, struct city *pcity)
void really_handle_city_sell(struct player *pplayer, struct city *pcity, struct impr_type *pimprove)
int city_granary_savings(const struct city *pcity)
void auto_arrange_workers(struct city *pcity)
bool city_refresh(struct city *pcity)
static void try_to_sell_stuff(struct player *pplayer, struct city *pcity)
#define AI_BA_RECALC_SPEED
#define AI_CITY_RECALC_SPEED
static bool adjust_wants_for_reqs(struct ai_type *ait, struct player *pplayer, struct city *pcity, const struct impr_type *pimprove, const adv_want v)
static void unit_do_disband_trad(struct player *owner, struct unit *punit, const enum action_requester requester)
static bool dai_cant_help_req(const struct req_context *context, const struct requirement *req)
void want_techs_for_improvement_effect(struct ai_type *ait, struct player *pplayer, const struct city *pcity, const struct impr_type *pimprove, struct tech_vector *needed_techs, adv_want building_want)
static void increase_maxbuycost(struct player *pplayer, int new_value)
static void dai_barbarian_choose_build(struct player *pplayer, struct city *pcity, struct adv_choice *choice)
void dai_city_save(struct ai_type *ait, const char *aitstr, struct section_file *file, const struct city *pcity, const char *citystr)
void dai_city_load(struct ai_type *ait, const char *aitstr, const struct section_file *file, struct city *pcity, const char *citystr)
static void dai_city_sell_noncritical(struct city *pcity, bool redundant_only)
#define city_range_iterate_end
static int unit_food_upkeep(struct unit *punit)
void dai_manage_cities(struct ai_type *ait, struct player *pplayer)
void dai_city_alloc(struct ai_type *ait, struct city *pcity)
void dai_consider_wonder_city(struct ai_type *ait, struct city *pcity, bool *result)
static bool should_force_recalc(struct city *pcity)
bool dai_can_player_build_improvement_later(const struct player *p, const struct impr_type *pimprove)
static int action_target_neg_util(action_id act_id, const struct city *pcity)
#define city_range_iterate(city_here, list, range, city)
static void resolve_city_emergency(struct ai_type *ait, struct player *pplayer, struct city *pcity)
void dont_want_tech_obsoleting_impr(struct ai_type *ait, struct player *pplayer, const struct city *pcity, const struct impr_type *pimprove, adv_want building_want)
void dai_build_adv_adjust(struct ai_type *ait, struct player *pplayer, struct city *wonder_city)
static void contemplate_terrain_improvements(struct ai_type *ait, struct city *pcity)
static void dai_spend_gold(struct ai_type *ait, struct player *pplayer)
static void adjust_improvement_wants_by_effects(struct ai_type *ait, struct player *pplayer, struct city *pcity, struct impr_type *pimprove, const bool already)
void dai_city_free(struct ai_type *ait, struct city *pcity)
static void want_tech_for_improvement_effect(struct ai_type *ait, struct player *pplayer, const struct city *pcity, const struct impr_type *pimprove, const struct advance *tech, adv_want building_want)
Impr_type_id dai_find_source_building(struct city *pcity, enum effect_type effect_type, const struct unit_type *utype)
void dai_build_adv_init(struct ai_type *ait, struct player *pplayer)
static void dai_upgrade_units(struct city *pcity, int limit, bool military)
#define CITY_EMERGENCY(pcity)
bool dai_can_city_build_improvement_later(const struct city *pcity, const struct impr_type *pimprove)
adv_want dai_city_want(struct player *pplayer, struct city *acity, struct adv_data *adv, struct impr_type *pimprove)
static adv_want base_want(struct ai_type *ait, struct player *pplayer, struct city *pcity, struct impr_type *pimprove)
static int unit_foodbox_cost(struct unit *punit)
static bool building_crucial(const struct player *plr, struct impr_type *pimprove, const struct city *pcity)
static void dai_city_choose_build(struct ai_type *ait, struct player *pplayer, struct city *pcity)
#define BUILDING_WAIT_MINIMUM
bool dai_on_war_footing(struct ai_type *ait, struct player *pplayer)
struct adv_choice * domestic_advisor_choose_build(struct ai_type *ait, struct player *pplayer, struct city *pcity)
bool dai_can_requirement_be_met_in_city(const struct requirement *preq, const struct player *pplayer, const struct city *pcity)
adv_want dai_effect_value(struct player *pplayer, const struct adv_data *adv, const struct city *pcity, const bool capital, int turns, const struct effect *peffect, const int c, const int nplayers)
int assess_defense(struct ai_type *ait, struct city *pcity)
struct adv_choice * military_advisor_choose_build(struct ai_type *ait, const struct civ_map *nmap, struct player *pplayer, struct city *pcity, player_unit_list_getter ul_cb)
bool dai_process_defender_want(struct ai_type *ait, const struct civ_map *nmap, struct player *pplayer, struct city *pcity, unsigned int danger, struct adv_choice *choice, adv_want extra_want)
int assess_defense_quadratic(struct ai_type *ait, struct city *pcity)
void dai_auto_settler_reset(struct ai_type *ait, struct player *pplayer)
void contemplate_new_city(struct ai_type *ait, struct city *pcity)
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit int cost
bool ai_fuzzy(const struct player *pplayer, bool normal_decision)
struct effect_list * get_req_source_effects(struct universal *psource)
int get_city_bonus(const struct city *pcity, enum effect_type effect_type)
struct effect_list * get_effects(enum effect_type effect_type)
bool building_has_effect(const struct impr_type *pimprove, enum effect_type effect_type)
#define effect_list_iterate_end
#define effect_list_iterate(effect_list, peffect)
signed short Continent_id
#define PL_(String1, String2, n)
const struct ft_color ftc_server
const char * city_link(const struct city *pcity)
static GtkWidget * source
bool has_handicap(const struct player *pplayer, enum handicap_type htype)
const struct impr_type * valid_improvement(const struct impr_type *pimprove)
int impr_sell_gold(const struct impr_type *pimprove)
bool can_city_sell_building(const struct city *pcity, const struct impr_type *pimprove)
bool is_improvement_redundant(const struct city *pcity, const struct impr_type *pimprove)
bool can_player_build_improvement_later(const struct player *p, const struct impr_type *pimprove)
bool is_improvement(const struct impr_type *pimprove)
Impr_type_id improvement_number(const struct impr_type *pimprove)
const char * improvement_rule_name(const struct impr_type *pimprove)
Impr_type_id improvement_index(const struct impr_type *pimprove)
int impr_build_shield_cost(const struct city *pcity, const struct impr_type *pimprove)
bool is_wonder(const struct impr_type *pimprove)
bool is_great_wonder(const struct impr_type *pimprove)
bool improvement_obsolete(const struct player *pplayer, const struct impr_type *pimprove, const struct city *pcity)
bool improvement_has_flag(const struct impr_type *pimprove, enum impr_flag_id flag)
struct city * city_from_small_wonder(const struct player *pplayer, const struct impr_type *pimprove)
const char * improvement_name_translation(const struct impr_type *pimprove)
bool is_small_wonder(const struct impr_type *pimprove)
bool great_wonder_is_available(const struct impr_type *pimprove)
bool is_improvement_productive(const struct city *pcity, const struct impr_type *pimprove)
#define improvement_iterate_end
#define improvement_iterate(_p)
void initialize_infrastructure_cache(struct player *pplayer)
#define fc_assert_msg(condition, message,...)
#define fc_assert_ret(condition)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
#define fc_assert_action(condition, action)
#define log_debug(message,...)
#define log_normal(message,...)
#define log_base(level, message,...)
#define fc_calloc(n, esz)
void notify_player(const struct player *pplayer, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
struct city_list * cities
int player_get_expected_income(const struct player *pplayer)
const char * player_name(const struct player *pplayer)
#define players_iterate_end
#define players_iterate(_pplayer)
static bool is_barbarian(const struct player *pplayer)
int normal_player_count(void)
bool secfile_lookup_bool_default(const struct section_file *secfile, bool def, const char *path,...)
int secfile_lookup_int_default(const struct section_file *secfile, int def, const char *path,...)
#define secfile_insert_int(secfile, value, path,...)
#define secfile_insert_bool(secfile, value, path,...)
bool is_req_active(const struct req_context *context, const struct player *other_player, const struct requirement *req, const enum req_problem_type prob_type)
enum req_unchanging_status is_req_preventing(const struct req_context *context, const struct player *other_player, const struct requirement *req, enum req_problem_type prob_type)
#define requirement_vector_iterate_end
#define requirement_vector_iterate(req_vec, preq)
int research_goal_unknown_techs(const struct research *presearch, Tech_type_id goal)
int research_goal_bulbs_required(const struct research *presearch, Tech_type_id goal)
struct research * research_get(const struct player *pplayer)
#define CLIP(lower, current, upper)
#define DEFAULT_SPECIALIST
#define CITY_LOG(loglevel, pcity, msg,...)
#define UNIT_LOG(loglevel, punit, msg,...)
#define TIMING_LOG(timer, activity)
enum action_result result
adv_want building_want[B_LAST]
struct adv_data::@92 stats
enum adv_improvement_status impr_calc[B_LAST]
enum req_range impr_range[B_LAST]
unsigned int grave_danger
struct unit_type * worker_type
struct ai_plr::@267 stats
adv_want tech_want[A_LAST+1]
struct universal production
citizens feel[CITIZEN_LAST][FEELING_LAST]
citizens specialists[SP_MAX]
struct city::@17::@19 server
struct unit_list * units_supported
struct civ_game::@30::@34 server
struct packet_game_info info
int incite_improvement_factor
struct requirement_vector obsolete_by
struct requirement_vector reqs
int great_wonder_owners[B_LAST]
struct city_list * cities
struct player_ai ai_common
struct player_economic economic
const struct player * player
Tech_type_id advance_index(const struct advance *padvance)
Tech_type_id advance_number(const struct advance *padvance)
struct city * tile_city(const struct tile *ptile)
#define tile_worked(_tile)
#define tile_continent(_tile)
int city_num_trade_routes(const struct city *pcity)
#define trade_routes_iterate_end
#define trade_routes_iterate(c, proute)
#define TRAIT_DEFAULT_VALUE
const struct unit_type * utype
const struct impr_type * building
bool unit_is_alive(int id)
bool unit_being_aggressive(const struct civ_map *nmap, const struct unit *punit)
bool is_field_unit(const struct unit *punit)
bool unit_can_do_action(const struct unit *punit, const action_id act_id)
struct unit * unit_virtual_create(struct player *pplayer, struct city *pcity, const struct unit_type *punittype, int veteran_level)
const char * get_activity_text(enum unit_activity activity)
void unit_virtual_destroy(struct unit *punit)
void unit_tile_set(struct unit *punit, struct tile *ptile)
bool unit_perform_action(struct player *pplayer, const int actor_id, const int target_id, const int sub_tgt_id_incoming, const char *name, const action_id action_type, const enum action_requester requester)
void unit_do_action(struct player *pplayer, const int actor_id, const int target_id, const int sub_tgt_id, const char *name, const action_id action_type)
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_safe(unitlist, _unit)
#define unit_list_iterate_end
#define unit_list_iterate_safe_end
struct unit_type * best_role_unit(const struct city *pcity, int role)
const struct unit_type * unit_type_get(const struct unit *punit)
int utype_upkeep_cost(const struct unit_type *ut, struct player *pplayer, Output_type_id otype)
bool utype_is_cityfounder(const struct unit_type *utype)
struct unit_type * get_role_unit(int role, int role_index)
const char * unit_rule_name(const struct unit *punit)
int num_role_units(int role)
const struct unit_type * can_upgrade_unittype(const struct player *pplayer, const struct unit_type *punittype)
const char * utype_rule_name(const struct unit_type *punittype)
bool unit_has_type_role(const struct unit *punit, enum unit_role_id role)
bool unit_has_type_flag(const struct unit *punit, enum unit_type_flag_id flag)
int utype_build_shield_cost(const struct city *pcity, const struct player *pplayer, const struct unit_type *punittype)
int utype_happy_cost(const struct unit_type *ut, const struct player *pplayer)
int unit_upgrade_price(const struct player *pplayer, const struct unit_type *from, const struct unit_type *to)