SBSPSS/source/enemy/nworm.h

90 lines
2.5 KiB
C
Raw Normal View History

2001-04-20 21:06:19 +02:00
/*=========================================================================
nworm.h
Author: CRB
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
#ifndef __ENEMY_NWORM_H__
#define __ENEMY_NWORM_H__
2001-05-16 18:02:10 +02:00
class CNpcParasiticWormSegment
{
public:
virtual void init();
2001-05-16 22:16:58 +02:00
virtual void shutdown();
2001-05-16 18:02:10 +02:00
virtual void render();
virtual void processEnemyCollision( CThing *thisThing );
virtual void setScale( u16 scale ) {m_scale = scale;}
CNpcParasiticWormSegment *m_nextSegment;
virtual void setPos( DVECTOR newPos ) {Pos = newPos;}
virtual DVECTOR getPos() {return( Pos );}
virtual void setHeading( s16 newHeading ) {m_heading = newHeading;}
void updateCollisionArea();
2001-05-16 18:15:38 +02:00
virtual int checkCollisionAgainst(CThing *_thisThing, int _frames);
2001-05-16 18:02:10 +02:00
virtual void setCollisionSize(int _w,int _h);
virtual void setCollisionCentreOffset(int _x,int _y) {m_collisionCentreOffset.vx=_x;m_collisionCentreOffset.vy=_y;}
virtual CRECT const &getCollisionArea() {return m_collisionArea;}
2001-05-16 18:15:38 +02:00
DVECTOR const &getCollisionCentre() {return m_collisionCentre;}
int getCollisionRadius() {return m_collisionRadius;}
2001-06-21 00:02:19 +02:00
void setAnim( int newAnim ) {m_animNo = newAnim;}
2001-05-16 18:02:10 +02:00
2001-05-16 18:15:38 +02:00
protected:
2001-05-16 18:02:10 +02:00
u16 m_scale;
CActorGfx *m_actorGfx;
DVECTOR Pos;
s16 m_heading;
CRECT m_collisionArea;
DVECTOR m_collisionCentre;
DVECTOR m_collisionCentreOffset;
DVECTOR m_collisionSize;
int m_collisionRadius;
2001-06-21 00:02:19 +02:00
int m_animNo;
2001-05-16 18:02:10 +02:00
};
2001-04-20 21:06:19 +02:00
class CNpcParasiticWormEnemy : public CNpcEnemy
{
public:
virtual void postInit();
2001-04-26 23:29:44 +02:00
virtual void shutdown();
2001-05-04 15:45:55 +02:00
virtual void render();
2001-05-16 18:15:38 +02:00
virtual int checkCollisionAgainst(CThing *_thisThing, int _frames);
2001-04-20 21:06:19 +02:00
protected:
virtual bool processSensor();
virtual void processClose( int _frames );
virtual void processMovement( int _frames );
2001-06-28 22:29:14 +02:00
virtual void processShotDeathEnd( int _frames );
2001-05-16 18:02:10 +02:00
//void resetParasiticWormHeadToTail();
2001-05-04 15:45:55 +02:00
virtual void processEnemyCollision( CThing *thisThing );
2001-04-20 21:06:19 +02:00
enum
{
2001-05-25 00:11:16 +02:00
NPC_PARASITIC_WORM_SPACING = 1,
NPC_PARASITIC_WORM_LENGTH = 30,
2001-04-20 21:06:19 +02:00
};
2001-05-04 15:45:55 +02:00
2001-05-16 21:04:40 +02:00
// position history stuff
2001-05-16 20:07:38 +02:00
2001-05-16 21:04:40 +02:00
class CNpcPositionHistory
{
public:
DVECTOR pos;
CNpcPositionHistory *next;
CNpcPositionHistory *prev;
};
2001-06-14 18:07:48 +02:00
CNpcParasiticWormSegment m_segmentArray[NPC_PARASITIC_WORM_LENGTH];
2001-05-16 21:04:40 +02:00
CNpcPositionHistory *m_positionHistory;
2001-06-14 18:07:48 +02:00
CNpcPositionHistory m_positionHistoryArray[NPC_PARASITIC_WORM_SPACING * NPC_PARASITIC_WORM_LENGTH];
2001-05-16 21:04:40 +02:00
s32 m_collTimer;
2001-04-20 21:06:19 +02:00
};
#endif