diff options
author | Nao Pross <naopross@thearcway.org> | 2018-02-25 21:11:43 +0100 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2018-02-25 21:11:43 +0100 |
commit | 20b958c69451dd8251a8899cf7264d5c92ed7c60 (patch) | |
tree | 440ec68a189efdf42a21a9d621b6de2c04305fb5 /src/main/headers/Actor.hpp | |
parent | Update CMakeLists and Makefile (diff) | |
download | Subconscious-old-20b958c69451dd8251a8899cf7264d5c92ed7c60.tar.gz Subconscious-old-20b958c69451dd8251a8899cf7264d5c92ed7c60.zip |
Better management of stats and skill of actors and items
Diffstat (limited to 'src/main/headers/Actor.hpp')
-rw-r--r-- | src/main/headers/Actor.hpp | 71 |
1 files changed, 29 insertions, 42 deletions
diff --git a/src/main/headers/Actor.hpp b/src/main/headers/Actor.hpp index 1e160f6..6366f2e 100644 --- a/src/main/headers/Actor.hpp +++ b/src/main/headers/Actor.hpp @@ -1,14 +1,34 @@ #ifndef ACTOR_HPP #define ACTOR_HPP +#include "Weapon.hpp" + #include <list> #include <string> +#include <map> + -#include "Item.hpp" +class Item; class Actor { public: + enum class Stat + { + ATTACK, + DEFENCE, + MAGICATTACK, // magia + MAGICDEFENSE, // resistenza + PRECISION, + DODGE, + REACTION + }; + + enum class Skill + { + + }; + const std::string name; const unsigned maxHp; @@ -19,35 +39,19 @@ public: void heal(int amt); void store(Item &item); - Item& drop(); + Item* drop(); + + unsigned stat(Stat stat) const; + unsigned skill(Skill skill) const; /* accessors */ bool alive() const { return _alive; } unsigned hp() const { return _hp; } - unsigned attack() const { return _attack; } - unsigned defence() const { return _defence; } - - unsigned magicAttack() const { return _magicAttack; } - unsigned magicDefence() const { return _magicDefence; } - - unsigned precisionProbabiliy() const { return _precisionProbability; } - unsigned dodgeProbabiliy() const { return _dodgeProbability; } - - unsigned reactionSpeed() const { return _reactionSpeed; } - const std::list<Item*>& inventory() const { return _inventory; } - //TODO add weaponslot Item* weapon() const { return _weapon; } - unsigned levelAxe() const { return _levelAxe; } - unsigned levelLance() const { return _levelLance; } - unsigned levelSword() const { return _levelSword; } - unsigned levelRanged() const { return _levelRanged; } - unsigned levelStick() const { return _levelStick; } - unsigned levelMedicine() const { return _levelMedicine; } - int x() { return _x; } int y() { return _y; } @@ -59,31 +63,14 @@ protected: unsigned _movements; int _x, _y; - /* combat related */ - unsigned _attack; - unsigned _defence; - - unsigned _magicAttack; // nota come magia - unsigned _magicDefence; // nota come resistenza - - unsigned _precisionProbability; - unsigned _dodgeProbability; - unsigned _reactionSpeed; - - // unsigned _abilityProbability; - /* others */ + Item* _weapon; + unsigned _inventorySize; std::list<Item*> _inventory; - Item* _weapon; - - unsigned _levelAxe; - unsigned _levelLance; - unsigned _levelSword; - unsigned _levelRanged; - unsigned _levelStick; - unsigned _levelMedicine; + std::map<Stat, unsigned> _stats; + std::map<Weapon::Class, unsigned> _skills; Actor(std::string _name, unsigned _maxHp); }; |