1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

vcmi: remove DIRECT_DAMAGE_IMMUNITY bonus

Replace by SPELL_DAMAGE_REDUCTION bonus with 100 value
This commit is contained in:
Konstantin
2023-04-10 18:41:25 +03:00
committed by Konstantin P
parent 5841c716fd
commit b0d2787e86
16 changed files with 13 additions and 62 deletions

View File

@@ -201,8 +201,6 @@
"core.bonus.DOUBLE_DAMAGE_CHANCE.description": "${val}%几率造成双倍基础伤害",
"core.bonus.DRAGON_NATURE.name": "龙",
"core.bonus.DRAGON_NATURE.description": "生物拥有龙的特性",
"core.bonus.DIRECT_DAMAGE_IMMUNITY.name": "魔法直伤免疫",
"core.bonus.DIRECT_DAMAGE_IMMUNITY.description": "免疫直接造成伤害的魔法",
"core.bonus.EARTH_IMMUNITY.name": "土系免疫",
"core.bonus.EARTH_IMMUNITY.description": "免疫所有土系魔法",
"core.bonus.ENCHANTER.name": "强化师",

View File

@@ -201,8 +201,6 @@
"core.bonus.DOUBLE_DAMAGE_CHANCE.description": "Has a ${val}% chance of dealing double base damage when attacking",
"core.bonus.DRAGON_NATURE.name": "Dragon",
"core.bonus.DRAGON_NATURE.description": "Creature has a Dragon Nature",
"core.bonus.DIRECT_DAMAGE_IMMUNITY.name": "Direct Damage Immunity",
"core.bonus.DIRECT_DAMAGE_IMMUNITY.description": "Immune to direct damage spells",
"core.bonus.EARTH_IMMUNITY.name": "Earth immunity",
"core.bonus.EARTH_IMMUNITY.description": "Immune to all spells from the school of Earth magic",
"core.bonus.ENCHANTER.name": "Enchanter",

View File

@@ -196,8 +196,6 @@
"core.bonus.DOUBLE_DAMAGE_CHANCE.description": "${val}% Chance auf doppelten Schaden",
"core.bonus.DRAGON_NATURE.name": "Drache",
"core.bonus.DRAGON_NATURE.description": "Kreatur hat eine Drachennatur",
"core.bonus.DIRECT_DAMAGE_IMMUNITY.name": "Direkte Schadensimmunität",
"core.bonus.DIRECT_DAMAGE_IMMUNITY.description": "Immun gegen Direktschadenszauber",
"core.bonus.EARTH_IMMUNITY.name": "Erdimmunität",
"core.bonus.EARTH_IMMUNITY.description": "Immun gegen alle Zauber der Erdschule",
"core.bonus.ENCHANTER.name": "Verzauberer",

View File

@@ -175,8 +175,6 @@
"core.bonus.DOUBLE_DAMAGE_CHANCE.description": "${val}% szans na podwójne obrażenia",
"core.bonus.DRAGON_NATURE.name": "Smok",
"core.bonus.DRAGON_NATURE.description": "Stworzenie posiada smoczą naturę",
"core.bonus.DIRECT_DAMAGE_IMMUNITY.name": "Odporność na bezpośrednie obrażenia",
"core.bonus.DIRECT_DAMAGE_IMMUNITY.description": "Odporny na czary zadające bezpośrednie obrażenia",
"core.bonus.EARTH_IMMUNITY.name": "Odporność na ziemię",
"core.bonus.EARTH_IMMUNITY.description": "Odporny na wszystkie czary szkoły ziemi",
"core.bonus.ENCHANTER.name": "Czarodziej",

View File

@@ -199,8 +199,6 @@
"core.bonus.DOUBLE_DAMAGE_CHANCE.description": "Шанс ${val}% на двойной урон",
"core.bonus.DRAGON_NATURE.name": "Дракон",
"core.bonus.DRAGON_NATURE.description": "Это существо - дракон",
"core.bonus.DIRECT_DAMAGE_IMMUNITY.name": "Иммунитет к магии прямого урона",
"core.bonus.DIRECT_DAMAGE_IMMUNITY.description": "Заклинания прямого урона не могут быть применены",
"core.bonus.EARTH_IMMUNITY.name": "Иммунитет к земле",
"core.bonus.EARTH_IMMUNITY.description": "Иммунитет ко всем заклинаниям Магии Земли",
"core.bonus.ENCHANTER.name": "Заклинатель (массовое)",

