SBSPSS/source/friend/friend.h

116 lines
2.3 KiB
C
Raw Normal View History

2001-04-27 16:39:10 +02:00
/*=========================================================================
friend.h
Author: CRB
2001-05-25 21:08:35 +02:00
Created:
2001-04-27 16:39:10 +02:00
Project: Spongebob
2001-05-25 21:08:35 +02:00
Purpose:
2001-04-27 16:39:10 +02:00
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
2001-05-25 21:08:35 +02:00
#ifndef __PLATFORM_PLATFORM_H__
#include "platform\platform.h"
#endif
2001-04-27 16:39:10 +02:00
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-25 20:43:47 +02:00
enum
{ // For Dynamic ThingCache
MAX_SUBTYPE =NPC_FRIEND_UNIT_TYPE_MAX,
};
2001-04-27 16:39:10 +02:00
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-05-25 20:43:47 +02:00
2001-04-27 16:39:10 +02:00
void setType( NPC_FRIEND_UNIT_TYPE newType ) {m_type = newType;}
2001-05-25 21:08:35 +02:00
void setPlatform( CNpcPlatform *platform ) {m_platform = platform;}
void clearPlatform() {m_platform = NULL;}
2001-05-30 22:24:02 +02:00
virtual void setupWaypoints( sThingActor *ThisActor );
2001-07-09 21:38:58 +02:00
virtual void setObstructed() {}
2001-04-27 16:39:10 +02:00
static CNpcFriend *Create(sThingActor *ThisActor);
static NPC_FRIEND_UNIT_TYPE getTypeFromMapEdit( u16 newType );
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
2001-05-25 21:08:35 +02:00
2001-04-27 16:39:10 +02:00
NPC_FRIEND_UNIT_TYPE m_type;
s32 m_extension;
2001-05-25 21:08:35 +02:00
CNpcPlatform *m_platform;
2001-04-27 16:39:10 +02:00
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;
bool m_reversed;
2001-05-25 23:18:54 +02:00
int m_hasSpokenToSbYet;
int m_iconStrobe;
2001-04-27 16:39:10 +02:00
};
#endif