|
Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
|
A single Pokemon record – the most property-rich object in the tree. More...
#include <pokemonbox.h>
Public Member Functions | |
| PokemonBox (SaveFile *saveFile=nullptr, var16 startOffset=0, var16 nicknameStartOffset=0, var16 otNameStartOffset=0, var8 index=0, var8 recordSize=0x21) | |
| < Species id (raw save value). | |
| virtual | ~PokemonBox () |
| virtual SaveFileIterator * | load (SaveFile *saveFile=nullptr, var16 startOffset=0, var16 nicknameStartOffset=0, var16 otNameStartOffset=0, var8 index=0, var8 recordSize=0x21) |
| Expand one Pokemon from the save. | |
| virtual SaveFileIterator * | save (SaveFile *saveFile=nullptr, var16 startOffset=0, svar32 speciesStartOffset=0, var16 nicknameStartOffset=0, var16 otNameStartOffset=0, var8 index=0, var8 recordSize=0x21) |
| Flatten one Pokemon back to the save. | |
| PokemonDBEntry * | isValid () |
| The species' DB entry, or null if not a real Pokedex species. | |
| bool | isValidBool () |
| Convenience bool form of isValid(). | |
| unsigned int | levelToExp (int level=-1) |
EXP needed for level (current level if -1). | |
| unsigned int | expLevelRangeStart () |
| EXP at the start of the current level. | |
| unsigned int | expLevelRangeEnd () |
| EXP at the next level. | |
| float | expLevelRangePercent () |
| Fractional progress through the level. | |
| int | hpDV () |
| int | hpStat () |
| int | nonHpStat (PokemonStats::PokemonStats_ stat) |
| bool | isAfflicted () |
| Has any status condition. | |
| bool | isHealed () |
| Fully healed (HP + status). (heal() performs a Pokecenter heal.). | |
| bool | isMaxHp () |
| HP equals computed max. | |
| bool | hasNickname () |
| Carries a real nickname. | |
| bool | hasTradeStatus (PlayerBasics *basics=nullptr) |
Counts as traded relative to basics. | |
| bool | hasEvolution () |
| Species can evolve. | |
| bool | hasDeEvolution () |
| Species has a pre-evolution. | |
| bool | isMaxLevel () |
| Level 100. | |
| bool | isMaxPP () |
| All moves at max PP. | |
| bool | isMaxPpUps () |
| All moves at max PP-Ups. | |
| bool | isMaxEVs () |
| All stat-exp maxed. | |
| bool | isMinEvs () |
| All stat-exp zero. | |
| bool | isMaxDVs () |
| All DVs maxed. | |
| bool | isMinDVs () |
| All DVs zero. | |
| bool | isPokemonReset () |
| Matches the reset baseline. | |
| bool | isMaxedOut () |
| Level/EV/DV/PP all maxed. | |
| bool | isCorrected () |
| Values internally consistent (see correct* slots). | |
| int | dexNum () |
| Pokedex number. | |
| QString | speciesName () |
| Species display name. | |
| bool | isShiny () |
| Shiny per the VC-era DV formula (see disclaimer above). | |
| int | getNature () |
| virtual void | copyFrom (PokemonBox *pkmn) |
| Deep-copy another mon's values into this one. | |
| PokemonDBEntry * | toData () |
| The species' DB entry for this mon. | |
| int | atkStat () |
| Computed Attack stat. | |
| int | defStat () |
| Computed Defense stat. | |
| int | spdStat () |
| Computed Speed stat. | |
| int | spStat () |
| Computed Special stat. | |
| int | movesCount () |
| Number of non-empty move slots. | |
| int | movesMax () |
| Move-slot capacity (maxMoves). | |
| PokemonMove * | movesAt (int ind) |
Move slot ind (GC-protected return). | |
| int | dvCount () |
| Number of stored DVs (maxDV). | |
| int | dvAt (int ind) |
DV value at ind. | |
| void | dvSet (int ind, int val) |
Set DV ind. | |
| protected::void | speciesChanged () |
| void | hpChanged () |
| void | levelChanged () |
| void | statusChanged () |
| void | type1Changed () |
| void | type2Changed () |
| void | catchRateChanged () |
| void | otIDChanged () |
| void | expChanged () |
| void | hpExpChanged () |
| void | atkExpChanged () |
| void | defExpChanged () |
| void | spdExpChanged () |
| void | spExpChanged () |
| void | dvChanged () |
| void | otNameChanged () |
| void | nicknameChanged () |
| void | movesChanged () |
| void | type2ExplicitChanged () |
| void | expRangeChanged () |
| void | statChanged () |
| void | healedChanged () |
| void | hasNicknameChanged () |
| void | evChanged () |
| void | pokemonResetChanged () |
| virtual void | reset () |
| Blank this Pokemon. | |
| virtual void | randomize (PlayerBasics *basics=nullptr) |
| Randomize this Pokemon (constrained). | |
| void | clearMoves () |
| Empty all move slots. | |
| void | resetExp () |
| Reset EXP to the current level's baseline. | |
| virtual void | update (bool resetHp=false, bool resetExp=false, bool resetType=false, bool resetCatchRate=false, bool correctMoves=false) |
| Recompute derived stats. | |
| void | correctTypes () |
| Reset type1/type2 to this species' DB-default type(s) (e.g. | |
| void | heal () |
| Pokecenter heal: full HP, clear status. | |
| void | changeName (bool removeNickname=false) |
| Randomize or (if true) remove the nickname. | |
| void | changeOtData (bool removeOtData=false, PlayerBasics *basics=nullptr) |
| Randomize or remove OT data. | |
| void | changeTrade (bool removeTradeStatus=false, PlayerBasics *basics=nullptr) |
| Toggle traded status. | |
| void | evolve () |
| Evolve to the next species. | |
| void | deEvolve () |
| Revert to the prior species. | |
| void | maxLevel () |
| Set to level 100. | |
| void | maxPpUps () |
| Max every move's PP-Ups. | |
| void | maxEVs () |
| Max all stat-exp. | |
| void | resetEVs () |
| Zero all stat-exp. | |
| void | reRollEVs () |
| Randomize stat-exp. | |
| void | maxDVs () |
| Max all DVs. | |
| void | reRollDVs () |
| Randomize DVs. | |
| void | resetDVs () |
| Zero all DVs. | |
| void | maxOut () |
| Max level/EV/DV/PP at once. | |
| void | randomizeMoves () |
| Randomize the move set. | |
| void | resetPokemon () |
| Reset to the baseline state. | |
| void | rollShiny () |
| Randomize DVs until shiny. | |
| void | rollNonShiny () |
| Randomize DVs until not shiny. | |
| void | makeShiny () |
| Force DVs to a shiny combination. | |
| void | unmakeShiny () |
| Force DVs to a non-shiny combination. | |
| void | setNature (int nature) |
| void | cleanupMoves () |
| Remove invalid/duplicate moves. | |
| void | correctMoves () |
| Repair move/PP inconsistencies. | |
| virtual bool | isBoxMon () |
| True for a pure box mon; PokemonParty overrides to false. | |
| void | changeMove (int ind, int moveID=0, int pp=0, int ppUp=0) |
Set move slot ind. | |
| void | deleteMoveAt (int ind) |
Delete the move in slot ind, then compact so there is no gap in the move list (the slots after it slide up; empties stay parked at the bottom). | |
| void | clearMovesButFirst () |
| Remove every move except the first one (slots 1..3 cleared). | |
| void | correctMoveAt (int ind) |
Make the move in slot ind valid (PokemonMove::correctMove) THEN compact: correctMove can clear an invalid/duplicate move, which would otherwise leave a gap, so the list is reflowed so there is no hole. | |
| void | reorderMove (int from, int to) |
Reorder the filled move slots: take the move at from and re-insert it before slot to (drop-slot convention: 0..movesCount; == movesCount appends after the last move). | |
| void | manualSpeciesChanged () |
| UI hook: species edited directly. | |
| void | manualLevelChanged () |
| UI hook: level edited directly. | |
Static Public Member Functions | |
| static PokemonBox * | newPokemon (PokemonRandom::PokemonRandom_ list=PokemonRandom::Random_Starters, PlayerBasics *basics=nullptr) |
| static PokemonBox * | newPokemon (PokemonDBEntry *pkmnData, PlayerBasics *basics=nullptr) |
Public Attributes | |
| int | species |
| int | hp |
| int | level |
| int | status |
| int | type1 |
| int | type2 |
| int | catchRate |
| int | otID |
| unsigned int | exp |
| int | hpExp |
| int | atkExp |
| int | defExp |
| int | spdExp |
| int | spExp |
| var8 | dv [maxDV] |
| Stored DVs (Atk/Def/Spd/Spc); HP DV is derived. | |
| QString | otName |
| QString | nickname |
| PokemonMove * | moves [4] |
| The four move slots. | |
| bool | type2Explicit |
A single Pokemon record – the most property-rich object in the tree.
Models one stored Pokemon (box format by default; PokemonParty extends it with party-only stats). The stored fields are the raw save values (species, level, EXP, the four EVs/"exp" stats, DVs, OT name/ID, nickname, moves). On top of those sit a large set of computed Q_PROPERTYs the UI binds to: derived stats, validity/heal/min-max checks, evolution availability, shininess and nature, dex number and species name. Editing a raw field and calling update() recomputes the derived values.
Construction/serialisation take explicit byte offsets because a Pokemon's data is split across regions in the save (species list, the record itself, the nickname table, and the OT-name table). See load()/save().
Definition at line 212 of file pokemonbox.h.
| PokemonBox::PokemonBox | ( | SaveFile * | saveFile = nullptr, |
| var16 | startOffset = 0, | ||
| var16 | nicknameStartOffset = 0, | ||
| var16 | otNameStartOffset = 0, | ||
| var8 | index = 0, | ||
| var8 | recordSize = 0x21 ) |
< Species id (raw save value).
Current HP. Level. Status-condition bits. Primary type id. Secondary type id. Catch-rate/held byte. Original-trainer ID. Experience points. HP stat-exp (EV equivalent). Attack stat-exp. Defense stat-exp. Speed stat-exp. Special stat-exp. Original-trainer name. Nickname (may be empty). How type2 is stored (see note at the field). < Is the species a real Pokedex entry? EXP at the current level's start. EXP at the next level. Progress through the current level (0..1). < Derived HP DV (from the four stored DVs). Computed max HP. < Has a status condition? Fully healed (HP + status)? HP at its computed max? Has a non-default nickname? < Can evolve further? Has a prior evolution (de-evolve)? Level 100? All moves at max PP? All moves at max PP-Ups? All stat-exp maxed? All stat-exp zero? All DVs maxed? All DVs zero? Matches a freshly-reset state? Fully maxed (level/EV/DV/PP)? Values are internally consistent? < Shiny by the VC-era DV formula (see disclaimer below). Derived nature (see PokemonNatures). < Computed Attack stat. Computed Defense stat. Computed Speed stat. Computed Special stat. < Pokedex number for the species. Species display name.
| startOffset | record start; |
| nicknameStartOffset | / |
| otNameStartOffset | locate the split name tables; |
| index | slot within the box; |
| recordSize | per-record byte size (box default 0x21). |
Definition at line 290 of file pokemonbox.cpp.
References atkExpChanged(), defExpChanged(), dvChanged(), evChanged(), expRangeChanged(), hasNicknameChanged(), healedChanged(), hpChanged(), hpExpChanged(), levelChanged(), load(), moves, movesChanged(), nicknameChanged(), pokemonResetChanged(), PokemonMove::ppCapChanged(), spdExpChanged(), speciesChanged(), spExpChanged(), and statChanged().
Referenced by PokemonParty::convertToBox(), PokemonParty::convertToParty(), copyFrom(), PokemonParty::copyFrom(), newPokemon(), newPokemon(), and PokemonParty::toBoxData().
|
virtual |
Definition at line 353 of file pokemonbox.cpp.
References moves.
| void PokemonBox::atkExpChanged | ( | ) |
Referenced by copyFrom(), load(), maxEVs(), PokemonBox(), randomize(), reRollEVs(), reset(), and resetEVs().
| int PokemonBox::atkStat | ( | ) |
Computed Attack stat.
Definition at line 2012 of file pokemonbox.cpp.
References PokemonStats::Attack, and nonHpStat().
Referenced by PokemonParty::regenStats().
| void PokemonBox::catchRateChanged | ( | ) |
Referenced by copyFrom(), load(), reset(), and update().
| void PokemonBox::changeMove | ( | int | ind, |
| int | moveID = 0, | ||
| int | pp = 0, | ||
| int | ppUp = 0 ) |
Set move slot ind.
Definition at line 1745 of file pokemonbox.cpp.
References moves.
Referenced by pokemonResetChanged().
| void PokemonBox::changeName | ( | bool | removeNickname = false | ) |
Randomize or (if true) remove the nickname.
Definition at line 1123 of file pokemonbox.cpp.
References Names::inst(), PokemonDBEntry::name, nickname, nicknameChanged(), Names::pokemon(), AbstractRandomString::randomExample(), and toData().
Referenced by changeTrade(), deEvolve(), evolve(), pokemonResetChanged(), and randomize().
| void PokemonBox::changeOtData | ( | bool | removeOtData = false, |
| PlayerBasics * | basics = nullptr ) |
Randomize or remove OT data.
Definition at line 1133 of file pokemonbox.cpp.
References Names::inst(), Random::inst(), otID, otIDChanged(), otName, otNameChanged(), Names::player(), PlayerBasics::playerID, PlayerBasics::playerName, AbstractRandomString::randomExample(), and Random::rangeInclusive().
Referenced by changeTrade(), and pokemonResetChanged().
| void PokemonBox::changeTrade | ( | bool | removeTradeStatus = false, |
| PlayerBasics * | basics = nullptr ) |
Toggle traded status.
Definition at line 1162 of file pokemonbox.cpp.
References changeName(), and changeOtData().
Referenced by pokemonResetChanged(), and randomize().
| void PokemonBox::cleanupMoves | ( | ) |
Remove invalid/duplicate moves.
Definition at line 1651 of file pokemonbox.cpp.
References moves.
Referenced by clearMovesButFirst(), correctMoveAt(), deleteMoveAt(), pokemonResetChanged(), and update().
| void PokemonBox::clearMoves | ( | ) |
Empty all move slots.
Definition at line 799 of file pokemonbox.cpp.
References moves, and movesChanged().
Referenced by copyFrom(), pokemonResetChanged(), randomizeMoves(), reset(), and resetPokemon().
| void PokemonBox::clearMovesButFirst | ( | ) |
Remove every move except the first one (slots 1..3 cleared).
The list is compacted first, so "first" is whatever move currently leads the list.
Definition at line 1765 of file pokemonbox.cpp.
References cleanupMoves(), maxMoves, moves, and movesChanged().
Referenced by pokemonResetChanged().
|
virtual |
Deep-copy another mon's values into this one.
Reimplemented in PokemonParty.
Definition at line 1880 of file pokemonbox.cpp.
References atkExp, atkExpChanged(), catchRate, catchRateChanged(), clearMoves(), defExp, defExpChanged(), dv, dvChanged(), exp, expChanged(), hp, hpChanged(), hpExp, hpExpChanged(), level, levelChanged(), PokemonMove::moveID, moves, movesChanged(), nickname, nicknameChanged(), otID, otIDChanged(), otName, otNameChanged(), PokemonBox(), PokemonMove::pp, PokemonMove::ppUp, spdExp, spdExpChanged(), species, speciesChanged(), spExp, spExpChanged(), status, statusChanged(), type1, type1Changed(), type2, type2Changed(), type2Explicit, and type2ExplicitChanged().
Referenced by PokemonParty::copyFrom(), and randomize().
| void PokemonBox::correctMoveAt | ( | int | ind | ) |
Make the move in slot ind valid (PokemonMove::correctMove) THEN compact: correctMove can clear an invalid/duplicate move, which would otherwise leave a gap, so the list is reflowed so there is no hole.
Definition at line 1785 of file pokemonbox.cpp.
References cleanupMoves(), maxMoves, moves, and movesChanged().
Referenced by pokemonResetChanged().
| void PokemonBox::correctMoves | ( | ) |
Repair move/PP inconsistencies.
Definition at line 1692 of file pokemonbox.cpp.
References moves.
Referenced by pokemonResetChanged(), PokemonParty::specialChanged(), update(), and PokemonParty::update().
| void PokemonBox::correctTypes | ( | ) |
Reset type1/type2 to this species' DB-default type(s) (e.g.
Fire/Flying for Charizard). Standalone so QML can call it cleanly – update() with mixed bool args is unreliable from QML (the arg-passing glitch), so don't route through it.
Definition at line 1050 of file pokemonbox.cpp.
References isValid(), type1, type1Changed(), type2, type2Changed(), type2Explicit, and type2ExplicitChanged().
Referenced by pokemonResetChanged().
| void PokemonBox::deEvolve | ( | ) |
Revert to the prior species.
Definition at line 1222 of file pokemonbox.cpp.
References changeName(), hasDeEvolution(), hasNickname(), isValid(), species, speciesChanged(), and update().
Referenced by pokemonResetChanged().
| void PokemonBox::defExpChanged | ( | ) |
Referenced by copyFrom(), load(), maxEVs(), PokemonBox(), randomize(), reRollEVs(), reset(), and resetEVs().
| int PokemonBox::defStat | ( | ) |
Computed Defense stat.
Definition at line 2017 of file pokemonbox.cpp.
References PokemonStats::Defense, and nonHpStat().
Referenced by PokemonParty::regenStats().
| void PokemonBox::deleteMoveAt | ( | int | ind | ) |
Delete the move in slot ind, then compact so there is no gap in the move list (the slots after it slide up; empties stay parked at the bottom).
Definition at line 1750 of file pokemonbox.cpp.
References cleanupMoves(), maxMoves, moves, and movesChanged().
Referenced by pokemonResetChanged().
| int PokemonBox::dexNum | ( | ) |
| int PokemonBox::dvAt | ( | int | ind | ) |
| void PokemonBox::dvChanged | ( | ) |
Referenced by copyFrom(), dvSet(), load(), makeShiny(), maxDVs(), PokemonBox(), reRollDVs(), reset(), resetDVs(), rollNonShiny(), rollShiny(), and unmakeShiny().
| int PokemonBox::dvCount | ( | ) |
| void PokemonBox::dvSet | ( | int | ind, |
| int | val ) |
| void PokemonBox::evChanged | ( | ) |
Referenced by PokemonBox().
| void PokemonBox::evolve | ( | ) |
Evolve to the next species.
Definition at line 1194 of file pokemonbox.cpp.
References changeName(), hasEvolution(), hasNickname(), Random::inst(), isValid(), Random::rangeExclusive(), species, speciesChanged(), and update().
Referenced by pokemonResetChanged().
| void PokemonBox::expChanged | ( | ) |
Referenced by copyFrom(), load(), reset(), resetExp(), setNature(), and update().
| var32 PokemonBox::expLevelRangeEnd | ( | ) |
EXP at the next level.
Definition at line 879 of file pokemonbox.cpp.
References exp, isValid(), level, and levelToExp().
Referenced by expLevelRangePercent(), isMaxedOut(), and setNature().
| float PokemonBox::expLevelRangePercent | ( | ) |
Fractional progress through the level.
Definition at line 887 of file pokemonbox.cpp.
References exp, expLevelRangeEnd(), expLevelRangeStart(), isValid(), and level.
| var32 PokemonBox::expLevelRangeStart | ( | ) |
EXP at the start of the current level.
Definition at line 871 of file pokemonbox.cpp.
References exp, isValid(), level, and levelToExp().
Referenced by expLevelRangePercent(), resetExp(), and setNature().
| void PokemonBox::expRangeChanged | ( | ) |
Referenced by PokemonBox().
| int PokemonBox::getNature | ( | ) |
Definition at line 1603 of file pokemonbox.cpp.
References exp.
| bool PokemonBox::hasDeEvolution | ( | ) |
Species has a pre-evolution.
Definition at line 1181 of file pokemonbox.cpp.
References isValid().
Referenced by deEvolve().
| bool PokemonBox::hasEvolution | ( | ) |
Species can evolve.
Definition at line 1168 of file pokemonbox.cpp.
References isValid().
Referenced by evolve().
| bool PokemonBox::hasNickname | ( | ) |
Carries a real nickname.
Definition at line 1108 of file pokemonbox.cpp.
References isValid(), and nickname.
Referenced by deEvolve(), and evolve().
| void PokemonBox::hasNicknameChanged | ( | ) |
Referenced by PokemonBox().
| bool PokemonBox::hasTradeStatus | ( | PlayerBasics * | basics = nullptr | ) |
Counts as traded relative to basics.
Definition at line 1118 of file pokemonbox.cpp.
References otID, otName, PlayerBasics::playerID, and PlayerBasics::playerName.
| void PokemonBox::heal | ( | ) |
Pokecenter heal: full HP, clear status.
Definition at line 1096 of file pokemonbox.cpp.
References hp, hpChanged(), hpStat(), moves, status, and statusChanged().
Referenced by maxOut(), pokemonResetChanged(), randomize(), and resetPokemon().
| void PokemonBox::healedChanged | ( | ) |
Referenced by PokemonBox().
| void PokemonBox::hpChanged | ( | ) |
Referenced by copyFrom(), heal(), load(), PokemonBox(), reset(), and update().
| int PokemonBox::hpDV | ( | ) |
Definition at line 918 of file pokemonbox.cpp.
References PokemonStats::Attack, PokemonStats::Defense, dv, PokemonStats::Special, and PokemonStats::Speed.
Referenced by hpStat().
| void PokemonBox::hpExpChanged | ( | ) |
Referenced by copyFrom(), load(), maxEVs(), PokemonBox(), randomize(), reRollEVs(), reset(), and resetEVs().
| int PokemonBox::hpStat | ( | ) |
Definition at line 937 of file pokemonbox.cpp.
References hpDV(), hpExp, isValid(), and level.
Referenced by heal(), isCorrected(), isMaxedOut(), isMaxHp(), PokemonParty::regenStats(), and update().
| bool PokemonBox::isAfflicted | ( | ) |
Has any status condition.
Definition at line 1083 of file pokemonbox.cpp.
References status.
Referenced by isHealed().
|
virtual |
True for a pure box mon; PokemonParty overrides to false.
Reimplemented in PokemonParty.
Definition at line 1740 of file pokemonbox.cpp.
Referenced by pokemonResetChanged().
| bool PokemonBox::isCorrected | ( | ) |
Values internally consistent (see correct* slots).
Definition at line 1523 of file pokemonbox.cpp.
References catchRate, exp, hp, hpStat(), isValid(), levelToExp(), type1, and type2.
| bool PokemonBox::isHealed | ( | ) |
Fully healed (HP + status). (heal() performs a Pokecenter heal.).
Definition at line 1078 of file pokemonbox.cpp.
References isAfflicted(), isMaxHp(), and isMaxPP().
Referenced by isPokemonReset().
| bool PokemonBox::isMaxDVs | ( | ) |
| bool PokemonBox::isMaxedOut | ( | ) |
Level/EV/DV/PP all maxed.
Definition at line 1492 of file pokemonbox.cpp.
References atkExp, defExp, dv, exp, expLevelRangeEnd(), hp, hpExp, hpStat(), isMaxPP(), isMaxPpUps(), isValidBool(), level, moves, spdExp, and spExp.
| bool PokemonBox::isMaxEVs | ( | ) |
| bool PokemonBox::isMaxHp | ( | ) |
HP equals computed max.
Definition at line 1088 of file pokemonbox.cpp.
References hp, hpStat(), and isValid().
Referenced by isHealed().
| bool PokemonBox::isMaxLevel | ( | ) |
| bool PokemonBox::isMaxPP | ( | ) |
All moves at max PP.
Definition at line 1252 of file pokemonbox.cpp.
References isMaxPP(), and moves.
Referenced by isHealed(), isMaxedOut(), and isMaxPP().
| bool PokemonBox::isMaxPpUps | ( | ) |
All moves at max PP-Ups.
Definition at line 1267 of file pokemonbox.cpp.
References isMaxPpUps(), and moves.
Referenced by isMaxedOut(), and isMaxPpUps().
| bool PokemonBox::isMinDVs | ( | ) |
| bool PokemonBox::isMinEvs | ( | ) |
All stat-exp zero.
Definition at line 1288 of file pokemonbox.cpp.
References atkExp, defExp, hpExp, spdExp, and spExp.
Referenced by isPokemonReset().
| bool PokemonBox::isPokemonReset | ( | ) |
Matches the reset baseline.
Definition at line 1441 of file pokemonbox.cpp.
References isHealed(), isMinEvs(), isValid(), level, and moves.
| bool PokemonBox::isShiny | ( | ) |
Shiny per the VC-era DV formula (see disclaimer above).
Definition at line 1593 of file pokemonbox.cpp.
References PokemonStats::Attack, PokemonStats::Defense, dv, PokemonStats::Special, and PokemonStats::Speed.
| PokemonDBEntry * PokemonBox::isValid | ( | ) |
The species' DB entry, or null if not a real Pokedex species.
Definition at line 817 of file pokemonbox.cpp.
References PokemonDB::getIndAt(), PokemonDB::inst(), and species.
Referenced by correctTypes(), deEvolve(), dexNum(), evolve(), expLevelRangeEnd(), expLevelRangePercent(), expLevelRangeStart(), hasDeEvolution(), hasEvolution(), hasNickname(), hpStat(), isCorrected(), isMaxHp(), isPokemonReset(), isValidBool(), levelToExp(), nonHpStat(), resetExp(), resetPokemon(), speciesName(), and update().
| bool PokemonBox::isValidBool | ( | ) |
Convenience bool form of isValid().
Definition at line 831 of file pokemonbox.cpp.
References isValid().
Referenced by isMaxedOut(), PokemonParty::regenStats(), and setNature().
| void PokemonBox::levelChanged | ( | ) |
Referenced by copyFrom(), load(), PokemonParty::load(), maxLevel(), PokemonBox(), randomize(), reset(), and resetPokemon().
| unsigned int PokemonBox::levelToExp | ( | int | level = -1 | ) |
EXP needed for level (current level if -1).
Definition at line 836 of file pokemonbox.cpp.
References exp, isValid(), and level.
Referenced by expLevelRangeEnd(), expLevelRangeStart(), isCorrected(), and update().
|
virtual |
Expand one Pokemon from the save.
Reimplemented in PokemonParty.
Definition at line 409 of file pokemonbox.cpp.
References atkExp, atkExpChanged(), PokemonStats::Attack, catchRate, catchRateChanged(), PokemonStats::Defense, defExp, defExpChanged(), dv, dvChanged(), exp, expChanged(), hp, hpChanged(), hpExp, hpExpChanged(), SaveFile::iterator(), level, levelChanged(), moves, movesChanged(), nickname, nicknameChanged(), SaveFileIterator::offsetTo(), otID, otIDChanged(), otName, otNameChanged(), reset(), spdExp, spdExpChanged(), PokemonStats::Special, species, speciesChanged(), PokemonStats::Speed, spExp, spExpChanged(), status, statusChanged(), SaveFile::toolset, type1, type1Changed(), type2, type2Changed(), type2Explicit, and type2ExplicitChanged().
Referenced by PokemonParty::load(), and PokemonBox().
| void PokemonBox::makeShiny | ( | ) |
Force DVs to a shiny combination.
Definition at line 1722 of file pokemonbox.cpp.
References PokemonStats::Attack, dv, dvChanged(), and rollShiny().
Referenced by pokemonResetChanged().
| void PokemonBox::manualLevelChanged | ( | ) |
UI hook: level edited directly.
Definition at line 2007 of file pokemonbox.cpp.
References update().
Referenced by pokemonResetChanged().
| void PokemonBox::manualSpeciesChanged | ( | ) |
UI hook: species edited directly.
Definition at line 2002 of file pokemonbox.cpp.
References update().
Referenced by pokemonResetChanged().
| void PokemonBox::maxDVs | ( | ) |
Max all DVs.
Definition at line 1335 of file pokemonbox.cpp.
References dv, and dvChanged().
Referenced by maxOut(), and pokemonResetChanged().
| void PokemonBox::maxEVs | ( | ) |
Max all stat-exp.
Definition at line 1359 of file pokemonbox.cpp.
References atkExp, atkExpChanged(), defExp, defExpChanged(), hpExp, hpExpChanged(), spdExp, spdExpChanged(), spExp, spExpChanged(), and update().
Referenced by maxOut(), and pokemonResetChanged().
| void PokemonBox::maxLevel | ( | ) |
Set to level 100.
Definition at line 1321 of file pokemonbox.cpp.
References level, levelChanged(), and update().
Referenced by maxOut(), and pokemonResetChanged().
| void PokemonBox::maxOut | ( | ) |
Max level/EV/DV/PP at once.
Definition at line 1419 of file pokemonbox.cpp.
References heal(), maxDVs(), maxEVs(), maxLevel(), maxPpUps(), and update().
Referenced by pokemonResetChanged().
| void PokemonBox::maxPpUps | ( | ) |
Max every move's PP-Ups.
Definition at line 1329 of file pokemonbox.cpp.
References moves.
Referenced by maxOut(), and pokemonResetChanged().
| PokemonMove * PokemonBox::movesAt | ( | int | ind | ) |
Move slot ind (GC-protected return).
Definition at line 1981 of file pokemonbox.cpp.
References moves, and qmlCppOwned().
| void PokemonBox::movesChanged | ( | ) |
Referenced by clearMoves(), clearMovesButFirst(), copyFrom(), correctMoveAt(), deleteMoveAt(), load(), PokemonBox(), randomizeMoves(), reorderMove(), and resetPokemon().
| int PokemonBox::movesCount | ( | ) |
| int PokemonBox::movesMax | ( | ) |
|
static |
Definition at line 383 of file pokemonbox.cpp.
References Random::chanceSuccess(), Random::flipCoin(), PokemonDBEntry::ind, Random::inst(), PokemonBox(), and Random::rangeInclusive().
|
static |
Definition at line 359 of file pokemonbox.cpp.
References PokemonDB::getIndAt(), PokemonDB::getStoreAt(), PokemonDB::getStoreSize(), PokemonDB::inst(), Random::inst(), StarterPokemonDB::inst(), newPokemon(), PokemonBox(), pokemonDexCount, StarterPokemonDB::random3Starter(), PokemonRandom::Random_All, PokemonRandom::Random_Pokedex, PokemonRandom::Random_Starters, StarterPokemonDB::randomAnyStarter(), and Random::rangeExclusive().
Referenced by ItemMarketEntryGCPokemon::checkout(), newPokemon(), PlayerPokemon::pokemonNew(), PokemonStorageBox::pokemonNew(), and randomize().
| void PokemonBox::nicknameChanged | ( | ) |
Referenced by changeName(), copyFrom(), load(), PokemonBox(), and reset().
| int PokemonBox::nonHpStat | ( | PokemonStats::PokemonStats_ | stat | ) |
Definition at line 948 of file pokemonbox.cpp.
References atkExp, PokemonStats::Attack, PokemonStats::Defense, defExp, dv, isValid(), level, spdExp, PokemonStats::Special, PokemonStats::Speed, and spExp.
Referenced by atkStat(), defStat(), spdStat(), and spStat().
| void PokemonBox::otIDChanged | ( | ) |
Referenced by changeOtData(), copyFrom(), load(), and reset().
| void PokemonBox::otNameChanged | ( | ) |
Referenced by changeOtData(), copyFrom(), load(), and reset().
| void PokemonBox::pokemonResetChanged | ( | ) |
References changeMove(), changeName(), changeOtData(), changeTrade(), cleanupMoves(), clearMoves(), clearMovesButFirst(), correctMoveAt(), correctMoves(), correctTypes(), deEvolve(), deleteMoveAt(), evolve(), heal(), isBoxMon(), makeShiny(), manualLevelChanged(), manualSpeciesChanged(), maxDVs(), maxEVs(), maxLevel(), maxOut(), maxPpUps(), randomize(), randomizeMoves(), reorderMove(), reRollDVs(), reRollEVs(), reset(), resetDVs(), resetEVs(), resetExp(), resetPokemon(), rollNonShiny(), rollShiny(), setNature(), unmakeShiny(), and update().
Referenced by PokemonBox().
|
virtual |
Randomize this Pokemon (constrained).
Reimplemented in PokemonParty.
Definition at line 718 of file pokemonbox.cpp.
References atkExp, atkExpChanged(), Random::chanceSuccess(), changeName(), changeTrade(), copyFrom(), defExp, defExpChanged(), Random::flipCoin(), TypesDB::getStoreAt(), heal(), hpExp, hpExpChanged(), Random::inst(), TypesDB::inst(), level, levelChanged(), newPokemon(), pokemonLevelMax, PokemonRandom::Random_Pokedex, randomizeMoves(), Random::rangeInclusive(), reset(), spdExp, spdExpChanged(), spExp, spExpChanged(), type1, type1Changed(), type2, type2Changed(), type2Explicit, type2ExplicitChanged(), and update().
Referenced by pokemonResetChanged(), PokemonParty::randomize(), and PokemonStorageBox::randomize().
| void PokemonBox::randomizeMoves | ( | ) |
Randomize the move set.
Definition at line 1430 of file pokemonbox.cpp.
References clearMoves(), moves, and movesChanged().
Referenced by pokemonResetChanged(), and randomize().
| void PokemonBox::reorderMove | ( | int | from, |
| int | to ) |
Reorder the filled move slots: take the move at from and re-insert it before slot to (drop-slot convention: 0..movesCount; == movesCount appends after the last move).
Only the filled prefix participates (empty slots stay parked at the bottom, per game move-list compaction). The fixed PokemonMove slot objects keep their identity – the (id/pp/ppUp) VALUES move between them – so QML's movesAt() pointers stay valid. Writes only the move bytes the reorder touches; nothing else in the save changes.
Definition at line 1798 of file pokemonbox.cpp.
References maxMoves, moves, and movesChanged().
Referenced by pokemonResetChanged().
| void PokemonBox::reRollDVs | ( | ) |
Randomize DVs.
Definition at line 1343 of file pokemonbox.cpp.
References dv, dvChanged(), and Random::inst().
Referenced by pokemonResetChanged(), and rollNonShiny().
| void PokemonBox::reRollEVs | ( | ) |
Randomize stat-exp.
Definition at line 1399 of file pokemonbox.cpp.
References atkExp, atkExpChanged(), defExp, defExpChanged(), hpExp, hpExpChanged(), Random::inst(), Random::rangeInclusive(), spdExp, spdExpChanged(), spExp, spExpChanged(), and update().
Referenced by pokemonResetChanged().
|
virtual |
Blank this Pokemon.
Reimplemented in PokemonParty.
Definition at line 656 of file pokemonbox.cpp.
References atkExp, atkExpChanged(), catchRate, catchRateChanged(), clearMoves(), defExp, defExpChanged(), dv, dvChanged(), exp, expChanged(), hp, hpChanged(), hpExp, hpExpChanged(), level, levelChanged(), nickname, nicknameChanged(), otID, otIDChanged(), otName, otNameChanged(), spdExp, spdExpChanged(), species, speciesChanged(), spExp, spExpChanged(), status, statusChanged(), type1, type1Changed(), type2, type2Changed(), type2Explicit, and type2ExplicitChanged().
Referenced by load(), pokemonResetChanged(), randomize(), and PokemonParty::reset().
| void PokemonBox::resetDVs | ( | ) |
Zero all DVs.
Definition at line 1351 of file pokemonbox.cpp.
References dv, and dvChanged().
Referenced by pokemonResetChanged().
| void PokemonBox::resetEVs | ( | ) |
Zero all stat-exp.
Definition at line 1379 of file pokemonbox.cpp.
References atkExp, atkExpChanged(), defExp, defExpChanged(), hpExp, hpExpChanged(), spdExp, spdExpChanged(), spExp, spExpChanged(), and update().
Referenced by pokemonResetChanged(), and resetPokemon().
| void PokemonBox::resetExp | ( | ) |
Reset EXP to the current level's baseline.
Definition at line 909 of file pokemonbox.cpp.
References exp, expChanged(), expLevelRangeStart(), and isValid().
Referenced by pokemonResetChanged(), PokemonParty::specialChanged(), update(), and PokemonParty::update().
| void PokemonBox::resetPokemon | ( | ) |
Reset to the baseline state.
Definition at line 1850 of file pokemonbox.cpp.
References clearMoves(), heal(), isValid(), level, levelChanged(), moves, movesChanged(), resetEVs(), and update().
Referenced by pokemonResetChanged().
| void PokemonBox::rollNonShiny | ( | ) |
Randomize DVs until not shiny.
Definition at line 1714 of file pokemonbox.cpp.
References PokemonStats::Attack, dv, dvChanged(), and reRollDVs().
Referenced by pokemonResetChanged().
| void PokemonBox::rollShiny | ( | ) |
Randomize DVs until shiny.
Definition at line 1698 of file pokemonbox.cpp.
References PokemonStats::Attack, PokemonStats::Defense, dv, dvChanged(), Random::inst(), Random::rangeInclusive(), PokemonStats::Special, and PokemonStats::Speed.
Referenced by makeShiny(), and pokemonResetChanged().
|
virtual |
Flatten one Pokemon back to the save.
Reimplemented in PokemonParty.
Definition at line 556 of file pokemonbox.cpp.
References atkExp, PokemonStats::Attack, catchRate, PokemonStats::Defense, defExp, dv, exp, hp, hpExp, SaveFile::iterator(), level, moves, nickname, SaveFileIterator::offsetTo(), otID, otName, spdExp, PokemonStats::Special, species, PokemonStats::Speed, spExp, status, SaveFile::toolset, type1, type2, and type2Explicit.
Referenced by PokemonParty::save().
| void PokemonBox::setNature | ( | int | nature | ) |
Definition at line 1608 of file pokemonbox.cpp.
References exp, expChanged(), expLevelRangeEnd(), expLevelRangeStart(), and isValidBool().
Referenced by pokemonResetChanged().
| void PokemonBox::spdExpChanged | ( | ) |
Referenced by copyFrom(), load(), maxEVs(), PokemonBox(), randomize(), reRollEVs(), reset(), and resetEVs().
| int PokemonBox::spdStat | ( | ) |
Computed Speed stat.
Definition at line 2022 of file pokemonbox.cpp.
References nonHpStat(), and PokemonStats::Speed.
Referenced by PokemonParty::regenStats().
| protected::void PokemonBox::speciesChanged | ( | ) |
Referenced by copyFrom(), deEvolve(), evolve(), load(), PokemonBox(), and reset().
| QString PokemonBox::speciesName | ( | ) |
| void PokemonBox::spExpChanged | ( | ) |
Referenced by copyFrom(), load(), maxEVs(), PokemonBox(), randomize(), reRollEVs(), reset(), and resetEVs().
| int PokemonBox::spStat | ( | ) |
Computed Special stat.
Definition at line 2027 of file pokemonbox.cpp.
References nonHpStat(), and PokemonStats::Special.
Referenced by PokemonParty::regenStats().
| void PokemonBox::statChanged | ( | ) |
Referenced by PokemonBox(), and PokemonParty::PokemonParty().
| void PokemonBox::statusChanged | ( | ) |
Referenced by copyFrom(), heal(), load(), and reset().
| PokemonDBEntry * PokemonBox::toData | ( | ) |
The species' DB entry for this mon.
Definition at line 1955 of file pokemonbox.cpp.
References PokemonDB::getIndAt(), PokemonDB::inst(), and species.
Referenced by changeName(), and MoveSelectModel::monFromBox().
| void PokemonBox::type1Changed | ( | ) |
Referenced by copyFrom(), correctTypes(), load(), randomize(), reset(), and update().
| void PokemonBox::type2Changed | ( | ) |
Referenced by copyFrom(), correctTypes(), load(), randomize(), reset(), and update().
| void PokemonBox::type2ExplicitChanged | ( | ) |
Referenced by copyFrom(), correctTypes(), load(), randomize(), reset(), and update().
| void PokemonBox::unmakeShiny | ( | ) |
Force DVs to a non-shiny combination.
Definition at line 1733 of file pokemonbox.cpp.
References PokemonStats::Attack, dv, and dvChanged().
Referenced by pokemonResetChanged().
|
virtual |
Recompute derived stats.
Each flag opts into clobbering a value that would otherwise be preserved (HP/EXP) or only sometimes needs it (type/catch rate/moves).
Reimplemented in PokemonParty.
Definition at line 984 of file pokemonbox.cpp.
References catchRate, catchRateChanged(), cleanupMoves(), correctMoves(), exp, expChanged(), hp, hpChanged(), hpStat(), isValid(), levelToExp(), resetExp(), type1, type1Changed(), type2, type2Changed(), type2Explicit, and type2ExplicitChanged().
Referenced by deEvolve(), evolve(), manualLevelChanged(), manualSpeciesChanged(), maxEVs(), maxLevel(), maxOut(), pokemonResetChanged(), randomize(), reRollEVs(), resetEVs(), resetPokemon(), and PokemonParty::update().
| int PokemonBox::atkExp |
Definition at line 511 of file pokemonbox.h.
Referenced by copyFrom(), isMaxedOut(), isMaxEVs(), isMinEvs(), load(), maxEVs(), nonHpStat(), randomize(), reRollEVs(), reset(), resetEVs(), and save().
| int PokemonBox::catchRate |
Definition at line 507 of file pokemonbox.h.
Referenced by copyFrom(), isCorrected(), load(), reset(), save(), and update().
| int PokemonBox::defExp |
Definition at line 512 of file pokemonbox.h.
Referenced by copyFrom(), isMaxedOut(), isMaxEVs(), isMinEvs(), load(), maxEVs(), nonHpStat(), randomize(), reRollEVs(), reset(), resetEVs(), and save().
Stored DVs (Atk/Def/Spd/Spc); HP DV is derived.
Definition at line 515 of file pokemonbox.h.
Referenced by copyFrom(), dvAt(), dvSet(), hpDV(), isMaxDVs(), isMaxedOut(), isMinDVs(), isShiny(), load(), makeShiny(), maxDVs(), nonHpStat(), reRollDVs(), reset(), resetDVs(), rollNonShiny(), rollShiny(), save(), and unmakeShiny().
| unsigned int PokemonBox::exp |
Definition at line 509 of file pokemonbox.h.
Referenced by copyFrom(), expLevelRangeEnd(), expLevelRangePercent(), expLevelRangeStart(), getNature(), isCorrected(), isMaxedOut(), levelToExp(), load(), reset(), resetExp(), save(), setNature(), and update().
| int PokemonBox::hp |
Definition at line 502 of file pokemonbox.h.
Referenced by copyFrom(), heal(), isCorrected(), isMaxedOut(), isMaxHp(), load(), reset(), save(), and update().
| int PokemonBox::hpExp |
Definition at line 510 of file pokemonbox.h.
Referenced by copyFrom(), hpStat(), isMaxedOut(), isMaxEVs(), isMinEvs(), load(), maxEVs(), randomize(), reRollEVs(), reset(), resetEVs(), and save().
| int PokemonBox::level |
Definition at line 503 of file pokemonbox.h.
Referenced by copyFrom(), expLevelRangeEnd(), expLevelRangePercent(), expLevelRangeStart(), hpStat(), isMaxedOut(), isMaxLevel(), isPokemonReset(), levelToExp(), load(), PokemonParty::load(), maxLevel(), nonHpStat(), randomize(), reset(), resetPokemon(), save(), and PokemonParty::save().
| PokemonMove* PokemonBox::moves[4] |
The four move slots.
Definition at line 519 of file pokemonbox.h.
Referenced by changeMove(), cleanupMoves(), clearMoves(), clearMovesButFirst(), copyFrom(), correctMoveAt(), correctMoves(), deleteMoveAt(), heal(), isMaxedOut(), isMaxPP(), isMaxPpUps(), isPokemonReset(), load(), maxPpUps(), movesAt(), movesCount(), PokemonBox(), randomizeMoves(), reorderMove(), resetPokemon(), save(), and ~PokemonBox().
| QString PokemonBox::nickname |
Definition at line 517 of file pokemonbox.h.
Referenced by changeName(), copyFrom(), hasNickname(), load(), reset(), and save().
| int PokemonBox::otID |
Definition at line 508 of file pokemonbox.h.
Referenced by changeOtData(), copyFrom(), hasTradeStatus(), load(), reset(), and save().
| QString PokemonBox::otName |
Definition at line 516 of file pokemonbox.h.
Referenced by changeOtData(), copyFrom(), hasTradeStatus(), load(), reset(), and save().
| int PokemonBox::spdExp |
Definition at line 513 of file pokemonbox.h.
Referenced by copyFrom(), isMaxedOut(), isMaxEVs(), isMinEvs(), load(), maxEVs(), nonHpStat(), randomize(), reRollEVs(), reset(), resetEVs(), and save().
| int PokemonBox::species |
Definition at line 501 of file pokemonbox.h.
Referenced by copyFrom(), deEvolve(), evolve(), isValid(), load(), reset(), save(), and toData().
| int PokemonBox::spExp |
Definition at line 514 of file pokemonbox.h.
Referenced by copyFrom(), isMaxedOut(), isMaxEVs(), isMinEvs(), load(), maxEVs(), nonHpStat(), randomize(), reRollEVs(), reset(), resetEVs(), and save().
| int PokemonBox::status |
Definition at line 504 of file pokemonbox.h.
Referenced by copyFrom(), heal(), isAfflicted(), load(), reset(), and save().
| int PokemonBox::type1 |
Definition at line 505 of file pokemonbox.h.
Referenced by copyFrom(), correctTypes(), isCorrected(), load(), randomize(), reset(), save(), and update().
| int PokemonBox::type2 |
Definition at line 506 of file pokemonbox.h.
Referenced by copyFrom(), correctTypes(), isCorrected(), load(), randomize(), reset(), save(), and update().
| bool PokemonBox::type2Explicit |
Definition at line 530 of file pokemonbox.h.
Referenced by copyFrom(), correctTypes(), load(), randomize(), reset(), save(), and update().