mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
support setting spell master level in OPENING_BATTLE_SPELLS
This commit is contained in:
@@ -403,6 +403,7 @@ In battle, army affected by this bonus will cast spell at the very start of the
|
||||
|
||||
- subtype: spell identifier
|
||||
- val: duration of the spell, in rounds
|
||||
- addInfo - spell mastery level (1 - Basic, 3 - Expert)
|
||||
|
||||
### FREE_SHIP_BOARDING
|
||||
|
||||
|
@@ -225,6 +225,7 @@ static void loadBonusAddInfo(CAddInfo & var, BonusType type, const JsonNode & va
|
||||
case BonusType::DARKNESS:
|
||||
case BonusType::FULL_MAP_SCOUTING:
|
||||
case BonusType::FULL_MAP_DARKNESS:
|
||||
case BonusType::OPENING_BATTLE_SPELL:
|
||||
// 1 number
|
||||
var = getFirstValue(value).Integer();
|
||||
break;
|
||||
|
@@ -206,7 +206,8 @@ void BattleFlowProcessor::castOpeningSpells(const CBattleInfoCallback & battle)
|
||||
const CSpell * spell = b->subtype.as<SpellID>().toSpell();
|
||||
|
||||
spells::BattleCast parameters(&battle, &caster, spells::Mode::PASSIVE, spell);
|
||||
parameters.setSpellLevel(3);
|
||||
int32_t spellLevel = b->additionalInfo != CAddInfo::NONE ? b->additionalInfo[0] : 3;
|
||||
parameters.setSpellLevel(spellLevel);
|
||||
parameters.setEffectDuration(b->val);
|
||||
parameters.massive = true;
|
||||
parameters.castIfPossible(gameHandler->spellcastEnvironment(), spells::Target());
|
||||
|
Reference in New Issue
Block a user