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
959 if (
actions[act]->ui_name[0] ==
'\0') {
1015 "%s contradicts itself regarding sub targets.",
1145 return paction->sub_target_kind;
1184 FALSE,
"Action %d don't exist.", act_id);
1218 const struct action *blocker)
1306 if (prob.
min == prob.
max) {
1351 "Invalid action %d", act_id);
1377 }
else if (
probtxt !=
nullptr) {
1387 }
else if (
custom !=
nullptr) {
1410 const char *ui_name =
_(
actions[act_id]->ui_name);
1453 }
else if (prob.
min == prob.
max) {
1465 _(
"The probability of success is %.1f%%, %.1f%% or somewhere"
1469 prob.
max - prob.
min > 1 ?
1472 _(
" (This is the most precise interval I can calculate "
1473 "given the information our nation has access to.)") :
1487 "Action %s isn't performed by a unit",
1502 enabler->rulesave.comment =
nullptr;
1518 if (
enabler->rulesave.comment !=
nullptr) {
1623 for (
i = 0;
i <
obreq->contras->alternatives;
i++) {
1635 || (
obreq->contras->alternative[
i].req.present
1637 &
obreq->contras->alternative[
i].req.source))) {
1657 for (
i = 0;
i <
obreq->contras->alternatives;
i++) {
1668 out->suggested_solutions[
i].vector_number
1673 out->suggested_solutions[
i].req.present
1674 = !
obreq->contras->alternative[
i].req.present;
1675 out->suggested_solutions[
i].req.source
1676 =
obreq->contras->alternative[
i].req.source;
1677 out->suggested_solutions[
i].req.range
1678 =
obreq->contras->alternative[
i].req.range;
1679 out->suggested_solutions[
i].req.survives
1680 =
obreq->contras->alternative[
i].req.survives;
1681 out->suggested_solutions[
i].req.quiet
1682 =
obreq->contras->alternative[
i].req.quiet;
1722 if (
out !=
nullptr) {
1738 if (
out !=
nullptr) {
1824 N_(
"Requirement {%s} of action \"%s\" implies a claimed "
1825 "tile. No diplomatic relation to Nature."),
1832 out->suggested_solutions[0].vector_number
1888 N_(
"In enabler for \"%s\": No diplomatic relation to Nature."
1889 " Requirements {%s} and {%s} contradict each other."),
1899 out->suggested_solutions[0].vector_number
1905 out->suggested_solutions[1].vector_number
1923 if (
out !=
nullptr) {
1931 if (
out !=
nullptr) {
1938 if (
out !=
nullptr) {
1944 if (
out !=
nullptr) {
1950 if (
out !=
nullptr) {
2027 " used by any unit."),
2031 if (
out !=
nullptr) {
2053 if (vec == &
ae->actor_reqs) {
2055 }
else if (vec == &
ae->target_reqs) {
2080 return &
ae->actor_reqs;
2082 return &
ae->target_reqs;
2100 return _(
"actor_reqs");
2103 return _(
"target_reqs");
2162static const struct tile *
2222static const struct city *
2261 if (ptile !=
nullptr) {
2283 const struct action *act,
2486 if (
pclass->cache.native_bases !=
nullptr) {
2630 const struct city *homecity)
2634 if (
actor ==
nullptr) {
2663 if (
actor->city ==
nullptr) {
2681 if (0 >=
actor->city->airlift
2820 const struct city *homecity)
2827 if (
actor ==
nullptr) {
2832 if (target ==
nullptr) {
3005 "Is omniscient, should get yes or no.");
3056 FALSE,
"Action %s is performed by %s not %s",
3064 FALSE,
"Action %s is against %s not %s",
3136 FALSE,
"Action %s is performed by %s not %s",
3144 FALSE,
"Action %s is against %s not %s",
3216 FALSE,
"Action %s is performed by %s not %s",
3224 FALSE,
"Action %s is against %s not %s",
3302 FALSE,
"Action %s is performed by %s not %s",
3310 FALSE,
"Action %s is against %s not %s",
3379 FALSE,
"Action %s is performed by %s not %s",
3387 FALSE,
"Action %s is against %s not %s",
3455 FALSE,
"Action %s is performed by %s not %s",
3463 FALSE,
"Action %s is against %s not %s",
3504#define ASSERT_PLAYER_ACTION(_atk) \
3505 fc_assert_ret_val_msg(AAK_PLAYER == action_id_get_actor_kind(wanted_action),\
3506 FALSE, "Action %s is performed by %s not %s", \
3507 action_id_rule_name(wanted_action), \
3508 action_actor_kind_name( \
3509 action_id_get_actor_kind(wanted_action)), \
3510 action_actor_kind_name(AAK_PLAYER)); \
3511 fc_assert_ret_val_msg(_atk \
3512 == action_id_get_target_kind(wanted_action), \
3513 FALSE, "Action %s is against %s not %s", \
3514 action_id_rule_name(wanted_action), \
3515 action_target_kind_name( \
3516 action_id_get_target_kind(wanted_action)), \
3517 action_target_kind_name(_atk));
3538 nullptr,
nullptr,
nullptr);
3573 },
nullptr,
nullptr);
3643 nullptr,
nullptr)) {
3730 nullptr,
nullptr,
nullptr);
3759 if (
actor ==
nullptr ||
actor->player ==
nullptr) {
3764 if (target ==
nullptr) {
4084 if (
actor ==
nullptr) {
4087 if (target ==
nullptr) {
4275 }
else if (known ==
TRI_YES) {
4416 "Action %s is performed by %s not %s",
4424 "Action %s is against %s not %s",
4515 "Action %s is performed by %s not %s",
4523 "Action %s is against %s not %s",
4603 "Action %s is performed by %s not %s",
4611 "Action %s is against %s not %s",
4736 "Invalid probability [%d, %d]",
4792 "Action %s is performed by %s not %s",
4800 "Action %s is against %s not %s",
4875 "Action %s is performed by %s not %s",
4883 "Action %s is against %s not %s",
4958 "Action %s is performed by %s not %s",
4966 "Action %s is against %s not %s",
5063 log_error(
"Invalid action target kind");
5081 const struct city* target)
5116 const struct unit *target)
5149 const struct tile *target)
5633 "Bad initial odds for action number %d."
5634 " Does it roll the dice at all?",
5727 FALSE,
"Action %s is against %s not cities",
6049 return N_(
"%sPoison City%s");
6052 return N_(
"%sPoison City and Escape%s");
6055 return N_(
"S%sabotage Enemy Unit%s");
6058 return N_(
"S%sabotage Enemy Unit and Escape%s");
6061 return N_(
"Bribe Enemy %sUnit%s");
6064 return N_(
"Bribe Enemy %sStack%s");
6067 return N_(
"%sSabotage City%s");
6070 return N_(
"%sSabotage City and Escape%s");
6073 return N_(
"Industria%sl Sabotage%s");
6076 return N_(
"Industria%sl Sabotage Production%s");
6079 return N_(
"Industria%sl Sabotage and Escape%s");
6082 return N_(
"Industria%sl Sabotage Production and Escape%s");
6085 return N_(
"Incite a Re%svolt%s");
6088 return N_(
"Incite a Re%svolt and Escape%s");
6091 return N_(
"Establish %sEmbassy%s");
6094 return N_(
"Becom%se Ambassador%s");
6097 return N_(
"Steal %sTechnology%s");
6100 return N_(
"Steal %sTechnology and Escape%s");
6103 return N_(
"In%sdustrial Espionage%s");
6106 return N_(
"In%sdustrial Espionage and Escape%s");
6109 return N_(
"%sInvestigate City%s");
6113 return N_(
"%sInvestigate City (spends the unit)%s");
6116 return N_(
"Steal %sGold%s");
6119 return N_(
"Steal %sGold and Escape%s");
6122 return N_(
"Spread %sPlague%s");
6125 return N_(
"Steal %sMaps%s");
6128 return N_(
"Steal %sMaps and Escape%s");
6131 return N_(
"Establish Trade %sRoute%s");
6134 return N_(
"Enter %sMarketplace%s");
6137 return N_(
"Help %sbuild Wonder%s");
6140 return N_(
"%sCapture Units%s");
6143 return N_(
"%sExpel Unit%s");
6146 return N_(
"%sFound City%s");
6149 return N_(
"%sJoin City%s");
6152 return N_(
"B%sombard%s");
6155 return N_(
"B%sombard 2%s");
6158 return N_(
"B%sombard 3%s");
6161 return N_(
"B%sombard 4%s");
6165 return N_(
"Lethal B%sombard%s");
6168 return N_(
"Suitcase %sNuke%s");
6171 return N_(
"Suitcase %sNuke and Escape%s");
6174 return N_(
"Explode %sNuclear%s");
6177 return N_(
"%sNuke City%s");
6180 return N_(
"%sNuke Units%s");
6183 return N_(
"Destroy %sCity%s");
6186 return N_(
"Dis%sband recovering production%s");
6189 return N_(
"Dis%sband without recovering production%s");
6192 return N_(
"Set %sHome City%s");
6195 return N_(
"Make %sHomeless%s");
6198 return N_(
"%sUpgrade Unit%s");
6201 return N_(
"Drop %sParatrooper%s");
6204 return N_(
"Drop %sParatrooper%s");
6207 return N_(
"Drop %sParatrooper%s");
6210 return N_(
"Drop %sParatrooper%s");
6213 return N_(
"Drop %sParatrooper%s");
6216 return N_(
"Drop %sParatrooper%s");
6219 return N_(
"%sAirlift to City%s");
6223 return N_(
"%sAttack%s");
6227 return N_(
"%sSuicide Attack%s");
6230 return N_(
"%sWipe Units%s");
6233 return N_(
"Collect %sRansom%s");
6236 return N_(
"Surgical Str%sike Building%s");
6239 return N_(
"Surgical Str%sike Production%s");
6244 return N_(
"%sConquer City%s");
6247 return N_(
"%sConquer City 2%s");
6252 return N_(
"%sConquer Extras%s");
6255 return N_(
"%sConquer Extras 2%s");
6259 return N_(
"Heal %sUnit%s");
6263 return N_(
"%sTransform Terrain%s");
6267 return N_(
"Transform by %sCultivating%s");
6271 return N_(
"Transform by %sPlanting%s");
6275 return N_(
"Pilla%sge%s");
6279 return N_(
"%sClean%s");
6283 return N_(
"%sFortify%s");
6287 return N_(
"Build %sRoad%s");
6290 return N_(
"%sConvert Unit%s");
6294 return N_(
"%sBuild Base%s");
6298 return N_(
"Build %sMine%s");
6302 return N_(
"Build %sIrrigation%s");
6305 return N_(
"%sDeboard%s");
6310 return N_(
"%sBoard%s");
6316 return N_(
"%sEmbark%s");
6319 return N_(
"%sUnload%s");
6324 return N_(
"%sLoad%s");
6329 return N_(
"%sDisembark%s");
6332 return N_(
"%sDisembark 2%s");
6335 return N_(
"%sEliminate Diplomat%s");
6341 return N_(
"Enter %sHut%s");
6347 return N_(
"Frighten %sHut%s");
6352 return N_(
"Regular %sMove%s");
6357 return N_(
"%sTeleport%s");
6360 return N_(
"%sTeleport%s");
6363 return N_(
"%sTeleport%s");
6366 return N_(
"%sTeleport%s");
6369 return N_(
"%sTeleport%s");
6372 return N_(
"%sTeleport%s");
6375 return N_(
"%sEscape To Nearest City%s");
6378 return N_(
"%sUser Action 1%s");
6381 return N_(
"%sUser Action 2%s");
6384 return N_(
"%sUser Action 3%s");
6387 return N_(
"%sUser Action 4%s");
6389 return N_(
"%sGain Veterancy%s");
6391 return N_(
"%sEscape%s");
6393 return N_(
"%sCivil War%s");
6395 return N_(
"Finish %sUnit%s");
6397 return N_(
"Finish %sBuilding%s");
6546 return "explode_nuclear_min_range";
6548 return "nuke_city_min_range";
6550 return "nuke_units_min_range";
6552 return "teleport_min_range";
6554 return "teleport_2_min_range";
6556 return "teleport_3_min_range";
6558 return "teleport_conquer_min_range";
6560 return "teleport_frighten_min_range";
6562 return "teleport_frighten_conquer_min_range";
6564 return "teleport_enter_min_range";
6566 return "teleport_enter_conquer_min_range";
6568 return "user_action_1_min_range";
6570 return "user_action_2_min_range";
6572 return "user_action_3_min_range";
6574 return "user_action_4_min_range";
6717 return "help_wonder_max_range";
6719 return "disband_unit_recover_max_range";
6721 return "bombard_max_range";
6723 return "bombard_2_max_range";
6725 return "bombard_3_max_range";
6727 return "bombard_4_max_range";
6729 return "bombard_lethal_max_range";
6731 return "bombard_lethal_2_max_range";
6733 return "explode_nuclear_max_range";
6735 return "nuke_city_max_range";
6737 return "nuke_units_max_range";
6739 return "airlift_max_range";
6741 return "teleport_max_range";
6743 return "teleport_2_max_range";
6745 return "teleport_3_max_range";
6747 return "teleport_conquer_max_range";
6749 return "teleport_frighten_max_range";
6751 return "teleport_frighten_conquer_max_range";
6753 return "teleport_enter_max_range";
6755 return "teleport_enter_conquer_max_range";
6757 return "user_action_1_max_range";
6759 return "user_action_2_max_range";
6761 return "user_action_3_max_range";
6763 return "user_action_4_max_range";
6922 return "explode_nuclear_target_kind";
6924 return "nuke_city_target_kind";
6926 return "pillage_target_kind";
6928 return "pillage_2_target_kind";
6930 return "user_action_1_target_kind";
6932 return "user_action_2_target_kind";
6934 return "user_action_3_target_kind";
6936 return "user_action_4_target_kind";
7095 return "found_city_consuming_always";
7097 return "explode_nuclear_consuming_always";
7099 return "nuke_city_consuming_always";
7101 return "nuke_units_consuming_always";
7103 return "spread_plague_actor_consuming_always";
7105 return "user_action_1_actor_consuming_always";
7107 return "user_action_2_actor_consuming_always";
7109 return "user_action_3_actor_consuming_always";
7111 return "user_action_4_actor_consuming_always";
7136 return "enter_marketplace_blocked_by";
7138 return "bombard_blocked_by";
7140 return "bombard_2_blocked_by";
7142 return "bombard_3_blocked_by";
7144 return "bombard_4_blocked_by";
7146 return "bombard_lethal_blocked_by";
7148 return "bombard_lethal_2_blocked_by";
7150 return "explode_nuclear_blocked_by";
7152 return "nuke_city_blocked_by";
7154 return "nuke_units_blocked_by";
7156 return "attack_blocked_by";
7158 return "attack_2_blocked_by";
7160 return "suicide_attack_blocked_by";
7162 return "suicide_attack_2_blocked_by";
7164 return "wipe_units_blocked_by";
7166 return "collect_ransom_blocked_by";
7168 return "conquer_city_shrink_blocked_by";
7170 return "conquer_city_shrink_2_blocked_by";
7172 return "conquer_city_shrink_3_blocked_by";
7174 return "conquer_city_shrink_4_blocked_by";
7176 return "move_blocked_by";
7178 return "move_2_blocked_by";
7180 return "move_3_blocked_by";
7182 return "teleport_blocked_by";
7184 return "teleport_2_blocked_by";
7186 return "teleport_3_blocked_by";
7188 return "teleport_conquer_blocked_by";
7190 return "teleport_frighten_blocked_by";
7192 return "teleport_frighten_conquer_blocked_by";
7194 return "teleport_enter_blocked_by";
7196 return "teleport_enter_conquer_blocked_by";
7341 return "bribe_unit_post_success_forced_actions";
7343 return "bribe_stack_post_success_forced_actions";
7345 return "attack_post_success_forced_actions";
7347 return "attack_2_post_success_forced_actions";
7349 return "wipe_units_post_success_forced_actions";
7351 return "collect_ransom_post_success_forced_actions";
7523 N_(
"individual cities"),
7524 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