|
| unit (unit_ctor_t) |
|
| unit ()=delete |
|
unit_ptr | clone () const |
|
virtual | ~unit () |
|
void | swap (unit &) |
| Swap, for copy and swap idiom. More...
|
|
unit & | operator= (const unit &)=delete |
|
void | advance_to (const unit_type &t, bool use_traits=false) |
| Advances this unit to another type. More...
|
|
const advances_to_t & | advances_to () const |
| Gets the possible types this unit can advance to on level-up. More...
|
|
const std::vector< std::string > | advances_to_translated () const |
| Gets the names of the possible types this unit can advance to on level-up. More...
|
|
void | set_advances_to (const std::vector< std::string > &advances_to) |
| Sets this unit's advancement options. More...
|
|
bool | can_advance () const |
| Checks whether this unit has any options to advance to. More...
|
|
bool | advances () const |
| Checks whether this unit is eligible for level-up. More...
|
|
std::map< std::string, std::string > | advancement_icons () const |
| Gets and image path and and associated description for each advancement option. More...
|
|
std::vector< config > | get_modification_advances () const |
| Gets any non-typed advanced options set by modifications. More...
|
|
std::vector< std::pair< std::string, std::string > > | amla_icons () const |
| Gets the image and description data for modification advancements. More...
|
|
const std::vector< config > & | modification_advancements () const |
| The raw, unparsed data for modification advancements. More...
|
|
void | set_advancements (std::vector< config > advancements) |
| Sets the raw modification advancement option data. More...
|
|
int | side () const |
| The side this unit belongs to. More...
|
|
void | set_side (unsigned int new_side) |
| Sets the side this unit belongs to. More...
|
|
const unit_type & | type () const |
| This unit's type, accounting for gender and variation. More...
|
|
const std::string & | type_id () const |
| The id of this unit's type. More...
|
|
const t_string & | type_name () const |
| Gets the translatable name of this unit's type. More...
|
|
const std::string & | id () const |
| Gets this unit's id. More...
|
|
void | set_id (const std::string &id) |
| Sets this unit's string ID. More...
|
|
std::size_t | underlying_id () const |
| This unit's unique internal ID. More...
|
|
const t_string & | name () const |
| Gets this unit's translatable display name. More...
|
|
void | set_name (const t_string &name) |
| Sets this unit's translatable display name. More...
|
|
void | rename (const std::string &name) |
| Attempts to rename this unit's translatable display name, taking the 'unrenamable' flag into account. More...
|
|
bool | unrenamable () const |
| Whether this unit can be renamed. More...
|
|
void | set_unrenamable (bool unrenamable) |
| Sets the 'unrenamable' flag. More...
|
|
t_string | unit_description () const |
| A detailed description of this unit. More...
|
|
void | set_unit_description (const t_string &new_desc) |
| A detailed description of this unit. More...
|
|
const std::vector< t_string > & | unit_special_notes () const |
| The unit's special notes. More...
|
|
unit_race::GENDER | gender () const |
| The gender of this unit. More...
|
|
UNIT_ALIGNMENT | alignment () const |
| The alignment of this unit. More...
|
|
void | set_alignment (UNIT_ALIGNMENT alignment) |
| Sets the alignment of this unit. More...
|
|
const unit_race * | race () const |
| Gets this unit's race. More...
|
|
int | hitpoints () const |
| The current number of hitpoints this unit has. More...
|
|
int | max_hitpoints () const |
| The max number of hitpoints this unit can have. More...
|
|
void | set_max_hitpoints (int value) |
|
void | set_hitpoints (int hp) |
| Sets the current hitpoint amount. More...
|
|
int | experience () const |
| The current number of experience points this unit has. More...
|
|
int | max_experience () const |
| The max number of experience points this unit can have. More...
|
|
void | set_max_experience (int value) |
|
unsigned int | experience_to_advance () const |
| The number of experience points this unit needs to level up, or 0 if current XP > max XP. More...
|
|
unsigned int | experience_overflow () const |
| The number of experience points over max this unit has, or 0 if current XP < max XP. More...
|
|
void | set_experience (int xp) |
| Sets the current experience point amount. More...
|
|
int | level () const |
| The current level of this unit. More...
|
|
void | set_level (int level) |
| Sets the current level of this unit. More...
|
|
const std::string & | variation () const |
| The ID of the variation of this unit's type. More...
|
|
void | set_undead_variation (const std::string &value) |
| The ID of the undead variation (ie, dwarf, swimmer) of this unit. More...
|
|
const std::string & | undead_variation () const |
|
std::string | small_profile () const |
| An optional profile image to display in Help. More...
|
|
void | set_small_profile (const std::string &value) |
|
std::string | big_profile () const |
| An optional profile image displays when this unit is 'speaking' via [message]. More...
|
|
void | set_big_profile (const std::string &value) |
|
bool | can_recruit () const |
| Whether this unit can recruit other units - ie, are they a leader unit. More...
|
|
void | set_can_recruit (bool canrecruit) |
| Sets whether this unit can recruit other units. More...
|
|
const std::vector< std::string > & | recruits () const |
| The type IDs of the other units this unit may recruit, if possible. More...
|
|
void | set_recruits (const std::vector< std::string > &recruits) |
| Sets the recruit list. More...
|
|
int | cost () const |
| How much gold is required to recruit this unit. More...
|
|
int | recall_cost () const |
| How much gold it costs to recall this unit, or -1 if the side's default recall cost is used. More...
|
|
void | set_recall_cost (int recall_cost) |
| Sets the cost of recalling this unit. More...
|
|
const config & | recall_filter () const |
| Gets the filter constraints upon which units this unit may recall, if able. More...
|
|
void | set_recall_filter (const config &filter) |
| Sets the filter constraints upon which units this unit may recall, if able. More...
|
|
const std::string & | get_role () const |
| Gets this unit's role. More...
|
|
void | set_role (const std::string &role) |
| Sets a unit's role. More...
|
|
std::string | usage () const |
| Gets this unit's usage. More...
|
|
void | set_usage (const std::string &usage) |
| Sets this unit's usage. More...
|
|
config & | variables () |
| Gets any user-defined variables this unit 'owns'. More...
|
|
const config & | variables () const |
| Const overload of variables. More...
|
|
bool | get_hidden () const |
| Gets whether this unit is currently hidden on the map. More...
|
|
void | set_hidden (bool state) const |
| Sets whether the unit is hidden on the map. More...
|
|
double | hp_bar_scaling () const |
| The factor by which the HP bar should be scaled. More...
|
|
double | xp_bar_scaling () const |
| The factor by which the XP bar should be scaled. More...
|
|
bool | hold_position () const |
| Whether the unit has been instructed to hold its position. More...
|
|
void | toggle_hold_position () |
| Toggle the unit's hold position status. More...
|
|
void | set_user_end_turn (bool value=true) |
| Set whether the user ended their turn. More...
|
|
void | toggle_user_end_turn () |
| Toggle whether the user ended their turn. More...
|
|
bool | user_end_turn () const |
| Check whether the user ended their turn. More...
|
|
void | new_turn () |
| Refresh unit for the beginning of a turn. More...
|
|
void | end_turn () |
| Refresh unit for the end of a turn. More...
|
|
void | new_scenario () |
| Refresh unit for the beginning of a new scenario. More...
|
|
bool | take_hit (int damage) |
| Damage the unit. More...
|
|
void | heal (int amount) |
| Heal the unit. More...
|
|
void | heal_fully () |
| Fully heal the unit, restoring it to max hitpoints. More...
|
|
const std::set< std::string > | get_states () const |
| Get the status effects currently affecting the unit. More...
|
|
bool | get_state (const std::string &state) const |
| Check if the unit is affected by a status effect. More...
|
|
void | set_state (const std::string &state, bool value) |
| Set whether the unit is affected by a status effect. More...
|
|
void | set_state (state_t state, bool value) |
| Set whether the unit is affected by a status effect. More...
|
|
bool | get_state (state_t state) const |
| Check if the unit is affected by a status effect. More...
|
|
bool | poisoned () const |
| Check if the unit has been poisoned. More...
|
|
bool | incapacitated () const |
| Check if the unit has been petrified. More...
|
|
bool | slowed () const |
| Check if the unit has been slowed. More...
|
|
attack_itors | attacks () |
| Gets an iterator over this unit's attacks. More...
|
|
const_attack_itors | attacks () const |
| Const overload of attacks. More...
|
|
template<typename... Args> |
attack_ptr | add_attack (attack_itors::iterator position, Args &&... args) |
| Adds a new attack to the unit. More...
|
|
bool | remove_attack (attack_ptr atk) |
| Remove an attack from the unit. More...
|
|
void | remove_attacks_ai () |
| Set the unit to have no attacks left for this turn. More...
|
|
int | damage_from (const attack_type &attack, bool attacker, const map_location &loc, const_attack_ptr weapon=nullptr) const |
| Calculates the damage this unit would take from a certain attack. More...
|
|
int | max_attacks () const |
| The maximum number of attacks this unit may perform per turn, usually 1. More...
|
|
void | set_max_attacks (int value) |
|
int | attacks_left () const |
| Gets the remaining number of attacks this unit can perform this turn. More...
|
|
int | attacks_left (bool base_value) const |
| Gets the remaining number of attacks this unit can perform this turn. More...
|
|
void | set_attacks (int left) |
| Sets the number of attacks this unit has left this turn. More...
|
|
int | defense_modifier (const t_translation::terrain_code &terrain) const |
| The unit's defense on a given terrain. More...
|
|
int | resistance_against (const std::string &damage_name, bool attacker, const map_location &loc, const_attack_ptr weapon=nullptr, const_attack_ptr opp_weapon=nullptr) const |
| The unit's resistance against a given damage type. More...
|
|
int | resistance_against (const attack_type &atk, bool attacker, const map_location &loc, const_attack_ptr weapon=nullptr) const |
| The unit's resistance against a given attack. More...
|
|
utils::string_map | get_base_resistances () const |
| Gets resistances without any abilities applied. More...
|
|
void | generate_traits (bool must_have_only=false) |
| Applies mandatory traits (e.g. More...
|
|
const std::vector< t_string > & | trait_names () const |
| Gets the names of the currently registered traits. More...
|
|
const std::vector< t_string > & | trait_descriptions () const |
| Gets the descriptions of the currently registered traits. More...
|
|
std::vector< std::string > | get_traits_list () const |
| Gets a list of the traits this unit currently has. More...
|
|
void | add_trait_description (const config &trait, const t_string &description) |
| Register a trait's name and its description for the UI's use. More...
|
|
int | upkeep () const |
| Gets the amount of gold this unit costs a side per turn. More...
|
|
upkeep_t | upkeep_raw () const |
| Gets the raw variant controlling the upkeep value. More...
|
|
void | set_upkeep (upkeep_t v) |
| Sets the upkeep value to a specific value value. More...
|
|
bool | loyal () const |
| Gets whether this unit is loyal - ie, it costs no upkeep. More...
|
|
bool | is_fearless () const |
| Gets whether this unit is fearless - ie, unaffected by time of day. More...
|
|
bool | is_healthy () const |
| Gets whether this unit is healthy - ie, always rest heals. More...
|
|
int | total_movement () const |
| The maximum moves this unit has. More...
|
|
void | set_total_movement (int value) |
|
int | movement_left () const |
| Gets how far a unit can move, considering the incapacitated flag. More...
|
|
int | movement_left (bool base_value) const |
| Gets how far a unit can move. More...
|
|
void | set_movement (int moves, bool unit_action=false) |
| Set this unit's remaining movement to moves. More...
|
|
bool | has_moved () const |
| Checks if this unit has moved. More...
|
|
void | remove_movement_ai () |
| Sets the unit to have no moves left for this turn. More...
|
|
bool | resting () const |
| Checks whether this unit is 'resting'. More...
|
|
void | set_resting (bool rest) |
| Sets this unit's resting status. More...
|
|
bool | emits_zoc () const |
| Tests whether the unit has a zone-of-control, considering incapacitated. More...
|
|
bool | get_emit_zoc () const |
| Gets the raw zone-of-control flag, disregarding incapacitated. More...
|
|
void | set_emit_zoc (bool val) |
| Sets the raw zone-of-control flag. More...
|
|
const map_location & | get_location () const |
| The current map location this unit is at. More...
|
|
void | set_location (const map_location &loc) |
| Sets this unit's map location. More...
|
|
map_location::DIRECTION | facing () const |
| The current direction this unit is facing within its hex. More...
|
|
void | set_facing (map_location::DIRECTION dir) const |
| The this unit's facing. More...
|
|
bool | has_goto () const |
| Gets whether this unit has a multi-turn destination set. More...
|
|
const map_location & | get_goto () const |
| The map location to which this unit is moving over multiple turns, if any. More...
|
|
void | set_goto (const map_location &new_goto) |
| Sets this unit's long term destination. More...
|
|
int | vision () const |
| Gets the unit's vision points. More...
|
|
int | jamming () const |
| Gets the unit's jamming points. More...
|
|
bool | move_interrupted () const |
| Check whether the unit's move has been interrupted. More...
|
|
const map_location & | get_interrupted_move () const |
| Get the target location of the unit's interrupted move. More...
|
|
void | set_interrupted_move (const map_location &interrupted_move) |
| Set the target location of the unit's interrupted move. More...
|
|
const movetype & | movement_type () const |
| Get the unit's movement type. More...
|
|
int | movement_cost (const t_translation::terrain_code &terrain) const |
| Get the unit's movement cost on a particular terrain. More...
|
|
int | vision_cost (const t_translation::terrain_code &terrain) const |
| Get the unit's vision cost on a particular terrain. More...
|
|
int | jamming_cost (const t_translation::terrain_code &terrain) const |
| Get the unit's jamming cost on a particular terrain. More...
|
|
bool | is_flying () const |
| Check if the unit is a flying unit. More...
|
|
config & | get_modifications () |
| Get the raw modifications. More...
|
|
const config & | get_modifications () const |
| Set the raw modifications. More...
|
|
std::size_t | modification_count (const std::string &type, const std::string &id) const |
| Count modifications of a particular type. More...
|
|
void | add_modification (const std::string &type, const config &modification, bool no_add=false) |
| Add a new modification to the unit. More...
|
|
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) |
| Apply a builtin effect to the unit. More...
|
|
std::string | describe_builtin_effect (std::string type, const config &effect) |
| Construct a string describing a built-in effect. More...
|
|
void | apply_modifications () |
| Re-apply all saved modifications. More...
|
|
unit_animation_component & | anim_comp () const |
|
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 |
| Get the unit's halo image. More...
|
|
void | set_image_halo (const std::string &halo) |
| Set the unit's halo image. More...
|
|
std::string | image_ellipse () const |
| Get the unit's ellipse image. More...
|
|
void | set_image_ellipse (const std::string &ellipse) |
| Set the unit's ellipse image. More...
|
|
const std::string & | flag_rgb () const |
| Get the source color palette to use when recoloring the unit's image. More...
|
|
std::string | TC_image_mods () const |
| Constructs a recolor (RC) IPF string for this unit's team color. More...
|
|
const std::string & | effect_image_mods () const |
| Gets any IPF image mods applied by effects. More...
|
|
std::string | image_mods () const |
| Gets an IPF string containing all IPF image mods. More...
|
|
const std::vector< std::string > & | overlays () const |
| Get the unit's overlay images. More...
|
|
color_t | hp_color () const |
| Color for this unit's current hitpoints. More...
|
|
color_t | hp_color (int hitpoints) const |
| Color for this unit's hitpoints. More...
|
|
color_t | xp_color () const |
| Color for this unit's XP. More...
|
|
bool | get_ability_bool (const std::string &tag_name, const map_location &loc) const |
| Checks whether this unit currently possesses or is affected by a given ability. More...
|
|
bool | get_ability_bool (const std::string &tag_name) const |
| Checks whether this unit currently possesses or is affected by a given ability. More...
|
|
unit_ability_list | get_abilities (const std::string &tag_name, const map_location &loc) const |
| Gets the unit's active abilities of a particular type if it were on a specified location. More...
|
|
unit_ability_list | get_abilities (const std::string &tag_name) const |
| Gets the unit's active abilities of a particular type. More...
|
|
unit_ability_list | get_abilities_weapons (const std::string &tag_name, const map_location &loc, const_attack_ptr weapon=nullptr, const_attack_ptr opp_weapon=nullptr) const |
|
unit_ability_list | get_abilities_weapons (const std::string &tag_name, const_attack_ptr weapon=nullptr, const_attack_ptr opp_weapon=nullptr) const |
|
std::vector< std::tuple< std::string, t_string, t_string, t_string > > | ability_tooltips () const |
| Gets the names and descriptions of this unit's abilities. More...
|
|
std::vector< std::tuple< std::string, t_string, t_string, t_string > > | ability_tooltips (boost::dynamic_bitset<> &active_list, const map_location &loc) const |
| Gets the names and descriptions of this unit's abilities. More...
|
|
std::vector< std::string > | get_ability_list () const |
| Get a list of all abilities by ID. More...
|
|
bool | has_ability_type (const std::string &ability) const |
| Check if the unit has an ability of a specific type. More...
|
|
bool | has_ability_by_id (const std::string &ability) const |
| Check if the unit has an ability of a specific ID. More...
|
|
void | remove_ability_by_id (const std::string &ability) |
| Removes a unit's abilities with a specific ID. More...
|
|
unit_formula_manager & | formula_manager () const |
| Get the unit formula manager. More...
|
|
void | generate_name () |
| Generates a random race-appropriate name if one has not already been provided. More...
|
|
bool | invisible (const map_location &loc, bool see_all=true) const |
|
bool | is_visible_to_team (const team &team, bool const see_all=true) const |
|
bool | is_visible_to_team (const map_location &loc, const team &team, bool const see_all=true) const |
| Return true if the unit would be visible to team if its location were loc. More...
|
|
void | write (config &cfg, bool write_all=true) const |
| Serializes the current unit metadata values. More...
|
|
unit & | mark_clone (bool is_temporary) |
| Mark this unit as clone so it can be inserted to unit_map. More...
|
|
void | set_appearance_changed (bool value) |
|
bool | appearance_changed () const |
|