44#define MAXIMUM_CLAIMED_OCEAN_SIZE_3_2 (20)
46#define enough_new_user_flags(_new_flags_, _name_, \
47 _LAST_USER_FLAG_, _LAST_USER_FLAG_PREV_) \
48FC_STATIC_ASSERT((ARRAY_SIZE(_new_flags_) \
49 <= _LAST_USER_FLAG_ - _LAST_USER_FLAG_PREV_), \
50 not_enough_new_##_name_##_user_flags)
52#define UTYF_LAST_USER_FLAG_3_2 UTYF_USER_FLAG_50
53#define TECH_LAST_USER_FLAG_3_2 TECH_USER_7
63 memset(info, 0,
sizeof(*info));
79 log_fatal(
"\"%s\": ruleset capability problem:", filename);
98 log_fatal(
"\"%s\": ruleset datafile appears incompatible:", filename);
106 log_fatal(
"\"%s\": ruleset datafile claims required option(s)"
107 " that we don't support:", filename);
117 log_error(
"\"%s\": lacking legal format_version field", filename);
121 }
else if (format == 0) {
122 log_error(
"\"%s\": Illegal format_version value", filename);
136 const char *filename,
150 log_fatal(
"\"%s\": ruleset datafile format version differs from"
151 " other ruleset datafile(s):", filename);
184 if (
problem->num_suggested_solutions == 0) {
187 log_error(
"While adding hard obligatory reqs to action enabler"
189 " Don't know how to fix it."
192 ae->rulesave.ruledit_disabled =
TRUE;
203 for (
i = 0;
i <
problem->num_suggested_solutions;
i++) {
222 log_warn(
"While adding hard obligatory reqs to action enabler"
226 ae->rulesave.ruledit_disabled =
TRUE;
232 for (
i = 0;
i <
problem->num_suggested_solutions;
i++) {
244 log_error(
"While adding hard obligatory reqs to action enabler"
246 "Failed to apply solution %s."
257 if (
problem->num_suggested_solutions - 1 ==
i) {
260 ae->rulesave.ruledit_disabled =
new_enabler->rulesave.ruledit_disabled;
292 log_normal(
"action enablers: adding obligatory hard requirements.");
293 log_warn(
"More than one way to fulfill a new obligatory hard requirement"
295 " In that case the enabler is copied so each alternative"
296 " solution is applied to a copy of the enabler."
297 " If an action enabler becomes self contradicting after applying"
298 " a solution it is dropped."
299 " Note that other copies of the original enabler may have"
300 " survived even if one copy is dropped.");
318 if (
ae->rulesave.ruledit_disabled) {
359 {
N_(
"NoVeteran"),
N_(
"May acquire veteran status.") },
360 {
N_(
"CanEscape"),
N_(
"Can try to escape stack death.") }
373 "Can't upgrade the ruleset. Not enough free unit type "
374 "user flags to add user flags for the unit type flags "
375 "that used to be hardcoded.");
383 "Ruleset had illegal user unit type flag '%s'",
406 N_(
"National borders expand freely into the ocean.") },
407 {
N_(
"Claim_Ocean_Limited"),
408 N_(
"National borders from oceanic sources expand freely.") },
421 "Can't upgrade the ruleset. Not enough free tech "
422 "user flags to add user flags for the tech flags "
423 "that used to be hardcoded.");
431 "Ruleset had illegal user tech flag '%s'",
568 "Claim_Ocean_Limited");
650 return "UnitTypeFlag";
662 return "Martial_Law_By_Unit";
673 if (!
fc_strcasecmp(
"conquer_city_shrink_blocked_by", new_name)) {
674 return "conquer_city_blocked_by";
676 if (!
fc_strcasecmp(
"conquer_city_shrink_2_blocked_by", new_name)) {
677 return "conquer_city_2_blocked_by";
679 if (!
fc_strcasecmp(
"conquer_city_shrink_3_blocked_by", new_name)) {
680 return "conquer_city_3_blocked_by";
682 if (!
fc_strcasecmp(
"conquer_city_shrink_4_blocked_by", new_name)) {
683 return "conquer_city_4_blocked_by";
694 if (!
fc_strcasecmp(
"ui_name_conquer_city_shrink", new_name)) {
695 return "ui_name_conquer_city";
697 if (!
fc_strcasecmp(
"ui_name_conquer_city_shrink_2", new_name)) {
698 return "ui_name_conquer_city_2";
700 if (!
fc_strcasecmp(
"ui_name_conquer_city_shrink_3", new_name)) {
701 return "ui_name_conquer_city_3";
703 if (!
fc_strcasecmp(
"ui_name_conquer_city_shrink_4", new_name)) {
704 return "ui_name_conquer_city_4";
710#define RS_DEFAULT_CIVIL_WAR_CELEB -5
711#define RS_DEFAULT_CIVIL_WAR_UNHAPPY 5
719 "civstyle.civil_war_bonus_celebrating");
732 "civstyle.civil_war_bonus_unhappy");
767 if (text ==
nullptr) {
struct req_vec_problem * action_enabler_suggest_repair(const struct action_enabler *enabler)
const char * action_enabler_vector_by_number_name(req_vec_num_in_item vec)
const char * action_rule_name(const struct action *action)
void action_enabler_add(struct action_enabler *enabler)
const char * action_ui_name_default(int act)
struct action_enabler * action_enabler_new(void)
struct action_enabler * action_enabler_copy(const struct action_enabler *original)
struct action_enabler_list * action_enablers_for_action(action_id action)
struct requirement_vector * action_enabler_vector_by_number(const void *enabler, req_vec_num_in_item number)
#define enabler_get_action(_enabler_)
static struct action * action_by_number(action_id act_id)
#define action_has_result(_act_, _res_)
#define action_enabler_list_iterate_end
#define action_iterate_end
#define action_enabler_list_iterate(action_enabler_list, aenabler)
#define action_iterate(_act_)
bool has_capabilities(const char *us, const char *them)
bool iterate_effect_cache(iec_cb cb, void *data)
struct effect * effect_new(enum effect_type type, int value, struct multiplier *pmul)
void effect_req_append(struct effect *peffect, struct requirement req)
#define log_warn(message,...)
#define fc_assert_ret_val(condition, val)
#define log_fatal(message,...)
#define log_normal(message,...)
#define log_error(message,...)
const char * secfile_error(void)
bool secfile_lookup_int(const struct section_file *secfile, int *ival, const char *path,...)
const char * entry_name(const struct entry *pentry)
const char * secfile_lookup_str(const struct section_file *secfile, const char *path,...)
int secfile_lookup_int_default(const struct section_file *secfile, int def, const char *path,...)
const char * secfile_lookup_str_default(const struct section_file *secfile, const char *def, const char *path,...)
bool req_vec_change_apply(const struct req_vec_change *modification, requirement_vector_by_number getter, const void *parent_item)
const char * req_vec_change_translation(const struct req_vec_change *change, const requirement_vector_namer namer)
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)
#define RS_DEFAULT_CIVIL_WAR_UNHAPPY
bool load_action_ui_name_3_3(struct section_file *file, int act, const char *entry_name, struct rscompat_info *compat)
void rscompat_civil_war_effects_3_3(struct section_file *game_rs)
const char * rscompat_effect_name_3_3(const char *old_name)
const char * ui_name_old_name_3_3(const char *new_name)
#define UTYF_LAST_USER_FLAG_3_2
static bool rscompat_enabler_add_obligatory_hard_reqs(struct action_enabler *ae)
#define MAXIMUM_CLAIMED_OCEAN_SIZE_3_2
#define RS_DEFAULT_CIVIL_WAR_CELEB
bool rscompat_names(struct rscompat_info *info)
#define TECH_LAST_USER_FLAG_3_2
void rscompat_postprocess(struct rscompat_info *info)
const char * rscompat_utype_flag_name_3_3(const char *old_name)
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 * blocked_by_old_name_3_3(const char *new_name)
static int first_free_tech_user_flag(void)
static bool effect_list_compat_cb(struct effect *peffect, void *data)
const char * rscompat_universal_name_3_3(const char *old_name)
static int first_free_unit_type_user_flag(void)
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)
#define enough_new_user_flags(_new_flags_, _name_, _LAST_USER_FLAG_, _LAST_USER_FLAG_PREV_)
#define RULESET_COMPAT_CAP
#define ruleset_error(logger, level, format,...)
#define RULESET_CAPABILITIES
static struct compatibility compat[]
struct civ_game::@32::@36 server
struct civ_game::@32::@36::@37 deprecated
int fc_strcasecmp(const char *str0, const char *str1)
#define sz_strlcpy(dest, src)
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)
#define MAX_NUM_USER_TECH_FLAGS
bool utype_has_role(const struct unit_type *punittype, int role)
const char * unit_type_flag_id_name_cb(enum unit_type_flag_id flag)
void set_user_unit_type_flag_name(enum unit_type_flag_id id, const char *name, const char *helptxt)
#define MAX_NUM_USER_UNIT_FLAGS
#define UTYF_LAST_USER_FLAG
#define unit_type_iterate(_p)
#define unit_type_iterate_end