66 pcity->
server.adv->downtown = 0;
76 if (punittype == NULL) {
82 "Non existence of wonder helper unit not caught");
90 struct adv_city *city_data = pcity->server.adv;
100 if (move_cost >
range) {
141 if (pcity != wonder_city &&
is_wonder(pimprove)) {
144 }
else if (!is_coinage
187 if (wonder_city &&
city_owner(wonder_city) != pplayer) {
189 adv->wonder_city = 0;
196 if (NULL == wonder_city
205 int best_candidate_value = 0;
206 struct city *best_candidate = NULL;
214 int value = pcity->surplus[
O_SHIELD];
216 struct adv_city *city_data = pcity->server.adv;
218 if (
is_ai(pplayer)) {
252 if (value > best_candidate_value
253 && (!has_help || (place >= 0 && adv->
stats.
cities[place] > 5))
254 && (!has_help || city_data->
downtown > 3)) {
255 best_candidate = pcity;
256 best_candidate_value = value;
260 if (best_candidate) {
263 wonder_city = best_candidate;
267 if (
is_ai(pplayer)) {
302 if (chosen != NULL) {
328 .
kind = VUT_IMPROVEMENT,
339 && pimprove->genus != IG_SMALL_WONDER) {
341 .
kind = VUT_IMPROVEMENT,
342 .value = {.building = pimprove}
#define action_id_get_role(act_id)
static void calculate_city_clusters(struct player *pplayer)
void building_advisor(struct player *pplayer)
static void ba_human_wants(struct player *pplayer, struct city *wonder_city)
void building_advisor_choose(struct city *pcity, struct adv_choice *choice)
void advisor_choose_build(struct player *pplayer, struct city *pcity)
struct adv_data * adv_data_get(struct player *pplayer, bool *caller_closes)
#define CALL_FUNC_EACH_AI(_func,...)
#define CALL_PLR_AI_FUNC(_func, _player,...)
bool city_has_building(const struct city *pcity, const struct impr_type *pimprove)
bool can_city_build_improvement_now(const struct city *pcity, const struct impr_type *pimprove)
bool can_city_build_improvement_later(const struct city *pcity, const struct impr_type *pimprove)
#define city_list_iterate(citylist, pcity)
#define city_owner(_pcity_)
#define city_list_iterate_end
signed short Continent_id
struct city * game_city_by_number(int id)
bool has_handicap(const struct player *pplayer, enum handicap_type htype)
const struct impr_type * valid_improvement(const struct impr_type *pimprove)
bool can_player_build_improvement_later(const struct player *p, 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)
bool is_wonder(const struct impr_type *pimprove)
bool improvement_has_flag(const struct impr_type *pimprove, enum impr_flag_id flag)
bool is_improvement_productive(const struct city *pcity, const struct impr_type *pimprove)
#define improvement_iterate_end
#define improvement_iterate(_p)
#define fc_assert_msg(condition, message,...)
int unit_move_rate(const struct unit *punit)
struct pf_map * pf_map_new(const struct pf_parameter *parameter)
void pf_map_destroy(struct pf_map *pfm)
#define pf_map_move_costs_iterate_end
#define pf_map_move_costs_iterate(ARG_pfm, NAME_tile, NAME_cost, COND_from_start)
#define CITY_LOG(loglevel, pcity, msg,...)
adv_want building_want[B_LAST]
struct adv_data::@90 threats
struct adv_data::@92 stats
struct universal production
struct city::@17::@19 server
struct civ_map::@41::@43 server
struct city_list * cities
bool is_terrain_class_near_tile(const struct civ_map *nmap, const struct tile *ptile, enum terrain_class tclass)
struct city * tile_city(const struct tile *ptile)
#define tile_continent(_tile)
const struct impr_type * building
struct unit * unit_virtual_create(struct player *pplayer, struct city *pcity, const struct unit_type *punittype, int veteran_level)
void unit_virtual_destroy(struct unit *punit)
void unit_tile_set(struct unit *punit, struct tile *ptile)
struct unit_type * first_role_unit_for_player(const struct player *pplayer, int role)
struct unit_type * get_role_unit(int role, int role_index)
int num_role_units(int role)
struct unit_type * best_role_unit_for_player(const struct player *pplayer, int role)
bool utype_can_do_action(const struct unit_type *putype, const action_id act_id)