From 6c608b0aca94991407c9d751a77144440add92a8 Mon Sep 17 00:00:00 2001 From: Charles Date: Wed, 16 May 2001 19:04:40 +0000 Subject: [PATCH] --- source/enemy/nanemone.cpp | 1 + source/enemy/nanemone.h | 2 ++ source/enemy/nbblob.cpp | 2 +- source/enemy/neyeball.cpp | 1 + source/enemy/neyeball.h | 2 ++ source/enemy/nffolk.cpp | 2 +- source/enemy/nfskull.cpp | 1 + source/enemy/nfskull.h | 2 ++ source/enemy/ngpirate.cpp | 2 +- source/enemy/npc.cpp | 31 ------------------------------- source/enemy/npc.h | 17 ----------------- source/enemy/nprojjf.h | 1 + source/enemy/nsjfish.h | 2 ++ source/enemy/nsshark.cpp | 1 + source/enemy/nsshark.h | 2 ++ source/enemy/nworm.cpp | 26 ++++++++++++++++++-------- source/enemy/nworm.h | 14 ++++++++++++-- source/friend/friend.cpp | 5 ----- source/friend/friend.h | 1 - 19 files changed, 48 insertions(+), 67 deletions(-) diff --git a/source/enemy/nanemone.cpp b/source/enemy/nanemone.cpp index 392905dca..9f460f2d2 100644 --- a/source/enemy/nanemone.cpp +++ b/source/enemy/nanemone.cpp @@ -53,6 +53,7 @@ void CNpcAnemoneEnemy::postInit() { CNpcEnemy::postInit(); m_drawRotation = m_heading + 1024; + m_fireHeading = m_heading; } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/enemy/nanemone.h b/source/enemy/nanemone.h index d298d6cf7..496a0473a 100644 --- a/source/enemy/nanemone.h +++ b/source/enemy/nanemone.h @@ -25,6 +25,8 @@ public: protected: virtual void processEnemyCollision( CThing *thisThing ); virtual bool processSensor(); + + s32 m_fireHeading; }; class CNpcAnemone1Enemy : public CNpcAnemoneEnemy diff --git a/source/enemy/nbblob.cpp b/source/enemy/nbblob.cpp index 205995f1b..849a1f704 100644 --- a/source/enemy/nbblob.cpp +++ b/source/enemy/nbblob.cpp @@ -29,7 +29,7 @@ void CNpcBallBlobEnemy::postInit() { - m_heading = m_fireHeading = 128; + m_heading = 128; m_npcPath.setPathType( CNpcPath::PONG_PATH ); diff --git a/source/enemy/neyeball.cpp b/source/enemy/neyeball.cpp index 32252548c..8df6f403d 100644 --- a/source/enemy/neyeball.cpp +++ b/source/enemy/neyeball.cpp @@ -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 ); diff --git a/source/enemy/neyeball.h b/source/enemy/neyeball.h index ac0279ba0..5548c175c 100644 --- a/source/enemy/neyeball.h +++ b/source/enemy/neyeball.h @@ -24,6 +24,8 @@ protected: virtual void processEnemyCollision( CThing *thisThing ); virtual bool processSensor(); virtual void processClose( int _frames ); + + s32 m_fireHeading; }; #endif \ No newline at end of file diff --git a/source/enemy/nffolk.cpp b/source/enemy/nffolk.cpp index 1e1842cd1..f64e6ef90 100644 --- a/source/enemy/nffolk.cpp +++ b/source/enemy/nffolk.cpp @@ -30,7 +30,7 @@ void CNpcFishFolk::postInit() { - m_heading = m_fireHeading = 0; + m_heading = 0; DVECTOR newPos; diff --git a/source/enemy/nfskull.cpp b/source/enemy/nfskull.cpp index c25c0027b..17fe22a0b 100644 --- a/source/enemy/nfskull.cpp +++ b/source/enemy/nfskull.cpp @@ -36,6 +36,7 @@ void CNpcFlamingSkullEnemy::processEnemyCollision( CThing *thisThing ) void CNpcFlamingSkullEnemy::postInit() { m_state = FLAMING_SKULL_ATTACK; + m_fireHeading = m_heading; } bool CNpcFlamingSkullEnemy::processSensor() diff --git a/source/enemy/nfskull.h b/source/enemy/nfskull.h index 5b79891ef..1c854ee08 100644 --- a/source/enemy/nfskull.h +++ b/source/enemy/nfskull.h @@ -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, diff --git a/source/enemy/ngpirate.cpp b/source/enemy/ngpirate.cpp index 8c34d4a3e..968992cd8 100644 --- a/source/enemy/ngpirate.cpp +++ b/source/enemy/ngpirate.cpp @@ -34,7 +34,7 @@ void CNpcGhostPirateEnemy::postInit() { - m_heading = m_fireHeading = 3072; + m_heading = 3072; } bool CNpcGhostPirateEnemy::processSensor() diff --git a/source/enemy/npc.cpp b/source/enemy/npc.cpp index 168e5e47a..68c631bcc 100644 --- a/source/enemy/npc.cpp +++ b/source/enemy/npc.cpp @@ -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(); diff --git a/source/enemy/npc.h b/source/enemy/npc.h index 63099c5dd..e2ec595f7 100644 --- a/source/enemy/npc.h +++ b/source/enemy/npc.h @@ -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; }; /*****************************************************************************/ diff --git a/source/enemy/nprojjf.h b/source/enemy/nprojjf.h index a02c2dc5a..7bc3b5c1b 100644 --- a/source/enemy/nprojjf.h +++ b/source/enemy/nprojjf.h @@ -41,6 +41,7 @@ protected: }; s32 m_lifetime; + bool m_evadeClockwise; }; #endif diff --git a/source/enemy/nsjfish.h b/source/enemy/nsjfish.h index 46c95b049..e84961dbc 100644 --- a/source/enemy/nsjfish.h +++ b/source/enemy/nsjfish.h @@ -38,6 +38,8 @@ protected: { NPC_JELLYFISH_RESISTANCE = 64, }; + + bool m_evadeClockwise; }; #endif diff --git a/source/enemy/nsshark.cpp b/source/enemy/nsshark.cpp index ef9859d3e..64a4e49bb 100644 --- a/source/enemy/nsshark.cpp +++ b/source/enemy/nsshark.cpp @@ -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 ) diff --git a/source/enemy/nsshark.h b/source/enemy/nsshark.h index 14bf38d28..6f9db7a9c 100644 --- a/source/enemy/nsshark.h +++ b/source/enemy/nsshark.h @@ -34,6 +34,8 @@ protected: { NPC_SUB_SHARK_HIGH_SPEED = 6, }; + + u8 m_salvoCount; }; #endif \ No newline at end of file diff --git a/source/enemy/nworm.cpp b/source/enemy/nworm.cpp index 5ca386252..68b9cc2c2 100644 --- a/source/enemy/nworm.cpp +++ b/source/enemy/nworm.cpp @@ -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(); } diff --git a/source/enemy/nworm.h b/source/enemy/nworm.h index 95eb1b641..ffc1cc2fa 100644 --- a/source/enemy/nworm.h +++ b/source/enemy/nworm.h @@ -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 \ No newline at end of file diff --git a/source/friend/friend.cpp b/source/friend/friend.cpp index 222592e83..e273d650f 100644 --- a/source/friend/friend.cpp +++ b/source/friend/friend.cpp @@ -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 ); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/source/friend/friend.h b/source/friend/friend.h index e67e5ec5f..75f5b06ce 100644 --- a/source/friend/friend.h +++ b/source/friend/friend.h @@ -96,7 +96,6 @@ protected: int m_animNo; u8 m_animPlaying; CActorGfx *m_actorGfx; - DVECTOR m_drawOffset; bool m_reversed; };