Pokered Save Editor 2
Pokemon Red & Blue save file editor - Qt 6 C++/QML
Loading...
Searching...
No Matches
AreaPlayer Class Reference

The player's position and movement/HM/battle/warp state on the map. More...

#include <areaplayer.h>

Inheritance diagram for AreaPlayer:
Collaboration diagram for AreaPlayer:

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

Detailed Description

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).

See also
Area, PlayerDir.

Definition at line 54 of file areaplayer.h.

Constructor & Destructor Documentation

◆ AreaPlayer()

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().

◆ ~AreaPlayer()

AreaPlayer::~AreaPlayer ( )
virtual

Definition at line 34 of file areaplayer.cpp.

Member Function Documentation

◆ battleEndedOrBlackoutChanged()

void AreaPlayer::battleEndedOrBlackoutChanged ( )

Referenced by load(), and reset().

◆ finalLedgeJumpingChanged()

void AreaPlayer::finalLedgeJumpingChanged ( )

Referenced by load(), and reset().

◆ flyOutofBattleChanged()

void AreaPlayer::flyOutofBattleChanged ( )

Referenced by load(), and reset().

◆ isBattleChanged()

void AreaPlayer::isBattleChanged ( )

Referenced by load(), and reset().

◆ isTrainerBattleChanged()

void AreaPlayer::isTrainerBattleChanged ( )

Referenced by load(), and reset().

◆ load()

◆ movingThroughDoorChanged()

void AreaPlayer::movingThroughDoorChanged ( )

Referenced by load(), and reset().

◆ noBattlesChanged()

void AreaPlayer::noBattlesChanged ( )

Referenced by load(), and reset().

◆ playerCurDirChanged()

void AreaPlayer::playerCurDirChanged ( )

Referenced by load(), randomize(), and reset().

◆ playerJumpingYScrnCoordsChanged()

void AreaPlayer::playerJumpingYScrnCoordsChanged ( )

Referenced by load(), and reset().

◆ playerLastStopDirChanged()

void AreaPlayer::playerLastStopDirChanged ( )

Referenced by load(), randomize(), and reset().

◆ playerMoveDirChanged()

protected::void AreaPlayer::playerMoveDirChanged ( )

Referenced by load(), randomize(), and reset().

◆ randomize()

◆ reset()

◆ save()

◆ setTo()

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().

◆ spinPlayerChanged()

void AreaPlayer::spinPlayerChanged ( )

Referenced by load(), and reset().

◆ standingOnDoorChanged()

void AreaPlayer::standingOnDoorChanged ( )

Referenced by load(), and reset().

◆ standingOnWarpChanged()

void AreaPlayer::standingOnWarpChanged ( )

Referenced by load(), and reset().

◆ strengthOutsideBattleChanged()

void AreaPlayer::strengthOutsideBattleChanged ( )

Referenced by load(), and reset().

◆ surfingAllowedChanged()

void AreaPlayer::surfingAllowedChanged ( )

Referenced by load(), and reset().

◆ usedCardKeyChanged()

void AreaPlayer::usedCardKeyChanged ( )

Referenced by load(), and reset().

◆ usingLinkCableChanged()

void AreaPlayer::usingLinkCableChanged ( )

References randomize(), reset(), and setTo().

Referenced by load(), and reset().

◆ walkBikeSurfChanged()

void AreaPlayer::walkBikeSurfChanged ( )

Referenced by load(), and reset().

◆ xBlockCoordChanged()

void AreaPlayer::xBlockCoordChanged ( )

Referenced by load(), randomize(), and reset().

◆ xCoordChanged()

void AreaPlayer::xCoordChanged ( )

Referenced by load(), randomize(), and reset().

◆ xOffsetSinceLastSpecialWarpChanged()

void AreaPlayer::xOffsetSinceLastSpecialWarpChanged ( )

Referenced by load(), and reset().

◆ yBlockCoordChanged()

void AreaPlayer::yBlockCoordChanged ( )

Referenced by load(), randomize(), and reset().

◆ yCoordChanged()

void AreaPlayer::yCoordChanged ( )

Referenced by load(), randomize(), and reset().

◆ yOffsetSinceLastSpecialWarpChanged()

void AreaPlayer::yOffsetSinceLastSpecialWarpChanged ( )

Referenced by load(), and reset().

Member Data Documentation

◆ battleEndedOrBlackout

bool AreaPlayer::battleEndedOrBlackout
See also
battleEndedOrBlackout property.

Definition at line 157 of file areaplayer.h.

