mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
Allow different subtypes of SOUL_STEAL work concurrently
This commit is contained in:
@@ -983,6 +983,7 @@ void CGameHandler::applyBattleEffects(BattleAttack &bat, const CStack *att, cons
|
|||||||
//soul steal handling
|
//soul steal handling
|
||||||
if (att->hasBonusOfType(Bonus::SOUL_STEAL) && def->isLiving())
|
if (att->hasBonusOfType(Bonus::SOUL_STEAL) && def->isLiving())
|
||||||
{
|
{
|
||||||
|
|
||||||
StacksHealedOrResurrected shi;
|
StacksHealedOrResurrected shi;
|
||||||
shi.lifeDrain = true;
|
shi.lifeDrain = true;
|
||||||
shi.tentHealing = false;
|
shi.tentHealing = false;
|
||||||
@@ -990,6 +991,26 @@ void CGameHandler::applyBattleEffects(BattleAttack &bat, const CStack *att, cons
|
|||||||
shi.canOverheal = true;
|
shi.canOverheal = true;
|
||||||
shi.drainedFrom = def->ID;
|
shi.drainedFrom = def->ID;
|
||||||
|
|
||||||
|
if (att->hasBonusOfType(Bonus::SOUL_STEAL, 0) && att->hasBonusOfType(Bonus::SOUL_STEAL, 1))
|
||||||
|
{
|
||||||
|
StacksHealedOrResurrected::HealInfo hi0;
|
||||||
|
hi0.stackID = att->ID;
|
||||||
|
hi0.healedHP = bsa.killedAmount * att->valOfBonuses(Bonus::SOUL_STEAL, 0) * att->MaxHealth();
|
||||||
|
hi0.lowLevelResurrection = false;
|
||||||
|
|
||||||
|
StacksHealedOrResurrected::HealInfo hi1;
|
||||||
|
hi1.stackID = att->ID;
|
||||||
|
hi1.healedHP = bsa.killedAmount * att->valOfBonuses(Bonus::SOUL_STEAL, 1) * att->MaxHealth();
|
||||||
|
hi1.lowLevelResurrection = true;
|
||||||
|
|
||||||
|
shi.healedStacks.push_back(hi0);
|
||||||
|
shi.healedStacks.push_back(hi1);
|
||||||
|
|
||||||
|
if (hi0.healedHP > 0 || hi1.healedHP > 0)
|
||||||
|
bsa.healedStacks.push_back(shi);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
StacksHealedOrResurrected::HealInfo hi;
|
StacksHealedOrResurrected::HealInfo hi;
|
||||||
hi.stackID = att->ID;
|
hi.stackID = att->ID;
|
||||||
hi.healedHP = bsa.killedAmount * att->valOfBonuses(Bonus::SOUL_STEAL) * att->MaxHealth(); //TODO: Should unit be additionally healed after life drain?
|
hi.healedHP = bsa.killedAmount * att->valOfBonuses(Bonus::SOUL_STEAL) * att->MaxHealth(); //TODO: Should unit be additionally healed after life drain?
|
||||||
@@ -1001,6 +1022,7 @@ void CGameHandler::applyBattleEffects(BattleAttack &bat, const CStack *att, cons
|
|||||||
bsa.healedStacks.push_back(shi);
|
bsa.healedStacks.push_back(shi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
bat.bsa.push_back(bsa); //add this stack to the list of victims after drain life has been calculated
|
bat.bsa.push_back(bsa); //add this stack to the list of victims after drain life has been calculated
|
||||||
|
|
||||||
//fire shield handling
|
//fire shield handling
|
||||||
|
|||||||
Reference in New Issue
Block a user