Browse Source

disintegrate

Laserlicht 1 year ago
parent
commit
9c4d4e89d6
3 changed files with 12 additions and 1 deletions
  1. 9 0
      config/bonuses.json
  2. 2 1
      lib/battle/CUnitState.cpp
  3. 1 0
      lib/bonuses/BonusEnum.h

+ 9 - 0
config/bonuses.json

@@ -591,6 +591,15 @@
 		{
 			"icon":  "zvs/Lib1.res/MEGABREATH"
 		}
+	},
+
+	"DISINTEGRATE":
+	{
+		"graphics":
+		{
+			"icon":  "zvs/Lib1.res/DISINTEGRATE"
+		}
+
 	}
 }
 

+ 2 - 1
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;
 }
 

+ 1 - 0
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 */