124#define SPECLIST_TAG cityimpr
125#define SPECLIST_TYPE struct cityimpr
128#define cityimpr_list_iterate(cityimprlist, pcityimpr) \
129 TYPED_LIST_ITERATE(struct cityimpr, cityimprlist, pcityimpr)
130#define cityimpr_list_iterate_end LIST_ITERATE_END
249 PL_(
"%s is selling %s (obsolete) for %d.",
250 "%s is selling %s (obsolete) for %d.",
259 if (
sold && refresh) {
293 if (
cmr->worker_positions[idx]) {
294 if (
pwork ==
nullptr) {
349 cmp->happy_factor = 0;
403 if (
pcity->cm_parameter) {
416 if (!
cmr->found_a_valid) {
417 if (
pcity->cm_parameter) {
420 pcity->cm_parameter =
nullptr;
424 _(
"The citizen governor can't fulfill the requirements "
425 "for %s. Passing back control."),
435 if (!
cmr->found_a_valid) {
438 cmp.minimal_surplus[
o] = 0;
444 if (!
cmr->found_a_valid) {
449 cmp.minimal_surplus[
o] =
MIN(
cmp.minimal_surplus[
o],
456 if (!
cmr->found_a_valid) {
473 log_error(
"%s radius changed when already arranged workers.",
494 const struct impr_type *pimprove =
pcity->production.value.building;
503 _(
"Notice: Wonder %s in %s will be finished next turn."),
517 const struct impr_type *pimprove =
pcity->production.value.building;
538 _(
"Suggest throttling growth in %s to use %s "
539 "(being built) more effectively."),
553 _(
"%s may soon grow to size %i."),
580 if (
pconn !=
nullptr) {
583 if (pplayer !=
nullptr) {
624 if (
tcity !=
nullptr) {
706 nullptr,
nullptr,
nullptr,
nullptr);
733 return change - want;
756 return change - want;
802#ifndef FREECIV_NDEBUG
821 "city_reduce_size() has remaining"
822 "%d of %d for \"%s\"[%d]",
857 }
else if (change < 0) {
861#ifndef FREECIV_NDEBUG
868 "city_repair_size() has remaining %d of %d for \"%s\"[%d]",
929 const struct impr_type *pimprove =
pcity->production.value.building;
937 _(
"%s needs %s (being built) to grow beyond size %d."),
943 _(
"%s needs an improvement to grow beyond size %d."),
1029 struct player *nationality,
1054 _(
"%s grows to size %d."),
1070 struct player *nationality,
1105 }
else if (change < 0) {
1131 _(
"A recent plague outbreak prevents growth in %s."),
1147 }
else if (
pcity->food_stock < 0) {
1163 _(
"Famine feared in %s, %s lost!"),
1177 _(
"Famine causes population loss in %s."),
1182 _(
"Famine destroys %s entirely."),
1221 switch (target->
kind) {
1243 _(
"%s can't build %s from the worklist. "
1253 switch (
preq->source.kind) {
1255 if (
preq->present) {
1258 _(
"%s can't build %s from the worklist; "
1259 "counter %s value's checkpoint do not met "
1264 (
preq->source.value.counter));
1270 if (
preq->present) {
1273 _(
"%s can't build %s from the worklist; "
1274 "tech %s not yet available. Postponing..."),
1278 (
preq->source.value.advance));
1280 pcity,
"need_tech");
1287 if (
preq->present) {
1290 _(
"%s can't build %s from the worklist; "
1291 "no tech with flag \"%s\" yet available. "
1297 pcity,
"need_techflag");
1309 if (
preq->present) {
1312 _(
"%s can't build %s from the worklist; "
1313 "need to have %s first. Postponing..."),
1317 preq->source.value.building));
1319 pcity,
"need_building");
1323 _(
"%s can't build %s from the worklist; "
1324 "need to not have %s. Postponing..."),
1328 preq->source.value.building));
1330 pcity,
"have_building");
1339 if (
preq->present) {
1342 _(
"%s can't build %s from the worklist; "
1343 "need to have %s first. Postponing..."),
1347 preq->source.value.impr_genus));
1349 pcity,
"need_building_genus");
1353 _(
"%s can't build %s from the worklist; "
1354 "need to not have %s. Postponing..."),
1358 preq->source.value.impr_genus));
1360 pcity,
"have_building_genus");
1369 if (
preq->present) {
1372 _(
"%s can't build %s from the worklist; "
1373 "need to have %s first. Postponing..."),
1377 preq->source.value.impr_flag));
1379 pcity,
"need_building_flag");
1383 _(
"%s can't build %s from the worklist; "
1384 "need to not have %s. Postponing..."),
1388 preq->source.value.impr_flag));
1390 pcity,
"have_building_flag");
1395 if (
preq->present) {
1398 _(
"%s can't build %s from the worklist; "
1399 "need to have %s first. Postponing..."),
1403 preq->source.value.plr_flag));
1405 pcity,
"need_player_flag");
1409 _(
"%s can't build %s from the worklist; "
1410 "need to not have %s. Postponing..."),
1414 preq->source.value.plr_flag));
1416 pcity,
"have_player_flag");
1423 if (
preq->present) {
1426 _(
"%s can't build %s from the worklist; "
1427 "it needs %s government. Postponing..."),
1432 pcity,
"need_government");
1436 _(
"%s can't build %s from the worklist; "
1437 "it cannot have %s government. Postponing..."),
1442 pcity,
"have_government");
1446 if (
preq->present) {
1449 _(
"%s can't build %s from the worklist; "
1450 "it needs %s government. Postponing..."),
1455 pcity,
"need_govflag");
1459 _(
"%s can't build %s from the worklist; "
1460 "it cannot have %s government. Postponing..."),
1465 pcity,
"have_govflag");
1469 if (
preq->present) {
1472 _(
"%s can't build %s from the worklist; "
1473 "it needs \"%s\" achievement. Postponing..."),
1478 pcity,
"need_achievement");
1485 if (
preq->present) {
1488 Q_(
"?extra:%s can't build %s from the worklist; "
1489 "%s is required. Postponing..."),
1494 pcity,
"need_extra");
1498 Q_(
"?extra:%s can't build %s from the worklist; "
1499 "%s is prohibited. Postponing..."),
1504 pcity,
"have_extra");
1508 if (
preq->present) {
1511 Q_(
"?tiledef:%s can't build %s from the worklist; "
1512 "%s is required. Postponing..."),
1517 pcity,
"need_tiledef");
1521 Q_(
"?tiledef:%s can't build %s from the worklist; "
1522 "%s is prohibited. Postponing..."),
1527 pcity,
"have_tiledef");
1531 if (
preq->present) {
1534 Q_(
"?tdconn:%s can't build %s from the worklist; "
1535 "access to %s is required. Postponing..."),
1540 pcity,
"need_tiledef_conn");
1544 Q_(
"?tdconn:%s can't build %s from the worklist; "
1545 "access to %s is prohibited. Postponing..."),
1550 pcity,
"have_tiledef_conn");
1554 if (
preq->present) {
1557 Q_(
"?extra:%s can't build %s from the worklist; "
1558 "%s is required. Postponing..."),
1563 pcity,
"need_good");
1567 Q_(
"?extra:%s can't build %s from the worklist; "
1568 "%s is prohibited. Postponing..."),
1573 pcity,
"have_good");
1577 if (
preq->present) {
1580 Q_(
"?terrain:%s can't build %s from the worklist; "
1581 "%s terrain is required. Postponing..."),
1586 pcity,
"need_terrain");
1590 Q_(
"?terrain:%s can't build %s from the worklist; "
1591 "%s terrain is prohibited. Postponing..."),
1596 pcity,
"have_terrain");
1605 if (
preq->present) {
1609 Q_(
"?nation:%s can't build %s from the worklist; "
1610 "%s nation is required. Postponing..."),
1615 pcity,
"need_nation");
1619 Q_(
"?nation:%s can't build %s from the worklist; "
1620 "%s nation is prohibited. Postponing..."),
1625 pcity,
"have_nation");
1635 if (
preq->present) {
1639 Q_(
"?ngroup:%s can't build %s from the worklist; "
1640 "%s nation is required. Postponing..."),
1645 pcity,
"need_nationgroup");
1649 Q_(
"?ngroup:%s can't build %s from the worklist; "
1650 "%s nation is prohibited. Postponing..."),
1655 pcity,
"have_nationgroup");
1663 if (
preq->present) {
1666 _(
"%s can't build %s from the worklist; "
1667 "only %s style cities may build this. Postponing..."),
1672 pcity,
"need_style");
1676 _(
"%s can't build %s from the worklist; "
1677 "%s style cities may not build this. Postponing..."),
1682 pcity,
"have_style");
1688 if (
preq->present) {
1692 _(
"%s can't build %s from the worklist; "
1693 "only city with %s may build this. Postponing..."),
1698 pcity,
"need_nationality");
1703 _(
"%s can't build %s from the worklist; "
1704 "only city without %s may build this. Postponing..."),
1709 pcity,
"have_nationality");
1720 if (
preq->present) {
1728 _(
"%s can't build %s from the worklist; "
1729 "the relationship '%s' is required."
1734 preq->source.value.diplrel));
1737 reason =
"need_diplrel_tile";
1739 reason =
"need_diplrel_tile_o";
1752 _(
"%s can't build %s from the worklist; "
1753 "the relationship '%s' is prohibited."
1758 preq->source.value.diplrel));
1761 reason =
"have_diplrel_tile";
1763 reason =
"have_diplrel_tile_o";
1775 if (
preq->present) {
1783 _(
"%s can't build %s from the worklist; "
1784 "unit with the relationship '%s' is required."
1789 preq->source.value.diplrel));
1792 reason =
"need_diplrel_unitany";
1795 reason =
"need_diplrel_unitany_o";
1805 _(
"%s can't build %s from the worklist; "
1806 "unit with the relationship '%s' is prohibited."
1811 preq->source.value.diplrel));
1814 reason =
"have_diplrel_unitany";
1817 reason =
"have_diplrel_unitany_o";
1825 if (
preq->present) {
1828 _(
"%s can't build %s from the worklist; "
1829 "city must be of size %d or larger. "
1833 preq->source.value.minsize);
1835 pcity,
"need_minsize");
1839 _(
"%s can't build %s from the worklist; "
1840 "city must be of size %d or smaller."
1844 (
preq->source.value.minsize - 1));
1846 pcity,
"need_minsize");
1850 if (
preq->present) {
1853 _(
"%s can't build %s from the worklist; "
1854 "city must have culture of %d. Postponing..."),
1857 preq->source.value.minculture);
1859 pcity,
"need_minculture");
1866 if (
preq->present) {
1869 _(
"%s can't build %s from the worklist; "
1870 "city must have %d%% foreign population. Postponing..."),
1873 preq->source.value.minforeignpct);
1875 pcity,
"need_minforeignpct");
1879 _(
"%s can't build %s from the worklist; "
1880 "city must have %d%% native population. Postponing..."),
1883 100 -
preq->source.value.minforeignpct);
1885 pcity,
"need_minforeignpct");
1889 if (
preq->present) {
1892 _(
"%s can't build %s from the worklist; "
1893 "%d techs must be known. Postponing..."),
1896 preq->source.value.min_techs);
1898 pcity,
"need_mintechs");
1904 if (
preq->present) {
1907 _(
"%s can't build %s from the worklist; "
1908 "%d future techs must be known. Postponing..."),
1911 preq->source.value.future_techs);
1913 pcity,
"need_futuretechs");
1919 if (
preq->present) {
1922 _(
"%s can't build %s from the worklist; "
1923 "Must own %d cities. Postponing..."),
1926 preq->source.value.min_cities);
1928 pcity,
"need_mincities");
1934 if (
preq->present) {
1937 PL_(
"%s can't build %s from the worklist; "
1938 "more than %d total unit on tile."
1940 "%s can't build %s from the worklist; "
1941 "more than %d total units on tile."
1943 preq->source.value.max_tile_total_units),
1946 preq->source.value.max_tile_total_units);
1948 pcity,
"need_tileunits");
1952 PL_(
"%s can't build %s from the worklist; "
1953 "fewer than %d total unit on tile."
1955 "%s can't build %s from the worklist; "
1956 "fewer than %d total units on tile."
1958 preq->source.value.max_tile_total_units + 1),
1961 preq->source.value.max_tile_total_units + 1);
1963 pcity,
"need_tileunits");
1967 if (
preq->present) {
1970 PL_(
"%s can't build %s from the worklist; "
1971 "more than %d unit on tile."
1973 "%s can't build %s from the worklist; "
1974 "more than %d units on tile."
1976 preq->source.value.max_tile_top_units),
1979 preq->source.value.max_tile_top_units);
1981 pcity,
"need_tiletopunits");
1985 PL_(
"%s can't build %s from the worklist; "
1986 "fewer than %d unit on tile."
1988 "%s can't build %s from the worklist; "
1989 "fewer than %d units on tile."
1991 preq->source.value.max_tile_top_units + 1),
1994 preq->source.value.max_tile_top_units + 1);
1996 pcity,
"need_tiletopunits");
2009 if (
preq->present) {
2012 _(
"%s can't build %s from the worklist; "
2013 "terrain with \"%s\" flag is required. "
2019 pcity,
"need_terrainflag");
2023 _(
"%s can't build %s from the worklist; "
2024 "terrain with \"%s\" flag is prohibited. "
2030 pcity,
"have_terrainflag");
2039 if (
preq->present) {
2042 _(
"%s can't build %s from the worklist; "
2043 "road with \"%s\" flag is required. "
2049 pcity,
"need_roadflag");
2053 _(
"%s can't build %s from the worklist; "
2054 "road with \"%s\" flag is prohibited. "
2060 pcity,
"have_roadflag");
2064 if (
preq->present) {
2067 _(
"%s can't build %s from the worklist; "
2068 "extra with \"%s\" flag is required. "
2074 pcity,
"need_extraflag");
2078 _(
"%s can't build %s from the worklist; "
2079 "extra with \"%s\" flag is prohibited. "
2085 pcity,
"have_extraflag");
2097 if (
preq->present) {
2100 _(
"%s can't build %s from the worklist; "
2101 "different terrain class nearby is required. "
2106 pcity,
"need_different_terrainclass");
2110 _(
"%s can't build %s from the worklist; "
2111 "different terrain class nearby is prohibited. "
2116 pcity,
"have_different_terrainclass");
2139 log_error(
"worklist_change_build_target() has bogus preq");
2150 if (
preq->present) {
2154 _(
"%s can't build %s from the worklist; "
2155 "only available when city in range %s \"%s\". "
2161 pcity,
"need_citystatus");
2166 _(
"%s can't build %s from the worklist; "
2167 "not available when city in range %s is \"%s\". "
2173 pcity,
"have_citystatus");
2178 log_error(
"worklist_change_build_target() has bogus citystatus preq");
2182 if (
preq->present) {
2186 _(
"%s can't build %s from the worklist; "
2187 "only available from %s. Postponing..."),
2192 pcity,
"need_minyear");
2201 if (
preq->present) {
2206 _(
"%s can't build %s from the worklist; "
2207 "only available from %s. Postponing..."),
2212 pcity,
"need_mincalfrag");
2219 _(
"%s can't build %s from the worklist; "
2220 "not available after %s. Postponing..."),
2225 pcity,
"have_mincalfrag");
2229 if (
preq->present) {
2234 _(
"%s can't build %s from the worklist; "
2235 "only available in worlds with %s map."),
2240 pcity,
"need_topo");
2245 if (
preq->present) {
2250 _(
"%s can't build %s from the worklist; "
2251 "only available in worlds with %s map."),
2256 pcity,
"need_wrap");
2268 _(
"%s can't build %s from the worklist; "
2269 "only available when the server setting "
2276 pcity,
"need_setting");
2281 if (
preq->present) {
2284 _(
"%s can't build %s from the worklist; "
2285 "only available once %d turns old. Postponing..."),
2288 preq->source.value.age);
2297 if (
preq->present) {
2300 _(
"%s can't build %s from the worklist; "
2301 "only available once %d turns old form. Postponing..."),
2304 preq->source.value.age);
2306 pcity,
"need_form_age");
2315 "worklist_change_build_target() "
2316 "called with invalid preq");
2388 switch (target.
kind) {
2418 _(
"%s can't build %s from the worklist; "
2419 "tech %s not yet available. Postponing..."),
2425 _(
"%s can't build %s from the worklist; "
2426 "multiple techs still needed. Postponing..."),
2449 _(
"%s can't build %s from the worklist. Purging..."),
2468 _(
"Production of %s is upgraded to %s in %s."),
2506 _(
"Production of %s is upgraded to %s in %s."),
2517 _(
"%s can't build %s from the worklist. Purging..."),
2535 log_error(
"worklist_change_build_target() has unrecognized "
2536 "target kind (%d)", target.
kind);
2555 _(
"The %s worklist is now empty."),
2578 switch (
pcity->production.kind) {
2603 log_debug(
"Trying advisor_choose_build.");
2605 log_debug(
"Advisor_choose_build didn't kill us.");
2643 _(
"Production of %s is upgraded to %s in %s."),
2691 _(
"Production of %s is upgraded to %s in %s."),
2725 _(
"%s can't upkeep %s, unit disbanded."),
2755 pcity->before_change_shields =
pcity->shield_stock;
2765 _(
"Citizens in %s perish for their failure to "
2771 _(
"Citizens in %s perish for their failure to "
2807 pcity->before_change_shields = 0;
2808 pcity->shield_stock = 0;
2817 pimprove =
pcity->production.value.building;
2821 _(
"%s is building %s, which is no longer available."),
2854 _(
"Completion of %s"));
2863 _(
"The %s have finished building %s in %s."),
2870 _(
"%s has finished building %s."),
2891 PL_(
"%s boosts research; you gain %d immediate "
2893 "%s boosts research; you gain %d immediate "
2898 for (
i = 0;
i < mod;
i++) {
2905 Q_(
"?frombldg:Acquired %s from %s."),
adv_name,
2911 Q_(
"?frombldg:The %s have acquired %s "
2918 _(
"The %s have started building a spaceship!"),
3037 _(
"%s is building %s, which is no longer available."),
3041 log_verbose(
"%s %s tried to build %s, which is not available.",
3063 _(
"%s can't build %s yet. "
3064 "(city size: %d, unit population cost: %d)"),
3100 _(
"%s is finished building %s, carrying %s."),
3106 _(
"%s is finished building %s."),
3128 pcity->before_change_shields = 0;
3131 log_normal(
"City %s (%s) has built %s but has no %d shields "
3135 pcity->shield_stock = 0;
3144 PL_(
"%s cost %d population. %s shrinks to size %d.",
3145 "%s cost %d population. %s shrinks to size %d.",
3184 switch (
pcity->production.kind) {
3225 _(
"Can't afford to maintain %s in %s, building sold!"),
3316 struct unit_list *cargo;
3376 _(
"Not enough gold. %s disbanded."),
3659 if (pplayer ==
pcity->original) {
3723 log_debug(
"In %s, building %s. Beg of Turn shields = %d",
3725 pcity->before_change_shields);
3733 pcity->disbanded_shields = 0;
3734 pcity->caravan_shields = 0;
3744 pcity->before_change_shields = 0;
3797 if (
pcity->rapture == 1) {
3799 _(
"Celebrations in your honor in %s."),
3803 if (
pcity->rapture != 0) {
3805 _(
"Celebrations canceled in %s."),
3826 &(
pcity->illness_trade),
nullptr);
3910 revomsg =
_(
" Unrest threatens to spread beyond the city.");
3914 if (
pcity->anarchy == 1) {
3917 _(
"Civil disorder in %s.%s"),
3922 _(
"CIVIL DISORDER CONTINUES in %s.%s"),
3926 if (
pcity->anarchy != 0) {
3928 _(
"Order restored in %s."),
3946 _(
"The people have overthrown your %s, "
3947 "your country is in turmoil."),
3990 _(
"%s can't build %s yet, "
3991 "as we can't disband our only city."),
4019 _(
"%s is disbanded into %s."),
4139 nullptr,
nullptr) / 25);
4198 bool migration =
FALSE;
4229 _(
"Migrants from %s can't go to %s because there is "
4230 "not enough food available!"),
4236 _(
"Migrants from %s can't go to %s (%s) because there "
4237 "is not enough food available!"),
4241 _(
"Migrants from %s (%s) can't go to %s because there "
4242 "is not enough food available!"),
4256 _(
"Migrants from %s can't go to %s because it needs "
4257 "an improvement to grow!"),
4263 _(
"Migrants from %s can't go to %s (%s) because it "
4264 "needs an improvement to grow!"),
4268 _(
"Migrants from %s (%s) can't go to %s because it "
4269 "needs an improvement to grow!"),
4317 _(
"%s was disbanded by its citizens."),
4355 _(
"Migrants from %s moved to %s in search of a better "
4361 _(
"Migrants from %s moved to %s (%s) in search of a "
4366 _(
"Migrants from %s (%s) moved to %s in search of a "
4388 log_debug(
"[M] T%d migration successful (%s -> %s)",
4431 if (!pplayer->cities) {
4453 if (
pcity->food_stock > 0) {
4454 pcity->food_stock = 0;
4490 PL_(
"Robbery in %s. %d gold stolen.",
4491 "Robbery in %s. %d gold stolen.",
amount),
4515 &&
pcity->size > 1)) {
4519 _(
"%s destroys %s entirely."),
4525 _(
"%s causes population loss in %s."),
4539 imprs[total++] = pimprove;
4550 _(
"%s destroys %s in %s."),
4566 if (
pcity->shield_stock > 0) {
4569 pcity->shield_stock = 0;
4575 _(
"Production of %s in %s destroyed."),
4663 log_debug(
"[M] T%d check city: %s score: %6.3f (%s)",
4697 log_debug(
"[M] T%d - compare city: %s (%s) dist: %d mgr_dist: %d "
4708 log_debug(
"[M] T%d - best city (player): %s (%s) score: "
4729 log_debug(
"[M] T%d - best city (world): %s (%s) score: "
4745 _(
"Citizens of %s are thinking about migrating to %s "
4746 "for a better life."),
4767 _(
"Citizens of %s are thinking about migrating to %s "
4768 "(%s) for a better life."),
4821 bool changed =
FALSE;
4825 if (ptile->worked ==
pcity
const char * achievement_name_translation(struct achievement *pach)
bool is_action_enabled_city(const struct civ_map *nmap, const action_id wanted_action, const struct city *actor_city)
void advisor_choose_build(struct player *pplayer, struct city *pcity)
int tile_border_source_radius_sq(struct tile *ptile)
const char * textcalfrag(int frag)
const char * textyear(int year)
struct player_slot * citizens_random(const struct city *pcity)
void citizens_nation_add(struct city *pcity, const struct player_slot *pslot, int add)
citizens citizens_nation_get(const struct city *pcity, const struct player_slot *pslot)
void citizens_reduction_apply(struct city *pcity, const struct citizens_reduction *pchange)
struct player * citizens_unit_nationality(const struct city *pcity, unsigned pop_cost, struct citizens_reduction *pchange)
void citizens_convert(struct city *pcity)
void citizens_update(struct city *pcity, struct player *plr)
const char * city_improvement_name_translation(const struct city *pcity, const struct impr_type *pimprove)
bool can_city_build_improvement_direct(const struct city *pcity, const struct impr_type *pimprove, const enum req_problem_type prob_type)
int city_granary_size(int city_size)
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)
int city_improvement_upkeep(const struct city *pcity, const struct impr_type *b)
int city_airlift_max(const struct city *pcity)
struct output_type * get_output_type(Output_type_id output)
bool is_city_option_set(const struct city *pcity, enum city_options option)
void city_size_add(struct city *pcity, int add)
bool city_production_has_flag(const struct city *pcity, enum impr_flag_id flag)
int city_production_unit_veteran_level(struct city *pcity, const struct unit_type *punittype)
bool city_tile_index_to_xy(int *city_map_x, int *city_map_y, int city_tile_index, int city_radius_sq)
bool city_rapture_grow(const struct city *pcity)
int city_production_turns_to_build(const struct city *pcity, bool include_shield_stock)
bool city_unhappy(const struct city *pcity)
Specialist_type_id best_specialist(Output_type_id otype, const struct city *pcity)
bool can_city_build_improvement_now(const struct city *pcity, const struct impr_type *pimprove, const enum req_problem_type prob_type)
struct city * city_list_find_number(struct city_list *This, int id)
bool city_celebrating(const struct city *pcity)
int city_illness_calc(const struct city *pcity, int *ill_base, int *ill_size, int *ill_trade, int *ill_pollution)
bool city_can_grow_to(const struct city *pcity, int pop_size)
void city_refresh_from_main_map(const struct civ_map *nmap, struct city *pcity, bool *workers_map)
bool city_happy(const struct city *pcity)
int city_map_radius_sq_get(const struct city *pcity)
static int cmp(int v1, int v2)
int city_tile_output(const struct city *pcity, const struct tile *ptile, bool is_celebrating, Output_type_id otype)
bool can_city_build_unit_direct(const struct civ_map *nmap, const struct city *pcity, const struct unit_type *punittype)
bool can_city_build_now(const struct civ_map *nmap, const struct city *pcity, const struct universal *target)
bool can_city_build_unit_now(const struct civ_map *nmap, const struct city *pcity, const struct unit_type *punittype)
int city_map_tiles(int city_radius_sq)
bool city_can_work_tile(const struct city *pcity, const struct tile *ptile)
bool city_production_build_units(const struct city *pcity, bool add_production, int *num_units)
void city_rally_point_clear(struct city *pcity)
bool can_city_build_improvement_later(const struct city *pcity, const struct impr_type *pimprove)
bool city_had_recent_plague(const struct city *pcity)
bool city_can_change_build(const struct city *pcity)
bool can_city_build_unit_later(const struct civ_map *nmap, const struct city *pcity, const struct unit_type *punittype)
int city_total_unit_gold_upkeep(const struct city *pcity)
int city_total_impr_gold_upkeep(const struct city *pcity)
#define cities_iterate_end
#define city_list_iterate_safe(citylist, _city)
#define city_list_iterate(citylist, pcity)
#define city_tile(_pcity_)
#define cities_iterate(pcity)
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 output_type_iterate(output)
#define INCITE_IMPOSSIBLE_COST
#define city_owner(_pcity_)
#define city_tile_iterate_skip_free_worked_end
#define city_list_iterate_end
#define city_tile_iterate(_nmap, _radius_sq, _city_tile, _tile)
#define city_list_iterate_safe_end
#define city_tile_iterate_end
#define city_built_iterate(_pcity, _p)
#define city_built_iterate_end
#define output_type_iterate_end
static bool city_illness_check(const struct city *pcity)
static void uk_rem_gold_append(struct unit *punit)
static void city_refresh_after_city_size_increase(struct city *pcity, struct player *nationality, bool aaw)
static bool worklist_change_build_target(struct player *pplayer, struct city *pcity)
void remove_obsolete_buildings(struct player *pplayer)
static bool city_build_stuff(struct player *pplayer, struct city *pcity)
int city_shrink_granary_savings(const struct city *pcity)
static void apply_disaster(struct city *pcity, struct disaster_type *pdis)
static bool city_distribute_surplus_shields(struct player *pplayer, struct city *pcity)
static void unit_list_referred_destroy(struct unit_list *punitlist)
static bool place_pollution(struct city *pcity, enum extra_cause cause)
void choose_build_target(struct player *pplayer, struct city *pcity)
static void uk_rem_gold_callback(struct unit *punit)
void auto_arrange_workers(struct city *pcity)
void city_refresh_queue_add(struct city *pcity)
static struct unit_list * uk_rem_gold
static bool city_balance_treasury_buildings(struct city *pcity)
static void update_city_activity(struct city *pcity)
static void upgrade_unit_prod(struct city *pcity)
static float city_migration_score(struct city *pcity)
void nullify_prechange_production(struct city *pcity)
bool city_empty_food_stock(struct city *pcity)
static bool city_increase_size(struct city *pcity, bool natural_growth, Specialist_type_id sid)
bool check_city_migrations(void)
static void upgrade_building_prod(struct city *pcity)
bool player_balance_treasury_units_and_buildings(struct player *pplayer)
static citizens city_reduce_specialists(struct city *pcity, citizens change)
static void city_global_turn_notify(struct conn_list *dest)
static void city_populate(struct city *pcity, struct player *nationality)
static void define_orig_production_values(struct city *pcity)
void city_repair_size(struct city *pcity, int change)
#define cityimpr_list_iterate(cityimprlist, pcityimpr)
void city_counters_refresh(struct city *pcity)
static bool upkeep_kill_unit(struct unit *punit, Output_type_id outp, enum unit_loss_reason wipe_reason, bool wipe_in_the_end)
static bool city_build_building(struct player *pplayer, struct city *pcity)
static struct unit static const struct impr_type * building_upgrades_to(struct city *pcity, const struct impr_type *pimprove)
void send_city_turn_notifications(struct connection *pconn)
static struct unit * sell_random_unit(struct player *pplayer, struct unit_list *punitlist)
int city_incite_cost(struct player *pplayer, struct city *pcity)
static void nullify_caravan_and_disband_plus(struct city *pcity)
static bool sell_random_building(struct player *pplayer, struct cityimpr_list *imprs)
static bool disband_city(struct city *pcity)
void update_city_activities(struct player *pplayer)
bool city_reduce_size(struct city *pcity, citizens pop_loss, struct player *destroyer, const char *reason)
#define cityimpr_list_iterate_end
bool city_refresh(struct city *pcity)
static void city_turn_notify(const struct city *pcity, struct conn_list *dest, const struct player *cache_for_player)
static void city_shrink_reset_foodbox(struct city *pcity, int new_size)
void apply_cmresult_to_city(struct city *pcity, const struct cm_result *cmr)
bool player_balance_treasury_units(struct player *pplayer)
void city_style_refresh(struct city *pcity)
static bool city_balance_treasury_units(struct city *pcity)
static const struct unit_type * unit_upgrades_to(struct city *pcity, const struct unit_type *id)
static bool do_city_migration(struct city *pcity_from, struct city *pcity_to)
static struct city_list * city_refresh_queue
void city_refresh_for_player(struct player *pplayer)
void city_tc_effect_refresh(struct player *pplayer)
static void check_pollution(struct city *pcity)
void check_disasters(void)
static void set_default_city_manager(struct cm_parameter *cmp, struct city *pcity)
static citizens city_reduce_workers(struct city *pcity, citizens change)
static bool worklist_item_postpone_req_vec(struct universal *target, struct city *pcity, struct player *pplayer, int saved_id)
static struct unit * city_create_unit(struct city *pcity, const struct unit_type *utype, struct citizens_reduction *red) fc__attribute((nonnull(1
bool city_change_size(struct city *pcity, citizens size, struct player *nationality, Specialist_type_id sid, const char *reason)
void city_refresh_queue_processing(void)
int city_growth_granary_savings(const struct city *pcity)
void remove_obsolete_buildings_city(struct city *pcity, bool refresh)
static bool check_city_migrations_player(const struct player *pplayer)
static bool city_build_unit(struct player *pplayer, struct city *pcity)
void cm_clear_cache(struct city *pcity)
void cm_init_parameter(struct cm_parameter *dest)
struct cm_result * cm_result_new(struct city *pcity)
void cm_result_destroy(struct cm_result *result)
void cm_print_result(const struct cm_result *result)
void cm_query_result(struct city *pcity, const struct cm_parameter *param, struct cm_result *result, bool negative_ok)
void cm_init_emergency_parameter(struct cm_parameter *dest)
void cm_print_city(const struct city *pcity)
struct player * conn_get_player(const struct connection *pconn)
void conn_list_do_unbuffer(struct conn_list *dest)
void conn_list_do_buffer(struct conn_list *dest)
const char * counter_name_translation(const struct counter *counter)
int counters_get_city_counters_count(void)
#define city_counters_iterate_end
#define city_counters_iterate(pcount)
int city_culture(const struct city *pcity)
int city_history_gain(const 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 const struct action *paction struct unit 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 int cost
const char * disaster_rule_name(struct disaster_type *pdis)
bool can_disaster_happen(const struct disaster_type *pdis, const struct city *pcity)
const char * disaster_name_translation(struct disaster_type *pdis)
bool disaster_has_effect(const struct disaster_type *pdis, enum disaster_effect_id effect)
#define disaster_type_iterate(_p)
#define DISASTER_BASE_RARITY
#define disaster_type_iterate_end
int get_city_bonus(const struct city *pcity, enum effect_type effect_type)
int get_current_construction_bonus(const struct city *pcity, enum effect_type effect_type, const enum req_problem_type prob_type)
int get_city_tile_output_bonus(const struct city *pcity, const struct tile *ptile, const struct output_type *poutput, enum effect_type effect_type)
#define MAX_CITY_NATIONALITIES
#define CITY_MAP_MAX_RADIUS
enum output_type_id Output_type_id
#define PL_(String1, String2, n)
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_number(int id)
#define GAME_MAX_MGR_DISTANCE
const char * government_name_translation(const struct government *pgovern)
struct government * government_of_city(const struct city *pcity)
Government_type_id government_number(const struct government *pgovern)
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(const struct impr_type *pimprove)
const char * improvement_rule_name(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)
bool is_convert_improvement(const struct impr_type *pimprove)
const char * improvement_name_translation(const struct impr_type *pimprove)
bool is_small_wonder(const struct impr_type *pimprove)
const struct impr_type * improvement_replacement(const struct impr_type *pimprove)
#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_normal(message,...)
#define log_base(level, message,...)
#define log_error(message,...)
#define fc_assert_ret_val_msg(condition, val, message,...)
void lsend_packet_city_update_counters(struct conn_list *dest, const struct packet_city_update_counters *packet)
void lsend_packet_chat_msg(struct conn_list *dest, const struct packet_chat_msg *packet)
void handle_player_change_government(struct player *pplayer, Government_type_id government)
int real_map_distance(const struct tile *tile0, const struct tile *tile1)
int map_distance(const struct tile *tile0, const struct tile *tile1)
#define iterate_outward(nmap, start_tile, max_dist, itr_tile)
#define iterate_outward_end
void map_update_border(struct tile *ptile, struct player *owner, int old_radius_sq, int new_radius_sq)
void map_claim_border(struct tile *ptile, struct player *owner, int radius_sq)
void update_tile_knowledge(struct tile *ptile)
const char * nation_rule_name(const struct nation_type *pnation)
const char * nation_adjective_for_player(const struct player *pplayer)
const char * nation_adjective_translation(const struct nation_type *pnation)
struct nation_type * nation_of_city(const struct city *pcity)
const char * nation_group_name_translation(const struct nation_group *pgroup)
const char * nation_plural_translation(const struct nation_type *pnation)
const char * nation_plural_for_player(const struct player *pplayer)
void notify_research(const struct research *presearch, const struct player *exclude, enum event_type event, const struct ft_color color, const char *format,...)
void notify_player(const struct player *pplayer, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
void notify_research_embassies(const struct research *presearch, const struct player *exclude, enum event_type event, const struct ft_color color, const char *format,...)
void notify_conn(struct conn_list *dest, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
void package_event(struct packet_chat_msg *packet, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
void event_cache_add_for_player(const struct packet_chat_msg *packet, const struct player *pplayer)
struct city_list * cities
int player_number(const struct player *pplayer)
const char * player_name(const struct player *pplayer)
struct city * player_city_by_number(const struct player *pplayer, int city_id)
const char * diplrel_name_translation(int value)
struct player * player_slot_get_player(const struct player_slot *pslot)
#define players_iterate_end
#define players_iterate(_pplayer)
static bool is_barbarian(const struct player *pplayer)
void send_player_info_c(struct player *src, struct conn_list *dest)
const char * universal_rule_name(const struct universal *psource)
bool is_req_active(const struct req_context *context, const struct req_context *other_context, const struct requirement *req, const enum req_problem_type prob_type)
const char * universal_name_translation(const struct universal *psource, char *buf, size_t bufsz)
#define requirement_vector_iterate_end
#define requirement_vector_iterate(req_vec, preq)
const char * research_advance_name_translation(const struct research *presearch, Tech_type_id tech)
struct research * research_get(const struct player *pplayer)
enum tech_state research_invention_state(const struct research *presearch, Tech_type_id tech)
int research_pretty_name(const struct research *presearch, char *buf, size_t buf_len)
#define sanity_check_city(x)
void script_server_signal_emit(const char *signal_name,...)
const char * ssetv_human_readable(ssetv val, bool present)
static struct setting settings[]
#define CLIP(lower, current, upper)
void send_spaceship_info(struct player *src, struct conn_list *dest)
bool is_normal_specialist_id(Specialist_type_id sp)
#define normal_specialist_type_iterate(sp)
#define DEFAULT_SPECIALIST
#define normal_specialist_type_iterate_end
#define CITY_LOG(loglevel, pcity, msg,...)
#define TIMING_LOG(timer, activity)
struct impr_type * pimprove
struct conn_list * glob_observers
struct conn_list * est_connections
struct packet_game_info info
int incite_improvement_factor
struct civ_game::@32::@36 server
struct requirement_vector reqs
int counters[MAX_COUNTERS]
enum gold_upkeep_style gold_upkeep_style
int culture_migration_pml
bool unit_builders_nationality
enum spaceship_state state
struct city_list * cities
struct conn_list * connections
struct player_economic economic
struct player_spaceship spaceship
struct player_score score
struct player_slot * slot
const struct player * player
struct requirement_vector build_reqs
struct unit::@84::@87 server
enum unit_activity changed_from
struct player * nationality
struct goods_type * carrying
const struct unit_type * utype
int city_style(struct city *pcity)
const char * style_name_translation(const struct nation_style *pstyle)
#define sz_strlcpy(dest, src)
const char * advance_name_translation(const struct advance *padvance)
Tech_type_id advance_number(const struct advance *padvance)
const char * terrain_name_translation(const struct terrain *pterrain)
void tile_add_extra(struct tile *ptile, const struct extra_type *pextra)
struct city * tile_city(const struct tile *ptile)
#define tile_worked(_tile)
#define tile_has_extra(ptile, pextra)
const char * tiledef_name_translation(const struct tiledef *td)
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)
bool goods_can_be_provided(const struct city *pcity, const struct goods_type *pgood, const struct unit *punit)
bool goods_has_flag(const struct goods_type *pgood, enum goods_flag_id flag)
struct trade_route_settings * trade_route_settings_by_type(enum trade_route_type type)
const char * goods_name_translation(struct goods_type *pgood)
#define trade_routes_iterate_safe_end
#define trade_routes_iterate_safe(c, proute)
#define trade_partners_iterate_end
#define trade_partners_iterate(c, p)
const struct unit_type * utype
const struct impr_type * building
bool unit_is_alive(int id)
int unit_upkeep_cost(const struct unit *punit, Output_type_id otype)
bool unit_can_do_action(const struct unit *punit, const action_id act_id)
#define unit_cargo_iterate_end
#define unit_cargo_iterate(_ptrans, _pcargo)
#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 unit_build_shield_cost(const struct city *pcity, const struct unit *punit)
const char * unit_rule_name(const struct unit *punit)
const char * utype_rule_name(const struct unit_type *punittype)
int utype_pop_value(const struct unit_type *punittype, const struct city *pcity)
int utype_build_shield_cost(const struct city *pcity, const struct player *pplayer, const struct unit_type *punittype)
const char * utype_name_translation(const struct unit_type *punittype)
#define unit_tech_reqs_iterate_end
#define unit_tech_reqs_iterate(_utype_, _p)
static bool utype_has_flag(const struct unit_type *punittype, int flag)
bool worklist_peek_ith(const struct worklist *pwl, struct universal *prod, int idx)
bool worklist_is_empty(const struct worklist *pwl)
void worklist_remove(struct worklist *pwl, int idx)
int worklist_length(const struct worklist *pwl)