This commit is contained in:
parent
805eb61563
commit
26e32d4c79
4 changed files with 5 additions and 34 deletions
|
@ -592,7 +592,6 @@ void CNpcEnemy::init()
|
||||||
m_heading = m_fireHeading = 0;
|
m_heading = m_fireHeading = 0;
|
||||||
m_movementTimer = 0;
|
m_movementTimer = 0;
|
||||||
m_timerTimer = 0;
|
m_timerTimer = 0;
|
||||||
m_collisionTimer = 0;
|
|
||||||
m_velocity = 0;
|
m_velocity = 0;
|
||||||
m_extension = 0;
|
m_extension = 0;
|
||||||
m_rotation = 0;
|
m_rotation = 0;
|
||||||
|
@ -643,7 +642,6 @@ void CNpcEnemy::reinit()
|
||||||
m_heading = m_fireHeading = 0;
|
m_heading = m_fireHeading = 0;
|
||||||
m_movementTimer = 0;
|
m_movementTimer = 0;
|
||||||
m_timerTimer = 0;
|
m_timerTimer = 0;
|
||||||
m_collisionTimer = 0;
|
|
||||||
m_velocity = 0;
|
m_velocity = 0;
|
||||||
m_extension = 0;
|
m_extension = 0;
|
||||||
m_rotation = 0;
|
m_rotation = 0;
|
||||||
|
@ -1239,11 +1237,6 @@ void CNpcEnemy::processCollision()
|
||||||
|
|
||||||
void CNpcEnemy::processTimer(int _frames)
|
void CNpcEnemy::processTimer(int _frames)
|
||||||
{
|
{
|
||||||
if ( m_collisionTimer > 0 )
|
|
||||||
{
|
|
||||||
m_collisionTimer -= _frames;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( m_timerTimer > 0 )
|
if ( m_timerTimer > 0 )
|
||||||
{
|
{
|
||||||
m_timerTimer -= _frames;
|
m_timerTimer -= _frames;
|
||||||
|
@ -1417,37 +1410,14 @@ void CNpcEnemy::processEnemyCollision( CThing *thisThing )
|
||||||
|
|
||||||
s16 headingFromTarget = ratan2( yDist, xDist );
|
s16 headingFromTarget = ratan2( yDist, xDist );
|
||||||
|
|
||||||
if ( xDist > 0 )
|
|
||||||
{
|
|
||||||
Pos.vx += 6;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Pos.vx -= 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( yDist > 0 )
|
|
||||||
{
|
|
||||||
Pos.vy += 3;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Pos.vy -= 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
Pos.vx += otherDelta.vx;
|
Pos.vx += otherDelta.vx;
|
||||||
Pos.vy += otherDelta.vy;
|
Pos.vy += otherDelta.vy;
|
||||||
|
|
||||||
if ( m_collisionTimer <= 0 )
|
m_heading = headingFromTarget;
|
||||||
{
|
|
||||||
m_collisionTimer = GameState::getOneSecondInFrames();
|
|
||||||
|
|
||||||
m_heading = headingFromTarget;
|
// try next waypoint to get around other enemy
|
||||||
|
|
||||||
// try next waypoint to get around other enemy
|
m_npcPath.incPath();
|
||||||
|
|
||||||
m_npcPath.incPath();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -280,7 +280,6 @@ protected:
|
||||||
s32 m_velocity;
|
s32 m_velocity;
|
||||||
bool m_evadeClockwise;
|
bool m_evadeClockwise;
|
||||||
s32 m_movementTimer;
|
s32 m_movementTimer;
|
||||||
s32 m_collisionTimer;
|
|
||||||
s32 m_timerTimer;
|
s32 m_timerTimer;
|
||||||
s32 m_extension;
|
s32 m_extension;
|
||||||
bool m_extendDir;
|
bool m_extendDir;
|
||||||
|
|
|
@ -19,6 +19,7 @@ class CNpcSquidDartEnemy : public CNpcEnemy
|
||||||
public:
|
public:
|
||||||
void render();
|
void render();
|
||||||
virtual int getFrameCount() {return( 4 );}
|
virtual int getFrameCount() {return( 4 );}
|
||||||
|
virtual u8 canCollideWithEnemy() {return( false );}
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -23,6 +23,7 @@ class CNpcSmallJellyfishEnemy : public CNpcEnemy
|
||||||
public:
|
public:
|
||||||
void render();
|
void render();
|
||||||
virtual int getFrameCount() {return( 6 );}
|
virtual int getFrameCount() {return( 6 );}
|
||||||
|
virtual u8 canCollideWithEnemy() {return( false );}
|
||||||
protected:
|
protected:
|
||||||
virtual bool processSensor();
|
virtual bool processSensor();
|
||||||
virtual void processClose( int _frames );
|
virtual void processClose( int _frames );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue