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:
@@ -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;
|
||||||
}
|
}
|
||||||
|
@@ -4402,7 +4402,7 @@ bool CGameHandler::makeCustomAction( BattleAction &ba )
|
|||||||
|
|
||||||
sendAndApply(&StartAction(ba)); //start spell casting
|
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());
|
sendAndApply(&EndAction());
|
||||||
if( !gs->curB->getStack(gs->curB->activeStack, false)->alive() )
|
if( !gs->curB->getStack(gs->curB->activeStack, false)->alive() )
|
||||||
|
Reference in New Issue
Block a user