20 #include <yaml-cpp/yaml.h> 46 int _inventoryX, _inventoryY;
48 int _fuseTimer, _ammoQuantity;
49 int _painKiller, _heal, _stimulant;
50 bool _XCOMProperty, _droppedOnAlienTurn, _isAmmo;
57 void load(
const YAML::Node& node,
Mod *mod);
59 YAML::Node
save()
const;
int getFuseTimer() const
Gets the turn until explosion.
Definition: BattleItem.cpp:149
void setAmmoQuantity(int qty)
Sets the item's ammo quantity.
Definition: BattleItem.cpp:180
RuleInventory * getSlot() const
Gets the item's inventory slot.
Definition: BattleItem.cpp:266
void setSlotX(int x)
Sets the item's inventory X position.
Definition: BattleItem.cpp:293
bool occupiesSlot(int x, int y, BattleItem *item=0) const
Checks if the item is occupying a slot.
Definition: BattleItem.cpp:323
Contains all the game-specific static data that never changes throughout the game, like rulesets and resources.
Definition: Mod.h:87
int getAmmoQuantity() const
Gets the item's ammo quantity.
Definition: BattleItem.cpp:167
bool needsAmmo() const
Determines if this item uses ammo.
Definition: BattleItem.cpp:356
bool isAmmo() const
Checks a flag on the item to see if it's a clip in a weapon or not.
Definition: BattleItem.cpp:558
void setOwner(BattleUnit *owner)
Sets the owner.
Definition: BattleItem.cpp:222
int getPainKillerQuantity() const
Get medikit pain killers quantity.
Definition: BattleItem.cpp:472
void load(const YAML::Node &node, Mod *mod)
Loads the item from YAML.
Definition: BattleItem.cpp:67
YAML::Node save() const
Saves the item to YAML.
Definition: BattleItem.cpp:97
bool getTurnFlag() const
get the flag representing "not dropped on player turn"
Definition: BattleItem.cpp:518
int getStimulantQuantity() const
Get medikit stimulant quantity.
Definition: BattleItem.cpp:490
BattleUnit * getUnit() const
Gets the corpse's unit.
Definition: BattleItem.cpp:427
void setPreviousOwner(BattleUnit *owner)
Sets the item's previous owner.
Definition: BattleItem.cpp:232
int getSlotX() const
Gets the item's inventory X position.
Definition: BattleItem.cpp:284
Represents a specific type of item.
Definition: RuleItem.h:40
int getHealQuantity() const
Get medikit heal quantity.
Definition: BattleItem.cpp:454
BattleItem * getAmmoItem()
Gets the item's ammo item.
Definition: BattleItem.cpp:347
Represents a single item in the battlescape.
Definition: BattleItem.h:37
void convertToCorpse(RuleItem *rules)
Sets the item's ruleset.
Definition: BattleItem.cpp:537
void setTurnFlag(bool flag)
set the flag representing "not dropped on player turn"
Definition: BattleItem.cpp:528
void setPainKillerQuantity(int pk)
Set medikit pain killers quantity.
Definition: BattleItem.cpp:463
void setTile(Tile *tile)
Sets the tile.
Definition: BattleItem.cpp:409
void setStimulantQuantity(int stimulant)
Set medikit stimulant quantity.
Definition: BattleItem.cpp:481
void setIsAmmo(bool ammo)
Sets a flag on the item indicating if this is a clip in a weapon or not.
Definition: BattleItem.cpp:549
BattleUnit * getPreviousOwner() const
Gets the item's previous owner.
Definition: BattleItem.cpp:213
int getSlotY() const
Gets the item's inventory Y position.
Definition: BattleItem.cpp:302
BattleUnit * getOwner() const
Gets the item's owner.
Definition: BattleItem.cpp:204
Basic element of which a battle map is build.
Definition: Tile.h:42
RuleItem * getRules() const
Gets the item's ruleset.
Definition: BattleItem.cpp:140
Tile * getTile() const
Gets the item's tile.
Definition: BattleItem.cpp:400
void setFuseTimer(int turns)
Sets the turns until explosion.
Definition: BattleItem.cpp:158
void setUnit(BattleUnit *unit)
Sets the corpse's unit.
Definition: BattleItem.cpp:436
bool getXCOMProperty() const
Get xcom property flag.
Definition: BattleItem.cpp:508
int getId() const
Gets it's unique id.
Definition: BattleItem.cpp:418
~BattleItem()
Cleans up the item.
Definition: BattleItem.cpp:58
BattleItem(RuleItem *rules, int *id)
Creates a item of the specified type.
Definition: BattleItem.cpp:34
int setAmmoItem(BattleItem *item)
Sets the item's ammo item.
Definition: BattleItem.cpp:366
bool spendBullet()
Spend one bullet.
Definition: BattleItem.cpp:189
void setSlotY(int y)
Sets the item's inventory Y position.
Definition: BattleItem.cpp:311
void setSlot(RuleInventory *slot)
Sets the item's inventory slot.
Definition: BattleItem.cpp:275
void setXCOMProperty(bool flag)
Set xcom property flag.
Definition: BattleItem.cpp:499
void setHealQuantity(int heal)
Set medikit Heal quantity.
Definition: BattleItem.cpp:445
Represents a moving unit in the battlescape, player controlled or AI controlled it holds info about i...
Definition: BattleUnit.h:59
Definition: BaseInfoState.cpp:40
void moveToOwner(BattleUnit *owner)
Removes the item from previous owner and moves to new owner.
Definition: BattleItem.cpp:241
Represents a specific section of the inventory, containing information like available slots and scree...
Definition: RuleInventory.h:42