1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

Add TRANSMUTATION_IMMUNITY bonus

This commit is contained in:
Ivan Savenko
2025-06-11 14:15:10 +03:00
parent d2178f8831
commit 9762e8493a
2 changed files with 2 additions and 1 deletions

View File

@@ -191,6 +191,7 @@ class JsonNode;
BONUS_NAME(STACK_EXPERIENCE_GAIN_PERCENT) /*modifies all stack experience gains*/\
BONUS_NAME(FULL_MAP_SCOUTING) /*Skyship*/\
BONUS_NAME(FULL_MAP_DARKNESS) /*opposite to Skyship*/\
BONUS_NAME(TRANSMUTATION_IMMUNITY) /*blocks TRANSMUTATION bonus*/\
/* end of list */

View File

@@ -1341,7 +1341,7 @@ void BattleActionProcessor::handleAfterAttackCasting(const CBattleInfoCallback &
if(!defender->alive())
return;
if(attacker->hasBonusOfType(BonusType::TRANSMUTATION) && defender->isLiving()) //transmutation mechanics, similar to WoG werewolf ability
if(attacker->hasBonusOfType(BonusType::TRANSMUTATION) && defender->isLiving() && !defender->hasBonusOfType(BonusType::TRANSMUTATION_IMMUNITY)) //transmutation mechanics, similar to WoG werewolf ability
{
int chanceToTrigger = attacker->valOfBonuses(BonusType::TRANSMUTATION);
if (!gameHandler->randomizer->rollCombatAbility(ownerArmy, chanceToTrigger))