From ac3b5a5d62f4cddc0dca113e522420a4cf56640c Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 15 May 2001 19:08:14 +0000 Subject: [PATCH] --- source/enemy/nclam.cpp | 41 ++++++++++++++++++++++++------------ source/enemy/nclam.h | 2 +- source/enemy/npcdata.cpp | 2 +- source/platform/platdata.cpp | 2 +- 4 files changed, 30 insertions(+), 17 deletions(-) diff --git a/source/enemy/nclam.cpp b/source/enemy/nclam.cpp index 7fb0b8e7d..b8c9b0d16 100644 --- a/source/enemy/nclam.cpp +++ b/source/enemy/nclam.cpp @@ -157,6 +157,16 @@ void CNpcStaticClamEnemy::postInit() m_isStunned = false; m_isAnimating = false; + + // create platform in same place + + CNpcClamPlatform *platform = new ("clam platform") CNpcClamPlatform; + + platform->setType( CNpcClamPlatform::NPC_CLAM_PLATFORM ); + platform->setGraphic( (u8) 0 ); + platform->init( Pos ); + platform->setTiltable( false ); + platform->setBBox(); } void CNpcStaticClamEnemy::processClose( int _frames ) @@ -175,9 +185,11 @@ void CNpcStaticClamEnemy::processClose( int _frames ) m_frame = 0; m_isAnimating = false; } + + m_isStunned = false; } -void CNpcStaticClamEnemy::processShot( int _frames ) +/*void CNpcStaticClamEnemy::processShot( int _frames ) { if ( !m_isStunned ) { @@ -194,29 +206,30 @@ void CNpcStaticClamEnemy::processShot( int _frames ) { m_isStunned = true; - // create platform in same place - - CNpcClamPlatform *platform = new ("clam platform") CNpcClamPlatform; - - platform->setType( CNpcClamPlatform::NPC_CLAM_PLATFORM ); - platform->setGraphic( (u8) 0 ); - platform->init( Pos ); - platform->setTiltable( false ); - platform->setBBox(); - break; } } } m_controlFunc = NPC_CONTROL_MOVEMENT; -} +}*/ void CNpcStaticClamEnemy::collidedWith( CThing *_thisThing ) { - if ( !m_isStunned ) + if ( m_isActive && !m_isCaught && !m_isDying ) { - CNpcClamEnemy::collidedWith( _thisThing ); + switch(_thisThing->getThingType()) + { + case TYPE_PLAYER: + { + m_isStunned = true; + + break; + } + + default: + break; + } } } diff --git a/source/enemy/nclam.h b/source/enemy/nclam.h index 3fb477117..e07d0a736 100644 --- a/source/enemy/nclam.h +++ b/source/enemy/nclam.h @@ -37,7 +37,7 @@ public: //virtual int checkCollisionAgainst(CThing *_thisThing, int _frames); protected: virtual void collidedWith(CThing *_thisThing); - virtual void processShot( int _frames ); + //virtual void processShot( int _frames ); virtual void processClose( int _frames ); u8 m_isStunned; diff --git a/source/enemy/npcdata.cpp b/source/enemy/npcdata.cpp index d8f6e09dd..0b08885d5 100644 --- a/source/enemy/npcdata.cpp +++ b/source/enemy/npcdata.cpp @@ -307,7 +307,7 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] = false, 0, 128, - DETECT_ATTACK_COLLISION_GENERIC, + DETECT_NO_COLLISION, DAMAGE__HIT_ENEMY, 0, 0, diff --git a/source/platform/platdata.cpp b/source/platform/platdata.cpp index f32eeed08..cffd94e46 100644 --- a/source/platform/platdata.cpp +++ b/source/platform/platdata.cpp @@ -64,7 +64,7 @@ CNpcPlatform::NPC_PLATFORM_DATA CNpcPlatform::m_data[NPC_PLATFORM_TYPE_MAX] = true, DAMAGE__NONE, 0, - 4, + 2, NPC_PLATFORM_INFINITE_LIFE_COLLAPSIBLE, 0, NPC_PLATFORM_TIMER_NONE,