TODO: modify other races constructors

did some reworking
This commit is contained in:
2024-07-13 14:02:30 -04:00
parent f2d2f6f72d
commit 9fdbf141d3
24 changed files with 227 additions and 186 deletions

View File

@ -2,11 +2,10 @@
#include <algorithm>
character::character(RNG *rng, const enum race &nrace):
rng{rng},
race{nrace}, HP{STARTING_HP[race]},
character::character(RNG *rng, const enum race &nrace, const position &pos):
rng{rng}, race{nrace}, HP{STARTING_HP[race]},
ATK{STARTING_ATK[race]}, DEF{STARTING_DEF[race]},
base_hit_rate{1, 1} {}
base_hit_rate{1, 1}, pos{pos} {}
void character::start_turn() {
ATK = STARTING_ATK[race];
@ -14,6 +13,11 @@ void character::start_turn() {
base_hit_rate = {1, 1};
}
void character::print(display *out, bool color, bool player) {
out->print_char(pos, player ? '@' : CHARACTER_REP[race],
COLOR_PAIR(COLOR_BLACK_ON_WHITE));
}
enum race character::get_race() const {
return race;
}
@ -46,10 +50,18 @@ fraction character::get_hitrate() const {
return base_hit_rate;
}
int character::get_room_num() const {
return room_num;
}
bool character::is_hostile() const {
return hostile;
}
void character::set_room_num(const int room) {
room_num = room;
}
void character::set_position(const position &npos) {
pos = npos;
}