38#define ASSERT_UNUSED_ACTION_CASES \
41#define SPECENUM_NAME action_actor_kind
42#define SPECENUM_VALUE0 AAK_UNIT
43#define SPECENUM_VALUE0NAME N_("a unit")
44#define SPECENUM_VALUE1 AAK_CITY
45#define SPECENUM_VALUE1NAME N_("a city")
46#define SPECENUM_VALUE2 AAK_PLAYER
47#define SPECENUM_VALUE2NAME N_("a player")
48#define SPECENUM_COUNT AAK_COUNT
53#include "actions_enums_gen.h"
56#define ACTION_ANY ACTION_COUNT
59#define ACTION_NONE ACTION_COUNT
62#define MAX_NUM_ACTIONS ACTION_COUNT
63#define NUM_ACTIONS MAX_NUM_ACTIONS
66#define SPECENUM_NAME moves_actor_kind
67#define SPECENUM_VALUE0 MAK_STAYS
68#define SPECENUM_VALUE0NAME N_("stays")
69#define SPECENUM_VALUE1 MAK_REGULAR
70#define SPECENUM_VALUE1NAME N_("regular")
71#define SPECENUM_VALUE2 MAK_TELEPORT
72#define SPECENUM_VALUE2NAME N_("teleport")
73#define SPECENUM_VALUE3 MAK_ESCAPE
74#define SPECENUM_VALUE3NAME N_("escape")
75#define SPECENUM_VALUE4 MAK_FORCED
76#define SPECENUM_VALUE4NAME N_("forced")
77#define SPECENUM_VALUE5 MAK_UNREPRESENTABLE
78#define SPECENUM_VALUE5NAME N_("unrepresentable")
82#define SPECENUM_NAME action_requester
84#define SPECENUM_VALUE0 ACT_REQ_PLAYER
85#define SPECENUM_VALUE0NAME N_("the player")
87#define SPECENUM_VALUE1 ACT_REQ_RULES
88#define SPECENUM_VALUE1NAME N_("the game rules")
90#define SPECENUM_VALUE2 ACT_REQ_SS_AGENT
91#define SPECENUM_VALUE2NAME N_("a server agent")
93#define SPECENUM_COUNT ACT_REQ_COUNT
103#define ACTION_DISTANCE_LAST_NON_SIGNAL 128016
105#define ACTION_DISTANCE_UNLIMITED (ACTION_DISTANCE_LAST_NON_SIGNAL + 1)
107#define ACTION_DISTANCE_MAX ACTION_DISTANCE_UNLIMITED
184#define action_has_result(_act_, _res_) ((_act_)->result == (_res_))
186#define enabler_get_action(_enabler_) action_by_number(_enabler_->action)
187#define enabler_get_action_id(_enabler_) (_enabler_->action)
189#define SPECLIST_TAG action_enabler
190#define SPECLIST_TYPE struct action_enabler
192#define action_enabler_list_iterate(action_enabler_list, aenabler) \
193 TYPED_LIST_ITERATE(struct action_enabler, action_enabler_list, aenabler)
194#define action_enabler_list_iterate_end LIST_ITERATE_END
196#define action_enabler_list_re_iterate(action_enabler_list, aenabler) \
197 action_enabler_list_iterate(action_enabler_list, aenabler) { \
198 if (!aenabler->rulesave.ruledit_disabled) {
200#define action_enabler_list_re_iterate_end \
202 } action_enabler_list_iterate_end
204#define action_iterate_all(_act_) \
207 for (_act_ = 0; _act_ < NUM_ACTIONS; _act_++) {
209#define action_iterate_all_end \
214#define action_iterate(_act_) \
216 action_iterate_all(_act_) {
218#define action_iterate_end \
219 } action_iterate_all_end; \
223#define SPECLIST_TAG action
224#define SPECLIST_TYPE struct action
227#define action_list_iterate(_list_, _act_) \
228 TYPED_LIST_ITERATE(struct action, _list_, _act_)
229#define action_list_iterate_end LIST_ITERATE_END
235#define action_noninternal_iterate(_act_) \
237 action_iterate(_act_) { \
238 if (!action_id_is_internal(_act_)) {
240#define action_noninternal_iterate_end \
242 } action_iterate_end; \
245#define action_by_result_iterate(_paction_, _result_) \
247 action_list_iterate(action_list_by_result(_result_), _paction_) { \
249#define action_by_result_iterate_end \
250 } action_list_iterate_end; \
253#define action_by_activity_iterate(_paction_, _activity_) \
255 action_list_iterate(action_list_by_activity(_activity_), _paction_) {
257#define action_by_activity_iterate_end \
258 } action_list_iterate_end; \
261#define action_array_iterate(_act_array_, _act_id_) \
265 for (_pos_ = 0; _pos_ < NUM_ACTIONS; _pos_++) { \
266 const action_id _act_id_ = _act_array_[_pos_]; \
268 if (_act_id_ == ACTION_NONE) { \
273#define action_array_iterate_end \
277#define action_enablers_iterate(_enabler_) \
279 action_iterate(_act_) { \
280 action_enabler_list_iterate( \
281 action_enablers_for_action(_act_), _enabler_) {
283#define action_enablers_iterate_end \
284 } action_enabler_list_iterate_end; \
285 } action_iterate_end; \
289#define SPECENUM_NAME action_auto_perf_cause
292#define SPECENUM_VALUE0 AAPC_UNIT_UPKEEP
293#define SPECENUM_VALUE0NAME "Unit Upkeep"
295#define SPECENUM_VALUE1 AAPC_UNIT_MOVED_ADJ
296#define SPECENUM_VALUE1NAME "Moved Adjacent"
299#define SPECENUM_VALUE2 AAPC_POST_ACTION
300#define SPECENUM_VALUE2NAME "After Successful Action"
303#define SPECENUM_VALUE3 AAPC_CITY_GONE
304#define SPECENUM_VALUE3NAME "City Gone"
308#define SPECENUM_VALUE4 AAPC_UNIT_STACK_DEATH
309#define SPECENUM_VALUE4NAME "Unit Stack Dead"
311#define SPECENUM_COUNT AAPC_COUNT
338#define action_auto_perf_iterate(_act_perf_) \
343 _ap_num_ < MAX_NUM_ACTION_AUTO_PERFORMERS \
344 && (action_auto_perf_by_number(_ap_num_)->cause \
347 const struct action_auto_perf *_act_perf_ \
348 = action_auto_perf_by_number(_ap_num_);
350#define action_auto_perf_iterate_end \
354#define action_auto_perf_by_cause_iterate(_cause_, _act_perf_) \
355action_auto_perf_iterate(_act_perf_) { \
356 if (_act_perf_->cause != _cause_) { \
360#define action_auto_perf_by_cause_iterate_end \
361} action_auto_perf_iterate_end
363#define action_auto_perf_actions_iterate(_autoperf_, _act_id_) \
364 action_array_iterate(_autoperf_->alternatives, _act_id_)
366#define action_auto_perf_actions_iterate_end \
367 action_array_iterate_end
372#define ACTION_AUTO_UPKEEP_FOOD 0
373#define ACTION_AUTO_UPKEEP_GOLD 1
374#define ACTION_AUTO_UPKEEP_SHIELD 2
375#define ACTION_AUTO_MOVED_ADJ 3
376#define ACTION_AUTO_POST_BRIBE_UNIT 4
377#define ACTION_AUTO_POST_BRIBE_STACK 5
378#define ACTION_AUTO_POST_ATTACK 6
379#define ACTION_AUTO_POST_ATTACK2 7
380#define ACTION_AUTO_POST_COLLECT_RANSOM 8
381#define ACTION_AUTO_ESCAPE_CITY 9
382#define ACTION_AUTO_ESCAPE_STACK 10
383#define ACTION_AUTO_POST_WIPE_UNITS 11
413#define action_id_get_actor_kind(act_id) \
414 action_get_actor_kind(action_by_number(act_id))
417#define action_id_get_target_kind(act_id) \
418 action_get_target_kind(action_by_number(act_id))
421#define action_id_get_sub_target_kind(act_id) \
422 action_get_sub_target_kind(action_by_number(act_id))
426#define action_id(_act_) (_act_->id)
428#define action_has_result_safe(paction, result) \
429 (paction && action_has_result(paction, result))
430#define action_id_has_result_safe(act_id, result) \
431 (action_by_number(act_id) \
432 && action_has_result(action_by_number(act_id), result))
435#define action_id_has_complex_target(act_id) \
436 action_has_complex_target(action_by_number(act_id))
438#define action_id_requires_details(act_id) \
439 action_requires_details(action_by_number(act_id))
441#define action_id_get_act_time(act_id, actor_unit, tgt_tile, tgt_extra) \
442 actres_get_act_time(action_by_number(act_id)->result, \
443 actor_unit, tgt_tile, tgt_extra)
449#define action_id_distance_accepted(act_id, distance) \
450 action_distance_accepted(action_by_number(act_id), distance)
454#define action_id_distance_inside_max(act_id, distance) \
455 action_distance_inside_max(action_by_number(act_id), distance)
458 const struct action *blocker);
461#define action_id_get_role(act_id) \
462 action_get_role(action_by_number(act_id))
464#define action_get_activity(_pact_) \
465 actres_activity_result(_pact_->result)
466#define action_id_get_activity(act_id) \
467 action_get_activity(action_by_number(act_id))
558 const struct tile *target,
593 const struct tile *target,
615 const struct city* target);
624 const struct unit *target);
633 const struct tile *target);
691#define ACTPROB_IMPOSSIBLE action_prob_new_impossible()
692#define ACTPROB_CERTAIN action_prob_new_certain()
693#define ACTPROB_NA action_prob_new_not_relevant()
694#define ACTPROB_NOT_IMPLEMENTED action_prob_new_not_impl()
695#define ACTPROB_NOT_KNOWN action_prob_new_unknown()
698#define ACTION_ODDS_PCT_DICE_ROLL_NA 110
714#define action_id_univs_not_blocking(act_id, act_uni, tgt_uni) \
715 action_univs_not_blocking(action_by_number(act_id), act_uni, tgt_uni)
bool is_action_possible_on_city(action_id act_id, const struct player *actor_player, const struct city *target_city)
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)
const char * action_prob_explain(const struct act_prob prob)
struct act_prob action_prob_vs_stack(const struct civ_map *nmap, const struct unit *actor, const action_id act_id, const struct tile *victims)
bool action_mp_full_makes_legal(const struct unit *actor, const action_id act_id)
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)
struct req_vec_problem * action_enabler_suggest_repair(const struct action_enabler *enabler)
bool action_prob_possible(const struct act_prob probability)
struct act_prob action_prob_new_not_impl(void)
struct req_vec_problem * action_enabler_suggest_improvement(const struct action_enabler *enabler)
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)
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 *sub_tgt)
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)
const char * action_blocked_by_ruleset_var_name(const struct action *act)
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)
static struct action * action_by_number(action_id act_id)
bool action_maybe_possible_actor_unit(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit)
bool action_is_in_use(struct action *paction)
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)
const char * action_post_success_forced_ruleset_var_name(const struct action *act)
struct action * action_by_rule_name(const char *name)
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)
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, const struct city *target_city, const struct unit *target_unit)
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)
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)
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)
const char * action_actor_consuming_always_ruleset_var_name(action_id act)
bool action_immune_government(struct government *gov, action_id act)
struct act_prob action_prob_new_certain(void)
const char * action_max_range_ruleset_var_name(int act)
bool action_is_internal(struct action *paction)
int action_dice_roll_initial_odds(const struct action *paction)
struct act_prob action_prob_fall_back(const struct act_prob *ap1, const struct act_prob *ap2)
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 act_prob action_prob_self(const struct civ_map *nmap, const struct unit *actor, const action_id act_id)
struct action_list * action_list_by_result(enum action_result result)
bool action_univs_not_blocking(const struct action *paction, struct universal *actor_uni, struct universal *target_uni)
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)
bool action_actor_utype_hard_reqs_ok(const struct action *result, const struct unit_type *actor_unittype)
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)
const char * action_target_kind_ruleset_var_name(int act)
void action_enabler_add(struct action_enabler *enabler)
struct act_prob action_prob_vs_tile(const struct civ_map *nmap, const struct unit *actor, const action_id act_id, const struct tile *victims, const struct extra_type *target_extra)
struct act_prob action_prob_vs_unit(const struct civ_map *nmap, const struct unit *actor, const action_id act_id, const struct unit *victim)
const char * action_ui_name_default(int act)
bool action_enabler_utype_possible_actor(const struct action_enabler *ae, const struct unit_type *act_utype)
struct act_prob action_speculate_unit_on_city(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 city *target)
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)
int action_get_role(const struct action *paction)
struct act_prob action_prob_vs_city(const struct civ_map *nmap, const struct unit *actor, const action_id act_id, const struct city *victim)
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)
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)
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_vs_extras(const struct civ_map *nmap, const struct unit *actor, const action_id act_id, const struct tile *target, const struct extra_type *tgt_extra)
struct action_enabler * action_enabler_copy(const struct action_enabler *original)
int action_prob_cmp_pessimist(const struct act_prob ap1, const struct act_prob ap2)
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)
struct requirement_vector * action_enabler_vector_by_number(const void *enabler, req_vec_num_in_item vec)
bool is_action_enabled_player(const struct civ_map *nmap, const action_id wanted_action, const struct player *actor_plr)
double action_prob_to_0_to_1_pessimist(const struct act_prob ap)
const char * gen_action_name_update_cb(const char *old_name)
struct action_enabler_list * action_enablers_for_action(action_id action)
bool action_distance_accepted(const struct action *action, const int distance)
const char * action_ui_name_ruleset_var_name(int act)
const char * action_get_ui_name_mnemonic(action_id act_id, const char *mnemonic)
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, const struct extra_type *tgt_extra)
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
signed char req_vec_num_in_item
req_vec_num_in_item a requirement vectors number in an item.
struct requirement_vector reqs
enum action_auto_perf_cause cause
action_id alternatives[MAX_NUM_ACTIONS]
struct action_enabler::@14 rulesave
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