#include <item.h>
Public Member Functions | |
| Consumable (int _rarity, int _weight, Tile _sprite, std::string _name, IntPoint _coords, int stat, int val, int _type) | |
| Consumable (IntPoint _coords, ConsumableType cons) | |
| void | perform_action () |
| int | get_stat () |
| int | get_amount () |
| int | get_type () |
Public Member Functions inherited from Item | |
| Item (IntPoint _coords) | |
| Item (int _rarity, int _weight, Tile _sprite, std::string _name, IntPoint _coords) | |
| int | get_weight () |
| Tile * | get_sprite () |
| IntPoint | get_coords () |
| void | set_coords (IntPoint _c) |
| std::string | get_name () |
| int | get_rarity () |
| std::string | get_description () |
| int | get_size () |
Protected Attributes | |
| int | stat_modified |
| int | amount_modified |
| int | type |
Protected Attributes inherited from Item | |
| std::string | name |
| std::string | description |
| int | weight |
| IntPoint | coords |
| Tile | sprite |
| int | rarity |
| int | size |
Additional Inherited Members | |
Public Attributes inherited from Item | |
| bool | can_equip |
| bool | can_use |
| bool | can_wield |
| bool | can_consume |
Class for creating consumables. Consumables refer to anything that can be consumed to alter a stat in some way.
| Consumable::Consumable | ( | int | _rarity, |
| int | _weight, | ||
| Tile | _sprite, | ||
| std::string | _name, | ||
| IntPoint | _coords, | ||
| int | stat, | ||
| int | val, | ||
| int | _type | ||
| ) |
The constructor for the consumable.
| _rarity | Sets the rarity of the consumable. |
| _weight | Sets the weight of the consumable. |
| _sprite | Sets the sprite for the consumable. |
| _name | Sets the name of the consumable. |
| _coords | Sets the coordinates of the consumable. |
| stat | Sets the stat_modified variable of the consumable. |
| val | Sets the amount_modified variable of the consumable. |
| _type | Sets the type of the consumable. |
| Consumable::Consumable | ( | IntPoint | _coords, |
| ConsumableType | cons | ||
| ) |
Constructor for the consumable. This is the normally used constructor, relying on the defined ConsumableType and taking a set of coordinates.
| _coords | Sets the coordinates of the consumable. |
| cons | The template for th consumable. |
| int Consumable::get_amount | ( | ) |
Public accessor for the variable amount_modified.
| int Consumable::get_stat | ( | ) |
Public accessor for the variable stat_modified.
| int Consumable::get_type | ( | ) |
Public accessor for the variable type.
|
virtual |
For performaing an action other than changing a stat of the character.
Implements Item.
|
protected |
The magnitude that the stat should be modified by.
|
protected |
The stat that will be modified by the consumable. This corresponds an index in the current_stat or stat vector in the character class.
|
protected |
How the consumable will behave. Corresponds to the enum ConsumableTypes, which defines the behavior of consumable, e.g. restore health vs. fortifying health.
1.8.8