View File

@@ -201,8 +201,6 @@
"core.bonus.DOUBLE_DAMAGE_CHANCE.description": "${val}% de probabilidad de doble daño",
"core.bonus.DRAGON_NATURE.name": "Dragón",
"core.bonus.DRAGON_NATURE.description": "La criatura tiene la naturaleza de dragón",
"core.bonus.DIRECT_DAMAGE_IMMUNITY.name": "Inmunidad al Daño Directo",
"core.bonus.DIRECT_DAMAGE_IMMUNITY.description": "Inmune a hechizos de daño directo",
"core.bonus.EARTH_IMMUNITY.name": "Inmunidad a la Tierra",
"core.bonus.EARTH_IMMUNITY.description": "Inmune a todos los hechizos de la escuela de tierra",
"core.bonus.ENCHANTER.name": "Encantador",

View File

@@ -175,8 +175,6 @@
"core.bonus.DOUBLE_DAMAGE_CHANCE.description" : "${val}% шанс нанести подвійної шкоди",
"core.bonus.DRAGON_NATURE.name" : "Дракон",
"core.bonus.DRAGON_NATURE.description" : "Істота має драконячу природу",
"core.bonus.DIRECT_DAMAGE_IMMUNITY.name" : "Імунітет до прямої шкоди",
"core.bonus.DIRECT_DAMAGE_IMMUNITY.description" : "Імунітет до заклять, що завдають прямої шкоди",
"core.bonus.EARTH_IMMUNITY.name" : "Імунітет Землі",
"core.bonus.EARTH_IMMUNITY.description" : "Імунітет до всіх заклять школи Землі",
"core.bonus.ENCHANTER.name" : "Чарівник",

View File

@@ -2433,8 +2433,8 @@
"valueType" : "BASE_NUMBER"
},
{
"type" : "DIRECT_DAMAGE_IMMUNITY",
"val" : 0,
"type" : "SPELL_DAMAGE_REDUCTION",
"val" : 100,
"valueType" : "BASE_NUMBER"
}
],

View File

@@ -116,14 +116,6 @@
}
},
"DIRECT_DAMAGE_IMMUNITY":
{
"graphics":
{
"icon": "zvs/Lib1.res/E_SPDIR"
}
},
"DISGUISED":
{
"hidden": true

View File

@@ -425,9 +425,6 @@
"indifferent": true
},
"targetCondition" : {
"noneOf" : {
"bonus.DIRECT_DAMAGE_IMMUNITY" : "normal"
}
}
}
}

View File

