#include "assassin.h"

#include "constants.h"

assassin::assassin(RNG *rng, const feature enabled_features):
        player_base{rng, enabled_features, race::ASSASSIN} {};

const char *assassin::get_race_name() const {
        return "Assassin";
}

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

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

        if (res.res == HIT && rng->trial(INSTAKILL_RATE)) {
                ch->get_hit(this, INF, INF_HIT_RATE);
                return {HIT, "PC assassinated " + ch->get_abbrev() + ". "};
        }

        return res;
}
