aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/headers/Actor.hpp
blob: 90535b12d0d7554f1d1a5c0168b50ae579095b49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#ifndef ACTOR_HPP
#define ACTOR_HPP

#include <list>
#include <string>

#include "Item.hpp"

class Actor 
{
public:
    const unsigned maxHp;
    const std::string name;

    Actor() = delete;
    virtual ~Actor();

    void damage(int amt);
    void heal(int amt);

    void store(Item &item);
    Item& drop();

    /* 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; }

protected:
    bool _alive;
    unsigned _hp;

    /* movement related */
    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 */
    unsigned _inventorySize;
    std::list<Item*> _inventory;

    Item* _weapon;

    unsigned _levelAxe;
    unsigned _levelLance;
    unsigned _levelSword;
    unsigned _levelRanged;
    unsigned _levelStick;
    unsigned _levelMedicine;

    Actor(std::string _name, unsigned _maxHp);
};

#endif