mirror of
https://github.com/vcmi/vcmi.git
synced 2025-05-13 22:06:58 +02:00
* CHexFieldControl renamed to CClickableHex * CCreatureAnimation.cpp/.h moved to BattleInterface/CCreatureAnimation.cpp/.h * Removed unused project files * Added VCMI_client filters file for VS 2010 * Gathered common parts of StdInc.h in Global.h * Boost.Spirit has been included in PCH for ERM project * StopWatch renamed to CStopWatch * GuiBase.cpp split up in UIFramework/...
52 lines
1.0 KiB
C++
52 lines
1.0 KiB
C++
#include "StdInc.h"
|
|
#include "CMovementStartAnimation.h"
|
|
|
|
#include "../CMusicHandler.h"
|
|
#include "CBattleInterface.h"
|
|
#include "../CGameInfo.h"
|
|
#include "CCreatureAnimation.h"
|
|
#include "../../lib/BattleState.h"
|
|
#include "../CPlayerInterface.h"
|
|
|
|
bool CMovementStartAnimation::init()
|
|
{
|
|
if( !isEarliest(false) )
|
|
return false;
|
|
|
|
|
|
if(!stack || myAnim()->getType() == 5)
|
|
{
|
|
CMovementStartAnimation::endAnim();
|
|
return false;
|
|
}
|
|
|
|
CCS->soundh->playSound(battle_sound(stack->getCreature(), startMoving));
|
|
myAnim()->setType(CCreatureAnim::MOVE_START);
|
|
|
|
return true;
|
|
}
|
|
|
|
void CMovementStartAnimation::nextFrame()
|
|
{
|
|
if(myAnim()->onLastFrameInGroup())
|
|
{
|
|
endAnim();
|
|
}
|
|
else
|
|
{
|
|
if((owner->animCount+1)%(4/owner->curInt->sysOpts.animSpeed)==0)
|
|
myAnim()->incrementFrame();
|
|
}
|
|
}
|
|
|
|
void CMovementStartAnimation::endAnim()
|
|
{
|
|
CBattleAnimation::endAnim();
|
|
|
|
delete this;
|
|
}
|
|
|
|
CMovementStartAnimation::CMovementStartAnimation(CBattleInterface * _owner, const CStack * _stack)
|
|
: CBattleStackAnimation(_owner, _stack)
|
|
{
|
|
} |