2011-12-13 21:35:28 +00:00
|
|
|
#include "StdInc.h"
|
|
|
|
#include "CMovementEndAnimation.h"
|
|
|
|
|
2011-12-17 18:59:59 +00:00
|
|
|
#include "CCreatureAnimation.h"
|
2011-12-13 21:35:28 +00:00
|
|
|
#include "../CMusicHandler.h"
|
|
|
|
#include "../CGameInfo.h"
|
|
|
|
#include "../../lib/BattleState.h"
|
|
|
|
#include "../CCursorHandler.h"
|
|
|
|
|
|
|
|
bool CMovementEndAnimation::init()
|
|
|
|
{
|
|
|
|
if( !isEarliest(true) )
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if(!stack || myAnim()->framesInGroup(CCreatureAnim::MOVE_END) == 0 ||
|
|
|
|
myAnim()->getType() == CCreatureAnim::DEATH)
|
|
|
|
{
|
|
|
|
endAnim();
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
CCS->soundh->playSound(battle_sound(stack->getCreature(), endMoving));
|
|
|
|
|
|
|
|
myAnim()->setType(CCreatureAnim::MOVE_END);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
void CMovementEndAnimation::nextFrame()
|
|
|
|
{
|
|
|
|
if(myAnim()->onLastFrameInGroup())
|
|
|
|
{
|
|
|
|
endAnim();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void CMovementEndAnimation::endAnim()
|
|
|
|
{
|
|
|
|
CBattleAnimation::endAnim();
|
|
|
|
|
|
|
|
if(myAnim()->getType() != CCreatureAnim::DEATH)
|
|
|
|
myAnim()->setType(CCreatureAnim::HOLDING); //resetting to default
|
|
|
|
|
|
|
|
CCS->curh->show();
|
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
|
2011-12-17 18:59:59 +00:00
|
|
|
CMovementEndAnimation::CMovementEndAnimation(CBattleInterface * _owner, const CStack * _stack, SBattleHex destTile)
|
2011-12-13 21:35:28 +00:00
|
|
|
: CBattleStackAnimation(_owner, _stack), destinationTile(destTile)
|
|
|
|
{
|
|
|
|
}
|