#include "ironclad_ward.h"

#include <algorithm>
#include "constants.h"

ironclad_ward::ironclad_ward(const position &pos):
        potion{potion_type::IRONCLAD_WARD, DURATION, pos} {}

void ironclad_ward::apply(const enum race &race, int &HP, int &ATK,
                          int &DEF, fraction &base_hit_rate) {
        if (remaining_duration != 0) {
                ATK *= ATK_MUL * (race == DROW ? DROW_POTION_MUL : 1);
                DEF *= DEF_MUL * (race == DROW ? DROW_POTION_MUL : 1);
                base_hit_rate *= HR_MUL;
                --remaining_duration;
        }
}

int ironclad_ward::get_priority() const {
        return CALC_LAST;
}

const char *ironclad_ward::get_name() const {
        return "IW";
}
