|
@@ -1557,12 +1557,10 @@ struct BattleUnitsChanged : public CPackForClient
|
|
|
void applyCl(CClient *cl);
|
|
void applyCl(CClient *cl);
|
|
|
|
|
|
|
|
std::vector<UnitChanges> changedStacks;
|
|
std::vector<UnitChanges> changedStacks;
|
|
|
- std::vector<CustomEffectInfo> customEffects;
|
|
|
|
|
|
|
|
|
|
template <typename Handler> void serialize(Handler & h, const int version)
|
|
template <typename Handler> void serialize(Handler & h, const int version)
|
|
|
{
|
|
{
|
|
|
h & changedStacks;
|
|
h & changedStacks;
|
|
|
- h & customEffects;
|
|
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -1575,7 +1573,6 @@ struct BattleStackAttacked
|
|
|
damageAmount(0),
|
|
damageAmount(0),
|
|
|
newState(),
|
|
newState(),
|
|
|
flags(0),
|
|
flags(0),
|
|
|
- effect(0),
|
|
|
|
|
spellID(SpellID::NONE)
|
|
spellID(SpellID::NONE)
|
|
|
{};
|
|
{};
|
|
|
|
|
|
|
@@ -1586,9 +1583,8 @@ struct BattleStackAttacked
|
|
|
ui32 killedAmount;
|
|
ui32 killedAmount;
|
|
|
int64_t damageAmount;
|
|
int64_t damageAmount;
|
|
|
UnitChanges newState;
|
|
UnitChanges newState;
|
|
|
- enum EFlags {KILLED = 1, EFFECT = 2/*deprecated */, SECONDARY = 4, REBIRTH = 8, CLONE_KILLED = 16, SPELL_EFFECT = 32 /*, BONUS_EFFECT = 64 */};
|
|
|
|
|
|
|
+ enum EFlags {KILLED = 1, SECONDARY = 2, REBIRTH = 4, CLONE_KILLED = 8, SPELL_EFFECT = 16, FIRE_SHIELD = 32, };
|
|
|
ui32 flags; //uses EFlags (above)
|
|
ui32 flags; //uses EFlags (above)
|
|
|
- ui32 effect; //set only if flag EFFECT is set
|
|
|
|
|
SpellID spellID; //only if flag SPELL_EFFECT is set
|
|
SpellID spellID; //only if flag SPELL_EFFECT is set
|
|
|
|
|
|
|
|
bool killed() const//if target stack was killed
|
|
bool killed() const//if target stack was killed
|
|
@@ -1599,10 +1595,6 @@ struct BattleStackAttacked
|
|
|
{
|
|
{
|
|
|
return flags & CLONE_KILLED;
|
|
return flags & CLONE_KILLED;
|
|
|
}
|
|
}
|
|
|
- bool isEffect() const//if stack has been attacked by a spell
|
|
|
|
|
- {
|
|
|
|
|
- return flags & EFFECT;
|
|
|
|
|
- }
|
|
|
|
|
bool isSecondary() const//if stack was not a primary target (receives no spell effects)
|
|
bool isSecondary() const//if stack was not a primary target (receives no spell effects)
|
|
|
{
|
|
{
|
|
|
return flags & SECONDARY;
|
|
return flags & SECONDARY;
|
|
@@ -1616,6 +1608,10 @@ struct BattleStackAttacked
|
|
|
{
|
|
{
|
|
|
return flags & REBIRTH;
|
|
return flags & REBIRTH;
|
|
|
}
|
|
}
|
|
|
|
|
+ bool fireShield() const
|
|
|
|
|
+ {
|
|
|
|
|
+ return flags & FIRE_SHIELD;
|
|
|
|
|
+ }
|
|
|
template <typename Handler> void serialize(Handler &h, const int version)
|
|
template <typename Handler> void serialize(Handler &h, const int version)
|
|
|
{
|
|
{
|
|
|
h & stackAttacked;
|
|
h & stackAttacked;
|
|
@@ -1624,7 +1620,6 @@ struct BattleStackAttacked
|
|
|
h & flags;
|
|
h & flags;
|
|
|
h & killedAmount;
|
|
h & killedAmount;
|
|
|
h & damageAmount;
|
|
h & damageAmount;
|
|
|
- h & effect;
|
|
|
|
|
h & spellID;
|
|
h & spellID;
|
|
|
}
|
|
}
|
|
|
bool operator<(const BattleStackAttacked &b) const
|
|
bool operator<(const BattleStackAttacked &b) const
|
|
@@ -1737,8 +1732,9 @@ struct BattleSpellCast : public CPackForClient
|
|
|
SpellID spellID; //id of spell
|
|
SpellID spellID; //id of spell
|
|
|
ui8 manaGained; //mana channeling ability
|
|
ui8 manaGained; //mana channeling ability
|
|
|
BattleHex tile; //destination tile (may not be set in some global/mass spells
|
|
BattleHex tile; //destination tile (may not be set in some global/mass spells
|
|
|
- std::vector<CustomEffectInfo> customEffects;
|
|
|
|
|
std::set<ui32> affectedCres; //ids of creatures affected by this spell, generally used if spell does not set any effect (like dispel or cure)
|
|
std::set<ui32> affectedCres; //ids of creatures affected by this spell, generally used if spell does not set any effect (like dispel or cure)
|
|
|
|
|
+ std::set<ui32> resistedCres; // creatures that resisted the spell (e.g. Dwarves)
|
|
|
|
|
+ std::set<ui32> reflectedCres; // creatures that reflected the spell (e.g. Magic Mirror spell)
|
|
|
si32 casterStack;// -1 if not cated by creature, >=0 caster stack ID
|
|
si32 casterStack;// -1 if not cated by creature, >=0 caster stack ID
|
|
|
bool castByHero; //if true - spell has been cast by hero, otherwise by a creature
|
|
bool castByHero; //if true - spell has been cast by hero, otherwise by a creature
|
|
|
|
|
|
|
@@ -1748,8 +1744,9 @@ struct BattleSpellCast : public CPackForClient
|
|
|
h & spellID;
|
|
h & spellID;
|
|
|
h & manaGained;
|
|
h & manaGained;
|
|
|
h & tile;
|
|
h & tile;
|
|
|
- h & customEffects;
|
|
|
|
|
h & affectedCres;
|
|
h & affectedCres;
|
|
|
|
|
+ h & resistedCres;
|
|
|
|
|
+ h & reflectedCres;
|
|
|
h & casterStack;
|
|
h & casterStack;
|
|
|
h & castByHero;
|
|
h & castByHero;
|
|
|
h & activeCast;
|
|
h & activeCast;
|