1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

Partial support for Clone spell.

This commit is contained in:
DjWarmonger
2012-02-10 13:13:24 +00:00
parent 9e5fcc3152
commit c724092028
5 changed files with 42 additions and 2 deletions

View File

@@ -2729,6 +2729,13 @@ void CStack::prepareAttacked(BattleStackAttacked &bsa) const
bsa.killedAmount = bsa.damageAmount / MaxHealth();
unsigned damageFirst = bsa.damageAmount % MaxHealth();
if (bsa.damageAmount && vstd::contains(state, EBattleStackState::CLONED)) // block ability should not kill clone (0 damage)
{
bsa.killedAmount = count;
bsa.flags |= BattleStackAttacked::KILLED;
return; // no rebirth I believe
}
if( firstHPleft <= damageFirst )
{
bsa.killedAmount++;