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, int modIndex) |
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... | |
int | getDeathSound () 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... | |
bool | isLivingWeapon () const |
Checks if this unit has a built in weapon. 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.
int OpenXcom::Unit::getDeathSound | ( | ) | const |
Gets the death sound id.
Gets the unit's death sound.
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.
int OpenXcom::Unit::getMoveSound | ( | ) | const |
Gets the move sound id.
Gets the unit's move sound.
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.
(ie: chryssalid).
void OpenXcom::Unit::load | ( | const YAML::Node & | node, |
int | modIndex | ||
) |
Loads the unit data from YAML.
Loads the unit from a YAML file.
modIndex | A value that offsets the sounds and sprite values to avoid conflicts. |
node | YAML node. |