This commit is contained in:
parent
6c98c057a8
commit
9dc0ce319e
@ -34,32 +34,42 @@ void CNpcEnemy::processFlyingDutchmanMovement( int _frames )
|
|||||||
{
|
{
|
||||||
m_movementTimer -= _frames;
|
m_movementTimer -= _frames;
|
||||||
|
|
||||||
if ( m_extendDir == EXTEND_UP )
|
s32 xDist = m_extension - Pos.vx;
|
||||||
{
|
s32 xDistSqr = xDist * xDist;
|
||||||
s32 yDist = -10 - Pos.vy;
|
|
||||||
s32 yDistSqr = yDist * yDist;
|
|
||||||
|
|
||||||
if ( yDistSqr > 100 )
|
if ( xDistSqr > 100 )
|
||||||
{
|
{
|
||||||
processGenericGotoTarget( _frames, 0, yDist, m_data[m_type].speed );
|
processGenericGotoTarget( _frames, xDist, 0, m_data[m_type].speed );
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_extendDir = EXTEND_DOWN;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
s32 yDist = 400 - Pos.vy;
|
if ( m_extendDir == EXTEND_UP )
|
||||||
s32 yDistSqr = yDist * yDist;
|
|
||||||
|
|
||||||
if ( yDistSqr > 100 )
|
|
||||||
{
|
{
|
||||||
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
|
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_controlFunc = NPC_CONTROL_MOVEMENT;
|
||||||
m_movementTimer = GameState::getOneSecondInFrames() * 3;
|
m_movementTimer = GameState::getOneSecondInFrames() * 3;
|
||||||
m_state = FLYING_DUTCHMAN_ATTACK_PLAYER_1;
|
m_state = FLYING_DUTCHMAN_ATTACK_PLAYER_1;
|
||||||
|
|
||||||
|
if ( m_extension == 100 )
|
||||||
|
{
|
||||||
|
m_extension = 400;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_extension = 100;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -209,7 +209,7 @@ void CNpcEnemy::init()
|
|||||||
{
|
{
|
||||||
CEnemyThing::init();
|
CEnemyThing::init();
|
||||||
|
|
||||||
m_type = NPC_SUB_SHARK;
|
m_type = NPC_FLYING_DUTCHMAN;
|
||||||
|
|
||||||
// sActorHdr *Hdr = m_skel.Load( m_data[m_type].skelType );
|
// sActorHdr *Hdr = m_skel.Load( m_data[m_type].skelType );
|
||||||
// m_skel.Init( Hdr );
|
// m_skel.Init( Hdr );
|
||||||
@ -233,7 +233,7 @@ void CNpcEnemy::init()
|
|||||||
|
|
||||||
m_health = m_data[this->m_type].initHealth;
|
m_health = m_data[this->m_type].initHealth;
|
||||||
|
|
||||||
m_extension = EXTEND_RIGHT;
|
m_extendDir = EXTEND_RIGHT;
|
||||||
|
|
||||||
Pos.vx = 400;
|
Pos.vx = 400;
|
||||||
Pos.vy = 100;
|
Pos.vy = 100;
|
||||||
@ -307,6 +307,7 @@ void CNpcEnemy::init()
|
|||||||
{
|
{
|
||||||
m_state = FLYING_DUTCHMAN_ATTACK_PLAYER_1;
|
m_state = FLYING_DUTCHMAN_ATTACK_PLAYER_1;
|
||||||
m_extendDir = EXTEND_UP;
|
m_extendDir = EXTEND_UP;
|
||||||
|
m_extension = 100;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -731,7 +731,7 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
|||||||
NPC_TIMER_NONE,
|
NPC_TIMER_NONE,
|
||||||
false,
|
false,
|
||||||
3,
|
3,
|
||||||
256,
|
2048,
|
||||||
false,
|
false,
|
||||||
DAMAGE__HIT_ENEMY,
|
DAMAGE__HIT_ENEMY,
|
||||||
256,
|
256,
|
||||||
|
Loading…
Reference in New Issue
Block a user