|
Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
|
The player's position and movement/HM/battle/warp state on the map. More...
#include <areaplayer.h>
Public Member Functions | |
| AreaPlayer (SaveFile *saveFile=nullptr) | |
| < Current move direction (raw bits; see field note). | |
| virtual | ~AreaPlayer () |
| void | load (SaveFile *saveFile=nullptr) |
| Expand the player state from the save. | |
| void | save (SaveFile *saveFile) |
| Flatten the player state to the save. | |
| protected::void | playerMoveDirChanged () |
| void | playerLastStopDirChanged () |
| void | playerCurDirChanged () |
| void | yCoordChanged () |
| void | xCoordChanged () |
| void | yBlockCoordChanged () |
| void | xBlockCoordChanged () |
| void | playerJumpingYScrnCoordsChanged () |
| void | strengthOutsideBattleChanged () |
| void | surfingAllowedChanged () |
| void | flyOutofBattleChanged () |
| void | isBattleChanged () |
| void | isTrainerBattleChanged () |
| void | noBattlesChanged () |
| void | battleEndedOrBlackoutChanged () |
| void | yOffsetSinceLastSpecialWarpChanged () |
| void | xOffsetSinceLastSpecialWarpChanged () |
| void | standingOnDoorChanged () |
| void | movingThroughDoorChanged () |
| void | standingOnWarpChanged () |
| void | walkBikeSurfChanged () |
| void | finalLedgeJumpingChanged () |
| void | spinPlayerChanged () |
| void | usedCardKeyChanged () |
| void | usingLinkCableChanged () |
| void | reset () |
| Blank the player state. | |
| void | randomize (int x, int y) |
| Randomize, placing the player at (x,y). | |
| void | setTo (MapDBEntry *map, int x, int y) |
Place the player on map at (x,y). | |
Public Attributes | |
| int | playerMoveDir |
| Move direction (raw bits per the table above). | |
| int | playerLastStopDir |
| the direction in which the player was moving before the player last stopped | |
| int | playerCurDir |
| if the player is moving, the current direction if the player is not moving, the last the direction in which the player moved | |
| int | yCoord |
| int | xCoord |
| int | yBlockCoord |
| int | xBlockCoord |
| int | playerJumpingYScrnCoords |
| bool | strengthOutsideBattle |
| bool | surfingAllowed |
| bool | flyOutofBattle |
| bool | isBattle |
| bool | isTrainerBattle |
| bool | noBattles |
| bool | battleEndedOrBlackout |
| int | yOffsetSinceLastSpecialWarp |
| int | xOffsetSinceLastSpecialWarp |
| bool | standingOnDoor |
| bool | movingThroughDoor |
| bool | standingOnWarp |
| int | walkBikeSurf |
| Movement mode: 0x00 walking, 0x01 biking, 0x02 surfing. | |
| bool | finalLedgeJumping |
| bool | spinPlayer |
| bool | usedCardKey |
| bool | usingLinkCable |
The player's position and movement/HM/battle/warp state on the map.
The richest area child: tile/block coordinates, facing directions, HM-usability flags (strength/surf/fly), battle state, warp state, and a grab-bag of misc flags. Many fields are live mid-step gameplay state. The field comments below give the raw value meanings. randomize()/setTo() place the player at (x,y).
Definition at line 54 of file areaplayer.h.
| AreaPlayer::AreaPlayer | ( | SaveFile * | saveFile = nullptr | ) |
< Current move direction (raw bits; see field note).
Direction before the last stop. Current/last-moved direction. Tile Y. Tile X. Block Y. Block X. Ledge-jump screen Y. Strength active outside battle. Surf usable here. Fly usable here. In a battle. In a trainer battle. Battles suppressed. Battle just ended / blackout. Y offset since last special warp. X offset since last special warp. Standing on a door tile. Walking through a door. Standing on a warp tile. Movement mode (see field note: 0 walk/1 bike/2 surf). Mid final ledge jump. Spin-tile movement active. Card key just used. Link cable in use.
Definition at line 29 of file areaplayer.cpp.
References load().
|
virtual |
Definition at line 34 of file areaplayer.cpp.
| void AreaPlayer::load | ( | SaveFile * | saveFile = nullptr | ) |
Expand the player state from the save.
Definition at line 36 of file areaplayer.cpp.
References battleEndedOrBlackout, battleEndedOrBlackoutChanged(), finalLedgeJumping, finalLedgeJumpingChanged(), flyOutofBattle, flyOutofBattleChanged(), isBattle, isBattleChanged(), isTrainerBattle, isTrainerBattleChanged(), movingThroughDoor, movingThroughDoorChanged(), noBattles, noBattlesChanged(), playerCurDir, playerCurDirChanged(), playerJumpingYScrnCoords, playerJumpingYScrnCoordsChanged(), playerLastStopDir, playerLastStopDirChanged(), playerMoveDir, playerMoveDirChanged(), reset(), spinPlayer, spinPlayerChanged(), standingOnDoor, standingOnDoorChanged(), standingOnWarp, standingOnWarpChanged(), strengthOutsideBattle, strengthOutsideBattleChanged(), surfingAllowed, surfingAllowedChanged(), SaveFile::toolset, usedCardKey, usedCardKeyChanged(), usingLinkCable, usingLinkCableChanged(), walkBikeSurf, walkBikeSurfChanged(), xBlockCoord, xBlockCoordChanged(), xCoord, xCoordChanged(), xOffsetSinceLastSpecialWarp, xOffsetSinceLastSpecialWarpChanged(), yBlockCoord, yBlockCoordChanged(), yCoord, yCoordChanged(), yOffsetSinceLastSpecialWarp, and yOffsetSinceLastSpecialWarpChanged().
Referenced by AreaPlayer().
| void AreaPlayer::playerCurDirChanged | ( | ) |
Referenced by load(), randomize(), and reset().
| void AreaPlayer::playerLastStopDirChanged | ( | ) |
Referenced by load(), randomize(), and reset().
| protected::void AreaPlayer::playerMoveDirChanged | ( | ) |
Referenced by load(), randomize(), and reset().
| void AreaPlayer::randomize | ( | int | x, |
| int | y ) |
Randomize, placing the player at (x,y).
Definition at line 230 of file areaplayer.cpp.
References Random::inst(), PlayerDir::None, playerCurDir, playerCurDirChanged(), playerLastStopDir, playerLastStopDirChanged(), playerMoveDir, playerMoveDirChanged(), Random::rangeInclusive(), reset(), PlayerDir::Right, PlayerDir::Up, xBlockCoord, xBlockCoordChanged(), xCoord, xCoordChanged(), yBlockCoord, yBlockCoordChanged(), yCoord, and yCoordChanged().
Referenced by setTo(), and usingLinkCableChanged().
| void AreaPlayer::reset | ( | ) |
Blank the player state.
Definition at line 152 of file areaplayer.cpp.
References battleEndedOrBlackout, battleEndedOrBlackoutChanged(), finalLedgeJumping, finalLedgeJumpingChanged(), flyOutofBattle, flyOutofBattleChanged(), isBattle, isBattleChanged(), isTrainerBattle, isTrainerBattleChanged(), movingThroughDoor, movingThroughDoorChanged(), noBattles, noBattlesChanged(), playerCurDir, playerCurDirChanged(), playerJumpingYScrnCoords, playerJumpingYScrnCoordsChanged(), playerLastStopDir, playerLastStopDirChanged(), playerMoveDir, playerMoveDirChanged(), spinPlayer, spinPlayerChanged(), standingOnDoor, standingOnDoorChanged(), standingOnWarp, standingOnWarpChanged(), strengthOutsideBattle, strengthOutsideBattleChanged(), surfingAllowed, surfingAllowedChanged(), usedCardKey, usedCardKeyChanged(), usingLinkCable, usingLinkCableChanged(), walkBikeSurf, walkBikeSurfChanged(), xBlockCoord, xBlockCoordChanged(), xCoord, xCoordChanged(), xOffsetSinceLastSpecialWarp, xOffsetSinceLastSpecialWarpChanged(), yBlockCoord, yBlockCoordChanged(), yCoord, yCoordChanged(), yOffsetSinceLastSpecialWarp, and yOffsetSinceLastSpecialWarpChanged().
Referenced by load(), randomize(), and usingLinkCableChanged().
| void AreaPlayer::save | ( | SaveFile * | saveFile | ) |
Flatten the player state to the save.
Definition at line 121 of file areaplayer.cpp.
References battleEndedOrBlackout, finalLedgeJumping, flyOutofBattle, isBattle, isTrainerBattle, movingThroughDoor, noBattles, playerCurDir, playerJumpingYScrnCoords, playerLastStopDir, playerMoveDir, SaveFileToolset::setByte(), spinPlayer, standingOnDoor, standingOnWarp, strengthOutsideBattle, surfingAllowed, SaveFile::toolset, usedCardKey, usingLinkCable, walkBikeSurf, xBlockCoord, xCoord, xOffsetSinceLastSpecialWarp, yBlockCoord, yCoord, and yOffsetSinceLastSpecialWarp.
| void AreaPlayer::setTo | ( | MapDBEntry * | map, |
| int | x, | ||
| int | y ) |
Place the player on map at (x,y).
Definition at line 263 of file areaplayer.cpp.
References randomize().
Referenced by usingLinkCableChanged().
| void AreaPlayer::usingLinkCableChanged | ( | ) |
References randomize(), reset(), and setTo().
| void AreaPlayer::xBlockCoordChanged | ( | ) |
Referenced by load(), randomize(), and reset().
| void AreaPlayer::xCoordChanged | ( | ) |
Referenced by load(), randomize(), and reset().
| void AreaPlayer::yBlockCoordChanged | ( | ) |
Referenced by load(), randomize(), and reset().
| void AreaPlayer::yCoordChanged | ( | ) |
Referenced by load(), randomize(), and reset().
| bool AreaPlayer::battleEndedOrBlackout |
Definition at line 157 of file areaplayer.h.
| bool AreaPlayer::finalLedgeJumping |
Definition at line 172 of file areaplayer.h.
| bool AreaPlayer::flyOutofBattle |
Definition at line 151 of file areaplayer.h.
| bool AreaPlayer::isBattle |
| bool AreaPlayer::isTrainerBattle |
Definition at line 155 of file areaplayer.h.
| bool AreaPlayer::movingThroughDoor |
Definition at line 163 of file areaplayer.h.
| bool AreaPlayer::noBattles |
| int AreaPlayer::playerCurDir |
if the player is moving, the current direction if the player is not moving, the last the direction in which the player moved
Definition at line 139 of file areaplayer.h.
Referenced by load(), randomize(), reset(), and save().
| int AreaPlayer::playerJumpingYScrnCoords |
Definition at line 146 of file areaplayer.h.
| int AreaPlayer::playerLastStopDir |
the direction in which the player was moving before the player last stopped
Definition at line 135 of file areaplayer.h.
Referenced by load(), randomize(), reset(), and save().
| int AreaPlayer::playerMoveDir |
Move direction (raw bits per the table above).
Definition at line 132 of file areaplayer.h.
Referenced by load(), randomize(), reset(), and save().
| bool AreaPlayer::spinPlayer |
Definition at line 173 of file areaplayer.h.
| bool AreaPlayer::standingOnDoor |
Definition at line 162 of file areaplayer.h.
| bool AreaPlayer::standingOnWarp |
Definition at line 164 of file areaplayer.h.
| bool AreaPlayer::strengthOutsideBattle |
Definition at line 149 of file areaplayer.h.
| bool AreaPlayer::surfingAllowed |
Definition at line 150 of file areaplayer.h.
| bool AreaPlayer::usedCardKey |
Definition at line 174 of file areaplayer.h.
| bool AreaPlayer::usingLinkCable |
Definition at line 175 of file areaplayer.h.
| int AreaPlayer::walkBikeSurf |
Movement mode: 0x00 walking, 0x01 biking, 0x02 surfing.
Definition at line 171 of file areaplayer.h.
| int AreaPlayer::xBlockCoord |
Definition at line 145 of file areaplayer.h.
Referenced by load(), randomize(), reset(), and save().
| int AreaPlayer::xCoord |
Definition at line 143 of file areaplayer.h.
Referenced by load(), randomize(), reset(), and save().
| int AreaPlayer::xOffsetSinceLastSpecialWarp |
Definition at line 161 of file areaplayer.h.
| int AreaPlayer::yBlockCoord |
Definition at line 144 of file areaplayer.h.
Referenced by load(), randomize(), reset(), and save().
| int AreaPlayer::yCoord |
Definition at line 142 of file areaplayer.h.
Referenced by load(), randomize(), reset(), and save().
| int AreaPlayer::yOffsetSinceLastSpecialWarp |
Definition at line 160 of file areaplayer.h.