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