From 279dfe77ea7b8de11f3af9983207d76612f0decc Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 19 Jun 2001 21:43:18 +0000 Subject: [PATCH] --- Graphics/characters/SeaSnake/AnimList.Txt | 7 +++-- source/enemy/npcdata.cpp | 2 +- source/enemy/nssnake.cpp | 37 ++++++++--------------- source/enemy/nssnake.h | 3 +- tools/MapEdit/actor.ini | 6 ++-- 5 files changed, 23 insertions(+), 32 deletions(-) diff --git a/Graphics/characters/SeaSnake/AnimList.Txt b/Graphics/characters/SeaSnake/AnimList.Txt index 3b2d7e4c6..9a5271832 100644 --- a/Graphics/characters/SeaSnake/AnimList.Txt +++ b/Graphics/characters/SeaSnake/AnimList.Txt @@ -1,3 +1,4 @@ -bodystatic -headstatic -headstaticmouthshut \ No newline at end of file +body1static +body2static +body3static +headsnap \ No newline at end of file diff --git a/source/enemy/npcdata.cpp b/source/enemy/npcdata.cpp index 89aad13a3..c821f2620 100644 --- a/source/enemy/npcdata.cpp +++ b/source/enemy/npcdata.cpp @@ -428,7 +428,7 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] = { // NPC_SEA_SNAKE ACTORS_SEASNAKE_SBK, - ANIM_SEASNAKE_HEADSTATICMOUTHSHUT, + ANIM_SEASNAKE_HEADSNAP, NPC_SENSOR_USER_CLOSE, NPC_MOVEMENT_FIXED_PATH, NPC_CLOSE_NONE, diff --git a/source/enemy/nssnake.cpp b/source/enemy/nssnake.cpp index 43ca12aba..cc1548de8 100644 --- a/source/enemy/nssnake.cpp +++ b/source/enemy/nssnake.cpp @@ -230,31 +230,13 @@ void CNpcSeaSnakeEnemy::processMovement( int _frames ) { m_snapTimer -= _frames; - if ( m_snapTimer <= 0 ) + if ( m_snapTimer > 0 ) { - m_animNo = ANIM_SEASNAKE_HEADSTATICMOUTHSHUT; - m_animPlaying = true; - m_frame = 0; - } - else - { - m_openTimer -= _frames; - - if ( m_openTimer <= 0 ) + if ( !m_animPlaying ) { - if ( m_animNo == ANIM_SEASNAKE_HEADSTATIC ) - { - m_animNo = ANIM_SEASNAKE_HEADSTATICMOUTHSHUT; - } - else - { - m_animNo = ANIM_SEASNAKE_HEADSTATIC; - } - + m_animNo = ANIM_SEASNAKE_HEADSNAP; m_animPlaying = true; m_frame = 0; - - m_openTimer = GameState::getOneSecondInFrames() >> 2; } } } @@ -494,7 +476,7 @@ void CNpcSeaSnakeEnemy::processClose( int _frames ) m_sensorFunc = NPC_SENSOR_NONE; m_snapTimer = m_movementTimer; - m_openTimer = GameState::getOneSecondInFrames() >> 2; + //m_openTimer = GameState::getOneSecondInFrames() >> 2; } @@ -609,7 +591,7 @@ void CNpcSeaSnakeSegment::render() if ( renderFlag ) { - SprFrame = m_actorGfx->Render(renderPos,ANIM_SEASNAKE_BODYSTATIC,0,0); + SprFrame = m_actorGfx->Render(renderPos,ANIM_SEASNAKE_BODY1STATIC,0,0); m_actorGfx->RotateScale( SprFrame, renderPos, m_heading, 4096, m_scale ); sBBox boundingBox = m_actorGfx->GetBBox(); @@ -738,4 +720,11 @@ void CNpcSeaSnakeEnemy::processShot( int _frames ) void CNpcSeaSnakeEnemy::processUserCollision( CThing *thisThing ) { -} \ No newline at end of file +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +s32 CNpcSeaSnakeEnemy::getFrameShift( int _frames ) +{ + return( ( _frames << 8 ) >> 3 ); +} diff --git a/source/enemy/nssnake.h b/source/enemy/nssnake.h index 93c1a88d4..a59804d03 100644 --- a/source/enemy/nssnake.h +++ b/source/enemy/nssnake.h @@ -55,6 +55,7 @@ public: virtual int checkCollisionAgainst(CThing *_thisThing, int _frames); //virtual CRECT const *getThinkBBox(); protected: + virtual s32 getFrameShift( int _frames ); virtual bool processSensor(); virtual void processClose( int _frames ); virtual void processMovement( int _frames ); @@ -85,7 +86,7 @@ protected: CNpcPositionHistory m_positionHistoryArray[NPC_SEA_SNAKE_SPACING * NPC_SEA_SNAKE_LENGTH]; s32 m_collTimer; s32 m_snapTimer; - s32 m_openTimer; + //s32 m_openTimer; bool m_meterOn; }; diff --git a/tools/MapEdit/actor.ini b/tools/MapEdit/actor.ini index 66c04ae6e..a508fbac5 100644 --- a/tools/MapEdit/actor.ini +++ b/tools/MapEdit/actor.ini @@ -244,8 +244,8 @@ Health=0 AttackStrength=20 [GiantWorm] -#Gfx=..\..\graphics\characters\giantworm\render\psx\GiantWorm_headstatic0000.bmp -Gfx=..\..\graphics\characters\seasnake\render\psx\seasnake_headstatic0000.bmp +Gfx=..\..\graphics\characters\giantworm\render\psx\GiantWorm_headstatic0000.bmp +#Gfx=..\..\graphics\characters\seasnake\render\psx\seasnake_headstatic0000.bmp WayPoints=16 Speed=3 TurnRate=128 @@ -282,7 +282,7 @@ Health=64 AttackStrength=20 [SeaSnake] -Gfx=..\..\graphics\characters\seasnake\render\psx\seasnake_headstatic0000.bmp +Gfx=..\..\graphics\characters\seasnake\render\psx\seasnake_headsnap0000.bmp WayPoints=16 Speed=3 TurnRate=256