OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | List of all members
OpenXcom::RuleCraftWeapon Class Reference

Represents a specific type of craft weapon. More...

#include <RuleCraftWeapon.h>

Public Member Functions

 RuleCraftWeapon (const std::string &type)
 Creates a blank craft weapon ruleset. More...
 
 ~RuleCraftWeapon ()
 Cleans up the craft weapon ruleset.
 
void load (const YAML::Node &node, int modIndex)
 Loads craft weapon data from YAML. More...
 
std::string getType () const
 Gets the craft weapon's type. More...
 
int getSprite () const
 Gets the craft weapon's sprite. More...
 
int getSound () const
 Gets the craft weapon's sound. More...
 
int getDamage () const
 Gets the craft weapon's damage. More...
 
int getRange () const
 Gets the craft weapon's range. More...
 
int getAccuracy () const
 Gets the craft weapon's accuracy. More...
 
int getCautiousReload () const
 Gets the craft weapon's cautious reload time. More...
 
int getStandardReload () const
 Gets the craft weapon's standard reload time. More...
 
int getAggressiveReload () const
 Gets the craft weapon's aggressive reload time. More...
 
int getAmmoMax () const
 Gets the craft weapon's maximum ammo. More...
 
int getRearmRate () const
 Gets the craft weapon's rearm rate. More...
 
std::string getLauncherItem () const
 Gets the craft weapon's launcher item. More...
 
std::string getClipItem () const
 Gets the craft weapon's clip item. More...
 
CraftWeaponProjectileType getProjectileType () const
 Gets the craft weapon's projectile's type. More...
 
int getProjectileSpeed () const
 Gets the craft weapon's projectile speed. More...
 

Detailed Description

Represents a specific type of craft weapon.

Contains constant info about a craft weapon like damage, range, accuracy, items used, etc.

See also
CraftWeapon

Constructor & Destructor Documentation

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

Creates a blank craft weapon ruleset.

Creates a blank ruleset for a certain type of craft weapon.

Parameters
typeString defining the type.

Member Function Documentation

int OpenXcom::RuleCraftWeapon::getAccuracy ( ) const

Gets the craft weapon's accuracy.

Gets the percentage chance of each shot of this craft weapon hitting an enemy craft.

Returns
The accuracy as a percentage.
int OpenXcom::RuleCraftWeapon::getAggressiveReload ( ) const

Gets the craft weapon's aggressive reload time.

Gets the amount of time the craft weapon takes to reload in aggressive mode.

Returns
The time in game seconds.
int OpenXcom::RuleCraftWeapon::getAmmoMax ( ) const

Gets the craft weapon's maximum ammo.

Gets the maximum amount of ammo the craft weapon can carry.

Returns
The amount of ammo.
int OpenXcom::RuleCraftWeapon::getCautiousReload ( ) const

Gets the craft weapon's cautious reload time.

Gets the amount of time the craft weapon takes to reload in cautious mode.

Returns
The time in game seconds.
std::string OpenXcom::RuleCraftWeapon::getClipItem ( ) const

Gets the craft weapon's clip item.

Gets the language string of the item used to load this craft weapon with ammo.

Returns
The item name.
int OpenXcom::RuleCraftWeapon::getDamage ( ) const

Gets the craft weapon's damage.

Gets the amount of damage this craft weapon inflicts on enemy crafts.

Returns
The damage amount.
std::string OpenXcom::RuleCraftWeapon::getLauncherItem ( ) const

Gets the craft weapon's launcher item.

Gets the language string of the item used to equip this craft weapon.

Returns
The item name.
int OpenXcom::RuleCraftWeapon::getProjectileSpeed ( ) const

Gets the craft weapon's projectile speed.

Gets the speed of the projectile fired by this weapon.

Returns
The projectile speed.
CraftWeaponProjectileType OpenXcom::RuleCraftWeapon::getProjectileType ( ) const

Gets the craft weapon's projectile's type.

Gets the Projectile Type this weapon will fire.

Returns
The projectile type.
int OpenXcom::RuleCraftWeapon::getRange ( ) const

Gets the craft weapon's range.

Gets the maximum range of this craft weapon.

Returns
The range in km.
int OpenXcom::RuleCraftWeapon::getRearmRate ( ) const

Gets the craft weapon's rearm rate.

Gets how much ammo is added to the craft weapon while rearming (the amount of ammo in each clip item).

Returns
The amount of ammo.
int OpenXcom::RuleCraftWeapon::getSound ( ) const

Gets the craft weapon's sound.

Gets the ID of the sound used when firing the weapon in the Dogfight screen.

Returns
The sound ID.
int OpenXcom::RuleCraftWeapon::getSprite ( ) const

Gets the craft weapon's sprite.

Gets the ID of the sprite used to draw the craft weapon in the Equip Craft and Interception screens.

Returns
The sprite ID.
int OpenXcom::RuleCraftWeapon::getStandardReload ( ) const

Gets the craft weapon's standard reload time.

Gets the amount of time the craft weapon takes to reload in standard mode.

Returns
The time in game seconds.
std::string OpenXcom::RuleCraftWeapon::getType ( ) const

Gets the craft weapon's type.

Gets the language string that names this craft weapon.

Each craft weapon type has a unique name.

Returns
The craft weapon's name.
void OpenXcom::RuleCraftWeapon::load ( const YAML::Node &  node,
int  modIndex 
)

Loads craft weapon data from YAML.

Loads the craft weapon from a YAML file.

Parameters
nodeYAML node.
modIndexA value that offsets the sounds and sprite values to avoid conflicts.

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