#include <item.h>
Public Member Functions | |
| Weapon (int _rarity, int _weight, Tile _sprite, std::string _name, IntPoint _coords, int t, int _dam) | |
| Weapon (IntPoint _coords, WeaponType wpn) | |
| void | perform_action () |
| int | get_type () |
| int | get_damage () |
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 | damage |
| int | range |
| 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 weapons. Weapons refer to anything that can be wielded to alter a character's attack.
| Weapon::Weapon | ( | int | _rarity, |
| int | _weight, | ||
| Tile | _sprite, | ||
| std::string | _name, | ||
| IntPoint | _coords, | ||
| int | t, | ||
| int | _dam | ||
| ) |
The constructor for the weapon.
| _rarity | Sets the rarity of the weapon. |
| _weight | Sets the weight of the weapon. |
| _sprite | Sets the sprite for the weapon. |
| _name | Sets the name of the weapon. |
| _coords | Sets the coordinates of the weapon. |
| t | Sets the type of the weapon. |
| _dam | Sets the damage of the weapon. |
| Weapon::Weapon | ( | IntPoint | _coords, |
| WeaponType | wpn | ||
| ) |
Constructor for the weapon. This is the normally used constructor, relying on the defined WeaponTypes and taking a set of coordinates.
| _coords | Sets the coordinates of the weapon. |
| wpn | The template for the weapon. |
| int Weapon::get_damage | ( | ) |
Public accessor for the variable to_dam.
| int Weapon::get_type | ( | ) |
Public accessor for the variable type.
|
virtual |
For performaing an action other than changing the attack of the character.
Implements Item.
|
protected |
The value the character's attack will become. A character's attack will be replaced by (not added to) the damage done by a weapon.
|
protected |
How many tiles the weapon can reach.
|
protected |
The possible types that the weapon can be. The possible types are as follows: 1 = piercing, 2 = slashing, and 3 = bludgeoning.
1.8.8