diff --git a/config/heroes/fortress.json b/config/heroes/fortress.json index 554ae0329..86975e440 100644 --- a/config/heroes/fortress.json +++ b/config/heroes/fortress.json @@ -68,11 +68,12 @@ "specialty" : { "bonuses" : { "armorer" : { - "subtype" : "skill.armorer", - "type" : "SECONDARY_SKILL_PREMY", + "type" : "GENERAL_DAMAGE_REDUCTION", + "subtype" : -1, + "targetSourceType" : "SECONDARY_SKILL", "updater" : "TIMES_HERO_LEVEL", "val" : 5, - "valueType" : "PERCENT_TO_BASE" + "valueType" : "PERCENT_TO_TARGET_TYPE" } } } diff --git a/config/heroes/rampart.json b/config/heroes/rampart.json index 48fedfe0a..acd008ea7 100644 --- a/config/heroes/rampart.json +++ b/config/heroes/rampart.json @@ -12,11 +12,12 @@ "specialty" : { "bonuses" : { "armorer" : { - "subtype" : "skill.armorer", - "type" : "SECONDARY_SKILL_PREMY", + "type" : "GENERAL_DAMAGE_REDUCTION", + "subtype" : -1, + "targetSourceType" : "SECONDARY_SKILL", "updater" : "TIMES_HERO_LEVEL", "val" : 5, - "valueType" : "PERCENT_TO_BASE" + "valueType" : "PERCENT_TO_TARGET_TYPE" } } } diff --git a/config/heroes/tower.json b/config/heroes/tower.json index 2e95c9eb9..ebfa965bc 100644 --- a/config/heroes/tower.json +++ b/config/heroes/tower.json @@ -57,11 +57,12 @@ "specialty" : { "bonuses" : { "armorer" : { - "subtype" : "skill.armorer", - "type" : "SECONDARY_SKILL_PREMY", + "type" : "GENERAL_DAMAGE_REDUCTION", + "subtype" : -1, + "targetSourceType" : "SECONDARY_SKILL", "updater" : "TIMES_HERO_LEVEL", "val" : 5, - "valueType" : "PERCENT_TO_BASE" + "valueType" : "PERCENT_TO_TARGET_TYPE" } } } diff --git a/config/skills.json b/config/skills.json index 24815189a..9526e63dd 100644 --- a/config/skills.json +++ b/config/skills.json @@ -672,8 +672,8 @@ "base" : { "effects" : { "main" : { - "subtype" : "skill.armorer", - "type" : "SECONDARY_SKILL_PREMY", + "type" : "GENERAL_DAMAGE_REDUCTION", + "subtype" : -1, "valueType" : "BASE_NUMBER" } } diff --git a/lib/HeroBonus.h b/lib/HeroBonus.h index f11ce9fb8..daa88a9e6 100644 --- a/lib/HeroBonus.h +++ b/lib/HeroBonus.h @@ -257,7 +257,7 @@ public: BONUS_NAME(SPELLCASTER) /*subtype - spell id, value - level of school, additional info - weighted chance. use SPECIFIC_SPELL_POWER, CREATURE_SPELL_POWER or CREATURE_ENCHANT_POWER for calculating the power*/ \ BONUS_NAME(CATAPULT) \ BONUS_NAME(ENEMY_DEFENCE_REDUCTION) /*in % (value) eg. behemots*/ \ - BONUS_NAME(GENERAL_DAMAGE_REDUCTION) /* shield / air shield effect */ \ + BONUS_NAME(GENERAL_DAMAGE_REDUCTION) /* shield / air shield effect, also armorer skill/petrify effect for subtype -1*/ \ BONUS_NAME(GENERAL_ATTACK_REDUCTION) /*eg. while stoned or blinded - in %,// subtype not used, use ONLY_MELEE_FIGHT / DISTANCE_FIGHT*/ \ BONUS_NAME(DEFENSIVE_STANCE) /* val - bonus to defense while defending */ \ BONUS_NAME(ATTACKS_ALL_ADJACENT) /*eg. hydra*/ \ @@ -335,7 +335,7 @@ public: BONUS_NAME(LEARN_BATTLE_SPELL_CHANCE) /*skill-agnostic eagle eye chance. subtype = 0 - from enemy, 1 - TODO: from entire battlefield*/\ BONUS_NAME(LEARN_BATTLE_SPELL_LEVEL_LIMIT) /*skill-agnostic eagle eye limit, subtype - school (-1 for all), others TODO*/\ BONUS_NAME(PERCENTAGE_DAMAGE_BOOST) /*skill-agnostic archery and offence, subtype is 0 for offence and 1 for archery*/\ - BONUS_NAME(LEARN_MEETING_SPELL_LIMIT) /*skill-agnostic scholar, subtype is -1 for all, TODO for others (> 0)*/ + BONUS_NAME(LEARN_MEETING_SPELL_LIMIT) /*skill-agnostic scholar, subtype is -1 for all, TODO for others (> 0)*/\ /* end of list */ diff --git a/lib/battle/DamageCalculator.cpp b/lib/battle/DamageCalculator.cpp index c19a7b2fd..3bc58368d 100644 --- a/lib/battle/DamageCalculator.cpp +++ b/lib/battle/DamageCalculator.cpp @@ -277,8 +277,8 @@ double DamageCalculator::getDefenseSkillFactor() const double DamageCalculator::getDefenseArmorerFactor() const { - const std::string cachingStrArmorer = "type_SECONDARY_SKILL_PREMYs_ARMORER"; - static const auto selectorArmorer = Selector::typeSubtype(Bonus::SECONDARY_SKILL_PREMY, SecondarySkill::ARMORER); + const std::string cachingStrArmorer = "type_GENERAL_DAMAGE_REDUCTIONs_N1_NsrcSPELL_EFFECT"; + static const auto selectorArmorer = Selector::typeSubtype(Bonus::GENERAL_DAMAGE_REDUCTION, -1).And(Selector::sourceTypeSel(Bonus::SPELL_EFFECT).Not()); return info.defender->valOfBonuses(selectorArmorer, cachingStrArmorer) / 100.0; } @@ -382,8 +382,8 @@ double DamageCalculator::getDefenseForgetfulnessFactor() const double DamageCalculator::getDefensePetrificationFactor() const { // Creatures that are petrified by a Basilisk's Petrifying attack or a Medusa's Stone gaze take 50% damage (R8 = 0.50) from ranged and melee attacks. Taking damage also deactivates the effect. - const std::string cachingStrAllReduction = "type_GENERAL_DAMAGE_REDUCTIONs_N1"; - static const auto selectorAllReduction = Selector::typeSubtype(Bonus::GENERAL_DAMAGE_REDUCTION, -1); + const std::string cachingStrAllReduction = "type_GENERAL_DAMAGE_REDUCTIONs_N1_srcSPELL_EFFECT"; + static const auto selectorAllReduction = Selector::typeSubtype(Bonus::GENERAL_DAMAGE_REDUCTION, -1).And(Selector::sourceTypeSel(Bonus::SPELL_EFFECT)); return info.defender->valOfBonuses(selectorAllReduction, cachingStrAllReduction) / 100.0; }