Moved all animation ordering logic to callers

Previously, CBattleAnimation & inheritors were controlling animation
ordering - e.g. which animations should play after which.
Now, this is controlled by caller, e.g. BattleInterface & its
controllers.
H3 animations are fairly linear and can be split in stages which are
already somewhat implemented via waitForAnims
This commit is contained in:
Ivan Savenko
2022-12-13 21:31:49 +02:00
parent e750bd2713
commit c79634b6a7
20 changed files with 174 additions and 238 deletions
+1 -22
View File
@@ -10,6 +10,7 @@
#pragma once
#include "../../lib/battle/BattleHex.h"
#include "BattleConstants.h"
VCMI_LIB_NAMESPACE_BEGIN
@@ -25,27 +26,6 @@ class BattleInterface;
class BattleRenderer;
class CPointEffectAnimation;
namespace EBattleEffect
{
enum EBattleEffect
{
// list of battle effects that have hardcoded triggers
FEAR = 15,
GOOD_LUCK = 18,
GOOD_MORALE = 20,
BAD_MORALE = 30,
BAD_LUCK = 48,
RESURRECT = 50,
DRAIN_LIFE = 52, // hardcoded constant in CGameHandler
POISON = 67,
DEATH_BLOW = 73,
REGENERATION = 74,
MANA_DRAIN = 77,
INVALID = -1,
};
}
/// Struct for battle effect animation e.g. morale, prayer, armageddon, bless,...
struct BattleEffect
{
@@ -74,7 +54,6 @@ public:
//displays custom effect on the battlefield
void displayEffect(EBattleEffect::EBattleEffect effect, const BattleHex & destTile);
void displayEffect(EBattleEffect::EBattleEffect effect, uint32_t soundID, const BattleHex & destTile);
//void displayEffects(EBattleEffect::EBattleEffect effect, uint32_t soundID, const std::vector<BattleHex> & destTiles);
void battleTriggerEffect(const BattleTriggerEffect & bte);