#include <unit.hpp>
Classes | |
struct | upkeep_full |
struct | upkeep_loyal |
Public Types | |
enum | state_t { STATE_SLOWED = 0, STATE_POISONED, STATE_PETRIFIED, STATE_UNCOVERED, STATE_NOT_MOVED, STATE_UNHEALABLE, STATE_GUARDIAN, STATE_UNKNOWN = -1 } |
typedef boost::variant < upkeep_full, upkeep_loyal, int > | t_upkeep |
typedef boost::ptr_vector< config > | t_advancements |
Public Member Functions | |
unit (const unit &u) | |
unit (const config &cfg, bool use_traits=false, const vconfig *vcfg=nullptr, n_unit::id_manager *id_manager=nullptr) | |
Initializes a unit from a config. More... | |
unit (const unit_type &t, int side, bool real_unit, unit_race::GENDER gender=unit_race::NUM_GENDERS) | |
Initializes a unit from a unit type only real_unit may have random traits, name and gender (to prevent OOS caused by RNG calls) More... | |
virtual | ~unit () |
void | swap (unit &) |
Swap, for copy and swap idiom. More... | |
unit & | operator= (unit) |
Assignment operator. More... | |
void | advance_to (const unit_type &t, bool use_traits=false) |
Advances this unit to another type. More... | |
const std::vector< std::string > & | advances_to () const |
const std::vector< std::string > | advances_to_translated () const |
void | set_advances_to (const std::vector< std::string > &advances_to) |
const std::string & | type_id () const |
The id of the type of the unit. More... | |
const unit_type & | type () const |
The type of the unit (accounting for gender and variation). More... | |
void | set_id (const std::string &id) |
id assigned by wml More... | |
const std::string & | id () const |
size_t | underlying_id () const |
The unique internal ID of the unit. More... | |
const t_string & | type_name () const |
The unit type name. More... | |
const std::string & | undead_variation () const |
const std::string & | variation () const |
const t_string & | name () const |
The unit name for display. More... | |
void | set_name (const t_string &name) |
void | rename (const std::string &name) |
std::string | small_profile () const |
The unit's profile. More... | |
std::string | big_profile () const |
t_string | unit_description () const |
Information about the unit – a detailed description of it. More... | |
int | hitpoints () const |
int | max_hitpoints () const |
void | set_hitpoints (int hp) |
int | experience () const |
int | max_experience () const |
void | set_experience (int xp) |
void | set_recall_cost (int recall_cost) |
int | level () const |
void | set_level (int level) |
int | recall_cost () const |
void | remove_movement_ai () |
void | remove_attacks_ai () |
SDL_Color | hp_color () const |
Colors for the unit's current hitpoints. More... | |
SDL_Color | hp_color (int hitpoints) const |
Colors for the unit's hitpoints. More... | |
SDL_Color | xp_color () const |
Colors for the unit's XP. More... | |
double | hp_bar_scaling () const |
double | xp_bar_scaling () const |
bool | unrenamable () const |
Set to true for some scenario-specific units which should not be renamed. More... | |
void | set_unrenamable (bool unrenamable) |
int | side () const |
const std::string & | team_color () const |
unit_race::GENDER | gender () const |
void | set_side (unsigned int new_side) |
fixed_t | alpha () const |
bool | can_recruit () const |
void | set_can_recruit (bool canrecruit) |
const std::vector< std::string > & | recruits () const |
void | set_recruits (const std::vector< std::string > &recruits) |
const config & | recall_filter () const |
bool | poisoned () const |
bool | incapacitated () const |
bool | slowed () const |
int | total_movement () const |
int | movement_left () const |
Returns how far a unit can move this turn (zero if incapacitated). More... | |
int | movement_left (bool base_value) const |
Providing a true parameter to movement_left() causes it to ignore incapacitation. More... | |
int | vision () const |
int | jamming () const |
void | toggle_hold_position () |
bool | hold_position () const |
void | set_user_end_turn (bool value=true) |
void | toggle_user_end_turn () |
bool | user_end_turn () const |
int | attacks_left () const |
int | max_attacks () const |
void | set_movement (int moves, bool unit_action=false) |
Set the unit's remaining movement to moves. More... | |
void | set_attacks (int left) |
void | new_turn () |
void | end_turn () |
void | new_scenario () |
bool | take_hit (int damage) |
Called on every draw. More... | |
void | heal (int amount) |
void | heal_all () |
bool | resting () const |
void | set_resting (bool rest) |
const std::map< std::string, std::string > | get_states () const |
bool | get_state (const std::string &state) const |
void | set_state (const std::string &state, bool value) |
void | set_state (state_t state, bool value) |
bool | get_state (state_t state) const |
bool | has_moved () const |
bool | has_goto () const |
bool | emits_zoc () const |
bool | matches_id (const std::string &unit_id) const |
const std::vector< std::string > & | overlays () const |
void | write (config &cfg) const |
void | set_role (const std::string &role) |
const std::string & | get_role () const |
void | set_emit_zoc (bool val) |
bool | get_emit_zoc () const |
const std::vector< attack_type > & | attacks () const |
std::vector< attack_type > & | attacks () |
int | damage_from (const attack_type &attack, bool attacker, const map_location &loc) const |
unit_animation_component & | anim_comp () const |
void | set_facing (map_location::DIRECTION dir) const |
map_location::DIRECTION | facing () const |
const std::vector< t_string > & | trait_names () const |
const std::vector< t_string > & | trait_descriptions () const |
std::vector< std::string > | get_traits_list () const |
int | cost () const |
const map_location & | get_location () const |
void | set_location (const map_location &loc) |
To be called by unit_map or for temporary units only. More... | |
const map_location & | get_goto () const |
void | set_goto (const map_location &new_goto) |
int | upkeep () const |
t_upkeep | upkeep_raw () const |
void | set_upkeep (t_upkeep v) |
bool | loyal () const |
void | set_hidden (bool state) const |
bool | get_hidden () const |
bool | is_flying () const |
bool | is_fearless () const |
bool | is_healthy () const |
int | movement_cost (const t_translation::t_terrain &terrain) const |
int | vision_cost (const t_translation::t_terrain &terrain) const |
int | jamming_cost (const t_translation::t_terrain &terrain) const |
int | defense_modifier (const t_translation::t_terrain &terrain) const |
int | resistance_against (const std::string &damage_name, bool attacker, const map_location &loc) const |
int | resistance_against (const attack_type &damage_type, bool attacker, const map_location &loc) const |
utils::string_map | get_base_resistances () const |
const movetype & | movement_type () const |
bool | can_advance () const |
bool | advances () const |
std::map< std::string, std::string > | advancement_icons () const |
std::vector< std::pair < std::string, std::string > > | amla_icons () const |
std::vector< config > | get_modification_advances () const |
void | set_advancements (std::vector< config > advancements) |
const t_advancements & | modification_advancements () const |
size_t | modification_count (const std::string &type, const std::string &id) const |
void | add_modification (const std::string &type, const config &modification, bool no_add=false) |
void | expire_modifications (const std::string &duration) |
Clears those modifications whose duration has expired. More... | |
void | apply_builtin_effect (std::string type, const config &effect) |
std::string | describe_builtin_effect (std::string type, const config &effect) |
bool | move_interrupted () const |
const map_location & | get_interrupted_move () const |
void | set_interrupted_move (const map_location &interrupted_move) |
std::string | absolute_image () const |
The name of the file to game_display (used in menus). More... | |
std::string | default_anim_image () const |
The default image to use for animation frames with no defined image. More... | |
std::string | image_halo () const |
std::string | image_ellipse () const |
std::string | usage () const |
void | set_image_halo (const std::string &halo) |
void | set_image_ellipse (const std::string &ellipse) |
void | set_usage (const std::string &usage) |
config & | variables () |
const config & | variables () const |
unit_type::ALIGNMENT | alignment () const |
void | set_alignment (unit_type::ALIGNMENT alignment) |
const unit_race * | race () const |
Never returns nullptr, but may point to the null race. More... | |
bool | get_ability_bool (const std::string &tag_name, const map_location &loc) const |
Returns true if the unit is currently under effect by an ability with this given TAG NAME. More... | |
bool | get_ability_bool (const std::string &tag_name) const |
Returns true if the unit is currently under effect by an ability with this given TAG NAME. More... | |
unit_ability_list | get_abilities (const std::string &tag_name, const map_location &loc) const |
unit_ability_list | get_abilities (const std::string &tag_name) const |
std::vector< boost::tuple < t_string, t_string, t_string > > | ability_tooltips (std::vector< bool > *active_list=nullptr) const |
Tuple of: neutral ability name, gendered ability name, description. More... | |
std::vector< std::string > | get_ability_list () const |
bool | has_ability_type (const std::string &ability) const |
unit_formula_manager & | formula_manager () const |
void | backup_state () |
void | apply_modifications () |
void | generate_traits (bool musthaveonly=false) |
Apply mandatory traits (e.g. More... | |
void | generate_name () |
bool | invisible (const map_location &loc, bool see_all=true) const |
bool | is_visible_to_team (team const &team, gamemap const &map, bool const see_all=true) const |
unit & | clone (bool is_temporary=true) |
Mark this unit as clone so it can be inserted to unit_map. More... | |
std::string | TC_image_mods () const |
const std::string & | effect_image_mods () const |
std::string | image_mods () const |
long | ref_count () const |
bool | has_ability_by_id (const std::string &ability) const |
Static Public Member Functions | |
static void | clear_status_caches () |
Clear the unit status cache for all units. More... | |
static const std::string & | leader_crown () |
The path to the leader crown overlay. More... | |
static state_t | get_known_boolean_state_id (const std::string &state) |
static std::map< std::string, state_t > | get_known_boolean_state_names () |
Static Public Attributes | |
static const std::set < std::string > | builtin_effects |
Protected Attributes | |
long | ref_count_ |
map_location::DIRECTION | facing_ |
Private Member Functions | |
bool | ability_active (const std::string &ability, const config &cfg, const map_location &loc) const |
bool | ability_affects_adjacent (const std::string &ability, const config &cfg, int dir, const map_location &loc, const unit &from) const |
bool | ability_affects_self (const std::string &ability, const config &cfg, const map_location &loc) const |
bool | resistance_filter_matches (const config &cfg, bool attacker, const std::string &damage_name, int res) const |
void | remove_ability_by_id (const std::string &ability) |
void | add_trait_description (const config &trait, const t_string &description) |
register a trait's name and its description for UI's use More... | |
void | set_underlying_id (n_unit::id_manager &id_manager) |
void | parse_upkeep (const config::attribute_value &upkeep) |
void | write_upkeep (config::attribute_value &upkeep) const |
void | clear_visibility_cache () const |
Clears the cache. More... | |
Static Private Attributes | |
static std::map< std::string, state_t > | known_boolean_state_names_ = get_known_boolean_state_names() |
Friends | |
class | unit_animation_component |
void | intrusive_ptr_add_ref (const unit *) |
Intrusive Pointer interface. More... | |
void | intrusive_ptr_release (const unit *) |
typedef boost::ptr_vector<config> unit::t_advancements |
typedef boost::variant<upkeep_full, upkeep_loyal, int> unit::t_upkeep |
enum unit::state_t |
unit::unit | ( | const unit & | u | ) |
Definition at line 246 of file unit.cpp.
Referenced by apply_builtin_effect().
|
explicit |
Initializes a unit from a config.
Definition at line 334 of file unit.cpp.
References abilities_, config::add_child(), game_config::add_color_info(), game_events::manager::add_events(), adjust_profile(), advance_to(), advancements_, advances_to_, alignment_, alpha_, config::append(), attacks_, attacks_left_, config::attribute_range(), vconfig::child(), config::child(), config::child_or_empty(), config::child_range(), config::clear(), n_unit::unit_id::create_real(), description_, e, emit_zoc_, events_, experience_, facing_, filter_recall_, unit_type_data::find_race(), formula_man_, resources::game_events, resources::gameboard, generate_name(), generate_name_, config::get(), vconfig::get_children(), vconfig::get_config(), goto_, config::has_child(), hit_points_, level_, max_attacks_, max_experience_, max_hit_points_, max_movement_, movetype::merge(), modifications_, movement_, movement_type_, map_location::NDIRECTIONS, vconfig::null(), unit_race::null_race, overlays_, utils::parenthetical_split(), map_location::parse_direction(), parse_upkeep(), profile_, race_, random_traits_, recall_cost_, resting_, set_image_ellipse(), set_image_halo(), set_recruits(), set_state(), set_underlying_id(), set_usage(), side_, small_profile_, utils::split(), STATE_GUARDIAN, type_, undead_variation_, underlying_id_, unit_types, unit_value_, unrenamable_, validate_side(), variables(), variables_, vision_, map_location::x, and map_location::y.
unit::unit | ( | const unit_type & | t, |
int | side, | ||
bool | real_unit, | ||
unit_race::GENDER | gender = unit_race::NUM_GENDERS |
||
) |
Initializes a unit from a unit type only real_unit may have random traits, name and gender (to prevent OOS caused by RNG calls)
Definition at line 620 of file unit.cpp.
References advance_to(), attacks_left_, resources::gameboard, generate_name(), hit_points_, max_attacks_, max_hit_points_, max_movement_, movement_, set_underlying_id(), and upkeep_.
|
virtual |
Definition at line 708 of file unit.cpp.
References anim_comp_, e, ERR_UT, gui2::event::find(), and itor.
|
private |
Definition at line 309 of file abilities.cpp.
References config::child(), config::child_range(), unit_map::end(), resources::filter_con, unit_map::find(), terrain_filter::flatten(), resources::gameboard, get_adjacent_tiles(), filter_context::get_disp_context(), i, terrain_filter::match(), unit_filter::matches(), map_location::NDIRECTIONS, map_location::parse_directions(), utils::parse_ranges(), side_, resources::teams, display_context::teams(), resources::tod_manager, and resources::units.
Referenced by ability_tooltips(), get_abilities(), and get_ability_bool().
|
private |
Definition at line 383 of file abilities.cpp.
References config::child_range(), resources::filter_con, gui2::event::find(), i, and map_location::parse_directions().
Referenced by get_abilities(), and get_ability_bool().
|
private |
Definition at line 411 of file abilities.cpp.
References config::child(), resources::filter_con, and unit_filter::matches().
Referenced by get_abilities(), and get_ability_bool().
std::vector< boost::tuple< t_string, t_string, t_string > > unit::ability_tooltips | ( | std::vector< bool > * | active_list = nullptr | ) | const |
Tuple of: neutral ability name, gendered ability name, description.
Returns names and descriptions of the unit's abilities.
The returned triples consist of (in order) base name, male or female name as appropriate for the unit, and description.
active_list | If nullptr, then all abilities are forced active. If not null, this vector will be the same length as the returned one and will indicate whether or not the corresponding ability is active. |
Definition at line 261 of file abilities.cpp.
References abilities_, ability_active(), config::all_children_range(), config::attribute_value::blank(), t_string::empty(), gender_, loc_, name(), and config::attribute_value::t_str().
Referenced by dialogs::units_list_preview_pane::get_details(), and unit_abilities().
std::string unit::absolute_image | ( | ) | const |
The name of the file to game_display (used in menus).
Definition at line 2262 of file unit.cpp.
References unit_type::icon(), unit_type::image(), and type().
Referenced by dialogs::advance_unit_dialog(), big_profile(), dialogs::units_list_preview_pane::get_details(), impl_unit_get(), dialogs::recall_dialog(), REPORT_GENERATOR(), gui2::set_attacker_info(), gui2::set_defender_info(), small_profile(), and unit_box_at().
void unit::add_modification | ( | const std::string & | type, |
const config & | modification, | ||
bool | no_add = false |
||
) |
Definition at line 2133 of file unit.cpp.
References config::add_child(), add_trait_description(), apply_builtin_effect(), game_lua_kernel::apply_effect(), builtin_effects, config::child(), config::child_range(), describe_builtin_effect(), t_string::empty(), config::empty(), resources::filter_con, get_state(), i, level_, loc_, resources::lua_kernel, unit_filter::matches(), modifications_, N_, set_state(), STATE_POISONED, and vgettext().
Referenced by apply_modifications(), ai::helper_advance_unit(), and intf_add_modification().
register a trait's name and its description for UI's use
Definition at line 2249 of file unit.cpp.
References t_string::empty(), unit_race::FEMALE, gender_, gender_string(), trait_descriptions_, and trait_names_.
Referenced by add_modification().
Advances this unit to another type.
Advances this unit to the specified type.
Experience is left unchanged. Current hit point total is left unchanged unless it would violate max HP. Assumes gender_ and variation_ are set to their correct values.
Definition at line 904 of file unit.cpp.
References abilities_, unit_type::abilities_cfg(), game_events::manager::add_events(), unit_type::advancements(), advancements_, unit_type::advances_to(), advances_to_, alignment_, unit_type::alpha(), alpha_, anim_comp_, apply_modifications(), unit_type::attacks(), attacks_, unit_type::big_profile(), unit_type::cost(), description_, unit_type::ellipse(), emit_zoc_, unit_type::events(), unit_type::experience_needed(), unit_type::flag_rgb(), flag_rgb_, resources::game_events, gender_, unit_type::generate_name(), generate_name_, generate_traits(), unit_type::get_cfg_for_units(), unit_type::get_gender_unit_type(), get_state(), unit_type::get_variation(), unit_type::halo(), unit_type::has_zoc(), hit_points_, unit_type::hitpoints(), unit_type::hp_bar_scaling(), hp_bar_scaling_, unit_type::id(), is_fearless_, is_healthy_, unit_type::jamming(), jamming_, unit_type::level(), level_, unit_type::max_attacks(), max_attacks_, max_experience_, max_hit_points_, max_movement_, modification_descriptions_, unit_type::movement(), unit_type::movement_type(), movement_type_, profile_, unit_type::race(), race_, random_traits_, unit_type::recall_cost(), recall_cost_, set_image_ellipse(), set_image_halo(), set_state(), set_usage(), unit_type::small_profile(), small_profile_, STATE_POISONED, trait_descriptions_, trait_names_, type(), type_, unit_type::type_name(), type_name_, unit_type::undead_variation(), undead_variation_, unit_type::unit_description(), unit_value_, unit_type::usage(), variation_, unit_type::vision(), vision_, unit_type::xp_bar_scaling(), and xp_bar_scaling_.
Referenced by apply_builtin_effect(), expire_modifications(), ai::helper_advance_unit(), intf_transform_unit(), and unit().
std::map< std::string, std::string > unit::advancement_icons | ( | ) | const |
Definition at line 1580 of file unit.cpp.
References advances_to(), advances_to_, can_advance(), get_modification_advances(), and game_config::images::level.
Referenced by unit_advancement_options().
|
inline |
Definition at line 324 of file unit.hpp.
References can_advance(), experience_, and max_experience().
|
inline |
Definition at line 133 of file unit.hpp.
References advances_to_.
Referenced by advancement_icons(), unit_callable::get_value(), impl_unit_get(), unit_helper::number_of_possible_advances(), set_advances_to(), and xp_color().
const std::vector< std::string > unit::advances_to_translated | ( | ) | const |
Definition at line 1121 of file unit.cpp.
References advances_to_, unit_type_data::find(), unit_type::log_id(), type(), unit_type::type_name(), unit_types, and WRN_UT.
Referenced by unit_level().
|
inline |
Definition at line 368 of file unit.hpp.
References alignment_.
Referenced by attack_info(), battle_context_unit_stats::battle_context_unit_stats(), gui2::format_stats(), dialogs::units_list_preview_pane::get_details(), battle_prediction_pane::get_unit_strings(), unit_callable::get_value(), impl_unit_get(), ai::readonly_context_impl::power_projection(), set_alignment(), and unit_alignment().
std::vector< std::pair< std::string, std::string > > unit::amla_icons | ( | ) | const |
Definition at line 1611 of file unit.cpp.
References get_modification_advances(), and modification_count().
Referenced by REPORT_GENERATOR().
|
inline |
Definition at line 276 of file unit.hpp.
References anim_comp_.
Referenced by unit_animator::add_animation(), wb::ghost_owner_unit(), editor::editor_action_unit_replace::perform_without_undo(), unit_drawer::redraw_unit(), unit_animator::replace_anim_if_invalid(), teleport_unit_between(), wb::unghost_owner_unit(), and unit_display::unit_sheath_weapon().
void unit::apply_builtin_effect | ( | std::string | type, |
const config & | effect | ||
) |
Definition at line 1800 of file unit.cpp.
References abilities_, config::add_child(), game_config::add_color_info(), adjust_profile(), advance_to(), advancements_, advances_to_, alignment_, anim_comp_, config::append(), utils::apply_modifier(), attacks_, unit_type::base_id(), config::child(), config::child_range(), description_, emit_zoc_, preferences::encountered_units(), experience_, gui2::event::find(), unit_type_data::find(), config::get(), movetype::get_defense(), movetype::get_jamming(), movetype::get_movement(), movetype::get_resistances(), movetype::get_vision(), has_ability_by_id(), config::has_child(), heal_all(), hit_points_, i, image_mods_, is_fearless_, is_healthy_, jamming_, LOG_UT, max_attacks_, max_experience_, max_hit_points_, max_movement_, movetype::terrain_info::merge(), movetype::terrain_defense::merge(), movetype::resistances::merge(), movement_, movement_type_, overlays_, utils::parenthetical_split(), profile_, recall_cost(), recall_cost_, remove_ability_by_id(), utils::replace(), cursor::set(), set_image_ellipse(), set_image_halo(), set_state(), side_, small_profile_, utils::split(), resources::teams, type(), unit(), unit_types, upkeep_, variation_, vision_, and WRN_UT.
Referenced by add_modification(), and game_lua_kernel::cfun_builtin_effect().
void unit::apply_modifications | ( | ) |
Definition at line 2271 of file unit.cpp.
References add_modification(), config::child_range(), unit_experience_accelerator::get_acceleration(), config::has_child(), i, log_scope, max_experience_, modifications_, and lg::wml_error().
Referenced by advance_to().
|
inline |
Definition at line 271 of file unit.hpp.
References attacks_.
Referenced by battle_context::battle_context(), battle_context_unit_stats::battle_context_unit_stats(), battle_context::choose_attacker_weapon(), battle_context::choose_defender_weapon(), dialogs::units_list_preview_pane::get_details(), unit_callable::get_value(), impl_unit_attack_get(), impl_unit_attack_set(), impl_unit_attacks_get(), impl_unit_attacks_len(), basic_unit_filter_impl::internal_matches_filter(), game_lua_kernel::intf_simulate_combat(), ai::readonly_context_impl::power_projection(), ai::ai_default_rca::move_to_targets_phase::rate_group(), and unit_weapons().
|
inline |
|
inline |
Definition at line 230 of file unit.hpp.
References attacks_left_, and incapacitated().
Referenced by wb::attack::apply_temp_modifier(), unit_callable::get_value(), impl_unit_get(), wb::attack::remove_temp_modifier(), and display_context::unit_can_move().
void unit::backup_state | ( | ) |
std::string unit::big_profile | ( | ) | const |
Definition at line 1012 of file unit.cpp.
References absolute_image(), and profile_.
Referenced by impl_unit_get().
|
inline |
Definition at line 323 of file unit.hpp.
References advances_to_, and get_modification_advances().
Referenced by advancement_icons(), advances(), dialogs::recall_dialog(), and unit_drawer::redraw_unit().
|
inline |
Definition at line 207 of file unit.hpp.
References canrecruit_.
Referenced by ai::ai_default_rca::get_healing_phase::evaluate(), wb::find_backup_leader(), generate_traits(), ai::default_recruitment::recruitment::get_cost_map_of_side(), dialogs::units_list_preview_pane::get_details(), gui2::get_image_mods(), ai::default_recruitment::recruitment::get_unit_ratio(), unit_callable::get_value(), impl_unit_get(), basic_unit_filter_impl::internal_matches_filter(), dialogs::recall_dialog(), unit_drawer::redraw_unit(), ai::default_recruitment::recruitment::update_own_units_count(), upkeep(), and write().
|
static |
Clear the unit status cache for all units.
Currently only the hidden status of units is cached this way.
Definition at line 610 of file unit.cpp.
References itor.
Referenced by game_lua_kernel::intf_teleport(), game_events::t_pump::operator()(), editor::editor_action_unit_replace::perform_without_undo(), actions::undo::move_action::redo(), and actions::undo::move_action::undo().
|
inlineprivate |
unit & unit::clone | ( | bool | is_temporary = true | ) |
Mark this unit as clone so it can be inserted to unit_map.
Definition at line 2368 of file unit.cpp.
References resources::gameboard, resources::gamedata, id_, game_data::INITIAL, synced_context::is_synced(), n_unit::id_manager::next_fake_id(), n_unit::id_manager::next_id(), pos, set_underlying_id(), underlying_id_, game_board::unit_id_manager(), and WRN_UT.
Referenced by temporary_unit_placer::temporary_unit_placer().
|
inline |
Definition at line 284 of file unit.hpp.
References unit_value_.
Referenced by ai::default_recruitment::recruitment::get_unit_ratio(), unit_callable::get_value(), impl_unit_get(), statistics::recall_unit(), statistics::recruit_unit(), statistics::un_recall_unit(), and statistics::un_recruit_unit().
|
inline |
Definition at line 274 of file unit.hpp.
References resistance_against().
Referenced by battle_context_unit_stats::battle_context_unit_stats(), and battle_prediction_pane::get_unit_strings().
std::string unit::default_anim_image | ( | ) | const |
The default image to use for animation frames with no defined image.
Definition at line 2267 of file unit.cpp.
References unit_type::icon(), unit_type::image(), and type().
Referenced by unit_animation_component::invalidate(), and unit_drawer::redraw_unit().
int unit::defense_modifier | ( | const t_translation::t_terrain & | terrain | ) | const |
Definition at line 1520 of file unit.cpp.
References movetype::defense_modifier(), unit_ability_list::empty(), get_abilities(), unit_abilities::effect::get_composite_value(), and movement_type_.
Referenced by battle_context_unit_stats::battle_context_unit_stats(), ai::ai_default_rca::move_to_targets_phase::choose_move(), pathfind::shortest_path_calculator::cost(), ai::ai_default_rca::get_villages_phase::find_villages(), basic_unit_filter_impl::internal_matches_filter(), intf_unit_defense(), ai::readonly_context_impl::power_projection(), ai::ai_default_rca::move_to_targets_phase::rate_group(), ai::ai_default_rca::aspect_attacks_base::rate_terrain(), ai::default_ai_context_impl::rate_terrain(), REPORT_GENERATOR(), and unit_defense().
std::string unit::describe_builtin_effect | ( | std::string | type, |
const config & | effect | ||
) |
Definition at line 1720 of file unit.cpp.
References _n(), attacks_, lexical_cast(), N_, utils::print_modifier(), and vgettext().
Referenced by add_modification(), and game_lua_kernel::cfun_builtin_effect().
const std::string & unit::effect_image_mods | ( | ) | const |
|
inline |
Definition at line 257 of file unit.hpp.
References emit_zoc_, and incapacitated().
Referenced by pathfind::enemy_zoc(), and unit_drawer::redraw_unit().
void unit::end_turn | ( | ) |
Definition at line 1225 of file unit.cpp.
References expire_modifications(), get_state(), movement_, resting_, set_interrupted_move(), set_state(), STATE_NOT_MOVED, STATE_SLOWED, and total_movement().
|
inline |
Definition at line 171 of file unit.hpp.
References experience_.
Referenced by gui2::format_stats(), dialogs::units_list_preview_pane::get_details(), unit_callable::get_value(), ai::helper_advance_unit(), impl_unit_get(), dialogs::recall_dialog(), unit_drawer::redraw_unit(), unit_xp(), and xp_color().
void unit::expire_modifications | ( | const std::string & | duration | ) |
Clears those modifications whose duration has expired.
If duration is empty, then all temporary modifications (those not lasting forever) have expired. Otherwise, modifications whose duration equals duration have expired.
Definition at line 1180 of file unit.cpp.
References advance_to(), anim_comp_, config::child(), config::child_count(), config::get(), get_unit_type(), i, mod_duration_match(), modifications_, config::remove_child(), and type().
Referenced by end_turn(), new_scenario(), and new_turn().
|
inline |
Definition at line 278 of file unit.hpp.
References facing_.
Referenced by unit_callable::get_value(), impl_unit_get(), unit_animation::matches(), and unit_drawer::redraw_unit().
|
inline |
Definition at line 393 of file unit.hpp.
References formula_man_.
Referenced by unit_callable::get_value().
|
inline |
Definition at line 203 of file unit.hpp.
References gender_.
Referenced by unit_race::generate_name(), unit_race::generator(), dialogs::units_list_preview_pane::get_details(), unit_callable::get_value(), impl_unit_get(), basic_unit_filter_impl::internal_matches_filter(), unit_alignment(), and unit_race().
void unit::generate_name | ( | ) |
Definition at line 804 of file unit.cpp.
References t_string::empty(), gender_, unit_race::generate_name(), generate_name_, name_, and race_.
Referenced by unit().
void unit::generate_traits | ( | bool | musthaveonly = false | ) |
Apply mandatory traits (e.g.
undead, mechanical) to a unit and then fill out with available (leaders have a restricted set of available traits) traits until no more are available or the unit has its maximum number of traits. This routine does not apply the effects of added traits to a unit. That must be done by the caller. Note that random numbers used in config files don't work in multiplayer, so that leaders should be barred from all random traits until that is fixed. Later the restrictions will be based on play balance. musthaveonly is true when you don't want to generate random traits or you don't want to give any optional traits to a unit.
Definition at line 827 of file unit.cpp.
References config::add_child(), can_recruit(), config::child_range(), random_new::generator, random_new::rng::get_random_int(), unit_type::log_id(), LOG_UT, modifications_, unit_type::num_traits(), unit_type::possible_traits(), random_traits_, and type().
Referenced by advance_to().
unit_ability_list unit::get_abilities | ( | const std::string & | tag_name, |
const map_location & | loc | ||
) | const |
Definition at line 168 of file abilities.cpp.
References abilities_, ability_active(), ability_affects_adjacent(), ability_affects_self(), config::child_range(), unit_map::end(), unit_map::find(), get_adjacent_tiles(), i, unit_ability_list::push_back(), side(), resources::teams, and resources::units.
Referenced by defense_modifier(), get_abilities(), pathfind::get_teleport_locations(), unit_display::reset_helpers(), and resistance_against().
|
inline |
Definition at line 386 of file unit.hpp.
References get_abilities(), and loc_.
bool unit::get_ability_bool | ( | const std::string & | tag_name, |
const map_location & | loc | ||
) | const |
Returns true if the unit is currently under effect by an ability with this given TAG NAME.
This means that the ability could be owned by the unit itself, or by an adjacent unit.
Definition at line 129 of file abilities.cpp.
References abilities_, ability_active(), ability_affects_adjacent(), ability_affects_self(), config::child_range(), unit_map::end(), unit_map::find(), get_adjacent_tiles(), i, side(), resources::teams, and resources::units.
Referenced by pathfind::shortest_path_calculator::cost(), ai::ai_default_rca::get_healing_phase::evaluate(), pathfind::find_routes(), get_ability_bool(), pathfind::get_teleport_locations(), intf_unit_ability(), invisible(), pathfind::mark_route(), ai::ai_default_rca::aspect_attacks_base::rate_terrain(), and ai::default_ai_context_impl::rate_terrain().
|
inline |
Returns true if the unit is currently under effect by an ability with this given TAG NAME.
This means that the ability could be owned by the unit itself, or by an adjacent unit.
Definition at line 383 of file unit.hpp.
References get_ability_bool(), and loc_.
std::vector< std::string > unit::get_ability_list | ( | ) | const |
Definition at line 210 of file abilities.cpp.
References abilities_, and config::all_children_range().
Referenced by unit_callable::get_value(), and impl_unit_get().
|
inline |
Definition at line 320 of file unit.hpp.
References movetype::damage_table(), and movement_type_.
Referenced by unit_hp().
|
inline |
Definition at line 268 of file unit.hpp.
References emit_zoc_.
Referenced by unit_callable::get_value(), and impl_unit_get().
|
inline |
|
inline |
Definition at line 304 of file unit.hpp.
References hidden_.
Referenced by unit_callable::get_value(), impl_unit_get(), and unit_drawer::redraw_unit().
|
inline |
Definition at line 347 of file unit.hpp.
References interrupted_move_.
|
static |
Definition at line 1314 of file unit.cpp.
References i, known_boolean_state_names_, and STATE_UNKNOWN.
Referenced by get_state(), and set_state().
|
static |
Definition at line 1324 of file unit.cpp.
References STATE_GUARDIAN, STATE_NOT_MOVED, STATE_PETRIFIED, STATE_POISONED, STATE_SLOWED, STATE_UNCOVERED, and STATE_UNHEALABLE.
|
inline |
Definition at line 286 of file unit.hpp.
References loc_.
Referenced by actions::actor_sighted(), pathfind::full_cost_map::add_unit(), calculate_healing(), 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(), ai::ai_default_rca::move_leader_to_keep_phase::evaluate(), wb::find_backup_leader(), pathfind::find_vacant_castle(), events::mouse_handler::get_route(), pathfind::teleport_group::get_teleport_pair(), wb::ghost_owner_unit(), impl_unit_get(), impl_unit_set(), intf_advance_unit(), intf_find_cost_map_helper(), game_lua_kernel::intf_find_path(), game_lua_kernel::intf_match_unit(), game_lua_kernel::intf_simulate_combat(), intf_unit_resistance(), invisible(), is_visible_to_team(), luaW_pushfaivariant(), unit_filter::matches(), basic_unit_filter_impl::matches(), pathfind::paths::paths(), unit_drawer::redraw_unit(), game_lua_kernel::run_filter(), ai::move_result::test_route(), wb::unghost_owner_unit(), display_context::unit_can_move(), unit_display::unit_healing(), unit_weapons(), ai::default_recruitment::recruitment::update_important_hexes(), and playsingle_controller::hotkey_handler::whiteboard_suppose_dead().
std::vector< config > unit::get_modification_advances | ( | ) | const |
Definition at line 1630 of file unit.cpp.
References advances_to_, modification_advancements(), modification_count(), sort(), and utils::split().
Referenced by advancement_icons(), amla_icons(), can_advance(), unit_helper::number_of_possible_advances(), and xp_color().
|
inline |
Definition at line 265 of file unit.hpp.
References role_.
Referenced by unit_callable::get_value(), impl_unit_get(), and basic_unit_filter_impl::internal_matches_filter().
bool unit::get_state | ( | const std::string & | state | ) | const |
Definition at line 1289 of file unit.cpp.
References get_known_boolean_state_id(), STATE_UNKNOWN, and states_.
Referenced by add_modification(), pathfind::full_cost_map::add_unit(), advance_to(), attack_info(), battle_context_unit_stats::battle_context_unit_stats(), calculate_healing(), actions::shroud_clearer::clear_unit(), end_turn(), ai::ai_default_rca::get_healing_phase::evaluate(), get_states(), unit_callable::get_value(), impl_unit_status_get(), incapacitated(), basic_unit_filter_impl::internal_matches_filter(), invisible(), jamming_cost(), pathfind::jamming_path::jamming_path(), movement_cost(), pathfind::paths::paths(), poisoned(), slowed(), unit_status(), vision_cost(), and pathfind::vision_path::vision_path().
bool unit::get_state | ( | state_t | state | ) | const |
Definition at line 1309 of file unit.cpp.
References known_boolean_states_.
const std::map< std::string, std::string > unit::get_states | ( | ) | const |
Definition at line 1267 of file unit.cpp.
References get_state(), i, known_boolean_state_names_, and states_.
Referenced by unit_callable::get_value(), basic_unit_filter_impl::internal_matches_filter(), and write().
std::vector< std::string > unit::get_traits_list | ( | ) | const |
Definition at line 883 of file unit.cpp.
References config::child_range(), and modifications_.
Referenced by unit_callable::get_value(), impl_unit_get(), and unit_traits().
bool unit::has_ability_by_id | ( | const std::string & | ability | ) | const |
Definition at line 1357 of file unit.cpp.
References abilities_, and config::all_children_range().
Referenced by apply_builtin_effect(), and basic_unit_filter_impl::internal_matches_filter().
bool unit::has_ability_type | ( | const std::string & | ability | ) | const |
Definition at line 419 of file abilities.cpp.
References abilities_, and config::child_range().
|
inline |
Definition at line 256 of file unit.hpp.
References get_goto(), and map_location::valid().
Referenced by display_context::unit_can_move().
|
inline |
Definition at line 255 of file unit.hpp.
References movement_left(), and total_movement().
Referenced by display_context::unit_can_move().
Definition at line 1253 of file unit.cpp.
References amount, hit_points_, and max_hitpoints().
|
inline |
Definition at line 241 of file unit.hpp.
References hit_points_, and max_hitpoints().
Referenced by apply_builtin_effect(), ai::helper_advance_unit(), ai::helper_place_unit(), and new_scenario().
|
inline |
Definition at line 168 of file unit.hpp.
References hit_points_.
Referenced by attack_info(), battle_context_unit_stats::battle_context_unit_stats(), calculate_healing(), ai::ai_default_rca::move_to_targets_phase::choose_move(), ai::default_recruitment::recruitment::do_combat_analysis(), ai::ai_default_rca::get_healing_phase::evaluate(), ai::ai_default_rca::get_villages_phase::find_villages(), gui2::format_stats(), dialogs::units_list_preview_pane::get_details(), ai::default_recruitment::recruitment::get_unit_ratio(), unit_callable::get_value(), hp_color(), impl_unit_get(), ai::readonly_context_impl::power_projection(), ai::ai_default_rca::move_to_targets_phase::rate_group(), unit_drawer::redraw_unit(), and unit_hp().
|
inline |
Definition at line 226 of file unit.hpp.
References hold_position_.
|
inline |
Definition at line 195 of file unit.hpp.
References hp_bar_scaling_.
Referenced by unit_drawer::redraw_unit().
SDL_Color unit::hp_color | ( | ) | const |
Colors for the unit's current hitpoints.
Definition at line 1065 of file unit.cpp.
References hitpoints(), hp_color_(), and max_hitpoints().
Referenced by gui2::format_stats(), dialogs::units_list_preview_pane::get_details(), unit_drawer::redraw_unit(), unit_hp(), and unit_weapons().
SDL_Color unit::hp_color | ( | int | hitpoints | ) | const |
Colors for the unit's hitpoints.
hitpoints | the amount of hitpoints the color represents. |
Definition at line 1070 of file unit.cpp.
References hitpoints(), and hp_color_().
|
inline |
Definition at line 148 of file unit.hpp.
References id_, and type_name().
Referenced by display::add_exclusive_draw(), wb::attack::apply_temp_modifier(), wb::move::apply_temp_modifier(), wb::manager::create_temp_move(), wb::find_backup_leader(), actions::find_recall_location(), unit_callable::get_value(), impl_unit_get(), basic_unit_filter_impl::internal_matches_filter(), game_lua_kernel::intf_match_unit(), intrusive_ptr_add_ref(), intrusive_ptr_release(), invisible(), events::menu_handler::recall(), wb::attack::remove_temp_modifier(), wb::move::remove_temp_modifier(), and set_id().
|
inline |
Definition at line 358 of file unit.hpp.
References ellipse_, and unit_detail::get_or_default().
Referenced by unit_drawer::redraw_unit().
|
inline |
Definition at line 356 of file unit.hpp.
References unit_detail::get_or_default(), and halo_.
Referenced by unit_drawer::redraw_unit().
std::string unit::image_mods | ( | ) | const |
Definition at line 2430 of file unit.cpp.
References image_mods_, and TC_image_mods().
Referenced by dialogs::units_list_preview_pane::get_details(), impl_unit_get(), unit_animation_component::invalidate(), unit_drawer::redraw_unit(), REPORT_GENERATOR(), and unit_box_at().
|
inline |
Definition at line 215 of file unit.hpp.
References get_state(), and STATE_PETRIFIED.
Referenced by attacks_left(), calculate_healing(), ai::default_recruitment::recruitment::do_combat_analysis(), emits_zoc(), ai::default_recruitment::recruitment::get_cost_map_of_side(), ai::move_result::get_unit(), ai::stopunit_result::get_unit(), ai::default_recruitment::recruitment::get_unit_ratio(), unit_callable::get_value(), impl_unit_get(), movement_left(), unit_drawer::redraw_unit(), unit_animation_component::refresh(), unit_animation_component::set_selecting(), unit_animation_component::set_standing(), events::mouse_handler::show_attack_options(), ai::default_recruitment::recruitment::update_own_units_count(), and display_context::would_be_discovered().
bool unit::invisible | ( | const map_location & | loc, |
bool | see_all = true |
||
) | const |
Definition at line 2291 of file unit.cpp.
References DBG_UT, resources::gameboard, get_ability_bool(), get_location(), get_state(), id(), invisibility_cache_, itor, side_, STATE_UNCOVERED, and display_context::would_be_discovered().
Referenced by basic_unit_filter_impl::internal_matches_filter(), is_visible_to_team(), pathfind::mark_route(), unit_drawer::redraw_unit(), unit_status(), and display_context::would_be_discovered().
|
inline |
Definition at line 306 of file unit.hpp.
References is_fearless_.
Referenced by attack_info(), battle_context_unit_stats::battle_context_unit_stats(), battle_prediction_pane::get_unit_strings(), and unit_alignment().
|
inline |
Definition at line 305 of file unit.hpp.
References movetype::is_flying(), and movement_type_.
Referenced by unit_animation_component::invalidate(), and unit_drawer::redraw_unit().
|
inline |
bool unit::is_visible_to_team | ( | team const & | team, |
gamemap const & | map, | ||
bool const | see_all = true |
||
) | const |
Definition at line 2333 of file unit.cpp.
References team::fogged(), get_location(), invisible(), team::is_enemy(), n_unit::unit_id::is_fake(), gamemap::on_board(), side(), and underlying_id_.
Referenced by actions::actor_sighted(), calculate_healing(), actions::get_sides_not_seeing(), and unit_drawer::redraw_unit().
|
inline |
Definition at line 224 of file unit.hpp.
References jamming_.
Referenced by pathfind::jamming_path::jamming_path().
|
inline |
Definition at line 312 of file unit.hpp.
References get_state(), movetype::jamming_cost(), movement_type_, and STATE_SLOWED.
Referenced by intf_unit_jamming_cost().
|
static |
The path to the leader crown overlay.
Definition at line 234 of file unit.cpp.
Referenced by dialogs::units_list_preview_pane::get_details(), gui2::get_image_mods(), dialogs::recall_dialog(), and unit_drawer::redraw_unit().
|
inline |
Definition at line 175 of file unit.hpp.
References level_.
Referenced by gui2::format_stats(), dialogs::units_list_preview_pane::get_details(), unit_callable::get_value(), impl_unit_get(), basic_unit_filter_impl::internal_matches_filter(), dialogs::recall_dialog(), unit_drawer::redraw_unit(), set_level(), unit_level(), and upkeep().
bool unit::matches_id | ( | const std::string & | unit_id | ) | const |
|
inline |
Definition at line 231 of file unit.hpp.
References max_attacks_.
Referenced by unit_callable::get_value(), and impl_unit_get().
|
inline |
Definition at line 172 of file unit.hpp.
References max_experience_.
Referenced by advances(), gui2::format_stats(), dialogs::units_list_preview_pane::get_details(), unit_callable::get_value(), ai::helper_advance_unit(), impl_unit_get(), dialogs::recall_dialog(), unit_drawer::redraw_unit(), unit_xp(), and xp_color().
|
inline |
Definition at line 169 of file unit.hpp.
References max_hit_points_.
Referenced by attack_info(), battle_context_unit_stats::battle_context_unit_stats(), calculate_healing(), ai::ai_default_rca::get_healing_phase::evaluate(), gui2::format_stats(), dialogs::units_list_preview_pane::get_details(), ai::default_recruitment::recruitment::get_unit_ratio(), unit_callable::get_value(), heal(), heal_all(), hp_color(), impl_unit_get(), ai::readonly_context_impl::power_projection(), ai::ai_default_rca::move_to_targets_phase::rate_group(), unit_drawer::redraw_unit(), and unit_hp().
|
inline |
Definition at line 333 of file unit.hpp.
References advancements_.
Referenced by get_modification_advances(), and impl_unit_get().
size_t unit::modification_count | ( | const std::string & | type, |
const std::string & | id | ||
) | const |
Definition at line 1695 of file unit.cpp.
References config::child_range(), and modifications_.
Referenced by amla_icons(), and get_modification_advances().
|
inline |
Definition at line 346 of file unit.hpp.
References interrupted_move_, movement_left(), map_location::x, and map_location::y.
|
inline |
Definition at line 308 of file unit.hpp.
References get_state(), movetype::movement_cost(), movement_type_, and STATE_SLOWED.
Referenced by ai::ai_default_rca::move_cost_calculator::cost(), pathfind::shortest_path_calculator::cost(), pathfind::emergency_path_calculator::cost(), ai::ai_default_rca::move_leader_to_keep_phase::evaluate(), pathfind::find_vacant_tile(), basic_unit_filter_impl::internal_matches_filter(), intf_unit_movement_cost(), pathfind::mark_route(), wb::path_cost(), REPORT_GENERATOR(), display_context::unit_can_move(), and unit_moves().
|
inline |
Returns how far a unit can move this turn (zero if incapacitated).
Definition at line 220 of file unit.hpp.
References incapacitated(), and movement_.
Referenced by pathfind::full_cost_map::add_unit(), wb::attack::apply_temp_modifier(), wb::move::apply_temp_modifier(), dialogs::units_list_preview_pane::get_details(), unit_callable::get_value(), has_moved(), impl_unit_get(), pathfind::mark_route(), move_interrupted(), pathfind::paths::paths(), unit_drawer::redraw_unit(), remove_movement_ai(), wb::attack::remove_temp_modifier(), wb::move::remove_temp_modifier(), ai::move_result::test_route(), display_context::unit_can_move(), and unit_moves().
|
inline |
Providing a true parameter to movement_left() causes it to ignore incapacitation.
Definition at line 222 of file unit.hpp.
References movement_, and movement_left().
Referenced by movement_left().
|
inline |
Definition at line 321 of file unit.hpp.
References movement_type_.
Referenced by pathfind::full_cost_map::add_unit(), actions::shroud_clearer::clear_unit(), pathfind::jamming_path::jamming_path(), pathfind::paths::paths(), and pathfind::vision_path::vision_path().
|
inline |
The unit name for display.
Definition at line 158 of file unit.hpp.
References name_.
Referenced by ability_tooltips(), wb::attack::apply_temp_modifier(), wb::move::apply_temp_modifier(), gui2::format_stats(), dialogs::units_list_preview_pane::get_details(), unit_callable::get_value(), impl_unit_get(), unit_map::insert(), basic_unit_filter_impl::internal_matches_filter(), events::menu_handler::recall(), dialogs::recall_dialog(), wb::attack::remove_temp_modifier(), wb::move::remove_temp_modifier(), rename(), set_name(), and unit_name().
void unit::new_scenario | ( | ) |
Definition at line 1238 of file unit.cpp.
References expire_modifications(), goto_, heal_all(), set_state(), STATE_GUARDIAN, STATE_PETRIFIED, STATE_POISONED, and STATE_SLOWED.
void unit::new_turn | ( | ) |
Definition at line 1215 of file unit.cpp.
References attacks_left_, end_turn_, expire_modifications(), hold_position_, max_attacks_, movement_, set_state(), STATE_UNCOVERED, and total_movement().
Referenced by SYNCED_COMMAND_HANDLER_FUNCTION().
|
inline |
Definition at line 260 of file unit.hpp.
References overlays_.
Referenced by dialogs::units_list_preview_pane::get_details(), gui2::get_image_mods(), impl_unit_get(), dialogs::recall_dialog(), and unit_drawer::redraw_unit().
|
private |
Definition at line 2475 of file unit.cpp.
References config::attribute_value::empty(), config::attribute_value::to_int(), upkeep_, and WRN_UT.
Referenced by unit().
|
inline |
Definition at line 214 of file unit.hpp.
References get_state(), and STATE_POISONED.
Referenced by unit_drawer::redraw_unit().
|
inline |
Never returns nullptr, but may point to the null race.
Definition at line 371 of file unit.hpp.
References race_.
Referenced by dialogs::units_list_preview_pane::get_details(), unit_callable::get_value(), impl_unit_get(), basic_unit_filter_impl::internal_matches_filter(), and unit_race().
|
inline |
Definition at line 177 of file unit.hpp.
References recall_cost_.
Referenced by apply_builtin_effect(), impl_unit_get(), basic_unit_filter_impl::internal_matches_filter(), dialogs::recall_dialog(), set_recall_cost(), and statistics::un_recall_unit_cost().
|
inline |
Definition at line 212 of file unit.hpp.
References filter_recall_.
|
inline |
Definition at line 209 of file unit.hpp.
References recruit_list_.
Referenced by unit_callable::get_value(), impl_unit_get(), and set_recruits().
|
inline |
Definition at line 414 of file unit.hpp.
References ref_count_.
Referenced by intrusive_ptr_add_ref(), and intrusive_ptr_release().
|
private |
Definition at line 1367 of file unit.cpp.
References abilities_, config::erase(), i, config::ordered_begin(), and config::ordered_end().
Referenced by apply_builtin_effect().
void unit::remove_attacks_ai | ( | ) |
Definition at line 2443 of file unit.cpp.
References attacks_left_, max_attacks_, and set_attacks().
void unit::remove_movement_ai | ( | ) |
Definition at line 2451 of file unit.cpp.
References movement_left(), set_movement(), set_state(), STATE_NOT_MOVED, and total_movement().
|
inline |
Definition at line 160 of file unit.hpp.
References name(), name_, and unrenamable_.
int unit::resistance_against | ( | const std::string & | damage_name, |
bool | attacker, | ||
const map_location & | loc | ||
) | const |
Definition at line 1559 of file unit.cpp.
References unit_ability_list::begin(), unit_ability_list::empty(), unit_ability_list::end(), unit_ability_list::erase(), get_abilities(), unit_abilities::effect::get_composite_value(), unit_ability_list::highest(), i, movement_type_, movetype::resistance_against(), and resistance_filter_matches().
Referenced by damage_from(), intf_unit_resistance(), resistance_against(), and unit_hp().
|
inline |
Definition at line 316 of file unit.hpp.
References resistance_against(), and attack_type::type().
|
private |
Definition at line 1535 of file unit.cpp.
References unit_abilities::filter_base_matches(), gui2::event::find(), and utils::split().
Referenced by resistance_against().
|
inline |
Definition at line 242 of file unit.hpp.
References resting_.
Referenced by calculate_healing(), unit_callable::get_value(), and impl_unit_get().
void unit::set_advances_to | ( | const std::vector< std::string > & | advances_to | ) |
Definition at line 1136 of file unit.cpp.
References advances_to(), advances_to_, unit_type_data::check_types(), and unit_types.
Referenced by impl_unit_set().
|
inline |
Definition at line 369 of file unit.hpp.
References alignment(), and alignment_.
Referenced by impl_unit_set().
Definition at line 233 of file unit.hpp.
References attacks_left_.
Referenced by wb::attack::apply_temp_modifier(), ai::helper_place_unit(), impl_unit_set(), remove_attacks_ai(), and wb::attack::remove_temp_modifier().
|
inline |
|
inline |
Definition at line 173 of file unit.hpp.
References experience_.
Referenced by ai::helper_advance_unit(), and impl_unit_set().
void unit::set_facing | ( | map_location::DIRECTION | dir | ) | const |
Definition at line 1491 of file unit.cpp.
References facing_, and map_location::NDIRECTIONS.
Referenced by impl_unit_set(), teleport_unit_between(), and unit_display::unit_draw_weapon().
|
inline |
void unit::set_hidden | ( | bool | state | ) | const |
Definition at line 2460 of file unit.cpp.
References anim_comp_, and hidden_.
Referenced by impl_unit_set(), wb::temporary_unit_hider::temporary_unit_hider(), and wb::temporary_unit_hider::~temporary_unit_hider().
|
inline |
|
inline |
Definition at line 363 of file unit.hpp.
References ellipse_.
Referenced by advance_to(), apply_builtin_effect(), and unit().
void unit::set_image_halo | ( | const std::string & | halo | ) |
Definition at line 2467 of file unit.cpp.
References anim_comp_, and halo_.
Referenced by advance_to(), apply_builtin_effect(), and unit().
|
inline |
Definition at line 176 of file unit.hpp.
References level(), and level_.
Referenced by impl_unit_set().
|
inline |
To be called by unit_map or for temporary units only.
Definition at line 288 of file unit.hpp.
References loc_.
Referenced by pathfind::full_cost_map::add_unit(), impl_unit_set(), and teleport_unit_between().
Set the unit's remaining movement to moves.
If unit_action is set to true, then additionally 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 1148 of file unit.cpp.
References end_turn_, hold_position_, and movement_.
Referenced by wb::attack::apply_temp_modifier(), ai::helper_place_unit(), impl_unit_set(), remove_movement_ai(), wb::attack::remove_temp_modifier(), unit_movement_resetter::unit_movement_resetter(), and unit_movement_resetter::~unit_movement_resetter().
Definition at line 159 of file unit.hpp.
Referenced by impl_unit_set().
Definition at line 174 of file unit.hpp.
References recall_cost(), and recall_cost_.
Referenced by impl_unit_set().
void unit::set_recruits | ( | const std::vector< std::string > & | recruits | ) |
Definition at line 1112 of file unit.cpp.
References unit_type_data::check_types(), recruit_list_, recruits(), and unit_types.
Referenced by impl_unit_set(), and unit().
|
inline |
Definition at line 243 of file unit.hpp.
References resting_.
Referenced by calculate_healing(), and impl_unit_set().
|
inline |
void unit::set_state | ( | const std::string & | state, |
bool | value | ||
) |
Definition at line 1337 of file unit.cpp.
References get_known_boolean_state_id(), STATE_UNKNOWN, and states_.
Referenced by add_modification(), advance_to(), apply_builtin_effect(), end_turn(), ai::helper_advance_unit(), impl_unit_status_set(), new_scenario(), new_turn(), remove_movement_ai(), and unit().
Definition at line 1304 of file unit.cpp.
References known_boolean_states_.
|
private |
Definition at line 2350 of file unit.cpp.
References resources::gamedata, id_, game_data::INITIAL, synced_context::is_synced(), n_unit::id_manager::next_fake_id(), n_unit::id_manager::next_id(), type_id(), underlying_id_, and n_unit::unit_id::value.
|
inline |
Definition at line 200 of file unit.hpp.
References unrenamable(), and unrenamable_.
|
inline |
|
inline |
|
inline |
Definition at line 201 of file unit.hpp.
References side_.
Referenced by actions::actor_sighted(), pathfind::full_cost_map::add_unit(), attack_info(), calculate_healing(), game_state::can_recruit_from(), game_state::can_recruit_on(), can_see(), actions::shroud_clearer::clear_dest(), actions::shroud_clearer::clear_unit(), pathfind::shortest_path_calculator::cost(), wb::manager::create_temp_move(), ai::default_recruitment::recruitment::do_combat_analysis(), game_display::draw_hex(), pathfind::enemy_zoc(), ai::ai_default_rca::get_healing_phase::evaluate(), wb::find_actions_of(), pathfind::find_routes(), pathfind::find_vacant_castle(), wb::future_visible_unit(), get_abilities(), get_ability_bool(), ai::default_recruitment::recruitment::get_cost_map_of_side(), gui2::get_image_mods(), ai::move_result::get_unit(), ai::stopunit_result::get_unit(), ai::default_recruitment::recruitment::get_unit_ratio(), unit_callable::get_value(), impl_unit_get(), basic_unit_filter_impl::internal_matches_filter(), game_lua_kernel::intf_find_path(), game_lua_kernel::intf_find_reach(), is_visible_to_team(), luaW_pushfaivariant(), pathfind::mark_route(), wb::path_cost(), pathfind::paths::paths(), unit_creator::post_create(), ai::readonly_context_impl::power_projection(), ai::ai_default_rca::aspect_attacks_base::rate_terrain(), unit_drawer::redraw_unit(), events::mouse_handler::show_attack_options(), SYNCED_COMMAND_HANDLER_FUNCTION(), TC_image_mods(), pathfind::teleport_map::teleport_map(), display_context::unit_can_move(), unit_moves(), unit_side(), ai::default_recruitment::recruitment::update_important_hexes(), ai::default_recruitment::recruitment::update_own_units_count(), and display_context::would_be_discovered().
|
inline |
Definition at line 216 of file unit.hpp.
References get_state(), and STATE_SLOWED.
Referenced by unit_drawer::redraw_unit().
std::string unit::small_profile | ( | ) | const |
The unit's profile.
Definition at line 1020 of file unit.cpp.
References absolute_image(), and small_profile_.
Referenced by REPORT_GENERATOR().
Swap, for copy and swap idiom.
Definition at line 728 of file unit.cpp.
References advances_to_, alignment_, alpha_, anim_comp_, attacks_, attacks_left_, canrecruit_, emit_zoc_, end_turn_, events_, experience_, facing_, filter_recall_, flag_rgb_, formula_man_, gender_, getsHit_, goto_, hidden_, hit_points_, hold_position_, id_, image_mods_, interrupted_move_, invisibility_cache_, is_fearless_, is_healthy_, jamming_, known_boolean_states_, level_, loc_, max_attacks_, max_experience_, max_hit_points_, max_movement_, modification_descriptions_, modifications_, movement_, movement_type_, name_, overlays_, race_, recall_cost_, recruit_list_, resting_, role_, side_, states_, swap(), trait_descriptions_, trait_names_, type_, type_name_, undead_variation_, underlying_id_, unit_value_, unrenamable_, variables_, variation_, and vision_.
Referenced by operator=().
|
inline |
std::string unit::TC_image_mods | ( | ) | const |
Definition at line 2423 of file unit.cpp.
References flag_rgb_, team::get_side_color_index(), and side().
Referenced by image_mods(), unit_animation_component::invalidate(), and unit_drawer::redraw_unit().
|
inline |
Definition at line 202 of file unit.hpp.
References flag_rgb_.
Referenced by gui2::get_image_mods(), and dialogs::recall_dialog().
|
inline |
Definition at line 225 of file unit.hpp.
References end_turn_, and hold_position_.
|
inline |
Definition at line 228 of file unit.hpp.
References end_turn_, and hold_position_.
|
inline |
Definition at line 218 of file unit.hpp.
References max_movement_.
Referenced by pathfind::full_cost_map::add_unit(), end_turn(), ai::default_recruitment::recruitment::get_cost_map_of_side(), dialogs::units_list_preview_pane::get_details(), ai::default_recruitment::recruitment::get_unit_ratio(), unit_callable::get_value(), has_moved(), impl_unit_get(), pathfind::mark_route(), new_turn(), wb::path_cost(), pathfind::paths::paths(), unit_drawer::redraw_unit(), remove_movement_ai(), unit_movement_resetter::unit_movement_resetter(), unit_moves(), unit_vision(), and ai::default_recruitment::recruitment::update_own_units_count().
|
inline |
Definition at line 281 of file unit.hpp.
References trait_descriptions_.
Referenced by unit_traits().
|
inline |
Definition at line 280 of file unit.hpp.
References trait_names_.
Referenced by gui2::format_stats(), dialogs::units_list_preview_pane::get_details(), dialogs::recall_dialog(), and unit_traits().
|
inline |
The type of the unit (accounting for gender and variation).
Definition at line 144 of file unit.hpp.
References type_.
Referenced by absolute_image(), advance_to(), advances_to_translated(), apply_builtin_effect(), battle_context_unit_stats::battle_context_unit_stats(), default_anim_image(), expire_modifications(), generate_traits(), basic_unit_filter_impl::internal_matches_filter(), statistics::recruit_unit(), help::show_unit_description(), statistics::un_recruit_unit(), actions::undo::recruit_action::undo(), unit_type(), and write().
|
inline |
The id of the type of the unit.
If you are dealing with creating units (e.g. recruitment), this is not what you want, as a variation can change this; use type().base_id() instead.
Definition at line 142 of file unit.hpp.
References unit_type::id(), and type_.
Referenced by statistics::advance_unit(), ai::default_recruitment::recruitment::do_combat_analysis(), unit_callable::get_value(), impl_unit_get(), basic_unit_filter_impl::internal_matches_filter(), unit_creator::post_create(), statistics::recall_unit(), set_underlying_id(), statistics::un_recall_unit(), statistics::un_recall_unit_cost(), unit_type(), ai::default_recruitment::recruitment::update_own_units_count(), and write().
|
inline |
The unit type name.
Definition at line 153 of file unit.hpp.
References type_name_.
Referenced by dialogs::advance_unit_dialog(), gui2::format_stats(), dialogs::units_list_preview_pane::get_details(), ai::helper_advance_unit(), id(), dialogs::recall_dialog(), and unit_type().
|
inline |
Definition at line 154 of file unit.hpp.
References undead_variation_.
Referenced by battle_context_unit_stats::battle_context_unit_stats().
|
inline |
The unique internal ID of the unit.
Definition at line 150 of file unit.hpp.
References underlying_id_, and n_unit::unit_id::value.
Referenced by wb::side_actions::actions_of(), BOOST_AUTO_TEST_CASE(), ai::call_lua_filter_fcn(), actions::shroud_clearer::clear_dest(), actions::shroud_clearer::clear_unit(), wb::side_actions::count_actions_of(), wb::manager::create_temp_move(), unit_callable::do_compare(), wb::side_actions::find_first_action_of(), wb::side_actions::find_last_action_of(), impl_unit_equality(), intrusive_ptr_add_ref(), intrusive_ptr_release(), luaW_pushfaivariant(), actions::shroud_clearer::record_sighting(), and wb::side_actions::unit_has_actions().
|
inline |
Information about the unit – a detailed description of it.
Definition at line 166 of file unit.hpp.
References description_.
Referenced by unit_type(), and write().
|
inline |
Set to true for some scenario-specific units which should not be renamed.
Definition at line 199 of file unit.hpp.
References unrenamable_.
Referenced by set_unrenamable().
int unit::upkeep | ( | ) | const |
Definition at line 1498 of file unit.cpp.
References can_recruit(), level(), and upkeep_.
Referenced by unit_callable::get_value().
|
inline |
|
inline |
Definition at line 360 of file unit.hpp.
References unit_detail::get_or_default(), and usage_.
Referenced by unit_callable::get_value(), and impl_unit_get().
|
inline |
Definition at line 229 of file unit.hpp.
References end_turn_.
Referenced by unit_drawer::redraw_unit().
|
inline |
Definition at line 366 of file unit.hpp.
References variables_.
Referenced by unit_callable::get_value(), impl_unit_variables_get(), impl_unit_variables_set(), basic_unit_filter_impl::internal_matches_filter(), and unit().
|
inline |
Definition at line 367 of file unit.hpp.
References variables_.
|
inline |
Definition at line 155 of file unit.hpp.
References variation_.
Referenced by unit_callable::get_value(), impl_unit_get(), and basic_unit_filter_impl::internal_matches_filter().
|
inline |
Definition at line 223 of file unit.hpp.
References max_movement_, and vision_.
Referenced by actions::shroud_clearer::clear_unit(), unit_vision(), and pathfind::vision_path::vision_path().
|
inline |
Definition at line 310 of file unit.hpp.
References get_state(), movement_type_, STATE_SLOWED, and movetype::vision_cost().
Referenced by intf_unit_vision_cost().
Definition at line 1379 of file unit.cpp.
References abilities_, config::add_child(), advancements_, advances_to_, alignment_, alpha_, config::append(), attacks_, attacks_left_, unit_type::base_id(), can_recruit(), config::clear_children(), description_, ellipse_, emit_zoc_, events_, experience_, facing_, filter_recall_, flag_rgb_, formula_man_, gender_, gender_string(), generate_name_, get_states(), goto_, halo_, hit_points_, i, unit_type::icon(), unit_race::id(), id_, unit_type::image(), jamming_, utils::join(), level_, max_attacks_, max_experience_, max_hit_points_, max_movement_, modifications_, movement_, movement_type_, name_, overlays_, profile_, race_, random_traits_, recall_cost_, recruit_list_, resting_, role_, side_, small_profile_, type(), type_id(), type_name_, undead_variation_, underlying_id_, unit_description(), unit_value_, unrenamable_, usage_, n_unit::unit_id::value, variables_, variation_, vision_, movetype::write(), map_location::write_direction(), write_upkeep(), map_location::x, and map_location::y.
Referenced by get_checksum(), impl_unit_get(), basic_unit_filter_impl::internal_matches_filter(), and game_events::WML_HANDLER_FUNCTION().
|
private |
|
inline |
Definition at line 196 of file unit.hpp.
References xp_bar_scaling_.
Referenced by unit_drawer::redraw_unit().
SDL_Color unit::xp_color | ( | ) | const |
Colors for the unit's XP.
Definition at line 1075 of file unit.cpp.
References advances_to(), experience(), get_modification_advances(), game_config::kill_experience, and max_experience().
Referenced by gui2::format_stats(), dialogs::units_list_preview_pane::get_details(), dialogs::recall_dialog(), unit_drawer::redraw_unit(), and unit_xp().
|
friend |
|
private |
Definition at line 524 of file unit.hpp.
Referenced by ability_tooltips(), advance_to(), apply_builtin_effect(), get_abilities(), get_ability_bool(), get_ability_list(), has_ability_by_id(), has_ability_type(), remove_ability_by_id(), unit(), and write().
|
private |
Definition at line 525 of file unit.hpp.
Referenced by advance_to(), apply_builtin_effect(), modification_advancements(), set_advancements(), unit(), and write().
|
private |
Definition at line 442 of file unit.hpp.
Referenced by advance_to(), advancement_icons(), advances_to(), advances_to_translated(), apply_builtin_effect(), can_advance(), get_modification_advances(), set_advances_to(), swap(), unit(), and write().
|
private |
Definition at line 462 of file unit.hpp.
Referenced by advance_to(), alignment(), apply_builtin_effect(), set_alignment(), swap(), unit(), and write().
|
private |
|
private |
Definition at line 517 of file unit.hpp.
Referenced by advance_to(), anim_comp(), apply_builtin_effect(), expire_modifications(), set_hidden(), set_image_halo(), swap(), and ~unit().
|
private |
Definition at line 499 of file unit.hpp.
Referenced by advance_to(), apply_builtin_effect(), attacks(), describe_builtin_effect(), swap(), unit(), and write().
|
private |
Definition at line 484 of file unit.hpp.
Referenced by attacks_left(), new_turn(), remove_attacks_ai(), set_attacks(), swap(), unit(), and write().
|
static |
Definition at line 342 of file unit.hpp.
Referenced by add_modification(), and game_lua_kernel::game_lua_kernel().
|
private |
Definition at line 460 of file unit.hpp.
Referenced by can_recruit(), set_can_recruit(), and swap().
|
private |
Definition at line 526 of file unit.hpp.
Referenced by advance_to(), apply_builtin_effect(), unit(), unit_description(), and write().
|
private |
Definition at line 529 of file unit.hpp.
Referenced by image_ellipse(), set_image_ellipse(), and write().
|
private |
Definition at line 494 of file unit.hpp.
Referenced by advance_to(), apply_builtin_effect(), emits_zoc(), get_emit_zoc(), set_emit_zoc(), swap(), unit(), and write().
|
private |
Definition at line 482 of file unit.hpp.
Referenced by new_turn(), set_movement(), set_user_end_turn(), swap(), toggle_hold_position(), toggle_user_end_turn(), and user_end_turn().
|
private |
|
private |
Definition at line 454 of file unit.hpp.
Referenced by advances(), apply_builtin_effect(), experience(), set_experience(), swap(), unit(), and write().
|
mutableprotected |
Definition at line 501 of file unit.hpp.
Referenced by facing(), set_facing(), unit_animation_component::start_animation(), swap(), unit(), and write().
|
private |
|
private |
Definition at line 463 of file unit.hpp.
Referenced by advance_to(), swap(), TC_image_mods(), team_color(), and write().
|
private |
|
private |
Definition at line 470 of file unit.hpp.
Referenced by ability_tooltips(), add_trait_description(), advance_to(), gender(), generate_name(), swap(), and write().
|
private |
Definition at line 531 of file unit.hpp.
Referenced by advance_to(), generate_name(), unit(), and write().
|
private |
Definition at line 508 of file unit.hpp.
Referenced by get_goto(), new_scenario(), set_goto(), swap(), unit(), and write().
|
private |
Definition at line 528 of file unit.hpp.
Referenced by image_halo(), set_image_halo(), and write().
|
mutableprivate |
Definition at line 520 of file unit.hpp.
Referenced by get_hidden(), set_hidden(), and swap().
|
private |
Definition at line 452 of file unit.hpp.
Referenced by advance_to(), apply_builtin_effect(), heal(), heal_all(), hitpoints(), set_hitpoints(), swap(), take_hit(), unit(), and write().
|
private |
Definition at line 481 of file unit.hpp.
Referenced by hold_position(), new_turn(), set_movement(), swap(), toggle_hold_position(), and toggle_user_end_turn().
|
private |
Definition at line 521 of file unit.hpp.
Referenced by advance_to(), and hp_bar_scaling().
|
private |
Never nullptr, but may point to the null race.
Definition at line 446 of file unit.hpp.
Referenced by clone(), id(), matches_id(), set_id(), set_underlying_id(), swap(), and write().
|
private |
Definition at line 464 of file unit.hpp.
Referenced by apply_builtin_effect(), effect_image_mods(), image_mods(), and swap().
|
private |
Definition at line 508 of file unit.hpp.
Referenced by get_interrupted_move(), move_interrupted(), set_interrupted_move(), and swap().
|
mutableprivate |
Hold the visibility status cache for a unit, when not uncovered.
This is mutable since it is a cache.
Definition at line 542 of file unit.hpp.
Referenced by invisible(), and swap().
|
private |
Definition at line 510 of file unit.hpp.
Referenced by advance_to(), apply_builtin_effect(), is_fearless(), and swap().
|
private |
Definition at line 510 of file unit.hpp.
Referenced by advance_to(), apply_builtin_effect(), is_healthy(), and swap().
|
private |
Definition at line 479 of file unit.hpp.
Referenced by advance_to(), apply_builtin_effect(), jamming(), swap(), and write().
|
staticprivate |
Definition at line 489 of file unit.hpp.
Referenced by get_known_boolean_state_id(), and get_states().
|
private |
Definition at line 488 of file unit.hpp.
Referenced by get_state(), set_state(), and swap().
|
private |
Definition at line 457 of file unit.hpp.
Referenced by add_modification(), advance_to(), level(), set_level(), swap(), unit(), and write().
|
private |
Definition at line 440 of file unit.hpp.
Referenced by ability_tooltips(), add_modification(), get_abilities(), get_ability_bool(), get_location(), unit_animation_component::invalidate(), unit_animation_component::refresh(), unit_animation_component::set_disabled_ghosted(), unit_animation_component::set_ghosted(), unit_animation_component::set_idling(), set_location(), unit_animation_component::set_selecting(), unit_animation_component::set_standing(), unit_animation_component::start_animation(), and swap().
|
private |
Definition at line 485 of file unit.hpp.
Referenced by advance_to(), apply_builtin_effect(), max_attacks(), new_turn(), remove_attacks_ai(), swap(), unit(), and write().
|
private |
Definition at line 455 of file unit.hpp.
Referenced by advance_to(), apply_builtin_effect(), apply_modifications(), max_experience(), swap(), unit(), and write().
|
private |
Definition at line 453 of file unit.hpp.
Referenced by advance_to(), apply_builtin_effect(), max_hitpoints(), swap(), unit(), and write().
|
private |
Definition at line 477 of file unit.hpp.
Referenced by advance_to(), apply_builtin_effect(), swap(), total_movement(), unit(), vision(), and write().
|
private |
Definition at line 512 of file unit.hpp.
Referenced by advance_to(), and swap().
|
private |
Definition at line 523 of file unit.hpp.
Referenced by add_modification(), apply_modifications(), expire_modifications(), generate_traits(), get_traits_list(), modification_count(), swap(), unit(), and write().
|
private |
Definition at line 476 of file unit.hpp.
Referenced by apply_builtin_effect(), end_turn(), movement_left(), new_turn(), set_movement(), swap(), unit(), and write().
|
private |
Definition at line 480 of file unit.hpp.
Referenced by advance_to(), apply_builtin_effect(), defense_modifier(), get_base_resistances(), is_flying(), jamming_cost(), movement_cost(), movement_type(), resistance_against(), swap(), unit(), vision_cost(), and write().
|
private |
Definition at line 447 of file unit.hpp.
Referenced by generate_name(), name(), rename(), set_name(), swap(), and write().
|
private |
Definition at line 496 of file unit.hpp.
Referenced by apply_builtin_effect(), overlays(), swap(), unit(), and write().
|
private |
Definition at line 533 of file unit.hpp.
Referenced by advance_to(), apply_builtin_effect(), big_profile(), unit(), and write().
|
private |
The displayed name of the unit type.
Definition at line 445 of file unit.hpp.
Referenced by advance_to(), generate_name(), race(), swap(), unit(), and write().
|
private |
Definition at line 530 of file unit.hpp.
Referenced by advance_to(), generate_traits(), unit(), and write().
|
private |
Definition at line 459 of file unit.hpp.
Referenced by advance_to(), apply_builtin_effect(), recall_cost(), set_recall_cost(), swap(), unit(), and write().
|
private |
Definition at line 461 of file unit.hpp.
Referenced by recruits(), set_recruits(), swap(), and write().
|
mutableprotected |
Definition at line 418 of file unit.hpp.
Referenced by intrusive_ptr_add_ref(), intrusive_ptr_release(), and ref_count().
|
private |
Definition at line 483 of file unit.hpp.
Referenced by end_turn(), resting(), set_resting(), swap(), unit(), and write().
|
private |
Definition at line 498 of file unit.hpp.
Referenced by get_role(), set_role(), swap(), and write().
|
private |
Definition at line 468 of file unit.hpp.
Referenced by ability_active(), apply_builtin_effect(), invisible(), set_side(), side(), swap(), unit(), and write().
|
private |
Definition at line 534 of file unit.hpp.
Referenced by advance_to(), apply_builtin_effect(), small_profile(), unit(), and write().
|
private |
Definition at line 487 of file unit.hpp.
Referenced by get_state(), get_states(), set_state(), and swap().
|
private |
Definition at line 505 of file unit.hpp.
Referenced by add_trait_description(), advance_to(), swap(), and trait_descriptions().
|
private |
Definition at line 504 of file unit.hpp.
Referenced by add_trait_description(), advance_to(), swap(), and trait_names().
|
private |
|
private |
Never nullptr. Adjusted for gender and variation.
Definition at line 444 of file unit.hpp.
Referenced by advance_to(), swap(), type_name(), and write().
|
private |
Definition at line 449 of file unit.hpp.
Referenced by advance_to(), swap(), undead_variation(), unit(), and write().
|
private |
Definition at line 448 of file unit.hpp.
Referenced by clone(), is_visible_to_team(), set_underlying_id(), swap(), underlying_id(), unit(), and write().
|
private |
|
private |
Definition at line 466 of file unit.hpp.
Referenced by rename(), set_unrenamable(), swap(), unit(), unrenamable(), and write().
|
private |
Definition at line 532 of file unit.hpp.
Referenced by apply_builtin_effect(), loyal(), parse_upkeep(), set_upkeep(), unit(), upkeep(), upkeep_raw(), and write_upkeep().
|
private |
Definition at line 527 of file unit.hpp.
Referenced by set_usage(), usage(), and write().
|
private |
|
private |
Definition at line 450 of file unit.hpp.
Referenced by advance_to(), apply_builtin_effect(), swap(), variation(), and write().
|
private |
Definition at line 478 of file unit.hpp.
Referenced by advance_to(), apply_builtin_effect(), swap(), unit(), vision(), and write().
|
private |
Definition at line 521 of file unit.hpp.
Referenced by advance_to(), and xp_bar_scaling().