Stats for Peoplemon. This struct is used for base stats, EVs, IVs, battle increases/decreases, and base stats.
More...
#include <Stats.hpp>
|
| Stats () |
| Initializes all members to 0. More...
|
|
| Stats (Stat stat, int points) |
| Construct Stats with all zeros except the given stat. More...
|
|
int | sum () const |
| Returns the sum of the 6 stats that are used for EV calculations. More...
|
|
void | randomize () |
| Generates random IV stats. More...
|
|
void | addEVs (const Stats &evs) |
| Adds the given EV points to this set of stats while obeying the constraints on EV values and sums. More...
|
|
int & | get (Stat stat) |
| Returns a reference to the given stat. More...
|
|
int | get (Stat stat) const |
| Returns the given stat. More...
|
|
|
static const std::array< Stat, 6 > | IterableStats |
| Helper array to iterate over stats in loop. More...
|
|
static constexpr int | MaxEVSum = 510 |
| The maximum amount that EVs or IVs can sum to. More...
|
|
static constexpr int | MaxEVStat = 255 |
| The maximum amount that a single EV can be. More...
|
|
static constexpr int | MaxIVStat = 31 |
| The maximum amount that a single IV can be. More...
|
|
Stats for Peoplemon. This struct is used for base stats, EVs, IVs, battle increases/decreases, and base stats.
Definition at line 19 of file Stats.hpp.
◆ Stats() [1/2]
core::pplmn::Stats::Stats |
( |
| ) |
|
Initializes all members to 0.
Definition at line 12 of file Stats.cpp.
◆ Stats() [2/2]
core::pplmn::Stats::Stats |
( |
Stat |
stat, |
|
|
int |
points |
|
) |
| |
Construct Stats with all zeros except the given stat.
- Parameters
-
stat | The single stat to populate |
points | The points to put in that stat |
Definition at line 20 of file Stats.cpp.
◆ addEVs()
void core::pplmn::Stats::addEVs |
( |
const Stats & |
evs | ) |
|
Adds the given EV points to this set of stats while obeying the constraints on EV values and sums.
- Parameters
-
Definition at line 31 of file Stats.cpp.
◆ computeStats()
Stats core::pplmn::Stats::computeStats |
( |
const Stats & |
base, |
|
|
const Stats & |
evs, |
|
|
const Stats & |
ivs, |
|
|
unsigned int |
level, |
|
|
const Stats & |
stages = {} |
|
) |
| |
|
static |
◆ get() [1/2]
int & core::pplmn::Stats::get |
( |
Stat |
stat | ) |
|
Returns a reference to the given stat.
Definition at line 39 of file Stats.cpp.
◆ get() [2/2]
int core::pplmn::Stats::get |
( |
Stat |
stat | ) |
const |
Returns the given stat.
Definition at line 44 of file Stats.cpp.
◆ randomize()
void core::pplmn::Stats::randomize |
( |
| ) |
|
Generates random IV stats.
Definition at line 27 of file Stats.cpp.
◆ stageMultiplier()
float core::pplmn::Stats::stageMultiplier |
( |
int |
stage | ) |
|
|
static |
Returns the multiplier for a given stat increase/decrease.
- Parameters
-
stage | The current stat stage in range [-6, 6] |
- Returns
- float The multiplier to apply
Definition at line 66 of file Stats.cpp.
◆ statToString()
const char * core::pplmn::Stats::statToString |
( |
Stat |
stat | ) |
|
|
static |
Converts the given stat to its string representation.
- Parameters
-
- Returns
- const char* The string representation of the stat
Definition at line 74 of file Stats.cpp.
◆ sum()
int core::pplmn::Stats::sum |
( |
| ) |
const |
Returns the sum of the 6 stats that are used for EV calculations.
- Returns
- int The sum of each stat
Definition at line 25 of file Stats.cpp.
◆ atk
int core::pplmn::Stats::atk |
◆ def
int core::pplmn::Stats::def |
◆ hp
int core::pplmn::Stats::hp |
◆ IterableStats
const std::array< Stat, 6 > core::pplmn::Stats::IterableStats |
|
static |
Initial value:
Helper array to iterate over stats in loop.
Definition at line 104 of file Stats.hpp.
◆ MaxEVStat
constexpr int core::pplmn::Stats::MaxEVStat = 255 |
|
staticconstexpr |
The maximum amount that a single EV can be.
Definition at line 110 of file Stats.hpp.
◆ MaxEVSum
constexpr int core::pplmn::Stats::MaxEVSum = 510 |
|
staticconstexpr |
The maximum amount that EVs or IVs can sum to.
Definition at line 107 of file Stats.hpp.
◆ MaxIVStat
constexpr int core::pplmn::Stats::MaxIVStat = 31 |
|
staticconstexpr |
The maximum amount that a single IV can be.
Definition at line 113 of file Stats.hpp.
◆ spatk
int core::pplmn::Stats::spatk |
◆ spd
int core::pplmn::Stats::spd |
◆ spdef
int core::pplmn::Stats::spdef |
The documentation for this struct was generated from the following files: