1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

made diplomacy join chance bonus-based

This commit is contained in:
Henning Koehler 2017-08-28 23:33:19 +12:00
parent 69a538a600
commit 9b3c61616f
3 changed files with 23 additions and 3 deletions

View File

@ -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,

View File

@ -234,6 +234,7 @@ std::vector<std::shared_ptr<Bonus>> 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;

View File

@ -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
}