mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +02:00
vcmi: use global bonuses for sight radius and mana
We do not need to hardcode constants for there. We can just use default bonuses.
This commit is contained in:
parent
5d4bcb3c78
commit
6b987275eb
@ -44,5 +44,18 @@
|
|||||||
"STACK_ARTIFACTS": false,
|
"STACK_ARTIFACTS": false,
|
||||||
"COMMANDERS": false,
|
"COMMANDERS": false,
|
||||||
"MITHRIL": false //so far unused
|
"MITHRIL": false //so far unused
|
||||||
}
|
},
|
||||||
|
"heroBaseBonuses":
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"type" : "MANA_REGENERATION", //default mana regeneration
|
||||||
|
"val" : 1,
|
||||||
|
"valueType" : "BASE_NUMBER"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type" : "SIGHT_RADIUS", //default sight radius
|
||||||
|
"val" : 5,
|
||||||
|
"valueType" : "BASE_NUMBER"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
@ -895,7 +895,7 @@ int3 CGHeroInstance::getSightCenter() const
|
|||||||
|
|
||||||
int CGHeroInstance::getSightRadius() const
|
int CGHeroInstance::getSightRadius() const
|
||||||
{
|
{
|
||||||
return 5 + valOfBonuses(Bonus::SIGHT_RADIUS); // scouting gives SIGHT_RADIUS bonus
|
return valOfBonuses(Bonus::SIGHT_RADIUS); // scouting gives SIGHT_RADIUS bonus
|
||||||
}
|
}
|
||||||
|
|
||||||
si32 CGHeroInstance::manaRegain() const
|
si32 CGHeroInstance::manaRegain() const
|
||||||
@ -903,7 +903,7 @@ si32 CGHeroInstance::manaRegain() const
|
|||||||
if (hasBonusOfType(Bonus::FULL_MANA_REGENERATION))
|
if (hasBonusOfType(Bonus::FULL_MANA_REGENERATION))
|
||||||
return manaLimit();
|
return manaLimit();
|
||||||
|
|
||||||
return 1 + valOfBonuses(Bonus::SECONDARY_SKILL_PREMY, SecondarySkill::MYSTICISM) + valOfBonuses(Bonus::MANA_REGENERATION); //1 + Mysticism level
|
return valOfBonuses(Bonus::SECONDARY_SKILL_PREMY, SecondarySkill::MYSTICISM) + valOfBonuses(Bonus::MANA_REGENERATION); //1 + Mysticism level
|
||||||
}
|
}
|
||||||
|
|
||||||
si32 CGHeroInstance::getManaNewTurn() const
|
si32 CGHeroInstance::getManaNewTurn() const
|
||||||
|
Loading…
Reference in New Issue
Block a user