47#define ACTPROB_VAL_MIN 0
49#define ACTPROB_VAL_MAX 200
51#define ACTPROB_VAL_1_PCT (ACTPROB_VAL_MAX / 100)
53#define ACTPROB_VAL_NA 253
55#define ACTPROB_VAL_NOT_IMPL 254
950 if (
actions[act]->ui_name[0] ==
'\0') {
1005 "%s contradicts itself regarding sub targets.",
1124 return paction->sub_target_kind;
1163 FALSE,
"Action %d don't exist.", act_id);
1197 const struct action *blocker)
1285 if (prob.
min == prob.
max) {
1330 "Invalid action %d", act_id);
1389 const char *ui_name =
_(
actions[act_id]->ui_name);
1432 }
else if (prob.
min == prob.
max) {
1444 _(
"The probability of success is %.1f%%, %.1f%% or somewhere"
1448 prob.
max - prob.
min > 1 ?
1451 _(
" (This is the most precise interval I can calculate "
1452 "given the information our nation has access to.)") :
1466 "Action %s isn't performed by a unit",
1481 enabler->rulesave.comment =
nullptr;
1497 if (
enabler->rulesave.comment !=
nullptr) {
1602 for (
i = 0;
i <
obreq->contras->alternatives;
i++) {
1614 || (
obreq->contras->alternative[
i].req.present
1616 &
obreq->contras->alternative[
i].req.source))) {
1636 for (
i = 0;
i <
obreq->contras->alternatives;
i++) {
1647 out->suggested_solutions[
i].vector_number
1652 out->suggested_solutions[
i].req.present
1653 = !
obreq->contras->alternative[
i].req.present;
1654 out->suggested_solutions[
i].req.source
1655 =
obreq->contras->alternative[
i].req.source;
1656 out->suggested_solutions[
i].req.range
1657 =
obreq->contras->alternative[
i].req.range;
1658 out->suggested_solutions[
i].req.survives
1659 =
obreq->contras->alternative[
i].req.survives;
1660 out->suggested_solutions[
i].req.quiet
1661 =
obreq->contras->alternative[
i].req.quiet;
1828 N_(
"Requirement {%s} of action \"%s\" implies a claimed "
1829 "tile. No diplomatic relation to Nature."),
1836 out->suggested_solutions[0].vector_number
1892 N_(
"In enabler for \"%s\": No diplomatic relation to Nature."
1893 " Requirements {%s} and {%s} contradict each other."),
1903 out->suggested_solutions[0].vector_number
1909 out->suggested_solutions[1].vector_number
2031 " used by any unit."),
2057 if (vec == &
ae->actor_reqs) {
2059 }
else if (vec == &
ae->target_reqs) {
2084 return &
ae->actor_reqs;
2086 return &
ae->target_reqs;
2104 return _(
"actor_reqs");
2107 return _(
"target_reqs");
2166static const struct tile *
2226static const struct city *
2265 if (ptile !=
nullptr) {
2287 const struct action *act,
2631 const struct city *homecity)
2682 if (0 >=
actor->city->airlift
2820 const struct city *homecity)
2829 if (target ==
NULL) {
3002 "Is omniscient, should get yes or no.");
3042 FALSE,
"Action %s is performed by %s not %s",
3050 FALSE,
"Action %s is against %s not %s",
3122 FALSE,
"Action %s is performed by %s not %s",
3130 FALSE,
"Action %s is against %s not %s",
3202 FALSE,
"Action %s is performed by %s not %s",
3210 FALSE,
"Action %s is against %s not %s",
3288 FALSE,
"Action %s is performed by %s not %s",
3296 FALSE,
"Action %s is against %s not %s",
3365 FALSE,
"Action %s is performed by %s not %s",
3373 FALSE,
"Action %s is against %s not %s",
3441 FALSE,
"Action %s is performed by %s not %s",
3449 FALSE,
"Action %s is against %s not %s",
3502 nullptr,
nullptr,
nullptr);
3536 if (target ==
NULL) {
3859 if (target ==
NULL) {
4047 }
else if (known ==
TRI_YES) {
4185 "Action %s is performed by %s not %s",
4193 "Action %s is against %s not %s",
4284 "Action %s is performed by %s not %s",
4292 "Action %s is against %s not %s",
4372 "Action %s is performed by %s not %s",
4380 "Action %s is against %s not %s",
4505 "Invalid probability [%d, %d]",
4561 "Action %s is performed by %s not %s",
4569 "Action %s is against %s not %s",
4644 "Action %s is performed by %s not %s",
4652 "Action %s is against %s not %s",
4727 "Action %s is performed by %s not %s",
4735 "Action %s is against %s not %s",
4832 log_error(
"Invalid action target kind");
4850 const struct city* target)
4885 const struct unit *target)
4918 const struct tile *target)
5402 "Bad initial odds for action number %d."
5403 " Does it roll the dice at all?",
5496 FALSE,
"Action %s is against %s not cities",
5811 return "ui_name_poison_city";
5813 return "ui_name_poison_city_escape";
5815 return "ui_name_sabotage_unit";
5817 return "ui_name_sabotage_unit_escape";
5819 return "ui_name_bribe_unit";
5821 return "ui_name_bribe_stack";
5823 return "ui_name_sabotage_city";
5825 return "ui_name_sabotage_city_escape";
5827 return "ui_name_targeted_sabotage_city";
5829 return "ui_name_sabotage_city_production";
5831 return "ui_name_targeted_sabotage_city_escape";
5833 return "ui_name_sabotage_city_production_escape";
5835 return "ui_name_incite_city";
5837 return "ui_name_incite_city_escape";
5839 return "ui_name_establish_embassy";
5841 return "ui_name_establish_embassy_stay";
5843 return "ui_name_steal_tech";
5845 return "ui_name_steal_tech_escape";
5847 return "ui_name_targeted_steal_tech";
5849 return "ui_name_targeted_steal_tech_escape";
5851 return "ui_name_investigate_city";
5853 return "ui_name_investigate_city_spend_unit";
5855 return "ui_name_steal_gold";
5857 return "ui_name_steal_gold_escape";
5859 return "ui_name_spread_plague";
5861 return "ui_name_steal_maps";
5863 return "ui_name_steal_maps_escape";
5865 return "ui_name_establish_trade_route";
5867 return "ui_name_enter_marketplace";
5869 return "ui_name_help_wonder";
5871 return "ui_name_capture_units";
5873 return "ui_name_expel_unit";
5875 return "ui_name_found_city";
5877 return "ui_name_join_city";
5879 return "ui_name_bombard";
5881 return "ui_name_bombard_2";
5883 return "ui_name_bombard_3";
5885 return "ui_name_bombard_4";
5887 return "ui_name_bombard_lethal";
5889 return "ui_name_bombard_lethal_2";
5891 return "ui_name_suitcase_nuke";
5893 return "ui_name_suitcase_nuke_escape";
5895 return "ui_name_explode_nuclear";
5897 return "ui_name_nuke_city";
5899 return "ui_name_nuke_units";
5901 return "ui_name_destroy_city";
5903 return "ui_name_disband_unit_recover";
5905 return "ui_name_disband_unit";
5907 return "ui_name_home_city";
5909 return "ui_name_homeless";
5911 return "ui_name_upgrade_unit";
5913 return "ui_name_paradrop_unit";
5915 return "ui_name_paradrop_unit_conquer";
5917 return "ui_name_paradrop_unit_frighten";
5919 return "ui_name_paradrop_unit_frighten_conquer";
5921 return "ui_name_paradrop_unit_enter";
5923 return "ui_name_paradrop_unit_enter_conquer";
5925 return "ui_name_airlift_unit";
5927 return "ui_name_attack";
5929 return "ui_name_attack_2";
5931 return "ui_name_suicide_attack";
5933 return "ui_name_suicide_attack_2";
5935 return "ui_name_wipe_units";
5937 return "ui_name_collect_ransom";
5939 return "ui_name_surgical_strike_building";
5941 return "ui_name_surgical_strike_production";
5943 return "ui_name_conquer_city_shrink";
5945 return "ui_name_conquer_city_shrink2";
5947 return "ui_name_conquer_city_shrink3";
5949 return "ui_name_conquer_city_shrink4";
5951 return "ui_name_conquer_extras";
5953 return "ui_name_conquer_extras_2";
5955 return "ui_name_conquer_extras_3";
5957 return "ui_name_conquer_extras_4";
5959 return "ui_name_heal_unit";
5961 return "ui_name_heal_unit_2";
5963 return "ui_name_transform_terrain";
5965 return "ui_name_transform_terrain_2";
5967 return "ui_name_cultivate";
5969 return "ui_name_cultivate_2";
5971 return "ui_name_plant";
5973 return "ui_name_plant_2";
5975 return "ui_name_pillage";
5977 return "ui_name_pillage_2";
5979 return "ui_name_clean";
5981 return "ui_name_clean_2";
5983 return "ui_name_fortify";
5985 return "ui_name_fortify_2";
5987 return "ui_name_build_road";
5989 return "ui_name_build_road_2";
5991 return "ui_name_convert_unit";
5993 return "ui_name_build_base";
5995 return "ui_name_build_base_2";
5997 return "ui_name_build_mine";
5999 return "ui_name_build_mine_2";
6001 return "ui_name_irrigate";
6003 return "ui_name_irrigate_2";
6005 return "ui_name_transport_deboard";
6007 return "ui_name_transport_board";
6009 return "ui_name_transport_board_2";
6011 return "ui_name_transport_board_3";
6013 return "ui_name_transport_embark";
6015 return "ui_name_transport_embark_2";
6017 return "ui_name_transport_embark_3";
6019 return "ui_name_transport_embark_4";
6021 return "ui_name_transport_unload";
6023 return "ui_name_transport_load";
6025 return "ui_name_transport_load_2";
6027 return "ui_name_transport_load_3";
6029 return "ui_name_transport_disembark";
6031 return "ui_name_transport_disembark_2";
6033 return "ui_name_transport_disembark_3";
6035 return "ui_name_transport_disembark_4";
6037 return "ui_name_enter_hut";
6039 return "ui_name_enter_hut_2";
6041 return "ui_name_enter_hut_3";
6043 return "ui_name_enter_hut_4";
6045 return "ui_name_frighten_hut";
6047 return "ui_name_frighten_hut_2";
6049 return "ui_name_frighten_hut_3";
6051 return "ui_name_frighten_hut_4";
6053 return "ui_name_spy_attack";
6055 return "ui_name_unit_move";
6057 return "ui_name_unit_move_2";
6059 return "ui_name_unit_move_3";
6061 return "ui_name_teleport";
6063 return "ui_name_teleport_2";
6065 return "ui_name_teleport_3";
6067 return "ui_name_teleport_conquer";
6069 return "ui_name_teleport_frighten";
6071 return "ui_name_teleport_frighten_conquer";
6073 return "ui_name_teleport_enter";
6075 return "ui_name_teleport_enter_conquer";
6077 return "ui_name_escape";
6079 return "ui_name_user_action_1";
6081 return "ui_name_user_action_2";
6083 return "ui_name_user_action_3";
6085 return "ui_name_user_action_4";
6110 return N_(
"%sPoison City%s");
6113 return N_(
"%sPoison City and Escape%s");
6116 return N_(
"S%sabotage Enemy Unit%s");
6119 return N_(
"S%sabotage Enemy Unit and Escape%s");
6122 return N_(
"Bribe Enemy %sUnit%s");
6125 return N_(
"Bribe Enemy %sStack%s");
6128 return N_(
"%sSabotage City%s");
6131 return N_(
"%sSabotage City and Escape%s");
6134 return N_(
"Industria%sl Sabotage%s");
6137 return N_(
"Industria%sl Sabotage Production%s");
6140 return N_(
"Industria%sl Sabotage and Escape%s");
6143 return N_(
"Industria%sl Sabotage Production and Escape%s");
6146 return N_(
"Incite a Re%svolt%s");
6149 return N_(
"Incite a Re%svolt and Escape%s");
6152 return N_(
"Establish %sEmbassy%s");
6155 return N_(
"Becom%se Ambassador%s");
6158 return N_(
"Steal %sTechnology%s");
6161 return N_(
"Steal %sTechnology and Escape%s");
6164 return N_(
"In%sdustrial Espionage%s");
6167 return N_(
"In%sdustrial Espionage and Escape%s");
6170 return N_(
"%sInvestigate City%s");
6174 return N_(
"%sInvestigate City (spends the unit)%s");
6177 return N_(
"Steal %sGold%s");
6180 return N_(
"Steal %sGold and Escape%s");
6183 return N_(
"Spread %sPlague%s");
6186 return N_(
"Steal %sMaps%s");
6189 return N_(
"Steal %sMaps and Escape%s");
6192 return N_(
"Establish Trade %sRoute%s");
6195 return N_(
"Enter %sMarketplace%s");
6198 return N_(
"Help %sbuild Wonder%s");
6201 return N_(
"%sCapture Units%s");
6204 return N_(
"%sExpel Unit%s");
6207 return N_(
"%sFound City%s");
6210 return N_(
"%sJoin City%s");
6213 return N_(
"B%sombard%s");
6216 return N_(
"B%sombard 2%s");
6219 return N_(
"B%sombard 3%s");
6222 return N_(
"B%sombard 4%s");
6226 return N_(
"Lethal B%sombard%s");
6229 return N_(
"Suitcase %sNuke%s");
6232 return N_(
"Suitcase %sNuke and Escape%s");
6235 return N_(
"Explode %sNuclear%s");
6238 return N_(
"%sNuke City%s");
6241 return N_(
"%sNuke Units%s");
6244 return N_(
"Destroy %sCity%s");
6247 return N_(
"Dis%sband recovering production%s");
6250 return N_(
"Dis%sband without recovering production%s");
6253 return N_(
"Set %sHome City%s");
6256 return N_(
"Make %sHomeless%s");
6259 return N_(
"%sUpgrade Unit%s");
6262 return N_(
"Drop %sParatrooper%s");
6265 return N_(
"Drop %sParatrooper%s");
6268 return N_(
"Drop %sParatrooper%s");
6271 return N_(
"Drop %sParatrooper%s");
6274 return N_(
"Drop %sParatrooper%s");
6277 return N_(
"Drop %sParatrooper%s");
6280 return N_(
"%sAirlift to City%s");
6284 return N_(
"%sAttack%s");
6288 return N_(
"%sSuicide Attack%s");
6291 return N_(
"%sWipe Units%s");
6294 return N_(
"Collect %sRansom%s");
6297 return N_(
"Surgical Str%sike Building%s");
6300 return N_(
"Surgical Str%sike Production%s");
6305 return N_(
"%sConquer City%s");
6308 return N_(
"%sConquer City 2%s");
6313 return N_(
"%sConquer Extras%s");
6316 return N_(
"%sConquer Extras 2%s");
6320 return N_(
"Heal %sUnit%s");
6324 return N_(
"%sTransform Terrain%s");
6328 return N_(
"Transform by %sCultivating%s");
6332 return N_(
"Transform by %sPlanting%s");
6336 return N_(
"Pilla%sge%s");
6340 return N_(
"%sClean%s");
6344 return N_(
"%sFortify%s");
6348 return N_(
"Build %sRoad%s");
6351 return N_(
"%sConvert Unit%s");
6355 return N_(
"%sBuild Base%s");
6359 return N_(
"Build %sMine%s");
6363 return N_(
"Build %sIrrigation%s");
6366 return N_(
"%sDeboard%s");
6371 return N_(
"%sBoard%s");
6377 return N_(
"%sEmbark%s");
6380 return N_(
"%sUnload%s");
6385 return N_(
"%sLoad%s");
6390 return N_(
"%sDisembark%s");
6393 return N_(
"%sDisembark 2%s");
6396 return N_(
"%sEliminate Diplomat%s");
6402 return N_(
"Enter %sHut%s");
6408 return N_(
"Frighten %sHut%s");
6413 return N_(
"Regular %sMove%s");
6418 return N_(
"%sTeleport%s");
6421 return N_(
"%sTeleport%s");
6424 return N_(
"%sTeleport%s");
6427 return N_(
"%sTeleport%s");
6430 return N_(
"%sTeleport%s");
6433 return N_(
"%sTeleport%s");
6436 return N_(
"%sEscape To Nearest City%s");
6439 return N_(
"%sUser Action 1%s");
6442 return N_(
"%sUser Action 2%s");
6445 return N_(
"%sUser Action 3%s");
6448 return N_(
"%sUser Action 4%s");
6450 return N_(
"%sGain Veterancy%s");
6452 return N_(
"%sEscape%s");
6454 return N_(
"%sCivil War%s");
6601 return "explode_nuclear_min_range";
6603 return "nuke_city_min_range";
6605 return "nuke_units_min_range";
6607 return "teleport_min_range";
6609 return "teleport_2_min_range";
6611 return "teleport_3_min_range";
6613 return "teleport_conquer_min_range";
6615 return "teleport_frighten_min_range";
6617 return "teleport_frighten_conquer_min_range";
6619 return "teleport_enter_min_range";
6621 return "teleport_enter_conquer_min_range";
6623 return "user_action_1_min_range";
6625 return "user_action_2_min_range";
6627 return "user_action_3_min_range";
6629 return "user_action_4_min_range";
6770 return "help_wonder_max_range";
6772 return "disband_unit_recover_max_range";
6774 return "bombard_max_range";
6776 return "bombard_2_max_range";
6778 return "bombard_3_max_range";
6780 return "bombard_4_max_range";
6782 return "bombard_lethal_max_range";
6784 return "bombard_lethal_2_max_range";
6786 return "explode_nuclear_max_range";
6788 return "nuke_city_max_range";
6790 return "nuke_units_max_range";
6792 return "airlift_max_range";
6794 return "teleport_max_range";
6796 return "teleport_2_max_range";
6798 return "teleport_3_max_range";
6800 return "teleport_conquer_max_range";
6802 return "teleport_frighten_max_range";
6804 return "teleport_frighten_conquer_max_range";
6806 return "teleport_enter_max_range";
6808 return "teleport_enter_conquer_max_range";
6810 return "user_action_1_max_range";
6812 return "user_action_2_max_range";
6814 return "user_action_3_max_range";
6816 return "user_action_4_max_range";
6973 return "explode_nuclear_target_kind";
6975 return "nuke_city_target_kind";
6977 return "pillage_target_kind";
6979 return "pillage_2_target_kind";
6981 return "user_action_1_target_kind";
6983 return "user_action_2_target_kind";
6985 return "user_action_3_target_kind";
6987 return "user_action_4_target_kind";
7144 return "found_city_consuming_always";
7146 return "explode_nuclear_consuming_always";
7148 return "nuke_city_consuming_always";
7150 return "nuke_units_consuming_always";
7152 return "spread_plague_actor_consuming_always";
7154 return "user_action_1_actor_consuming_always";
7156 return "user_action_2_actor_consuming_always";
7158 return "user_action_3_actor_consuming_always";
7160 return "user_action_4_actor_consuming_always";
7185 return "enter_marketplace_blocked_by";
7187 return "bombard_blocked_by";
7189 return "bombard_2_blocked_by";
7191 return "bombard_3_blocked_by";
7193 return "bombard_4_blocked_by";
7195 return "bombard_lethal_blocked_by";
7197 return "bombard_lethal_2_blocked_by";
7199 return "explode_nuclear_blocked_by";
7201 return "nuke_city_blocked_by";
7203 return "nuke_units_blocked_by";
7205 return "attack_blocked_by";
7207 return "attack_2_blocked_by";
7209 return "suicide_attack_blocked_by";
7211 return "suicide_attack_2_blocked_by";
7213 return "wipe_units_blocked_by";
7215 return "collect_ransom_blocked_by";
7217 return "conquer_city_shrink_blocked_by";
7219 return "conquer_city_shrink_2_blocked_by";
7221 return "conquer_city_shrink_3_blocked_by";
7223 return "conquer_city_shrink_4_blocked_by";
7225 return "move_blocked_by";
7227 return "move_2_blocked_by";
7229 return "move_3_blocked_by";
7231 return "teleport_blocked_by";
7233 return "teleport_2_blocked_by";
7235 return "teleport_3_blocked_by";
7237 return "teleport_conquer_blocked_by";
7239 return "teleport_frighten_blocked_by";
7241 return "teleport_frighten_conquer_blocked_by";
7243 return "teleport_enter_blocked_by";
7245 return "teleport_enter_conquer_blocked_by";
7388 return "bribe_unit_post_success_forced_actions";
7390 return "bribe_stack_post_success_forced_actions";
7392 return "attack_post_success_forced_actions";
7394 return "attack_2_post_success_forced_actions";
7396 return "wipe_units_post_success_forced_actions";
7398 return "collect_ransom_post_success_forced_actions";
7562 return "Conquer City Shrink";
7565 return "Conquer City Shrink 2";
7568 return "Conquer City Shrink 3";
7571 return "Conquer City Shrink 4";
7580 N_(
"individual cities"),
7581 N_(
"individual units"),
bool is_action_possible_on_city(action_id act_id, const struct player *actor_player, const struct city *target_city)
static struct action * actions[MAX_NUM_ACTIONS]
const char * action_prepare_ui_name(action_id act_id, const char *mnemonic, const struct act_prob prob, const char *custom)
bool action_distance_inside_max(const struct action *action, const int distance)
struct act_prob action_speculate_unit_on_extras(const struct civ_map *nmap, action_id act_id, const struct unit *actor, const struct city *actor_home, const struct tile *actor_tile, bool omniscient_cheat, const struct tile *target_tile, const struct extra_type *target_extra)
static enum fc_tristate is_action_possible(const struct civ_map *nmap, const action_id wanted_action, const struct req_context *actor, const struct req_context *target, const struct extra_type *target_extra, const bool omniscient, const struct city *homecity)
const char * action_prob_explain(const struct act_prob prob)
bool action_mp_full_makes_legal(const struct unit *actor, const action_id act_id)
static struct act_prob action_prob_battle_then_dice_roll(const struct player *act_player, const struct unit *act_unit, const struct city *tgt_city, const struct unit *tgt_unit, const struct tile *tgt_tile, const struct player *tgt_player, const struct action *paction)
static bool is_action_enabled_unit_on_self_full(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct city *actor_home, const struct tile *actor_tile)
enum action_actor_kind action_get_actor_kind(const struct action *paction)
bool action_prob_certain(const struct act_prob probability)
const char * action_id_name_translation(action_id act_id)
struct action_auto_perf * action_auto_perf_slot_number(const int num)
req_vec_num_in_item action_enabler_vector_number(const void *enabler, const struct requirement_vector *vec)
bool action_has_complex_target(const struct action *paction)
static bool action_actor_utype_hard_reqs_ok_full(const struct action *paction, const struct unit_type *actor_unittype, bool ignore_third_party)
struct req_vec_problem * action_enabler_suggest_repair(const struct action_enabler *enabler)
static bool is_action_enabled_unit_on_tile_full(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct city *actor_home, const struct tile *actor_tile, const struct tile *target_tile, const struct extra_type *target_extra)
bool action_prob_possible(const struct act_prob probability)
#define ACTPROB_VAL_NOT_IMPL
struct action_auto_perf auto_perfs[MAX_NUM_ACTION_AUTO_PERFORMERS]
bool action_actor_utype_hard_reqs_ok(const struct action *paction, const struct unit_type *actor_unittype)
struct act_prob action_prob_new_not_impl(void)
struct req_vec_problem * action_enabler_suggest_improvement(const struct action_enabler *enabler)
static enum fc_tristate action_enabled_local(const action_id wanted_action, const struct req_context *actor, const struct req_context *target)
struct act_prob action_speculate_unit_on_stack(const struct civ_map *nmap, action_id act_id, const struct unit *actor, const struct city *actor_home, const struct tile *actor_tile, bool omniscient_cheat, const struct tile *target)
void actions_rs_pre_san_gen(void)
const char * action_min_range_ruleset_var_name(int act)
struct act_prob action_speculate_unit_on_self(const struct civ_map *nmap, action_id act_id, const struct unit *actor, const struct city *actor_home, const struct tile *actor_tile, bool omniscient_cheat)
static bool is_effect_val_known(enum effect_type effect_type, const struct player *pov_player, const struct req_context *context, const struct req_context *other_context)
const char * action_blocked_by_ruleset_var_name(const struct action *act)
static bool is_action_enabled(const struct civ_map *nmap, const action_id wanted_action, const struct req_context *actor, const struct req_context *target, const struct extra_type *target_extra, const struct city *actor_home)
static struct act_prob action_prob(const struct civ_map *nmap, const action_id wanted_action, const struct req_context *actor, const struct city *actor_home, const struct req_context *target, const struct extra_type *target_extra)
struct req_vec_problem * action_enabler_suggest_repair_oblig(const struct action_enabler *enabler)
void action_array_add_all_by_result(action_id *act_array, int *position, enum action_result result)
const char * action_name_translation(const struct action *paction)
int action_dice_roll_odds(const struct player *act_player, const struct unit *act_unit, const struct city *tgt_city, const struct player *tgt_player, const struct action *paction)
void action_array_end(action_id *act_array, int size)
struct act_prob action_prob_vs_tile(const struct civ_map *nmap, const struct unit *actor_unit, const action_id act_id, const struct tile *target_tile, const struct extra_type *target_extra)
static struct act_prob action_prob_pre_action_dice_roll(const struct player *act_player, const struct unit *act_unit, const struct city *tgt_city, const struct player *tgt_player, const struct action *paction)
const char * atk_helpnames[ATK_COUNT]
static enum fc_tristate action_hard_reqs_actor(const struct civ_map *nmap, const struct action *paction, const struct req_context *actor, const bool omniscient, const struct city *homecity)
static void hard_code_actions(void)
static bool is_action_enabled_unit_on_city_full(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct city *actor_home, const struct tile *actor_tile, const struct city *target_city)
bool action_is_in_use(struct action *paction)
static struct req_vec_problem * enabler_tile_tgt_local_diplrel_implies_claimed(const struct action_enabler *enabler)
bool action_ever_possible(action_id action)
const char * action_enabler_vector_by_number_name(req_vec_num_in_item vec)
bool are_action_probabilitys_equal(const struct act_prob *ap1, const struct act_prob *ap2)
static struct act_prob action_prob_self_full(const struct civ_map *nmap, const struct unit *actor_unit, const struct city *actor_home, const struct tile *actor_tile, const action_id act_id)
const char * action_post_success_forced_ruleset_var_name(const struct action *act)
struct action * action_by_rule_name(const char *name)
static bool action_has_possible_actor_hard_reqs(struct action *paction)
const char * action_rule_name(const struct action *action)
const char * action_id_rule_name(action_id act_id)
enum action_sub_target_kind action_get_sub_target_kind(const struct action *paction)
static const struct tile * blocked_find_target_tile(const struct action *act, const struct unit *actor_unit, const struct tile *target_tile_arg, const struct city *target_city, const struct unit *target_unit)
static bool action_prob_not_relevant(const struct act_prob probability)
static struct act_prob ap_diplomat_battle(const struct unit *pattacker, const struct unit *pvictim, const struct tile *tgt_tile, const struct action *paction) fc__attribute((nonnull(3)))
static bool is_action_enabled_unit_on_extras_full(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct city *actor_home, const struct tile *actor_tile, const struct tile *target_tile, const struct extra_type *target_extra)
void action_enabler_free(struct action_enabler *enabler)
bool is_action_enabled_unit_on_stack(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct tile *target_tile)
static enum fc_tristate tech_can_be_stolen(const struct player *actor_player, const struct player *target_player)
static struct action_list * actlist_by_result[ACTRES_LAST]
struct action_list * action_list_by_activity(enum unit_activity activity)
int action_number(const struct action *action)
struct act_prob action_prob_new_unknown(void)
bool action_would_be_blocked_by(const struct action *blocked, const struct action *blocker)
static struct action * player_action_new(action_id id, enum action_result result)
static struct req_vec_problem * enabler_first_clarification(const struct action_enabler *enabler)
static bool action_prob_not_impl(const struct act_prob probability)
bool is_action_enabled_unit_on_tile(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct tile *target_tile, const struct extra_type *target_extra)
struct act_prob action_prob_and(const struct act_prob *ap1, const struct act_prob *ap2)
static bool actions_initialized
const char * action_actor_consuming_always_ruleset_var_name(action_id act)
bool action_immune_government(struct government *gov, action_id act)
static bool is_target_possible(const action_id wanted_action, const struct player *actor_player, const struct req_context *target)
static struct act_prob ap_dipl_battle_win(const struct unit *pattacker, const struct unit *pdefender)
static struct act_prob action_prob_vs_stack_full(const struct civ_map *nmap, const struct unit *actor_unit, const struct city *actor_home, const struct tile *actor_tile, const action_id act_id, const struct tile *target_tile)
struct act_prob action_prob_vs_extras(const struct civ_map *nmap, const struct unit *actor_unit, const action_id act_id, const struct tile *target_tile, const struct extra_type *target_extra)
struct act_prob action_prob_new_certain(void)
const char * action_max_range_ruleset_var_name(int act)
static struct act_prob action_prob_vs_city_full(const struct civ_map *nmap, const struct unit *actor_unit, const struct city *actor_home, const struct tile *actor_tile, const action_id act_id, const struct city *target_city)
bool action_is_internal(struct action *paction)
int action_dice_roll_initial_odds(const struct action *paction)
struct act_prob action_prob_self(const struct civ_map *nmap, const struct unit *actor_unit, const action_id act_id)
struct act_prob action_prob_fall_back(const struct act_prob *ap1, const struct act_prob *ap2)
static const struct unit_type * tgt_city_local_utype(const struct city *target_city)
static struct requirement * req_vec_first_local_diplrel(const struct requirement_vector *vec)
static struct act_prob action_prob_vs_tile_full(const struct civ_map *nmap, const struct unit *actor_unit, const struct city *actor_home, const struct tile *actor_tile, const action_id act_id, const struct tile *target_tile, const struct extra_type *target_extra)
bool is_action_enabled_unit_on_city(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct city *target_city)
struct action_list * action_list_by_result(enum action_result result)
bool action_univs_not_blocking(const struct action *paction, struct universal *actor_uni, struct universal *target_uni)
struct act_prob action_speculate_unit_on_city(const struct civ_map *nmap, const action_id act_id, const struct unit *actor, const struct city *actor_home, const struct tile *actor_tile, const bool omniscient_cheat, const struct city *target)
static struct requirement * req_vec_first_contradiction_in_vec(const struct requirement *req, const struct requirement_vector *vec)
bool actions_are_ready(void)
bool is_action_enabled_unit_on_unit(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct unit *target_unit)
struct act_prob action_speculate_unit_on_tile(const struct civ_map *nmap, action_id act_id, const struct unit *actor, const struct city *actor_home, const struct tile *actor_tile, bool omniscient_cheat, const struct tile *target_tile, const struct extra_type *target_extra)
struct act_prob action_prob_vs_city(const struct civ_map *nmap, const struct unit *actor_unit, const action_id act_id, const struct city *target_city)
const char * action_target_kind_ruleset_var_name(int act)
static struct act_prob action_prob_vs_unit_full(const struct civ_map *nmap, const struct unit *actor_unit, const struct city *actor_home, const struct tile *actor_tile, const action_id act_id, const struct unit *target_unit)
bool action_maybe_possible_actor_unit(const struct civ_map *nmap, const action_id act_id, const struct unit *actor_unit)
struct action * action_is_blocked_by(const struct civ_map *nmap, const struct action *act, const struct unit *actor_unit, const struct tile *target_tile_arg, const struct city *target_city_arg, const struct unit *target_unit)
static bool is_enabler_active(const struct action_enabler *enabler, const struct req_context *actor, const struct req_context *target)
static struct action_enabler_list * action_enablers_by_action[MAX_NUM_ACTIONS]
void action_enabler_add(struct action_enabler *enabler)
const char * action_ui_name_default(int act)
#define ACTPROB_VAL_1_PCT
bool action_enabler_utype_possible_actor(const struct action_enabler *ae, const struct unit_type *act_utype)
static struct act_prob act_prob_unseen_target(const struct civ_map *nmap, action_id act_id, const struct unit *actor_unit)
struct action_enabler * action_enabler_new(void)
bool action_requires_details(const struct action *paction)
struct act_prob action_prob_new_not_relevant(void)
const char * action_target_kind_help(enum action_target_kind kind)
static struct req_vec_problem * enabler_first_self_contradiction(const struct action_enabler *enabler)
int action_get_role(const struct action *paction)
struct act_prob action_speculate_unit_on_unit(const struct civ_map *nmap, action_id act_id, const struct unit *actor, const struct city *actor_home, const struct tile *actor_tile, bool omniscient_cheat, const struct unit *target)
static struct action * unit_action_new(action_id id, enum action_result result, bool rare_pop_up, bool unitwaittime_controlled, enum moves_actor_kind moves_actor, const int min_distance, const int max_distance, bool actor_consuming_always)
const struct action_auto_perf * action_auto_perf_by_number(const int num)
struct act_prob action_prob_new_impossible(void)
bool action_enabler_possible_actor(const struct action_enabler *ae)
static const struct city * blocked_find_target_city(const struct action *act, const struct unit *actor_unit, const struct tile *target_tile, const struct city *target_city_arg, const struct unit *target_unit)
struct action ** _actions
bool action_id_exists(const action_id act_id)
bool action_enabler_remove(struct action_enabler *enabler)
enum action_target_kind action_get_target_kind(const struct action *paction)
struct act_prob action_prob_unit_vs_tgt(const struct civ_map *nmap, const struct action *paction, const struct unit *act_unit, const struct city *tgt_city, const struct unit *tgt_unit, const struct tile *tgt_tile, const struct extra_type *extra_tgt)
static bool action_prob_is_signal(const struct act_prob probability)
struct action_enabler * action_enabler_copy(const struct action_enabler *original)
static const char * action_prob_to_text(const struct act_prob prob)
int action_prob_cmp_pessimist(const struct act_prob ap1, const struct act_prob ap2)
struct act_prob action_prob_vs_stack(const struct civ_map *nmap, const struct unit *actor_unit, const action_id act_id, const struct tile *target_tile)
bool action_id_is_internal(action_id act)
bool is_action_enabled_unit_on_self(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit)
bool action_id_is_rare_pop_up(action_id act_id)
static struct action * action_new(action_id id, enum action_result result, const int min_distance, const int max_distance, bool actor_consuming_always)
static struct req_vec_problem * ae_suggest_repair_if_no_oblig(const struct action_enabler *enabler, const struct obligatory_req_vector *oblig)
struct act_prob action_prob_vs_unit(const struct civ_map *nmap, const struct unit *actor_unit, const action_id act_id, const struct unit *target_unit)
bool is_action_enabled_player(const struct civ_map *nmap, const action_id wanted_action, const struct player *actor_plr)
static const struct impr_type * tgt_city_local_building(const struct city *target_city)
static struct astring ui_name_str
bool is_action_enabled_unit_on_extras(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct tile *target_tile, const struct extra_type *target_extra)
static bool is_action_enabled_unit_on_unit_full(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct city *actor_home, const struct tile *actor_tile, const struct unit *target_unit)
static bool is_action_enabled_unit_on_stack_full(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct city *actor_home, const struct tile *actor_tile, const struct tile *target_tile)
double action_prob_to_0_to_1_pessimist(const struct act_prob ap)
const char * gen_action_name_update_cb(const char *old_name)
static struct action_list * actlist_by_activity[ACTIVITY_LAST]
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)
bool action_distance_accepted(const struct action *action, const int distance)
static struct act_prob action_prob_vs_extras_full(const struct civ_map *nmap, const struct unit *actor_unit, const struct city *actor_home, const struct tile *actor_tile, const action_id act_id, const struct tile *target_tile, const struct extra_type *target_extra)
const char * action_ui_name_ruleset_var_name(int act)
const char * action_get_ui_name_mnemonic(action_id act_id, const char *mnemonic)
#define action_noninternal_iterate_end
#define ACTION_DISTANCE_MAX
#define enabler_get_action(_enabler_)
#define ASSERT_UNUSED_ACTION_CASES
#define enabler_get_action_id(_enabler_)
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_enabler_list_iterate_end
#define ACTION_DISTANCE_UNLIMITED
#define action_iterate_end
#define action_iterate_all(_act_)
#define action_id_get_actor_kind(act_id)
#define action_iterate_all_end
#define ACTPROB_NOT_KNOWN
#define action_enabler_list_iterate(action_enabler_list, aenabler)
#define action_id_distance_accepted(act_id, distance)
#define ACTPROB_IMPOSSIBLE
#define ACTPROB_NOT_IMPLEMENTED
#define action_iterate(_act_)
#define action_noninternal_iterate(_act_)
#define action_id_get_target_kind(act_id)
#define action_id_has_result_safe(act_id, result)
#define ACTION_ODDS_PCT_DICE_ROLL_NA
enum action_sub_target_kind actres_sub_target_kind_default(enum action_result result)
enum act_tgt_compl actres_target_compl_calc(enum action_result result)
enum fc_tristate actres_possible(const struct civ_map *nmap, enum action_result result, const struct req_context *actor, const struct req_context *target, const struct extra_type *target_extra, enum fc_tristate def, bool omniscient, const struct city *homecity)
enum unit_activity actres_activity_result(enum action_result result)
enum dice_roll_type actres_dice_type(enum action_result result)
enum action_battle_kind actres_get_battle_kind(enum action_result result)
enum action_target_kind actres_target_kind_default(enum action_result result)
#define ASSERT_UNUSED_ACTRES_CASES
void astr_free(struct astring *astr)
void astr_set(struct astring *astr, const char *format,...)
void astr_clear(struct astring *astr)
void astr_add(struct astring *astr, const char *format,...)
static const char * astr_str(const struct astring *astr) fc__attribute((nonnull(1)))
bool territory_claiming_base(const struct base_type *pbase)
#define BV_ISSET(bv, bit)
static bool is_non_attack_city_tile(const struct tile *ptile, const struct player *pplayer)
#define city_tile(_pcity_)
#define city_owner(_pcity_)
double unit_win_chance(const struct civ_map *nmap, const struct unit *attacker, const struct unit *defender, const struct action *paction)
enum unit_attack_result unit_attack_units_at_tile_result(const struct unit *punit, const struct action *paction, const struct tile *ptile)
struct unit * get_defender(const struct civ_map *nmap, const struct unit *attacker, const struct tile *ptile, const struct action *paction)
struct unit * get_diplomatic_defender(const struct unit *act_unit, const struct unit *pvictim, const struct tile *tgt_tile, const struct action *paction)
bool can_unit_attack_tile(const struct unit *punit, const struct action *paction, const struct tile *dest_tile)
struct unit struct city struct unit * target_unit
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit * actor
struct unit struct city struct unit struct tile * target_tile
struct unit struct city * target_city
struct unit struct city struct unit struct tile struct extra_type * target_extra
int get_target_bonus_effects(struct effect_list *plist, const struct req_context *context, const struct req_context *other_context, enum effect_type effect_type)
struct effect_list * get_effects(enum effect_type effect_type)
#define effect_list_iterate_end
#define effect_list_iterate(effect_list, peffect)
const struct functions * fc_funcs
#define MAX_NUM_ACTION_AUTO_PERFORMERS
static bool is_ruleset_compat_mode(void)
#define fc_assert_msg(condition, message,...)
#define fc_assert_ret(condition)
#define log_verbose(message,...)
#define fc_assert(condition)
#define fc_assert_action_msg(condition, action, message,...)
#define fc_assert_ret_val(condition, val)
#define fc_assert_action(condition, action)
#define log_error(message,...)
#define FC_STATIC_ASSERT(cond, tag)
#define fc_assert_ret_val_msg(condition, val, message,...)
int real_map_distance(const struct tile *tile0, const struct tile *tile1)
bool can_unit_exist_at_tile(const struct civ_map *nmap, const struct unit *punit, const struct tile *ptile)
bool is_native_tile(const struct unit_type *punittype, const struct tile *ptile)
int unit_move_rate(const struct unit *punit)
bool unit_could_load_at(const struct unit *punit, const struct tile *ptile)
bool can_unit_type_transport(const struct unit_type *transporter, const struct unit_class *transported)
bool can_attack_non_native(const struct unit_type *utype)
void oblig_hard_reqs_init(void)
void oblig_hard_reqs_free(void)
void hard_code_oblig_hard_reqs_ruleset(void)
void hard_code_oblig_hard_reqs(void)
struct obligatory_req_vector * oblig_hard_reqs_get(enum action_result res)
struct obligatory_req_vector * oblig_hard_reqs_get_sub(enum action_sub_result res)
#define obligatory_req_vector_iterate_end
#define obligatory_req_vector_iterate(obreq_vec, pobreq)
bool can_player_see_tile(const struct player *plr, const struct tile *ptile)
bool can_player_see_unit(const struct player *pplayer, const struct unit *punit)
bool pplayers_at_war(const struct player *pplayer, const struct player *pplayer2)
bool player_can_see_city_externals(const struct player *pow_player, const struct city *target_city)
bool pplayers_allied(const struct player *pplayer, const struct player *pplayer2)
bool can_player_see_hypotetic_units_at(const struct player *pplayer, const struct tile *ptile)
bool player_can_trust_tile_has_no_units(const struct player *pplayer, const struct tile *ptile)
bool universal_never_there(const struct universal *source)
const struct req_context * req_context_empty(void)
const char * req_to_fstring(const struct requirement *req, struct astring *astr)
bool universal_fulfills_requirements(bool check_necessary, const struct requirement_vector *reqs, const struct universal *source)
struct req_vec_problem * req_vec_suggest_repair(const struct requirement_vector *vec, requirement_vector_number get_num, const void *parent_item)
bool are_requirements_contradictions(const struct requirement *req1, const struct requirement *req2)
struct req_vec_problem * req_vec_problem_new(int num_suggested_solutions, const char *descr,...)
bool are_reqs_active(const struct req_context *context, const struct req_context *other_context, const struct requirement_vector *reqs, const enum req_problem_type prob_type)
bool does_req_contradicts_reqs(const struct requirement *req, const struct requirement_vector *vec)
bool req_vec_is_impossible_to_fulfill(const struct requirement_vector *reqs)
struct req_vec_problem * req_vec_suggest_improvement(const struct requirement_vector *vec, requirement_vector_number get_num, const void *parent_item)
#define requirement_fulfilled_by_unit_type(_ut_, _rqs_)
signed char req_vec_num_in_item
req_vec_num_in_item a requirement vectors number in an item.
#define requirement_vector_iterate_end
#define requirement_fulfilled_by_government(_gov_, _rqs_)
#define requirement_vector_iterate(req_vec, preq)
struct research * research_get(const struct player *pplayer)
enum tech_state research_invention_state(const struct research *presearch, Tech_type_id tech)
bool research_invention_gettable(const struct research *presearch, const Tech_type_id tech, bool allow_holes)
server_setting_id server_setting_by_name(const char *name)
int server_setting_value_int_get(server_setting_id id)
enum fc_tristate fc_tristate_and(enum fc_tristate one, enum fc_tristate two)
#define CLIP(lower, current, upper)
enum action_auto_perf_cause cause
action_id alternatives[MAX_NUM_ACTIONS]
struct requirement_vector actor_reqs
struct requirement_vector target_reqs
bool unitwaittime_controlled
bool actor_consuming_always
enum action_sub_target_kind sub_target_kind
enum moves_actor_kind moves_actor
struct action::@12::@13 is_unit
enum action_result result
char ui_name[MAX_LEN_NAME]
bv_action_sub_results sub_results
enum action_actor_kind actor_kind
enum act_tgt_compl target_complexity
enum action_target_kind target_kind
struct packet_game_info info
int(* player_tile_city_id_get)(const struct tile *ptile, const struct player *pplayer)
bool tech_steal_allow_holes
enum airlifting_style airlifting_style
bool airlift_from_always_enabled
bv_actions diplchance_initial_odds
const struct player * player
struct veteran_system * veteran
const struct unit_type * utype
int fc_strcasecmp(const char *str0, const char *str1)
Tech_type_id advance_number(const struct advance *padvance)
#define advance_iterate(_p)
#define advance_iterate_end
bool tile_is_seen(const struct tile *target_tile, const struct player *pow_player)
struct city * tile_city(const struct tile *ptile)
#define tile_owner(_tile)
struct unit * unit_transport_get(const struct unit *pcargo)
bool unit_can_do_action(const struct unit *punit, const action_id act_id)
bool unit_transported(const struct unit *pcargo)
bool can_unit_unload(const struct unit *pcargo, const struct unit *ptrans)
bool unit_can_convert(const struct civ_map *nmap, const struct unit *punit)
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end
const struct unit_type * unit_type_get(const struct unit *punit)
bool utype_may_act_move_frags(const struct unit_type *punit_type, const action_id act_id, const int move_fragments)
const struct veteran_level * utype_veteran_level(const struct unit_type *punittype, int level)
bool unit_has_type_flag(const struct unit *punit, enum unit_type_flag_id flag)
bool utype_can_do_act_if_tgt_citytile(const struct unit_type *punit_type, const action_id act_id, const enum citytile_type prop, const bool is_there)
bool utype_can_do_action(const struct unit_type *putype, const action_id act_id)
#define unit_type_iterate(_p)
#define unit_type_iterate_end