diff --git a/source/enemy/nfdutch.cpp b/source/enemy/nfdutch.cpp index 483763573..2ec458afc 100644 --- a/source/enemy/nfdutch.cpp +++ b/source/enemy/nfdutch.cpp @@ -34,32 +34,42 @@ void CNpcEnemy::processFlyingDutchmanMovement( int _frames ) { m_movementTimer -= _frames; - if ( m_extendDir == EXTEND_UP ) - { - s32 yDist = -10 - Pos.vy; - s32 yDistSqr = yDist * yDist; + s32 xDist = m_extension - Pos.vx; + s32 xDistSqr = xDist * xDist; - if ( yDistSqr > 100 ) - { - processGenericGotoTarget( _frames, 0, yDist, m_data[m_type].speed ); - } - else - { - m_extendDir = EXTEND_DOWN; - } + if ( xDistSqr > 100 ) + { + processGenericGotoTarget( _frames, xDist, 0, m_data[m_type].speed ); } else { - s32 yDist = 400 - Pos.vy; - s32 yDistSqr = yDist * yDist; - - if ( yDistSqr > 100 ) + if ( m_extendDir == EXTEND_UP ) { - processGenericGotoTarget( _frames, 0, yDist, m_data[m_type].speed ); + s32 yDist = -10 - Pos.vy; + s32 yDistSqr = yDist * yDist; + + if ( yDistSqr > 100 ) + { + processGenericGotoTarget( _frames, 0, yDist, m_data[m_type].speed ); + } + else + { + m_extendDir = EXTEND_DOWN; + } } else { - m_extendDir = EXTEND_UP; + s32 yDist = 400 - Pos.vy; + s32 yDistSqr = yDist * yDist; + + if ( yDistSqr > 100 ) + { + processGenericGotoTarget( _frames, 0, yDist, m_data[m_type].speed ); + } + else + { + m_extendDir = EXTEND_UP; + } } } } @@ -129,6 +139,15 @@ void CNpcEnemy::processCloseFlyingDutchmanAttack( int _frames ) m_controlFunc = NPC_CONTROL_MOVEMENT; m_movementTimer = GameState::getOneSecondInFrames() * 3; m_state = FLYING_DUTCHMAN_ATTACK_PLAYER_1; + + if ( m_extension == 100 ) + { + m_extension = 400; + } + else + { + m_extension = 100; + } } break; diff --git a/source/enemy/npc.cpp b/source/enemy/npc.cpp index 800ad860a..db2e7ebb1 100644 --- a/source/enemy/npc.cpp +++ b/source/enemy/npc.cpp @@ -209,7 +209,7 @@ void CNpcEnemy::init() { CEnemyThing::init(); - m_type = NPC_SUB_SHARK; + m_type = NPC_FLYING_DUTCHMAN; // sActorHdr *Hdr = m_skel.Load( m_data[m_type].skelType ); // m_skel.Init( Hdr ); @@ -233,7 +233,7 @@ void CNpcEnemy::init() m_health = m_data[this->m_type].initHealth; - m_extension = EXTEND_RIGHT; + m_extendDir = EXTEND_RIGHT; Pos.vx = 400; Pos.vy = 100; @@ -307,6 +307,7 @@ void CNpcEnemy::init() { m_state = FLYING_DUTCHMAN_ATTACK_PLAYER_1; m_extendDir = EXTEND_UP; + m_extension = 100; break; } diff --git a/source/enemy/npcdata.cpp b/source/enemy/npcdata.cpp index a9fa7e4fd..4216a8850 100644 --- a/source/enemy/npcdata.cpp +++ b/source/enemy/npcdata.cpp @@ -731,7 +731,7 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] = NPC_TIMER_NONE, false, 3, - 256, + 2048, false, DAMAGE__HIT_ENEMY, 256,