![]() |
OpenXcom
1.0
Open-source clone of the original X-Com
|
Represents the static data for a unit that is generated on the battlescape, this includes: HWPs, aliens and civilians. More...
#include <Unit.h>
Public Member Functions | |
| Unit (const std::string &type) | |
| Creates a blank unit ruleset. More... | |
| ~Unit () | |
| Cleans up the unit ruleset. | |
| void | load (const YAML::Node &node, Mod *mod) |
| Loads the unit data from YAML. More... | |
| std::string | getType () const |
| Gets the unit's type. More... | |
| UnitStats * | getStats () |
| Gets the unit's stats. More... | |
| int | getStandHeight () const |
| Gets the unit's height when standing. More... | |
| int | getKneelHeight () const |
| Gets the unit's height when kneeling. More... | |
| int | getFloatHeight () const |
| Gets the unit's float elevation. More... | |
| std::string | getArmor () const |
| Gets the armor type. More... | |
| std::string | getRace () const |
| Gets the alien race type. More... | |
| std::string | getRank () const |
| Gets the alien rank. More... | |
| int | getValue () const |
| Gets the value - for score calculation. More... | |
| const std::vector< int > & | getDeathSounds () const |
| Gets the death sound id. More... | |
| int | getMoveSound () const |
| Gets the move sound id. More... | |
| int | getIntelligence () const |
| Gets the intelligence. This is the number of turns AI remembers your troop positions. More... | |
| int | getAggression () const |
| Gets the aggression. Determines the chance of revenge and taking cover. More... | |
| int | getSpecialAbility () const |
| Gets the alien's special ability. More... | |
| std::string | getSpawnUnit () const |
| Gets the unit's spawn unit. More... | |
| int | getAggroSound () const |
| Gets the unit's war cry. More... | |
| int | getEnergyRecovery () const |
| Gets how much energy this unit recovers per turn. More... | |
| bool | isLivingWeapon () const |
| Checks if this unit has a built in weapon. More... | |
| std::string | getMeleeWeapon () const |
| Gets the name of any melee weapon that may be built in to this unit. More... | |
| std::string | getPsiWeapon () const |
| Gets the name of any psi weapon that may be built in to this unit. More... | |
| const std::vector< std::vector< std::string > > & | getBuiltInWeapons () const |
| Gets a vector of integrated items this unit has available. More... | |
| bool | getCapturable () const |
| Gets whether the alien can be captured alive. More... | |
Represents the static data for a unit that is generated on the battlescape, this includes: HWPs, aliens and civilians.
| OpenXcom::Unit::Unit | ( | const std::string & | type | ) |
Creates a blank unit ruleset.
Creates a certain type of unit.
| type | String defining the type. |
| int OpenXcom::Unit::getAggression | ( | ) | const |
Gets the aggression. Determines the chance of revenge and taking cover.
Gets the aggression.
Determines the chance of revenge and taking cover.
| int OpenXcom::Unit::getAggroSound | ( | ) | const |
Gets the unit's war cry.
| std::string OpenXcom::Unit::getArmor | ( | ) | const |
Gets the armor type.
Gets the unit's armor type.
| const std::vector< std::vector< std::string > > & OpenXcom::Unit::getBuiltInWeapons | ( | ) | const |
Gets a vector of integrated items this unit has available.
What weapons does this unit have built in? this is a vector of strings representing any weapons that may be inherent to this creature.
note: unlike "livingWeapon" this is used in ADDITION to any loadout or living weapon item that may be defined.
| bool OpenXcom::Unit::getCapturable | ( | ) | const |
Gets whether the alien can be captured alive.
| const std::vector< int > & OpenXcom::Unit::getDeathSounds | ( | ) | const |
Gets the death sound id.
Get the unit's death sounds.
| int OpenXcom::Unit::getEnergyRecovery | ( | ) | const |
Gets how much energy this unit recovers per turn.
How much energy does this unit recover per turn?
| int OpenXcom::Unit::getFloatHeight | ( | ) | const |
Gets the unit's float elevation.
Returns the unit's floating elevation.
| int OpenXcom::Unit::getIntelligence | ( | ) | const |
Gets the intelligence. This is the number of turns AI remembers your troop positions.
Gets the intelligence.
This is the number of turns the AI remembers your troop positions.
| int OpenXcom::Unit::getKneelHeight | ( | ) | const |
Gets the unit's height when kneeling.
Returns the unit's height at kneeling.
| std::string OpenXcom::Unit::getMeleeWeapon | ( | ) | const |
Gets the name of any melee weapon that may be built in to this unit.
What is this unit's built in melee weapon (if any).
| int OpenXcom::Unit::getMoveSound | ( | ) | const |
Gets the move sound id.
Gets the unit's move sound.
| std::string OpenXcom::Unit::getPsiWeapon | ( | ) | const |
Gets the name of any psi weapon that may be built in to this unit.
What is this unit's built in psi weapon (if any).
| std::string OpenXcom::Unit::getRace | ( | ) | const |
Gets the alien race type.
Gets the alien's race.
| std::string OpenXcom::Unit::getRank | ( | ) | const |
Gets the alien rank.
Gets the unit's rank.
| std::string OpenXcom::Unit::getSpawnUnit | ( | ) | const |
Gets the unit's spawn unit.
Gets the unit that is spawned when this one dies.
| int OpenXcom::Unit::getSpecialAbility | ( | ) | const |
Gets the alien's special ability.
Gets the unit's special ability.
| int OpenXcom::Unit::getStandHeight | ( | ) | const |
Gets the unit's height when standing.
Returns the unit's height at standing.
| UnitStats * OpenXcom::Unit::getStats | ( | ) |
Gets the unit's stats.
Returns the unit's stats data object.
| std::string OpenXcom::Unit::getType | ( | ) | const |
Gets the unit's type.
Returns the language string that names this unit.
Each unit type has a unique name.
| int OpenXcom::Unit::getValue | ( | ) | const |
Gets the value - for score calculation.
Gets the unit's value - for scoring.
| bool OpenXcom::Unit::isLivingWeapon | ( | ) | const |
Checks if this unit has a built in weapon.
Checks if this unit is a living weapon.
a living weapon ignores any loadout that may be available to its rank and uses the one associated with its race.
| void OpenXcom::Unit::load | ( | const YAML::Node & | node, |
| Mod * | mod | ||
| ) |
Loads the unit data from YAML.
Loads the unit from a YAML file.
| node | YAML node. |
| mod | Mod for the unit. |
1.8.14