OpenXcom  1.0
Open-source clone of the original X-Com
Public Member Functions | List of all members
OpenXcom::Armor Class Reference

Represents a specific type of armor. More...

#include <Armor.h>

Public Member Functions

 Armor (const std::string &type)
 Creates a blank armor ruleset. More...
 
 ~Armor ()
 Cleans up the armor ruleset.
 
void load (const YAML::Node &node)
 Loads the armor data from YAML. More...
 
std::string getType () const
 Gets the armor's type. More...
 
std::string getSpriteSheet () const
 Gets the unit's sprite sheet. More...
 
std::string getSpriteInventory () const
 Gets the unit's inventory sprite. More...
 
int getFrontArmor () const
 Gets the front armor level. More...
 
int getSideArmor () const
 Gets the side armor level. More...
 
int getRearArmor () const
 Gets the rear armor level. More...
 
int getUnderArmor () const
 Gets the under armor level. More...
 
std::string getCorpseGeoscape () const
 Gets the Geoscape corpse item. More...
 
const std::vector< std::string > & getCorpseBattlescape () const
 Gets the Battlescape corpse item. More...
 
std::string getStoreItem () const
 Gets the stores item. More...
 
std::string getSpecialWeapon () const
 Gets the special weapon type. More...
 
int getDrawingRoutine () const
 Gets the battlescape drawing routine ID. More...
 
bool drawBubbles () const
 Gets whether or not to draw bubbles (breathing animation). More...
 
MovementType getMovementType () const
 DO NOT USE THIS FUNCTION OUTSIDE THE BATTLEUNIT CONSTRUCTOR OR I WILL HUNT YOU DOWN. More...
 
int getSize () const
 Gets whether this is a normal or big unit. More...
 
float getDamageModifier (ItemDamageType dt) const
 Gets damage modifier. More...
 
const std::vector< int > & getLoftempsSet () const
 Gets loftempSet. More...
 
const UnitStatsgetStats () const
 Gets the armor's stats. More...
 
int getWeight () const
 Gets the armor's weight. More...
 
int getDeathFrames () const
 Gets number of death frames. More...
 
bool getConstantAnimation () const
 Gets if armor uses constant animation.
 
bool getCanHoldWeapon () const
 Gets if armor can hold weapon.
 
ForcedTorso getForcedTorso () const
 Checks if this armor ignores gender (power suit/flying suit). More...
 
int getFaceColorGroup () const
 Get face base color. More...
 
int getHairColorGroup () const
 Get hair base color. More...
 
int getUtileColorGroup () const
 Get utile base color. More...
 
int getRankColorGroup () const
 Get rank base color. More...
 
int getFaceColor (int i) const
 Get face base color. More...
 
int getHairColor (int i) const
 Get hair base color. More...
 
int getUtileColor (int i) const
 Get utile base color. More...
 
int getRankColor (int i) const
 Get rank base color. More...
 
bool hasInventory () const
 Can we access this unit's inventory? More...
 
const std::vector< std::string > & getUnits () const
 Gets the armor's units. More...
 

Detailed Description

Represents a specific type of armor.

Not only soldier armor, but also alien armor - some alien races wear Soldier Armor, Leader Armor or Commander Armor depending on their rank.

Constructor & Destructor Documentation

◆ Armor()

OpenXcom::Armor::Armor ( const std::string &  type)

Creates a blank armor ruleset.

Creates a blank ruleset for a certain type of armor.

Parameters
typeString defining the type.

Member Function Documentation

◆ drawBubbles()

bool OpenXcom::Armor::drawBubbles ( ) const

Gets whether or not to draw bubbles (breathing animation).

Returns
True if breathing animation is enabled, false otherwise.

◆ getCorpseBattlescape()

const std::vector< std::string > & OpenXcom::Armor::getCorpseBattlescape ( ) const

Gets the Battlescape corpse item.

Gets the list of corpse items dropped by the unit in the Battlescape (one per unit tile).

Returns
The list of corpse items.

◆ getCorpseGeoscape()

std::string OpenXcom::Armor::getCorpseGeoscape ( ) const

Gets the Geoscape corpse item.

Gets the corpse item used in the Geoscape.

Returns
The name of the corpse item.

◆ getDamageModifier()

float OpenXcom::Armor::getDamageModifier ( ItemDamageType  dt) const

Gets damage modifier.

Gets the damage modifier for a certain damage type.

Parameters
dtThe damageType.
Returns
The damage modifier 0->1.

◆ getDeathFrames()

int OpenXcom::Armor::getDeathFrames ( ) const

Gets number of death frames.

Returns
number of death frames.

◆ getDrawingRoutine()

int OpenXcom::Armor::getDrawingRoutine ( ) const

Gets the battlescape drawing routine ID.

Gets the drawing routine ID.

Returns
The drawing routine ID.

◆ getFaceColor()

int OpenXcom::Armor::getFaceColor ( int  i) const

Get face base color.

Gets new face colors for replacement, if 0 then don't replace colors.

Returns
Color index or 0.

◆ getFaceColorGroup()

