This commit is contained in:
parent
17a4463ac2
commit
38b97c7111
13 changed files with 185 additions and 3 deletions
|
@ -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()
|
||||
{
|
||||
CPlayer *player = GameScene.getPlayer();
|
||||
|
|
|
@ -27,6 +27,7 @@ class CNpcIronDogfishEnemy : public CNpcBossEnemy
|
|||
public:
|
||||
void postInit();
|
||||
void render();
|
||||
void renderOnMapScreen( DVECTOR drawPos );
|
||||
void shutdown();
|
||||
protected:
|
||||
void processTimer( int _frames );
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
if ( m_isActive && !m_isCaught && !m_isDying )
|
||||
|
|
|
@ -25,6 +25,7 @@ public:
|
|||
void think( int _frames );
|
||||
void postInit();
|
||||
void render();
|
||||
void renderOnMapScreen( DVECTOR drawPos );
|
||||
void shutdown();
|
||||
u8 hasBeenAttacked();
|
||||
protected:
|
||||
|
|
|
@ -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 )
|
||||
{
|
||||
}*/
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "fx\fx.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 ) )
|
||||
|
||||
class CNpcMotherJellyfishEnemy : public CNpcBossEnemy
|
||||
|
@ -29,6 +29,7 @@ class CNpcMotherJellyfishEnemy : public CNpcBossEnemy
|
|||
public:
|
||||
void postInit();
|
||||
void render();
|
||||
void renderOnMapScreen( DVECTOR drawPos );
|
||||
void shutdown();
|
||||
void setupWaypoints( sThingActor *ThisActor );
|
||||
protected:
|
||||
|
|
|
@ -205,6 +205,8 @@ s32 CNpcEnemy::playerYDist;
|
|||
s32 CNpcEnemy::playerXDistSqr;
|
||||
s32 CNpcEnemy::playerYDistSqr;
|
||||
|
||||
extern CThing *g_bossThing;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CNpcEnemy::NPC_UNIT_TYPE CNpcEnemy::getTypeFromMapEdit( u16 newType )
|
||||
|
@ -362,12 +364,14 @@ CNpcEnemy *CNpcEnemy::Create(int enemyType)
|
|||
case CNpcEnemy::NPC_MOTHER_JELLYFISH:
|
||||
{
|
||||
enemy = new ("mother jellyfish") CNpcMotherJellyfishEnemy;
|
||||
g_bossThing = (CThing *) enemy;
|
||||
break;
|
||||
}
|
||||
|
||||
case CNpcEnemy::NPC_SUB_SHARK:
|
||||
{
|
||||
enemy = new ("sub shark") CNpcSubSharkEnemy;
|
||||
g_bossThing = (CThing *) enemy;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -380,12 +384,14 @@ CNpcEnemy *CNpcEnemy::Create(int enemyType)
|
|||
case CNpcEnemy::NPC_FLYING_DUTCHMAN:
|
||||
{
|
||||
enemy = new ("flying dutchman") CNpcFlyingDutchmanEnemy;
|
||||
g_bossThing = (CThing *) enemy;
|
||||
break;
|
||||
}
|
||||
|
||||
case CNpcEnemy::NPC_IRON_DOGFISH:
|
||||
{
|
||||
enemy = new ("iron dogfish") CNpcIronDogfishEnemy;
|
||||
g_bossThing = (CThing *) enemy;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -410,6 +416,7 @@ CNpcEnemy *CNpcEnemy::Create(int enemyType)
|
|||
case CNpcEnemy::NPC_SEA_SNAKE:
|
||||
{
|
||||
enemy = new ("sea snake") CNpcSeaSnakeEnemy;
|
||||
g_bossThing = (CThing *) enemy;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
if ( m_isActive && !m_isCaught && !m_isDying )
|
||||
|
|
|
@ -28,6 +28,7 @@ class CNpcSubSharkEnemy : public CNpcBossEnemy
|
|||
public:
|
||||
void postInit();
|
||||
void render();
|
||||
void renderOnMapScreen( DVECTOR drawPos );
|
||||
void shutdown();
|
||||
protected:
|
||||
//virtual void processClose( int _frames );
|
||||
|
|
|
@ -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 )
|
||||
{
|
||||
// DVECTOR pos,thisThingPos;
|
||||
|
|
|
@ -59,6 +59,7 @@ public:
|
|||
void postInit();
|
||||
void shutdown();
|
||||
void render();
|
||||
void renderOnMapScreen( DVECTOR drawPos );
|
||||
int checkCollisionAgainst(CThing *_thisThing, int _frames);
|
||||
protected:
|
||||
s32 getFrameShift( int _frames );
|
||||
|
|
|
@ -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.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->y3=Ft4->y1+H;
|
||||
RenderPos.vy+=H+ScaleHInc;
|
||||
|
|
|
@ -15,6 +15,7 @@ public:
|
|||
/*virtual */void init(DVECTOR const &Pos);
|
||||
/*virtual */void think(int _frames);
|
||||
/*virtual */void render();
|
||||
void renderOnMapScreen( DVECTOR drawPos );
|
||||
|
||||
void Setup(int XOfs,int YOfs,bool XFlip);
|
||||
void setScale( s16 newScale ) {Scale = newScale;}
|
||||
|
|
Loading…
Add table
Reference in a new issue