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_COUNT AAK_COUNT
49#include "actions_enums_gen.h"
52#define ACTION_ANY ACTION_COUNT
55#define ACTION_NONE ACTION_COUNT
58#define MAX_NUM_ACTIONS ACTION_COUNT
59#define NUM_ACTIONS MAX_NUM_ACTIONS
62#define SPECENUM_NAME moves_actor_kind
63#define SPECENUM_VALUE0 MAK_STAYS
64#define SPECENUM_VALUE0NAME N_("stays")
65#define SPECENUM_VALUE1 MAK_REGULAR
66#define SPECENUM_VALUE1NAME N_("regular")
67#define SPECENUM_VALUE2 MAK_TELEPORT
68#define SPECENUM_VALUE2NAME N_("teleport")
69#define SPECENUM_VALUE3 MAK_ESCAPE
70#define SPECENUM_VALUE3NAME N_("escape")
71#define SPECENUM_VALUE4 MAK_FORCED
72#define SPECENUM_VALUE4NAME N_("forced")
73#define SPECENUM_VALUE5 MAK_UNREPRESENTABLE
74#define SPECENUM_VALUE5NAME N_("unrepresentable")
78#define SPECENUM_NAME action_requester
80#define SPECENUM_VALUE0 ACT_REQ_PLAYER
81#define SPECENUM_VALUE0NAME N_("the player")
83#define SPECENUM_VALUE1 ACT_REQ_RULES
84#define SPECENUM_VALUE1NAME N_("the game rules")
86#define SPECENUM_VALUE2 ACT_REQ_SS_AGENT
87#define SPECENUM_VALUE2NAME N_("a server agent")
89#define SPECENUM_COUNT ACT_REQ_COUNT
99#define ACTION_DISTANCE_LAST_NON_SIGNAL 128016
101#define ACTION_DISTANCE_UNLIMITED (ACTION_DISTANCE_LAST_NON_SIGNAL + 1)
103#define ACTION_DISTANCE_MAX ACTION_DISTANCE_UNLIMITED
180#define action_has_result(_act_, _res_) ((_act_)->result == (_res_))
182#define enabler_get_action(_enabler_) action_by_number(_enabler_->action)
183#define enabler_get_action_id(_enabler_) (_enabler_->action)
185#define SPECLIST_TAG action_enabler
186#define SPECLIST_TYPE struct action_enabler
188#define action_enabler_list_iterate(action_enabler_list, aenabler) \
189 TYPED_LIST_ITERATE(struct action_enabler, action_enabler_list, aenabler)
190#define action_enabler_list_iterate_end LIST_ITERATE_END
192#define action_enabler_list_re_iterate(action_enabler_list, aenabler) \
193 action_enabler_list_iterate(action_enabler_list, aenabler) { \
194 if (!aenabler->rulesave.ruledit_disabled) {
196#define action_enabler_list_re_iterate_end \
198 } action_enabler_list_iterate_end
200#define action_iterate_all(_act_) \
203 for (_act_ = 0; _act_ < NUM_ACTIONS; _act_++) {
205#define action_iterate_all_end \
210#define action_iterate(_act_) \
212 action_iterate_all(_act_) {
214#define action_iterate_end \
215 } action_iterate_all_end; \
219#define SPECLIST_TAG action
220#define SPECLIST_TYPE struct action
223#define action_list_iterate(_list_, _act_) \
224 TYPED_LIST_ITERATE(struct action, _list_, _act_)
225#define action_list_iterate_end LIST_ITERATE_END
231#define action_noninternal_iterate(_act_) \
233 action_iterate(_act_) { \
234 if (!action_id_is_internal(_act_)) {
236#define action_noninternal_iterate_end \
238 } action_iterate_end; \
241#define action_by_result_iterate(_paction_, _result_) \
243 action_list_iterate(action_list_by_result(_result_), _paction_) { \
245#define action_by_result_iterate_end \
246 } action_list_iterate_end; \
249#define action_by_activity_iterate(_paction_, _activity_) \
251 action_list_iterate(action_list_by_activity(_activity_), _paction_) {
253#define action_by_activity_iterate_end \
254 } action_list_iterate_end; \
257#define action_array_iterate(_act_array_, _act_id_) \
261 for (_pos_ = 0; _pos_ < NUM_ACTIONS; _pos_++) { \
262 const action_id _act_id_ = _act_array_[_pos_]; \
264 if (_act_id_ == ACTION_NONE) { \
269#define action_array_iterate_end \
273#define action_enablers_iterate(_enabler_) \
275 action_iterate(_act_) { \
276 action_enabler_list_iterate( \
277 action_enablers_for_action(_act_), _enabler_) {
279#define action_enablers_iterate_end \
280 } action_enabler_list_iterate_end; \
281 } action_iterate_end; \
285#define SPECENUM_NAME action_auto_perf_cause
288#define SPECENUM_VALUE0 AAPC_UNIT_UPKEEP
289#define SPECENUM_VALUE0NAME "Unit Upkeep"
291#define SPECENUM_VALUE1 AAPC_UNIT_MOVED_ADJ
292#define SPECENUM_VALUE1NAME "Moved Adjacent"
295#define SPECENUM_VALUE2 AAPC_POST_ACTION
296#define SPECENUM_VALUE2NAME "After Successful Action"
299#define SPECENUM_VALUE3 AAPC_CITY_GONE
300#define SPECENUM_VALUE3NAME "City Gone"
304#define SPECENUM_VALUE4 AAPC_UNIT_STACK_DEATH
305#define SPECENUM_VALUE4NAME "Unit Stack Dead"
307#define SPECENUM_COUNT AAPC_COUNT
334#define action_auto_perf_iterate(_act_perf_) \
339 _ap_num_ < MAX_NUM_ACTION_AUTO_PERFORMERS \
340 && (action_auto_perf_by_number(_ap_num_)->cause \
343 const struct action_auto_perf *_act_perf_ \
344 = action_auto_perf_by_number(_ap_num_);
346#define action_auto_perf_iterate_end \
350#define action_auto_perf_by_cause_iterate(_cause_, _act_perf_) \
351action_auto_perf_iterate(_act_perf_) { \
352 if (_act_perf_->cause != _cause_) { \
356#define action_auto_perf_by_cause_iterate_end \
357} action_auto_perf_iterate_end
359#define action_auto_perf_actions_iterate(_autoperf_, _act_id_) \
360 action_array_iterate(_autoperf_->alternatives, _act_id_)
362#define action_auto_perf_actions_iterate_end \
363 action_array_iterate_end
368#define ACTION_AUTO_UPKEEP_FOOD 0
369#define ACTION_AUTO_UPKEEP_GOLD 1
370#define ACTION_AUTO_UPKEEP_SHIELD 2
371#define ACTION_AUTO_MOVED_ADJ 3
372#define ACTION_AUTO_POST_BRIBE_UNIT 4
373#define ACTION_AUTO_POST_BRIBE_STACK 5
374#define ACTION_AUTO_POST_ATTACK 6
375#define ACTION_AUTO_POST_ATTACK2 7
376#define ACTION_AUTO_POST_COLLECT_RANSOM 8
377#define ACTION_AUTO_ESCAPE_CITY 9
378#define ACTION_AUTO_ESCAPE_STACK 10
379#define ACTION_AUTO_POST_WIPE_UNITS 11
409#define action_id_get_actor_kind(act_id) \
410 action_get_actor_kind(action_by_number(act_id))
413#define action_id_get_target_kind(act_id) \
414 action_get_target_kind(action_by_number(act_id))
417#define action_id_get_sub_target_kind(act_id) \
418 action_get_sub_target_kind(action_by_number(act_id))
422#define action_id(_act_) (_act_->id)
424#define action_has_result_safe(paction, result) \
425 (paction && action_has_result(paction, result))
426#define action_id_has_result_safe(act_id, result) \
427 (action_by_number(act_id) \
428 && action_has_result(action_by_number(act_id), result))
431#define action_id_has_complex_target(act_id) \
432 action_has_complex_target(action_by_number(act_id))
434#define action_id_requires_details(act_id) \
435 action_requires_details(action_by_number(act_id))
437#define action_id_get_act_time(act_id, actor_unit, tgt_tile, tgt_extra) \
438 actres_get_act_time(action_by_number(act_id)->result, \
439 actor_unit, tgt_tile, tgt_extra)
445#define action_id_distance_accepted(act_id, distance) \
446 action_distance_accepted(action_by_number(act_id), distance)
450#define action_id_distance_inside_max(act_id, distance) \
451 action_distance_inside_max(action_by_number(act_id), distance)
454 const struct action *blocker);
457#define action_id_get_role(act_id) \
458 action_get_role(action_by_number(act_id))
460#define action_get_activity(_pact_) \
461 actres_activity_result(_pact_->result)
462#define action_id_get_activity(act_id) \
463 action_get_activity(action_by_number(act_id))
554 const struct tile *target,
589 const struct tile *target,
611 const struct city* target);
620 const struct unit *target);
629 const struct tile *target);
687#define ACTPROB_IMPOSSIBLE action_prob_new_impossible()
688#define ACTPROB_CERTAIN action_prob_new_certain()
689#define ACTPROB_NA action_prob_new_not_relevant()
690#define ACTPROB_NOT_IMPLEMENTED action_prob_new_not_impl()
691#define ACTPROB_NOT_KNOWN action_prob_new_unknown()
694#define ACTION_ODDS_PCT_DICE_ROLL_NA 110
710#define action_id_univs_not_blocking(act_id, act_uni, tgt_uni) \
711 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