This commit is contained in:
parent
3a8b8a4535
commit
6c608b0aca
19 changed files with 48 additions and 67 deletions
|
@ -53,6 +53,7 @@ void CNpcAnemoneEnemy::postInit()
|
||||||
{
|
{
|
||||||
CNpcEnemy::postInit();
|
CNpcEnemy::postInit();
|
||||||
m_drawRotation = m_heading + 1024;
|
m_drawRotation = m_heading + 1024;
|
||||||
|
m_fireHeading = m_heading;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -25,6 +25,8 @@ public:
|
||||||
protected:
|
protected:
|
||||||
virtual void processEnemyCollision( CThing *thisThing );
|
virtual void processEnemyCollision( CThing *thisThing );
|
||||||
virtual bool processSensor();
|
virtual bool processSensor();
|
||||||
|
|
||||||
|
s32 m_fireHeading;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CNpcAnemone1Enemy : public CNpcAnemoneEnemy
|
class CNpcAnemone1Enemy : public CNpcAnemoneEnemy
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
void CNpcBallBlobEnemy::postInit()
|
void CNpcBallBlobEnemy::postInit()
|
||||||
{
|
{
|
||||||
m_heading = m_fireHeading = 128;
|
m_heading = 128;
|
||||||
|
|
||||||
m_npcPath.setPathType( CNpcPath::PONG_PATH );
|
m_npcPath.setPathType( CNpcPath::PONG_PATH );
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@ void CNpcEyeballEnemy::processEnemyCollision( CThing *thisThing )
|
||||||
void CNpcEyeballEnemy::postInit()
|
void CNpcEyeballEnemy::postInit()
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
m_fireHeading = m_heading;
|
||||||
CProjectile *projectile;
|
CProjectile *projectile;
|
||||||
projectile = new ( "eyeball projectile" ) CProjectile;
|
projectile = new ( "eyeball projectile" ) CProjectile;
|
||||||
projectile->init( Pos, m_fireHeading, CProjectile::PROJECTILE_FIXED, CProjectile::PROJECTILE_INFINITE_LIFE );
|
projectile->init( Pos, m_fireHeading, CProjectile::PROJECTILE_FIXED, CProjectile::PROJECTILE_INFINITE_LIFE );
|
||||||
|
|
|
@ -24,6 +24,8 @@ protected:
|
||||||
virtual void processEnemyCollision( CThing *thisThing );
|
virtual void processEnemyCollision( CThing *thisThing );
|
||||||
virtual bool processSensor();
|
virtual bool processSensor();
|
||||||
virtual void processClose( int _frames );
|
virtual void processClose( int _frames );
|
||||||
|
|
||||||
|
s32 m_fireHeading;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -30,7 +30,7 @@
|
||||||
|
|
||||||
void CNpcFishFolk::postInit()
|
void CNpcFishFolk::postInit()
|
||||||
{
|
{
|
||||||
m_heading = m_fireHeading = 0;
|
m_heading = 0;
|
||||||
|
|
||||||
DVECTOR newPos;
|
DVECTOR newPos;
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ void CNpcFlamingSkullEnemy::processEnemyCollision( CThing *thisThing )
|
||||||
void CNpcFlamingSkullEnemy::postInit()
|
void CNpcFlamingSkullEnemy::postInit()
|
||||||
{
|
{
|
||||||
m_state = FLAMING_SKULL_ATTACK;
|
m_state = FLAMING_SKULL_ATTACK;
|
||||||
|
m_fireHeading = m_heading;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CNpcFlamingSkullEnemy::processSensor()
|
bool CNpcFlamingSkullEnemy::processSensor()
|
||||||
|
|
|
@ -22,6 +22,8 @@ protected:
|
||||||
virtual bool processSensor();
|
virtual bool processSensor();
|
||||||
virtual void processClose( int _frames );
|
virtual void processClose( int _frames );
|
||||||
|
|
||||||
|
s32 m_fireHeading;
|
||||||
|
|
||||||
enum NPC_FLAMING_SKULL_STATE
|
enum NPC_FLAMING_SKULL_STATE
|
||||||
{
|
{
|
||||||
FLAMING_SKULL_ATTACK = 0,
|
FLAMING_SKULL_ATTACK = 0,
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
void CNpcGhostPirateEnemy::postInit()
|
void CNpcGhostPirateEnemy::postInit()
|
||||||
{
|
{
|
||||||
m_heading = m_fireHeading = 3072;
|
m_heading = 3072;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CNpcGhostPirateEnemy::processSensor()
|
bool CNpcGhostPirateEnemy::processSensor()
|
||||||
|
|
|
@ -602,14 +602,11 @@ void CNpcEnemy::init()
|
||||||
m_animNo = m_data[m_type].initAnim;
|
m_animNo = m_data[m_type].initAnim;
|
||||||
m_frame = 0;
|
m_frame = 0;
|
||||||
|
|
||||||
m_heading = m_fireHeading = 0;
|
|
||||||
m_movementTimer = 0;
|
m_movementTimer = 0;
|
||||||
m_timerTimer = 0;
|
m_timerTimer = 0;
|
||||||
m_velocity = 0;
|
m_velocity = 0;
|
||||||
m_extension = 0;
|
m_extension = 0;
|
||||||
m_rotation = 0;
|
|
||||||
m_reversed = false;
|
m_reversed = false;
|
||||||
m_salvoCount = 0;
|
|
||||||
m_isActive = true;
|
m_isActive = true;
|
||||||
m_isDying = false;
|
m_isDying = false;
|
||||||
|
|
||||||
|
@ -626,13 +623,6 @@ void CNpcEnemy::init()
|
||||||
|
|
||||||
m_npcPath.initPath();
|
m_npcPath.initPath();
|
||||||
|
|
||||||
DVECTOR ofs = getCollisionSize();
|
|
||||||
|
|
||||||
m_drawOffset.vx = 0;
|
|
||||||
m_drawOffset.vy = -( ofs.vy >> 1 );
|
|
||||||
|
|
||||||
m_positionHistory = NULL;
|
|
||||||
|
|
||||||
m_isShuttingDown = false;
|
m_isShuttingDown = false;
|
||||||
m_drawRotation = 0;
|
m_drawRotation = 0;
|
||||||
m_isCaught = false;
|
m_isCaught = false;
|
||||||
|
@ -657,14 +647,11 @@ void CNpcEnemy::reinit()
|
||||||
m_animNo = m_data[m_type].initAnim;
|
m_animNo = m_data[m_type].initAnim;
|
||||||
m_frame = 0;
|
m_frame = 0;
|
||||||
|
|
||||||
m_heading = m_fireHeading = 0;
|
|
||||||
m_movementTimer = 0;
|
m_movementTimer = 0;
|
||||||
m_timerTimer = 0;
|
m_timerTimer = 0;
|
||||||
m_velocity = 0;
|
m_velocity = 0;
|
||||||
m_extension = 0;
|
m_extension = 0;
|
||||||
m_rotation = 0;
|
|
||||||
m_reversed = false;
|
m_reversed = false;
|
||||||
m_salvoCount = 0;
|
|
||||||
m_isActive = true;
|
m_isActive = true;
|
||||||
m_isDying = false;
|
m_isDying = false;
|
||||||
|
|
||||||
|
@ -690,24 +677,6 @@ void CNpcEnemy::shutdown()
|
||||||
|
|
||||||
m_npcPath.removeAllWaypoints();
|
m_npcPath.removeAllWaypoints();
|
||||||
|
|
||||||
// remove position history
|
|
||||||
|
|
||||||
CNpcPositionHistory *currentPosition;
|
|
||||||
CNpcPositionHistory *oldPosition;
|
|
||||||
|
|
||||||
currentPosition = m_positionHistory;
|
|
||||||
|
|
||||||
while( currentPosition )
|
|
||||||
{
|
|
||||||
oldPosition = currentPosition;
|
|
||||||
currentPosition = currentPosition->next;
|
|
||||||
|
|
||||||
oldPosition->prev->next = NULL;
|
|
||||||
delete oldPosition;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_positionHistory = NULL;
|
|
||||||
|
|
||||||
if (m_actorGfx) delete m_actorGfx;
|
if (m_actorGfx) delete m_actorGfx;
|
||||||
|
|
||||||
CEnemyThing::shutdown();
|
CEnemyThing::shutdown();
|
||||||
|
|
|
@ -281,19 +281,15 @@ protected:
|
||||||
NPC_MOVEMENT_FUNC m_movementFunc;
|
NPC_MOVEMENT_FUNC m_movementFunc;
|
||||||
CNpcPath m_npcPath;
|
CNpcPath m_npcPath;
|
||||||
s32 m_heading;
|
s32 m_heading;
|
||||||
s32 m_fireHeading;
|
|
||||||
s32 m_velocity;
|
s32 m_velocity;
|
||||||
bool m_evadeClockwise;
|
|
||||||
s32 m_movementTimer;
|
s32 m_movementTimer;
|
||||||
s32 m_timerTimer;
|
s32 m_timerTimer;
|
||||||
s32 m_extension;
|
s32 m_extension;
|
||||||
bool m_extendDir;
|
bool m_extendDir;
|
||||||
s16 m_rotation;
|
|
||||||
DVECTOR m_base;
|
DVECTOR m_base;
|
||||||
DVECTOR m_initPos;
|
DVECTOR m_initPos;
|
||||||
u8 m_state;
|
u8 m_state;
|
||||||
u8 m_oldState;
|
u8 m_oldState;
|
||||||
u8 m_salvoCount;
|
|
||||||
bool m_animPlaying;
|
bool m_animPlaying;
|
||||||
bool m_reversed;
|
bool m_reversed;
|
||||||
s32 m_health;
|
s32 m_health;
|
||||||
|
@ -308,25 +304,12 @@ protected:
|
||||||
int m_animNo;
|
int m_animNo;
|
||||||
CActorGfx *m_actorGfx;
|
CActorGfx *m_actorGfx;
|
||||||
SpriteBank *m_spriteBank;
|
SpriteBank *m_spriteBank;
|
||||||
DVECTOR m_drawOffset;
|
|
||||||
POLY_FT4 *SprFrame;
|
POLY_FT4 *SprFrame;
|
||||||
|
|
||||||
virtual void collidedWith(CThing *_thisThing);
|
virtual void collidedWith(CThing *_thisThing);
|
||||||
|
|
||||||
u8 m_isShuttingDown;
|
u8 m_isShuttingDown;
|
||||||
s16 m_drawRotation;
|
s16 m_drawRotation;
|
||||||
|
|
||||||
// position history stuff
|
|
||||||
|
|
||||||
class CNpcPositionHistory
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
DVECTOR pos;
|
|
||||||
CNpcPositionHistory *next;
|
|
||||||
CNpcPositionHistory *prev;
|
|
||||||
};
|
|
||||||
|
|
||||||
CNpcPositionHistory *m_positionHistory;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -41,6 +41,7 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
s32 m_lifetime;
|
s32 m_lifetime;
|
||||||
|
bool m_evadeClockwise;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -38,6 +38,8 @@ protected:
|
||||||
{
|
{
|
||||||
NPC_JELLYFISH_RESISTANCE = 64,
|
NPC_JELLYFISH_RESISTANCE = 64,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
bool m_evadeClockwise;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -41,6 +41,7 @@ void CNpcSubSharkEnemy::postInit()
|
||||||
m_state = SUB_SHARK_MINE_1;
|
m_state = SUB_SHARK_MINE_1;
|
||||||
m_extendDir = EXTEND_RIGHT;
|
m_extendDir = EXTEND_RIGHT;
|
||||||
m_npcPath.setPathType( CNpcPath::PONG_PATH );
|
m_npcPath.setPathType( CNpcPath::PONG_PATH );
|
||||||
|
m_salvoCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CNpcSubSharkEnemy::processMovement( int _frames )
|
void CNpcSubSharkEnemy::processMovement( int _frames )
|
||||||
|
|
|
@ -34,6 +34,8 @@ protected:
|
||||||
{
|
{
|
||||||
NPC_SUB_SHARK_HIGH_SPEED = 6,
|
NPC_SUB_SHARK_HIGH_SPEED = 6,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
u8 m_salvoCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -48,14 +48,6 @@ void CNpcParasiticWormSegment::init()
|
||||||
m_heading = 0;
|
m_heading = 0;
|
||||||
m_nextSegment = NULL;
|
m_nextSegment = NULL;
|
||||||
|
|
||||||
/*DVECTOR ofs = getCollisionSize();
|
|
||||||
|
|
||||||
m_drawOffset.vx = 0;
|
|
||||||
m_drawOffset.vy = -( ofs.vy >> 1 );
|
|
||||||
|
|
||||||
updateCollisionArea();*/
|
|
||||||
|
|
||||||
//sBBox boundingBox = m_actorGfx->GetBBox();
|
|
||||||
setCollisionSize( 20, 20 );
|
setCollisionSize( 20, 20 );
|
||||||
setCollisionCentreOffset( 10, 10 );
|
setCollisionCentreOffset( 10, 10 );
|
||||||
updateCollisionArea();
|
updateCollisionArea();
|
||||||
|
@ -197,6 +189,24 @@ void CNpcParasiticWormEnemy::shutdown()
|
||||||
delete oldSegment;
|
delete oldSegment;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// remove position history
|
||||||
|
|
||||||
|
CNpcPositionHistory *currentPosition;
|
||||||
|
CNpcPositionHistory *oldPosition;
|
||||||
|
|
||||||
|
currentPosition = m_positionHistory;
|
||||||
|
|
||||||
|
while( currentPosition )
|
||||||
|
{
|
||||||
|
oldPosition = currentPosition;
|
||||||
|
currentPosition = currentPosition->next;
|
||||||
|
|
||||||
|
oldPosition->prev->next = NULL;
|
||||||
|
delete oldPosition;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_positionHistory = NULL;
|
||||||
|
|
||||||
CNpcEnemy::shutdown();
|
CNpcEnemy::shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -66,8 +66,18 @@ protected:
|
||||||
NPC_PARASITIC_WORM_LENGTH = 10,
|
NPC_PARASITIC_WORM_LENGTH = 10,
|
||||||
};
|
};
|
||||||
|
|
||||||
CNpcParasiticWormSegment *m_segment;
|
// position history stuff
|
||||||
|
|
||||||
|
class CNpcPositionHistory
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
DVECTOR pos;
|
||||||
|
CNpcPositionHistory *next;
|
||||||
|
CNpcPositionHistory *prev;
|
||||||
|
};
|
||||||
|
|
||||||
|
CNpcParasiticWormSegment *m_segment;
|
||||||
|
CNpcPositionHistory *m_positionHistory;
|
||||||
s32 m_collTimer;
|
s32 m_collTimer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -171,11 +171,6 @@ void CNpcFriend::init()
|
||||||
m_animNo = m_data[m_type].idleAnim;
|
m_animNo = m_data[m_type].idleAnim;
|
||||||
m_frame = 0;
|
m_frame = 0;
|
||||||
m_reversed = false;
|
m_reversed = false;
|
||||||
|
|
||||||
DVECTOR ofs = getCollisionSize();
|
|
||||||
|
|
||||||
m_drawOffset.vx = 0;
|
|
||||||
m_drawOffset.vy = -( ofs.vy >> 1 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
|
@ -96,7 +96,6 @@ protected:
|
||||||
int m_animNo;
|
int m_animNo;
|
||||||
u8 m_animPlaying;
|
u8 m_animPlaying;
|
||||||
CActorGfx *m_actorGfx;
|
CActorGfx *m_actorGfx;
|
||||||
DVECTOR m_drawOffset;
|
|
||||||
bool m_reversed;
|
bool m_reversed;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue