OpenXcom
1.0
Open-source clone of the original X-Com
|
Represents a specific type of item. More...
#include <RuleItem.h>
Public Member Functions | |
RuleItem (const std::string &type) | |
Creates a blank item ruleset. More... | |
~RuleItem () | |
Cleans up the item ruleset. | |
void | load (const YAML::Node &node, int modIndex, int listIndex) |
Loads item data from YAML. More... | |
std::string | getType () const |
Gets the item's type. More... | |
std::string | getName () const |
Gets the item's name. More... | |
const std::vector< std::string > & | getRequirements () const |
Gets the item's requirements. More... | |
double | getSize () const |
Gets the item's size. More... | |
int | getBuyCost () const |
Gets the item's purchase cost. More... | |
int | getSellCost () const |
Gets the item's sale cost. More... | |
int | getTransferTime () const |
Gets the item's transfer time. More... | |
int | getWeight () const |
Gets the item's weight. More... | |
int | getBigSprite () const |
Gets the item's reference in BIGOBS.PCK for use in inventory. More... | |
int | getFloorSprite () const |
Gets the item's reference in FLOOROB.PCK for use in inventory. More... | |
int | getHandSprite () const |
Gets the item's reference in HANDOB.PCK for use in inventory. More... | |
bool | isTwoHanded () const |
Gets if the item is two-handed. More... | |
bool | isWaypoint () const |
Gets if the item is a launcher. More... | |
bool | isFixed () const |
Gets if the item is fixed. More... | |
int | getBulletSprite () const |
Gets the item's bullet sprite reference. More... | |
int | getFireSound () const |
Gets the item's fire sound. More... | |
int | getHitSound () const |
Gets the item's hit sound. More... | |
int | getHitAnimation () const |
Gets the item's hit animation. More... | |
int | getPower () const |
Gets the item's power. More... | |
int | getAccuracySnap () const |
Gets the item's snapshot accuracy. More... | |
int | getAccuracyAuto () const |
Gets the item's autoshot accuracy. More... | |
int | getAccuracyAimed () const |
Gets the item's aimed shot accuracy. More... | |
int | getAccuracyMelee () const |
Gets the item's melee accuracy. More... | |
int | getTUSnap () const |
Gets the item's snapshot TU cost. More... | |
int | getTUAuto () const |
Gets the item's autoshot TU cost. More... | |
int | getTUAimed () const |
Gets the item's aimed shot TU cost. More... | |
int | getTUMelee () const |
Gets the item's melee TU cost. More... | |
std::vector< std::string > * | getCompatibleAmmo () |
Gets list of compatible ammo. More... | |
ItemDamageType | getDamageType () const |
Gets the item's damage type. More... | |
BattleType | getBattleType () const |
Gets the item's type. More... | |
int | getInventoryWidth () const |
Gets the item's inventory width. More... | |
int | getInventoryHeight () const |
Gets the item's inventory height. More... | |
int | getClipSize () const |
Gets the ammo amount. More... | |
void | drawHandSprite (SurfaceSet *texture, Surface *surface) const |
Draws the item's hand sprite onto a surface. More... | |
int | getHealQuantity () const |
Gets the medikit heal quantity. More... | |
int | getPainKillerQuantity () const |
Gets the medikit pain killer quantity. More... | |
int | getStimulantQuantity () const |
Gets the medikit stimulant quantity. More... | |
int | getWoundRecovery () const |
Gets the medikit wound healed per shot. More... | |
int | getHealthRecovery () const |
Gets the medikit health recovered per shot. More... | |
int | getEnergyRecovery () const |
Gets the medikit energy recovered per shot. More... | |
int | getStunRecovery () const |
Gets the medikit stun recovered per shot. More... | |
int | getTUUse () const |
Gets the Time Unit use. More... | |
int | getExplosionRadius () const |
Gets the max explosion radius. More... | |
int | getRecoveryPoints () const |
Gets the recovery points score. More... | |
int | getArmor () const |
Gets the item's armor. More... | |
bool | isRecoverable () const |
Gets the item's recoverability. More... | |
int | getTurretType () const |
Gets the item's turret type. More... | |
bool | getAlien () const |
Checks if this a live alien. More... | |
bool | getFlatRate () const |
Should we charge a flat rate? More... | |
bool | getArcingShot () const |
Should this weapon arc? More... | |
int | getAttraction () const |
How much do aliens want this thing? More... | |
int | getListOrder () const |
Get the list weight for this item. More... | |
int | getBulletSpeed () const |
How fast does a projectile fired from this weapon travel? More... | |
int | getExplosionSpeed () const |
How fast does the explosion animation play? More... | |
int | getAutoShots () const |
How many auto shots does this weapon fire. More... | |
bool | isRifle () const |
is this item a 2 handed weapon? More... | |
bool | isPistol () const |
is this item a single handed weapon? More... | |
int | getMaxRange () const |
Get the max range of this weapon. More... | |
int | getAimRange () const |
Get the max range of aimed shots with this weapon. More... | |
int | getSnapRange () const |
Get the max range of snap shots with this weapon. More... | |
int | getAutoRange () const |
Get the max range of auto shots with this weapon. More... | |
int | getMinRange () const |
Get the minimum effective range of this weapon. More... | |
int | getDropoff () const |
Get the accuracy dropoff of this weapon. More... | |
int | getShotgunPellets () const |
Get the number of projectiles to trace. More... | |
std::string | getZombieUnit () const |
Gets the weapon's zombie unit. More... | |
bool | isStrengthApplied () const |
Is strength applied to the damage of this weapon? More... | |
bool | isSkillApplied () const |
Is skill applied to the accuracy of this weapon? More... | |
int | getMeleeAttackSound () const |
What sound does this weapon make when you swing this at someone? More... | |
int | getMeleeHitSound () const |
What sound does this weapon make when you punch someone in the face with it? More... | |
int | getMeleePower () const |
Ok, so this isn't a melee type weapon but we're using it for melee... how much damage should it do? More... | |
int | getMeleeAnimation () const |
Get the melee animation starting frame (comes from hit.pck). More... | |
bool | isLOSRequired () const |
Check if LOS is required to use this item (only applies to psionic type items) More... | |
Represents a specific type of item.
Contains constant info about an item like storage size, sell price, etc.
OpenXcom::RuleItem::RuleItem | ( | const std::string & | type | ) |
Creates a blank item ruleset.
Creates a blank ruleset for a certain type of item.
type | String defining the type. |
void OpenXcom::RuleItem::drawHandSprite | ( | SurfaceSet * | texture, |
Surface * | surface | ||
) | const |
Draws the item's hand sprite onto a surface.
Draws and centers the hand sprite on a surface according to its dimensions.
texture | Pointer to the surface set to get the sprite from. |
surface | Pointer to the surface to draw to. |
int OpenXcom::RuleItem::getAccuracyAimed | ( | ) | const |
Gets the item's aimed shot accuracy.
Gets the item's accuracy for aimed shots.
int OpenXcom::RuleItem::getAccuracyAuto | ( | ) | const |
Gets the item's autoshot accuracy.
Gets the item's accuracy for autoshots.
int OpenXcom::RuleItem::getAccuracyMelee | ( | ) | const |
Gets the item's melee accuracy.
Gets the item's accuracy for melee attacks.
int OpenXcom::RuleItem::getAccuracySnap | ( | ) | const |
Gets the item's snapshot accuracy.
Gets the item's accuracy for snapshots.
int OpenXcom::RuleItem::getAimRange | ( | ) | const |
Get the max range of aimed shots with this weapon.
Gets the maximum effective range of this weapon when using Aimed Shot.
bool OpenXcom::RuleItem::getAlien | ( | ) | const |
Checks if this a live alien.
Returns if this is a live alien.
bool OpenXcom::RuleItem::getArcingShot | ( | ) | const |
Should this weapon arc?
Returns if this weapon should arc its shots.
int OpenXcom::RuleItem::getArmor | ( | ) | const |
Gets the item's armor.
Returns the item's armor.
The item is destroyed when an explosion power bigger than its armor hits it.
int OpenXcom::RuleItem::getAttraction | ( | ) | const |
How much do aliens want this thing?
Gets the attraction value for this item (for AI).
int OpenXcom::RuleItem::getAutoRange | ( | ) | const |
Get the max range of auto shots with this weapon.
Gets the maximim effective range of this weapon for Auto Shot.
int OpenXcom::RuleItem::getAutoShots | ( | ) | const |
How many auto shots does this weapon fire.
Gets the amount of auto shots fired by this weapon.
BattleType OpenXcom::RuleItem::getBattleType | ( | ) | const |
Gets the item's type.
Gets the item's battlye type.
int OpenXcom::RuleItem::getBigSprite | ( | ) | const |
Gets the item's reference in BIGOBS.PCK for use in inventory.
Gets the reference in BIGOBS.PCK for use in inventory.
int OpenXcom::RuleItem::getBulletSpeed | ( | ) | const |
How fast does a projectile fired from this weapon travel?
Gets the speed at which this bullet travels.
int OpenXcom::RuleItem::getBulletSprite | ( | ) | const |
Gets the item's bullet sprite reference.
int OpenXcom::RuleItem::getBuyCost | ( | ) | const |
Gets the item's purchase cost.
Gets the amount of money this item costs to purchase (0 if not purchasable).
int OpenXcom::RuleItem::getClipSize | ( | ) | const |
Gets the ammo amount.
Gets the item's ammo clip size.
std::vector< std::string > * OpenXcom::RuleItem::getCompatibleAmmo | ( | ) |
Gets list of compatible ammo.
Gets a list of compatible ammo.
ItemDamageType OpenXcom::RuleItem::getDamageType | ( | ) | const |
Gets the item's damage type.
int OpenXcom::RuleItem::getDropoff | ( | ) | const |
Get the accuracy dropoff of this weapon.
Gets the accuracy dropoff value of this weapon.
int OpenXcom::RuleItem::getEnergyRecovery | ( | ) | const |
Gets the medikit energy recovered per shot.
Gets the amount of energy added to a soldier's energy.
int OpenXcom::RuleItem::getExplosionRadius | ( | ) | const |
Gets the max explosion radius.
Returns the item's max explosion radius.
Small explosions don't have a restriction. Larger explosions are restricted using a formula, with a maximum of radius 10 no matter how large the explosion is.
int OpenXcom::RuleItem::getExplosionSpeed | ( | ) | const |
How fast does the explosion animation play?
Gets the speed at which this bullet explodes.
int OpenXcom::RuleItem::getFireSound | ( | ) | const |
Gets the item's fire sound.
bool OpenXcom::RuleItem::getFlatRate | ( | ) | const |
Should we charge a flat rate?
Returns whether this item charges a flat TU rate.
int OpenXcom::RuleItem::getFloorSprite | ( | ) | const |
Gets the item's reference in FLOOROB.PCK for use in inventory.
Gets the reference in FLOOROB.PCK for use in inventory.
int OpenXcom::RuleItem::getHandSprite | ( | ) | const |
Gets the item's reference in HANDOB.PCK for use in inventory.
Gets the reference in HANDOB.PCK for use in inventory.
int OpenXcom::RuleItem::getHealQuantity | ( | ) | const |
Gets the medikit heal quantity.
Gets the heal quantity of the item.
int OpenXcom::RuleItem::getHealthRecovery | ( | ) | const |
Gets the medikit health recovered per shot.
Gets the amount of health added to a wounded soldier's health.
int OpenXcom::RuleItem::getHitAnimation | ( | ) | const |
Gets the item's hit animation.
int OpenXcom::RuleItem::getHitSound | ( | ) | const |
Gets the item's hit sound.
int OpenXcom::RuleItem::getInventoryHeight | ( | ) | const |
Gets the item's inventory height.
Gets the item's height in a soldier's inventory.
int OpenXcom::RuleItem::getInventoryWidth | ( | ) | const |
Gets the item's inventory width.
Gets the item's width in a soldier's inventory.
int OpenXcom::RuleItem::getListOrder | ( | ) | const |
Get the list weight for this item.
Gets the list weight for this research item.
int OpenXcom::RuleItem::getMaxRange | ( | ) | const |
Get the max range of this weapon.
Gets the maximum range of this weapon.
int OpenXcom::RuleItem::getMeleeAnimation | ( | ) | const |
Get the melee animation starting frame (comes from hit.pck).
What is the starting frame offset in hit.pck to use for the animation?
int OpenXcom::RuleItem::getMeleeAttackSound | ( | ) | const |
What sound does this weapon make when you swing this at someone?
int OpenXcom::RuleItem::getMeleeHitSound | ( | ) | const |
What sound does this weapon make when you punch someone in the face with it?
int OpenXcom::RuleItem::getMeleePower | ( | ) | const |
Ok, so this isn't a melee type weapon but we're using it for melee... how much damage should it do?
How much damage does this weapon do when you punch someone in the face with it?
int OpenXcom::RuleItem::getMinRange | ( | ) | const |
Get the minimum effective range of this weapon.
Gets the minimum effective range of this weapon.
std::string OpenXcom::RuleItem::getName | ( | ) | const |
Gets the item's name.
Gets the language string that names this item.
This is not necessarily unique.
int OpenXcom::RuleItem::getPainKillerQuantity | ( | ) | const |
Gets the medikit pain killer quantity.
Gets the pain killer quantity of the item.
int OpenXcom::RuleItem::getPower | ( | ) | const |
Gets the item's power.
int OpenXcom::RuleItem::getRecoveryPoints | ( | ) | const |
Gets the recovery points score.
Returns the item's recovery points.
This is used during the battlescape debriefing score calculation.
const std::vector< std::string > & OpenXcom::RuleItem::getRequirements | ( | ) | const |
Gets the item's requirements.
Gets the list of research required to use this item.
int OpenXcom::RuleItem::getSellCost | ( | ) | const |
Gets the item's sale cost.
Gets the amount of money this item is worth to sell.
int OpenXcom::RuleItem::getShotgunPellets | ( | ) | const |
Get the number of projectiles to trace.
Gets the number of projectiles this ammo shoots at once.
double OpenXcom::RuleItem::getSize | ( | ) | const |
Gets the item's size.
Gets the amount of space this item takes up in a storage facility.
int OpenXcom::RuleItem::getSnapRange | ( | ) | const |
Get the max range of snap shots with this weapon.
Gets the maximim effective range of this weapon for Snap Shot.
int OpenXcom::RuleItem::getStimulantQuantity | ( | ) | const |
Gets the medikit stimulant quantity.
Gets the stimulant quantity of the item.
int OpenXcom::RuleItem::getStunRecovery | ( | ) | const |
Gets the medikit stun recovered per shot.
Gets the amount of stun removed from a soldier's stun level.
int OpenXcom::RuleItem::getTransferTime | ( | ) | const |
Gets the item's transfer time.
Gets the amount of time this item takes to arrive at a base.
int OpenXcom::RuleItem::getTUAimed | ( | ) | const |
Gets the item's aimed shot TU cost.
Gets the item's time unit percentage for aimed shots.
int OpenXcom::RuleItem::getTUAuto | ( | ) | const |
Gets the item's autoshot TU cost.
Gets the item's time unit percentage for autoshots.
int OpenXcom::RuleItem::getTUMelee | ( | ) | const |
Gets the item's melee TU cost.
Gets the item's time unit percentage for melee attacks.
int OpenXcom::RuleItem::getTurretType | ( | ) | const |
Gets the item's turret type.
Returns the item's Turret Type.
int OpenXcom::RuleItem::getTUSnap | ( | ) | const |
Gets the item's snapshot TU cost.
Gets the item's time unit percentage for snapshots.
int OpenXcom::RuleItem::getTUUse | ( | ) | const |
Gets the Time Unit use.
Gets the number of Time Units needed to use this item.
std::string OpenXcom::RuleItem::getType | ( | ) | const |
Gets the item's type.
Gets the item type.
Each item has a unique type.
int OpenXcom::RuleItem::getWeight | ( | ) | const |
Gets the item's weight.
Gets the weight of the item.
int OpenXcom::RuleItem::getWoundRecovery | ( | ) | const |
Gets the medikit wound healed per shot.
Gets the amount of fatal wound healed per usage.
std::string OpenXcom::RuleItem::getZombieUnit | ( | ) | const |
Gets the weapon's zombie unit.
Gets the unit that the victim is morphed into when attacked.
bool OpenXcom::RuleItem::isFixed | ( | ) | const |
Gets if the item is fixed.
Returns whether this item is a fixed weapon.
You can't move/throw/drop fixed weapons - e.g. HWP turrets.
bool OpenXcom::RuleItem::isLOSRequired | ( | ) | const |
Check if LOS is required to use this item (only applies to psionic type items)
Is line of sight required for this psionic weapon to function?
bool OpenXcom::RuleItem::isPistol | ( | ) | const |
is this item a single handed weapon?
is this item a pistol?
bool OpenXcom::RuleItem::isRecoverable | ( | ) | const |
Gets the item's recoverability.
Returns if the item should be recoverable from the battlescape.
bool OpenXcom::RuleItem::isRifle | ( | ) | const |
is this item a 2 handed weapon?
is this item a rifle?
bool OpenXcom::RuleItem::isSkillApplied | ( | ) | const |
Is skill applied to the accuracy of this weapon?
Is skill applied to the accuracy of this weapon? this only applies to melee weapons.
bool OpenXcom::RuleItem::isStrengthApplied | ( | ) | const |
Is strength applied to the damage of this weapon?
bool OpenXcom::RuleItem::isTwoHanded | ( | ) | const |
Gets if the item is two-handed.
Returns whether this item is held with two hands.
bool OpenXcom::RuleItem::isWaypoint | ( | ) | const |
Gets if the item is a launcher.
Returns whether this item uses waypoints.
void OpenXcom::RuleItem::load | ( | const YAML::Node & | node, |
int | modIndex, | ||
int | listOrder | ||
) |
Loads item data from YAML.
Loads the item from a YAML file.
node | YAML node. |
modIndex | Offsets the sounds and sprite values to avoid conflicts. |
listOrder | The list weight for this item. |