This commit is contained in:
Charles 2001-05-03 21:39:27 +00:00
parent a567d00bc3
commit d4dc0ef1d2
10 changed files with 148 additions and 46 deletions

View file

@ -1,8 +1,7 @@
sharksubchomp chomp
sharksubdeath death
sharksubidle gethit
sharksubspit sprintclosed
sharksubsprintclosed sprintopen
sharksubsprintopen swim
sharksubswim swipe
sharksubswipe

View file

@ -186,3 +186,5 @@ actors/SKELETALFISH.SBK
actors/SPIDERCRAB.SBK actors/SPIDERCRAB.SBK
actors/SPIKEYANENOME.SBK actors/SPIKEYANENOME.SBK
actors/STOMPER.SBK actors/STOMPER.SBK
actors/SHARKSUB.SBK

View file

@ -112,7 +112,8 @@ ACTOR_NPC := BarnacleBoy Krusty Squidward Gary Sandy Patrick MermaidMan
ACTOR_ENEMY := Anenome BabyOctopus Ballblob Caterpillar clam Dustdevil Eyeball \ ACTOR_ENEMY := Anenome BabyOctopus Ballblob Caterpillar clam Dustdevil Eyeball \
Flamingskull FlyingDutchman Ghost HermitCrab IronDogFish Lrgjellyfish \ Flamingskull FlyingDutchman Ghost HermitCrab IronDogFish Lrgjellyfish \
PuffaFish Sharkman Skeletalfish SpiderCrab SpikeyAnenome Stomper PuffaFish Sharkman Skeletalfish SpiderCrab SpikeyAnenome Stomper \
SharkSub
# Boogermonster GiantWorm Jellyfish2 Motherjellyfish Nautilus Neptune SeaSnake SharkSub # Boogermonster GiantWorm Jellyfish2 Motherjellyfish Nautilus Neptune SeaSnake SharkSub

View file

@ -19,6 +19,10 @@
#include "enemy\nmjfish.h" #include "enemy\nmjfish.h"
#endif #endif
#ifndef __VID_HEADER_
#include "system\vid.h"
#endif
#ifndef __GAME_GAME_H__ #ifndef __GAME_GAME_H__
#include "game\game.h" #include "game\game.h"
#endif #endif
@ -217,4 +221,71 @@ void CNpcMotherJellyfishEnemy::processClose( int _frames )
break; break;
} }
} }
} }
/*void CNpcMotherJellyfishEnemy::render()
{
SprFrame = NULL;
if ( m_isActive )
{
CEnemyThing::render();
// Render
DVECTOR renderPos;
DVECTOR origRenderPos;
DVECTOR offset = CLevel::getCameraPos();
int spriteWidth = m_spriteBank->getFrameWidth( m_frame >> 8 );
int spriteHeight = m_spriteBank->getFrameHeight( m_frame >> 8 );
renderPos.vx = Pos.vx - offset.vx;
origRenderPos.vx = renderPos.vx;
renderPos.vx += m_drawOffset.vx;
renderPos.vy = Pos.vy - offset.vy;
origRenderPos.vy = renderPos.vy;
renderPos.vy += m_drawOffset.vy - ( spriteHeight >> 1 );
if ( renderPos.vx >= 0 && renderPos.vx <= VidGetScrW() )
{
if ( renderPos.vy >= 0 && renderPos.vy <= VidGetScrH() )
{
SprFrame = m_spriteBank->printRotatedScaledSprite( FRM_JELLYFISH1_SWIM1,renderPos.vx,renderPos.vy,4096,4096,0,10);
setRGB0( SprFrame, 255, 128, 255 );
// get xmax, xmin, ymax, ymin
s32 XMax;
s32 XMin;
s32 YMax;
s32 YMin;
XMin=SprFrame->x0;
if (XMin>SprFrame->x1) XMin=SprFrame->x1;
if (XMin>SprFrame->x2) XMin=SprFrame->x2;
if (XMin>SprFrame->x3) XMin=SprFrame->x3;
XMax=SprFrame->x0;
if (XMax<SprFrame->x1) XMax=SprFrame->x1;
if (XMax<SprFrame->x2) XMax=SprFrame->x2;
if (XMax<SprFrame->x3) XMax=SprFrame->x3;
YMin=SprFrame->y0;
if (YMin>SprFrame->y1) YMin=SprFrame->y1;
if (YMin>SprFrame->y2) YMin=SprFrame->y2;
if (YMin>SprFrame->y3) YMin=SprFrame->y3;
YMax=SprFrame->y0;
if (YMax<SprFrame->y1) YMax=SprFrame->y1;
if (YMax<SprFrame->y2) YMax=SprFrame->y2;
if (YMax<SprFrame->y3) YMax=SprFrame->y3;
XMax -= origRenderPos.vx;
XMin -= origRenderPos.vx;
YMax -= origRenderPos.vy;
YMin -= origRenderPos.vy;
setCollisionSize( ( XMax - XMin ), ( YMax - YMin ) );
setCollisionCentreOffset( ( XMax + XMin ) >> 1, ( YMax + YMin ) >> 1 );
}
}
}
}*/

