45 qCritical(
"Too long ruleset summary. It can be only %d bytes long. "
46 "Put longer explanations to ruleset description.",
150 const char *list_for)
153 case VUT_IMPROVEMENT:
161 qCritical(
"%s: World-ranged requirement not supported for "
162 "%s (only great wonders supported)",
165 }
else if (preq->
range > REQ_RANGE_TRADEROUTE
167 qCritical(
"%s: %s-ranged requirement not supported for "
168 "%s (only wonders supported)",
169 list_for, req_range_name(preq->
range),
179 qCritical(
"%s: MinCalFrag requirement used in ruleset without "
180 "calendar fragments",
185 qCritical(
"%s: MinCalFrag requirement %d out of range (max %d in "
192 case VUT_SERVERSETTING:
204 qCritical(
"%s: ServerSetting requirement %s isn't visible enough "
205 "to appear in a requirement. Everyone should be able to "
206 "see the value of a server setting that appears in a "
215 qCritical(
"%s: ServerSetting requirement setting %s isn't about a "
234 int local_reqs_of_type[],
236 int max_tiles,
const char *list_for)
262 case VUT_TERRAINCLASS:
263 if (local_reqs_of_type[VUT_TERRAIN] > 0) {
264 qCritical(
"%s: Requirement list has both local terrain and "
265 "terrainclass requirement",
271 if (local_reqs_of_type[VUT_TERRAINCLASS] > 0) {
272 qCritical(
"%s: Requirement list has both local terrain and "
273 "terrainclass requirement",
294 case VUT_MINFOREIGNPCT:
301 case VUT_TERRAINALTER:
305 case VUT_VISIONLAYER:
312 qCritical(
"%s: Requirement list has multiple %s requirements",
319 if (max_tiles != -1 && rc > max_tiles) {
320 qCritical(
"%s: Requirement list has more %s requirements than "
321 "can ever be fulfilled.",
327 case VUT_TERRAINCLASS:
328 if (rc > 2 || (max_tiles != -1 && rc > max_tiles)) {
329 qCritical(
"%s: Requirement list has more %s requirements than "
330 "can ever be fulfilled.",
339 qCritical(
"%s: Requirement list has more %s requirements than "
340 "can ever be fulfilled.",
349 qCritical(
"%s: Requirement list has more %s requirements than "
350 "can ever be fulfilled.",
356 case VUT_SERVERSETTING:
363 case VUT_MAXTILEUNITS:
367 case VUT_NATIONGROUP:
372 case VUT_IMPROVEMENT:
383 case VUT_NATIONALITY:
385 case VUT_ACHIEVEMENT:
420 bool conjunctive,
int max_tiles,
421 const char *list_for)
424 int reqs_of_type[VUT_COUNT];
425 int local_reqs_of_type[VUT_COUNT];
428 memset(reqs_of_type, 0,
sizeof(reqs_of_type));
429 memset(local_reqs_of_type, 0,
sizeof(local_reqs_of_type));
434 conjunctive, max_tiles, list_for)) {
442 if (problem !=
nullptr) {
443 qCritical(
"%s: %s.", list_for, problem->
description);
459 if (peffect->
type == EFT_ACTION_SUCCESS_TARGET_MOVE_COST) {
463 if (preq->source.kind == VUT_ACTION) {
470 qCritical(
"The effect Action_Success_Target_Move_Cost has the"
471 " requirement {%s} but the action %s isn't"
472 " (single) unit targeted.",
480 }
else if (peffect->
type == EFT_ACTION_SUCCESS_MOVE_COST) {
484 if (preq->source.kind == VUT_ACTION && preq->present) {
486 qCritical(
"The effect Action_Success_Actor_Move_Cost has the"
487 " requirement {%s} but the action %s isn't"
488 " performed by a unit.",
496 }
else if (peffect->
type == EFT_ACTION_ODDS_PCT) {
500 if (preq->source.kind == VUT_ACTION && preq->present) {
503 qCritical(
"The effect Action_Odds_Pct has the"
504 " requirement {%s} but the action %s doesn't"
505 " roll the dice to see if it fails.",
516 effect_type_name(peffect->
type));
526 qCCritical(ruleset_category,
"No role barbarian leader units");
530 qCCritical(ruleset_category,
"No role barbarian build units");
534 qCCritical(ruleset_category,
"No role barbarian ship units");
537 bool sea_capable =
false;
551 qCCritical(ruleset_category,
552 "Barbarian boat (%s) needs to be able to move at sea.",
558 qCCritical(ruleset_category,
"No role sea raider barbarian units");
565 if (ptype->transport_capacity <= 1) {
566 qCCritical(ruleset_category,
567 "Barbarian boat %s has no capacity for both "
568 "leader and at least one man.",
579 qCCritical(ruleset_category,
580 "Barbarian boat %s cannot transport "
581 "barbarian cargo %s.",
603 qCCritical(ruleset_category,
"No flag Settler units");
607 qCCritical(ruleset_category,
"No role Start Explorer units");
610 qCCritical(ruleset_category,
"No role Ferryboat units");
613 qCCritical(ruleset_category,
"No role Firstbuild units");
617 bool sea_capable =
false;
631 qCCritical(ruleset_category,
632 "Ferryboat (%s) needs to be able to move at sea.",
640 qCCritical(ruleset_category,
"Inspire_Partisans effect present, but no "
641 "units with partisan role.");
657 && pimprove->genus != IG_SPECIAL) {
660 "Gold producing improvement with genus other than \"Special\"");
665 && pimprove->genus != IG_IMPROVEMENT) {
668 "Disasterproof improvement with genus other than \"Improvement\"");
683 enum effect_type boolean_effects[] = {
684 EFT_ANY_GOVERNMENT, EFT_CAPITAL_CITY, EFT_ENABLE_NUKE,
685 EFT_ENABLE_SPACE, EFT_HAVE_EMBASSIES, EFT_NO_ANARCHY,
686 EFT_NUKE_PROOF, EFT_REVEAL_CITIES, EFT_REVEAL_MAP,
687 EFT_SIZE_UNLIMIT, EFT_SS_STRUCTURAL, EFT_SS_COMPONENT,
688 EFT_NO_UNHAPPY, EFT_RAPTURE_GROW, EFT_HAS_SENATE,
689 EFT_INSPIRE_PARTISANS, EFT_HAPPINESS_TO_GOLD, EFT_FANATICS,
690 EFT_NO_DIPLOMACY, EFT_GOV_CENTER, EFT_NOT_TECH_SOURCE,
691 EFT_VICTORY, EFT_HAVE_CONTACTS, EFT_COUNT};
695 for (i = 0; boolean_effects[i] != EFT_COUNT; i++) {
698 qCCritical(ruleset_category,
699 "Boolean effect %s can get disabled, but it can't get "
700 "enabled before that.",
701 effect_type_name(boolean_effects[i]));
723 bool default_gov_failed =
false;
729 if (
game.
info.tech_cost_style == TECH_COST_CIV1CIV2
730 &&
game.
info.free_tech_method == FTM_CHEAPEST) {
731 qCCritical(ruleset_category,
732 "Cost based free tech method, but tech cost style "
733 "1 so all techs cost the same.");
752 }
else if (preq == padvance) {
753 qCCritical(ruleset_category,
"Tech \"%s\" requires itself.",
761 if (preqreq == padvance) {
762 qCCritical(ruleset_category,
763 "Tech \"%s\" requires itself indirectly via \"%s\".",
773 if (preq->source.kind == VUT_ADVANCE) {
777 qCCritical(ruleset_category,
778 "Tech \"%s\" requires a tech in its research_reqs."
779 " This isn't supported yet. Please keep using req1"
780 " and req2 like before.",
787 qCCritical(ruleset_category,
788 "Tech \"%s\" has the requirement %s in its"
789 " research_reqs. This requirement may change during"
790 " the game. Changing requirements aren't supported"
799 if (padvance->bonus_message !=
nullptr) {
801 qCCritical(ruleset_category,
802 "Tech \"%s\" bonus message is not format with %%s for "
803 "a bonus tech name.",
812 qCCritical(ruleset_category,
813 "The government form %s reserved for revolution handling "
815 "default_government.",
818 default_gov_failed =
true;
822 for (
const auto &pnation :
nations) {
833 qCCritical(ruleset_category,
834 "Tech %s does not exist, but is initial "
835 "tech for everyone.",
842 qCCritical(ruleset_category,
843 "Tech %s is initial for everyone, but %s has "
844 "no root_req for it.",
858 qCCritical(ruleset_category,
859 "Tech %s does not exist, but is tech for %s.",
867 qCCritical(ruleset_category,
868 "Tech %s is initial for %s, but they have "
869 "no root_req for it.",
877 && pnation.init_buildings[0] !=
B_LAST) {
878 qCCritical(ruleset_category,
879 "Barbarian nation %s has init_buildings set but will "
884 if (!default_gov_failed
886 qCCritical(ruleset_category,
887 "The government form %s reserved for revolution "
888 "handling has been set as "
889 "initial government for %s.",
900 int chain_length = 0;
901 const struct unit_type *upgraded = putype;
903 while (upgraded !=
nullptr) {
906 if (chain_length > num_utypes) {
907 qCCritical(ruleset_category,
908 "There seems to be obsoleted_by loop in update "
909 "chain that starts from %s",
926 qCCritical(ruleset_category,
927 "The unit type '%s' has the 'Spy' unit type flag but "
928 "not the 'Diplomat' unit type flag.",
938 if (putype->paratroopers_range < 0
941 qCCritical(ruleset_category,
942 "The paratroopers_range of the unit type '%s' is %d. "
943 "That is out of range. Max range is %d.",
954 qCCritical(ruleset_category,
955 "Effects have conflicting or invalid requirements!");
970 qCCritical(ruleset_category,
971 "Disasters have conflicting or invalid requirements!");
982 qCCritical(ruleset_category,
983 "Goods have conflicting or invalid requirements!");
994 qCCritical(ruleset_category,
995 "Buildings have conflicting or invalid requirements!");
1000 qCCritical(ruleset_category,
1001 "Buildings have conflicting or invalid obsolescence req!");
1011 qCCritical(ruleset_category,
1012 "Governments have conflicting or invalid requirements!");
1024 qCCritical(ruleset_category,
1025 "Specialists have conflicting or invalid requirements!");
1036 qCCritical(ruleset_category,
1037 "Extras have conflicting or invalid requirements!");
1042 qCCritical(ruleset_category,
1043 "Extras have conflicting or invalid removal requirements!");
1046 if ((requirement_vector_size(&pextra->rmreqs) > 0)
1047 && !(pextra->rmcauses
1048 & (ERM_ENTER | ERM_CLEANPOLLUTION | ERM_CLEANFALLOUT
1050 qCWarning(ruleset_category,
1051 "Requirements for extra removal defined but not "
1052 "a valid remove cause!");
1069 qCCritical(ruleset_category,
1070 "Road '%s' integrates with '%s' but not vice versa!",
1085 if (ignore_retired) {
1090 for (bfi = 0; bfi < BF_COUNT; bfi++) {
1097 qCCritical(ruleset_category,
1098 "Base %s uses the retired base flag %s!",
1100 base_flag_id_name(base_flag_id(bfi)));
1110 qCCritical(ruleset_category,
1111 "City styles have conflicting or invalid requirements!");
1122 qCCritical(ruleset_category,
"Action %s: negative min distance (%d).",
1128 qCCritical(ruleset_category,
1129 "Action %s: min distance (%d) larger than "
1130 "any distance on a map can be (%d).",
1137 qCCritical(ruleset_category,
1138 "Action %s: max distance is %d. "
1139 "A map can't be that big.",
1145 qCCritical(ruleset_category,
1146 "Action %s: min distance is %d but max distance is %d.",
1160 qCCritical(ruleset_category,
"The action %s can't block %s.",
1170 "Action Enabler Actor Reqs")
1172 "Action Enabler Target Reqs")) {
1173 qCCritical(ruleset_category,
1174 "Action enabler for %s has conflicting or invalid "
1183 if (requirement_vector_size(&(enabler->target_reqs)) > 0) {
1186 qCCritical(ruleset_category,
1187 "An action enabler for %s has a target "
1188 "requirement vector. %s doesn't have a target.",
1196 if (preq->source.kind == VUT_DIPLREL
1197 && preq->range == REQ_RANGE_LOCAL) {
1201 qCCritical(ruleset_category,
1202 "Action enabler for %s has a local DiplRel "
1203 "requirement %s in target_reqs! Please read the "
1204 "section \"Requirement vector rules\" in "
1205 "doc/README.actions",
1213 if (!ignore_retired) {
1222 if (problem !=
nullptr) {
1223 qCCritical(ruleset_category,
"%s", problem->
description);
1228 if (problem !=
nullptr) {
1230 qCWarning(deprecations_category,
"Enabler for action %s: %s",
1256 qCCritical(ruleset_category,
1257 "auto_attack: %s not supported in"
1270 qCCritical(ruleset_category,
1271 "There's no basic city style for nation style %s",
1282 qCCritical(ruleset_category,
1283 "Music Styles have conflicting or invalid requirements!");
1291 if (pterr->animal !=
nullptr) {
1293 qCCritical(ruleset_category,
1294 "%s has %s as animal to appear, but it's not native "
1307 bool can_exist =
false;
1331 qCCritical(ruleset_category,
"Unit class %s cannot exist anywhere.",
1341 if (!pach->unique && pach->cons_msg ==
nullptr) {
1344 "Achievement %s has no message for consecutive gainers though "
1345 "it's possible to be gained by multiple players",
1352 if (
game.
server.ruledit.embedded_nations !=
nullptr) {
1355 for (nati = 0; nati <
game.
server.ruledit.embedded_nations_count;
1360 if (pnat ==
nullptr) {
1363 "There's nation %s listed in embedded nations, but there's "
1397 if (pextra != pextra2) {
1400 if (!
BV_ISSET(pextra->conflicts, idx)) {
1401 log_debug(
"Autoconflicting resource %s with %s",
1414 const enum action_result blocked;
1415 const enum action_result blocker;
1436 {ACTRES_RECYCLE_UNIT, ACTRES_HELP_WONDER},
1443 {ACTRES_DISBAND_UNIT, ACTRES_HELP_WONDER},
1444 {ACTRES_DISBAND_UNIT, ACTRES_RECYCLE_UNIT},
1450 {ACTRES_CONQUER_CITY, ACTRES_ATTACK},
1455 for (i = 0; i <
ARRAY_SIZE(must_block); i++) {
1456 enum action_result blocked_result = must_block[i].blocked;
1457 enum action_result blocker_result = must_block[i].blocker;
1464 qCDebug(ruleset_category,
"Autoblocking %s with %s",
1466 BV_SET(blocked->blocked_by, blocker->id);
1488 qCInfo(ruleset_category,
1489 (
"Disabling 'barbarians' setting for lack of suitable "
const char * achievement_rule_name(struct achievement *pach)
Return untranslated name of this achievement type.
#define achievements_iterate_end
#define achievements_iterate(_ach_)
bool action_distance_inside_max(const struct action *action, const int distance)
Returns TRUE iff the specified distance between actor and target is sm,aller or equal to the max rang...
enum action_actor_kind action_get_actor_kind(const struct action *paction)
Get the actor kind of an action.
const char * action_rule_name(const struct action *action)
Get the rule name of the action.
struct req_vec_problem * action_enabler_suggest_repair(const struct action_enabler *enabler)
Returns a suggestion to fix the specified action enabler or nullptr if no fix is found to be needed.
bool action_would_be_blocked_by(const struct action *blocked, const struct action *blocker)
Returns TRUE iff blocked will be illegal if blocker is legal.
int action_dice_roll_initial_odds(const struct action *paction)
Returns the initial odds of an action not failing its dice roll.
struct action * action_by_number(action_id act_id)
Return the action with the given id.
struct req_vec_problem * action_enabler_suggest_improvement(const struct action_enabler *enabler)
Returns a suggestion to improve the specified action enabler or nullptr if nothing to improve is foun...
enum action_target_kind action_get_target_kind(const struct action *paction)
Get the target kind of an action.
bool action_has_result(const struct action *paction, enum action_result result)
Returns TRUE iff performing the specified action has the specified result.
struct action_auto_perf * action_auto_perf_slot_number(const int num)
Returns action auto performer rule slot number num so it can be filled.
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_DISTANCE_MAX
#define ACTION_AUTO_MOVED_ADJ
#define action_auto_perf_actions_iterate_end
#define ACTION_DISTANCE_LAST_NON_SIGNAL
#define action_enabler_list_iterate_end
#define action_by_result_iterate_end
#define action_by_result_iterate(_paction_, _act_id_, _result_)
#define action_auto_perf_actions_iterate(_autoperf_, _act_id_)
#define action_iterate_end
#define action_enabler_list_iterate(action_enabler_list, aenabler)
#define action_iterate(_act_)
#define action_id_get_target_kind(act_id)
#define ACTION_ODDS_PCT_DICE_ROLL_NA
bool base_flag_is_retired(enum base_flag_id flag)
Returns TRUE iff the given flag is retired.
bool BV_ISSET(const BV &bv, int bit)
struct citystyle * city_styles
const char * city_style_rule_name(const int style)
Return the (untranslated) rule name of the city style.
const char * disaster_rule_name(struct disaster_type *pdis)
Return untranslated name of this disaster type.
#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.
int effect_cumulative_max(enum effect_type type, struct universal *for_uni)
Get the maximum effect value in this ruleset for the universal (that is, the sum of all positive effe...
int effect_cumulative_min(enum effect_type type, struct universal *for_uni)
Get the minimum effect value in this ruleset for the universal (that is, the sum of all negative effe...
#define MAX_NUM_TECH_LIST
const char * government_rule_name(const struct government *pgovern)
Return the (untranslated) rule name of the government.
std::vector< government > governments
const char * improvement_rule_name(const struct impr_type *pimprove)
Return the (untranslated) rule name of the improvement.
bool is_wonder(const struct impr_type *pimprove)
Returns whether improvement is some kind of wonder.
bool is_great_wonder(const struct impr_type *pimprove)
Is this building a great wonder?
bool improvement_has_flag(const struct impr_type *pimprove, enum impr_flag_id flag)
Return TRUE if the impr has this flag otherwise FALSE.
const char * improvement_name_translation(const struct impr_type *pimprove)
Return the (translated) name of the given improvement.
#define improvement_iterate_end
#define improvement_iterate(_p)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
#define log_debug(message,...)
bool is_native_to_class(const struct unit_class *punitclass, const struct terrain *pterrain, const bv_extras *extras)
This terrain is native to unit class.
bool can_unit_type_transport(const struct unit_type *transporter, const struct unit_class *transported)
Return TRUE iff transporter type has ability to transport transported class.
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
struct nation_type * nation_by_rule_name(const char *name)
Returns the nation that has the given (untranslated) rule name (adjective).
enum barbarian_type nation_barbarian_type(const struct nation_type *nation)
Returns which kind of barbarians can use this nation.
req_vec_num_in_item req_vec_vector_number(const void *parent_item, const struct requirement_vector *vec)
Returns the requirement vector number of the specified requirement vector in the specified requiremen...
bool is_req_unchanging(const struct requirement *req)
Return TRUE if this is an "unchanging" requirement.
struct req_vec_problem * req_vec_get_first_contradiction(const struct requirement_vector *vec, requirement_vector_number get_num, const void *parent_item)
Returns the first self contradiction found in the specified requirement vector with suggested solutio...
const char * universal_type_rule_name(const struct universal *psource)
Return untranslated name of the universal source name.
QString req_to_fstring(const struct requirement *req)
Returns the given requirement as a formatted string ready for printing.
void req_vec_problem_free(struct req_vec_problem *issue)
De-allocates resources associated with the given requirement vector problem.
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)
Road_type_id road_number(const struct road_type *proad)
Return the road id.
enum sset_type server_setting_type_get(server_setting_id id)
Returns the type of the server setting with the specified id.
server_setting_id ssetv_setting_get(ssetv enc)
Returns the server setting of the setting - value pair.
bool server_setting_exists(server_setting_id id)
Returns TRUE iff a server setting with the specified id exists.
const char * server_setting_name_get(server_setting_id id)
Returns the name of the server setting with the specified id.
enum sset_category setting_category(const struct setting *pset)
Access function for the setting category.
struct setting * setting_by_number(int id)
Returns the setting to the given id.
void setting_lock_set(struct setting *pset, bool lock)
Set the value for the lock of a setting.
struct setting * setting_by_name(const char *name)
Returns the setting to the given name.
bool setting_enum_set(struct setting *pset, const char *val, struct connection *caller, char *reject_msg, size_t reject_msg_len)
Set the setting to 'val'.
bool setting_is_visible_at_level(const struct setting *pset, enum cmdlevel plevel)
Returns whether the specified server setting (option) can be seen by a caller with the specified acce...
bool formats_match(const char *format1, const char *format2)
Returns TRUE iff both formats are compatible (if 'format1' can be used instead 'format2' and reciproc...
const char * specialist_rule_name(const struct specialist *sp)
Return the (untranslated) rule name of the specialist type.
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 advance * require[AR_SIZE]
struct civ_game::@28::@32 server
struct packet_ruleset_control control
int global_init_techs[MAX_NUM_TECH_LIST]
struct packet_game_info info
struct civ_game::@27 rgame
struct packet_calendar_info calendar
struct government * default_government
struct government * government_during_revolution
struct requirement_vector reqs
int init_techs[MAX_NUM_TECH_LIST]
struct extra_type_list * integrators
struct requirement_vector reqs
const struct unit_type * obsoleted_by
const char * style_rule_name(const struct nation_style *pstyle)
Return the (untranslated) rule name of the style.
int basic_city_style_for_style(struct nation_style *pstyle)
Return basic city style representing nation style.
#define music_styles_iterate(_p)
#define music_styles_iterate_end
#define styles_iterate(_p)
#define styles_iterate_end
struct advance * advance_requires(const struct advance *padvance, enum tech_req require)
Accessor for requirements.
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.
struct advance * valid_advance_by_number(const Tech_type_id id)
Returns pointer when the advance "exists" in this game, returns nullptr otherwise.
Tech_type_id advance_number(const struct advance *padvance)
Return the advance index.
#define advance_req_iterate(_goal, _padvance)
#define advance_iterate(_start, _p)
#define advance_req_iterate_end
#define advance_iterate_end
const char * terrain_rule_name(const struct terrain *pterrain)
Return the (untranslated) rule name of the terrain.
#define terrain_type_iterate(_p)
#define is_ocean(pterrain)
#define terrain_type_iterate_end
const char * goods_rule_name(struct goods_type *pgood)
Return untranslated name of this goods type.
#define goods_type_iterate_end
#define goods_type_iterate(_p)
const struct impr_type * building
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.
int num_role_units(int role)
How many unit types have specified role/flag.
struct unit_type * get_role_unit(int role, int role_index)
Return index-th unit with specified role/flag.
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_class_iterate(_p)
static bool utype_has_flag(const struct unit_type *punittype, int flag)
#define unit_type_iterate(_p)
#define UNIT_MAX_PARADROP_RANGE
#define uclass_index(_c_)
#define unit_class_iterate_end
#define unit_type_iterate_end