Freeciv-3.3
|
Go to the source code of this file.
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 1936 of file unithand.c.
Referenced by dai_do_build_city().
Create a trade route between cities. No checks - callers should have made sure that the route can be added already.
Definition at line 6373 of file unithand.c.
Referenced by api_edit_create_trade_route(), and do_unit_establish_trade().
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 2515 of file unithand.c.
Referenced by execute_orders(), handle_city_name_suggestion_req(), and illegal_action().
bool unit_activity_handling | ( | struct unit * | punit, |
enum unit_activity | new_activity, | ||
enum gen_action | trigger_action | ||
) |
Handle request for changing activity.
Definition at line 6663 of file unithand.c.
Referenced by adv_follow_path(), adv_unit_move(), auto_worker_setup_work(), auto_workers_player(), 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(), terrain_change_bounce_single_unit(), 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, | ||
enum gen_action | trigger_action | ||
) |
Handle request for targeted activity.
Definition at line 6735 of file unithand.c.
Referenced by adv_follow_path(), auto_worker_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 4072 of file unithand.c.
Referenced by do_unit_change_homecity(), do_unit_make_homeless(), 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 3338 of file unithand.c.
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(), unit_activity_handling_targeted(), and unleash_barbarians().
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.
'move_do_not_act' is a 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.
Definition at line 5715 of file unithand.c.
Referenced by execute_orders().
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 3358 of file unithand.c.
Referenced by api_edit_perform_action_unit_vs_city(), api_edit_perform_action_unit_vs_city_impr(), api_edit_perform_action_unit_vs_city_tech(), api_edit_perform_action_unit_vs_self(), api_edit_perform_action_unit_vs_tile(), api_edit_perform_action_unit_vs_tile_extra(), api_edit_perform_action_unit_vs_unit(), dai_manage_paratrooper(), execute_orders(), handle_unit_do_action(), handle_unit_type_upgrade(), random_movements(), unit_do_action(), unit_do_disband_trad(), and unit_move_handling().
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 6562 of file unithand.c.
Referenced by dai_manage_settler(), and handle_unit_server_side_agent_set().