1 /***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
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)
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 #ifndef FC__UNITHAND_H
14 #define FC__UNITHAND_H
20 /* A category of reasons why an action isn't enabled. */
22 /* Explanation: wrong actor unit. */
24 /* Explanation: no action target. */
26 /* Explanation: the action is redundant vs this target. */
28 /* Explanation: bad actor terrain. */
30 /* Explanation: bad target terrain. */
32 /* Explanation: being transported. */
34 /* Explanation: not being transported. */
35 ANEK_IS_NOT_TRANSPORTED
,
36 /* Explanation: transports a cargo unit. */
38 /* Explanation: doesn't transport a cargo unit. */
39 ANEK_IS_NOT_TRANSPORTING
,
40 /* Explanation: actor unit has a home city. */
41 ANEK_ACTOR_HAS_HOME_CITY
,
42 /* Explanation: actor unit has no a home city. */
43 ANEK_ACTOR_HAS_NO_HOME_CITY
,
44 /* Explanation: must declare war first. */
46 /* Explanation: can't be done to domestic targets. */
48 /* Explanation: can't be done to foreign targets. */
50 /* Explanation: this nation can't act. */
52 /* Explanation: this nation can't be targeted. */
54 /* Explanation: not enough MP left. */
56 /* Explanation: can't be done to city centers. */
58 /* Explanation: can't be done to non city centers. */
59 ANEK_IS_NOT_CITY_CENTER
,
60 /* Explanation: can't be done to claimed target tiles. */
62 /* Explanation: can't be done to unclaimed target tiles. */
63 ANEK_TGT_IS_UNCLAIMED
,
64 /* Explanation: can't be done because target is too near. */
66 /* Explanation: can't be done because target is too far away. */
68 /* Explanation: can't be done to targets that far from the coast line. */
70 /* Explanation: can't be done because the actor can't exit its
73 /* Explanation: actor can't reach unit at target. */
75 /* Explanation: the action is disabled in this scenario. */
76 ANEK_SCENARIO_DISABLED
,
77 /* Explanation: too close to a city. */
78 ANEK_CITY_TOO_CLOSE_TGT
,
79 /* Explanation: the target city is too big. */
81 /* Explanation: the target city's population limit banned the action. */
83 /* Explanation: the specified city don't have the needed capacity. */
84 ANEK_CITY_NO_CAPACITY
,
85 /* Explanation: the target tile is unknown. */
86 ANEK_TGT_TILE_UNKNOWN
,
87 /* Explanation: the action is blocked by another action. */
89 /* Explanation not detected. */
93 void unit_activity_handling(struct unit
*punit
,
94 enum unit_activity new_activity
);
95 void unit_activity_handling_targeted(struct unit
*punit
,
96 enum unit_activity new_activity
,
97 struct extra_type
**new_target
);
98 void unit_change_homecity_handling(struct unit
*punit
, struct city
*new_pcity
,
101 bool unit_move_handling(struct unit
*punit
, struct tile
*pdesttile
,
102 bool igzoc
, bool move_diplomat_city
,
103 struct unit
*embark_to
);
105 bool unit_perform_action(struct player
*pplayer
,
110 const enum gen_action action_type
,
111 const enum action_requester requester
);
113 void illegal_action_msg(struct player
*pplayer
,
114 const enum event_type event
,
116 const int stopped_action
,
117 const struct tile
*target_tile
,
118 const struct city
*target_city
,
119 const struct unit
*target_unit
);
121 enum ane_kind
action_not_enabled_reason(struct unit
*punit
,
122 enum gen_action action_id
,
123 const struct tile
*target_tile
,
124 const struct city
*target_city
,
125 const struct unit
*target_unit
);
127 #endif /* FC__UNITHAND_H */