This commit is contained in:
Charles 2001-04-20 20:22:16 +00:00
parent 952fb82287
commit f613848385
27 changed files with 552 additions and 730 deletions

View File

@ -194,6 +194,30 @@ void CNpcAnemone1Enemy::processClose( int _frames )
} }
} }
void CNpcAnemone2Enemy::postInit()
{
CProjectile *projectile;
s16 heading;
for ( int fireLoop = 0 ; fireLoop < 5 ; fireLoop++ )
{
DVECTOR spikePos;
heading = m_heading - 1024 + ( fireLoop * 512 );
heading &= 4095;
spikePos = Pos;
spikePos.vx += ( 40 * rcos( heading ) ) >> 12;
spikePos.vy += ( 40 * rsin( heading ) ) >> 12;
projectile = new( "anemone lev2 projectile" ) CProjectile;
projectile->init( spikePos, heading, CProjectile::PROJECTILE_FIXED, CProjectile::PROJECTILE_INFINITE_LIFE );
projectile->setLayerCollision( m_layerCollision );
addChild( projectile );
}
}
void CNpcAnemone2Enemy::processClose( int _frames ) void CNpcAnemone2Enemy::processClose( int _frames )
{ {
int fireLoop; int fireLoop;

View File

@ -32,6 +32,8 @@ protected:
class CNpcAnemone2Enemy : public CNpcAnemoneEnemy class CNpcAnemone2Enemy : public CNpcAnemoneEnemy
{ {
public:
virtual void postInit();
protected: protected:
virtual void processClose( int _frames ); virtual void processClose( int _frames );
}; };

View File

@ -27,6 +27,13 @@
#include <ACTOR_BALLBLOB_ANIM.h> #include <ACTOR_BALLBLOB_ANIM.h>
#endif #endif
void CNpcBallBlobEnemy::postInit()
{
m_heading = m_fireHeading = 128;
m_npcPath.setPathType( CNpcPath::PONG_PATH );
}
void CNpcBallBlobEnemy::processMovement( int _frames ) void CNpcBallBlobEnemy::processMovement( int _frames )
{ {
s32 moveX = 0, moveY = 0; s32 moveX = 0, moveY = 0;

View File

@ -16,6 +16,8 @@
class CNpcBallBlobEnemy : public CNpcEnemy class CNpcBallBlobEnemy : public CNpcEnemy
{ {
public:
virtual void postInit();
protected: protected:
virtual void processMovement( int _frames ); virtual void processMovement( int _frames );
}; };

View File

@ -15,6 +15,10 @@
#include "enemy\npc.h" #include "enemy\npc.h"
#endif #endif
#ifndef __ENEMY_NBOOGER_H__
#include "enemy\nbooger.h"
#endif
#ifndef __GAME_GAME_H__ #ifndef __GAME_GAME_H__
#include "game\game.h" #include "game\game.h"
#endif #endif
@ -24,7 +28,31 @@
#endif #endif
void CNpcEnemy::processCloseBoogerMonsterAttack( int _frames ) bool CNpcBoogerMonsterEnemy::processSensor()
{
switch( m_sensorFunc )
{
case NPC_SENSOR_NONE:
return( false );
default:
{
if ( playerXDistSqr + playerYDistSqr < 400 )
{
m_controlFunc = NPC_CONTROL_CLOSE;
m_extendDir = EXTEND_UP;
return( true );
}
else
{
return( false );
}
}
}
}
void CNpcBoogerMonsterEnemy::processClose( int _frames )
{ {
s32 velocity; s32 velocity;

View File

@ -15,6 +15,10 @@
#include "enemy\npc.h" #include "enemy\npc.h"
#endif #endif
#ifndef __ENEMY_NDOGFISH_H__
#include "enemy\ndogfish.h"
#endif
#ifndef __GAME_GAME_H__ #ifndef __GAME_GAME_H__
#include "game\game.h" #include "game\game.h"
#endif #endif
@ -31,7 +35,36 @@
#include <ACTOR_IRONDOGFISH_ANIM.h> #include <ACTOR_IRONDOGFISH_ANIM.h>
#endif #endif
void CNpcEnemy::processIronDogfishMovement( int _frames ) void CNpcIronDogfishEnemy::postInit()
{
m_state = IRON_DOGFISH_THUMP_1;
m_extendDir = EXTEND_RIGHT;
}
bool CNpcIronDogfishEnemy::processSensor()
{
switch( m_sensorFunc )
{
case NPC_SENSOR_NONE:
return( false );
default:
{
if ( playerXDistSqr + playerYDistSqr < 10000 )
{
m_controlFunc = NPC_CONTROL_CLOSE;
return( true );
}
else
{
return( false );
}
}
}
}
void CNpcIronDogfishEnemy::processMovement( int _frames )
{ {
if ( m_movementTimer > 0 ) if ( m_movementTimer > 0 )
{ {
@ -79,7 +112,7 @@ void CNpcEnemy::processIronDogfishMovement( int _frames )
} }
} }
void CNpcEnemy::processStandardIronDogfishAttack( int _frames ) void CNpcIronDogfishEnemy::processStandardIronDogfishAttack( int _frames )
{ {
if ( playerXDist > 0 ) if ( playerXDist > 0 )
{ {
@ -176,7 +209,7 @@ void CNpcEnemy::processStandardIronDogfishAttack( int _frames )
} }
} }
void CNpcEnemy::processCloseIronDogfishAttack( int _frames ) void CNpcIronDogfishEnemy::processClose( int _frames )
{ {
// swipe at player // swipe at player

View File

@ -15,6 +15,10 @@
#include "enemy\npc.h" #include "enemy\npc.h"
#endif #endif
#ifndef __ENEMY_NFDUTCH_H__
#include "enemy\nfdutch.h"
#endif
#ifndef __GAME_GAME_H__ #ifndef __GAME_GAME_H__
#include "game\game.h" #include "game\game.h"
#endif #endif
@ -31,7 +35,18 @@
#include <ACTOR_FLYINGDUTCHMAN_ANIM.h> #include <ACTOR_FLYINGDUTCHMAN_ANIM.h>
#endif #endif
void CNpcEnemy::processFlyingDutchmanMovement( int _frames ) void CNpcFlyingDutchmanEnemy::postInit()
{
m_state = FLYING_DUTCHMAN_ATTACK_PLAYER_1;
m_extendDir = EXTEND_UP;
s32 minX, maxX;
m_npcPath.getPathXExtents( &minX, &maxX );
m_extension = minX;
}
void CNpcFlyingDutchmanEnemy::processMovement( int _frames )
{ {
if ( !m_animPlaying ) if ( !m_animPlaying )
{ {
@ -98,7 +113,7 @@ void CNpcEnemy::processFlyingDutchmanMovement( int _frames )
} }
} }
void CNpcEnemy::processCloseFlyingDutchmanAttack( int _frames ) void CNpcFlyingDutchmanEnemy::processClose( int _frames )
{ {
if ( playerYDist > 0 ) if ( playerYDist > 0 )
{ {

View File

@ -28,6 +28,25 @@
#endif #endif
void CNpcFishFolk::postInit()
{
m_heading = m_fireHeading = 0;
DVECTOR newPos;
newPos.vx = 200;
newPos.vy = 400;
m_npcPath.addWaypoint( newPos );
newPos.vx = 500;
newPos.vy = 400;
m_npcPath.addWaypoint( newPos );
m_npcPath.setPathType( CNpcPath::PONG_PATH );
}
void CNpcFishFolk::processMovementModifier( int _frames, s32 distX, s32 distY, s32 dist, s16 headingChange ) void CNpcFishFolk::processMovementModifier( int _frames, s32 distX, s32 distY, s32 dist, s16 headingChange )
{ {
Pos.vy += distY; Pos.vy += distY;

View File

@ -16,6 +16,8 @@
class CNpcFishFolk : public CNpcEnemy class CNpcFishFolk : public CNpcEnemy
{ {
public:
virtual void postInit();
protected: protected:
virtual void processMovementModifier( int _frames, s32 distX, s32 distY, s32 dist, s16 headingChange ); virtual void processMovementModifier( int _frames, s32 distX, s32 distY, s32 dist, s16 headingChange );
}; };

View File

@ -73,12 +73,42 @@ void CNpcEnemy::processGenericGotoTarget( int _frames, s32 xDist, s32 yDist, s32
moveX = preShiftX / abs( preShiftX ); moveX = preShiftX / abs( preShiftX );
} }
if ( xDist > 0 )
{
if ( moveX > xDist )
{
moveX = xDist;
}
}
else
{
if ( moveX < xDist )
{
moveX = xDist;
}
}
moveY = preShiftY >> 12; moveY = preShiftY >> 12;
if ( !moveY && preShiftY ) if ( !moveY && preShiftY )
{ {
moveY = preShiftY / abs( preShiftY ); moveY = preShiftY / abs( preShiftY );
} }
if ( yDist > 0 )
{
if ( moveY > yDist )
{
moveY = yDist;
}
}
else
{
if ( moveY < yDist )
{
moveY = yDist;
}
}
Pos.vx += moveX; Pos.vx += moveX;
Pos.vy += moveY; Pos.vy += moveY;
} }

View File

@ -32,6 +32,11 @@
#endif #endif
void CNpcGhostPirateEnemy::postInit()
{
m_heading = m_fireHeading = 3072;
}
bool CNpcGhostPirateEnemy::processSensor() bool CNpcGhostPirateEnemy::processSensor()
{ {
switch( m_sensorFunc ) switch( m_sensorFunc )

View File

@ -16,6 +16,8 @@
class CNpcGhostPirateEnemy : public CNpcEnemy class CNpcGhostPirateEnemy : public CNpcEnemy
{ {
public:
virtual void postInit();
protected: protected:
virtual bool processSensor(); virtual bool processSensor();
virtual void processClose( int _frames ); virtual void processClose( int _frames );

View File

@ -31,6 +31,13 @@
#include <ACTOR_HERMITCRAB_ANIM.h> #include <ACTOR_HERMITCRAB_ANIM.h>
#endif #endif
void CNpcHermitCrabEnemy::postInit()
{
m_npcPath.setPathType( CNpcPath::PONG_PATH );
m_state = HERMIT_CRAB_NO_ATTACK;
}
bool CNpcHermitCrabEnemy::processSensor() bool CNpcHermitCrabEnemy::processSensor()
{ {
switch( m_sensorFunc ) switch( m_sensorFunc )

View File

@ -21,9 +21,17 @@
class CNpcHermitCrabEnemy : public CNpcEnemy class CNpcHermitCrabEnemy : public CNpcEnemy
{ {
public: public:
virtual void postInit();
protected: protected:
virtual bool processSensor(); virtual bool processSensor();
virtual void processClose( int _frames ); virtual void processClose( int _frames );
enum NPC_HERMIT_CRAB_STATE
{
HERMIT_CRAB_NO_ATTACK = 0,
HERMIT_CRAB_PUNCH_ATTACK = 1,
HERMIT_CRAB_ROLL_ATTACK,
};
}; };
#endif #endif

View File

@ -1,6 +1,6 @@
/*========================================================================= /*=========================================================================
nnjfish.cpp nmjfish.cpp
Author: CRB Author: CRB
Created: Created:
@ -15,6 +15,10 @@
#include "enemy\npc.h" #include "enemy\npc.h"
#endif #endif
#ifndef __ENEMY_NMJFISH_H__
#include "enemy\nmjfish.h"
#endif
#ifndef __GAME_GAME_H__ #ifndef __GAME_GAME_H__
#include "game\game.h" #include "game\game.h"
#endif #endif
@ -27,7 +31,12 @@
#define MJ_HALF_CYCLE_WIDTH ( MJ_CYCLE_WIDTH >> 1 ) #define MJ_HALF_CYCLE_WIDTH ( MJ_CYCLE_WIDTH >> 1 )
void CNpcEnemy::processMotherJellyfishMovement( int _frames ) void CNpcMotherJellyfishEnemy::postInit()
{
m_state = MOTHER_JELLYFISH_RETURN_TO_START_1;
}
void CNpcMotherJellyfishEnemy::processMovement( int _frames )
{ {
s32 xDist, yDist; s32 xDist, yDist;
s32 xDistSqr, yDistSqr; s32 xDistSqr, yDistSqr;
@ -125,7 +134,7 @@ void CNpcEnemy::processMotherJellyfishMovement( int _frames )
} }
} }
void CNpcEnemy::processCloseMotherJellyfishAttack( int _frames ) void CNpcMotherJellyfishEnemy::processClose( int _frames )
{ {
switch( m_state ) switch( m_state )
{ {

View File

@ -87,7 +87,7 @@ void CNpcBabyOctopusEnemy::processMovementModifier( int _frames, s32 distX, s32
s32 absVelocity = abs( m_velocity ); s32 absVelocity = abs( m_velocity );
s32 reqVelocity = dist; s32 reqVelocity = dist;
resistance = _frames * NPC_JELLYFISH_RESISTANCE; resistance = _frames * NPC_OCTOPUS_RESISTANCE;
if ( absVelocity < resistance ) if ( absVelocity < resistance )
{ {

View File

@ -20,6 +20,11 @@ protected:
virtual bool processSensor(); virtual bool processSensor();
virtual void processClose( int _frames ); virtual void processClose( int _frames );
virtual void processMovementModifier( int _frames, s32 distX, s32 distY, s32 dist, s16 headingChange ); virtual void processMovementModifier( int _frames, s32 distX, s32 distY, s32 dist, s16 headingChange );
enum
{
NPC_OCTOPUS_RESISTANCE = 64,
};
}; };
#endif #endif

View File

@ -114,6 +114,38 @@
#include "enemy\nfskull.h" #include "enemy\nfskull.h"
#endif #endif
#ifndef __ENEMY_NSSTOMP_H__
#include "enemy\nsstomp.h"
#endif
#ifndef __ENEMY_NBOOGER_H__
#include "enemy\nbooger.h"
#endif
#ifndef __ENEMY_NMJFISH_H__
#include "enemy\nmjfish.h"
#endif
#ifndef __ENEMY_NSSHARK_H__
#include "enemy\nsshark.h"
#endif
#ifndef __ENEMY_NWORM_H__
#include "enemy\nworm.h"
#endif
#ifndef __ENEMY_NFDUTCH_H__
#include "enemy\nfdutch.h"
#endif
#ifndef __ENEMY_NDOGFISH_H__
#include "enemy\ndogfish.h"
#endif
#ifndef __ENEMY_NHAZARD_H__
#include "enemy\nhazard.h"
#endif
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Friend NPCs // Friend NPCs
@ -375,6 +407,84 @@ CNpcEnemy *CNpcEnemy::Create(sThingActor *ThisActor)
break; break;
} }
case CNpcEnemy::NPC_SKULL_STOMPER:
{
enemy = new ("skull stomper") CNpcSkullStomperEnemy;
break;
}
case CNpcEnemy::NPC_BOOGER_MONSTER:
{
enemy = new ("booger monster") CNpcBoogerMonsterEnemy;
break;
}
case CNpcEnemy::NPC_MOTHER_JELLYFISH:
{
enemy = new ("mother jellyfish") CNpcMotherJellyfishEnemy;
break;
}
case CNpcEnemy::NPC_SUB_SHARK:
{
enemy = new ("sub shark") CNpcSubSharkEnemy;
break;
}
case CNpcEnemy::NPC_PARASITIC_WORM:
{
enemy = new ("parasitic worm") CNpcParasiticWormEnemy;
break;
}
case CNpcEnemy::NPC_FLYING_DUTCHMAN:
{
enemy = new ("flying dutchman") CNpcFlyingDutchmanEnemy;
break;
}
case CNpcEnemy::NPC_IRON_DOGFISH:
{
enemy = new ("iron dogfish") CNpcIronDogfishEnemy;
break;
}
case CNpcEnemy::NPC_FALLING_ITEM:
{
enemy = new ("falling item") CNpcFallingItemHazard;
break;
}
case CNpcEnemy::NPC_FISH_HOOK:
{
enemy = new ("fish hook") CNpcFishHookHazard;
break;
}
case CNpcEnemy::NPC_PENDULUM:
{
enemy = new ("pendulum") CNpcPendulumHazard;
break;
}
case CNpcEnemy::NPC_FIREBALL:
{
enemy = new ("fireball") CNpcFireballHazard;
break;
}
case CNpcEnemy::NPC_SAW_BLADE:
{
enemy = new ("saw blade") CNpcReturningHazard;
break;
}
case CNpcEnemy::NPC_DUST_DEVIL:
{
enemy = new ("dust devil") CNpcReturningGroundHazard;
break;
}
default: default:
{ {
enemy = new ("npc enemy") CNpcEnemy; enemy = new ("npc enemy") CNpcEnemy;
@ -513,288 +623,7 @@ void CNpcEnemy::init()
void CNpcEnemy::postInit() void CNpcEnemy::postInit()
{ {
switch ( m_data[this->m_type].initFunc ) m_npcPath.setPathType( CNpcPath::PONG_PATH );
{
case NPC_INIT_DEFAULT:
{
m_npcPath.setPathType( CNpcPath::PONG_PATH );
break;
}
case NPC_INIT_BALL_BLOB:
{
m_heading = m_fireHeading = 128;
m_npcPath.setPathType( CNpcPath::PONG_PATH );
break;
}
case NPC_INIT_HERMIT_CRAB:
{
m_npcPath.setPathType( CNpcPath::PONG_PATH );
m_state = HERMIT_CRAB_NO_ATTACK;
break;
}
case NPC_INIT_GHOST_PIRATE:
m_heading = m_fireHeading = 3072;
break;
case NPC_INIT_SKULL_STOMPER:
{
m_extendDir = EXTEND_DOWN;
break;
}
case NPC_INIT_MOTHER_JELLYFISH:
{
m_state = MOTHER_JELLYFISH_RETURN_TO_START_1;
break;
}
case NPC_INIT_FLYING_DUTCHMAN:
{
m_state = FLYING_DUTCHMAN_ATTACK_PLAYER_1;
m_extendDir = EXTEND_UP;
s32 minX, maxX;
m_npcPath.getPathXExtents( &minX, &maxX );
m_extension = minX;
break;
}
case NPC_INIT_SUB_SHARK:
{
m_state = SUB_SHARK_MINE_1;
m_extendDir = EXTEND_RIGHT;
break;
}
case NPC_INIT_IRON_DOGFISH:
{
m_state = IRON_DOGFISH_THUMP_1;
m_extendDir = EXTEND_RIGHT;
break;
}
case NPC_INIT_FISH_HOOK:
{
m_heading = m_fireHeading = 3072;
DVECTOR newPos;
newPos.vx = 100;
newPos.vy = -100;
m_npcPath.addWaypoint( newPos );
m_npcPath.setPathType( CNpcPath::SINGLE_USE_PATH );
break;
}
case NPC_INIT_PENDULUM:
{
m_extendDir = EXTEND_LEFT;
m_extension = 0;
m_heading = 1024;
break;
}
case NPC_INIT_FIREBALL:
{
DVECTOR newPos;
newPos.vx = 300;
newPos.vy = 100;
m_npcPath.addWaypoint( newPos );
m_npcPath.setPathType( CNpcPath::SINGLE_USE_PATH );
m_extension = 0;
m_velocity = m_data[m_type].speed;
m_timerTimer = GameState::getOneSecondInFrames() * 4;
break;
}
case NPC_INIT_RETURNING_HAZARD:
{
m_npcPath.setPathType( CNpcPath::SINGLE_USE_PATH );
break;
}
case NPC_INIT_FISH_FOLK:
{
m_heading = m_fireHeading = 0;
DVECTOR newPos;
newPos.vx = 200;
newPos.vy = 400;
m_npcPath.addWaypoint( newPos );
newPos.vx = 500;
newPos.vy = 400;
m_npcPath.addWaypoint( newPos );
m_npcPath.setPathType( CNpcPath::PONG_PATH );
break;
}
case NPC_INIT_ANEMONE_2:
{
CProjectile *projectile;
s16 heading;
for ( int fireLoop = 0 ; fireLoop < 5 ; fireLoop++ )
{
DVECTOR spikePos;
heading = m_heading - 1024 + ( fireLoop * 512 );
heading &= 4095;
spikePos = Pos;
spikePos.vx += ( 40 * rcos( heading ) ) >> 12;
spikePos.vy += ( 40 * rsin( heading ) ) >> 12;
projectile = new( "anemone lev2 projectile" ) CProjectile;
projectile->init( spikePos, heading, CProjectile::PROJECTILE_FIXED, CProjectile::PROJECTILE_INFINITE_LIFE );
projectile->setLayerCollision( m_layerCollision );
addChild( projectile );
}
break;
}
case NPC_INIT_CIRCULAR_PLATFORM:
{
Pos.vx = 300;
Pos.vy = 300;
m_base = Pos;
m_extendDir = EXTEND_CLOCKWISE;
m_extension = 100;
break;
}
case NPC_INIT_PARASITIC_WORM:
{
DVECTOR newPos;
newPos.vx = 100;
//newPos.vy = 10;
newPos.vy = 100;
m_npcPath.addWaypoint( newPos );
newPos.vx = 500;
//newPos.vy = 10;
newPos.vy = 100;
m_npcPath.addWaypoint( newPos );
newPos.vx = 500;
//newPos.vy = 100;
newPos.vy = 300;
m_npcPath.addWaypoint( newPos );
newPos.vx = 100;
//newPos.vy = 100;
newPos.vy = 300;
m_npcPath.addWaypoint( newPos );
m_npcPath.setPathType( CNpcPath::PONG_PATH );
// create start of list
CNpcPositionHistory *newPosition;
newPosition = new ("position history") CNpcPositionHistory;
newPosition->pos = Pos;
m_positionHistory = newPosition;
CNpcPositionHistory *currentPosition = m_positionHistory;
// create rest of list
for ( int histLength = 1 ; histLength < ( NPC_PARASITIC_WORM_LENGTH * NPC_PARASITIC_WORM_SPACING ) ; histLength++ )
{
newPosition = new ("position history") CNpcPositionHistory;
newPosition->pos = Pos;
newPosition->next = NULL;
newPosition->prev = currentPosition;
currentPosition->next = newPosition;
currentPosition = newPosition;
}
// link ends together for circular list
currentPosition->next = m_positionHistory;
m_positionHistory->prev = currentPosition;
for ( int segCount = 0 ; segCount < NPC_PARASITIC_WORM_LENGTH ; segCount++ )
{
CNpcEnemy *segment;
segment = new ("segment") CNpcEnemy;
segment->setType( CNpcEnemy::NPC_PARASITIC_WORM_SEGMENT );
segment->init();
segment->setLayerCollision( m_layerCollision );
this->addChild( segment );
}
m_movementTimer = 2 * GameState::getOneSecondInFrames();
break;
}
case NPC_INIT_PARASITIC_WORM_SEGMENT:
{
break;
}
case NPC_INIT_SPIDER_CRAB:
{
m_npcPath.setPathType( CNpcPath::PONG_PATH );
if ( m_layerCollision->getHeightFromGround( Pos.vx, Pos.vy, 16 ) < 0 )
//if ( m_layerCollision->Get( Pos.vx >> 4, Pos.vy >> 4 ) )
{
// starting off below ground, jump initially
m_velocity = 5;
m_movementFunc = NPC_MOVEMENT_SPIDER_CRAB_INITJUMP;
}
break;
}
default:
break;
}
} }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -1030,16 +859,6 @@ void CNpcEnemy::collidedWith( CThing *_thisThing )
bool CNpcEnemy::processSensor() bool CNpcEnemy::processSensor()
{ {
/*// temporary
if ( playerXDistSqr + playerYDistSqr < 10000 )
{
m_controlFunc = NPC_CONTROL_SHOT;
m_state = NPC_GENERIC_HIT_CHECK_HEALTH;
return( true );
}
// temporary*/
switch( m_sensorFunc ) switch( m_sensorFunc )
{ {
case NPC_SENSOR_NONE: case NPC_SENSOR_NONE:
@ -1049,8 +868,7 @@ bool CNpcEnemy::processSensor()
{ {
switch( m_sensorFunc ) switch( m_sensorFunc )
{ {
case NPC_SENSOR_OIL_BLOB_USER_CLOSE: case NPC_SENSOR_GENERIC_USER_CLOSE:
case NPC_SENSOR_NINJA_STARFISH_USER_CLOSE:
{ {
if ( playerXDistSqr + playerYDistSqr < 10000 ) if ( playerXDistSqr + playerYDistSqr < 10000 )
{ {
@ -1167,93 +985,6 @@ bool CNpcEnemy::processSensor()
} }
} }
case NPC_SENSOR_PARASITIC_WORM_USER_CLOSE:
{
if ( playerXDistSqr + playerYDistSqr < 40000 )
{
m_controlFunc = NPC_CONTROL_CLOSE;
return( true );
}
else
{
return( false );
}
}
case NPC_SENSOR_SKULL_STOMPER_USER_CLOSE:
{
if ( playerXDistSqr < 10000 && playerYDist >= 0 )
{
m_controlFunc = NPC_CONTROL_CLOSE;
m_extendDir = EXTEND_DOWN;
return( true );
}
else
{
return( false );
}
}
case NPC_SENSOR_BOOGER_MONSTER_USER_CLOSE:
{
if ( playerXDistSqr + playerYDistSqr < 400 )
{
m_controlFunc = NPC_CONTROL_CLOSE;
m_extendDir = EXTEND_UP;
return( true );
}
else
{
return( false );
}
}
case NPC_SENSOR_IRON_DOGFISH_USER_CLOSE:
{
if ( playerXDistSqr + playerYDistSqr < 10000 )
{
m_controlFunc = NPC_CONTROL_CLOSE;
return( true );
}
else
{
return( false );
}
}
case NPC_SENSOR_FISH_HOOK_USER_CLOSE:
{
if ( playerXDistSqr + playerYDistSqr < 400 )
{
m_controlFunc = NPC_CONTROL_CLOSE;
return( true );
}
else
{
return( false );
}
}
case NPC_SENSOR_FALLING_ITEM_USER_CLOSE:
{
if ( playerXDistSqr + playerYDistSqr < 40000 )
{
m_controlFunc = NPC_CONTROL_CLOSE;
m_movementTimer = GameState::getOneSecondInFrames() * 3;
return( true );
}
else
{
return( false );
}
}
default: default:
return( false ); return( false );
} }
@ -1323,69 +1054,6 @@ void CNpcEnemy::processMovement(int _frames)
break; break;
} }
case NPC_MOVEMENT_MOTHER_JELLYFISH:
{
processMotherJellyfishMovement( _frames );
break;
}
case NPC_MOVEMENT_FLYING_DUTCHMAN:
{
processFlyingDutchmanMovement( _frames );
break;
}
case NPC_MOVEMENT_PARASITIC_WORM:
{
processParasiticWormMovement( _frames );
break;
}
case NPC_MOVEMENT_SUB_SHARK:
{
processSubSharkMovement( _frames );
break;
}
case NPC_MOVEMENT_IRON_DOGFISH:
{
processIronDogfishMovement( _frames );
break;
}
case NPC_MOVEMENT_PENDULUM:
{
processPendulumMovement( _frames );
break;
}
case NPC_MOVEMENT_FIREBALL:
{
processFireballMovement( _frames );
break;
}
case NPC_MOVEMENT_RETURNING_HAZARD:
{
processReturningHazardMovement( _frames );
break;
}
case NPC_MOVEMENT_RETURNING_HAZARD_GROUND:
{
processReturningHazardMovementGround( _frames );
break;
}
default: default:
break; break;
@ -1507,51 +1175,6 @@ void CNpcEnemy::processClose(int _frames)
break; break;
} }
case NPC_CLOSE_SKULL_STOMPER_ATTACK:
processCloseSkullStomperAttack( _frames );
break;
case NPC_CLOSE_BOOGER_MONSTER_ATTACK:
processCloseBoogerMonsterAttack( _frames );
break;
case NPC_CLOSE_MOTHER_JELLYFISH_ATTACK:
processCloseMotherJellyfishAttack( _frames );
break;
case NPC_CLOSE_FLYING_DUTCHMAN_ATTACK:
processCloseFlyingDutchmanAttack( _frames );
break;
case NPC_CLOSE_SUB_SHARK_ATTACK:
processCloseSubSharkAttack( _frames );
break;
case NPC_CLOSE_IRON_DOGFISH_ATTACK:
processCloseIronDogfishAttack( _frames );
break;
case NPC_CLOSE_FALLING_ITEM_FALL:
processCloseFallingItemFall( _frames );
break;
case NPC_CLOSE_FISH_HOOK_RISE:
processCloseFishHookRise( _frames );
break;
case NPC_CLOSE_PARASITIC_WORM_ATTACK:
processCloseParasiticWormAttack( _frames );
break;
default: default:
break; break;
} }

View File

@ -187,32 +187,6 @@ protected:
protected: protected:
// NPC data structure definitions // // NPC data structure definitions //
enum NPC_INIT_FUNC
{
NPC_INIT_DEFAULT = 0,
NPC_INIT_SNAKE = 1,
NPC_INIT_ACID,
NPC_INIT_GHOST_PIRATE,
NPC_INIT_SKULL_STOMPER,
NPC_INIT_MOTHER_JELLYFISH,
NPC_INIT_SUB_SHARK,
NPC_INIT_FLYING_DUTCHMAN,
NPC_INIT_IRON_DOGFISH,
NPC_INIT_FALLING_ITEM,
NPC_INIT_FISH_HOOK,
NPC_INIT_PENDULUM,
NPC_INIT_FIREBALL,
NPC_INIT_RETURNING_HAZARD,
NPC_INIT_FISH_FOLK,
NPC_INIT_CIRCULAR_PLATFORM,
NPC_INIT_PARASITIC_WORM,
NPC_INIT_PARASITIC_WORM_SEGMENT,
NPC_INIT_HERMIT_CRAB,
NPC_INIT_BALL_BLOB,
NPC_INIT_ANEMONE_2,
NPC_INIT_SPIDER_CRAB,
};
enum NPC_CONTROL_FUNC enum NPC_CONTROL_FUNC
{ {
NPC_CONTROL_NONE, NPC_CONTROL_NONE,
@ -226,31 +200,14 @@ protected:
{ {
NPC_SENSOR_NONE = 0, NPC_SENSOR_NONE = 0,
NPC_SENSOR_USER_CLOSE = 1, NPC_SENSOR_USER_CLOSE = 1,
NPC_SENSOR_NINJA_STARFISH_USER_CLOSE, NPC_SENSOR_GENERIC_USER_CLOSE,
NPC_SENSOR_GENERIC_USER_VISIBLE, NPC_SENSOR_GENERIC_USER_VISIBLE,
NPC_SENSOR_OIL_BLOB_USER_CLOSE,
NPC_SENSOR_SKULL_STOMPER_USER_CLOSE,
NPC_SENSOR_BOOGER_MONSTER_USER_CLOSE,
NPC_SENSOR_IRON_DOGFISH_USER_CLOSE,
NPC_SENSOR_FALLING_ITEM_USER_CLOSE,
NPC_SENSOR_FISH_HOOK_USER_CLOSE,
NPC_SENSOR_PARASITIC_WORM_USER_CLOSE,
}; };
enum NPC_CLOSE_FUNC enum NPC_CLOSE_FUNC
{ {
NPC_CLOSE_NONE = 0, NPC_CLOSE_NONE = 0,
NPC_CLOSE_GENERIC_USER_SEEK = 1, NPC_CLOSE_GENERIC_USER_SEEK = 1,
NPC_CLOSE_SKULL_STOMPER_ATTACK,
NPC_CLOSE_BOOGER_MONSTER_ATTACK,
NPC_CLOSE_MOTHER_JELLYFISH_ATTACK,
NPC_CLOSE_SUB_SHARK_ATTACK,
NPC_CLOSE_FLYING_DUTCHMAN_ATTACK,
NPC_CLOSE_IRON_DOGFISH_ATTACK,
NPC_CLOSE_FALLING_ITEM_FALL,
NPC_CLOSE_FISH_HOOK_RISE,
NPC_CLOSE_HERMIT_CRAB_ATTACK,
NPC_CLOSE_PARASITIC_WORM_ATTACK,
}; };
enum NPC_MOVEMENT_FUNC enum NPC_MOVEMENT_FUNC
@ -258,18 +215,7 @@ protected:
NPC_MOVEMENT_STATIC = 0, NPC_MOVEMENT_STATIC = 0,
NPC_MOVEMENT_FIXED_PATH = 1, NPC_MOVEMENT_FIXED_PATH = 1,
NPC_MOVEMENT_FIXED_PATH_WALK, NPC_MOVEMENT_FIXED_PATH_WALK,
NPC_MOVEMENT_MOTHER_JELLYFISH,
NPC_MOVEMENT_SUB_SHARK,
NPC_MOVEMENT_FLYING_DUTCHMAN,
NPC_MOVEMENT_IRON_DOGFISH,
NPC_MOVEMENT_PENDULUM,
NPC_MOVEMENT_FIREBALL,
NPC_MOVEMENT_RETURNING_HAZARD,
NPC_MOVEMENT_CLAM_RETRACT,
NPC_MOVEMENT_PARASITIC_WORM,
NPC_MOVEMENT_STATIC_CYCLE_ANIM, NPC_MOVEMENT_STATIC_CYCLE_ANIM,
NPC_MOVEMENT_RETURNING_HAZARD_GROUND,
NPC_MOVEMENT_SPIDER_CRAB_INITJUMP,
}; };
enum NPC_TIMER_FUNC enum NPC_TIMER_FUNC
@ -286,50 +232,6 @@ protected:
NPC_SHOT_GENERIC = 1, NPC_SHOT_GENERIC = 1,
}; };
enum NPC_MOTHER_JELLYFISH_STATE
{
MOTHER_JELLYFISH_RETURN_TO_START_1 = 0,
MOTHER_JELLYFISH_CYCLE_1 = 1,
MOTHER_JELLYFISH_ATTACK_PLAYER_SPAWN_1,
MOTHER_JELLYFISH_RETURN_TO_START_2,
MOTHER_JELLYFISH_CYCLE_2,
MOTHER_JELLYFISH_ATTACK_PLAYER_SPAWN_2,
MOTHER_JELLYFISH_RETURN_TO_START_3,
MOTHER_JELLYFISH_CYCLE_3,
MOTHER_JELLYFISH_ATTACK_PLAYER_SHOCK,
};
enum NPC_SUB_SHARK_STATE
{
SUB_SHARK_MINE_1 = 0,
SUB_SHARK_MINE_2 = 1,
SUB_SHARK_CYCLE,
SUB_SHARK_SWALLOW,
};
enum NPC_FLYING_DUTCHMAN_STATE
{
FLYING_DUTCHMAN_ATTACK_PLAYER_1 = 0,
FLYING_DUTCHMAN_ATTACK_PLAYER_2 = 1,
FLYING_DUTCHMAN_ATTACK_PLAYER_3,
};
enum NPC_IRON_DOGFISH_STATE
{
IRON_DOGFISH_THUMP_1 = 0,
IRON_DOGFISH_LASER_EYE_1 = 1,
IRON_DOGFISH_THUMP_2,
IRON_DOGFISH_ROLL,
IRON_DOGFISH_LASER_EYE_2,
};
enum NPC_HERMIT_CRAB_STATE
{
HERMIT_CRAB_NO_ATTACK = 0,
HERMIT_CRAB_PUNCH_ATTACK = 1,
HERMIT_CRAB_ROLL_ATTACK,
};
enum NPC_GENERIC_HIT_STATE enum NPC_GENERIC_HIT_STATE
{ {
NPC_GENERIC_HIT_CHECK_HEALTH = 100, NPC_GENERIC_HIT_CHECK_HEALTH = 100,
@ -340,11 +242,6 @@ protected:
enum enum
{ {
NPC_JELLYFISH_RESISTANCE = 64,
NPC_BOOGER_MONSTER_MAX_EXTENSION = 20,
NPC_SUB_SHARK_HIGH_SPEED = 6,
NPC_PARASITIC_WORM_SPACING = 6,
NPC_PARASITIC_WORM_LENGTH = 10,
EXTEND_UP = true, EXTEND_UP = true,
EXTEND_DOWN = false, EXTEND_DOWN = false,
EXTEND_RIGHT = true, EXTEND_RIGHT = true,
@ -368,7 +265,6 @@ protected:
int skelType; int skelType;
// FileEquate animData; // FileEquate animData;
u16 initAnim; u16 initAnim;
NPC_INIT_FUNC initFunc;
NPC_SENSOR_FUNC sensorFunc; NPC_SENSOR_FUNC sensorFunc;
NPC_MOVEMENT_FUNC movementFunc; NPC_MOVEMENT_FUNC movementFunc;
NPC_CLOSE_FUNC closeFunc; NPC_CLOSE_FUNC closeFunc;
@ -409,54 +305,6 @@ protected:
void reinit(); void reinit();
// flaming skull functions
void processCloseFlamingSkullAttack( int _frames );
// skull stomper functions
void processCloseSkullStomperAttack( int _frames );
// booger monster functions
void processCloseBoogerMonsterAttack( int _frames );
// mother jellyfish functions
void processMotherJellyfishMovement( int _frames );
void processCloseMotherJellyfishAttack( int _frames );
// sub shark functions
void processSubSharkMovement( int _frames );
void processCloseSubSharkAttack( int _frames );
// parasitic worm functions
void processParasiticWormMovement( int _frames );
void resetParasiticWormHeadToTail();
void processCloseParasiticWormAttack( int _frames );
// flying dutchman functions
void processFlyingDutchmanMovement( int _frames );
void processCloseFlyingDutchmanAttack( int _frames );
// iron dogfish functions
void processIronDogfishMovement( int _frames );
void processStandardIronDogfishAttack( int _frames );
void processCloseIronDogfishAttack( int _frames );
// hazard functions
void processCloseFallingItemFall( int _frames );
void processCloseFishHookRise( int _frames );
void processPendulumMovement( int _frames );
void processFireballMovement( int _frames );
void processReturningHazardMovement( int _frames );
void processReturningHazardMovementGround( int _frames );
// data // data
static NPC_DATA m_data[NPC_UNIT_TYPE_MAX]; static NPC_DATA m_data[NPC_UNIT_TYPE_MAX];

View File

@ -321,11 +321,9 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_FALLING_ITEM { // NPC_FALLING_ITEM
ACTORS_CLAM_SBK, ACTORS_CLAM_SBK,
ANIM_CLAM_SIDESNAP, ANIM_CLAM_SIDESNAP,
NPC_INIT_DEFAULT, NPC_SENSOR_USER_CLOSE,
//NPC_SENSOR_FALLING_ITEM_USER_CLOSE,
NPC_SENSOR_NONE,
NPC_MOVEMENT_STATIC, NPC_MOVEMENT_STATIC,
NPC_CLOSE_FALLING_ITEM_FALL, NPC_CLOSE_NONE,
NPC_TIMER_NONE, NPC_TIMER_NONE,
false, false,
8, 8,
@ -344,10 +342,9 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_FISH_HOOK { // NPC_FISH_HOOK
ACTORS_CLAM_SBK, ACTORS_CLAM_SBK,
ANIM_CLAM_SIDESNAP, ANIM_CLAM_SIDESNAP,
NPC_INIT_FISH_HOOK, NPC_SENSOR_NONE,
NPC_SENSOR_FISH_HOOK_USER_CLOSE,
NPC_MOVEMENT_STATIC, NPC_MOVEMENT_STATIC,
NPC_CLOSE_FISH_HOOK_RISE, NPC_CLOSE_NONE,
NPC_TIMER_NONE, NPC_TIMER_NONE,
false, false,
3, 3,
@ -366,9 +363,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_DUST_DEVIL { // NPC_DUST_DEVIL
ACTORS_DUSTDEVIL_SBK, ACTORS_DUSTDEVIL_SBK,
ANIM_DUSTDEVIL_TWIST, ANIM_DUSTDEVIL_TWIST,
NPC_INIT_RETURNING_HAZARD,
NPC_SENSOR_NONE, NPC_SENSOR_NONE,
NPC_MOVEMENT_RETURNING_HAZARD_GROUND, NPC_MOVEMENT_STATIC,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
NPC_TIMER_NONE, NPC_TIMER_NONE,
false, false,
@ -388,9 +384,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_PENDULUM { // NPC_PENDULUM
ACTORS_CLAM_SBK, ACTORS_CLAM_SBK,
ANIM_CLAM_SIDESNAP, ANIM_CLAM_SIDESNAP,
NPC_INIT_PENDULUM,
NPC_SENSOR_NONE, NPC_SENSOR_NONE,
NPC_MOVEMENT_PENDULUM, NPC_MOVEMENT_STATIC,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
NPC_TIMER_NONE, NPC_TIMER_NONE,
false, false,
@ -410,9 +405,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_FIREBALL { // NPC_FIREBALL
ACTORS_CLAM_SBK, ACTORS_CLAM_SBK,
ANIM_CLAM_SIDESNAP, ANIM_CLAM_SIDESNAP,
NPC_INIT_FIREBALL,
NPC_SENSOR_NONE, NPC_SENSOR_NONE,
NPC_MOVEMENT_FIREBALL, NPC_MOVEMENT_STATIC,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
NPC_TIMER_NONE, NPC_TIMER_NONE,
false, false,
@ -432,9 +426,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_SAW_BLADE { // NPC_SAW_BLADE
ACTORS_CLAM_SBK, ACTORS_CLAM_SBK,
ANIM_CLAM_SIDESNAP, ANIM_CLAM_SIDESNAP,
NPC_INIT_RETURNING_HAZARD,
NPC_SENSOR_NONE, NPC_SENSOR_NONE,
NPC_MOVEMENT_RETURNING_HAZARD, NPC_MOVEMENT_STATIC,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
NPC_TIMER_NONE, NPC_TIMER_NONE,
false, false,
@ -454,7 +447,6 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_SMALL_JELLYFISH_1 { // NPC_SMALL_JELLYFISH_1
0,//ACTORS_JELLYFISH1_SBK, 0,//ACTORS_JELLYFISH1_SBK,
FRM_JELLYFISH1_SWIM1, FRM_JELLYFISH1_SWIM1,
NPC_INIT_DEFAULT,
NPC_SENSOR_USER_CLOSE, NPC_SENSOR_USER_CLOSE,
NPC_MOVEMENT_FIXED_PATH, NPC_MOVEMENT_FIXED_PATH,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
@ -476,7 +468,6 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_SMALL_JELLYFISH_2 { // NPC_SMALL_JELLYFISH_2
ACTORS_CLAM_SBK, ACTORS_CLAM_SBK,
ANIM_CLAM_SIDESNAP, ANIM_CLAM_SIDESNAP,
NPC_INIT_DEFAULT,
NPC_SENSOR_USER_CLOSE, NPC_SENSOR_USER_CLOSE,
NPC_MOVEMENT_FIXED_PATH, NPC_MOVEMENT_FIXED_PATH,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
@ -498,7 +489,6 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_ANEMONE_1 { // NPC_ANEMONE_1
ACTORS_ANENOMELVL1_SBK, ACTORS_ANENOMELVL1_SBK,
ANIM_ANENOMELVL1_BEND, ANIM_ANENOMELVL1_BEND,
NPC_INIT_DEFAULT,
NPC_SENSOR_USER_CLOSE, NPC_SENSOR_USER_CLOSE,
NPC_MOVEMENT_STATIC_CYCLE_ANIM, NPC_MOVEMENT_STATIC_CYCLE_ANIM,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
@ -520,7 +510,6 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_ANEMONE_2 { // NPC_ANEMONE_2
ACTORS_SPIKEYANENOME_SBK, ACTORS_SPIKEYANENOME_SBK,
ANIM_SPIKEYANENOME_BODY, ANIM_SPIKEYANENOME_BODY,
NPC_INIT_ANEMONE_2,
NPC_SENSOR_USER_CLOSE, NPC_SENSOR_USER_CLOSE,
NPC_MOVEMENT_STATIC_CYCLE_ANIM, NPC_MOVEMENT_STATIC_CYCLE_ANIM,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
@ -542,7 +531,6 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_ANEMONE_3 { // NPC_ANEMONE_3
ACTORS_ANENOMELVL3_SBK, ACTORS_ANENOMELVL3_SBK,
ANIM_ANENOMELVL3_BEND, ANIM_ANENOMELVL3_BEND,
NPC_INIT_DEFAULT,
NPC_SENSOR_USER_CLOSE, NPC_SENSOR_USER_CLOSE,
NPC_MOVEMENT_STATIC_CYCLE_ANIM, NPC_MOVEMENT_STATIC_CYCLE_ANIM,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
@ -564,7 +552,6 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_SKELETAL_FISH { // NPC_SKELETAL_FISH
ACTORS_SKELETALFISH_SBK, ACTORS_SKELETALFISH_SBK,
ANIM_SKELETALFISH_IDLE, ANIM_SKELETALFISH_IDLE,
NPC_INIT_DEFAULT,
NPC_SENSOR_GENERIC_USER_VISIBLE, NPC_SENSOR_GENERIC_USER_VISIBLE,
NPC_MOVEMENT_FIXED_PATH, NPC_MOVEMENT_FIXED_PATH,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
@ -586,7 +573,6 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_CLAM_JUMP { // NPC_CLAM_JUMP
ACTORS_CLAM_SBK, ACTORS_CLAM_SBK,
ANIM_CLAM_SIDESNAP, ANIM_CLAM_SIDESNAP,
NPC_INIT_DEFAULT,
NPC_SENSOR_USER_CLOSE, NPC_SENSOR_USER_CLOSE,
NPC_MOVEMENT_STATIC, NPC_MOVEMENT_STATIC,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
@ -608,7 +594,6 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_CLAM_STATIC { // NPC_CLAM_STATIC
ACTORS_CLAM_SBK, ACTORS_CLAM_SBK,
ANIM_CLAM_SIDESNAP, ANIM_CLAM_SIDESNAP,
NPC_INIT_DEFAULT,
NPC_SENSOR_USER_CLOSE, NPC_SENSOR_USER_CLOSE,
NPC_MOVEMENT_STATIC, NPC_MOVEMENT_STATIC,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
@ -630,7 +615,6 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_SQUID_DART { // NPC_SQUID_DART
0,//ACTORS_SQUIDDART_SBK, 0,//ACTORS_SQUIDDART_SBK,
FRM_SQUIDDART_SWIM0001, FRM_SQUIDDART_SWIM0001,
NPC_INIT_DEFAULT,
NPC_SENSOR_NONE, NPC_SENSOR_NONE,
NPC_MOVEMENT_FIXED_PATH, NPC_MOVEMENT_FIXED_PATH,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
@ -652,7 +636,6 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_FISH_FOLK { // NPC_FISH_FOLK
ACTORS_CLAM_SBK, ACTORS_CLAM_SBK,
ANIM_CLAM_SIDESNAP, ANIM_CLAM_SIDESNAP,
NPC_INIT_FISH_FOLK,
NPC_SENSOR_NONE, NPC_SENSOR_NONE,
NPC_MOVEMENT_FIXED_PATH_WALK, NPC_MOVEMENT_FIXED_PATH_WALK,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
@ -674,7 +657,6 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_PRICKLY_BUG { // NPC_PRICKLY_BUG
ACTORS_CATERPILLAR_SBK, ACTORS_CATERPILLAR_SBK,
ANIM_CATERPILLAR_CRAWL, ANIM_CATERPILLAR_CRAWL,
NPC_INIT_DEFAULT,
NPC_SENSOR_NONE, NPC_SENSOR_NONE,
NPC_MOVEMENT_FIXED_PATH_WALK, NPC_MOVEMENT_FIXED_PATH_WALK,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
@ -696,7 +678,6 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_SEA_SNAKE { // NPC_SEA_SNAKE
ACTORS_CLAM_SBK, ACTORS_CLAM_SBK,
ANIM_CLAM_SIDESNAP, ANIM_CLAM_SIDESNAP,
NPC_INIT_DEFAULT,
NPC_SENSOR_NONE, NPC_SENSOR_NONE,
NPC_MOVEMENT_FIXED_PATH, NPC_MOVEMENT_FIXED_PATH,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
@ -718,7 +699,6 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_PUFFA_FISH { // NPC_PUFFA_FISH
ACTORS_PUFFAFISH_SBK, ACTORS_PUFFAFISH_SBK,
ANIM_PUFFAFISH_PUFFUPIDLE, ANIM_PUFFAFISH_PUFFUPIDLE,
NPC_INIT_DEFAULT,
NPC_SENSOR_USER_CLOSE, NPC_SENSOR_USER_CLOSE,
NPC_MOVEMENT_FIXED_PATH, NPC_MOVEMENT_FIXED_PATH,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
@ -740,7 +720,6 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_ANGLER_FISH { // NPC_ANGLER_FISH
ACTORS_CLAM_SBK, ACTORS_CLAM_SBK,
ANIM_CLAM_SIDESNAP, ANIM_CLAM_SIDESNAP,
NPC_INIT_DEFAULT,
NPC_SENSOR_NONE, NPC_SENSOR_NONE,
NPC_MOVEMENT_FIXED_PATH, NPC_MOVEMENT_FIXED_PATH,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
@ -762,10 +741,9 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_HERMIT_CRAB { // NPC_HERMIT_CRAB
ACTORS_HERMITCRAB_SBK, ACTORS_HERMITCRAB_SBK,
ANIM_HERMITCRAB_IDLE, ANIM_HERMITCRAB_IDLE,
NPC_INIT_HERMIT_CRAB,
NPC_SENSOR_USER_CLOSE, NPC_SENSOR_USER_CLOSE,
NPC_MOVEMENT_FIXED_PATH_WALK, NPC_MOVEMENT_FIXED_PATH_WALK,
NPC_CLOSE_HERMIT_CRAB_ATTACK, NPC_CLOSE_NONE,
NPC_TIMER_NONE, NPC_TIMER_NONE,
false, false,
2, 2,
@ -784,7 +762,6 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_MINE { // NPC_MINE
ACTORS_CLAM_SBK, ACTORS_CLAM_SBK,
ANIM_CLAM_SIDESNAP, ANIM_CLAM_SIDESNAP,
NPC_INIT_DEFAULT,
NPC_SENSOR_NONE, NPC_SENSOR_NONE,
NPC_MOVEMENT_STATIC, NPC_MOVEMENT_STATIC,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
@ -806,10 +783,9 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_BOOGER_MONSTER { // NPC_BOOGER_MONSTER
ACTORS_CLAM_SBK, ACTORS_CLAM_SBK,
ANIM_CLAM_SIDESNAP, ANIM_CLAM_SIDESNAP,
NPC_INIT_DEFAULT, NPC_SENSOR_USER_CLOSE,
NPC_SENSOR_BOOGER_MONSTER_USER_CLOSE,
NPC_MOVEMENT_STATIC, NPC_MOVEMENT_STATIC,
NPC_CLOSE_BOOGER_MONSTER_ATTACK, NPC_CLOSE_NONE,
NPC_TIMER_NONE, NPC_TIMER_NONE,
false, false,
0, 0,
@ -828,7 +804,6 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_SPIDER_CRAB { // NPC_SPIDER_CRAB
ACTORS_SPIDERCRAB_SBK, ACTORS_SPIDERCRAB_SBK,
ANIM_SPIDERCRAB_IDLE, ANIM_SPIDERCRAB_IDLE,
NPC_INIT_SPIDER_CRAB,
NPC_SENSOR_USER_CLOSE, NPC_SENSOR_USER_CLOSE,
NPC_MOVEMENT_FIXED_PATH_WALK, NPC_MOVEMENT_FIXED_PATH_WALK,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
@ -850,7 +825,6 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_SPIDER_CRAB_SPAWNER { // NPC_SPIDER_CRAB_SPAWNER
ACTORS_SPIDERCRAB_SBK, ACTORS_SPIDERCRAB_SBK,
ANIM_SPIDERCRAB_IDLE, ANIM_SPIDERCRAB_IDLE,
NPC_INIT_DEFAULT,
NPC_SENSOR_NONE, NPC_SENSOR_NONE,
NPC_MOVEMENT_STATIC, NPC_MOVEMENT_STATIC,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
@ -872,7 +846,6 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_EYEBALL { // NPC_EYEBALL
ACTORS_EYEBALL_SBK, ACTORS_EYEBALL_SBK,
ANIM_EYEBALL_STALK, ANIM_EYEBALL_STALK,
NPC_INIT_DEFAULT,
NPC_SENSOR_USER_CLOSE, NPC_SENSOR_USER_CLOSE,
NPC_MOVEMENT_STATIC, NPC_MOVEMENT_STATIC,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
@ -894,7 +867,6 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_BABY_OCTOPUS { // NPC_BABY_OCTOPUS
ACTORS_BABYOCTOPUS_SBK, ACTORS_BABYOCTOPUS_SBK,
ANIM_BABYOCTOPUS_IDLE, ANIM_BABYOCTOPUS_IDLE,
NPC_INIT_DEFAULT,
NPC_SENSOR_USER_CLOSE, NPC_SENSOR_USER_CLOSE,
NPC_MOVEMENT_FIXED_PATH, NPC_MOVEMENT_FIXED_PATH,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
@ -916,7 +888,6 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_ZOMBIE_FISH_FOLK { // NPC_ZOMBIE_FISH_FOLK
ACTORS_CLAM_SBK, ACTORS_CLAM_SBK,
ANIM_CLAM_SIDESNAP, ANIM_CLAM_SIDESNAP,
NPC_INIT_FISH_FOLK,
NPC_SENSOR_NONE, NPC_SENSOR_NONE,
NPC_MOVEMENT_FIXED_PATH_WALK, NPC_MOVEMENT_FIXED_PATH_WALK,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
@ -938,8 +909,7 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_NINJA_STARFISH { // NPC_NINJA_STARFISH
ACTORS_CLAM_SBK, ACTORS_CLAM_SBK,
ANIM_CLAM_SIDESNAP, ANIM_CLAM_SIDESNAP,
NPC_INIT_DEFAULT, NPC_SENSOR_GENERIC_USER_CLOSE,
NPC_SENSOR_NINJA_STARFISH_USER_CLOSE,
NPC_MOVEMENT_STATIC, NPC_MOVEMENT_STATIC,
NPC_CLOSE_GENERIC_USER_SEEK, NPC_CLOSE_GENERIC_USER_SEEK,
NPC_TIMER_NONE, NPC_TIMER_NONE,
@ -960,7 +930,6 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_GHOST { // NPC_GHOST
ACTORS_GHOST_SBK, ACTORS_GHOST_SBK,
ANIM_GHOST_IDLE, ANIM_GHOST_IDLE,
NPC_INIT_DEFAULT,
NPC_SENSOR_NONE, NPC_SENSOR_NONE,
NPC_MOVEMENT_FIXED_PATH, NPC_MOVEMENT_FIXED_PATH,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
@ -982,7 +951,6 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_GHOST_PIRATE { // NPC_GHOST_PIRATE
ACTORS_CLAM_SBK, ACTORS_CLAM_SBK,
ANIM_CLAM_SIDESNAP, ANIM_CLAM_SIDESNAP,
NPC_INIT_GHOST_PIRATE,
NPC_SENSOR_NONE, NPC_SENSOR_NONE,
NPC_MOVEMENT_STATIC, NPC_MOVEMENT_STATIC,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
@ -1004,7 +972,6 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_FLAMING_SKULL { // NPC_FLAMING_SKULL
ACTORS_FLAMINGSKULL_SBK, ACTORS_FLAMINGSKULL_SBK,
ANIM_FLAMINGSKULL_MOVE, ANIM_FLAMINGSKULL_MOVE,
NPC_INIT_DEFAULT,
NPC_SENSOR_USER_CLOSE, NPC_SENSOR_USER_CLOSE,
NPC_MOVEMENT_STATIC_CYCLE_ANIM, NPC_MOVEMENT_STATIC_CYCLE_ANIM,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
@ -1026,7 +993,6 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_SHARK_MAN { // NPC_SHARK_MAN
ACTORS_SHARKMAN_SBK, ACTORS_SHARKMAN_SBK,
ANIM_SHARKMAN_IDLE1_, ANIM_SHARKMAN_IDLE1_,
NPC_INIT_DEFAULT,
NPC_SENSOR_GENERIC_USER_VISIBLE, NPC_SENSOR_GENERIC_USER_VISIBLE,
NPC_MOVEMENT_STATIC, NPC_MOVEMENT_STATIC,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
@ -1048,8 +1014,7 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_OIL_BLOB { // NPC_OIL_BLOB
ACTORS_CLAM_SBK, ACTORS_CLAM_SBK,
ANIM_CLAM_SIDESNAP, ANIM_CLAM_SIDESNAP,
NPC_INIT_DEFAULT, NPC_SENSOR_GENERIC_USER_CLOSE,
NPC_SENSOR_OIL_BLOB_USER_CLOSE,
NPC_MOVEMENT_STATIC, NPC_MOVEMENT_STATIC,
NPC_CLOSE_GENERIC_USER_SEEK, NPC_CLOSE_GENERIC_USER_SEEK,
NPC_TIMER_NONE, NPC_TIMER_NONE,
@ -1070,10 +1035,9 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_SKULL_STOMPER { // NPC_SKULL_STOMPER
ACTORS_STOMPER_SBK, ACTORS_STOMPER_SBK,
ANIM_STOMPER_CRUSH, ANIM_STOMPER_CRUSH,
NPC_INIT_SKULL_STOMPER, NPC_SENSOR_USER_CLOSE,
NPC_SENSOR_SKULL_STOMPER_USER_CLOSE,
NPC_MOVEMENT_STATIC, NPC_MOVEMENT_STATIC,
NPC_CLOSE_SKULL_STOMPER_ATTACK, NPC_CLOSE_NONE,
NPC_TIMER_NONE, NPC_TIMER_NONE,
false, false,
5, 5,
@ -1092,10 +1056,9 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_MOTHER_JELLYFISH { // NPC_MOTHER_JELLYFISH
ACTORS_CLAM_SBK, ACTORS_CLAM_SBK,
ANIM_CLAM_SIDESNAP, ANIM_CLAM_SIDESNAP,
NPC_INIT_MOTHER_JELLYFISH,
NPC_SENSOR_NONE, NPC_SENSOR_NONE,
NPC_MOVEMENT_MOTHER_JELLYFISH, NPC_MOVEMENT_STATIC,
NPC_CLOSE_MOTHER_JELLYFISH_ATTACK, NPC_CLOSE_NONE,
NPC_TIMER_NONE, NPC_TIMER_NONE,
false, false,
3, 3,
@ -1114,10 +1077,9 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_SUB_SHARK { // NPC_SUB_SHARK
ACTORS_CLAM_SBK, ACTORS_CLAM_SBK,
ANIM_CLAM_SIDESNAP, ANIM_CLAM_SIDESNAP,
NPC_INIT_SUB_SHARK,
NPC_SENSOR_NONE, NPC_SENSOR_NONE,
NPC_MOVEMENT_SUB_SHARK, NPC_MOVEMENT_STATIC,
NPC_CLOSE_SUB_SHARK_ATTACK, NPC_CLOSE_NONE,
NPC_TIMER_NONE, NPC_TIMER_NONE,
false, false,
3, 3,
@ -1136,10 +1098,9 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_PARASITIC_WORM { // NPC_PARASITIC_WORM
ACTORS_CLAM_SBK, ACTORS_CLAM_SBK,
ANIM_CLAM_SIDESNAP, ANIM_CLAM_SIDESNAP,
NPC_INIT_PARASITIC_WORM, NPC_SENSOR_USER_CLOSE,
NPC_SENSOR_PARASITIC_WORM_USER_CLOSE, NPC_MOVEMENT_STATIC,
NPC_MOVEMENT_PARASITIC_WORM, NPC_CLOSE_NONE,
NPC_CLOSE_PARASITIC_WORM_ATTACK,
NPC_TIMER_NONE, NPC_TIMER_NONE,
false, false,
3, 3,
@ -1158,10 +1119,9 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_FLYING_DUTCHMAN { // NPC_FLYING_DUTCHMAN
ACTORS_FLYINGDUTCHMAN_SBK, ACTORS_FLYINGDUTCHMAN_SBK,
ANIM_FLYINGDUTCHMAN_FLY, ANIM_FLYINGDUTCHMAN_FLY,
NPC_INIT_FLYING_DUTCHMAN,
NPC_SENSOR_NONE, NPC_SENSOR_NONE,
NPC_MOVEMENT_FLYING_DUTCHMAN, NPC_MOVEMENT_STATIC,
NPC_CLOSE_FLYING_DUTCHMAN_ATTACK, NPC_CLOSE_NONE,
NPC_TIMER_NONE, NPC_TIMER_NONE,
false, false,
3, 3,
@ -1180,10 +1140,9 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_IRON_DOGFISH { // NPC_IRON_DOGFISH
ACTORS_IRONDOGFISH_SBK, ACTORS_IRONDOGFISH_SBK,
ANIM_IRONDOGFISH_IDLE, ANIM_IRONDOGFISH_IDLE,
NPC_INIT_IRON_DOGFISH, NPC_SENSOR_USER_CLOSE,
NPC_SENSOR_IRON_DOGFISH_USER_CLOSE, NPC_MOVEMENT_STATIC,
NPC_MOVEMENT_IRON_DOGFISH, NPC_CLOSE_NONE,
NPC_CLOSE_IRON_DOGFISH_ATTACK,
NPC_TIMER_NONE, NPC_TIMER_NONE,
false, false,
3, 3,
@ -1202,7 +1161,6 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_PARASITIC_WORM_SEGMENT { // NPC_PARASITIC_WORM_SEGMENT
ACTORS_CLAM_SBK, ACTORS_CLAM_SBK,
ANIM_CLAM_SIDESNAP, ANIM_CLAM_SIDESNAP,
NPC_INIT_PARASITIC_WORM_SEGMENT,
NPC_SENSOR_NONE, NPC_SENSOR_NONE,
NPC_MOVEMENT_STATIC, NPC_MOVEMENT_STATIC,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,
@ -1224,7 +1182,6 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
{ // NPC_BALL_BLOB { // NPC_BALL_BLOB
ACTORS_BALLBLOB_SBK, ACTORS_BALLBLOB_SBK,
ANIM_BALLBLOB_WOBBLE, ANIM_BALLBLOB_WOBBLE,
NPC_INIT_BALL_BLOB,
NPC_SENSOR_NONE, NPC_SENSOR_NONE,
NPC_MOVEMENT_STATIC, NPC_MOVEMENT_STATIC,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,

View File

@ -32,6 +32,22 @@
#endif #endif
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcSpiderCrabEnemy::postInit()
{
m_npcPath.setPathType( CNpcPath::PONG_PATH );
if ( m_layerCollision->getHeightFromGround( Pos.vx, Pos.vy, 16 ) < 0 )
{
// starting off below ground, jump initially
m_velocity = 5;
m_state = SPIDER_CRAB_INIT_JUMP;
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool CNpcSpiderCrabEnemy::processSensor() bool CNpcSpiderCrabEnemy::processSensor()
@ -247,7 +263,7 @@ void CNpcSpiderCrabEnemy::processSpiderCrabInitJumpMovement( int _frames )
if ( completed || collision ) if ( completed || collision )
{ {
m_movementFunc = m_data[m_type].movementFunc; m_state = SPIDER_CRAB_DEFAULT;
} }
} }
@ -264,7 +280,7 @@ void CNpcSpiderCrabEnemy::processMovement(int _frames)
s32 moveVel = 0; s32 moveVel = 0;
s32 moveDist = 0; s32 moveDist = 0;
if ( m_movementFunc == NPC_MOVEMENT_SPIDER_CRAB_INITJUMP ) if ( m_state == SPIDER_CRAB_INIT_JUMP )
{ {
processSpiderCrabInitJumpMovement( _frames ); processSpiderCrabInitJumpMovement( _frames );
} }

View File

@ -21,12 +21,19 @@
class CNpcSpiderCrabEnemy : public CNpcEnemy class CNpcSpiderCrabEnemy : public CNpcEnemy
{ {
public: public:
virtual void postInit();
protected: protected:
virtual bool processSensor(); virtual bool processSensor();
virtual void processClose( int _frames ); virtual void processClose( int _frames );
virtual void processCollision(); virtual void processCollision();
virtual void processMovement( int _frames ); virtual void processMovement( int _frames );
void processSpiderCrabInitJumpMovement( int _frames ); void processSpiderCrabInitJumpMovement( int _frames );
enum NPC_SPIDER_CRAB_STATE
{
SPIDER_CRAB_DEFAULT = 0,
SPIDER_CRAB_INIT_JUMP = 1,
};
}; };
#endif #endif

View File

@ -27,6 +27,11 @@ protected:
virtual bool processSensor(); virtual bool processSensor();
virtual void processClose( int _frames ); virtual void processClose( int _frames );
virtual void processMovementModifier( int _frames, s32 distX, s32 distY, s32 dist, s16 headingChange ); virtual void processMovementModifier( int _frames, s32 distX, s32 distY, s32 dist, s16 headingChange );
enum
{
NPC_JELLYFISH_RESISTANCE = 64,
};
}; };
#endif #endif

View File

@ -15,6 +15,10 @@
#include "enemy\npc.h" #include "enemy\npc.h"
#endif #endif
#ifndef __ENEMY_NSSHARK_H__
#include "enemy\nsshark.h"
#endif
#ifndef __GAME_GAME_H__ #ifndef __GAME_GAME_H__
#include "game\game.h" #include "game\game.h"
#endif #endif
@ -32,7 +36,13 @@
#endif #endif
void CNpcEnemy::processSubSharkMovement( int _frames ) void CNpcSubSharkEnemy::postInit()
{
m_state = SUB_SHARK_MINE_1;
m_extendDir = EXTEND_RIGHT;
}
void CNpcSubSharkEnemy::processMovement( int _frames )
{ {
if ( !m_animPlaying ) if ( !m_animPlaying )
{ {
@ -116,7 +126,7 @@ void CNpcEnemy::processSubSharkMovement( int _frames )
} }
} }
void CNpcEnemy::processCloseSubSharkAttack( int _frames ) void CNpcSubSharkEnemy::processClose( int _frames )
{ {
if ( m_state != SUB_SHARK_SWALLOW ) if ( m_state != SUB_SHARK_SWALLOW )
{ {

View File

@ -15,6 +15,10 @@
#include "enemy\npc.h" #include "enemy\npc.h"
#endif #endif
#ifndef __ENEMY_NSSTOMP_H__
#include "enemy\nsstomp.h"
#endif
#ifndef __GAME_GAME_H__ #ifndef __GAME_GAME_H__
#include "game\game.h" #include "game\game.h"
#endif #endif
@ -28,7 +32,36 @@
#endif #endif
void CNpcEnemy::processCloseSkullStomperAttack( int _frames ) void CNpcSkullStomperEnemy::postInit()
{
m_extendDir = EXTEND_DOWN;
}
bool CNpcSkullStomperEnemy::processSensor()
{
switch( m_sensorFunc )
{
case NPC_SENSOR_NONE:
return( false );
default:
{
if ( playerXDistSqr < 10000 && playerYDist >= 0 )
{
m_controlFunc = NPC_CONTROL_CLOSE;
m_extendDir = EXTEND_DOWN;
return( true );
}
else
{
return( false );
}
}
}
}
void CNpcSkullStomperEnemy::processClose( int _frames )
{ {
s8 groundHeight; s8 groundHeight;
s8 yMovement; s8 yMovement;

View File

@ -15,6 +15,10 @@
#include "enemy\npc.h" #include "enemy\npc.h"
#endif #endif
#ifndef __ENEMY_NWORM_H__
#include "enemy\nworm.h"
#endif
#ifndef __GAME_GAME_H__ #ifndef __GAME_GAME_H__
#include "game\game.h" #include "game\game.h"
#endif #endif
@ -23,7 +27,96 @@
#include "player\player.h" #include "player\player.h"
#endif #endif
void CNpcEnemy::processParasiticWormMovement( int _frames ) void CNpcParasiticWormEnemy::postInit()
{
DVECTOR newPos;
newPos.vx = 100;
//newPos.vy = 10;
newPos.vy = 100;
m_npcPath.addWaypoint( newPos );
newPos.vx = 500;
//newPos.vy = 10;
newPos.vy = 100;
m_npcPath.addWaypoint( newPos );
newPos.vx = 500;
//newPos.vy = 100;
newPos.vy = 300;
m_npcPath.addWaypoint( newPos );
newPos.vx = 100;
//newPos.vy = 100;
newPos.vy = 300;
m_npcPath.addWaypoint( newPos );
m_npcPath.setPathType( CNpcPath::PONG_PATH );
// create start of list
CNpcPositionHistory *newPosition;
newPosition = new ("position history") CNpcPositionHistory;
newPosition->pos = Pos;
m_positionHistory = newPosition;
CNpcPositionHistory *currentPosition = m_positionHistory;
// create rest of list
for ( int histLength = 1 ; histLength < ( NPC_PARASITIC_WORM_LENGTH * NPC_PARASITIC_WORM_SPACING ) ; histLength++ )
{
newPosition = new ("position history") CNpcPositionHistory;
newPosition->pos = Pos;
newPosition->next = NULL;
newPosition->prev = currentPosition;
currentPosition->next = newPosition;
currentPosition = newPosition;
}
// link ends together for circular list
currentPosition->next = m_positionHistory;
m_positionHistory->prev = currentPosition;
for ( int segCount = 0 ; segCount < NPC_PARASITIC_WORM_LENGTH ; segCount++ )
{
CNpcEnemy *segment;
segment = new ("segment") CNpcParasiticWormSegment;
segment->setType( CNpcEnemy::NPC_PARASITIC_WORM_SEGMENT );
segment->init();
segment->setLayerCollision( m_layerCollision );
segment->postInit();
this->addChild( segment );
}
m_movementTimer = 2 * GameState::getOneSecondInFrames();
}
void CNpcParasiticWormSegment::postInit()
{
}
bool CNpcParasiticWormEnemy::processSensor()
{
if ( playerXDistSqr + playerYDistSqr < 40000 )
{
m_controlFunc = NPC_CONTROL_CLOSE;
return( true );
}
else
{
return( false );
}
}
void CNpcParasiticWormEnemy::processMovement( int _frames )
{ {
s32 moveX = 0, moveY = 0; s32 moveX = 0, moveY = 0;
s32 moveVel = 0; s32 moveVel = 0;
@ -110,7 +203,7 @@ void CNpcEnemy::processParasiticWormMovement( int _frames )
} }
} }
void CNpcEnemy::resetParasiticWormHeadToTail() void CNpcParasiticWormEnemy::resetParasiticWormHeadToTail()
{ {
DVECTOR startPos; DVECTOR startPos;
DVECTOR endPos; DVECTOR endPos;
@ -182,7 +275,7 @@ void CNpcEnemy::resetParasiticWormHeadToTail()
} }
} }
void CNpcEnemy::processCloseParasiticWormAttack( int _frames ) void CNpcParasiticWormEnemy::processClose( int _frames )
{ {
resetParasiticWormHeadToTail(); resetParasiticWormHeadToTail();

View File

@ -129,6 +129,10 @@ SOURCE=..\..\..\source\enemy\nbooger.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\..\source\enemy\nbooger.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\enemy\nclam.cpp SOURCE=..\..\..\source\enemy\nclam.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
@ -141,6 +145,10 @@ SOURCE=..\..\..\source\enemy\ndogfish.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\..\source\enemy\ndogfish.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\enemy\neyeball.cpp SOURCE=..\..\..\source\enemy\neyeball.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
@ -153,6 +161,10 @@ SOURCE=..\..\..\source\enemy\nfdutch.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\..\source\enemy\nfdutch.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\enemy\nffolk.cpp SOURCE=..\..\..\source\enemy\nffolk.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
@ -197,6 +209,10 @@ SOURCE=..\..\..\source\enemy\nhazard.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\..\source\enemy\nhazard.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\enemy\nhcrab.cpp SOURCE=..\..\..\source\enemy\nhcrab.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
@ -209,6 +225,10 @@ SOURCE=..\..\..\source\enemy\nmjfish.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\..\source\enemy\nmjfish.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\enemy\nocto.cpp SOURCE=..\..\..\source\enemy\nocto.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
@ -289,12 +309,24 @@ SOURCE=..\..\..\source\enemy\nsshark.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\..\source\enemy\nsshark.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\enemy\nsstomp.cpp SOURCE=..\..\..\source\enemy\nsstomp.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\..\source\enemy\nsstomp.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\enemy\nworm.cpp SOURCE=..\..\..\source\enemy\nworm.cpp
# End Source File # End Source File
# Begin Source File
SOURCE=..\..\..\source\enemy\nworm.h
# End Source File
# End Group # End Group
# Begin Group "fileio" # Begin Group "fileio"