![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
Include dependency graph for unithand.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Functions | |
| bool | unit_activity_handling (struct unit *punit, enum unit_activity new_activity) |
| Handle request for changing activity. More... | |
| bool | unit_activity_handling_targeted (struct unit *punit, enum unit_activity new_activity, struct extra_type **new_target) |
| Handle request for targeted activity. More... | |
| void | unit_change_homecity_handling (struct unit *punit, struct city *new_pcity, bool rehome) |
| Transfer a unit from one city (and possibly player) to another. More... | |
| bool | unit_move_handling (struct unit *punit, struct tile *pdesttile, bool igzoc, bool move_diplomat_city) |
| Will try to move to/attack the tile dest_x,dest_y. More... | |
| void | unit_do_action (struct player *pplayer, const int actor_id, const int target_id, const int sub_tgt_id, const char *name, const action_id action_type) |
| Handle unit action. More... | |
| bool | unit_perform_action (struct player *pplayer, const int actor_id, const int target_id, const int sub_tgt_id, const char *name, const action_id action_type, const enum action_requester requester) |
| Execute a request to perform an action and let the caller know if it was performed or not. More... | |
| void | illegal_action_msg (struct player *pplayer, const enum event_type event, struct unit *actor, const action_id stopped_action, const struct tile *target_tile, const struct city *target_city, const struct unit *target_unit) |
| Try to explain to the player why an action is illegal. More... | |
| enum ane_kind | action_not_enabled_reason (struct unit *punit, action_id act_id, const struct tile *target_tile, const struct city *target_city, const struct unit *target_unit) |
| Give the reason kind why an action isn't enabled. More... | |
| bool | unit_server_side_agent_set (struct player *pplayer, struct unit *punit, enum server_side_agent agent) |
| Change controlling server side agent. More... | |
| enum ane_kind action_not_enabled_reason | ( | struct unit * | punit, |
| action_id | act_id, | ||
| const struct tile * | target_tile, | ||
| const struct city * | target_city, | ||
| const struct unit * | target_unit | ||
| ) |
Give the reason kind why an action isn't enabled.
Definition at line 1046 of file unithand.cpp.
Referenced by dai_do_build_city().
| void illegal_action_msg | ( | struct player * | pplayer, |
| const enum event_type | event, | ||
| struct unit * | actor, | ||
| const action_id | stopped_action, | ||
| const struct tile * | target_tile, | ||
| const struct city * | target_city, | ||
| const struct unit * | target_unit | ||
| ) |
Try to explain to the player why an action is illegal.
Event type should be E_BAD_COMMAND if the player should know that the action is illegal or E_UNIT_ILLEGAL_ACTION if new information potentially is being revealed to the player.
Definition at line 2003 of file unithand.cpp.
Referenced by execute_orders(), handle_city_name_suggestion_req(), and illegal_action().
| bool unit_activity_handling | ( | struct unit * | punit, |
| enum unit_activity | new_activity | ||
| ) |
Handle request for changing activity.
Definition at line 5485 of file unithand.cpp.
Referenced by adv_follow_path(), adv_unit_move(), auto_settler_setup_work(), auto_settlers_player(), bounce_unit(), create_city(), dai_auto_settler_cont(), dai_diplomat_city(), dai_do_build_city(), dai_manage_airunit(), dai_manage_barbarian_leader(), dai_manage_military(), dai_military_attack(), dai_military_findjob(), dai_unit_attack(), dai_unit_bodyguard_move(), dai_unit_move(), dai_unit_new_task(), do_explore(), handle_unit_orders(), player_restore_units(), remove_city(), unit_activity_handling_targeted(), unit_activity_targeted_internal(), and unit_survive_autoattack().
| bool unit_activity_handling_targeted | ( | struct unit * | punit, |
| enum unit_activity | new_activity, | ||
| struct extra_type ** | new_target | ||
| ) |
Handle request for targeted activity.
Definition at line 5551 of file unithand.cpp.
Referenced by adv_follow_path(), auto_settler_setup_work(), handle_unit_change_activity_real(), and unit_activity_handling().
Transfer a unit from one city (and possibly player) to another.
If 'rehome' is not set, only change the player which owns the unit (the new owner is new_pcity's owner). Otherwise the new unit will be given a homecity, even if it was homeless before. This new homecity must be valid for this unit.
Definition at line 3239 of file unithand.cpp.
Referenced by do_unit_change_homecity(), and transfer_unit().
| void unit_do_action | ( | struct player * | pplayer, |
| const int | actor_id, | ||
| const int | target_id, | ||
| const int | sub_tgt_id, | ||
| const char * | name, | ||
| const action_id | action_type | ||
| ) |
Handle unit action.
action_type must be a valid action.
Definition at line 2718 of file unithand.cpp.
Referenced by adv_unit_move(), dai_airlift(), dai_caravan_goto(), dai_diplomat_bribe_nearby(), dai_diplomat_city(), dai_do_build_city(), dai_hunter_try_launch(), dai_unit_attack(), dai_unit_make_homecity(), dai_unit_move(), dai_upgrade_units(), and unleash_barbarians().
| bool unit_move_handling | ( | struct unit * | punit, |
| struct tile * | pdesttile, | ||
| bool | igzoc, | ||
| bool | move_do_not_act | ||
| ) |
Will try to move to/attack the tile dest_x,dest_y.
Returns TRUE if this was done, FALSE if it wasn't for some reason. Even if this returns TRUE, the unit may have died upon arrival to new tile.
'igzoc' means ignore ZOC rules - not necessary for igzoc units etc, but done in some special cases (moving barbarians out of initial hut). Should normally be FALSE.
'move_do_not_act' is another special case which should normally be FALSE. If TRUE any enabler controlled actions punit can perform to pdesttile it self or something located at it will be ignored. If FALSE the system will check if punit can perform any enabler controlled action to pdesttile. If it can the player will be asked to choose what to do. If it can't and punit is unable to move (or perform another non enabler controlled action) to pdesttile the game will try to explain why.
FIXME: This function needs a good cleaning.
Definition at line 4654 of file unithand.cpp.
Referenced by adv_unit_move(), dai_unit_attack(), dai_unit_move(), diplomat_bribe(), execute_orders(), occupy_move(), remove_city(), and unleash_barbarians().
| bool unit_perform_action | ( | struct player * | pplayer, |
| const int | actor_id, | ||
| const int | target_id, | ||
| const int | sub_tgt_id_incoming, | ||
| const char * | name, | ||
| const action_id | action_type, | ||
| const enum action_requester | requester | ||
| ) |
Execute a request to perform an action and let the caller know if it was performed or not.
The action must be a valid action.
Returns TRUE iff action could be done, FALSE if it couldn't. Even if this returns TRUE, unit may have died during the action.
Definition at line 2737 of file unithand.cpp.
Referenced by dai_manage_paratrooper(), diplomat_bribe(), execute_orders(), handle_unit_do_action(), handle_unit_type_upgrade(), occupy_move(), remove_city(), unit_do_action(), and unit_do_disband_trad().
| bool unit_server_side_agent_set | ( | struct player * | pplayer, |
| struct unit * | punit, | ||
| enum server_side_agent | agent | ||
| ) |
Change controlling server side agent.
Definition at line 5386 of file unithand.cpp.
Referenced by dai_manage_settler(), and handle_unit_server_side_agent_set().