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
964 if (
actions[act]->ui_name[0] ==
'\0') {
1020 "%s contradicts itself regarding sub targets.",
1150 return paction->sub_target_kind;
1189 FALSE,
"Action %d don't exist.", act_id);
1223 const struct action *blocker)
1311 if (prob.
min == prob.
max) {
1356 "Invalid action %d", act_id);
1382 }
else if (
probtxt !=
nullptr) {
1392 }
else if (
custom !=
nullptr) {
1415 const char *ui_name =
_(
actions[act_id]->ui_name);
1458 }
else if (prob.
min == prob.
max) {
1470 _(
"The probability of success is %.1f%%, %.1f%% or somewhere"
1474 prob.
max - prob.
min > 1 ?
1477 _(
" (This is the most precise interval I can calculate "
1478 "given the information our nation has access to.)") :
1492 "Action %s isn't performed by a unit",
1507 enabler->rulesave.comment =
nullptr;
1523 if (
enabler->rulesave.comment !=
nullptr) {
1628 for (
i = 0;
i <
obreq->contras->alternatives;
i++) {
1640 || (
obreq->contras->alternative[
i].req.present
1642 &
obreq->contras->alternative[
i].req.source))) {
1662 for (
i = 0;
i <
obreq->contras->alternatives;
i++) {
1673 out->suggested_solutions[
i].vector_number
1678 out->suggested_solutions[
i].req.present
1679 = !
obreq->contras->alternative[
i].req.present;
1680 out->suggested_solutions[
i].req.source
1681 =
obreq->contras->alternative[
i].req.source;
1682 out->suggested_solutions[
i].req.range
1683 =
obreq->contras->alternative[
i].req.range;
1684 out->suggested_solutions[
i].req.survives
1685 =
obreq->contras->alternative[
i].req.survives;
1686 out->suggested_solutions[
i].req.quiet
1687 =
obreq->contras->alternative[
i].req.quiet;
1727 if (
out !=
nullptr) {
1743 if (
out !=
nullptr) {
1829 N_(
"Requirement {%s} of action \"%s\" implies a claimed "
1830 "tile. No diplomatic relation to Nature."),
1837 out->suggested_solutions[0].vector_number
1893 N_(
"In enabler for \"%s\": No diplomatic relation to Nature."
1894 " Requirements {%s} and {%s} contradict each other."),
1904 out->suggested_solutions[0].vector_number
1910 out->suggested_solutions[1].vector_number
1928 if (
out !=
nullptr) {
1936 if (
out !=
nullptr) {
1943 if (
out !=
nullptr) {
1949 if (
out !=
nullptr) {
1955 if (
out !=
nullptr) {
2032 " used by any unit."),
2036 if (
out !=
nullptr) {
2058 if (vec == &
ae->actor_reqs) {
2060 }
else if (vec == &
ae->target_reqs) {
2085 return &
ae->actor_reqs;
2087 return &
ae->target_reqs;
2105 return _(
"actor_reqs");
2108 return _(
"target_reqs");
2167static const struct tile *
2227static const struct city *
2266 if (ptile !=
nullptr) {
2288 const struct action *act,
2491 if (
pclass->cache.native_bases !=
nullptr) {
2635 const struct city *homecity)
2639 if (
actor ==
nullptr) {
2668 if (
actor->city ==
nullptr) {
2686 if (0 >=
actor->city->airlift
2825 const struct city *homecity)
2832 if (
actor ==
nullptr) {
2837 if (target ==
nullptr) {
3010 "Is omniscient, should get yes or no.");
3061 FALSE,
"Action %s is performed by %s not %s",
3069 FALSE,
"Action %s is against %s not %s",
3141 FALSE,
"Action %s is performed by %s not %s",
3149 FALSE,
"Action %s is against %s not %s",
3221 FALSE,
"Action %s is performed by %s not %s",
3229 FALSE,
"Action %s is against %s not %s",
3307 FALSE,
"Action %s is performed by %s not %s",
3315 FALSE,
"Action %s is against %s not %s",
3384 FALSE,
"Action %s is performed by %s not %s",
3392 FALSE,
"Action %s is against %s not %s",
3460 FALSE,
"Action %s is performed by %s not %s",
3468 FALSE,
"Action %s is against %s not %s",
3509#define ASSERT_PLAYER_ACTION(_atk) \
3510 fc_assert_ret_val_msg(AAK_PLAYER == action_id_get_actor_kind(wanted_action),\
3511 FALSE, "Action %s is performed by %s not %s", \
3512 action_id_rule_name(wanted_action), \
3513 action_actor_kind_name( \
3514 action_id_get_actor_kind(wanted_action)), \
3515 action_actor_kind_name(AAK_PLAYER)); \
3516 fc_assert_ret_val_msg(_atk \
3517 == action_id_get_target_kind(wanted_action), \
3518 FALSE, "Action %s is against %s not %s", \
3519 action_id_rule_name(wanted_action), \
3520 action_target_kind_name( \
3521 action_id_get_target_kind(wanted_action)), \
3522 action_target_kind_name(_atk));
3543 nullptr,
nullptr,
nullptr);
3578 },
nullptr,
nullptr);
3648 nullptr,
nullptr)) {
3735 nullptr,
nullptr,
nullptr);
3764 if (
actor ==
nullptr ||
actor->player ==
nullptr) {
3769 if (target ==
nullptr) {
4089 if (
actor ==
nullptr) {
4092 if (target ==
nullptr) {
4280 }
else if (known ==
TRI_YES) {
4421 "Action %s is performed by %s not %s",
4429 "Action %s is against %s not %s",
4520 "Action %s is performed by %s not %s",
4528 "Action %s is against %s not %s",
4608 "Action %s is performed by %s not %s",
4616 "Action %s is against %s not %s",
4741 "Invalid probability [%d, %d]",
4797 "Action %s is performed by %s not %s",
4805 "Action %s is against %s not %s",
4880 "Action %s is performed by %s not %s",
4888 "Action %s is against %s not %s",
4963 "Action %s is performed by %s not %s",
4971 "Action %s is against %s not %s",
5068 log_error(
"Invalid action target kind");
5086 const struct city* target)
5121 const struct unit *target)
5154 const struct tile *target)
5638 "Bad initial odds for action number %d."
5639 " Does it roll the dice at all?",
5732 FALSE,
"Action %s is against %s not cities",
6054 return N_(
"%sPoison City%s");
6057 return N_(
"%sPoison City and Escape%s");
6060 return N_(
"S%sabotage Enemy Unit%s");
6063 return N_(
"S%sabotage Enemy Unit and Escape%s");
6066 return N_(
"Bribe Enemy %sUnit%s");
6069 return N_(
"Bribe Enemy %sStack%s");
6072 return N_(
"%sSabotage City%s");
6075 return N_(
"%sSabotage City and Escape%s");
6078 return N_(
"Industria%sl Sabotage%s");
6081 return N_(
"Industria%sl Sabotage Production%s");
6084 return N_(
"Industria%sl Sabotage and Escape%s");
6087 return N_(
"Industria%sl Sabotage Production and Escape%s");
6090 return N_(
"Incite a Re%svolt%s");
6093 return N_(
"Incite a Re%svolt and Escape%s");
6096 return N_(
"Establish %sEmbassy%s");
6099 return N_(
"Becom%se Ambassador%s");
6102 return N_(
"Steal %sTechnology%s");
6105 return N_(
"Steal %sTechnology and Escape%s");
6108 return N_(
"In%sdustrial Espionage%s");
6111 return N_(
"In%sdustrial Espionage and Escape%s");
6114 return N_(
"%sInvestigate City%s");
6118 return N_(
"%sInvestigate City (spends the unit)%s");
6121 return N_(
"Steal %sGold%s");
6124 return N_(
"Steal %sGold and Escape%s");
6127 return N_(
"Spread %sPlague%s");
6130 return N_(
"Steal %sMaps%s");
6133 return N_(
"Steal %sMaps and Escape%s");
6136 return N_(
"Establish Trade %sRoute%s");
6139 return N_(
"Enter %sMarketplace%s");
6142 return N_(
"Help %sbuild Wonder%s");
6145 return N_(
"%sCapture Units%s");
6148 return N_(
"%sExpel Unit%s");
6151 return N_(
"%sFound City%s");
6154 return N_(
"%sJoin City%s");
6157 return N_(
"B%sombard%s");
6160 return N_(
"B%sombard 2%s");
6163 return N_(
"B%sombard 3%s");
6166 return N_(
"B%sombard 4%s");
6170 return N_(
"Lethal B%sombard%s");
6173 return N_(
"Suitcase %sNuke%s");
6176 return N_(
"Suitcase %sNuke and Escape%s");
6179 return N_(
"Explode %sNuclear%s");
6182 return N_(
"%sNuke City%s");
6185 return N_(
"%sNuke Units%s");
6188 return N_(
"Destroy %sCity%s");
6191 return N_(
"Dis%sband recovering production%s");
6194 return N_(
"Dis%sband without recovering production%s");
6197 return N_(
"Set %sHome City%s");
6200 return N_(
"Make %sHomeless%s");
6203 return N_(
"%sUpgrade Unit%s");
6206 return N_(
"Drop %sParatrooper%s");
6209 return N_(
"Drop %sParatrooper%s");
6212 return N_(
"Drop %sParatrooper%s");
6215 return N_(
"Drop %sParatrooper%s");
6218 return N_(
"Drop %sParatrooper%s");
6221 return N_(
"Drop %sParatrooper%s");
6224 return N_(
"%sAirlift to City%s");
6228 return N_(
"%sAttack%s");
6232 return N_(
"%sSuicide Attack%s");
6235 return N_(
"%sWipe Units%s");
6238 return N_(
"Collect %sRansom%s");
6241 return N_(
"Surgical Str%sike Building%s");
6244 return N_(
"Surgical Str%sike Production%s");
6249 return N_(
"%sConquer City%s");
6252 return N_(
"%sConquer City 2%s");
6257 return N_(
"%sConquer Extras%s");
6260 return N_(
"%sConquer Extras 2%s");
6264 return N_(
"Heal %sUnit%s");
6268 return N_(
"%sTransform Terrain%s");
6272 return N_(
"Transform by %sCultivating%s");
6276 return N_(
"Transform by %sPlanting%s");
6280 return N_(
"Pilla%sge%s");
6284 return N_(
"%sClean%s");
6288 return N_(
"%sFortify%s");
6292 return N_(
"Build %sRoad%s");
6295 return N_(
"%sConvert Unit%s");
6299 return N_(
"%sBuild Base%s");
6303 return N_(
"Build %sMine%s");
6307 return N_(
"Build %sIrrigation%s");
6310 return N_(
"%sDeboard%s");
6315 return N_(
"%sBoard%s");
6321 return N_(
"%sEmbark%s");
6324 return N_(
"%sUnload%s");
6329 return N_(
"%sLoad%s");
6334 return N_(
"%sDisembark%s");
6337 return N_(
"%sDisembark 2%s");
6340 return N_(
"%sEliminate Diplomat%s");
6346 return N_(
"Enter %sHut%s");
6352 return N_(
"Frighten %sHut%s");
6357 return N_(
"Regular %sMove%s");
6362 return N_(
"%sTeleport%s");
6365 return N_(
"%sTeleport%s");
6368 return N_(
"%sTeleport%s");
6371 return N_(
"%sTeleport%s");
6374 return N_(
"%sTeleport%s");
6377 return N_(
"%sTeleport%s");
6380 return N_(
"%sEscape To Nearest City%s");
6383 return N_(
"%sScout%s");
6386 return N_(
"%sUser Action 1%s");
6389 return N_(
"%sUser Action 2%s");
6392 return N_(
"%sUser Action 3%s");
6395 return N_(
"%sUser Action 4%s");
6397 return N_(
"%sGain Veterancy%s");
6399 return N_(
"%sEscape%s");
6401 return N_(
"%sCivil War%s");
6403 return N_(
"Finish %sUnit%s");
6405 return N_(
"Finish %sBuilding%s");
6555 return "explode_nuclear_min_range";
6557 return "nuke_city_min_range";
6559 return "nuke_units_min_range";
6561 return "teleport_min_range";
6563 return "teleport_2_min_range";
6565 return "teleport_3_min_range";
6567 return "teleport_conquer_min_range";
6569 return "teleport_frighten_min_range";
6571 return "teleport_frighten_conquer_min_range";
6573 return "teleport_enter_min_range";
6575 return "teleport_enter_conquer_min_range";
6577 return "user_action_1_min_range";
6579 return "user_action_2_min_range";
6581 return "user_action_3_min_range";
6583 return "user_action_4_min_range";
6726 return "help_wonder_max_range";
6728 return "disband_unit_recover_max_range";
6730 return "bombard_max_range";
6732 return "bombard_2_max_range";
6734 return "bombard_3_max_range";
6736 return "bombard_4_max_range";
6738 return "bombard_lethal_max_range";
6740 return "bombard_lethal_2_max_range";
6742 return "explode_nuclear_max_range";
6744 return "nuke_city_max_range";
6746 return "nuke_units_max_range";
6748 return "airlift_max_range";
6750 return "teleport_max_range";
6752 return "teleport_2_max_range";
6754 return "teleport_3_max_range";
6756 return "teleport_conquer_max_range";
6758 return "teleport_frighten_max_range";
6760 return "teleport_frighten_conquer_max_range";
6762 return "teleport_enter_max_range";
6764 return "teleport_enter_conquer_max_range";
6766 return "scout_max_range";
6768 return "user_action_1_max_range";
6770 return "user_action_2_max_range";
6772 return "user_action_3_max_range";
6774 return "user_action_4_max_range";
6934 return "explode_nuclear_target_kind";
6936 return "nuke_city_target_kind";
6938 return "pillage_target_kind";
6940 return "pillage_2_target_kind";
6942 return "user_action_1_target_kind";
6944 return "user_action_2_target_kind";
6946 return "user_action_3_target_kind";
6948 return "user_action_4_target_kind";
7108 return "found_city_consuming_always";
7110 return "explode_nuclear_consuming_always";
7112 return "nuke_city_consuming_always";
7114 return "nuke_units_consuming_always";
7116 return "spread_plague_actor_consuming_always";
7118 return "user_action_1_actor_consuming_always";
7120 return "user_action_2_actor_consuming_always";
7122 return "user_action_3_actor_consuming_always";
7124 return "user_action_4_actor_consuming_always";
7149 return "enter_marketplace_blocked_by";
7151 return "bombard_blocked_by";
7153 return "bombard_2_blocked_by";
7155 return "bombard_3_blocked_by";
7157 return "bombard_4_blocked_by";
7159 return "bombard_lethal_blocked_by";
7161 return "bombard_lethal_2_blocked_by";
7163 return "explode_nuclear_blocked_by";
7165 return "nuke_city_blocked_by";
7167 return "nuke_units_blocked_by";
7169 return "attack_blocked_by";
7171 return "attack_2_blocked_by";
7173 return "suicide_attack_blocked_by";
7175 return "suicide_attack_2_blocked_by";
7177 return "wipe_units_blocked_by";
7179 return "collect_ransom_blocked_by";
7181 return "conquer_city_shrink_blocked_by";
7183 return "conquer_city_shrink_2_blocked_by";
7185 return "conquer_city_shrink_3_blocked_by";
7187 return "conquer_city_shrink_4_blocked_by";
7189 return "move_blocked_by";
7191 return "move_2_blocked_by";
7193 return "move_3_blocked_by";
7195 return "teleport_blocked_by";
7197 return "teleport_2_blocked_by";
7199 return "teleport_3_blocked_by";
7201 return "teleport_conquer_blocked_by";
7203 return "teleport_frighten_blocked_by";
7205 return "teleport_frighten_conquer_blocked_by";
7207 return "teleport_enter_blocked_by";
7209 return "teleport_enter_conquer_blocked_by";
7355 return "bribe_unit_post_success_forced_actions";
7357 return "bribe_stack_post_success_forced_actions";
7359 return "attack_post_success_forced_actions";
7361 return "attack_2_post_success_forced_actions";
7363 return "wipe_units_post_success_forced_actions";
7365 return "collect_ransom_post_success_forced_actions";
7538 N_(
"individual cities"),
7539 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)
#define ASSERT_PLAYER_ACTION(_atk)
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)
bool is_action_enabled_player_on_tile(const struct civ_map *nmap, const action_id wanted_action, const struct player *actor_plr, const struct tile *target_tile, const struct extra_type *target_extra)
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)
enum gen_action select_actres_action_unit_on_stack(struct civ_map *nmap, enum action_result actres, struct unit *punit, struct tile *ptile)
static struct action * action_new(action_id id, enum action_actor_kind aak, enum action_result result, const int min_distance, const int max_distance, bool actor_consuming_always)
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 action * city_action_new(action_id id, enum action_result result)
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)
bool is_action_enabled_city(const struct civ_map *nmap, const action_id wanted_action, const struct city *actor_city)
bool is_action_enabled_player_on_stack(const struct civ_map *nmap, const action_id wanted_action, const struct player *actor_plr, const struct tile *target_tile, const struct extra_type *target_extra)
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_player_on_city(const struct civ_map *nmap, const action_id wanted_action, const struct player *actor_plr, const struct city *target_city)
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)
enum gen_action select_actres_action_unit_on_tile(struct civ_map *nmap, enum action_result actres, struct unit *punit, struct tile *ptile)
struct action_list * action_list_by_result(enum action_result result)
bool is_action_enabled_player_on_self(const struct civ_map *nmap, const action_id wanted_action, const struct player *actor_plr)
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)
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)
bool is_action_enabled_player_on_extras(const struct civ_map *nmap, const action_id wanted_action, const struct player *actor_plr, const struct tile *target_tile, const struct extra_type *target_extra)
bool is_action_enabled_player_on_unit(const struct civ_map *nmap, const action_id wanted_action, const struct player *actor_plr, const struct unit *target_unit)
const char * action_ui_name_default(int act)
bool action_enablers_allow(const action_id wanted_action, const struct req_context *actor, const struct req_context *target)
#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 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)
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)
enum gen_action select_actres_action_unit_on_city(struct civ_map *nmap, enum action_result actres, struct unit *punit, struct city *pcity)
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_get_ui_name_mnemonic(action_id act_id, const char *mnemonic)
#define action_list_iterate_end
#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_list_iterate(_list_, _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 struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit int const struct action *paction struct unit struct city * pcity
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)
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)
struct requirement * req_vec_first_contradiction_in_vec(const struct requirement *req, const struct requirement_vector *vec)
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)
bool is_super_specialist(const struct specialist *sp)
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