SBSPSS/source/pickups/pickup.h

127 lines
2.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
/* Std Lib
------- */
/*----------------------------------------------------------------------
Tyepdefs && Defines
------------------- */
typedef enum
{
2001-02-27 17:59:50 +01:00
PICKUP__BIG_HEALTH,
PICKUP__MEDIUM_HEALTH,
PICKUP__SMALL_HEALTH,
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-02-21 18:13:37 +01:00
PICKUP__GLASSES,
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-02-21 18:13:37 +01:00
PICKUP__QUEST_ITEM__TEST, // Needs to be one of these for each quest item ( I think )
2001-04-19 21:18:22 +02:00
PICKUP__BALLOON_AND_SPATULA,
2001-04-26 23:19:53 +02:00
PICKUP__JELLY_LAUNCHER,
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:
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-20 23:53:35 +01:00
class SpriteBank *getSpriteBank() {return m_spriteBank;}
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-02-20 23:53:35 +01:00
private:
class SpriteBank *m_spriteBank;
};
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-02-20 23:53:35 +01:00
/*----------------------------------------------------------------------
Globals
------- */
/*----------------------------------------------------------------------
Functions
--------- */
CBasePickup *createPickup(const PICKUP_TYPE _type,const DVECTOR *_pos);
/*---------------------------------------------------------------------- */
#endif /* __PICKUPS_PICKUP_H__ */
/*===========================================================================
end */