This commit is contained in:
parent
851263ff5c
commit
056511ac63
6 changed files with 118 additions and 44 deletions
|
@ -27,9 +27,19 @@
|
|||
#include "projectl\projectl.h"
|
||||
#endif
|
||||
|
||||
#ifndef __ANIM_FLYINGDUTCHMAN_HEADER__
|
||||
#include <ACTOR_FLYINGDUTCHMAN_ANIM.h>
|
||||
#endif
|
||||
|
||||
void CNpcEnemy::processFlyingDutchmanMovement( int _frames )
|
||||
{
|
||||
if ( !m_animPlaying )
|
||||
{
|
||||
m_animPlaying = true;
|
||||
m_animNo = m_data[m_type].moveAnim;
|
||||
m_frame = 0;
|
||||
}
|
||||
|
||||
if ( m_movementTimer > 0 )
|
||||
{
|
||||
m_movementTimer -= _frames;
|
||||
|
@ -77,6 +87,15 @@ void CNpcEnemy::processFlyingDutchmanMovement( int _frames )
|
|||
{
|
||||
m_controlFunc = NPC_CONTROL_CLOSE;
|
||||
}
|
||||
|
||||
if ( playerXDist > 0 )
|
||||
{
|
||||
m_heading = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_heading = 2048;
|
||||
}
|
||||
}
|
||||
|
||||
void CNpcEnemy::processCloseFlyingDutchmanAttack( int _frames )
|
||||
|
@ -92,6 +111,13 @@ void CNpcEnemy::processCloseFlyingDutchmanAttack( int _frames )
|
|||
|
||||
if ( playerYDistSqr > 100 )
|
||||
{
|
||||
if ( !m_animPlaying )
|
||||
{
|
||||
m_animPlaying = true;
|
||||
m_animNo = m_data[m_type].moveAnim;
|
||||
m_frame = 0;
|
||||
}
|
||||
|
||||
processGenericGotoTarget( _frames, 0, playerYDist, m_data[m_type].speed );
|
||||
}
|
||||
else
|
||||
|
@ -101,33 +127,49 @@ void CNpcEnemy::processCloseFlyingDutchmanAttack( int _frames )
|
|||
case FLYING_DUTCHMAN_ATTACK_PLAYER_1:
|
||||
case FLYING_DUTCHMAN_ATTACK_PLAYER_2:
|
||||
{
|
||||
// fire at player
|
||||
|
||||
s16 heading;
|
||||
|
||||
if ( playerXDist > 0 )
|
||||
if ( m_animNo != ANIM_FLYINGDUTCHMAN_FIREATTACK )
|
||||
{
|
||||
heading = 0;
|
||||
m_animNo = ANIM_FLYINGDUTCHMAN_FIREATTACK;
|
||||
m_animPlaying = true;
|
||||
m_frame = 0;
|
||||
}
|
||||
else
|
||||
else if ( !m_animPlaying )
|
||||
{
|
||||
heading = 2048;
|
||||
// fire at player
|
||||
|
||||
s16 heading;
|
||||
|
||||
if ( playerXDist > 0 )
|
||||
{
|
||||
heading = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
heading = 2048;
|
||||
}
|
||||
|
||||
CProjectile *projectile;
|
||||
projectile = new( "test projectile" ) CProjectile;
|
||||
projectile->init( Pos, heading );
|
||||
|
||||
m_controlFunc = NPC_CONTROL_MOVEMENT;
|
||||
m_movementTimer = GameState::getOneSecondInFrames() * 3;
|
||||
|
||||
m_state++;
|
||||
}
|
||||
|
||||
CProjectile *projectile;
|
||||
projectile = new( "test projectile" ) CProjectile;
|
||||
projectile->init( Pos, heading );
|
||||
|
||||
m_controlFunc = NPC_CONTROL_MOVEMENT;
|
||||
m_movementTimer = GameState::getOneSecondInFrames() * 3;
|
||||
|
||||
m_state++;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
if ( !m_animPlaying )
|
||||
{
|
||||
m_animPlaying = true;
|
||||
m_animNo = m_data[m_type].moveAnim;
|
||||
m_frame = 0;
|
||||
}
|
||||
|
||||
// charge player
|
||||
|
||||
if ( playerXDistSqr + playerYDistSqr > 100 )
|
||||
|
@ -154,4 +196,13 @@ void CNpcEnemy::processCloseFlyingDutchmanAttack( int _frames )
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( playerXDist > 0 )
|
||||
{
|
||||
m_heading = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_heading = 2048;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue