This commit is contained in:
Charles 2001-05-04 18:54:27 +00:00
parent fdfe68f4b5
commit 308db847f1
12 changed files with 67 additions and 98 deletions

View file

@ -108,7 +108,8 @@ platform_src := platform \
pdual \
pfgen \
pfallnor \
praft
praft \
plantern
hazard_src := hazard \
hfalling \

View file

@ -276,42 +276,7 @@ void CNpcIronDogfishEnemy::processClose( int _frames )
}
}
void CNpcIronDogfishEnemy::collidedWith(CThing *_thisThing)
{
if ( m_isActive && !m_isCaught )
{
switch(_thisThing->getThingType())
{
case TYPE_PLAYER:
{
CPlayer *player = (CPlayer *) _thisThing;
ATTACK_STATE playerState = player->getAttackState();
switch( playerState )
{
case ATTACK_STATE__NONE:
{
if ( !player->isRecoveringFromHit() )
{
switch( m_data[m_type].detectCollision )
{
case DETECT_NO_COLLISION:
{
// ignore
break;
}
case DETECT_ALL_COLLISION:
{
m_oldControlFunc = m_controlFunc;
m_controlFunc = NPC_CONTROL_COLLISION;
break;
}
case DETECT_ATTACK_COLLISION_GENERIC:
void CNpcIronDogfishEnemy::processAttackCollision()
{
switch( m_animNo )
{
@ -330,44 +295,3 @@ void CNpcIronDogfishEnemy::collidedWith(CThing *_thisThing)
break;
}
}
}
}
break;
}
default:
{
// player is attacking, respond appropriately
if ( m_controlFunc != NPC_CONTROL_SHOT )
{
m_controlFunc = NPC_CONTROL_SHOT;
m_state = NPC_GENERIC_HIT_CHECK_HEALTH;
}
break;
}
}
break;
}
case TYPE_ENEMY:
{
CNpcEnemy *enemy = (CNpcEnemy *) _thisThing;
if ( enemy->canCollideWithEnemy() )
{
processEnemyCollision( _thisThing );
}
break;
}
default:
ASSERT(0);
break;
}
}
}

View file

@ -24,7 +24,7 @@ protected:
virtual void processMovement( int _frames );
void processStandardIronDogfishAttack( int _frames );
void processWalkToUser( int _frames, int speed );
virtual void collidedWith(CThing *_thisThing);
virtual void processAttackCollision();
enum NPC_IRON_DOGFISH_STATE
{

View file

@ -813,6 +813,20 @@ void CNpcEnemy::think(int _frames)
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcEnemy::processAttackCollision()
{
//if ( m_controlFunc == NPC_CONTROL_CLOSE && m_data[m_type].closeFunc != NPC_CLOSE_NONE )
if ( m_controlFunc == NPC_CONTROL_CLOSE )
{
// only detect collision if in attack mode
m_oldControlFunc = m_controlFunc;
m_controlFunc = NPC_CONTROL_COLLISION;
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcEnemy::collidedWith( CThing *_thisThing )
{
if ( m_isActive && !m_isCaught )
@ -850,14 +864,7 @@ void CNpcEnemy::collidedWith( CThing *_thisThing )
case DETECT_ATTACK_COLLISION_GENERIC:
{
//if ( m_controlFunc == NPC_CONTROL_CLOSE && m_data[m_type].closeFunc != NPC_CLOSE_NONE )
if ( m_controlFunc == NPC_CONTROL_CLOSE )
{
// only detect collision if in attack mode
m_oldControlFunc = m_controlFunc;
m_controlFunc = NPC_CONTROL_COLLISION;
}
processAttackCollision();
break;
}

View file

@ -236,6 +236,7 @@ protected:
virtual void processShot();
virtual void processClose( int _frames );
virtual void processCollision();
virtual void processAttackCollision();
void processTimer( int _frames );
bool isCollisionWithGround();

View file

@ -784,7 +784,7 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
false,
3,
256,
DETECT_NO_COLLISION,
DETECT_ALL_COLLISION,
DAMAGE__SHOCK_ENEMY,
256,
0,

View file

@ -286,6 +286,18 @@ CNpcPlatform::NPC_PLATFORM_DATA CNpcPlatform::m_data[NPC_PLATFORM_TYPE_MAX] =
NPC_PLATFORM_TIMER_NONE,
},
{ // NPC_LANTERN_PLATFORM
3,
128,
true,
DAMAGE__NONE,
0,
4,
NPC_PLATFORM_INFINITE_LIFE,
0,
NPC_PLATFORM_TIMER_NONE,
},
{ // NPC_PLAYER_BUBBLE_PLATFORM
3,
128,
@ -322,5 +334,6 @@ CNpcPlatform::NPC_PLATFORM_UNIT_TYPE CNpcPlatform::mapEditConvertTable[NPC_PLATF
NPC_CRATE_GENERATOR,
NPC_RAFT_PLATFORM,
NPC_VERTICAL_OILDRUM_GENERATOR,
NPC_LANTERN_PLATFORM,
NPC_PLAYER_BUBBLE_PLATFORM,
};

View file

@ -115,6 +115,10 @@
#include "platform\praft.h"
#endif
#ifndef __PLATFORM_PLANTERN_H__
#include "platform\plantern.h"
#endif
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -264,6 +268,12 @@ CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
break;
}
case NPC_LANTERN_PLATFORM:
{
platform = new ("lantern platform") CNpcLanternPlatform;
break;
}
default:
{
ASSERT( 0 );

View file

@ -74,6 +74,7 @@ public:
NPC_RAFT_PLATFORM,
NPC_VERTICAL_OILDRUM_GENERATOR,
NPC_VERTICAL_OILDRUM_PLATFORM,
NPC_LANTERN_PLATFORM,
NPC_PLAYER_BUBBLE_PLATFORM,
NPC_PLATFORM_TYPE_MAX,
};

View file

@ -102,6 +102,7 @@ DualPlatform=16
Wooden=6
Raft=19
VertOilDrumGenerator=20
SwingingLantern=21
################################################
# Triggers

View file

@ -82,3 +82,6 @@ Gfx=..\..\Graphics\platforms\raft\raft.gin
[VertOildrumGenerator]
Gfx=..\..\Graphics\platforms\vert_Oildrum\vert_Oildrum.gin
[SwingingLantern]
Gfx=..\..\Graphics\platforms\wooden\wooden.gin

View file

@ -1185,6 +1185,14 @@ SOURCE=..\..\..\source\platform\pgeyser.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\platform\plantern.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\platform\plantern.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\platform\platdata.cpp
# End Source File
# Begin Source File