50 this->
file = saveFile;
52 if(saveFile ==
nullptr)
55 auto toolset = saveFile->
toolset;
57 for (
var8 i = 0; i < toolset->getByte(0x2F2C) && i < 6; i++) {
75 auto toolset = saveFile->
toolset;
96 toolset->setByte(speciesOffset, 0xFF);
112 for(
var8 i = 0; i < count; i++) {
115 tmp->randomize(basics);
124 tmp->randomize(basics);
131 tmp->changeMove(2,
MovesDB::inst()->getIndAt(
"STRENGTH")->ind);
135 for(
auto move : tmp->moves) {
static MovesDB * inst()
< Number of moves.
The trainer's headline values: name, ID, money, coins, badges, starter.
virtual void load(SaveFile *saveFile=nullptr, var16 boxOffset=0)
Expand the party from the save (boxOffset locates the party block).
PokemonParty * partyAt(int ind)
Party member at ind (GC-protected return).
virtual void randomize(PlayerBasics *basics)
Randomize the party; basics supplies starter/OT context.
PlayerPokemon(SaveFile *saveFile=nullptr)
virtual void save(SaveFile *saveFile, var16 boxOffset=0)
Flatten the party back to the save (boxOffset locates the party block).
virtual void pokemonNew()
Add/initialize a fresh party Pokemon.
static PokemonBox * newPokemon(PokemonRandom::PokemonRandom_ list=PokemonRandom::Random_Starters, PlayerBasics *basics=nullptr)
A party Pokemon: a PokemonBox plus the five pre-generated battle stats.
static PokemonParty * convertToParty(PokemonBox *data)
New party mon from a box record (regenerates stats).
bool isParty
True if this box is actually the party (affects record format).
void pokemonChanged()
Box contents changed.
void pokemonInsertChange()
A mon was inserted.
QVector< PokemonBox * > pokemon
The stored mons.
void reset()
Empty the box.
SaveFile * file
Owning save.
PokemonStorageBox(int maxSize=boxMaxPokemon, SaveFile *saveFile=nullptr, var16 boxOffset=0)
< How many mons are in the box.
int rangeInclusive(const int start, const int end) const
Random integer in the closed interval [start, end].
static Random * inst()
< Convenience 50% coin flip (integer path), readable from QML.
One loaded save: the raw 32 KB bytes, their expanded object tree, and the tools that move between the...
SaveFileToolset * toolset
Tools to operate directly on the raw sav file data.
var8e var8
Everyday 8-bit alias. Exact (not "fastest") to dodge the pointer-width bug noted above.
var16e var16
Everyday 16-bit alias. Exact width to avoid the "fastest" widening bug.
constexpr var8 boxMaxPokemon
Capacity of a single PC box.
qmlCppOwned() – protect Q_INVOKABLE QObject returns from QML's GC.
static T * qmlCppOwned(T *obj)
Hand QML CppOwnership of a C++-owned QObject returned from a Q_INVOKABLE.
@ Random_Starters
A "startery"-feeling Pokemon (non-legendary base evo).