1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +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;
case 7://maxed mastery for spell
bonus.type = Bonus::MAXED_SPELL;
bonus.subtype = it->subtype; //spell i
speciality.bonuses.push_back (bonus);
break;
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
if (hasBonusOfType(Bonus::SPELL, spell->id))
{
amax(skill, valOfBonuses(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)
skill = 3;
assert(skill >= 0 && skill <= 3);
return skill;
}

View File

@ -4402,7 +4402,7 @@ bool CGameHandler::makeCustomAction( BattleAction &ba )
sendAndApply(&StartAction(ba)); //start spell casting
handleSpellCasting(ba.additionalInfo, skill, ba.destinationTile, ba.side, h->tempOwner, h, secondHero, h->getPrimSkillLevel(2));
handleSpellCasting (ba.additionalInfo, skill, ba.destinationTile, ba.side, h->tempOwner, h, secondHero, h->getPrimSkillLevel(2));
sendAndApply(&EndAction());
if( !gs->curB->getStack(gs->curB->activeStack, false)->alive() )