mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-19 21:10:12 +02:00
This commit is contained in:
parent
849e3fc04e
commit
7874dffa7d
@ -1365,6 +1365,7 @@ struct StacksHealedOrResurrected : public CPackForClient //3013
|
||||
bool lifeDrain; //if true, this heal is an effect of life drain
|
||||
bool tentHealing; //if true, than it's healing via First Aid Tent
|
||||
si32 drainedFrom; //if life drain - then stack life was drain from, if tentHealing - stack that is a healer
|
||||
bool cure; //archangel cast also remove negative effects
|
||||
|
||||
template <typename Handler> void serialize(Handler &h, const int version)
|
||||
{
|
||||
|
@ -1623,6 +1623,18 @@ DLL_LINKAGE void StacksHealedOrResurrected::applyGs( CGameState *gs )
|
||||
}
|
||||
vstd::amin(changedStack->firstHPleft, changedStack->MaxHealth());
|
||||
if(resurrected)
|
||||
{
|
||||
//removing all spells effects
|
||||
auto selector = [](const Bonus * b)
|
||||
{
|
||||
const CSpell *s = b->sourceSpell();
|
||||
//Special case: DISRUPTING_RAY is "immune" to dispell
|
||||
//Other even PERMANENT effects can be removed
|
||||
return (s != nullptr) && (s->id != SpellID::DISRUPTING_RAY);
|
||||
};
|
||||
changedStack->popBonuses(selector);
|
||||
}
|
||||
else if(cure)
|
||||
{
|
||||
//removing all effects from negative spells
|
||||
auto selector = [](const Bonus * b)
|
||||
|
@ -24,6 +24,8 @@ void HealingSpellMechanics::applyBattleEffects(const SpellCastEnvironment * env,
|
||||
StacksHealedOrResurrected shr;
|
||||
shr.lifeDrain = false;
|
||||
shr.tentHealing = false;
|
||||
//special case for Archangel
|
||||
shr.cure = parameters.mode == ECastingMode::CREATURE_ACTIVE_CASTING && owner->id == SpellID::RESURRECTION;
|
||||
|
||||
const bool resurrect = (healLevel != EHealLevel::HEAL);
|
||||
for(auto & attackedCre : ctx.attackedCres)
|
||||
|
@ -888,6 +888,7 @@ void CGameHandler::applyBattleEffects(BattleAttack &bat, const CStack *att, cons
|
||||
StacksHealedOrResurrected shi;
|
||||
shi.lifeDrain = true;
|
||||
shi.tentHealing = false;
|
||||
shi.cure = false;
|
||||
shi.drainedFrom = def->ID;
|
||||
|
||||
StacksHealedOrResurrected::HealInfo hi;
|
||||
@ -4153,6 +4154,7 @@ bool CGameHandler::makeBattleAction( BattleAction &ba )
|
||||
StacksHealedOrResurrected shr;
|
||||
shr.lifeDrain = false;
|
||||
shr.tentHealing = true;
|
||||
shr.cure = false;
|
||||
shr.drainedFrom = ba.stackNumber;
|
||||
|
||||
StacksHealedOrResurrected::HealInfo hi;
|
||||
|
Loading…
x
Reference in New Issue
Block a user