mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
tweak
This commit is contained in:
parent
f1a4831813
commit
21c0c95049
@ -154,6 +154,14 @@ void SpellCastContext::setDamageToDisplay(const si32 value)
|
|||||||
damageToDisplay = value;
|
damageToDisplay = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SpellCastContext::addCustomEffect(const CStack * target, ui32 effect)
|
||||||
|
{
|
||||||
|
BattleSpellCast::CustomEffect customEffect;
|
||||||
|
customEffect.effect = effect;
|
||||||
|
customEffect.stack = target->ID;
|
||||||
|
sc.customEffects.push_back(customEffect);
|
||||||
|
}
|
||||||
|
|
||||||
void SpellCastContext::prepareBattleLog()
|
void SpellCastContext::prepareBattleLog()
|
||||||
{
|
{
|
||||||
bool displayDamage = true;
|
bool displayDamage = true;
|
||||||
@ -806,12 +814,7 @@ void DefaultSpellMechanics::handleMagicMirror(const SpellCastEnvironment * env,
|
|||||||
});
|
});
|
||||||
|
|
||||||
for(auto s : reflected)
|
for(auto s : reflected)
|
||||||
{
|
ctx.addCustomEffect(s, 3);
|
||||||
BattleSpellCast::CustomEffect effect;
|
|
||||||
effect.effect = 3;
|
|
||||||
effect.stack = s->ID;
|
|
||||||
ctx.sc.customEffects.push_back(effect);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -839,12 +842,7 @@ void DefaultSpellMechanics::handleResistance(const SpellCastEnvironment * env, S
|
|||||||
});
|
});
|
||||||
|
|
||||||
for(auto s : resisted)
|
for(auto s : resisted)
|
||||||
{
|
ctx.addCustomEffect(s, 78);
|
||||||
BattleSpellCast::CustomEffect effect;
|
|
||||||
effect.effect = 78;
|
|
||||||
effect.stack = s->ID;
|
|
||||||
ctx.sc.customEffects.push_back(effect);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,6 @@ public:
|
|||||||
const DefaultSpellMechanics * mechanics;
|
const DefaultSpellMechanics * mechanics;
|
||||||
const SpellCastEnvironment * env;
|
const SpellCastEnvironment * env;
|
||||||
std::vector<const CStack *> attackedCres;//must be vector, as in Chain Lightning order matters
|
std::vector<const CStack *> attackedCres;//must be vector, as in Chain Lightning order matters
|
||||||
BattleSpellCast sc;//todo: make private
|
|
||||||
StacksInjured si;
|
StacksInjured si;
|
||||||
const BattleSpellCastParameters & parameters;
|
const BattleSpellCastParameters & parameters;
|
||||||
|
|
||||||
@ -31,9 +30,12 @@ public:
|
|||||||
void addDamageToDisplay(const si32 value);
|
void addDamageToDisplay(const si32 value);
|
||||||
void setDamageToDisplay(const si32 value);
|
void setDamageToDisplay(const si32 value);
|
||||||
|
|
||||||
|
void addCustomEffect(const CStack * target, ui32 effect);
|
||||||
|
|
||||||
void beforeCast();
|
void beforeCast();
|
||||||
void afterCast();
|
void afterCast();
|
||||||
private:
|
private:
|
||||||
|
BattleSpellCast sc;
|
||||||
const CGHeroInstance * otherHero;
|
const CGHeroInstance * otherHero;
|
||||||
int spellCost;
|
int spellCost;
|
||||||
si32 damageToDisplay;
|
si32 damageToDisplay;
|
||||||
|
Loading…
Reference in New Issue
Block a user