Freeciv-3.2
Loading...
Searching...
No Matches
actions.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996-2013 - Freeciv Development Team
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13
14#ifndef FC_ACTIONS_H
15#define FC_ACTIONS_H
16
17/* common */
18#include "actres.h"
19#include "fc_types.h"
20#include "map_types.h"
21#include "requirements.h"
22
23#ifdef __cplusplus
24extern "C" {
25#endif /* __cplusplus */
26
27/* If 'enum gen_action' has currently unused values that should
28 * not be used in 'switch - cases', put those cases here. E.g.:
29 *
30 *#define ASSERT_UNUSED_ACTION_CASES \
31 * case ACTION_UNUSED_1: \
32 * fc_assert_msg(FALSE, "ACTION_UNUSED_1"); \
33 * break; \
34 * case ACTION_UNUSED_2: \
35 * fc_assert_msg(FALSE, "ACTION_UNUSED_2"); \
36 * break;
37 */
38#define ASSERT_UNUSED_ACTION_CASES \
39
40
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
45#include "specenum_gen.h"
46
47const char *gen_action_name_update_cb(const char *old_name);
48
49/* Values used in the network protocol. */
50/* Names used in file formats but not normally shown to users. */
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
305#include "specenum_gen.h"
306
307/* Fake action id used in searches to signal "any action at all". */
308#define ACTION_ANY ACTION_COUNT
309
310/* Fake action id used to signal the absence of any actions. */
311#define ACTION_NONE ACTION_COUNT
312
313/* Used in the network protocol. */
314#define MAX_NUM_ACTIONS ACTION_COUNT
315#define NUM_ACTIONS MAX_NUM_ACTIONS
316
317/* Describes how a unit successfully performing an action will move it. */
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")
331#include "specenum_gen.h"
332
333/* Who ordered the action to be performed? */
334#define SPECENUM_NAME action_requester
335/* The player ordered it directly. */
336#define SPECENUM_VALUE0 ACT_REQ_PLAYER
337#define SPECENUM_VALUE0NAME N_("the player")
338/* The game it self because the rules requires it. */
339#define SPECENUM_VALUE1 ACT_REQ_RULES
340#define SPECENUM_VALUE1NAME N_("the game rules")
341/* A server side autonomous agent working for the player. */
342#define SPECENUM_VALUE2 ACT_REQ_SS_AGENT
343#define SPECENUM_VALUE2NAME N_("a server agent")
344/* Number of action requesters. */
345#define SPECENUM_COUNT ACT_REQ_COUNT
346#include "specenum_gen.h"
347
348/* The last action distance value that is interpreted as an actual
349 * distance rather than as a signal value.
350 *
351 * It is specified literally rather than referring to MAP_DISTANCE_MAX
352 * because Freeciv-web's MAP_DISTANCE_MAX differs from the regular Freeciv
353 * server's MAP_DISTANCE_MAX. A static assertion in actions.c makes sure
354 * that it can cover the whole map. */
355#define ACTION_DISTANCE_LAST_NON_SIGNAL 128016
356/* No action max distance to target limit. */
357#define ACTION_DISTANCE_UNLIMITED (ACTION_DISTANCE_LAST_NON_SIGNAL + 1)
358/* No action max distance can be bigger than this. */
359#define ACTION_DISTANCE_MAX ACTION_DISTANCE_UNLIMITED
360
361struct action
362{
364
367
371
372 /* Sub target policy. */
374
375 /* Limits on the distance on the map between the actor and the target.
376 * The action is legal iff the distance is min_distance, max_distance or
377 * a value in between. */
379
380 /* The name of the action shown in the UI */
382
383 /* Suppress automatic help text generation about what enables and/or
384 * disables this action. */
385 bool quiet;
386
387 /* Actions that blocks this action. The action will be illegal if any
388 * bloking action is legal. */
390
391 /* Successfully performing this action will always consume the actor.
392 * Don't set this for actions that consumes the unit in some cases
393 * (depending on luck, the presence of a flag, etc) but not in other
394 * cases. */
396
397 union {
398 struct {
399 /* A unit's ability to perform this action will pop up the action
400 * selection dialog before the player asks for it only in exceptional
401 * cases.
402 *
403 * The motivation for setting rare_pop_up is to minimize player
404 * annoyance and mistakes. Getting a pop up every time a unit moves is
405 * annoying. An unexpected offer to do something that in many cases is
406 * destructive can lead the player's muscle memory to perform the
407 * wrong action. */
409
410 /* The unitwaittime setting blocks this action when done too soon. */
412
413 /* How successfully performing the specified action always will move
414 * the actor unit of the specified type. */
418};
419
421{
425
426 /* Only relevant for ruledit and other rulesave users. Indicates that
427 * this action enabler is deleted and shouldn't be saved. */
429};
430
431#define action_has_result(_act_, _res_) ((_act_)->result == (_res_))
432
433#define enabler_get_action(_enabler_) action_by_number(_enabler_->action)
434#define enabler_get_action_id(_enabler_) (_enabler_->action)
435
436#define SPECLIST_TAG action_enabler
437#define SPECLIST_TYPE struct action_enabler
438#include "speclist.h"
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
442
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) {
446
447#define action_enabler_list_re_iterate_end \
448 } \
449 } action_enabler_list_iterate_end
450
451#define action_iterate_all(_act_) \
452{ \
453 action_id _act_; \
454 for (_act_ = 0; _act_ < NUM_ACTIONS; _act_++) {
455
456#define action_iterate_all_end \
457 } \
458}
459
460/* Filter out unused action slots, in versions where those exist */
461#define action_iterate(_act_) \
462{ \
463 action_iterate_all(_act_) {
464
465#define action_iterate_end \
466 } action_iterate_all_end; \
467}
468
469/* Get 'struct action_id_list' and related functions: */
470#define SPECLIST_TAG action
471#define SPECLIST_TYPE struct action
472#include "speclist.h"
473
474#define action_list_iterate(_list_, _act_) \
475 TYPED_LIST_ITERATE(struct action, _list_, _act_)
476#define action_list_iterate_end LIST_ITERATE_END
477
480
481#define action_by_result_iterate(_paction_, _result_) \
482{ \
483 action_list_iterate(action_list_by_result(_result_), _paction_) { \
484
485#define action_by_result_iterate_end \
486 } action_list_iterate_end; \
487}
488
489#define action_by_activity_iterate(_paction_, _activity_) \
490{ \
491 action_list_iterate(action_list_by_activity(_activity_), _paction_) {
492
493#define action_by_activity_iterate_end \
494 } action_list_iterate_end; \
495}
496
497#define action_array_iterate(_act_array_, _act_id_) \
498{ \
499 int _pos_; \
500 \
501 for (_pos_ = 0; _pos_ < NUM_ACTIONS; _pos_++) { \
502 const action_id _act_id_ = _act_array_[_pos_]; \
503 \
504 if (_act_id_ == ACTION_NONE) { \
505 /* No more actions in this list. */ \
506 break; \
507 }
508
509#define action_array_iterate_end \
510 } \
511}
512
513#define action_enablers_iterate(_enabler_) \
514{ \
515 action_iterate(_act_) { \
516 action_enabler_list_iterate( \
517 action_enablers_for_action(_act_), _enabler_) {
518
519#define action_enablers_iterate_end \
520 } action_enabler_list_iterate_end; \
521 } action_iterate_end; \
522}
523
524/* The reason why an action should be auto performed. */
525#define SPECENUM_NAME action_auto_perf_cause
526/* Can't pay the unit's upkeep. */
527/* (Can be triggered by food, shield or gold upkeep) */
528#define SPECENUM_VALUE0 AAPC_UNIT_UPKEEP
529#define SPECENUM_VALUE0NAME "Unit Upkeep"
530/* A unit moved to an adjacent tile (auto attack). */
531#define SPECENUM_VALUE1 AAPC_UNIT_MOVED_ADJ
532#define SPECENUM_VALUE1NAME "Moved Adjacent"
533/* An action was successfully performed and the (action specific) conditions
534 * for forcing a post action move are fulfilled. */
535#define SPECENUM_VALUE2 AAPC_POST_ACTION
536#define SPECENUM_VALUE2NAME "After Successful Action"
537/* The city that made the unit's current tile native is gone. Evaluated
538 * against an adjacent tile. */
539#define SPECENUM_VALUE3 AAPC_CITY_GONE
540#define SPECENUM_VALUE3NAME "City Gone"
541/* The unit's stack has been defeated and is scheduled for execution but the
542 * unit has the CanEscape unit type flag.
543 * Evaluated against an adjacent tile. */
544#define SPECENUM_VALUE4 AAPC_UNIT_STACK_DEATH
545#define SPECENUM_VALUE4NAME "Unit Stack Dead"
546/* Number of forced action auto performer causes. */
547#define SPECENUM_COUNT AAPC_COUNT
548#include "specenum_gen.h"
549
550/* An Action Auto Performer rule makes an actor try to perform an action
551 * without being ordered to do so by the player controlling it.
552 * - the first auto performer that matches the cause and fulfills the reqs
553 * is selected.
554 * - the actions listed by the selected auto performer is tried in order
555 * until an action is successful, all actions have been tried or the
556 * actor disappears.
557 * - if no action inside the selected auto performer is legal no action is
558 * performed. The system won't try to select another auto performer.
559 */
561{
562 /* The reason for trying to auto perform an action. */
564
565 /* Must be fulfilled if the game should try to force an action from this
566 * action auto performer. */
568
569 /* Auto perform the first legal action in this list.
570 * The list is terminated by ACTION_NONE. */
572};
573
574#define action_auto_perf_iterate(_act_perf_) \
575{ \
576 int _ap_num_; \
577 \
578 for (_ap_num_ = 0; \
579 _ap_num_ < MAX_NUM_ACTION_AUTO_PERFORMERS \
580 && (action_auto_perf_by_number(_ap_num_)->cause \
581 != AAPC_COUNT); \
582 _ap_num_++) { \
583 const struct action_auto_perf *_act_perf_ \
584 = action_auto_perf_by_number(_ap_num_);
585
586#define action_auto_perf_iterate_end \
587 } \
588}
589
590#define action_auto_perf_by_cause_iterate(_cause_, _act_perf_) \
591action_auto_perf_iterate(_act_perf_) { \
592 if (_act_perf_->cause != _cause_) { \
593 continue; \
594 }
595
596#define action_auto_perf_by_cause_iterate_end \
597} action_auto_perf_iterate_end
598
599#define action_auto_perf_actions_iterate(_autoperf_, _act_id_) \
600 action_array_iterate(_autoperf_->alternatives, _act_id_)
601
602#define action_auto_perf_actions_iterate_end \
603 action_array_iterate_end
604
605/* Hard coded location of action auto performers. Used for conversion while
606 * action auto performers aren't directly exposed to the ruleset.
607 * Remember to update also MAX_NUM_ACTION_AUTO_PERFORMERS when changing these. */
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
619
620/* Initialization */
621void actions_init(void);
622void actions_rs_pre_san_gen(void);
623void actions_free(void);
624
625bool actions_are_ready(void);
626
627bool action_id_exists(const action_id act_id);
628
629extern struct action **_actions;
630/**********************************************************************/
635static inline struct action *action_by_number(action_id act_id)
636{
637 if (!gen_action_is_valid((enum gen_action)act_id)) {
638 return NULL;
639 }
640
641 /* We return NULL if there's NULL there, no need to special case it */
642 return _actions[act_id];
643}
644
645struct action *action_by_rule_name(const char *name);
646
648#define action_id_get_actor_kind(act_id) \
649 action_get_actor_kind(action_by_number(act_id))
651 const struct action *paction);
652#define action_id_get_target_kind(act_id) \
653 action_get_target_kind(action_by_number(act_id))
655 const struct action *paction);
656#define action_id_get_sub_target_kind(act_id) \
657 action_get_sub_target_kind(action_by_number(act_id))
658
659int action_number(const struct action *action);
660
661#define action_id(_act_) (_act_->id)
662
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))
668
669bool action_has_complex_target(const struct action *paction);
670#define action_id_has_complex_target(act_id) \
671 action_has_complex_target(action_by_number(act_id))
672bool action_requires_details(const struct action *paction);
673#define action_id_requires_details(act_id) \
674 action_requires_details(action_by_number(act_id))
675
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)
679
681
682bool action_distance_accepted(const struct action *action,
683 const int distance);
684#define action_id_distance_accepted(act_id, distance) \
685 action_distance_accepted(action_by_number(act_id), distance)
686
687bool action_distance_inside_max(const struct action *action,
688 const int distance);
689#define action_id_distance_inside_max(act_id, distance) \
690 action_distance_inside_max(action_by_number(act_id), distance)
691
692bool action_would_be_blocked_by(const struct action *blocked,
693 const struct action *blocker);
694
695int action_get_role(const struct action *paction);
696#define action_id_get_role(act_id) \
697 action_get_role(action_by_number(act_id))
698
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))
703
704const char *action_rule_name(const struct action *action);
705const char *action_id_rule_name(action_id act_id);
706
707const char *action_name_translation(const struct action *action);
708const char *action_id_name_translation(action_id act_id);
709const char *action_get_ui_name_mnemonic(action_id act_id,
710 const char *mnemonic);
711const char *action_prepare_ui_name(action_id act_id, const char *mnemonic,
712 const struct act_prob prob,
713 const char *custom);
714
715const char *action_ui_name_ruleset_var_name(int act);
716const char *action_ui_name_default(int act);
717
718const char *action_min_range_ruleset_var_name(int act);
719const char *action_max_range_ruleset_var_name(int act);
720
721const char *action_target_kind_ruleset_var_name(int act);
722const char *action_target_kind_help(enum action_target_kind kind);
723
725
726const char *action_blocked_by_ruleset_var_name(const struct action *act);
727
728const char *
730
732
733struct action_enabler_list *
735
738struct action_enabler *
739action_enabler_copy(const struct action_enabler *original);
742
743struct req_vec_problem *
745struct req_vec_problem *
747struct req_vec_problem *
749
752 const struct requirement_vector *vec);
753struct requirement_vector *
757
759 const struct unit_type *act_utype);
761
762struct action *action_is_blocked_by(const struct civ_map *nmap,
763 const struct action *act,
764 const struct unit *actor_unit,
765 const struct tile *target_tile,
766 const struct city *target_city,
767 const struct unit *target_unit);
768
771 const struct unit *actor_unit,
772 const struct city *target_city);
773
776 const struct unit *actor_unit,
777 const struct unit *target_unit);
778
781 const struct unit *actor_unit,
782 const struct tile *target_tile);
783
786 const struct unit *actor_unit,
787 const struct tile *target_tile,
788 const struct extra_type *target_extra);
789
792 const struct unit *actor_unit,
793 const struct tile *target,
794 const struct extra_type *tgt_extra);
795
798 const struct unit *actor_unit);
799
801 const struct unit *actor,
802 const action_id act_id,
803 const struct city *victim);
804
806 const struct unit *actor,
807 const action_id act_id,
808 const struct unit *victim);
809
811 const struct unit* actor,
812 const action_id act_id,
813 const struct tile* victims);
814
816 const struct unit *actor,
817 const action_id act_id,
818 const struct tile *victims,
819 const struct extra_type *target_extra);
820
822 const struct unit *actor,
823 const action_id act_id,
824 const struct tile *target,
825 const struct extra_type *tgt_extra);
826
828 const struct unit *actor,
829 const action_id act_id);
830
832 const struct action *paction,
833 const struct unit *act_unit,
834 const struct city *tgt_city,
835 const struct unit *tgt_unit,
836 const struct tile *tgt_tile,
837 const struct extra_type *sub_tgt);
838
839struct act_prob
841 action_id act_id,
842 const struct unit *actor,
843 const struct city *actor_home,
844 const struct tile *actor_tile,
845 bool omniscient_cheat,
846 const struct city* target);
847
848struct act_prob
850 action_id act_id,
851 const struct unit *actor,
852 const struct city *actor_home,
853 const struct tile *actor_tile,
854 bool omniscient_cheat,
855 const struct unit *target);
856
857struct act_prob
859 action_id act_id,
860 const struct unit *actor,
861 const struct city *actor_home,
862 const struct tile *actor_tile,
863 bool omniscient_cheat,
864 const struct tile *target);
865
866struct act_prob
868 action_id act_id,
869 const struct unit *actor,
870 const struct city *actor_home,
871 const struct tile *actor_tile,
872 bool omniscient_cheat,
873 const struct tile *target_tile,
874 const struct extra_type *target_extra);
875
876struct act_prob
878 action_id act_id,
879 const struct unit *actor,
880 const struct city *actor_home,
881 const struct tile *actor_tile,
882 bool omniscient_cheat,
883 const struct tile *target_tile,
884 const struct extra_type *target_extra);
885
886struct act_prob
888 action_id act_id,
889 const struct unit *actor,
890 const struct city *actor_home,
891 const struct tile *actor_tile,
892 bool omniscient_cheat);
893
894bool action_prob_possible(const struct act_prob probability);
895
896bool action_prob_certain(const struct act_prob probability);
897
899 const struct act_prob *ap2);
900
901int action_prob_cmp_pessimist(const struct act_prob ap1,
902 const struct act_prob ap2);
903
904double action_prob_to_0_to_1_pessimist(const struct act_prob ap);
905
907 const struct act_prob *ap2);
908
910 const struct act_prob *ap2);
911
912const char *action_prob_explain(const struct act_prob prob);
913
919
920/* Special action probability values. Documented in fc_types.h's
921 * definition of struct act_prob. */
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()
927
928/* ACTION_ODDS_PCT_DICE_ROLL_NA must be above 100%. */
929#define ACTION_ODDS_PCT_DICE_ROLL_NA 110
931int action_dice_roll_odds(const struct player *act_player,
932 const struct unit *act_unit,
933 const struct city *tgt_city,
934 const struct player *tgt_player,
935 const struct action *paction);
936
937bool
938action_actor_utype_hard_reqs_ok(const struct action *result,
939 const struct unit_type *actor_unittype);
940
941/* Reasoning about actions */
942bool action_univs_not_blocking(const struct action *paction,
943 struct universal *actor_uni,
944 struct universal *target_uni);
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)
947
948bool action_immune_government(struct government *gov, action_id act);
949
951 const struct player *actor_player,
952 const struct city *target_city);
953
956 const struct unit *actor_unit);
957
958bool action_mp_full_makes_legal(const struct unit *actor,
959 const action_id act_id);
960
961bool action_is_in_use(struct action *paction);
962
963/* Action lists */
966 int *position,
967 enum action_result result);
968
969/* Action auto performers */
970const struct action_auto_perf *action_auto_perf_by_number(const int num);
972
973#ifdef __cplusplus
974}
975#endif /* __cplusplus */
976
977#endif /* FC_ACTIONS_H */
bool is_action_possible_on_city(action_id act_id, const struct player *actor_player, const struct city *target_city)
Definition actions.c:6214
const char * action_prepare_ui_name(action_id act_id, const char *mnemonic, const struct act_prob prob, const char *custom)
Definition actions.c:2073
const char * action_name_translation(const struct action *action)
Definition actions.c:1991
bool action_distance_inside_max(const struct action *action, const int distance)
Definition actions.c:1934
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)
Definition actions.c:5709
const char * action_prob_explain(const struct act_prob prob)
Definition actions.c:2184
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)
Definition actions.c:5259
bool action_mp_full_makes_legal(const struct unit *actor, const action_id act_id)
Definition actions.c:6292
enum action_actor_kind action_get_actor_kind(const struct action *paction)
Definition actions.c:1859
bool action_prob_certain(const struct act_prob probability)
Definition actions.c:5831
const char * action_id_name_translation(action_id act_id)
Definition actions.c:2011
struct action_auto_perf * action_auto_perf_slot_number(const int num)
Definition actions.c:6421
req_vec_num_in_item action_enabler_vector_number(const void *enabler, const struct requirement_vector *vec)
Definition actions.c:2809
bool action_has_complex_target(const struct action *paction)
Definition actions.c:1893
struct req_vec_problem * action_enabler_suggest_repair(const struct action_enabler *enabler)
Definition actions.c:2679
bool action_prob_possible(const struct act_prob probability)
Definition actions.c:5821
struct act_prob action_prob_new_not_impl(void)
Definition actions.c:5800
struct req_vec_problem * action_enabler_suggest_improvement(const struct action_enabler *enabler)
Definition actions.c:2745
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)
Definition actions.c:5642
void actions_rs_pre_san_gen(void)
Definition actions.c:1654
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)
Definition actions.c:5517
const char * action_min_range_ruleset_var_name(int act)
Definition actions.c:7116
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)
Definition actions.c:5743
const char * action_blocked_by_ruleset_var_name(const struct action *act)
Definition actions.c:7757
struct req_vec_problem * action_enabler_suggest_repair_oblig(const struct action_enabler *enabler)
Definition actions.c:2439
void action_array_add_all_by_result(action_id *act_array, int *position, enum action_result result)
Definition actions.c:6486
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)
Definition actions.c:6121
void action_array_end(action_id *act_array, int size)
Definition actions.c:6469
static struct action * action_by_number(action_id act_id)
Definition actions.h:635
bool action_maybe_possible_actor_unit(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit)
Definition actions.c:6237
bool action_is_in_use(struct action *paction)
Definition actions.c:6398
bool action_ever_possible(action_id action)
Definition actions.c:8092
const char * action_enabler_vector_by_number_name(req_vec_num_in_item vec)
Definition actions.c:2856
bool are_action_probabilitys_equal(const struct act_prob *ap1, const struct act_prob *ap2)
Definition actions.c:5872
const char * action_post_success_forced_ruleset_var_name(const struct action *act)
Definition actions.c:7933
struct action * action_by_rule_name(const char *name)
Definition actions.c:1840
const char * action_rule_name(const struct action *action)
Definition actions.c:1977
const char * action_id_rule_name(action_id act_id)
Definition actions.c:2000
enum action_sub_target_kind action_get_sub_target_kind(const struct action *paction)
Definition actions.c:1880
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)
Definition actions.c:3036
void actions_free(void)
Definition actions.c:1664
void action_enabler_free(struct action_enabler *enabler)
Definition actions.c:2255
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)
Definition actions.c:4006
struct action_list * action_list_by_activity(enum unit_activity activity)
Definition actions.c:8145
int action_number(const struct action *action)
Definition actions.c:1969
struct act_prob action_prob_new_unknown(void)
Definition actions.c:5810
bool action_would_be_blocked_by(const struct action *blocked, const struct action *blocker)
Definition actions.c:1957
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)
Definition actions.c:4082
struct act_prob action_prob_and(const struct act_prob *ap1, const struct act_prob *ap2)
Definition actions.c:5959
const char * action_actor_consuming_always_ruleset_var_name(action_id act)
Definition actions.c:7600
bool action_immune_government(struct government *gov, action_id act)
Definition actions.c:6173
struct act_prob action_prob_new_certain(void)
Definition actions.c:5780
const char * action_max_range_ruleset_var_name(int act)
Definition actions.c:7276
int action_dice_roll_initial_odds(const struct action *paction)
Definition actions.c:6097
struct act_prob action_prob_fall_back(const struct act_prob *ap1, const struct act_prob *ap2)
Definition actions.c:6029
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)
Definition actions.c:3841
struct act_prob action_prob_self(const struct civ_map *nmap, const struct unit *actor, const action_id act_id)
Definition actions.c:5495
struct action_list * action_list_by_result(enum action_result result)
Definition actions.c:8135
#define MAX_NUM_ACTIONS
Definition actions.h:314
bool action_univs_not_blocking(const struct action *paction, struct universal *actor_uni, struct universal *target_uni)
Definition actions.c:6445
bool actions_are_ready(void)
Definition actions.c:1717
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)
Definition actions.c:3918
bool action_actor_utype_hard_reqs_ok(const struct action *result, const struct unit_type *actor_unittype)
Definition actions.c:3356
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)
Definition actions.c:5675
const char * action_target_kind_ruleset_var_name(int act)
Definition actions.c:7445
void action_enabler_add(struct action_enabler *enabler)
Definition actions.c:2282
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)
Definition actions.c:5342
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)
Definition actions.c:5067
const char * action_ui_name_default(int act)
Definition actions.c:6773
bool action_enabler_utype_possible_actor(const struct action_enabler *ae, const struct unit_type *act_utype)
Definition actions.c:6315
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)
Definition actions.c:5574
struct action_enabler * action_enabler_new(void)
Definition actions.c:2236
bool action_requires_details(const struct action *paction)
Definition actions.c:1906
struct act_prob action_prob_new_not_relevant(void)
Definition actions.c:5790
const char * action_target_kind_help(enum action_target_kind kind)
Definition actions.c:8125
int action_get_role(const struct action *paction)
Definition actions.c:2224
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)
Definition actions.c:4984
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)
Definition actions.c:5609
const struct action_auto_perf * action_auto_perf_by_number(const int num)
Definition actions.c:6437
struct act_prob action_prob_new_impossible(void)
Definition actions.c:5770
bool action_enabler_possible_actor(const struct action_enabler *ae)
Definition actions.c:6342
struct action ** _actions
Definition actions.c:98
bool action_id_exists(const action_id act_id)
Definition actions.c:1829
bool action_enabler_remove(struct action_enabler *enabler)
Definition actions.c:2299
enum action_target_kind action_get_target_kind(const struct action *paction)
Definition actions.c:1869
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)
Definition actions.c:5425
struct action_enabler * action_enabler_copy(const struct action_enabler *original)
Definition actions.c:2267
int action_prob_cmp_pessimist(const struct act_prob ap1, const struct act_prob ap2)
Definition actions.c:5881
bool is_action_enabled_unit_on_self(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit)
Definition actions.c:4231
bool action_id_is_rare_pop_up(action_id act_id)
Definition actions.c:1921
void actions_init(void)
Definition actions.c:1594
struct requirement_vector * action_enabler_vector_by_number(const void *enabler, req_vec_num_in_item vec)
Definition actions.c:2832
double action_prob_to_0_to_1_pessimist(const struct act_prob ap)
Definition actions.c:5932
const char * gen_action_name_update_cb(const char *old_name)
Definition actions.c:8100
struct action_enabler_list * action_enablers_for_action(action_id action)
Definition actions.c:2315
bool action_distance_accepted(const struct action *action, const int distance)
Definition actions.c:1945
const char * action_ui_name_ruleset_var_name(int act)
Definition actions.c:6506
const char * action_get_ui_name_mnemonic(action_id act_id, const char *mnemonic)
Definition actions.c:2019
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)
Definition actions.c:4159
char * incite_cost
Definition comments.c:75
struct unit struct city struct unit * target_unit
Definition dialogs_g.h:56
struct unit * actor_unit
Definition dialogs_g.h:55
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit * actor
Definition dialogs_g.h:73
struct unit struct city struct unit struct tile * target_tile
Definition dialogs_g.h:57
struct unit struct city * target_city
Definition dialogs_g.h:56
struct unit struct city struct unit struct tile struct extra_type * target_extra
Definition dialogs_g.h:57
int action_id
Definition fc_types.h:389
#define MAX_LEN_NAME
Definition fc_types.h:66
const char * name
Definition inputfile.c:127
signed char req_vec_num_in_item
req_vec_num_in_item a requirement vectors number in an item.
size_t size
Definition specvec.h:72
struct requirement_vector reqs
Definition actions.h:567
enum action_auto_perf_cause cause
Definition actions.h:563
action_id alternatives[MAX_NUM_ACTIONS]
Definition actions.h:571
bool ruledit_disabled
Definition actions.h:428
action_id action
Definition actions.h:422
struct requirement_vector actor_reqs
Definition actions.h:423
struct requirement_vector target_reqs
Definition actions.h:424
bool unitwaittime_controlled
Definition actions.h:411
action_id id
Definition actions.h:363
bool actor_consuming_always
Definition actions.h:395
bool rare_pop_up
Definition actions.h:408
int max_distance
Definition actions.h:378
bool quiet
Definition actions.h:385
enum action_sub_target_kind sub_target_kind
Definition actions.h:370
enum moves_actor_kind moves_actor
Definition actions.h:415
struct action::@12::@13 is_unit
enum action_result result
Definition actions.h:365
char ui_name[MAX_LEN_NAME]
Definition actions.h:381
bv_action_sub_results sub_results
Definition actions.h:366
enum action_actor_kind actor_kind
Definition actions.h:368
enum act_tgt_compl target_complexity
Definition actions.h:373
bv_actions blocked_by
Definition actions.h:389
union action::@12 actor
enum action_target_kind target_kind
Definition actions.h:369
int min_distance
Definition actions.h:378
Definition city.h:320
Definition tile.h:50
Definition unit.h:138