merged DT/add-troll-char
This commit is contained in:
@ -16,7 +16,7 @@
|
||||
class character; // forward declaration
|
||||
|
||||
// Note: player should not be in the character list
|
||||
typedef std::vector<character *> character_list;
|
||||
|
||||
|
||||
class character {
|
||||
public:
|
||||
@ -32,78 +32,65 @@ public:
|
||||
|
||||
struct attack_result {
|
||||
result res;
|
||||
int dmg_dealt;
|
||||
int remaining_HP;
|
||||
character *which; // hit whom
|
||||
std::string msg;
|
||||
};
|
||||
|
||||
struct apply_result {
|
||||
result res;
|
||||
potion *which; // applied which potion
|
||||
std::string msg;
|
||||
};
|
||||
virtual result move(position_list spots, const direction &dir);
|
||||
|
||||
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;
|
||||
virtual attack_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);
|
||||
virtual void print(display *out);
|
||||
|
||||
result apply_effects();
|
||||
virtual result calc_effects();
|
||||
void discard_level_effects();
|
||||
void start_turn();
|
||||
virtual void start_turn();
|
||||
|
||||
enum race get_race() const;
|
||||
position get_position() const;
|
||||
position get_pos() const;
|
||||
void set_pos(const position &npos);
|
||||
|
||||
int get_HP() const;
|
||||
int get_ATK() const;
|
||||
int get_DEF() const;
|
||||
int get_gold() const;
|
||||
float get_hitrate_real() const;
|
||||
fraction get_hitrate() const;
|
||||
int get_room_num() const;
|
||||
|
||||
void set_position(const position &npos);
|
||||
void set_HP(const int nHP);
|
||||
void set_ATK(const int nATK);
|
||||
void set_DEF(const int nDEF);
|
||||
void set_gold(const int ngold);
|
||||
void set_hitrate(const fraction nhitrate);
|
||||
void set_room_num(const int room);
|
||||
|
||||
protected:
|
||||
RNG *rng;
|
||||
|
||||
const feature enabled_features;
|
||||
const enum race race;
|
||||
|
||||
int HP;
|
||||
position pos;
|
||||
|
||||
// IMPORTANT: keep track of ATK and DEF in game at turn time
|
||||
int ATK;
|
||||
int DEF;
|
||||
fraction base_hit_rate;
|
||||
|
||||
position pos;
|
||||
potion_list effects;
|
||||
|
||||
int gold; // characters spawn with gold
|
||||
potion_list potions; // inventory
|
||||
potion_list effects; // applied potions
|
||||
|
||||
int room_num;
|
||||
int calc_dmg(const int ATK, const int DEF);
|
||||
private:
|
||||
void insert_potion(potion *p);
|
||||
void insert_effect(potion *effect);
|
||||
};
|
||||
|
||||
int calc_dmg(const int ATK, const int DEF);
|
||||
typedef std::vector<character *> character_list;
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user