46 #define FORMAT_VERSION 20
59 if (rsname !=
nullptr && rsname[0] !=
'\0') {
60 fc_snprintf(buf,
sizeof(buf),
"%s %s data for Freeciv21", rsname,
63 fc_snprintf(buf,
sizeof(buf),
"Template %s data for Freeciv21", rstype);
78 int default_value,
const char *path,
81 if (value != default_value) {
82 if (
entry !=
nullptr) {
96 bool default_value,
const char *path,
99 if ((value && !default_value) || (!value && default_value)) {
100 if (
entry !=
nullptr) {
117 struct entry *mod_entry;
134 const struct requirement_vector *
reqs,
135 const char *path,
const char *
entry)
138 bool includes_negated =
false;
139 bool includes_surviving =
false;
140 bool includes_quiet =
false;
144 if (!preq->present) {
145 includes_negated =
true;
147 if (preq->survives) {
148 includes_surviving =
true;
151 includes_quiet =
true;
160 "%s.%s%d.type", path,
entry, i);
162 "%s.%s%d.name", path,
entry, i);
166 if (includes_surviving) {
171 if (includes_negated) {
176 if (includes_quiet) {
192 const char *path,
const char *
entry)
215 const struct advance *padv,
const char *path,
232 const struct terrain *pthis,
const char *path,
235 if (save ==
nullptr) {
237 }
else if (save == pthis) {
250 const struct government *gov,
const char *path,
263 const char *path,
const char *
entry)
271 building_names[set_count++] =
289 const std::array<unit_type *, MAX_NUM_UNIT_LIST> &input,
290 const char *path,
const char *
entry)
296 for (
const auto &utype : input) {
297 if (utype ==
nullptr) {
315 bv_unit_classes *bits,
const char *path,
316 const char *
entry,
bool unreachable_only)
345 if (to_save !=
nullptr) {
357 const char *filename)
370 if (sfile ==
nullptr) {
379 if (!pb->ruledit_disabled) {
381 const char *flag_names[IF_COUNT];
385 fc_snprintf(path,
sizeof(path),
"building_%d", sect_idx++);
392 if (strcmp(pb->graphic_str,
"-")) {
395 if (strcmp(pb->graphic_alt,
"-")) {
398 if (strcmp(pb->soundtag,
"-")) {
401 if (strcmp(pb->soundtag_alt,
"-")) {
413 for (flagi = 0; flagi < IF_COUNT; flagi++) {
415 flag_names[set_count++] = impr_flag_id_name(impr_flag_id(flagi));
424 save_strvec(sfile, pb->helptext, path,
"helptext");
441 if (sfile ==
nullptr) {
452 fc_snprintf(path,
sizeof(path),
"style_%d", sect_idx++);
464 fc_snprintf(path,
sizeof(path),
"citystyle_%d", sect_idx++);
471 if (strcmp(
city_styles[i].citizens_graphic,
"-")) {
473 "%s.citizens_graphic", path);
475 if (strcmp(
city_styles[i].citizens_graphic_alt,
"generic")) {
477 "%s.citizens_graphic_alt", path);
490 fc_snprintf(path,
sizeof(path),
"musicstyle_%d", sect_idx++);
493 "%s.music_peaceful", path);
495 "%s.music_combat", path);
511 struct section_file *sfile,
const int aap,
const char *uflags_path,
512 bool (*unexpected_req)(
const struct requirement *preq))
523 fc_assert(req->range == REQ_RANGE_LOCAL);
525 if (req->source.kind == VUT_UTFLAG) {
528 protecor_flag[i++] = unit_type_flag_id(req->source.value.unitflag);
529 }
else if (unexpected_req(req)) {
530 qCritical(
"Can't handle action auto performer requirement %s",
542 qCritical(
"%s: didn't save all unit type flags.", uflags_path);
557 const int aap,
const char *actions_path)
575 qCritical(
"%s: didn't save all actions.", actions_path);
600 char uflags_path[100];
601 char action_path[100];
604 "missing_unit_upkeep.%s_protected",
item);
606 "missing_unit_upkeep.%s_unit_act",
item);
621 if (sfile ==
nullptr) {
633 fc_snprintf(path,
sizeof(path),
"specialist_%d", sect_idx++);
639 "%s.short_name", path);
655 "parameters.celebrate_size_limit");
659 "parameters.add_to_size_limit");
663 "parameters.angry_citizens");
667 "parameters.changeable_budget");
669 if (
game.
info.forced_science != 0) {
671 "parameters.forced_science");
673 if (
game.
info.forced_luxury != 100) {
675 "parameters.forced_luxury");
679 "parameters.forced_gold");
683 "parameters.vision_reveal_tiles");
685 if (
game.
info.pop_report_zeroes != 1) {
687 "parameters.pop_report_zeroes");
691 "citizen.nationality");
695 "citizen.convert_speed");
697 if (
game.
info.conquest_convert_pct != 0) {
699 "citizen.conquest_convert_pct");
701 if (
game.
info.citizen_partisans_pct != 0) {
703 "citizen.partisans_pct");
709 "missing_unit_upkeep.food_wipe");
715 "missing_unit_upkeep.gold_wipe");
721 "missing_unit_upkeep.shield_wipe");
762 if (sfile ==
nullptr) {
846 action_target_kind,
"actions.%s",
883 enum gameloss_style gs;
888 const char *tnames[
game.
server.ruledit.named_teams];
892 int force_capture_units, force_bombard, force_explode_nuclear;
894 if (sfile ==
nullptr) {
898 if (
game.
server.ruledit.description_file !=
nullptr) {
900 "ruledit.description_file");
905 "tileset.preferred");
909 "soundset.preferred");
913 "musicset.preferred");
924 struct entry *mod_entry;
932 if (
game.
server.ruledit.description_file ==
nullptr) {
934 "about.description");
937 sfile,
game.
server.ruledit.description_file,
"about.description");
943 "about.capabilities");
949 "global_init_techs");
951 "global_init_buildings");
954 "options.popup_tech_help",
nullptr);
960 for (gs = gameloss_style_begin(); gs != gameloss_style_end();
961 gs = gameloss_style_next(gs)) {
962 if (
game.
info.gameloss_style & gs) {
963 style_names[set_count++] = gameloss_style_name(gs);
969 "civstyle.gameloss_style");
973 "civstyle.happy_cost",
nullptr);
975 "civstyle.food_cost",
nullptr);
977 "civstyle.civil_war_enabled",
nullptr);
980 "civstyle.civil_war_bonus_celebrating",
nullptr);
983 "civstyle.civil_war_bonus_unhappy",
nullptr);
985 "civstyle.paradrop_to_transport",
nullptr);
990 "civstyle.ransom_gold",
nullptr);
996 "civstyle.tech_steal_allow_holes",
nullptr);
999 "civstyle.tech_trade_allow_holes",
nullptr);
1002 "civstyle.tech_trade_loss_allow_holes",
nullptr);
1005 "civstyle.tech_parasite_allow_holes",
nullptr);
1008 "civstyle.tech_loss_allow_holes",
nullptr);
1011 "civstyle.upgrade_veteran_loss",
nullptr);
1014 "civstyle.autoupgrade_veteran_loss",
nullptr);
1018 "civstyle.granary_food_ini");
1028 fc_snprintf(buffer,
sizeof(buffer),
"civstyle.min_city_center_%s",
1046 gold_upkeep_style_name(
game.
info.gold_upkeep_style),
1047 "civstyle.gold_upkeep_style");
1050 "civstyle.output_granularity",
nullptr);
1052 "illness.illness_on",
nullptr);
1055 "illness.illness_base_factor",
nullptr);
1061 "illness.illness_trade_infection",
nullptr);
1064 "illness.illness_pollution_factor",
nullptr);
1067 "incite_cost.base_incite_cost",
nullptr);
1070 "incite_cost.improvement_factor",
nullptr);
1095 "auto_attack.attack_actions");
1109 ACTION_CAPTURE_UNITS);
1112 "actions.force_capture_units",
nullptr);
1116 "actions.force_bombard",
nullptr);
1117 force_explode_nuclear =
1121 "actions.force_explode_nuclear",
nullptr);
1125 "actions.poison_empties_food_stock",
nullptr);
1129 "actions.steal_maps_reveals_all_cities",
nullptr);
1145 quiet_actions[i] = gen_action(act);
1152 "actions.quiet_actions")
1154 qCritical(
"Didn't save all quiet actions.");
1165 if (pae->disabled) {
1169 fc_snprintf(path,
sizeof(path),
"actionenabler_%d", sect_idx++);
1180 "combat_rules.tired_attack",
nullptr);
1183 "combat_rules.only_killing_makes_veteran",
nullptr);
1186 "combat_rules.nuke_pop_loss_pct",
nullptr);
1189 "combat_rules.nuke_defender_survival_chance_pct",
1193 "borders.radius_sq_city",
nullptr);
1199 "borders.radius_sq_city_permanent",
nullptr);
1201 "research.tech_cost_style");
1206 "research.tech_leakage");
1208 tech_upkeep_style_name(
game.
info.tech_upkeep_style),
1209 "research.tech_upkeep_style");
1212 "research.tech_upkeep_divider",
nullptr);
1214 free_tech_method_name(
game.
info.free_tech_method),
1215 "research.free_tech_method");
1219 "culture.victory_min_points",
nullptr);
1228 "culture.history_interest_pml",
nullptr);
1234 "calendar.start_year",
nullptr);
1236 "calendar.fragments",
nullptr);
1239 if (
game.
calendar.calendar_fragment_name[i][0] !=
'\0') {
1241 "calendar.fragment_name%d", i);
1247 "calendar.positive_label");
1251 "calendar.negative_label");
1261 rgbcolor_save(sfile, pcol,
"playercolors.colorlist%d", col_idx++);
1266 for (i = 0; i <
game.
server.ruledit.named_teams; i++) {
1280 enum disaster_effect_id de;
1281 const char *effect_names[DE_COUNT];
1283 fc_snprintf(path,
sizeof(path),
"disaster_%d", sect_idx++);
1292 for (de = disaster_effect_id_begin(); de != disaster_effect_id_end();
1293 de = disaster_effect_id_next(de)) {
1295 effect_names[set_count++] = disaster_effect_id_name(de);
1299 if (set_count > 0) {
1313 fc_snprintf(path,
sizeof(path),
"achievement_%d", sect_idx++);
1327 if (pach->cons_msg !=
nullptr) {
1334 for (
int itrt = 0; itrt <
TRT_LAST; itrt++) {
1343 fc_snprintf(path,
sizeof(path),
"trade.settings%d", set_count++);
1360 const char *flag_names[GF_COUNT];
1363 fc_snprintf(path,
sizeof(path),
"goods_%d", sect_idx++);
1374 for (flagi = 0; flagi < GF_COUNT; flagi++) {
1376 flag_names[set_count++] = goods_flag_id_name(goods_flag_id(flagi));
1380 if (set_count > 0) {
1384 save_strvec(sfile, pgood->helptext, path,
"helptext");
1392 for (i = 0; i < CLAUSE_COUNT; i++) {
1398 fc_snprintf(path,
sizeof(path),
"clause_%d", sect_idx++);
1426 "settings.set%d.value", set_count);
1430 "settings.set%d.value", set_count);
1434 "settings.set%d.value", set_count);
1439 "settings.set%d.value", set_count);
1444 "settings.set%d.value", set_count);
1449 "settings.set%d.value", set_count);
1455 "settings.set%d.lock", set_count);
1474 if (sfile ==
nullptr) {
1479 "during_revolution");
1485 if (!pg.ruledit_disabled) {
1489 fc_snprintf(path,
sizeof(path),
"government_%d", sect_idx++);
1498 if (pg.ai.better !=
nullptr) {
1502 const auto prtitle = pg.ruler_titles->value(
nullptr);
1503 if (prtitle !=
nullptr) {
1507 if (title !=
nullptr) {
1512 if (title !=
nullptr) {
1517 save_strvec(sfile, pg.helptext, path,
"helptext");
1527 if (!pmul->ruledit_disabled) {
1530 fc_snprintf(path,
sizeof(path),
"multiplier_%d", sect_idx++);
1541 save_strvec(sfile, pmul->helptext, path,
"helptext");
1555 const char *field_prefix)
1561 const char *trait_names[] = {
"expansionist",
"trader",
"aggressive",
1564 for (tr = trait_begin(); tr != trait_end() && trait_names[tr] !=
nullptr;
1565 tr = trait_next(tr)) {
1566 int default_default;
1568 default_default = (traits[tr].
min + traits[tr].
max) / 2;
1571 || (default_traits !=
nullptr
1572 && traits[tr].
min != default_traits[tr].
min)) {
1574 field_prefix, trait_names[tr]);
1577 || (default_traits !=
nullptr
1578 && traits[tr].max != default_traits[tr].max)) {
1580 field_prefix, trait_names[tr]);
1582 if (default_default != traits[tr].fixed) {
1584 field_prefix, trait_names[tr]);
1598 int max_items = nation_city_list_size(pnat->
server.default_cities);
1599 char *city_str[max_items];
1602 const char *list_items[max_items];
1606 fc_snprintf(path,
sizeof(path),
"nation_%d", sect_idx++);
1612 "%s.translation_domain", path);
1635 if (set_count > 0) {
1645 if (set_count > 0) {
1654 "%s.leaders%d.name", path, subsect_idx);
1657 "%s.leaders%d.sex", path, subsect_idx++);
1661 if (pnat->
server.rgb !=
nullptr) {
1672 if (pnat->
barb_type != NOT_A_BARBARIAN) {
1674 "%s.barbarian_type", path);
1687 prtitle = pgov.ruler_titles->value(pnat);
1690 "%s.ruler_titles%d.government", path, subsect_idx);
1692 "%s.ruler_titles%d.male_title", path, subsect_idx);
1695 "%s.ruler_titles%d.female_title", path, subsect_idx++);
1707 if (set_count > 0) {
1709 "%s.civilwar_nations", path);
1718 "%s.init_government", path);
1724 bool list_started =
false;
1726 city_str[set_count] =
1734 strcat(city_str[set_count],
" (!river");
1735 list_started =
true;
1738 strcat(city_str[set_count],
" (river");
1739 list_started =
true;
1747 const char *pref =
nullptr;
1761 if (pref !=
nullptr) {
1763 strcat(city_str[set_count],
", ");
1765 strcat(city_str[set_count],
" (");
1766 list_started =
true;
1768 strcat(city_str[set_count], pref);
1775 strcat(city_str[set_count],
")");
1778 list_items[set_count] = city_str[set_count];
1782 if (set_count > 0) {
1787 for (i = 0; i < set_count; i++) {
1788 delete[] city_str[i];
1789 city_str[i] =
nullptr;
1806 if (sfile ==
nullptr) {
1813 if (
game.
server.ruledit.embedded_nations !=
nullptr) {
1816 new const char *[
game.
server.ruledit.embedded_nations_count];
1820 for (i = 0; i <
game.
server.ruledit.embedded_nations_count; i++) {
1821 tmp[i] =
game.
server.ruledit.embedded_nations[i];
1826 "ruledit.embedded_nations");
1834 if (
game.
server.ruledit.allowed_govs !=
nullptr) {
1837 "compatibility.allowed_govs");
1839 if (
game.
server.ruledit.allowed_terrains !=
nullptr) {
1842 "compatibility.allowed_terrains");
1844 if (
game.
server.ruledit.allowed_styles !=
nullptr) {
1847 "compatibility.allowed_styles");
1853 "compatibility.default_government");
1859 if (
game.
server.ruledit.embedded_nations !=
nullptr) {
1865 sect_idx <
game.
server.ruledit.embedded_nations_count;
1868 game.
server.ruledit.embedded_nations[sect_idx]);
1870 if (pnat ==
nullptr) {
1871 qCritical(
"Embedded nation \"%s\" not found!",
1872 game.
server.ruledit.embedded_nations[sect_idx]);
1887 fc_snprintf(path,
sizeof(path),
"nset_%d", sect_idx++);
1896 "%s.description", path);
1907 fc_snprintf(path,
sizeof(path),
"ngroup_%d", sect_idx++);
1912 if (pgroup->hidden) {
1939 if (sfile ==
nullptr) {
1944 const char *flagname =
1948 if (flagname !=
nullptr) {
1965 fc_snprintf(path,
sizeof(path),
"techclass_%d", sect_idx++);
1978 const char *flag_names[TF_COUNT];
1982 fc_snprintf(path,
sizeof(path),
"advance_%d", sect_idx++);
1987 if (pa->tclass !=
nullptr) {
2002 if (strcmp(
"-", pa->graphic_alt)) {
2005 if (pa->bonus_message !=
nullptr) {
2011 for (flagi = 0; flagi < TF_COUNT; flagi++) {
2013 flag_names[set_count++] = tech_flag_id_name(tech_flag_id(flagi));
2017 if (set_count > 0) {
2021 if (pa->cost >= 0) {
2025 save_strvec(sfile, pa->helptext, path,
"helptext");
2042 if (sfile ==
nullptr) {
2047 const char *flagname =
2049 const char *helptxt =
2052 if (flagname !=
nullptr) {
2063 const char *flagname =
2065 const char *helptxt =
2068 if (flagname !=
nullptr) {
2080 "parameters.ocean_reclaim_requirement");
2084 "parameters.land_channel_requirement");
2088 "parameters.thaw_requirement");
2092 "parameters.freeze_requirement");
2096 "parameters.lake_max_size");
2100 "parameters.min_start_native_area");
2104 "parameters.move_fragments");
2108 "parameters.igter_cost");
2113 "parameters.pythagorean_diagonal");
2127 const char *flag_names[TER_USER_LAST];
2132 fc_snprintf(path,
sizeof(path),
"terrain_%d", sect_idx++);
2138 identifier[0] = pterr->identifier;
2139 identifier[1] =
'\0';
2152 if (pterr->output[o] != 0) {
2160 for (r = 0; pterr->resources[r] !=
nullptr; r++) {
2165 const char *resource_names[r];
2167 for (r = 0; pterr->resources[r] !=
nullptr; r++) {
2176 if (pterr->road_output_incr_pct[o] != 0) {
2178 "%s.road_%s_incr_pct", path,
2193 "irrigation_result");
2195 "%s.irrigation_food_incr", path);
2202 "%s.mining_shield_incr", path);
2206 "transform_result");
2210 if (pterr->animal !=
nullptr) {
2220 "%s.clean_pollution_time", path);
2222 "%s.clean_fallout_time", path);
2225 "warmer_wetter_result");
2227 "warmer_drier_result");
2229 "cooler_wetter_result");
2231 "cooler_drier_result");
2234 for (flagi = 0; flagi < TER_USER_LAST; flagi++) {
2236 flag_names[set_count++] =
2237 terrain_flag_id_name(terrain_flag_id(flagi));
2241 if (set_count > 0) {
2246 enum mapgen_terrain_property mtp;
2248 for (mtp = mapgen_terrain_property_begin();
2249 mtp != mapgen_terrain_property_end();
2250 mtp = mapgen_terrain_property_next(mtp)) {
2251 if (pterr->property[mtp] != 0) {
2253 path, mapgen_terrain_property_name(mtp));
2267 if (set_count > 0) {
2274 save_strvec(sfile, pterr->helptext, path,
"helptext");
2283 if (!pres->ruledit_disabled) {
2287 fc_snprintf(path,
sizeof(path),
"resource_%d", sect_idx++);
2293 if (pres->data.resource->output[o] != 0) {
2300 identifier[0] = pres->data.resource->id_old_save;
2301 identifier[1] =
'\0';
2308 "extraui.ui_name_base_fortress");
2310 "extraui.ui_name_base_airbase");
2318 const char *flag_names[EF_COUNT];
2319 const char *cause_names[EC_COUNT];
2326 fc_snprintf(path,
sizeof(path),
"extra_%d", sect_idx++);
2331 "%s.category", path);
2334 for (causei = 0; causei < EC_COUNT; causei++) {
2336 cause_names[set_count++] = extra_cause_name(extra_cause(causei));
2340 if (set_count > 0) {
2346 for (causei = 0; causei < ERM_COUNT; causei++) {
2348 cause_names[set_count++] = extra_rmcause_name(extra_rmcause(causei));
2352 if (set_count > 0) {
2357 if (strcmp(pextra->graphic_str,
"-")) {
2360 if (strcmp(pextra->graphic_alt,
"-")) {
2363 if (strcmp(pextra->activity_gfx,
"-")) {
2367 if (strcmp(pextra->act_gfx_alt,
"-")) {
2370 if (strcmp(pextra->act_gfx_alt2,
"-")) {
2374 if (strcmp(pextra->rmact_gfx,
"-")) {
2377 if (strcmp(pextra->rmact_gfx_alt,
"-")) {
2387 "disappearance_reqs");
2389 if (!pextra->buildable) {
2392 if (!pextra->generated) {
2397 if (pextra->build_time_factor != 1) {
2399 "%s.build_time_factor", path);
2401 if (pextra->removal_time_factor != 1) {
2403 "%s.removal_time_factor", path);
2405 if (pextra->defense_bonus != 0) {
2409 if (pextra->eus != EUS_NORMAL) {
2411 "%s.unit_seen", path);
2416 "%s.appearance_chance", path);
2421 "%s.disappearance_chance", path);
2433 if (set_count > 0) {
2439 for (flagi = 0; flagi < EF_COUNT; flagi++) {
2441 flag_names[set_count++] = extra_flag_id_name(extra_flag_id(flagi));
2445 if (set_count > 0) {
2458 if (set_count > 0) {
2472 if (set_count > 0) {
2486 if (set_count > 0) {
2488 "%s.bridged_over", path);
2491 save_strvec(sfile, pextra->helptext, path,
"helptext");
2500 if (!pextra->ruledit_disabled) {
2503 const char *flag_names[BF_COUNT];
2507 fc_snprintf(path,
sizeof(path),
"base_%d", sect_idx++);
2512 "%s.gui_type", path);
2523 "%s.vision_invis_sq", path);
2531 for (flagi = 0; flagi < BF_COUNT; flagi++) {
2533 flag_names[set_count++] = base_flag_id_name(base_flag_id(flagi));
2537 if (set_count > 0) {
2550 if (!pextra->ruledit_disabled) {
2553 const char *flag_names[RF_COUNT];
2557 fc_snprintf(path,
sizeof(path),
"road_%d", sect_idx++);
2563 if (proad->
move_mode != RMM_FAST_ALWAYS) {
2565 "%s.move_mode", path);
2572 "%s.%s_incr_const", path,
2602 for (flagi = 0; flagi < RF_COUNT; flagi++) {
2604 flag_names[set_count++] = road_flag_id_name(road_flag_id(flagi));
2608 if (set_count > 0) {
2625 const char *vlist_name[vsystem->
levels];
2626 int vlist_power[vsystem->
levels];
2627 int vlist_raise[vsystem->
levels];
2628 int vlist_wraise[vsystem->
levels];
2629 int vlist_move[vsystem->
levels];
2632 for (i = 0; i < vsystem->
levels; i++) {
2641 "%s.veteran_names", path);
2643 "%s.veteran_power_fact", path);
2645 "%s.veteran_base_raise_chance", path);
2647 "%s.veteran_work_raise_chance", path);
2649 "%s.veteran_move_bonus", path);
2661 bool has_quiet =
false;
2665 if (pbonus->quiet) {
2676 "%s.bonuses%d.flag", path, i);
2678 "%s.bonuses%d.type", path, i);
2702 if (sfile ==
nullptr) {
2707 const char *flagname =
2709 const char *helptxt =
2712 if (flagname !=
nullptr) {
2723 const char *flagname =
2725 const char *helptxt =
2728 if (flagname !=
nullptr) {
2746 const char *hut_str =
nullptr;
2747 const char *flag_names[UCF_COUNT];
2751 fc_snprintf(path,
sizeof(path),
"unitclass_%d", sect_idx++);
2758 if (puc->non_native_def_pct != 100) {
2760 "%s.non_native_def_pct", path);
2763 switch (puc->hut_behavior) {
2768 hut_str =
"Nothing";
2771 hut_str =
"Frighten";
2779 for (flagi = 0; flagi < UCF_COUNT; flagi++) {
2781 flag_names[set_count++] =
2782 unit_class_flag_id_name(unit_class_flag_id(flagi));
2786 if (set_count > 0) {
2790 save_strvec(sfile, puc->helptext, path,
"helptext");
2799 if (!put->ruledit_disabled) {
2805 fc_snprintf(path,
sizeof(path),
"unit_%d", sect_idx++);
2812 save_tech_ref(sfile, put->require_advance, path,
"tech_req");
2820 if (preq->source.kind == VUT_GOVERNMENT) {
2822 "can't convert non player range to the rs format");
2824 "can't convert not present reqs to the rs format");
2826 "%s.gov_req", path);
2838 if (preq->source.kind == VUT_IMPROVEMENT) {
2840 "can't convert non player range to the rs format");
2842 "can't convert not present reqs to the rs format");
2844 "%s.impr_req", path);
2850 if (put->obsoleted_by !=
nullptr) {
2852 "%s.obsolete_by", path);
2856 if (strcmp(
"-", put->graphic_alt)) {
2859 if (strcmp(
"-", put->sound_move)) {
2862 if (strcmp(
"-", put->sound_move_alt)) {
2866 if (strcmp(
"-", put->sound_fight)) {
2869 if (strcmp(
"-", put->sound_fight_alt)) {
2889 if (put->vlayer != V_MAIN) {
2891 "%s.vision_layer", path);
2901 if (put->upkeep[o] != 0) {
2908 if (put->converted_to !=
nullptr) {
2910 "%s.convert_to", path);
2912 if (put->convert_time != 1) {
2920 if (put->veteran !=
nullptr) {
2924 if (put->paratroopers_range != 0) {
2926 "%s.paratroopers_range", path);
2928 if (put->bombard_rate != 0) {
2932 if (put->city_slots != 0) {
2935 if (put->city_size != 1) {
2942 flag_names[set_count++] =
2943 unit_type_flag_id_name(unit_type_flag_id(flagi));
2947 if (set_count > 0) {
2955 flag_names[set_count++] = unit_role_id_name(unit_role_id(flagi));
2959 if (set_count > 0) {
2964 save_strvec(sfile, put->helptext, path,
"helptext");
2978 if (buffer !=
nullptr) {
2979 FILE *ffile =
fc_fopen(filename,
"w");
2980 int full_len = qstrlen(buffer);
2983 if (ffile !=
nullptr) {
2984 len = fwrite(buffer, 1, full_len, ffile);
2987 if (
len != full_len) {
3016 bool success =
true;
3020 fc_snprintf(filename,
sizeof(filename),
"%s/buildings.ruleset", path);
3025 fc_snprintf(filename,
sizeof(filename),
"%s/styles.ruleset", path);
3030 fc_snprintf(filename,
sizeof(filename),
"%s/cities.ruleset", path);
3035 fc_snprintf(filename,
sizeof(filename),
"%s/effects.ruleset", path);
3040 fc_snprintf(filename,
sizeof(filename),
"%s/game.ruleset", path);
3045 fc_snprintf(filename,
sizeof(filename),
"%s/governments.ruleset",
3051 fc_snprintf(filename,
sizeof(filename),
"%s/nations.ruleset", path);
3056 fc_snprintf(filename,
sizeof(filename),
"%s/techs.ruleset", path);
3061 fc_snprintf(filename,
sizeof(filename),
"%s/terrain.ruleset", path);
3066 fc_snprintf(filename,
sizeof(filename),
"%s/units.ruleset", path);
3071 fc_snprintf(filename,
sizeof(filename),
"%s/script.lua", path);
3076 fc_snprintf(filename,
sizeof(filename),
"%s/parser.lua", path);
3081 fc_snprintf(filename,
sizeof(filename),
"%s/luadata.txt", path);
3087 qCritical(
"Failed to create directory %s", path);
#define achievements_iterate_end
#define achievements_iterate(_ach_)
const char * action_max_range_ruleset_var_name(int act)
Return max range ruleset variable name for the action or nullptr if max range can't be set in the rul...
const char * action_ui_name_ruleset_var_name(int act)
Return ui_name ruleset variable name for the action.
const char * action_ui_name_default(int act)
Return default ui_name for the action.
int action_max_range_default(int act)
Return default max range for the action if it is ruleset settable.
const char * action_actor_consuming_always_ruleset_var_name(action_id act)
Return actor consuming always ruleset variable name for the action or nullptr if actor consuming alwa...
const char * action_min_range_ruleset_var_name(int act)
Return min range ruleset variable name for the action or nullptr if min range can't be set in the rul...
const struct action_auto_perf * action_auto_perf_by_number(const int num)
Returns action auto performer rule number num.
const char * action_target_kind_ruleset_var_name(int act)
Return target kind ruleset variable name for the action or nullptr if min range can't be set in the r...
struct action * action_by_number(action_id act_id)
Return the action with the given id.
int action_min_range_default(int act)
Return default min range for the action if it is ruleset settable.
const char * action_id_rule_name(action_id act_id)
Get the rule name of the action.
struct action_enabler_list * action_enablers_for_action(action_id action)
Get all enablers for an action in the current ruleset.
#define action_enablers_iterate_end
#define ACTION_AUTO_MOVED_ADJ
#define ACTION_AUTO_UPKEEP_GOLD
#define ACTION_DISTANCE_UNLIMITED
#define ACTION_AUTO_UPKEEP_SHIELD
#define action_iterate_end
#define action_id_would_be_blocked_by(blocked_id, blocker_id)
#define action_enablers_iterate(_enabler_)
#define action_iterate(_act_)
#define ACTION_AUTO_UPKEEP_FOOD
bool base_has_flag(const struct base_type *pbase, enum base_flag_id flag)
Check if base provides effect.
bool BV_ISSET(const BV &bv, int bit)
struct citystyle * city_styles
const char * get_output_identifier(Output_type_id output)
Return an id string for the output type.
#define output_type_iterate(output)
#define output_type_iterate_end
struct clause_info * clause_info_get(enum clause_type type)
Free memory associated with clause infos.
#define disaster_type_iterate(_p)
#define disaster_type_iterate_end
bool iterate_effect_cache(iec_cb cb, void *data)
Iterate through all the effects in cache, and call callback for each.
#define MAX_NUM_NATION_SETS
#define MAX_NUM_BUILDING_LIST
#define MAX_CALENDAR_FRAGMENTS
#define MAX_NUM_NATION_GROUPS
#define MAX_NUM_UNIT_LIST
#define MAX_NUM_TECH_LIST
const char * skip_intl_qualifier_prefix(const char *str)
Some strings are ambiguous for translation.
#define RS_DEFAULT_RANSOM_GOLD
#define RS_DEFAULT_CIVIL_WAR_UNHAPPY
#define RS_DEFAULT_NUKE_DEFENDER_SURVIVAL_CHANCE_PCT
#define RS_DEFAULT_NUKE_POP_LOSS_PCT
#define RS_DEFAULT_BASE_POLLUTION
#define RS_DEFAULT_INCITE_TOTAL_FCT
#define RS_DEFAULT_ILLNESS_BASE_FACTOR
#define RS_DEFAULT_NEG_YEAR_LABEL
#define RS_DEFAULT_FORCE_TRADE_ROUTE
#define RS_DEFAULT_INCITE_IMPROVEMENT_FCT
#define RS_ACTION_NO_MAX_DISTANCE
#define RS_DEFAULT_BASE_BRIBE_COST
#define RS_DEFAULT_TECH_UPKEEP_DIVIDER
#define RS_DEFAULT_HAPPY_COST
#define RS_DEFAULT_ONLY_KILLING_VETERAN
#define RS_DEFAULT_POISON_EMPTIES_FOOD_STOCK
#define RS_DEFAULT_GRANARY_FOOD_INC
#define RS_DEFAULT_ILLNESS_ON
#define GAME_DEFAULT_CELEBRATESIZE
#define RS_DEFAULT_STEAL_MAP_REVEALS_CITIES
#define RS_DEFAULT_CIVIL_WAR_CELEB
#define RS_DEFAULT_BASE_TECH_COST
#define RS_DEFAULT_USER_ACTION_TARGET_KIND
#define RS_DEFAULT_UPGRADE_VETERAN_LOSS
#define RS_DEFAULT_CALENDAR_SKIP_0
#define RS_DEFAULT_CITY_RADIUS_SQ
#define RS_DEFAULT_BORDER_SIZE_EFFECT
#define RS_DEFAULT_FORCE_EXPLODE_NUCLEAR
#define RS_DEFAULT_FORCE_CAPTURE_UNITS
#define RS_DEFAULT_PILLAGE_SELECT
#define RS_DEFAULT_POS_YEAR_LABEL
#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_DEFAULT_ILLNESS_TRADE_INFECTION_PCT
#define RS_DEFAULT_FOOD_COST
#define RS_DEFAULT_INCITE_UNIT_FCT
#define RS_DEFAULT_INCITE_BASE_COST
#define RS_DEFAULT_FORCE_BOMBARD
#define GAME_DEFAULT_ANGRYCITIZEN
#define RS_DEFAULT_CITY_CENTER_OUTPUT
#define RS_DEFAULT_ILLNESS_POLLUTION_PCT
#define RS_DEFAULT_ILLNESS_MIN_SIZE
#define RS_DEFAULT_BORDER_RADIUS_SQ_CITY
const char * government_rule_name(const struct government *pgovern)
Return the (untranslated) rule name of the government.
const char * ruler_title_female_untranslated_name(const struct ruler_title *pruler_title)
Return the female rule title name.
const char * ruler_title_male_untranslated_name(const struct ruler_title *pruler_title)
Return the male rule title name.
std::vector< government > governments
const char * improvement_rule_name(const struct impr_type *pimprove)
Return the (untranslated) rule name of the improvement.
struct impr_type * improvement_by_number(const Impr_type_id id)
Returns the improvement type for the given index/ID.
bool improvement_has_flag(const struct impr_type *pimprove, enum impr_flag_id flag)
Return TRUE if the impr has this flag otherwise FALSE.
#define improvement_re_active_iterate_end
#define improvement_re_active_iterate(_p)
#define fc_assert_msg(condition, message,...)
#define fc_assert(condition)
struct terrain_misc terrain_control
#define multipliers_iterate(_mul_)
#define multipliers_iterate_end
static const char * untranslated_name(const struct name_translation *ptrans)
static const char * rule_name_get(const struct name_translation *ptrans)
const char * nation_set_untranslated_name(const struct nation_set *pset)
Return the untranslated name of a nation set (including qualifier, if any).
bool nation_leader_is_male(const struct nation_leader *pleader)
Return the sex of the nation leader.
enum nation_city_preference nation_city_terrain_preference(const struct nation_city *pncity, const struct terrain *pterrain)
Return the default nation city preference for the terrain.
const char * nation_rule_name(const struct nation_type *pnation)
Return the (untranslated) rule name of the nation (adjective form).
std::vector< nation_type > nations
bool nation_is_in_group(const struct nation_type *pnation, const struct nation_group *pgroup)
Check if the given nation is in a given group.
bool nation_is_in_set(const struct nation_type *pnation, const struct nation_set *pset)
Check if the given nation is in a given set.
enum nation_city_preference nation_city_river_preference(const struct nation_city *pncity)
Return the default nation city preference for rivers.
const char * nation_set_rule_name(const struct nation_set *pset)
Return the (untranslated) rule name of a nation set.
const char * nation_set_description(const struct nation_set *pset)
Return the (untranslated) user description of a nation set.
struct nation_type * nation_by_rule_name(const char *name)
Returns the nation that has the given (untranslated) rule name (adjective).
const char * nation_leader_name(const struct nation_leader *pleader)
Return the name of the nation leader.
const char * nation_city_name(const struct nation_city *pncity)
Return the name of the default nation city.
const char * nation_group_rule_name(const struct nation_group *pgroup)
Return the (untranslated) rule name of a nation group.
#define nation_leader_list_iterate(leaderlist, pleader)
#define nation_list_iterate(nationlist, pnation)
#define nation_sets_iterate_end
#define nation_sets_iterate(NAME_pset)
#define nation_city_list_iterate(citylist, pncity)
#define nation_list_iterate_end
#define nation_city_list_iterate_end
#define nation_leader_list_iterate_end
#define nation_groups_iterate(NAME_pgroup)
#define nation_groups_iterate_end
struct section_file * secfile_new(bool allow_duplicates)
Create a new empty section file.
bool secfile_save(const struct section_file *secfile, QString filename)
Save the previously filled in section_file to disk.
struct entry * secfile_insert_filereference(struct section_file *secfile, const char *filename, const char *path,...)
Insert a read-from-a-file string entry.
const char * entry_name(const struct entry *pentry)
Returns the name of this entry.
bool entry_str_set_gt_marking(struct entry *pentry, bool gt_marking)
Sets if the string should get gettext marking.
struct section * secfile_insert_include(struct section_file *secfile, const char *filename)
Insert a include entry.
#define secfile_insert_int(secfile, value, path,...)
#define secfile_insert_enum_vec(secfile, enumerators, dim, specenum_type, path,...)
#define secfile_insert_enum(secfile, enumerator, specenum_type, path,...)
#define secfile_insert_int_vec(secfile, values, dim, path,...)
#define secfile_insert_str_vec(secfile, strings, dim, path,...)
#define secfile_insert_str(secfile, string, path,...)
#define secfile_insert_bool(secfile, value, path,...)
#define secfile_insert_enum_data(secfile, value, bitwise, name_fn, data, path,...)
QString req_to_fstring(const struct requirement *req)
Returns the given requirement as a formatted string ready for printing.
const char * universal_rule_name(const struct universal *psource)
Return the (untranslated) rule name of the universal.
#define requirement_vector_iterate_end
#define requirement_vector_iterate(req_vec, preq)
void rgbcolor_save(struct section_file *file, const struct rgbcolor *prgbcolor, const char *path,...)
Save an RGB color definition ([colorpath].red, [colorpath].green and [colorpath].blue).
#define rgbcolor_list_iterate_end
#define rgbcolor_list_iterate(rgbcolorlist, prgbcolor)
bool road_has_flag(const struct road_type *proad, enum road_flag_id flag)
Check if road provides effect.
static bool save_reqs_vector(struct section_file *sfile, const struct requirement_vector *reqs, const char *path, const char *entry)
Save vector of requirements.
static bool save_tech_list(struct section_file *sfile, int *input, const char *path, const char *entry)
Save techs vector.
static bool save_name_translation(struct section_file *sfile, struct name_translation *name, const char *path)
Save name of the object.
static bool save_terrain_ref(struct section_file *sfile, const struct terrain *save, const struct terrain *pthis, const char *path, const char *entry)
Save terrain reference.
static bool save_nations_ruleset(const char *filename, const char *name, struct rule_data *data)
Save nations.ruleset.
static bool save_action_kind(struct section_file *sfile, action_id act)
Save details of an action.
static bool save_action_actor_consuming_always(struct section_file *sfile, action_id act)
Save if an action always will consume the actor.
static bool save_action_max_range(struct section_file *sfile, action_id act)
Save max range of an action.
static bool save_traits(struct trait_limits *traits, struct trait_limits *default_traits, struct section_file *sfile, const char *secname, const char *field_prefix)
Save list of AI traits.
static struct section_file * create_ruleset_file(const char *rsname, const char *rstype)
Create new ruleset section file with common header.
bool save_ruleset(const char *path, const char *name, struct rule_data *data)
Save ruleset to directory given.
static bool save_strvec(struct section_file *sfile, QVector< QString > *to_save, const char *path, const char *entry)
Save strvec as ruleset vector of strings.
static bool save_cities_ruleset(const char *filename, const char *name)
Save cities.ruleset.
static bool save_techs_ruleset(const char *filename, const char *name)
Save techs.ruleset.
static bool save_uclass_vec(struct section_file *sfile, bv_unit_classes *bits, const char *path, const char *entry, bool unreachable_only)
Save vector of unit class names based on bitvector bits.
static bool save_ruleset_file(struct section_file *sfile, const char *filename)
Save ruleset file.
static bool save_veteran_system(struct section_file *sfile, const char *path, struct veteran_system *vsystem)
Save one veteran system.
static bool save_unit_list(struct section_file *sfile, const std::array< unit_type *, MAX_NUM_UNIT_LIST > &input, const char *path, const char *entry)
Save units vector.
static bool save_default_bool(struct section_file *sfile, bool value, bool default_value, const char *path, const char *entry)
Save bool value that has default applied upon loading.
static bool effect_save(struct effect *peffect, void *data)
Save one effect.
static bool save_game_ruleset(const char *filename, const char *name)
Save game.ruleset.
static bool save_buildings_ruleset(const char *filename, const char *name)
Save buildings.ruleset.
static bool save_action_auto_uflag_block(struct section_file *sfile, const int aap, const char *uflags_path, bool(*unexpected_req)(const struct requirement *preq))
Save an action auto performer's !present utype reqs as a regular setting.
static bool unexpected_non_otype(const struct requirement *req)
Missing unit upkeep should only contain output type and absence of blocking unit type flag requiremen...
static bool save_building_list(struct section_file *sfile, int *input, const char *path, const char *entry)
Save buildings vector.
static bool save_luadata(const char *filename)
Save luadata.txt.
static bool save_governments_ruleset(const char *filename, const char *name)
Save governments.ruleset.
static bool save_units_ruleset(const char *filename, const char *name)
Save units.ruleset.
static bool save_terrain_ruleset(const char *filename, const char *name)
Save terrain.ruleset.
static bool save_muuk_action_auto(struct section_file *sfile, const int aap, const char *item)
Save the action a unit should perform when its missing food, gold or shield upkeep.
static bool save_action_range(struct section_file *sfile, action_id act)
Save range of an action.
static bool save_gov_ref(struct section_file *sfile, const struct government *gov, const char *path, const char *entry)
Save government reference.
static bool save_styles_ruleset(const char *filename, const char *name)
Save styles.ruleset.
static bool save_combat_bonuses(struct section_file *sfile, struct unit_type *put, char *path)
Save unit combat bonuses list.
static bool save_effects_ruleset(const char *filename, const char *name)
Save effects.ruleset.
static bool save_default_int(struct section_file *sfile, int value, int default_value, const char *path, const char *entry)
Save int value that has default applied upon loading.
static bool save_nation(struct section_file *sfile, struct nation_type *pnat, int sect_idx)
Save a single nation.
static bool save_script_lua(const char *filename, const char *name, const char *buffer)
Save script.lua.
static bool save_action_auto_actions(struct section_file *sfile, const int aap, const char *actions_path)
Save an action auto performer's action list as a regular setting.
static bool save_tech_ref(struct section_file *sfile, const struct advance *padv, const char *path, const char *entry)
Save tech reference.
static bool save_action_ui_name(struct section_file *sfile, int act, const char *entry_name)
Save ui_name of one action.
char * get_script_buffer()
Return current script.lua buffer.
char * get_parser_buffer()
Return current parser.lua buffer.
#define RS_DEFAULT_TECH_TRADE_LOSS_HOLES
#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
#define RS_DEFAULT_TECH_LOSS_HOLES
#define RS_DEFAULT_HISTORY_INTEREST_PML
#define RS_DEFAULT_PYTHAGOREAN_DIAGONAL
#define RS_DEFAULT_TECH_STEAL_HOLES
#define GAME_DEFAULT_ACH_UNIQUE
#define RS_DEFAULT_MUUK_FOOD_WIPE
#define RS_DEFAULT_MUUK_GOLD_WIPE
#define RULESET_CAPABILITIES
#define RS_DEFAULT_MUUK_SHIELD_WIPE
#define RS_DEFAULT_GOLD_UPKEEP_STYLE
#define GAME_DEFAULT_NATIONALITY
#define GAME_DEFAULT_ADDTOSIZE
#define RS_DEFAULT_EXTRA_DISAPPEARANCE
#define GAME_DEFAULT_VISION_REVEAL_TILES
#define RS_DEFAULT_CULTURE_VIC_LEAD
#define GAME_DEFAULT_CHANGEABLE_BUDGET
#define GAME_DEFAULT_DISASTER_FREQ
#define GAME_DEFAULT_CONVERT_SPEED
int setting_int_get(struct setting *pset)
Get value of integer setting.
bool setting_locked(const struct setting *pset)
Returns if the setting is locked by the ruleset.
enum sset_type setting_type(const struct setting *pset)
Access function for the setting type.
const char * setting_name(const struct setting *pset)
Access function for the setting name.
enum setting_default_level setting_get_setdef(const struct setting *pset)
Is the setting in changed state, or the default.
const char * setting_bitwise_secfile_str(secfile_data_t data, int bit)
Convert the integer to the long support string representation of an enumerator.
char * setting_str_get(struct setting *pset)
Get value of string setting.
int setting_bitwise_get(struct setting *pset)
Get value of bitwise setting.
bool setting_bool_get(struct setting *pset)
Get value of boolean setting.
int read_enum_value(const struct setting *pset)
Helper function to read value from enumerator setting.
const char * setting_enum_secfile_str(secfile_data_t data, int val)
Convert the integer to the long support string representation of an enumerator.
#define settings_iterate(_level, _pset)
#define settings_iterate_end
bool make_dir(const QString &pathname)
If the directory "pathname" does not exist, recursively create all directories until it does.
struct specialist * specialist_by_number(const Specialist_type_id id)
Return the specialist pointer for the given number.
#define specialist_type_iterate_end
#define specialist_type_iterate(sp)
struct requirement_vector reqs
action_id alternatives[MAX_NUM_ACTIONS]
char ui_name[MAX_LEN_NAME]
enum base_gui_type gui_type
struct civ_game::@28::@32 server
struct rgbcolor * plr_bg_color
struct packet_ruleset_control control
int global_init_techs[MAX_NUM_TECH_LIST]
struct packet_game_info info
int global_init_buildings[MAX_NUM_BUILDING_LIST]
char * ruleset_description
struct civ_game::@27 rgame
char * ruleset_capabilities
struct veteran_system * veteran
struct packet_calendar_info calendar
struct government * default_government
struct government * government_during_revolution
struct civ_map::@39::@41 server
struct requirement_vector receiver_reqs
struct requirement_vector giver_reqs
Effect saving callback data structure.
struct section_file * sfile
struct requirement_vector reqs
int init_buildings[MAX_NUM_BUILDING_LIST]
struct name_translation noun_plural
char flag_graphic_str[MAX_LEN_NAME]
struct name_translation adjective
char flag_graphic_alt[MAX_LEN_NAME]
struct nation_leader_list * leaders
struct nation_type::@48::@50 server
std::array< unit_type *, MAX_NUM_UNIT_LIST > init_units
enum barbarian_type barb_type
char * translation_domain
struct nation_style * style
int init_techs[MAX_NUM_TECH_LIST]
government * init_government
enum road_move_mode move_mode
int tile_incr_const[O_LAST]
struct requirement_vector reqs
char graphic_alt[MAX_LEN_NAME]
char graphic_str[MAX_LEN_NAME]
struct name_translation name
QVector< QString > * helptext
struct name_translation abbreviation
enum traderoute_bonus_type bonus_type
enum traderoute_illegal_cancelling cancelling
struct combat_bonus_list * bonuses
struct name_translation name
struct veteran_level * definitions
const char * style_rule_name(const struct nation_style *pstyle)
Return the (untranslated) rule name of the style.
#define music_styles_iterate(_p)
#define music_styles_iterate_end
#define styles_re_active_iterate_end
#define styles_re_active_iterate(_p)
int fc_snprintf(char *str, size_t n, const char *format,...)
See also fc_utf8_snprintf_trunc(), fc_utf8_snprintf_rep().
int fc_strcasecmp(const char *str0, const char *str1)
Compare strings like strcmp(), but ignoring case.
FILE * fc_fopen(const char *filename, const char *opentype)
Wrapper function for fopen() with filename conversion to local encoding on Windows.
const char * team_slot_rule_name(const struct team_slot *tslot)
Returns the name (untranslated) of the slot.
struct team_slot * team_slot_by_number(int team_id)
Return the possibly unused and uninitialized team slot.
bool advance_has_flag(Tech_type_id tech, enum tech_flag_id flag)
Return TRUE if the tech has this flag otherwise FALSE.
const char * advance_rule_name(const struct advance *padvance)
Return the (untranslated) rule name of the advance/technology.
struct advance * advance_by_number(const Tech_type_id atype)
Return the advance for the given advance index.
const char * tech_class_rule_name(const struct tech_class *ptclass)
Return the (untranslated) rule name of tech_class You must not free the return pointer.
const char * tech_flag_helptxt(enum tech_flag_id id)
Return the (untranslated) helptxt of the user tech flag.
Tech_type_id advance_index(const struct advance *padvance)
Return the advance index.
const char * tech_flag_id_name_cb(enum tech_flag_id flag)
Tech flag name callback, called from specenum code.
#define advance_re_active_iterate(_p)
#define tech_class_iterate_end
#define MAX_NUM_USER_TECH_FLAGS
#define advance_re_active_iterate_end
#define tech_class_iterate(_p)
const char * terrain_rule_name(const struct terrain *pterrain)
Return the (untranslated) rule name of the terrain.
const char * terrain_flag_id_name_cb(enum terrain_flag_id flag)
Terrain flag name callback, called from specenum code.
const char * terrain_flag_helptxt(enum terrain_flag_id id)
Return the (untranslated) helptxt of the user terrain flag.
#define terrain_type_iterate(_p)
#define terrain_type_iterate_end
#define terrain_has_flag(terr, flag)
#define MAX_NUM_USER_TER_FLAGS
bool goods_has_flag(const struct goods_type *pgood, enum goods_flag_id flag)
Check if goods has given flag.
const char * trade_route_type_name(enum trade_route_type type)
Return human readable name of trade route type.
struct trade_route_settings * trade_route_settings_by_type(enum trade_route_type type)
Get trade route settings related to type.
const char * traderoute_cancelling_type_name(enum traderoute_illegal_cancelling type)
Return human readable name of traderoute cancelling type.
#define goods_type_re_active_iterate_end
#define goods_type_re_active_iterate(_p)
#define TRAIT_DEFAULT_VALUE
const char * unit_type_flag_id_name_cb(enum unit_type_flag_id flag)
Unit type flag name callback, called from specenum code.
const char * unit_class_flag_helptxt(enum unit_class_flag_id id)
Return the (untranslated) help text of the user unit class flag.
const char * utype_rule_name(const struct unit_type *punittype)
Return the (untranslated) rule name of the unit type.
bool utype_has_role(const struct unit_type *punittype, int role)
Return whether the given unit type has the role.
const char * unit_type_flag_helptxt(enum unit_type_flag_id id)
Return the (untranslated) helptxt of the user unit flag.
const char * unit_class_flag_id_name_cb(enum unit_class_flag_id flag)
Unit class flag name callback, called from specenum code.
const char * uclass_rule_name(const struct unit_class *pclass)
Return the (untranslated) rule name of the unit class.
static bool uclass_has_flag(const struct unit_class *punitclass, enum unit_class_flag_id flag)
#define unit_type_re_active_iterate(_p)
#define combat_bonus_list_iterate_end
#define combat_bonus_list_iterate(bonuslist, pbonus)
#define unit_class_iterate(_p)
#define unit_class_re_active_iterate_end
#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_class_re_active_iterate(_p)
#define uclass_index(_c_)
#define unit_class_iterate_end
#define MAX_NUM_USER_UCLASS_FLAGS
#define unit_type_re_active_iterate_end
const char * freeciv21_version()
Returns the raw version string.