This commit is contained in:
Charles 2001-05-16 19:04:40 +00:00
parent 3a8b8a4535
commit 6c608b0aca
19 changed files with 48 additions and 67 deletions

View File

@ -53,6 +53,7 @@ void CNpcAnemoneEnemy::postInit()
{
CNpcEnemy::postInit();
m_drawRotation = m_heading + 1024;
m_fireHeading = m_heading;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -25,6 +25,8 @@ public:
protected:
virtual void processEnemyCollision( CThing *thisThing );
virtual bool processSensor();
s32 m_fireHeading;
};
class CNpcAnemone1Enemy : public CNpcAnemoneEnemy

View File

@ -29,7 +29,7 @@
void CNpcBallBlobEnemy::postInit()
{
m_heading = m_fireHeading = 128;
m_heading = 128;
m_npcPath.setPathType( CNpcPath::PONG_PATH );

View File

@ -40,6 +40,7 @@ void CNpcEyeballEnemy::processEnemyCollision( CThing *thisThing )
void CNpcEyeballEnemy::postInit()
{
return;
m_fireHeading = m_heading;
CProjectile *projectile;
projectile = new ( "eyeball projectile" ) CProjectile;
projectile->init( Pos, m_fireHeading, CProjectile::PROJECTILE_FIXED, CProjectile::PROJECTILE_INFINITE_LIFE );

View File

@ -24,6 +24,8 @@ protected:
virtual void processEnemyCollision( CThing *thisThing );
virtual bool processSensor();
virtual void processClose( int _frames );
s32 m_fireHeading;
};
#endif

View File

@ -30,7 +30,7 @@
void CNpcFishFolk::postInit()
{
m_heading = m_fireHeading = 0;
m_heading = 0;
DVECTOR newPos;

View File

@ -36,6 +36,7 @@ void CNpcFlamingSkullEnemy::processEnemyCollision( CThing *thisThing )
void CNpcFlamingSkullEnemy::postInit()
{
m_state = FLAMING_SKULL_ATTACK;
m_fireHeading = m_heading;
}
bool CNpcFlamingSkullEnemy::processSensor()

View File

@ -22,6 +22,8 @@ protected:
virtual bool processSensor();
virtual void processClose( int _frames );
s32 m_fireHeading;
enum NPC_FLAMING_SKULL_STATE
{
FLAMING_SKULL_ATTACK = 0,

View File

@ -34,7 +34,7 @@
void CNpcGhostPirateEnemy::postInit()
{
m_heading = m_fireHeading = 3072;
m_heading = 3072;
}
bool CNpcGhostPirateEnemy::processSensor()

View File

@ -602,14 +602,11 @@ void CNpcEnemy::init()
m_animNo = m_data[m_type].initAnim;
m_frame = 0;
m_heading = m_fireHeading = 0;
m_movementTimer = 0;
m_timerTimer = 0;
m_velocity = 0;
m_extension = 0;
m_rotation = 0;
m_reversed = false;
m_salvoCount = 0;
m_isActive = true;
m_isDying = false;
@ -626,13 +623,6 @@ void CNpcEnemy::init()
m_npcPath.initPath();
DVECTOR ofs = getCollisionSize();
m_drawOffset.vx = 0;
m_drawOffset.vy = -( ofs.vy >> 1 );
m_positionHistory = NULL;
m_isShuttingDown = false;
m_drawRotation = 0;
m_isCaught = false;
@ -657,14 +647,11 @@ void CNpcEnemy::reinit()
m_animNo = m_data[m_type].initAnim;
m_frame = 0;
m_heading = m_fireHeading = 0;
m_movementTimer = 0;
m_timerTimer = 0;
m_velocity = 0;
m_extension = 0;
m_rotation = 0;
m_reversed = false;
m_salvoCount = 0;
m_isActive = true;
m_isDying = false;
@ -690,24 +677,6 @@ void CNpcEnemy::shutdown()
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;
CEnemyThing::shutdown();

View File

@ -281,19 +281,15 @@ protected:
NPC_MOVEMENT_FUNC m_movementFunc;
CNpcPath m_npcPath;
s32 m_heading;
s32 m_fireHeading;
s32 m_velocity;
bool m_evadeClockwise;
s32 m_movementTimer;
s32 m_timerTimer;
s32 m_extension;
bool m_extendDir;
s16 m_rotation;
DVECTOR m_base;
DVECTOR m_initPos;
u8 m_state;
u8 m_oldState;
u8 m_salvoCount;
bool m_animPlaying;
bool m_reversed;
s32 m_health;
@ -308,25 +304,12 @@ protected:
int m_animNo;
CActorGfx *m_actorGfx;
SpriteBank *m_spriteBank;
DVECTOR m_drawOffset;
POLY_FT4 *SprFrame;
virtual void collidedWith(CThing *_thisThing);
u8 m_isShuttingDown;
s16 m_drawRotation;
// position history stuff
class CNpcPositionHistory
{
public:
DVECTOR pos;
CNpcPositionHistory *next;
CNpcPositionHistory *prev;
};
CNpcPositionHistory *m_positionHistory;
};
/*****************************************************************************/

View File

@ -41,6 +41,7 @@ protected:
};
s32 m_lifetime;
bool m_evadeClockwise;
};
#endif

View File

@ -38,6 +38,8 @@ protected:
{
NPC_JELLYFISH_RESISTANCE = 64,
};
bool m_evadeClockwise;
};
#endif

View File

@ -41,6 +41,7 @@ void CNpcSubSharkEnemy::postInit()
m_state = SUB_SHARK_MINE_1;
m_extendDir = EXTEND_RIGHT;
m_npcPath.setPathType( CNpcPath::PONG_PATH );
m_salvoCount = 0;
}
void CNpcSubSharkEnemy::processMovement( int _frames )

View File

@ -34,6 +34,8 @@ protected:
{
NPC_SUB_SHARK_HIGH_SPEED = 6,
};
u8 m_salvoCount;
};
#endif

View File

@ -48,14 +48,6 @@ void CNpcParasiticWormSegment::init()
m_heading = 0;
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 );
setCollisionCentreOffset( 10, 10 );
updateCollisionArea();
@ -197,6 +189,24 @@ void CNpcParasiticWormEnemy::shutdown()
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();
}

View File

@ -66,9 +66,19 @@ protected:
NPC_PARASITIC_WORM_LENGTH = 10,
};
CNpcParasiticWormSegment *m_segment;
// position history stuff
s32 m_collTimer;
class CNpcPositionHistory
{
public:
DVECTOR pos;
CNpcPositionHistory *next;
CNpcPositionHistory *prev;
};
CNpcParasiticWormSegment *m_segment;
CNpcPositionHistory *m_positionHistory;
s32 m_collTimer;
};
#endif

View File

@ -171,11 +171,6 @@ void CNpcFriend::init()
m_animNo = m_data[m_type].idleAnim;
m_frame = 0;
m_reversed = false;
DVECTOR ofs = getCollisionSize();
m_drawOffset.vx = 0;
m_drawOffset.vy = -( ofs.vy >> 1 );
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -96,7 +96,6 @@ protected:
int m_animNo;
u8 m_animPlaying;
CActorGfx *m_actorGfx;
DVECTOR m_drawOffset;
bool m_reversed;
};