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

Partially functional artifact screen.

[TBD compound artifacts, backpack arranging, "live" modifying values, many details]
This commit is contained in:
Michał W. Urbańczyk
2011-01-06 20:00:19 +00:00
parent ebb9c84da9
commit 401b364ad7
16 changed files with 388 additions and 225 deletions

View File

@ -1190,6 +1190,21 @@ void CGHeroInstance::UpdateSpeciality()
}
void CGHeroInstance::updateSkill(int which, int val)
{
if(which == LEADERSHIP || which == LUCK)
{
bool luck = which == LUCK;
Bonus::BonusType type[] = {Bonus::MORALE, Bonus::LUCK};
Bonus *b = getBonus(Selector::type(type[luck]) && Selector::sourceType(Bonus::SECONDARY_SKILL));
if(!b)
{
b = new Bonus(Bonus::PERMANENT, type[luck], Bonus::SECONDARY_SKILL, +val, which, which, Bonus::BASE_NUMBER);
addNewBonus(b);
}
else
b->val = +val;
}
int skillVal = 0;
switch (which)
{