HALTED: major overhaul for character
This commit is contained in:
@ -29,21 +29,33 @@ public:
|
||||
direction_list moveable(const position_list &available_positions) const;
|
||||
virtual result move(const direction dir,
|
||||
const position_list &available_positions);
|
||||
virtual result attack(const direction dir,
|
||||
character_list &chlist) = 0;
|
||||
virtual result move_or_attack(const direction dir,
|
||||
const position_list &available_positions,
|
||||
character_list &chlist);
|
||||
|
||||
virtual result attack(const direction dir, character *ch) = 0;
|
||||
virtual result move_or_attack(const direction dir,
|
||||
const position_list &available_positions,
|
||||
character *ch);
|
||||
struct attack_result {
|
||||
result res;
|
||||
int dmg_dealt;
|
||||
int remaining_HP;
|
||||
character *which; // hit whom
|
||||
};
|
||||
|
||||
virtual void apply(direction &dir,
|
||||
potion_list &potions);
|
||||
virtual result get_hit(const enum race &race, const int atk,
|
||||
const fraction hitrate) = 0;
|
||||
struct apply_result {
|
||||
result res;
|
||||
potion *which; // applied which potion
|
||||
};
|
||||
|
||||
struct hit_result {
|
||||
result res;
|
||||
int dmg_dealt;
|
||||
int remaining_HP;
|
||||
};
|
||||
|
||||
virtual attack_result attack(const direction dir,
|
||||
character_list &chlist) = 0;
|
||||
virtual attack_result attack(const direction dir, character *ch) = 0;
|
||||
|
||||
virtual apply_result apply(const direction &dir,
|
||||
potion_list &potions);
|
||||
virtual hit_result get_hit(const enum race &race, const int atk,
|
||||
const fraction hitrate) = 0;
|
||||
|
||||
// overload for different races
|
||||
virtual void print(display *out, bool player = false);
|
||||
@ -60,7 +72,6 @@ public:
|
||||
int get_gold() const;
|
||||
float get_hitrate_real() const;
|
||||
fraction get_hitrate() const;
|
||||
bool is_hostile() const;
|
||||
int get_room_num() const;
|
||||
|
||||
void set_position(const position &npos);
|
||||
@ -69,14 +80,8 @@ public:
|
||||
void set_DEF(const int nDEF);
|
||||
void set_gold(const int ngold);
|
||||
void set_hitrate(const fraction nhitrate);
|
||||
virtual void set_hostile(const bool is_hostile);
|
||||
void set_room_num(const int room);
|
||||
|
||||
// if stat is hostile, positive to set it to hostile,
|
||||
// negative to set it to peaceful
|
||||
void apply_buff(const stat_name statn, const int amount);
|
||||
// void apply_buff(const stat_name statn, const float mul);
|
||||
// reserved for later
|
||||
protected:
|
||||
RNG *rng;
|
||||
const enum race race;
|
||||
@ -94,7 +99,6 @@ protected:
|
||||
potion_list potions; // inventory
|
||||
potion_list effects; // applied potions
|
||||
|
||||
bool hostile;
|
||||
int room_num;
|
||||
private:
|
||||
void insert_potion(potion *p);
|
||||
|
Reference in New Issue
Block a user