SBSPSS/source/hazard/hazard.h

132 lines
3.0 KiB
C
Raw Normal View History

2001-04-24 15:24:26 +02:00
/*=========================================================================
hazard.h
Author: CRB
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
#ifndef __HAZARD_HAZARD_H__
#define __HAZARD_HAZARD_H__
#ifndef __THING_THING_H__
#include "thing/thing.h"
#endif
#ifndef __ENEMY_NPCPATH_H__
#include "enemy\npcpath.h"
#endif
#ifndef __GFX_SPRBANK_H__
#include "gfx\sprbank.h"
#endif
#ifndef __ACTOR_HEADER__
#include "gfx\actor.h"
#endif
2001-06-01 18:30:37 +02:00
#ifndef __SOUND_SOUND_H__
#include "sound\sound.h"
#endif
2001-04-24 15:24:26 +02:00
class CNpcHazard : public CHazardThing
{
public:
2001-05-01 15:28:11 +02:00
enum NPC_HAZARD_UNIT_TYPE
{
NPC_FALLING_HAZARD = 0,
NPC_PENDULUM_HAZARD = 1,
NPC_BOAT_HAZARD,
2001-05-03 16:51:14 +02:00
NPC_BARREL_HAZARD,
NPC_STATIC_HAZARD,
NPC_CIRCULAR_SAW_HAZARD,
2001-05-04 23:25:33 +02:00
NPC_MOWER_HAZARD,
NPC_MASHER_HAZARD,
NPC_FAN_HAZARD,
NPC_SPIKES_HAZARD,
2001-05-05 15:54:34 +02:00
NPC_BIG_WHEEL_HAZARD,
2001-05-05 21:08:02 +02:00
NPC_DUAL_PLATFORM_BARREL_HAZARD,
2001-05-05 23:04:00 +02:00
NPC_BOUNCING_BARREL_HAZARD,
2001-05-18 14:55:34 +02:00
NPC_FIREBALL_HAZARD,
2001-05-22 21:59:56 +02:00
NPC_ROLLING_ROCK_HAZARD,
2001-05-23 00:01:43 +02:00
NPC_FLY_TRAP_HAZARD,
2001-05-23 20:45:27 +02:00
NPC_RISING_WEIGHT_HAZARD,
NPC_RISING_WEIGHT_WHEEL_HAZARD,
2001-05-24 01:16:43 +02:00
NPC_PRESSURE_SWITCH_HAZARD,
2001-05-24 17:18:25 +02:00
NPC_ROCKSHARD_HAZARD,
2001-05-31 17:43:13 +02:00
NPC_INERT_HAZARD,
2001-06-04 21:01:17 +02:00
NPC_CONVEYOR_SWITCH_HAZARD,
2001-06-05 18:01:22 +02:00
NPC_BOUNCING_ROCK_HAZARD,
2001-06-14 23:27:25 +02:00
NPC_SWORDFISH_HAZARD,
NPC_LOG_HAZARD,
2001-07-17 22:15:28 +02:00
NPC_CHECKPOINT_HAZARD,
2001-05-01 15:28:11 +02:00
NPC_HAZARD_TYPE_MAX,
};
2001-05-25 20:43:47 +02:00
enum
{ // For Dynamic ThingCache
MAX_SUBTYPE =NPC_HAZARD_TYPE_MAX,
};
2001-05-01 15:28:11 +02:00
2001-04-24 17:01:42 +02:00
virtual void init();
2001-06-01 23:00:15 +02:00
virtual void setGraphic( sThingHazard *ThisHazard );
2001-04-24 15:24:26 +02:00
void shutdown();
2001-07-17 22:30:13 +02:00
virtual void think(int _frames);
2001-05-03 16:51:14 +02:00
virtual void render();
2001-05-01 15:28:11 +02:00
virtual void setWaypoints( sThingHazard *ThisHazard );
2001-05-30 00:07:28 +02:00
void setWaypointPtr( u16 *newPtr ) {m_npcPath.setWaypointPtr( newPtr );}
void setWaypointCount( u8 newCount ) {m_npcPath.setWaypointCount( newCount );}
2001-05-10 21:27:57 +02:00
virtual void setRespawnRate( s16 newRespawnRate ) {m_respawnRate=newRespawnRate;}
2001-06-04 21:01:17 +02:00
virtual void trigger() {}
2001-06-18 21:06:43 +02:00
virtual void leftThinkZone(int _frames);
2001-06-19 22:07:57 +02:00
virtual CRECT const *getThinkBBox() {return &m_thinkArea;}
2001-05-01 15:28:11 +02:00
static NPC_HAZARD_UNIT_TYPE getTypeFromMapEdit( u16 newType );
2001-05-29 21:19:14 +02:00
static CNpcHazard *Create(int Type);
2001-05-01 15:28:11 +02:00
static CNpcHazard *Create(sThingHazard *ThisHazard);
2001-04-24 15:24:26 +02:00
2001-05-08 18:25:45 +02:00
void setPlatform(CThing *_newPlatform) {m_platform = _newPlatform;}
void clearPlatform() {m_platform = NULL;}
CThing *isOnPlatform() {return m_platform;}
2001-04-24 15:24:26 +02:00
protected:
2001-04-24 17:01:42 +02:00
enum
{
EXTEND_UP = true,
EXTEND_DOWN = false,
EXTEND_RIGHT = true,
EXTEND_LEFT = false,
EXTEND_CLOCKWISE = true,
EXTEND_ANTICLOCKWISE = false,
};
virtual void processMovement( int _frames );
virtual void processTimer( int _frames );
2001-05-01 18:28:51 +02:00
virtual void collidedWith(CThing *_thisThing);
2001-04-24 15:24:26 +02:00
CNpcPath m_npcPath;
2001-04-24 17:01:42 +02:00
DVECTOR m_base;
s32 m_timer;
bool m_timerActive;
bool m_isActive;
s32 m_extension;
bool m_extendDir;
s32 m_heading;
2001-05-01 15:28:11 +02:00
CModelGfx *m_modelGfx;
2001-05-10 21:27:57 +02:00
s16 m_respawnRate;
2001-06-18 21:06:43 +02:00
int m_soundId;
2001-06-19 22:07:57 +02:00
CRECT m_thinkArea;
2001-05-01 15:28:11 +02:00
2001-05-08 18:25:45 +02:00
CThing *m_platform;
2001-05-01 15:28:11 +02:00
static NPC_HAZARD_UNIT_TYPE mapEditConvertTable[NPC_HAZARD_TYPE_MAX];
2001-04-24 15:24:26 +02:00
};
#endif