2001-01-22 17:01:49 +01:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
projectl.h
|
|
|
|
|
|
|
|
Author: CRB
|
|
|
|
Created:
|
|
|
|
Project: Spongebob
|
|
|
|
Purpose:
|
|
|
|
|
|
|
|
Copyright (c) 2000 Climax Development Ltd
|
|
|
|
|
|
|
|
===========================================================================*/
|
|
|
|
|
|
|
|
#ifndef __PROJECTL_PROJECTL_H__
|
|
|
|
#define __PROJECTL_PROJECTL_H__
|
|
|
|
|
2001-02-27 17:59:50 +01:00
|
|
|
#ifndef __THING_THING_H__
|
|
|
|
#include "thing/thing.h"
|
|
|
|
#endif
|
|
|
|
|
2001-01-22 17:01:49 +01:00
|
|
|
/*****************************************************************************/
|
|
|
|
|
2001-02-27 17:59:50 +01:00
|
|
|
class CProjectile : public CEnemyProjectileThing
|
2001-01-22 17:01:49 +01:00
|
|
|
{
|
|
|
|
public:
|
2001-01-22 23:24:53 +01:00
|
|
|
enum PROJECTILE_MOVEMENT_TYPE
|
|
|
|
{
|
2001-04-04 00:01:52 +02:00
|
|
|
PROJECTILE_FIXED = 0,
|
|
|
|
PROJECTILE_DUMBFIRE = 1,
|
|
|
|
PROJECTILE_USER_SEEK,
|
2001-02-08 16:34:18 +01:00
|
|
|
PROJECTILE_GAS_CLOUD,
|
2001-01-22 23:24:53 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
enum PROJECTILE_LIFETIME_TYPE
|
|
|
|
{
|
|
|
|
PROJECTILE_FINITE_LIFE = 0,
|
|
|
|
PROJECTILE_INFINITE_LIFE = 1,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum PROJECTILE_STATE
|
|
|
|
{
|
|
|
|
PROJECTILE_ATTACK = 0,
|
|
|
|
PROJECTILE_RETURN = 1,
|
|
|
|
};
|
|
|
|
|
2001-01-22 17:01:49 +01:00
|
|
|
void init();
|
|
|
|
void init( DVECTOR initPos, s16 initHeading );
|
2001-01-22 23:24:53 +01:00
|
|
|
void init( DVECTOR initPos, s16 initHeading, PROJECTILE_MOVEMENT_TYPE initMoveType, PROJECTILE_LIFETIME_TYPE initLifeType );
|
2001-02-08 16:42:59 +01:00
|
|
|
void init( DVECTOR initPos, s16 initHeading, PROJECTILE_MOVEMENT_TYPE initMoveType, PROJECTILE_LIFETIME_TYPE initLifeType, s32 initLifetime );
|
2001-01-22 17:01:49 +01:00
|
|
|
void shutdown();
|
2001-04-25 21:52:35 +02:00
|
|
|
void setToShutdown();
|
|
|
|
u8 isSetToShutdown() {return( m_isShuttingDown );}
|
2001-01-22 17:01:49 +01:00
|
|
|
void think(int _frames);
|
|
|
|
virtual void render();
|
|
|
|
void processEvent( GAME_EVENT evt, CThing *sourceThing );
|
2001-04-04 00:01:52 +02:00
|
|
|
void setMovementType( PROJECTILE_MOVEMENT_TYPE moveType );
|
|
|
|
PROJECTILE_MOVEMENT_TYPE getMovementType();
|
|
|
|
void setState( PROJECTILE_STATE newState );
|
2001-04-04 17:53:44 +02:00
|
|
|
void setLifeTime( PROJECTILE_LIFETIME_TYPE lifeType );
|
2001-04-04 00:01:52 +02:00
|
|
|
void setPosition( DVECTOR newPos );
|
2001-04-12 16:55:55 +02:00
|
|
|
void setLayerCollision( class CLayerCollision *_layer ) {m_layerCollision=_layer;}
|
|
|
|
|
|
|
|
private:
|
|
|
|
class CLayerCollision *m_layerCollision;
|
2001-01-22 17:01:49 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
DVECTOR getScreenOffset();
|
2001-01-22 23:24:53 +01:00
|
|
|
bool processTargetSeek( int _frames, DVECTOR targetPos );
|
2001-04-12 18:33:48 +02:00
|
|
|
void collidedWith( CThing *_thisThing );
|
2001-01-22 17:01:49 +01:00
|
|
|
|
2001-01-22 23:24:53 +01:00
|
|
|
class SpriteBank *m_spriteBank;
|
2001-02-08 21:00:58 +01:00
|
|
|
DVECTOR m_initPos;
|
2001-01-22 23:24:53 +01:00
|
|
|
s16 m_heading;
|
|
|
|
s32 m_lifetime;
|
2001-02-08 21:00:58 +01:00
|
|
|
s32 m_extension;
|
2001-01-22 23:24:53 +01:00
|
|
|
PROJECTILE_MOVEMENT_TYPE m_movementType;
|
|
|
|
PROJECTILE_LIFETIME_TYPE m_lifetimeType;
|
|
|
|
PROJECTILE_STATE m_state;
|
|
|
|
u16 m_turnSpeed;
|
2001-04-25 17:41:29 +02:00
|
|
|
u8 m_isShuttingDown;
|
2001-01-22 17:01:49 +01:00
|
|
|
};
|
|
|
|
|
2001-04-07 00:21:01 +02:00
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
class CPlayerProjectile : public CPlayerProjectileThing
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
enum PLAYER_PROJECTILE_MOVEMENT_TYPE
|
|
|
|
{
|
|
|
|
PLAYER_PROJECTILE_DUMBFIRE = 0,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum PLAYER_PROJECTILE_LIFETIME_TYPE
|
|
|
|
{
|
|
|
|
PLAYER_PROJECTILE_FINITE_LIFE = 0,
|
|
|
|
PLAYER_PROJECTILE_INFINITE_LIFE = 1,
|
|
|
|
};
|
|
|
|
|
|
|
|
void init();
|
|
|
|
void init( DVECTOR initPos, s16 initHeading );
|
|
|
|
void init( DVECTOR initPos, s16 initHeading, PLAYER_PROJECTILE_MOVEMENT_TYPE initMoveType, PLAYER_PROJECTILE_LIFETIME_TYPE initLifeType );
|
|
|
|
void init( DVECTOR initPos, s16 initHeading, PLAYER_PROJECTILE_MOVEMENT_TYPE initMoveType, PLAYER_PROJECTILE_LIFETIME_TYPE initLifeType, s32 initLifetime );
|
|
|
|
void shutdown();
|
2001-04-25 21:52:35 +02:00
|
|
|
void setToShutdown();
|
|
|
|
u8 isSetToShutdown() {return( m_isShuttingDown );}
|
2001-04-30 20:55:38 +02:00
|
|
|
virtual void think(int _frames);
|
2001-04-07 00:21:01 +02:00
|
|
|
virtual void render();
|
|
|
|
void processEvent( GAME_EVENT evt, CThing *sourceThing );
|
|
|
|
void setMovementType( PLAYER_PROJECTILE_MOVEMENT_TYPE moveType );
|
|
|
|
PLAYER_PROJECTILE_MOVEMENT_TYPE getMovementType();
|
|
|
|
void setLifeTime( PLAYER_PROJECTILE_LIFETIME_TYPE lifeType );
|
|
|
|
void setPosition( DVECTOR newPos );
|
2001-04-12 16:55:55 +02:00
|
|
|
void setLayerCollision( class CLayerCollision *_layer ) {m_layerCollision=_layer;}
|
|
|
|
|
|
|
|
private:
|
|
|
|
class CLayerCollision *m_layerCollision;
|
2001-04-07 00:21:01 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
DVECTOR getScreenOffset();
|
2001-04-12 18:33:48 +02:00
|
|
|
void collidedWith( CThing *_thisThing );
|
2001-04-07 00:21:01 +02:00
|
|
|
|
|
|
|
class SpriteBank *m_spriteBank;
|
|
|
|
DVECTOR m_initPos;
|
|
|
|
s16 m_heading;
|
|
|
|
s32 m_lifetime;
|
|
|
|
s32 m_extension;
|
|
|
|
PLAYER_PROJECTILE_MOVEMENT_TYPE m_movementType;
|
|
|
|
PLAYER_PROJECTILE_LIFETIME_TYPE m_lifetimeType;
|
|
|
|
u16 m_turnSpeed;
|
2001-04-20 23:29:11 +02:00
|
|
|
int m_frame;
|
|
|
|
POLY_FT4 *SprFrame;
|
|
|
|
u8 m_reversed;
|
2001-04-25 17:41:29 +02:00
|
|
|
u8 m_isShuttingDown;
|
2001-04-07 00:21:01 +02:00
|
|
|
};
|
|
|
|
|
2001-01-22 17:01:49 +01:00
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
#endif
|