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,9 +2,8 @@
#include <algorithm>
#include <math.h>
vampire::vampire(RNG *rng, const position_list &available_positions):
character{rng, race::rshade} {
pos = available_positions[rng->rand_under(available_positions.size())];
vampire::vampire(RNG *rng, const position &pos):
character{rng, race::rshade, pos} {
gold = 0;
hostile = true;
}
@ -13,8 +12,8 @@ result vampire::attack(const direction dir, character_list &chlist) {
position tmp{pos + MOVE[dir]};
for (auto &ch : chlist)
if (tmp == ch.get_position()) {
auto res = ch.get_hit(race, ATK, base_hit_rate);
if (tmp == ch->get_position()) {
auto res = ch->get_hit(race, ATK, base_hit_rate);
if (res != result::miss) {
HP += GAIN_HP;