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.",
2371 for (j = 0; j < nval; j++) {
2376 "\"%s\" unit_type \"%s\":"
2377 "has unknown unit class %s as cargo.",
2393 for (j = 0; j < nval; j++) {
2398 "\"%s\" unit_type \"%s\":"
2399 "has unknown unit class %s as target.",
2415 for (j = 0; j < nval; j++) {
2420 "\"%s\" unit_type \"%s\":"
2421 "has unknown unit class %s as embarkable.",
2437 for (j = 0; j < nval; j++) {
2442 "\"%s\" unit_type \"%s\":"
2443 "has unknown unit class %s as disembarkable.",
2470 if (!vision_layer_is_valid(u->vlayer)) {
2472 "\"%s\" unit_type \"%s\":"
2473 "has unknown vision layer %s.",
2482 0,
"%s.paratroopers_range", sec_name);
2484 u->rscompat_cache.paratroopers_mr_req
2486 file, 0,
"%s.paratroopers_mr_req", sec_name);
2487 u->rscompat_cache.paratroopers_mr_sub
2489 file, 0,
"%s.paratroopers_mr_sub", sec_name);
2491 u->rscompat_cache.paratroopers_mr_req = 0;
2492 u->rscompat_cache.paratroopers_mr_sub = 0;
2495 "%s.bombard_rate", sec_name);
2497 "%s.city_slots", sec_name);
2499 "%s.city_size", sec_name);
2502 "%s.tp_defense", sec_name);
2503 u->tp_defense = transp_def_type_by_name(sval,
fc_strcasecmp);
2504 if (!transp_def_type_is_valid(u->tp_defense)) {
2506 "\"%s\" unit_type \"%s\":"
2507 " bad tp_defense \"%s\".",
2525 for (j = 0; j < nval; j++) {
2527 if (0 == strcmp(sval,
"")) {
2531 u->vlayer = V_INVIS;
2535 if (!unit_type_flag_id_is_valid(ival)) {
2538 if (unit_class_flag_id_is_valid(ival)) {
2540 "\"%s\" unit_type \"%s\": unit_class flag!",
2544 "\"%s\" unit_type \"%s\": bad flag name \"%s\".",
2571 for (j = 0; j < nval; j++) {
2573 if (strcmp(sval,
"") == 0) {
2577 if (!unit_role_id_is_valid(ival)) {
2579 "\"%s\" unit_type \"%s\": bad role name \"%s\".",
2597 "\"%s\" unit_type \"%s\": depends on removed tech \"%s\".",
2607 section_list_destroy(csec);
2608 section_list_destroy(sec);
2624 struct section_list *sec;
2638 if (NULL == sec || 0 == (nval = section_list_size(sec))) {
2640 "\"%s\": No improvements?!?", filename);
2643 log_verbose(
"%d improvement types (including possibly unused)", nval);
2646 "\"%s\": Too many improvements (%d, max %d)",
2655 for (i = 0; i < nval; i++) {
2665 section_list_destroy(sec);
2676 struct section_list *sec;
2683 nval = (NULL != sec ? section_list_size(sec) : 0);
2685 for (i = 0; i < nval && ok; i++) {
2687 const char *sec_name =
section_name(section_list_get(sec, i));
2688 struct requirement_vector *
reqs =
2696 const char *sval, **slist;
2702 if (!impr_genus_id_is_valid(b->
genus)) {
2704 "\"%s\" improvement \"%s\": couldn't match "
2705 "genus \"%s\".", filename,
2714 for (j = 0; j < nflags; j++) {
2716 if (strcmp(sval,
"") == 0) {
2720 if (!impr_flag_id_is_valid(ival)) {
2722 "\"%s\" improvement \"%s\": bad flag name \"%s\".",
2736 requirement_vector_copy(&b->
reqs,
reqs);
2739 struct requirement_vector *obs_reqs =
2743 if (obs_reqs == NULL) {
2747 requirement_vector_copy(&b->
obsolete_by, obs_reqs);
2752 "%s.build_cost", sec_name)
2754 "%s.upkeep", sec_name)
2756 "%s.sabotage", sec_name)) {
2764 "%s.graphic", sec_name));
2767 "%s.graphic_alt", sec_name));
2771 "%s.sound", sec_name));
2774 "%s.sound_alt", sec_name));
2779 section_list_destroy(sec);
2795 struct section_list *sec = NULL;
2815 != terrain_flag_id_invalid()) {
2817 "\"%s\": Duplicate terrain flag name '%s'",
2824 "\"%s\": Too many user terrain flags!",
2843 "control.extra_flags%d.name",
2847 "control.extra_flags%d.helptxt", i);
2850 != extra_flag_id_invalid()) {
2852 "\"%s\": Duplicate extra flag name '%s'",
2859 "\"%s\": Too many user extra flags!",
2877 if (NULL == sec || 0 == (nval = section_list_size(sec))) {
2879 "\"%s\": ruleset doesn't have any terrains.",
2885 "\"%s\": Too many terrains (%d, max %d)",
2903 const char *sec_name =
section_name(section_list_get(sec, terri));
2914 section_list_destroy(sec);
2921 nval = (NULL != sec ? section_list_size(sec) : 0);
2924 "\"%s\": Too many extra types (%d, max %d)",
2941 for (idx = 0; idx < nval; idx++) {
2942 const char *sec_name =
section_name(section_list_get(sec, idx));
2954 section_list_destroy(sec);
2961 nval = (NULL != sec ? section_list_size(sec) : 0);
2964 "\"%s\": Too many base types (%d, max %d)",
2982 for (idx = 0; idx < nval; idx++) {
2983 const char *sec_name =
section_name(section_list_get(sec, idx));
2986 if (base_name != NULL) {
2989 if (pextra != NULL) {
2994 "No extra definition matching base definition \"%s\"",
3000 "Base section \"%s\" does not associate base with any extra",
3007 section_list_destroy(sec);
3014 nval = (NULL != sec ? section_list_size(sec) : 0);
3017 "\"%s\": Too many road types (%d, max %d)",
3035 for (idx = 0; idx < nval; idx++) {
3036 const char *sec_name =
section_name(section_list_get(sec, idx));
3039 if (road_name != NULL) {
3042 if (pextra != NULL) {
3047 "No extra definition matching road definition \"%s\"",
3053 "Road section \"%s\" does not associate road with any extra",
3060 section_list_destroy(sec);
3067 nval = (NULL != sec ? section_list_size(sec) : 0);
3070 "\"%s\": Too many resource types (%d, max %d)",
3088 for (idx = 0; idx < nval; idx++) {
3089 const char *sec_name =
section_name(section_list_get(sec, idx));
3090 const char *resource_name;
3095 if (resource_name != NULL) {
3098 if (pextra != NULL) {
3103 "No extra definition matching resource definition \"%s\"",
3109 "Resource section %s does not list extra this resource belongs to.",
3116 section_list_destroy(sec);
3129 bool compat_road =
FALSE;
3130 bool compat_rail =
FALSE;
3131 bool compat_river =
FALSE;
3141 "parameters.ocean_reclaim_requirement");
3144 "parameters.land_channel_requirement");
3147 "parameters.thaw_requirement");
3150 "parameters.freeze_requirement");
3153 "parameters.lake_max_size");
3156 "parameters.min_start_native_area");
3159 "parameters.move_fragments");
3162 "\"%s\": move_fragments must be at least 1",
3169 "parameters.igter_cost");
3172 "\"%s\": igter_cost must be at least 1",
3181 "parameters.pythagorean_diagonal");
3185 "parameters.ocean_resources");
3188 N_(
"?gui_type:Build Type A Base"),
3189 "extraui.ui_name_base_fortress");
3193 N_(
"?gui_type:Build Type B Base"),
3194 "extraui.ui_name_base_airbase");
3211 pterrain->identifier
3213 if (
'\0' == pterrain->identifier) {
3215 "\"%s\" [%s] identifier missing value.",
3216 filename, tsection);
3222 "\"%s\" [%s] cannot use '%c' as an identifier;"
3223 " it is reserved for unknown terrain.",
3224 filename, tsection, pterrain->identifier);
3228 for (j =
T_FIRST; j < i; j++) {
3231 "\"%s\" [%s] has the same identifier as [%s].",
3244 pterrain->tclass = terrain_class_by_name(cstr,
fc_strcasecmp);
3245 if (!terrain_class_is_valid(pterrain->tclass)) {
3247 "\"%s\": [%s] unknown class \"%s\"",
3248 filename, tsection, cstr);
3254 "%s.movement_cost", tsection)
3256 "%s.defense_bonus", tsection)) {
3269 pterrain->resources =
fc_calloc(nval + 1,
sizeof(*pterrain->resources));
3270 for (j = 0; j < nval; j++) {
3272 if (pterrain->resources[j] == NULL) {
3277 pterrain->resources[nval] = NULL;
3286 pterrain->road_output_incr_pct[o]
3291 if (!
lookup_time(file, &pterrain->base_time, tsection,
"base_time",
3292 filename, NULL, &ok)
3293 || !
lookup_time(file, &pterrain->road_time, tsection,
"road_time",
3294 filename, NULL, &ok)) {
3300 if (!
lookup_terrain(file,
"cultivate_result", filename, pterrain,
3301 &pterrain->cultivate_result,
FALSE)) {
3302 if (
compat->compat_mode) {
3303 if (!
lookup_terrain(file,
"irrigation_result", filename, pterrain,
3304 &pterrain->cultivate_result,
TRUE)) {
3314 if (!
compat->compat_mode && pterrain->cultivate_result == pterrain) {
3316 "%s: Cultivating result in terrain itself.",
3322 "%s.irrigation_food_incr", tsection)
3324 tsection,
"irrigation_time", filename, NULL, &ok)) {
3331 &pterrain->plant_result,
FALSE)) {
3332 if (
compat->compat_mode) {
3334 &pterrain->plant_result,
TRUE)) {
3344 if (!
compat->compat_mode && pterrain->plant_result == pterrain) {
3346 "%s: Planting result in terrain itself.",
3352 "%s.mining_shield_incr", tsection)
3354 tsection,
"mining_time", filename, NULL, &ok)) {
3361 tsection,
"cultivate_time", filename, NULL, &ok)) {
3362 if (
compat->compat_mode) {
3363 if (pterrain->cultivate_result != pterrain) {
3364 if (pterrain->cultivate_result == NULL && pterrain->irrigation_time != 0) {
3368 if (
compat->log_cb != NULL) {
3372 "Changed %s cultivate_time to zero, as it inconsistently had "
3373 "irrigation_result \"no\" and nonzero irrigation_time.",
3377 pterrain->cultivate_time = 0;
3379 pterrain->cultivate_time = pterrain->irrigation_time;
3381 pterrain->irrigation_time = 0;
3383 pterrain->cultivate_time = 0;
3384 pterrain->cultivate_result = NULL;
3388 "%s: Missing cultivate_time", tsection);
3393 if ((pterrain->cultivate_result != NULL
3394 && pterrain->cultivate_time <= 0)
3395 || (pterrain->cultivate_result == NULL
3396 && pterrain->cultivate_time > 0)) {
3398 "%s: cultivate_result and cultivate_time disagree "
3399 "whether cultivating is enabled", tsection);
3405 tsection,
"plant_time", filename, NULL, &ok)) {
3406 if (
compat->compat_mode) {
3407 if (pterrain->plant_result != pterrain) {
3408 if (pterrain->plant_result == NULL && pterrain->mining_time != 0) {
3412 if (
compat->log_cb != NULL) {
3416 "Changed %s plant_time to zero, as it inconsistently had "
3417 "mining_result \"no\" and nonzero mining_time.",
3421 pterrain->plant_time = 0;
3423 pterrain->plant_time = pterrain->mining_time;
3425 pterrain->mining_time = 0;
3427 pterrain->plant_time = 0;
3428 pterrain->plant_result = NULL;
3437 if ((pterrain->plant_result != NULL
3438 && pterrain->plant_time <= 0)
3439 || (pterrain->plant_result == NULL
3440 && pterrain->plant_time > 0)) {
3442 "%s: plant_result and plant_time disagree "
3443 "whether planting is enabled", tsection);
3449 &pterrain->animal, filename,
3455 if (!
lookup_terrain(file,
"transform_result", filename, pterrain,
3456 &pterrain->transform_result,
TRUE)) {
3461 tsection,
"transform_time", filename, NULL, &ok)) {
3467 if (pterrain->transform_time <= 0) {
3471 pterrain->transform_result = NULL;
3472 }
else if (pterrain->transform_result == NULL) {
3473 pterrain->transform_time = 0;
3476 if ((pterrain->transform_result != NULL
3477 && pterrain->transform_time <= 0)
3478 || (pterrain->transform_result == NULL
3479 && pterrain->transform_time > 0)) {
3481 "%s: transform_result and transform_time disagree "
3482 "whether transforming is enabled", tsection);
3487 pterrain->placing_time = 1;
3489 tsection,
"placing_time", filename, NULL, &ok);
3491 pterrain->pillage_time = 1;
3493 tsection,
"pillage_time", filename, NULL, &ok);
3494 pterrain->clean_pollution_time = 3;
3495 lookup_time(file, &pterrain->clean_pollution_time,
3496 tsection,
"clean_pollution_time", filename, NULL, &ok);
3497 pterrain->clean_fallout_time = 3;
3499 tsection,
"clean_fallout_time", filename, NULL, &ok);
3501 if (!
lookup_terrain(file,
"warmer_wetter_result", filename, pterrain,
3502 &pterrain->warmer_wetter_result,
TRUE)
3503 || !
lookup_terrain(file,
"warmer_drier_result", filename, pterrain,
3504 &pterrain->warmer_drier_result,
TRUE)
3505 || !
lookup_terrain(file,
"cooler_wetter_result", filename, pterrain,
3506 &pterrain->cooler_wetter_result,
TRUE)
3507 || !
lookup_terrain(file,
"cooler_drier_result", filename, pterrain,
3508 &pterrain->cooler_drier_result,
TRUE)) {
3515 for (j = 0; j < nval; j++) {
3516 const char *sval = slist[j];
3517 enum terrain_flag_id flag
3520 if (!terrain_flag_id_is_valid(flag)) {
3522 "\"%s\" [%s] has unknown flag \"%s\".",
3523 filename, tsection, sval);
3527 BV_SET(pterrain->flags, flag);
3537 enum mapgen_terrain_property mtp;
3538 for (mtp = mapgen_terrain_property_begin();
3539 mtp != mapgen_terrain_property_end();
3540 mtp = mapgen_terrain_property_next(mtp)) {
3541 pterrain->property[mtp]
3543 mapgen_terrain_property_name(mtp));
3549 for (j = 0; j < nval; j++) {
3554 "\"%s\" [%s] is native to unknown unit class \"%s\".",
3555 filename, tsection, slist[j]);
3571 if (!
rgbcolor_load(file, &pterrain->rgb,
"%s.color", tsection)) {
3573 "Missing terrain color definition: %s",
3580 pterrain->helptext =
lookup_strvec(file, tsection,
"helptext");
3593 struct requirement_vector *
reqs;
3594 const char *catname;
3596 enum extra_cause cause;
3597 enum extra_rmcause rmcause;
3598 const char *eus_name;
3599 const char *vis_req_name;
3600 const struct advance *vis_req;
3603 if (catname == NULL) {
3605 "\"%s\" extra \"%s\" has no category.",
3610 pextra->category = extra_category_by_name(catname,
fc_strcasecmp);
3611 if (!extra_category_is_valid(pextra->category)) {
3613 "\"%s\" extra \"%s\" has invalid category \"%s\".",
3621 for (cj = 0; cj < nval; cj++) {
3622 const char *sval = slist[cj];
3626 if (!extra_cause_is_valid(cause)) {
3628 "\"%s\" extra \"%s\": unknown cause \"%s\".",
3633 pextra->causes |= (1 << cause);
3638 if (pextra->causes == 0) {
3654 pextra->rmcauses = 0;
3655 for (j = 0; j < nval; j++) {
3656 const char *sval = slist[j];
3660 if (!extra_rmcause_is_valid(rmcause)) {
3662 "\"%s\" extra \"%s\": unknown rmcause \"%s\".",
3667 pextra->rmcauses |= (1 << rmcause);
3688 "%s.rmact_gfx_alt",
section));
3700 requirement_vector_copy(&pextra->reqs,
reqs);
3707 requirement_vector_copy(&pextra->rmreqs,
reqs);
3714 requirement_vector_copy(&pextra->appearance_reqs,
reqs);
3721 requirement_vector_copy(&pextra->disappearance_reqs,
reqs);
3729 pextra->build_time = 0;
3733 "%s.build_time_factor",
section);
3734 pextra->removal_time = 0;
3738 "%s.removal_time_factor",
section);
3741 if (pextra->infracost > 0) {
3748 if (pextra->defense_bonus != 0) {
3757 pextra->eus = extra_unit_seen_type_by_name(eus_name,
fc_strcasecmp);
3758 if (!extra_unit_seen_type_is_valid(pextra->eus)) {
3760 "\"%s\" extra \"%s\" has illegal unit_seen value \"%s\".",
3765 if (pextra->eus == EUS_HIDDEN) {
3770 "%s.appearance_chance",
3774 "%s.disappearance_chance",
3779 for (j = 0; j < nval; j++) {
3782 if (uclass == NULL) {
3784 "\"%s\" extra \"%s\" is native to unknown unit class \"%s\".",
3800 for (j = 0; j < nval; j++) {
3801 const char *sval = slist[j];
3802 enum extra_flag_id flag = extra_flag_id_by_name(sval,
fc_strcasecmp);
3804 if (!extra_flag_id_is_valid(flag)) {
3806 "\"%s\" extra \"%s\": unknown flag \"%s\".",
3811 BV_SET(pextra->flags, flag);
3825 for (j = 0; j < nval; j++) {
3826 const char *sval = slist[j];
3829 if (pextra2 == NULL) {
3831 "\"%s\" extra \"%s\": unknown conflict extra \"%s\".",
3849 for (j = 0; j < nval; j++) {
3850 const char *sval = slist[j];
3855 "\"%s\" extra \"%s\" hidden by unknown extra \"%s\".",
3871 for (j = 0; j < nval; j++) {
3872 const char *sval = slist[j];
3877 "\"%s\" extra \"%s\" bridged over unknown extra \"%s\".",
3892 "%s.visibility_req",
section);
3895 if (vis_req == NULL) {
3897 "\"%s\" %s: unknown visibility_req %s.",
3898 filename,
section, vis_req_name);
3919 if (!presource->data.resource) {
3921 "\"%s\" extra \"%s\" has \"Resource\" cause but no "
3922 "corresponding [resource_*] section",
3929 presource->data.resource->output[o] =
3936 presource->data.resource->id_old_save = identifier[0];
3939 "\"%s\" [%s] identifier missing value.",
3940 filename, rsection);
3946 "\"%s\" [%s] cannot use '%c' as an identifier;"
3948 filename, rsection, presource->data.resource->id_old_save);
3967 "\"%s\" resource section [%s]: extra \"%s\" does not "
3968 "have \"Resource\" in its causes",
3969 filename,
section, extra_name);
3981 if (pres->data.resource->id_old_save == pres2->data.resource->id_old_save
3984 "\"%s\" [%s] has the same identifier as [%s].",
4004 const char *gui_str;
4008 "\"%s\" extra \"%s\" has \"Base\" cause but no "
4009 "corresponding [base_*] section",
4018 if (!base_gui_type_is_valid(pbase->
gui_type)) {
4020 "\"%s\" base \"%s\": unknown gui_type \"%s\".",
4029 "%s.vision_main_sq",
4032 "%s.vision_invis_sq",
4035 "%s.vision_subs_sq",
4038 if (
compat->compat_mode) {
4043 for (bj = 0; bj < nval; bj++) {
4044 const char *sval = slist[bj];
4048 "\"%s\" base \"%s\": unknown flag \"%s\".",
4053 if (!
BV_ISSET(pextra->flags, EF_NOT_AGGRESSIVE)) {
4055 BV_SET(pextra->flags, EF_NOT_AGGRESSIVE);
4074 if (pextra == pextra2) {
4095 "\"%s\" base section [%s]: extra \"%s\" does not have "
4096 "\"Base\" in its causes",
4097 filename,
section, extra_name);
4104 bv_extras compat_bridged;
4106 if (
compat->compat_mode) {
4115 for (j = 0; j < nval; j++) {
4117 BV_SET(compat_bridged, pextra->id);
4126 const char *special;
4127 const char *modestr;
4128 struct requirement_vector *
reqs;
4129 const char *gui_str;
4133 "\"%s\" extra \"%s\" has \"Road\" cause but no "
4134 "corresponding [road_*] section",
4158 if (!road_move_mode_is_valid(proad->
move_mode)) {
4160 "Illegal move_mode \"%s\" for road \"%s\"",
4182 "Multiple roads marked as compatibility \"Road\"");
4190 "Multiple roads marked as compatibility \"Railroad\"");
4198 "Multiple roads marked as compatibility \"River\"");
4201 compat_river =
TRUE;
4207 "Illegal compatibility special \"%s\" for road %s",
4217 if (gui_str == NULL) {
4222 "\"%s\" road \"%s\": no gui_type.",
4229 if (!road_gui_type_is_valid(proad->
gui_type)) {
4231 "\"%s\" road \"%s\": unknown gui_type \"%s\".",
4240 for (j = 0; j < nval; j++) {
4241 const char *sval = slist[j];
4245 if (textra != NULL) {
4251 "\"%s\" road \"%s\" integrates with unknown road \"%s\".",
4267 for (j = 0; j < nval; j++) {
4268 const char *sval = slist[j];
4274 if (
BV_ISSET(compat_bridged, pbridged->id)) {
4275 BV_SET(pextra->bridged_over, pbridged->id);
4279 enum road_flag_id flag = road_flag_id_by_name(sval,
fc_strcasecmp);
4281 if (!road_flag_id_is_valid(flag)) {
4283 "\"%s\" road \"%s\": unknown flag \"%s\".",
4306 "\"%s\" road section [%s]: extra \"%s\" does not have "
4307 "\"Road\" in its causes",
4308 filename,
section, extra_name);
4316 pextra->bridged = extra_type_list_new();
4318 if (
BV_ISSET(pextra->bridged_over, pbridged->id)) {
4319 extra_type_list_append(pextra->bridged, pbridged);
4340 struct section_list *sec;
4352 if (NULL == sec || 0 == (nval = section_list_size(sec))) {
4355 }
else if (nval >
G_LAST) {
4357 "\"%s\": Too many governments (%d, max %d)",
4368 const char *sec_name =
4378 section_list_destroy(sec);
4382 nval = (NULL != sec ? section_list_size(sec) : 0);
4386 "\"%s\": Too many multipliers (%d, max %d)",
4396 const char *sec_name =
4401 "\"%s\": Cannot load multiplier names",
4410 section_list_destroy(sec);
4421 struct section_list *sec;
4440 const char *sec_name =
section_name(section_list_get(sec, i));
4441 struct requirement_vector *
reqs =
4454 if (g->ai.better == NULL) {
4459 g->ai.better = NULL;
4461 requirement_vector_copy(&g->reqs,
reqs);
4476 const char *sec_name =
4478 const char *male, *female;
4484 "Lack of default ruler titles for "
4485 "government \"%s\" (nb %d): %s",
4492 "Lack of default ruler titles for "
4493 "government \"%s\" (nb %d).",
4501 section_list_destroy(sec);
4507 const char *sec_name =
section_name(section_list_get(sec,
id));
4508 struct requirement_vector *
reqs;
4520 if (pmul->stop <= pmul->start) {
4522 "Multiplier \"%s\" stop (%d) must be greater "
4524 pmul->stop, pmul->start);
4533 if (((pmul->stop - pmul->start) % pmul->step) != 0) {
4535 "Multiplier \"%s\" step (%d) does not fit "
4536 "exactly into interval start-stop (%d to %d)",
4538 pmul->start, pmul->stop);
4547 if (pmul->def < pmul->start || pmul->def > pmul->stop) {
4549 "Multiplier \"%s\" default (%d) not within "
4551 pmul->def, pmul->start, pmul->stop);
4555 if (((pmul->def - pmul->start) % pmul->step) != 0) {
4557 "Multiplier \"%s\" default (%d) not legal "
4558 "with respect to step size %d",
4564 "%s.offset", sec_name);
4566 "%s.factor", sec_name);
4567 if (pmul->factor == 0) {
4569 "Multiplier \"%s\" scaling factor must "
4585 requirement_vector_copy(&pmul->reqs,
reqs);
4589 section_list_destroy(sec);
4626 while (desc_left > 0) {
4628 int this_len = desc_left;
4634 part.text[this_len] =
'\0';
4638 desc_left -= this_len;
4655 if (prev_leader == pleader) {
4672 struct section_list *sec;
4687 "No available nations in this ruleset!");
4691 "Too many nations (max %d, we have %d)!",
4700 const char *sec_name =
section_name(section_list_get(sec, i));
4702 "%s.translation_domain", sec_name);
4704 "%s.plural", sec_name);
4707 if (domain == NULL) {
4708 domain =
"freeciv-nations";
4711 if (!strcmp(
"freeciv-core", domain)) {
4712 pl->translation_domain = NULL;
4714 && !strcmp(
"freeciv", domain)) {
4715 pl->translation_domain = NULL;
4716 }
else if (!strcmp(
"freeciv-nations", domain)) {
4717 pl->translation_domain =
fc_strdup(domain);
4720 "Unsupported translation domain \"%s\" for %s",
4730 name_set(&pl->noun_plural, pl->translation_domain, noun_plural);
4733 for (j = 0; j < i && ok; j++) {
4742 "Two nations defined with the same adjective \"%s\": "
4743 "in section \'%s\' and section \'%s\'",
4752 "Two nations defined with the same rule_name \"%s\": "
4753 "in section \'%s\' and section \'%s\'",
4761 "Two nations defined with the same plural name \"%s\": "
4762 "in section \'%s\' and section \'%s\'",
4774 section_list_destroy(sec);
4792 if (pgroup == NULL) {
4797 section_list_destroy(sec);
4812 for (i = 0; i <
len; i++) {
4826 const char *secfile_str1,
4827 const char *secfile_str2,
4828 const char **allowed_terrains,
4834 secfile_str1, secfile_str2);
4841 for (j = 0; j < dim; j++) {
4843 char city_name[
len + 1], *p, *next, *end;
4853 if ((p = strchr(city_name,
'('))) {
4856 if (!(end = strchr(p,
')'))) {
4858 "\"%s\" [%s] %s: city name \"%s\" "
4860 secfile_str1, secfile_str2,
cities[j]);
4863 for (*end++ =
'\0';
'\0' != *end; end++) {
4866 "\"%s\" [%s] %s: city name \"%s\" "
4867 "contains characters after last parenthesis.",
4883 "\"%s\" [%s] %s: city name \"%s\" is too long.",
4885 secfile_str1, secfile_str2, city_name);
4896 if ((next = strchr(p,
','))) {
4916 "\"%s\" [%s] %s: city \"%s\" "
4917 "has terrain hint \"%s\" not in allowed_terrains.",
4927 if (NULL == pterrain) {
4929 size_t l = strlen(p);
4932 char saved = p[l - 1];
4936 if (pterrain == NULL) {
4953 "\"%s\" [%s] %s: city \"%s\" "
4954 "has terrain hint \"%s\" not in allowed_terrains.",
4960 }
else if (!pterrain) {
4966 "\"%s\" [%s] %s: city \"%s\" "
4967 "has unknown terrain hint \"%s\".",
4974 if (NULL != pterrain) {
4979 p = next ? next + 1 : NULL;
4980 }
while (NULL != p &&
'\0' != *p);
5002 const char *
name, *bad_leader;
5006 struct section_list *sec = NULL;
5015 "ruledit.embedded_nations");
5032 for (tr = trait_begin(); tr != trait_end(); tr = trait_next(tr)) {
5047 "Default values for trait %s not sane.",
5056 "compatibility.allowed_govs");
5072 "compatibility.allowed_terrains");
5088 "compatibility.allowed_styles");
5104 "compatibility.default_government");
5112 "Tried to set unknown government type \"%s\" as default_government!",
5128 const char *set_name, *set_rule_name, *set_description;
5135 if (NULL == set_name || NULL == set_rule_name) {
5140 if (
nation_set_new(set_name, set_rule_name, set_description) == NULL) {
5145 section_list_destroy(sec);
5150 "must be defined.");
5158 "compatibility.default_nationset");
5165 "Unknown default_nationset \"%s\".", sval);
5188 if (pgroup == NULL) {
5204 section_list_destroy(sec);
5214 char tmp[200] =
"\0";
5216 const char *sec_name =
section_name(section_list_get(sec, i));
5220 if (default_set >= 0) {
5221 nation_set_list_append(pnation->sets,
5225 for (j = 0; j < dim; j++) {
5229 fc_assert(pset == NULL || pgroup == NULL);
5232 nation_set_list_append(pnation->sets, pset);
5233 }
else if (NULL != pgroup) {
5234 nation_group_list_append(pnation->groups, pgroup);
5240 log_verbose(
"Nation %s: Unknown set/group \"%s\".",
5247 if (nation_set_list_size(pnation->sets) < 1) {
5249 "Nation %s is not a member of any nation set",
5257 for (j = 0; j < dim; j++) {
5260 if (pnation == pconflict) {
5262 "Nation %s conflicts with itself",
5266 }
else if (NULL != pconflict) {
5267 nation_list_append(pnation->server.conflicts_with, pconflict);
5273 log_verbose(
"Nation %s: conflicts_with nation \"%s\" is unknown.",
5287 bool is_male =
FALSE;
5300 "Nation %s: leader name \"%s\" is too long.",
5316 "Nation %s: leader \"%s\" has unsupported "
5317 "sex variant \"%s\".",
5336 "Nation %s: Too many leaders; max is %d",
5340 }
else if (0 == j) {
5342 "Nation %s: no leaders; at least one is required.",
5351 "Nation %s: leader \"%s\" defined more than once.",
5359 (void)
rgbcolor_load(file, &pnation->server.rgb,
"%s.color", sec_name);
5363 for (tr = trait_begin(); tr != trait_end(); tr = trait_next(tr)) {
5364 bool server_traits_used =
TRUE;
5366 if (pnation->server.traits[tr].min < 0) {
5369 server_traits_used =
FALSE;
5371 if (pnation->server.traits[tr].max < 0) {
5374 server_traits_used =
FALSE;
5376 if (pnation->server.traits[tr].fixed < 0) {
5377 if (server_traits_used) {
5380 int diff = pnation->server.traits[tr].max - pnation->server.traits[tr].min;
5383 pnation->server.traits[tr].fixed = diff / 2 + pnation->server.traits[tr].min;
5386 if (pnation->server.traits[tr].max < pnation->server.traits[tr].min) {
5388 "%s values for trait %s not sane.",
5399 pnation->is_playable =
5404 "%s.barbarian_type", sec_name);
5405 pnation->barb_type = barbarian_type_by_name(barb_type,
fc_strcasecmp);
5406 if (!barbarian_type_is_valid(pnation->barb_type)) {
5408 "Nation %s, barbarian_type is invalid (\"%s\")",
5414 if (pnation->barb_type != NOT_A_BARBARIAN
5415 && pnation->is_playable) {
5419 "Nation %s marked both barbarian and playable.",
5430 "%s.flag_alt", sec_name));
5434 const char *male, *female;
5437 "%s.ruler_titles%d.government",
5464 "Nation %s: government \"%s\" not in allowed_govs.",
5476 "Nation %s: government \"%s\" not found.",
5482 if (NULL != male && NULL != female) {
5504 if (pnation->style == NULL) {
5510 "Nation %s: Illegal style \"%s\"",
5515 log_verbose(
"Nation %s: style \"%s\" not supported in this "
5516 "ruleset; using default.",
5524 "%s.civilwar_nations", sec_name);
5525 for (j = 0; j < dim; j++) {
5531 if (pconflict == pnation) {
5533 "Nation %s is its own civil war nation",
5537 }
else if (NULL != pconflict) {
5538 nation_list_append(pnation->server.civilwar_nations, pconflict);
5545 log_verbose(
"Nation %s: civil war nation \"%s\" is unknown.",
5558 pnation->init_techs, filename)) {
5563 pnation->init_buildings, filename)) {
5568 pnation->init_units, filename)) {
5579 if (pnation->init_government == NULL) {
5590 "Nation %s: init_government \"%s\" not allowed.",
5610 "Nation %s: legend \"%s\" is too long.",
5617 pnation->player = NULL;
5619 section_list_destroy(sec);
5626 section_list_destroy(sec);
5639 int num_playable = 0, barb_land_count = 0, barb_sea_count = 0, barb_both_count = 0;
5644 case NOT_A_BARBARIAN:
5649 case LAND_BARBARIAN:
5655 case ANIMAL_BARBARIAN:
5658 case LAND_AND_SEA_BARBARIAN:
5666 if (num_playable < 1) {
5668 "Nation set \"%s\" has no playable nations. "
5673 if (barb_land_count == 0 && barb_both_count == 0) {
5675 "No land barbarian nation defined in set \"%s\". "
5680 if (barb_sea_count == 0 && barb_both_count == 0) {
5682 "No sea barbarian nation defined in set \"%s\". "
5701 struct section_list *sec;
5714 "No available nation styles in this ruleset!");
5723 const char *sec_name =
section_name(section_list_get(sec, i));
5729 section_list_destroy(sec);
5746 section_list_destroy(sec);
5761 struct section_list *sec;
5771 struct requirement_vector *
reqs;
5772 const char *sec_name =
section_name(section_list_get(sec, i));
5780 "%s.citizens_graphic", sec_name));
5790 section_list_destroy(sec);
5803 struct requirement_vector *
reqs;
5809 "%s.music_peaceful", sec_name));
5812 "%s.music_combat", sec_name));
5819 requirement_vector_copy(&pmus->
reqs,
reqs);
5825 section_list_destroy(sec);
5838 const char *uflags_path,
5839 const char *filename)
5844 enum unit_type_flag_id *protecor_flag;
5852 if (!protecor_flag) {
5855 "\"%s\": %s: bad unit type flag list.",
5856 filename, uflags_path);
5861 for (i = 0; i < psize; i++) {
5862 requirement_vector_append(&auto_perf->
reqs,
5869 free(protecor_flag);
5881 const char *actions_path,
5882 const char *filename)
5886 enum gen_action *unit_acts;
5891 "%s", actions_path);
5896 "\"%s\": %s: bad action list",
5897 filename, actions_path);
5902 for (i = 0; i < asize; i++) {
5918 const char *filename)
5920 char uflags_path[100];
5921 char action_path[100];
5924 "missing_unit_upkeep.%s_protected",
item);
5926 "missing_unit_upkeep.%s_unit_act",
item);
5942 struct section_list *sec;
5954 if (section_list_size(sec) >=
SP_MAX) {
5956 "\"%s\": Too many specialists (%d, max %d).",
5957 filename, section_list_size(sec),
SP_MAX);
5969 struct requirement_vector *
reqs;
5978 "%s.short_name", sec_name);
5984 "\"%s\": No graphic tag for specialist at %s.",
5985 filename, sec_name);
5992 "%s.graphic_alt", sec_name));
5999 requirement_vector_copy(&s->
reqs,
reqs);
6012 "\"%s\": must give a min_size of 0 for at least one "
6013 "specialist type.", filename);
6016 section_list_destroy(sec);
6024 "parameters.celebrate_size_limit");
6029 "parameters.angry_citizens");
6042 "\"%s\": Forced taxes do not add up in ruleset!",
6052 "parameters.vision_reveal_tiles");
6060 "citizen.nationality");
6063 "citizen.convert_speed");
6076 auto_perf->
cause = AAPC_UNIT_UPKEEP;
6079 requirement_vector_append(&auto_perf->
reqs,
6091 "missing_unit_upkeep.food_wipe");
6095 auto_perf->
cause = AAPC_UNIT_UPKEEP;
6098 requirement_vector_append(&auto_perf->
reqs,
6110 "missing_unit_upkeep.gold_wipe");
6114 auto_perf->
cause = AAPC_UNIT_UPKEEP;
6117 requirement_vector_append(&auto_perf->
reqs,
6129 "missing_unit_upkeep.shield_wipe");
6145 struct section_list *sec;
6147 const char *filename;
6162 enum effect_type eff;
6167 struct requirement_vector *
reqs;
6173 "\"%s\" [%s] missing effect type.", filename, sec_name);
6183 if (!effect_type_is_valid(eff)) {
6185 "\"%s\" [%s] lists unknown effect type \"%s\".",
6186 filename, sec_name,
type);
6194 const char *multiplier_name
6197 if (multiplier_name) {
6201 "\"%s\" [%s] has unknown multiplier \"%s\".",
6202 filename, sec_name, multiplier_name);
6224 section_list_destroy(sec);
6237 int def,
int min,
int max,
6238 const char *path, ...)
6241 int def,
int min,
int max,
6242 const
char *path, ...)
6248 va_start(args, path);
6258 "\"%s\" should be in the interval [%d, %d] "
6259 "but is %d; using the minimal value.",
6260 fullpath, min, max, ival);
6266 "\"%s\" should be in the interval [%d, %d] "
6267 "but is %d; using the maximal value.",
6268 fullpath, min, max, ival);
6280 const char *compat_name)
6285 if (compat_name != NULL) {
6287 "actions.%s", compat_name);
6306 if (vname != NULL) {
6307 struct entry *pentry;
6312 if (pentry == NULL) {
6315 if (compat_name != NULL) {
6321 if (pentry == NULL) {
6362 if (vname != NULL) {
6417 const char *filename,
6423 char fullpath[1024];
6425 fc_snprintf(fullpath,
sizeof(fullpath),
"actions.%s",
6429 enum gen_action *blocking_actions;
6436 if (!blocking_actions) {
6439 "\"%s\": %s: bad action list",
6440 filename, fullpath);
6445 for (j = 0; j < asize; j++) {
6449 free(blocking_actions);
6461 const char *filename,
6466 char action_list_path[100];
6474 auto_perf->
cause = AAPC_POST_ACTION;
6477 requirement_vector_append(&auto_perf->
reqs,
6483 fc_snprintf(action_list_path,
sizeof(action_list_path),
6487 action_list_path, filename)) {
6498 const char *filename,
6503 enum gen_action *listed_actions;
6510 if (!listed_actions) {
6518 for (j = 0; j < asize; j++) {
6519 BV_SET(*target, listed_actions[j]);
6522 free(listed_actions);
6534 const char *sval, **svec;
6535 const char *filename;
6539 const char *pref_text;
6541 struct section_list *sec;
6558 if (pref_text[0] !=
'\0') {
6560 " Use correct spelling tileset.preferred instead");
6563 if (pref_text[0] !=
'\0') {
6573 if (pref_text[0] !=
'\0') {
6575 " Use correct spelling soundset.preferred instead");
6578 if (pref_text[0] !=
'\0') {
6588 if (pref_text[0] !=
'\0') {
6590 " Use correct spelling musicset.preferred instead");
6593 if (pref_text[0] !=
'\0') {
6607 if (pref_text[0] !=
'\0') {
6616 if (pref_text[0] !=
'\0') {
6625 if (pref_text[0] !=
'\0') {
6629 len = strlen(pref_text);
6641 if (pref_text[0] !=
'\0') {
6645 len = strlen(pref_text);
6659 if (pref_text[0] !=
'\0') {
6660 int len = strlen(pref_text);
6687 "options.popup_tech_help");
6692 "civstyle.base_pollution");
6697 for (j = 0; j < nval; j++) {
6698 enum gameloss_style style;
6701 if (strcmp(sval,
"") == 0) {
6705 if (!gameloss_style_is_valid(style)) {
6707 "\"%s\": bad value \"%s\" for gameloss_style.",
6724 "civstyle.happy_cost");
6730 "civstyle.food_cost");
6736 "civstyle.civil_war_bonus_celebrating");
6740 "civstyle.civil_war_bonus_unhappy");
6747 "civstyle.base_bribe_cost");
6753 "civstyle.ransom_gold");
6756 "civstyle.pillage_select");
6760 "civstyle.tech_steal_allow_holes");
6763 "civstyle.tech_trade_allow_holes");
6766 "civstyle.tech_trade_loss_allow_holes");
6769 "civstyle.tech_parasite_allow_holes");
6772 "civstyle.tech_loss_allow_holes");
6779 "civstyle.upgrade_veteran_loss");
6785 "civstyle.autoupgrade_veteran_loss");
6792 "research.base_tech_cost");
6795 "civstyle.granary_food_ini");
6800 "Too many granary_food_ini entries (%d, max %d)",
6804 log_error(
"No values for granary_food_ini. Using default "
6813 if (food_ini[gi] <= 0) {
6817 food_ini[gi] = food_ini[gi - 1];
6819 log_error(
"Bad value for granary_food_ini[%i]. Using %i.",
6834 "civstyle.granary_food_inc");
6842 "civstyle.min_city_center_%s",
6848 const char *tus_text;
6855 "civstyle.init_vis_radius_sq");
6862 "civstyle.init_city_radius_sq");
6865 "civstyle.gold_upkeep_style");
6870 "Unknown gold upkeep style \"%s\"",
6876 "civstyle.output_granularity");
6890 "wonder_visibility.small_wonders");
6896 "Unknown wonder visibility type \"%s\"",
6905 "illness.illness_on");
6911 "illness.illness_base_factor");
6917 "illness.illness_min_size");
6923 "illness.illness_trade_infection");
6929 "illness.illness_pollution_factor");
6937 "incite_cost.base_incite_cost");
6943 "incite_cost.improvement_factor");
6949 "incite_cost.unit_factor");
6955 "incite_cost.total_factor");
6973 struct requirement_vector *
reqs;
6978 auto_perf->
cause = AAPC_UNIT_MOVED_ADJ;
6981 "auto_attack",
"if_attacker",
6986 requirement_vector_copy(&auto_perf->
reqs,
reqs);
6989 "auto_attack.attack_actions",
6993 "\"%s\": %s: failed load %s.",
6994 filename,
"auto_attack",
"attack_actions");
6998 if (ok &&
compat->compat_mode) {
6999 enum unit_type_flag_id *protecor_flag;
7005 "%s",
"auto_attack.will_never");
7007 if (!protecor_flag) {
7010 "\"%s\": %s: bad unit type flag list.",
7011 filename,
"auto_attack.will_never");
7017 protecor_flag = NULL;
7021 psize, protecor_flag)) {
7024 "\"%s\": %s: failed to upgrade.",
7025 filename,
"auto_attack");
7039 int force_capture_units, force_bombard, force_explode_nuclear;
7042 "actions.force_trade_route")) {
7046 ACTION_TRADE_ROUTE);
7053 "actions.force_capture_units");
7055 if (force_capture_units) {
7057 ACTION_CAPTURE_UNITS);
7059 ACTION_CAPTURE_UNITS);
7061 ACTION_CAPTURE_UNITS);
7063 ACTION_CAPTURE_UNITS);
7065 ACTION_CAPTURE_UNITS);
7067 ACTION_CAPTURE_UNITS);
7069 ACTION_CAPTURE_UNITS);
7071 ACTION_CAPTURE_UNITS);
7073 ACTION_CAPTURE_UNITS);
7075 ACTION_CAPTURE_UNITS);
7077 ACTION_CAPTURE_UNITS);
7079 ACTION_CAPTURE_UNITS);
7086 "actions.force_bombard");
7088 if (force_bombard) {
7146 force_explode_nuclear
7148 "actions.force_explode_nuclear");
7150 if (force_explode_nuclear) {
7201 "actions.diplchance_initial_odds")) {
7213 "actions.poison_empties_food_stock");
7220 "actions.steal_maps_reveals_all_cities");
7246 enum gen_action *quiet_actions;
7252 "actions.quiet_actions");
7254 if (!quiet_actions) {
7257 "\"%s\": actions.quiet_actions: bad action list",
7262 for (j = 0; j < asize; j++) {
7267 free(quiet_actions);
7276 BV_SET(paction->sub_results, ACT_SUB_RES_HUT_ENTER);
7279 ACT_SUB_RES_HUT_ENTER);
7281 ACT_SUB_RES_HUT_ENTER);
7285 BV_SET(paction->sub_results, ACT_SUB_RES_HUT_FRIGHTEN);
7288 ACT_SUB_RES_HUT_FRIGHTEN);
7290 ACT_SUB_RES_HUT_FRIGHTEN);
7297 "civstyle.paradrop_to_transport")
7316 ACTION_SPY_BRIBE_UNIT))) {
7332 auto_perf->
cause = AAPC_CITY_GONE;
7338 "actions.escape_city", filename)) {
7350 auto_perf->
cause = AAPC_UNIT_STACK_DEATH;
7356 "actions.unit_stack_death", filename)) {
7370 struct requirement_vector *actor_reqs;
7371 struct requirement_vector *target_reqs;
7372 const char *action_text;
7378 if (action_text == NULL) {
7380 "\"%s\" [%s] missing action to enable.",
7381 filename, sec_name);
7389 "\"%s\" [%s] lists unknown action type \"%s\".",
7390 filename, sec_name, action_text);
7398 if (actor_reqs == NULL) {
7403 requirement_vector_copy(&enabler->
actor_reqs, actor_reqs);
7406 if (target_reqs == NULL) {
7411 requirement_vector_copy(&enabler->
target_reqs, target_reqs);
7416 section_list_destroy(sec);
7424 "global_unit_options.slow_invasions");
7432 const char *tus_text;
7438 "combat_rules.tired_attack");
7442 "combat_rules.only_killing_makes_veteran");
7446 "combat_rules.only_real_fight_makes_veteran");
7450 "combat_rules.combat_odds_scaled_veterancy");
7454 default_drbr =
FALSE;
7458 "combat_rules.damage_reduces_bombard_rate");
7462 "combat_rules.low_firepower_badwallattacker");
7465 "combat_rules.low_firepower_pearl_harbour");
7468 "combat_rules.low_firepower_combat_bonus");
7471 "combat_rules.low_firepower_nonnat_bombard");
7477 "combat_rules.nuke_pop_loss_pct");
7483 "combat_rules.nuke_defender_survival_chance_pct");
7491 "borders.radius_sq_city");
7497 "borders.size_effect");
7504 "borders.radius_sq_city_permanent");
7508 "research.tech_cost_style");
7513 "Unknown tech cost style \"%s\"",
7519 "research.tech_leakage");
7524 "Unknown tech leakage \"%s\"",
7530 log_error(
"Only tech_leakage \"%s\" supported with "
7531 "tech_cost_style \"%s\". ",
7532 tech_leakage_style_name(TECH_LEAKAGE_NONE),
7533 tech_cost_style_name(TECH_COST_CIV1CIV2));
7534 log_error(
"Switching to tech_leakage \"%s\".",
7535 tech_leakage_style_name(TECH_LEAKAGE_NONE));
7543 "research.base_tech_cost");
7546 "research.tech_upkeep_style");
7552 "Unknown tech upkeep style \"%s\"",
7564 "research.tech_upkeep_divider");
7569 "No free_tech_method given");
7575 "Bad value %s for free_tech_method.", sval);
7587 "culture.victory_min_points");
7590 "culture.victory_lead_pct");
7593 "culture.migration_pml");
7596 "culture.history_interest_pml");
7601 "calendar.skip_year_0");
7604 "calendar.start_year");
7610 "Too many calendar fragments. Max is %d",
7618 "calendar.positive_label"));
7622 "calendar.negative_label"));
7628 if (fname != NULL) {
7638 bool color_read =
TRUE;
7646 while (color_read) {
7649 color_read =
rgbcolor_load(file, &prgbcolor,
"playercolors.colorlist%d", i);
7666 "No background player color defined! (%s)",
7681 for (i = 0; i < teams; i++) {
7687 nval = (NULL != sec ? section_list_size(sec) : 0);
7692 "\"%s\": Too many disaster types (%d, max %d)",
7694 section_list_destroy(sec);
7706 struct requirement_vector *
reqs;
7707 const char *sec_name =
section_name(section_list_get(sec,
id));
7711 "\"%s\": Cannot load disaster names",
7722 requirement_vector_copy(&pdis->reqs,
reqs);
7725 "%s.frequency", sec_name);
7730 for (j = 0; j < eff_count; j++) {
7731 const char *dsval = svec[j];
7732 enum disaster_effect_id
effect;
7736 if (!disaster_effect_id_is_valid(
effect)) {
7738 "\"%s\" disaster \"%s\": unknown effect \"%s\".",
7753 section_list_destroy(sec);
7761 const char *sec_name =
section_name(section_list_get(sec,
id));
7762 const char *
typename;
7767 pach->type = achievement_type_by_name(
typename,
fc_strcasecmp);
7768 if (!achievement_type_is_valid(pach->type)) {
7770 "Achievement has unknown type \"%s\".",
7771 typename != NULL ?
typename :
"(NULL)");
7777 "%s.unique", sec_name);
7780 "%s.value", sec_name);
7782 "%s.culture", sec_name);
7787 "Achievement %s has no first msg!", sec_name);
7797 if (!pach->unique) {
7799 "Achievement %s has no msg for consecutive gainers!",
7812 section_list_destroy(sec);
7817 "trade.settings%d.type",
7823 "\"%s\" unknown trade route type \"%s\".",
7832 "trade.settings%d.pct", i);
7834 "trade.settings%d.cancelling", i);
7838 "\"%s\" unknown trade route cancelling type \"%s\".",
7847 if (!trade_route_bonus_type_is_valid(set->
bonus_type)) {
7849 "\"%s\" unknown trade route bonus type \"%s\".",
7865 "trade.goods_selection");
7871 "\"%s\" goods selection method \"%s\" unknown.",
7882 const char *sec_name =
section_name(section_list_get(sec,
id));
7883 struct requirement_vector *
reqs;
7892 requirement_vector_copy(&pgood->reqs,
reqs);
7895 "%s.from_pct", sec_name);
7897 "%s.to_pct", sec_name);
7899 "%s.onetime_pct", sec_name);
7903 for (j = 0; j < nval; j++) {
7904 enum goods_flag_id flag;
7908 if (!goods_flag_id_is_valid(flag)) {
7914 BV_SET(pgood->flags, flag);
7919 pgood->helptext =
lookup_strvec(file, sec_name,
"helptext");
7921 section_list_destroy(sec);
7928 int num = section_list_size(sec);
7930 for (i = 0; i < num; i++) {
7931 const char *sec_name =
section_name(section_list_get(sec, i));
7933 "%s.type", sec_name);
7936 struct requirement_vector *
reqs;
7938 if (!clause_type_is_valid(
type)) {
7940 "\"%s\" unknown clause type \"%s\".",
7941 filename, clause_name);
7950 "\"%s\" duplicate clause type \"%s\" definition.",
7951 filename, clause_name);
7973 section_list_destroy(sec);
7993 const char *flagname;
7996 fpacket.
id = i + UCF_USER_FLAG_1;
7998 flagname = unit_class_flag_id_name(i + UCF_USER_FLAG_1);
7999 if (flagname == NULL) {
8000 fpacket.
name[0] =
'\0';
8022 packet.
flags = c->flags;
8044 const char *flagname;
8047 fpacket.
id = i + UTYF_USER_FLAG_1;
8049 flagname = unit_type_flag_id_name(i + UTYF_USER_FLAG_1);
8050 if (flagname == NULL) {
8051 fpacket.
name[0] =
'\0';
8103 packet.
fuel = u->fuel;
8104 packet.
flags = u->flags;
8105 packet.
roles = u->roles;
8108 packet.
upkeep[o] = u->upkeep[o];
8115 packet.
cargo = u->cargo;
8119 packet.
vlayer = u->vlayer;
8121 if (u->veteran == NULL) {
8140 packet.
worker = u->adv.worker;
8160 bonuspacket.
unit = packet.
id;
8161 bonuspacket.
flag = pbonus->flag;
8162 bonuspacket.
type = pbonus->type;
8163 bonuspacket.
value = pbonus->value;
8164 bonuspacket.
quiet = pbonus->quiet;
8183 packet.
id = spec_id;
8191 packet.
reqs[j++] = *preq;
8208 packet.
id = ptclass->idx;
8211 packet.
cost_pct = ptclass->cost_pct;
8228 const char *flagname;
8231 fpacket.
id = i + TECH_USER_1;
8234 if (flagname == NULL) {
8235 fpacket.
name[0] =
'\0';
8253 if (a->tclass == NULL) {
8256 packet.
tclass = a->tclass->idx;
8300 packet.
flags = a->flags;
8301 packet.
cost = a->cost;
8320 packet.
genus = b->genus;
8327 packet.
reqs[j++] = *preq;
8336 packet.
upkeep = b->upkeep;
8338 packet.
flags = b->flags;
8360 const char *flagname;
8363 fpacket.
id = i + TER_USER_1;
8366 if (flagname == NULL) {
8367 fpacket.
name[0] =
'\0';
8386 packet.
tclass = pterrain->tclass;
8398 packet.
output[o] = pterrain->output[o];
8402 for (r = pterrain->resources; *r; r++) {
8439 packet.
flags = pterrain->flags;
8462 packet.
output[o] = presource->data.resource->output[o];
8480 const char *flagname;
8483 fpacket.
id = i + EF_USER_FLAG_1;
8485 flagname = extra_flag_id_name(i + EF_USER_FLAG_1);
8486 if (flagname == NULL) {
8487 fpacket.
name[0] =
'\0';
8512 for (j = 0; j < EC_COUNT; j++) {
8519 for (j = 0; j < ERM_COUNT; j++) {
8535 packet.
reqs[j++] = *preq;
8541 packet.
rmreqs[j++] = *preq;
8568 packet.
eus = e->eus;
8572 packet.
flags = e->flags;
8662 packet.
reqs[j++] = *preq;
8667 packet.
to_pct = g->to_pct;
8669 packet.
flags = g->flags;
8695 packet.
reqs[j++] = *preq;
8721 packet.
type = a->type;
8722 packet.
unique = a->unique;
8723 packet.
value = a->value;
8800 packet.
cause = aperf->cause;
8804 packet.
reqs[counter++] = *req;
8814 packet.
alternatives[counter] = aperf->alternatives[counter];
8859 gov.reqs[j++] = *preq;
8912 groups_packet.
hidden[i] = pgroup->hidden;
8919 if (
n->translation_domain == NULL) {
8960 if (
n->init_techs[i] !=
A_LAST) {
8969 const struct unit_type *t =
n->init_units[i];
8980 if (
n->init_buildings[i] !=
B_LAST) {
9021 for (i = 0; i < CLAUSE_COUNT; i++) {
9055 packet.
start = pmul->start;
9056 packet.
stop = pmul->stop;
9057 packet.
step = pmul->step;
9058 packet.
def = pmul->def;
9059 packet.
offset = pmul->offset;
9060 packet.
factor = pmul->factor;
9068 packet.
reqs[j++] = *preq;
9092 city_p.
reqs[j++] = *preq;
9117 packet.
id = pmus->id;
9124 packet.
reqs[j++] = *preq;
9229 bool act,
bool buffer_script,
bool load_luadata)
9234 act, buffer_script, load_luadata)) {
9250 if (restore != NULL) {
9287 log_normal(
_(
"Cannot load any ruleset. Freeciv-web ruleset is available from "
9288 "https://github.com/freeciv/freeciv-web"));
9323 bool act,
bool buffer_script,
bool load_luadata)
9325 struct section_file *techfile, *unitfile, *buildfile, *govfile, *terrfile;
9326 struct section_file *stylefile, *cityfile, *nationfile, *effectfile, *gamefile;
9334 compat_info.
log_cb = logger;
9351 server.playable_nations = 0;
9369 if (techfile == NULL
9370 || buildfile == NULL
9374 || stylefile == NULL
9376 || nationfile == NULL
9377 || effectfile == NULL
9378 || gamefile == NULL) {
9510 if (pret ==
TRI_MAYBE && buffer_script) {
9512 "-- This file is for lua-functionality for parsing luadata.txt\n-- of this ruleset.");
9518 if (ok && !buffer_script) {
9558 "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