mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-13 01:20:34 +02:00
* support for new objects:
- magic plains - fiery fields - rock lands - magic clouds - lucid pools - holy ground - clover field - evil fog
This commit is contained in:
@ -828,7 +828,6 @@ int CGHeroInstance::getTotalStrength() const
|
||||
|
||||
ui8 CGHeroInstance::getSpellSchoolLevel(const CSpell * spell) const
|
||||
{
|
||||
//TODO: skill level may be different on special terrain
|
||||
ui8 skill = 0; //skill level
|
||||
|
||||
if(spell->fire)
|
||||
@ -840,6 +839,17 @@ ui8 CGHeroInstance::getSpellSchoolLevel(const CSpell * spell) const
|
||||
if(spell->earth)
|
||||
skill = std::max(skill,getSecSkillLevel(17));
|
||||
|
||||
//bonuses (eg. from special terrains)
|
||||
skill = std::max<ui8>(skill, valOfBonuses(HeroBonus::MAGIC_SCHOOL_SKILL, 0)); //any school bonus
|
||||
if(spell->fire)
|
||||
skill = std::max<ui8>(skill, valOfBonuses(HeroBonus::MAGIC_SCHOOL_SKILL, 1));
|
||||
if(spell->air)
|
||||
skill = std::max<ui8>(skill, valOfBonuses(HeroBonus::MAGIC_SCHOOL_SKILL, 2));
|
||||
if(spell->water)
|
||||
skill = std::max<ui8>(skill, valOfBonuses(HeroBonus::MAGIC_SCHOOL_SKILL, 4));
|
||||
if(spell->earth)
|
||||
skill = std::max<ui8>(skill, valOfBonuses(HeroBonus::MAGIC_SCHOOL_SKILL, 8));
|
||||
|
||||
return skill;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user