Skip to content

Commit c070ed5

Browse files
LocalIdentityLocalIdentity
andauthored
Fixes the damage calculation for Spectres and Tamed Beasts (#1995)
* Fixes the damage calculation for Spectres and Tamed Beasts Spectres and Tamed Beasts use the monster damage values for their base damage stats but in an effort for GGG to have them equal the minion stats at the same level they have added a global damage multiplier to make them even e.g. For level 42 monster Monster Damage: 97.1 Minion Damage: 230.37 (2.37x) So the spectre needs a 137% more damage multiplier I also rolled the 25% more damage server side mod into this calc so that they are in 1 place * Multiply all minion attack damage by minion multiplier All minions are meant to have their attack damage multiplied by the minions innate damage multiplier Currently we were only applying that damage multiplier to the innate physical damage of the hit Currently this mechanic is bugged for Spectres and Tamed Beasts and working how we currently have the code but this will be fixed by GGG next week in a patch * Fix damage multi not applying to the minion directly * Fix test --------- Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent a5a8fae commit c070ed5

8 files changed

Lines changed: 27 additions & 17 deletions

File tree

spec/System/TestSkills_spec.lua

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,17 @@ describe("TestSkills", function()
285285
assert.True(baseLeapSlamHit < build.calcsTab.mainOutput.AverageDamage)
286286
end)
287287

288+
it("applies minion offensive multiplier to all attack damage", function()
289+
build.skillsTab:PasteSocketGroup("Wolf Pack 20/0 1")
290+
runCallback("OnFrame")
291+
292+
local minion = build.calcsTab.mainEnv.minion
293+
local expectedPhysicalMax = round(build.calcsTab.mainEnv.data.monsterAllyDamageTable[minion.level] * (1 + minion.minionData.damageSpread))
294+
295+
assert.are.equals(expectedPhysicalMax, minion.weaponData1.PhysicalMax)
296+
assert.are.near(-30, minion.mainSkill.skillModList:Sum("MORE", minion.mainSkill.skillCfg, "Damage"), 0.0001)
297+
end)
298+
288299
it("Inspiring Ally only mirrors companion damage, not generic minion damage", function()
289300
build.itemsTab:CreateDisplayItemFromRaw([[
290301
New Item
@@ -934,4 +945,4 @@ describe("TestSkills", function()
934945
local expectedAverageEffect = 1 + (build.calcsTab.calcsOutput.MaxAncestralEmpowermentCombinedDamageEffect - 1) * build.calcsTab.calcsOutput.AncestralEmpowermentCombinedUptimeRatio / 100
935946
assert.are.equals(round(expectedAverageEffect, 4), round(build.calcsTab.calcsOutput.AvgAncestralEmpowermentCombinedDamageEffect, 4))
936947
end)
937-
end)
948+
end)

src/Data/Skills/act_dex.lua

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -898,9 +898,6 @@ skills["SummonBeastPlayer"] = {
898898
summonBeast = true,
899899
duration = true,
900900
},
901-
baseMods = {
902-
mod("MinionModifier", "LIST", { mod = mod("Damage", "MORE", 25) }), --Server side damage mod added in 0.3,
903-
},
904901
constantStats = {
905902
{ "minion_base_resummon_time_ms", 12000 },
906903
},

src/Data/Skills/act_int.lua

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19767,9 +19767,6 @@ skills["SummonSpectrePlayer"] = {
1976719767
spectre = true,
1976819768
duration = true,
1976919769
},
19770-
baseMods = {
19771-
mod("MinionModifier", "LIST", { mod = mod("Damage", "MORE", 25) }), --Server side damage mod added in 0.3,
19772-
},
1977319770
constantStats = {
1977419771
{ "minion_base_resummon_time_ms", 12000 },
1977519772
{ "spectre_warp_start_distance", 100 },

src/Export/Skills/act_dex.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ statMap = {
9191
#skill SummonBeastPlayer
9292
#set SummonBeastPlayer
9393
#flags spell minion summonBeast duration
94-
#baseMod mod("MinionModifier", "LIST", { mod = mod("Damage", "MORE", 25) }), --Server side damage mod added in 0.3
9594
#mods
9695
#skillEnd
9796

src/Export/Skills/act_int.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1354,7 +1354,6 @@ statMap = {
13541354
#skill SummonSpectrePlayer
13551355
#set SummonSpectrePlayer
13561356
#flags spell minion spectre duration
1357-
#baseMod mod("MinionModifier", "LIST", { mod = mod("Damage", "MORE", 25) }), --Server side damage mod added in 0.3
13581357
#mods
13591358
#skillEnd
13601359

src/Modules/CalcActiveSkill.lua

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -638,9 +638,13 @@ function calcs.buildActiveSkillModList(env, activeSkill)
638638

639639
-- The damage fixup stat applies x% less base Attack Damage and x% more base Attack Speed as confirmed by Openarl Jan 4th 2024
640640
-- Implemented in this manner as the stat exists on the minion not the skills
641-
if activeSkill.actor and activeSkill.actor.minionData and activeSkill.actor.minionData.damageFixup then
642-
skillModList:NewMod("Damage", "MORE", -100 * activeSkill.actor.minionData.damageFixup, "Damage Fixup", ModFlag.Attack)
643-
skillModList:NewMod("Speed", "MORE", 100 * activeSkill.actor.minionData.damageFixup, "Damage Fixup", ModFlag.Attack)
641+
if activeSkill.actor and activeSkill.actor.minionData then
642+
if activeSkill.actor.minionData.damageFixup then
643+
skillModList:NewMod("Damage", "MORE", -100 * activeSkill.actor.minionData.damageFixup, "Damage Fixup", ModFlag.Attack)
644+
skillModList:NewMod("Speed", "MORE", 100 * activeSkill.actor.minionData.damageFixup, "Damage Fixup", ModFlag.Attack)
645+
elseif activeSkill.actor.minionData.damage ~= 1 then
646+
skillModList:NewMod("Damage", "MORE", (activeSkill.actor.minionData.damage - 1) * 100, activeSkill.actor.minionData.name .." Damage Multiplier", ModFlag.Attack)
647+
end
644648
end
645649
if skillModList:Flag(activeSkill.skillCfg, "DisableSkill") and not skillModList:Flag(activeSkill.skillCfg, "EnableSkill") then
646650
skillFlags.disable = true
@@ -819,13 +823,13 @@ function calcs.buildActiveSkillModList(env, activeSkill)
819823
end
820824

821825
-- Create minion
822-
local minionList, isSpectre, isBeastCompanion
826+
local minionList, monsterDamage
823827
if activeGrantedEffect.minionList and activeGrantedEffect.name:match("^Spectre") then
824828
minionList = copyTable(env.build.spectreList)
825-
isSpectre = true
829+
monsterDamage = true
826830
elseif activeGrantedEffect.minionList and activeGrantedEffect.name:match("^Companion") then
827831
minionList = copyTable(env.build.beastList)
828-
isBeastCompanion = true
832+
monsterDamage = true
829833
elseif activeGrantedEffect.minionList and activeGrantedEffect.minionList[1] then
830834
minionList = copyTable(activeGrantedEffect.minionList)
831835
else
@@ -879,8 +883,9 @@ function calcs.buildActiveSkillModList(env, activeSkill)
879883
minion.lifeTable = env.data.monsterAllyLifeTable
880884
end
881885
local attackTime = minion.minionData.attackTime
882-
local damageTable = (isSpectre or minion.minionData.hostile) and env.data.monsterDamageTable or env.data.monsterAllyDamageTable
883-
local damage = damageTable[minion.level] * minion.minionData.damage
886+
local damageTable = (monsterDamage or minion.minionData.hostile) and env.data.monsterDamageTable or env.data.monsterAllyDamageTable
887+
minion.hiddenDamageFixup = monsterDamage and (round(env.data.monsterAllyDamageTable[minion.level] / damageTable[minion.level] * data.misc.SpectreBeastDamageFixup, 2) - 1) or 0
888+
local damage = damageTable[minion.level]
884889
if not minion.minionData.baseDamageIgnoresAttackSpeed then -- minions with this flag do not factor attack time into their base damage
885890
damage = damage * attackTime
886891
end

src/Modules/CalcPerform.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,6 +1001,7 @@ function calcs.perform(env, skipEHP)
10011001
env.minion.modDB:NewMod("ProjectileCount", "BASE", 1, "Base")
10021002
env.minion.modDB:NewMod("PhysicalHeavyStunBuildup", "MORE", data.monsterConstants["physical_hit_damage_stun_multiplier_+%_final_from_ot"], "Physical Damage")
10031003
env.minion.modDB:NewMod("EnemyHeavyStunBuildup", "MORE", data.monsterConstants["melee_hit_damage_stun_multiplier_+%_final_from_ot"], "Melee Damage", ModFlag.Melee)
1004+
env.minion.modDB:NewMod("Damage", "MORE", env.minion.hiddenDamageFixup * 100, "Hidden Level Scaling")
10041005
for _, mod in ipairs(env.minion.minionData.modList) do
10051006
env.minion.modDB:AddMod(mod)
10061007
end

src/Modules/Data.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ data.misc = { -- magic numbers
246246
PvpElemental2 = 150,
247247
PvpNonElemental1 = 0.57,
248248
PvpNonElemental2 = 90,
249+
SpectreBeastDamageFixup = 1.25 -- 25% more damage server side mod added in 0.3
249250
}
250251

251252
data.skillColorMap = { colorCodes.STRENGTH, colorCodes.DEXTERITY, colorCodes.INTELLIGENCE, colorCodes.NORMAL }

0 commit comments

Comments
 (0)