This commit is contained in:
Charles 2001-08-03 19:10:05 +00:00
parent 17a4463ac2
commit 38b97c7111
13 changed files with 185 additions and 3 deletions

View File

@ -618,6 +618,15 @@ void CNpcIronDogfishEnemy::render()
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcIronDogfishEnemy::renderOnMapScreen( DVECTOR drawPos )
{
SprFrame = NULL;
SprFrame = m_actorGfx->Render(drawPos,0,0,false);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcIronDogfishEnemy::processCollision() void CNpcIronDogfishEnemy::processCollision()
{ {
CPlayer *player = GameScene.getPlayer(); CPlayer *player = GameScene.getPlayer();

View File

@ -27,6 +27,7 @@ class CNpcIronDogfishEnemy : public CNpcBossEnemy
public: public:
void postInit(); void postInit();
void render(); void render();
void renderOnMapScreen( DVECTOR drawPos );
void shutdown(); void shutdown();
protected: protected:
void processTimer( int _frames ); void processTimer( int _frames );

View File

@ -710,6 +710,20 @@ void CNpcFlyingDutchmanEnemy::render()
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcFlyingDutchmanEnemy::renderOnMapScreen( DVECTOR drawPos )
{
SprFrame = NULL;
SprFrame = m_actorGfx->Render(drawPos,0,0,false);
//setShadeTex(SprFrame,0);
//setSemiTrans( SprFrame, true );
//SprFrame->tpage|=1<<5;
m_actorGfx->RotateScale( SprFrame, drawPos, 0, 5120, 5120 );
//setRGB0( SprFrame, m_fadeVal, m_fadeVal, m_fadeVal );
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcFlyingDutchmanEnemy::collidedWith(CThing *_thisThing) void CNpcFlyingDutchmanEnemy::collidedWith(CThing *_thisThing)
{ {
if ( m_isActive && !m_isCaught && !m_isDying ) if ( m_isActive && !m_isCaught && !m_isDying )

View File

@ -25,6 +25,7 @@ public:
void think( int _frames ); void think( int _frames );
void postInit(); void postInit();
void render(); void render();
void renderOnMapScreen( DVECTOR drawPos );
void shutdown(); void shutdown();
u8 hasBeenAttacked(); u8 hasBeenAttacked();
protected: protected:

View File

@ -755,6 +755,21 @@ void CNpcMotherJellyfishEnemy::render()
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcMotherJellyfishEnemy::renderOnMapScreen( DVECTOR drawPos )
{
SprFrame = NULL;
SprFrame = m_actorGfx->Render(drawPos,0,0,false);
m_actorGfx->RotateScale( SprFrame, drawPos, 0, ONE, ONE );
for ( int i = 0 ; i < 4 ; i++ )
{
legs[i]->renderOnMapScreen( drawPos );
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*void CNpcMotherJellyfishEnemy::processUserCollision( CThing *thisThing ) /*void CNpcMotherJellyfishEnemy::processUserCollision( CThing *thisThing )
{ {
}*/ }*/

View File

@ -21,7 +21,7 @@
#include "fx\fx.h" #include "fx\fx.h"
#include "fx\fxjfish.h" #include "fx\fxjfish.h"
#define MJ_PINK ( 255 + ( 128 << 8 ) + ( 255 << 16 ) ) #define MJ_PINK ( 127 + ( 127 << 8 ) + ( 127 << 16 ) )
#define MJ_WHITE ( 255 + ( 255 << 8 ) + ( 255 << 16 ) ) #define MJ_WHITE ( 255 + ( 255 << 8 ) + ( 255 << 16 ) )
class CNpcMotherJellyfishEnemy : public CNpcBossEnemy class CNpcMotherJellyfishEnemy : public CNpcBossEnemy
@ -29,6 +29,7 @@ class CNpcMotherJellyfishEnemy : public CNpcBossEnemy
public: public:
void postInit(); void postInit();
void render(); void render();
void renderOnMapScreen( DVECTOR drawPos );
void shutdown(); void shutdown();
void setupWaypoints( sThingActor *ThisActor ); void setupWaypoints( sThingActor *ThisActor );
protected: protected:

View File

@ -205,6 +205,8 @@ s32 CNpcEnemy::playerYDist;
s32 CNpcEnemy::playerXDistSqr; s32 CNpcEnemy::playerXDistSqr;
s32 CNpcEnemy::playerYDistSqr; s32 CNpcEnemy::playerYDistSqr;
extern CThing *g_bossThing;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
CNpcEnemy::NPC_UNIT_TYPE CNpcEnemy::getTypeFromMapEdit( u16 newType ) CNpcEnemy::NPC_UNIT_TYPE CNpcEnemy::getTypeFromMapEdit( u16 newType )
@ -362,12 +364,14 @@ CNpcEnemy *CNpcEnemy::Create(int enemyType)
case CNpcEnemy::NPC_MOTHER_JELLYFISH: case CNpcEnemy::NPC_MOTHER_JELLYFISH:
{ {
enemy = new ("mother jellyfish") CNpcMotherJellyfishEnemy; enemy = new ("mother jellyfish") CNpcMotherJellyfishEnemy;
g_bossThing = (CThing *) enemy;
break; break;
} }
case CNpcEnemy::NPC_SUB_SHARK: case CNpcEnemy::NPC_SUB_SHARK:
{ {
enemy = new ("sub shark") CNpcSubSharkEnemy; enemy = new ("sub shark") CNpcSubSharkEnemy;
g_bossThing = (CThing *) enemy;
break; break;
} }
@ -380,12 +384,14 @@ CNpcEnemy *CNpcEnemy::Create(int enemyType)
case CNpcEnemy::NPC_FLYING_DUTCHMAN: case CNpcEnemy::NPC_FLYING_DUTCHMAN:
{ {
enemy = new ("flying dutchman") CNpcFlyingDutchmanEnemy; enemy = new ("flying dutchman") CNpcFlyingDutchmanEnemy;
g_bossThing = (CThing *) enemy;
break; break;
} }
case CNpcEnemy::NPC_IRON_DOGFISH: case CNpcEnemy::NPC_IRON_DOGFISH:
{ {
enemy = new ("iron dogfish") CNpcIronDogfishEnemy; enemy = new ("iron dogfish") CNpcIronDogfishEnemy;
g_bossThing = (CThing *) enemy;
break; break;
} }
@ -410,6 +416,7 @@ CNpcEnemy *CNpcEnemy::Create(int enemyType)
case CNpcEnemy::NPC_SEA_SNAKE: case CNpcEnemy::NPC_SEA_SNAKE:
{ {
enemy = new ("sea snake") CNpcSeaSnakeEnemy; enemy = new ("sea snake") CNpcSeaSnakeEnemy;
g_bossThing = (CThing *) enemy;
break; break;
} }

View File

@ -769,6 +769,16 @@ void CNpcSubSharkEnemy::render()
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcSubSharkEnemy::renderOnMapScreen( DVECTOR drawPos )
{
SprFrame = NULL;
SprFrame = m_actorGfx->Render(drawPos,3,0,false);
//m_actorGfx->RotateScale( SprFrame, renderPos, 0, 4096, 4096 );
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcSubSharkEnemy::collidedWith(CThing *_thisThing) void CNpcSubSharkEnemy::collidedWith(CThing *_thisThing)
{ {
if ( m_isActive && !m_isCaught && !m_isDying ) if ( m_isActive && !m_isCaught && !m_isDying )

View File

@ -28,6 +28,7 @@ class CNpcSubSharkEnemy : public CNpcBossEnemy
public: public:
void postInit(); void postInit();
void render(); void render();
void renderOnMapScreen( DVECTOR drawPos );
void shutdown(); void shutdown();
protected: protected:
//virtual void processClose( int _frames ); //virtual void processClose( int _frames );

View File

@ -998,6 +998,72 @@ void CNpcSeaSnakeEnemy::render()
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcSeaSnakeEnemy::renderOnMapScreen( DVECTOR drawPos )
{
drawPos.vx += 300;
POLY_FT4 *headSprFrame;
headSprFrame = m_actorGfx->Render(drawPos,ANIM_SEASNAKE_HEADSNAP,0,0);
m_actorGfx->RotateScale( headSprFrame, drawPos, 0, 4096, 4096 );
int segmentCount;
int segmentType;
u16 segScale;
int initLength = NPC_SEA_SNAKE_LENGTH / 3;
int remLength = NPC_SEA_SNAKE_LENGTH - initLength;
for ( segmentCount = 0 ; segmentCount < NPC_SEA_SNAKE_LENGTH ; segmentCount++ )
{
drawPos.vx -= 30;
if ( segmentCount > 3 )
{
if ( segmentCount == m_segmentCount - 1 )
{
segmentType = ANIM_SEASNAKE_TAILSTATIC;
}
else
{
if ( segmentCount % 2 )
{
segmentType = ANIM_SEASNAKE_BODY2STATIC;
}
else
{
segmentType = ANIM_SEASNAKE_BODY3STATIC;
}
}
}
else
{
segmentType = ANIM_SEASNAKE_BODY1STATIC;
}
if ( segmentCount < initLength )
{
u16 sum = ONE << 1;
u16 start = ONE;
u16 end = sum - start;
segScale = start + ( ( end * segmentCount ) / initLength );
}
else
{
u16 sum = ONE << 1;
u16 start = ONE >> 1;
u16 end = sum - start;
segScale = start + ( ( end * ( NPC_SEA_SNAKE_LENGTH - segmentCount ) ) / remLength );
}
POLY_FT4 *Ft4= m_actorGfx->Render(drawPos,segmentType,0,0);
m_actorGfx->RotateScale( Ft4, drawPos, 0, 4096, segScale );
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
int CNpcSeaSnakeEnemy::checkCollisionAgainst( CThing *_thisThing, int _frames ) int CNpcSeaSnakeEnemy::checkCollisionAgainst( CThing *_thisThing, int _frames )
{ {
// DVECTOR pos,thisThingPos; // DVECTOR pos,thisThingPos;

View File

@ -59,6 +59,7 @@ public:
void postInit(); void postInit();
void shutdown(); void shutdown();
void render(); void render();
void renderOnMapScreen( DVECTOR drawPos );
int checkCollisionAgainst(CThing *_thisThing, int _frames); int checkCollisionAgainst(CThing *_thisThing, int _frames);
protected: protected:
s32 getFrameShift( int _frames ); s32 getFrameShift( int _frames );

View File

@ -33,11 +33,11 @@ void CFXJellyFishLegs::init(DVECTOR const &_Pos)
} }
/*****************************************************************************/ /*****************************************************************************/
void CFXJellyFishLegs::Setup(int XOfs,int YOfs,bool XFlip) void CFXJellyFishLegs::Setup(int XOfs,int YOfs,bool _XFlip)
{ {
Ofs.vx=XOfs; Ofs.vx=XOfs;
Ofs.vy=YOfs; Ofs.vy=YOfs;
XFlip=XFlip; XFlip=_XFlip;
} }
/*****************************************************************************/ /*****************************************************************************/
@ -105,6 +105,61 @@ int XInc=LegXInc;
} }
Ft4->y2=Ft4->y0+H;
Ft4->y3=Ft4->y1+H;
RenderPos.vy+=H+ScaleHInc;
WOfs+=ScaleWInc;
}
}
/*****************************************************************************/
/*** Render on map ***********************************************************/
/*****************************************************************************/
void CFXJellyFishLegs::renderOnMapScreen( DVECTOR drawPos )
{
SpriteBank *SprBank=CGameScene::getSpriteBank();;
DVECTOR RenderPos=drawPos;
int WOfs=0;
int H;
int ThisAngle=0;
int LegHeight=SprBank->getFrameHeight(FRM__LEG)-4;
int ScaleWInc=(ONE*LegWInc)>>12;
int ScaleHInc=(ONE*LegHInc)>>12;
int XInc=LegXInc;
RenderPos.vx+=Ofs.vx;
RenderPos.vy+=Ofs.vy;
if (!XFlip) XInc=-XInc;
for (int i=0; i<LegCount; i++)
{
ThisAngle+=AngleInc;
ThisAngle&=CIRCLE_TAB_MASK;
H=LegHeight+(CircleTable[ThisAngle]>>5);
POLY_FT4 *Ft4;
Ft4=SprBank->printFT4Scaled(FRM__LEG,RenderPos.vx+(i*XInc),RenderPos.vy,XFlip,0,OtPos,ONE>>4);
if (!XFlip)
{
Ft4->x0+=WOfs/2;
Ft4->x2+=WOfs/2;
Ft4->x1-=WOfs/2;
Ft4->x3-=WOfs/2;
}
else
{
Ft4->x0+=WOfs/2;
Ft4->x2+=WOfs/2;
Ft4->x1-=WOfs/2;
Ft4->x3-=WOfs/2;
}
Ft4->y2=Ft4->y0+H; Ft4->y2=Ft4->y0+H;
Ft4->y3=Ft4->y1+H; Ft4->y3=Ft4->y1+H;
RenderPos.vy+=H+ScaleHInc; RenderPos.vy+=H+ScaleHInc;

View File

@ -15,6 +15,7 @@ public:
/*virtual */void init(DVECTOR const &Pos); /*virtual */void init(DVECTOR const &Pos);
/*virtual */void think(int _frames); /*virtual */void think(int _frames);
/*virtual */void render(); /*virtual */void render();
void renderOnMapScreen( DVECTOR drawPos );
void Setup(int XOfs,int YOfs,bool XFlip); void Setup(int XOfs,int YOfs,bool XFlip);
void setScale( s16 newScale ) {Scale = newScale;} void setScale( s16 newScale ) {Scale = newScale;}