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 )
{
if ( !m_animPlaying )
if ( !m_isAnimating && !m_isStunned )
{
m_animPlaying = true;
m_animNo = ANIM_CLAM_SIDESNAP;
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;
}
void CNpcStaticClamEnemy::collidedWith( CThing *_thisThing )
{
if ( !m_isStunned )
{
CNpcClamEnemy::collidedWith( _thisThing );
}
}

View File

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

View File

@ -833,9 +833,8 @@ void CNpcEnemy::think(int _frames)
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;
}
else
@ -853,7 +852,16 @@ void CNpcEnemy::think(int _frames)
case NPC_CONTROL_MOVEMENT:
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
{
@ -1122,11 +1130,6 @@ bool CNpcEnemy::processSensor()
void CNpcEnemy::processMovement(int _frames)
{
//if ( _frames > 2 )
//{
//_frames = 2;
//}
s32 moveX = 0, moveY = 0;
s32 moveVel = 0;
s32 moveDist = 0;

View File

@ -293,7 +293,7 @@ protected:
virtual bool processSensor();
virtual void processMovement( int _frames );
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 processCollision();
void processTimer( int _frames );

View File

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

View File

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

View File

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

View File

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