SBSPSS/source/player/player.h

549 lines
14 KiB
C
Raw Normal View History

2001-01-16 20:27:14 +01:00
/*=========================================================================
player.h
Author: PKG
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
2001-01-09 21:38:20 +01:00
2001-01-16 17:20:45 +01:00
#ifndef __PLAYER_PLAYER_H__
2001-01-16 20:27:14 +01:00
#define __PLAYER_PLAYER_H__
2001-01-09 21:38:20 +01:00
2001-01-16 20:27:14 +01:00
/*----------------------------------------------------------------------
Includes
-------- */
2001-02-27 17:59:50 +01:00
#ifndef __THING_THING_H__
#include "thing/thing.h"
2001-01-16 20:27:14 +01:00
#endif
2001-04-01 22:22:49 +02:00
#include "gfx/actor.h"
2001-01-09 21:38:20 +01:00
2001-01-16 20:27:14 +01:00
#ifndef __DATA_STRUCTS_HEADER__
#include <dstructs.h>
#endif
2001-01-15 23:09:47 +01:00
2001-01-20 00:37:40 +01:00
#ifndef __PLAYER_PSTATES_H__
#include "player\pstates.h"
#endif
2001-02-01 18:01:12 +01:00
#ifndef __SOUND_SOUND_H__
#include "sound\sound.h"
#endif
2001-01-16 20:27:14 +01:00
/* Std Lib
------- */
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
2001-02-27 23:06:24 +01:00
typedef enum
{
PLAYER_MODE_BASICUNARMED,
2001-03-25 23:33:20 +02:00
PLAYER_MODE_FULLUNARMED,
2001-03-25 22:36:28 +02:00
PLAYER_MODE_BALLOON,
2001-03-30 19:47:00 +02:00
PLAYER_MODE_BUBBLE_MIXTURE,
2001-03-31 20:22:38 +02:00
PLAYER_MODE_NET,
2001-03-30 19:47:00 +02:00
PLAYER_MODE_CORALBLOWER,
2001-04-03 23:36:35 +02:00
PLAYER_MODE_JELLY_LAUNCHER,
2001-03-02 17:02:30 +01:00
2001-03-25 23:33:20 +02:00
PLAYER_MODE_DEAD,
2001-02-27 23:06:24 +01:00
PLAYER_MODE_FLY,
2001-06-12 18:28:39 +02:00
PLAYER_MODE_CART,
2001-07-03 22:49:30 +02:00
PLAYER_MODE_SWALLOW,
2001-06-12 18:28:39 +02:00
2001-02-27 23:06:24 +01:00
NUM_PLAYERMODES,
}PLAYER_MODE;
2001-01-20 00:37:40 +01:00
typedef enum
{
STATE_IDLE,
2001-02-06 18:15:28 +01:00
STATE_IDLETEETER,
2001-01-20 00:37:40 +01:00
STATE_JUMP,
2001-05-01 20:39:41 +02:00
STATE_SPRINGUP,
2001-01-20 00:37:40 +01:00
STATE_RUN,
STATE_FALL,
STATE_FALLFAR,
2001-04-04 17:40:38 +02:00
STATE_HITGROUND,
2001-01-22 22:02:59 +01:00
STATE_BUTTBOUNCE,
STATE_BUTTFALL,
STATE_BUTTLAND,
2001-05-11 22:56:43 +02:00
STATE_BUTTBOUNCEUP,
2001-01-22 22:02:59 +01:00
STATE_SOAKUP,
STATE_GETUP,
2001-05-29 17:54:26 +02:00
STATE_LOOKDOWN,
STATE_LOOKDOWNRELAX,
2001-06-19 17:23:50 +02:00
STATE_LOOKUP,
STATE_LOOKUPRELAX,
2001-05-11 21:49:41 +02:00
STATE_JUMPBACK,
2001-06-12 18:28:39 +02:00
STATE_CART,
2001-06-15 23:24:14 +02:00
STATE_FLOAT,
2001-07-03 00:57:52 +02:00
STATE_CELEBRATE,
2001-07-03 22:49:30 +02:00
STATE_SWALLOW,
2001-02-06 22:09:45 +01:00
2001-01-20 00:37:40 +01:00
NUM_STATES,
}PLAYER_STATE;
2001-04-30 23:27:46 +02:00
typedef enum
{
PLAYER_ADDON_NET,
PLAYER_ADDON_CORALBLOWER,
PLAYER_ADDON_JELLYLAUNCHER,
PLAYER_ADDON_BUBBLEWAND,
2001-05-10 16:35:35 +02:00
PLAYER_ADDON_JELLYFISHINNET,
2001-05-10 23:32:18 +02:00
PLAYER_ADDON_GLOVE,
2001-04-30 23:27:46 +02:00
NUM_PLAYER_ADDONS,
NO_ADDON,
}PLAYER_ADDONS;
2001-01-20 00:37:40 +01:00
enum
{
FACING_LEFT=+1,
FACING_RIGHT=-1,
};
2001-02-06 22:09:45 +01:00
typedef enum
{
2001-03-05 22:11:51 +01:00
DAMAGE__NONE, // put in so that an item can push the user but not damage them
2001-02-06 22:09:45 +01:00
DAMAGE__FALL,
DAMAGE__ELECTROCUTION,
DAMAGE__LAVA,
2001-02-27 17:59:50 +01:00
DAMAGE__HIT_ENEMY,
2001-03-05 22:11:51 +01:00
DAMAGE__SHOCK_ENEMY,
DAMAGE__GAS_ENEMY,
DAMAGE__POISON_ENEMY,
DAMAGE__SWALLOW_ENEMY,
DAMAGE__PINCH_ENEMY,
DAMAGE__SQUASH_ENEMY,
DAMAGE__BURN_ENEMY,
DAMAGE__BITE_ENEMY,
2001-05-14 19:04:13 +02:00
DAMAGE__COLLISION_DAMAGE,
2001-05-10 21:54:07 +02:00
DAMAGE__KILL_OUTRIGHT,
2001-02-06 22:09:45 +01:00
}DAMAGE_TYPE;
2001-05-17 20:42:59 +02:00
typedef enum
{
DEATHTYPE__NORMAL,
DEATHTYPE__DRYUP,
DEATHTYPE__SQUASH,
2001-06-04 16:41:56 +02:00
DEATHTYPE__LIQUID,
2001-07-18 01:26:21 +02:00
DEATHTYPE__FALL_TO_DEATH,
2001-05-17 20:42:59 +02:00
} DEATH_TYPE;
2001-05-11 21:49:41 +02:00
typedef enum
{
REACT__LEFT=-1,
REACT__UP=0,
REACT__RIGHT=+1,
REACT__GET_DIRECTION_FROM_THING=123,
REACT__NO_REACTION=234,
}REACT_DIRECTION;
2001-01-20 00:37:40 +01:00
2001-02-09 18:01:04 +01:00
// 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,
2001-05-10 00:12:00 +02:00
PI_FIRE =1<<5,
PI_CATCH =1<<6,
2001-05-18 23:03:51 +02:00
PI_WEAPONCHANGE =1<<7,
2001-02-09 18:01:04 +01:00
}PLAYERINPUT;
2001-04-12 20:48:33 +02:00
// For getAttackState()
typedef enum
{
ATTACK_STATE__NONE,
ATTACK_STATE__KARATE,
ATTACK_STATE__BUTT_BOUNCE,
} ATTACK_STATE;
2001-06-21 22:51:55 +02:00
// Special anim that means SB will not get drawn
// Just pass it to setAnimNo() like a normal anim
#define ANIM_SPONGEBOB_DONOTDRAW -1
2001-01-16 20:27:14 +01:00
/*----------------------------------------------------------------------
Structure defintions
-------------------- */
2001-01-12 23:40:39 +01:00
2001-02-26 21:42:25 +01:00
class CPlayer : public CPlayerThing
2001-01-09 21:38:20 +01:00
{
public:
2001-01-22 22:02:59 +01:00
enum
2001-01-20 00:37:40 +01:00
{
2001-03-23 21:09:14 +01:00
MAX_LIVES=99,
2001-05-04 01:45:28 +02:00
2001-05-10 23:32:18 +02:00
WATERLEVELSHIFT=5,
2001-05-04 01:45:28 +02:00
WATERMAXHEALTH=(255<<WATERLEVELSHIFT),
2001-06-14 17:19:57 +02:00
WATERMINSOAKUPLEVEL=(245<<WATERLEVELSHIFT), // SB won't auto soak unless water is lower than this
2001-06-22 18:22:03 +02:00
WATER_COUNTER_STARTSCALE=50, // Scale of text
WATER_COUNTER_ENDSCALE=511,
WATER_COUNTER_R1=59, // Colour of text
WATER_COUNTER_G1=118,
WATER_COUNTER_B1=253,
WATER_COUNTER_R2=255,
WATER_COUNTER_G2=28,
WATER_COUNTER_B2=17,
WATER_COUNTER_SECONDTIME=15<<CPlayer::WATERLEVELSHIFT, // Each digit lasts this many frames..
WATER_COUNTER_MOVINGTIME=5<<CPlayer::WATERLEVELSHIFT, // ..and spends this longing moving into position
2001-01-22 22:02:59 +01:00
};
2001-01-20 00:37:40 +01:00
2001-05-03 20:42:56 +02:00
typedef struct
{
s16 x1,y1;
s16 x2,y2;
} CameraBox;
2001-02-09 18:01:04 +01:00
virtual void init();
virtual void shutdown();
virtual void think(int _frames);
2001-06-25 21:57:44 +02:00
void detectHazardousSurface();
2001-02-09 18:01:04 +01:00
virtual void render();
2001-05-15 18:48:29 +02:00
virtual int dontKillDuringLevelRespawn() {return true;}
2001-07-23 21:26:37 +02:00
virtual void shove(DVECTOR const &move);
2001-05-24 22:00:19 +02:00
void moveLeft(); // This is only for camera scroll right now
2001-05-13 21:28:48 +02:00
void moveRight(); // " " " " "
2001-05-24 22:00:19 +02:00
void fall(); // " " " " "
void buttFall(); // " " " " "
2001-04-25 20:38:33 +02:00
virtual int moveVertical(int _moveDistance);
virtual int moveHorizontal(int _moveDistance);
2001-08-17 18:04:11 +02:00
void forceFall();
2001-01-15 23:09:47 +01:00
2001-05-01 23:43:14 +02:00
int isTryingToConversateWithFriend() {return m_allowConversation;}
2001-07-23 21:26:37 +02:00
DVECTOR const &getCameraPos() {return m_cameraPos;}
2001-07-21 20:39:43 +02:00
void setCartCam(int _flag) {m_cartCamActive=_flag;}
2001-07-21 21:14:40 +02:00
void setReverseCameraMovement(int _flag) {m_reverseCameraMovement=_flag;}
2001-05-03 20:42:56 +02:00
void setCameraBox(CameraBox _cameraBox);
2001-07-23 21:26:37 +02:00
void setRespawnPos(DVECTOR const &_respawn) {m_respawnPos=_respawn;}
void setRespawnPosAndRingTelephone(DVECTOR const &_respawn);
2001-02-06 18:15:28 +01:00
2001-05-10 16:35:35 +02:00
// This isn't funny anymore.. :(
2001-03-29 21:19:33 +02:00
int getHeightFromGround(int _x,int _y,int _maxHeight=32);
2001-05-10 16:35:35 +02:00
int getHeightFromPlatformNoGround(int _x,int _y,int _maxHeight=32);
2001-04-07 21:52:45 +02:00
int getHeightFromGroundNoPlatform(int _x,int _y,int _maxHeight=32);
2001-03-29 21:19:33 +02:00
2001-07-26 22:00:55 +02:00
void setLedgeLookAhead(int _lookAhead);
2001-04-17 22:09:33 +02:00
2001-03-01 21:30:25 +01:00
void addLife();
2001-07-27 17:19:36 +02:00
void addSpatula(int Count=1);
2001-06-14 17:19:57 +02:00
int getSpatulasHeld() {return m_numSpatulasHeld;}
2001-04-12 20:48:33 +02:00
ATTACK_STATE getAttackState();
2001-04-20 23:29:14 +02:00
int isRecoveringFromHit() {return m_invincibleFrameCount!=0||m_currentMode==PLAYER_MODE_DEAD;}
2001-08-16 20:26:23 +02:00
int isDead() {return m_currentMode==PLAYER_MODE_DEAD;}
int wasLastHitElectrical() {return m_recoveringFromElectrocution;}
2001-03-01 21:30:25 +01:00
2001-04-30 23:27:46 +02:00
void registerAddon(PLAYER_ADDONS _addon);
2001-05-01 18:26:31 +02:00
DVECTOR *getMoveVelocity() {return &m_moveVelocity;}
void setMoveVelocity(const DVECTOR *_moveVelocity) {m_moveVelocity=*_moveVelocity;}
2001-04-30 23:27:46 +02:00
2001-02-27 23:06:24 +01:00
public:
2001-01-26 19:20:41 +01:00
void setMode(PLAYER_MODE _mode);
2001-07-03 22:49:30 +02:00
PLAYER_MODE getMode() {return m_currentMode;}
2001-01-20 00:37:40 +01:00
int getFacing();
2001-01-16 20:27:14 +01:00
void setFacing(int _facing);
2001-01-20 00:37:40 +01:00
int getAnimFrame();
void setAnimFrame(int _animFrame);
int getAnimFrameCount();
int getAnimNo();
void setAnimNo(int _animNo);
2001-05-01 20:39:41 +02:00
2001-06-14 23:22:40 +02:00
void springPlayerUp(int _springHeight=55); // Springy branches
void floatPlayerUp(); // Geysers
2001-05-02 20:11:29 +02:00
void teleportTo(int _x,int _y);
2001-04-19 01:37:52 +02:00
private:
2001-08-08 18:54:00 +02:00
void processTeleportToCommand();
int m_teleportPending;
DVECTOR m_teleportPendingPos;
2001-04-19 01:37:52 +02:00
void playAnimFrameSfx(int _animNo,int _animFrame);
2001-05-02 20:11:29 +02:00
void calcCameraFocusPointTarget();
2001-04-19 01:37:52 +02:00
2001-05-01 18:26:31 +02:00
DVECTOR m_moveVelocity;
2001-05-01 23:43:14 +02:00
int m_allowConversation;
2001-05-01 18:26:31 +02:00
2001-04-19 01:37:52 +02:00
public:
2001-07-23 21:26:37 +02:00
DVECTOR const &getPlayerPos() {return Pos;}
2001-03-23 21:09:14 +01:00
void setPlayerPos(DVECTOR *_pos) {Pos=*_pos;}
2001-06-20 21:32:03 +02:00
void ignoreNewlyPressedButtonsOnPadThisThink();
2001-03-23 21:09:14 +01:00
PLAYERINPUT getPadInputHeld() {return m_padInput;}
PLAYERINPUT getPadInputDown() {return m_padInputDown;}
2001-05-29 20:22:49 +02:00
int tryingToManuallyPickupWeapon() {return m_tryingToManuallyPickupWeapon;}
int tryingToAutomaticallyPickupWeapon() {return m_tryingToAutomaticallyPickupWeapon;}
2001-05-11 21:49:41 +02:00
2001-05-04 01:45:28 +02:00
void inSoakUpState();
2001-05-11 21:49:41 +02:00
void takeDamage(DAMAGE_TYPE _damage,REACT_DIRECTION _reactDirection=REACT__UP,CThing *_thing=NULL);
2001-02-06 22:09:45 +01:00
2001-03-23 21:09:14 +01:00
void respawn();
2001-06-12 23:45:33 +02:00
void setCanExitLevelNow() {m_canExitLevel=true;}
2001-08-10 00:44:21 +02:00
int getCanExitLevelNow() {return m_canExitLevel&&getMode()!=PLAYER_MODE_DEAD;}
2001-07-03 00:57:52 +02:00
void collectedQuestItem();
2001-03-23 21:09:14 +01:00
2001-07-10 20:15:12 +02:00
int getLivesLeft();
2001-01-25 16:25:46 +01:00
2001-02-01 18:01:12 +01:00
public:
typedef struct
{
int m_frame;
CSoundMediator::SFXID m_sfxId;
} AnimFrameSfx;
2001-04-05 18:26:17 +02:00
void renderSb(DVECTOR *_pos,int _animNo,int _animFrame);
2001-04-18 18:35:26 +02:00
int canDoLookAround();
2001-05-04 01:45:28 +02:00
2001-02-01 18:01:12 +01:00
private:
typedef struct
{
2001-04-19 01:37:52 +02:00
int m_animNumber;
2001-02-01 18:32:16 +01:00
int m_numAnimFrameSfx;
const struct AnimFrameSfx *m_animFrameSfx;
2001-02-01 18:01:12 +01:00
} AnimSfx;
2001-02-01 18:32:16 +01:00
static const AnimSfx s_animSfx[];
2001-04-19 01:37:52 +02:00
static const int s_numAnimSfx;
2001-01-20 00:37:40 +01:00
int m_animFrame;
2001-01-16 20:27:14 +01:00
int m_animNo;
2001-04-01 22:22:49 +02:00
CActorGfx *m_actorGfx;
2001-01-16 20:27:14 +01:00
2001-07-21 20:39:43 +02:00
int m_cartCamActive;
2001-07-21 21:14:40 +02:00
int m_reverseCameraMovement;
2001-02-14 21:28:57 +01:00
DVECTOR m_cameraPos;
2001-04-12 00:37:57 +02:00
DVECTOR m_currentCamFocusPointTarget;
DVECTOR m_currentCamFocusPoint;
2001-01-15 23:09:47 +01:00
int m_facing;
2001-04-12 00:37:57 +02:00
int m_padLookAroundTimer;
2001-07-26 22:00:55 +02:00
int m_ledgeLookAhead;
2001-04-17 22:09:33 +02:00
int m_ledgeLookOffset;
int m_ledgeLookTimer;
2001-04-12 00:37:57 +02:00
2001-01-15 23:09:47 +01:00
2001-01-22 23:58:12 +01:00
enum
{
2001-04-19 01:49:41 +02:00
INVINCIBLE_FRAMES__START=200, // Invincible for this many frames at start of life
2001-05-14 18:12:30 +02:00
INVINCIBLE_FRAMES__HIT=120, // Invincible for this many frames after taking damage
2001-01-22 23:58:12 +01:00
};
2001-03-02 17:02:30 +01:00
int m_invincibleFrameCount; // Initial invincibility and also invincibility after taking damage
2001-08-14 23:03:31 +02:00
int m_recoveringFromElectrocution; // TRUE is last hit was electrical
2001-01-22 23:58:12 +01:00
2001-03-23 21:09:14 +01:00
static class CPlayerMode *s_playerModes[NUM_PLAYERMODES];
class CPlayerMode *m_currentPlayerModeClass;
2001-05-15 18:48:29 +02:00
PLAYER_MODE m_currentMode;
PLAYER_MODE m_lastModeBeforeDeath;
2001-01-22 23:58:12 +01:00
2001-05-17 20:42:59 +02:00
public:
DEATH_TYPE getDeathType() {return m_deathType;}
2001-08-09 20:45:11 +02:00
void dieYouPorousFreak(DEATH_TYPE _deathType=DEATHTYPE__NORMAL);
2001-05-04 01:45:28 +02:00
2001-08-15 22:12:32 +02:00
void setSBOTPosToFront();
private:
void setSBOTPos(int _ot);
2001-05-04 01:45:28 +02:00
private:
2001-06-14 17:19:57 +02:00
int m_numSpatulasHeld;
2001-07-17 22:13:07 +02:00
int m_spatulaWarningTimer;
2001-05-04 01:45:28 +02:00
int m_healthWaterLevel;
2001-06-01 20:59:33 +02:00
int m_helmetSoundTimer; // Timer for breathing sound when using the helmet
2001-01-22 23:58:12 +01:00
2001-05-17 20:42:59 +02:00
DEATH_TYPE m_deathType;
2001-05-04 01:45:28 +02:00
2001-01-29 23:35:18 +01:00
void updatePadInput();
2001-02-09 18:01:04 +01:00
protected:
virtual PLAYERINPUT readPadInput();
private:
PLAYERINPUT m_padInput; // Controls that are being held down
PLAYERINPUT m_lastPadInput; // Last frames controls
PLAYERINPUT m_padInputDown; // Controls that were pressed this frame
2001-06-20 21:32:03 +02:00
int m_ignoreNewlyPressedButtonsOnPadThisThink;
2001-05-29 20:22:49 +02:00
int m_tryingToManuallyPickupWeapon;
int m_tryingToAutomaticallyPickupWeapon;
2001-01-29 23:35:18 +01:00
2001-02-09 18:01:04 +01:00
2001-02-12 16:26:00 +01:00
// Various info about the current map
2001-05-03 20:42:56 +02:00
CameraBox m_cameraPosLimitBox;
CameraBox m_playerPosLimitBox;
2001-02-12 18:55:01 +01:00
DVECTOR m_respawnPos;
2001-06-12 23:45:33 +02:00
int m_canExitLevel;
2001-02-26 21:42:25 +01:00
2001-03-02 17:02:30 +01:00
// Powerups
private:
enum
{
SQUEAKY_BOOTS_TIME=60*10,
2001-07-10 22:19:45 +02:00
SQUEAKY_BOOTS_FLASH_TIME=60*2,
2001-03-02 17:02:30 +01:00
INVINCIBILITY_RING_TIME=60*10,
2001-07-12 18:47:11 +02:00
INITIAL_BUBBLE_BLOWER_AMMO=10,
BUBBLE_BLOWER_AMMO_IN_PICKUP=10,
2001-07-27 18:00:58 +02:00
MAX_BUBBLE_BLOWER_AMMO=20,
2001-07-12 18:47:11 +02:00
INITIAL_JELLY_LAUNCHER_AMMO=6,
JELLY_LAUNCHER_AMMO_IN_PICKUP=6,
2001-07-27 18:00:58 +02:00
MAX_JELLY_LAUNCHER_AMMO=20,
2001-07-12 18:47:11 +02:00
2001-07-27 17:19:36 +02:00
PANT_FLASH_TIME=128,
PANT_FLASH_Y_OFFSET=-90,
2001-05-29 16:51:59 +02:00
MAX_JELLFISH_IN_NET=5,
2001-03-02 17:02:30 +01:00
};
public:
2001-05-29 16:51:59 +02:00
void giveSqueakyBoots() {m_squeakyBootsTimer=SQUEAKY_BOOTS_TIME;}
int isWearingBoots() {return m_squeakyBootsTimer;}
void giveInvincibilityRing() {m_invincibilityRingTimer=INVINCIBILITY_RING_TIME;}
void giveDivingHelmet() {m_divingHelmet=true;}
int isWearingDivingHelmet() {return m_divingHelmet;}
2001-07-27 18:00:58 +02:00
void giveBubbleAmmo() {m_bubbleAmmo+=BUBBLE_BLOWER_AMMO_IN_PICKUP;if(m_bubbleAmmo>MAX_BUBBLE_BLOWER_AMMO)m_bubbleAmmo=MAX_BUBBLE_BLOWER_AMMO;}
void giveBubbleAmmoFromWeapon() {m_bubbleAmmo+=INITIAL_BUBBLE_BLOWER_AMMO;if(m_bubbleAmmo>MAX_BUBBLE_BLOWER_AMMO)m_bubbleAmmo=MAX_BUBBLE_BLOWER_AMMO;}
2001-07-14 00:10:16 +02:00
void setBubbleAmmo(int _amount) {m_bubbleAmmo=_amount;if(m_bubbleAmmo>MAX_BUBBLE_BLOWER_AMMO)m_bubbleAmmo=MAX_BUBBLE_BLOWER_AMMO;}
2001-05-29 16:51:59 +02:00
void useOneBubble() {m_bubbleAmmo--;}
int getBubbleAmmo() {return m_bubbleAmmo;}
2001-07-14 00:10:16 +02:00
int isHoldingBubbleWand() {return m_currentMode==PLAYER_MODE_BUBBLE_MIXTURE;}
2001-05-29 16:51:59 +02:00
2001-07-12 18:47:11 +02:00
void giveJellyAmmo() {m_jellyAmmo+=JELLY_LAUNCHER_AMMO_IN_PICKUP;if(m_jellyAmmo>MAX_JELLY_LAUNCHER_AMMO)m_jellyAmmo=MAX_JELLY_LAUNCHER_AMMO;}
2001-07-27 18:00:58 +02:00
void giveJellyAmmoFromWeapon() {m_jellyAmmo+=INITIAL_JELLY_LAUNCHER_AMMO;if(m_jellyAmmo>MAX_JELLY_LAUNCHER_AMMO)m_jellyAmmo=MAX_JELLY_LAUNCHER_AMMO;}
2001-05-29 16:51:59 +02:00
void useOneJelly() {m_jellyAmmo--;}
int getJellyAmmo() {return m_jellyAmmo;}
2001-07-12 18:47:11 +02:00
void giveJellyFishAmmo() {m_jellyfishAmmoCount++;if(m_jellyfishAmmoCount>MAX_JELLFISH_IN_NET)m_jellyfishAmmoCount=MAX_JELLFISH_IN_NET;}
void useOneJellyFishAmmo() {m_jellyfishAmmoCount--;}
int isJellyFishAmmoFull() {return m_jellyfishAmmoCount==MAX_JELLFISH_IN_NET;}
int getJellyFishAmmo() {return m_jellyfishAmmoCount;}
2001-07-14 00:10:16 +02:00
int isHoldingNet() {return m_currentMode==PLAYER_MODE_NET;}
2001-05-16 18:47:29 +02:00
2001-07-18 18:48:49 +02:00
int isHoldingBalloon() {return m_currentMode==PLAYER_MODE_BALLOON;}
2001-06-01 20:59:33 +02:00
void setIsInWater(int _in) {m_isInWater=_in;m_helmetSoundTimer=0;}
2001-05-15 00:08:19 +02:00
int getIsInWater() {return m_isInWater;}
2001-06-14 17:19:57 +02:00
int getIsHelmetFullSoICanStopSoakingUp() {return m_healthWaterLevel==WATERMAXHEALTH;}
int getIsHelmetSoFullThatIDontNeedToSoakUp(){return m_healthWaterLevel>=WATERMINSOAKUPLEVEL;}
2001-05-08 18:58:07 +02:00
2001-05-11 22:56:43 +02:00
void justButtBouncedABadGuy(); // Also fugly.. :/
2001-06-15 23:24:14 +02:00
void setFloating();
2001-03-02 17:02:30 +01:00
private:
int m_squeakyBootsTimer;
2001-04-25 20:38:33 +02:00
int m_invincibilityRingTimer;
2001-03-29 23:30:34 +02:00
int m_divingHelmet;
2001-03-31 04:05:24 +02:00
int m_bubbleAmmo;
2001-04-08 20:57:16 +02:00
int m_jellyAmmo;
2001-05-29 16:51:59 +02:00
int m_jellyfishAmmoCount;
2001-05-08 18:58:07 +02:00
int m_isInWater;
2001-07-27 17:19:36 +02:00
int m_pantFlashTimer;
int m_hasReceivedExtraLifeFor100Spats;
2001-03-06 21:13:16 +01:00
// Platforms
public:
2001-03-29 21:19:33 +02:00
void setPlatform(CThing *_newPlatform);
2001-08-17 16:25:04 +02:00
void setLockoutPlatform(CThing *_newPlatform);
2001-03-29 21:19:33 +02:00
void clearPlatform();
CThing *isOnPlatform() {return m_platform;}
private:
CThing *m_platform;
2001-08-17 16:25:04 +02:00
CThing *m_lockoutPlatform;
2001-03-23 21:09:14 +01:00
2001-03-31 20:22:38 +02:00
2001-04-18 18:35:26 +02:00
// Player collision size
public:
enum
{
COLSIZE_BASE_WIDTH=30,
COLSIZE_BASE_HEIGHT=60,
2001-06-07 21:40:41 +02:00
HEIGHT_FOR_HEAD_COLLISION=64,
2001-04-18 18:35:26 +02:00
};
void resetPlayerCollisionSizeToBase();
void setPlayerCollisionSize(int _x,int _y,int _w,int _h);
2001-05-01 22:23:32 +02:00
void getPlayerCollisionSize(int *_x,int *_y,int *_w,int *_h);
2001-08-17 20:54:26 +02:00
void getPlayerNormalCollisionSize(int *_x,int *_y,int *_w,int *_h);
2001-04-18 18:35:26 +02:00
2001-03-31 20:22:38 +02:00
// Graphical resources
public:
2001-06-22 18:22:03 +02:00
class FontBank *getFontBank() {return m_fontBank;}
class ScalableFontBank *getScalableFontBank() {return m_scalableFontBank;}
2001-03-31 20:22:38 +02:00
enum
{
2001-06-14 17:19:57 +02:00
SB_UI_XBASE=40,
SB_UI_YBASE=40,
SB_UI_GAP_FROM_SPAT_COUNT_TO_PICKUPS=50,
SB_UI_GAP_BETWEEN_ITEMS=5,
2001-06-14 18:05:27 +02:00
POWERUPUI_ICONX=400,
POWERUPUI_ICONY=40,
POWERUPUI_TEXTX=440,
POWERUPUI_TEXTY=37,
POWERUPUI_OT=0,
2001-03-31 20:22:38 +02:00
};
private:
2001-06-22 18:22:03 +02:00
class FontBank *m_fontBank;
class ScalableFontBank *m_scalableFontBank;
2001-06-08 17:02:29 +02:00
public:
// Movement tracking for barrels
s32 getMovement() {return( m_xMove );}
2001-08-13 18:31:14 +02:00
s8 getMoveLeftRight() {return( m_moveLeftRight );}
void setMoveLeftRight( s8 newLeftRight ) {m_moveLeftRight = newLeftRight;}
2001-06-08 17:02:29 +02:00
private:
s32 m_xMove;
2001-08-13 18:31:14 +02:00
s8 m_moveLeftRight;
2001-01-09 21:38:20 +01:00
};
2001-01-15 23:09:47 +01:00
2001-01-16 20:27:14 +01:00
/*----------------------------------------------------------------------
Globals
------- */
/*----------------------------------------------------------------------
Functions
--------- */
/*---------------------------------------------------------------------- */
#endif /* __PLAYER_PLAYER_H__ */
/*===========================================================================
end */