SBSPSS/source/fx/fx.h

105 lines
2.5 KiB
C
Raw Normal View History

2001-05-05 20:12:30 +02:00
/*********************/
/*** FX Base Class ***/
/*********************/
#ifndef __FX_FX_HEADER__
#define __FX_FX_HEADER__
#include "thing/thing.h"
/*****************************************************************************/
class CFX : public CFXThing
{
public:
enum FX_TYPE
{
2001-06-01 00:02:07 +02:00
FX_TYPE_JELLYFISH_LEGS, // zero also used to chain fx, so first must be unique type (I know what I mean)
2001-05-16 21:06:02 +02:00
FX_TYPE_FALLINGTILE,
2001-05-31 22:07:48 +02:00
FX_TYPE_EXPLODE,
FX_TYPE_SPLASH_WATER,
FX_TYPE_SPLASH_ACID,
FX_TYPE_SPLASH_LAVA,
FX_TYPE_SPLASH_OIL,
FX_TYPE_BUBBLE_WATER,
FX_TYPE_BUBBLE_ACID,
FX_TYPE_BUBBLE_LAVA,
FX_TYPE_BUBBLE_OIL,
FX_TYPE_DROP_WATER,
FX_TYPE_DROP_ACID,
FX_TYPE_DROP_LAVA,
FX_TYPE_DROP_OIL,
2001-06-12 01:37:59 +02:00
FX_TYPE_FOUNTAIN_WATER,
FX_TYPE_FOUNTAIN_ACID,
FX_TYPE_FOUNTAIN_LAVA,
FX_TYPE_FOUNTAIN_OIL,
2001-06-12 22:20:52 +02:00
FX_TYPE_THWACK,
2001-05-05 20:12:30 +02:00
FX_TYPE_LIGHTNING_BOLT,
FX_TYPE_LIGHTNING_SHEET,
FX_TYPE_LIGHTNING_BLAST,
FX_TYPE_LIGHTNING_RADIAL,
FX_TYPE_LIGHTNING_PROJECTILE,
2001-05-31 22:07:48 +02:00
2001-05-05 20:12:30 +02:00
FX_TYPE_SHOCKWAVE,
FX_TYPE_DAZE,
2001-05-31 22:07:48 +02:00
2001-05-05 20:12:30 +02:00
FX_TYPE_CASCADE,
FX_TYPE_CASCADE_SPLASH,
FX_TYPE_FIREBALL,
2001-05-18 22:54:43 +02:00
FX_TYPE_STEAM,
2001-05-21 20:11:30 +02:00
FX_TYPE_SMOKE,
FX_TYPE_GAS,
2001-05-05 20:12:30 +02:00
FX_TYPE_FLAMES,
2001-05-31 00:05:41 +02:00
FX_TYPE_NRG_BAR,
2001-05-25 20:43:47 +02:00
FX_TYPE_MAX
};
enum
{ // For Dynamic ThingCache
MAX_SUBTYPE =FX_TYPE_MAX,
2001-05-05 20:12:30 +02:00
};
2001-05-16 21:06:02 +02:00
static CFX *Create(const FX_TYPE Type);
2001-05-05 20:12:30 +02:00
static CFX *Create(const FX_TYPE Type,CThing *Parent);
2001-05-16 21:06:02 +02:00
static CFX *Create(const FX_TYPE Type,DVECTOR const &Pos);
2001-05-31 22:07:48 +02:00
virtual bool alwaysThink() {return(!RelativeToMap);}
2001-05-05 20:12:30 +02:00
virtual void init();
2001-05-31 22:07:48 +02:00
virtual void init(DVECTOR const &Pos);
2001-05-05 20:12:30 +02:00
virtual void shutdown();
virtual void think(int _frames);
virtual void render();
2001-05-31 22:07:48 +02:00
virtual void setData(void *Data){};
2001-05-05 20:12:30 +02:00
virtual int canCollide() {return false;}
2001-05-09 21:57:57 +02:00
virtual void SetOtPos(int Ot) {OtPos=Ot;}
2001-05-23 00:30:36 +02:00
virtual void setLife(int L) {Life=L;}
2001-05-31 22:07:48 +02:00
virtual void setRelativeToMap(bool f) {RelativeToMap=f;}
virtual void getFXRenderPos(DVECTOR &Pos);
virtual bool getFXParentPos(DVECTOR &Pos);
virtual void killFX() {setToShutdown();}
2001-06-01 23:00:15 +02:00
virtual void toggleVisible() {IsVisible = !IsVisible;}
2001-05-09 21:57:57 +02:00
2001-05-05 20:12:30 +02:00
protected:
2001-06-07 18:33:19 +02:00
virtual void collidedWith(CThing *_thisThing);
2001-05-16 21:06:02 +02:00
s32 OtPos;
2001-05-23 00:30:36 +02:00
s16 Life;
2001-05-31 22:07:48 +02:00
bool RelativeToMap;
2001-06-01 23:00:15 +02:00
bool IsVisible;
2001-05-05 20:12:30 +02:00
};
2001-05-21 20:11:30 +02:00
/*****************************************************************************/
/*****************************************************************************/
/*****************************************************************************/
2001-06-12 01:37:59 +02:00
void TestFX(DVECTOR Pos,CThing *Parent);
2001-05-21 20:11:30 +02:00
2001-05-05 20:12:30 +02:00
#endif