This commit is contained in:
Charles 2001-04-25 15:10:26 +00:00
parent 25a557744e
commit 69fcc8270d
8 changed files with 87 additions and 33 deletions

View file

@ -131,14 +131,61 @@ void CNpcJumpingClamEnemy::processClose( int _frames )
} }
} }
void CNpcStaticClamEnemy::postInit()
{
CNpcClamEnemy::postInit();
m_isStunned = false;
m_isAnimating = false;
}
void CNpcStaticClamEnemy::processClose( int _frames ) void CNpcStaticClamEnemy::processClose( int _frames )
{ {
if ( !m_animPlaying ) if ( !m_isAnimating && !m_isStunned )
{ {
m_animPlaying = true; m_animPlaying = true;
m_animNo = ANIM_CLAM_SIDESNAP; m_animNo = ANIM_CLAM_SIDESNAP;
m_frame = 0; m_frame = 0;
m_isAnimating = true;
}
else if ( !m_animPlaying )
{
m_controlFunc = NPC_CONTROL_MOVEMENT;
m_animNo = m_data[m_type].initAnim;
m_frame = 0;
m_isAnimating = false;
}
}
void CNpcStaticClamEnemy::processShot()
{
if ( !m_isStunned )
{
switch( m_data[m_type].shotFunc )
{
case NPC_SHOT_NONE:
{
// do nothing
break;
}
case NPC_SHOT_GENERIC:
{
m_isStunned = true;
break;
}
}
} }
m_controlFunc = NPC_CONTROL_MOVEMENT; m_controlFunc = NPC_CONTROL_MOVEMENT;
} }
void CNpcStaticClamEnemy::collidedWith( CThing *_thisThing )
{
if ( !m_isStunned )
{
CNpcClamEnemy::collidedWith( _thisThing );
}
}

View file

@ -29,8 +29,15 @@ protected:
class CNpcStaticClamEnemy : public CNpcClamEnemy class CNpcStaticClamEnemy : public CNpcClamEnemy
{ {
public:
virtual void postInit();
protected: protected:
virtual void collidedWith(CThing *_thisThing);
virtual void processShot();
virtual void processClose( int _frames ); virtual void processClose( int _frames );
u8 m_isStunned;
u8 m_isAnimating;
}; };
#endif #endif

View file

@ -833,9 +833,8 @@ void CNpcEnemy::think(int _frames)
s32 frameShift = ( _frames << 8 ) >> 1; s32 frameShift = ( _frames << 8 ) >> 1;
if ( ( frameCount << 8 ) - m_frame > frameShift ) //( _frames >> 1 ) ) if ( ( frameCount << 8 ) - m_frame > frameShift )
{ {
//m_frame += _frames >> 1;
m_frame += frameShift; m_frame += frameShift;
} }
else else
@ -853,7 +852,16 @@ void CNpcEnemy::think(int _frames)
case NPC_CONTROL_MOVEMENT: case NPC_CONTROL_MOVEMENT:
if ( !processSensor() ) if ( !processSensor() )
{ {
processMovement(_frames); int moveFrames = _frames;
if ( moveFrames > 2 )
{
// make sure enemies don't go berserk if too many frames are dropped
moveFrames = 2;
}
processMovement( moveFrames );
} }
else else
{ {
@ -1122,11 +1130,6 @@ bool CNpcEnemy::processSensor()
void CNpcEnemy::processMovement(int _frames) void CNpcEnemy::processMovement(int _frames)
{ {
//if ( _frames > 2 )
//{
//_frames = 2;
//}
s32 moveX = 0, moveY = 0; s32 moveX = 0, moveY = 0;
s32 moveVel = 0; s32 moveVel = 0;
s32 moveDist = 0; s32 moveDist = 0;

View file

@ -293,7 +293,7 @@ protected:
virtual bool processSensor(); virtual bool processSensor();
virtual void processMovement( int _frames ); virtual void processMovement( int _frames );
virtual void processMovementModifier( int _frames, s32 distX, s32 distY, s32 dist, s16 headingChange ); virtual void processMovementModifier( int _frames, s32 distX, s32 distY, s32 dist, s16 headingChange );
void processShot(); virtual void processShot();
virtual void processClose( int _frames ); virtual void processClose( int _frames );
virtual void processCollision(); virtual void processCollision();
void processTimer( int _frames ); void processTimer( int _frames );

View file

@ -271,11 +271,6 @@ void CNpcSpiderCrabEnemy::processSpiderCrabInitJumpMovement( int _frames )
void CNpcSpiderCrabEnemy::processMovement(int _frames) void CNpcSpiderCrabEnemy::processMovement(int _frames)
{ {
if ( _frames > 2 )
{
_frames = 2;
}
s32 moveX = 0, moveY = 0; s32 moveX = 0, moveY = 0;
s32 moveVel = 0; s32 moveVel = 0;
s32 moveDist = 0; s32 moveDist = 0;

View file

@ -360,11 +360,13 @@ void CThingManager::addToThingList(CThing *_this)
Params: Params:
Returns: Returns:
---------------------------------------------------------------------- */ ---------------------------------------------------------------------- */
int testTypeGit;
void CThingManager::removeFromThingList(CThing *_this) void CThingManager::removeFromThingList(CThing *_this)
{ {
CThing *prevThing,*thing; CThing *prevThing,*thing;
prevThing=NULL; prevThing=NULL;
testTypeGit = _this->getThingType();
thing=s_thingLists[_this->getThingType()]; thing=s_thingLists[_this->getThingType()];
while(thing!=_this) while(thing!=_this)
{ {

View file

@ -31,8 +31,8 @@ BabyOctopus=16
Ballblob=17 Ballblob=17
Boogermonster=18 Boogermonster=18
Caterpillar=19 Caterpillar=19
Clam-Level1=20 JumpingClam=20
Clam-Level2=21 StaticClam=21
Eyeball=22 Eyeball=22
Flamingskull=23 Flamingskull=23
FlyingDutchman=24 FlyingDutchman=24

View file

@ -189,23 +189,23 @@ Collision=0
Health=48 Health=48
AttackStrength=20 AttackStrength=20
#[Clam-Level1] [JumpingClam]
#Gfx=..\..\graphics\characters\ Gfx=..\..\graphics\characters\clam\render\psx\clam_snapup0000.bmp
#WayPoints=16 WayPoints=16
#Speed=0 Speed=0
#TurnRate=0 TurnRate=0
#Collision=1 Collision=1
#Health=0 Health=0
#AttackStrength=20 AttackStrength=20
#[Clam-Level2] [StaticClam]
#Gfx=..\..\graphics\characters\ Gfx=..\..\graphics\characters\clam\render\psx\clam_sidesnap0000.bmp
#WayPoints=16 WayPoints=16
#Speed=0 Speed=0
#TurnRate=0 TurnRate=0
#Collision=1 Collision=1
#Health=0 Health=0
#AttackStrength=20 AttackStrength=20
[Eyeball] [Eyeball]
Gfx=..\..\graphics\characters\eyeball\render\psx\EyeBall_Roll0000.bmp Gfx=..\..\graphics\characters\eyeball\render\psx\EyeBall_Roll0000.bmp