finished the bulk of game
This commit is contained in:
30
src/potions/wound_def.cc
Normal file
30
src/potions/wound_def.cc
Normal file
@ -0,0 +1,30 @@
|
||||
#include "wound_def.h"
|
||||
|
||||
#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} {}
|
||||
|
||||
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);
|
||||
|
||||
--remaining_duration;
|
||||
}
|
||||
}
|
||||
|
||||
int wound_def::get_priority() const {
|
||||
return CALC_ADD_BASE;
|
||||
}
|
||||
|
||||
const char *wound_def::get_name() const {
|
||||
return "WD";
|
||||
}
|
Reference in New Issue
Block a user