@@ -30,9 +30,6 @@
"negative": true
},
"targetCondition" : {
"noneOf" : {
"bonus.DIRECT_DAMAGE_IMMUNITY" : "normal"
}
}
},
"iceBolt" : {
@@ -66,9 +63,6 @@
"negative": true
},
"targetCondition" : {
"noneOf" : {
"bonus.DIRECT_DAMAGE_IMMUNITY" : "normal"
}
}
},
"lightningBolt" : {
@@ -95,9 +89,6 @@
"negative": true
},
"targetCondition" : {
"noneOf" : {
"bonus.DIRECT_DAMAGE_IMMUNITY" : "normal"
}
}
},
"implosion" : {
@@ -125,7 +116,6 @@
},
"targetCondition" : {
"noneOf" : {
"bonus.DIRECT_DAMAGE_IMMUNITY" : "normal",
"bonus.SIEGE_WEAPON" : "absolute"
}
}
@@ -197,7 +187,6 @@
},
"targetCondition" : {
"noneOf" : {
"bonus.DIRECT_DAMAGE_IMMUNITY" : "normal"
}
}
},
@@ -226,7 +215,6 @@
},
"targetCondition" : {
"noneOf" : {
"bonus.DIRECT_DAMAGE_IMMUNITY" : "normal"
}
}
},
@@ -255,7 +243,6 @@
},
"targetCondition" : {
"noneOf" : {
"bonus.DIRECT_DAMAGE_IMMUNITY" : "normal"
}
}
},
@@ -284,7 +271,6 @@
},
"targetCondition" : {
"noneOf" : {
"bonus.DIRECT_DAMAGE_IMMUNITY" : "normal"
}
}
},
@@ -313,7 +299,6 @@
},
"targetCondition" : {
"noneOf" : {
"bonus.DIRECT_DAMAGE_IMMUNITY" : "normal",
"bonus.SIEGE_WEAPON" : "absolute",
"bonus.UNDEAD" : "absolute"
}
@@ -345,9 +330,6 @@
"targetCondition" : {
"allOf" : {
"bonus.UNDEAD" : "absolute"
},
"noneOf" : {
"bonus.DIRECT_DAMAGE_IMMUNITY" : "normal"
}
}
},
@@ -375,9 +357,6 @@
"negative": true
},
"targetCondition" : {
"noneOf" : {
"bonus.DIRECT_DAMAGE_IMMUNITY" : "normal"
}
}
},
"titanBolt" : {

View File

@@ -105,9 +105,6 @@
"special": true
},
"targetCondition" : {
"noneOf" : {
"bonus.DIRECT_DAMAGE_IMMUNITY" : "normal"
}
}
},
"landMine" : {
@@ -163,9 +160,6 @@
"indifferent": true
},
"targetCondition" : {
"noneOf" : {
"bonus.DIRECT_DAMAGE_IMMUNITY" : "normal"
}
}
},
"forceField" : {
@@ -287,9 +281,6 @@
"special": true
},
"targetCondition" : {
"noneOf" : {
"bonus.DIRECT_DAMAGE_IMMUNITY" : "normal"
}
}
},
"fireWall" : {
@@ -358,9 +349,6 @@
"indifferent": true
},
"targetCondition" : {
"noneOf" : {
"bonus.DIRECT_DAMAGE_IMMUNITY" : "normal"
}
}
},
"earthquake" : {

View File

@@ -133,7 +133,6 @@ VCMI_LIB_NAMESPACE_BEGIN
BONUS_NAME(BIND_EFFECT) /*doesn't do anything particular, works as a marker)*/\
BONUS_NAME(ACID_BREATH) /*additional val damage per creature after attack, additional info - chance in percent*/\
BONUS_NAME(RECEPTIVE) /*accepts friendly spells even with immunity*/\
BONUS_NAME(DIRECT_DAMAGE_IMMUNITY) /*direct damage spells, that is*/\
BONUS_NAME(CASTS) /*how many times creature can cast activated spell*/ \
BONUS_NAME(SPECIFIC_SPELL_POWER) /* value used for Thunderbolt and Resurrection cast by units, subtype - spell id */\
BONUS_NAME(CREATURE_SPELL_POWER) /* value per unit, divided by 100 (so faerie Dragons have 800)*/ \

View File

@@ -216,6 +216,12 @@ BonusParams::BonusParams(std::string deprecatedTypeStr, std::string deprecatedSu
valueType = BonusValueType::INDEPENDENT_MAX;
valueTypeRelevant = true;
}
else if (deprecatedTypeStr == "DIRECT_DAMAGE_IMMUNITY")
{
type = BonusType::SPELL_DAMAGE_REDUCTION;
val = 100;
valRelevant = true;
}
else
isConverted = false;
}

View File

@@ -279,6 +279,10 @@ protected:
{
const bool battleWideNegation = target->hasBonusOfType(BonusType::NEGATE_ALL_NATURAL_IMMUNITIES, 0);
const bool heroNegation = target->hasBonusOfType(BonusType::NEGATE_ALL_NATURAL_IMMUNITIES, 1);
//Non-magical effects is not affected by orb of vulnerability
if(!m->isMagicalEffect())
return false;
//anyone can cast on artifact holder`s stacks
if(heroNegation)
{

View File

@@ -42,7 +42,7 @@ TEST_F(BonusConditionTest, ImmuneByDefault)
TEST_F(BonusConditionTest, ReceptiveIfMatchesType)
{
setDefaultExpectations();
unitBonuses.addNewBonus(std::make_shared<Bonus>(BonusDuration::ONE_BATTLE, BonusType::DIRECT_DAMAGE_IMMUNITY, BonusSource::OTHER, 0, 0));
unitBonuses.addNewBonus(std::make_shared<Bonus>(BonusDuration::ONE_BATTLE, BonusType::SPELL_DAMAGE_REDUCTION, BonusSource::OTHER, 100, 0));
EXPECT_TRUE(subject->isReceptive(&mechanicsMock, &unitMock));
}