From 9b3c61616fd8998d22c87bdd9c3c9b85b86c23ef Mon Sep 17 00:00:00 2001 From: Henning Koehler Date: Mon, 28 Aug 2017 23:33:19 +1200 Subject: [PATCH] made diplomacy join chance bonus-based --- config/skills.json | 18 ++++++++++++++++++ lib/CSkillHandler.cpp | 1 + lib/mapObjects/MiscObjects.cpp | 7 ++++--- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/config/skills.json b/config/skills.json index 7ae2a7501..784614c38 100644 --- a/config/skills.json +++ b/config/skills.json @@ -140,6 +140,12 @@ "basic" : { "description" : "", "effects" : [ + { + "subtype" : "skill.diplomacy", + "type" : "SECONDARY_SKILL_PREMY", + "val" : 1, + "valueType" : "BASE_NUMBER" + }, { "type" : "SURRENDER_DISCOUNT", "val" : 20, @@ -150,6 +156,12 @@ "advanced" : { "description" : "", "effects" : [ + { + "subtype" : "skill.diplomacy", + "type" : "SECONDARY_SKILL_PREMY", + "val" : 2, + "valueType" : "BASE_NUMBER" + }, { "type" : "SURRENDER_DISCOUNT", "val" : 40, @@ -160,6 +172,12 @@ "expert" : { "description" : "", "effects" : [ + { + "subtype" : "skill.diplomacy", + "type" : "SECONDARY_SKILL_PREMY", + "val" : 3, + "valueType" : "BASE_NUMBER" + }, { "type" : "SURRENDER_DISCOUNT", "val" : 60, diff --git a/lib/CSkillHandler.cpp b/lib/CSkillHandler.cpp index 98b414d9c..2825c95b7 100644 --- a/lib/CSkillHandler.cpp +++ b/lib/CSkillHandler.cpp @@ -234,6 +234,7 @@ std::vector> CSkillHandler::defaultBonus(SecondarySkill s case SecondarySkill::SCOUTING: addBonus(level, Bonus::SIGHT_RADIOUS); break; case SecondarySkill::DIPLOMACY: + addBonus(level); addBonus(20 * level, Bonus::SURRENDER_DISCOUNT); break; case SecondarySkill::NAVIGATION: addBonus(50 * level); break; diff --git a/lib/mapObjects/MiscObjects.cpp b/lib/mapObjects/MiscObjects.cpp index e8000ec6f..71588de38 100644 --- a/lib/mapObjects/MiscObjects.cpp +++ b/lib/mapObjects/MiscObjects.cpp @@ -323,17 +323,18 @@ int CGCreature::takenAction(const CGHeroInstance *h, bool allowJoin) const if(count*2 > totalCount) sympathy++; // 2 - hero have similar creatures more that 50% - int charisma = powerFactor + h->getSecSkillLevel(SecondarySkill::DIPLOMACY) + sympathy; + int diplomacy = h->valOfBonuses(Bonus::SECONDARY_SKILL_PREMY, SecondarySkill::DIPLOMACY); + int charisma = powerFactor + diplomacy + sympathy; if(charisma < character) return FIGHT; if (allowJoin) { - if(h->getSecSkillLevel(SecondarySkill::DIPLOMACY) + sympathy + 1 >= character) + if(diplomacy + sympathy + 1 >= character) return JOIN_FOR_FREE; - else if(h->getSecSkillLevel(SecondarySkill::DIPLOMACY) * 2 + sympathy + 1 >= character) + else if(diplomacy * 2 + sympathy + 1 >= character) return VLC->creh->creatures[subID]->cost[6] * getStackCount(SlotID(0)); //join for gold }