55 const struct player *other_player,
62 const struct player *other_player,
66 const struct tile *tile2,
67 enum req_range
range);
82#define REQUC_LOCAL unchanging_local
98#define REQUC_PRESENT unchanging_present
113#define REQUC_WORLD unchanging_world
125 if (REQ_RANGE_ALLIANCE == req->
range
126 || REQ_RANGE_TEAM == req->
range) {
130 preq.
range = REQ_RANGE_PLAYER;
137#define REQUC_NALLY unchanging_noally
151 || (NULL != context->
city && NULL != context->
tile
160#define REQUC_CITYTILE unchanging_citytile
172 if (REQ_RANGE_CITY == req->
range) {
177#define REQUC_CITYSTATUS unchanging_citystatus
194 if (REQ_RANGE_LOCAL == req->
range) {
216#define REQUC_IMPR unchanging_building
237 if (!universals_n_is_valid(
source.kind)) {
252 return unit_activity_is_valid(act)
254 && act != ACTIVITY_SENTRY
255 && act != ACTIVITY_GOTO
256 && act != ACTIVITY_EXPLORE;
265 if (univ->
kind == VUT_ACTIVITY) {
284 if (
source->value.advance != NULL) {
291 if (tech_flag_id_is_valid(
source->value.techflag)) {
297 if (
source->value.govern != NULL) {
301 case VUT_ACHIEVEMENT:
303 if (
source->value.achievement != NULL) {
309 if (
source->value.style != NULL) {
313 case VUT_IMPROVEMENT:
315 if (
source->value.building != NULL) {
321 if (impr_genus_id_is_valid(
source->value.impr_genus)) {
327 if (
source->value.extra != NULL) {
333 if (
source->value.good != NULL) {
346 if (terrain_flag_id_is_valid(
source->value.terrainflag)) {
356 case VUT_NATIONGROUP:
358 if (
source->value.nationgroup != NULL) {
362 case VUT_NATIONALITY:
369 case VUT_DIPLREL_TILE:
370 case VUT_DIPLREL_TILE_O:
371 case VUT_DIPLREL_UNITANY:
372 case VUT_DIPLREL_UNITANY_O:
374 if (
source->value.diplrel != diplrel_other_invalid()) {
380 if (
source->value.utype) {
386 if (unit_type_flag_id_is_valid(
source->value.unitflag)) {
392 if (
source->value.uclass) {
397 source->value.unitclassflag
399 if (unit_class_flag_id_is_valid(
source->value.unitclassflag)) {
405 if (
source->value.minveteran > 0) {
411 if (ustate_prop_is_valid(
source->value.unit_state)) {
423 if (
source->value.minmoves > 0) {
429 if (
source->value.min_hit_points > 0) {
435 if (
source->value.age > 0) {
441 if (
source->value.min_techs > 0) {
447 if (
source->value.action != NULL) {
459 if (
source->value.specialist) {
465 if (
source->value.minsize > 0) {
471 if (
source->value.minculture > 0) {
475 case VUT_MINFOREIGNPCT:
477 if (
source->value.minforeignpct > 0) {
483 if (ai_level_is_valid(
source->value.ai_level)) {
487 case VUT_MAXTILEUNITS:
489 if (0 <=
source->value.max_tile_units) {
493 case VUT_TERRAINCLASS:
494 source->value.terrainclass
496 if (terrain_class_is_valid(
source->value.terrainclass)) {
502 if (road_flag_id_is_valid(
source->value.roadflag)) {
508 if (extra_flag_id_is_valid(
source->value.extraflag)) {
518 if (
source->value.mincalfrag >= 0) {
525 if (topo_flag_is_valid(
source->value.topo_property)) {
529 case VUT_SERVERSETTING:
535 case VUT_TERRAINALTER:
536 source->value.terrainalter
538 if (terrain_alteration_is_valid(
source->value.terrainalter)) {
544 if (
source->value.citytile != CITYT_LAST) {
550 if (
source->value.citystatus != CITYS_LAST) {
559 source->kind = universals_n_invalid();
577 source.value.advance = NULL;
582 if (
source.value.advance != NULL) {
591 if (
source.value.govern != NULL) {
595 case VUT_ACHIEVEMENT:
597 if (
source.value.achievement != NULL) {
603 if (
source.value.style != NULL) {
607 case VUT_IMPROVEMENT:
609 if (
source.value.building != NULL) {
624 if (
source.value.terrain != NULL) {
633 if (
source.value.nation != NULL) {
637 case VUT_NATIONGROUP:
639 if (
source.value.nationgroup != NULL) {
644 case VUT_DIPLREL_TILE:
645 case VUT_DIPLREL_TILE_O:
646 case VUT_DIPLREL_UNITANY:
647 case VUT_DIPLREL_UNITANY_O:
649 if (
source.value.diplrel != diplrel_other_invalid()) {
653 case VUT_NATIONALITY:
655 if (
source.value.nationality != NULL) {
661 if (
source.value.utype != NULL) {
670 if (
source.value.uclass != NULL) {
700 if (
source.value.action != NULL) {
716 case VUT_MINFOREIGNPCT:
722 case VUT_MAXTILEUNITS:
725 case VUT_TERRAINCLASS:
743 case VUT_SERVERSETTING:
746 case VUT_TERRAINALTER:
760 source.kind = universals_n_invalid();
762 source.value.advance = NULL;
798 return source->value.techflag;
801 case VUT_ACHIEVEMENT:
805 case VUT_IMPROVEMENT:
808 return source->value.impr_genus;
816 return source->value.terrainflag;
819 case VUT_NATIONGROUP:
821 case VUT_NATIONALITY:
824 case VUT_DIPLREL_TILE:
825 case VUT_DIPLREL_TILE_O:
826 case VUT_DIPLREL_UNITANY:
827 case VUT_DIPLREL_UNITANY_O:
828 return source->value.diplrel;
832 return source->value.unitflag;
836 return source->value.unitclassflag;
838 return source->value.minveteran;
840 return source->value.unit_state;
842 return source->value.activity;
844 return source->value.minmoves;
846 return source->value.min_hit_points;
850 return source->value.min_techs;
854 return source->value.outputtype;
858 return source->value.minsize;
860 return source->value.minculture;
861 case VUT_MINFOREIGNPCT:
862 return source->value.minforeignpct;
864 return source->value.ai_level;
865 case VUT_MAXTILEUNITS:
866 return source->value.max_tile_units;
867 case VUT_TERRAINCLASS:
868 return source->value.terrainclass;
870 return source->value.roadflag;
872 return source->value.extraflag;
874 return source->value.minyear;
876 return source->value.mincalfrag;
878 return source->value.topo_property;
879 case VUT_SERVERSETTING:
880 return source->value.ssetval;
881 case VUT_TERRAINALTER:
882 return source->value.terrainalter;
884 return source->value.citytile;
886 return source->value.citystatus;
923 req_range_name(req->
range),
944 const char *error = NULL;
948 invalid = !universals_n_is_valid(req.
source.
kind);
950 error =
"bad type or name";
956 if (!req_range_is_valid(req.
range)) {
964 case VUT_IMPROVEMENT:
982 case VUT_TERRAINCLASS:
985 case VUT_TERRAINALTER:
987 case VUT_MAXTILEUNITS:
988 case VUT_DIPLREL_TILE_O:
989 case VUT_DIPLREL_UNITANY_O:
990 req.
range = REQ_RANGE_LOCAL;
994 case VUT_MINFOREIGNPCT:
995 case VUT_NATIONALITY:
998 req.
range = REQ_RANGE_CITY;
1000 case VUT_GOVERNMENT:
1001 case VUT_ACHIEVEMENT:
1006 case VUT_NATIONGROUP:
1008 case VUT_DIPLREL_TILE:
1009 case VUT_DIPLREL_UNITANY:
1011 req.
range = REQ_RANGE_PLAYER;
1014 case VUT_MINCALFRAG:
1017 case VUT_SERVERSETTING:
1018 req.
range = REQ_RANGE_WORLD;
1034 case VUT_TERRAINCLASS:
1038 invalid = (req.
range != REQ_RANGE_LOCAL
1039 && req.
range != REQ_RANGE_CADJACENT
1040 && req.
range != REQ_RANGE_ADJACENT
1041 && req.
range != REQ_RANGE_CITY
1042 && req.
range != REQ_RANGE_TRADE_ROUTE);
1046 case VUT_ACHIEVEMENT:
1048 invalid = (req.
range < REQ_RANGE_PLAYER);
1050 case VUT_GOVERNMENT:
1053 invalid = (req.
range != REQ_RANGE_PLAYER);
1056 case VUT_MINFOREIGNPCT:
1057 case VUT_NATIONALITY:
1058 case VUT_CITYSTATUS:
1059 invalid = (req.
range != REQ_RANGE_CITY
1060 && req.
range != REQ_RANGE_TRADE_ROUTE);
1063 invalid = (req.
range != REQ_RANGE_CITY);
1065 case VUT_MINCULTURE:
1066 invalid = (req.
range != REQ_RANGE_CITY
1067 && req.
range != REQ_RANGE_TRADE_ROUTE
1068 && req.
range != REQ_RANGE_PLAYER
1069 && req.
range != REQ_RANGE_TEAM
1070 && req.
range != REQ_RANGE_ALLIANCE
1071 && req.
range != REQ_RANGE_WORLD);
1074 invalid = (req.
range != REQ_RANGE_LOCAL
1075 && req.
range != REQ_RANGE_PLAYER
1076 && req.
range != REQ_RANGE_TEAM
1077 && req.
range != REQ_RANGE_ALLIANCE
1078 && req.
range != REQ_RANGE_WORLD)
1081 && req.
range != REQ_RANGE_LOCAL);
1083 case VUT_DIPLREL_TILE:
1084 invalid = (req.
range != REQ_RANGE_LOCAL
1085 && req.
range != REQ_RANGE_PLAYER
1086 && req.
range != REQ_RANGE_TEAM
1087 && req.
range != REQ_RANGE_ALLIANCE)
1090 && req.
range != REQ_RANGE_LOCAL);
1092 case VUT_DIPLREL_TILE_O:
1093 invalid = (req.
range != REQ_RANGE_LOCAL);
1095 case VUT_DIPLREL_UNITANY:
1096 invalid = (req.
range != REQ_RANGE_LOCAL
1097 && req.
range != REQ_RANGE_PLAYER
1098 && req.
range != REQ_RANGE_TEAM
1099 && req.
range != REQ_RANGE_ALLIANCE)
1102 && req.
range != REQ_RANGE_LOCAL);
1104 case VUT_DIPLREL_UNITANY_O:
1105 invalid = (req.
range != REQ_RANGE_LOCAL);
1108 case VUT_NATIONGROUP:
1109 invalid = (req.
range != REQ_RANGE_PLAYER
1110 && req.
range != REQ_RANGE_TEAM
1111 && req.
range != REQ_RANGE_ALLIANCE
1112 && req.
range != REQ_RANGE_WORLD);
1118 case VUT_MINVETERAN:
1125 case VUT_SPECIALIST:
1126 case VUT_TERRAINALTER:
1127 invalid = (req.
range != REQ_RANGE_LOCAL);
1130 case VUT_MAXTILEUNITS:
1131 invalid = (req.
range != REQ_RANGE_LOCAL
1132 && req.
range != REQ_RANGE_CADJACENT
1133 && req.
range != REQ_RANGE_ADJACENT);
1136 case VUT_MINCALFRAG:
1138 case VUT_SERVERSETTING:
1139 invalid = (req.
range != REQ_RANGE_WORLD);
1143 invalid = (req.
range != REQ_RANGE_LOCAL
1144 && req.
range != REQ_RANGE_CITY
1145 && req.
range != REQ_RANGE_PLAYER);
1147 case VUT_IMPR_GENUS:
1149 invalid = req.
range != REQ_RANGE_LOCAL;
1151 case VUT_IMPROVEMENT:
1163 error =
"bad range";
1170 case VUT_IMPROVEMENT:
1178 case VUT_IMPR_GENUS:
1179 case VUT_GOVERNMENT:
1185 case VUT_MINVETERAN:
1193 case VUT_SPECIALIST:
1195 case VUT_MINCULTURE:
1196 case VUT_MINFOREIGNPCT:
1198 case VUT_TERRAINCLASS:
1200 case VUT_MINCALFRAG:
1202 case VUT_SERVERSETTING:
1203 case VUT_TERRAINALTER:
1205 case VUT_CITYSTATUS:
1207 case VUT_NATIONALITY:
1213 case VUT_ACHIEVEMENT:
1214 case VUT_NATIONGROUP:
1217 case VUT_DIPLREL_TILE:
1218 case VUT_DIPLREL_TILE_O:
1219 case VUT_DIPLREL_UNITANY:
1220 case VUT_DIPLREL_UNITANY_O:
1221 case VUT_MAXTILEUNITS:
1231 error =
"bad 'survives'";
1236 log_error(
"Invalid requirement %s | %s | %s | %s | %s: %s",
1238 present ?
"present" :
"", value, error);
1328 if (impr_req->
range == REQ_RANGE_LOCAL
1329 && genus_req->
range == REQ_RANGE_LOCAL) {
1360 if (nation_req->
range == REQ_RANGE_PLAYER
1361 && group_req->
range == REQ_RANGE_PLAYER) {
1451 case VUT_IMPROVEMENT:
1459 case VUT_IMPR_GENUS:
1468 case VUT_DIPLREL_TILE:
1469 case VUT_DIPLREL_TILE_O:
1470 case VUT_DIPLREL_UNITANY:
1471 case VUT_DIPLREL_UNITANY_O:
1480 bv_diplrel_all_reqs req1_contra;
1488 return BV_ISSET(req1_contra, req2_pos);
1519 case VUT_NATIONGROUP:
1540 const struct requirement_vector *vec)
1559 const struct tile *tile2,
1560 enum req_range
range)
1563 case REQ_RANGE_ADJACENT:
1571 case REQ_RANGE_CADJACENT:
1573 case REQ_RANGE_CITY:
1574 case REQ_RANGE_TRADE_ROUTE:
1575 case REQ_RANGE_LOCAL:
1576 case REQ_RANGE_CONTINENT:
1577 case REQ_RANGE_PLAYER:
1578 case REQ_RANGE_TEAM:
1579 case REQ_RANGE_ALLIANCE:
1580 case REQ_RANGE_WORLD:
1581 case REQ_RANGE_COUNT:
1592 const struct player *pplayer2,
1593 enum req_range
range)
1596 case REQ_RANGE_WORLD:
1598 case REQ_RANGE_ALLIANCE:
1600 case REQ_RANGE_TEAM:
1602 case REQ_RANGE_PLAYER:
1603 return pplayer1 == pplayer2;
1604 case REQ_RANGE_CONTINENT:
1605 case REQ_RANGE_TRADE_ROUTE:
1606 case REQ_RANGE_CITY:
1607 case REQ_RANGE_ADJACENT:
1608 case REQ_RANGE_CADJACENT:
1609 case REQ_RANGE_LOCAL:
1610 case REQ_RANGE_COUNT:
1618#define IS_REQ_ACTIVE_VARIANT_ASSERT(_kind) \
1620 fc_assert_ret_val(req != NULL, TRI_MAYBE); \
1621 fc_assert_ret_val(req->source.kind == _kind, TRI_MAYBE); \
1622 fc_assert(context != NULL); \
1635 const struct player *other_player,
1653 log_error(
"World-ranged requirements are only supported for wonders.");
1666 log_error(
"World-ranged requirements are only supported for wonders.");
1689 log_error(
"Player-ranged requirements are only supported for wonders.");
1703 log_error(
"Player-ranged requirements are only supported for wonders.");
1716 const struct city *pcity;
1723 log_error(
"Island-ranged requirements are only supported for wonders.");
1747 const struct player *other_player,
1765 switch (req->
range) {
1766 case REQ_RANGE_WORLD:
1768 case REQ_RANGE_ALLIANCE:
1769 case REQ_RANGE_TEAM:
1770 if (context->
player == NULL) {
1780 case REQ_RANGE_PLAYER:
1781 if (context->
player == NULL) {
1786 case REQ_RANGE_CONTINENT:
1787 case REQ_RANGE_TRADE_ROUTE:
1788 case REQ_RANGE_CITY:
1789 case REQ_RANGE_LOCAL:
1790 case REQ_RANGE_CADJACENT:
1791 case REQ_RANGE_ADJACENT:
1793 log_error(
"Surviving requirements are only supported at "
1794 "World/Alliance/Team/Player ranges.");
1796 case REQ_RANGE_COUNT:
1803 switch (req->
range) {
1804 case REQ_RANGE_WORLD:
1806 case REQ_RANGE_ALLIANCE:
1807 case REQ_RANGE_TEAM:
1808 if (context->
player == NULL) {
1818 case REQ_RANGE_PLAYER:
1819 if (context->
player == NULL) {
1825 case REQ_RANGE_CONTINENT:
1831 continent, building)
1836 case REQ_RANGE_TRADE_ROUTE:
1837 if (context->
city) {
1844 if (trade_partner == NULL) {
1856 case REQ_RANGE_CITY:
1857 if (context->
city) {
1863 case REQ_RANGE_LOCAL:
1865 if (context->
building == building) {
1874 case REQ_RANGE_CADJACENT:
1875 case REQ_RANGE_ADJACENT:
1877 case REQ_RANGE_COUNT:
1898 const struct player *other_player,
1919 const struct player *other_player,
1934 switch (req->
range) {
1935 case REQ_RANGE_PLAYER:
1936 if (NULL != context->
player) {
1942 case REQ_RANGE_TEAM:
1943 case REQ_RANGE_ALLIANCE:
1944 case REQ_RANGE_WORLD:
1945 if (NULL == context->
player) {
1958 case REQ_RANGE_LOCAL:
1959 case REQ_RANGE_CADJACENT:
1960 case REQ_RANGE_ADJACENT:
1961 case REQ_RANGE_CITY:
1962 case REQ_RANGE_TRADE_ROUTE:
1963 case REQ_RANGE_CONTINENT:
1964 case REQ_RANGE_COUNT:
1983 const struct player *other_player,
1986 enum tech_flag_id techflag;
1992 switch (req->
range) {
1993 case REQ_RANGE_PLAYER:
1994 if (NULL != context->
player) {
2001 case REQ_RANGE_TEAM:
2002 case REQ_RANGE_ALLIANCE:
2003 if (NULL == context->
player) {
2013 case REQ_RANGE_WORLD:
2021 case REQ_RANGE_LOCAL:
2022 case REQ_RANGE_CADJACENT:
2023 case REQ_RANGE_ADJACENT:
2024 case REQ_RANGE_CITY:
2025 case REQ_RANGE_TRADE_ROUTE:
2026 case REQ_RANGE_CONTINENT:
2027 case REQ_RANGE_COUNT:
2046 const struct player *other_player,
2055 switch (req->
range) {
2056 case REQ_RANGE_CITY:
2057 if (!context->
city) {
2061 case REQ_RANGE_TRADE_ROUTE:
2062 if (!context->
city) {
2071 if (trade_partner == NULL) {
2073 }
else if (
city_culture(trade_partner) >= minculture) {
2080 case REQ_RANGE_PLAYER:
2081 case REQ_RANGE_TEAM:
2082 case REQ_RANGE_ALLIANCE:
2083 case REQ_RANGE_WORLD:
2084 if (NULL == context->
player) {
2095 case REQ_RANGE_LOCAL:
2096 case REQ_RANGE_CADJACENT:
2097 case REQ_RANGE_ADJACENT:
2098 case REQ_RANGE_CONTINENT:
2099 case REQ_RANGE_COUNT:
2119 const struct player *other_player,
2122 int min_foreign_pct, foreign_pct;
2128 switch (req->
range) {
2129 case REQ_RANGE_CITY:
2130 if (!context->
city) {
2136 case REQ_RANGE_TRADE_ROUTE:
2137 if (!context->
city) {
2142 if (foreign_pct >= min_foreign_pct) {
2148 if (trade_partner == NULL) {
2153 if (foreign_pct >= min_foreign_pct) {
2161 case REQ_RANGE_PLAYER:
2162 case REQ_RANGE_TEAM:
2163 case REQ_RANGE_ALLIANCE:
2164 case REQ_RANGE_WORLD:
2165 case REQ_RANGE_LOCAL:
2166 case REQ_RANGE_CADJACENT:
2167 case REQ_RANGE_ADJACENT:
2168 case REQ_RANGE_CONTINENT:
2169 case REQ_RANGE_COUNT:
2189 const struct player *other_player,
2199 switch (req->
range) {
2200 case REQ_RANGE_LOCAL:
2201 if (!context->
tile) {
2205 case REQ_RANGE_CADJACENT:
2206 if (!context->
tile) {
2209 if (unit_list_size(context->
tile->
units) <= max_units) {
2213 if (unit_list_size(adjc_tile->units) <= max_units) {
2218 case REQ_RANGE_ADJACENT:
2219 if (!context->
tile) {
2222 if (unit_list_size(context->
tile->
units) <= max_units) {
2226 if (unit_list_size(adjc_tile->units) <= max_units) {
2231 case REQ_RANGE_CITY:
2232 case REQ_RANGE_TRADE_ROUTE:
2233 case REQ_RANGE_CONTINENT:
2234 case REQ_RANGE_PLAYER:
2235 case REQ_RANGE_TEAM:
2236 case REQ_RANGE_ALLIANCE:
2237 case REQ_RANGE_WORLD:
2238 case REQ_RANGE_COUNT:
2257 const struct player *other_player,
2267 switch (req->
range) {
2268 case REQ_RANGE_LOCAL:
2270 if (!context->
tile) {
2274 case REQ_RANGE_CADJACENT:
2275 if (!context->
tile) {
2280 case REQ_RANGE_ADJACENT:
2281 if (!context->
tile) {
2286 case REQ_RANGE_CITY:
2287 if (!context->
city) {
2299 case REQ_RANGE_TRADE_ROUTE:
2300 if (!context->
city) {
2312 if (trade_partner == NULL) {
2326 case REQ_RANGE_CONTINENT:
2327 case REQ_RANGE_PLAYER:
2328 case REQ_RANGE_TEAM:
2329 case REQ_RANGE_ALLIANCE:
2330 case REQ_RANGE_WORLD:
2331 case REQ_RANGE_COUNT:
2350 const struct player *other_player,
2355 switch (req->
range) {
2356 case REQ_RANGE_LOCAL:
2357 case REQ_RANGE_CITY:
2359 if (!context->
city) {
2364 case REQ_RANGE_CADJACENT:
2365 case REQ_RANGE_ADJACENT:
2366 case REQ_RANGE_TRADE_ROUTE:
2367 case REQ_RANGE_CONTINENT:
2368 case REQ_RANGE_PLAYER:
2369 case REQ_RANGE_TEAM:
2370 case REQ_RANGE_ALLIANCE:
2371 case REQ_RANGE_WORLD:
2372 case REQ_RANGE_COUNT:
2391 const struct player *other_player,
2412 const struct player *other_player,
2432 const struct player *other_player,
2452 const struct player *other_player,
2455 const struct terrain *pterrain;
2461 switch (req->
range) {
2462 case REQ_RANGE_LOCAL:
2464 if (!context->
tile) {
2468 case REQ_RANGE_CADJACENT:
2469 if (!context->
tile) {
2473 case REQ_RANGE_ADJACENT:
2474 if (!context->
tile) {
2478 case REQ_RANGE_CITY:
2479 if (!context->
city) {
2482 if (pterrain != NULL) {
2491 case REQ_RANGE_TRADE_ROUTE:
2492 if (!context->
city) {
2495 if (pterrain != NULL) {
2507 if (trade_partner == NULL) {
2523 case REQ_RANGE_CONTINENT:
2524 case REQ_RANGE_PLAYER:
2525 case REQ_RANGE_TEAM:
2526 case REQ_RANGE_ALLIANCE:
2527 case REQ_RANGE_WORLD:
2528 case REQ_RANGE_COUNT:
2548 const struct player *other_player,
2551 enum terrain_class pclass;
2558 switch (req->
range) {
2559 case REQ_RANGE_LOCAL:
2561 if (!context->
tile) {
2565 case REQ_RANGE_CADJACENT:
2566 if (!context->
tile) {
2571 case REQ_RANGE_ADJACENT:
2572 if (!context->
tile) {
2577 case REQ_RANGE_CITY:
2578 if (!context->
city) {
2592 case REQ_RANGE_TRADE_ROUTE:
2593 if (!context->
city) {
2608 if (trade_partner == NULL) {
2624 case REQ_RANGE_CONTINENT:
2625 case REQ_RANGE_PLAYER:
2626 case REQ_RANGE_TEAM:
2627 case REQ_RANGE_ALLIANCE:
2628 case REQ_RANGE_WORLD:
2629 case REQ_RANGE_COUNT:
2649 const struct player *other_player,
2652 enum terrain_flag_id terrflag;
2659 switch (req->
range) {
2660 case REQ_RANGE_LOCAL:
2663 if (!context->
tile) {
2668 case REQ_RANGE_CADJACENT:
2669 if (!context->
tile) {
2676 case REQ_RANGE_ADJACENT:
2677 if (!context->
tile) {
2684 case REQ_RANGE_CITY:
2685 if (!context->
city) {
2699 case REQ_RANGE_TRADE_ROUTE:
2700 if (!context->
city) {
2715 if (trade_partner == NULL) {
2731 case REQ_RANGE_CONTINENT:
2732 case REQ_RANGE_PLAYER:
2733 case REQ_RANGE_TEAM:
2734 case REQ_RANGE_ALLIANCE:
2735 case REQ_RANGE_WORLD:
2736 case REQ_RANGE_COUNT:
2755 const struct player *other_player,
2758 enum road_flag_id roadflag;
2765 switch (req->
range) {
2766 case REQ_RANGE_LOCAL:
2768 if (!context->
tile) {
2772 case REQ_RANGE_CADJACENT:
2773 if (!context->
tile) {
2779 case REQ_RANGE_ADJACENT:
2780 if (!context->
tile) {
2786 case REQ_RANGE_CITY:
2787 if (!context->
city) {
2798 case REQ_RANGE_TRADE_ROUTE:
2799 if (!context->
city) {
2811 if (trade_partner == NULL) {
2824 case REQ_RANGE_CONTINENT:
2825 case REQ_RANGE_PLAYER:
2826 case REQ_RANGE_TEAM:
2827 case REQ_RANGE_ALLIANCE:
2828 case REQ_RANGE_WORLD:
2829 case REQ_RANGE_COUNT:
2848 const struct player *other_player,
2851 enum extra_flag_id extraflag;
2858 switch (req->
range) {
2859 case REQ_RANGE_LOCAL:
2861 if (!context->
tile) {
2865 case REQ_RANGE_CADJACENT:
2866 if (!context->
tile) {
2871 case REQ_RANGE_ADJACENT:
2872 if (!context->
tile) {
2877 case REQ_RANGE_CITY:
2878 if (!context->
city) {
2889 case REQ_RANGE_TRADE_ROUTE:
2890 if (!context->
city) {
2902 if (trade_partner == NULL) {
2915 case REQ_RANGE_CONTINENT:
2916 case REQ_RANGE_PLAYER:
2917 case REQ_RANGE_TEAM:
2918 case REQ_RANGE_ALLIANCE:
2919 case REQ_RANGE_WORLD:
2920 case REQ_RANGE_COUNT:
2940 const struct player *other_player,
2943 enum terrain_alteration alteration;
2949 if (!context->
tile) {
2953 switch (req->
range) {
2954 case REQ_RANGE_LOCAL:
2957 case REQ_RANGE_CADJACENT:
2958 case REQ_RANGE_ADJACENT:
2959 case REQ_RANGE_CITY:
2960 case REQ_RANGE_TRADE_ROUTE:
2961 case REQ_RANGE_CONTINENT:
2962 case REQ_RANGE_PLAYER:
2963 case REQ_RANGE_TEAM:
2964 case REQ_RANGE_ALLIANCE:
2965 case REQ_RANGE_WORLD:
2966 case REQ_RANGE_COUNT:
2985 const struct player *other_player,
2990 if (context->
player == NULL) {
3008 const struct player *other_player,
3013 if (context->
player == NULL) {
3031 const struct player *other_player,
3036 switch (req->
range) {
3037 case REQ_RANGE_WORLD:
3041 case REQ_RANGE_PLAYER:
3042 if (context->
player == NULL) {
3066 const struct player *other_player,
3071 if (context->
player == NULL) {
3090 const struct player *other_player,
3099 switch (req->
range) {
3100 case REQ_RANGE_PLAYER:
3101 if (context->
player == NULL) {
3105 case REQ_RANGE_TEAM:
3106 case REQ_RANGE_ALLIANCE:
3107 if (context->
player == NULL) {
3118 case REQ_RANGE_WORLD:
3125 case REQ_RANGE_LOCAL:
3126 case REQ_RANGE_CADJACENT:
3127 case REQ_RANGE_ADJACENT:
3128 case REQ_RANGE_CITY:
3129 case REQ_RANGE_TRADE_ROUTE:
3130 case REQ_RANGE_CONTINENT:
3131 case REQ_RANGE_COUNT:
3151 const struct player *other_player,
3160 switch (req->
range) {
3161 case REQ_RANGE_PLAYER:
3162 if (context->
player == NULL) {
3167 case REQ_RANGE_TEAM:
3168 case REQ_RANGE_ALLIANCE:
3169 case REQ_RANGE_WORLD:
3170 if (context->
player == NULL) {
3181 case REQ_RANGE_LOCAL:
3182 case REQ_RANGE_CADJACENT:
3183 case REQ_RANGE_ADJACENT:
3184 case REQ_RANGE_CITY:
3185 case REQ_RANGE_TRADE_ROUTE:
3186 case REQ_RANGE_CONTINENT:
3187 case REQ_RANGE_COUNT:
3207 const struct player *other_player,
3217 switch (req->
range) {
3218 case REQ_RANGE_CITY:
3219 if (context->
city == NULL) {
3229 case REQ_RANGE_TRADE_ROUTE:
3230 if (context->
city == NULL) {
3241 if (trade_partner == NULL) {
3253 case REQ_RANGE_PLAYER:
3254 case REQ_RANGE_TEAM:
3255 case REQ_RANGE_ALLIANCE:
3256 case REQ_RANGE_WORLD:
3257 case REQ_RANGE_LOCAL:
3258 case REQ_RANGE_CADJACENT:
3259 case REQ_RANGE_ADJACENT:
3260 case REQ_RANGE_CONTINENT:
3261 case REQ_RANGE_COUNT:
3274 const struct player *other_player,
3275 enum req_range
range,
3279 case REQ_RANGE_PLAYER:
3280 if (target_player == NULL) {
3284 case REQ_RANGE_TEAM:
3285 case REQ_RANGE_ALLIANCE:
3286 case REQ_RANGE_WORLD:
3287 if (target_player == NULL) {
3298 case REQ_RANGE_LOCAL:
3299 if (target_player == NULL || other_player == NULL) {
3303 case REQ_RANGE_CADJACENT:
3304 case REQ_RANGE_ADJACENT:
3305 case REQ_RANGE_CITY:
3306 case REQ_RANGE_TRADE_ROUTE:
3307 case REQ_RANGE_CONTINENT:
3308 case REQ_RANGE_COUNT:
3327 const struct player *other_player,
3347 const struct player *other_player,
3371 const struct player *other_player,
3388 const struct player *other_player,
3389 enum req_range
range,
3420 const struct player *other_player,
3442 const struct player *other_player,
3462 const struct player *other_player,
3471 if (req->
range != REQ_RANGE_LOCAL) {
3491 const struct player *other_player,
3494 enum unit_type_flag_id unitflag;
3500 if (req->
range != REQ_RANGE_LOCAL) {
3520 const struct player *other_player,
3529 if (req->
range != REQ_RANGE_LOCAL) {
3550 const struct player *other_player,
3553 enum unit_class_flag_id ucflag;
3559 if (req->
range != REQ_RANGE_LOCAL) {
3579 const struct player *other_player,
3582 enum ustate_prop uprop;
3589 "Unsupported range \"%s\"",
3590 req_range_name(req->
range));
3594 if (context->
unit == NULL) {
3599 case USP_TRANSPORTED:
3601 case USP_LIVABLE_TILE:
3606 case USP_TRANSPORTING:
3608 case USP_HAS_HOME_CITY:
3610 case USP_NATIVE_TILE:
3615 case USP_NATIVE_EXTRA:
3620 case USP_MOVED_THIS_TURN:
3623 fc_assert_msg(uprop != USP_COUNT,
"Invalid unit state property.");
3644 const struct player *other_player,
3647 enum unit_activity activity;
3654 "Unsupported range \"%s\"",
3655 req_range_name(req->
range));
3659 if (context->
unit == NULL) {
3665 case ACTIVITY_SENTRY:
3667 case ACTIVITY_EXPLORE:
3688 const struct player *other_player,
3693 if (context->
unit == NULL) {
3712 const struct player *other_player,
3717 if (context->
unit == NULL) {
3736 const struct player *other_player,
3741 if (context->
unit == NULL) {
3759 const struct player *other_player,
3764 switch (req->
range) {
3765 case REQ_RANGE_LOCAL:
3774 case REQ_RANGE_CITY:
3783 case REQ_RANGE_PLAYER:
3784 if (context->
player == NULL) {
3801 const struct city *pcity)
3803 if (pcity == NULL) {
3820 const struct player *other_player,
3823 enum citytile_type citytile;
3830 if (context->
tile == NULL) {
3836 switch (req->
range) {
3837 case REQ_RANGE_LOCAL:
3840 case REQ_RANGE_CADJACENT:
3851 case REQ_RANGE_ADJACENT:
3862 case REQ_RANGE_CITY:
3863 case REQ_RANGE_TRADE_ROUTE:
3864 case REQ_RANGE_CONTINENT:
3865 case REQ_RANGE_PLAYER:
3866 case REQ_RANGE_TEAM:
3867 case REQ_RANGE_ALLIANCE:
3868 case REQ_RANGE_WORLD:
3869 case REQ_RANGE_COUNT:
3876 switch (req->
range) {
3877 case REQ_RANGE_LOCAL:
3879 case REQ_RANGE_CADJACENT:
3884 if (adjc_tile->owner != NULL) {
3890 case REQ_RANGE_ADJACENT:
3895 if (adjc_tile->owner != NULL) {
3901 case REQ_RANGE_CITY:
3902 case REQ_RANGE_TRADE_ROUTE:
3903 case REQ_RANGE_CONTINENT:
3904 case REQ_RANGE_PLAYER:
3905 case REQ_RANGE_TEAM:
3906 case REQ_RANGE_ALLIANCE:
3907 case REQ_RANGE_WORLD:
3908 case REQ_RANGE_COUNT:
3914 case CITYT_EXTRAS_OWNED:
3915 switch (req->
range) {
3916 case REQ_RANGE_LOCAL:
3918 case REQ_RANGE_CADJACENT:
3923 if (adjc_tile->extras_owner != NULL) {
3929 case REQ_RANGE_ADJACENT:
3934 if (adjc_tile->extras_owner != NULL) {
3940 case REQ_RANGE_CITY:
3941 case REQ_RANGE_TRADE_ROUTE:
3942 case REQ_RANGE_CONTINENT:
3943 case REQ_RANGE_PLAYER:
3944 case REQ_RANGE_TEAM:
3945 case REQ_RANGE_ALLIANCE:
3946 case REQ_RANGE_WORLD:
3947 case REQ_RANGE_COUNT:
3959 log_error(
"is_req_active(): citytile %d not supported.",
3975 const struct player *other_player,
3978 enum citystatus_type citystatus;
3984 if (context->
city == NULL) {
3988 if (citystatus == CITYS_OWNED_BY_ORIGINAL) {
3989 switch (req->
range) {
3990 case REQ_RANGE_CITY:
3995 case REQ_RANGE_TRADE_ROUTE:
4005 if (trade_partner == NULL || trade_partner->original == NULL) {
4007 }
else if (
city_owner(trade_partner) == trade_partner->original) {
4014 case REQ_RANGE_LOCAL:
4015 case REQ_RANGE_CADJACENT:
4016 case REQ_RANGE_ADJACENT:
4017 case REQ_RANGE_CONTINENT:
4018 case REQ_RANGE_PLAYER:
4019 case REQ_RANGE_TEAM:
4020 case REQ_RANGE_ALLIANCE:
4021 case REQ_RANGE_WORLD:
4022 case REQ_RANGE_COUNT:
4031 log_error(
"is_req_active(): citystatus %d not supported.",
4047 const struct player *other_player,
4052 if (context->
city == NULL) {
4055 if (req->
range == REQ_RANGE_TRADE_ROUTE) {
4064 if (trade_partner == NULL) {
4090 const struct player *other_player,
4099 if (req->
range == REQ_RANGE_WORLD) {
4101 }
else if (context->
player == NULL) {
4103 }
else if (req->
range == REQ_RANGE_ALLIANCE
4104 || req->
range == REQ_RANGE_TEAM) {
4112 }
else if (req->
range == REQ_RANGE_PLAYER) {
4135 const struct player *other_player,
4153 const struct player *other_player,
4172 const struct player *other_player,
4192 const struct player *other_player,
4269 const struct player *other_player,
4301 const struct player *other_player,
4304 if (context == NULL) {
4309 log_error(
"tri_req_present(): invalid source kind %d.",
4329 const struct player *other_player,
4362 const struct player *other_player,
4363 const struct requirement_vector *
reqs,
4367 if (!
is_req_active(context, other_player, preq, prob_type)) {
4383 const struct player *other_player,
4390 int fragment1 = fragment;
4391 int year_inc, year_inc1;
4394 bool present, present1;
4397 if (slowdown >= 3) {
4401 }
else if (slowdown >= 2) {
4405 }
else if (slowdown >= 1) {
4410 year_inc = ypt * pass;
4411 year_inc1 = year_inc + ypt * period;
4415 fragment += fpt * pass;
4417 year_inc += fragment_years;
4419 fragment1 = fragment + fpt * period;
4421 year_inc1 += fragment_years;
4435 switch (req->
range) {
4436 case REQ_RANGE_LOCAL:
4446 case REQ_RANGE_CITY:
4447 if (context->
city == NULL) {
4456 case REQ_RANGE_PLAYER:
4457 if (context->
player == NULL) {
4474 case VUT_MINCALFRAG:
4487 ? present || present1 : !(present && present1));
4497 const struct player *other_player,
4499 void *data,
int n_data)
4505 for (i = 0; i < n_data; i++) {
4525 const struct player *other_player,
4526 const struct requirement_vector *
reqs,
4527 struct requirement_vector *maybe_reqs,
4529 void *data,
int n_data)
4532 bool certain =
TRUE;
4536 switch(tester(context, other_player, preq,
4547 requirement_vector_append(maybe_reqs, *preq);
4579 "Invalid source kind %d.", req->
source.
kind);
4608 return cond(nmap, s, context, req);
4620 const struct player *other_player,
4635 if (auto_present ? req->
present
4650 const struct requirement_vector *vec)
4668 enum universals_n kind)
4671 if (preq->present && preq->source.kind == kind) {
4697 case VUT_SPECIALIST:
4700 case VUT_CITYSTATUS:
4703 case VUT_SERVERSETTING:
4705 case VUT_NATIONGROUP:
4708 case VUT_GOVERNMENT:
4709 case VUT_ACHIEVEMENT:
4710 case VUT_IMPROVEMENT:
4711 case VUT_IMPR_GENUS:
4713 case VUT_MINCULTURE:
4714 case VUT_MINFOREIGNPCT:
4716 case VUT_NATIONALITY:
4718 case VUT_DIPLREL_TILE:
4719 case VUT_DIPLREL_TILE_O:
4720 case VUT_DIPLREL_UNITANY:
4721 case VUT_DIPLREL_UNITANY_O:
4722 case VUT_MAXTILEUNITS:
4725 case VUT_MINVETERAN:
4732 case VUT_MINCALFRAG:
4736 case VUT_TERRAINCLASS:
4738 case VUT_TERRAINALTER:
4790 const struct requirement_vector *vec)
4807struct requirement_vector *
4811 return (
struct requirement_vector *)parent_item;
4827 const char *req_vec_description;
4838 if (namer == NULL) {
4841 req_vec_description =
_(
"the requirement vector");
4856 req_vec_change_operation_name(change->
operation),
4858 req_vec_description);
4870 req_vec_change_operation_name(change->
operation),
4872 req_vec_description);
4880 _(
"Do nothing to %s"), req_vec_description);
4899 const void *parent_item)
4901 struct requirement_vector *target
4907 requirement_vector_append(target, modification->
req);
4912 requirement_vector_remove(target, i);
4970 const char *descr, ...)
4976 va_start(ap, descr);
4980 va_start(ap, descr);
5016 const void *parent_item)
5021 if (vec == NULL || requirement_vector_size(vec) == 0) {
5026 if (get_num == NULL || parent_item == NULL) {
5029 vec_num = get_num(parent_item, vec);
5033 for (i = 0; i < requirement_vector_size(vec); i++) {
5034 struct requirement *preq = requirement_vector_get(vec, i);
5035 for (j = 0; j < requirement_vector_size(vec); j++) {
5036 struct requirement *nreq = requirement_vector_get(vec, j);
5044 N_(
"Requirements {%s} and {%s} contradict each other."),
5081 const void *parent_item)
5102 const void *parent_item)
5108 if (vec == NULL || requirement_vector_size(vec) == 0) {
5113 if (get_num == NULL || parent_item == NULL) {
5116 vec_num = get_num(parent_item, vec);
5120 for (i = 0; i < requirement_vector_size(vec); i++) {
5121 struct requirement *preq = requirement_vector_get(vec, i);
5134 if (problem == NULL) {
5136 N_(
"Requirement {%s} requires %s but it will never be"
5147 if (problem != NULL) {
5153 N_(
"Requirement {%s} mentions %s but it will never be there."),
5187 const void *parent_item)
5192 if (vec == NULL || requirement_vector_size(vec) == 0) {
5197 if (get_num == NULL || parent_item == NULL) {
5200 vec_num = get_num(parent_item, vec);
5204 for (i = 0; i < requirement_vector_size(vec) - 1; i++) {
5205 struct requirement *preq = requirement_vector_get(vec, i);
5206 for (j = i + 1; j < requirement_vector_size(vec); j++) {
5207 struct requirement *nreq = requirement_vector_get(vec, j);
5215 N_(
"Requirements {%s} and {%s} are the same."),
5253 const void *parent_item)
5281 if (psource1->
kind != psource2->
kind) {
5284 switch (psource1->
kind) {
5291 case VUT_GOVERNMENT:
5293 case VUT_ACHIEVEMENT:
5297 case VUT_IMPROVEMENT:
5299 case VUT_IMPR_GENUS:
5311 case VUT_NATIONGROUP:
5313 case VUT_NATIONALITY:
5316 case VUT_DIPLREL_TILE:
5317 case VUT_DIPLREL_TILE_O:
5318 case VUT_DIPLREL_UNITANY:
5319 case VUT_DIPLREL_UNITANY_O:
5329 case VUT_MINVETERAN:
5348 case VUT_SPECIALIST:
5352 case VUT_MINCULTURE:
5354 case VUT_MINFOREIGNPCT:
5358 case VUT_MAXTILEUNITS:
5360 case VUT_TERRAINCLASS:
5368 case VUT_MINCALFRAG:
5372 case VUT_SERVERSETTING:
5374 case VUT_TERRAINALTER:
5378 case VUT_CITYSTATUS:
5394 static char buffer[10];
5396 switch (psource->
kind) {
5401 case VUT_CITYSTATUS:
5407 case VUT_MINCALFRAG:
5414 case VUT_SERVERSETTING:
5420 case VUT_GOVERNMENT:
5422 case VUT_ACHIEVEMENT:
5426 case VUT_IMPROVEMENT:
5428 case VUT_IMPR_GENUS:
5440 case VUT_NATIONGROUP:
5443 case VUT_DIPLREL_TILE:
5444 case VUT_DIPLREL_TILE_O:
5445 case VUT_DIPLREL_UNITANY:
5446 case VUT_DIPLREL_UNITANY_O:
5448 case VUT_NATIONALITY:
5458 case VUT_MINVETERAN:
5486 case VUT_SPECIALIST:
5492 case VUT_MINCULTURE:
5496 case VUT_MINFOREIGNPCT:
5502 case VUT_MAXTILEUNITS:
5505 case VUT_TERRAINCLASS:
5511 case VUT_TERRAINALTER:
5530 char *buf,
size_t bufsz)
5533 switch (psource->
kind) {
5545 case VUT_GOVERNMENT:
5549 case VUT_ACHIEVEMENT:
5557 case VUT_IMPROVEMENT:
5561 case VUT_IMPR_GENUS:
5579 case VUT_NATIONGROUP:
5583 case VUT_NATIONALITY:
5588 case VUT_DIPLREL_TILE:
5589 case VUT_DIPLREL_TILE_O:
5590 case VUT_DIPLREL_UNITANY:
5591 case VUT_DIPLREL_UNITANY_O:
5601 Q_(
"?utflag:\"%s\" units"),
5602 unit_type_flag_id_translated_name(
5614 Q_(
"?ucflag:\"%s\" units"),
5615 unit_class_flag_id_translated_name(
5618 case VUT_MINVETERAN:
5625 case USP_TRANSPORTED:
5629 case USP_LIVABLE_TILE:
5633 _(
"On livable tile"));
5635 case USP_TRANSPORTING:
5639 case USP_HAS_HOME_CITY:
5643 case USP_NATIVE_TILE:
5647 _(
"On native tile"));
5649 case USP_NATIVE_EXTRA:
5653 _(
"In native extra"));
5655 case USP_MOVED_THIS_TURN:
5662 "Invalid unit state property.");
5697 case VUT_SPECIALIST:
5705 case VUT_MINCULTURE:
5709 case VUT_MINFOREIGNPCT:
5718 case VUT_MAXTILEUNITS:
5724 case VUT_TERRAINCLASS:
5732 Q_(
"?terrflag:\"%s\" terrain"),
5733 terrain_flag_id_translated_name(
5739 Q_(
"?roadflag:\"%s\" road"),
5745 Q_(
"?extraflag:\"%s\" extra"),
5752 case VUT_MINCALFRAG:
5763 case VUT_SERVERSETTING:
5767 case VUT_TERRAINALTER:
5780 case CITYT_EXTRAS_OWNED:
5789 case VUT_CITYSTATUS:
5791 case CITYS_OWNED_BY_ORIGINAL:
5813 return universals_n_name(psource->
kind);
5822 switch (target->
kind) {
5823 case VUT_IMPROVEMENT:
5842 bool changed =
FALSE;
5846 preq->source = *replacement;
5859 const struct requirement_vector *
reqs,
5886 for (i = 0; i < n_unis; i++) {
5919 bool req_mentioned_a_source =
FALSE;
5921 for (i = 0; i < n_unis; i++) {
5926 req_mentioned_a_source =
TRUE;
5934 if (!req_mentioned_a_source) {
5955 "No req item found function for %s",
5972 const struct requirement_vector *
reqs,
5975 bool necessary =
FALSE;
5979 "No req item found function for %s",
5987 if (preq->present) {
5992 if (preq->present) {
6001 return (!check_necessary || necessary);
6019 log_error(
"Unhandled item_found value");
6035 case VUT_NATIONGROUP:
6076 case VUT_IMPROVEMENT:
6081 case VUT_IMPR_GENUS:
6174 case VUT_TERRAINCLASS:
6180 case VUT_TERRAINALTER:
6261 ||
source->kind == VUT_DIPLREL_TILE
6262 ||
source->kind == VUT_DIPLREL_TILE_O
6263 ||
source->kind == VUT_DIPLREL_UNITANY
6264 ||
source->kind == VUT_DIPLREL_UNITANY_O),
6273 &&
source->value.diplrel < DS_LAST) {
6278 &&
source->value.diplrel == DRO_HOSTS_REAL_EMBASSY) {
6283 &&
source->value.diplrel == DRO_HAS_REAL_EMBASSY) {
6288 &&
source->value.diplrel < DS_LAST
6289 && preq->
range == REQ_RANGE_LOCAL) {
6325 if (preq->
range != REQ_RANGE_LOCAL) {
6330 switch (
source->value.unit_state) {
6331 case USP_TRANSPORTED:
6332 case USP_TRANSPORTING:
6334 case USP_LIVABLE_TILE:
6335 case USP_NATIVE_TILE:
6338 case USP_HAS_HOME_CITY:
6339 case USP_NATIVE_EXTRA:
6340 case USP_MOVED_THIS_TURN:
6389 const enum req_range
range,
6391 const int max_value)
6395 const int pres_start = (present ? 0 : max_value);
6399 const int range_start = ((max_value - 1) * 2) *
range;
6401 return range_start + pres_start + value;
bool achievement_player_has(const struct achievement *pach, const struct player *pplayer)
struct achievement * achievement_by_number(int id)
int achievement_number(const struct achievement *pach)
const char * achievement_rule_name(struct achievement *pach)
struct achievement * achievement_by_rule_name(const char *name)
const char * achievement_name_translation(struct achievement *pach)
bool achievement_claimed(const struct achievement *pach)
const char * action_name_translation(const struct action *action)
bool action_is_in_use(struct action *paction)
struct action * action_by_rule_name(const char *name)
const char * action_rule_name(const struct action *action)
int action_number(const struct action *action)
static struct action * action_by_number(action_id act_id)
void astr_free(struct astring *astr)
void astr_set(struct astring *astr, const char *format,...)
void astr_init(struct astring *astr)
static const char * astr_str(const struct astring *astr) fc__attribute((nonnull(1)))
#define BV_ISSET(bv, bit)
const char * textcalfrag(int frag)
const char * textyear(int year)
citizens citizens_nation_foreign(const struct city *pcity)
#define citizens_iterate_end
#define citizens_iterate(_pcity, _pslot, _nationality)
bool city_has_building(const struct city *pcity, const struct impr_type *pimprove)
Output_type_id output_type_by_identifier(const char *id)
const char * get_output_identifier(Output_type_id output)
const char * get_output_name(Output_type_id output)
int city_map_radius_sq_get(const struct city *pcity)
#define city_tile(_pcity_)
static citizens city_size_get(const struct city *pcity)
#define city_owner(_pcity_)
static bool is_city_center(const struct city *pcity, const struct tile *ptile)
#define city_tile_iterate(_nmap, _radius_sq, _city_tile, _tile)
#define city_tile_iterate_end
int city_culture(const struct city *pcity)
int player_culture(const struct player *plr)
struct unit struct city struct unit * target_unit
struct unit struct city struct unit struct tile * target_tile
int get_world_bonus(enum effect_type effect_type)
static bool is_server(void)
#define PL_(String1, String2, n)
const char * government_name_translation(const struct government *pgovern)
struct government * government_by_number(const Government_type_id gov)
struct government * government_of_player(const struct player *pplayer)
Government_type_id government_number(const struct government *pgovern)
const char * government_rule_name(const struct government *pgovern)
struct government * government_by_rule_name(const char *name)
static GtkWidget * source
struct impr_type * improvement_by_number(const Impr_type_id id)
bool great_wonder_is_built(const struct impr_type *pimprove)
bool great_wonder_is_destroyed(const struct impr_type *pimprove)
bool wonder_is_lost(const struct player *pplayer, const struct impr_type *pimprove)
bool wonder_is_built(const struct player *pplayer, const struct impr_type *pimprove)
Impr_type_id improvement_number(const struct impr_type *pimprove)
bool can_improvement_go_obsolete(const struct impr_type *pimprove)
const char * improvement_rule_name(const struct impr_type *pimprove)
struct city * city_from_wonder(const struct player *pplayer, 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)
struct impr_type * improvement_by_rule_name(const char *name)
const char * improvement_name_translation(const struct impr_type *pimprove)
bool great_wonder_is_available(const struct impr_type *pimprove)
#define fc_assert_msg(condition, message,...)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
#define log_error(message,...)
#define fc_assert_ret_val_msg(condition, val, message,...)
bool is_tiles_adjacent(const struct tile *tile0, const struct tile *tile1)
bool same_pos(const struct tile *tile1, const struct tile *tile2)
int map_distance(const struct tile *tile0, const struct tile *tile1)
#define current_topo_has_flag(flag)
#define cardinal_adjc_iterate_end
#define adjc_iterate(nmap, center_tile, itr_tile)
#define cardinal_adjc_iterate(nmap, center_tile, itr_tile)
const char * move_points_text(int mp, bool reduce)
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)
struct nation_group * nation_group_by_rule_name(const char *name)
const char * nation_rule_name(const struct nation_type *pnation)
Nation_type_id nation_number(const struct nation_type *pnation)
const char * nation_adjective_translation(const struct nation_type *pnation)
struct nation_type * nation_by_number(const Nation_type_id nation)
const char * nation_group_rule_name(const struct nation_group *pgroup)
struct nation_type * nation_of_player(const struct player *pplayer)
bool nation_is_in_group(const struct nation_type *pnation, const struct nation_group *pgroup)
const char * nation_group_name_translation(const struct nation_group *pgroup)
struct nation_type * nation_by_rule_name(const char *name)
struct nation_group * nation_group_by_number(int id)
int nation_group_number(const struct nation_group *pgroup)
#define NO_NATION_SELECTED
bool player_knows_techs_with_flag(const struct player *pplayer, enum tech_flag_id flag)
bv_diplrel_all_reqs diplrel_req_contradicts(const struct requirement *req)
int diplrel_by_rule_name(const char *value)
bool players_on_same_team(const struct player *pplayer1, const struct player *pplayer2)
bool is_diplrel_to_other(const struct player *pplayer, int diplrel)
const char * diplrel_name_translation(int value)
bool is_diplrel_between(const struct player *player1, const struct player *player2, int diplrel)
int player_age(const struct player *pplayer)
bool pplayers_allied(const struct player *pplayer, const struct player *pplayer2)
struct player * player_slot_get_player(const struct player_slot *pslot)
const char * diplrel_rule_name(int value)
#define players_iterate_end
#define players_iterate(_pplayer)
#define players_iterate_alive_end
#define players_iterate_alive(_pplayer)
static enum req_item_found terrain_type_found(const struct requirement *preq, const struct universal *source)
bool universal_never_there(const struct universal *source)
static enum fc_tristate is_topology_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_diplrel_unitany_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
bool universal_is_relevant_to_requirement(const struct requirement *req, const struct universal *source)
bool is_req_in_vec(const struct requirement *req, const struct requirement_vector *vec)
static int num_city_buildings(const struct city *pcity, const struct impr_type *building)
int universal_build_shield_cost(const struct city *pcity, const struct universal *target)
static enum req_item_found city_tile_found(const struct requirement *preq, const struct universal *source)
struct req_vec_problem * req_vec_get_first_contradiction(const struct requirement_vector *vec, requirement_vector_number get_num, const void *parent_item)
static universal_found universal_found_function[VUT_COUNT]
static enum req_unchanging_status unchanging_local(const struct civ_map *nmap, enum req_unchanging_status def, const struct req_context *context, const struct requirement *req)
const struct req_context * req_context_empty(void)
static enum req_item_found unit_type_found(const struct requirement *preq, const struct universal *source)
static enum fc_tristate is_mincalfrag_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
void universal_extraction(const struct universal *source, int *kind, int *value)
static int num_player_buildings(const struct player *pplayer, const struct impr_type *building)
static enum fc_tristate is_extraflag_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_minforeignpct_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static int num_continent_buildings(const struct player *pplayer, int continent, const struct impr_type *building)
static enum fc_tristate tri_req_present(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
const char * req_to_fstring(const struct requirement *req, struct astring *astr)
static enum fc_tristate is_style_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
req_vec_num_in_item req_vec_vector_number(const void *parent_item, const struct requirement_vector *vec)
static bool present_implies_not_present(const struct requirement *req1, const struct requirement *req2)
static enum fc_tristate is_roadflag_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
struct requirement_vector * req_vec_by_number(const void *parent_item, req_vec_num_in_item number)
bool universal_fulfills_requirements(bool check_necessary, const struct requirement_vector *reqs, const struct universal *source)
static bool activity_is_valid_in_requirement(enum unit_activity act)
static enum fc_tristate is_specialist_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum req_unchanging_status unchanging_noally(const struct civ_map *nmap, enum req_unchanging_status def, const struct req_context *context, const struct requirement *req)
static enum fc_tristate is_minveteran_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_unitstate_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
bool req_vec_change_apply(const struct req_vec_change *modification, requirement_vector_by_number getter, const void *parent_item)
void universal_copy(struct universal *dst, const struct universal *src)
static enum req_unchanging_status unchanging_building(const struct civ_map *nmap, enum req_unchanging_status def, const struct req_context *context, const struct requirement *req)
bool are_requirements_equal(const struct requirement *req1, const struct requirement *req2)
static enum req_item_found extra_type_found(const struct requirement *preq, const struct universal *source)
static enum fc_tristate is_diplrel_unitany_in_range(const struct tile *target_tile, const struct player *other_player, enum req_range range, int diplrel)
static enum fc_tristate is_nation_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
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)
static enum fc_tristate is_buildinggenus_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
const char * req_vec_change_translation(const struct req_vec_change *change, const requirement_vector_namer namer)
static enum fc_tristate is_diplrel_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
struct requirement req_from_str(const char *type, const char *range, bool survives, bool present, bool quiet, const char *value)
struct req_vec_problem * req_vec_suggest_repair(const struct requirement_vector *vec, requirement_vector_number get_num, const void *parent_item)
void universal_value_from_str(struct universal *source, const char *value)
void req_get_values(const struct requirement *req, int *type, int *range, bool *survives, bool *present, bool *quiet, int *value)
struct requirement req_from_values(int type, int range, bool survives, bool present, bool quiet, int value)
bool are_reqs_active(const struct req_context *context, const struct player *other_player, const struct requirement_vector *reqs, const enum req_problem_type prob_type)
const char * universal_rule_name(const struct universal *psource)
static enum fc_tristate is_ai_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum req_unchanging_status unchanging_present(const struct civ_map *nmap, enum req_unchanging_status def, const struct req_context *context, const struct requirement *req)
static enum fc_tristate is_citytile_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_nationality_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_activity_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
bool universal_replace_in_req_vec(struct requirement_vector *reqs, const struct universal *to_replace, const struct universal *replacement)
static enum req_item_found action_found(const struct requirement *preq, const struct universal *source)
enum fc_tristate default_tester_cb(const struct req_context *context, const struct player *other_player, const struct requirement *req, void *data, int n_data)
bool are_requirements_contradictions(const struct requirement *req1, const struct requirement *req2)
enum fc_tristate tri_req_active_turns(int pass, int period, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_diplrel_unitany_o_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
struct req_vec_problem * req_vec_problem_new(int num_suggested_solutions, const char *descr,...)
static enum fc_tristate is_diplrel_in_range(const struct player *target_player, const struct player *other_player, enum req_range range, int diplrel)
static enum fc_tristate is_none_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
bool universal_is_legal_in_requirement(const struct universal *univ)
static enum fc_tristate is_maxunitsontile_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
int requirement_kind_ereq(const int value, const enum req_range range, const bool present, const int max_value)
static enum fc_tristate is_terrain_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
void req_vec_problem_free(struct req_vec_problem *issue)
static struct req_def req_definitions[VUT_COUNT]
static enum req_item_found improvement_found(const struct requirement *preq, const struct universal *source)
struct req_vec_problem * req_vec_get_first_missing_univ(const struct requirement_vector *vec, requirement_vector_number get_num, const void *parent_item)
static enum fc_tristate is_gov_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_terrainalter_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_tech_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_good_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static bool players_in_same_range(const struct player *pplayer1, const struct player *pplayer2, enum req_range range)
enum req_item_found(* universal_found)(const struct requirement *, const struct universal *)
struct universal universal_by_number(const enum universals_n kind, const int value)
static enum fc_tristate is_achievement_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
enum req_item_found universal_fulfills_requirement(const struct requirement *preq, const struct universal *source)
static enum fc_tristate is_building_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_unitclassflag_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum req_item_found ustate_found(const struct requirement *preq, const struct universal *source)
bool req_vec_wants_type(const struct requirement_vector *reqs, enum universals_n kind)
static int num_world_buildings_total(const struct impr_type *building)
static enum req_unchanging_status unchanging_citytile(const struct civ_map *nmap, enum req_unchanging_status def, const struct req_context *context, const struct requirement *req)
enum fc_tristate tri_reqs_cb_active(const struct req_context *context, const struct player *other_player, const struct requirement_vector *reqs, struct requirement_vector *maybe_reqs, req_tester_cb tester, void *data, int n_data)
static enum req_item_found output_type_found(const struct requirement *preq, const struct universal *source)
static enum fc_tristate is_minhitpoints_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
struct req_vec_problem * req_vec_get_first_redundant_req(const struct requirement_vector *vec, requirement_vector_number get_num, const void *parent_item)
static enum fc_tristate is_age_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_nationgroup_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static bool is_city_in_tile(const struct tile *ptile, const struct city *pcity)
enum fc_tristate(* is_req_active_cb)(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
bool does_req_contradicts_reqs(const struct requirement *req, const struct requirement_vector *vec)
static enum req_item_found government_found(const struct requirement *preq, const struct universal *source)
static enum req_unchanging_status unchanging_world(const struct civ_map *nmap, enum req_unchanging_status def, const struct req_context *context, const struct requirement *req)
static enum fc_tristate is_serversetting_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_action_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
bool are_universals_equal(const struct universal *psource1, const struct universal *psource2)
struct req_vec_problem * req_vec_problem_new_transl(int num_suggested_solutions, const char *description, const char *description_translated)
static enum req_item_found unit_activity_found(const struct requirement *preq, const struct universal *source)
static enum fc_tristate is_mintechs_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_unitclass_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
enum fc_tristate tri_req_active(const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_terrainflag_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
bool universals_say_everything(struct requirement_vector *reqs, struct universal *unis, size_t n_unis)
static enum fc_tristate is_extra_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum req_item_found nation_found(const struct requirement *preq, const struct universal *source)
const char * universal_type_rule_name(const struct universal *psource)
void universal_found_functions_init(void)
static enum req_item_found unit_class_found(const struct requirement *preq, const struct universal *source)
#define IS_REQ_ACTIVE_VARIANT_ASSERT(_kind)
int universal_number(const struct universal *source)
static enum fc_tristate is_outputtype_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
bool universal_is_mentioned_by_requirements(const struct requirement_vector *reqs, const struct universal *psource)
static enum fc_tristate is_minsize_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_diplrel_tile_o_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum req_item_found diplrel_found(const struct requirement *preq, const struct universal *source)
bool req_vec_is_impossible_to_fulfill(const struct requirement_vector *reqs)
static enum fc_tristate is_unitflag_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
bool req_implies_req(const struct requirement *req1, const struct requirement *req2)
void req_copy(struct requirement *dst, const struct requirement *src)
enum req_unchanging_status is_req_unchanging(const struct req_context *context, const struct requirement *req)
static enum fc_tristate is_techflag_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static bool player_has_ever_built(const struct player *pplayer, const struct impr_type *building)
static enum fc_tristate is_terrainclass_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
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)
static bool nation_contra_group(const struct requirement *nation_req, const struct requirement *group_req)
bool req_is_impossible_to_fulfill(const struct requirement *req)
static bool are_tiles_in_range(const struct tile *tile1, const struct tile *tile2, enum req_range range)
static enum fc_tristate is_minyear_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static bool are_requirements_opposites(const struct requirement *req1, const struct requirement *req2)
static int num_world_buildings(const struct impr_type *building)
static enum fc_tristate is_minmovefrags_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum fc_tristate is_diplrel_tile_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
static enum req_unchanging_status unchanging_citystatus(const struct civ_map *nmap, enum req_unchanging_status def, const struct req_context *context, const struct requirement *req)
static enum fc_tristate is_minculture_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
const char * universal_name_translation(const struct universal *psource, char *buf, size_t bufsz)
struct universal universal_by_rule_name(const char *kind, const char *value)
static enum fc_tristate is_citystatus_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
bool universals_mean_unfulfilled(struct requirement_vector *reqs, struct universal *unis, size_t n_unis)
struct req_vec_problem * req_vec_suggest_improvement(const struct requirement_vector *vec, requirement_vector_number get_num, const void *parent_item)
static bool impr_contra_genus(const struct requirement *impr_req, const struct requirement *genus_req)
static enum fc_tristate is_unittype_req_active(const struct civ_map *nmap, const struct req_context *context, const struct player *other_player, const struct requirement *req)
#define requirement_diplrel_ereq(_id_, _range_, _present_)
signed char req_vec_num_in_item
req_vec_num_in_item a requirement vectors number in an item.
req_vec_num_in_item(* requirement_vector_number)(const void *parent_item, const struct requirement_vector *vec)
const char *(* requirement_vector_namer)(req_vec_num_in_item number)
#define universal_is_mentioned_by_requirement(preq, psource)
enum req_unchanging_status(* req_unchanging_cond_cb)(const struct civ_map *nmap, enum req_unchanging_status def, const struct req_context *context, const struct requirement *req)
enum fc_tristate(* req_tester_cb)(const struct req_context *context, const struct player *other_player, const struct requirement *req, void *data, int n_data)
#define requirement_vector_iterate_end
struct universal universal_by_number(const enum universals_n kind, const int value)
struct requirement_vector *(* requirement_vector_by_number)(const void *parent_item, req_vec_num_in_item number)
#define requirement_vector_iterate(req_vec, preq)
struct research * research_get(const struct player *pplayer)
enum tech_state research_invention_state(const struct research *presearch, Tech_type_id tech)
bool road_has_flag(const struct road_type *proad, enum road_flag_id flag)
bool is_road_flag_near_tile(const struct civ_map *nmap, const struct tile *ptile, enum road_flag_id flag)
bool is_road_flag_card_near(const struct civ_map *nmap, const struct tile *ptile, enum road_flag_id flag)
bool ssetv_setting_has_value(ssetv val)
ssetv ssetv_by_rule_name(const char *name)
const char * ssetv_rule_name(ssetv val)
const char * ssetv_human_readable(ssetv val, bool present)
enum fc_tristate fc_tristate_or(enum fc_tristate one, enum fc_tristate two)
#define BOOL_TO_TRISTATE(tri)
struct specialist * specialist_by_rule_name(const char *name)
struct specialist * specialist_by_number(const Specialist_type_id id)
Specialist_type_id specialist_number(const struct specialist *sp)
const char * specialist_rule_name(const struct specialist *sp)
const char * specialist_plural_translation(const struct specialist *sp)
struct packet_game_info info
struct packet_calendar_info calendar
bool global_advances[A_LAST]
enum ai_level skill_level
struct player_ai ai_common
struct nation_style * style
const struct impr_type * building
const struct action * action
const struct player * player
const struct output_type * output
const struct unit_type * unittype
const struct specialist * specialist
enum req_unchanging_status unchanging
req_unchanging_cond_cb unchanging_cond
const is_req_active_cb cb
req_vec_num_in_item vector_number
enum req_vec_change_operation operation
int num_suggested_solutions
char description_translated[500]
struct req_vec_change * suggested_solutions
struct player * extras_owner
enum unit_activity activity
struct unit::@80::@83 server
struct unit * transporter
struct nation_style * style_by_rule_name(const char *name)
struct nation_style * style_by_number(int id)
const char * style_name_translation(const struct nation_style *pstyle)
const char * style_rule_name(const struct nation_style *pstyle)
int style_number(const struct nation_style *pstyle)
int fc_snprintf(char *str, size_t n, const char *format,...)
size_t fc_strlcpy(char *dest, const char *src, size_t n)
int fc_strcasecmp(const char *str0, const char *str1)
size_t fc_strlcat(char *dest, const char *src, size_t n)
int cat_snprintf(char *str, size_t n, const char *format,...)
int fc_vsnprintf(char *str, size_t n, const char *format, va_list ap)
struct advance * advance_by_number(const Tech_type_id atype)
const char * advance_name_translation(const struct advance *padvance)
const char * advance_rule_name(const struct advance *padvance)
struct advance * advance_by_rule_name(const char *name)
Tech_type_id advance_number(const struct advance *padvance)
struct terrain * terrain_by_rule_name(const char *name)
bool is_terrain_class_near_tile(const struct civ_map *nmap, const struct tile *ptile, enum terrain_class tclass)
bool is_terrain_class_card_near(const struct civ_map *nmap, const struct tile *ptile, enum terrain_class tclass)
const char * terrain_class_name_translation(enum terrain_class tclass)
const char * terrain_name_translation(const struct terrain *pterrain)
struct terrain * terrain_by_number(const Terrain_type_id type)
bool terrain_can_support_alteration(const struct terrain *pterrain, enum terrain_alteration alter)
bool is_terrain_card_near(const struct civ_map *nmap, const struct tile *ptile, const struct terrain *pterrain, bool check_self)
const char * terrain_rule_name(const struct terrain *pterrain)
enum terrain_class terrain_type_terrain_class(const struct terrain *pterrain)
bool is_terrain_flag_near_tile(const struct civ_map *nmap, const struct tile *ptile, enum terrain_flag_id flag)
Terrain_type_id terrain_number(const struct terrain *pterrain)
bool is_terrain_flag_card_near(const struct civ_map *nmap, const struct tile *ptile, enum terrain_flag_id flag)
bool is_terrain_near_tile(const struct civ_map *nmap, const struct tile *ptile, const struct terrain *pterrain, bool check_self)
#define terrain_has_flag(terr, flag)
bool tile_has_extra_flag(const struct tile *ptile, enum extra_flag_id flag)
bool tile_has_native_base(const struct tile *ptile, const struct unit_type *punittype)
bool tile_has_road_flag(const struct tile *ptile, enum road_flag_id flag)
struct city * tile_city(const struct tile *ptile)
#define tile_terrain(_tile)
#define tile_continent(_tile)
#define tile_has_extra(ptile, pextra)
#define tile_owner(_tile)
Goods_type_id goods_number(const struct goods_type *pgood)
struct goods_type * goods_by_rule_name(const char *name)
const char * goods_rule_name(struct goods_type *pgood)
const char * goods_name_translation(struct goods_type *pgood)
struct goods_type * goods_by_number(Goods_type_id id)
bool city_receives_goods(const struct city *pcity, const struct goods_type *pgood)
#define trade_partners_iterate_end
#define trade_partners_iterate(c, p)
const struct unit_type * utype
struct nation_style * style
struct specialist * specialist
enum impr_genus_id impr_genus
enum citytile_type citytile
struct nation_group * nationgroup
struct extra_type * extra
struct nation_type * nation
struct government * govern
enum citystatus_type citystatus
const struct impr_type * building
struct achievement * achievement
enum unit_activity activity
enum ustate_prop unit_state
Output_type_id outputtype
enum topo_flag topo_property
struct unit_class * uclass
struct nation_type * nationality
bool is_real_activity(enum unit_activity activity)
int get_transporter_occupancy(const struct unit *ptrans)
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end
const char * uclass_name_translation(const struct unit_class *pclass)
const struct unit_type * unit_type_get(const struct unit *punit)
struct unit_type * unit_type_by_rule_name(const char *name)
bool uclass_flag_is_in_use(enum unit_class_flag_id ucflag)
struct unit_class * uclass_by_number(const Unit_Class_id id)
const char * utype_rule_name(const struct unit_type *punittype)
struct unit_type * utype_by_number(const Unit_type_id id)
const char * uclass_rule_name(const struct unit_class *pclass)
Unit_type_id utype_number(const struct unit_type *punittype)
struct unit_class * unit_class_by_rule_name(const char *s)
bool utype_flag_is_in_use(enum unit_type_flag_id uflag)
int utype_build_shield_cost(const struct city *pcity, const struct player *pplayer, const struct unit_type *punittype)
Unit_Class_id uclass_number(const struct unit_class *pclass)
const char * utype_name_translation(const struct unit_type *punittype)
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)
bool victory_enabled(enum victory_condition_type victory)