This commit is contained in:
parent
5f53416118
commit
3bd9c2b01b
3 changed files with 66 additions and 4 deletions
|
@ -1 +1,2 @@
|
||||||
idle
|
idle
|
||||||
|
slither
|
|
@ -31,6 +31,10 @@
|
||||||
#include "system\vid.h"
|
#include "system\vid.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __ANIM_GARY_HEADER__
|
||||||
|
#include <ACTOR_GARY_Anim.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@ -47,7 +51,38 @@ void CNpcGaryFriend::postInit()
|
||||||
|
|
||||||
void CNpcGaryFriend::think( int _frames )
|
void CNpcGaryFriend::think( int _frames )
|
||||||
{
|
{
|
||||||
CNpcFriend::think(_frames);
|
if ( m_animPlaying )
|
||||||
|
{
|
||||||
|
s32 frameCount;
|
||||||
|
|
||||||
|
frameCount = m_actorGfx->getFrameCount( m_animNo );
|
||||||
|
|
||||||
|
s32 frameShift = ( _frames << 8 ) >> 1;
|
||||||
|
|
||||||
|
if ( ( frameCount << 8 ) - m_frame > frameShift )
|
||||||
|
{
|
||||||
|
m_frame += frameShift;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_frame = ( frameCount - 1 ) << 8;
|
||||||
|
m_animPlaying = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( m_started )
|
||||||
|
{
|
||||||
|
m_animNo = ANIM_GARY_SLITHER;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_animNo = m_data[m_type].idleAnim;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_animPlaying = true;
|
||||||
|
m_frame = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if ( m_fallDeath )
|
if ( m_fallDeath )
|
||||||
{
|
{
|
||||||
|
@ -259,3 +294,29 @@ const CRECT *CNpcGaryFriend::getThinkBBox()
|
||||||
|
|
||||||
return &objThinkBox;
|
return &objThinkBox;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void CNpcGaryFriend::start()
|
||||||
|
{
|
||||||
|
if ( !m_started )
|
||||||
|
{
|
||||||
|
m_started = true;
|
||||||
|
m_animNo = ANIM_GARY_SLITHER;
|
||||||
|
m_animPlaying = true;
|
||||||
|
m_frame = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void CNpcGaryFriend::stop()
|
||||||
|
{
|
||||||
|
if ( m_started )
|
||||||
|
{
|
||||||
|
m_started = false;
|
||||||
|
m_animNo = m_data[m_type].idleAnim;
|
||||||
|
m_animPlaying = true;
|
||||||
|
m_frame = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -26,8 +26,8 @@ public:
|
||||||
virtual void setupWaypoints( sThingActor *ThisActor );
|
virtual void setupWaypoints( sThingActor *ThisActor );
|
||||||
virtual CRECT const *getThinkBBox();
|
virtual CRECT const *getThinkBBox();
|
||||||
DVECTOR const &getTriggerPos() {return( m_triggerPos );}
|
DVECTOR const &getTriggerPos() {return( m_triggerPos );}
|
||||||
void start() {m_started = true;}
|
void start();
|
||||||
void stop() {m_started = false;}
|
void stop();
|
||||||
void startLeft();
|
void startLeft();
|
||||||
void startRight();
|
void startRight();
|
||||||
virtual void render();
|
virtual void render();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue