clean potions contants

This commit is contained in:
a25liang
2024-07-17 20:09:16 -04:00
parent ea381c24f6
commit 9bc1170f31
13 changed files with 26 additions and 37 deletions

View File

@ -3,8 +3,6 @@
#include <algorithm>
#include "../constants.h"
const int WOUND_DEF = 5;
const int WOUND_DEF_DROW = 7;
wound_def::wound_def(const position &pos):
potion{potion_type::wound_def, -1, pos} {}
@ -12,11 +10,9 @@ wound_def::wound_def(const position &pos):
void wound_def::apply(const enum race &race, int &HP, int &ATK, int &DEF,
fraction &base_hit_rate) {
if (remaining_duration != 0) {
if (race == rdrow)
DEF = std::max(DEF - WOUND_DEF_DROW, 0);
else
DEF = std::max(DEF - WOUND_DEF, 0);
int tmp = WOUND_DEF;
if (race == rdrow) tmp *= DROW_POTION_MUL;
DEF = std::max(DEF - tmp, 0);
--remaining_duration;
}
}