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);
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;
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
2027 " used by any unit."),
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,
2629 const struct city *homecity)
2680 if (0 >=
actor->city->airlift
2818 const struct city *homecity)
2825 if (
actor ==
nullptr) {
2830 if (target ==
nullptr) {
3003 "Is omniscient, should get yes or no.");
3043 FALSE,
"Action %s is performed by %s not %s",
3051 FALSE,
"Action %s is against %s not %s",
3123 FALSE,
"Action %s is performed by %s not %s",
3131 FALSE,
"Action %s is against %s not %s",
3203 FALSE,
"Action %s is performed by %s not %s",
3211 FALSE,
"Action %s is against %s not %s",
3289 FALSE,
"Action %s is performed by %s not %s",
3297 FALSE,
"Action %s is against %s not %s",
3366 FALSE,
"Action %s is performed by %s not %s",
3374 FALSE,
"Action %s is against %s not %s",
3442 FALSE,
"Action %s is performed by %s not %s",
3450 FALSE,
"Action %s is against %s not %s",
3491#define ASSERT_PLAYER_ACTION(_atk) \
3492 fc_assert_ret_val_msg(AAK_PLAYER == action_id_get_actor_kind(wanted_action),\
3493 FALSE, "Action %s is performed by %s not %s", \
3494 action_id_rule_name(wanted_action), \
3495 action_actor_kind_name( \
3496 action_id_get_actor_kind(wanted_action)), \
3497 action_actor_kind_name(AAK_PLAYER)); \
3498 fc_assert_ret_val_msg(_atk \
3499 == action_id_get_target_kind(wanted_action), \
3500 FALSE, "Action %s is against %s not %s", \
3501 action_id_rule_name(wanted_action), \
3502 action_target_kind_name( \
3503 action_id_get_target_kind(wanted_action)), \
3504 action_target_kind_name(_atk));
3525 nullptr,
nullptr,
nullptr);
3560 },
nullptr,
nullptr);
3630 nullptr,
nullptr)) {
3717 nullptr,
nullptr,
nullptr);
3751 if (target ==
NULL) {
4074 if (target ==
NULL) {
4262 }
else if (known ==
TRI_YES) {
4400 "Action %s is performed by %s not %s",
4408 "Action %s is against %s not %s",
4499 "Action %s is performed by %s not %s",
4507 "Action %s is against %s not %s",
4587 "Action %s is performed by %s not %s",
4595 "Action %s is against %s not %s",
4720 "Invalid probability [%d, %d]",
4776 "Action %s is performed by %s not %s",
4784 "Action %s is against %s not %s",
4859 "Action %s is performed by %s not %s",
4867 "Action %s is against %s not %s",
4942 "Action %s is performed by %s not %s",
4950 "Action %s is against %s not %s",
5047 log_error(
"Invalid action target kind");
5065 const struct city* target)
5100 const struct unit *target)
5133 const struct tile *target)
5617 "Bad initial odds for action number %d."
5618 " Does it roll the dice at all?",
5711 FALSE,
"Action %s is against %s not cities",
6033 return N_(
"%sPoison City%s");
6036 return N_(
"%sPoison City and Escape%s");
6039 return N_(
"S%sabotage Enemy Unit%s");
6042 return N_(
"S%sabotage Enemy Unit and Escape%s");
6045 return N_(
"Bribe Enemy %sUnit%s");
6048 return N_(
"Bribe Enemy %sStack%s");
6051 return N_(
"%sSabotage City%s");
6054 return N_(
"%sSabotage City and Escape%s");
6057 return N_(
"Industria%sl Sabotage%s");
6060 return N_(
"Industria%sl Sabotage Production%s");
6063 return N_(
"Industria%sl Sabotage and Escape%s");
6066 return N_(
"Industria%sl Sabotage Production and Escape%s");
6069 return N_(
"Incite a Re%svolt%s");
6072 return N_(
"Incite a Re%svolt and Escape%s");
6075 return N_(
"Establish %sEmbassy%s");
6078 return N_(
"Becom%se Ambassador%s");
6081 return N_(
"Steal %sTechnology%s");
6084 return N_(
"Steal %sTechnology and Escape%s");
6087 return N_(
"In%sdustrial Espionage%s");
6090 return N_(
"In%sdustrial Espionage and Escape%s");
6093 return N_(
"%sInvestigate City%s");
6097 return N_(
"%sInvestigate City (spends the unit)%s");
6100 return N_(
"Steal %sGold%s");
6103 return N_(
"Steal %sGold and Escape%s");
6106 return N_(
"Spread %sPlague%s");
6109 return N_(
"Steal %sMaps%s");
6112 return N_(
"Steal %sMaps and Escape%s");
6115 return N_(
"Establish Trade %sRoute%s");
6118 return N_(
"Enter %sMarketplace%s");
6121 return N_(
"Help %sbuild Wonder%s");
6124 return N_(
"%sCapture Units%s");
6127 return N_(
"%sExpel Unit%s");
6130 return N_(
"%sFound City%s");
6133 return N_(
"%sJoin City%s");
6136 return N_(
"B%sombard%s");
6139 return N_(
"B%sombard 2%s");
6142 return N_(
"B%sombard 3%s");
6145 return N_(
"B%sombard 4%s");
6149 return N_(
"Lethal B%sombard%s");
6152 return N_(
"Suitcase %sNuke%s");
6155 return N_(
"Suitcase %sNuke and Escape%s");
6158 return N_(
"Explode %sNuclear%s");
6161 return N_(
"%sNuke City%s");
6164 return N_(
"%sNuke Units%s");
6167 return N_(
"Destroy %sCity%s");
6170 return N_(
"Dis%sband recovering production%s");
6173 return N_(
"Dis%sband without recovering production%s");
6176 return N_(
"Set %sHome City%s");
6179 return N_(
"Make %sHomeless%s");
6182 return N_(
"%sUpgrade Unit%s");
6185 return N_(
"Drop %sParatrooper%s");
6188 return N_(
"Drop %sParatrooper%s");
6191 return N_(
"Drop %sParatrooper%s");
6194 return N_(
"Drop %sParatrooper%s");
6197 return N_(
"Drop %sParatrooper%s");
6200 return N_(
"Drop %sParatrooper%s");
6203 return N_(
"%sAirlift to City%s");
6207 return N_(
"%sAttack%s");
6211 return N_(
"%sSuicide Attack%s");
6214 return N_(
"%sWipe Units%s");
6217 return N_(
"Collect %sRansom%s");
6220 return N_(
"Surgical Str%sike Building%s");
6223 return N_(
"Surgical Str%sike Production%s");
6228 return N_(
"%sConquer City%s");
6231 return N_(
"%sConquer City 2%s");
6236 return N_(
"%sConquer Extras%s");
6239 return N_(
"%sConquer Extras 2%s");
6243 return N_(
"Heal %sUnit%s");
6247 return N_(
"%sTransform Terrain%s");
6251 return N_(
"Transform by %sCultivating%s");
6255 return N_(
"Transform by %sPlanting%s");
6259 return N_(
"Pilla%sge%s");
6263 return N_(
"%sClean%s");
6267 return N_(
"%sFortify%s");
6271 return N_(
"Build %sRoad%s");
6274 return N_(
"%sConvert Unit%s");
6278 return N_(
"%sBuild Base%s");
6282 return N_(
"Build %sMine%s");
6286 return N_(
"Build %sIrrigation%s");
6289 return N_(
"%sDeboard%s");
6294 return N_(
"%sBoard%s");
6300 return N_(
"%sEmbark%s");
6303 return N_(
"%sUnload%s");
6308 return N_(
"%sLoad%s");
6313 return N_(
"%sDisembark%s");
6316 return N_(
"%sDisembark 2%s");
6319 return N_(
"%sEliminate Diplomat%s");
6325 return N_(
"Enter %sHut%s");
6331 return N_(
"Frighten %sHut%s");
6336 return N_(
"Regular %sMove%s");
6341 return N_(
"%sTeleport%s");
6344 return N_(
"%sTeleport%s");
6347 return N_(
"%sTeleport%s");
6350 return N_(
"%sTeleport%s");
6353 return N_(
"%sTeleport%s");
6356 return N_(
"%sTeleport%s");
6359 return N_(
"%sEscape To Nearest City%s");
6362 return N_(
"%sUser Action 1%s");
6365 return N_(
"%sUser Action 2%s");
6368 return N_(
"%sUser Action 3%s");
6371 return N_(
"%sUser Action 4%s");
6373 return N_(
"%sGain Veterancy%s");
6375 return N_(
"%sEscape%s");
6377 return N_(
"%sCivil War%s");
6379 return N_(
"Finish %sUnit%s");
6381 return N_(
"Finish %sBuilding%s");
6530 return "explode_nuclear_min_range";
6532 return "nuke_city_min_range";
6534 return "nuke_units_min_range";
6536 return "teleport_min_range";
6538 return "teleport_2_min_range";
6540 return "teleport_3_min_range";
6542 return "teleport_conquer_min_range";
6544 return "teleport_frighten_min_range";
6546 return "teleport_frighten_conquer_min_range";
6548 return "teleport_enter_min_range";
6550 return "teleport_enter_conquer_min_range";
6552 return "user_action_1_min_range";
6554 return "user_action_2_min_range";
6556 return "user_action_3_min_range";
6558 return "user_action_4_min_range";
6701 return "help_wonder_max_range";
6703 return "disband_unit_recover_max_range";
6705 return "bombard_max_range";
6707 return "bombard_2_max_range";
6709 return "bombard_3_max_range";
6711 return "bombard_4_max_range";
6713 return "bombard_lethal_max_range";
6715 return "bombard_lethal_2_max_range";
6717 return "explode_nuclear_max_range";
6719 return "nuke_city_max_range";
6721 return "nuke_units_max_range";
6723 return "airlift_max_range";
6725 return "teleport_max_range";
6727 return "teleport_2_max_range";
6729 return "teleport_3_max_range";
6731 return "teleport_conquer_max_range";
6733 return "teleport_frighten_max_range";
6735 return "teleport_frighten_conquer_max_range";
6737 return "teleport_enter_max_range";
6739 return "teleport_enter_conquer_max_range";
6741 return "user_action_1_max_range";
6743 return "user_action_2_max_range";
6745 return "user_action_3_max_range";
6747 return "user_action_4_max_range";
6906 return "explode_nuclear_target_kind";
6908 return "nuke_city_target_kind";
6910 return "pillage_target_kind";
6912 return "pillage_2_target_kind";
6914 return "user_action_1_target_kind";
6916 return "user_action_2_target_kind";
6918 return "user_action_3_target_kind";
6920 return "user_action_4_target_kind";
7079 return "found_city_consuming_always";
7081 return "explode_nuclear_consuming_always";
7083 return "nuke_city_consuming_always";
7085 return "nuke_units_consuming_always";
7087 return "spread_plague_actor_consuming_always";
7089 return "user_action_1_actor_consuming_always";
7091 return "user_action_2_actor_consuming_always";
7093 return "user_action_3_actor_consuming_always";
7095 return "user_action_4_actor_consuming_always";
7120 return "enter_marketplace_blocked_by";
7122 return "bombard_blocked_by";
7124 return "bombard_2_blocked_by";
7126 return "bombard_3_blocked_by";
7128 return "bombard_4_blocked_by";
7130 return "bombard_lethal_blocked_by";
7132 return "bombard_lethal_2_blocked_by";
7134 return "explode_nuclear_blocked_by";
7136 return "nuke_city_blocked_by";
7138 return "nuke_units_blocked_by";
7140 return "attack_blocked_by";
7142 return "attack_2_blocked_by";
7144 return "suicide_attack_blocked_by";
7146 return "suicide_attack_2_blocked_by";
7148 return "wipe_units_blocked_by";
7150 return "collect_ransom_blocked_by";
7152 return "conquer_city_shrink_blocked_by";
7154 return "conquer_city_shrink_2_blocked_by";
7156 return "conquer_city_shrink_3_blocked_by";
7158 return "conquer_city_shrink_4_blocked_by";
7160 return "move_blocked_by";
7162 return "move_2_blocked_by";
7164 return "move_3_blocked_by";
7166 return "teleport_blocked_by";
7168 return "teleport_2_blocked_by";
7170 return "teleport_3_blocked_by";
7172 return "teleport_conquer_blocked_by";
7174 return "teleport_frighten_blocked_by";
7176 return "teleport_frighten_conquer_blocked_by";
7178 return "teleport_enter_blocked_by";
7180 return "teleport_enter_conquer_blocked_by";
7325 return "bribe_unit_post_success_forced_actions";
7327 return "bribe_stack_post_success_forced_actions";
7329 return "attack_post_success_forced_actions";
7331 return "attack_2_post_success_forced_actions";
7333 return "wipe_units_post_success_forced_actions";
7335 return "collect_ransom_post_success_forced_actions";
7507 N_(
"individual cities"),
7508 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)
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)
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)
#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)
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_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)
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