2017-07-13 10:26:03 +02:00
|
|
|
/*
|
2022-12-11 23:16:23 +02:00
|
|
|
* BattleAnimations.h, part of VCMI engine
|
2017-07-13 10:26:03 +02:00
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
|
|
|
*/
|
2011-12-22 16:05:19 +03:00
|
|
|
#pragma once
|
|
|
|
|
2017-06-24 16:42:05 +02:00
|
|
|
#include "../../lib/battle/BattleHex.h"
|
2022-12-08 19:41:02 +02:00
|
|
|
#include "BattleConstants.h"
|
2011-12-22 16:05:19 +03:00
|
|
|
|
2022-07-26 15:07:42 +02:00
|
|
|
VCMI_LIB_NAMESPACE_BEGIN
|
|
|
|
|
2011-12-22 16:05:19 +03:00
|
|
|
class CStack;
|
2022-12-08 19:41:02 +02:00
|
|
|
class CCreature;
|
|
|
|
class CSpell;
|
2023-01-18 17:32:57 +02:00
|
|
|
class Point;
|
2022-07-26 15:07:42 +02:00
|
|
|
|
|
|
|
VCMI_LIB_NAMESPACE_END
|
|
|
|
|
2022-12-15 23:24:03 +02:00
|
|
|
class ColorFilter;
|
2022-12-13 18:49:35 +02:00
|
|
|
class BattleHero;
|
2022-12-08 19:41:02 +02:00
|
|
|
class CAnimation;
|
2022-12-09 13:26:17 +02:00
|
|
|
class BattleInterface;
|
|
|
|
class CreatureAnimation;
|
2011-12-22 16:05:19 +03:00
|
|
|
struct StackAttackedInfo;
|
|
|
|
|
|
|
|
/// Base class of battle animations
|
2022-12-12 22:04:25 +02:00
|
|
|
class BattleAnimation
|
2011-12-22 16:05:19 +03:00
|
|
|
{
|
|
|
|
protected:
|
2022-12-13 13:58:16 +02:00
|
|
|
BattleInterface & owner;
|
2022-11-28 16:02:46 +02:00
|
|
|
bool initialized;
|
2022-11-20 19:11:34 +02:00
|
|
|
|
2022-12-12 22:04:25 +02:00
|
|
|
std::vector<BattleAnimation *> & pendingAnimations();
|
2022-12-09 13:26:17 +02:00
|
|
|
std::shared_ptr<CreatureAnimation> stackAnimation(const CStack * stack) const;
|
2022-11-20 19:11:34 +02:00
|
|
|
bool stackFacingRight(const CStack * stack);
|
|
|
|
void setStackFacingRight(const CStack * stack, bool facingRight);
|
|
|
|
|
2013-07-06 19:10:20 +03:00
|
|
|
virtual bool init() = 0; //to be called - if returned false, call again until returns true
|
2022-11-28 16:02:46 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
ui32 ID; //unique identifier
|
|
|
|
|
|
|
|
bool isInitialized();
|
|
|
|
bool tryInitialize();
|
2023-05-13 22:38:57 +02:00
|
|
|
virtual void tick(uint32_t msPassed) {} //call every new frame
|
2022-12-12 22:04:25 +02:00
|
|
|
virtual ~BattleAnimation();
|
2011-12-22 16:05:19 +03:00
|
|
|
|
2022-12-12 22:04:25 +02:00
|
|
|
BattleAnimation(BattleInterface & owner);
|
2011-12-22 16:05:19 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
/// Sub-class which is responsible for managing the battle stack animation.
|
2022-12-12 22:04:25 +02:00
|
|
|
class BattleStackAnimation : public BattleAnimation
|
2011-12-22 16:05:19 +03:00
|
|
|
{
|
|
|
|
public:
|
2022-12-09 13:10:35 +02:00
|
|
|
std::shared_ptr<CreatureAnimation> myAnim; //animation for our stack, managed by BattleInterface
|
2011-12-22 16:05:19 +03:00
|
|
|
const CStack * stack; //id of stack whose animation it is
|
|
|
|
|
2022-12-12 22:04:25 +02:00
|
|
|
BattleStackAnimation(BattleInterface & owner, const CStack * _stack);
|
2022-11-20 19:11:34 +02:00
|
|
|
void rotateStack(BattleHex hex);
|
2011-12-22 16:05:19 +03:00
|
|
|
};
|
|
|
|
|
2022-12-16 18:34:35 +02:00
|
|
|
class StackActionAnimation : public BattleStackAnimation
|
2011-12-22 16:05:19 +03:00
|
|
|
{
|
2022-12-22 01:04:58 +02:00
|
|
|
ECreatureAnimType nextGroup;
|
|
|
|
ECreatureAnimType currGroup;
|
2022-12-16 18:34:35 +02:00
|
|
|
std::string sound;
|
|
|
|
public:
|
2022-12-22 01:04:58 +02:00
|
|
|
void setNextGroup( ECreatureAnimType group );
|
|
|
|
void setGroup( ECreatureAnimType group );
|
2022-12-16 18:34:35 +02:00
|
|
|
void setSound( std::string sound );
|
2022-11-27 20:01:52 +02:00
|
|
|
|
2022-12-22 01:04:58 +02:00
|
|
|
ECreatureAnimType getGroup() const;
|
2022-12-14 14:21:58 +02:00
|
|
|
|
2022-12-16 18:34:35 +02:00
|
|
|
StackActionAnimation(BattleInterface & owner, const CStack * _stack);
|
|
|
|
~StackActionAnimation();
|
2011-12-22 16:05:19 +03:00
|
|
|
|
2022-12-16 18:34:35 +02:00
|
|
|
bool init() override;
|
2011-12-22 16:05:19 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
/// Animation of a defending unit
|
2022-12-16 18:34:35 +02:00
|
|
|
class DefenceAnimation : public StackActionAnimation
|
2011-12-22 16:05:19 +03:00
|
|
|
{
|
2022-12-12 22:04:25 +02:00
|
|
|
public:
|
|
|
|
DefenceAnimation(BattleInterface & owner, const CStack * stack);
|
|
|
|
};
|
2013-07-16 21:12:47 +03:00
|
|
|
|
2022-12-12 22:04:25 +02:00
|
|
|
/// Animation of a hit unit
|
2022-12-16 18:34:35 +02:00
|
|
|
class HittedAnimation : public StackActionAnimation
|
2022-12-12 22:04:25 +02:00
|
|
|
{
|
2011-12-22 16:05:19 +03:00
|
|
|
public:
|
2022-12-12 22:04:25 +02:00
|
|
|
HittedAnimation(BattleInterface & owner, const CStack * stack);
|
|
|
|
};
|
2011-12-22 16:05:19 +03:00
|
|
|
|
2022-12-12 22:04:25 +02:00
|
|
|
/// Animation of a dying unit
|
2022-12-16 18:34:35 +02:00
|
|
|
class DeathAnimation : public StackActionAnimation
|
2022-12-12 22:04:25 +02:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
DeathAnimation(BattleInterface & owner, const CStack * stack, bool ranged);
|
2011-12-22 16:05:19 +03:00
|
|
|
};
|
|
|
|
|
2022-12-16 18:34:35 +02:00
|
|
|
/// Resurrects stack from dead state
|
|
|
|
class ResurrectionAnimation : public StackActionAnimation
|
2011-12-22 16:05:19 +03:00
|
|
|
{
|
|
|
|
public:
|
2022-12-16 18:34:35 +02:00
|
|
|
ResurrectionAnimation(BattleInterface & owner, const CStack * _stack);
|
2011-12-22 16:05:19 +03:00
|
|
|
};
|
|
|
|
|
2022-12-18 18:26:43 +02:00
|
|
|
class ColorTransformAnimation : public BattleStackAnimation
|
2011-12-22 16:05:19 +03:00
|
|
|
{
|
2022-12-16 18:34:35 +02:00
|
|
|
std::vector<ColorFilter> steps;
|
|
|
|
std::vector<float> timePoints;
|
|
|
|
const CSpell * spell;
|
|
|
|
|
|
|
|
float totalProgress;
|
2022-12-14 14:21:58 +02:00
|
|
|
|
2022-12-18 18:26:43 +02:00
|
|
|
bool init() override;
|
2023-05-13 22:38:57 +02:00
|
|
|
void tick(uint32_t msPassed) override;
|
2022-12-14 14:21:58 +02:00
|
|
|
|
2011-12-22 16:05:19 +03:00
|
|
|
public:
|
2022-12-21 23:29:56 +02:00
|
|
|
ColorTransformAnimation(BattleInterface & owner, const CStack * _stack, const std::string & colorFilterName, const CSpell * spell);
|
2011-12-22 16:05:19 +03:00
|
|
|
};
|
|
|
|
|
2022-12-01 22:06:42 +02:00
|
|
|
/// Base class for all animations that play during stack movement
|
2022-12-12 22:04:25 +02:00
|
|
|
class StackMoveAnimation : public BattleStackAnimation
|
2022-11-28 22:35:38 +02:00
|
|
|
{
|
|
|
|
public:
|
2022-12-16 22:07:46 +02:00
|
|
|
BattleHex nextHex;
|
|
|
|
BattleHex prevHex;
|
2022-11-28 22:35:38 +02:00
|
|
|
|
2022-12-01 22:06:42 +02:00
|
|
|
protected:
|
2022-12-16 22:07:46 +02:00
|
|
|
StackMoveAnimation(BattleInterface & owner, const CStack * _stack, BattleHex prevHex, BattleHex nextHex);
|
2022-11-28 22:35:38 +02:00
|
|
|
};
|
|
|
|
|
2011-12-22 16:05:19 +03:00
|
|
|
/// Move animation of a creature
|
2022-12-12 22:04:25 +02:00
|
|
|
class MovementAnimation : public StackMoveAnimation
|
2011-12-22 16:05:19 +03:00
|
|
|
{
|
|
|
|
private:
|
2023-03-20 19:43:37 +02:00
|
|
|
int moveSoundHander; // sound handler used when moving a unit
|
|
|
|
|
2013-07-06 19:10:20 +03:00
|
|
|
std::vector<BattleHex> destTiles; //full path, includes already passed hexes
|
|
|
|
ui32 curentMoveIndex; // index of nextHex in destTiles
|
|
|
|
|
|
|
|
double begX, begY; // starting position
|
|
|
|
double distanceX, distanceY; // full movement distance, may be negative if creture moves topleft
|
|
|
|
|
2023-01-27 23:16:02 +02:00
|
|
|
/// progress gain per second
|
|
|
|
double progressPerSecond;
|
|
|
|
|
|
|
|
/// range 0 -> 1, indicates move progrees. 0 = movement starts, 1 = move ends
|
|
|
|
double progress;
|
2013-07-06 19:10:20 +03:00
|
|
|
|
2011-12-22 16:05:19 +03:00
|
|
|
public:
|
2015-10-12 15:47:10 +02:00
|
|
|
bool init() override;
|
2023-05-13 22:38:57 +02:00
|
|
|
void tick(uint32_t msPassed) override;
|
2011-12-22 16:05:19 +03:00
|
|
|
|
2022-12-12 22:04:25 +02:00
|
|
|
MovementAnimation(BattleInterface & owner, const CStack *_stack, std::vector<BattleHex> _destTiles, int _distance);
|
|
|
|
~MovementAnimation();
|
2011-12-22 16:05:19 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
/// Move end animation of a creature
|
2022-12-12 22:04:25 +02:00
|
|
|
class MovementEndAnimation : public StackMoveAnimation
|
2011-12-22 16:05:19 +03:00
|
|
|
{
|
|
|
|
public:
|
2015-10-12 15:47:10 +02:00
|
|
|
bool init() override;
|
2011-12-22 16:05:19 +03:00
|
|
|
|
2022-12-12 22:04:25 +02:00
|
|
|
MovementEndAnimation(BattleInterface & owner, const CStack * _stack, BattleHex destTile);
|
|
|
|
~MovementEndAnimation();
|
2011-12-22 16:05:19 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
/// Move start animation of a creature
|
2022-12-12 22:04:25 +02:00
|
|
|
class MovementStartAnimation : public StackMoveAnimation
|
2011-12-22 16:05:19 +03:00
|
|
|
{
|
|
|
|
public:
|
2015-10-12 15:47:10 +02:00
|
|
|
bool init() override;
|
2011-12-22 16:05:19 +03:00
|
|
|
|
2022-12-12 22:04:25 +02:00
|
|
|
MovementStartAnimation(BattleInterface & owner, const CStack * _stack);
|
2011-12-22 16:05:19 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
/// Class responsible for animation of stack chaning direction (left <-> right)
|
2022-12-12 22:04:25 +02:00
|
|
|
class ReverseAnimation : public StackMoveAnimation
|
2011-12-22 16:05:19 +03:00
|
|
|
{
|
2022-12-10 00:25:11 +02:00
|
|
|
void setupSecondPart();
|
2011-12-22 16:05:19 +03:00
|
|
|
public:
|
2015-10-12 15:47:10 +02:00
|
|
|
bool init() override;
|
2013-07-06 19:10:20 +03:00
|
|
|
|
2022-12-12 22:04:25 +02:00
|
|
|
ReverseAnimation(BattleInterface & owner, const CStack * stack, BattleHex dest);
|
2011-12-22 16:05:19 +03:00
|
|
|
};
|
|
|
|
|
2022-12-16 18:34:35 +02:00
|
|
|
/// This class is responsible for managing the battle attack animation
|
|
|
|
class AttackAnimation : public StackActionAnimation
|
2022-12-08 20:43:51 +02:00
|
|
|
{
|
2022-12-16 18:34:35 +02:00
|
|
|
protected:
|
|
|
|
BattleHex dest; //attacked hex
|
|
|
|
const CStack *defendingStack;
|
|
|
|
const CStack *attackingStack;
|
|
|
|
int attackingStackPosBeforeReturn; //for stacks with return_after_strike feature
|
2022-12-08 20:43:51 +02:00
|
|
|
|
2022-12-16 18:34:35 +02:00
|
|
|
const CCreature * getCreature() const;
|
2022-12-22 01:04:58 +02:00
|
|
|
ECreatureAnimType findValidGroup( const std::vector<ECreatureAnimType> candidates ) const;
|
2022-12-16 18:34:35 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
AttackAnimation(BattleInterface & owner, const CStack *attacker, BattleHex _dest, const CStack *defender);
|
2022-12-08 20:43:51 +02:00
|
|
|
};
|
|
|
|
|
2022-12-16 18:34:35 +02:00
|
|
|
/// Hand-to-hand attack
|
|
|
|
class MeleeAttackAnimation : public AttackAnimation
|
2017-09-08 13:25:12 +02:00
|
|
|
{
|
2022-12-22 01:04:58 +02:00
|
|
|
ECreatureAnimType getUpwardsGroup(bool multiAttack) const;
|
|
|
|
ECreatureAnimType getForwardGroup(bool multiAttack) const;
|
|
|
|
ECreatureAnimType getDownwardsGroup(bool multiAttack) const;
|
2022-12-15 23:24:03 +02:00
|
|
|
|
2022-12-22 01:04:58 +02:00
|
|
|
ECreatureAnimType selectGroup(bool multiAttack);
|
2022-12-15 23:24:03 +02:00
|
|
|
|
|
|
|
public:
|
2022-12-16 18:34:35 +02:00
|
|
|
MeleeAttackAnimation(BattleInterface & owner, const CStack * attacker, BattleHex _dest, const CStack * _attacked, bool multiAttack);
|
2022-12-15 23:24:03 +02:00
|
|
|
|
2023-05-13 22:38:57 +02:00
|
|
|
void tick(uint32_t msPassed) override;
|
2022-12-14 12:04:37 +02:00
|
|
|
};
|
|
|
|
|
2022-12-16 18:34:35 +02:00
|
|
|
|
2022-12-14 12:04:37 +02:00
|
|
|
class RangedAttackAnimation : public AttackAnimation
|
|
|
|
{
|
2022-12-01 22:06:42 +02:00
|
|
|
void setAnimationGroup();
|
|
|
|
void initializeProjectile();
|
|
|
|
void emitProjectile();
|
|
|
|
void emitExplosion();
|
|
|
|
|
2017-09-08 13:25:12 +02:00
|
|
|
protected:
|
2022-12-01 22:06:42 +02:00
|
|
|
bool projectileEmitted;
|
|
|
|
|
2022-12-22 01:04:58 +02:00
|
|
|
virtual ECreatureAnimType getUpwardsGroup() const = 0;
|
|
|
|
virtual ECreatureAnimType getForwardGroup() const = 0;
|
|
|
|
virtual ECreatureAnimType getDownwardsGroup() const = 0;
|
2022-12-01 22:06:42 +02:00
|
|
|
|
|
|
|
virtual void createProjectile(const Point & from, const Point & dest) const = 0;
|
2022-12-06 14:12:13 +02:00
|
|
|
virtual uint32_t getAttackClimaxFrame() const = 0;
|
2017-09-08 13:25:12 +02:00
|
|
|
|
2022-12-01 22:06:42 +02:00
|
|
|
public:
|
2022-12-12 22:04:25 +02:00
|
|
|
RangedAttackAnimation(BattleInterface & owner, const CStack * attacker, BattleHex dest, const CStack * defender);
|
|
|
|
~RangedAttackAnimation();
|
2022-12-01 22:06:42 +02:00
|
|
|
|
|
|
|
bool init() override;
|
2023-05-13 22:38:57 +02:00
|
|
|
void tick(uint32_t msPassed) override;
|
2017-09-08 13:25:12 +02:00
|
|
|
};
|
|
|
|
|
2011-12-22 16:05:19 +03:00
|
|
|
/// Shooting attack
|
2022-12-12 22:04:25 +02:00
|
|
|
class ShootingAnimation : public RangedAttackAnimation
|
2022-12-01 22:06:42 +02:00
|
|
|
{
|
2022-12-22 01:04:58 +02:00
|
|
|
ECreatureAnimType getUpwardsGroup() const override;
|
|
|
|
ECreatureAnimType getForwardGroup() const override;
|
|
|
|
ECreatureAnimType getDownwardsGroup() const override;
|
2022-12-01 22:06:42 +02:00
|
|
|
|
|
|
|
void createProjectile(const Point & from, const Point & dest) const override;
|
2022-12-06 14:12:13 +02:00
|
|
|
uint32_t getAttackClimaxFrame() const override;
|
2022-12-01 22:06:42 +02:00
|
|
|
|
|
|
|
public:
|
2022-12-12 22:04:25 +02:00
|
|
|
ShootingAnimation(BattleInterface & owner, const CStack * attacker, BattleHex dest, const CStack * defender);
|
2022-12-01 22:06:42 +02:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
/// Catapult attack
|
2022-12-12 22:04:25 +02:00
|
|
|
class CatapultAnimation : public ShootingAnimation
|
2011-12-22 16:05:19 +03:00
|
|
|
{
|
|
|
|
private:
|
2022-11-27 23:26:28 +02:00
|
|
|
bool explosionEmitted;
|
2011-12-22 16:05:19 +03:00
|
|
|
int catapultDamage;
|
2022-11-25 16:32:23 +02:00
|
|
|
|
2011-12-22 16:05:19 +03:00
|
|
|
public:
|
2022-12-12 22:04:25 +02:00
|
|
|
CatapultAnimation(BattleInterface & owner, const CStack * attacker, BattleHex dest, const CStack * defender, int _catapultDmg = 0);
|
2011-12-22 16:05:19 +03:00
|
|
|
|
2022-12-01 22:06:42 +02:00
|
|
|
void createProjectile(const Point & from, const Point & dest) const override;
|
2023-05-13 22:38:57 +02:00
|
|
|
void tick(uint32_t msPassed) override;
|
2011-12-22 16:05:19 +03:00
|
|
|
};
|
|
|
|
|
2022-12-12 22:04:25 +02:00
|
|
|
class CastAnimation : public RangedAttackAnimation
|
2017-09-08 13:25:12 +02:00
|
|
|
{
|
2022-12-01 22:06:42 +02:00
|
|
|
const CSpell * spell;
|
|
|
|
|
2022-12-22 01:04:58 +02:00
|
|
|
ECreatureAnimType getUpwardsGroup() const override;
|
|
|
|
ECreatureAnimType getForwardGroup() const override;
|
|
|
|
ECreatureAnimType getDownwardsGroup() const override;
|
2022-12-01 22:06:42 +02:00
|
|
|
|
|
|
|
void createProjectile(const Point & from, const Point & dest) const override;
|
2022-12-06 14:12:13 +02:00
|
|
|
uint32_t getAttackClimaxFrame() const override;
|
2022-12-01 22:06:42 +02:00
|
|
|
|
2017-09-08 13:25:12 +02:00
|
|
|
public:
|
2022-12-12 22:04:25 +02:00
|
|
|
CastAnimation(BattleInterface & owner, const CStack * attacker, BattleHex dest_, const CStack * defender, const CSpell * spell);
|
2022-12-02 01:55:09 +02:00
|
|
|
};
|
|
|
|
|
2022-12-16 18:34:35 +02:00
|
|
|
class DummyAnimation : public BattleAnimation
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
int counter;
|
|
|
|
int howMany;
|
|
|
|
public:
|
|
|
|
bool init() override;
|
2023-05-13 22:38:57 +02:00
|
|
|
void tick(uint32_t msPassed) override;
|
2022-12-16 18:34:35 +02:00
|
|
|
|
|
|
|
DummyAnimation(BattleInterface & owner, int howManyFrames);
|
|
|
|
};
|
|
|
|
|
2022-12-01 22:06:42 +02:00
|
|
|
/// Class that plays effect at one or more positions along with (single) sound effect
|
2022-12-25 21:39:55 +02:00
|
|
|
class EffectAnimation : public BattleAnimation
|
2022-12-01 22:06:42 +02:00
|
|
|
{
|
2022-12-12 21:17:15 +02:00
|
|
|
std::string soundName;
|
2022-12-01 22:06:42 +02:00
|
|
|
bool effectFinished;
|
2023-03-26 02:48:11 +02:00
|
|
|
bool reversed;
|
2022-12-01 22:06:42 +02:00
|
|
|
int effectFlags;
|
|
|
|
|
|
|
|
std::shared_ptr<CAnimation> animation;
|
|
|
|
std::vector<Point> positions;
|
|
|
|
std::vector<BattleHex> battlehexes;
|
|
|
|
|
|
|
|
bool alignToBottom() const;
|
|
|
|
bool waitForSound() const;
|
2022-12-02 01:55:09 +02:00
|
|
|
bool forceOnTop() const;
|
|
|
|
bool screenFill() const;
|
2022-12-01 22:06:42 +02:00
|
|
|
|
|
|
|
void onEffectFinished();
|
|
|
|
void clearEffect();
|
2023-05-13 22:38:57 +02:00
|
|
|
void playEffect(uint32_t msPassed);
|
2022-12-01 22:06:42 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
enum EEffectFlags
|
|
|
|
{
|
|
|
|
ALIGN_TO_BOTTOM = 1,
|
2022-12-25 21:35:13 +02:00
|
|
|
FORCE_ON_TOP = 2,
|
|
|
|
SCREEN_FILL = 4,
|
2022-12-01 22:06:42 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/// Create animation with screen-wide effect
|
2023-03-26 02:48:11 +02:00
|
|
|
EffectAnimation(BattleInterface & owner, std::string animationName, int effects = 0, bool reversed = false);
|
2022-12-01 22:06:42 +02:00
|
|
|
|
|
|
|
/// Create animation positioned at point(s). Note that positions must be are absolute, including battleint position offset
|
2023-03-26 02:48:11 +02:00
|
|
|
EffectAnimation(BattleInterface & owner, std::string animationName, Point pos , int effects = 0, bool reversed = false);
|
|
|
|
EffectAnimation(BattleInterface & owner, std::string animationName, std::vector<Point> pos , int effects = 0, bool reversed = false);
|
2022-12-01 22:06:42 +02:00
|
|
|
|
|
|
|
/// Create animation positioned at certain hex(es)
|
2023-03-26 02:48:11 +02:00
|
|
|
EffectAnimation(BattleInterface & owner, std::string animationName, BattleHex hex , int effects = 0, bool reversed = false);
|
|
|
|
EffectAnimation(BattleInterface & owner, std::string animationName, std::vector<BattleHex> hex, int effects = 0, bool reversed = false);
|
2022-12-02 01:55:09 +02:00
|
|
|
|
2023-03-26 02:48:11 +02:00
|
|
|
EffectAnimation(BattleInterface & owner, std::string animationName, Point pos, BattleHex hex, int effects = 0, bool reversed = false);
|
2022-12-25 21:39:55 +02:00
|
|
|
~EffectAnimation();
|
2017-09-08 13:25:12 +02:00
|
|
|
|
|
|
|
bool init() override;
|
2023-05-13 22:38:57 +02:00
|
|
|
void tick(uint32_t msPassed) override;
|
2017-09-08 13:25:12 +02:00
|
|
|
};
|
|
|
|
|
2022-12-13 18:49:35 +02:00
|
|
|
class HeroCastAnimation : public BattleAnimation
|
2022-12-12 23:31:18 +02:00
|
|
|
{
|
2022-12-13 18:49:35 +02:00
|
|
|
std::shared_ptr<BattleHero> hero;
|
|
|
|
const CStack * target;
|
|
|
|
const CSpell * spell;
|
|
|
|
BattleHex tile;
|
|
|
|
bool projectileEmitted;
|
|
|
|
|
|
|
|
void initializeProjectile();
|
|
|
|
void emitProjectile();
|
|
|
|
void emitAnimationEvent();
|
2022-12-12 23:31:18 +02:00
|
|
|
|
2022-12-01 22:06:42 +02:00
|
|
|
public:
|
2022-12-13 18:49:35 +02:00
|
|
|
HeroCastAnimation(BattleInterface & owner, std::shared_ptr<BattleHero> hero, BattleHex dest, const CStack * defender, const CSpell * spell);
|
2017-07-20 06:08:49 +02:00
|
|
|
|
2023-05-13 22:38:57 +02:00
|
|
|
void tick(uint32_t msPassed) override;
|
2022-12-01 22:06:42 +02:00
|
|
|
bool init() override;
|
2012-04-08 13:34:23 +03:00
|
|
|
};
|