This commit is contained in:
Charles 2001-02-27 21:25:22 +00:00
parent fb13af9532
commit bb1837c2d3
23 changed files with 342 additions and 85 deletions

View File

@ -28,7 +28,7 @@
#endif #endif
void CNpc::processCloseAnemone1Attack( int _frames ) void CNpcEnemy::processCloseAnemone1Attack( int _frames )
{ {
s32 moveX, moveY; s32 moveX, moveY;
s16 decDir, incDir, moveDist; s16 decDir, incDir, moveDist;
@ -121,7 +121,7 @@ void CNpc::processCloseAnemone1Attack( int _frames )
} }
} }
void CNpc::processCloseAnemone2Attack( int _frames ) void CNpcEnemy::processCloseAnemone2Attack( int _frames )
{ {
int fireLoop; int fireLoop;
CProjectile *projectile; CProjectile *projectile;
@ -142,7 +142,7 @@ void CNpc::processCloseAnemone2Attack( int _frames )
m_sensorFunc = NPC_SENSOR_NONE; m_sensorFunc = NPC_SENSOR_NONE;
} }
void CNpc::processCloseAnemone3Attack( int _frames ) void CNpcEnemy::processCloseAnemone3Attack( int _frames )
{ {
CProjectile *projectile; CProjectile *projectile;
u8 lifetime = 8; u8 lifetime = 8;

View File

@ -24,7 +24,7 @@
#endif #endif
void CNpc::processCloseBoogerMonsterAttack( int _frames ) void CNpcEnemy::processCloseBoogerMonsterAttack( int _frames )
{ {
s32 velocity; s32 velocity;

View File

@ -24,7 +24,7 @@
#endif #endif
void CNpc::processCloseClamAttack( int _frames ) void CNpcEnemy::processCloseClamAttack( int _frames )
{ {
s32 velocity; s32 velocity;
@ -77,7 +77,7 @@ void CNpc::processCloseClamAttack( int _frames )
} }
} }
void CNpc::processClamRetract( int _frames ) void CNpcEnemy::processClamRetract( int _frames )
{ {
s32 velocity; s32 velocity;

View File

@ -27,7 +27,7 @@
#include "projectl\projectl.h" #include "projectl\projectl.h"
#endif #endif
void CNpc::processIronDogfishMovement( int _frames ) void CNpcEnemy::processIronDogfishMovement( int _frames )
{ {
if ( m_movementTimer > 0 ) if ( m_movementTimer > 0 )
{ {
@ -68,7 +68,7 @@ void CNpc::processIronDogfishMovement( int _frames )
} }
} }
void CNpc::processStandardIronDogfishAttack( int _frames ) void CNpcEnemy::processStandardIronDogfishAttack( int _frames )
{ {
if ( playerXDist > 0 ) if ( playerXDist > 0 )
{ {
@ -141,7 +141,7 @@ void CNpc::processStandardIronDogfishAttack( int _frames )
} }
} }
void CNpc::processCloseIronDogfishAttack( int _frames ) void CNpcEnemy::processCloseIronDogfishAttack( int _frames )
{ {
// swipe at player // swipe at player

View File

@ -28,7 +28,7 @@
#endif #endif
void CNpc::processCloseEyeballAttack( int _frames ) void CNpcEnemy::processCloseEyeballAttack( int _frames )
{ {
if ( Next ) if ( Next )
{ {

View File

@ -28,7 +28,7 @@
#endif #endif
void CNpc::processFlyingDutchmanMovement( int _frames ) void CNpcEnemy::processFlyingDutchmanMovement( int _frames )
{ {
if ( m_movementTimer > 0 ) if ( m_movementTimer > 0 )
{ {
@ -69,7 +69,7 @@ void CNpc::processFlyingDutchmanMovement( int _frames )
} }
} }
void CNpc::processCloseFlyingDutchmanAttack( int _frames ) void CNpcEnemy::processCloseFlyingDutchmanAttack( int _frames )
{ {
if ( playerYDist > 0 ) if ( playerYDist > 0 )
{ {

View File

@ -24,7 +24,7 @@
#endif #endif
void CNpc::processFishFolkMovementModifier( int _frames, s32 distX, s32 distY ) void CNpcEnemy::processFishFolkMovementModifier( int _frames, s32 distX, s32 distY )
{ {
Pos.vy += distY; Pos.vy += distY;

View File

@ -24,7 +24,7 @@
#endif #endif
void CNpc::processCloseFlamingSkullAttack( int _frames ) void CNpcEnemy::processCloseFlamingSkullAttack( int _frames )
{ {
s32 distX, distY; s32 distX, distY;
s32 distXSqr, distYSqr; s32 distXSqr, distYSqr;

View File

@ -20,11 +20,11 @@
#endif #endif
void CNpc::processGaryMovement( int _frames ) void CNpcFriend::processGaryMovement( int _frames )
{ {
s8 multiplier = -1 + ( 2 * m_extension ); s8 multiplier = -1 + ( 2 * m_extension );
s32 maxHeight = 10; s32 maxHeight = 10;
s32 fallSpeed = 5; s32 fallSpeed = 3;
s8 yMovement = fallSpeed * _frames; s8 yMovement = fallSpeed * _frames;
s8 groundHeight; s8 groundHeight;

View File

@ -24,7 +24,7 @@
#endif #endif
void CNpc::processGenericGotoTarget( int _frames, s32 xDist, s32 yDist, s32 speed ) void CNpcEnemy::processGenericGotoTarget( int _frames, s32 xDist, s32 yDist, s32 speed )
{ {
s16 decDir, incDir, moveDist; s16 decDir, incDir, moveDist;
s32 moveX, moveY; s32 moveX, moveY;
@ -83,7 +83,7 @@ void CNpc::processGenericGotoTarget( int _frames, s32 xDist, s32 yDist, s32 spee
Pos.vy += moveY; Pos.vy += moveY;
} }
void CNpc::processGenericGetUserDist( int _frames, s32 *distX, s32 *distY ) void CNpcEnemy::processGenericGetUserDist( int _frames, s32 *distX, s32 *distY )
{ {
s32 moveX = 0, moveY = 0; s32 moveX = 0, moveY = 0;
@ -99,7 +99,7 @@ void CNpc::processGenericGetUserDist( int _frames, s32 *distX, s32 *distY )
*distY = playerPos.vy - this->Pos.vy; *distY = playerPos.vy - this->Pos.vy;
} }
bool CNpc::processGroundCollisionReverse( s32 *moveX, s32 *moveY ) bool CNpcEnemy::processGroundCollisionReverse( s32 *moveX, s32 *moveY )
{ {
bool xBlocked = false; bool xBlocked = false;
bool yBlocked = false; bool yBlocked = false;
@ -153,7 +153,7 @@ bool CNpc::processGroundCollisionReverse( s32 *moveX, s32 *moveY )
return( xBlocked | yBlocked ); return( xBlocked | yBlocked );
} }
void CNpc::processGenericFixedPathMove( int _frames, s32 *moveX, s32 *moveY, s32 *moveVel, s32 *moveDist ) void CNpcEnemy::processGenericFixedPathMove( int _frames, s32 *moveX, s32 *moveY, s32 *moveVel, s32 *moveDist )
{ {
bool pathComplete; bool pathComplete;
bool waypointChange; bool waypointChange;
@ -226,7 +226,7 @@ void CNpc::processGenericFixedPathMove( int _frames, s32 *moveX, s32 *moveY, s32
} }
} }
void CNpc::processGenericFixedPathWalk( int _frames, s32 *moveX, s32 *moveY ) void CNpcEnemy::processGenericFixedPathWalk( int _frames, s32 *moveX, s32 *moveY )
{ {
s32 maxHeight = 10; s32 maxHeight = 10;
s32 distX, distY; s32 distX, distY;
@ -295,7 +295,7 @@ void CNpc::processGenericFixedPathWalk( int _frames, s32 *moveX, s32 *moveY )
} }
} }
void CNpc::processGenericCircularPath( int _frames ) void CNpcEnemy::processGenericCircularPath( int _frames )
{ {
m_rotation += m_data[m_type].speed; m_rotation += m_data[m_type].speed;
m_rotation %= 4096; m_rotation %= 4096;
@ -305,7 +305,7 @@ void CNpc::processGenericCircularPath( int _frames )
} }
bool CNpc::isCollisionWithGround() bool CNpcEnemy::isCollisionWithGround()
{ {
ASSERT(m_layerCollision); ASSERT(m_layerCollision);
return m_layerCollision->Get( Pos.vx >> 4, ( Pos.vy + 1 ) >> 4 ) ? 16:0; return m_layerCollision->Get( Pos.vx >> 4, ( Pos.vy + 1 ) >> 4 ) ? 16:0;

View File

@ -28,7 +28,7 @@
#endif #endif
void CNpc::processCloseGhostPirateAttack( int _frames ) void CNpcEnemy::processCloseGhostPirateAttack( int _frames )
{ {
s32 velocity; s32 velocity;

View File

@ -24,7 +24,7 @@
#endif #endif
void CNpc::processMotherJellyfishMovement( int _frames ) void CNpcEnemy::processMotherJellyfishMovement( int _frames )
{ {
s32 xDist, yDist; s32 xDist, yDist;
s32 xDistSqr, yDistSqr; s32 xDistSqr, yDistSqr;
@ -106,7 +106,7 @@ void CNpc::processMotherJellyfishMovement( int _frames )
} }
} }
void CNpc::processCloseMotherJellyfishAttack( int _frames ) void CNpcEnemy::processCloseMotherJellyfishAttack( int _frames )
{ {
// seek position above user // seek position above user

View File

@ -24,7 +24,7 @@
#endif #endif
void CNpc::processBabyOctopusMovementModifier( int _frames, s32 dist, s16 headingChange ) void CNpcEnemy::processBabyOctopusMovementModifier( int _frames, s32 dist, s16 headingChange )
{ {
s32 newX, newY; s32 newX, newY;
s32 preShiftX, preShiftY; s32 preShiftX, preShiftY;

View File

@ -45,17 +45,176 @@
#include "game\convo.h" #include "game\convo.h"
#endif #endif
#include "Gfx\Skel.h"
#include "gfx\anim.h"
s32 CNpc::playerXDist; #ifndef __VID_HEADER_
s32 CNpc::playerYDist; #include "system\vid.h"
s32 CNpc::playerXDistSqr; #endif
s32 CNpc::playerYDistSqr;
class CLayerCollision *CNpc::m_layerCollision;
void CNpc::init() ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Friend NPCs
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
class CLayerCollision *CNpcFriend::m_layerCollision;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcFriend::init()
{
CNpcThing::init();
sActorHdr *Hdr=m_skel.Load(ACTORS_SPONGEBOB_A3D);
m_skel.Init(Hdr);
TPLoadTex(ACTORS_ACTOR_SPONGEBOB_TEX);
m_skel.setAnimDatabase(CAnimDB::Load(ACTORS_SPONGEBOB_ABK));
Pos.vx = 100;
Pos.vy = 100;
m_extension = EXTEND_RIGHT;
// temporary
m_animNo = 0;
m_frame = 0;
m_type = NPC_FRIEND_GARY;
//m_spriteBank=new ("enemy sprites") SpriteBank();
//m_spriteBank->load(UI_UIGFX_SPR);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcFriend::shutdown()
{
//m_spriteBank->dump(); delete m_spriteBank;
CNpcThing::shutdown();
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcFriend::think(int _frames)
{
CNpcThing::think(_frames);
switch( m_data[m_type].movementFunc )
{
case NPC_FRIEND_MOVEMENT_GARY:
processGaryMovement( _frames );
break;
case NPC_FRIEND_MOVEMENT_STATIC:
default:
break;
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcFriend::render()
{
CNpcThing::render();
// Render
DVECTOR renderPos;
DVECTOR offset = CLevel::getCameraPos();
renderPos.vx = ( Pos.vx - offset.vx - ( VidGetScrW() >> 1 ) ) * 20;
renderPos.vy = ( Pos.vy - offset.vy - ( VidGetScrH() >> 1 ) ) * 20;
m_skel.setPos( renderPos );
m_skel.setFrame(m_frame);
m_skel.setAnimNo(m_animNo);
m_skel.Animate(this);
m_skel.Render(this);
/*s32 x,y;
s32 scrnWidth = VidGetScrW();
s32 scrnHeight = VidGetScrH();
s32 spriteWidth = m_spriteBank->getFrameWidth(FRM_BARNACLEBOY);
s32 spriteHeight = m_spriteBank->getFrameHeight(FRM_BARNACLEBOY);
x = Pos.vx - offset.vx - ( spriteWidth >> 1 );
y = Pos.vy - offset.vy - ( spriteHeight >> 1 );
//if ( x < -spriteWidth || y < -spriteHeight || x > scrnWidth || y > scrnHeight )
//{
//return;
//}
m_spriteBank->printFT4(FRM_BARNACLEBOY,x,y,0,0,0);*/
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcFriend::processEvent( GAME_EVENT evt, CThing *sourceThing )
{
switch( evt )
{
case USER_REQUEST_TALK_EVENT:
{
if ( m_data[this->m_type].canTalk )
{
DVECTOR sourcePos;
s32 xDiffSqr, yDiffSqr;
// check talk distance
sourcePos = sourceThing->getPos();
xDiffSqr = this->Pos.vx - sourcePos.vx;
xDiffSqr *= xDiffSqr;
yDiffSqr = this->Pos.vy - sourcePos.vy;
yDiffSqr *= yDiffSqr;
if ( xDiffSqr + yDiffSqr < 10000 )
{
if( !CConversation::isActive() )
{
CConversation::trigger( SCRIPTS_SPEECHTEST_DAT );
}
}
}
break;
}
default:
// ignore
break;
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Enemy NPCs
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
s32 CNpcEnemy::playerXDist;
s32 CNpcEnemy::playerYDist;
s32 CNpcEnemy::playerXDistSqr;
s32 CNpcEnemy::playerYDistSqr;
class CLayerCollision *CNpcEnemy::m_layerCollision;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcEnemy::init()
{ {
CEnemyThing::init(); CEnemyThing::init();
sActorHdr *Hdr=m_skel.Load(ACTORS_SPONGEBOB_A3D);
m_skel.Init(Hdr);
TPLoadTex(ACTORS_ACTOR_SPONGEBOB_TEX);
m_skel.setAnimDatabase(CAnimDB::Load(ACTORS_SPONGEBOB_ABK));
// temporary
m_animNo = 0;
m_frame = 0;
m_type = NPC_CIRCULAR_PLATFORM; m_type = NPC_CIRCULAR_PLATFORM;
m_heading = m_fireHeading = 0; m_heading = m_fireHeading = 0;
@ -278,16 +437,18 @@ m_npcPath.initPath();
} }
} }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpc::shutdown() void CNpcEnemy::shutdown()
{ {
m_npcPath.removeAllWaypoints(); m_npcPath.removeAllWaypoints();
CEnemyThing::shutdown(); CEnemyThing::shutdown();
} }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpc::think(int _frames) void CNpcEnemy::think(int _frames)
{ {
CEnemyThing::think(_frames); CEnemyThing::think(_frames);
@ -333,8 +494,9 @@ void CNpc::think(int _frames)
processTimer(_frames); processTimer(_frames);
} }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpc::detectCollisionWithPlayer() void CNpcEnemy::detectCollisionWithPlayer()
{ {
if ( m_data[m_type].detectCollision && playerXDistSqr + playerYDistSqr < 400 ) if ( m_data[m_type].detectCollision && playerXDistSqr + playerYDistSqr < 400 )
{ {
@ -345,8 +507,9 @@ void CNpc::detectCollisionWithPlayer()
} }
} }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool CNpc::processSensor() bool CNpcEnemy::processSensor()
{ {
switch( m_sensorFunc ) switch( m_sensorFunc )
{ {
@ -650,7 +813,9 @@ bool CNpc::processSensor()
} }
} }
void CNpc::processMovement(int _frames) ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcEnemy::processMovement(int _frames)
{ {
if ( _frames > 2 ) if ( _frames > 2 )
{ {
@ -738,13 +903,6 @@ void CNpc::processMovement(int _frames)
break; break;
} }
case NPC_MOVEMENT_GARY:
{
processGaryMovement( _frames );
}
break;
default: default:
break; break;
@ -753,7 +911,9 @@ void CNpc::processMovement(int _frames)
processMovementModifier( _frames, moveX, moveY, moveVel, moveDist ); processMovementModifier( _frames, moveX, moveY, moveVel, moveDist );
} }
void CNpc::processMovementModifier(int _frames, s32 distX, s32 distY, s32 dist, s16 headingChange) ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcEnemy::processMovementModifier(int _frames, s32 distX, s32 distY, s32 dist, s16 headingChange)
{ {
switch( m_data[m_type].movementModifierFunc ) switch( m_data[m_type].movementModifierFunc )
{ {
@ -793,11 +953,15 @@ void CNpc::processMovementModifier(int _frames, s32 distX, s32 distY, s32 dist,
} }
} }
void CNpc::processShot() ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcEnemy::processShot()
{ {
} }
void CNpc::processClose(int _frames) ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcEnemy::processClose(int _frames)
{ {
switch( m_data[this->m_type].closeFunc ) switch( m_data[this->m_type].closeFunc )
{ {
@ -908,7 +1072,9 @@ void CNpc::processClose(int _frames)
} }
} }
void CNpc::processCollision() ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcEnemy::processCollision()
{ {
CPlayer *player = GameScene.getPlayer(); CPlayer *player = GameScene.getPlayer();
@ -917,7 +1083,9 @@ void CNpc::processCollision()
m_controlFunc = m_oldControlFunc; m_controlFunc = m_oldControlFunc;
} }
void CNpc::processTimer(int _frames) ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcEnemy::processTimer(int _frames)
{ {
if ( m_timerTimer > 0 ) if ( m_timerTimer > 0 )
{ {
@ -948,12 +1116,29 @@ void CNpc::processTimer(int _frames)
} }
} }
void CNpc::render() ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcEnemy::render()
{ {
CEnemyThing::render(); CEnemyThing::render();
// Render
DVECTOR renderPos;
DVECTOR offset = CLevel::getCameraPos();
renderPos.vx = ( Pos.vx - offset.vx ) * 20;
renderPos.vy = ( Pos.vy - offset.vy ) * 20;
m_skel.setPos( renderPos );
m_skel.setFrame(m_frame);
m_skel.setAnimNo(m_animNo);
m_skel.Animate(this);
m_skel.Render(this);
} }
void CNpc::processEvent( GAME_EVENT evt, CThing *sourceThing ) ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcEnemy::processEvent( GAME_EVENT evt, CThing *sourceThing )
{ {
switch( evt ) switch( evt )
{ {

View File

@ -30,17 +30,87 @@
#include "player\player.h" #include "player\player.h"
#endif #endif
// temporary
#ifndef __GFX_SPRBANK_H__
#include "gfx\sprbank.h"
#endif
/*****************************************************************************/ /*****************************************************************************/
class CNpc : public CEnemyThing class CNpcFriend : public CNpcThing
{
public:
enum NPC_FRIEND_UNIT_TYPE
{
NPC_FRIEND_SANDY_CHEEKS = 0,
NPC_FRIEND_GARY = 1,
NPC_FRIEND_UNIT_TYPE_MAX,
};
void init();
void shutdown();
void think(int _frames);
virtual void render();
void processEvent( GAME_EVENT evt, CThing *sourceThing );
void setLayerCollision( class CLayerCollision *_layer ) {m_layerCollision=_layer;}
protected:
enum NPC_FRIEND_MOVEMENT_FUNC
{
NPC_FRIEND_MOVEMENT_STATIC = 0,
NPC_FRIEND_MOVEMENT_GARY = 1,
};
typedef struct NPC_FRIEND_DATA_TYPE
{
//NPC_FRIEND_INIT_FUNC initFunc;
//NPC_FRIEND_SENSOR_FUNC sensorFunc;
NPC_FRIEND_MOVEMENT_FUNC movementFunc;
//NPC_FRIEND_MOVEMENT_MODIFIER_FUNC movementModifierFunc;
//NPC_FRIEND_CLOSE_FUNC closeFunc;
//NPC_FRIEND_TIMER_FUNC timerFunc;
bool canTalk;
u8 speed;
u16 turnSpeed;
bool detectCollision;
DAMAGE_TYPE damageToUserType;
}
NPC_FRIEND_DATA;
// gary functions
void processGaryMovement( int _frames );
// data
static NPC_FRIEND_DATA m_data[NPC_FRIEND_UNIT_TYPE_MAX];
static class CLayerCollision *m_layerCollision;
//class SpriteBank *m_spriteBank;
enum
{
EXTEND_RIGHT = true,
EXTEND_LEFT = false,
};
// internal variables
NPC_FRIEND_UNIT_TYPE m_type;
s32 m_extension;
int m_frame;
int m_animNo;
CSkel m_skel;
};
class CNpcEnemy : public CEnemyThing
{ {
public: public:
enum NPC_UNIT_TYPE enum NPC_UNIT_TYPE
{ {
NPC_SANDY_CHEEKS = 0, NPC_FALLING_ITEM = 0,
NPC_GARY = 1, NPC_FISH_HOOK = 1,
NPC_FALLING_ITEM,
NPC_FISH_HOOK,
NPC_DUST_DEVIL, NPC_DUST_DEVIL,
NPC_PENDULUM, NPC_PENDULUM,
NPC_FIREBALL, NPC_FIREBALL,
@ -182,7 +252,6 @@ protected:
NPC_MOVEMENT_FIREBALL, NPC_MOVEMENT_FIREBALL,
NPC_MOVEMENT_RETURNING_HAZARD, NPC_MOVEMENT_RETURNING_HAZARD,
NPC_MOVEMENT_CLAM_RETRACT, NPC_MOVEMENT_CLAM_RETRACT,
NPC_MOVEMENT_GARY,
}; };
enum NPC_MOVEMENT_MODIFIER_FUNC enum NPC_MOVEMENT_MODIFIER_FUNC
@ -371,10 +440,6 @@ protected:
void processFireballMovement( int _frames ); void processFireballMovement( int _frames );
void processReturningHazardMovement( int _frames ); void processReturningHazardMovement( int _frames );
// gary functions
void processGaryMovement( int _frames );
// data // data
static NPC_DATA m_data[NPC_UNIT_TYPE_MAX]; static NPC_DATA m_data[NPC_UNIT_TYPE_MAX];
@ -407,6 +472,10 @@ protected:
DVECTOR m_base; DVECTOR m_base;
u8 m_state; u8 m_state;
u8 m_salvoCount; u8 m_salvoCount;
int m_frame;
int m_animNo;
CSkel m_skel;
}; };

View File

@ -20,15 +20,15 @@
#endif #endif
CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] = CNpcFriend::NPC_FRIEND_DATA CNpcFriend::m_data[NPC_FRIEND_UNIT_TYPE_MAX] =
{ {
{ // NPC_SANDY_CHEEKS { // NPC_SANDY_CHEEKS
NPC_INIT_DEFAULT, //NPC_FRIEND_INIT_DEFAULT,
NPC_SENSOR_NONE, //NPC_FRIEND_SENSOR_NONE,
NPC_MOVEMENT_STATIC, NPC_FRIEND_MOVEMENT_STATIC,
NPC_MOVEMENT_MODIFIER_NONE, //NPC_FRIEND_MOVEMENT_MODIFIER_NONE,
NPC_CLOSE_NONE, //NPC_FRIEND_CLOSE_NONE,
NPC_TIMER_NONE, //NPC_FRIEND_TIMER_NONE,
true, true,
3, 3,
128, 128,
@ -37,19 +37,22 @@ CNpc::NPC_DATA CNpc::m_data[NPC_UNIT_TYPE_MAX] =
}, },
{ // NPC_GARY { // NPC_GARY
NPC_INIT_DEFAULT, //NPC_FRIEND_INIT_DEFAULT,
NPC_SENSOR_NONE, //NPC_FRIEND_SENSOR_NONE,
NPC_MOVEMENT_GARY, NPC_FRIEND_MOVEMENT_GARY,
NPC_MOVEMENT_MODIFIER_NONE, //NPC_FRIEND_MOVEMENT_MODIFIER_NONE,
NPC_CLOSE_NONE, //NPC_FRIEND_CLOSE_NONE,
NPC_TIMER_NONE, //NPC_FRIEND_TIMER_NONE,
false, false,
3, 3,
2048, 2048,
false, false,
DAMAGE__HIT_ENEMY, DAMAGE__HIT_ENEMY,
}, },
};
CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{
{ // NPC_FALLING_ITEM { // NPC_FALLING_ITEM
NPC_INIT_DEFAULT, NPC_INIT_DEFAULT,
NPC_SENSOR_FALLING_ITEM_USER_CLOSE, NPC_SENSOR_FALLING_ITEM_USER_CLOSE,

View File

@ -24,7 +24,7 @@
#endif #endif
void CNpc::processCloseSpiderCrabAttack( int _frames ) void CNpcEnemy::processCloseSpiderCrabAttack( int _frames )
{ {
s32 velocity; s32 velocity;
DVECTOR newPos = Pos; DVECTOR newPos = Pos;

View File

@ -24,7 +24,7 @@
#endif #endif
void CNpc::processCloseSharkManAttack( int _frames ) void CNpcEnemy::processCloseSharkManAttack( int _frames )
{ {
s32 moveX = 0, moveY = 0; s32 moveX = 0, moveY = 0;
s32 groundHeight; s32 groundHeight;

View File

@ -24,7 +24,7 @@
#endif #endif
void CNpc::processSmallJellyfishMovementModifier( int _frames, s32 distX, s32 distY, s32 dist, s16 headingChange ) void CNpcEnemy::processSmallJellyfishMovementModifier( int _frames, s32 distX, s32 distY, s32 dist, s16 headingChange )
{ {
s32 newX, newY; s32 newX, newY;
s32 preShiftX, preShiftY; s32 preShiftX, preShiftY;
@ -100,7 +100,7 @@ void CNpc::processSmallJellyfishMovementModifier( int _frames, s32 distX, s32 di
Pos.vy += newY; Pos.vy += newY;
} }
void CNpc::processCloseSmallJellyfishEvade( int _frames ) void CNpcEnemy::processCloseSmallJellyfishEvade( int _frames )
{ {
s32 moveX = 0, moveY = 0; s32 moveX = 0, moveY = 0;

View File

@ -24,7 +24,7 @@
#endif #endif
void CNpc::processCloseSkeletalFishAttack( int _frames ) void CNpcEnemy::processCloseSkeletalFishAttack( int _frames )
{ {
s32 moveX, moveY; s32 moveX, moveY;
s16 decDir, incDir, moveDist; s16 decDir, incDir, moveDist;

View File

@ -27,7 +27,7 @@
#include "projectl\projectl.h" #include "projectl\projectl.h"
#endif #endif
void CNpc::processSubSharkMovement( int _frames ) void CNpcEnemy::processSubSharkMovement( int _frames )
{ {
if ( m_timerTimer <= 0 ) if ( m_timerTimer <= 0 )
{ {
@ -84,7 +84,7 @@ void CNpc::processSubSharkMovement( int _frames )
} }
} }
void CNpc::processCloseSubSharkAttack( int _frames ) void CNpcEnemy::processCloseSubSharkAttack( int _frames )
{ {
if ( playerXDist > 0 ) if ( playerXDist > 0 )
{ {

View File

@ -24,7 +24,7 @@
#endif #endif
void CNpc::processCloseSkullStomperAttack( int _frames ) void CNpcEnemy::processCloseSkullStomperAttack( int _frames )
{ {
s8 groundHeight; s8 groundHeight;
s8 yMovement; s8 yMovement;

View File

@ -100,8 +100,8 @@ void CGameScene::init()
Level.init(); Level.init();
#ifdef __USER_charles__ #ifdef __USER_charles__
C2dEnemy *enemy; CNpcFriend *enemy;
enemy=new ("test enemy") C2dEnemy; enemy=new ("test enemy") CNpcFriend;
enemy->init(); enemy->init();
enemy->setLayerCollision( Level.getCollisionLayer() ); enemy->setLayerCollision( Level.getCollisionLayer() );
#endif #endif