82#define RULES_SUFFIX "ruleset"
83#define SCRIPT_SUFFIX "lua"
85#define ADVANCE_SECTION_PREFIX "advance_"
86#define TECH_CLASS_SECTION_PREFIX "techclass_"
87#define BUILDING_SECTION_PREFIX "building_"
88#define CITYSTYLE_SECTION_PREFIX "citystyle_"
89#define MUSICSTYLE_SECTION_PREFIX "musicstyle_"
90#define EFFECT_SECTION_PREFIX "effect_"
91#define GOVERNMENT_SECTION_PREFIX "government_"
92#define NATION_SET_SECTION_PREFIX "nset"
93#define NATION_GROUP_SECTION_PREFIX "ngroup"
94#define NATION_SECTION_PREFIX "nation"
95#define STYLE_SECTION_PREFIX "style_"
96#define CLAUSE_SECTION_PREFIX "clause_"
97#define EXTRA_SECTION_PREFIX "extra_"
98#define BASE_SECTION_PREFIX "base_"
99#define ROAD_SECTION_PREFIX "road_"
100#define RESOURCE_SECTION_PREFIX "resource_"
101#define GOODS_SECTION_PREFIX "goods_"
102#define SPECIALIST_SECTION_PREFIX "specialist_"
103#define TERRAIN_SECTION_PREFIX "terrain_"
104#define UNIT_CLASS_SECTION_PREFIX "unitclass_"
105#define UNIT_SECTION_PREFIX "unit_"
106#define DISASTER_SECTION_PREFIX "disaster_"
107#define ACHIEVEMENT_SECTION_PREFIX "achievement_"
108#define ACTION_ENABLER_SECTION_PREFIX "actionenabler_"
109#define MULTIPLIER_SECTION_PREFIX "multiplier_"
111#define check_name(name) (check_strlen(name, MAX_LEN_NAME, NULL))
112#define check_cityname(name) (check_strlen(name, MAX_LEN_CITYNAME, NULL))
116#define MAX_SECTION_LABEL 64
117#define section_strlcpy(dst, src) \
118 (void) loud_strlcpy(dst, src, MAX_SECTION_LABEL, name_too_long)
129 bool act,
bool buffer_script,
bool load_luadata);
151 const char *secfile_str1,
152 const char *secfile_str2,
153 const char **allowed_terrains,
207 const char *file,
const char *function,
209 const char *format, ...)
218 va_start(args, format);
219 if (logger != NULL) {
253 ae->ruledit_disabled =
TRUE;
257 log_normal(
"Purged all action enablers for %s",
264 if (!ae->ruledit_disabled
267 ae->ruledit_disabled =
TRUE;
269 log_normal(
"Purged unused action enabler for %s",
284 enum effect_type
type;
286 for (
type = effect_type_begin();
type != effect_type_end();
290 eft->ruledit_do_not_save =
TRUE;
293 effect_type_name(eft->type));
327 if (problem == NULL) {
367 if (problem == NULL) {
425 "Purged redundant requirement in"
426 " %s in action enabler for %s",
429 "Purged redundant requirement in"
430 " %s in action enabler for %s",
436 while (!ae->ruledit_disabled
455 enum effect_type
type;
457 for (
type = effect_type_begin();
type != effect_type_end();
463 "Purged redundant requirement in effect of type %s",
464 effect_type_name(
type));
502 const char *extension,
506 const char *dfilename;
511 subdir,
name, extension);
519 log_verbose(
"Trying \"%s\": default ruleset directory.", filename);
525 fc_snprintf(filename,
sizeof(filename),
"%s_%s.%s",
526 subdir,
name, extension);
527 log_verbose(
"Trying \"%s\": alternative ruleset filename syntax.",
532 }
else if (!optional) {
535 _(
"Could not find a readable \"%s.%s\" ruleset file."),
570 if (dfilename == NULL) {
579 if (secfile == NULL) {
591 char **buffer,
bool optional)
596 if (dfilename == NULL) {
600 if (buffer == NULL) {
624 if (dfilename == NULL) {
633 if (secfile == NULL) {
653 const char *filename;
657 requirement_vector_reserve(&
reqs_list, 0);
660 sec, sub, j)); j++) {
663 bool survives, present, quiet;
664 struct entry *pentry;
667 if (
compat->compat_mode) {
705 "\"%s\": trying to have an floating point entry as a requirement name in '%s.%s%d'.",
706 filename, sec, sub, j);
717 "\"%s\": error in handling requirement name for '%s.%s%d'.",
718 filename, sec, sub, j);
733 "\"%s\": invalid boolean value for survives for "
734 "'%s.%s%d'.", filename, sec, sub, j);
742 "\"%s\": invalid boolean value for present for "
743 "'%s.%s%d'.", filename, sec, sub, j);
750 "\"%s\": invalid boolean value for quiet for "
751 "'%s.%s%d'.", filename, sec, sub, j);
754 if (
compat->compat_mode) {
760 if (
compat->compat_mode) {
764 if (
compat->compat_mode) {
767 type =
"DiplRelTile";
774 if (req.
source.
kind == universals_n_invalid()) {
776 "\"%s\" [%s] has invalid or unknown req: "
783 requirement_vector_append(&
reqs_list, req);
786 if (
compat->compat_mode) {
788 filename, sec, sub, rfor);
793 "Too many (%d) requirements for %s. Max is %d",
806 struct combat_bonus_list *
list,
813 const char *filename;
819 sec, sub, j)); j++) {
825 if (!unit_type_flag_id_is_valid(bonus->
flag)) {
826 log_error(
"\"%s\": unknown flag name \"%s\" in '%s.%s'.",
827 filename,
flag, sec, sub);
835 if (!combat_bonus_type_is_valid(bonus->
type)) {
836 log_error(
"\"%s\": unknown bonus type \"%s\" in '%s.%s'.",
837 filename,
type, sec, sub);
844 log_error(
"\"%s\": failed to get value from '%s.%s%d'.",
845 filename, sec, sub, j);
853 combat_bonus_list_append(
list, bonus);
869 const char *prefix,
const char *
entry,
870 const char *filename,
871 const char *description)
876 if (!sval || !strcmp(sval,
"Never")) {
883 "\"%s\" %s %s: couldn't match \"%s\".",
884 filename, (description ? description : prefix),
entry, sval);
900 const char *prefix,
const char *
entry,
902 const char *filename,
903 const char *description)
909 if (!sval || strcmp(sval,
"None") == 0) {
916 "\"%s\" %s %s: couldn't match \"%s\".",
917 filename, (description ? description : prefix),
entry, sval);
935 const char *filename)
956 "\"%s\": string vector %s.%s too long (%d, max %d)",
959 }
else if (nval == 1 && strcmp(slist[0],
"") == 0) {
964 for (i = 0; i < nval; i++) {
965 const char *sval = slist[i];
970 "\"%s\" %s.%s (%d): couldn't match \"%s\".",
971 filename, prefix,
entry, i, sval);
975 output[i] = punittype;
976 log_debug(
"\"%s\" %s.%s (%d): %s (%d)", filename, prefix,
entry, i, sval,
993 const char *
entry,
int *output,
994 const char *filename)
1006 if (slist == NULL || nval == 0) {
1010 "\"%s\": string vector %s.%s too long (%d, max %d)",
1016 if (nval == 1 && strcmp(slist[0],
"") == 0) {
1020 for (i = 0; i < nval && ok; i++) {
1021 const char *sval = slist[i];
1024 if (NULL == padvance) {
1026 "\"%s\" %s.%s (%d): couldn't match \"%s\".",
1027 filename, prefix,
entry, i, sval);
1032 "\"%s\" %s.%s (%d): \"%s\" is removed.",
1033 filename, prefix,
entry, i, sval);
1039 log_debug(
"\"%s\" %s.%s (%d): %s (%d)", filename, prefix,
entry, i, sval,
1057 const char *prefix,
const char *
entry,
1058 int *output,
const char *filename)
1072 "\"%s\": string vector %s.%s too long (%d, max %d)",
1075 }
else if (nval == 0 || (nval == 1 && strcmp(slist[0],
"") == 0)) {
1076 if (slist != NULL) {
1082 for (i = 0; i < nval; i++) {
1083 const char *sval = slist[i];
1086 if (NULL == pimprove) {
1088 "\"%s\" %s.%s (%d): couldn't match \"%s\".",
1089 filename, prefix,
entry, i, sval);
1112 const char *filename,
1113 const char *description)
1119 if (strcmp(sval,
"None") == 0) {
1123 if (*result == NULL) {
1125 "\"%s\" %s %s: couldn't match \"%s\".",
1126 filename, (description ? description : prefix),
entry, sval);
1141 const char *filename,
1155 "\"%s\" %s: couldn't match \"%s\".",
1156 filename,
entry, sval);
1170 char copy[strlen(sval) + 1];
1174 if (strlen(copy) > 0) {
1185 const char *prefix,
const char *suffix)
1189 "%s.%s", prefix, suffix);
1206 const char *jsection)
1214 "\"%s\" [%s] has unknown \"%s\".",
1215 filename, jsection,
name);
1227 const char *filename,
1230 bool null_acceptable)
1237 if (NULL ==
name && !null_acceptable) {
1243 || (0 == strcmp(
name,
"none"))
1244 || (0 == strcmp(
name,
"no"))) {
1249 if (0 == strcmp(
name,
"yes")) {
1258 if (pterr == NULL) {
1260 "\"%s\" [%s] has unknown \"%s\".",
1276 const char *sec_name,
const char *property_name,
1277 const char *filename,
const char *item_name,
1287 if (*turns > max_turns) {
1289 "\"%s\": \"%s\": \"%s\" value %d too large (max %d)",
1290 filename, item_name ? item_name : sec_name,
1291 property_name, *turns, max_turns);
1304 const char *sec_name)
1311 "\"%s\" [%s]: no \"name\" specified.",
1326 const char *secname,
const char *field_prefix)
1333 const char *trait_names[] = {
1341 for (tr = trait_begin(); tr != trait_end() && trait_names[tr] != NULL; tr = trait_next(tr)) {
1366 struct section_list *sec;
1381 nval = (NULL != sec ? section_list_size(sec) : 0);
1386 "\"%s\": Too many achievement types (%d, max %d)",
1399 "\"%s\": Cannot load achievement names",
1407 section_list_destroy(sec);
1412 nval = (NULL != sec ? section_list_size(sec) : 0);
1417 "\"%s\": Too many goods types (%d, max %d)",
1419 section_list_destroy(sec);
1421 }
else if (nval < 1) {
1423 "\"%s\": At least one goods type needed",
1425 section_list_destroy(sec);
1433 const char *sec_name
1438 "\"%s\": Cannot load goods names",
1445 section_list_destroy(sec);
1459 struct section_list *sec = NULL;
1479 if (tech_flag_id_by_name(flag,
fc_strcasecmp) != tech_flag_id_invalid()) {
1481 "\"%s\": Duplicate tech flag name '%s'",
1488 "\"%s\": Too many user tech flags!",
1507 nval = (NULL != sec ? section_list_size(sec) : 0);
1512 "\"%s\": Too many tech classes (%d, max %d)",
1514 section_list_destroy(sec);
1522 const char *sec_name
1538 if (NULL == sec || 0 == (num_techs = section_list_size(sec))) {
1540 "\"%s\": No Advances?!?", filename);
1543 log_verbose(
"%d advances (including possibly unused)", num_techs);
1546 "\"%s\": Too many advances (%d, max %d)",
1565 section_list_destroy(sec);
1576 struct section_list *sec;
1588 const char *sec_name =
section_name(section_list_get(sec, i));
1591 sec_name,
"cost_pct");
1600 const char *sec_name =
section_name(section_list_get(sec, i));
1603 struct requirement_vector *research_reqs;
1618 "\"%s\" [%s] \"%s\": \"Never\" with non-\"Never\".",
1625 "\"%s\" [%s] \"%s\": should have \"None\" second.",
1634 const char *classname;
1637 if (classname != NULL) {
1638 classname =
Q_(classname);
1640 if (a->tclass == NULL) {
1642 "\"%s\" [%s] \"%s\": Unknown tech class \"%s\".",
1654 if (research_reqs == NULL) {
1659 requirement_vector_copy(&a->research_reqs, research_reqs);
1664 for (j = 0; j < nval; j++) {
1666 if (strcmp(sval,
"") == 0) {
1670 if (!tech_flag_id_is_valid(ival)) {
1672 "\"%s\" [%s] \"%s\": bad flag name \"%s\".",
1690 "%s.graphic_alt", sec_name));
1693 a->bonus_message =
lookup_string(file, sec_name,
"bonus_message");
1714 bool out_of_order =
FALSE;
1721 && (a == b->require[
AR_ONE] || a == b->require[
AR_TWO])) {
1723 b->inherited_root_req =
TRUE;
1725 out_of_order =
TRUE;
1756 "\"%s\" tech \"%s\": req1 leads to removed tech.",
1763 "\"%s\" tech \"%s\": req2 leads to removed tech.",
1772 section_list_destroy(sec);
1787 struct section_list *sec = NULL;
1809 != unit_type_flag_id_invalid()) {
1811 "\"%s\": Duplicate unit flag name '%s'",
1818 "\"%s\": Too many user unit type flags!",
1838 "control.class_flags%d.name",
1842 "control.class_flags%d.helptxt", i);
1845 != unit_class_flag_id_invalid()) {
1847 "\"%s\": Duplicate unit class flag name '%s'",
1854 "\"%s\": Too many user unit class flags!",
1874 if (NULL == sec || 0 == (nval = section_list_size(sec))) {
1876 "\"%s\": No unit classes?!?", filename);
1882 "\"%s\": Too many unit classes (%d, max %d)",
1902 section_list_destroy(sec);
1908 if (NULL == sec || 0 == (nval = section_list_size(sec))) {
1910 "\"%s\": No unit types?!?", filename);
1913 log_verbose(
"%d unit types (including possibly unused)", nval);
1916 "\"%s\": Too many unit types (%d, max %d)",
1935 section_list_destroy(sec);
1948 const char **vlist_name;
1949 int *vlist_power, *vlist_raise, *vlist_wraise, *vlist_move;
1950 size_t count_name, count_power, count_raise, count_wraise, count_move;
1955 if (*vsystem != NULL) {
1956 fc_snprintf(err, err_len,
"Veteran system is defined?!");
1962 "%s.veteran_names", path);
1964 "%s.veteran_power_fact", path);
1966 "%s.veteran_base_raise_chance", path);
1967 if (vlist_raise == NULL) {
1970 "%s.veteran_raise_chance", path);
1979 "%s.veteran_work_raise_chance",
1982 "%s.veteran_move_bonus", path);
1986 fc_snprintf(err, err_len,
"\"%s\": Too many veteran levels (section "
1989 }
else if (count_name != count_power
1990 || count_name != count_raise
1991 || count_name != count_wraise
1992 || count_name != count_move) {
1994 fc_snprintf(err, err_len,
"\"%s\": Different lengths for the veteran "
1997 }
else if (count_name == 0) {
2004#define rs_sanity_veteran(_path, _entry, _i, _condition, _action) \
2006 log_error("Invalid veteran definition '%s.%s[%d]'!", \
2007 _path, _entry, _i); \
2008 log_debug("Failed check: '%s'. Update value: '%s'.", \
2009 #_condition, #_action); \
2012 for (i = 0; i < count_name; i++) {
2015 (vlist_power[i] < 0), vlist_power[i] = 0);
2017 (vlist_raise[i] < 0), vlist_raise[i] = 0);
2019 (vlist_wraise[i] < 0), vlist_wraise[i] = 0);
2021 (vlist_move[i] < 0), vlist_move[i] = 0);
2025 (vlist_power[i] != 100), vlist_power[i] = 100);
2026 }
else if (i == count_name - 1) {
2029 (vlist_power[i] < vlist_power[i - 1]),
2030 vlist_power[i] = vlist_power[i - 1]);
2032 (vlist_raise[i] != 0), vlist_raise[i] = 0);
2034 (vlist_wraise[i] != 0), vlist_wraise[i] = 0);
2038 (vlist_power[i] < vlist_power[i - 1]),
2039 vlist_power[i] = vlist_power[i - 1]);
2041 (vlist_raise[i] > 100), vlist_raise[i] = 100);
2043 (vlist_wraise[i] > 100), vlist_wraise[i] = 100);
2047 vlist_move[i], vlist_raise[i],
2050#undef rs_sanity_veteran
2080 struct section_list *sec, *csec;
2081 const char *sval, **slist;
2090 "Error loading the default veteran system: %s",
2096 nval = (NULL != sec ? section_list_size(sec) : 0);
2099 nval = (NULL != csec ? section_list_size(csec) : 0);
2104 const char *sec_name =
section_name(section_list_get(csec, i));
2114 "%s.hp_loss_pct", sec_name)) {
2121 "%s.non_native_def_pct",
2125 const char *hut_str;
2128 "%s.hut_behavior", sec_name);
2130 uc->rscompat_cache_from_3_0.hut_behavior =
HUT_NORMAL;
2132 uc->rscompat_cache_from_3_0.hut_behavior =
HUT_NOTHING;
2134 uc->rscompat_cache_from_3_0.hut_behavior =
HUT_FRIGHTEN;
2137 "\"%s\" unit_class \"%s\":"
2138 " Illegal hut behavior \"%s\".",
2148 for (j = 0; j < nval; j++) {
2150 if (strcmp(sval,
"") == 0) {
2154 if (!unit_class_flag_id_is_valid(ival)) {
2158 if (unit_type_flag_id_is_valid(ival)) {
2160 "\"%s\" unit_class \"%s\": unit_type flag \"%s\"!",
2164 "\"%s\" unit_class \"%s\": bad flag name \"%s\".",
2186 const struct section *psection = section_list_get(sec, i);
2189 if (!
lookup_tech(file, &u->require_advance, sec_name,
2190 "tech_req", filename,
2195 if (u->require_advance ==
A_NEVER) {
2197 "%s lacks valid tech_req.",
2218 char tmp[200] =
"\0";
2224 if (need_government == NULL) {
2229 VUT_GOVERNMENT, REQ_RANGE_PLAYER,
2235 msg,
sizeof(msg),
compat)) {
2237 "Error loading the veteran system: %s",
2244 &u->obsoleted_by, filename,
2247 &u->converted_to, filename,
2252 u->convert_time = 1;
2253 lookup_time(file, &u->convert_time, sec_name,
"convert_time",
2263 const char *sec_name =
section_name(section_list_get(sec, i));
2273 &impr_req, filename,
2280 VUT_IMPROVEMENT, REQ_RANGE_CITY,
2289 "\"%s\" unit_type \"%s\": bad class \"%s\".",
2321 "%s.build_cost", sec_name)
2323 "%s.pop_cost", sec_name)
2325 "%s.attack", sec_name)
2327 "%s.defense", sec_name)
2329 "%s.move_rate", sec_name)
2331 "%s.vision_radius_sq", sec_name)
2333 "%s.transport_cap", sec_name)
2335 "%s.hitpoints", sec_name)
2337 "%s.firepower", sec_name)
2339 "%s.fuel", sec_name)
2341 "%s.uk_happy", sec_name)) {
2348 if (u->firepower <= 0) {
2350 "\"%s\" unit_type \"%s\":"
2352 " but must be at least 1. "
2353 " If you want no attack ability,"
2354 " set the unit's attack strength to 0.",
2369 if (u->transport_capacity > 0) {
2372 "\"%s\" unit type \"%s\" "
2373 "has transport_cap %d, but no cargo unit classes.",
2381 "\"%s\" unit type \"%s\" "
2382 "has cargo defined, but transport_cap is 0.",
2390 for (j = 0; j < nval; j++) {
2395 "\"%s\" unit_type \"%s\":"
2396 "has unknown unit class %s as cargo.",
2412 for (j = 0; j < nval; j++) {
2417 "\"%s\" unit_type \"%s\":"
2418 "has unknown unit class %s as target.",
2434 for (j = 0; j < nval; j++) {
2439 "\"%s\" unit_type \"%s\":"
2440 "has unknown unit class %s as embarkable.",
2456 for (j = 0; j < nval; j++) {
2461 "\"%s\" unit_type \"%s\":"
2462 "has unknown unit class %s as disembarkable.",
2489 if (!vision_layer_is_valid(u->vlayer)) {
2491 "\"%s\" unit_type \"%s\":"
2492 "has unknown vision layer %s.",
2501 0,
"%s.paratroopers_range", sec_name);
2503 u->rscompat_cache.paratroopers_mr_req
2505 file, 0,
"%s.paratroopers_mr_req", sec_name);
2506 u->rscompat_cache.paratroopers_mr_sub
2508 file, 0,
"%s.paratroopers_mr_sub", sec_name);
2510 u->rscompat_cache.paratroopers_mr_req = 0;
2511 u->rscompat_cache.paratroopers_mr_sub = 0;
2514 "%s.bombard_rate", sec_name);
2516 "%s.city_slots", sec_name);
2518 "%s.city_size", sec_name);
2521 "%s.tp_defense", sec_name);
2522 u->tp_defense = transp_def_type_by_name(sval,
fc_strcasecmp);
2523 if (!transp_def_type_is_valid(u->tp_defense)) {
2525 "\"%s\" unit_type \"%s\":"
2526 " bad tp_defense \"%s\".",
2544 for (j = 0; j < nval; j++) {
2546 if (0 == strcmp(sval,
"")) {
2550 u->vlayer = V_INVIS;
2554 if (!unit_type_flag_id_is_valid(ival)) {
2557 if (unit_class_flag_id_is_valid(ival)) {
2559 "\"%s\" unit_type \"%s\": unit_class flag!",
2563 "\"%s\" unit_type \"%s\": bad flag name \"%s\".",
2590 for (j = 0; j < nval; j++) {
2592 if (strcmp(sval,
"") == 0) {
2596 if (!unit_role_id_is_valid(ival)) {
2598 "\"%s\" unit_type \"%s\": bad role name \"%s\".",
2616 "\"%s\" unit_type \"%s\": depends on removed tech \"%s\".",
2626 section_list_destroy(csec);
2627 section_list_destroy(sec);
2643 struct section_list *sec;
2657 if (NULL == sec || 0 == (nval = section_list_size(sec))) {
2659 "\"%s\": No improvements?!?", filename);
2662 log_verbose(
"%d improvement types (including possibly unused)", nval);
2665 "\"%s\": Too many improvements (%d, max %d)",
2674 for (i = 0; i < nval; i++) {
2684 section_list_destroy(sec);
2695 struct section_list *sec;
2702 nval = (NULL != sec ? section_list_size(sec) : 0);
2704 for (i = 0; i < nval && ok; i++) {
2706 const char *sec_name =
section_name(section_list_get(sec, i));
2707 struct requirement_vector *
reqs =
2715 const char *sval, **slist;
2721 if (!impr_genus_id_is_valid(b->
genus)) {
2723 "\"%s\" improvement \"%s\": couldn't match "
2724 "genus \"%s\".", filename,
2733 for (j = 0; j < nflags; j++) {
2735 if (strcmp(sval,
"") == 0) {
2739 if (!impr_flag_id_is_valid(ival)) {
2741 "\"%s\" improvement \"%s\": bad flag name \"%s\".",
2755 requirement_vector_copy(&b->
reqs,
reqs);
2758 struct requirement_vector *obs_reqs =
2762 if (obs_reqs == NULL) {
2766 requirement_vector_copy(&b->
obsolete_by, obs_reqs);
2771 "%s.build_cost", sec_name)
2773 "%s.upkeep", sec_name)
2775 "%s.sabotage", sec_name)) {
2783 "%s.graphic", sec_name));
2786 "%s.graphic_alt", sec_name));
2790 "%s.sound", sec_name));
2793 "%s.sound_alt", sec_name));
2798 section_list_destroy(sec);
2814 struct section_list *sec = NULL;
2834 != terrain_flag_id_invalid()) {
2836 "\"%s\": Duplicate terrain flag name '%s'",
2843 "\"%s\": Too many user terrain flags!",
2862 "control.extra_flags%d.name",
2866 "control.extra_flags%d.helptxt", i);
2869 != extra_flag_id_invalid()) {
2871 "\"%s\": Duplicate extra flag name '%s'",
2878 "\"%s\": Too many user extra flags!",
2896 if (NULL == sec || 0 == (nval = section_list_size(sec))) {
2898 "\"%s\": ruleset doesn't have any terrains.",
2904 "\"%s\": Too many terrains (%d, max %d)",
2922 const char *sec_name =
section_name(section_list_get(sec, terri));
2933 section_list_destroy(sec);
2940 nval = (NULL != sec ? section_list_size(sec) : 0);
2943 "\"%s\": Too many extra types (%d, max %d)",
2960 for (idx = 0; idx < nval; idx++) {
2961 const char *sec_name =
section_name(section_list_get(sec, idx));
2973 section_list_destroy(sec);
2980 nval = (NULL != sec ? section_list_size(sec) : 0);
2983 "\"%s\": Too many base types (%d, max %d)",
3001 for (idx = 0; idx < nval; idx++) {
3002 const char *sec_name =
section_name(section_list_get(sec, idx));
3005 if (base_name != NULL) {
3008 if (pextra != NULL) {
3013 "No extra definition matching base definition \"%s\"",
3019 "Base section \"%s\" does not associate base with any extra",
3026 section_list_destroy(sec);
3033 nval = (NULL != sec ? section_list_size(sec) : 0);
3036 "\"%s\": Too many road types (%d, max %d)",
3054 for (idx = 0; idx < nval; idx++) {
3055 const char *sec_name =
section_name(section_list_get(sec, idx));
3058 if (road_name != NULL) {
3061 if (pextra != NULL) {
3066 "No extra definition matching road definition \"%s\"",
3072 "Road section \"%s\" does not associate road with any extra",
3079 section_list_destroy(sec);
3086 nval = (NULL != sec ? section_list_size(sec) : 0);
3089 "\"%s\": Too many resource types (%d, max %d)",
3107 for (idx = 0; idx < nval; idx++) {
3108 const char *sec_name =
section_name(section_list_get(sec, idx));
3109 const char *resource_name;
3114 if (resource_name != NULL) {
3117 if (pextra != NULL) {
3122 "No extra definition matching resource definition \"%s\"",
3128 "Resource section %s does not list extra this resource belongs to.",
3135 section_list_destroy(sec);
3148 bool compat_road =
FALSE;
3149 bool compat_rail =
FALSE;
3150 bool compat_river =
FALSE;
3160 "parameters.ocean_reclaim_requirement");
3163 "parameters.land_channel_requirement");
3166 "parameters.thaw_requirement");
3169 "parameters.freeze_requirement");
3172 "parameters.lake_max_size");
3175 "parameters.min_start_native_area");
3178 "parameters.move_fragments");
3181 "\"%s\": move_fragments must be at least 1",
3188 "parameters.igter_cost");
3191 "\"%s\": igter_cost must be at least 1",
3200 "parameters.pythagorean_diagonal");
3204 "parameters.ocean_resources");
3207 N_(
"?gui_type:Build Type A Base"),
3208 "extraui.ui_name_base_fortress");
3212 N_(
"?gui_type:Build Type B Base"),
3213 "extraui.ui_name_base_airbase");
3230 pterrain->identifier
3232 if (
'\0' == pterrain->identifier) {
3234 "\"%s\" [%s] identifier missing value.",
3235 filename, tsection);
3241 "\"%s\" [%s] cannot use '%c' as an identifier;"
3242 " it is reserved for unknown terrain.",
3243 filename, tsection, pterrain->identifier);
3247 for (j =
T_FIRST; j < i; j++) {
3250 "\"%s\" [%s] has the same identifier as [%s].",
3263 pterrain->tclass = terrain_class_by_name(cstr,
fc_strcasecmp);
3264 if (!terrain_class_is_valid(pterrain->tclass)) {
3266 "\"%s\": [%s] unknown class \"%s\"",
3267 filename, tsection, cstr);
3273 "%s.movement_cost", tsection)
3275 "%s.defense_bonus", tsection)) {
3288 pterrain->resources =
fc_calloc(nval + 1,
sizeof(*pterrain->resources));
3289 for (j = 0; j < nval; j++) {
3291 if (pterrain->resources[j] == NULL) {
3296 pterrain->resources[nval] = NULL;
3305 pterrain->road_output_incr_pct[o]
3310 if (!
lookup_time(file, &pterrain->base_time, tsection,
"base_time",
3311 filename, NULL, &ok)
3312 || !
lookup_time(file, &pterrain->road_time, tsection,
"road_time",
3313 filename, NULL, &ok)) {
3319 if (!
lookup_terrain(file,
"cultivate_result", filename, pterrain,
3320 &pterrain->cultivate_result,
FALSE)) {
3321 if (
compat->compat_mode) {
3322 if (!
lookup_terrain(file,
"irrigation_result", filename, pterrain,
3323 &pterrain->cultivate_result,
TRUE)) {
3333 if (!
compat->compat_mode && pterrain->cultivate_result == pterrain) {
3335 "%s: Cultivating result in terrain itself.",
3341 "%s.irrigation_food_incr", tsection)
3343 tsection,
"irrigation_time", filename, NULL, &ok)) {
3350 &pterrain->plant_result,
FALSE)) {
3351 if (
compat->compat_mode) {
3353 &pterrain->plant_result,
TRUE)) {
3363 if (!
compat->compat_mode && pterrain->plant_result == pterrain) {
3365 "%s: Planting result in terrain itself.",
3371 "%s.mining_shield_incr", tsection)
3373 tsection,
"mining_time", filename, NULL, &ok)) {
3380 tsection,
"cultivate_time", filename, NULL, &ok)) {
3381 if (
compat->compat_mode) {
3382 if (pterrain->cultivate_result != pterrain) {
3383 if (pterrain->cultivate_result == NULL && pterrain->irrigation_time != 0) {
3387 if (
compat->log_cb != NULL) {
3391 "Changed %s cultivate_time to zero, as it inconsistently had "
3392 "irrigation_result \"no\" and nonzero irrigation_time.",
3396 pterrain->cultivate_time = 0;
3398 pterrain->cultivate_time = pterrain->irrigation_time;
3400 pterrain->irrigation_time = 0;
3402 pterrain->cultivate_time = 0;
3403 pterrain->cultivate_result = NULL;
3407 "%s: Missing cultivate_time", tsection);
3412 if ((pterrain->cultivate_result != NULL
3413 && pterrain->cultivate_time <= 0)
3414 || (pterrain->cultivate_result == NULL
3415 && pterrain->cultivate_time > 0)) {
3417 "%s: cultivate_result and cultivate_time disagree "
3418 "whether cultivating is enabled", tsection);
3424 tsection,
"plant_time", filename, NULL, &ok)) {
3425 if (
compat->compat_mode) {
3426 if (pterrain->plant_result != pterrain) {
3427 if (pterrain->plant_result == NULL && pterrain->mining_time != 0) {
3431 if (
compat->log_cb != NULL) {
3435 "Changed %s plant_time to zero, as it inconsistently had "
3436 "mining_result \"no\" and nonzero mining_time.",
3440 pterrain->plant_time = 0;
3442 pterrain->plant_time = pterrain->mining_time;
3444 pterrain->mining_time = 0;
3446 pterrain->plant_time = 0;
3447 pterrain->plant_result = NULL;
3456 if ((pterrain->plant_result != NULL
3457 && pterrain->plant_time <= 0)
3458 || (pterrain->plant_result == NULL
3459 && pterrain->plant_time > 0)) {
3461 "%s: plant_result and plant_time disagree "
3462 "whether planting is enabled", tsection);
3468 &pterrain->animal, filename,
3474 if (!
lookup_terrain(file,
"transform_result", filename, pterrain,
3475 &pterrain->transform_result,
TRUE)) {
3480 tsection,
"transform_time", filename, NULL, &ok)) {
3486 if (pterrain->transform_time <= 0) {
3490 pterrain->transform_result = NULL;
3491 }
else if (pterrain->transform_result == NULL) {
3492 pterrain->transform_time = 0;
3495 if ((pterrain->transform_result != NULL
3496 && pterrain->transform_time <= 0)
3497 || (pterrain->transform_result == NULL
3498 && pterrain->transform_time > 0)) {
3500 "%s: transform_result and transform_time disagree "
3501 "whether transforming is enabled", tsection);
3506 pterrain->placing_time = 1;
3508 tsection,
"placing_time", filename, NULL, &ok);
3510 pterrain->pillage_time = 1;
3512 tsection,
"pillage_time", filename, NULL, &ok);
3513 pterrain->clean_pollution_time = 3;
3514 lookup_time(file, &pterrain->clean_pollution_time,
3515 tsection,
"clean_pollution_time", filename, NULL, &ok);
3516 pterrain->clean_fallout_time = 3;
3518 tsection,
"clean_fallout_time", filename, NULL, &ok);
3520 if (!
lookup_terrain(file,
"warmer_wetter_result", filename, pterrain,
3521 &pterrain->warmer_wetter_result,
TRUE)
3522 || !
lookup_terrain(file,
"warmer_drier_result", filename, pterrain,
3523 &pterrain->warmer_drier_result,
TRUE)
3524 || !
lookup_terrain(file,
"cooler_wetter_result", filename, pterrain,
3525 &pterrain->cooler_wetter_result,
TRUE)
3526 || !
lookup_terrain(file,
"cooler_drier_result", filename, pterrain,
3527 &pterrain->cooler_drier_result,
TRUE)) {
3534 for (j = 0; j < nval; j++) {
3535 const char *sval = slist[j];
3536 enum terrain_flag_id flag
3539 if (!terrain_flag_id_is_valid(flag)) {
3541 "\"%s\" [%s] has unknown flag \"%s\".",
3542 filename, tsection, sval);
3546 BV_SET(pterrain->flags, flag);
3556 enum mapgen_terrain_property mtp;
3557 for (mtp = mapgen_terrain_property_begin();
3558 mtp != mapgen_terrain_property_end();
3559 mtp = mapgen_terrain_property_next(mtp)) {
3560 pterrain->property[mtp]
3562 mapgen_terrain_property_name(mtp));
3568 for (j = 0; j < nval; j++) {
3573 "\"%s\" [%s] is native to unknown unit class \"%s\".",
3574 filename, tsection, slist[j]);
3590 if (!
rgbcolor_load(file, &pterrain->rgb,
"%s.color", tsection)) {
3592 "Missing terrain color definition: %s",
3599 pterrain->helptext =
lookup_strvec(file, tsection,
"helptext");
3612 struct requirement_vector *
reqs;
3613 const char *catname;
3615 enum extra_cause cause;
3616 enum extra_rmcause rmcause;
3617 const char *eus_name;
3618 const char *vis_req_name;
3619 const struct advance *vis_req;
3622 if (catname == NULL) {
3624 "\"%s\" extra \"%s\" has no category.",
3629 pextra->category = extra_category_by_name(catname,
fc_strcasecmp);
3630 if (!extra_category_is_valid(pextra->category)) {
3632 "\"%s\" extra \"%s\" has invalid category \"%s\".",
3640 for (cj = 0; cj < nval; cj++) {
3641 const char *sval = slist[cj];
3645 if (!extra_cause_is_valid(cause)) {
3647 "\"%s\" extra \"%s\": unknown cause \"%s\".",
3652 pextra->causes |= (1 << cause);
3657 if (pextra->causes == 0) {
3673 pextra->rmcauses = 0;
3674 for (j = 0; j < nval; j++) {
3675 const char *sval = slist[j];
3679 if (!extra_rmcause_is_valid(rmcause)) {
3681 "\"%s\" extra \"%s\": unknown rmcause \"%s\".",
3686 pextra->rmcauses |= (1 << rmcause);
3707 "%s.rmact_gfx_alt",
section));
3719 requirement_vector_copy(&pextra->reqs,
reqs);
3726 requirement_vector_copy(&pextra->rmreqs,
reqs);
3733 requirement_vector_copy(&pextra->appearance_reqs,
reqs);
3740 requirement_vector_copy(&pextra->disappearance_reqs,
reqs);
3748 pextra->build_time = 0;
3752 "%s.build_time_factor",
section);
3753 pextra->removal_time = 0;
3757 "%s.removal_time_factor",
section);
3760 if (pextra->infracost > 0) {
3767 if (pextra->defense_bonus != 0) {
3776 pextra->eus = extra_unit_seen_type_by_name(eus_name,
fc_strcasecmp);
3777 if (!extra_unit_seen_type_is_valid(pextra->eus)) {
3779 "\"%s\" extra \"%s\" has illegal unit_seen value \"%s\".",
3784 if (pextra->eus == EUS_HIDDEN) {
3789 "%s.appearance_chance",
3793 "%s.disappearance_chance",
3798 for (j = 0; j < nval; j++) {
3801 if (uclass == NULL) {
3803 "\"%s\" extra \"%s\" is native to unknown unit class \"%s\".",
3819 for (j = 0; j < nval; j++) {
3820 const char *sval = slist[j];
3821 enum extra_flag_id flag = extra_flag_id_by_name(sval,
fc_strcasecmp);
3823 if (!extra_flag_id_is_valid(flag)) {
3825 "\"%s\" extra \"%s\": unknown flag \"%s\".",
3830 BV_SET(pextra->flags, flag);
3844 for (j = 0; j < nval; j++) {
3845 const char *sval = slist[j];
3848 if (pextra2 == NULL) {
3850 "\"%s\" extra \"%s\": unknown conflict extra \"%s\".",
3868 for (j = 0; j < nval; j++) {
3869 const char *sval = slist[j];
3874 "\"%s\" extra \"%s\" hidden by unknown extra \"%s\".",
3890 for (j = 0; j < nval; j++) {
3891 const char *sval = slist[j];
3896 "\"%s\" extra \"%s\" bridged over unknown extra \"%s\".",
3911 "%s.visibility_req",
section);
3914 if (vis_req == NULL) {
3916 "\"%s\" %s: unknown visibility_req %s.",
3917 filename,
section, vis_req_name);
3938 if (!presource->data.resource) {
3940 "\"%s\" extra \"%s\" has \"Resource\" cause but no "
3941 "corresponding [resource_*] section",
3948 presource->data.resource->output[o] =
3955 presource->data.resource->id_old_save = identifier[0];
3958 "\"%s\" [%s] identifier missing value.",
3959 filename, rsection);
3965 "\"%s\" [%s] cannot use '%c' as an identifier;"
3967 filename, rsection, presource->data.resource->id_old_save);
3986 "\"%s\" resource section [%s]: extra \"%s\" does not "
3987 "have \"Resource\" in its causes",
3988 filename,
section, extra_name);
4000 if (pres->data.resource->id_old_save == pres2->data.resource->id_old_save
4003 "\"%s\" [%s] has the same identifier as [%s].",
4023 const char *gui_str;
4027 "\"%s\" extra \"%s\" has \"Base\" cause but no "
4028 "corresponding [base_*] section",
4037 if (!base_gui_type_is_valid(pbase->
gui_type)) {
4039 "\"%s\" base \"%s\": unknown gui_type \"%s\".",
4048 "%s.vision_main_sq",
4051 "%s.vision_invis_sq",
4054 "%s.vision_subs_sq",
4057 if (
compat->compat_mode) {
4062 for (bj = 0; bj < nval; bj++) {
4063 const char *sval = slist[bj];
4067 "\"%s\" base \"%s\": unknown flag \"%s\".",
4072 if (!
BV_ISSET(pextra->flags, EF_NOT_AGGRESSIVE)) {
4074 BV_SET(pextra->flags, EF_NOT_AGGRESSIVE);
4093 if (pextra == pextra2) {
4114 "\"%s\" base section [%s]: extra \"%s\" does not have "
4115 "\"Base\" in its causes",
4116 filename,
section, extra_name);
4123 bv_extras compat_bridged;
4125 if (
compat->compat_mode) {
4134 for (j = 0; j < nval; j++) {
4136 BV_SET(compat_bridged, pextra->id);
4145 const char *special;
4146 const char *modestr;
4147 struct requirement_vector *
reqs;
4148 const char *gui_str;
4152 "\"%s\" extra \"%s\" has \"Road\" cause but no "
4153 "corresponding [road_*] section",
4177 if (!road_move_mode_is_valid(proad->
move_mode)) {
4179 "Illegal move_mode \"%s\" for road \"%s\"",
4201 "Multiple roads marked as compatibility \"Road\"");
4209 "Multiple roads marked as compatibility \"Railroad\"");
4217 "Multiple roads marked as compatibility \"River\"");
4220 compat_river =
TRUE;
4226 "Illegal compatibility special \"%s\" for road %s",
4236 if (gui_str == NULL) {
4241 "\"%s\" road \"%s\": no gui_type.",
4248 if (!road_gui_type_is_valid(proad->
gui_type)) {
4250 "\"%s\" road \"%s\": unknown gui_type \"%s\".",
4259 for (j = 0; j < nval; j++) {
4260 const char *sval = slist[j];
4264 if (textra != NULL) {
4270 "\"%s\" road \"%s\" integrates with unknown road \"%s\".",
4286 for (j = 0; j < nval; j++) {
4287 const char *sval = slist[j];
4293 if (
BV_ISSET(compat_bridged, pbridged->id)) {
4294 BV_SET(pextra->bridged_over, pbridged->id);
4298 enum road_flag_id flag = road_flag_id_by_name(sval,
fc_strcasecmp);
4300 if (!road_flag_id_is_valid(flag)) {
4302 "\"%s\" road \"%s\": unknown flag \"%s\".",
4325 "\"%s\" road section [%s]: extra \"%s\" does not have "
4326 "\"Road\" in its causes",
4327 filename,
section, extra_name);
4335 pextra->bridged = extra_type_list_new();
4337 if (
BV_ISSET(pextra->bridged_over, pbridged->id)) {
4338 extra_type_list_append(pextra->bridged, pbridged);
4359 struct section_list *sec;
4371 if (NULL == sec || 0 == (nval = section_list_size(sec))) {
4374 }
else if (nval >
G_LAST) {
4376 "\"%s\": Too many governments (%d, max %d)",
4387 const char *sec_name =
4397 section_list_destroy(sec);
4401 nval = (NULL != sec ? section_list_size(sec) : 0);
4405 "\"%s\": Too many multipliers (%d, max %d)",
4415 const char *sec_name =
4420 "\"%s\": Cannot load multiplier names",
4429 section_list_destroy(sec);
4440 struct section_list *sec;
4459 const char *sec_name =
section_name(section_list_get(sec, i));
4460 struct requirement_vector *
reqs =
4473 if (g->ai.better == NULL) {
4478 g->ai.better = NULL;
4480 requirement_vector_copy(&g->reqs,
reqs);
4495 const char *sec_name =
4497 const char *male, *female;
4503 "Lack of default ruler titles for "
4504 "government \"%s\" (nb %d): %s",
4511 "Lack of default ruler titles for "
4512 "government \"%s\" (nb %d).",
4520 section_list_destroy(sec);
4526 const char *sec_name =
section_name(section_list_get(sec,
id));
4527 struct requirement_vector *
reqs;
4539 if (pmul->stop <= pmul->start) {
4541 "Multiplier \"%s\" stop (%d) must be greater "
4543 pmul->stop, pmul->start);
4552 if (((pmul->stop - pmul->start) % pmul->step) != 0) {
4554 "Multiplier \"%s\" step (%d) does not fit "
4555 "exactly into interval start-stop (%d to %d)",
4557 pmul->start, pmul->stop);
4566 if (pmul->def < pmul->start || pmul->def > pmul->stop) {
4568 "Multiplier \"%s\" default (%d) not within "
4570 pmul->def, pmul->start, pmul->stop);
4574 if (((pmul->def - pmul->start) % pmul->step) != 0) {
4576 "Multiplier \"%s\" default (%d) not legal "
4577 "with respect to step size %d",
4583 "%s.offset", sec_name);
4585 "%s.factor", sec_name);
4586 if (pmul->factor == 0) {
4588 "Multiplier \"%s\" scaling factor must "
4604 requirement_vector_copy(&pmul->reqs,
reqs);
4608 section_list_destroy(sec);
4645 while (desc_left > 0) {
4647 int this_len = desc_left;
4653 part.text[this_len] =
'\0';
4657 desc_left -= this_len;
4674 if (prev_leader == pleader) {
4691 struct section_list *sec;
4706 "No available nations in this ruleset!");
4710 "Too many nations (max %d, we have %d)!",
4719 const char *sec_name =
section_name(section_list_get(sec, i));
4721 "%s.translation_domain", sec_name);
4723 "%s.plural", sec_name);
4726 if (domain == NULL) {
4727 domain =
"freeciv-nations";
4730 if (!strcmp(
"freeciv-core", domain)) {
4731 pl->translation_domain = NULL;
4733 && !strcmp(
"freeciv", domain)) {
4734 pl->translation_domain = NULL;
4735 }
else if (!strcmp(
"freeciv-nations", domain)) {
4736 pl->translation_domain =
fc_strdup(domain);
4739 "Unsupported translation domain \"%s\" for %s",
4749 name_set(&pl->noun_plural, pl->translation_domain, noun_plural);
4752 for (j = 0; j < i && ok; j++) {
4761 "Two nations defined with the same adjective \"%s\": "
4762 "in section \'%s\' and section \'%s\'",
4771 "Two nations defined with the same rule_name \"%s\": "
4772 "in section \'%s\' and section \'%s\'",
4780 "Two nations defined with the same plural name \"%s\": "
4781 "in section \'%s\' and section \'%s\'",
4793 section_list_destroy(sec);
4811 if (pgroup == NULL) {
4816 section_list_destroy(sec);
4831 for (i = 0; i <
len; i++) {
4845 const char *secfile_str1,
4846 const char *secfile_str2,
4847 const char **allowed_terrains,
4853 secfile_str1, secfile_str2);
4860 for (j = 0; j < dim; j++) {
4862 char city_name[
len + 1], *p, *next, *end;
4872 if ((p = strchr(city_name,
'('))) {
4875 if (!(end = strchr(p,
')'))) {
4877 "\"%s\" [%s] %s: city name \"%s\" "
4879 secfile_str1, secfile_str2,
cities[j]);
4882 for (*end++ =
'\0';
'\0' != *end; end++) {
4885 "\"%s\" [%s] %s: city name \"%s\" "
4886 "contains characters after last parenthesis.",
4902 "\"%s\" [%s] %s: city name \"%s\" is too long.",
4904 secfile_str1, secfile_str2, city_name);
4915 if ((next = strchr(p,
','))) {
4935 "\"%s\" [%s] %s: city \"%s\" "
4936 "has terrain hint \"%s\" not in allowed_terrains.",
4946 if (NULL == pterrain) {
4948 size_t l = strlen(p);
4951 char saved = p[l - 1];
4955 if (pterrain == NULL) {
4972 "\"%s\" [%s] %s: city \"%s\" "
4973 "has terrain hint \"%s\" not in allowed_terrains.",
4979 }
else if (!pterrain) {
4985 "\"%s\" [%s] %s: city \"%s\" "
4986 "has unknown terrain hint \"%s\".",
4993 if (NULL != pterrain) {
4998 p = next ? next + 1 : NULL;
4999 }
while (NULL != p &&
'\0' != *p);
5021 const char *
name, *bad_leader;
5025 struct section_list *sec = NULL;
5034 "ruledit.embedded_nations");
5051 for (tr = trait_begin(); tr != trait_end(); tr = trait_next(tr)) {
5066 "Default values for trait %s not sane.",
5075 "compatibility.allowed_govs");
5091 "compatibility.allowed_terrains");
5107 "compatibility.allowed_styles");
5123 "compatibility.default_government");
5131 "Tried to set unknown government type \"%s\" as default_government!",
5147 const char *set_name, *set_rule_name, *set_description;
5154 if (NULL == set_name || NULL == set_rule_name) {
5159 if (
nation_set_new(set_name, set_rule_name, set_description) == NULL) {
5164 section_list_destroy(sec);
5169 "must be defined.");
5177 "compatibility.default_nationset");
5184 "Unknown default_nationset \"%s\".", sval);
5207 if (pgroup == NULL) {
5223 section_list_destroy(sec);
5233 char tmp[200] =
"\0";
5235 const char *sec_name =
section_name(section_list_get(sec, i));
5239 if (default_set >= 0) {
5240 nation_set_list_append(pnation->sets,
5244 for (j = 0; j < dim; j++) {
5248 fc_assert(pset == NULL || pgroup == NULL);
5251 nation_set_list_append(pnation->sets, pset);
5252 }
else if (NULL != pgroup) {
5253 nation_group_list_append(pnation->groups, pgroup);
5259 log_verbose(
"Nation %s: Unknown set/group \"%s\".",
5266 if (nation_set_list_size(pnation->sets) < 1) {
5268 "Nation %s is not a member of any nation set",
5276 for (j = 0; j < dim; j++) {
5279 if (pnation == pconflict) {
5281 "Nation %s conflicts with itself",
5285 }
else if (NULL != pconflict) {
5286 nation_list_append(pnation->server.conflicts_with, pconflict);
5292 log_verbose(
"Nation %s: conflicts_with nation \"%s\" is unknown.",
5306 bool is_male =
FALSE;
5319 "Nation %s: leader name \"%s\" is too long.",
5335 "Nation %s: leader \"%s\" has unsupported "
5336 "sex variant \"%s\".",
5355 "Nation %s: Too many leaders; max is %d",
5359 }
else if (0 == j) {
5361 "Nation %s: no leaders; at least one is required.",
5370 "Nation %s: leader \"%s\" defined more than once.",
5378 (void)
rgbcolor_load(file, &pnation->server.rgb,
"%s.color", sec_name);
5382 for (tr = trait_begin(); tr != trait_end(); tr = trait_next(tr)) {
5383 bool server_traits_used =
TRUE;
5385 if (pnation->server.traits[tr].min < 0) {
5388 server_traits_used =
FALSE;
5390 if (pnation->server.traits[tr].max < 0) {
5393 server_traits_used =
FALSE;
5395 if (pnation->server.traits[tr].fixed < 0) {
5396 if (server_traits_used) {
5399 int diff = pnation->server.traits[tr].max - pnation->server.traits[tr].min;
5402 pnation->server.traits[tr].fixed = diff / 2 + pnation->server.traits[tr].min;
5405 if (pnation->server.traits[tr].max < pnation->server.traits[tr].min) {
5407 "%s values for trait %s not sane.",
5418 pnation->is_playable =
5423 "%s.barbarian_type", sec_name);
5424 pnation->barb_type = barbarian_type_by_name(barb_type,
fc_strcasecmp);
5425 if (!barbarian_type_is_valid(pnation->barb_type)) {
5427 "Nation %s, barbarian_type is invalid (\"%s\")",
5433 if (pnation->barb_type != NOT_A_BARBARIAN
5434 && pnation->is_playable) {
5438 "Nation %s marked both barbarian and playable.",
5449 "%s.flag_alt", sec_name));
5453 const char *male, *female;
5456 "%s.ruler_titles%d.government",
5483 "Nation %s: government \"%s\" not in allowed_govs.",
5495 "Nation %s: government \"%s\" not found.",
5501 if (NULL != male && NULL != female) {
5523 if (pnation->style == NULL) {
5529 "Nation %s: Illegal style \"%s\"",
5534 log_verbose(
"Nation %s: style \"%s\" not supported in this "
5535 "ruleset; using default.",
5543 "%s.civilwar_nations", sec_name);
5544 for (j = 0; j < dim; j++) {
5550 if (pconflict == pnation) {
5552 "Nation %s is its own civil war nation",
5556 }
else if (NULL != pconflict) {
5557 nation_list_append(pnation->server.civilwar_nations, pconflict);
5564 log_verbose(
"Nation %s: civil war nation \"%s\" is unknown.",
5577 pnation->init_techs, filename)) {
5582 pnation->init_buildings, filename)) {
5587 pnation->init_units, filename)) {
5598 if (pnation->init_government == NULL) {
5609 "Nation %s: init_government \"%s\" not allowed.",
5629 "Nation %s: legend \"%s\" is too long.",
5636 pnation->player = NULL;
5638 section_list_destroy(sec);
5645 section_list_destroy(sec);
5658 int num_playable = 0, barb_land_count = 0, barb_sea_count = 0, barb_both_count = 0;
5663 case NOT_A_BARBARIAN:
5668 case LAND_BARBARIAN:
5674 case ANIMAL_BARBARIAN:
5677 case LAND_AND_SEA_BARBARIAN:
5685 if (num_playable < 1) {
5687 "Nation set \"%s\" has no playable nations. "
5692 if (barb_land_count == 0 && barb_both_count == 0) {
5694 "No land barbarian nation defined in set \"%s\". "
5699 if (barb_sea_count == 0 && barb_both_count == 0) {
5701 "No sea barbarian nation defined in set \"%s\". "
5720 struct section_list *sec;
5733 "No available nation styles in this ruleset!");
5742 const char *sec_name =
section_name(section_list_get(sec, i));
5748 section_list_destroy(sec);
5765 section_list_destroy(sec);
5780 struct section_list *sec;
5790 struct requirement_vector *
reqs;
5791 const char *sec_name =
section_name(section_list_get(sec, i));
5799 "%s.citizens_graphic", sec_name));
5809 section_list_destroy(sec);
5822 struct requirement_vector *
reqs;
5828 "%s.music_peaceful", sec_name));
5831 "%s.music_combat", sec_name));
5838 requirement_vector_copy(&pmus->
reqs,
reqs);
5844 section_list_destroy(sec);
5857 const char *uflags_path,
5858 const char *filename)
5863 enum unit_type_flag_id *protecor_flag;
5871 if (!protecor_flag) {
5874 "\"%s\": %s: bad unit type flag list.",
5875 filename, uflags_path);
5880 for (i = 0; i < psize; i++) {
5881 requirement_vector_append(&auto_perf->
reqs,
5888 free(protecor_flag);
5900 const char *actions_path,
5901 const char *filename)
5905 enum gen_action *unit_acts;
5910 "%s", actions_path);
5915 "\"%s\": %s: bad action list",
5916 filename, actions_path);
5921 for (i = 0; i < asize; i++) {
5937 const char *filename)
5939 char uflags_path[100];
5940 char action_path[100];
5943 "missing_unit_upkeep.%s_protected",
item);
5945 "missing_unit_upkeep.%s_unit_act",
item);
5961 struct section_list *sec;
5973 if (section_list_size(sec) >=
SP_MAX) {
5975 "\"%s\": Too many specialists (%d, max %d).",
5976 filename, section_list_size(sec),
SP_MAX);
5988 struct requirement_vector *
reqs;
5997 "%s.short_name", sec_name);
6003 "\"%s\": No graphic tag for specialist at %s.",
6004 filename, sec_name);
6011 "%s.graphic_alt", sec_name));
6018 requirement_vector_copy(&s->
reqs,
reqs);
6031 "\"%s\": must give a min_size of 0 for at least one "
6032 "specialist type.", filename);
6035 section_list_destroy(sec);
6043 "parameters.celebrate_size_limit");
6048 "parameters.angry_citizens");
6061 "\"%s\": Forced taxes do not add up in ruleset!",
6071 "parameters.vision_reveal_tiles");
6079 "citizen.nationality");
6082 "citizen.convert_speed");
6095 auto_perf->
cause = AAPC_UNIT_UPKEEP;
6098 requirement_vector_append(&auto_perf->
reqs,
6110 "missing_unit_upkeep.food_wipe");
6114 auto_perf->
cause = AAPC_UNIT_UPKEEP;
6117 requirement_vector_append(&auto_perf->
reqs,
6129 "missing_unit_upkeep.gold_wipe");
6133 auto_perf->
cause = AAPC_UNIT_UPKEEP;
6136 requirement_vector_append(&auto_perf->
reqs,
6148 "missing_unit_upkeep.shield_wipe");
6164 struct section_list *sec;
6166 const char *filename;
6181 enum effect_type eff;
6186 struct requirement_vector *
reqs;
6192 "\"%s\" [%s] missing effect type.", filename, sec_name);
6202 if (!effect_type_is_valid(eff)) {
6204 "\"%s\" [%s] lists unknown effect type \"%s\".",
6205 filename, sec_name,
type);
6213 const char *multiplier_name
6216 if (multiplier_name) {
6220 "\"%s\" [%s] has unknown multiplier \"%s\".",
6221 filename, sec_name, multiplier_name);
6243 section_list_destroy(sec);
6256 int def,
int min,
int max,
6257 const char *path, ...)
6260 int def,
int min,
int max,
6261 const
char *path, ...)
6267 va_start(args, path);
6277 "\"%s\" should be in the interval [%d, %d] "
6278 "but is %d; using the minimal value.",
6279 fullpath, min, max, ival);
6285 "\"%s\" should be in the interval [%d, %d] "
6286 "but is %d; using the maximal value.",
6287 fullpath, min, max, ival);
6299 const char *compat_name)
6304 if (compat_name != NULL) {
6306 "actions.%s", compat_name);
6325 if (vname != NULL) {
6326 struct entry *pentry;
6331 if (pentry == NULL) {
6334 if (compat_name != NULL) {
6340 if (pentry == NULL) {
6381 if (vname != NULL) {
6436 const char *filename,
6442 char fullpath[1024];
6444 fc_snprintf(fullpath,
sizeof(fullpath),
"actions.%s",
6448 enum gen_action *blocking_actions;
6455 if (!blocking_actions) {
6458 "\"%s\": %s: bad action list",
6459 filename, fullpath);
6464 for (j = 0; j < asize; j++) {
6468 free(blocking_actions);
6480 const char *filename,
6485 char action_list_path[100];
6493 auto_perf->
cause = AAPC_POST_ACTION;
6496 requirement_vector_append(&auto_perf->
reqs,
6502 fc_snprintf(action_list_path,
sizeof(action_list_path),
6506 action_list_path, filename)) {
6517 const char *filename,
6522 enum gen_action *listed_actions;
6529 if (!listed_actions) {
6537 for (j = 0; j < asize; j++) {
6538 BV_SET(*target, listed_actions[j]);
6541 free(listed_actions);
6553 const char *sval, **svec;
6554 const char *filename;
6558 const char *pref_text;
6560 struct section_list *sec;
6577 if (pref_text[0] !=
'\0') {
6579 " Use correct spelling tileset.preferred instead");
6582 if (pref_text[0] !=
'\0') {
6592 if (pref_text[0] !=
'\0') {
6594 " Use correct spelling soundset.preferred instead");
6597 if (pref_text[0] !=
'\0') {
6607 if (pref_text[0] !=
'\0') {
6609 " Use correct spelling musicset.preferred instead");
6612 if (pref_text[0] !=
'\0') {
6626 if (pref_text[0] !=
'\0') {
6635 if (pref_text[0] !=
'\0') {
6644 if (pref_text[0] !=
'\0') {
6648 len = strlen(pref_text);
6660 if (pref_text[0] !=
'\0') {
6664 len = strlen(pref_text);
6678 if (pref_text[0] !=
'\0') {
6679 int len = strlen(pref_text);
6706 "options.popup_tech_help");
6711 "civstyle.base_pollution");
6716 for (j = 0; j < nval; j++) {
6717 enum gameloss_style style;
6720 if (strcmp(sval,
"") == 0) {
6724 if (!gameloss_style_is_valid(style)) {
6726 "\"%s\": bad value \"%s\" for gameloss_style.",
6743 "civstyle.happy_cost");
6749 "civstyle.food_cost");
6755 "civstyle.civil_war_bonus_celebrating");
6759 "civstyle.civil_war_bonus_unhappy");
6766 "civstyle.base_bribe_cost");
6772 "civstyle.ransom_gold");
6775 "civstyle.pillage_select");
6779 "civstyle.tech_steal_allow_holes");
6782 "civstyle.tech_trade_allow_holes");
6785 "civstyle.tech_trade_loss_allow_holes");
6788 "civstyle.tech_parasite_allow_holes");
6791 "civstyle.tech_loss_allow_holes");
6798 "civstyle.upgrade_veteran_loss");
6804 "civstyle.autoupgrade_veteran_loss");
6811 "research.base_tech_cost");
6814 "civstyle.granary_food_ini");
6819 "Too many granary_food_ini entries (%d, max %d)",
6823 log_error(
"No values for granary_food_ini. Using default "
6832 if (food_ini[gi] <= 0) {
6836 food_ini[gi] = food_ini[gi - 1];
6838 log_error(
"Bad value for granary_food_ini[%i]. Using %i.",
6853 "civstyle.granary_food_inc");
6861 "civstyle.min_city_center_%s",
6867 const char *tus_text;
6874 "civstyle.init_vis_radius_sq");
6881 "civstyle.init_city_radius_sq");
6884 "civstyle.gold_upkeep_style");
6889 "Unknown gold upkeep style \"%s\"",
6895 "civstyle.output_granularity");
6909 "wonder_visibility.small_wonders");
6915 "Unknown wonder visibility typpe \"%s\"",
6924 "illness.illness_on");
6930 "illness.illness_base_factor");
6936 "illness.illness_min_size");
6942 "illness.illness_trade_infection");
6948 "illness.illness_pollution_factor");
6956 "incite_cost.base_incite_cost");
6962 "incite_cost.improvement_factor");
6968 "incite_cost.unit_factor");
6974 "incite_cost.total_factor");
6992 struct requirement_vector *
reqs;
6997 auto_perf->
cause = AAPC_UNIT_MOVED_ADJ;
7000 "auto_attack",
"if_attacker",
7005 requirement_vector_copy(&auto_perf->
reqs,
reqs);
7008 "auto_attack.attack_actions",
7012 "\"%s\": %s: failed load %s.",
7013 filename,
"auto_attack",
"attack_actions");
7017 if (ok &&
compat->compat_mode) {
7018 enum unit_type_flag_id *protecor_flag;
7024 "%s",
"auto_attack.will_never");
7026 if (!protecor_flag) {
7029 "\"%s\": %s: bad unit type flag list.",
7030 filename,
"auto_attack.will_never");
7036 protecor_flag = NULL;
7040 psize, protecor_flag)) {
7043 "\"%s\": %s: failed to upgrade.",
7044 filename,
"auto_attack");
7058 int force_capture_units, force_bombard, force_explode_nuclear;
7061 "actions.force_trade_route")) {
7065 ACTION_TRADE_ROUTE);
7072 "actions.force_capture_units");
7074 if (force_capture_units) {
7076 ACTION_CAPTURE_UNITS);
7078 ACTION_CAPTURE_UNITS);
7080 ACTION_CAPTURE_UNITS);
7082 ACTION_CAPTURE_UNITS);
7084 ACTION_CAPTURE_UNITS);
7086 ACTION_CAPTURE_UNITS);
7088 ACTION_CAPTURE_UNITS);
7090 ACTION_CAPTURE_UNITS);
7092 ACTION_CAPTURE_UNITS);
7094 ACTION_CAPTURE_UNITS);
7096 ACTION_CAPTURE_UNITS);
7098 ACTION_CAPTURE_UNITS);
7105 "actions.force_bombard");
7107 if (force_bombard) {
7165 force_explode_nuclear
7167 "actions.force_explode_nuclear");
7169 if (force_explode_nuclear) {
7220 "actions.diplchance_initial_odds")) {
7232 "actions.poison_empties_food_stock");
7239 "actions.steal_maps_reveals_all_cities");
7265 enum gen_action *quiet_actions;
7271 "actions.quiet_actions");
7273 if (!quiet_actions) {
7276 "\"%s\": actions.quiet_actions: bad action list",
7281 for (j = 0; j < asize; j++) {
7286 free(quiet_actions);
7295 BV_SET(paction->sub_results, ACT_SUB_RES_HUT_ENTER);
7298 ACT_SUB_RES_HUT_ENTER);
7300 ACT_SUB_RES_HUT_ENTER);
7304 BV_SET(paction->sub_results, ACT_SUB_RES_HUT_FRIGHTEN);
7307 ACT_SUB_RES_HUT_FRIGHTEN);
7309 ACT_SUB_RES_HUT_FRIGHTEN);
7316 "civstyle.paradrop_to_transport")
7335 ACTION_SPY_BRIBE_UNIT))) {
7351 auto_perf->
cause = AAPC_CITY_GONE;
7357 "actions.escape_city", filename)) {
7369 auto_perf->
cause = AAPC_UNIT_STACK_DEATH;
7375 "actions.unit_stack_death", filename)) {
7389 struct requirement_vector *actor_reqs;
7390 struct requirement_vector *target_reqs;
7391 const char *action_text;
7397 if (action_text == NULL) {
7399 "\"%s\" [%s] missing action to enable.",
7400 filename, sec_name);
7408 "\"%s\" [%s] lists unknown action type \"%s\".",
7409 filename, sec_name, action_text);
7417 if (actor_reqs == NULL) {
7422 requirement_vector_copy(&enabler->
actor_reqs, actor_reqs);
7425 if (target_reqs == NULL) {
7430 requirement_vector_copy(&enabler->
target_reqs, target_reqs);
7435 section_list_destroy(sec);
7443 "global_unit_options.slow_invasions");
7451 const char *tus_text;
7457 "combat_rules.tired_attack");
7461 "combat_rules.only_killing_makes_veteran");
7465 "combat_rules.only_real_fight_makes_veteran");
7469 "combat_rules.combat_odds_scaled_veterancy");
7473 default_drbr =
FALSE;
7477 "combat_rules.damage_reduces_bombard_rate");
7481 "combat_rules.low_firepower_badwallattacker");
7484 "combat_rules.low_firepower_pearl_harbour");
7487 "combat_rules.low_firepower_combat_bonus");
7490 "combat_rules.low_firepower_nonnat_bombard");
7496 "combat_rules.nuke_pop_loss_pct");
7502 "combat_rules.nuke_defender_survival_chance_pct");
7510 "borders.radius_sq_city");
7516 "borders.size_effect");
7523 "borders.radius_sq_city_permanent");
7527 "research.tech_cost_style");
7532 "Unknown tech cost style \"%s\"",
7538 "research.tech_leakage");
7543 "Unknown tech leakage \"%s\"",
7549 log_error(
"Only tech_leakage \"%s\" supported with "
7550 "tech_cost_style \"%s\". ",
7551 tech_leakage_style_name(TECH_LEAKAGE_NONE),
7552 tech_cost_style_name(TECH_COST_CIV1CIV2));
7553 log_error(
"Switching to tech_leakage \"%s\".",
7554 tech_leakage_style_name(TECH_LEAKAGE_NONE));
7562 "research.base_tech_cost");
7565 "research.tech_upkeep_style");
7571 "Unknown tech upkeep style \"%s\"",
7583 "research.tech_upkeep_divider");
7588 "No free_tech_method given");
7594 "Bad value %s for free_tech_method.", sval);
7606 "culture.victory_min_points");
7609 "culture.victory_lead_pct");
7612 "culture.migration_pml");
7615 "culture.history_interest_pml");
7620 "calendar.skip_year_0");
7623 "calendar.start_year");
7629 "Too many calendar fragments. Max is %d",
7637 "calendar.positive_label"));
7641 "calendar.negative_label"));
7647 if (fname != NULL) {
7657 bool color_read =
TRUE;
7665 while (color_read) {
7668 color_read =
rgbcolor_load(file, &prgbcolor,
"playercolors.colorlist%d", i);
7685 "No background player color defined! (%s)",
7700 for (i = 0; i < teams; i++) {
7706 nval = (NULL != sec ? section_list_size(sec) : 0);
7711 "\"%s\": Too many disaster types (%d, max %d)",
7713 section_list_destroy(sec);
7725 struct requirement_vector *
reqs;
7726 const char *sec_name =
section_name(section_list_get(sec,
id));
7730 "\"%s\": Cannot load disaster names",
7741 requirement_vector_copy(&pdis->reqs,
reqs);
7744 "%s.frequency", sec_name);
7749 for (j = 0; j < eff_count; j++) {
7750 const char *dsval = svec[j];
7751 enum disaster_effect_id
effect;
7755 if (!disaster_effect_id_is_valid(
effect)) {
7757 "\"%s\" disaster \"%s\": unknown effect \"%s\".",
7772 section_list_destroy(sec);
7780 const char *sec_name =
section_name(section_list_get(sec,
id));
7781 const char *
typename;
7786 pach->type = achievement_type_by_name(
typename,
fc_strcasecmp);
7787 if (!achievement_type_is_valid(pach->type)) {
7789 "Achievement has unknown type \"%s\".",
7790 typename != NULL ?
typename :
"(NULL)");
7796 "%s.unique", sec_name);
7799 "%s.value", sec_name);
7801 "%s.culture", sec_name);
7806 "Achievement %s has no first msg!", sec_name);
7816 if (!pach->unique) {
7818 "Achievement %s has no msg for consecutive gainers!",
7831 section_list_destroy(sec);
7836 "trade.settings%d.type",
7842 "\"%s\" unknown trade route type \"%s\".",
7851 "trade.settings%d.pct", i);
7853 "trade.settings%d.cancelling", i);
7857 "\"%s\" unknown trade route cancelling type \"%s\".",
7866 if (!trade_route_bonus_type_is_valid(set->
bonus_type)) {
7868 "\"%s\" unknown trade route bonus type \"%s\".",
7884 "trade.goods_selection");
7890 "\"%s\" goods selection method \"%s\" unknown.",
7901 const char *sec_name =
section_name(section_list_get(sec,
id));
7902 struct requirement_vector *
reqs;
7911 requirement_vector_copy(&pgood->reqs,
reqs);
7914 "%s.from_pct", sec_name);
7916 "%s.to_pct", sec_name);
7918 "%s.onetime_pct", sec_name);
7922 for (j = 0; j < nval; j++) {
7923 enum goods_flag_id flag;
7927 if (!goods_flag_id_is_valid(flag)) {
7933 BV_SET(pgood->flags, flag);
7938 pgood->helptext =
lookup_strvec(file, sec_name,
"helptext");
7940 section_list_destroy(sec);
7947 int num = section_list_size(sec);
7949 for (i = 0; i < num; i++) {
7950 const char *sec_name =
section_name(section_list_get(sec, i));
7952 "%s.type", sec_name);
7955 struct requirement_vector *
reqs;
7957 if (!clause_type_is_valid(
type)) {
7959 "\"%s\" unknown clause type \"%s\".",
7960 filename, clause_name);
7969 "\"%s\" dublicate clause type \"%s\" definition.",
7970 filename, clause_name);
7992 section_list_destroy(sec);
8012 const char *flagname;
8015 fpacket.
id = i + UCF_USER_FLAG_1;
8017 flagname = unit_class_flag_id_name(i + UCF_USER_FLAG_1);
8018 if (flagname == NULL) {
8019 fpacket.
name[0] =
'\0';
8041 packet.
flags = c->flags;
8063 const char *flagname;
8066 fpacket.
id = i + UTYF_USER_FLAG_1;
8068 flagname = unit_type_flag_id_name(i + UTYF_USER_FLAG_1);
8069 if (flagname == NULL) {
8070 fpacket.
name[0] =
'\0';
8122 packet.
fuel = u->fuel;
8123 packet.
flags = u->flags;
8124 packet.
roles = u->roles;
8127 packet.
upkeep[o] = u->upkeep[o];
8134 packet.
cargo = u->cargo;
8138 packet.
vlayer = u->vlayer;
8140 if (u->veteran == NULL) {
8159 packet.
worker = u->adv.worker;
8179 bonuspacket.
unit = packet.
id;
8180 bonuspacket.
flag = pbonus->flag;
8181 bonuspacket.
type = pbonus->type;
8182 bonuspacket.
value = pbonus->value;
8183 bonuspacket.
quiet = pbonus->quiet;
8202 packet.
id = spec_id;
8210 packet.
reqs[j++] = *preq;
8227 packet.
id = ptclass->idx;
8230 packet.
cost_pct = ptclass->cost_pct;
8247 const char *flagname;
8250 fpacket.
id = i + TECH_USER_1;
8253 if (flagname == NULL) {
8254 fpacket.
name[0] =
'\0';
8272 if (a->tclass == NULL) {
8275 packet.
tclass = a->tclass->idx;
8319 packet.
flags = a->flags;
8320 packet.
cost = a->cost;
8339 packet.
genus = b->genus;
8346 packet.
reqs[j++] = *preq;
8355 packet.
upkeep = b->upkeep;
8357 packet.
flags = b->flags;
8379 const char *flagname;
8382 fpacket.
id = i + TER_USER_1;
8385 if (flagname == NULL) {
8386 fpacket.
name[0] =
'\0';
8405 packet.
tclass = pterrain->tclass;
8417 packet.
output[o] = pterrain->output[o];
8421 for (r = pterrain->resources; *r; r++) {
8458 packet.
flags = pterrain->flags;
8481 packet.
output[o] = presource->data.resource->output[o];
8499 const char *flagname;
8502 fpacket.
id = i + EF_USER_FLAG_1;
8504 flagname = extra_flag_id_name(i + EF_USER_FLAG_1);
8505 if (flagname == NULL) {
8506 fpacket.
name[0] =
'\0';
8531 for (j = 0; j < EC_COUNT; j++) {
8538 for (j = 0; j < ERM_COUNT; j++) {
8554 packet.
reqs[j++] = *preq;
8560 packet.
rmreqs[j++] = *preq;
8587 packet.
eus = e->eus;
8591 packet.
flags = e->flags;
8681 packet.
reqs[j++] = *preq;
8686 packet.
to_pct = g->to_pct;
8688 packet.
flags = g->flags;
8714 packet.
reqs[j++] = *preq;
8740 packet.
type = a->type;
8741 packet.
unique = a->unique;
8742 packet.
value = a->value;
8819 packet.
cause = aperf->cause;
8823 packet.
reqs[counter++] = *req;
8833 packet.
alternatives[counter] = aperf->alternatives[counter];
8878 gov.reqs[j++] = *preq;
8931 groups_packet.
hidden[i] = pgroup->hidden;
8938 if (
n->translation_domain == NULL) {
8979 if (
n->init_techs[i] !=
A_LAST) {
8988 const struct unit_type *t =
n->init_units[i];
8999 if (
n->init_buildings[i] !=
B_LAST) {
9040 for (i = 0; i < CLAUSE_COUNT; i++) {
9074 packet.
start = pmul->start;
9075 packet.
stop = pmul->stop;
9076 packet.
step = pmul->step;
9077 packet.
def = pmul->def;
9078 packet.
offset = pmul->offset;
9079 packet.
factor = pmul->factor;
9087 packet.
reqs[j++] = *preq;
9111 city_p.
reqs[j++] = *preq;
9136 packet.
id = pmus->id;
9143 packet.
reqs[j++] = *preq;
9248 bool act,
bool buffer_script,
bool load_luadata)
9253 act, buffer_script, load_luadata)) {
9269 if (restore != NULL) {
9306 log_normal(
_(
"Cannot load any ruleset. Freeciv-web ruleset is available from "
9307 "https://github.com/freeciv/freeciv-web"));
9342 bool act,
bool buffer_script,
bool load_luadata)
9344 struct section_file *techfile, *unitfile, *buildfile, *govfile, *terrfile;
9345 struct section_file *stylefile, *cityfile, *nationfile, *effectfile, *gamefile;
9353 compat_info.
log_cb = logger;
9370 server.playable_nations = 0;
9388 if (techfile == NULL
9389 || buildfile == NULL
9393 || stylefile == NULL
9395 || nationfile == NULL
9396 || effectfile == NULL
9397 || gamefile == NULL) {
9529 if (pret ==
TRI_MAYBE && buffer_script) {
9531 "-- This file is for lua-functionality for parsing luadata.txt\n-- of this ruleset.");
9537 if (ok && !buffer_script) {
9577 "Could not load game.ruleset:\n%s",
int achievement_index(const struct achievement *pach)
int achievement_number(const struct achievement *pach)
#define achievements_iterate_end
#define achievements_iterate(_ach_)
struct action_auto_perf * action_auto_perf_slot_number(const int num)
void actions_rs_pre_san_gen(void)
const char * action_min_range_ruleset_var_name(int act)
const char * action_blocked_by_ruleset_var_name(const struct action *act)
bool action_is_in_use(struct action *paction)
const char * action_post_success_forced_ruleset_var_name(const struct action *act)
struct action * action_by_rule_name(const char *name)
const char * action_rule_name(const struct action *action)
const char * action_actor_consuming_always_ruleset_var_name(action_id act)
const char * action_max_range_ruleset_var_name(int act)
enum action_target_kind action_target_kind_default(enum action_result result)
int action_min_range_default(enum action_result result)
const char * action_target_kind_ruleset_var_name(int act)
void action_enabler_add(struct action_enabler *enabler)
const char * action_ui_name_default(int act)
struct action_enabler * action_enabler_new(void)
bool action_enabler_possible_actor(const struct action_enabler *ae)
struct action_enabler_list * action_enablers_for_action(action_id action)
const char * action_ui_name_ruleset_var_name(int act)
int action_max_range_default(enum action_result result)
#define action_by_result_iterate(_paction_, _result_)
#define action_auto_perf_iterate_end
#define action_enablers_iterate_end
#define ACTION_AUTO_MOVED_ADJ
#define action_id_get_sub_target_kind(act_id)
#define ACTION_AUTO_UPKEEP_GOLD
static struct action * action_by_number(action_id act_id)
#define ACTION_AUTO_ESCAPE_STACK
#define action_has_result(_act_, _res_)
#define ACTION_AUTO_ESCAPE_CITY
#define action_enabler_list_iterate_end
#define ACTION_DISTANCE_UNLIMITED
#define action_by_result_iterate_end
#define ACTION_AUTO_UPKEEP_SHIELD
#define ACTION_AUTO_POST_BRIBE
#define action_iterate_end
#define action_enablers_iterate(_enabler_)
#define action_enabler_list_iterate(action_enabler_list, aenabler)
#define action_iterate(_act_)
#define action_auto_perf_iterate(_act_perf_)
#define ACTION_AUTO_UPKEEP_FOOD
#define ACTION_AUTO_POST_ATTACK
void adv_units_ruleset_init(void)
#define CALL_FUNC_EACH_AI(_func,...)
Base_type_id base_number(const struct base_type *pbase)
void base_type_init(struct extra_type *pextra, int idx)
bool territory_claiming_base(const struct base_type *pbase)
#define BV_ISSET(bv, bit)
struct citystyle * city_styles
void city_styles_alloc(int num)
void city_production_caravan_shields_init(void)
const char * city_style_rule_name(const int style)
const char * get_output_identifier(Output_type_id output)
#define output_type_iterate(output)
#define output_type_iterate_end
static struct fc_sockaddr_list * list
void conn_list_compression_thaw(const struct conn_list *pconn_list)
void conn_list_compression_freeze(const struct conn_list *pconn_list)
#define log_deprecation(message,...)
struct clause_info * clause_info_get(enum clause_type type)
const char * disaster_rule_name(struct disaster_type *pdis)
Disaster_type_id disaster_number(const struct disaster_type *pdis)
Disaster_type_id disaster_index(const struct disaster_type *pdis)
#define disaster_type_iterate(_p)
#define disaster_type_iterate_end
void send_ruleset_cache(struct conn_list *dest)
struct effect * effect_new(enum effect_type type, int value, struct multiplier *pmul)
struct effect_list * get_effects(enum effect_type effect_type)
void effect_req_append(struct effect *peffect, struct requirement req)
#define effect_list_iterate_end
#define effect_list_iterate(effect_list, peffect)
#define MAX_DISASTER_TYPES
#define MAX_NUM_BUILDING_LIST
#define EC_NATURAL_DEFENSIVE
#define EC_NOT_AGGRESSIVE
#define MAX_CALENDAR_FRAGMENTS
#define MAX_NUM_TECH_CLASSES
#define MAX_NUM_MULTIPLIERS
#define MAX_NUM_UNIT_LIST
#define MAX_ACHIEVEMENT_TYPES
#define MAX_NUM_TECH_LIST
const struct ft_color ftc_warning
void game_ruleset_init(void)
void game_ruleset_free(void)
#define RS_DEFAULT_RANSOM_GOLD
#define RS_DEFAULT_GRANARY_FOOD_INI
#define RS_DEFAULT_CIVIL_WAR_UNHAPPY
#define RS_DEFAULT_NUKE_DEFENDER_SURVIVAL_CHANCE_PCT
#define RS_MIN_BORDER_RADIUS_SQ_CITY_PERMANENT
#define RS_MAX_TECH_UPKEEP_DIVIDER
#define RS_MIN_ILLNESS_POLLUTION_PCT
#define RS_DEFAULT_NUKE_POP_LOSS_PCT
#define RS_MAX_BORDER_RADIUS_SQ_CITY
#define RS_DEFAULT_BASE_POLLUTION
#define RS_MIN_ILLNESS_TRADE_INFECTION_PCT
#define RS_MAX_ILLNESS_BASE_FACTOR
#define RS_DEFAULT_INCITE_TOTAL_FCT
#define RS_DEFAULT_ILLNESS_BASE_FACTOR
#define RS_DEFAULT_NEG_YEAR_LABEL
#define RS_MIN_NUKE_POP_LOSS_PCT
#define RS_MIN_INCITE_IMPROVEMENT_FCT
#define RS_MIN_BASE_BRIBE_COST
#define RS_MAX_NUKE_POP_LOSS_PCT
#define RS_DEFAULT_INCITE_IMPROVEMENT_FCT
#define RS_MAX_INCITE_IMPROVEMENT_FCT
#define RS_MIN_RANSOM_GOLD
#define RS_ACTION_NO_MAX_DISTANCE
#define RS_DEFAULT_BASE_BRIBE_COST
#define RS_MAX_INCITE_BASE_COST
#define RS_DEFAULT_TECH_UPKEEP_DIVIDER
#define RS_DEFAULT_HAPPY_COST
#define RS_MIN_UPGRADE_VETERAN_LOSS
#define RS_MIN_ILLNESS_MIN_SIZE
#define RS_DEFAULT_POISON_EMPTIES_FOOD_STOCK
#define RS_DEFAULT_GRANARY_FOOD_INC
#define RS_DEFAULT_ILLNESS_ON
#define RS_MAX_HAPPY_COST
#define GAME_DEFAULT_CELEBRATESIZE
#define RS_MIN_ILLNESS_BASE_FACTOR
#define RS_DEFAULT_STEAL_MAP_REVEALS_CITIES
#define RS_MIN_TECH_UPKEEP_DIVIDER
#define RS_MAX_RANSOM_GOLD
#define RS_MIN_HAPPY_COST
#define RS_MIN_BORDER_RADIUS_SQ_CITY
#define GAME_DEFAULT_RULESETDIR
#define RS_DEFAULT_CIVIL_WAR_CELEB
#define RS_MAX_BASE_TECH_COST
#define RS_DEFAULT_BASE_TECH_COST
#define RS_MIN_NUKE_DEFENDER_SURVIVAL_CHANCE_PCT
#define RS_MAX_BORDER_RADIUS_SQ_CITY_PERMANENT
#define RS_DEFAULT_UPGRADE_VETERAN_LOSS
#define RS_MAX_NUKE_DEFENDER_SURVIVAL_CHANCE_PCT
#define RS_MAX_INCITE_UNIT_FCT
#define RS_MIN_VIS_RADIUS_SQ
#define RS_DEFAULT_CALENDAR_SKIP_0
#define RS_MAX_ILLNESS_MIN_SIZE
#define RS_DEFAULT_CITY_RADIUS_SQ
#define GAME_DEFAULT_START_YEAR
#define RS_MAX_BORDER_SIZE_EFFECT
#define RS_DEFAULT_BORDER_SIZE_EFFECT
#define RS_MAX_BASE_BRIBE_COST
#define RS_MIN_INCITE_BASE_COST
#define RS_DEFAULT_PILLAGE_SELECT
#define RS_MIN_CITY_RADIUS_SQ
#define RS_MIN_CITY_CENTER_OUTPUT
#define RS_MAX_GRANARY_FOOD_INC
#define RS_MAX_CITY_CENTER_OUTPUT
#define RS_MAX_CITY_RADIUS_SQ
#define RS_DEFAULT_POS_YEAR_LABEL
#define RS_MIN_INCITE_UNIT_FCT
#define RS_MIN_BORDER_SIZE_EFFECT
#define RS_DEFAULT_VIS_RADIUS_SQ
#define RS_DEFAULT_BORDER_RADIUS_SQ_CITY_PERMANENT
#define RS_DEFAULT_TIRED_ATTACK
#define RS_DEFAULT_ACTION_ACTOR_CONSUMING_ALWAYS
#define RS_MAX_ILLNESS_POLLUTION_PCT
#define RS_DEFAULT_ILLNESS_TRADE_INFECTION_PCT
#define RS_DEFAULT_FOOD_COST
#define RS_DEFAULT_INCITE_UNIT_FCT
#define RS_MAX_INCITE_TOTAL_FCT
#define RS_DEFAULT_INCITE_BASE_COST
#define GAME_DEFAULT_ANGRYCITIZEN
#define RS_DEFAULT_CITY_CENTER_OUTPUT
#define RS_MIN_INCITE_TOTAL_FCT
#define RS_DEFAULT_ILLNESS_POLLUTION_PCT
#define RS_MAX_UPGRADE_VETERAN_LOSS
static void set_ruleset_compat_mode(bool active)
#define RS_MAX_VIS_RADIUS_SQ
#define RS_MIN_GRANARY_FOOD_INC
#define RS_MAX_ILLNESS_TRADE_INFECTION_PCT
#define RS_DEFAULT_ILLNESS_MIN_SIZE
#define RS_MIN_BASE_TECH_COST
#define RS_DEFAULT_BORDER_RADIUS_SQ_CITY
const struct nation_type * ruler_title_nation(const struct ruler_title *pruler_title)
struct ruler_title * government_ruler_title_new(struct government *pgovern, const struct nation_type *pnation, const char *ruler_male_title, const char *ruler_female_title)
const char * ruler_title_female_untranslated_name(const struct ruler_title *pruler_title)
Government_type_id government_count(void)
const char * ruler_title_male_untranslated_name(const struct ruler_title *pruler_title)
void governments_alloc(int num)
Government_type_id government_number(const struct government *pgovern)
const struct ruler_title_hash * government_ruler_titles(const struct government *pgovern)
Government_type_id government_index(const struct government *pgovern)
const char * government_rule_name(const struct government *pgovern)
struct government * government_by_rule_name(const char *name)
#define governments_iterate(NAME_pgov)
#define ruler_titles_iterate(ARG_hash, NAME_rule_title)
#define ruler_titles_iterate_end
#define governments_iterate_end
struct impr_type * improvement_by_number(const Impr_type_id id)
Impr_type_id improvement_number(const struct impr_type *pimprove)
const char * improvement_rule_name(const struct impr_type *pimprove)
void improvement_feature_cache_init(void)
struct impr_type * improvement_by_rule_name(const char *name)
#define improvement_iterate_end
#define improvement_iterate(_p)
void vdo_log(const char *file, const char *function, int line, bool print_from_where, enum log_level level, char *buf, int buflen, const char *message, va_list args)
#define fc_assert_ret(condition)
#define log_verbose(message,...)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
#define log_do_output_for_level(level)
#define log_debug(message,...)
#define log_normal(message,...)
#define log_error(message,...)
struct terrain_misc terrain_control
#define fc_calloc(n, esz)
int utype_unknown_move_cost(const struct unit_type *utype)
void init_move_fragments(void)
const char * multiplier_rule_name(const struct multiplier *pmul)
Multiplier_type_id multiplier_number(const struct multiplier *pmul)
struct multiplier * multiplier_by_rule_name(const char *name)
Multiplier_type_id multiplier_index(const struct multiplier *pmul)
#define multipliers_iterate(_mul_)
#define multipliers_iterate_end
static void name_set(struct name_translation *ptrans, const char *domain, const char *vernacular_name)
static const char * rule_name_get(const struct name_translation *ptrans)
static const char * untranslated_name(const struct name_translation *ptrans)
static void names_set(struct name_translation *ptrans, const char *domain, const char *vernacular_name, const char *rule_name)
void nation_group_set_match(struct nation_group *pgroup, int match)
const char * nation_group_untranslated_name(const struct nation_group *pgroup)
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_count(void)
Nation_type_id nation_number(const struct nation_type *pnation)
struct nation_group * nation_group_new(const char *name)
bool nation_leader_is_male(const struct nation_leader *pleader)
struct nation_set * nation_set_new(const char *set_name, const char *set_rule_name, const char *set_description)
struct nation_type * nation_by_number(const Nation_type_id nation)
struct nation_city * nation_city_new(struct nation_type *pnation, const char *name)
const struct nation_leader_list * nation_leaders(const struct nation_type *pnation)
const char * nation_set_untranslated_name(const struct nation_set *pset)
bool is_nation_playable(const struct nation_type *nation)
int nation_set_number(const struct nation_set *pset)
void nation_city_set_terrain_preference(struct nation_city *pncity, const struct terrain *pterrain, enum nation_city_preference prefer)
void nation_city_set_river_preference(struct nation_city *pncity, enum nation_city_preference prefer)
bool nation_is_in_set(const struct nation_type *pnation, const struct nation_set *pset)
const char * nation_set_description(const struct nation_set *pset)
int nation_set_count(void)
struct nation_set * nation_set_by_number(int id)
struct nation_type * nation_by_rule_name(const char *name)
struct nation_set * nation_set_by_rule_name(const char *name)
Nation_type_id nation_index(const struct nation_type *pnation)
const char * nation_leader_name(const struct nation_leader *pleader)
int nation_group_count(void)
const char * nation_set_rule_name(const struct nation_set *pset)
struct nation_leader * nation_leader_new(struct nation_type *pnation, const char *name, bool is_male)
void nation_group_set_hidden(struct nation_group *pgroup, bool hidden)
void nations_alloc(int num)
enum barbarian_type nation_barbarian_type(const struct nation_type *nation)
int nation_group_number(const struct nation_group *pgroup)
#define nation_leader_list_iterate(leaderlist, pleader)
#define nation_sets_iterate_end
#define nation_set_list_iterate_end
#define nation_group_list_iterate(grouplist, pgroup)
#define nation_sets_iterate(NAME_pset)
#define nations_iterate_end
#define nations_iterate(NAME_pnation)
#define nation_leader_list_iterate_end
#define nation_group_list_iterate_end
#define nation_set_list_iterate(setlist, pset)
#define nation_groups_iterate(NAME_pgroup)
#define nation_groups_iterate_end
void notify_conn(struct conn_list *dest, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
#define web_lsend_packet(packetname,...)
#define PACKET_STRVEC_COMPUTE(str, strvec)
void lsend_packet_ruleset_summary(struct conn_list *dest, const struct packet_ruleset_summary *packet)
void lsend_packet_ruleset_building(struct conn_list *dest, const struct packet_ruleset_building *packet)
void lsend_packet_ruleset_unit_class_flag(struct conn_list *dest, const struct packet_ruleset_unit_class_flag *packet)
void lsend_packet_ruleset_achievement(struct conn_list *dest, const struct packet_ruleset_achievement *packet)
void lsend_packet_ruleset_nation_sets(struct conn_list *dest, const struct packet_ruleset_nation_sets *packet)
void lsend_packet_ruleset_multiplier(struct conn_list *dest, const struct packet_ruleset_multiplier *packet)
void lsend_packet_ruleset_city(struct conn_list *dest, const struct packet_ruleset_city *packet)
void lsend_packet_ruleset_unit(struct conn_list *dest, const struct packet_ruleset_unit *packet)
void lsend_packet_ruleset_clause(struct conn_list *dest, const struct packet_ruleset_clause *packet)
void lsend_packet_ruleset_unit_flag(struct conn_list *dest, const struct packet_ruleset_unit_flag *packet)
void lsend_packet_ruleset_action(struct conn_list *dest, const struct packet_ruleset_action *packet)
void lsend_packet_ruleset_extra(struct conn_list *dest, const struct packet_ruleset_extra *packet)
void lsend_packet_ruleset_nation_groups(struct conn_list *dest, const struct packet_ruleset_nation_groups *packet)
void lsend_packet_ruleset_terrain_control(struct conn_list *dest, const struct packet_ruleset_terrain_control *packet)
void lsend_packet_ruleset_government_ruler_title(struct conn_list *dest, const struct packet_ruleset_government_ruler_title *packet)
void lsend_packet_ruleset_music(struct conn_list *dest, const struct packet_ruleset_music *packet)
void lsend_packet_ruleset_control(struct conn_list *dest, const struct packet_ruleset_control *packet)
void lsend_packet_team_name_info(struct conn_list *dest, const struct packet_team_name_info *packet)
void lsend_packet_ruleset_terrain_flag(struct conn_list *dest, const struct packet_ruleset_terrain_flag *packet)
void lsend_packet_ruleset_unit_class(struct conn_list *dest, const struct packet_ruleset_unit_class *packet)
void lsend_packet_ruleset_disaster(struct conn_list *dest, const struct packet_ruleset_disaster *packet)
void lsend_packet_ruleset_description_part(struct conn_list *dest, const struct packet_ruleset_description_part *packet)
void lsend_packet_ruleset_government(struct conn_list *dest, const struct packet_ruleset_government *packet)
void lsend_packet_ruleset_unit_bonus(struct conn_list *dest, const struct packet_ruleset_unit_bonus *packet)
void lsend_packet_ruleset_base(struct conn_list *dest, const struct packet_ruleset_base *packet)
void lsend_packet_ruleset_resource(struct conn_list *dest, const struct packet_ruleset_resource *packet)
void lsend_packet_ruleset_specialist(struct conn_list *dest, const struct packet_ruleset_specialist *packet)
void lsend_packet_ruleset_tech(struct conn_list *dest, const struct packet_ruleset_tech *packet)
void lsend_packet_ruleset_trade(struct conn_list *dest, const struct packet_ruleset_trade *packet)
void lsend_packet_ruleset_action_enabler(struct conn_list *dest, const struct packet_ruleset_action_enabler *packet)
void lsend_packet_ruleset_style(struct conn_list *dest, const struct packet_ruleset_style *packet)
void lsend_packet_ruleset_tech_flag(struct conn_list *dest, const struct packet_ruleset_tech_flag *packet)
void lsend_packet_ruleset_tech_class(struct conn_list *dest, const struct packet_ruleset_tech_class *packet)
void lsend_packet_ruleset_goods(struct conn_list *dest, const struct packet_ruleset_goods *packet)
void lsend_packet_ruleset_game(struct conn_list *dest, const struct packet_ruleset_game *packet)
void lsend_packet_ruleset_nation(struct conn_list *dest, const struct packet_ruleset_nation *packet)
void lsend_packet_rulesets_ready(struct conn_list *dest)
void lsend_packet_ruleset_extra_flag(struct conn_list *dest, const struct packet_ruleset_extra_flag *packet)
void lsend_packet_ruleset_road(struct conn_list *dest, const struct packet_ruleset_road *packet)
void lsend_packet_ruleset_terrain(struct conn_list *dest, const struct packet_ruleset_terrain *packet)
void lsend_packet_ruleset_action_auto(struct conn_list *dest, const struct packet_ruleset_action_auto *packet)
struct city_list * cities
void send_nation_availability(struct conn_list *dest, bool nationset_change)
void playercolor_free(void)
void playercolor_init(void)
int playercolor_count(void)
void playercolor_add(struct rgbcolor *prgbcolor)
void count_playable_nations(void)
struct section_file * secfile_load(const char *filename, bool allow_duplicates)
const char * secfile_error(void)
const char * section_name(const struct section *psection)
void secfile_destroy(struct section_file *secfile)
bool entry_bool_get(const struct entry *pentry, bool *value)
void secfile_check_unused(const struct section_file *secfile)
bool secfile_lookup_int(const struct section_file *secfile, int *ival, const char *path,...)
struct section_list * secfile_sections_by_name_prefix(const struct section_file *secfile, const char *prefix)
const char ** secfile_lookup_str_vec(const struct section_file *secfile, size_t *dim, const char *path,...)
const char * entry_name(const struct entry *pentry)
struct entry * secfile_entry_lookup(const struct section_file *secfile, const char *path,...)
bool entry_str_get(const struct entry *pentry, const char **value)
const char * secfile_lookup_str(const struct section_file *secfile, const char *path,...)
int * secfile_lookup_int_vec(const struct section_file *secfile, size_t *dim, const char *path,...)
bool secfile_lookup_bool_default(const struct section_file *secfile, bool def, const char *path,...)
struct entry * section_entry_by_name(const struct section *psection, const char *name)
int secfile_lookup_int_default(const struct section_file *secfile, int def, const char *path,...)
bool entry_int_get(const struct entry *pentry, int *value)
const char * secfile_name(const struct section_file *secfile)
struct entry * secfile_entry_by_path(const struct section_file *secfile, const char *path)
const char * secfile_lookup_str_default(const struct section_file *secfile, const char *def, const char *path,...)
int secfile_lookup_int_def_min_max(const struct section_file *secfile, int defval, int minval, int maxval, const char *path,...)
enum entry_type entry_type_get(const struct entry *pentry)
#define secfile_lookup_enum_vec(secfile, dim, specenum_type, path,...)
#define secfile_lookup_enum_default(secfile, defval, specenum_type, path,...)
#define section_list_iterate(seclist, psection)
#define section_list_iterate_end
req_vec_num_in_item req_vec_vector_number(const void *parent_item, const struct requirement_vector *vec)
struct requirement_vector * req_vec_by_number(const void *parent_item, req_vec_num_in_item number)
bool req_vec_change_apply(const struct req_vec_change *modification, requirement_vector_by_number getter, const void *parent_item)
bool are_requirements_equal(const struct requirement *req1, const struct requirement *req2)
struct requirement req_from_str(const char *type, const char *range, bool survives, bool present, bool quiet, const char *value)
struct requirement req_from_values(int type, int range, bool survives, bool present, bool quiet, int value)
void req_vec_problem_free(struct req_vec_problem *issue)
struct req_vec_problem * req_vec_get_first_missing_univ(const struct requirement_vector *vec, requirement_vector_number get_num, const void *parent_item)
struct req_vec_problem * req_vec_get_first_redundant_req(const struct requirement_vector *vec, requirement_vector_number get_num, const void *parent_item)
bool req_vec_is_impossible_to_fulfill(const struct requirement_vector *reqs)
#define requirement_vector_iterate_end
#define requirement_vector_iterate(req_vec, preq)
bool rgbcolor_load(struct section_file *file, struct rgbcolor **prgbcolor, char *path,...)
Road_type_id road_number(const struct road_type *proad)
void road_integrators_cache_init(void)
void road_type_init(struct extra_type *pextra, int idx)
const char * rscompat_action_ui_name_S3_1(struct rscompat_info *compat, int act_id)
void rscompat_adjust_pre_sanity(struct rscompat_info *info)
enum road_gui_type rscompat_road_gui_type_3_1(struct road_type *proad)
void rscompat_extra_adjust_3_1(struct rscompat_info *compat, struct extra_type *pextra)
void rscompat_uclass_flags_3_1(struct rscompat_info *compat, struct unit_class *pclass)
const char * rscompat_req_name_3_1(const char *type, const char *old_name)
bool rscompat_auto_attack_3_1(struct rscompat_info *compat, struct action_auto_perf *auto_perf, size_t psize, enum unit_type_flag_id *protecor_flag)
bool rscompat_old_effect_3_1(const char *type, struct section_file *file, const char *sec_name, struct rscompat_info *compat)
bool rscompat_names(struct rscompat_info *info)
const char * rscompat_utype_flag_name_3_1(struct rscompat_info *compat, const char *old_type)
void rscompat_req_vec_adjust_3_1(struct rscompat_info *compat, struct requirement_vector *preqs, int *reqs_count, const char *filename, const char *sec, const char *sub, const char *rfor)
bool rscompat_old_slow_invasions_3_1(struct rscompat_info *compat, bool slow_invasions)
void rscompat_postprocess(struct rscompat_info *info)
int rscompat_check_capabilities(struct section_file *file, const char *filename, const struct rscompat_info *info)
void rscompat_enablers_add_obligatory_hard_reqs(void)
const char * rscompat_action_max_range_name_S3_1(struct rscompat_info *compat, int act_id)
void rscompat_init_info(struct rscompat_info *info)
bool rscompat_check_cap_and_version(struct section_file *file, const char *filename, const struct rscompat_info *info)
const char * rscompat_combat_bonus_name_3_1(struct rscompat_info *compat, const char *old_type)
const char * rscompat_req_type_name_3_1(const char *old_type)
#define check_cityname(name)
static int ruleset_purge_redundant_reqs_enablers(void)
static void ruleset_load_traits(struct trait_limits *out, struct section_file *file, const char *secname, const char *field_prefix)
static bool load_rulesetdir(const char *rsdir, bool compat_mode, rs_conversion_logger logger, bool act, bool buffer_script, bool load_luadata)
#define STYLE_SECTION_PREFIX
static bool lookup_terrain(struct section_file *file, const char *entry, const char *filename, struct terrain *pthis, struct terrain **result, bool null_acceptable)
static bool load_terrain_names(struct section_file *file, struct rscompat_info *compat)
static bool load_style_names(struct section_file *file, struct rscompat_info *compat)
int ruleset_purge_unused_entities(void)
#define MUSICSTYLE_SECTION_PREFIX
static char * road_sections
static bool load_ruleset_governments(struct section_file *file, struct rscompat_info *compat)
#define MULTIPLIER_SECTION_PREFIX
static struct requirement_vector reqs_list
static void send_ruleset_techs(struct conn_list *dest)
#define section_strlcpy(dst, src)
static void send_ruleset_units(struct conn_list *dest)
static void send_ruleset_governments(struct conn_list *dest)
static struct extra_type * lookup_resource(const char *filename, const char *name, const char *jsection)
static struct section_file * openload_luadata_file(const char *rsdir)
static bool load_ruleset_techs(struct section_file *file, struct rscompat_info *compat)
static bool purge_unused_req_vec(const struct requirement_vector *reqs, const char *msg)
void rulesets_deinit(void)
static bool load_action_ui_name(struct section_file *file, int act, const char *entry_name, const char *compat_name)
static void send_ruleset_resources(struct conn_list *dest)
static bool load_ruleset_buildings(struct section_file *file, struct rscompat_info *compat)
static char * terrain_sections
static bool lookup_building_list(struct section_file *file, const char *prefix, const char *entry, int *output, const char *filename)
static void nullcheck_secfile_destroy(struct section_file *file)
static void send_ruleset_clauses(struct conn_list *dest)
static void send_ruleset_game(struct conn_list *dest)
#define NATION_SECTION_PREFIX
static bool load_ruleset_effects(struct section_file *file, struct rscompat_info *compat)
static void send_ruleset_nations(struct conn_list *dest)
static void send_ruleset_roads(struct conn_list *dest)
static int ruleset_purge_unused_enablers(void)
static bool is_on_allowed_list(const char *name, const char **list, size_t len)
static void send_ruleset_tech_classes(struct conn_list *dest)
static void send_ruleset_action_enablers(struct conn_list *dest)
static void send_ruleset_control(struct conn_list *dest)
bool load_rulesets(const char *restore, const char *alt, bool compat_mode, rs_conversion_logger logger, bool act, bool buffer_script, bool load_luadata)
#define GOODS_SECTION_PREFIX
void ruleset_error_real(rs_conversion_logger logger, const char *file, const char *function, int line, enum log_level level, const char *format,...)
#define TERRAIN_SECTION_PREFIX
static struct section_file * openload_ruleset_file(const char *whichset, const char *rsdir)
static void send_ruleset_musics(struct conn_list *dest)
int ruleset_purge_redundant_reqs(void)
static int secfile_lookup_int_default_min_max(struct section_file *file, int def, int min, int max, const char *path,...) fc__attribute((__format__(__printf__
static char * base_sections
#define DISASTER_SECTION_PREFIX
static void send_ruleset_goods(struct conn_list *dest)
static const char name_too_long[]
bool reload_rulesets_settings(void)
static struct strvec * lookup_strvec(struct section_file *file, const char *prefix, const char *suffix)
#define CITYSTYLE_SECTION_PREFIX
static bool load_action_range(struct rscompat_info *compat, struct section_file *file, action_id act)
static bool lookup_tech(struct section_file *file, struct advance **result, const char *prefix, const char *entry, const char *filename, const char *description)
static bool load_game_names(struct section_file *file, struct rscompat_info *compat)
static void send_ruleset_specialists(struct conn_list *dest)
static bool load_ruleset_veteran(struct section_file *file, const char *path, struct veteran_system **vsystem, char *err, size_t err_len, struct rscompat_info *compat)
#define ADVANCE_SECTION_PREFIX
#define EFFECT_SECTION_PREFIX
static void send_ruleset_action_auto_performers(struct conn_list *dest)
static bool load_government_names(struct section_file *file, struct rscompat_info *compat)
static void send_ruleset_team_names(struct conn_list *dest)
static void send_ruleset_cities(struct conn_list *dest)
static bool lookup_building(struct section_file *file, const char *prefix, const char *entry, struct impr_type **result, const char *filename, const char *description)
static bool purge_redundant_req_vec(const struct requirement_vector *reqs, const char *msg)
static char * lookup_string(struct section_file *file, const char *prefix, const char *suffix)
static const char * check_leader_names(struct nation_type *pnation)
#define ACTION_ENABLER_SECTION_PREFIX
#define BASE_SECTION_PREFIX
static int ruleset_purge_redundant_reqs_effects(void)
static enum fc_tristate openload_script_file(const char *whichset, const char *rsdir, char **buffer, bool optional)
char * get_parser_buffer(void)
static bool load_building_names(struct section_file *file, struct rscompat_info *compat)
#define EXTRA_SECTION_PREFIX
static bool load_action_range_max(struct rscompat_info *compat, struct section_file *file, action_id act)
void send_rulesets(struct conn_list *dest)
#define CLAUSE_SECTION_PREFIX
static bool lookup_unit_list(struct section_file *file, const char *prefix, const char *entry, struct unit_type **output, const char *filename)
static char * resource_sections
#define UNIT_SECTION_PREFIX
#define ACHIEVEMENT_SECTION_PREFIX
static bool load_ruleset_cities(struct section_file *file, struct rscompat_info *compat)
static bool load_ruleset_styles(struct section_file *file, struct rscompat_info *compat)
static struct government * lookup_government(struct section_file *file, const char *entry, const char *filename, struct government *fallback)
static bool load_ruleset_units(struct section_file *file, struct rscompat_info *compat)
static bool lookup_time(const struct section_file *secfile, int *turns, const char *sec_name, const char *property_name, const char *filename, const char *item_name, bool *ok)
static bool load_action_blocked_by_list(struct section_file *file, const char *filename, struct action *paction)
static void send_ruleset_styles(struct conn_list *dest)
#define NATION_GROUP_SECTION_PREFIX
static char * extra_sections
struct requirement_vector * lookup_req_list(struct section_file *file, struct rscompat_info *compat, const char *sec, const char *sub, const char *rfor)
static void send_ruleset_disasters(struct conn_list *dest)
static bool purge_duplicate_req_vec(const struct requirement_vector *reqs, const char *msg)
static bool lookup_tech_list(struct section_file *file, const char *prefix, const char *entry, int *output, const char *filename)
#define MAX_SECTION_LABEL
#define BUILDING_SECTION_PREFIX
static bool load_ruleset_game(struct section_file *file, bool act, struct rscompat_info *compat)
static bool load_nation_names(struct section_file *file, struct rscompat_info *compat)
static void send_ruleset_achievements(struct conn_list *dest)
static void send_ruleset_bases(struct conn_list *dest)
static bool load_ruleset_terrain(struct section_file *file, struct rscompat_info *compat)
static int ruleset_purge_unused_effects(void)
static bool load_action_actor_consuming_always(struct section_file *file, action_id act)
static bool load_action_post_success_force(struct section_file *file, const char *filename, int performer_slot, struct action *paction)
static bool load_tech_names(struct section_file *file, struct rscompat_info *compat)
#define SPECIALIST_SECTION_PREFIX
static bool lookup_cbonus_list(struct rscompat_info *compat, struct combat_bonus_list *list, struct section_file *file, const char *sec, const char *sub)
static bool load_action_kind(struct section_file *file, action_id act)
static void send_ruleset_multipliers(struct conn_list *dest)
char * get_script_buffer(void)
static void send_ruleset_actions(struct conn_list *dest)
static bool load_city_name_list(struct section_file *file, struct nation_type *pnation, const char *secfile_str1, const char *secfile_str2, const char **allowed_terrains, size_t atcount)
static bool load_action_auto_uflag_block(struct section_file *file, struct action_auto_perf *auto_perf, const char *uflags_path, const char *filename)
static bool load_ruleset_nations(struct section_file *file, struct rscompat_info *compat)
static bool load_action_auto_actions(struct section_file *file, struct action_auto_perf *auto_perf, const char *actions_path, const char *filename)
static void send_ruleset_unit_classes(struct conn_list *dest)
#define TECH_CLASS_SECTION_PREFIX
#define RESOURCE_SECTION_PREFIX
static bool lookup_unit_type(struct section_file *file, const char *prefix, const char *entry, const struct unit_type **result, const char *filename, const char *description)
static void send_ruleset_extras(struct conn_list *dest)
#define rs_sanity_veteran(_path, _entry, _i, _condition, _action)
static void send_ruleset_terrain(struct conn_list *dest)
#define GOVERNMENT_SECTION_PREFIX
static bool load_unit_names(struct section_file *file, struct rscompat_info *compat)
static void send_ruleset_trade_routes(struct conn_list *dest)
static void notify_ruleset_fallback(const char *msg)
static bool lookup_bv_actions(struct section_file *file, const char *filename, bv_actions *target, const char *path)
static void send_ruleset_buildings(struct conn_list *dest)
#define UNIT_CLASS_SECTION_PREFIX
static bool ruleset_load_names(struct name_translation *pname, const char *domain, struct section_file *file, const char *sec_name)
#define ROAD_SECTION_PREFIX
static const char * valid_ruleset_filename(const char *subdir, const char *name, const char *extension, bool optional)
static bool load_muuk_as_action_auto(struct section_file *file, struct action_auto_perf *auto_perf, const char *item, const char *filename)
#define NATION_SET_SECTION_PREFIX
#define RS_DEFAULT_DAMAGE_REDUCES_BOMBARD_RATE
#define RS_DEFAULT_TECH_TRADE_LOSS_HOLES
#define RS_DEFAULT_TECH_COST_STYLE
#define RS_DEFAULT_EXTRA_APPEARANCE
#define RS_DEFAULT_TECH_PARASITE_HOLES
#define GAME_DEFAULT_ACH_VALUE
#define RS_DEFAULT_TECH_TRADE_HOLES
#define RS_DEFAULT_CULTURE_VIC_POINTS
#define RS_DEFAULT_CULTURE_MIGRATION_PML
void(* rs_conversion_logger)(const char *msg)
#define RS_DEFAULT_SMALL_WONDER_VISIBILITY
#define ruleset_error(logger, level, format,...)
#define RS_DEFAULT_ONLY_KILLING_VETERAN
#define RS_DEFAULT_TECH_LOSS_HOLES
#define RS_DEFAULT_HISTORY_INTEREST_PML
#define RS_DEFAULT_TECH_UPKEEP_STYLE
#define RS_DEFAULT_GOODS_SELECTION
#define RS_DEFAULT_PYTHAGOREAN_DIAGONAL
#define RS_DEFAULT_TECH_STEAL_HOLES
#define GAME_DEFAULT_ACH_UNIQUE
#define RS_DEFAULT_COMBAT_ODDS_SCALED_VETERANCY
#define RS_DEFAULT_MUUK_FOOD_WIPE
#define RS_DEFAULT_MUUK_GOLD_WIPE
#define GAME_DEFAULT_CHANGABLE_TAX
#define RS_DEFAULT_MUUK_SHIELD_WIPE
#define RS_DEFAULT_GOLD_UPKEEP_STYLE
#define GAME_DEFAULT_NATIONALITY
#define GAME_DEFAULT_ADDTOSIZE
#define RS_DEFAULT_ONLY_REAL_FIGHT_VETERAN
#define RS_DEFAULT_EXTRA_DISAPPEARANCE
#define GAME_DEFAULT_VISION_REVEAL_TILES
#define RS_DEFAULT_CULTURE_VIC_LEAD
#define RS_DEFAULT_TECH_LEAKAGE
#define GAME_DEFAULT_DISASTER_FREQ
#define GAME_DEFAULT_CONVERT_SPEED
static struct compatibility compat[]
bool script_server_init(void)
bool script_server_load_file(const char *filename, char **buf)
void script_server_free(void)
bool script_server_do_file(struct connection *caller, const char *filename)
bool settings_ruleset(struct section_file *file, const char *section, bool act)
struct setting_list * level[OLEVELS_NUM]
bool check_strlen(const char *str, size_t len, const char *errmsg)
const char * fileinfoname(const struct strvec *dirs, const char *filename)
void remove_leading_trailing_spaces(char *s)
const struct strvec * get_data_dirs(void)
struct specialist * specialist_by_number(const Specialist_type_id id)
const char * specialist_rule_name(const struct specialist *sp)
#define specialist_type_iterate_end
#define specialist_type_iterate(sp)
#define DEFAULT_SPECIALIST
const char * aifill(int amount)
void update_nations_with_startpos(void)
void strvec_store(struct strvec *psv, const char *const *vec, size_t size)
struct strvec * strvec_new(void)
struct requirement_vector reqs
enum action_auto_perf_cause cause
action_id alternatives[MAX_NUM_ACTIONS]
struct requirement_vector actor_reqs
struct requirement_vector target_reqs
bool actor_consuming_always
enum action_result result
char ui_name[MAX_LEN_NAME]
bv_action_sub_results sub_results
enum action_actor_kind actor_kind
enum action_target_kind target_kind
struct advance * require[AR_SIZE]
enum base_gui_type gui_type
char citizens_graphic[MAX_LEN_NAME]
char graphic_alt[MAX_LEN_NAME]
char graphic[MAX_LEN_NAME]
struct civ_game::@29 rgame
const char ** allowed_govs
struct rgbcolor * plr_bg_color
struct civ_game::@30::@34 server
struct packet_ruleset_control control
int global_init_techs[MAX_NUM_TECH_LIST]
struct packet_game_info info
int autoupgrade_veteran_loss
char rulesetdir[MAX_LEN_NAME]
int incite_improvement_factor
struct section_file * luadata
int global_init_buildings[MAX_NUM_BUILDING_LIST]
struct civ_game::@30::@34::@39 ruledit
struct trait_limits default_traits[TRAIT_COUNT]
const char ** allowed_terrains
char * ruleset_description
const char ** allowed_styles
size_t embedded_nations_count
char * ruleset_capabilities
struct veteran_system * veteran
struct packet_calendar_info calendar
struct government * default_government
struct government * government_during_revolution
struct civ_map::@41::@43 server
struct requirement_vector receiver_reqs
struct requirement_vector giver_reqs
enum unit_type_flag_id flag
enum combat_bonus_type type
char graphic_str[MAX_LEN_NAME]
char graphic_alt[MAX_LEN_NAME]
struct requirement_vector obsolete_by
char soundtag_alt[MAX_LEN_NAME]
struct requirement_vector reqs
struct name_translation name
char soundtag[MAX_LEN_NAME]
struct requirement_vector reqs
char music_peaceful[MAX_LEN_NAME]
char music_combat[MAX_LEN_NAME]
struct name_translation noun_plural
struct nation_list * parent_nations
struct name_translation adjective
enum barbarian_type barb_type
struct nation_type::@50::@52 server
char positive_year_label[MAX_LEN_NAME]
char negative_year_label[MAX_LEN_NAME]
char calendar_fragment_name[MAX_CALENDAR_FRAGMENTS][MAX_LEN_NAME]
bool tech_steal_allow_holes
int illness_trade_infection
enum gameloss_style gameloss_style
int citizen_partisans_pct
enum goods_selection_method goods_selection
Government_type_id government_during_revolution_id
enum gold_upkeep_style gold_upkeep_style
bool damage_reduces_bombard_rate
int nuke_defender_survival_chance_pct
enum tech_upkeep_style tech_upkeep_style
bool tech_trade_loss_allow_holes
int granary_food_ini[MAX_GRANARY_INIS]
enum free_tech_method free_tech_method
bool steal_maps_reveals_all_cities
bool only_real_fight_makes_veteran
int low_firepower_pearl_harbour
int citizen_convert_speed
int illness_pollution_factor
enum tech_leakage_style tech_leakage
bool airlift_from_always_enabled
int civil_war_bonus_unhappy
bool only_killing_makes_veteran
bool poison_empties_food_stock
bool tech_loss_allow_holes
bv_actions diplchance_initial_odds
bool tech_trade_allow_holes
int low_firepower_nonnat_bombard
bool tech_parasite_allow_holes
int low_firepower_combat_bonus
int culture_migration_pml
int border_city_permanent_radius_sq
int low_firepower_badwallattacker
bool airlift_to_always_enabled
enum wonder_visib_type small_wonder_visibility
enum tech_cost_style tech_cost_style
bool combat_odds_scaled_veterancy
int civil_war_bonus_celebrating
int border_city_radius_sq
Government_type_id default_government_id
int min_city_center_output[O_LAST]
char rule_name[MAX_LEN_NAME]
enum achievement_type type
action_id alternatives[MAX_NUM_ACTIONS]
struct requirement reqs[MAX_NUM_REQS]
enum action_auto_perf_cause cause
struct requirement actor_reqs[MAX_NUM_REQS]
struct requirement target_reqs[MAX_NUM_REQS]
enum action_sub_target_kind sub_tgt_kind
enum action_actor_kind act_kind
bool actor_consuming_always
bv_action_sub_results sub_results
char ui_name[MAX_LEN_NAME]
enum action_target_kind tgt_kind
enum action_result result
enum base_gui_type gui_type
char helptext[MAX_LEN_PACKET]
struct requirement obs_reqs[MAX_NUM_REQS]
char soundtag_alt[MAX_LEN_NAME]
struct requirement reqs[MAX_NUM_REQS]
char soundtag[MAX_LEN_NAME]
char rule_name[MAX_LEN_NAME]
char graphic_str[MAX_LEN_NAME]
char graphic_alt[MAX_LEN_NAME]
char citizens_graphic[MAX_LEN_NAME]
char rule_name[MAX_LEN_NAME]
char graphic_alt[MAX_LEN_NAME]
char graphic[MAX_LEN_NAME]
struct requirement reqs[MAX_NUM_REQS]
struct requirement receiver_reqs[MAX_NUM_REQS]
struct requirement giver_reqs[MAX_NUM_REQS]
char preferred_soundset[MAX_LEN_NAME]
char version[MAX_LEN_NAME]
char preferred_tileset[MAX_LEN_NAME]
char alt_dir[MAX_LEN_NAME]
int num_achievement_types
char preferred_musicset[MAX_LEN_NAME]
char rule_name[MAX_LEN_NAME]
struct requirement reqs[MAX_NUM_REQS]
bv_disaster_effects effects
int work_raise_chance[MAX_VET_LEVELS]
int base_raise_chance[MAX_VET_LEVELS]
int global_init_techs[MAX_NUM_TECH_LIST]
int move_bonus[MAX_VET_LEVELS]
int global_init_techs_count
char veteran_name[MAX_VET_LEVELS][MAX_LEN_NAME]
Impr_type_id global_init_buildings[MAX_NUM_BUILDING_LIST]
int global_init_buildings_count
int power_fact[MAX_VET_LEVELS]
char helptext[MAX_LEN_PACKET]
char rule_name[MAX_LEN_NAME]
struct requirement reqs[MAX_NUM_REQS]
struct requirement reqs[MAX_NUM_REQS]
char rule_name[MAX_LEN_NAME]
char helptext[MAX_LEN_PACKET]
char music_combat[MAX_LEN_NAME]
struct requirement reqs[MAX_NUM_REQS]
char music_peaceful[MAX_LEN_NAME]
char groups[MAX_NUM_NATION_GROUPS][MAX_LEN_NAME]
bool hidden[MAX_NUM_NATION_GROUPS]
char rule_names[MAX_NUM_NATION_SETS][MAX_LEN_NAME]
char names[MAX_NUM_NATION_SETS][MAX_LEN_NAME]
char descriptions[MAX_NUM_NATION_SETS][MAX_LEN_MSG]
int init_techs[MAX_NUM_TECH_LIST]
char leader_name[MAX_NUM_LEADERS][MAX_LEN_NAME]
char noun_plural[MAX_LEN_NAME]
char adjective[MAX_LEN_NAME]
Impr_type_id init_buildings[MAX_NUM_BUILDING_LIST]
Unit_type_id init_units[MAX_NUM_UNIT_LIST]
bool leader_is_male[MAX_NUM_LEADERS]
char translation_domain[MAX_LEN_NAME]
char graphic_str[MAX_LEN_NAME]
Government_type_id init_government_id
int groups[MAX_NUM_NATION_GROUPS]
enum barbarian_type barbarian_type
int sets[MAX_NUM_NATION_SETS]
char graphic_alt[MAX_LEN_NAME]
char rule_name[MAX_LEN_NAME]
int tile_incr_const[O_LAST]
enum road_gui_type gui_type
enum road_move_mode move_mode
struct requirement first_reqs[MAX_NUM_REQS]
char rule_name[MAX_LEN_NAME]
char graphic_alt[MAX_LEN_NAME]
struct requirement reqs[MAX_NUM_REQS]
char helptext[MAX_LEN_PACKET]
char short_name[MAX_LEN_NAME]
char graphic_str[MAX_LEN_NAME]
char plural_name[MAX_LEN_NAME]
char rule_name[MAX_LEN_NAME]
char text[MAX_LEN_CONTENT]
char rule_name[MAX_LEN_NAME]
char helptxt[MAX_LEN_PACKET]
struct requirement research_reqs[MAX_NUM_REQS]
char graphic_str[MAX_LEN_NAME]
char rule_name[MAX_LEN_NAME]
char graphic_alt[MAX_LEN_NAME]
char helptext[MAX_LEN_PACKET]
char helptxt[MAX_LEN_PACKET]
Terrain_type_id transform_result
char helptext[MAX_LEN_PACKET]
Resource_type_id resources[MAX_RESOURCE_TYPES]
char graphic_str[MAX_LEN_NAME]
bv_unit_classes native_to
Terrain_type_id cultivate_result
Terrain_type_id plant_result
int road_output_incr_pct[O_LAST]
char graphic_alt[MAX_LEN_NAME]
char rule_name[MAX_LEN_NAME]
enum trade_route_illegal_cancelling cancelling
enum trade_route_bonus_type bonus_type
enum combat_bonus_type type
enum unit_type_flag_id flag
char helptxt[MAX_LEN_PACKET]
char rule_name[MAX_LEN_NAME]
bv_unit_class_flags flags
char helptext[MAX_LEN_PACKET]
char helptxt[MAX_LEN_PACKET]
char graphic_alt[MAX_LEN_NAME]
enum transp_def_type tp_defense
char rule_name[MAX_LEN_NAME]
int power_fact[MAX_VET_LEVELS]
char graphic_str[MAX_LEN_NAME]
char sound_fight_alt[MAX_LEN_NAME]
bv_unit_classes disembarks
char sound_move_alt[MAX_LEN_NAME]
struct requirement build_reqs[MAX_NUM_REQS]
int base_raise_chance[MAX_VET_LEVELS]
int work_raise_chance[MAX_VET_LEVELS]
char sound_fight[MAX_LEN_NAME]
char veteran_name[MAX_VET_LEVELS][MAX_LEN_NAME]
char sound_move[MAX_LEN_NAME]
char helptext[MAX_LEN_PACKET]
int move_bonus[MAX_VET_LEVELS]
char team_name[MAX_LEN_NAME]
enum req_vec_change_operation operation
int num_suggested_solutions
struct req_vec_change * suggested_solutions
enum road_gui_type gui_type
struct requirement_vector first_reqs
enum road_move_mode move_mode
int tile_incr_const[O_LAST]
rs_conversion_logger log_cb
struct requirement_vector reqs
char graphic_alt[MAX_LEN_NAME]
char graphic_str[MAX_LEN_NAME]
struct name_translation name
struct name_translation abbreviation
enum trade_route_bonus_type bonus_type
enum trade_route_illegal_cancelling cancelling
struct name_translation name
struct veteran_level * definitions
struct nation_style * style_by_rule_name(const char *name)
struct nation_style * style_by_number(int id)
void styles_alloc(int count)
struct music_style * music_style_by_number(int id)
int style_number(const struct nation_style *pstyle)
void music_styles_alloc(int count)
int style_index(const struct nation_style *pstyle)
#define music_styles_iterate(_p)
#define music_styles_iterate_end
#define styles_iterate(_p)
#define styles_iterate_end
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 fc_vsnprintf(char *str, size_t n, const char *format, va_list ap)
#define sz_strlcpy(dest, src)
#define RETURN_VALUE_AFTER_EXIT(_val_)
struct team_slot * team_slot_by_number(int team_id)
const char * team_slot_defined_name(const struct team_slot *tslot)
int team_slot_index(const struct team_slot *tslot)
int team_slot_count(void)
void team_slot_set_defined_name(struct team_slot *tslot, const char *team_name)
#define team_slots_iterate_end
#define team_slots_iterate(_tslot)
struct advance * advance_by_number(const Tech_type_id atype)
const char * tech_flag_id_name_cb(enum tech_flag_id flag)
void set_user_tech_flag_name(enum tech_flag_id id, const char *name, const char *helptxt)
struct advance * valid_advance(struct advance *padvance)
void techs_precalc_data(void)
const char * advance_rule_name(const struct advance *padvance)
const char * tech_flag_helptxt(enum tech_flag_id id)
struct advance * advance_by_rule_name(const char *name)
struct tech_class * tech_class_by_rule_name(const char *name)
Tech_type_id advance_number(const struct advance *padvance)
#define tech_class_index(_ptclass_)
#define tech_class_iterate_end
#define MAX_NUM_USER_TECH_FLAGS
#define advance_iterate(_start, _p)
static Tech_type_id advance_count(void)
#define tech_class_iterate(_p)
#define advance_iterate_end
struct terrain * terrain_by_rule_name(const char *name)
Terrain_type_id terrain_count(void)
const char * terrain_flag_id_name_cb(enum terrain_flag_id flag)
Terrain_type_id terrain_index(const struct terrain *pterrain)
struct terrain * terrain_by_number(const Terrain_type_id type)
const char * terrain_flag_helptxt(enum terrain_flag_id id)
struct resource_type * resource_type_init(struct extra_type *pextra)
void set_user_terrain_flag_name(enum terrain_flag_id id, const char *name, const char *helptxt)
Terrain_type_id terrain_number(const struct terrain *pterrain)
#define terrain_type_iterate(_p)
#define MAX_RESOURCE_TYPES
#define TERRAIN_UNKNOWN_IDENTIFIER
#define terrain_type_iterate_end
#define RESOURCE_NONE_IDENTIFIER
#define RESOURCE_NULL_IDENTIFIER
#define MAX_NUM_USER_TER_FLAGS
Goods_type_id goods_number(const struct goods_type *pgood)
enum trade_route_illegal_cancelling trade_route_cancelling_type_by_name(const char *name)
struct trade_route_settings * trade_route_settings_by_type(enum trade_route_type type)
const char * goods_rule_name(struct goods_type *pgood)
Goods_type_id goods_index(const struct goods_type *pgood)
enum trade_route_type trade_route_type_by_name(const char *name)
#define goods_type_iterate_end
#define goods_type_iterate(_p)
#define TRAIT_DEFAULT_VALUE
void set_unit_class_caches(struct unit_class *pclass)
const char * unit_class_flag_helptxt(enum unit_class_flag_id id)
struct unit_type * unit_type_by_rule_name(const char *name)
bool utype_has_role(const struct unit_type *punittype, int role)
void unit_type_action_cache_init(void)
void set_unit_type_caches(struct unit_type *ptype)
void role_unit_precalcs(void)
void veteran_system_definition(struct veteran_system *vsystem, int level, const char *vlist_name, int vlist_power, int vlist_move, int vlist_raise, int vlist_wraise)
Unit_type_id utype_count(void)
int utype_veteran_levels(const struct unit_type *punittype)
const char * utype_rule_name(const struct unit_type *punittype)
const struct veteran_level * utype_veteran_level(const struct unit_type *punittype, int level)
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)
const char * unit_type_flag_helptxt(enum unit_type_flag_id id)
Unit_type_id utype_index(const struct unit_type *punittype)
void set_user_unit_class_flag_name(enum unit_class_flag_id id, const char *name, const char *helptxt)
struct veteran_system * veteran_system_new(int count)
Unit_Class_id uclass_number(const struct unit_class *pclass)
bool utype_can_do_action(const struct unit_type *putype, const action_id act_id)
void set_user_unit_type_flag_name(enum unit_type_flag_id id, const char *name, const char *helptxt)
static bool uclass_has_flag(const struct unit_class *punitclass, enum unit_class_flag_id flag)
#define combat_bonus_list_iterate_end
#define combat_bonus_list_iterate(bonuslist, pbonus)
#define unit_class_iterate(_p)
#define MAX_NUM_USER_UNIT_FLAGS
static bool utype_has_flag(const struct unit_type *punittype, int flag)
#define UTYF_LAST_USER_FLAG
#define unit_type_iterate(_p)
#define uclass_index(_c_)
#define unit_class_iterate_end
#define unit_type_iterate_end
#define MAX_NUM_USER_UCLASS_FLAGS