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
51#define SPECENUM_NAME gen_action
52#define SPECENUM_VALUE0 ACTION_ESTABLISH_EMBASSY
53#define SPECENUM_VALUE0NAME "Establish Embassy"
54#define SPECENUM_VALUE1 ACTION_ESTABLISH_EMBASSY_STAY
55#define SPECENUM_VALUE1NAME "Establish Embassy Stay"
56#define SPECENUM_VALUE2 ACTION_SPY_INVESTIGATE_CITY
57#define SPECENUM_VALUE2NAME "Investigate City"
58#define SPECENUM_VALUE3 ACTION_INV_CITY_SPEND
59#define SPECENUM_VALUE3NAME "Investigate City Spend Unit"
60#define SPECENUM_VALUE4 ACTION_SPY_POISON
61#define SPECENUM_VALUE4NAME "Poison City"
62#define SPECENUM_VALUE5 ACTION_SPY_POISON_ESC
63#define SPECENUM_VALUE5NAME "Poison City Escape"
64#define SPECENUM_VALUE6 ACTION_SPY_STEAL_GOLD
65#define SPECENUM_VALUE6NAME "Steal Gold"
66#define SPECENUM_VALUE7 ACTION_SPY_STEAL_GOLD_ESC
67#define SPECENUM_VALUE7NAME "Steal Gold Escape"
68#define SPECENUM_VALUE8 ACTION_SPY_SABOTAGE_CITY
69#define SPECENUM_VALUE8NAME "Sabotage City"
70#define SPECENUM_VALUE9 ACTION_SPY_SABOTAGE_CITY_ESC
71#define SPECENUM_VALUE9NAME "Sabotage City Escape"
72#define SPECENUM_VALUE10 ACTION_SPY_TARGETED_SABOTAGE_CITY
73#define SPECENUM_VALUE10NAME "Targeted Sabotage City"
74#define SPECENUM_VALUE11 ACTION_SPY_TARGETED_SABOTAGE_CITY_ESC
75#define SPECENUM_VALUE11NAME "Targeted Sabotage City Escape"
76#define SPECENUM_VALUE12 ACTION_SPY_SABOTAGE_CITY_PRODUCTION
77#define SPECENUM_VALUE12NAME "Sabotage City Production"
78#define SPECENUM_VALUE13 ACTION_SPY_SABOTAGE_CITY_PRODUCTION_ESC
79#define SPECENUM_VALUE13NAME "Sabotage City Production Escape"
80#define SPECENUM_VALUE14 ACTION_SPY_STEAL_TECH
81#define SPECENUM_VALUE14NAME "Steal Tech"
82#define SPECENUM_VALUE15 ACTION_SPY_STEAL_TECH_ESC
83#define SPECENUM_VALUE15NAME "Steal Tech Escape Expected"
84#define SPECENUM_VALUE16 ACTION_SPY_TARGETED_STEAL_TECH
85#define SPECENUM_VALUE16NAME "Targeted Steal Tech"
86#define SPECENUM_VALUE17 ACTION_SPY_TARGETED_STEAL_TECH_ESC
87#define SPECENUM_VALUE17NAME "Targeted Steal Tech Escape Expected"
88#define SPECENUM_VALUE18 ACTION_SPY_INCITE_CITY
89#define SPECENUM_VALUE18NAME "Incite City"
90#define SPECENUM_VALUE19 ACTION_SPY_INCITE_CITY_ESC
91#define SPECENUM_VALUE19NAME "Incite City Escape"
92#define SPECENUM_VALUE20 ACTION_TRADE_ROUTE
93#define SPECENUM_VALUE20NAME "Establish Trade Route"
94#define SPECENUM_VALUE21 ACTION_MARKETPLACE
95#define SPECENUM_VALUE21NAME "Enter Marketplace"
96#define SPECENUM_VALUE22 ACTION_HELP_WONDER
97#define SPECENUM_VALUE22NAME "Help Wonder"
98#define SPECENUM_VALUE23 ACTION_SPY_BRIBE_UNIT
99#define SPECENUM_VALUE23NAME "Bribe Unit"
100#define SPECENUM_VALUE24 ACTION_CAPTURE_UNITS
101#define SPECENUM_VALUE24NAME "Capture Units"
102#define SPECENUM_VALUE25 ACTION_SPY_SABOTAGE_UNIT
103#define SPECENUM_VALUE25NAME "Sabotage Unit"
104#define SPECENUM_VALUE26 ACTION_SPY_SABOTAGE_UNIT_ESC
105#define SPECENUM_VALUE26NAME "Sabotage Unit Escape"
106#define SPECENUM_VALUE27 ACTION_FOUND_CITY
107#define SPECENUM_VALUE27NAME "Found City"
108#define SPECENUM_VALUE28 ACTION_JOIN_CITY
109#define SPECENUM_VALUE28NAME "Join City"
110#define SPECENUM_VALUE29 ACTION_STEAL_MAPS
111#define SPECENUM_VALUE29NAME "Steal Maps"
112#define SPECENUM_VALUE30 ACTION_STEAL_MAPS_ESC
113#define SPECENUM_VALUE30NAME "Steal Maps Escape"
114#define SPECENUM_VALUE31 ACTION_SPY_NUKE
115#define SPECENUM_VALUE31NAME "Suitcase Nuke"
116#define SPECENUM_VALUE32 ACTION_SPY_NUKE_ESC
117#define SPECENUM_VALUE32NAME "Suitcase Nuke Escape"
118#define SPECENUM_VALUE33 ACTION_NUKE
119#define SPECENUM_VALUE33NAME "Explode Nuclear"
120#define SPECENUM_VALUE34 ACTION_NUKE_CITY
121#define SPECENUM_VALUE34NAME "Nuke City"
122#define SPECENUM_VALUE35 ACTION_NUKE_UNITS
123#define SPECENUM_VALUE35NAME "Nuke Units"
124#define SPECENUM_VALUE36 ACTION_DESTROY_CITY
125#define SPECENUM_VALUE36NAME "Destroy City"
126#define SPECENUM_VALUE37 ACTION_EXPEL_UNIT
127#define SPECENUM_VALUE37NAME "Expel Unit"
128#define SPECENUM_VALUE38 ACTION_DISBAND_UNIT_RECOVER
129#define SPECENUM_VALUE38NAME "Disband Unit Recover"
130#define SPECENUM_VALUE39 ACTION_DISBAND_UNIT
131#define SPECENUM_VALUE39NAME "Disband Unit"
132#define SPECENUM_VALUE40 ACTION_HOME_CITY
133#define SPECENUM_VALUE40NAME "Home City"
134#define SPECENUM_VALUE41 ACTION_HOMELESS
135#define SPECENUM_VALUE41NAME "Unit Make Homeless"
136#define SPECENUM_VALUE42 ACTION_UPGRADE_UNIT
137#define SPECENUM_VALUE42NAME "Upgrade Unit"
138#define SPECENUM_VALUE43 ACTION_CONVERT
139#define SPECENUM_VALUE43NAME "Convert Unit"
140#define SPECENUM_VALUE44 ACTION_AIRLIFT
141#define SPECENUM_VALUE44NAME "Airlift Unit"
142#define SPECENUM_VALUE45 ACTION_ATTACK
143#define SPECENUM_VALUE45NAME "Attack"
144#define SPECENUM_VALUE46 ACTION_ATTACK2
145#define SPECENUM_VALUE46NAME "Attack 2"
146#define SPECENUM_VALUE47 ACTION_SUICIDE_ATTACK
147#define SPECENUM_VALUE47NAME "Suicide Attack"
148#define SPECENUM_VALUE48 ACTION_SUICIDE_ATTACK2
149#define SPECENUM_VALUE48NAME "Suicide Attack 2"
150#define SPECENUM_VALUE49 ACTION_STRIKE_BUILDING
151#define SPECENUM_VALUE49NAME "Surgical Strike Building"
152#define SPECENUM_VALUE50 ACTION_STRIKE_PRODUCTION
153#define SPECENUM_VALUE50NAME "Surgical Strike Production"
154#define SPECENUM_VALUE51 ACTION_CONQUER_CITY
155#define SPECENUM_VALUE51NAME "Conquer City"
156#define SPECENUM_VALUE52 ACTION_CONQUER_CITY2
157#define SPECENUM_VALUE52NAME "Conquer City 2"
158#define SPECENUM_VALUE53 ACTION_CONQUER_CITY3
159#define SPECENUM_VALUE53NAME "Conquer City 3"
160#define SPECENUM_VALUE54 ACTION_CONQUER_CITY4
161#define SPECENUM_VALUE54NAME "Conquer City 4"
162#define SPECENUM_VALUE55 ACTION_BOMBARD
163#define SPECENUM_VALUE55NAME "Bombard"
164#define SPECENUM_VALUE56 ACTION_BOMBARD2
165#define SPECENUM_VALUE56NAME "Bombard 2"
166#define SPECENUM_VALUE57 ACTION_BOMBARD3
167#define SPECENUM_VALUE57NAME "Bombard 3"
168#define SPECENUM_VALUE58 ACTION_BOMBARD4
169#define SPECENUM_VALUE58NAME "Bombard 4"
170#define SPECENUM_VALUE59 ACTION_BOMBARD_LETHAL
171#define SPECENUM_VALUE59NAME "Bombard Lethal"
172#define SPECENUM_VALUE60 ACTION_BOMBARD_LETHAL2
173#define SPECENUM_VALUE60NAME "Bombard Lethal 2"
174#define SPECENUM_VALUE61 ACTION_FORTIFY
175#define SPECENUM_VALUE61NAME "Fortify"
176#define SPECENUM_VALUE62 ACTION_CULTIVATE
177#define SPECENUM_VALUE62NAME "Cultivate"
178#define SPECENUM_VALUE63 ACTION_PLANT
179#define SPECENUM_VALUE63NAME "Plant"
180#define SPECENUM_VALUE64 ACTION_TRANSFORM_TERRAIN
181#define SPECENUM_VALUE64NAME "Transform Terrain"
182#define SPECENUM_VALUE65 ACTION_ROAD
183#define SPECENUM_VALUE65NAME "Build Road"
184#define SPECENUM_VALUE66 ACTION_IRRIGATE
185#define SPECENUM_VALUE66NAME "Build Irrigation"
186#define SPECENUM_VALUE67 ACTION_MINE
187#define SPECENUM_VALUE67NAME "Build Mine"
188#define SPECENUM_VALUE68 ACTION_BASE
189#define SPECENUM_VALUE68NAME "Build Base"
190#define SPECENUM_VALUE69 ACTION_PILLAGE
191#define SPECENUM_VALUE69NAME "Pillage"
192#define SPECENUM_VALUE70 ACTION_TRANSPORT_BOARD
193#define SPECENUM_VALUE70NAME "Transport Board"
194#define SPECENUM_VALUE71 ACTION_TRANSPORT_BOARD2
195#define SPECENUM_VALUE71NAME "Transport Board 2"
196#define SPECENUM_VALUE72 ACTION_TRANSPORT_BOARD3
197#define SPECENUM_VALUE72NAME "Transport Board_3"
198#define SPECENUM_VALUE73 ACTION_TRANSPORT_DEBOARD
199#define SPECENUM_VALUE73NAME "Transport Deboard"
200#define SPECENUM_VALUE74 ACTION_TRANSPORT_EMBARK
201#define SPECENUM_VALUE74NAME "Transport Embark"
202#define SPECENUM_VALUE75 ACTION_TRANSPORT_EMBARK2
203#define SPECENUM_VALUE75NAME "Transport Embark 2"
204#define SPECENUM_VALUE76 ACTION_TRANSPORT_EMBARK3
205#define SPECENUM_VALUE76NAME "Transport Embark 3"
206#define SPECENUM_VALUE77 ACTION_TRANSPORT_EMBARK4
207#define SPECENUM_VALUE77NAME "Transport Embark 4"
208#define SPECENUM_VALUE78 ACTION_TRANSPORT_DISEMBARK1
209#define SPECENUM_VALUE78NAME "Transport Disembark"
210#define SPECENUM_VALUE79 ACTION_TRANSPORT_DISEMBARK2
211#define SPECENUM_VALUE79NAME "Transport Disembark 2"
212#define SPECENUM_VALUE80 ACTION_TRANSPORT_DISEMBARK3
213#define SPECENUM_VALUE80NAME "Transport Disembark 3"
214#define SPECENUM_VALUE81 ACTION_TRANSPORT_DISEMBARK4
215#define SPECENUM_VALUE81NAME "Transport Disembark 4"
216#define SPECENUM_VALUE82 ACTION_TRANSPORT_LOAD
217#define SPECENUM_VALUE82NAME "Transport Load"
218#define SPECENUM_VALUE83 ACTION_TRANSPORT_LOAD2
219#define SPECENUM_VALUE83NAME "Transport Load 2"
220#define SPECENUM_VALUE84 ACTION_TRANSPORT_LOAD3
221#define SPECENUM_VALUE84NAME "Transport Load 3"
222#define SPECENUM_VALUE85 ACTION_TRANSPORT_UNLOAD
223#define SPECENUM_VALUE85NAME "Transport Unload"
224#define SPECENUM_VALUE86 ACTION_SPY_SPREAD_PLAGUE
225#define SPECENUM_VALUE86NAME "Spread Plague"
226#define SPECENUM_VALUE87 ACTION_SPY_ATTACK
227#define SPECENUM_VALUE87NAME "Spy Attack"
228#define SPECENUM_VALUE88 ACTION_CONQUER_EXTRAS
229#define SPECENUM_VALUE88NAME "Conquer Extras"
230#define SPECENUM_VALUE89 ACTION_CONQUER_EXTRAS2
231#define SPECENUM_VALUE89NAME "Conquer Extras 2"
232#define SPECENUM_VALUE90 ACTION_CONQUER_EXTRAS3
233#define SPECENUM_VALUE90NAME "Conquer Extras 3"
234#define SPECENUM_VALUE91 ACTION_CONQUER_EXTRAS4
235#define SPECENUM_VALUE91NAME "Conquer Extras 4"
236#define SPECENUM_VALUE92 ACTION_HUT_ENTER
237#define SPECENUM_VALUE92NAME "Enter Hut"
238#define SPECENUM_VALUE93 ACTION_HUT_ENTER2
239#define SPECENUM_VALUE93NAME "Enter Hut 2"
240#define SPECENUM_VALUE94 ACTION_HUT_ENTER3
241#define SPECENUM_VALUE94NAME "Enter Hut 3"
242#define SPECENUM_VALUE95 ACTION_HUT_ENTER4
243#define SPECENUM_VALUE95NAME "Enter Hut 4"
244#define SPECENUM_VALUE96 ACTION_HUT_FRIGHTEN
245#define SPECENUM_VALUE96NAME "Frighten Hut"
246#define SPECENUM_VALUE97 ACTION_HUT_FRIGHTEN2
247#define SPECENUM_VALUE97NAME "Frighten Hut 2"
248#define SPECENUM_VALUE98 ACTION_HUT_FRIGHTEN3
249#define SPECENUM_VALUE98NAME "Frighten Hut 3"
250#define SPECENUM_VALUE99 ACTION_HUT_FRIGHTEN4
251#define SPECENUM_VALUE99NAME "Frighten Hut 4"
252#define SPECENUM_VALUE100 ACTION_HEAL_UNIT
253#define SPECENUM_VALUE100NAME "Heal Unit"
254#define SPECENUM_VALUE101 ACTION_HEAL_UNIT2
255#define SPECENUM_VALUE101NAME "Heal Unit 2"
256#define SPECENUM_VALUE102 ACTION_PARADROP
257#define SPECENUM_VALUE102NAME "Paradrop Unit"
258#define SPECENUM_VALUE103 ACTION_PARADROP_CONQUER
259#define SPECENUM_VALUE103NAME "Paradrop Unit Conquer"
260#define SPECENUM_VALUE104 ACTION_PARADROP_FRIGHTEN
261#define SPECENUM_VALUE104NAME "Paradrop Unit Frighten"
262#define SPECENUM_VALUE105 ACTION_PARADROP_FRIGHTEN_CONQUER
263#define SPECENUM_VALUE105NAME "Paradrop Unit Frighten Conquer"
264#define SPECENUM_VALUE106 ACTION_PARADROP_ENTER
265#define SPECENUM_VALUE106NAME "Paradrop Unit Enter"
266#define SPECENUM_VALUE107 ACTION_PARADROP_ENTER_CONQUER
267#define SPECENUM_VALUE107NAME "Paradrop Unit Enter Conquer"
268#define SPECENUM_VALUE108 ACTION_WIPE_UNITS
269#define SPECENUM_VALUE108NAME "Wipe Units"
270#define SPECENUM_VALUE109 ACTION_SPY_ESCAPE
271#define SPECENUM_VALUE109NAME "Spy Escape"
272#define SPECENUM_VALUE110 ACTION_UNIT_MOVE
273#define SPECENUM_VALUE110NAME "Unit Move"
274#define SPECENUM_VALUE111 ACTION_UNIT_MOVE2
275#define SPECENUM_VALUE111NAME "Unit Move 2"
276#define SPECENUM_VALUE112 ACTION_UNIT_MOVE3
277#define SPECENUM_VALUE112NAME "Unit Move 3"
278#define SPECENUM_VALUE113 ACTION_TELEPORT
279#define SPECENUM_VALUE113NAME "Teleport"
280#define SPECENUM_VALUE114 ACTION_TELEPORT_CONQUER
281#define SPECENUM_VALUE114NAME "Teleport Conquer"
282#define SPECENUM_VALUE115 ACTION_TELEPORT_FRIGHTEN
283#define SPECENUM_VALUE115NAME "Teleport Frighten"
284#define SPECENUM_VALUE116 ACTION_TELEPORT_FRIGHTEN_CONQUER
285#define SPECENUM_VALUE116NAME "Teleport Frighten Conquer"
286#define SPECENUM_VALUE117 ACTION_TELEPORT_ENTER
287#define SPECENUM_VALUE117NAME "Teleport Enter"
288#define SPECENUM_VALUE118 ACTION_TELEPORT_ENTER_CONQUER
289#define SPECENUM_VALUE118NAME "Teleport Enter Conquer"
290#define SPECENUM_VALUE119 ACTION_CLEAN
291#define SPECENUM_VALUE119NAME "Clean"
292#define SPECENUM_VALUE120 ACTION_COLLECT_RANSOM
293#define SPECENUM_VALUE120NAME "Collect Ransom"
294#define SPECENUM_VALUE121 ACTION_USER_ACTION1
295#define SPECENUM_VALUE121NAME "User Action 1"
296#define SPECENUM_VALUE122 ACTION_USER_ACTION2
297#define SPECENUM_VALUE122NAME "User Action 2"
298#define SPECENUM_VALUE123 ACTION_USER_ACTION3
299#define SPECENUM_VALUE123NAME "User Action 3"
300#define SPECENUM_VALUE124 ACTION_USER_ACTION4
301#define SPECENUM_VALUE124NAME "User Action 4"
302#define SPECENUM_BITVECTOR bv_actions
303#define SPECENUM_COUNT ACTION_COUNT
304#define SPECENUM_NAME_UPDATER
308#define ACTION_ANY ACTION_COUNT
311#define ACTION_NONE ACTION_COUNT
314#define MAX_NUM_ACTIONS ACTION_COUNT
315#define NUM_ACTIONS MAX_NUM_ACTIONS
318#define SPECENUM_NAME moves_actor_kind
319#define SPECENUM_VALUE0 MAK_STAYS
320#define SPECENUM_VALUE0NAME N_("stays")
321#define SPECENUM_VALUE1 MAK_REGULAR
322#define SPECENUM_VALUE1NAME N_("regular")
323#define SPECENUM_VALUE2 MAK_TELEPORT
324#define SPECENUM_VALUE2NAME N_("teleport")
325#define SPECENUM_VALUE3 MAK_ESCAPE
326#define SPECENUM_VALUE3NAME N_("escape")
327#define SPECENUM_VALUE4 MAK_FORCED
328#define SPECENUM_VALUE4NAME N_("forced")
329#define SPECENUM_VALUE5 MAK_UNREPRESENTABLE
330#define SPECENUM_VALUE5NAME N_("unrepresentable")
334#define SPECENUM_NAME action_requester
336#define SPECENUM_VALUE0 ACT_REQ_PLAYER
337#define SPECENUM_VALUE0NAME N_("the player")
339#define SPECENUM_VALUE1 ACT_REQ_RULES
340#define SPECENUM_VALUE1NAME N_("the game rules")
342#define SPECENUM_VALUE2 ACT_REQ_SS_AGENT
343#define SPECENUM_VALUE2NAME N_("a server agent")
345#define SPECENUM_COUNT ACT_REQ_COUNT
355#define ACTION_DISTANCE_LAST_NON_SIGNAL 128016
357#define ACTION_DISTANCE_UNLIMITED (ACTION_DISTANCE_LAST_NON_SIGNAL + 1)
359#define ACTION_DISTANCE_MAX ACTION_DISTANCE_UNLIMITED
431#define action_has_result(_act_, _res_) ((_act_)->result == (_res_))
433#define enabler_get_action(_enabler_) action_by_number(_enabler_->action)
434#define enabler_get_action_id(_enabler_) (_enabler_->action)
436#define SPECLIST_TAG action_enabler
437#define SPECLIST_TYPE struct action_enabler
439#define action_enabler_list_iterate(action_enabler_list, aenabler) \
440 TYPED_LIST_ITERATE(struct action_enabler, action_enabler_list, aenabler)
441#define action_enabler_list_iterate_end LIST_ITERATE_END
443#define action_enabler_list_re_iterate(action_enabler_list, aenabler) \
444 action_enabler_list_iterate(action_enabler_list, aenabler) { \
445 if (!aenabler->ruledit_disabled) {
447#define action_enabler_list_re_iterate_end \
449 } action_enabler_list_iterate_end
451#define action_iterate_all(_act_) \
454 for (_act_ = 0; _act_ < NUM_ACTIONS; _act_++) {
456#define action_iterate_all_end \
461#define action_iterate(_act_) \
463 action_iterate_all(_act_) {
465#define action_iterate_end \
466 } action_iterate_all_end; \
470#define SPECLIST_TAG action
471#define SPECLIST_TYPE struct action
474#define action_list_iterate(_list_, _act_) \
475 TYPED_LIST_ITERATE(struct action, _list_, _act_)
476#define action_list_iterate_end LIST_ITERATE_END
481#define action_by_result_iterate(_paction_, _result_) \
483 action_list_iterate(action_list_by_result(_result_), _paction_) { \
485#define action_by_result_iterate_end \
486 } action_list_iterate_end; \
489#define action_by_activity_iterate(_paction_, _activity_) \
491 action_list_iterate(action_list_by_activity(_activity_), _paction_) {
493#define action_by_activity_iterate_end \
494 } action_list_iterate_end; \
497#define action_array_iterate(_act_array_, _act_id_) \
501 for (_pos_ = 0; _pos_ < NUM_ACTIONS; _pos_++) { \
502 const action_id _act_id_ = _act_array_[_pos_]; \
504 if (_act_id_ == ACTION_NONE) { \
509#define action_array_iterate_end \
513#define action_enablers_iterate(_enabler_) \
515 action_iterate(_act_) { \
516 action_enabler_list_iterate( \
517 action_enablers_for_action(_act_), _enabler_) {
519#define action_enablers_iterate_end \
520 } action_enabler_list_iterate_end; \
521 } action_iterate_end; \
525#define SPECENUM_NAME action_auto_perf_cause
528#define SPECENUM_VALUE0 AAPC_UNIT_UPKEEP
529#define SPECENUM_VALUE0NAME "Unit Upkeep"
531#define SPECENUM_VALUE1 AAPC_UNIT_MOVED_ADJ
532#define SPECENUM_VALUE1NAME "Moved Adjacent"
535#define SPECENUM_VALUE2 AAPC_POST_ACTION
536#define SPECENUM_VALUE2NAME "After Successful Action"
539#define SPECENUM_VALUE3 AAPC_CITY_GONE
540#define SPECENUM_VALUE3NAME "City Gone"
544#define SPECENUM_VALUE4 AAPC_UNIT_STACK_DEATH
545#define SPECENUM_VALUE4NAME "Unit Stack Dead"
547#define SPECENUM_COUNT AAPC_COUNT
574#define action_auto_perf_iterate(_act_perf_) \
579 _ap_num_ < MAX_NUM_ACTION_AUTO_PERFORMERS \
580 && (action_auto_perf_by_number(_ap_num_)->cause \
583 const struct action_auto_perf *_act_perf_ \
584 = action_auto_perf_by_number(_ap_num_);
586#define action_auto_perf_iterate_end \
590#define action_auto_perf_by_cause_iterate(_cause_, _act_perf_) \
591action_auto_perf_iterate(_act_perf_) { \
592 if (_act_perf_->cause != _cause_) { \
596#define action_auto_perf_by_cause_iterate_end \
597} action_auto_perf_iterate_end
599#define action_auto_perf_actions_iterate(_autoperf_, _act_id_) \
600 action_array_iterate(_autoperf_->alternatives, _act_id_)
602#define action_auto_perf_actions_iterate_end \
603 action_array_iterate_end
608#define ACTION_AUTO_UPKEEP_FOOD 0
609#define ACTION_AUTO_UPKEEP_GOLD 1
610#define ACTION_AUTO_UPKEEP_SHIELD 2
611#define ACTION_AUTO_MOVED_ADJ 3
612#define ACTION_AUTO_POST_BRIBE 4
613#define ACTION_AUTO_POST_ATTACK 5
614#define ACTION_AUTO_POST_ATTACK2 6
615#define ACTION_AUTO_POST_COLLECT_RANSOM 7
616#define ACTION_AUTO_ESCAPE_CITY 8
617#define ACTION_AUTO_ESCAPE_STACK 9
618#define ACTION_AUTO_POST_WIPE_UNITS 10
648#define action_id_get_actor_kind(act_id) \
649 action_get_actor_kind(action_by_number(act_id))
652#define action_id_get_target_kind(act_id) \
653 action_get_target_kind(action_by_number(act_id))
656#define action_id_get_sub_target_kind(act_id) \
657 action_get_sub_target_kind(action_by_number(act_id))
661#define action_id(_act_) (_act_->id)
663#define action_has_result_safe(paction, result) \
664 (paction && action_has_result(paction, result))
665#define action_id_has_result_safe(act_id, result) \
666 (action_by_number(act_id) \
667 && action_has_result(action_by_number(act_id), result))
670#define action_id_has_complex_target(act_id) \
671 action_has_complex_target(action_by_number(act_id))
673#define action_id_requires_details(act_id) \
674 action_requires_details(action_by_number(act_id))
676#define action_id_get_act_time(act_id, actor_unit, tgt_tile, tgt_extra) \
677 actres_get_act_time(action_by_number(act_id)->result, \
678 actor_unit, tgt_tile, tgt_extra)
684#define action_id_distance_accepted(act_id, distance) \
685 action_distance_accepted(action_by_number(act_id), distance)
689#define action_id_distance_inside_max(act_id, distance) \
690 action_distance_inside_max(action_by_number(act_id), distance)
693 const struct action *blocker);
696#define action_id_get_role(act_id) \
697 action_get_role(action_by_number(act_id))
699#define action_get_activity(_pact_) \
700 actres_activity_result(_pact_->result)
701#define action_id_get_activity(act_id) \
702 action_get_activity(action_by_number(act_id))
793 const struct tile *target,
824 const struct tile *target,
846 const struct city* target);
855 const struct unit *target);
864 const struct tile *target);
922#define ACTPROB_IMPOSSIBLE action_prob_new_impossible()
923#define ACTPROB_CERTAIN action_prob_new_certain()
924#define ACTPROB_NA action_prob_new_not_relevant()
925#define ACTPROB_NOT_IMPLEMENTED action_prob_new_not_impl()
926#define ACTPROB_NOT_KNOWN action_prob_new_unknown()
929#define ACTION_ODDS_PCT_DICE_ROLL_NA 110
945#define action_id_univs_not_blocking(act_id, act_uni, tgt_uni) \
946 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)
const char * action_name_translation(const struct action *action)
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)
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)
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 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)
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 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