/*========================================================================= player.h Author: PKG Created: Project: Spongebob Purpose: Copyright (c) 2001 Climax Development Ltd ===========================================================================*/ #ifndef __PLAYER_PLAYER_H__ #define __PLAYER_PLAYER_H__ /*---------------------------------------------------------------------- Includes -------- */ #ifndef __THING_THING_H__ #include "thing/thing.h" #endif #include "gfx/actor.h" #ifndef __DATA_STRUCTS_HEADER__ #include #endif #ifndef __PLAYER_PSTATES_H__ #include "player\pstates.h" #endif #ifndef __SOUND_SOUND_H__ #include "sound\sound.h" #endif /* Std Lib ------- */ /*---------------------------------------------------------------------- Tyepdefs && Defines ------------------- */ typedef enum { PLAYER_MODE_BASICUNARMED, PLAYER_MODE_FULLUNARMED, PLAYER_MODE_BALLOON, PLAYER_MODE_BUBBLE_MIXTURE, PLAYER_MODE_NET, PLAYER_MODE_CORALBLOWER, PLAYER_MODE_JELLY_LAUNCHER, PLAYER_MODE_DEAD, PLAYER_MODE_FLY, PLAYER_MODE_CART, NUM_PLAYERMODES, }PLAYER_MODE; typedef enum { STATE_IDLE, STATE_IDLETEETER, STATE_JUMP, STATE_SPRINGUP, STATE_RUN, STATE_FALL, STATE_FALLFAR, STATE_HITGROUND, STATE_BUTTBOUNCE, STATE_BUTTFALL, STATE_BUTTLAND, STATE_BUTTBOUNCEUP, STATE_SOAKUP, STATE_GETUP, STATE_LOOKDOWN, STATE_LOOKDOWNRELAX, STATE_LOOKUP, STATE_LOOKUPRELAX, STATE_JUMPBACK, STATE_CART, STATE_FLOAT, NUM_STATES, }PLAYER_STATE; typedef enum { PLAYER_ADDON_NET, PLAYER_ADDON_CORALBLOWER, PLAYER_ADDON_JELLYLAUNCHER, PLAYER_ADDON_BUBBLEWAND, PLAYER_ADDON_JELLYFISHINNET, PLAYER_ADDON_GLOVE, NUM_PLAYER_ADDONS, NO_ADDON, }PLAYER_ADDONS; enum { FACING_LEFT=+1, FACING_RIGHT=-1, }; typedef enum { DAMAGE__NONE, // put in so that an item can push the user but not damage them DAMAGE__FALL, DAMAGE__ELECTROCUTION, DAMAGE__LAVA, DAMAGE__HIT_ENEMY, DAMAGE__SHOCK_ENEMY, DAMAGE__GAS_ENEMY, DAMAGE__POISON_ENEMY, DAMAGE__SWALLOW_ENEMY, DAMAGE__PINCH_ENEMY, DAMAGE__SQUASH_ENEMY, DAMAGE__BURN_ENEMY, DAMAGE__BITE_ENEMY, DAMAGE__COLLISION_DAMAGE, DAMAGE__KILL_OUTRIGHT, }DAMAGE_TYPE; typedef enum { DEATHTYPE__NORMAL, DEATHTYPE__DRYUP, DEATHTYPE__SQUASH, DEATHTYPE__LIQUID, } DEATH_TYPE; typedef enum { REACT__LEFT=-1, REACT__UP=0, REACT__RIGHT=+1, REACT__GET_DIRECTION_FROM_THING=123, REACT__NO_REACTION=234, }REACT_DIRECTION; // The input from the control pad is remapped to this rather than keeping it in the // normal pad format. This allows us to store all input in one byte ( as opposed to // two bytes ) for demo recording and means that the player state codes don't have // to keep using CPadConfig to remap the controls internally. typedef enum { PI_NONE =0, PI_UP =1<<0, PI_DOWN =1<<1, PI_LEFT =1<<2, PI_RIGHT =1<<3, PI_JUMP =1<<4, PI_FIRE =1<<5, PI_CATCH =1<<6, PI_WEAPONCHANGE =1<<7, }PLAYERINPUT; // For getAttackState() typedef enum { ATTACK_STATE__NONE, ATTACK_STATE__KARATE, ATTACK_STATE__BUTT_BOUNCE, } ATTACK_STATE; // Special anim that means SB will not get drawn // Just pass it to setAnimNo() like a normal anim #define ANIM_SPONGEBOB_DONOTDRAW -1 /*---------------------------------------------------------------------- Structure defintions -------------------- */ class CPlayer : public CPlayerThing { public: enum { MAX_LIVES=99, WATERLEVELSHIFT=5, WATERMAXHEALTH=(255<MAX_BUBBLE_BLOWER_AMMO)m_bubbleAmmo=MAX_BUBBLE_BLOWER_AMMO;} void useOneBubble() {m_bubbleAmmo--;} int getBubbleAmmo() {return m_bubbleAmmo;} void giveJellyAmmo() {m_jellyAmmo+=6;if(m_jellyAmmo>MAX_JELLY_LAUNCHER_AMMO)m_jellyAmmo=MAX_JELLY_LAUNCHER_AMMO;} void useOneJelly() {m_jellyAmmo--;} int getJellyAmmo() {return m_jellyAmmo;} void giveJellyFishAmmo(u32 _colour); void useOneJellyFishAmmo(); int isJellyFishAmmoFull(); int getJellyFishAmmo(); u32 getColourOfNextJellyfishAmmo(); void setIsInWater(int _in) {m_isInWater=_in;m_helmetSoundTimer=0;} int getIsInWater() {return m_isInWater;} int getIsHelmetFullSoICanStopSoakingUp() {return m_healthWaterLevel==WATERMAXHEALTH;} int getIsHelmetSoFullThatIDontNeedToSoakUp(){return m_healthWaterLevel>=WATERMINSOAKUPLEVEL;} int isHoldingNet() {return m_currentMode==PLAYER_MODE_NET;} void justButtBouncedABadGuy(); // Also fugly.. :/ void setFloating(); private: int m_squeakyBootsTimer; int m_invincibilityRingTimer; int m_divingHelmet; int m_bubbleAmmo; int m_jellyAmmo; int m_jellyfishAmmoCount; u32 m_jellyfishAmmoColours[MAX_JELLFISH_IN_NET]; int m_isInWater; // Platforms public: void setPlatform(CThing *_newPlatform); void clearPlatform(); CThing *isOnPlatform() {return m_platform;} private: CThing *m_platform; // Player collision size public: enum { COLSIZE_BASE_WIDTH=30, COLSIZE_BASE_HEIGHT=60, HEIGHT_FOR_HEAD_COLLISION=64, }; void resetPlayerCollisionSizeToBase(); void setPlayerCollisionSize(int _x,int _y,int _w,int _h); void getPlayerCollisionSize(int *_x,int *_y,int *_w,int *_h); // Graphical resources public: class FontBank *getFontBank() {return m_fontBank;} class ScalableFontBank *getScalableFontBank() {return m_scalableFontBank;} enum { SB_UI_XBASE=40, SB_UI_YBASE=40, SB_UI_GAP_FROM_SPAT_COUNT_TO_PICKUPS=50, SB_UI_GAP_BETWEEN_ITEMS=5, POWERUPUI_ICONX=400, POWERUPUI_ICONY=40, POWERUPUI_TEXTX=440, POWERUPUI_TEXTY=37, POWERUPUI_OT=0, }; private: class FontBank *m_fontBank; class ScalableFontBank *m_scalableFontBank; public: // Movement tracking for barrels s32 getMovement() {return( m_xMove );} private: s32 m_xMove; }; /*---------------------------------------------------------------------- Globals ------- */ /*---------------------------------------------------------------------- Functions --------- */ /*---------------------------------------------------------------------- */ #endif /* __PLAYER_PLAYER_H__ */ /*=========================================================================== end */