![]() |
Peoplemon
0.1.0
Peoplemon 3 game source documentation
|
Represents a Peoplemon in battle. Stores some extra state that only exists in battle. Wraps an underlying OwnedPeoplemon. More...
#include <BattlePeoplemon.hpp>
Public Member Functions | |
BattlePeoplemon (OwnedPeoplemon *peoplemon) | |
Construct a new Battle Peoplemon. More... | |
OwnedPeoplemon & | base () |
Returns the wrapped peoplemon. More... | |
const OwnedPeoplemon & | base () const |
Returns the wrapped peoplemon. More... | |
const Stats & | currentStats () const |
Returns the current stats of the peoplemon, including changes. More... | |
const BattleStats & | battleStages () const |
Returns the current battle-only stats of the peoplemon, including changes. More... | |
int | getSpeed () const |
Returns the speed of this peoplemon, adjusted for ailments. More... | |
void | applyDamage (int dmg) |
Applies damage to the peoplemon. Ensures that the hp does not go negative. More... | |
void | giveHealth (int hp) |
Restores HP and ensures it does not go over max HP. More... | |
bool | statChange (Stat stat, int diff) |
Apply a stage change to the given stat. More... | |
bool | hasAilment (const battle::BattlerSubstate &state) const |
Returns whether or not the peoplemon has an ailment of any kind. More... | |
bool | hasAilment (Ailment ail) const |
Returns true if the peoplemon has the specific ailment. More... | |
bool | giveAilment (Ailment ail) |
Gives the peoplemon an ailment. More... | |
bool | clearAilments (battle::BattlerSubstate *state) |
Clears all ailments the peoplemon has, including passive ailments if passed in. More... | |
SpecialAbility | currentAbility () const |
Returns the current ability of this peoplemon. More... | |
void | setCurrentAbility (SpecialAbility ability) |
Set an ability override, or None to fallback on the default. More... | |
void | copyStages (const BattlePeoplemon &other) |
Copies the stat stages from the other peoplemon. More... | |
void | resetStages () |
Resets all stat stages. More... | |
void | notifyInBattle () |
Lets the peoplemon know that they have seen battle. More... | |
void | resetSawBattle () |
Resets that this peoplemon has seen battle. More... | |
bool | hasSeenBattle () const |
Returns whether or not this peoplemon has seen battle (for exp gain) More... | |
std::int8_t & | turnsUntilAwake () |
The number of turns until the peoplemon wakes up. More... | |
Represents a Peoplemon in battle. Stores some extra state that only exists in battle. Wraps an underlying OwnedPeoplemon.
Definition at line 25 of file BattlePeoplemon.hpp.
core::pplmn::BattlePeoplemon::BattlePeoplemon | ( | OwnedPeoplemon * | peoplemon | ) |
Construct a new Battle Peoplemon.
peoplemon | The peoplemon to wrap |
Definition at line 11 of file BattlePeoplemon.cpp.
void core::pplmn::BattlePeoplemon::applyDamage | ( | int | dmg | ) |
Applies damage to the peoplemon. Ensures that the hp does not go negative.
dmg | The amount of hp to reduce |
Definition at line 27 of file BattlePeoplemon.cpp.
OwnedPeoplemon & core::pplmn::BattlePeoplemon::base | ( | ) |
Returns the wrapped peoplemon.
Definition at line 19 of file BattlePeoplemon.cpp.
const OwnedPeoplemon & core::pplmn::BattlePeoplemon::base | ( | ) | const |
Returns the wrapped peoplemon.
Definition at line 21 of file BattlePeoplemon.cpp.
const BattleStats & core::pplmn::BattlePeoplemon::battleStages | ( | ) | const |
Returns the current battle-only stats of the peoplemon, including changes.
Definition at line 25 of file BattlePeoplemon.cpp.
bool core::pplmn::BattlePeoplemon::clearAilments | ( | battle::BattlerSubstate * | state | ) |
Clears all ailments the peoplemon has, including passive ailments if passed in.
state | Optional battler state |
Definition at line 68 of file BattlePeoplemon.cpp.
void core::pplmn::BattlePeoplemon::copyStages | ( | const BattlePeoplemon & | other | ) |
Copies the stat stages from the other peoplemon.
other | The peoplemon to copy from |
Definition at line 92 of file BattlePeoplemon.cpp.
SpecialAbility core::pplmn::BattlePeoplemon::currentAbility | ( | ) | const |
Returns the current ability of this peoplemon.
Definition at line 80 of file BattlePeoplemon.cpp.
const Stats & core::pplmn::BattlePeoplemon::currentStats | ( | ) | const |
Returns the current stats of the peoplemon, including changes.
Definition at line 23 of file BattlePeoplemon.cpp.
int core::pplmn::BattlePeoplemon::getSpeed | ( | ) | const |
Returns the speed of this peoplemon, adjusted for ailments.
Definition at line 119 of file BattlePeoplemon.cpp.
bool core::pplmn::BattlePeoplemon::giveAilment | ( | Ailment | ail | ) |
Gives the peoplemon an ailment.
ail | The ailment to give |
Definition at line 61 of file BattlePeoplemon.cpp.
void core::pplmn::BattlePeoplemon::giveHealth | ( | int | hp | ) |
Restores HP and ensures it does not go over max HP.
hp | The amount of hp to restore |
Definition at line 29 of file BattlePeoplemon.cpp.
bool core::pplmn::BattlePeoplemon::hasAilment | ( | Ailment | ail | ) | const |
Returns true if the peoplemon has the specific ailment.
ail | The ailment to check for |
Definition at line 59 of file BattlePeoplemon.cpp.
bool core::pplmn::BattlePeoplemon::hasAilment | ( | const battle::BattlerSubstate & | state | ) | const |
Returns whether or not the peoplemon has an ailment of any kind.
state | The state of the battler the peoplemon belongs to |
Definition at line 55 of file BattlePeoplemon.cpp.
bool core::pplmn::BattlePeoplemon::hasSeenBattle | ( | ) | const |
Returns whether or not this peoplemon has seen battle (for exp gain)
Definition at line 115 of file BattlePeoplemon.cpp.
void core::pplmn::BattlePeoplemon::notifyInBattle | ( | ) |
Lets the peoplemon know that they have seen battle.
Definition at line 111 of file BattlePeoplemon.cpp.
void core::pplmn::BattlePeoplemon::resetSawBattle | ( | ) |
Resets that this peoplemon has seen battle.
Definition at line 113 of file BattlePeoplemon.cpp.
void core::pplmn::BattlePeoplemon::resetStages | ( | ) |
Resets all stat stages.
Definition at line 98 of file BattlePeoplemon.cpp.
void core::pplmn::BattlePeoplemon::setCurrentAbility | ( | SpecialAbility | ability | ) |
Set an ability override, or None to fallback on the default.
Definition at line 82 of file BattlePeoplemon.cpp.
bool core::pplmn::BattlePeoplemon::statChange | ( | Stat | stat, |
int | diff | ||
) |
Apply a stage change to the given stat.
stat | The stat to change |
diff | The number of stages to change by (negative to reduce) |
Definition at line 31 of file BattlePeoplemon.cpp.
std::int8_t & core::pplmn::BattlePeoplemon::turnsUntilAwake | ( | ) |
The number of turns until the peoplemon wakes up.
Definition at line 124 of file BattlePeoplemon.cpp.