Cavestory Mod API
Functions
PlayerStates

Functions

CAVESTORY_MOD_API void SetPlayerState (SafeClientInterface *pInterface, int iStateType=-1, bool bForce=false)
 Set the state of an interface. More...
 
CAVESTORY_MOD_API int GetPlayerState (SafeClientInterface *pInterface)
 Get the current playerstate of an interface. More...
 
bool IsPlayerState (MYCHAR *pChar, int iStateType)
 Check to see if a player is in the specified state. More...
 
CAVESTORY_MOD_API unsigned int GetPlayerStateFlags (MYCHAR *pChar)
 Get the flags for a player's state. More...
 
CAVESTORY_MOD_API PlayerStateAnimator_OutputType GetPlayerStateAnimatorType (MYCHAR *pChar)
 Get the return type of a player's state's animate function. More...
 
CAVESTORY_MOD_API unsigned int GetPlayerStateFlagsFromCarrier (MYCHAR *pChar)
 Get the flags from a player's carrier's playerstate. More...
 
CAVESTORY_MOD_API int FindPlayerStateByName (const char *pName)
 Find a player state by its name. More...
 
CAVESTORY_MOD_API int GetStateByUnitIndex (int iUnitIndex)
 Transform a unit index into a player state index. More...
 
CAVESTORY_MOD_API int GetUnitIndexByState (int iPlayerState)
 Transform a player state index into a unit index. More...
 

Detailed Description

Function Documentation

◆ FindPlayerStateByName()

CAVESTORY_MOD_API int FindPlayerStateByName ( const char *  pName)

Find a player state by its name.

Parameters
pNameThe name of the state.
Returns
Returns the index of the playerstate in question on success, otherwise returns -1.

◆ GetPlayerState()

CAVESTORY_MOD_API int GetPlayerState ( SafeClientInterface pInterface)

Get the current playerstate of an interface.

Parameters
pInterfaceThe interface to get the state from.
Returns
Returns the player state.

◆ GetPlayerStateAnimatorType()

CAVESTORY_MOD_API PlayerStateAnimator_OutputType GetPlayerStateAnimatorType ( MYCHAR pChar)

Get the return type of a player's state's animate function.

Parameters
pCharThe player to get the state from.
Returns
Returns the return type.

◆ GetPlayerStateFlags()

CAVESTORY_MOD_API unsigned int GetPlayerStateFlags ( MYCHAR pChar)

Get the flags for a player's state.

Parameters
pCharThe player to get the state from.
Returns
Returns the flags on success, otherwise returns 0 if the player is in the 'Normal' state.

◆ GetPlayerStateFlagsFromCarrier()

CAVESTORY_MOD_API unsigned int GetPlayerStateFlagsFromCarrier ( MYCHAR pChar)

Get the flags from a player's carrier's playerstate.

Parameters
pCharThe player to get the carrier from.
Returns
Returns the flags on success, otherwise returns 0 if the player's carrier is in the 'Normal' state / is not being carried.

◆ GetStateByUnitIndex()

CAVESTORY_MOD_API int GetStateByUnitIndex ( int  iUnitIndex)

Transform a unit index into a player state index.

Parameters
iUnitIndexThe unit index to transform.
Returns
Returns a player state index on success, -1 on failure.

◆ GetUnitIndexByState()

CAVESTORY_MOD_API int GetUnitIndexByState ( int  iPlayerState)

Transform a player state index into a unit index.

Parameters
iPlayerStateThe player state to transform.
Returns
Returns a unit index on success, -1 on failure.

◆ IsPlayerState()

bool IsPlayerState ( MYCHAR pChar,
int  iStateType 
)
inline

Check to see if a player is in the specified state.

Parameters
pCharThe character to check for.
iStateTypeThe state to check.
Returns
Returns the player state.

◆ SetPlayerState()

CAVESTORY_MOD_API void SetPlayerState ( SafeClientInterface pInterface,
int  iStateType = -1,
bool  bForce = false 
)

Set the state of an interface.

Parameters
pInterfaceThe interface to apply the state to.
iStateTypeThe type of state to set the player to. Find this in the 'PlayerStates' namespace.
bForceForce set the state, regardless of whether the given interface is already set to the given state type.