#include "viking.h"

#include "constants.h"

viking::viking(RNG *rng, const feature enabled_features, const position &pos,
               const int gen_room_num):
        enemy_base{rng, enabled_features, VIKING, pos, gen_room_num, "V"} {}

const char *viking::get_race_name() const {
        return "Viking";
}

long_result viking::attack(character *ch) {
        auto res1 = ch->get_hit(this, ATK, base_hit_rate);

        if (res1.res == result::DIED)
                return res1;

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

        if (res1.res == MISS && res2.res == MISS)
                return {MISS, res1.msg + res2.msg};
        else if (res2.res == DIED)
                return {DIED, res1.msg + res2.msg};
        else
                return {HIT, res1.msg + res2.msg};
}
