A single unit type that the player may recruit. More...
#include <types.hpp>
Classes | |
struct | ability_metadata |
struct | defaut_ctor_t |
Public Types | |
enum | BUILD_STATUS { NOT_BUILT , CREATED , VARIATIONS , HELP_INDEXED , FULL } |
Records the status of the lazy building of unit types. More... | |
using | error = unit_type_error |
Public Member Functions | |
unit_type (const config &cfg, const std::string &parent_id="") | |
Creates a unit type for the given config, but delays its build till later. More... | |
unit_type (config &&cfg, const std::string &parent_id="") | |
Creates a unit type for the given config, but delays its build till later. More... | |
unit_type () | |
unit_type (const unit_type &o) | |
unit_type (unit_type &&o)=default | |
~unit_type () | |
void | build (BUILD_STATUS status, const movement_type_map &movement_types, const race_map &races, const config_array_view &traits) |
Performs a build of this to the indicated stage. More... | |
void | build (BUILD_STATUS status, const movement_type_map &movement_types, const race_map &races, const config_array_view &traits) const |
Performs a build of this to the indicated stage. More... | |
std::set< std::string > | advancement_tree () const |
Get the advancement tree. More... | |
const std::vector< std::string > & | advances_to () const |
A vector of unit_type ids that this unit_type can advance to. More... | |
const std::vector< std::string > | advances_from () const |
A vector of unit_type ids that can advance to this unit_type. More... | |
config::const_child_itors | modification_advancements () const |
Returns two iterators pointing to a range of AMLA configs. More... | |
const unit_type & | get_gender_unit_type (std::string gender) const |
Returns a gendered variant of this unit_type. More... | |
const unit_type & | get_gender_unit_type (unit_race::GENDER gender) const |
Returns a gendered variant of this unit_type based on the given parameter. More... | |
const unit_type & | get_variation (const std::string &id) const |
const std::string & | undead_variation () const |
Info on the type of unit that the unit reanimates as. More... | |
unsigned int | num_traits () const |
const t_string & | type_name () const |
The name of the unit in the current language setting. More... | |
const std::string & | id () const |
The id for this unit_type. More... | |
const std::string | log_id () const |
A variant on id() that is more descriptive, for use with message logging. More... | |
const std::string & | parent_id () const |
The id of the original type from which this (variation) descended. More... | |
const std::string & | variation_id () const |
The id of this variation; empty if it's a gender variation or a base unit. More... | |
t_string | unit_description () const |
std::vector< t_string > | direct_special_notes () const |
Returns only the notes defined by [unit_type][special_note] tags, excluding any that would be found from abilities, attacks, etc. More... | |
std::vector< t_string > | special_notes () const |
Returns all notes that should be displayed in the help page for this type, including those found in abilities and attacks. More... | |
int | hitpoints () const |
double | hp_bar_scaling () const |
double | xp_bar_scaling () const |
int | level () const |
int | recall_cost () const |
int | movement () const |
int | vision () const |
int | vision (bool base_value) const |
If base_value is set to true, do not fall back to movement(). More... | |
int | jamming () const |
int | max_attacks () const |
int | cost () const |
const std::string & | default_variation () const |
const t_string & | variation_name () const |
const std::string & | usage () const |
const std::string & | image () const |
const std::string & | icon () const |
const std::string & | small_profile () const |
const std::string & | big_profile () const |
std::string | halo () const |
std::string | ellipse () const |
bool | generate_name () const |
const std::vector< unit_animation > & | animations () const |
const std::string & | flag_rgb () const |
const_attack_itors | attacks () const |
const std::string | movement_type_id () const |
const movetype & | movement_type () const |
int | experience_needed (bool with_acceleration=true) const |
unit_alignments::type | alignment () const |
const std::vector< ability_metadata > & | abilities_metadata () const |
const std::vector< ability_metadata > & | adv_abilities_metadata () const |
Some extra abilities that may be gained through AMLA advancements. More... | |
bool | can_advance () const |
bool | musthave_status (const std::string &status) const |
bool | has_zoc () const |
bool | has_ability_by_id (const std::string &ability) const |
std::vector< std::string > | get_ability_list () const |
config::const_child_itors | possible_traits () const |
const config & | abilities_cfg () const |
config::const_child_itors | advancements () const |
config::const_child_itors | events () const |
bool | has_random_traits () const |
const std::vector< unit_race::GENDER > & | genders () const |
The returned vector will not be empty, provided this has been built to the HELP_INDEXED status. More... | |
bool | has_gender_variation (const unit_race::GENDER gender) const |
std::vector< std::string > | variations () const |
const variations_map & | variation_types () const |
bool | has_variation (const std::string &variation_id) const |
bool | show_variations_in_help () const |
Whether the unit type has at least one help-visible variation. More... | |
std::string | race_id () const |
Returns the ID of this type's race without the need to build the type. More... | |
const unit_race * | race () const |
Never returns nullptr, but may point to the null race. More... | |
bool | hide_help () const |
bool | do_not_list () const |
const config & | get_cfg () const |
int | resistance_against (const std::string &damage_name, bool attacker) const |
Gets resistance while considering custom WML abilities. More... | |
void | apply_scenario_fix (const config &cfg) |
void | remove_scenario_fixes () |
Static Public Member Functions | |
static void | check_id (std::string &id) |
Validate the id argument. More... | |
static std::string | alignment_description (unit_alignments::type align, unit_race::GENDER gender=unit_race::MALE) |
Implementation detail of unit_type::alignment_description. More... | |
Private Types | |
typedef std::map< std::string, unit_type > | variations_map |
Private Member Functions | |
unit_type (defaut_ctor_t, const config &cfg, const std::string &parent_id) | |
void | build_full (const movement_type_map &movement_types, const race_map &races, const config_array_view &traits) |
Load data into an empty unit_type (build to FULL). More... | |
void | build_help_index (const movement_type_map &movement_types, const race_map &races, const config_array_view &traits) |
Partially load data into an empty unit_type (build to HELP_INDEXED). More... | |
void | build_created () |
Load the most needed data into an empty unit_type (build to CREATE). More... | |
bool | resistance_filter_matches (const config &cfg, bool attacker, const std::string &damage_name, int res) const |
Identical to unit::resistance_filter_matches. More... | |
config & | writable_cfg () |
void | fill_variations () |
Processes [variation] tags of ut_cfg, handling inheritance and child clearing. More... | |
void | fill_variations_and_gender () |
std::unique_ptr< unit_type > | create_sub_type (const config &var_cfg, bool default_inherit) |
Handles inheritance for configs of [male], [female], and [variation]. More... | |
unit_type & | operator= (const unit_type &o)=delete |
Friends | |
class | unit_type_data |
A single unit type that the player may recruit.
Individual units are defined by the unit class.
using unit_type::error = unit_type_error |
|
private |
|
private |
Definition at line 102 of file types.cpp.
References base_unit_id_, check_id(), id_, LOG_UT, config::optional_child(), and parent_id_.
|
explicit |
|
explicit |
Creates a unit type for the given config, but delays its build till later.
Definition at line 164 of file types.cpp.
References built_cfg_.
unit_type::unit_type | ( | ) |
Referenced by unit_type().
unit_type::unit_type | ( | const unit_type & | o | ) |
Definition at line 53 of file types.cpp.
References gender_types_, and unit_type().
|
default |
|
inline |
Definition at line 234 of file types.hpp.
References config::child_or_empty(), and get_cfg().
Referenced by unit::advance_to(), and special_notes().
|
inline |
Definition at line 217 of file types.hpp.
References abilities_.
Referenced by help::unit_topic_generator::operator()().
|
inline |
Some extra abilities that may be gained through AMLA advancements.
Definition at line 220 of file types.hpp.
References adv_abilities_.
Referenced by help::unit_topic_generator::operator()().
std::set< std::string > unit_type::advancement_tree | ( | ) | const |
Get the advancement tree.
Definition at line 647 of file types.cpp.
References advancement_tree_internal(), and id_.
Referenced by ai::default_recruitment::recruitment::do_similarity_penalty().
|
inline |
Definition at line 237 of file types.hpp.
References advancements_.
Referenced by unit::advance_to().
const std::vector< std::string > unit_type::advances_from | ( | ) | const |
A vector of unit_type ids that can advance to this unit_type.
Definition at line 654 of file types.cpp.
References unit_type_data::build_all(), HELP_INDEXED, id_, unit_type_data::types(), and unit_types.
Referenced by help::unit_topic_generator::operator()().
|
inline |
A vector of unit_type ids that this unit_type can advance to.
Definition at line 115 of file types.hpp.
References advances_to_.
Referenced by unit::advance_to(), advancement_tree_internal(), and help::unit_topic_generator::operator()().
|
inline |
Definition at line 193 of file types.hpp.
References alignment_.
Referenced by unit::advance_to(), battle_context_unit_stats::battle_context_unit_stats(), wfl::unit_type_callable::get_value(), and help::unit_topic_generator::operator()().
|
static |
Implementation detail of unit_type::alignment_description.
Definition at line 841 of file types.cpp.
References _(), and unit_race::FEMALE.
Referenced by attack_info(), gui2::dialogs::unit_recruit::filter_text_changed(), help::unit_topic_generator::operator()(), gui2::dialogs::unit_recall::pre_show(), gui2::unit_preview_pane::set_displayed_type(), gui2::unit_preview_pane::set_displayed_unit(), and unit_alignment().
const std::vector< unit_animation > & unit_type::animations | ( | ) | const |
Definition at line 536 of file types.cpp.
References animations_, unit_animation::fill_initial_animations(), and get_cfg().
Referenced by unit_animation_component::reset_after_advance().
void unit_type::apply_scenario_fix | ( | const config & | cfg | ) |
Definition at line 1375 of file types.cpp.
References advancements_, advances_to_, build_created(), unit_type_data::build_unit_type(), config::child_range(), utils::contains(), cost_, experience_needed_, gender_types_, config::get(), get_cfg(), config::has_child(), config::optional_child(), utils::split(), unit_types, VARIATIONS, and variations_.
const_attack_itors unit_type::attacks | ( | ) | const |
Definition at line 545 of file types.cpp.
References attacks_cache_, get_cfg(), and make_attack_itors().
Referenced by unit::advance_to(), combine_special_notes(), wfl::unit_type_callable::get_value(), impl_unit_attacks_len(), help::unit_topic_generator::operator()(), ai::default_recruitment::recruitment::simulate_attack(), and special_notes().
|
inline |
Definition at line 179 of file types.hpp.
References profile_.
Referenced by unit::advance_to(), and help::unit_topic_generator::operator()().
void unit_type::build | ( | BUILD_STATUS | status, |
const movement_type_map & | movement_types, | ||
const race_map & | races, | ||
const config_array_view & | traits | ||
) |
Performs a build of this to the indicated stage.
Definition at line 420 of file types.cpp.
References build_created(), build_full(), build_help_index(), CREATED, DBG_UT, ERR_UT, FULL, HELP_INDEXED, log_id(), NOT_BUILT, and VARIATIONS.
Referenced by build(), and unit_type_data::build_unit_type().
|
inline |
|
private |
Load the most needed data into an empty unit_type (build to CREATE).
This creates the gender-specific types (if needed) and also defines how much experience is needed to advance as well as what this advances to.
Definition at line 377 of file types.cpp.
References advances_to_, build_status_, cost_, CREATED, DBG_UT, experience_needed_, gender_types_, get_cfg(), i, image_, log_id(), utils::split(), type_name_, variation_name_, and variations_.
Referenced by apply_scenario_fix(), build(), and build_help_index().
|
private |
Load data into an empty unit_type (build to FULL).
Definition at line 193 of file types.cpp.
References game_config::add_color_info(), build_help_index(), build_status_, FULL, gender_types_, get_cfg(), game_config::hp_bar_scaling, hp_bar_scaling_, i, level_, unit_race::null_race, race_, unit_race::undead_variation(), undead_variation_, variations_, game_config_view::wrap(), game_config::xp_bar_scaling, xp_bar_scaling_, and zoc_.
Referenced by build().
|
private |
Partially load data into an empty unit_type (build to HELP_INDEXED).
Definition at line 236 of file types.cpp.
References abilities_, config::add_child(), unit_race::additional_traits(), adjust_profile(), adv_abilities_, alignment_, build_created(), build_status_, config::child_range(), config::clear(), DBG_UT, default_variation_, description_, do_not_list_, flag_rgb_, g, gender_types_, genders_, get_cfg(), string_enums::enum_base< Definition >::get_enum(), HELP_INDEXED, hide_help_, hitpoints_, i, icon_, jamming_, level_, unit_race::MALE, max_attacks_, movetype::merge(), movement_, movement_type_, movement_type_id_, unit_race::null_race, unit_race::num_traits(), num_traits_, config::optional_child(), possible_traits_, profile_, race_, recall_cost_, small_profile_, special_notes_, utils::split(), string_gender(), t, type_name_, unit_race::undead_variation(), undead_variation_, usage_, unit_race::uses_global_traits(), variations_, and vision_.
Referenced by build(), and build_full().
|
inline |
Definition at line 222 of file types.hpp.
References advances_to_.
Referenced by help::unit_topic_generator::operator()().
|
static |
Validate the id argument.
Replaces invalid characters in the reference with underscores.
id | The proposed id for a unit_type. |
error | if id starts with a space. |
Definition at line 1474 of file types.cpp.
Referenced by get_unit_type(), and unit_type().
|
inline |
Definition at line 172 of file types.hpp.
References cost_.
Referenced by unit::advance_to(), events::menu_handler::can_recruit(), ai::default_recruitment::recruitment::compare_unit_types(), wfl::unit_type_callable::get_value(), team::minimum_recruit_price(), help::unit_topic_generator::operator()(), ai::default_recruitment::recruitment::recall_unit_value(), actions::recruit_unit(), ai::simulated_recruit(), SYNCED_COMMAND_HANDLER_FUNCTION(), and actions::undo::recruit_action::undo().
|
private |
Handles inheritance for configs of [male], [female], and [variation].
Also removes gendered children, as those serve no purpose. default_inherit is the default value for inherit=.
Definition at line 1034 of file types.cpp.
References config::clear_children(), get_cfg(), config::inherit_from(), and parent_id().
Referenced by fill_variations(), and fill_variations_and_gender().
|
inline |
Definition at line 173 of file types.hpp.
References default_variation_.
Referenced by unit::init().
|
inline |
Returns only the notes defined by [unit_type][special_note] tags, excluding any that would be found from abilities, attacks, etc.
Definition at line 155 of file types.hpp.
References special_notes_.
Referenced by unit::advance_to().
|
inline |
Definition at line 279 of file types.hpp.
References do_not_list_.
|
inline |
|
inline |
Definition at line 240 of file types.hpp.
References config::child_range(), and get_cfg().
int unit_type::experience_needed | ( | bool | with_acceleration = true | ) | const |
Definition at line 579 of file types.cpp.
References experience_needed_.
Referenced by unit::advance_to(), battle_context_unit_stats::battle_context_unit_stats(), wfl::unit_type_callable::get_value(), and help::unit_topic_generator::operator()().
|
private |
Processes [variation] tags of ut_cfg, handling inheritance and child clearing.
Definition at line 1051 of file types.cpp.
References create_sub_type(), debug_id_, ERR_CF, get_cfg(), and variations_.
Referenced by fill_variations_and_gender().
|
private |
Definition at line 1080 of file types.cpp.
References create_sub_type(), fill_variations(), gender_types_, get_cfg(), and gui2::dialogs::loading_screen::progress().
const std::string & unit_type::flag_rgb | ( | ) | const |
Definition at line 722 of file types.cpp.
References flag_rgb_, and game_config::unit_rgb.
Referenced by unit::advance_to(), help::unit_topic_generator::operator()(), editor::mouse_action_unit::set_unit_mouse_overlay(), editor::unit_palette::setup_item(), and gui2::dialogs::faction_select::update_leader_image().
|
inline |
The returned vector will not be empty, provided this has been built to the HELP_INDEXED status.
Definition at line 249 of file types.hpp.
References genders_.
Referenced by help::unit_topic_generator::operator()(), and editor::mouse_action_unit::up_left().
|
inline |
std::vector< std::string > unit_type::get_ability_list | ( | ) | const |
Definition at line 606 of file types.cpp.
References get_cfg(), and config::optional_child().
Referenced by wfl::unit_type_callable::get_value().
|
inline |
Definition at line 281 of file types.hpp.
References built_cfg_, and cfg_.
Referenced by abilities_cfg(), unit::advance_to(), animations(), unit_type_data::apply_base_unit(), apply_scenario_fix(), attacks(), build_created(), build_full(), build_help_index(), create_sub_type(), ellipse(), events(), fill_variations(), fill_variations_and_gender(), generate_name(), get_ability_list(), halo(), has_ability_by_id(), help::unit_topic_generator::operator()(), race_id(), unit_drawer::redraw_unit(), remove_scenario_fixes(), and resistance_against().
const unit_type & unit_type::get_gender_unit_type | ( | std::string | gender | ) | const |
Returns a gendered variant of this unit_type.
gender | "male" or "female". |
Definition at line 455 of file types.cpp.
References unit_race::FEMALE, unit_race::MALE, unit_race::s_female, and unit_race::s_male.
Referenced by unit::advance_to(), unit::apply_builtin_effect(), impl_unit_type_lookup(), impl_unit_type_next(), help::unit_topic_generator::operator()(), and gui2::dialogs::faction_select::update_leader_image().
const unit_type & unit_type::get_gender_unit_type | ( | unit_race::GENDER | gender | ) | const |
Returns a gendered variant of this unit_type based on the given parameter.
Definition at line 466 of file types.cpp.
References gender_types_, and i.
const unit_type & unit_type::get_variation | ( | const std::string & | id | ) | const |
Definition at line 476 of file types.cpp.
References i, and variations_.
Referenced by unit::advance_to(), impl_unit_type_lookup(), intf_transform_unit(), help::unit_topic_generator::operator()(), and gui2::dialogs::unit_create::update_displayed_type().
|
inline |
bool unit_type::has_ability_by_id | ( | const std::string & | ability | ) | const |
|
inline |
Definition at line 250 of file types.hpp.
References genders_.
Referenced by impl_unit_type_next(), and help::unit_topic_generator::operator()().
bool unit_type::has_random_traits | ( | ) | const |
Definition at line 727 of file types.cpp.
References config_attribute_value::blank(), num_traits(), possible_traits(), and config_attribute_value::str().
bool unit_type::has_variation | ( | const std::string & | variation_id | ) | const |
variation_id | The id of the variation we search for. |
Definition at line 759 of file types.cpp.
References variation_id(), and variations_.
Referenced by unit::apply_builtin_effect(), and intf_transform_unit().
|
inline |
bool unit_type::hide_help | ( | ) | const |
Definition at line 626 of file types.cpp.
References unit_type_data::hide_help(), hide_help_, unit_race::id(), id_, race_, and unit_types.
Referenced by help::generate_unit_sections(), and help::show_unit_description().
|
inline |
Definition at line 161 of file types.hpp.
References hitpoints_.
Referenced by unit::advance_to(), battle_context_unit_stats::battle_context_unit_stats(), ai::default_recruitment::recruitment::compare_unit_types(), ai::default_recruitment::recruitment::do_combat_analysis(), ai::default_recruitment::attack_simulation::get_avg_hp_of_combatant(), wfl::unit_type_callable::get_value(), help::unit_topic_generator::operator()(), and ai::default_recruitment::recruitment::simulate_attack().
|
inline |
Definition at line 162 of file types.hpp.
References hp_bar_scaling_.
Referenced by unit::advance_to(), and unit::init().
|
inline |
Definition at line 177 of file types.hpp.
References icon_.
Referenced by unit::absolute_image(), unit::default_anim_image(), and unit::write().
|
inline |
The id for this unit_type.
Definition at line 141 of file types.hpp.
References id_.
Referenced by unit::advance_to(), wfl::unit_type_callable::do_compare(), ai::recruit_result::do_execute(), help::generate_unit_sections(), editor::unit_palette::get_id(), wfl::unit_type_callable::get_value(), impl_unit_type_tostring(), help::unit_topic_generator::operator()(), ai::default_recruitment::recruitment::recruit_matches_type(), and unit::type_id().
|
inline |
Definition at line 176 of file types.hpp.
References image_.
Referenced by unit::absolute_image(), unit::default_anim_image(), help::unit_topic_generator::operator()(), gui2::dialogs::unit_advance::pre_show(), editor::mouse_action_unit::set_unit_mouse_overlay(), editor::unit_palette::setup_item(), gui2::dialogs::faction_select::update_leader_image(), and unit::write().
|
inline |
Definition at line 170 of file types.hpp.
References jamming_.
Referenced by unit::advance_to(), and help::unit_topic_generator::operator()().
|
inline |
Definition at line 164 of file types.hpp.
References level_.
Referenced by unit::advance_to(), battle_context_unit_stats::battle_context_unit_stats(), wfl::unit_type_callable::get_value(), help::unit_topic_generator::operator()(), and ai::default_recruitment::recruitment::recruit_matches_type().
|
inline |
A variant on id() that is more descriptive, for use with message logging.
Definition at line 143 of file types.hpp.
References debug_id_, and id_.
Referenced by unit::advances_to_translated(), build(), build_created(), and unit::generate_traits().
|
inline |
Definition at line 171 of file types.hpp.
References max_attacks_.
Referenced by unit::advance_to().
|
inline |
Returns two iterators pointing to a range of AMLA configs.
Definition at line 120 of file types.hpp.
References advancements_.
Referenced by help::unit_topic_generator::operator()().
|
inline |
Definition at line 166 of file types.hpp.
References movement_.
Referenced by unit::advance_to(), wfl::unit_type_callable::get_value(), help::unit_topic_generator::operator()(), and vision().
|
inline |
Definition at line 189 of file types.hpp.
References movement_type_.
Referenced by unit::advance_to(), wfl::gamestate::DEFINE_WFL_FUNCTION(), ai::default_recruitment::recruitment::get_average_defense(), help::unit_topic_generator::operator()(), special_notes(), and ai::default_recruitment::recruitment::update_average_local_cost().
|
inline |
Definition at line 188 of file types.hpp.
References movement_type_id_.
bool unit_type::musthave_status | ( | const std::string & | status | ) | const |
Definition at line 674 of file types.cpp.
References config::child_range(), possible_traits(), and utils::split().
Referenced by battle_context_unit_stats::battle_context_unit_stats(), and wfl::unit_type_callable::get_value().
|
inline |
Definition at line 135 of file types.hpp.
References num_traits_.
Referenced by unit::generate_traits(), has_random_traits(), and help::unit_topic_generator::operator()().
|
inline |
The id of the original type from which this (variation) descended.
Definition at line 145 of file types.hpp.
References parent_id_.
Referenced by unit::apply_builtin_effect(), battle_context_unit_stats::battle_context_unit_stats(), create_sub_type(), unit_filter_impl::unit_filter_compound::fill(), statistics_t::recruit_unit(), statistics_t::un_recruit_unit(), actions::undo::recruit_action::write(), and unit::write().
|
inline |
Definition at line 231 of file types.hpp.
References config::child_range(), and possible_traits_.
Referenced by unit::generate_traits(), wfl::unit_type_callable::get_value(), has_random_traits(), musthave_status(), and help::unit_topic_generator::operator()().
|
inline |
Never returns nullptr, but may point to the null race.
Requires building to the HELP_INDEXED status to get the correct race.
Definition at line 277 of file types.hpp.
References race_.
Referenced by unit::advance_to(), and help::unit_topic_generator::operator()().
|
inline |
Returns the ID of this type's race without the need to build the type.
Definition at line 272 of file types.hpp.
References get_cfg().
Referenced by wfl::unit_type_callable::get_value(), and help::unit_topic_generator::operator()().
|
inline |
Definition at line 165 of file types.hpp.
References recall_cost_.
Referenced by unit::advance_to(), and wfl::unit_type_callable::get_value().
void unit_type::remove_scenario_fixes | ( | ) |
Definition at line 1444 of file types.cpp.
References advancements_, advances_to_, config::child_range(), cost_, experience_needed_, gender_types_, get_cfg(), utils::split(), and variations_.
int unit_type::resistance_against | ( | const std::string & | damage_name, |
bool | attacker | ||
) | const |
Gets resistance while considering custom WML abilities.
Attention: Filters in resistance-abilities will be ignored.
Definition at line 775 of file types.cpp.
References config::child_range(), unit_ability_list::emplace_back(), unit_ability_list::empty(), get_cfg(), unit_abilities::effect::get_composite_value(), unit_ability_list::highest(), movement_type_, map_location::null_location(), movetype::resistance_against(), and resistance_filter_matches().
Referenced by battle_context_unit_stats::battle_context_unit_stats().
|
private |
Identical to unit::resistance_filter_matches.
Definition at line 806 of file types.cpp.
References unit_abilities::filter_base_matches(), and utils::split().
Referenced by resistance_against().
bool unit_type::show_variations_in_help | ( | ) | const |
Whether the unit type has at least one help-visible variation.
Definition at line 764 of file types.cpp.
References variations_.
Referenced by help::unit_topic_generator::operator()(), unit_defense(), and unit_type().
|
inline |
Definition at line 178 of file types.hpp.
References small_profile_.
Referenced by unit::advance_to(), and help::unit_topic_generator::operator()().
std::vector< t_string > unit_type::special_notes | ( | ) | const |
Returns all notes that should be displayed in the help page for this type, including those found in abilities and attacks.
Definition at line 495 of file types.cpp.
References abilities_cfg(), attacks(), combine_special_notes(), movement_type(), and special_notes_.
Referenced by help::unit_topic_generator::operator()().
|
inline |
The name of the unit in the current language setting.
Definition at line 138 of file types.hpp.
References type_name_.
Referenced by unit::advance_to(), events::menu_handler::can_recruit(), editor::unit_palette::get_help_string(), wfl::unit_type_callable::get_value(), gui2::dialogs::unit_create::list_item_clicked(), help::unit_topic_generator::operator()(), editor::unit_palette::setup_item(), and ai::simulated_recruit().
|
inline |
Info on the type of unit that the unit reanimates as.
Definition at line 133 of file types.hpp.
References undead_variation_.
Referenced by unit::advance_to(), and battle_context_unit_stats::battle_context_unit_stats().
t_string unit_type::unit_description | ( | ) | const |
Definition at line 486 of file types.cpp.
References _(), description_, and t_string::empty().
Referenced by unit::advance_to(), help::unit_topic_generator::operator()(), and unit::write().
|
inline |
Definition at line 175 of file types.hpp.
References usage_.
Referenced by unit::advance_to(), wfl::unit_type_callable::get_value(), and ai::default_recruitment::recruitment::recruit_matches_type().
|
inline |
The id of this variation; empty if it's a gender variation or a base unit.
Definition at line 147 of file types.hpp.
References variation_id_.
Referenced by unit::advance_to(), and has_variation().
|
inline |
Definition at line 174 of file types.hpp.
References variation_name_.
Referenced by help::generate_unit_sections(), and gui2::dialogs::unit_create::list_item_clicked().
|
inline |
Definition at line 256 of file types.hpp.
References variations_.
Referenced by impl_unit_type_next().
std::vector< std::string > unit_type::variations | ( | ) | const |
Definition at line 747 of file types.cpp.
References variations_.
Referenced by help::unit_topic_generator::operator()().
|
inline |
Definition at line 167 of file types.hpp.
References movement(), and vision_.
Referenced by unit::advance_to(), and help::unit_topic_generator::operator()().
|
inline |
|
inlineprivate |
Definition at line 304 of file types.hpp.
References built_cfg_, and cfg_.
|
inline |
Definition at line 163 of file types.hpp.
References xp_bar_scaling_.
Referenced by unit::advance_to(), and unit::init().
|
friend |
|
private |
Definition at line 362 of file types.hpp.
Referenced by abilities_metadata(), and build_help_index().
|
private |
Definition at line 362 of file types.hpp.
Referenced by adv_abilities_metadata(), and build_help_index().
|
private |
Definition at line 367 of file types.hpp.
Referenced by advancements(), apply_scenario_fix(), modification_advancements(), and remove_scenario_fixes().
|
private |
Definition at line 366 of file types.hpp.
Referenced by advances_to(), apply_scenario_fix(), build_created(), can_advance(), and remove_scenario_fixes().
|
private |
Definition at line 371 of file types.hpp.
Referenced by alignment(), and build_help_index().
|
mutableprivate |
Definition at line 381 of file types.hpp.
Referenced by animations().
|
mutableprivate |
|
private |
|
private |
Definition at line 383 of file types.hpp.
Referenced by build_created(), build_full(), and build_help_index().
|
mutableprivate |
Definition at line 318 of file types.hpp.
Referenced by get_cfg(), unit_type(), and writable_cfg().
|
private |
Definition at line 316 of file types.hpp.
Referenced by get_cfg(), unit_type(), and writable_cfg().
|
private |
Definition at line 340 of file types.hpp.
Referenced by apply_scenario_fix(), build_created(), cost(), and remove_scenario_fixes().
|
private |
A suffix for id_, used when logging messages.
Definition at line 324 of file types.hpp.
Referenced by fill_variations(), and log_id().
|
private |
Definition at line 355 of file types.hpp.
Referenced by build_help_index(), and default_variation().
|
private |
Definition at line 330 of file types.hpp.
Referenced by build_help_index(), and unit_description().
|
private |
Definition at line 364 of file types.hpp.
Referenced by build_help_index(), and do_not_list().
|
private |
Definition at line 368 of file types.hpp.
Referenced by apply_scenario_fix(), build_created(), experience_needed(), and remove_scenario_fixes().
|
private |
Definition at line 348 of file types.hpp.
Referenced by build_help_index(), and flag_rgb().
|
private |
Definition at line 352 of file types.hpp.
Referenced by apply_scenario_fix(), build_created(), build_full(), build_help_index(), fill_variations_and_gender(), get_gender_unit_type(), remove_scenario_fixes(), and unit_type().
|
private |
Definition at line 378 of file types.hpp.
Referenced by build_help_index(), genders(), and has_gender_variation().
|
private |
Definition at line 364 of file types.hpp.
Referenced by build_help_index(), and hide_help().
|
private |
Definition at line 332 of file types.hpp.
Referenced by build_help_index(), and hitpoints().
|
private |
Definition at line 333 of file types.hpp.
Referenced by build_full(), and hp_bar_scaling().
|
private |
Definition at line 345 of file types.hpp.
Referenced by build_help_index(), and icon().
|
private |
Definition at line 322 of file types.hpp.
Referenced by advancement_tree(), advances_from(), hide_help(), id(), log_id(), and unit_type().
|
private |
Definition at line 344 of file types.hpp.
Referenced by build_created(), and image().
|
private |
Definition at line 338 of file types.hpp.
Referenced by build_help_index(), and jamming().
|
private |
Definition at line 334 of file types.hpp.
Referenced by build_full(), build_help_index(), and level().
|
private |
Definition at line 339 of file types.hpp.
Referenced by build_help_index(), and max_attacks().
|
private |
Definition at line 336 of file types.hpp.
Referenced by build_help_index(), and movement().
|
private |
Definition at line 374 of file types.hpp.
Referenced by build_help_index(), movement_type(), and resistance_against().
|
private |
Definition at line 373 of file types.hpp.
Referenced by build_help_index(), and movement_type_id().
|
private |
Definition at line 350 of file types.hpp.
Referenced by build_help_index(), and num_traits().
|
private |
The id of the top ancestor of this unit_type.
Definition at line 326 of file types.hpp.
Referenced by parent_id(), and unit_type().
|
private |
Definition at line 376 of file types.hpp.
Referenced by build_help_index(), and possible_traits().
|
private |
Definition at line 347 of file types.hpp.
Referenced by big_profile(), and build_help_index().
|
private |
Never nullptr, but may point to the null race.
Definition at line 360 of file types.hpp.
Referenced by build_full(), build_help_index(), hide_help(), and race().
|
private |
Definition at line 335 of file types.hpp.
Referenced by build_help_index(), and recall_cost().
|
private |
Definition at line 346 of file types.hpp.
Referenced by build_help_index(), and small_profile().
|
private |
Definition at line 331 of file types.hpp.
Referenced by build_help_index(), direct_special_notes(), and special_notes().
|
private |
Definition at line 329 of file types.hpp.
Referenced by build_created(), build_help_index(), and type_name().
|
private |
Definition at line 342 of file types.hpp.
Referenced by build_full(), build_help_index(), and undead_variation().
|
private |
Definition at line 341 of file types.hpp.
Referenced by build_help_index(), and usage().
|
private |
Definition at line 356 of file types.hpp.
Referenced by variation_id().
|
private |
Definition at line 357 of file types.hpp.
Referenced by build_created(), and variation_name().
|
private |
Definition at line 354 of file types.hpp.
Referenced by apply_scenario_fix(), build_created(), build_full(), build_help_index(), fill_variations(), get_variation(), has_variation(), remove_scenario_fixes(), show_variations_in_help(), variation_types(), and variations().
|
private |
Definition at line 337 of file types.hpp.
Referenced by build_help_index(), and vision().
|
private |
Definition at line 333 of file types.hpp.
Referenced by build_full(), and xp_bar_scaling().
|
private |
Definition at line 364 of file types.hpp.
Referenced by build_full(), and has_zoc().