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

vcmi: remove SPECIAL_BLESS_DAMAGE bonus

It is handled by HAS_ANOTHER_BONUS_LIMITER with SPELL_EFFECT limiter
with desired spell id (bless). Yes, bonus will come from HERO_SPECIAL,
but will work only for blessed with spell id creatures.
This commit is contained in:
Konstantin
2023-03-05 21:50:58 +03:00
parent a943d2cb12
commit 96c40eb36e
5 changed files with 24 additions and 20 deletions

View File

@@ -173,9 +173,20 @@
"specialty" : {
"bonuses" : {
"bless" : {
"addInfo" : 0,
"subtype" : "spell.bless",
"type" : "SPECIAL_BLESS_DAMAGE",
"type" : "GENERAL_DAMAGE_PREMY",
"limiters" : [
{
"type" : "HAS_ANOTHER_BONUS_LIMITER",
"parameters" : [
"GENERAL_DAMAGE_PREMY",
1,
{
"type" : "SPELL_EFFECT",
"id" : "spell.bless"
}
]
}
],
"updater" : "TIMES_HERO_LEVEL",
"val" : 3
}

View File

@@ -604,12 +604,16 @@ std::vector<std::shared_ptr<Bonus>> SpecialtyInfoToBonuses(const SSpecialtyInfo
result.push_back(bonus);
break;
case 6: //damage bonus for bless (Adela)
bonus->type = Bonus::SPECIAL_BLESS_DAMAGE;
bonus->subtype = spec.subtype; //spell id if you ever wanted to use it otherwise
bonus->additionalInfo = spec.additionalinfo; //damage factor
bonus->updater.reset(new TimesHeroLevelUpdater());
result.push_back(bonus);
break;
{
auto limiter = std::make_shared<HasAnotherBonusLimiter>(Bonus::GENERAL_DAMAGE_PREMY,Bonus::SPELL_EFFECT);
limiter->sid = spec.subtype; //spell id if you ever wanted to use it otherwise
limiter->isSourceIDRelevant = true;
bonus->type = Bonus::GENERAL_DAMAGE_PREMY;
bonus->updater.reset(new TimesHeroLevelUpdater());
bonus->addLimiter(limiter);
result.push_back(bonus);
break;
}
case 7: //maxed mastery for spell
bonus->type = Bonus::SPECIAL_FIXED_VALUE_ENCHANT;
bonus->subtype = spec.subtype; //spell id

View File

@@ -1649,7 +1649,6 @@ JsonNode subtypeToJson(Bonus::BonusType type, int subtype)
return JsonUtils::stringNode(CSkillHandler::encodeSkillWithType(subtype));
case Bonus::SPECIAL_SPELL_LEV:
case Bonus::SPECIFIC_SPELL_DAMAGE:
case Bonus::SPECIAL_BLESS_DAMAGE:
case Bonus::MAXED_SPELL:
case Bonus::SPECIAL_PECULIAR_ENCHANT:
case Bonus::SPECIAL_ADD_VALUE_ENCHANT:
@@ -1757,7 +1756,6 @@ std::string Bonus::nameForBonus() const
return CSkillHandler::encodeSkill(subtype);
case Bonus::SPECIAL_SPELL_LEV:
case Bonus::SPECIFIC_SPELL_DAMAGE:
case Bonus::SPECIAL_BLESS_DAMAGE:
case Bonus::MAXED_SPELL:
case Bonus::SPECIAL_PECULIAR_ENCHANT:
case Bonus::SPECIAL_ADD_VALUE_ENCHANT:

View File

@@ -290,7 +290,6 @@ public:
BONUS_NAME(SPECIAL_SPELL_LEV) /*subtype = id, val = value per level in percent*/\
BONUS_NAME(SPELL_DAMAGE) /*val = value*/\
BONUS_NAME(SPECIFIC_SPELL_DAMAGE) /*subtype = id of spell, val = value*/\
BONUS_NAME(SPECIAL_BLESS_DAMAGE) /*val = spell (bless), additionalInfo = value per level in percent*/\
BONUS_NAME(MAXED_SPELL) /*val = id. deprecated in favour of SPECIAL_FIXED_VALUE_ENCHANT*/\
BONUS_NAME(SPECIAL_PECULIAR_ENCHANT) /*blesses and curses with id = val dependent on unit's level, subtype = 0 or 1 for Coronius*/\
BONUS_NAME(SPECIAL_UPGRADE) /*subtype = base, additionalInfo = target */\

View File

@@ -197,14 +197,6 @@ void Timed::apply(ServerCallback * server, const Mechanics * m, const EffectTarg
}
}
if(casterHero && casterHero->hasBonusOfType(Bonus::SPECIAL_BLESS_DAMAGE, m->getSpellIndex())) //TODO: better handling of bonus percentages
{
int damagePercent = casterHero->valOfBonuses(Bonus::SPECIAL_BLESS_DAMAGE, m->getSpellIndex()) / tier;
Bonus specialBonus(Bonus::N_TURNS, Bonus::GENERAL_DAMAGE_PREMY, Bonus::SPELL_EFFECT, damagePercent, m->getSpellIndex());
specialBonus.turnsRemain = duration;
buffer.push_back(specialBonus);
}
if(cumulative)
sse.toAdd.emplace_back(affected->unitId(), buffer);
else