merged with paul, work in progress
This commit is contained in:
@ -2,21 +2,21 @@
|
|||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
poison_health::poison_health():
|
poison_health::poison_health(const position &pos):
|
||||||
potion{potion_type::poison_health, 1} {}
|
potion{potion_type::poison_health, 1, pos} {}
|
||||||
|
|
||||||
void poison_health::apply(enum race &race, int &HP, int &ATK, int &DEF,
|
void poison_health::apply(const enum race &race, int &HP, int &ATK, int &DEF,
|
||||||
float &base_hit_rate) {
|
fraction &base_hit_rate) {
|
||||||
if (remaining_duration > 0) {
|
if (remaining_duration > 0) {
|
||||||
if (race == rdrow)
|
if (race == rdrow)
|
||||||
HP = std::max(HP - 7, 0);
|
HP = std::max(HP - 7, 0);
|
||||||
else
|
else
|
||||||
HP = std::max(HP - 5, 0);
|
HP = std::max(HP - 5, 0);
|
||||||
|
|
||||||
--remaining_duration;
|
--remaining_duration;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int poison_health::get_priority() const {
|
int poison_health::get_priority() const {
|
||||||
return CALC_ADD_BASE;
|
return CALC_ADD_BASE;
|
||||||
}
|
}
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
|
|
||||||
class poison_health final: public potion {
|
class poison_health final: public potion {
|
||||||
public:
|
public:
|
||||||
poison_health();
|
poison_health(const position &pos);
|
||||||
void apply(enum race &race, int &HP, int &ATK, int &DEF,
|
void apply(const enum race &race, int &HP, int &ATK, int &DEF,
|
||||||
float &base_hit_rate) override;
|
fraction &base_hit_rate) override;
|
||||||
int get_priority() const override;
|
int get_priority() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -5,21 +5,21 @@
|
|||||||
const int WOUND_ATK = 5;
|
const int WOUND_ATK = 5;
|
||||||
const int WOUND_ATK_DROW = 7;
|
const int WOUND_ATK_DROW = 7;
|
||||||
|
|
||||||
wound_atk::wound_atk():
|
wound_atk::wound_atk(const position &pos):
|
||||||
potion{potion_type::wound_atk, -1} {}
|
potion{potion_type::wound_atk, -1, pos} {}
|
||||||
|
|
||||||
void wound_atk::apply(enum race &race, int &HP, int &ATK, int &DEF,
|
void wound_atk::apply(const enum race &race, int &HP, int &ATK, int &DEF,
|
||||||
float &base_hit_rate) {
|
fraction &base_hit_rate) {
|
||||||
if (remaining_duration > 0) {
|
if (remaining_duration > 0) {
|
||||||
if (race == rdrow)
|
if (race == rdrow)
|
||||||
ATK = std::max(ATK - WOUND_ATK_DROW, 0);
|
ATK = std::max(ATK - WOUND_ATK_DROW, 0);
|
||||||
else
|
else
|
||||||
ATK = std::max(ATK - WOUND_ATK, 0);
|
ATK = std::max(ATK - WOUND_ATK, 0);
|
||||||
|
|
||||||
--remaining_duration;
|
--remaining_duration;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int wound_atk::get_priority() const {
|
int wound_atk::get_priority() const {
|
||||||
return CALC_ADD_BASE;
|
return CALC_ADD_BASE;
|
||||||
}
|
}
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
|
|
||||||
class wound_atk final: public potion {
|
class wound_atk final: public potion {
|
||||||
public:
|
public:
|
||||||
wound_atk();
|
wound_atk(const position &pos);
|
||||||
void apply(enum race &race, int &HP, int &ATK, int &DEF,
|
void apply(const enum race &race, int &HP, int &ATK, int &DEF,
|
||||||
float &base_hit_rate) override;
|
fraction &base_hit_rate) override;
|
||||||
int get_priority() const override;
|
int get_priority() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -5,21 +5,21 @@
|
|||||||
const int WOUND_DEF = 5;
|
const int WOUND_DEF = 5;
|
||||||
const int WOUND_DEF_DROW = 7;
|
const int WOUND_DEF_DROW = 7;
|
||||||
|
|
||||||
wound_def::wound_def():
|
wound_def::wound_def(const position &pos):
|
||||||
potion{potion_type::wound_def, -1} {}
|
potion{potion_type::wound_def, -1, pos} {}
|
||||||
|
|
||||||
void wound_def::apply(enum race &race, int &HP, int &ATK, int &DEF,
|
void wound_def::apply(const enum race &race, int &HP, int &ATK, int &DEF,
|
||||||
float &base_hit_rate) {
|
fraction &base_hit_rate) {
|
||||||
if (remaining_duration > 0) {
|
if (remaining_duration > 0) {
|
||||||
if (race == rdrow)
|
if (race == rdrow)
|
||||||
DEF = std::max(DEF - WOUND_DEF_DROW, 0);
|
DEF = std::max(DEF - WOUND_DEF_DROW, 0);
|
||||||
else
|
else
|
||||||
DEF = std::max(DEF - WOUND_DEF, 0);
|
DEF = std::max(DEF - WOUND_DEF, 0);
|
||||||
|
|
||||||
--remaining_duration;
|
--remaining_duration;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int wound_def::get_priority() const {
|
int wound_def::get_priority() const {
|
||||||
return CALC_ADD_BASE;
|
return CALC_ADD_BASE;
|
||||||
}
|
}
|
||||||
|
@ -5,10 +5,10 @@
|
|||||||
|
|
||||||
class wound_def final: public potion {
|
class wound_def final: public potion {
|
||||||
public:
|
public:
|
||||||
wound_def();
|
wound_def(const position &pos);
|
||||||
void apply(enum race &race, int &HP, int &ATK, int &DEF,
|
void apply(const enum race &race, int &HP, int &ATK, int &DEF,
|
||||||
float &base_hit_rate) override;
|
fraction &base_hit_rate) override;
|
||||||
int get_priority() const override;
|
int get_priority() const override;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user