finished the bulk of game
This commit is contained in:
27
src/potions/poison_health.cc
Normal file
27
src/potions/poison_health.cc
Normal file
@ -0,0 +1,27 @@
|
||||
#include "poison_health.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include "../constants.h"
|
||||
|
||||
poison_health::poison_health(const position &pos):
|
||||
potion{potion_type::poison_health, 1, pos} {}
|
||||
|
||||
void poison_health::apply(const enum race &race, int &HP, int &ATK, int &DEF,
|
||||
fraction &base_hit_rate) {
|
||||
if (remaining_duration > 0) {
|
||||
if (race == rdrow)
|
||||
HP = std::max(HP - 7, 0);
|
||||
else
|
||||
HP = std::max(HP - 5, 0);
|
||||
|
||||
--remaining_duration;
|
||||
}
|
||||
}
|
||||
|
||||
int poison_health::get_priority() const {
|
||||
return CALC_ADD_BASE;
|
||||
}
|
||||
|
||||
const char *poison_health::get_name() const {
|
||||
return "PH";
|
||||
}
|
Reference in New Issue
Block a user