|
Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
|
One of a Pokemon's four move slots: move id, PP, and PP-Ups. More...
#include <pokemonbox.h>
Public Member Functions | |
| PokemonMove (PokemonBox *parentMon, var8 move=0, var8 pp=0, var8 ppUp=0) | |
| < Move id (indexes the moves DB). | |
| MoveDBEntry * | toMove () |
| Resolve moveID to its DB entry. | |
| bool | isMaxPP () |
| Is current PP at the cap? | |
| int | getMaxPP () |
| PP cap for this move given PP-Ups. | |
| bool | isMaxPpUps () |
| Are PP-Ups at max? | |
| bool | isInvalid () |
| Is the move id out of range / not a real move? | |
| QString | moveType () |
| The move's elemental type name. | |
| void | onMoveIdChanged () |
| Recompute derived state after the move id changes. | |
| QVector< int > | allValidMoves () |
| Every legal move id for this slot. | |
| QVector< int > | validMovesLeft () |
| Legal moves not already used by the mon. | |
| bool | isDuplicateMove () |
| Is this move a duplicate within the mon's set? | |
| protected::void | moveIDChanged () |
| void | ppChanged () |
| void | ppUpChanged () |
| void | ppCapChanged () |
| void | invalidChanged () |
| void | randomize () |
| Pick a random valid move. | |
| void | maxPpUp () |
| Set PP-Ups to max. | |
| void | raisePpUp () |
| +1 PP-Up. | |
| void | lowerPpUp () |
| -1 PP-Up. | |
| void | resetPpUp () |
| PP-Ups to 0. | |
| void | restorePP () |
| Refill PP to the cap. | |
| void | changeMove (int move=0, int pp=0, int ppUp=0) |
| Replace this slot's values. | |
| void | correctMove () |
| Clamp/repair inconsistent values. | |
Public Attributes | |
| int | moveID |
| Move id (backs property). | |
| int | pp |
| Current PP (backs property). | |
| int | ppUp |
| PP-Ups (backs property). | |
| PokemonBox * | parentMon = nullptr |
| Owning Pokemon (for cross-slot validation). | |
One of a Pokemon's four move slots: move id, PP, and PP-Ups.
Carries the raw values plus a wall of computed QML properties (max-PP checks, validity, duplicate detection, type). Holds a back-pointer to its owning parentMon so it can validate against the Pokemon's full move set.
Definition at line 132 of file pokemonbox.h.
| PokemonMove::PokemonMove | ( | PokemonBox * | parentMon, |
| var8 | move = 0, | ||
| var8 | pp = 0, | ||
| var8 | ppUp = 0 ) |
< Move id (indexes the moves DB).
Current PP. PP-Ups applied (0-3). < Is PP at its current cap? PP cap given PP-Ups. Are PP-Ups maxed (3)? < Is this move id invalid? Does the mon already know this move? The move's type name.
| parentMon | Owning Pokemon. |
| move/pp/ppUp | Initial raw values. |
Definition at line 43 of file pokemonbox.cpp.
References moveID, moveIDChanged(), onMoveIdChanged(), parentMon, pp, ppCapChanged(), ppChanged(), ppUp, ppUpChanged(), and randomize().
| QVector< int > PokemonMove::allValidMoves | ( | ) |
Every legal move id for this slot.
Definition at line 181 of file pokemonbox.cpp.
References parentMon.
Referenced by correctMove(), and validMovesLeft().
| void PokemonMove::changeMove | ( | int | move = 0, |
| int | pp = 0, | ||
| int | ppUp = 0 ) |
Replace this slot's values.
Definition at line 245 of file pokemonbox.cpp.
References moveID, moveIDChanged(), pp, ppChanged(), ppUp, and ppUpChanged().
Referenced by invalidChanged().
| void PokemonMove::correctMove | ( | ) |
Clamp/repair inconsistent values.
Definition at line 257 of file pokemonbox.cpp.
References allValidMoves(), isDuplicateMove(), moveID, moveIDChanged(), parentMon, and validMovesLeft().
Referenced by invalidChanged().
| int PokemonMove::getMaxPP | ( | ) |
PP cap for this move given PP-Ups.
Definition at line 140 of file pokemonbox.cpp.
References ppUp, and toMove().
Referenced by isMaxPP(), onMoveIdChanged(), randomize(), and restorePP().
| void PokemonMove::invalidChanged | ( | ) |
References changeMove(), correctMove(), lowerPpUp(), maxPpUp(), pp, ppUp, raisePpUp(), randomize(), resetPpUp(), and restorePP().
| bool PokemonMove::isDuplicateMove | ( | ) |
Is this move a duplicate within the mon's set?
Definition at line 223 of file pokemonbox.cpp.
References parentMon.
Referenced by correctMove().
| bool PokemonMove::isInvalid | ( | ) |
Is the move id out of range / not a real move?
Definition at line 158 of file pokemonbox.cpp.
References MoveDBEntry::glitch, moveID, and toMove().
Referenced by moveType(), and onMoveIdChanged().
| bool PokemonMove::isMaxPP | ( | ) |
Is current PP at the cap?
Definition at line 131 of file pokemonbox.cpp.
References getMaxPP(), and pp.
| bool PokemonMove::isMaxPpUps | ( | ) |
| void PokemonMove::lowerPpUp | ( | ) |
-1 PP-Up.
Definition at line 118 of file pokemonbox.cpp.
References ppUp, and ppUpChanged().
Referenced by invalidChanged().
| void PokemonMove::maxPpUp | ( | ) |
Set PP-Ups to max.
Definition at line 105 of file pokemonbox.cpp.
References ppUp, and ppUpChanged().
Referenced by invalidChanged().
| protected::void PokemonMove::moveIDChanged | ( | ) |
Referenced by changeMove(), correctMove(), PokemonMove(), and randomize().
| QString PokemonMove::moveType | ( | ) |
The move's elemental type name.
Definition at line 163 of file pokemonbox.cpp.
References isInvalid(), moveID, TypeDBEntry::readable, toMove(), and MoveDBEntry::toType.
| void PokemonMove::onMoveIdChanged | ( | ) |
Recompute derived state after the move id changes.
Definition at line 173 of file pokemonbox.cpp.
References getMaxPP(), isInvalid(), pp, and ppChanged().
Referenced by PokemonMove().
| void PokemonMove::ppCapChanged | ( | ) |
Referenced by PokemonBox::PokemonBox(), and PokemonMove().
| void PokemonMove::ppChanged | ( | ) |
Referenced by changeMove(), onMoveIdChanged(), PokemonMove(), randomize(), and restorePP().
| void PokemonMove::ppUpChanged | ( | ) |
Referenced by changeMove(), lowerPpUp(), maxPpUp(), PokemonMove(), raisePpUp(), randomize(), and resetPpUp().
| void PokemonMove::raisePpUp | ( | ) |
+1 PP-Up.
Definition at line 111 of file pokemonbox.cpp.
References ppUp, and ppUpChanged().
Referenced by invalidChanged().
| void PokemonMove::randomize | ( | ) |
Pick a random valid move.
Definition at line 82 of file pokemonbox.cpp.
References MovesDB::getIndAt(), getMaxPP(), MovesDB::getStoreSize(), MoveDBEntry::glitch, MoveDBEntry::ind, MovesDB::inst(), Random::inst(), moveID, moveIDChanged(), pp, ppChanged(), ppUp, ppUpChanged(), and Random::rangeInclusive().
Referenced by invalidChanged(), and PokemonMove().
| void PokemonMove::resetPpUp | ( | ) |
PP-Ups to 0.
Definition at line 125 of file pokemonbox.cpp.
References ppUp, and ppUpChanged().
Referenced by invalidChanged().
| void PokemonMove::restorePP | ( | ) |
Refill PP to the cap.
Definition at line 235 of file pokemonbox.cpp.
References getMaxPP(), pp, and ppChanged().
Referenced by invalidChanged().
| MoveDBEntry * PokemonMove::toMove | ( | ) |
Resolve moveID to its DB entry.
Definition at line 77 of file pokemonbox.cpp.
References MovesDB::getIndAt(), MovesDB::inst(), and moveID.
Referenced by getMaxPP(), isInvalid(), and moveType().
| QVector< int > PokemonMove::validMovesLeft | ( | ) |
Legal moves not already used by the mon.
Definition at line 208 of file pokemonbox.cpp.
References allValidMoves(), and parentMon.
Referenced by correctMove().
| int PokemonMove::moveID |
Move id (backs property).
Definition at line 185 of file pokemonbox.h.
Referenced by changeMove(), PokemonBox::copyFrom(), correctMove(), isInvalid(), moveType(), PokemonMove(), randomize(), and toMove().
| PokemonBox* PokemonMove::parentMon = nullptr |
Owning Pokemon (for cross-slot validation).
Definition at line 188 of file pokemonbox.h.
Referenced by allValidMoves(), correctMove(), isDuplicateMove(), PokemonMove(), and validMovesLeft().
| int PokemonMove::pp |
Current PP (backs property).
Definition at line 186 of file pokemonbox.h.
Referenced by changeMove(), PokemonBox::copyFrom(), invalidChanged(), isMaxPP(), onMoveIdChanged(), PokemonMove(), randomize(), and restorePP().
| int PokemonMove::ppUp |
PP-Ups (backs property).
Definition at line 187 of file pokemonbox.h.
Referenced by changeMove(), PokemonBox::copyFrom(), getMaxPP(), invalidChanged(), isMaxPpUps(), lowerPpUp(), maxPpUp(), PokemonMove(), raisePpUp(), randomize(), and resetPpUp().