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