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

SPECIAL_SPELL_LEV and SPECIAL_BLESS_DAMAGE no longer scale with hero level

This commit is contained in:
Henning Koehler 2018-02-21 09:56:20 +13:00
parent 89cb7b2780
commit 6c443d7094
9 changed files with 26 additions and 3 deletions

View File

@ -176,6 +176,7 @@
"addInfo" : 0,
"subtype" : "spell.bless",
"type" : "SPECIAL_BLESS_DAMAGE",
"updater" : "TIMES_HERO_LEVEL",
"val" : 3
}
}
@ -217,6 +218,7 @@
"frostRing" : {
"subtype" : "spell.frostRing",
"type" : "SPECIAL_SPELL_LEV",
"updater" : "TIMES_HERO_LEVEL",
"val" : 3
}
}

View File

@ -140,6 +140,7 @@
"resurrection" : {
"subtype" : "spell.resurrection",
"type" : "SPECIAL_SPELL_LEV",
"updater" : "TIMES_HERO_LEVEL",
"val" : 3
}
}
@ -206,6 +207,7 @@
"resurrection" : {
"subtype" : "spell.resurrection",
"type" : "SPECIAL_SPELL_LEV",
"updater" : "TIMES_HERO_LEVEL",
"val" : 3
}
}
@ -250,6 +252,7 @@
"meteorShower" : {
"subtype" : "spell.meteorShower",
"type" : "SPECIAL_SPELL_LEV",
"updater" : "TIMES_HERO_LEVEL",
"val" : 3
}
}

View File

@ -153,6 +153,7 @@
"inferno" : {
"subtype" : "spell.inferno",
"type" : "SPECIAL_SPELL_LEV",
"updater" : "TIMES_HERO_LEVEL",
"val" : 3
}
}
@ -283,6 +284,7 @@
"fireball" : {
"subtype" : "spell.fireball",
"type" : "SPECIAL_SPELL_LEV",
"updater" : "TIMES_HERO_LEVEL",
"val" : 3
}
}

View File

@ -148,6 +148,7 @@
"deathRipple" : {
"subtype" : "spell.deathRipple",
"type" : "SPECIAL_SPELL_LEV",
"updater" : "TIMES_HERO_LEVEL",
"val" : 3
}
}
@ -169,6 +170,7 @@
"meteorShower" : {
"subtype" : "spell.meteorShower",
"type" : "SPECIAL_SPELL_LEV",
"updater" : "TIMES_HERO_LEVEL",
"val" : 3
}
}
@ -236,6 +238,7 @@
"animateDead" : {
"subtype" : "spell.animateDead",
"type" : "SPECIAL_SPELL_LEV",
"updater" : "TIMES_HERO_LEVEL",
"val" : 3
}
}

View File

@ -176,6 +176,7 @@
"cure" : {
"subtype" : "spell.cure",
"type" : "SPECIAL_SPELL_LEV",
"updater" : "TIMES_HERO_LEVEL",
"val" : 3
}
}
@ -286,6 +287,7 @@
"iceBolt" : {
"subtype" : "spell.iceBolt",
"type" : "SPECIAL_SPELL_LEV",
"updater" : "TIMES_HERO_LEVEL",
"val" : 3
}
}

View File

@ -147,6 +147,7 @@
"hypnotize" : {
"subtype" : "spell.hypnotize",
"type" : "SPECIAL_SPELL_LEV",
"updater" : "TIMES_HERO_LEVEL",
"val" : 3
}
}
@ -249,6 +250,7 @@
"chainLightning" : {
"subtype" : "spell.chainLightning",
"type" : "SPECIAL_SPELL_LEV",
"updater" : "TIMES_HERO_LEVEL",
"val" : 3
}
}

View File

@ -442,6 +442,7 @@ std::vector<std::shared_ptr<Bonus>> SpecialtyInfoToBonuses(const SSpecialtyInfo
case 3: //spell damage bonus, level dependent but calculated elsewhere
bonus->type = Bonus::SPECIAL_SPELL_LEV;
bonus->subtype = spec.subtype;
bonus->updater.reset(new TimesHeroLevelUpdater());
result.push_back(bonus);
break;
case 4: //creature stat boost
@ -483,6 +484,7 @@ std::vector<std::shared_ptr<Bonus>> SpecialtyInfoToBonuses(const SSpecialtyInfo
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;
case 7: //maxed mastery for spell
@ -553,7 +555,14 @@ std::vector<std::shared_ptr<Bonus>> SpecialtyBonusToBonuses(const SSpecialtyBonu
std::vector<std::shared_ptr<Bonus>> result;
for(std::shared_ptr<Bonus> oldBonus : spec.bonuses)
{
if(spec.growsWithLevel)
if(oldBonus->type == Bonus::SPECIAL_SPELL_LEV || oldBonus->type == Bonus::SPECIAL_BLESS_DAMAGE)
{
// these bonuses used to auto-scale with hero level
std::shared_ptr<Bonus> newBonus = std::make_shared<Bonus>(*oldBonus);
newBonus->updater = std::make_shared<TimesHeroLevelUpdater>();
result.push_back(newBonus);
}
else if(spec.growsWithLevel)
{
std::shared_ptr<Bonus> newBonus = std::make_shared<Bonus>(*oldBonus);
switch(newBonus->type)

View File

@ -651,7 +651,7 @@ int64_t CGHeroInstance::getSpellBonus(const spells::Spell * spell, int64_t base,
});
if(affectedStack && affectedStack->creatureLevel() > 0) //Hero specials like Solmyr, Deemer
base *= (100. + ((valOfBonuses(Bonus::SPECIAL_SPELL_LEV, spell->getIndex()) * level) / affectedStack->creatureLevel())) / 100.0;
base *= (100. + valOfBonuses(Bonus::SPECIAL_SPELL_LEV, spell->getIndex()) / affectedStack->creatureLevel()) / 100.0;
return base;
}

View File

@ -219,7 +219,7 @@ void Timed::prepareEffects(SetStackEffect & sse, const Mechanics * m, const Effe
}
if(casterHero && casterHero->hasBonusOfType(Bonus::SPECIAL_BLESS_DAMAGE, m->getSpellIndex())) //TODO: better handling of bonus percentages
{
int damagePercent = casterHero->level * casterHero->valOfBonuses(Bonus::SPECIAL_BLESS_DAMAGE, m->getSpellIndex()) / tier;
int damagePercent = casterHero->valOfBonuses(Bonus::SPECIAL_BLESS_DAMAGE, m->getSpellIndex()) / tier;
Bonus specialBonus(Bonus::N_TURNS, Bonus::CREATURE_DAMAGE, Bonus::SPELL_EFFECT, damagePercent, m->getSpellIndex(), 0, Bonus::PERCENT_TO_ALL);
specialBonus.turnsRemain = duration;
buffer.push_back(specialBonus);