This commit is contained in:
parent
220d6cc144
commit
bd4323bd18
8 changed files with 140 additions and 2 deletions
|
@ -438,6 +438,7 @@ void CNpcIronDogfishEnemy::processShot( int _frames )
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setToShutdown();
|
setToShutdown();
|
||||||
|
CGameScene::setBossHasBeenKilled();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,10 +31,17 @@
|
||||||
#include "projectl\projectl.h"
|
#include "projectl\projectl.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __VID_HEADER_
|
||||||
|
#include "system\vid.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __ANIM_FLYINGDUTCHMAN_HEADER__
|
#ifndef __ANIM_FLYINGDUTCHMAN_HEADER__
|
||||||
#include <ACTOR_FLYINGDUTCHMAN_ANIM.h>
|
#include <ACTOR_FLYINGDUTCHMAN_ANIM.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void CNpcFlyingDutchmanEnemy::postInit()
|
void CNpcFlyingDutchmanEnemy::postInit()
|
||||||
{
|
{
|
||||||
m_state = FLYING_DUTCHMAN_ATTACK_PLAYER_1;
|
m_state = FLYING_DUTCHMAN_ATTACK_PLAYER_1;
|
||||||
|
@ -47,6 +54,8 @@ void CNpcFlyingDutchmanEnemy::postInit()
|
||||||
m_extension = minX;
|
m_extension = minX;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void CNpcFlyingDutchmanEnemy::processMovement( int _frames )
|
void CNpcFlyingDutchmanEnemy::processMovement( int _frames )
|
||||||
{
|
{
|
||||||
if ( !m_animPlaying )
|
if ( !m_animPlaying )
|
||||||
|
@ -114,6 +123,8 @@ void CNpcFlyingDutchmanEnemy::processMovement( int _frames )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void CNpcFlyingDutchmanEnemy::processClose( int _frames )
|
void CNpcFlyingDutchmanEnemy::processClose( int _frames )
|
||||||
{
|
{
|
||||||
if ( playerYDist > 0 )
|
if ( playerYDist > 0 )
|
||||||
|
@ -225,3 +236,117 @@ void CNpcFlyingDutchmanEnemy::processClose( int _frames )
|
||||||
m_heading = 2048;
|
m_heading = 2048;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
virtual void processClose( int _frames );
|
virtual void processClose( int _frames );
|
||||||
virtual void processMovement( int _frames );
|
virtual void processMovement( int _frames );
|
||||||
|
virtual void processShot( int _frames );
|
||||||
|
|
||||||
enum NPC_FLYING_DUTCHMAN_STATE
|
enum NPC_FLYING_DUTCHMAN_STATE
|
||||||
{
|
{
|
||||||
|
|
|
@ -456,3 +456,11 @@ u8 CNpcMotherJellyfishEnemy::canBeCaughtByNet()
|
||||||
{
|
{
|
||||||
return( m_isActive && !m_isDying && m_health <= 5 );
|
return( m_isActive && !m_isDying && m_health <= 5 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void CNpcMotherJellyfishEnemy::caughtWithNet()
|
||||||
|
{
|
||||||
|
setToShutdown();
|
||||||
|
CGameScene::setBossHasBeenKilled();
|
||||||
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@ public:
|
||||||
virtual void shutdown();
|
virtual void shutdown();
|
||||||
virtual void setupWaypoints( sThingActor *ThisActor );
|
virtual void setupWaypoints( sThingActor *ThisActor );
|
||||||
virtual u8 canBeCaughtByNet();
|
virtual u8 canBeCaughtByNet();
|
||||||
|
virtual void caughtWithNet();
|
||||||
protected:
|
protected:
|
||||||
virtual void processClose( int _frames );
|
virtual void processClose( int _frames );
|
||||||
virtual void processMovement( int _frames );
|
virtual void processMovement( int _frames );
|
||||||
|
|
|
@ -113,7 +113,7 @@ public:
|
||||||
virtual u8 hasBeenAttacked();
|
virtual u8 hasBeenAttacked();
|
||||||
virtual void hasBeenSteamed( DVECTOR &steamPos ) {hasBeenAttacked();}
|
virtual void hasBeenSteamed( DVECTOR &steamPos ) {hasBeenAttacked();}
|
||||||
virtual u8 canBeCaughtByNet();
|
virtual u8 canBeCaughtByNet();
|
||||||
void caughtWithNet();
|
virtual void caughtWithNet();
|
||||||
virtual int getFrameCount();
|
virtual int getFrameCount();
|
||||||
virtual int getFrame() {return( m_frame );}
|
virtual int getFrame() {return( m_frame );}
|
||||||
void setSpeed( s16 newSpeed ) {m_speed = newSpeed;}
|
void setSpeed( s16 newSpeed ) {m_speed = newSpeed;}
|
||||||
|
|
|
@ -388,6 +388,7 @@ void CNpcSubSharkEnemy::processShot( int _frames )
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
setToShutdown();
|
setToShutdown();
|
||||||
|
CGameScene::setBossHasBeenKilled();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -679,6 +679,7 @@ void CNpcSeaSnakeEnemy::processShot( int _frames )
|
||||||
if ( Pos.vy - offset.vy > VidGetScrH() )
|
if ( Pos.vy - offset.vy > VidGetScrH() )
|
||||||
{
|
{
|
||||||
setToShutdown();
|
setToShutdown();
|
||||||
|
CGameScene::setBossHasBeenKilled();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue