From 91b03405407436cbc9caee7fc5af76b4710d1fcf Mon Sep 17 00:00:00 2001 From: DjWarmonger Date: Sat, 17 Jul 2010 13:49:58 +0000 Subject: [PATCH] Support for level-dependent spell bonuses (Deemer) TODO: Bonuses for Resurrection, Animate Dead and probably other non-direct damage spells. --- config/specials.txt | 24 ++++++++++++------------ hch/CObjectHandler.cpp | 4 +--- lib/CGameState.cpp | 2 ++ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/config/specials.txt b/config/specials.txt index 7c389ffa8..88e7acad0 100644 --- a/config/specials.txt +++ b/config/specials.txt @@ -10,7 +10,7 @@ 8 2 5 27 0 9 6 41 0 3 10 8 45 0 0 -11 3 20 0 3 +11 3 3 20 0 12 1 0 0 8 13 2 5 11 0 14 8 48 0 0 @@ -24,12 +24,12 @@ 22 1 0 0 24 23 2 5 2 0 24 8 55 1 0 -25 3 37 0 3 +25 3 3 37 0 26 2 5 24 0 27 2 5 27 0 28 2 5 11 0 29 7 51 0 0 -30 3 16 0 3 +30 3 3 16 0 31 1 0 0 20 32 1 0 0 30 33 1 0 0 36 @@ -39,12 +39,12 @@ 37 1 0 0 38 38 10 1 1 0 39 1 0 0 36 -40 3 60 0 3 +40 3 3 60 0 41 2 5 8 1 42 2 5 11 0 43 7 51 0 0 44 1 0 0 34 -45 3 19 0 3 +45 3 3 19 0 46 8 53 0 0 47 10 350 6 0 48 1 0 0 46 @@ -56,13 +56,13 @@ 54 1 0 0 146 55 1 0 0 50 56 2 5 24 0 -57 3 22 0 3 +57 3 3 22 0 58 2 5 8 1 59 8 45 0 0 60 10 1 3 0 61 8 43 0 0 62 2 5 25 0 -63 3 21 0 3 +63 3 3 21 0 64 1 0 0 58 65 1 0 0 62 66 1 0 0 64 @@ -71,8 +71,8 @@ 69 2 5 12 0 70 10 350 6 0 71 1 0 0 56 -72 3 24 0 3 -73 3 23 0 3 +72 3 3 24 0 +73 3 3 23 0 74 2 5 25 0 75 2 5 11 1 76 3 39 0 3 @@ -87,12 +87,12 @@ 85 2 5 2 0 86 1 0 0 80 87 1 0 0 70 -88 3 38 0 3 +88 3 3 38 0 89 2 5 8 1 90 2 5 25 0 -91 3 38 0 3 +91 3 3 38 0 92 2 5 11 1 -93 3 23 0 3 +93 3 3 23 0 94 10 1 4 0 95 8 46 0 0 96 1 0 0 94 diff --git a/hch/CObjectHandler.cpp b/hch/CObjectHandler.cpp index cdb20b3b6..c424a3124 100644 --- a/hch/CObjectHandler.cpp +++ b/hch/CObjectHandler.cpp @@ -1026,11 +1026,9 @@ void CGHeroInstance::initObj() bonus.val = valOfBonuses(Bonus::SECONDARY_SKILL_PREMY, it->subtype) * it->val; //TODO: limit range to hero only speciality.bonuses.push_back(bonus); break; - case 3://spell damage bonus, level dependant - speciality.growthsWithLevel = true; + case 3://spell damage bonus, level dependant but calculated elsehwere bonus.type = Bonus::SPECIAL_SPELL_LEV; bonus.subtype = it->subtype; - bonus.additionalInfo = it->additionalinfo; speciality.bonuses.push_back (bonus); break; case 4://creature stat boost diff --git a/lib/CGameState.cpp b/lib/CGameState.cpp index 92820bc9c..0a3df2712 100644 --- a/lib/CGameState.cpp +++ b/lib/CGameState.cpp @@ -3086,6 +3086,8 @@ ui32 BattleInfo::calculateSpellDmg( const CSpell * sp, const CGHeroInstance * ca ret *= 100 + affectedCreature->valOfBonuses(Bonus::MORE_DAMAGE_FROM_SPELL, sp->id); ret /= 100; } + if (caster) //Hero specials like Solmyr, Deemer + ret *= (100.f + ((caster->valOfBonuses(Bonus::SPECIAL_SPELL_LEV, sp->id) * caster->level) / affectedCreature->type->level)) / 100.0f; } return ret;