mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-21 21:17:49 +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 lifeDrain; //if true, this heal is an effect of life drain
|
||||||
bool tentHealing; //if true, than it's healing via First Aid Tent
|
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
|
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)
|
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());
|
vstd::amin(changedStack->firstHPleft, changedStack->MaxHealth());
|
||||||
if(resurrected)
|
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
|
//removing all effects from negative spells
|
||||||
auto selector = [](const Bonus * b)
|
auto selector = [](const Bonus * b)
|
||||||
|
@ -24,6 +24,8 @@ void HealingSpellMechanics::applyBattleEffects(const SpellCastEnvironment * env,
|
|||||||
StacksHealedOrResurrected shr;
|
StacksHealedOrResurrected shr;
|
||||||
shr.lifeDrain = false;
|
shr.lifeDrain = false;
|
||||||
shr.tentHealing = 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);
|
const bool resurrect = (healLevel != EHealLevel::HEAL);
|
||||||
for(auto & attackedCre : ctx.attackedCres)
|
for(auto & attackedCre : ctx.attackedCres)
|
||||||
|
@ -888,6 +888,7 @@ void CGameHandler::applyBattleEffects(BattleAttack &bat, const CStack *att, cons
|
|||||||
StacksHealedOrResurrected shi;
|
StacksHealedOrResurrected shi;
|
||||||
shi.lifeDrain = true;
|
shi.lifeDrain = true;
|
||||||
shi.tentHealing = false;
|
shi.tentHealing = false;
|
||||||
|
shi.cure = false;
|
||||||
shi.drainedFrom = def->ID;
|
shi.drainedFrom = def->ID;
|
||||||
|
|
||||||
StacksHealedOrResurrected::HealInfo hi;
|
StacksHealedOrResurrected::HealInfo hi;
|
||||||
@ -4153,6 +4154,7 @@ bool CGameHandler::makeBattleAction( BattleAction &ba )
|
|||||||
StacksHealedOrResurrected shr;
|
StacksHealedOrResurrected shr;
|
||||||
shr.lifeDrain = false;
|
shr.lifeDrain = false;
|
||||||
shr.tentHealing = true;
|
shr.tentHealing = true;
|
||||||
|
shr.cure = false;
|
||||||
shr.drainedFrom = ba.stackNumber;
|
shr.drainedFrom = ba.stackNumber;
|
||||||
|
|
||||||
StacksHealedOrResurrected::HealInfo hi;
|
StacksHealedOrResurrected::HealInfo hi;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user