1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00

Surrendering and related artifacts (Statesman's Medal,

Diplomat's Ring, Ambassador's Sash).
This commit is contained in:
Michał W. Urbańczyk
2011-03-05 16:38:22 +00:00
parent 7908a1a61d
commit 7dbf105f6e
10 changed files with 131 additions and 228 deletions

View File

@ -1177,6 +1177,14 @@ void CGHeroInstance::updateSkill(int which, int val)
else
b->val = +val;
}
else if(which == DIPLOMACY) //surrender discount: 20% per level
{
if(Bonus *b = getBonus(Selector::type(Bonus::SURRENDER_DISCOUNT) && Selector::sourceType(Bonus::SECONDARY_SKILL)))
b->val = +val;
else
addNewBonus(new Bonus(Bonus::PERMANENT, Bonus::SURRENDER_DISCOUNT, Bonus::SECONDARY_SKILL, val * 20, which));
}
int skillVal = 0;
switch (which)