#include "vampire.h"

#include "constants.h"

vampire::vampire(RNG *rng, const feature enabled_features):
        player_base{rng, enabled_features, race::VAMPIRE} {};

const char *vampire::get_race_name() const {
        return "Vampire";
}

long_result vampire::attack(character *ch) {
        if (ch == nullptr)
                return {result::NOTHING,
                        "PC tried to drain thin air. "};

        auto res = ch->get_hit(this, ATK, base_hit_rate);

        if (res.res == MISS)
                return {MISS, res.msg + "PC is unhappy. "};

        if (ch->get_race() == DWARF) {
                HP -= GAIN_HP;

                if (is_dead())
                        return {DIED, ""};

                return {HIT, res.msg + "PC accidentally drained themselves. "};
        }

        HP += GAIN_HP;
        return {HIT, res.msg + "PC is happy. "};
}
