This commit is contained in:
Charles 2001-03-13 20:45:51 +00:00
parent 6c98c057a8
commit 9dc0ce319e
3 changed files with 41 additions and 21 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -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,