22 #include <yaml-cpp/yaml.h> 27 enum ItemDamageType { DT_NONE, DT_AP, DT_IN, DT_HE, DT_LASER, DT_PLASMA, DT_STUN, DT_MELEE, DT_ACID, DT_SMOKE };
28 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 };
43 std::string _type, _name;
44 std::vector<std::string> _requires;
46 int _costBuy, _costSell, _transferTime, _weight;
47 int _bigSprite, _floorSprite, _handSprite, _bulletSprite;
48 int _fireSound, _hitSound, _hitAnimation;
50 std::vector<std::string> _compatibleAmmo;
51 ItemDamageType _damageType;
52 int _accuracyAuto, _accuracySnap, _accuracyAimed, _tuAuto, _tuSnap, _tuAimed;
53 int _clipSize, _accuracyMelee, _tuMelee;
54 BattleType _battleType;
55 bool _twoHanded, _fixedWeapon;
56 int _waypoints, _invWidth, _invHeight;
57 int _painKiller, _heal, _stimulant;
58 int _woundRecovery, _healthRecovery, _stunRecovery, _energyRecovery;
63 bool _recover, _liveAlien;
64 int _blastRadius, _attraction;
65 bool _flatRate, _arcingShot;
66 int _listOrder, _maxRange, _aimRange, _snapRange, _autoRange, _minRange, _dropoff, _bulletSpeed, _explosionSpeed, _autoShots, _shotgunPellets;
67 std::string _zombieUnit;
68 bool _strengthApplied, _skillApplied, _LOSRequired, _underwaterOnly, _landOnly;
69 int _meleeSound, _meleePower, _meleeAnimation, _meleeHitSound, _specialType, _vaporColor, _vaporDensity, _vaporProbability;
76 void load(
const YAML::Node& node,
Mod *mod,
int listIndex);
bool isRifle() const
is this item a 2 handed weapon?
Definition: RuleItem.cpp:769
bool isPistol() const
is this item a single handed weapon?
Definition: RuleItem.cpp:778
int getSellCost() const
Gets the item's sale cost.
Definition: RuleItem.cpp:226
int getTUUse() const
Gets the Time Unit use.
Definition: RuleItem.cpp:557
RuleItem(const std::string &type)
Creates a blank item ruleset.
Definition: RuleItem.cpp:33
int getTUAuto() const
Gets the item's autoshot TU cost.
Definition: RuleItem.cpp:399
int getHealQuantity() const
Gets the medikit heal quantity.
Definition: RuleItem.cpp:494
int getStunRecovery() const
Gets the medikit stun recovered per shot.
Definition: RuleItem.cpp:548
int getAttraction() const
How much do aliens want this thing?
Definition: RuleItem.cpp:670
std::string getName() const
Gets the item's name.
Definition: RuleItem.cpp:186
int getHandSprite() const
Gets the item's reference in HANDOB.PCK for use in inventory.
Definition: RuleItem.cpp:272
int getMaxRange() const
Get the max range of this weapon.
Definition: RuleItem.cpp:688
Contains all the game-specific static data that never changes throughout the game, like rulesets and resources.
Definition: Mod.h:87
bool getFlatRate() const
Should we charge a flat rate?
Definition: RuleItem.cpp:652
int getExplosionRadius() const
Gets the max explosion radius.
Definition: RuleItem.cpp:567
int getAutoRange() const
Get the max range of auto shots with this weapon.
Definition: RuleItem.cpp:715
int getDropoff() const
Get the accuracy dropoff of this weapon.
Definition: RuleItem.cpp:733
bool isWaterOnly() const
Is this item restricted to underwater use?
Definition: RuleItem.cpp:869
int getArmor() const
Gets the item's armor.
Definition: RuleItem.cpp:614
int getTurretType() const
Gets the item's turret type.
Definition: RuleItem.cpp:634
int getPower() const
Gets the item's power.
Definition: RuleItem.cpp:345
int getInventoryHeight() const
Gets the item's inventory height.
Definition: RuleItem.cpp:462
int getTransferTime() const
Gets the item's transfer time.
Definition: RuleItem.cpp:236
int getListOrder() const
Get the list weight for this item.
Definition: RuleItem.cpp:679
bool getArcingShot() const
Should this weapon arc?
Definition: RuleItem.cpp:661
int getClipSize() const
Gets the ammo amount.
Definition: RuleItem.cpp:471
std::string getZombieUnit() const
Gets the weapon's zombie unit.
Definition: RuleItem.cpp:796
BattleType getBattleType() const
Gets the item's type.
Definition: RuleItem.cpp:444
std::string getType() const
Gets the item's type.
Definition: RuleItem.cpp:176
int getAccuracySnap() const
Gets the item's snapshot accuracy.
Definition: RuleItem.cpp:354
int getTUAimed() const
Gets the item's aimed shot TU cost.
Definition: RuleItem.cpp:408
int getExplosionSpeed() const
How fast does the explosion animation play?
Definition: RuleItem.cpp:751
int getMeleeAttackSound() const
What sound does this weapon make when you swing this at someone?
Definition: RuleItem.cpp:824
int getVaporDensity() const
Gets the vapor cloud density.
Definition: RuleItem.cpp:908
int getBulletSpeed() const
How fast does a projectile fired from this weapon travel?
Definition: RuleItem.cpp:742
Represents a specific type of item.
Definition: RuleItem.h:40
int getAccuracyAimed() const
Gets the item's aimed shot accuracy.
Definition: RuleItem.cpp:372
void drawHandSprite(SurfaceSet *texture, Surface *surface) const
Draws the item's hand sprite onto a surface.
Definition: RuleItem.cpp:482
Container of a set of surfaces.
Definition: SurfaceSet.h:35
int getVaporProbability() const
Gets the vapor cloud probability.
Definition: RuleItem.cpp:917
int getHitAnimation() const
Gets the item's hit animation.
Definition: RuleItem.cpp:336
int getAccuracyAuto() const
Gets the item's autoshot accuracy.
Definition: RuleItem.cpp:363
int getMinRange() const
Get the minimum effective range of this weapon.
Definition: RuleItem.cpp:724
int getFireSound() const
Gets the item's fire sound.
Definition: RuleItem.cpp:318
bool isSkillApplied() const
Is skill applied to the accuracy of this weapon?
Definition: RuleItem.cpp:815
bool isLOSRequired() const
Check if LOS is required to use this item (only applies to psionic type items)
Definition: RuleItem.cpp:851
int getWeight() const
Gets the item's weight.
Definition: RuleItem.cpp:245
int getMeleeAnimation() const
Get the melee animation starting frame (comes from hit.pck).
Definition: RuleItem.cpp:860
int getWoundRecovery() const
Gets the medikit wound healed per shot.
Definition: RuleItem.cpp:521
bool isRecoverable() const
Gets the item's recoverability.
Definition: RuleItem.cpp:624
int getTUMelee() const
Gets the item's melee TU cost.
Definition: RuleItem.cpp:417
int getPainKillerQuantity() const
Gets the medikit pain killer quantity.
Definition: RuleItem.cpp:503
int getMeleeHitSound() const
What sound does this weapon make when you punch someone in the face with it?
Definition: RuleItem.cpp:833
double getSize() const
Gets the item's size.
Definition: RuleItem.cpp:206
int getSpecialType() const
Get the associated special type of this item.
Definition: RuleItem.cpp:890
bool isFixed() const
Gets if the item is fixed.
Definition: RuleItem.cpp:300
int getAimRange() const
Get the max range of aimed shots with this weapon.
Definition: RuleItem.cpp:697
int getInventoryWidth() const
Gets the item's inventory width.
Definition: RuleItem.cpp:453
std::vector< std::string > * getCompatibleAmmo()
Gets list of compatible ammo.
Definition: RuleItem.cpp:426
~RuleItem()
Cleans up the item ruleset.
Definition: RuleItem.cpp:44
int getAutoShots() const
How many auto shots does this weapon fire.
Definition: RuleItem.cpp:760
int getBulletSprite() const
Gets the item's bullet sprite reference.
Definition: RuleItem.cpp:309
Element that is blit (rendered) onto the screen.
Definition: Surface.h:38
bool isStrengthApplied() const
Is strength applied to the damage of this weapon?
Definition: RuleItem.cpp:805
int getBuyCost() const
Gets the item's purchase cost.
Definition: RuleItem.cpp:216
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:842
int getSnapRange() const
Get the max range of snap shots with this weapon.
Definition: RuleItem.cpp:706
int getVaporColor() const
Get the color offset to use for the vapor trail.
Definition: RuleItem.cpp:899
int getHealthRecovery() const
Gets the medikit health recovered per shot.
Definition: RuleItem.cpp:530
int getHitSound() const
Gets the item's hit sound.
Definition: RuleItem.cpp:327
int getEnergyRecovery() const
Gets the medikit energy recovered per shot.
Definition: RuleItem.cpp:539
bool isAlien() const
Checks if this a live alien.
Definition: RuleItem.cpp:643
int getWaypoints() const
Gets if the item is a launcher.
Definition: RuleItem.cpp:290
int getStimulantQuantity() const
Gets the medikit stimulant quantity.
Definition: RuleItem.cpp:512
ItemDamageType getDamageType() const
Gets the item's damage type.
Definition: RuleItem.cpp:435
int getFloorSprite() const
Gets the item's reference in FLOOROB.PCK for use in inventory.
Definition: RuleItem.cpp:263
int getRecoveryPoints() const
Gets the recovery points score.
Definition: RuleItem.cpp:604
const std::vector< std::string > & getRequirements() const
Gets the item's requirements.
Definition: RuleItem.cpp:196
int getTUSnap() const
Gets the item's snapshot TU cost.
Definition: RuleItem.cpp:390
bool isTwoHanded() const
Gets if the item is two-handed.
Definition: RuleItem.cpp:281
int getShotgunPellets() const
Get the number of projectiles to trace.
Definition: RuleItem.cpp:787
int getBigSprite() const
Gets the item's reference in BIGOBS.PCK for use in inventory.
Definition: RuleItem.cpp:254
void load(const YAML::Node &node, Mod *mod, int listIndex)
Loads item data from YAML.
Definition: RuleItem.cpp:54
bool isLandOnly() const
Is this item restricted to land use?
Definition: RuleItem.cpp:878
int getAccuracyMelee() const
Gets the item's melee accuracy.
Definition: RuleItem.cpp:381
Definition: BaseInfoState.cpp:40