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:
@@ -173,9 +173,20 @@
|
|||||||
"specialty" : {
|
"specialty" : {
|
||||||
"bonuses" : {
|
"bonuses" : {
|
||||||
"bless" : {
|
"bless" : {
|
||||||
"addInfo" : 0,
|
"type" : "GENERAL_DAMAGE_PREMY",
|
||||||
"subtype" : "spell.bless",
|
"limiters" : [
|
||||||
"type" : "SPECIAL_BLESS_DAMAGE",
|
{
|
||||||
|
"type" : "HAS_ANOTHER_BONUS_LIMITER",
|
||||||
|
"parameters" : [
|
||||||
|
"GENERAL_DAMAGE_PREMY",
|
||||||
|
1,
|
||||||
|
{
|
||||||
|
"type" : "SPELL_EFFECT",
|
||||||
|
"id" : "spell.bless"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
"updater" : "TIMES_HERO_LEVEL",
|
"updater" : "TIMES_HERO_LEVEL",
|
||||||
"val" : 3
|
"val" : 3
|
||||||
}
|
}
|
||||||
|
@@ -604,12 +604,16 @@ std::vector<std::shared_ptr<Bonus>> SpecialtyInfoToBonuses(const SSpecialtyInfo
|
|||||||
result.push_back(bonus);
|
result.push_back(bonus);
|
||||||
break;
|
break;
|
||||||
case 6: //damage bonus for bless (Adela)
|
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
|
auto limiter = std::make_shared<HasAnotherBonusLimiter>(Bonus::GENERAL_DAMAGE_PREMY,Bonus::SPELL_EFFECT);
|
||||||
bonus->additionalInfo = spec.additionalinfo; //damage factor
|
limiter->sid = spec.subtype; //spell id if you ever wanted to use it otherwise
|
||||||
bonus->updater.reset(new TimesHeroLevelUpdater());
|
limiter->isSourceIDRelevant = true;
|
||||||
result.push_back(bonus);
|
bonus->type = Bonus::GENERAL_DAMAGE_PREMY;
|
||||||
break;
|
bonus->updater.reset(new TimesHeroLevelUpdater());
|
||||||
|
bonus->addLimiter(limiter);
|
||||||
|
result.push_back(bonus);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 7: //maxed mastery for spell
|
case 7: //maxed mastery for spell
|
||||||
bonus->type = Bonus::SPECIAL_FIXED_VALUE_ENCHANT;
|
bonus->type = Bonus::SPECIAL_FIXED_VALUE_ENCHANT;
|
||||||
bonus->subtype = spec.subtype; //spell id
|
bonus->subtype = spec.subtype; //spell id
|
||||||
|
@@ -1649,7 +1649,6 @@ JsonNode subtypeToJson(Bonus::BonusType type, int subtype)
|
|||||||
return JsonUtils::stringNode(CSkillHandler::encodeSkillWithType(subtype));
|
return JsonUtils::stringNode(CSkillHandler::encodeSkillWithType(subtype));
|
||||||
case Bonus::SPECIAL_SPELL_LEV:
|
case Bonus::SPECIAL_SPELL_LEV:
|
||||||
case Bonus::SPECIFIC_SPELL_DAMAGE:
|
case Bonus::SPECIFIC_SPELL_DAMAGE:
|
||||||
case Bonus::SPECIAL_BLESS_DAMAGE:
|
|
||||||
case Bonus::MAXED_SPELL:
|
case Bonus::MAXED_SPELL:
|
||||||
case Bonus::SPECIAL_PECULIAR_ENCHANT:
|
case Bonus::SPECIAL_PECULIAR_ENCHANT:
|
||||||
case Bonus::SPECIAL_ADD_VALUE_ENCHANT:
|
case Bonus::SPECIAL_ADD_VALUE_ENCHANT:
|
||||||
@@ -1757,7 +1756,6 @@ std::string Bonus::nameForBonus() const
|
|||||||
return CSkillHandler::encodeSkill(subtype);
|
return CSkillHandler::encodeSkill(subtype);
|
||||||
case Bonus::SPECIAL_SPELL_LEV:
|
case Bonus::SPECIAL_SPELL_LEV:
|
||||||
case Bonus::SPECIFIC_SPELL_DAMAGE:
|
case Bonus::SPECIFIC_SPELL_DAMAGE:
|
||||||
case Bonus::SPECIAL_BLESS_DAMAGE:
|
|
||||||
case Bonus::MAXED_SPELL:
|
case Bonus::MAXED_SPELL:
|
||||||
case Bonus::SPECIAL_PECULIAR_ENCHANT:
|
case Bonus::SPECIAL_PECULIAR_ENCHANT:
|
||||||
case Bonus::SPECIAL_ADD_VALUE_ENCHANT:
|
case Bonus::SPECIAL_ADD_VALUE_ENCHANT:
|
||||||
|
@@ -290,7 +290,6 @@ public:
|
|||||||
BONUS_NAME(SPECIAL_SPELL_LEV) /*subtype = id, val = value per level in percent*/\
|
BONUS_NAME(SPECIAL_SPELL_LEV) /*subtype = id, val = value per level in percent*/\
|
||||||
BONUS_NAME(SPELL_DAMAGE) /*val = value*/\
|
BONUS_NAME(SPELL_DAMAGE) /*val = value*/\
|
||||||
BONUS_NAME(SPECIFIC_SPELL_DAMAGE) /*subtype = id of spell, 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(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_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 */\
|
BONUS_NAME(SPECIAL_UPGRADE) /*subtype = base, additionalInfo = target */\
|
||||||
|
@@ -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)
|
if(cumulative)
|
||||||
sse.toAdd.emplace_back(affected->unitId(), buffer);
|
sse.toAdd.emplace_back(affected->unitId(), buffer);
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user