![]() |
Peoplemon
0.1.0
Peoplemon 3 game source documentation
|
Represents an instance of a peoplemon. Can be a wild peoplemon, trainer, or player peoplemon. Only contains persistent data specific to the individual peoplemon. More...
#include <OwnedPeoplemon.hpp>
Public Member Functions | |
OwnedPeoplemon () | |
Makes an empty peoplemon with id Unknown. More... | |
OwnedPeoplemon (Id id, unsigned int level) | |
Makes a peoplemon of the given type and level. More... | |
bool | loadLegacyFile (const std::string &file) |
Loads the peoplemon from a legacy file. More... | |
Id | id () const |
Returns the id of this peoplemon. More... | |
void | evolve () |
Changes this Peoplemon into it's evolved form if it has one. More... | |
const std::string & | name () const |
Returns the name of this peoplemon, custom or defualt. More... | |
void | setCustomName (const std::string &name) |
Sets a custom name for this peoplemon. More... | |
Type | type () const |
Returns the type of the peoplemon. More... | |
unsigned int | currentLevel () const |
Returns the current level of this peoplemon. More... | |
unsigned int | evolveLevel () const |
Returns the level that this people can evolve at. More... | |
Id | evolvesInto () const |
Returns the people that this evolves into. Returns Unknown if no evolution. More... | |
bool & | pendingEvolution () |
Flag set by battle controller when this people is able to evolve after battle. More... | |
bool | pendingEvolution () const |
Flag set by battle controller when this people is able to evolve after battle. More... | |
unsigned int | currentXP () const |
Returns the current XP of this peoplemon. More... | |
unsigned int | nextLevelXP () const |
Returns the xp required to level up. More... | |
unsigned int | awardXP (unsigned int xp) |
Award XP to this peoplemon. A return of 0 indicates that all XP has been awarded. Non zero indicates that the peoplemon should level up. More... | |
MoveId | levelUp () |
Levels up the peoplemon. More... | |
Stats | currentStats () const |
Returns the computed stats for the peoplemon. Does not take into account changes during battle. More... | |
const Stats & | currentEVs () const |
Returns the current EVs of this peoplemon. More... | |
const Stats & | currentIVs () const |
Returns the current IVs of this peoplemon. More... | |
std::uint16_t & | currentHp () |
Access the current HP. More... | |
std::uint16_t | currentHp () const |
Returns the current HP. 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... | |
void | awardEVs (const Stats &evs) |
Award EVs to this peoplemon. More... | |
Ailment & | currentAilment () |
Access the current ailment of this peoplemon. More... | |
Ailment | currentAilment () const |
Access the current ailment of this peoplemon. More... | |
item::Id & | holdItem () |
Access the current hold item of this peoplemon. More... | |
item::Id | holdItem () const |
Access the current hold item of this peoplemon. More... | |
SpecialAbility | ability () const |
Returns the special ability of this peoplemon. More... | |
const OwnedMove * | knownMoves () const |
Returns the moves known by this Peoplemon. More... | |
OwnedMove * | knownMoves () |
Returns the moves known by this Peoplemon. More... | |
bool | knowsMove (MoveId move) const |
Returns whether or not this peoplemon knows the given move. More... | |
void | learnMove (MoveId move, unsigned int i) |
Teaches the peoplemon the given move, potentially replacing an existing one. More... | |
bool | gainMove (MoveId move) |
Attempts to learn the given move if there is an open slot. More... | |
void | heal () |
Restores HP and removes ailments. More... | |
bool | hasExpShare () const |
Returns whether or not this peoplemon has an EXP share. More... | |
unsigned int | xpYield (bool isTrainer) const |
Returns the XP awarded by defeating this peoplemon. More... | |
OwnedMove * | findMove (MoveId id) |
Returns the OwnedMove for the given move. More... | |
bool | shakePasses (item::Id ball, int turnNumber, unsigned int opLevel) |
Performs the check that a shake would occur with the given peopleball. More... | |
bool | canClone () const |
Returns whether or not this peoplemon can be cloned. More... | |
Friends | |
struct | WildPeoplemon |
class | BattlePeoplemon |
struct | bl::serial::SerializableObject< OwnedPeoplemon > |
class | editor::component::OwnedPeoplemonWindow |
Represents an instance of a peoplemon. Can be a wild peoplemon, trainer, or player peoplemon. Only contains persistent data specific to the individual peoplemon.
Definition at line 44 of file OwnedPeoplemon.hpp.
core::pplmn::OwnedPeoplemon::OwnedPeoplemon | ( | ) |
Makes an empty peoplemon with id Unknown.
Definition at line 32 of file OwnedPeoplemon.cpp.
core::pplmn::OwnedPeoplemon::OwnedPeoplemon | ( | Id | id, |
unsigned int | level | ||
) |
Makes a peoplemon of the given type and level.
id | The species of peoplemon to create |
level | The level to create at |
Definition at line 41 of file OwnedPeoplemon.cpp.
SpecialAbility core::pplmn::OwnedPeoplemon::ability | ( | ) | const |
Returns the special ability of this peoplemon.
Definition at line 202 of file OwnedPeoplemon.cpp.
void core::pplmn::OwnedPeoplemon::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 182 of file OwnedPeoplemon.cpp.
void core::pplmn::OwnedPeoplemon::awardEVs | ( | const Stats & | evs | ) |
Award EVs to this peoplemon.
evs | The EVs to add |
Definition at line 192 of file OwnedPeoplemon.cpp.
unsigned int core::pplmn::OwnedPeoplemon::awardXP | ( | unsigned int | xp | ) |
Award XP to this peoplemon. A return of 0 indicates that all XP has been awarded. Non zero indicates that the peoplemon should level up.
xp | The XP to award |
Definition at line 154 of file OwnedPeoplemon.cpp.
bool core::pplmn::OwnedPeoplemon::canClone | ( | ) | const |
Returns whether or not this peoplemon can be cloned.
Definition at line 282 of file OwnedPeoplemon.cpp.
Ailment & core::pplmn::OwnedPeoplemon::currentAilment | ( | ) |
Access the current ailment of this peoplemon.
Definition at line 194 of file OwnedPeoplemon.cpp.
Ailment core::pplmn::OwnedPeoplemon::currentAilment | ( | ) | const |
Access the current ailment of this peoplemon.
Definition at line 198 of file OwnedPeoplemon.cpp.
const Stats & core::pplmn::OwnedPeoplemon::currentEVs | ( | ) | const |
Returns the current EVs of this peoplemon.
Definition at line 176 of file OwnedPeoplemon.cpp.
std::uint16_t & core::pplmn::OwnedPeoplemon::currentHp | ( | ) |
Access the current HP.
Definition at line 180 of file OwnedPeoplemon.cpp.
std::uint16_t core::pplmn::OwnedPeoplemon::currentHp | ( | ) | const |
Returns the current HP.
Definition at line 190 of file OwnedPeoplemon.cpp.
const Stats & core::pplmn::OwnedPeoplemon::currentIVs | ( | ) | const |
Returns the current IVs of this peoplemon.
Definition at line 178 of file OwnedPeoplemon.cpp.
unsigned int core::pplmn::OwnedPeoplemon::currentLevel | ( | ) | const |
Returns the current level of this peoplemon.
Definition at line 140 of file OwnedPeoplemon.cpp.
Stats core::pplmn::OwnedPeoplemon::currentStats | ( | ) | const |
Returns the computed stats for the peoplemon. Does not take into account changes during battle.
Definition at line 172 of file OwnedPeoplemon.cpp.
unsigned int core::pplmn::OwnedPeoplemon::currentXP | ( | ) | const |
Returns the current XP of this peoplemon.
Definition at line 150 of file OwnedPeoplemon.cpp.
void core::pplmn::OwnedPeoplemon::evolve | ( | ) |
Changes this Peoplemon into it's evolved form if it has one.
Definition at line 126 of file OwnedPeoplemon.cpp.
unsigned int core::pplmn::OwnedPeoplemon::evolveLevel | ( | ) | const |
Returns the level that this people can evolve at.
Definition at line 142 of file OwnedPeoplemon.cpp.
Id core::pplmn::OwnedPeoplemon::evolvesInto | ( | ) | const |
Returns the people that this evolves into. Returns Unknown if no evolution.
Definition at line 144 of file OwnedPeoplemon.cpp.
Returns the OwnedMove for the given move.
id | The move id to find |
Definition at line 253 of file OwnedPeoplemon.cpp.
bool core::pplmn::OwnedPeoplemon::gainMove | ( | MoveId | move | ) |
Attempts to learn the given move if there is an open slot.
move | The move to learn |
Definition at line 217 of file OwnedPeoplemon.cpp.
void core::pplmn::OwnedPeoplemon::giveHealth | ( | int | hp | ) |
Restores HP and ensures it does not go over max HP.
hp | The amount of hp to restore |
Definition at line 188 of file OwnedPeoplemon.cpp.
bool core::pplmn::OwnedPeoplemon::hasExpShare | ( | ) | const |
Returns whether or not this peoplemon has an EXP share.
Definition at line 232 of file OwnedPeoplemon.cpp.
void core::pplmn::OwnedPeoplemon::heal | ( | ) |
Restores HP and removes ailments.
Definition at line 227 of file OwnedPeoplemon.cpp.
item::Id & core::pplmn::OwnedPeoplemon::holdItem | ( | ) |
Access the current hold item of this peoplemon.
Definition at line 196 of file OwnedPeoplemon.cpp.
item::Id core::pplmn::OwnedPeoplemon::holdItem | ( | ) | const |
Access the current hold item of this peoplemon.
Definition at line 200 of file OwnedPeoplemon.cpp.
Id core::pplmn::OwnedPeoplemon::id | ( | ) | const |
Returns the id of this peoplemon.
Definition at line 124 of file OwnedPeoplemon.cpp.
OwnedMove * core::pplmn::OwnedPeoplemon::knownMoves | ( | ) |
Returns the moves known by this Peoplemon.
Definition at line 213 of file OwnedPeoplemon.cpp.
const OwnedMove * core::pplmn::OwnedPeoplemon::knownMoves | ( | ) | const |
Returns the moves known by this Peoplemon.
Definition at line 211 of file OwnedPeoplemon.cpp.
bool core::pplmn::OwnedPeoplemon::knowsMove | ( | MoveId | move | ) | const |
Returns whether or not this peoplemon knows the given move.
move | The move to check for |
Definition at line 204 of file OwnedPeoplemon.cpp.
void core::pplmn::OwnedPeoplemon::learnMove | ( | MoveId | move, |
unsigned int | i | ||
) |
Teaches the peoplemon the given move, potentially replacing an existing one.
move | The move to learn |
i | The index to place it, in range [0, 4) |
Definition at line 215 of file OwnedPeoplemon.cpp.
MoveId core::pplmn::OwnedPeoplemon::levelUp | ( | ) |
Levels up the peoplemon.
Definition at line 244 of file OwnedPeoplemon.cpp.
bool core::pplmn::OwnedPeoplemon::loadLegacyFile | ( | const std::string & | file | ) |
Loads the peoplemon from a legacy file.
file | Path to the file, relative to the peoplemon directory |
Definition at line 49 of file OwnedPeoplemon.cpp.
const std::string & core::pplmn::OwnedPeoplemon::name | ( | ) | const |
Returns the name of this peoplemon, custom or defualt.
Definition at line 132 of file OwnedPeoplemon.cpp.
unsigned int core::pplmn::OwnedPeoplemon::nextLevelXP | ( | ) | const |
Returns the xp required to level up.
Definition at line 152 of file OwnedPeoplemon.cpp.
bool & core::pplmn::OwnedPeoplemon::pendingEvolution | ( | ) |
Flag set by battle controller when this people is able to evolve after battle.
Definition at line 148 of file OwnedPeoplemon.cpp.
bool core::pplmn::OwnedPeoplemon::pendingEvolution | ( | ) | const |
Flag set by battle controller when this people is able to evolve after battle.
Definition at line 146 of file OwnedPeoplemon.cpp.
void core::pplmn::OwnedPeoplemon::setCustomName | ( | const std::string & | name | ) |
Sets a custom name for this peoplemon.
name | The name. Pass empty to reset to default |
Definition at line 138 of file OwnedPeoplemon.cpp.
bool core::pplmn::OwnedPeoplemon::shakePasses | ( | item::Id | ball, |
int | turnNumber, | ||
unsigned int | opLevel | ||
) |
Performs the check that a shake would occur with the given peopleball.
ball | The peopleball being used |
turnNumber | The current turn of the battle |
opLevel | The level of the peoplemon throwing the ball |
Definition at line 260 of file OwnedPeoplemon.cpp.
Type core::pplmn::OwnedPeoplemon::type | ( | ) | const |
Returns the type of the peoplemon.
Definition at line 136 of file OwnedPeoplemon.cpp.
unsigned int core::pplmn::OwnedPeoplemon::xpYield | ( | bool | isTrainer | ) | const |
Returns the XP awarded by defeating this peoplemon.
isTrainer | True if commanded by a trainer, false otherwise |
Definition at line 237 of file OwnedPeoplemon.cpp.
|
friend |
Definition at line 335 of file OwnedPeoplemon.hpp.
|
friend |
Definition at line 335 of file OwnedPeoplemon.hpp.
|
friend |
Definition at line 337 of file OwnedPeoplemon.hpp.
|
friend |
Definition at line 334 of file OwnedPeoplemon.hpp.