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:
parent
69a538a600
commit
9b3c61616f
@ -140,6 +140,12 @@
|
|||||||
"basic" : {
|
"basic" : {
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"effects" : [
|
"effects" : [
|
||||||
|
{
|
||||||
|
"subtype" : "skill.diplomacy",
|
||||||
|
"type" : "SECONDARY_SKILL_PREMY",
|
||||||
|
"val" : 1,
|
||||||
|
"valueType" : "BASE_NUMBER"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type" : "SURRENDER_DISCOUNT",
|
"type" : "SURRENDER_DISCOUNT",
|
||||||
"val" : 20,
|
"val" : 20,
|
||||||
@ -150,6 +156,12 @@
|
|||||||
"advanced" : {
|
"advanced" : {
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"effects" : [
|
"effects" : [
|
||||||
|
{
|
||||||
|
"subtype" : "skill.diplomacy",
|
||||||
|
"type" : "SECONDARY_SKILL_PREMY",
|
||||||
|
"val" : 2,
|
||||||
|
"valueType" : "BASE_NUMBER"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type" : "SURRENDER_DISCOUNT",
|
"type" : "SURRENDER_DISCOUNT",
|
||||||
"val" : 40,
|
"val" : 40,
|
||||||
@ -160,6 +172,12 @@
|
|||||||
"expert" : {
|
"expert" : {
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"effects" : [
|
"effects" : [
|
||||||
|
{
|
||||||
|
"subtype" : "skill.diplomacy",
|
||||||
|
"type" : "SECONDARY_SKILL_PREMY",
|
||||||
|
"val" : 3,
|
||||||
|
"valueType" : "BASE_NUMBER"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type" : "SURRENDER_DISCOUNT",
|
"type" : "SURRENDER_DISCOUNT",
|
||||||
"val" : 60,
|
"val" : 60,
|
||||||
|
@ -234,6 +234,7 @@ std::vector<std::shared_ptr<Bonus>> CSkillHandler::defaultBonus(SecondarySkill s
|
|||||||
case SecondarySkill::SCOUTING:
|
case SecondarySkill::SCOUTING:
|
||||||
addBonus(level, Bonus::SIGHT_RADIOUS); break;
|
addBonus(level, Bonus::SIGHT_RADIOUS); break;
|
||||||
case SecondarySkill::DIPLOMACY:
|
case SecondarySkill::DIPLOMACY:
|
||||||
|
addBonus(level);
|
||||||
addBonus(20 * level, Bonus::SURRENDER_DISCOUNT); break;
|
addBonus(20 * level, Bonus::SURRENDER_DISCOUNT); break;
|
||||||
case SecondarySkill::NAVIGATION:
|
case SecondarySkill::NAVIGATION:
|
||||||
addBonus(50 * level); break;
|
addBonus(50 * level); break;
|
||||||
|
@ -323,17 +323,18 @@ int CGCreature::takenAction(const CGHeroInstance *h, bool allowJoin) const
|
|||||||
if(count*2 > totalCount)
|
if(count*2 > totalCount)
|
||||||
sympathy++; // 2 - hero have similar creatures more that 50%
|
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)
|
if(charisma < character)
|
||||||
return FIGHT;
|
return FIGHT;
|
||||||
|
|
||||||
if (allowJoin)
|
if (allowJoin)
|
||||||
{
|
{
|
||||||
if(h->getSecSkillLevel(SecondarySkill::DIPLOMACY) + sympathy + 1 >= character)
|
if(diplomacy + sympathy + 1 >= character)
|
||||||
return JOIN_FOR_FREE;
|
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
|
return VLC->creh->creatures[subID]->cost[6] * getStackCount(SlotID(0)); //join for gold
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user