48 LOG_ERROR,
"Too long ruleset summary. It can be only %d bytes long. "
49 "Put longer explanations to ruleset description.",
154 const char *list_for)
157 case VUT_IMPROVEMENT:
166 "%s: World-ranged requirement not supported for "
167 "%s (only great wonders supported)", list_for,
170 }
else if (preq->
range > REQ_RANGE_TRADE_ROUTE && !
is_wonder(pimprove)) {
172 "%s: %s-ranged requirement not supported for "
173 "%s (only wonders supported)", list_for,
174 req_range_name(preq->
range),
185 "%s: MinCalFrag requirement used in ruleset without "
186 "calendar fragments", list_for);
190 "%s: MinCalFrag requirement %d out of range (max %d in "
196 case VUT_SERVERSETTING:
209 "%s: ServerSetting requirement %s isn't visible enough "
210 "to appear in a requirement. Everyone should be able to "
211 "see the value of a server setting that appears in a "
220 "%s: ServerSetting requirement setting %s isn't about a "
240 int local_reqs_of_type[],
242 int max_tiles,
const char *list_for)
268 case VUT_TERRAINCLASS:
269 if (local_reqs_of_type[VUT_TERRAIN] > 0) {
271 "%s: Requirement list has both local terrain and terrainclass requirement",
277 if (local_reqs_of_type[VUT_TERRAINCLASS] > 0) {
279 "%s: Requirement list has both local terrain and terrainclass requirement",
300 case VUT_MINFOREIGNPCT:
307 case VUT_TERRAINALTER:
317 "%s: Requirement list has multiple %s requirements",
324 if (max_tiles != -1 && rc > max_tiles) {
326 "%s: Requirement list has more %s requirements than "
327 "can ever be fulfilled.", list_for,
333 case VUT_TERRAINCLASS:
334 if (rc > 2 || (max_tiles != -1 && rc > max_tiles)) {
336 "%s: Requirement list has more %s requirements than "
337 "can ever be fulfilled.", list_for,
347 "%s: Requirement list has more %s requirements than "
348 "can ever be fulfilled.", list_for,
358 "%s: Requirement list has more %s requirements than "
359 "can ever be fulfilled.", list_for,
365 case VUT_SERVERSETTING:
371 case VUT_MAXTILEUNITS:
375 case VUT_NATIONGROUP:
380 case VUT_IMPROVEMENT:
390 case VUT_NATIONALITY:
392 case VUT_ACHIEVEMENT:
394 case VUT_DIPLREL_TILE:
395 case VUT_DIPLREL_TILE_O:
396 case VUT_DIPLREL_UNITANY:
397 case VUT_DIPLREL_UNITANY_O:
424 const struct requirement_vector *preqs,
425 bool conjunctive,
const char *list_for)
427 bool has_singlepole_req =
FALSE;
433 if (preq->source.kind != VUT_SERVERSETTING) {
442 has_singlepole_req =
TRUE;
444 &&
XOR(conjunctive, preq->present)) {
449 if (!has_singlepole_req) {
456 "%s: Requirement list containing 'singlepole' server"
457 " setting requirement must also have negated (!present)"
458 " 'alltemperate' requirement", list_for);
461 "%s: Disjunctive requirement list containing 'singlepole'"
462 " server setting requirement must also have present"
463 " 'alltemperate' requirement", list_for);
486 const struct requirement_vector *preqs,
487 bool conjunctive,
int max_tiles,
488 const char *list_for)
491 int reqs_of_type[VUT_COUNT];
492 int local_reqs_of_type[VUT_COUNT];
495 memset(reqs_of_type, 0,
sizeof(reqs_of_type));
496 memset(local_reqs_of_type, 0,
sizeof(local_reqs_of_type));
500 reqs_of_type, local_reqs_of_type, preq,
501 conjunctive, max_tiles, list_for)) {
511 if (problem != NULL) {
539 if (peffect->
type == EFT_CITY_VISION_RADIUS_SQ) {
540 if (requirement_vector_size(&peffect->
reqs) == 0) {
543 }
else if (peffect->
type == EFT_ACTION_SUCCESS_TARGET_MOVE_COST) {
546 if (preq->source.kind == VUT_ACTION) {
554 "The effect Action_Success_Target_Move_Cost has the"
555 " requirement {%s} but the action %s isn't"
556 " (single) unit targeted.",
564 }
else if (peffect->
type == EFT_ACTION_SUCCESS_MOVE_COST) {
567 if (preq->source.kind == VUT_ACTION && preq->present) {
570 "The effect Action_Success_Actor_Move_Cost has the"
571 " requirement {%s} but the action %s isn't"
572 " performed by a unit.",
580 }
else if (peffect->
type == EFT_ACTION_ODDS_PCT) {
583 if (preq->source.kind == VUT_ACTION && preq->present) {
587 "The effect Action_Odds_Pct has the"
588 " requirement {%s} but the action %s doesn't"
589 " roll the dice to see if it fails.",
600 effect_type_name(peffect->
type))) {
602 "Effects have conflicting or invalid requirements!");
628 bool sea_capable =
FALSE;
641 "Barbarian boat (%s) needs to be able to move at sea.",
653 if (ptype->transport_capacity <= 1) {
655 "Barbarian boat %s has no capacity for both "
656 "leader and at least one man.",
667 "Barbarian boat %s cannot transport "
668 "barbarian cargo %s.",
706 bool sea_capable =
FALSE;
719 "Ferryboat (%s) needs to be able to move at sea.",
728 "Inspire_Partisans effect present, but no units with partisan role.");
742 if (ptype->transport_capacity > 0) {
745 "%s has transport capacity %d, but no cargo types.",
751 "%s has cargo types, but no transport capacity.",
768 && pimprove->genus != IG_SPECIAL) {
770 "Gold producing improvement %s with genus other than \"Special\"",
776 && pimprove->genus != IG_IMPROVEMENT) {
778 "Disasterproof improvement %s with genus other than \"Improvement\"",
783 if (pimprove->genus != IG_SPECIAL
791 "Space part %s with genus other than \"Special\"",
796 if (
is_wonder(pimprove) && pimprove->upkeep != 0) {
798 "%s is a wonder with a nonzero upkeep value",
812 enum effect_type boolean_effects[] =
828 EFT_INSPIRE_PARTISANS,
829 EFT_HAPPINESS_TO_GOLD,
841 for (i = 0; boolean_effects[i] != EFT_COUNT; i++) {
845 "Boolean effect %s can get disabled, but it can't get "
846 "enabled before that.", effect_type_name(boolean_effects[i]));
868 bool default_gov_failed =
FALSE;
869 bool obsoleted_by_loop =
FALSE;
880 "Cost based free tech method, but tech cost style "
881 "\"Civ I|II\" so all techs cost the same.");
899 }
else if (preq == padvance) {
907 if (preqreq == padvance) {
909 "Tech \"%s\" requires itself indirectly via \"%s\".",
918 if (preq->source.kind == VUT_ADVANCE) {
923 "Tech \"%s\" requires a tech in its research_reqs."
924 " This isn't supported yet. Please keep using req1"
925 " and req2 like before.",
938 "Tech \"%s\" has the requirement %s in its"
939 " research_reqs. This requirement may change during"
940 " the game. Changing requirements aren't supported"
949 if (padvance->bonus_message != NULL) {
952 "Tech \"%s\" bonus message is not format with %%s for a bonus tech name.",
961 "The government form %s reserved for revolution handling has been set as "
962 "default_government.",
965 default_gov_failed =
TRUE;
980 "Tech %s does not exist, but is initial "
981 "tech for everyone.",
988 "Tech %s is initial for everyone, but %s has "
989 "no root_req for it.",
1005 "Tech %s does not exist, but is initial tech for %s.",
1013 "Tech %s is initial for %s, but they have "
1014 "no root_req for it.",
1023 && pnation->init_buildings[0] !=
B_LAST) {
1025 "Barbarian nation %s has init_buildings set but will "
1031 "The government form %s reserved for revolution handling has been set as "
1032 "initial government for %s.",
1042 int chain_length = 0;
1043 const struct unit_type *upgraded = putype;
1045 while (upgraded != NULL && !obsoleted_by_loop) {
1048 if (chain_length > num_utypes) {
1050 "There seems to be obsoleted_by loop in update "
1053 obsoleted_by_loop =
TRUE;
1067 "The unit type '%s' has the 'Spy' unit type flag but "
1068 "not the 'Diplomat' unit type flag.",
1076 if (putype->paratroopers_range < 0
1080 "The paratroopers_range of the unit type '%s' is %d. "
1081 "That is out of range. Max range is %d.",
1087 if ((putype->city_size <= 0 || putype->city_size >
MAX_CITY_SIZE)
1090 "Unit type '%s' would build size %d cities. "
1091 "City sizes must be from 1 to %d.",
1098 memset(&els, 0,
sizeof(els));
1110 if (
compat->log_cb != NULL) {
1111 compat->log_cb(
_(
"Missing base City_Vision_Radius_Sq effect. Please add one."));
1115 "There is no base City_Vision_Radius_Sq effect.");
1131 "Disasters have conflicting or invalid requirements!");
1141 "Goods have conflicting or invalid requirements!");
1151 _(
"Buildings have conflicting or invalid requirements!"));
1157 _(
"Buildings have conflicting or invalid obsolescence req!"));
1167 "Governments have conflicting or invalid requirements!");
1177 "Specialists have conflicting or invalid requirements!");
1187 "Extras have conflicting or invalid requirements!");
1193 "Extras have conflicting or invalid removal requirements!");
1196 if ((requirement_vector_size(&pextra->rmreqs) > 0)
1197 && !(pextra->rmcauses
1198 & (ERM_ENTER | ERM_CLEANPOLLUTION
1199 | ERM_CLEANFALLOUT | ERM_PILLAGE))) {
1201 "Requirements for extra removal defined but not "
1202 "a valid remove cause!");
1218 "Road '%s' integrates with '%s' but not vice versa!",
1232 "City styles have conflicting or invalid requirements!");
1257 "Action %s: min distance (%d) larger than "
1258 "any distance on a map can be (%d).",
1266 "Action %s: max distance is %d. "
1267 "A map can't be that big.",
1274 "Action %s: min distance is %d but max distance is %d.",
1288 "The action %s can't block %s.",
1297 "Action Enabler Actor Reqs")
1299 "Action Enabler Target Reqs")) {
1301 "Action enabler for %s has conflicting or invalid "
1309 if (requirement_vector_size(&(enabler->target_reqs)) > 0) {
1313 "An action enabler for %s has a target "
1314 "requirement vector. %s doesn't have a target.",
1322 if (preq->source.kind == VUT_DIPLREL
1323 && preq->range == REQ_RANGE_LOCAL) {
1330 "Action enabler for %s has a local DiplRel "
1331 "requirement %s in target_reqs! Please read the "
1332 "section \"Requirement vector rules\" in "
1333 "doc/README.actions",
1351 if (problem != NULL) {
1358 if (problem != NULL) {
1376 ACTRES_SPY_TARGETED_STEAL_TECH)
1380 ACTRES_SPY_TARGETED_SABOTAGE_CITY)
1382 ACTRES_SPY_SABOTAGE_CITY_PRODUCTION)
1387 "diplchance_initial_odds: \"%s\" not supported.",
1395 "%s both enters and frightens a hut at the same time.",
1429 "There's no basic city style for nation style %s",
1439 "Music Styles have conflicting or invalid requirements!");
1447 if (pterr->animal != NULL) {
1450 "%s has %s as animal to appear, but it's not native to the terrain.",
1456 for (pres = pterr->resources; *pres != NULL; pres++) {
1459 "%s has %s as a resource, but it's not a resource extra.",
1469 bool can_exist =
FALSE;
1490 "Unit class %s cannot exist anywhere.",
1498 if (!pach->unique && pach->cons_msg == NULL) {
1500 "Achievement %s has no message for consecutive gainers though "
1501 "it's possible to be gained by multiple players",
1516 "There's nation %s listed in embedded nations, but there's "
1548 if (pextra != pextra2) {
1551 if (!
BV_ISSET(pextra->conflicts, idx)) {
1552 log_debug(
"Autoconflicting resource %s with %s",
1563 const enum action_result blocked;
1564 const enum action_result blocker;
1585 { ACTRES_DISBAND_UNIT_RECOVER, ACTRES_HELP_WONDER },
1592 { ACTRES_DISBAND_UNIT, ACTRES_HELP_WONDER },
1593 { ACTRES_DISBAND_UNIT, ACTRES_DISBAND_UNIT_RECOVER },
1599 { ACTRES_CONQUER_CITY, ACTRES_ATTACK },
1605 { ACTRES_CONQUER_EXTRAS, ACTRES_ATTACK },
1609 { ACTRES_TRANSPORT_DISEMBARK, ACTRES_CONQUER_EXTRAS },
1610 { ACTRES_TRANSPORT_DISEMBARK, ACTRES_HUT_ENTER },
1611 { ACTRES_TRANSPORT_DISEMBARK, ACTRES_HUT_FRIGHTEN },
1616 for (i = 0; i <
ARRAY_SIZE(must_block); i++) {
1617 enum action_result blocked_result = must_block[i].blocked;
1618 enum action_result blocker_result = must_block[i].blocker;
1626 BV_SET(blocked->blocked_by, blocker->id);
1646 log_normal(
_(
"Disabling 'barbarians' setting for lack of suitable "
const char * achievement_rule_name(struct achievement *pach)
#define achievements_re_active_iterate(_p)
#define achievements_re_active_iterate_end
bool action_distance_inside_max(const struct action *action, const int distance)
enum action_actor_kind action_get_actor_kind(const struct action *paction)
struct action_auto_perf * action_auto_perf_slot_number(const int num)
struct req_vec_problem * action_enabler_suggest_repair(const struct action_enabler *enabler)
struct req_vec_problem * action_enabler_suggest_improvement(const struct action_enabler *enabler)
bool action_result_legal_target_kind(enum action_result result, enum action_target_kind tgt_kind)
const char * action_rule_name(const struct action *action)
const char * action_id_rule_name(action_id act_id)
bool action_would_be_blocked_by(const struct action *blocked, const struct action *blocker)
int action_dice_roll_initial_odds(const struct action *paction)
enum action_target_kind action_get_target_kind(const struct action *paction)
struct action_enabler_list * action_enablers_for_action(action_id action)
#define action_by_result_iterate(_paction_, _result_)
#define ACTION_DISTANCE_MAX
#define ACTION_AUTO_MOVED_ADJ
#define action_auto_perf_actions_iterate_end
static struct action * action_by_number(action_id act_id)
#define action_enabler_list_re_iterate_end
#define ACTION_DISTANCE_LAST_NON_SIGNAL
#define action_enabler_list_re_iterate(action_enabler_list, aenabler)
#define action_has_result(_act_, _res_)
#define action_by_result_iterate_end
#define action_auto_perf_actions_iterate(_autoperf_, _act_id_)
#define action_iterate_end
#define action_has_result_safe(paction, result)
#define action_iterate(_act_)
#define action_id_get_target_kind(act_id)
#define ACTION_ODDS_PCT_DICE_ROLL_NA
void astr_free(struct astring *astr)
#define BV_ISSET(bv, bit)
struct citystyle * city_styles
const char * city_style_rule_name(const int style)
#define log_deprecation(message,...)
const char * disaster_rule_name(struct disaster_type *pdis)
#define disaster_type_re_active_iterate(_p)
#define disaster_type_re_active_iterate_end
bool iterate_effect_cache(iec_cb cb, void *data)
int get_potential_improvement_bonus(const struct impr_type *pimprove, const struct city *pcity, enum effect_type effect_type, const enum req_problem_type prob_type, bool consider_multipliers)
int effect_cumulative_max(enum effect_type type, struct universal *unis, size_t n_unis)
int effect_cumulative_min(enum effect_type type, struct universal *for_uni)
#define MAX_NUM_TECH_LIST
const char * government_rule_name(const struct government *pgovern)
#define governments_re_active_iterate(_p)
#define governments_re_active_iterate_end
const char * improvement_rule_name(const struct impr_type *pimprove)
bool is_wonder(const struct impr_type *pimprove)
bool is_great_wonder(const struct impr_type *pimprove)
bool improvement_has_flag(const struct impr_type *pimprove, enum impr_flag_id flag)
const char * improvement_name_translation(const struct impr_type *pimprove)
#define improvement_re_active_iterate_end
#define improvement_re_active_iterate(_p)
#define log_verbose(message,...)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
#define log_debug(message,...)
#define log_normal(message,...)
bool is_native_to_class(const struct unit_class *punitclass, const struct terrain *pterrain, const bv_extras *extras)
bool can_unit_type_transport(const struct unit_type *transporter, const struct unit_class *transported)
const char * nation_rule_name(const struct nation_type *pnation)
struct nation_type * nation_by_rule_name(const char *name)
enum barbarian_type nation_barbarian_type(const struct nation_type *nation)
#define nations_re_active_iterate_end
#define nations_re_active_iterate(_pnat_)
const char * req_to_fstring(const struct requirement *req, struct astring *astr)
req_vec_num_in_item req_vec_vector_number(const void *parent_item, const struct requirement_vector *vec)
struct req_vec_problem * req_vec_suggest_repair(const struct requirement_vector *vec, requirement_vector_number get_num, const void *parent_item)
const char * universal_rule_name(const struct universal *psource)
void req_vec_problem_free(struct req_vec_problem *issue)
const char * universal_type_rule_name(const struct universal *psource)
enum req_unchanging_status is_req_unchanging(const struct req_context *context, const struct requirement *req)
#define requirement_vector_iterate_end
#define requirement_vector_iterate(req_vec, preq)
Road_type_id road_number(const struct road_type *proad)
void(* rs_conversion_logger)(const char *msg)
#define ruleset_error(logger, level, format,...)
static struct compatibility compat[]
const char * server_setting_name_get(server_setting_id id)
enum sset_type server_setting_type_get(server_setting_id id)
server_setting_id ssetv_setting_get(ssetv enc)
bool server_setting_exists(server_setting_id id)
struct setting * setting_by_name(const char *name)
struct setting * setting_by_number(int id)
enum sset_category setting_category(const struct setting *pset)
void setting_lock_set(struct setting *pset, bool lock)
bool setting_enum_set(struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
bool setting_is_visible_at_level(const struct setting *pset, enum cmdlevel plevel)
bool formats_match(const char *format1, const char *format2)
const char * specialist_rule_name(const struct specialist *sp)
#define specialist_type_re_active_iterate_end
#define specialist_type_re_active_iterate(_p)
enum action_result result
bv_action_sub_results sub_results
enum action_target_kind target_kind
struct advance * require[AR_SIZE]
struct civ_game::@29 rgame
struct civ_game::@30::@34 server
struct packet_ruleset_control control
int global_init_techs[MAX_NUM_TECH_LIST]
struct packet_game_info info
struct civ_game::@30::@34::@39 ruledit
size_t embedded_nations_count
struct packet_calendar_info calendar
struct government * default_government
struct government * government_during_revolution
struct requirement_vector reqs
struct els_data::@98 base_effects
rs_conversion_logger logger
bool city_vision_radius_sq
int init_techs[MAX_NUM_TECH_LIST]
enum free_tech_method free_tech_method
bv_actions diplchance_initial_odds
enum tech_cost_style tech_cost_style
struct extra_type_list * integrators
const struct unit_type * obsoleted_by
const char * style_rule_name(const struct nation_style *pstyle)
int basic_city_style_for_style(struct nation_style *pstyle)
#define music_styles_re_active_iterate_end
#define music_styles_re_active_iterate(_p)
#define styles_re_active_iterate_end
#define styles_re_active_iterate(_p)
struct advance * advance_by_number(const Tech_type_id atype)
struct advance * advance_requires(const struct advance *padvance, enum tech_req require)
struct advance * valid_advance_by_number(const Tech_type_id id)
const char * advance_rule_name(const struct advance *padvance)
Tech_type_id advance_number(const struct advance *padvance)
#define advance_re_active_iterate(_p)
#define advance_req_iterate(_goal, _padvance)
#define advance_re_active_iterate_end
#define advance_req_iterate_end
const char * terrain_rule_name(const struct terrain *pterrain)
#define terrain_re_active_iterate_end
#define is_ocean(pterrain)
#define terrain_re_active_iterate(_p)
const char * goods_rule_name(struct goods_type *pgood)
#define goods_type_re_active_iterate_end
#define goods_type_re_active_iterate(_p)
const struct impr_type * building
bool utype_is_cityfounder(const struct unit_type *utype)
struct unit_type * get_role_unit(int role, int role_index)
bool utype_has_role(const struct unit_type *punittype, int role)
int num_role_units(int role)
const char * utype_rule_name(const struct unit_type *punittype)
const char * uclass_rule_name(const struct unit_class *pclass)
static bool uclass_has_flag(const struct unit_class *punitclass, enum unit_class_flag_id flag)
#define unit_type_re_active_iterate(_p)
#define unit_class_iterate(_p)
#define unit_class_re_active_iterate_end
static bool utype_has_flag(const struct unit_type *punittype, int flag)
#define unit_type_iterate(_p)
#define unit_class_re_active_iterate(_p)
#define UNIT_MAX_PARADROP_RANGE
#define uclass_index(_c_)
#define unit_class_iterate_end
#define unit_type_iterate_end
#define unit_type_re_active_iterate_end