Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Enemy
- private:
- int level;
- int hp;
- int hpMax;
- int damageMin;
- int damageMax;
- float dropChance;
- int defence;
- int accuracy;
- public:
- Enemy(int level = 0);
- virtual ~Enemy();
- inline bool isAlive() { return this->hp > 0; }
- std::string getAsString()const;
- void takeDamage(int damage);
- inline int getLevel()const { return this->level; }
- inline int getDamageMin()const { return this->damageMin; }
- inline int getDamageMax()const { return this->damageMax; }
- inline int getDamage()const { return rand() % this->damageMax + this->damageMin; }
- inline int getExp()const { return this->level * 100; }
- inline int getHp()const { return this->hp; }
- inline int getHpMax()const { return this->hpMax; }
- inline int getDefence()const { return this->defence; }
- inline int getAccuracy()const { return this->accuracy; }
- };
- class Character
- {
- private:
- int distanceTravelled;
- int gold;
- std::string name;
- int level;
- int exp;
- int expNext;
- int strength;
- int vitality;
- int dexterity;
- int intelligence;
- int hp;
- int hpMax;
- int stamina;
- int staminaMax;
- int damageMin;
- int damageMax;
- int defence;
- int accuracy;
- int luck;
- int statPoints;
- public:
- Character();
- Character(string name, int distanceTravelled,
- int gold, int level,
- int exp, int strength, int vitality,
- int dexterity, int intelligence,
- int hp, int stamina, int statPoints);
- virtual ~Character();
- //Functions
- void initialize(const std::string name);
- void printStats() const;
- string getAsString()const;
- void levelUp();
- void updateStats();
- void addToStat(int stat, int value);
- inline void resetHP() { this->hp = this->hpMax; }
- //Accessors
- inline const int& getDistTravel() const { return this->distanceTravelled; }
- inline const std::string& getName() const { return this->name; }
- inline const int& getLevel() const { return this->level; }
- inline const int& getExp() const { return this->exp; }
- inline const int& getExpNext() const { return this->expNext; }
- inline const int& getStatPoints() const { return this->statPoints; }
- inline const int& getHP() const { return this->hp; }
- inline const int& getHPMax() const { return this->hpMax; }
- inline const bool isAlive() { return this->hp > 0; }
- inline const int& getStamina() const { return this->stamina; }
- inline const int& getDamageMin() const { return this->damageMin; }
- inline const int& getDamageMax() const { return this->damageMax; }
- //Modifier
- inline void setDistTravelled(const int& distance) { this->distanceTravelled = distance; }
- inline void travel() { this->distanceTravelled++; }
- inline void gainExp(const int exp) { this->exp += exp; }
- inline void gainGold(const int gold) { this->gold += gold; }
- inline void payGold(const int gold) { this->gold -= gold; }
- void takeDamage(const int damage);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement