From 4a851a8000b0c025d198f2e25af0b9347e7998ba Mon Sep 17 00:00:00 2001 From: myitinos Date: Mon, 31 Dec 2018 14:30:57 +0800 Subject: [PATCH] addedd hp and maxHP getter --- class/character.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/class/character.hpp b/class/character.hpp index 28b08e8..07b763b 100644 --- a/class/character.hpp +++ b/class/character.hpp @@ -42,6 +42,21 @@ class Character return hp > 0; } + bool restoreHP() + { + this->hp = this->maxHp; + } + + int checkHP() + { + return hp; + } + + int getMaxHP() + { + return maxHp; + } + int defend(int dmg) { dmg -= def;