220 int default_priority)
223 float priority = (float)default_priority;
230 const float mult_factor = 1.4;
241 return default_priority;
338 const struct nation_city_list *
342 int choice = 0,
priority, best_priority = -1;
343 const char *
name, *best_name = NULL;
350 if (-1 == best_priority ||
priority < best_priority) {
373 char *error_buf,
size_t bufsz)
393 _(
"A city called %s already exists."), cityname);
409 struct player *pother = NULL;
418 if (pother != NULL) {
421 _(
"Can't use %s as a city name. It is reserved for %s."),
439 _(
"%s is not a valid name. Only ASCII or "
440 "ruleset names are allowed for cities."),
461 log_verbose(
"Suggesting city name for %s at (%d,%d)",
490 int queue_size = 1, i = 0, idx;
492 memset(nations_selected, 0,
sizeof(nations_selected));
493 nation_list[0] = pnation;
497 for (; i < queue_size; i++) {
501 const int which = i +
fc_rand(queue_size - i);
504 nation_list[i] = nation_list[which];
505 nation_list[which] = tmp;
507 pnation = nation_list[i];
519 if (!nations_selected[idx]) {
520 nation_list[queue_size] =
n;
521 nations_selected[idx] =
TRUE;
530 if (!nations_selected[idx]) {
531 nation_list[queue_size] =
n;
532 nations_selected[idx] =
TRUE;
542 if (!nations_selected[idx]) {
543 nation_list[queue_size] =
n;
557 log_debug(
"City name not found in rulesets.");
589 bool rehome,
bool verbose)
597 "Tried to transfer the dying unit %d.",
600 if (from_player == to_player) {
609 _(
"Changed homecity of %s to %s."),
623 log_debug(
"%s already have a %s. Can't transfer from %s",
638 _(
"The %s already have a %s. Can't transfer yours."),
657 _(
"Transferred %s in %s from %s to %s."),
671 _(
"Transferred %s from %s to %s."),
685 _(
"%s %s lost in transfer to %s %s"),
720 struct unit_list *units,
struct city *pcity,
721 struct city *exclude_city,
722 int kill_outside,
bool verbose)
725 int saved_id = pcity->
id;
730 if (pplayer != pvictim) {
732 if (vunit->server.dying) {
755 bool homeless = (vunit->homecity == 0)
756 && !unit_list_search(
units, vunit);
765 unit_list_remove(
units, vunit);
782 if (vunit->server.dying) {
791 if (new_home_city && new_home_city != exclude_city
797 }
else if ((kill_outside == -1
809 log_verbose(
"Lost %s %s at (%d,%d) when %s was lost.",
815 _(
"%s lost along with control of %s."),
855 const struct city *pexclcity,
856 const struct player *pplayer,
857 bool only_ocean,
bool only_continent,
858 bool only_known,
bool only_player,
859 bool only_enemy,
const struct unit_class *pclass)
862 struct city *best_city = NULL;
867 if (pplayer != NULL && only_player && only_enemy) {
868 log_error(
"Non of my own cities will be at war with me!");
875 if (pplayer != NULL && only_player && pplayer != aplayer) {
880 if (pplayer != NULL && only_enemy
889 if (pexclcity && pexclcity == pcity) {
902 if ((best_dist == -1 || city_dist < best_dist)
912 best_dist = city_dist;
929 bool city_remains =
TRUE;
984 trade_route_list_append(pcity->
routes, proute);
985 trade_route_list_append(partner->
routes, back);
1013 bv_imprs *had_small_wonders)
1049 _(
"A replacement %s was built in %s."),
1071 int kill_outside,
bool transfer_unit_verbose,
1072 bool resolve_stack,
bool raze,
bool build_free)
1074 bv_imprs had_small_wonders;
1075 struct vision *old_vision, *new_vision;
1076 struct unit_list *old_city_units = unit_list_new();
1079 int saved_id = pcity->
id;
1080 bool city_remains =
TRUE;
1081 bool had_great_wonders =
FALSE;
1086 bool taker_had_no_cities = (city_list_size(ptaker->
cities) == 0);
1089 const int ul_size = unit_list_size(pcenter->
units);
1090 int central_units[ul_size + 1];
1091 bv_player *could_see_unit = NULL;
1098 central_units[units_num++] =
punit->
id;
1101 if (units_num > 0) {
1102 could_see_unit =
fc_calloc(
sizeof(*could_see_unit), units_num);
1105 for (i = 0; i < units_num; i++) {
1134 unit_list_prepend(old_city_units,
punit);
1157 had_great_wonders =
TRUE;
1179 _(
"You already had a city called %s."
1180 " The city was renamed to %s."),
1184 free(old_city_name);
1188 city_list_remove(pgiver->
cities, pcity);
1192 pcity->
owner = ptaker;
1195 city_list_prepend(ptaker->
cities, pcity);
1197 if (could_see_unit != NULL) {
1200 for (i = 0; i < units_num; i++) {
1221 free(could_see_unit);
1222 could_see_unit = NULL;
1227 kill_outside, transfer_unit_verbose);
1229 unit_list_destroy(old_city_units);
1231 if (resolve_stack) {
1236 city_remains =
FALSE;
1265 if (taker_had_no_cities) {
1296 _(
"The people in %s are stunned by your "
1297 "technological insight!"),
1300 if (upgradet != NULL) {
1302 _(
"Workers spontaneously gather and upgrade "
1307 _(
"Workers spontaneously gather and upgrade "
1308 "%s infrastructure."),
1349 if (had_great_wonders) {
1366 if (
BV_ISSET_ANY(had_small_wonders) || had_great_wonders) {
1406 return city_remains;
1421 bool has_small_wonders, has_great_wonders;
1435 has_small_wonders =
FALSE;
1436 has_great_wonders =
FALSE;
1454 has_small_wonders =
TRUE;
1474 has_small_wonders =
TRUE;
1476 has_great_wonders =
TRUE;
1482 if (has_great_wonders) {
1486 }
else if (has_small_wonders) {
1496 const char *
name,
struct player *nationality)
1534 if (city_list_size(pplayer->
cities) == 0) {
1549 if (NULL != pwork) {
1584 city_list_prepend(pplayer->
cities, pcity);
1619 _(
"You have founded %s."),
1671 if (
name == NULL ||
name[0] ==
'\0') {
1688 bv_imprs had_small_wonders;
1689 struct vision *old_vision;
1691 bool had_great_wonders =
FALSE;
1694 struct dbv tile_processed;
1695 struct tile_list *process_queue;
1709 had_great_wonders =
TRUE;
1718 && new_home_city != pcity
1741 struct unit *ptrans;
1762 _(
"Moved %s out of disbanded city %s "
1763 "since it cannot stay on %s."),
1774 _(
"When %s was disbanded your %s could not "
1775 "get out, and it was therefore lost."),
1782 process_queue = tile_list_new();
1784 for (tile_list_append(process_queue, pcenter); tile_list_size(process_queue) > 0;) {
1785 struct tile *ptile = tile_list_front(process_queue);
1787 tile_list_pop_front(process_queue);
1790 struct city *other_city;
1796 if (other_city != NULL) {
1799 tile_list_append(process_queue, piter);
1808 _(
"When %s was disbanded your %s in %s was trapped, "
1809 "and it was therefore lost."),
1823 tile_list_destroy(process_queue);
1902 if (NULL == pconn->playing && pconn->observer) {
1910 if (old_vision != NULL) {
1923 if (had_great_wonders) {
1965 bool try_civil_war =
FALSE;
1973 "Can't conquer city during peace.");
1979 ACTION_PARADROP_CONQUER)
1981 ACTION_PARADROP_FRIGHTEN_CONQUER)
1983 ACTION_PARADROP_ENTER_CONQUER),
1984 FALSE,
"Bad unit for city occupation.");
1989 "Can't conquer city while transported.");
2008 try_civil_war =
TRUE;
2016 int saved_id = pcity->
id;
2019 _(
"You destroy %s completely."),
2022 _(
"%s has been destroyed by %s."),
2031 if (try_civil_war) {
2048 PL_(
"You conquer %s; your lootings accumulate"
2050 "You conquer %s; your lootings accumulate"
2051 " to %d gold!", coins),
2055 PL_(
"%s conquered %s and looted %d gold"
2057 "%s conquered %s and looted %d gold"
2058 " from the city.", coins),
2064 _(
"You conquer %s."),
2067 _(
"%s conquered %s."),
2074 PL_(
"You have liberated %s!"
2075 " Lootings accumulate to %d gold.",
2076 "You have liberated %s!"
2077 " Lootings accumulate to %d gold.", coins),
2081 PL_(
"%s liberated %s and looted %d gold"
2083 "%s liberated %s and looted %d gold"
2084 " from the city.", coins),
2090 _(
"You have liberated %s!"),
2093 _(
"%s liberated %s."),
2117 if (try_civil_war) {
2137 return walls > 0 ? walls : 0;
2164 if (pdcity->
name == NULL) {
2165 packet->
name[0] =
'\0';
2225 struct trade_route_packet_list *routes;
2238 routes = trade_route_packet_list_new();
2239 package_city(pcity, &packet, &nat_packet, &rally_packet,
2240 &web_packet, routes,
FALSE);
2277 trade_route_packet_list_destroy(routes);
2288 struct player *pplayer = pconn->playing;
2290 if (!pplayer && !pconn->observer) {
2311 log_error(
"%s radius changed while sending to player.",
2339 if (!dest || dest == powner) {
2377 struct city *pcity,
struct tile *ptile)
2384 struct player *powner = NULL;
2385 struct trade_route_packet_list *routes = NULL;
2399 if (powner != NULL && powner == pviewer) {
2406 routes = trade_route_packet_list_new();
2410 package_city(pcity, &packet, &nat_packet, &rally_packet,
2411 &web_packet, routes,
FALSE);
2437 routes = trade_route_packet_list_new();
2440 package_city(pcity, &packet, &nat_packet, &rally_packet,
2441 &web_packet, routes,
FALSE);
2467 if (routes != NULL) {
2471 trade_route_packet_list_destroy(routes);
2484 struct trade_route_packet_list *routes,
2492 packet->
id32 = pcity->
id;
2520 nat_packet->
id32 = pcity->
id;
2521 nat_packet->
id16 = nat_packet->
id32;
2528 if (nationality != 0) {
2549 if (packet->
size != ppl) {
2555 log_error(
"Failed to fix inconsistent city size.");
2565 log_error(
"City size %d, citizen count %d for %s",
2575 web_packet, routes, dipl_invest);
2590 tri_packet->
index = i;
2591 tri_packet->
partner32 = proute->partner;
2593 tri_packet->
value = proute->value;
2597 trade_route_packet_list_append(routes, tri_packet);
2665 web_packet->
id32 = pcity->
id;
2666 web_packet->
id16 = web_packet->
id32;
2685 bv_imprs improvements;
2706 if (NULL == pdcity) {
2709 }
else if (pdcity->
location != pcenter) {
2710 log_error(
"Trying to update bad city (wrong location) "
2711 "at %i,%i for player %s",
2716 log_error(
"Trying to update old city (wrong identity) "
2717 "at %i,%i for player %s",
2758 if (!pcity || pcity->
id != pdcity->
identity) {
2764 playtile->
site = NULL;
2783 playtile->
site = NULL;
2807 _(
"Trade between %s and %s lost along with city."),
2808 city1_link, city2_link);
2812 _(
"Trade route between %s and %s canceled."),
2813 city1_link, city2_link);
2820 _(
"Trade between %s city %s and %s lost along with "
2828 _(
"Sorry, the %s canceled the trade route "
2829 "from %s to your city %s."),
2834 _(
"We canceled the trade route "
2835 "from %s to %s city %s."),
2857 trade_route_list_remove(pc1->
routes, proute);
2861 if (pc1->
id == pback->partner) {
2866 if (back_route != NULL) {
2867 trade_route_list_remove(pc2->
routes, back_route);
2888 _(
"%s has been struck by a plague! Population lost!"),
2911 struct impr_type *pimprove,
const char *reason)
2933 struct player **oldcity_owner)
2935 struct city *oldcity = NULL;
2949 if (oldcity && oldcity != pcity) {
2961 const char *reason,
struct unit *destroyer)
2963 int backup = pcity->
id;
2978 const char *reason,
struct unit *destroyer)
2986 if ((was_capital && (!city_remains || !
is_capital(pcity)))
3037 EFT_UNIT_UPKEEP_FREE_PER_CITY);
3044 bool update =
FALSE;
3050 if (free_uk[o] >
cost) {
3077 enum event_type
event)
3090 &&
event != E_IMP_AUTO
3091 &&
event != E_WORKLIST) {
3097 _(
"The %s have stopped building The %s in %s."),
3119 source =
_(
" from the worklist");
3124 source =
_(
" as suggested by the advisor");
3141 _(
"%s is building %s%s."),
3150 _(
"The %s have started building The %s in %s."),
3246 if (!pcity->server.synced) {
3263 ptile, _index, _x, _y) {
3311 if ((VUT_TERRAIN == preq->source.kind
3312 || VUT_TERRAINCLASS == preq->source.kind
3313 || VUT_TERRFLAG == preq->source.kind)
3319 PL_(
"You sell %s in %s (now landlocked)"
3321 "You sell %s in %s (now landlocked)"
3322 " for %d gold.", price),
3367 int city_tiles_old, city_tiles_new;
3377 if (city_radius_sq_new == city_radius_sq_old) {
3386 if (city_tiles_old == city_tiles_new) {
3393 pcity->
id, city_radius_sq_old, city_radius_sq_new);
3396 log_debug(
"[%s (%d)] city size: %d; specialists: %d (before change)",
3403 if (city_tiles_old < city_tiles_new) {
3414 city_radius_sq_old, city_x,
3459 ftc_server,
_(
"The size of the city map of %s is %s."),
3461 city_tiles_old < city_tiles_new ?
_(
"increased")
3465 log_debug(
"[%s (%d)] city size: %d; specialists: %d (after change)",
3480 if (ptask == NULL) {
3484 worker_task_list_remove(pcity->
task_reqs, ptask);
3504 while (worker_task_list_size(pcity->
task_reqs) > 0) {
3522 if (ptask->tgt == NULL) {
3527 packet.
want = ptask->want;
3542 case VUT_IMPROVEMENT:
3560 const struct player *known_for)
3568 || known_for == NULL) {
void advisor_choose_build(struct player *pplayer, struct city *pcity)
int adv_could_unit_move_to_tile(struct unit *punit, struct tile *dest_tile)
#define CALL_FUNC_EACH_AI(_func,...)
#define CALL_PLR_AI_FUNC(_func, _player,...)
bool is_land_barbarian(struct player *pplayer)
void dbv_init(struct dbv *pdbv, int bits)
void dbv_set(struct dbv *pdbv, int bit)
bool dbv_isset(const struct dbv *pdbv, int bit)
void dbv_free(struct dbv *pdbv)
#define BV_ARE_EQUAL(vec1, vec2)
#define BV_ISSET(bv, bit)
#define BV_ISSET_ANY(vec)
citizens citizens_nation_get(const struct city *pcity, const struct player_slot *pslot)
void citizens_init(struct city *pcity)
void citizens_convert_conquest(struct city *pcity)
void citizens_update(struct city *pcity, struct player *plr)
bool is_free_worked(const struct city *pcity, const struct tile *ptile)
void city_map_radius_sq_set(struct city *pcity, int radius_sq)
int city_production_build_shield_cost(const struct city *pcity)
void city_name_set(struct city *pcity, const char *new_name)
int city_granary_size(int city_size)
citizens player_angry_citizens(const struct player *pplayer)
void city_choose_build_default(const struct civ_map *nmap, struct city *pcity)
struct tile * city_map_to_tile(const struct civ_map *nmap, const struct tile *city_center, int city_radius_sq, int city_map_x, int city_map_y)
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)
struct output_type * get_output_type(Output_type_id output)
citizens player_content_citizens(const struct player *pplayer)
bool city_unhappy(const struct city *pcity)
struct city * create_city_virtual(struct player *pplayer, struct tile *ptile, const char *name)
struct city * city_list_find_number(struct city_list *This, int id)
int city_illness_calc(const struct city *pcity, int *ill_base, int *ill_size, int *ill_trade, int *ill_pollution)
int city_change_production_penalty(const struct city *pcity, const struct universal *target)
bool city_can_be_built_here(const struct civ_map *nmap, const struct tile *ptile, const struct unit *punit, bool hut_test)
bool city_happy(const struct city *pcity)
void city_add_improvement(struct city *pcity, const struct impr_type *pimprove)
int city_map_radius_sq_get(const struct city *pcity)
void citylog_map_workers(enum log_level level, struct city *pcity)
citizens city_specialists(const struct city *pcity)
struct city * city_list_find_name(struct city_list *This, const char *name)
bool can_city_build_now(const struct civ_map *nmap, const struct city *pcity, const struct universal *target)
int city_map_tiles(int city_radius_sq)
bool city_can_work_tile(const struct city *pcity, const struct tile *ptile)
int city_turns_to_grow(const struct city *pcity)
void city_rally_point_clear(struct city *pcity)
const char * city_production_name_translation(const struct city *pcity)
#define cities_iterate_end
#define city_list_iterate(citylist, pcity)
#define city_tile(_pcity_)
#define cities_iterate(pcity)
#define CITY_MAP_MAX_RADIUS_SQ
static citizens city_size_get(const struct city *pcity)
#define city_tile_iterate_skip_free_worked(_nmap, _radius_sq, _city_tile, _tile, _index, _x, _y)
#define CITY_MAP_MIN_RADIUS_SQ
#define city_map_iterate_radius_sq(_radius_sq_min, _radius_sq_max, _x, _y)
#define output_type_iterate(output)
#define city_owner(_pcity_)
#define city_tile_iterate_skip_free_worked_end
#define city_list_iterate_end
#define city_map_iterate_radius_sq_end
#define city_built_iterate(_pcity, _p)
#define city_map_iterate_without_index_end
#define city_built_iterate_end
#define city_map_iterate_without_index(_radius_sq, _x, _y)
#define output_type_iterate_end
void auto_arrange_workers(struct city *pcity)
void city_refresh_queue_add(struct city *pcity)
void nullify_prechange_production(struct city *pcity)
bool city_reduce_size(struct city *pcity, citizens pop_loss, struct player *destroyer, const char *reason)
bool city_refresh(struct city *pcity)
void city_refresh_for_player(struct player *pplayer)
void city_refresh_queue_processing(void)
void remove_obsolete_buildings_city(struct city *pcity, bool refresh)
enum announce_type announce
void conn_list_do_unbuffer(struct conn_list *dest)
struct connection * conn_by_user(const char *user_name)
void conn_list_do_buffer(struct conn_list *dest)
bool conn_is_global_observer(const struct connection *pconn)
#define conn_list_iterate(connlist, pconn)
#define conn_list_iterate_end
int city_culture(const struct city *pcity)
static void homeless(QVariant data1, QVariant data2)
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
int get_city_bonus(const struct city *pcity, enum effect_type effect_type)
int get_unit_bonus(const struct unit *punit, enum effect_type effect_type)
int get_city_output_bonus(const struct city *pcity, const struct output_type *poutput, enum effect_type effect_type)
int get_player_bonus(const struct player *pplayer, enum effect_type effect_type)
#define MAX_NUM_BUILDING_LIST
#define MAX_NUM_PLAYER_SLOTS
signed short Continent_id
#define IDENTITY_NUMBER_ZERO
#define PL_(String1, String2, n)
void fc_allocate_mutex(fc_mutex *mutex)
void fc_release_mutex(fc_mutex *mutex)
const char * city_tile_link(const struct city *pcity)
const struct ft_color ftc_server
const char * city_link(const struct city *pcity)
const char * unit_link(const struct unit *punit)
const char * unit_tile_link(const struct unit *punit)
struct city * game_city_by_name(const char *name)
struct unit * game_unit_by_number(int id)
void game_remove_city(struct world *gworld, struct city *pcity)
struct city * game_city_by_number(int id)
void send_game_info(struct conn_list *dest)
static GtkWidget * source
bool has_handicap(const struct player *pplayer, enum handicap_type htype)
void idex_register_city(struct world *iworld, struct city *pcity)
struct impr_type * improvement_by_number(const Impr_type_id id)
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(const struct impr_type *pimprove)
bool is_improvement_visible(const struct impr_type *pimprove)
Impr_type_id improvement_index(const struct impr_type *pimprove)
int impr_buy_gold_cost(const struct city *pcity, const struct impr_type *pimprove, int shields_in_stock)
bool is_great_wonder(const struct impr_type *pimprove)
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)
struct city * city_from_great_wonder(const struct impr_type *pimprove)
bool is_small_wonder(const struct impr_type *pimprove)
#define improvement_iterate_end
#define improvement_iterate(_p)
void adv_city_free(struct city *pcity)
void adv_city_update(struct city *pcity)
void adv_city_alloc(struct city *pcity)
#define fc_assert_msg(condition, message,...)
#define fc_assert_ret(condition)
#define log_verbose(message,...)
#define fc_assert(condition)
#define fc_assert_ret_msg(condition, message,...)
#define fc_assert_ret_val(condition, val)
#define fc_assert_action(condition, action)
#define log_debug(message,...)
#define log_base(level, message,...)
#define log_error(message,...)
#define fc_assert_ret_val_msg(condition, val, message,...)
bool is_safe_ocean(const struct civ_map *nmap, const struct tile *ptile)
int real_map_distance(const struct tile *tile0, const struct tile *tile1)
#define adjc_iterate(nmap, center_tile, itr_tile)
#define whole_map_iterate(_map, _tile)
#define whole_map_iterate_end
void vision_clear_sight(struct vision *vision)
void map_claim_ownership(struct tile *ptile, struct player *powner, struct tile *psource, bool claim_bases)
bool map_is_known(const struct tile *ptile, const struct player *pplayer)
void destroy_extra(struct tile *ptile, struct extra_type *pextra)
void send_tile_info(struct conn_list *dest, struct tile *ptile, bool send_unknown)
struct vision_site * map_get_player_city(const struct tile *ptile, const struct player *pplayer)
void map_show_tile(struct player *src_player, struct tile *ptile)
void give_citymap_from_player_to_player(struct city *pcity, struct player *pfrom, struct player *pdest)
void tile_change_side_effects(struct tile *ptile, bool refresh_city)
bool map_is_known_and_seen(const struct tile *ptile, const struct player *pplayer, enum vision_layer vlayer)
void change_playertile_site(struct player_tile *ptile, struct vision_site *new_site)
void map_claim_border(struct tile *ptile, struct player *owner, int radius_sq)
void update_tile_knowledge(struct tile *ptile)
struct vision_site * map_get_player_site(const struct tile *ptile, const struct player *pplayer)
bool upgrade_city_extras(struct city *pcity, struct extra_type **gained)
void map_clear_border(struct tile *ptile)
struct player_tile * map_get_player_tile(const struct tile *ptile, const struct player *pplayer)
void vision_change_sight(struct vision *vision, const v_radius_t radius_sq)
#define fc_calloc(n, esz)
bool can_exist_at_tile(const struct civ_map *nmap, const struct unit_type *utype, const struct tile *ptile)
bool can_unit_exist_at_tile(const struct civ_map *nmap, const struct unit *punit, const struct tile *ptile)
bool is_native_tile(const struct unit_type *punittype, const struct tile *ptile)
bool is_city_channel_tile(const struct civ_map *nmap, const struct unit_class *punitclass, const struct tile *ptile, const struct tile *pexclude)
bool can_unit_survive_at_tile(const struct civ_map *nmap, const struct unit *punit, const struct tile *ptile)
bool is_native_near_tile(const struct civ_map *nmap, const struct unit_class *uclass, const struct tile *ptile)
const char * nation_city_name(const struct nation_city *pncity)
const struct nation_city_list * nation_cities(const struct nation_type *pnation)
const char * nation_rule_name(const struct nation_type *pnation)
enum nation_city_preference nation_city_preference_revert(enum nation_city_preference prefer)
Nation_type_id nation_count(void)
struct nation_type * nation_of_unit(const struct unit *punit)
const char * nation_adjective_for_player(const struct player *pplayer)
enum nation_city_preference nation_city_terrain_preference(const struct nation_city *pncity, const struct terrain *pterrain)
struct nation_type * nation_of_player(const struct player *pplayer)
enum nation_city_preference nation_city_river_preference(const struct nation_city *pncity)
Nation_type_id nation_index(const struct nation_type *pnation)
const char * nation_plural_for_player(const struct player *pplayer)
#define nation_list_iterate(nationlist, pnation)
#define nation_city_list_iterate(citylist, pncity)
#define nation_list_iterate_end
#define nation_city_list_iterate_end
void notify_player(const struct player *pplayer, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
#define web_send_packet(packetname,...)
#define web_lsend_packet(packetname,...)
int send_packet_city_rally_point(struct connection *pc, const struct packet_city_rally_point *packet, bool force_to_send)
void lsend_packet_city_nationalities(struct conn_list *dest, const struct packet_city_nationalities *packet, bool force_to_send)
void dlsend_packet_city_remove(struct conn_list *dest, int city_id16, int city_id32)
int dsend_packet_city_remove(struct connection *pc, int city_id16, int city_id32)
int send_packet_city_info(struct connection *pc, const struct packet_city_info *packet, bool force_to_send)
void lsend_packet_trade_route_info(struct conn_list *dest, const struct packet_trade_route_info *packet)
int send_packet_trade_route_info(struct connection *pc, const struct packet_trade_route_info *packet)
void lsend_packet_city_info(struct conn_list *dest, const struct packet_city_info *packet, bool force_to_send)
int send_packet_city_nationalities(struct connection *pc, const struct packet_city_nationalities *packet, bool force_to_send)
void lsend_packet_city_short_info(struct conn_list *dest, const struct packet_city_short_info *packet)
void lsend_packet_worker_task(struct conn_list *dest, const struct packet_worker_task *packet)
void lsend_packet_city_rally_point(struct conn_list *dest, const struct packet_city_rally_point *packet, bool force_to_send)
int player_number(const struct player *pplayer)
const char * player_name(const struct player *pplayer)
bool can_player_see_unit(const struct player *pplayer, const struct unit *punit)
bool pplayers_at_war(const struct player *pplayer, const struct player *pplayer2)
int player_slot_index(const struct player_slot *pslot)
int player_index(const struct player *pplayer)
bool player_can_see_city_externals(const struct player *pow_player, const struct city *target_city)
bool pplayers_allied(const struct player *pplayer, const struct player *pplayer2)
bool can_player_see_units_in_city(const struct player *pplayer, const struct city *pcity)
struct player * player_slot_get_player(const struct player_slot *pslot)
bool can_player_see_city_internals(const struct player *pplayer, const struct city *pcity)
#define players_iterate_end
#define players_iterate(_pplayer)
static bool is_barbarian(const struct player *pplayer)
#define player_slots_iterate(_pslot)
#define player_slots_iterate_end
int normal_player_count(void)
bool civil_war_triggered(struct player *pplayer)
void maybe_make_contact(struct tile *ptile, struct player *pplayer)
void send_player_info_c(struct player *src, struct conn_list *dest)
struct player * civil_war(struct player *pplayer)
bool civil_war_possible(struct player *pplayer, bool conquering_city, bool honour_server_option)
void update_capital(struct player *pplayer)
#define allowed_nations_iterate(pnation)
#define allowed_nations_iterate_end
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)
bool are_universals_equal(const struct universal *psource1, const struct universal *psource2)
int universal_number(const struct universal *source)
#define requirement_vector_iterate_end
#define requirement_vector_iterate(req_vec, preq)
struct research * research_get(const struct player *pplayer)
bool road_has_flag(const struct road_type *proad, enum road_flag_id flag)
#define sanity_check_city(x)
void script_server_signal_emit(const char *signal_name,...)
void script_server_remove_exported_object(void *object)
static struct connection connections[MAX_NUM_CONNECTIONS]
static struct setting settings[]
bool is_ascii_name(const char *name)
#define CLIP(lower, current, upper)
void spaceship_lost(struct player *pplayer)
Specialist_type_id specialist_count(void)
#define specialist_type_iterate_end
#define specialist_type_iterate(sp)
#define DEFAULT_SPECIALIST
SPECPQ_PRIORITY_TYPE priority
static int recursion[AIT_LAST]
int identity_number(void)
enum server_states server_state(void)
struct worker_task_list * task_reqs
struct built_status built[B_LAST]
int last_turns_shield_surplus
enum capital_type capital
bv_city_options city_options
struct trade_route_list * routes
enum city_needs_arrange needs_arrange
struct universal production
struct unit_order * orders
struct city::@16 rally_point
int unhappy_penalty[O_LAST]
int before_change_shields
citizens feel[CITIZEN_LAST][FEELING_LAST]
citizens specialists[SP_MAX]
struct city::@17::@19 server
struct cm_parameter * cm_parameter
struct universal changed_from
struct unit_list * units_supported
enum city_names_mode allowed_city_names
struct civ_game::@29 rgame
struct civ_game::@30::@34 server
struct conn_list * glob_observers
struct conn_list * est_connections
struct packet_game_info info
int global_init_buildings[MAX_NUM_BUILDING_LIST]
struct civ_game::@30::@34::@38 mutexes
enum cmdlevel access_level
int init_buildings[MAX_NUM_BUILDING_LIST]
struct nation_list * parent_nations
struct nation_type::@50::@52 server
struct nation_list * civilwar_nations
int last_turns_shield_surplus
int before_change_shields
int ppl_content[FEELING_LAST]
bv_city_options city_options
enum capital_type capital
int ppl_unhappy[FEELING_LAST]
int ppl_angry[FEELING_LAST]
char name[MAX_LEN_CITYNAME]
int ppl_happy[FEELING_LAST]
bool diplomat_investigate
int unhappy_penalty[O_LAST]
int nation_id[MAX_CITY_NATIONALITIES]
int nation_citizens[MAX_CITY_NATIONALITIES]
struct unit_order orders[MAX_LEN_ROUTE]
enum capital_type capital
char name[MAX_LEN_CITYNAME]
bool team_pooled_research
enum route_direction direction
enum unit_activity activity
enum spaceship_state state
struct vision_site * site
struct city_list * cities
char username[MAX_LEN_NAME]
struct conn_list * connections
struct player_economic economic
struct player_spaceship spaceship
struct player::@69::@71 server
const struct player * player
struct unit::@80::@83 server
struct unit * transporter
const struct unit_type * utype
enum capital_type capital
int fc_snprintf(char *str, size_t n, const char *format,...)
int fc_strcasecmp(const char *str0, const char *str1)
#define sz_strlcpy(dest, src)
const struct player_list * team_members(const struct team *pteam)
bool is_terrain_class_near_tile(const struct civ_map *nmap, const struct tile *ptile, enum terrain_class tclass)
const char * terrain_name_translation(const struct terrain *pterrain)
bool is_terrain_near_tile(const struct civ_map *nmap, const struct tile *ptile, const struct terrain *pterrain, bool check_self)
#define terrain_type_iterate(_p)
#define terrain_type_iterate_end
void tile_set_owner(struct tile *ptile, struct player *pplayer, struct tile *claimer)
bool tile_extra_rm_apply(struct tile *ptile, struct extra_type *tgt)
struct city * tile_city(const struct tile *ptile)
void tile_set_worked(struct tile *ptile, struct city *pcity)
#define tile_claimer(_tile)
#define tile_worked(_tile)
#define tile_terrain(_tile)
#define tile_continent(_tile)
#define tile_has_extra(ptile, pextra)
#define tile_owner(_tile)
bool can_cities_trade(const struct city *pc1, const struct city *pc2)
enum trade_route_type cities_trade_route_type(const struct city *pcity1, const struct city *pcity2)
Goods_type_id goods_number(const struct goods_type *pgood)
struct trade_route_settings * trade_route_settings_by_type(enum trade_route_type type)
bool can_establish_trade_route(const struct city *pc1, const struct city *pc2)
#define trade_routes_iterate_safe_end
#define trade_routes_iterate_end
#define trade_routes_iterate_safe(c, proute)
#define trade_routes_iterate(c, proute)
const struct unit_type * utype
const struct impr_type * building
struct unit * transporter_for_unit_at(const struct unit *pcargo, const struct tile *ptile)
bool can_unit_continue_current_activity(const struct civ_map *nmap, struct unit *punit)
static bool is_enemy_unit_tile(const struct tile *ptile, const struct player *pplayer)
bool unit_activity_handling(struct unit *punit, enum unit_activity new_activity)
void unit_change_homecity_handling(struct unit *punit, struct city *new_pcity, bool rehome)
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_safe(unitlist, _unit)
#define unit_list_iterate_end
#define unit_list_iterate_safe_end
int utype_buy_gold_cost(const struct city *pcity, const struct unit_type *punittype, int shields_in_stock)
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)
const char * unit_rule_name(const struct unit *punit)
bool utype_player_already_has_this_unique(const struct player *pplayer, const struct unit_type *putype)
bool unit_can_take_over(const struct unit *punit)
bool utype_can_do_action(const struct unit_type *putype, const action_id act_id)
static bool uclass_has_flag(const struct unit_class *punitclass, enum unit_class_flag_id flag)
static bool utype_has_flag(const struct unit_type *punittype, int flag)
void vision_site_update_from_city(struct vision_site *psite, const struct city *pcity)
citizens vision_site_size_get(const struct vision_site *psite)
struct vision * vision_new(struct player *pplayer, struct tile *ptile)
bool vision_reveal_tiles(struct vision *vision, bool reveal_tiles)
void vision_free(struct vision *vision)
struct vision_site * vision_site_new_from_city(const struct city *pcity)
void vision_site_destroy(struct vision_site *psite)
#define V_RADIUS(main_sq, invis_sq, subs_sq)
#define vision_site_owner(v)
short int v_radius_t[V_COUNT]
#define worker_task_list_iterate(tasklist, ptask)
#define worker_task_list_iterate_end
void worklist_copy(struct worklist *dst, const struct worklist *src)