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-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-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-02-20 23:53:35 +01:00
|
|
|
private:
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
class CBaseWeaponPickup : public CBaseRespawningPickup
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
virtual void collidedWith(CThing *_thisThing);
|
|
|
|
|
|
|
|
virtual int getRespawnTime() {return 5*60;}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
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 */
|