19 #ifndef OPENXCOM_RULEITEM_H
20 #define OPENXCOM_RULEITEM_H
24 #include <yaml-cpp/yaml.h>
29 enum ItemDamageType { DT_NONE, DT_AP, DT_IN, DT_HE, DT_LASER, DT_PLASMA, DT_STUN, DT_MELEE, DT_ACID, DT_SMOKE };
30 enum BattleType { BT_NONE, BT_FIREARM, BT_AMMO, BT_MELEE, BT_GRENADE, BT_PROXIMITYGRENADE, BT_MEDIKIT, BT_SCANNER, BT_MINDPROBE, BT_PSIAMP, BT_FLARE, BT_CORPSE };
44 std::string _type, _name;
45 std::vector<std::string> _requires;
47 int _costBuy, _costSell, _transferTime, _weight;
48 int _bigSprite, _floorSprite, _handSprite, _bulletSprite;
49 int _fireSound, _hitSound, _hitAnimation;
51 std::vector<std::string> _compatibleAmmo;
52 ItemDamageType _damageType;
53 int _accuracyAuto, _accuracySnap, _accuracyAimed, _tuAuto, _tuSnap, _tuAimed;
54 int _clipSize, _accuracyMelee, _tuMelee;
55 BattleType _battleType;
56 bool _twoHanded, _waypoint, _fixedWeapon;
57 int _invWidth, _invHeight;
58 int _painKiller, _heal, _stimulant;
59 int _woundRecovery, _healthRecovery, _stunRecovery, _energyRecovery;
64 bool _recover, _liveAlien;
65 int _blastRadius, _attraction;
66 bool _flatRate, _arcingShot;
67 int _listOrder, _maxRange, _aimRange, _snapRange, _autoRange, _minRange, _dropoff, _bulletSpeed, _explosionSpeed, _autoShots, _shotgunPellets;
68 std::string _zombieUnit;
69 bool _strengthApplied, _skillApplied, _LOSRequired;
70 int _meleeSound, _meleePower, _meleeAnimation, _meleeHitSound;
77 void load(
const YAML::Node& node,
int modIndex,
int listIndex);
void load(const YAML::Node &node, int modIndex, int listIndex)
Loads item data from YAML.
Definition: RuleItem.cpp:55
int getRecoveryPoints() const
Gets the recovery points score.
Definition: RuleItem.cpp:624
RuleItem(const std::string &type)
Creates a blank item ruleset.
Definition: RuleItem.cpp:31
int getExplosionRadius() const
Gets the max explosion radius.
Definition: RuleItem.cpp:587
int getPower() const
Gets the item's power.
Definition: RuleItem.cpp:365
int getInventoryWidth() const
Gets the item's inventory width.
Definition: RuleItem.cpp:473
int getAccuracyMelee() const
Gets the item's melee accuracy.
Definition: RuleItem.cpp:401
int getTUUse() const
Gets the Time Unit use.
Definition: RuleItem.cpp:577
BattleType getBattleType() const
Gets the item's type.
Definition: RuleItem.cpp:464
bool getAlien() const
Checks if this a live alien.
Definition: RuleItem.cpp:663
int getPainKillerQuantity() const
Gets the medikit pain killer quantity.
Definition: RuleItem.cpp:523
int getHitSound() const
Gets the item's hit sound.
Definition: RuleItem.cpp:347
int getFloorSprite() const
Gets the item's reference in FLOOROB.PCK for use in inventory.
Definition: RuleItem.cpp:283
std::string getZombieUnit() const
Gets the weapon's zombie unit.
Definition: RuleItem.cpp:816
int getTUAimed() const
Gets the item's aimed shot TU cost.
Definition: RuleItem.cpp:428
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...
Definition: RuleItem.cpp:862
int getDropoff() const
Get the accuracy dropoff of this weapon.
Definition: RuleItem.cpp:753
bool getArcingShot() const
Should this weapon arc?
Definition: RuleItem.cpp:681
int getTUAuto() const
Gets the item's autoshot TU cost.
Definition: RuleItem.cpp:419
int getTransferTime() const
Gets the item's transfer time.
Definition: RuleItem.cpp:256
int getBulletSpeed() const
How fast does a projectile fired from this weapon travel?
Definition: RuleItem.cpp:762
int getFireSound() const
Gets the item's fire sound.
Definition: RuleItem.cpp:338
int getMeleeAnimation() const
Get the melee animation starting frame (comes from hit.pck).
Definition: RuleItem.cpp:880
double getSize() const
Gets the item's size.
Definition: RuleItem.cpp:226
int getBulletSprite() const
Gets the item's bullet sprite reference.
Definition: RuleItem.cpp:329
int getWoundRecovery() const
Gets the medikit wound healed per shot.
Definition: RuleItem.cpp:541
int getAutoRange() const
Get the max range of auto shots with this weapon.
Definition: RuleItem.cpp:735
bool isRifle() const
is this item a 2 handed weapon?
Definition: RuleItem.cpp:789
const std::vector< std::string > & getRequirements() const
Gets the item's requirements.
Definition: RuleItem.cpp:216
int getShotgunPellets() const
Get the number of projectiles to trace.
Definition: RuleItem.cpp:807
int getHandSprite() const
Gets the item's reference in HANDOB.PCK for use in inventory.
Definition: RuleItem.cpp:292
bool isStrengthApplied() const
Is strength applied to the damage of this weapon?
Definition: RuleItem.cpp:825
Represents a specific type of item.
Definition: RuleItem.h:41
Container of a set of surfaces.
Definition: SurfaceSet.h:38
int getAutoShots() const
How many auto shots does this weapon fire.
Definition: RuleItem.cpp:780
int getAccuracySnap() const
Gets the item's snapshot accuracy.
Definition: RuleItem.cpp:374
int getSellCost() const
Gets the item's sale cost.
Definition: RuleItem.cpp:246
bool isRecoverable() const
Gets the item's recoverability.
Definition: RuleItem.cpp:644
bool isTwoHanded() const
Gets if the item is two-handed.
Definition: RuleItem.cpp:301
int getHitAnimation() const
Gets the item's hit animation.
Definition: RuleItem.cpp:356
bool isPistol() const
is this item a single handed weapon?
Definition: RuleItem.cpp:798
int getMaxRange() const
Get the max range of this weapon.
Definition: RuleItem.cpp:708
int getBigSprite() const
Gets the item's reference in BIGOBS.PCK for use in inventory.
Definition: RuleItem.cpp:274
bool getFlatRate() const
Should we charge a flat rate?
Definition: RuleItem.cpp:672
int getMeleeHitSound() const
What sound does this weapon make when you punch someone in the face with it?
Definition: RuleItem.cpp:853
std::string getName() const
Gets the item's name.
Definition: RuleItem.cpp:206
bool isFixed() const
Gets if the item is fixed.
Definition: RuleItem.cpp:320
int getMinRange() const
Get the minimum effective range of this weapon.
Definition: RuleItem.cpp:744
bool isSkillApplied() const
Is skill applied to the accuracy of this weapon?
Definition: RuleItem.cpp:835
std::vector< std::string > * getCompatibleAmmo()
Gets list of compatible ammo.
Definition: RuleItem.cpp:446
~RuleItem()
Cleans up the item ruleset.
Definition: RuleItem.cpp:45
void drawHandSprite(SurfaceSet *texture, Surface *surface) const
Draws the item's hand sprite onto a surface.
Definition: RuleItem.cpp:502
int getHealthRecovery() const
Gets the medikit health recovered per shot.
Definition: RuleItem.cpp:550
int getTUMelee() const
Gets the item's melee TU cost.
Definition: RuleItem.cpp:437
std::string getType() const
Gets the item's type.
Definition: RuleItem.cpp:196
Element that is blit (rendered) onto the screen.
Definition: Surface.h:39
bool isLOSRequired() const
Check if LOS is required to use this item (only applies to psionic type items)
Definition: RuleItem.cpp:871
int getTUSnap() const
Gets the item's snapshot TU cost.
Definition: RuleItem.cpp:410
int getArmor() const
Gets the item's armor.
Definition: RuleItem.cpp:634
int getWeight() const
Gets the item's weight.
Definition: RuleItem.cpp:265
int getListOrder() const
Get the list weight for this item.
Definition: RuleItem.cpp:699
int getAccuracyAimed() const
Gets the item's aimed shot accuracy.
Definition: RuleItem.cpp:392
int getSnapRange() const
Get the max range of snap shots with this weapon.
Definition: RuleItem.cpp:726
int getStunRecovery() const
Gets the medikit stun recovered per shot.
Definition: RuleItem.cpp:568
int getAttraction() const
How much do aliens want this thing?
Definition: RuleItem.cpp:690
int getHealQuantity() const
Gets the medikit heal quantity.
Definition: RuleItem.cpp:514
int getTurretType() const
Gets the item's turret type.
Definition: RuleItem.cpp:654
int getEnergyRecovery() const
Gets the medikit energy recovered per shot.
Definition: RuleItem.cpp:559
int getBuyCost() const
Gets the item's purchase cost.
Definition: RuleItem.cpp:236
int getAccuracyAuto() const
Gets the item's autoshot accuracy.
Definition: RuleItem.cpp:383
int getAimRange() const
Get the max range of aimed shots with this weapon.
Definition: RuleItem.cpp:717
int getClipSize() const
Gets the ammo amount.
Definition: RuleItem.cpp:491
bool isWaypoint() const
Gets if the item is a launcher.
Definition: RuleItem.cpp:310
int getStimulantQuantity() const
Gets the medikit stimulant quantity.
Definition: RuleItem.cpp:532
int getInventoryHeight() const
Gets the item's inventory height.
Definition: RuleItem.cpp:482
int getExplosionSpeed() const
How fast does the explosion animation play?
Definition: RuleItem.cpp:771
int getMeleeAttackSound() const
What sound does this weapon make when you swing this at someone?
Definition: RuleItem.cpp:844
ItemDamageType getDamageType() const
Gets the item's damage type.
Definition: RuleItem.cpp:455