fixed potions not working properly
need to test: vampire draining
This commit is contained in:
@ -11,7 +11,7 @@ boost_atk::boost_atk(const position &pos):
|
||||
|
||||
void boost_atk::apply(const enum race &race, int &HP, int &ATK, int &DEF,
|
||||
fraction &base_hit_rate) {
|
||||
if (remaining_duration > 0) {
|
||||
if (remaining_duration != 0) {
|
||||
if (race == rdrow)
|
||||
ATK += BOOST_ATK_DROW;
|
||||
else
|
||||
|
@ -12,7 +12,7 @@ boost_def::boost_def(const position &pos):
|
||||
|
||||
void boost_def::apply(const enum race &race, int &HP, int &ATK, int &DEF,
|
||||
fraction &base_hit_rate) {
|
||||
if (remaining_duration > 0) {
|
||||
if (remaining_duration != 0) {
|
||||
if (race == rdrow)
|
||||
DEF += BOOST_DEF_DROW;
|
||||
else
|
||||
|
@ -8,7 +8,7 @@ poison_health::poison_health(const position &pos):
|
||||
|
||||
void poison_health::apply(const enum race &race, int &HP, int &ATK, int &DEF,
|
||||
fraction &base_hit_rate) {
|
||||
if (remaining_duration > 0) {
|
||||
if (remaining_duration != 0) {
|
||||
if (race == rdrow)
|
||||
HP = std::max(HP - 7, 0);
|
||||
else
|
||||
|
@ -4,11 +4,11 @@
|
||||
#include "../constants.h"
|
||||
|
||||
restore_health::restore_health(const position &pos):
|
||||
potion{potion_type::restore_health, -1, pos} {}
|
||||
potion{potion_type::restore_health, 1, pos} {}
|
||||
|
||||
void restore_health::apply(const enum race &race, int &HP, int &ATK, int &DEF,
|
||||
fraction &base_hit_rate) {
|
||||
if (remaining_duration > 0) {
|
||||
if (remaining_duration != 0) {
|
||||
if (race == rdrow)
|
||||
HP = std::min(HP + 7, MAX_HP[race]);
|
||||
else
|
||||
|
@ -11,7 +11,7 @@ wound_atk::wound_atk(const position &pos):
|
||||
|
||||
void wound_atk::apply(const enum race &race, int &HP, int &ATK, int &DEF,
|
||||
fraction &base_hit_rate) {
|
||||
if (remaining_duration > 0) {
|
||||
if (remaining_duration != 0) {
|
||||
if (race == rdrow)
|
||||
ATK = std::max(ATK - WOUND_ATK_DROW, 0);
|
||||
else
|
||||
|
@ -11,7 +11,7 @@ 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 (remaining_duration != 0) {
|
||||
if (race == rdrow)
|
||||
DEF = std::max(DEF - WOUND_DEF_DROW, 0);
|
||||
else
|
||||
|
Reference in New Issue
Block a user