Functions | |
int | unit::total_movement () const |
The maximum moves this unit has. More... | |
void | unit::set_total_movement (int value) |
int | unit::movement_left () const |
Gets how far a unit can move, considering the incapacitated flag. More... | |
int | unit::movement_left (bool base_value) const |
Gets how far a unit can move. More... | |
void | unit::set_movement (int moves, bool unit_action=false) |
Set this unit's remaining movement to moves. More... | |
bool | unit::has_moved () const |
Checks if this unit has moved. More... | |
void | unit::remove_movement_ai () |
Sets the unit to have no moves left for this turn. More... | |
bool | unit::resting () const |
Checks whether this unit is 'resting'. More... | |
void | unit::set_resting (bool rest) |
Sets this unit's resting status. More... | |
bool | unit::emits_zoc () const |
Tests whether the unit has a zone-of-control, considering incapacitated. More... | |
bool | unit::get_emit_zoc () const |
Gets the raw zone-of-control flag, disregarding incapacitated. More... | |
void | unit::set_emit_zoc (bool val) |
Sets the raw zone-of-control flag. More... | |
const map_location & | unit::get_location () const |
The current map location this unit is at. More... | |
void | unit::set_location (const map_location &loc) |
Sets this unit's map location. More... | |
map_location::direction | unit::facing () const |
The current direction this unit is facing within its hex. More... | |
void | unit::set_facing (map_location::direction dir) const |
The this unit's facing. More... | |
bool | unit::has_goto () const |
Gets whether this unit has a multi-turn destination set. More... | |
const map_location & | unit::get_goto () const |
The map location to which this unit is moving over multiple turns, if any. More... | |
void | unit::set_goto (const map_location &new_goto) |
Sets this unit's long term destination. More... | |
int | unit::vision () const |
Gets the unit's vision points. More... | |
int | unit::jamming () const |
Gets the unit's jamming points. More... | |
bool | unit::move_interrupted () const |
Check whether the unit's move has been interrupted. More... | |
const map_location & | unit::get_interrupted_move () const |
Get the target location of the unit's interrupted move. More... | |
void | unit::set_interrupted_move (const map_location &interrupted_move) |
Set the target location of the unit's interrupted move. More... | |
const movetype & | unit::movement_type () const |
Get the unit's movement type. More... | |
int | unit::movement_cost (const t_translation::terrain_code &terrain) const |
Get the unit's movement cost on a particular terrain. More... | |
int | unit::vision_cost (const t_translation::terrain_code &terrain) const |
Get the unit's vision cost on a particular terrain. More... | |
int | unit::jamming_cost (const t_translation::terrain_code &terrain) const |
Get the unit's jamming cost on a particular terrain. More... | |
bool | unit::is_flying () const |
Check if the unit is a flying unit. More... | |
|
inline |
Tests whether the unit has a zone-of-control, considering incapacitated.
Definition at line 1385 of file unit.hpp.
References unit::emit_zoc_, and unit::incapacitated().
Referenced by unit_drawer::draw_ellipses(), and pathfind::enemy_zoc().
|
inline |
The current direction this unit is facing within its hex.
Definition at line 1420 of file unit.hpp.
References unit::facing_.
Referenced by wfl::unit_callable::get_value(), unit_drawer::redraw_unit(), editor::map_context::to_config(), and UNIT_GETTER().
|
inline |
Gets the raw zone-of-control flag, disregarding incapacitated.
Definition at line 1391 of file unit.hpp.
References unit::emit_zoc_.
Referenced by wfl::unit_callable::get_value(), and UNIT_GETTER().
|
inline |
The map location to which this unit is moving over multiple turns, if any.
Definition at line 1435 of file unit.hpp.
References unit::goto_.
Referenced by events::menu_handler::execute_gotos(), unit::has_goto(), and UNIT_GETTER().
|
inline |
Get the target location of the unit's interrupted move.
Definition at line 1465 of file unit.hpp.
References unit::interrupted_move_.
|
inline |
The current map location this unit is at.
Definition at line 1404 of file unit.hpp.
References unit::loc_.
Referenced by actions::actor_sighted(), pathfind::full_cost_map::add_unit(), gui2::dialogs::add_unit_entry(), game_state::can_recruit_from(), game_state::can_recruit_on(), can_see(), ai::cfun_ai_get_suitable_keep(), actions::shroud_clearer::clear_dest(), actions::shroud_clearer::clear_unit(), wfl::attack_map_callable::collect_possible_attacks(), unit_drawer::draw_ellipses(), ai::ai_default_rca::move_leader_to_goals_phase::evaluate(), ai::ai_default_rca::move_leader_to_keep_phase::evaluate(), events::menu_handler::execute_gotos(), wb::find_backup_leader(), pathfind::find_vacant_castle(), terrain_filter::get_locs_impl(), events::mouse_handler::get_route(), wb::ghost_owner_unit(), impl_add_animation(), impl_unit_tostring(), intf_advance_unit(), game_lua_kernel::intf_erase_unit(), game_lua_kernel::intf_find_path(), game_lua_kernel::intf_find_vision_range(), game_lua_kernel::intf_match_unit(), game_lua_kernel::intf_put_unit(), intf_unit_resistance(), unit::invisible(), unit::is_visible_to_team(), luaW_pushfaivariant(), terrain_filter::match_impl(), unit_filter::matches(), unit_filter_impl::unit_filter_compound::matches(), events::mouse_handler::move_action(), pathfind::paths::paths(), gui2::dialogs::unit_list::pre_show(), unit_drawer::redraw_unit(), REPORT_GENERATOR(), events::mouse_handler::select_hex(), gui2::dialogs::attack_predictions::set_data(), ai::move_result::test_route(), editor::map_context::to_config(), wb::unghost_owner_unit(), display_context::unit_can_move(), UNIT_GETTER(), unit_display::unit_healing(), unit_weapons(), ai::default_recruitment::recruitment::update_important_hexes(), and playsingle_controller::hotkey_handler::whiteboard_suppose_dead().
|
inline |
Gets whether this unit has a multi-turn destination set.
Definition at line 1429 of file unit.hpp.
References unit::get_goto(), and map_location::valid().
Referenced by display_context::unit_can_move().
|
inline |
Checks if this unit has moved.
Definition at line 1359 of file unit.hpp.
References unit::movement_left(), and unit::total_movement().
Referenced by display_context::unit_can_move().
|
inline |
Check if the unit is a flying unit.
Definition at line 1513 of file unit.hpp.
References movetype::is_flying(), and unit::movement_type_.
Referenced by wfl::unit_callable::get_value(), unit_drawer::redraw_unit(), and UNIT_GETTER().
|
inline |
Gets the unit's jamming points.
Definition at line 1453 of file unit.hpp.
References unit::jamming_.
Referenced by pathfind::jamming_path::jamming_path(), UNIT_GETTER(), and unit_vision().
|
inline |
Get the unit's jamming cost on a particular terrain.
terrain | The terrain to check |
Definition at line 1507 of file unit.hpp.
References unit::get_state(), movetype::jamming_cost(), unit::movement_type_, and unit::STATE_SLOWED.
Referenced by wfl::gamestate::DEFINE_WFL_FUNCTION(), and intf_unit_jamming_cost().
|
inline |
Check whether the unit's move has been interrupted.
Definition at line 1459 of file unit.hpp.
References unit::interrupted_move_, unit::movement_left(), map_location::x, and map_location::y.
|
inline |
Get the unit's movement cost on a particular terrain.
terrain | The terrain to check |
Definition at line 1487 of file unit.hpp.
References unit::get_state(), movetype::movement_cost(), unit::movement_type_, and unit::STATE_SLOWED.
Referenced by pathfind::shortest_path_calculator::cost(), pathfind::emergency_path_calculator::cost(), ai::ai_default_rca::move_cost_calculator::cost(), wfl::gamestate::DEFINE_WFL_FUNCTION(), ai::ai_default_rca::move_leader_to_keep_phase::evaluate(), pathfind::find_vacant_tile(), intf_unit_movement_cost(), pathfind::mark_route(), wb::path_cost(), REPORT_GENERATOR(), display_context::unit_can_move(), and unit_moves().
|
inline |
Gets how far a unit can move, considering the incapacitated
flag.
Definition at line 1329 of file unit.hpp.
References unit::incapacitated(), and unit::movement_.
Referenced by pathfind::full_cost_map::add_unit(), wb::attack::apply_temp_modifier(), wb::move::apply_temp_modifier(), wb::move::calculate_moves_left(), events::menu_handler::execute_gotos(), wfl::unit_callable::get_value(), unit::has_moved(), pathfind::mark_route(), unit::move_interrupted(), unit::movement_left(), pathfind::paths::paths(), unit::remove_movement_ai(), wb::attack::remove_temp_modifier(), wb::move::remove_temp_modifier(), gui2::unit_preview_pane::set_display_data(), ai::move_result::test_route(), display_context::unit_can_move(), UNIT_GETTER(), unit_moves(), and display_context::unit_orb_status().
|
inline |
Gets how far a unit can move.
base_value | If false, consider the incapacitated flag. |
Definition at line 1341 of file unit.hpp.
References unit::movement_, and unit::movement_left().
|
inline |
Get the unit's movement type.
Definition at line 1477 of file unit.hpp.
References unit::movement_type_.
Referenced by pathfind::full_cost_map::add_unit(), actions::shroud_clearer::clear_unit(), wfl::unit_callable::get_value(), pathfind::jamming_path::jamming_path(), pathfind::paths::paths(), unit::unit_special_notes(), and pathfind::vision_path::vision_path().
void unit::remove_movement_ai | ( | ) |
Sets the unit to have no moves left for this turn.
Definition at line 2768 of file unit.cpp.
References unit::movement_left(), unit::set_movement(), unit::set_state(), unit::STATE_NOT_MOVED, and unit::total_movement().
|
inline |
Checks whether this unit is 'resting'.
Resting refers to whether this unit has not moved yet this turn. Note that this can be true even if movement_left is not equal to total_movement.
Definition at line 1373 of file unit.hpp.
References unit::resting_.
Referenced by wfl::unit_callable::get_value(), and UNIT_GETTER().
|
inline |
Sets the raw zone-of-control flag.
Definition at line 1397 of file unit.hpp.
References unit::emit_zoc_, unit::set_attr_changed(), and unit::UA_ZOC.
Referenced by unit::init(), and UNIT_SETTER().
void unit::set_facing | ( | map_location::direction | dir | ) | const |
The this unit's facing.
Definition at line 1682 of file unit.cpp.
References unit::appearance_changed_, unit::facing_, and map_location::indeterminate.
Referenced by unit_display::unit_attack(), unit_display::unit_draw_weapon(), and UNIT_SETTER().
|
inline |
Sets this unit's long term destination.
Definition at line 1441 of file unit.hpp.
References unit::goto_.
Referenced by events::mouse_handler::attack_enemy_(), events::menu_handler::execute_gotos(), events::mouse_handler::move_action(), and UNIT_SETTER().
|
inline |
Set the target location of the unit's interrupted move.
Definition at line 1471 of file unit.hpp.
References unit::interrupted_move_.
Referenced by unit::end_turn().
|
inline |
Sets this unit's map location.
Note this should only be called by unit_map or for temporary units.
Definition at line 1414 of file unit.hpp.
References loc, and unit::loc_.
void unit::set_movement | ( | int | moves, |
bool | unit_action = false |
||
) |
Set this unit's remaining movement to moves.
This does not affect maximum movement.
moves | The new number of moves |
unit_action | If to true, the "end turn" and "hold position" flags will be cleared (as they should be if a unit acts, as opposed to the movement being set by the engine for other reasons). |
Definition at line 1256 of file unit.cpp.
References unit::end_turn_, unit::hold_position_, and unit::movement_.
Referenced by wb::attack::apply_temp_modifier(), wb::mapbuilder::process(), unit::remove_movement_ai(), wb::attack::remove_temp_modifier(), unit_movement_resetter::unit_movement_resetter(), UNIT_SETTER(), and unit_movement_resetter::~unit_movement_resetter().
|
inline |
Sets this unit's resting status.
Definition at line 1379 of file unit.hpp.
References unit::resting_.
Referenced by UNIT_SETTER().
|
inline |
Definition at line 1318 of file unit.hpp.
References unit::max_movement_, unit::set_attr_changed(), and unit::UA_MAX_MP.
Referenced by unit::apply_builtin_effect(), unit::init(), and UNIT_SETTER().
|
inline |
The maximum moves this unit has.
Definition at line 1313 of file unit.hpp.
References unit::max_movement_.
Referenced by pathfind::full_cost_map::add_unit(), unit::end_turn(), ai::default_recruitment::recruitment::get_cost_map_of_side(), ai::default_recruitment::recruitment::get_unit_ratio(), wfl::unit_callable::get_value(), unit::has_moved(), pathfind::mark_route(), unit::new_turn(), wb::path_cost(), pathfind::paths::paths(), wb::mapbuilder::process(), unit::remove_movement_ai(), gui2::unit_preview_pane::set_display_data(), UNIT_GETTER(), unit_movement_resetter::unit_movement_resetter(), unit_moves(), display_context::unit_orb_status(), unit_vision(), and ai::default_recruitment::recruitment::update_own_units_count().
|
inline |
Gets the unit's vision points.
Definition at line 1447 of file unit.hpp.
References unit::max_movement_, and unit::vision_.
Referenced by actions::shroud_clearer::clear_unit(), UNIT_GETTER(), unit_vision(), and pathfind::vision_path::vision_path().
|
inline |
Get the unit's vision cost on a particular terrain.
terrain | The terrain to check |
Definition at line 1497 of file unit.hpp.
References unit::get_state(), unit::movement_type_, unit::STATE_SLOWED, and movetype::vision_cost().
Referenced by wfl::gamestate::DEFINE_WFL_FUNCTION(), and intf_unit_vision_cost().