From 38b97c71118328bf82e39b3061a5b7aacc9156dd Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 3 Aug 2001 19:10:05 +0000 Subject: [PATCH] --- source/enemy/ndogfish.cpp | 9 ++++++ source/enemy/ndogfish.h | 1 + source/enemy/nfdutch.cpp | 14 +++++++++ source/enemy/nfdutch.h | 1 + source/enemy/nmjfish.cpp | 15 +++++++++ source/enemy/nmjfish.h | 3 +- source/enemy/npc.cpp | 7 +++++ source/enemy/nsshark.cpp | 10 ++++++ source/enemy/nsshark.h | 1 + source/enemy/nssnake.cpp | 66 +++++++++++++++++++++++++++++++++++++++ source/enemy/nssnake.h | 1 + source/fx/fxjfish.cpp | 59 ++++++++++++++++++++++++++++++++-- source/fx/fxjfish.h | 1 + 13 files changed, 185 insertions(+), 3 deletions(-) diff --git a/source/enemy/ndogfish.cpp b/source/enemy/ndogfish.cpp index f375dc4c3..91581b61e 100644 --- a/source/enemy/ndogfish.cpp +++ b/source/enemy/ndogfish.cpp @@ -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(); diff --git a/source/enemy/ndogfish.h b/source/enemy/ndogfish.h index 6b1caf39a..2a1a06c21 100644 --- a/source/enemy/ndogfish.h +++ b/source/enemy/ndogfish.h @@ -27,6 +27,7 @@ class CNpcIronDogfishEnemy : public CNpcBossEnemy public: void postInit(); void render(); + void renderOnMapScreen( DVECTOR drawPos ); void shutdown(); protected: void processTimer( int _frames ); diff --git a/source/enemy/nfdutch.cpp b/source/enemy/nfdutch.cpp index 7081a7ecc..8dd5e0767 100644 --- a/source/enemy/nfdutch.cpp +++ b/source/enemy/nfdutch.cpp @@ -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 ) diff --git a/source/enemy/nfdutch.h b/source/enemy/nfdutch.h index d946035f8..f90650aaf 100644 --- a/source/enemy/nfdutch.h +++ b/source/enemy/nfdutch.h @@ -25,6 +25,7 @@ public: void think( int _frames ); void postInit(); void render(); + void renderOnMapScreen( DVECTOR drawPos ); void shutdown(); u8 hasBeenAttacked(); protected: diff --git a/source/enemy/nmjfish.cpp b/source/enemy/nmjfish.cpp index c57a33327..879eb07e6 100644 --- a/source/enemy/nmjfish.cpp +++ b/source/enemy/nmjfish.cpp @@ -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 ) { }*/ diff --git a/source/enemy/nmjfish.h b/source/enemy/nmjfish.h index c02614253..be63b0010 100644 --- a/source/enemy/nmjfish.h +++ b/source/enemy/nmjfish.h @@ -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: diff --git a/source/enemy/npc.cpp b/source/enemy/npc.cpp index 2d6c9d0d3..c578de229 100644 --- a/source/enemy/npc.cpp +++ b/source/enemy/npc.cpp @@ -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; } diff --git a/source/enemy/nsshark.cpp b/source/enemy/nsshark.cpp index 690d119ec..1477f5a45 100644 --- a/source/enemy/nsshark.cpp +++ b/source/enemy/nsshark.cpp @@ -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 ) diff --git a/source/enemy/nsshark.h b/source/enemy/nsshark.h index 47aee0190..688351172 100644 --- a/source/enemy/nsshark.h +++ b/source/enemy/nsshark.h @@ -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 ); diff --git a/source/enemy/nssnake.cpp b/source/enemy/nssnake.cpp index a7b809966..b7ed509fa 100644 --- a/source/enemy/nssnake.cpp +++ b/source/enemy/nssnake.cpp @@ -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; diff --git a/source/enemy/nssnake.h b/source/enemy/nssnake.h index 085bca5b5..e5717579b 100644 --- a/source/enemy/nssnake.h +++ b/source/enemy/nssnake.h @@ -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 ); diff --git a/source/fx/fxjfish.cpp b/source/fx/fxjfish.cpp index 29addc6d0..d2a13351c 100644 --- a/source/fx/fxjfish.cpp +++ b/source/fx/fxjfish.cpp @@ -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>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; diff --git a/source/fx/fxjfish.h b/source/fx/fxjfish.h index baf615676..c6d5bc85d 100644 --- a/source/fx/fxjfish.h +++ b/source/fx/fxjfish.h @@ -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;}