Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>;
- using namespace std;
- class creature
- {
- string name = "default";
- char symbol = '@';
- int health = 999;
- int damage = 999;
- int gold = 999;
- public:
- void get(string name_n, char symbol_n, int health_n, int damage_n, int gold_n)
- {
- name = name_n;
- symbol = symbol_n;
- health = health_n;
- damage = damage_n;
- gold = gold_n;
- }
- void reduceHealth(int damage) {
- health = health-damage;
- }
- bool isDead()
- {
- if (0>=health) {
- return true;
- }
- }
- void addGold(int gold)
- {
- gold = gold + gold;
- }
- };
- class Player : public creature
- {
- int level = 1;
- public:
- void get()
- {
- this->level = level;
- }
- void level_up(){
- level++;
- damage++;
- }
- };
- int main()
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement