Cavestory Mod API
|
A networking player. More...
#include <CaveNet_ExportedTypes.h>
Public Member Functions | |
NetPlayer (NetClient *client) | |
void | ClearPredictionFrames () |
Clear all prediction frames. | |
void | AddPredictionFrame () |
Remember the current playerstate for movement prediction. | |
bool | ApplyClosestPredictionFrame (unsigned long long int iGlobalTime, int iClientX, int iClientY) |
Apply the closest frame to the given global timestamp. More... | |
NetPlayerFrameInfo * | FindClosestPredictionFrame (unsigned long long int iGlobalTime, int iClientX, int iClientY) |
Get the closest movement frame to the given timestamp. More... | |
void | EndAnimation () |
End the current animation. | |
bool | BeginFishing () |
Begin fishing. More... | |
bool | Tackle (int level) |
Begin tackling. More... | |
bool | TeleportIn () |
Teleports the player in. More... | |
bool | TeleportOut () |
Teleports the player out. More... | |
bool | BecomeDead () |
Death animation. More... | |
bool | BecomeCarried (CaveNet::DataStructures::NetClient *pClient) |
Become a carried NPC. More... | |
bool | IsAnimating () |
Check to see if this player is currently being animated. More... | |
void | Damage (int iDamage, bool bExactDamage=false, PlayerDeathType iDamageType=PlayerDeathType::DEATHTYPE_UNKNOWN, CaveNet::DataStructures::NetClient *pKillerClient=NULL, NPCHAR *pKillerNpc=NULL) |
Deal damage to this player. More... | |
void | Act_Camera (bool bKey) |
Process the camera. More... | |
void | AirProcess () |
Process underwater air. | |
int | GetPlayerState () |
Get the playerstate for this player. More... | |
unsigned long long int | GetPlayerStateFlags () |
Get the playerstate flags for this player. More... | |
PlayerStateAnimator_OutputType | GetPlayerStateAnimatorType () |
Returns the animator type for this player. More... | |
bool | IsPlayerState (int iStateType) |
Check to see if this player is in the specified state. More... | |
unsigned long long int | GetPlayerStateFlagsFromCarrier () |
Get the playerstate flags from the player we're being carried by. More... | |
bool | IsMaxExp () |
Check to see if this player has max EXP in their held weapon. More... | |
bool | CanBeRevived () |
Check to see if this player can be revived right now. More... | |
int | CanShoot () |
Check to see if this player can shoot. More... | |
void | GetTrg () |
Update this client's gameKey, gameKeyTrg, key and keyTrg. | |
void | Act (bool bKey) |
Tick this player's movement logic. | |
void | AddExp (int x) |
void | AddLife (int x) |
void | SetLife (int x) |
void | AddMaxLife (int x) |
void | SetMaxLife (int x) |
void | SetPosition (int x, int y) |
void | ShowMyChar (bool val) |
Show/hide this player. More... | |
void | Animate (bool bKey) |
void | Revive (bool restoreControl, int health=1, NetClient *pSavior=NULL, bool bAnnounce=true) |
Revive this player. More... | |
void | Kill (bool bResetVelocity=true, PlayerDeathType iDeathType=PlayerDeathType::DEATHTYPE_UNKNOWN, NPCHAR *pKillerNpc=NULL, CaveNet::DataStructures::NetClient *pKillerClient=NULL) |
Kill this player. More... | |
void | ResetFlag () |
Reset the collision flags for this player. | |
void | HitMyCharMapNoclip () |
Player collision checking against map tiles whilst in noclip mode. | |
void | HitMyCharMap () |
Player collision checking against map tiles. | |
void | HitMyCharNpChar () |
Player collision checking against NPCs. | |
void | HitMyCharBullet () |
Player collision checking against bullets. | |
void | HitMyCharBoss () |
Player collision checking against bosses. | |
void | Put (int fx, int fy) |
Draw this player. More... | |
void | StartAI () |
Start AI routine (if this is a bot). | |
void | EndAI () |
End AI routine (if this is a bot). | |
void | ProcessAI () |
loop | |
NetClient * | GetClient () |
Get the client that owns this player. More... | |
Public Attributes | |
NetPlayerFrameInfo * | mMoveHistory |
Movement prediction information. | |
unsigned int | mMoveHistoryCount |
Stores how many movement frames are stored in mMoveHistory. | |
struct { | |
AI_Brain * brain | |
AI Brain. | |
bool enabled | |
AI enabled. | |
} | m_Ai |
Player data. | |
struct { | |
MYCHAR npc | |
This player's MYCHAR representation. | |
bool dead | |
Whether this client is dead or not. | |
} | m_Player |
Protected Attributes | |
NetClient * | mClient |
Friends | |
class | AI_Brain |
class | AI_ActionBase |
class | NetClient |
A networking player.
Handles a client's player object.
void CaveNet::DataStructures::NetPlayer::Act_Camera | ( | bool | bKey | ) |
Process the camera.
bKey | Whether input is allowed or not |
void CaveNet::DataStructures::NetPlayer::AddExp | ( | int | x | ) |
x |
void CaveNet::DataStructures::NetPlayer::AddLife | ( | int | x | ) |
x |
void CaveNet::DataStructures::NetPlayer::AddMaxLife | ( | int | x | ) |
x |
void CaveNet::DataStructures::NetPlayer::Animate | ( | bool | bKey | ) |
bKey | Allow control |
bool CaveNet::DataStructures::NetPlayer::ApplyClosestPredictionFrame | ( | unsigned long long int | iGlobalTime, |
int | iClientX, | ||
int | iClientY | ||
) |
Apply the closest frame to the given global timestamp.
iGlobalTime | The time that the frame should be the closest to. |
iClientX | The client's X position. |
iClientY | The client's Y position. |
bool CaveNet::DataStructures::NetPlayer::BecomeCarried | ( | CaveNet::DataStructures::NetClient * | pClient | ) |
Become a carried NPC.
bool CaveNet::DataStructures::NetPlayer::BecomeDead | ( | ) |
Death animation.
bool CaveNet::DataStructures::NetPlayer::BeginFishing | ( | ) |
Begin fishing.
bool CaveNet::DataStructures::NetPlayer::CanBeRevived | ( | ) |
Check to see if this player can be revived right now.
int CaveNet::DataStructures::NetPlayer::CanShoot | ( | ) |
Check to see if this player can shoot.
void CaveNet::DataStructures::NetPlayer::Damage | ( | int | iDamage, |
bool | bExactDamage = false , |
||
PlayerDeathType | iDamageType = PlayerDeathType::DEATHTYPE_UNKNOWN , |
||
CaveNet::DataStructures::NetClient * | pKillerClient = NULL , |
||
NPCHAR * | pKillerNpc = NULL |
||
) |
Deal damage to this player.
This method can kill the player.
damage | The amount of damage to deal. |
bExactDamage | If set to true, then the damage dealt is not run through any modifier settings. |
iDamageType | The type of damage done. |
pKillerClient | The client who is damaging us. |
pKillerNpc | The NPC who is damaging us. |
NetPlayerFrameInfo* CaveNet::DataStructures::NetPlayer::FindClosestPredictionFrame | ( | unsigned long long int | iGlobalTime, |
int | iClientX, | ||
int | iClientY | ||
) |
Get the closest movement frame to the given timestamp.
iGlobalTime | The time that the frame should be the closest to. |
iClientX | The client's X position. |
iClientY | The client's Y position. |
|
inline |
Get the client that owns this player.
int CaveNet::DataStructures::NetPlayer::GetPlayerState | ( | ) |
Get the playerstate for this player.
PlayerStateAnimator_OutputType CaveNet::DataStructures::NetPlayer::GetPlayerStateAnimatorType | ( | ) |
Returns the animator type for this player.
unsigned long long int CaveNet::DataStructures::NetPlayer::GetPlayerStateFlags | ( | ) |
Get the playerstate flags for this player.
unsigned long long int CaveNet::DataStructures::NetPlayer::GetPlayerStateFlagsFromCarrier | ( | ) |
Get the playerstate flags from the player we're being carried by.
|
inline |
Check to see if this player is currently being animated.
bool CaveNet::DataStructures::NetPlayer::IsMaxExp | ( | ) |
Check to see if this player has max EXP in their held weapon.
|
inline |
Check to see if this player is in the specified state.
iStateType | The state to check. |
void CaveNet::DataStructures::NetPlayer::Kill | ( | bool | bResetVelocity = true , |
PlayerDeathType | iDeathType = PlayerDeathType::DEATHTYPE_UNKNOWN , |
||
NPCHAR * | pKillerNpc = NULL , |
||
CaveNet::DataStructures::NetClient * | pKillerClient = NULL |
||
) |
Kill this player.
bResetVelocity | Reset the player's velocity to zero. |
void CaveNet::DataStructures::NetPlayer::Put | ( | int | fx, |
int | fy | ||
) |
Draw this player.
fx | Camera X |
fy | Camera Y |
void CaveNet::DataStructures::NetPlayer::Revive | ( | bool | restoreControl, |
int | health = 1 , |
||
NetClient * | pSavior = NULL , |
||
bool | bAnnounce = true |
||
) |
Revive this player.
restoreControl | Restore control after revival. |
health | How much health to revive them with. |
pSavior | Our saviour. Can be NULL. |
bAnnounce | Announce this revival to everyone on the server. |
void CaveNet::DataStructures::NetPlayer::SetLife | ( | int | x | ) |
x |
void CaveNet::DataStructures::NetPlayer::SetMaxLife | ( | int | x | ) |
x |
void CaveNet::DataStructures::NetPlayer::SetPosition | ( | int | x, |
int | y | ||
) |
x | |
y |
void CaveNet::DataStructures::NetPlayer::ShowMyChar | ( | bool | val | ) |
Show/hide this player.
val | Boolean |
bool CaveNet::DataStructures::NetPlayer::Tackle | ( | int | level | ) |
Begin tackling.
bool CaveNet::DataStructures::NetPlayer::TeleportIn | ( | ) |
Teleports the player in.
bool CaveNet::DataStructures::NetPlayer::TeleportOut | ( | ) |
Teleports the player out.