added potion and restore_health

This commit is contained in:
2024-07-11 21:32:23 -04:00
parent ae5cd1e0c6
commit 0312986dce
7 changed files with 102 additions and 33 deletions

View File

@ -14,7 +14,7 @@
#include "constants.h"
#include "position.h"
#include "layer.h"
#include "objects.h"
#include "potion.h"
#include "rng.h"
// #include "inventory.h" // Reserved for later
@ -41,11 +41,12 @@ public:
character_list &chlist) = 0;
virtual result move_or_attack(const direction dir,
const position_list &available_positions,
const character_list &chlist);
character_list &chlist);
virtual result apply(direction &dir,
const potion_list &potions);
virtual result get_hit(const enum race &race, const int atk,
const float hitrate) = 0;
enum race get_race() const;
position get_position() const;
int get_HP() const;
@ -72,13 +73,15 @@ protected:
const enum race race;
int HP;
// IMPORTANT: keep track of ATK and DEF in game at turn time
int ATK;
int DEF;
position pos;
int gold; // characters spawn with gold
// inventory inventory; // Reserved
potion_list potions;// inventory inventory; // Reserved
float base_hit_rate; // requires: between [0,1]