SBSPSS/source/friend/friend.h

103 lines
2.1 KiB
C
Raw Normal View History

2001-04-27 16:39:10 +02:00
/*=========================================================================
friend.h
Author: CRB
Created:
Project: Spongebob
Purpose:
Copyright (c) 2000 Climax Development Ltd
===========================================================================*/
#ifndef __FRIEND_FRIEND_H__
#define __FRIEND_FRIEND_H__
#ifndef __THING_THING_H__
#include "thing/thing.h"
#endif
#ifndef __PLAYER_PLAYER_H__
#include "player\player.h"
#endif
class CNpcFriend : public CNpcThing
{
public:
enum NPC_FRIEND_UNIT_TYPE
{
NPC_FRIEND_BARNACLE_BOY = 0,
NPC_FRIEND_GARY = 1,
NPC_FRIEND_KRUSTY,
NPC_FRIEND_MERMAID_MAN,
NPC_FRIEND_PATRICK,
NPC_FRIEND_SANDY_CHEEKS,
NPC_FRIEND_SQUIDWARD,
2001-05-03 15:11:45 +02:00
NPC_FRIEND_PLANKTON,
2001-04-27 16:39:10 +02:00
NPC_FRIEND_UNIT_TYPE_MAX,
};
2001-05-03 15:11:45 +02:00
virtual void init();
2001-04-27 16:39:10 +02:00
void init( DVECTOR initPos );
2001-05-03 00:49:59 +02:00
virtual void postInit();
2001-05-03 15:11:45 +02:00
virtual void shutdown();
2001-04-27 17:09:10 +02:00
virtual void think(int _frames);
2001-05-03 15:11:45 +02:00
virtual void render();
2001-04-27 16:39:10 +02:00
void setLayerCollision( class CLayerCollision *_layer ) {m_layerCollision=_layer;}
void setType( NPC_FRIEND_UNIT_TYPE newType ) {m_type = newType;}
static CNpcFriend *Create(sThingActor *ThisActor);
static NPC_FRIEND_UNIT_TYPE getTypeFromMapEdit( u16 newType );
2001-04-27 17:09:10 +02:00
protected:
2001-04-27 16:39:10 +02:00
class CLayerCollision *m_layerCollision;
protected:
typedef struct NPC_FRIEND_DATA_TYPE
{
int skelType;
u8 speed;
u16 turnSpeed;
bool detectCollision;
DAMAGE_TYPE damageToUserType;
2001-04-27 17:09:10 +02:00
u16 idleAnim;
2001-04-27 16:39:10 +02:00
}
NPC_FRIEND_DATA;
// gary functions
void processGaryMovement( int _frames );
// data
static NPC_FRIEND_DATA m_data[NPC_FRIEND_UNIT_TYPE_MAX];
static NPC_FRIEND_UNIT_TYPE mapEditConvertTable[NPC_FRIEND_UNIT_TYPE_MAX];
2001-05-03 00:49:59 +02:00
virtual void startConderversation();
2001-05-01 23:05:14 +02:00
2001-05-02 00:06:59 +02:00
virtual void collidedWith(CThing *_thisThing);
2001-04-27 16:39:10 +02:00
enum
{
EXTEND_RIGHT = true,
EXTEND_LEFT = false,
NPC_FRIEND_MAPEDIT_OFFSET = 1,
};
// internal variables
NPC_FRIEND_UNIT_TYPE m_type;
s32 m_extension;
int m_frame;
int m_animNo;
2001-04-27 17:09:10 +02:00
u8 m_animPlaying;
2001-04-27 16:39:10 +02:00
CActorGfx *m_actorGfx;
DVECTOR m_drawOffset;
bool m_reversed;
};
#endif