Referenced by load(), reset(), and save().

◆ finalLedgeJumping

bool AreaPlayer::finalLedgeJumping
See also
finalLedgeJumping property.

Definition at line 172 of file areaplayer.h.

Referenced by load(), reset(), and save().

◆ flyOutofBattle

bool AreaPlayer::flyOutofBattle
See also
flyOutofBattle property.

Definition at line 151 of file areaplayer.h.

Referenced by load(), reset(), and save().

◆ isBattle

bool AreaPlayer::isBattle
See also
isBattle property.

Definition at line 154 of file areaplayer.h.

Referenced by load(), reset(), and save().

◆ isTrainerBattle

bool AreaPlayer::isTrainerBattle
See also
isTrainerBattle property.

Definition at line 155 of file areaplayer.h.

Referenced by load(), reset(), and save().

◆ movingThroughDoor

bool AreaPlayer::movingThroughDoor
See also
movingThroughDoor property.

Definition at line 163 of file areaplayer.h.

Referenced by load(), reset(), and save().

◆ noBattles

bool AreaPlayer::noBattles
See also
noBattles property.

Definition at line 156 of file areaplayer.h.

Referenced by load(), reset(), and save().

◆ playerCurDir

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().

◆ playerJumpingYScrnCoords

int AreaPlayer::playerJumpingYScrnCoords
See also
playerJumpingYScrnCoords property.

Definition at line 146 of file areaplayer.h.

Referenced by load(), reset(), and save().

◆ playerLastStopDir

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().

◆ playerMoveDir

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().

◆ spinPlayer

bool AreaPlayer::spinPlayer
See also
spinPlayer property.

Definition at line 173 of file areaplayer.h.

Referenced by load(), reset(), and save().

◆ standingOnDoor

bool AreaPlayer::standingOnDoor
See also
standingOnDoor property.

Definition at line 162 of file areaplayer.h.

Referenced by load(), reset(), and save().

◆ standingOnWarp

bool AreaPlayer::standingOnWarp
See also
standingOnWarp property.

Definition at line 164 of file areaplayer.h.

Referenced by load(), reset(), and save().

◆ strengthOutsideBattle

bool AreaPlayer::strengthOutsideBattle
See also
strengthOutsideBattle property.

Definition at line 149 of file areaplayer.h.

Referenced by load(), reset(), and save().

◆ surfingAllowed

bool AreaPlayer::surfingAllowed
See also
surfingAllowed property.

Definition at line 150 of file areaplayer.h.

Referenced by load(), reset(), and save().

◆ usedCardKey

bool AreaPlayer::usedCardKey
See also
usedCardKey property.

Definition at line 174 of file areaplayer.h.

Referenced by load(), reset(), and save().

◆ usingLinkCable

bool AreaPlayer::usingLinkCable
See also
usingLinkCable property.

Definition at line 175 of file areaplayer.h.

Referenced by load(), reset(), and save().

◆ walkBikeSurf

int AreaPlayer::walkBikeSurf

Movement mode: 0x00 walking, 0x01 biking, 0x02 surfing.

Definition at line 171 of file areaplayer.h.

Referenced by load(), reset(), and save().

◆ xBlockCoord

int AreaPlayer::xBlockCoord
See also
xBlockCoord property.

Definition at line 145 of file areaplayer.h.

Referenced by load(), randomize(), reset(), and save().

◆ xCoord

int AreaPlayer::xCoord
See also
xCoord property.

Definition at line 143 of file areaplayer.h.

Referenced by load(), randomize(), reset(), and save().

◆ xOffsetSinceLastSpecialWarp

int AreaPlayer::xOffsetSinceLastSpecialWarp
See also
xOffsetSinceLastSpecialWarp property.

Definition at line 161 of file areaplayer.h.

Referenced by load(), reset(), and save().

◆ yBlockCoord

int AreaPlayer::yBlockCoord
See also
yBlockCoord property.

Definition at line 144 of file areaplayer.h.

Referenced by load(), randomize(), reset(), and save().

◆ yCoord

int AreaPlayer::yCoord
See also
yCoord property.

Definition at line 142 of file areaplayer.h.

Referenced by load(), randomize(), reset(), and save().

◆ yOffsetSinceLastSpecialWarp

int AreaPlayer::yOffsetSinceLastSpecialWarp
See also
yOffsetSinceLastSpecialWarp property.

Definition at line 160 of file areaplayer.h.

Referenced by load(), reset(), and save().


The documentation for this class was generated from the following files: