diff --git a/config/bonuses.json b/config/bonuses.json index b6d3ca125..25d0c43c7 100644 --- a/config/bonuses.json +++ b/config/bonuses.json @@ -591,6 +591,15 @@ { "icon": "zvs/Lib1.res/MEGABREATH" } + }, + + "DISINTEGRATE": + { + "graphics": + { + "icon": "zvs/Lib1.res/DISINTEGRATE" + } + } } diff --git a/lib/battle/CUnitState.cpp b/lib/battle/CUnitState.cpp index e00f5925b..92a7a65a1 100644 --- a/lib/battle/CUnitState.cpp +++ b/lib/battle/CUnitState.cpp @@ -831,7 +831,8 @@ void CUnitState::damage(int64_t & amount) health.damage(amount); } - if(health.available() <= 0 && (cloned || summoned)) + bool disintegrate = hasBonusOfType(BonusType::DISINTEGRATE); + if(health.available() <= 0 && (cloned || summoned || disintegrate)) ghostPending = true; } diff --git a/lib/bonuses/BonusEnum.h b/lib/bonuses/BonusEnum.h index 9438710ce..427c0b617 100644 --- a/lib/bonuses/BonusEnum.h +++ b/lib/bonuses/BonusEnum.h @@ -178,6 +178,7 @@ class JsonNode; BONUS_NAME(REVENGE) /*additional damage based on how many units in stack died - formula: sqrt((number of creatures at battle start + 1) * creature health) / (total health now + 1 creature health) - 1) * 100% */ \ BONUS_NAME(RESOURCES_CONSTANT_BOOST) /*Bonus that does not account for propagation and gives extra resources per day. val - resource amount, subtype - resource type*/ \ BONUS_NAME(RESOURCES_TOWN_MULTIPLYING_BOOST) /*Bonus that does not account for propagation and gives extra resources per day with amount multiplied by number of owned towns. val - base resource amount to be multiplied times number of owned towns, subtype - resource type*/ \ + BONUS_NAME(DISINTEGRATE) /* after death no corpse remains */ \ /* end of list */