2001-01-16 22:40:14 +01:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
npcpath.h
|
|
|
|
|
|
|
|
Author: CRB
|
|
|
|
Created:
|
|
|
|
Project: Spongebob
|
|
|
|
Purpose:
|
|
|
|
|
|
|
|
Copyright (c) 2000 Climax Development Ltd
|
|
|
|
|
|
|
|
===========================================================================*/
|
|
|
|
|
2001-01-18 20:18:39 +01:00
|
|
|
#ifndef __ENEMY_NPCPATH_H__
|
|
|
|
#define __ENEMY_NPCPATH_H__
|
|
|
|
|
|
|
|
#include "system\global.h"
|
2001-01-16 22:56:29 +01:00
|
|
|
|
2001-01-16 22:40:14 +01:00
|
|
|
class CNpcPath
|
|
|
|
{
|
2001-02-05 15:55:11 +01:00
|
|
|
public:
|
2001-04-02 21:21:46 +02:00
|
|
|
enum NPC_PATH_TYPE
|
|
|
|
{
|
|
|
|
SINGLE_USE_PATH = 0,
|
|
|
|
REPEATING_PATH = 1,
|
|
|
|
PONG_PATH = 2,
|
|
|
|
};
|
|
|
|
|
2001-01-16 22:56:29 +01:00
|
|
|
void initPath();
|
2001-04-02 21:21:46 +02:00
|
|
|
void setPathType( u8 newPathType );
|
2001-04-19 01:12:24 +02:00
|
|
|
u8 getPathType();
|
2001-01-16 22:40:14 +01:00
|
|
|
bool incPath();
|
2001-07-20 17:52:22 +02:00
|
|
|
void decPath();
|
2001-01-26 16:16:07 +01:00
|
|
|
void resetPath();
|
2001-02-05 15:55:11 +01:00
|
|
|
void reversePathDir();
|
2001-07-23 21:26:37 +02:00
|
|
|
s32 think( DVECTOR const ¤tPos, bool *pathComplete, bool *waypointChange, s32 *distX, s32 *distY );
|
|
|
|
bool thinkFlat( DVECTOR const ¤tPos, bool *pathComplete, s32 *distX, s32 *distY, s32 *heading, u8 waypointDist = 10 );
|
|
|
|
bool thinkVertical( DVECTOR const ¤tPos, bool *pathComplete, s32 *distX, s32 *distY, s32 *heading );
|
|
|
|
bool getDistToNextWaypoint( DVECTOR const ¤tPos, s32 *distX, s32 *distY );
|
2001-04-04 20:35:07 +02:00
|
|
|
void getPathXExtents( s32 *minExtent, s32 *maxExtent );
|
2001-04-07 17:39:22 +02:00
|
|
|
void getPathYExtents( s32 *minExtent, s32 *maxExtent );
|
2001-05-14 21:48:27 +02:00
|
|
|
u8 getWaypointCount() { return( waypointCount ); }
|
2001-05-30 00:07:28 +02:00
|
|
|
void setWaypointCount( u8 newCount ) { waypointCount = newCount; }
|
|
|
|
void setWaypointPtr( u16 *newPtr );
|
|
|
|
void setPathExtents();
|
|
|
|
u16 *getWaypointPtr() { return( waypointPtr ); }
|
2001-07-23 21:26:37 +02:00
|
|
|
bool isPointNear( DVECTOR const &testPos, s32 *xDist, s32 *yDist );
|
2001-06-21 22:10:19 +02:00
|
|
|
void getCurrentWaypointPos( DVECTOR *waypointPos );
|
2001-04-02 21:21:46 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
NPC_PATH_TYPE pathType;
|
|
|
|
u8 waypointCount;
|
|
|
|
bool reversePath;
|
2001-05-30 00:07:28 +02:00
|
|
|
u8 currentWaypoint;
|
|
|
|
u8 lastWaypoint;
|
2001-04-04 20:35:07 +02:00
|
|
|
s32 minX, maxX;
|
2001-04-07 17:39:22 +02:00
|
|
|
s32 minY, maxY;
|
2001-05-30 00:07:28 +02:00
|
|
|
|
|
|
|
u16 *waypointPtr;
|
2001-01-16 22:56:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|