From bd4323bd18382947c85ad548f94eea15ce41b7c4 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 12 Jun 2001 18:12:34 +0000 Subject: [PATCH] --- source/enemy/ndogfish.cpp | 1 + source/enemy/nfdutch.cpp | 127 +++++++++++++++++++++++++++++++++++++- source/enemy/nfdutch.h | 1 + source/enemy/nmjfish.cpp | 8 +++ source/enemy/nmjfish.h | 1 + source/enemy/npc.h | 2 +- source/enemy/nsshark.cpp | 1 + source/enemy/nssnake.cpp | 1 + 8 files changed, 140 insertions(+), 2 deletions(-) diff --git a/source/enemy/ndogfish.cpp b/source/enemy/ndogfish.cpp index ae631bd31..21d1397c1 100644 --- a/source/enemy/ndogfish.cpp +++ b/source/enemy/ndogfish.cpp @@ -438,6 +438,7 @@ void CNpcIronDogfishEnemy::processShot( int _frames ) else { setToShutdown(); + CGameScene::setBossHasBeenKilled(); } } } diff --git a/source/enemy/nfdutch.cpp b/source/enemy/nfdutch.cpp index d5440fbfa..9ce10510f 100644 --- a/source/enemy/nfdutch.cpp +++ b/source/enemy/nfdutch.cpp @@ -31,10 +31,17 @@ #include "projectl\projectl.h" #endif +#ifndef __VID_HEADER_ +#include "system\vid.h" +#endif + #ifndef __ANIM_FLYINGDUTCHMAN_HEADER__ #include #endif + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + void CNpcFlyingDutchmanEnemy::postInit() { m_state = FLYING_DUTCHMAN_ATTACK_PLAYER_1; @@ -47,6 +54,8 @@ void CNpcFlyingDutchmanEnemy::postInit() m_extension = minX; } +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + void CNpcFlyingDutchmanEnemy::processMovement( int _frames ) { if ( !m_animPlaying ) @@ -114,6 +123,8 @@ void CNpcFlyingDutchmanEnemy::processMovement( int _frames ) } } +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + void CNpcFlyingDutchmanEnemy::processClose( int _frames ) { if ( playerYDist > 0 ) @@ -224,4 +235,118 @@ void CNpcFlyingDutchmanEnemy::processClose( int _frames ) { m_heading = 2048; } -} \ No newline at end of file +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void CNpcFlyingDutchmanEnemy::processShot( int _frames ) +{ + switch( m_data[m_type].shotFunc ) + { + case NPC_SHOT_NONE: + { + // do nothing + + break; + } + + case NPC_SHOT_GENERIC: + { + switch ( m_state ) + { + case NPC_GENERIC_HIT_CHECK_HEALTH: + { + m_health -= 5; + + if ( m_health < 0 ) + { + m_state = NPC_GENERIC_HIT_DEATH_START; + m_isDying = true; + } + else + { + m_state = NPC_GENERIC_HIT_RECOIL; + + m_animPlaying = true; + m_animNo = m_data[m_type].recoilAnim; + m_frame = 0; + } + + break; + } + + case NPC_GENERIC_HIT_RECOIL: + { + if ( !m_animPlaying ) + { + m_state = 0; + m_controlFunc = NPC_CONTROL_MOVEMENT; + } + + break; + } + + case NPC_GENERIC_HIT_DEATH_START: + { + m_animPlaying = true; + m_animNo = m_data[m_type].dieAnim; + m_frame = 0; + m_state = NPC_GENERIC_HIT_DEATH_END; + m_isDying = true; + + if ( m_data[m_type].deathSfx < CSoundMediator::NUM_SFXIDS ) + { + CSoundMediator::playSfx( m_data[m_type].deathSfx ); + } + + m_speed = -5; + + if (m_data[m_type].skelType) + { + m_actorGfx->SetOtPos( 0 ); + } + + break; + } + + case NPC_GENERIC_HIT_DEATH_END: + { + if ( !m_animPlaying ) + { + m_drawRotation += 64 * _frames; + m_drawRotation &= 4095; + + Pos.vy += m_speed * _frames; + + if ( m_speed < 5 ) + { + m_speed++; + } + + DVECTOR offset = CLevel::getCameraPos(); + + if ( Pos.vy - offset.vy > VidGetScrH() ) + { + if ( m_data[m_type].respawning ) + { + m_isActive = false; + + m_timerFunc = NPC_TIMER_RESPAWN; + m_timerTimer = 4 * GameState::getOneSecondInFrames(); + } + else + { + setToShutdown(); + CGameScene::setBossHasBeenKilled(); + } + } + } + + break; + } + } + + break; + } + } +} diff --git a/source/enemy/nfdutch.h b/source/enemy/nfdutch.h index 26d63e564..74f28e68f 100644 --- a/source/enemy/nfdutch.h +++ b/source/enemy/nfdutch.h @@ -21,6 +21,7 @@ public: protected: virtual void processClose( int _frames ); virtual void processMovement( int _frames ); + virtual void processShot( int _frames ); enum NPC_FLYING_DUTCHMAN_STATE { diff --git a/source/enemy/nmjfish.cpp b/source/enemy/nmjfish.cpp index 4f4601acb..383a32d23 100644 --- a/source/enemy/nmjfish.cpp +++ b/source/enemy/nmjfish.cpp @@ -456,3 +456,11 @@ u8 CNpcMotherJellyfishEnemy::canBeCaughtByNet() { return( m_isActive && !m_isDying && m_health <= 5 ); } + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void CNpcMotherJellyfishEnemy::caughtWithNet() +{ + setToShutdown(); + CGameScene::setBossHasBeenKilled(); +} diff --git a/source/enemy/nmjfish.h b/source/enemy/nmjfish.h index 7e02337bf..7df7266fc 100644 --- a/source/enemy/nmjfish.h +++ b/source/enemy/nmjfish.h @@ -26,6 +26,7 @@ public: virtual void shutdown(); virtual void setupWaypoints( sThingActor *ThisActor ); virtual u8 canBeCaughtByNet(); + virtual void caughtWithNet(); protected: virtual void processClose( int _frames ); virtual void processMovement( int _frames ); diff --git a/source/enemy/npc.h b/source/enemy/npc.h index 295f8f20c..debef9c25 100644 --- a/source/enemy/npc.h +++ b/source/enemy/npc.h @@ -113,7 +113,7 @@ public: virtual u8 hasBeenAttacked(); virtual void hasBeenSteamed( DVECTOR &steamPos ) {hasBeenAttacked();} virtual u8 canBeCaughtByNet(); - void caughtWithNet(); + virtual void caughtWithNet(); virtual int getFrameCount(); virtual int getFrame() {return( m_frame );} void setSpeed( s16 newSpeed ) {m_speed = newSpeed;} diff --git a/source/enemy/nsshark.cpp b/source/enemy/nsshark.cpp index c70511bbf..18064eb58 100644 --- a/source/enemy/nsshark.cpp +++ b/source/enemy/nsshark.cpp @@ -388,6 +388,7 @@ void CNpcSubSharkEnemy::processShot( int _frames ) else { setToShutdown(); + CGameScene::setBossHasBeenKilled(); } } } diff --git a/source/enemy/nssnake.cpp b/source/enemy/nssnake.cpp index 619cd6480..7c0013979 100644 --- a/source/enemy/nssnake.cpp +++ b/source/enemy/nssnake.cpp @@ -679,6 +679,7 @@ void CNpcSeaSnakeEnemy::processShot( int _frames ) if ( Pos.vy - offset.vy > VidGetScrH() ) { setToShutdown(); + CGameScene::setBossHasBeenKilled(); } } else