This commit is contained in:
Charles 2001-04-27 19:54:38 +00:00
parent 4489d03842
commit c8249893fb
8 changed files with 44 additions and 54 deletions

View file

@ -15,6 +15,14 @@
#include "friend\friend.h"
#endif
#ifndef __ANIM_BARNACLEBOY_HEADER__
#include <ACTOR_BARNACLEBOY_Anim.h>
#endif
#ifndef __ANIM_KRUSTY_HEADER__
#include <ACTOR_KRUSTY_Anim.h>
#endif
#ifndef __ANIM_SQUIDWARD_HEADER__
#include <ACTOR_SQUIDWARD_Anim.h>
#endif
@ -28,7 +36,7 @@ CNpcFriend::NPC_FRIEND_DATA CNpcFriend::m_data[NPC_FRIEND_UNIT_TYPE_MAX] =
128,
false,
DAMAGE__HIT_ENEMY,
0,
ANIM_BARNACLEBOY_IDLE,
},
{ // NPC_FRIEND_GARY
@ -48,7 +56,7 @@ CNpcFriend::NPC_FRIEND_DATA CNpcFriend::m_data[NPC_FRIEND_UNIT_TYPE_MAX] =
128,
false,
DAMAGE__HIT_ENEMY,
0,
ANIM_KRUSTY_IDLEJIG,
},
{ // NPC_FRIEND_MERMAID_MAN

View file

@ -137,7 +137,7 @@ CNpcFriend *CNpcFriend::Create(sThingActor *ThisActor)
DVECTOR startPos;
startPos.vx = newXPos << 4;
startPos.vy = newYPos << 4;
startPos.vy = ( newYPos + 1 ) << 4;
friendNpc->init( startPos );
@ -194,13 +194,6 @@ void CNpcFriend::shutdown()
void CNpcFriend::think(int _frames)
{
if ( _frames > 2 )
{
// make sure enemies don't go berserk if too many frames are dropped
_frames = 2;
}
CNpcThing::think(_frames);
if ( m_animPlaying )
@ -221,35 +214,11 @@ void CNpcFriend::think(int _frames)
m_animPlaying = false;
}
}
s32 fallSpeed = 3;
s8 yMovement = fallSpeed * _frames;
s8 groundHeight;
// check vertical collision
groundHeight = m_layerCollision->getHeightFromGround( Pos.vx, Pos.vy, yMovement + 16 );
if ( groundHeight <= 0 )
{
// make sure we are on the ground, not below it
Pos.vy += groundHeight;
}
else
{
// above ground
if ( groundHeight < yMovement )
{
// colliding with ground
Pos.vy += groundHeight;
}
else
{
Pos.vy += yMovement;
}
m_animNo = m_data[m_type].idleAnim;
m_animPlaying = true;
m_frame = 0;
}
}