SBSPSS/source/pickups/pickup.h

175 lines
3.6 KiB
C
Raw Normal View History

2001-02-20 23:53:35 +01:00
/*=========================================================================
pickup.h
Author: PKG
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
#ifndef __PICKUPS_PICKUP_H__
#define __PICKUPS_PICKUP_H__
/*----------------------------------------------------------------------
Includes
-------- */
2001-02-27 17:59:50 +01:00
#ifndef __THING_THING_H__
#include "thing/thing.h"
2001-02-20 23:53:35 +01:00
#endif
2001-06-01 20:59:33 +02:00
#ifndef __SOUND_SOUND_H__
#include "sound\sound.h"
#endif
2001-02-20 23:53:35 +01:00
/* Std Lib
------- */
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
typedef enum
{
2001-06-14 17:19:57 +02:00
PICKUP__BIG_HEALTH, // No longer in the game.. Yay(!)
PICKUP__MEDIUM_HEALTH, // No longer in the game.. Yay(!)
PICKUP__SMALL_HEALTH, // No longer in the game.. Yay(!)
2001-02-20 23:53:35 +01:00
PICKUP__LIFE,
PICKUP__SPATULA,
2001-02-21 18:13:37 +01:00
PICKUP__JELLY_LAUNCHER_AMMO,
PICKUP__BUBBLE_MIXTURE,
2001-03-31 04:05:24 +02:00
PICKUP__BUBBLE_WAND,
PICKUP__NET,
2001-06-13 18:59:29 +02:00
PICKUP__GLASSES, // No longer in the game.. Yay(!)
2001-02-21 18:13:37 +01:00
PICKUP__SQUEAKY_SHOES,
2001-02-21 23:33:17 +01:00
PICKUP__BALLOON,
PICKUP__HELMET,
2001-03-30 19:47:00 +02:00
PICKUP__CORAL_BLOWER,
2001-05-24 20:21:14 +02:00
PICKUP__QUEST_ITEM,
2001-04-19 21:18:22 +02:00
PICKUP__BALLOON_AND_SPATULA,
2001-04-26 23:19:53 +02:00
PICKUP__JELLY_LAUNCHER,
2001-05-29 22:42:16 +02:00
PICKUP__KELP_TOKEN,
2001-06-27 21:50:35 +02:00
PICKUP__GLOVE,
2001-06-14 17:19:57 +02:00
2001-05-25 20:43:47 +02:00
PICKUP__MAX
2001-02-20 23:53:35 +01:00
}
PICKUP_TYPE;
/*----------------------------------------------------------------------
Structure defintions
-------------------- */
2001-02-26 21:42:25 +01:00
class CBasePickup : public CPickupThing
2001-02-20 23:53:35 +01:00
{
public:
2001-05-25 20:43:47 +02:00
enum
{ // For Dynamic ThingCache
MAX_SUBTYPE =PICKUP__MAX,
};
2001-02-20 23:53:35 +01:00
virtual void init();
virtual void shutdown();
virtual void think(int _frames);
virtual void render();
2001-04-02 23:37:20 +02:00
virtual DVECTOR getSizeForPlacement()=0;
2001-02-20 23:53:35 +01:00
void setPos(const struct DVECTOR *_pos);
virtual void collect(class CPlayer *_player);
protected:
2001-02-21 18:13:37 +01:00
enum
{
2001-02-21 23:33:17 +01:00
DEFAULT_VISIBILITY_RADIUS=32,
2001-02-21 18:13:37 +01:00
};
2001-02-21 23:33:17 +01:00
virtual int getVisibilityRadius() {return DEFAULT_VISIBILITY_RADIUS;}
virtual void thinkPickup(int _Frames) {;}
virtual void renderPickup(DVECTOR *_pos)=0;
2001-02-20 23:53:35 +01:00
2001-02-26 21:42:25 +01:00
virtual void collidedWith(CThing *_thisThing);
2001-06-01 20:59:33 +02:00
2001-02-20 23:53:35 +01:00
private:
2001-06-01 20:59:33 +02:00
virtual CSoundMediator::SFXID sfxToPlayWhenCollected(){return CSoundMediator::SFX_ITEM__ANY_OTHER_ITEM;}
2001-02-20 23:53:35 +01:00
};
2001-02-21 23:33:17 +01:00
class CBaseRespawningPickup : public CBasePickup
{
public:
virtual void init();
virtual void think(int _frames);
virtual void render();
virtual void collect(class CPlayer *_player);
protected:
virtual int getRespawnTime()=0;
2001-02-27 17:59:50 +01:00
virtual int canCollide() {return m_respawnTime==0;}
2001-02-21 23:33:17 +01:00
private:
int m_respawnTime;
};
2001-05-18 23:03:51 +02:00
2001-05-29 18:12:06 +02:00
class CBaseWeaponPickup : public CBasePickup
2001-05-18 23:03:51 +02:00
{
2001-05-29 20:22:49 +02:00
public:
virtual void init();
virtual void think(int _frames);
2001-07-27 18:00:58 +02:00
void setHasBeenCollected() {m_hasBeenCollected=true;}
int getHasBeenCollected() {return m_hasBeenCollected;}
2001-05-18 23:03:51 +02:00
protected:
virtual void collidedWith(CThing *_thisThing);
2001-05-29 20:22:49 +02:00
int m_dontAutoPickUpUntilPlayerMovesOffMe;
int m_collidedWithPlayer;
2001-07-27 18:00:58 +02:00
int m_hasBeenCollected;
2001-05-18 23:03:51 +02:00
2001-06-01 20:59:33 +02:00
private:
virtual CSoundMediator::SFXID sfxToPlayWhenCollected(){return CSoundMediator::SFX_ITEM__POWER_UP_ITEM;}
2001-05-18 23:03:51 +02:00
};
class CBaseWeaponSimplePickup : public CBaseWeaponPickup
{
public:
virtual void init();
virtual DVECTOR getSizeForPlacement();
protected:
virtual void renderPickup(DVECTOR *_pos);
virtual int getWeaponSpriteFrame()=0;
};
2001-02-20 23:53:35 +01:00
/*----------------------------------------------------------------------
Globals
------- */
/*----------------------------------------------------------------------
Functions
--------- */
CBasePickup *createPickup(const PICKUP_TYPE _type,const DVECTOR *_pos);
/*---------------------------------------------------------------------- */
#endif /* __PICKUPS_PICKUP_H__ */
/*===========================================================================
end */