19 #ifndef OPENXCOM_BATTLEITEM_H
20 #define OPENXCOM_BATTLEITEM_H
22 #include "../Battlescape/Position.h"
23 #include <yaml-cpp/yaml.h>
48 int _inventoryX, _inventoryY;
50 int _fuseTimer, _ammoQuantity;
51 int _painKiller, _heal, _stimulant;
52 bool _XCOMProperty, _droppedOnAlienTurn;
59 void load(
const YAML::Node& node);
61 YAML::Node
save()
const;
int getAmmoQuantity() const
Gets the item's ammo quantity.
Definition: BattleItem.cpp:173
void setAmmoQuantity(int qty)
Sets the item's ammo quantity.
Definition: BattleItem.cpp:186
void setSlotX(int x)
Sets the item's inventory X position.
Definition: BattleItem.cpp:288
int getPainKillerQuantity() const
Get medikit pain killers quantity.
Definition: BattleItem.cpp:462
BattleUnit * getPreviousOwner() const
Gets the item's previous owner.
Definition: BattleItem.cpp:217
RuleItem * getRules() const
Gets the item's ruleset.
Definition: BattleItem.cpp:146
BattleUnit * getOwner() const
Gets the item's owner.
Definition: BattleItem.cpp:208
void setOwner(BattleUnit *owner)
Sets the owner.
Definition: BattleItem.cpp:226
void load(const YAML::Node &node)
Loads the item from YAML.
Definition: BattleItem.cpp:65
bool needsAmmo() const
Determines if this item uses ammo.
Definition: BattleItem.cpp:351
bool occupiesSlot(int x, int y, BattleItem *item=0) const
Checks if the item is occupying a slot.
Definition: BattleItem.cpp:318
Represents a specific type of item.
Definition: RuleItem.h:41
RuleInventory * getSlot() const
Gets the item's inventory slot.
Definition: BattleItem.cpp:261
int getSlotY() const
Gets the item's inventory Y position.
Definition: BattleItem.cpp:297
BattleItem * getAmmoItem()
Gets the item's ammo item.
Definition: BattleItem.cpp:342
Represents a single item in the battlescape.
Definition: BattleItem.h:39
void convertToCorpse(RuleItem *rules)
Sets the item's ruleset.
Definition: BattleItem.cpp:526
void setTurnFlag(bool flag)
set the flag representing "not dropped on player turn"
Definition: BattleItem.cpp:517
void setPainKillerQuantity(int pk)
Set medikit pain killers quantity.
Definition: BattleItem.cpp:453
void setTile(Tile *tile)
Sets the tile.
Definition: BattleItem.cpp:399
int getHealQuantity() const
Get medikit heal quantity.
Definition: BattleItem.cpp:444
void setStimulantQuantity(int stimulant)
Set medikit stimulant quantity.
Definition: BattleItem.cpp:471
YAML::Node save() const
Saves the item to YAML.
Definition: BattleItem.cpp:81
Basic element of which a battle map is build.
Definition: Tile.h:43
int getId() const
Gets it's unique id.
Definition: BattleItem.cpp:408
void setFuseTimer(int turns)
Sets the turns until explosion.
Definition: BattleItem.cpp:164
void setUnit(BattleUnit *unit)
Sets the corpse's unit.
Definition: BattleItem.cpp:426
Tile * getTile() const
Gets the item's tile.
Definition: BattleItem.cpp:390
BattleUnit * getUnit() const
Gets the corpse's unit.
Definition: BattleItem.cpp:417
~BattleItem()
Cleans up the item.
Definition: BattleItem.cpp:57
BattleItem(RuleItem *rules, int *id)
Creates a item of the specified type.
Definition: BattleItem.cpp:33
int setAmmoItem(BattleItem *item)
Sets the item's ammo item.
Definition: BattleItem.cpp:361
bool spendBullet()
Spend one bullet.
Definition: BattleItem.cpp:195
int getFuseTimer() const
Gets the turn until explosion.
Definition: BattleItem.cpp:155
int getStimulantQuantity() const
Get medikit stimulant quantity.
Definition: BattleItem.cpp:480
bool getTurnFlag() const
get the flag representing "not dropped on player turn"
Definition: BattleItem.cpp:507
void setSlotY(int y)
Sets the item's inventory Y position.
Definition: BattleItem.cpp:306
void setSlot(RuleInventory *slot)
Sets the item's inventory slot.
Definition: BattleItem.cpp:270
void setXCOMProperty(bool flag)
Set xcom property flag.
Definition: BattleItem.cpp:489
void setHealQuantity(int heal)
Set medikit Heal quantity.
Definition: BattleItem.cpp:435
bool getXCOMProperty() const
Get xcom property flag.
Definition: BattleItem.cpp:497
int getSlotX() const
Gets the item's inventory X position.
Definition: BattleItem.cpp:279
Represents a moving unit in the battlescape, player controlled or AI controlled it holds info about i...
Definition: BattleUnit.h:58
void moveToOwner(BattleUnit *owner)
Removes the item from previous owner and moves to new owner.
Definition: BattleItem.cpp:236
Represents a specific section of the inventory, containing information like available slots and scree...
Definition: RuleInventory.h:44