int OpenXcom::Armor::getFaceColorGroup ( ) const

Get face base color.

Gets hair base color group for replacement, if 0 then don't replace colors.

Returns
Color group or 0.

◆ getForcedTorso()

ForcedTorso OpenXcom::Armor::getForcedTorso ( ) const

Checks if this armor ignores gender (power suit/flying suit).

Returns
which torso to force on the sprite.

◆ getFrontArmor()

int OpenXcom::Armor::getFrontArmor ( ) const

Gets the front armor level.

Returns
The front armor level.

◆ getHairColor()

int OpenXcom::Armor::getHairColor ( int  i) const

Get hair base color.

Gets new hair colors for replacement, if 0 then don't replace colors.

Returns
Color index or 0.

◆ getHairColorGroup()

int OpenXcom::Armor::getHairColorGroup ( ) const

Get hair base color.

Gets hair base color group for replacement, if 0 then don't replace colors.

Returns
Color group or 0.

◆ getLoftempsSet()

const std::vector< int > & OpenXcom::Armor::getLoftempsSet ( ) const

Gets loftempSet.

Gets the loftempSet.

Returns
The loftempsSet.

◆ getMovementType()

MovementType OpenXcom::Armor::getMovementType ( ) const

DO NOT USE THIS FUNCTION OUTSIDE THE BATTLEUNIT CONSTRUCTOR OR I WILL HUNT YOU DOWN.

Gets the movement type of this armor.

Useful for determining whether the armor can fly. : do not use this function outside the BattleUnit constructor, unless you are SURE you know what you are doing. for more information, see the BattleUnit constructor.

Returns
The movement type.

◆ getRankColor()

int OpenXcom::Armor::getRankColor ( int  i) const

Get rank base color.

Gets new rank colors for replacement, if 0 then don't replace colors.

Returns
Color index or 0.

◆ getRankColorGroup()

int OpenXcom::Armor::getRankColorGroup ( ) const

Get rank base color.

Gets rank base color group for replacement, if 0 then don't replace colors.

Returns
Color group or 0.

◆ getRearArmor()

int OpenXcom::Armor::getRearArmor ( ) const

Gets the rear armor level.

Returns
The rear armor level.

◆ getSideArmor()

int OpenXcom::Armor::getSideArmor ( ) const

Gets the side armor level.

Returns
The side armor level.

◆ getSize()

int OpenXcom::Armor::getSize ( ) const

Gets whether this is a normal or big unit.

Gets the size of the unit.

Normally this is 1 (small) or 2 (big).

Returns
The unit's size.

◆ getSpecialWeapon()

std::string OpenXcom::Armor::getSpecialWeapon ( ) const

Gets the special weapon type.

Gets the type of special weapon.

Returns
The name of the special weapon.

◆ getSpriteInventory()

std::string OpenXcom::Armor::getSpriteInventory ( ) const

Gets the unit's inventory sprite.

Returns
The inventory sprite name.

◆ getSpriteSheet()

std::string OpenXcom::Armor::getSpriteSheet ( ) const

Gets the unit's sprite sheet.

Returns
The sprite sheet name.

◆ getStats()

const UnitStats * OpenXcom::Armor::getStats ( ) const

Gets the armor's stats.

Gets pointer to the armor's stats.

Returns
stats Pointer to the armor's stats.

◆ getStoreItem()

std::string OpenXcom::Armor::getStoreItem ( ) const

Gets the stores item.

Gets the storage item needed to equip this.

Every soldier armor needs an item.

Returns
The name of the store item (STR_NONE for infinite armor).

◆ getType()

std::string OpenXcom::Armor::getType ( ) const

Gets the armor's type.

Returns the language string that names this armor.

Each armor has a unique name. Coveralls, Power Suit,...

Returns
The armor name.

◆ getUnderArmor()

int OpenXcom::Armor::getUnderArmor ( ) const

Gets the under armor level.

Returns
The under armor level.

◆ getUnits()

const std::vector< std::string > & OpenXcom::Armor::getUnits ( ) const

Gets the armor's units.

Gets the list of units this armor applies to.

Returns
The list of unit IDs (empty = applies to all).

◆ getUtileColor()

int OpenXcom::Armor::getUtileColor ( int  i) const

Get utile base color.

Gets new utile colors for replacement, if 0 then don't replace colors.

Returns
Color index or 0.

◆ getUtileColorGroup()

int OpenXcom::Armor::getUtileColorGroup ( ) const

Get utile base color.

Gets utile base color group for replacement, if 0 then don't replace colors.

Returns
Color group or 0.

◆ getWeight()

int OpenXcom::Armor::getWeight ( ) const

Gets the armor's weight.

Returns
the weight of the armor.

◆ hasInventory()

bool OpenXcom::Armor::hasInventory ( ) const

Can we access this unit's inventory?

Can this unit's inventory be accessed for any reason?

Returns
if we can access the inventory.

◆ load()

void OpenXcom::Armor::load ( const YAML::Node &  node)

Loads the armor data from YAML.

Loads the armor from a YAML file.

Parameters
nodeYAML node.

The documentation for this class was generated from the following files: