From 1fa6cbe5146a77dc1e692faf72a23bec21d7448c Mon Sep 17 00:00:00 2001 From: Henning Koehler Date: Sat, 26 Aug 2017 17:33:00 +1200 Subject: [PATCH] scouting uses SIGHT_RADIUS bonus --- config/skills.json | 102 ++++++++++++++++++++++++++++++ lib/CSkillHandler.cpp | 2 + lib/mapObjects/CGHeroInstance.cpp | 2 +- 3 files changed, 105 insertions(+), 1 deletion(-) diff --git a/config/skills.json b/config/skills.json index baccfd0cf..9d8445ba8 100644 --- a/config/skills.json +++ b/config/skills.json @@ -34,6 +34,108 @@ ] } }, + "archery" : { + "basic" : { + "description" : "", + "effects" : [ + { + "subtype" : "skill.archery", + "type" : "SECONDARY_SKILL_PREMY", + "val" : 10, + "valueType" : "BASE_NUMBER" + } + ] + }, + "advanced" : { + "description" : "", + "effects" : [ + { + "subtype" : "skill.archery", + "type" : "SECONDARY_SKILL_PREMY", + "val" : 25, + "valueType" : "BASE_NUMBER" + } + ] + }, + "expert" : { + "description" : "", + "effects" : [ + { + "subtype" : "skill.archery", + "type" : "SECONDARY_SKILL_PREMY", + "val" : 50, + "valueType" : "BASE_NUMBER" + } + ] + } + }, + "logistics" : { + "basic" : { + "description" : "", + "effects" : [ + { + "subtype" : "skill.logistics", + "type" : "SECONDARY_SKILL_PREMY", + "val" : 10, + "valueType" : "BASE_NUMBER" + } + ] + }, + "advanced" : { + "description" : "", + "effects" : [ + { + "subtype" : "skill.logistics", + "type" : "SECONDARY_SKILL_PREMY", + "val" : 20, + "valueType" : "BASE_NUMBER" + } + ] + }, + "expert" : { + "description" : "", + "effects" : [ + { + "subtype" : "skill.logistics", + "type" : "SECONDARY_SKILL_PREMY", + "val" : 30, + "valueType" : "BASE_NUMBER" + } + ] + } + }, + "scouting" : { + "basic" : { + "description" : "", + "effects" : [ + { + "type" : "SIGHT_RADIOUS", + "val" : 1, + "valueType" : "BASE_NUMBER" + } + ] + }, + "advanced" : { + "description" : "", + "effects" : [ + { + "type" : "SIGHT_RADIOUS", + "val" : 2, + "valueType" : "BASE_NUMBER" + } + ] + }, + "expert" : { + "description" : "", + "effects" : [ + { + "type" : "SIGHT_RADIOUS", + "val" : 3, + "valueType" : "BASE_NUMBER" + } + ] + } + }, "estates" : { "basic" : { "description" : "", diff --git a/lib/CSkillHandler.cpp b/lib/CSkillHandler.cpp index 6a02ecdd7..8d5504b61 100644 --- a/lib/CSkillHandler.cpp +++ b/lib/CSkillHandler.cpp @@ -223,6 +223,8 @@ const std::shared_ptr CSkillHandler::defaultBonus(SecondarySkill skill, i bonusVal = 5 + 5 * level * level; break; case SecondarySkill::LOGISTICS: bonusVal = 10 * level; break; + case SecondarySkill::SCOUTING: + bonusType = Bonus::SIGHT_RADIOUS; break; case SecondarySkill::DIPLOMACY: bonusType = Bonus::SURRENDER_DISCOUNT; bonusVal = 20 * level; break; diff --git a/lib/mapObjects/CGHeroInstance.cpp b/lib/mapObjects/CGHeroInstance.cpp index d8416638b..e8dea7953 100644 --- a/lib/mapObjects/CGHeroInstance.cpp +++ b/lib/mapObjects/CGHeroInstance.cpp @@ -1071,7 +1071,7 @@ int3 CGHeroInstance::getSightCenter() const int CGHeroInstance::getSightRadius() const { - return 5 + getSecSkillLevel(SecondarySkill::SCOUTING) + valOfBonuses(Bonus::SIGHT_RADIOUS); //default + scouting + return 5 + valOfBonuses(Bonus::SIGHT_RADIOUS); // scouting gives SIGHT_RADIUS bonus } si32 CGHeroInstance::manaRegain() const