View file

@ -18,6 +18,7 @@ class CNpcMotherJellyfishEnemy : public CNpcEnemy
{ {
public: public:
virtual void postInit(); virtual void postInit();
//void render();
protected: protected:
virtual void processClose( int _frames ); virtual void processClose( int _frames );
virtual void processMovement( int _frames ); virtual void processMovement( int _frames );

View file

@ -42,12 +42,7 @@ class CNpcEnemy : public CEnemyThing
public: public:
enum NPC_UNIT_TYPE enum NPC_UNIT_TYPE
{ {
//NPC_FALLING_ITEM = 0,
//NPC_FISH_HOOK = 1,
NPC_DUST_DEVIL = 0, NPC_DUST_DEVIL = 0,
//NPC_PENDULUM,
//NPC_FIREBALL,
//NPC_SAW_BLADE,
NPC_SMALL_JELLYFISH_1 = 1, NPC_SMALL_JELLYFISH_1 = 1,
NPC_SMALL_JELLYFISH_2, NPC_SMALL_JELLYFISH_2,
NPC_ANEMONE_1, NPC_ANEMONE_1,

View file

@ -103,9 +103,9 @@
#include <ACTOR_BALLBLOB_ANIM.h> #include <ACTOR_BALLBLOB_ANIM.h>
#endif #endif
//#ifndef __ANIM_SHARKSUB_HEADER__ #ifndef __ANIM_SHARKSUB_HEADER__
//#include <ACTOR_SHARKSUB_ANIM.h> #include <ACTOR_SHARKSUB_ANIM.h>
//#endif #endif
CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] = CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
@ -793,8 +793,8 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
}, },
{ // NPC_SUB_SHARK { // NPC_SUB_SHARK
ACTORS_CLAM_SBK, ACTORS_SHARKSUB_SBK,
ANIM_CLAM_SIDESNAP, ANIM_SHARKSUB_SWIM,
NPC_SENSOR_NONE, NPC_SENSOR_NONE,
NPC_MOVEMENT_STATIC, NPC_MOVEMENT_STATIC,
NPC_CLOSE_NONE, NPC_CLOSE_NONE,

View file

@ -32,7 +32,7 @@
#endif #endif
#ifndef __ANIM_SHARKSUB_HEADER__ #ifndef __ANIM_SHARKSUB_HEADER__
#include <ACTOR_CLAM_ANIM.h> #include <ACTOR_SHARKSUB_ANIM.h>
#endif #endif
@ -40,6 +40,7 @@ void CNpcSubSharkEnemy::postInit()
{ {
m_state = SUB_SHARK_MINE_1; m_state = SUB_SHARK_MINE_1;
m_extendDir = EXTEND_RIGHT; m_extendDir = EXTEND_RIGHT;
m_npcPath.setPathType( CNpcPath::PONG_PATH );
} }
void CNpcSubSharkEnemy::processMovement( int _frames ) void CNpcSubSharkEnemy::processMovement( int _frames )
@ -49,13 +50,13 @@ void CNpcSubSharkEnemy::processMovement( int _frames )
if ( playerXDistSqr + playerYDistSqr < 100 && !m_salvoCount ) if ( playerXDistSqr + playerYDistSqr < 100 && !m_salvoCount )
{ {
m_animPlaying = true; m_animPlaying = true;
m_animNo = ANIM_CLAM_SIDESNAP; m_animNo = ANIM_SHARKSUB_SWIPE;
m_frame = 0; m_frame = 0;
} }
else else
{ {
m_animPlaying = true; m_animPlaying = true;
m_animNo = ANIM_CLAM_SIDESNAP; m_animNo = ANIM_SHARKSUB_SWIM;
m_frame = 0; m_frame = 0;
} }
} }
@ -82,7 +83,32 @@ void CNpcSubSharkEnemy::processMovement( int _frames )
m_movementTimer -= _frames; m_movementTimer -= _frames;
} }
if ( m_extendDir == EXTEND_RIGHT ) s32 moveX = 0, moveY = 0;
s32 moveVel = 0;
s32 moveDist = 0;
processGenericFixedPathMove( _frames, &moveX, &moveY, &moveVel, &moveDist );
if ( moveX > 0 )
{
m_extendDir = EXTEND_RIGHT;
}
else
{
m_extendDir = EXTEND_LEFT;
}
Pos.vx += moveX;
Pos.vy += moveY;
if ( m_movementTimer <= 0 )
{
m_controlFunc = NPC_CONTROL_CLOSE;
}
/*if ( m_extendDir == EXTEND_RIGHT )
{ {
s32 xDist = 600 - Pos.vx; s32 xDist = 600 - Pos.vx;
s32 xDistSqr = xDist * xDist; s32 xDistSqr = xDist * xDist;
@ -123,7 +149,7 @@ void CNpcSubSharkEnemy::processMovement( int _frames )
m_controlFunc = NPC_CONTROL_CLOSE; m_controlFunc = NPC_CONTROL_CLOSE;
} }
} }
} }*/
} }
void CNpcSubSharkEnemy::processClose( int _frames ) void CNpcSubSharkEnemy::processClose( int _frames )
@ -145,6 +171,13 @@ void CNpcSubSharkEnemy::processClose( int _frames )
case SUB_SHARK_MINE_1: case SUB_SHARK_MINE_1:
case SUB_SHARK_MINE_2: case SUB_SHARK_MINE_2:
{ {
if ( !m_animPlaying )
{
m_animPlaying = true;
m_animNo = ANIM_SHARKSUB_SWIM;
m_frame = 0;
}
processGenericGotoTarget( _frames, playerXDist, 0, m_data[m_type].speed ); processGenericGotoTarget( _frames, playerXDist, 0, m_data[m_type].speed );
if ( playerXDistSqr < 100 ) if ( playerXDistSqr < 100 )
@ -167,7 +200,7 @@ void CNpcSubSharkEnemy::processClose( int _frames )
if ( !m_animPlaying ) if ( !m_animPlaying )
{ {
m_animPlaying = true; m_animPlaying = true;
m_animNo = ANIM_CLAM_SIDESNAP; m_animNo = ANIM_SHARKSUB_SPRINTOPEN;
m_frame = 0; m_frame = 0;
} }
@ -176,7 +209,7 @@ void CNpcSubSharkEnemy::processClose( int _frames )
if ( playerXDistSqr < 10000 ) if ( playerXDistSqr < 10000 )
{ {
m_animPlaying = true; m_animPlaying = true;
m_animNo = ANIM_CLAM_SIDESNAP; m_animNo = ANIM_SHARKSUB_CHOMP;
m_frame = 0; m_frame = 0;
m_state = SUB_SHARK_SWALLOW; m_state = SUB_SHARK_SWALLOW;
@ -222,7 +255,7 @@ void CNpcSubSharkEnemy::processClose( int _frames )
if ( !m_animPlaying ) if ( !m_animPlaying )
{ {
m_animPlaying = true; m_animPlaying = true;
m_animNo = ANIM_CLAM_SIDESNAP; m_animNo = ANIM_SHARKSUB_SWIM;
m_frame = 0; m_frame = 0;
m_controlFunc = NPC_CONTROL_MOVEMENT; m_controlFunc = NPC_CONTROL_MOVEMENT;
m_movementTimer = GameState::getOneSecondInFrames() * 8; m_movementTimer = GameState::getOneSecondInFrames() * 8;

View file

@ -270,7 +270,7 @@ CNpcPlatform::NPC_PLATFORM_DATA CNpcPlatform::m_data[NPC_PLATFORM_TYPE_MAX] =
0, 0,
4, 4,
NPC_PLATFORM_INFINITE_LIFE, NPC_PLATFORM_INFINITE_LIFE,
4, 2,
NPC_PLATFORM_TIMER_NONE, NPC_PLATFORM_TIMER_NONE,
}, },
@ -284,7 +284,7 @@ CNpcPlatform::NPC_PLATFORM_DATA CNpcPlatform::m_data[NPC_PLATFORM_TYPE_MAX] =
0, 0,
4, 4,
NPC_PLATFORM_INFINITE_LIFE, NPC_PLATFORM_INFINITE_LIFE,
4, 2,
NPC_PLATFORM_TIMER_NONE, NPC_PLATFORM_TIMER_NONE,
}, },

View file

@ -117,14 +117,14 @@ AttackStrength=20
# [Largejellyfish] - This is a platform # [Largejellyfish] - This is a platform
#[Motherjellyfish] [Motherjellyfish]
#Gfx=..\..\graphics\characters\ Gfx=..\..\graphics\characters\MotherJellyfish\render\psx\+motherjellyfish0000.bmp
#WayPoints=16 WayPoints=16
#Speed=3 Speed=3
#TurnRate=256 TurnRate=256
#Collision=0 Collision=0
#Health=256 Health=256
#AttackStrength=1234 AttackStrength=1234
[Anenome-Level1] [Anenome-Level1]
Gfx=..\..\graphics\characters\Anenome\render\AnemneLvl1Icon.bmp Gfx=..\..\graphics\characters\Anenome\render\AnemneLvl1Icon.bmp
@ -298,14 +298,14 @@ Collision=0
Health=16 Health=16
AttackStrength=20 AttackStrength=20
#[SharkSub] [SharkSub]
#Gfx=..\..\graphics\characters\ Gfx=..\..\graphics\characters\SharkSub\render\psx\SharkSub_swim0000.bmp
#WayPoints=16 WayPoints=16
#Speed=3 Speed=3
#TurnRate=2048 TurnRate=2048
#Collision=0 Collision=0
#Health=256 Health=256
#AttackStrength=0 AttackStrength=0
[Skeletalfish] [Skeletalfish]
Gfx=..\..\graphics\characters\Skeletalfish\render\psx\skeletalfish_idle0000.bmp Gfx=..\..\graphics\characters\Skeletalfish\render\psx\skeletalfish_idle0000.bmp