1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Support for MAXED_SPELL special (Melodia, Daremyth)

This commit is contained in:
DjWarmonger
2010-08-29 19:03:10 +00:00
parent 59447fb85e
commit 01776b6a04
2 changed files with 5 additions and 5 deletions

View File

@@ -1097,6 +1097,7 @@ void CGHeroInstance::initObj()
break; break;
case 7://maxed mastery for spell case 7://maxed mastery for spell
bonus.type = Bonus::MAXED_SPELL; bonus.type = Bonus::MAXED_SPELL;
bonus.subtype = it->subtype; //spell i
speciality.bonuses.push_back (bonus); speciality.bonuses.push_back (bonus);
break; break;
case 8://peculiar spells - enchantments case 8://peculiar spells - enchantments
@@ -1295,10 +1296,9 @@ ui8 CGHeroInstance::getSpellSchoolLevel(const CSpell * spell, int *outSelectedSc
amax(skill, valOfBonuses(Bonus::MAGIC_SCHOOL_SKILL, 0)); //any school bonus amax(skill, valOfBonuses(Bonus::MAGIC_SCHOOL_SKILL, 0)); //any school bonus
if (hasBonusOfType(Bonus::SPELL, spell->id)) amax(skill, valOfBonuses(Bonus::SPELL, spell->id)); //given by artifact or other effect
{ if (hasBonusOfType(Bonus::MAXED_SPELL, spell->id))//hero speciality (Daremyth, Melodia)
amax(skill, valOfBonuses(Bonus::SPELL, spell->id)); skill = 3;
}
assert(skill >= 0 && skill <= 3); assert(skill >= 0 && skill <= 3);
return skill; return skill;
} }