This commit is contained in:
parent
fdfe68f4b5
commit
308db847f1
12 changed files with 67 additions and 98 deletions
|
@ -108,7 +108,8 @@ platform_src := platform \
|
||||||
pdual \
|
pdual \
|
||||||
pfgen \
|
pfgen \
|
||||||
pfallnor \
|
pfallnor \
|
||||||
praft
|
praft \
|
||||||
|
plantern
|
||||||
|
|
||||||
hazard_src := hazard \
|
hazard_src := hazard \
|
||||||
hfalling \
|
hfalling \
|
||||||
|
|
|
@ -276,43 +276,8 @@ void CNpcIronDogfishEnemy::processClose( int _frames )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CNpcIronDogfishEnemy::collidedWith(CThing *_thisThing)
|
void CNpcIronDogfishEnemy::processAttackCollision()
|
||||||
{
|
{
|
||||||
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:
|
|
||||||
{
|
|
||||||
switch( m_animNo )
|
switch( m_animNo )
|
||||||
{
|
{
|
||||||
case ANIM_IRONDOGFISH_PUNCH:
|
case ANIM_IRONDOGFISH_PUNCH:
|
||||||
|
@ -329,45 +294,4 @@ void CNpcIronDogfishEnemy::collidedWith(CThing *_thisThing)
|
||||||
default:
|
default:
|
||||||
break;
|
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ protected:
|
||||||
virtual void processMovement( int _frames );
|
virtual void processMovement( int _frames );
|
||||||
void processStandardIronDogfishAttack( int _frames );
|
void processStandardIronDogfishAttack( int _frames );
|
||||||
void processWalkToUser( int _frames, int speed );
|
void processWalkToUser( int _frames, int speed );
|
||||||
virtual void collidedWith(CThing *_thisThing);
|
virtual void processAttackCollision();
|
||||||
|
|
||||||
enum NPC_IRON_DOGFISH_STATE
|
enum NPC_IRON_DOGFISH_STATE
|
||||||
{
|
{
|
||||||
|
|
|
@ -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 )
|
void CNpcEnemy::collidedWith( CThing *_thisThing )
|
||||||
{
|
{
|
||||||
if ( m_isActive && !m_isCaught )
|
if ( m_isActive && !m_isCaught )
|
||||||
|
@ -850,14 +864,7 @@ void CNpcEnemy::collidedWith( CThing *_thisThing )
|
||||||
|
|
||||||
case DETECT_ATTACK_COLLISION_GENERIC:
|
case DETECT_ATTACK_COLLISION_GENERIC:
|
||||||
{
|
{
|
||||||
//if ( m_controlFunc == NPC_CONTROL_CLOSE && m_data[m_type].closeFunc != NPC_CLOSE_NONE )
|
processAttackCollision();
|
||||||
if ( m_controlFunc == NPC_CONTROL_CLOSE )
|
|
||||||
{
|
|
||||||
// only detect collision if in attack mode
|
|
||||||
|
|
||||||
m_oldControlFunc = m_controlFunc;
|
|
||||||
m_controlFunc = NPC_CONTROL_COLLISION;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -236,6 +236,7 @@ protected:
|
||||||
virtual void processShot();
|
virtual void processShot();
|
||||||
virtual void processClose( int _frames );
|
virtual void processClose( int _frames );
|
||||||
virtual void processCollision();
|
virtual void processCollision();
|
||||||
|
virtual void processAttackCollision();
|
||||||
void processTimer( int _frames );
|
void processTimer( int _frames );
|
||||||
bool isCollisionWithGround();
|
bool isCollisionWithGround();
|
||||||
|
|
||||||
|
|
|
@ -784,7 +784,7 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||||
false,
|
false,
|
||||||
3,
|
3,
|
||||||
256,
|
256,
|
||||||
DETECT_NO_COLLISION,
|
DETECT_ALL_COLLISION,
|
||||||
DAMAGE__SHOCK_ENEMY,
|
DAMAGE__SHOCK_ENEMY,
|
||||||
256,
|
256,
|
||||||
0,
|
0,
|
||||||
|
|
|
@ -286,6 +286,18 @@ CNpcPlatform::NPC_PLATFORM_DATA CNpcPlatform::m_data[NPC_PLATFORM_TYPE_MAX] =
|
||||||
NPC_PLATFORM_TIMER_NONE,
|
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
|
{ // NPC_PLAYER_BUBBLE_PLATFORM
|
||||||
3,
|
3,
|
||||||
128,
|
128,
|
||||||
|
@ -322,5 +334,6 @@ CNpcPlatform::NPC_PLATFORM_UNIT_TYPE CNpcPlatform::mapEditConvertTable[NPC_PLATF
|
||||||
NPC_CRATE_GENERATOR,
|
NPC_CRATE_GENERATOR,
|
||||||
NPC_RAFT_PLATFORM,
|
NPC_RAFT_PLATFORM,
|
||||||
NPC_VERTICAL_OILDRUM_GENERATOR,
|
NPC_VERTICAL_OILDRUM_GENERATOR,
|
||||||
|
NPC_LANTERN_PLATFORM,
|
||||||
NPC_PLAYER_BUBBLE_PLATFORM,
|
NPC_PLAYER_BUBBLE_PLATFORM,
|
||||||
};
|
};
|
||||||
|
|
|
@ -115,6 +115,10 @@
|
||||||
#include "platform\praft.h"
|
#include "platform\praft.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __PLATFORM_PLANTERN_H__
|
||||||
|
#include "platform\plantern.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -264,6 +268,12 @@ CNpcPlatform *CNpcPlatform::Create(sThingPlatform *ThisPlatform)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case NPC_LANTERN_PLATFORM:
|
||||||
|
{
|
||||||
|
platform = new ("lantern platform") CNpcLanternPlatform;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
ASSERT( 0 );
|
ASSERT( 0 );
|
||||||
|
|
|
@ -74,6 +74,7 @@ public:
|
||||||
NPC_RAFT_PLATFORM,
|
NPC_RAFT_PLATFORM,
|
||||||
NPC_VERTICAL_OILDRUM_GENERATOR,
|
NPC_VERTICAL_OILDRUM_GENERATOR,
|
||||||
NPC_VERTICAL_OILDRUM_PLATFORM,
|
NPC_VERTICAL_OILDRUM_PLATFORM,
|
||||||
|
NPC_LANTERN_PLATFORM,
|
||||||
NPC_PLAYER_BUBBLE_PLATFORM,
|
NPC_PLAYER_BUBBLE_PLATFORM,
|
||||||
NPC_PLATFORM_TYPE_MAX,
|
NPC_PLATFORM_TYPE_MAX,
|
||||||
};
|
};
|
||||||
|
|
|
@ -102,6 +102,7 @@ DualPlatform=16
|
||||||
Wooden=6
|
Wooden=6
|
||||||
Raft=19
|
Raft=19
|
||||||
VertOilDrumGenerator=20
|
VertOilDrumGenerator=20
|
||||||
|
SwingingLantern=21
|
||||||
|
|
||||||
################################################
|
################################################
|
||||||
# Triggers
|
# Triggers
|
||||||
|
|
|
@ -82,3 +82,6 @@ Gfx=..\..\Graphics\platforms\raft\raft.gin
|
||||||
[VertOildrumGenerator]
|
[VertOildrumGenerator]
|
||||||
Gfx=..\..\Graphics\platforms\vert_Oildrum\vert_Oildrum.gin
|
Gfx=..\..\Graphics\platforms\vert_Oildrum\vert_Oildrum.gin
|
||||||
|
|
||||||
|
[SwingingLantern]
|
||||||
|
Gfx=..\..\Graphics\platforms\wooden\wooden.gin
|
||||||
|
|
||||||
|
|
|
@ -1185,6 +1185,14 @@ SOURCE=..\..\..\source\platform\pgeyser.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin 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
|
SOURCE=..\..\..\source\platform\platdata.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue