1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Added subtype for SPELL_DURATION

This commit is contained in:
Ivan Savenko 2023-10-28 17:57:56 +03:00
parent 1e0ea5f1f0
commit 4ba8014573
3 changed files with 7 additions and 1 deletions

View File

@ -256,6 +256,7 @@ Allows creature upgrade for affected armies
Changes duration of timed spells casted by affected hero
- val: additional duration, turns
- subtype: optional, identifier of affected spells, or all if not set
### SPELL

View File

@ -486,6 +486,7 @@ static void loadBonusSubtype(BonusSubtypeID & subtype, BonusType type, const Jso
break;
}
case BonusType::SPELL_IMMUNITY:
case BonusType::SPELL_DURATION:
case BonusType::SPECIAL_ADD_VALUE_ENCHANT:
case BonusType::SPECIAL_FIXED_VALUE_ENCHANT:
case BonusType::SPECIAL_PECULIAR_ENCHANT:

View File

@ -697,7 +697,11 @@ int32_t CGHeroInstance::getEffectPower(const spells::Spell * spell) const
int32_t CGHeroInstance::getEnchantPower(const spells::Spell * spell) const
{
return getPrimSkillLevel(PrimarySkill::SPELL_POWER) + valOfBonuses(BonusType::SPELL_DURATION);
int32_t spellpower = getPrimSkillLevel(PrimarySkill::SPELL_POWER);
int32_t durationCommon = valOfBonuses(BonusType::SPELL_DURATION, BonusSubtypeID());
int32_t durationSpecific = valOfBonuses(BonusType::SPELL_DURATION, BonusSubtypeID(spell->getId()));
return spellpower + durationCommon + durationSpecific;
}
int64_t CGHeroInstance::getEffectValue(const spells::Spell * spell) const