Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add support for added damage multipliers
  • Loading branch information
PJacek committed Jul 17, 2021
commit 60eb12ccdde886246e1ece26e482efe07b648315
6 changes: 6 additions & 0 deletions src/Data/SkillStatMap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,12 @@ return {
["global_maximum_added_chaos_damage"] = {
mod("ChaosMax", "BASE", nil),
},
["added_damage_+%_final"] = {
mod("AddedDamage", "MORE", nil),
},
["active_skill_added_damage_+%_final"] = {
mod("AddedDamage", "MORE", nil),
},
["shield_charge_damage_+%_maximum"] = {
mod("Damage", "MORE", nil, 0, 0, { type = "DistanceRamp", ramp = {{0,0},{60,1}} }),
},
Expand Down
12 changes: 0 additions & 12 deletions src/Data/Skills/act_dex.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2678,18 +2678,6 @@ skills["DualStrike"] = {
["dual_strike_damage_+%_final_against_enemies_on_full_life"] = {
mod("Damage", "MORE", nil, 0, bit.bor(KeywordFlag.Hit, KeywordFlag.Ailment), { type = "ActorCondition", actor = "enemy", var = "FullLife" })
},
["active_skill_added_damage_+%_final"] = {
mod("PhysicalMax", "MORE", nil),
mod("FireMax", "MORE", nil),
mod("ColdMax", "MORE", nil),
mod("LightningMax", "MORE", nil),
mod("ChaosMax", "MORE", nil),
mod("PhysicalMin", "MORE", nil),
mod("FireMin", "MORE", nil),
mod("ColdMin", "MORE", nil),
mod("LightningMin", "MORE", nil),
mod("ChaosMin", "MORE", nil),
}
},
baseFlags = {
attack = true,
Expand Down
12 changes: 0 additions & 12 deletions src/Export/Skills/act_dex.txt
Original file line number Diff line number Diff line change
Expand Up @@ -490,18 +490,6 @@ local skills, mod, flag, skill = ...
["dual_strike_damage_+%_final_against_enemies_on_full_life"] = {
mod("Damage", "MORE", nil, 0, bit.bor(KeywordFlag.Hit, KeywordFlag.Ailment), { type = "ActorCondition", actor = "enemy", var = "FullLife" })
},
["active_skill_added_damage_+%_final"] = {
mod("PhysicalMax", "MORE", nil),
mod("FireMax", "MORE", nil),
mod("ColdMax", "MORE", nil),
mod("LightningMax", "MORE", nil),
mod("ChaosMax", "MORE", nil),
mod("PhysicalMin", "MORE", nil),
mod("FireMin", "MORE", nil),
mod("ColdMin", "MORE", nil),
mod("LightningMin", "MORE", nil),
mod("ChaosMin", "MORE", nil),
}
},
#mods

Expand Down
25 changes: 15 additions & 10 deletions src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1850,28 +1850,33 @@ function calcs.offence(env, actor, activeSkill)
local damageEffectiveness = activeSkill.activeEffect.grantedEffectLevel.damageEffectiveness or skillData.damageEffectiveness or 1
local addedMin = skillModList:Sum("BASE", cfg, damageTypeMin) + enemyDB:Sum("BASE", cfg, "Self"..damageTypeMin)
local addedMax = skillModList:Sum("BASE", cfg, damageTypeMax) + enemyDB:Sum("BASE", cfg, "Self"..damageTypeMax)
local baseMin = ((source[damageTypeMin] or 0) + (source[damageType.."BonusMin"] or 0)) * baseMultiplier + addedMin * damageEffectiveness
local baseMax = ((source[damageTypeMax] or 0) + (source[damageType.."BonusMax"] or 0)) * baseMultiplier + addedMax * damageEffectiveness
local addedMult = calcLib.mod(skillModList, cfg, "Added"..damageType.."Damage", "AddedDamage")
local baseMin = ((source[damageTypeMin] or 0) + (source[damageType.."BonusMin"] or 0)) * baseMultiplier + addedMin * damageEffectiveness * addedMult
local baseMax = ((source[damageTypeMax] or 0) + (source[damageType.."BonusMax"] or 0)) * baseMultiplier + addedMax * damageEffectiveness * addedMult
output[damageTypeMin.."Base"] = baseMin
output[damageTypeMax.."Base"] = baseMax
if breakdown then
breakdown[damageType] = { damageTypes = { } }
if baseMin ~= 0 and baseMax ~= 0 then
t_insert(breakdown[damageType], "Base damage:")
local plus = ""
local plus = false
if (source[damageTypeMin] or 0) ~= 0 or (source[damageTypeMax] or 0) ~= 0 then
t_insert(breakdown[damageType], s_format("%d to %d ^8(base damage from %s)", source[damageTypeMin], source[damageTypeMax], source.type and "weapon" or "skill"))
if baseMultiplier ~= 1 then
t_insert(breakdown[damageType], s_format("(%d to %d) x %.2f ^8(base damage from %s multiplied by base damage multiplier)", source[damageTypeMin], source[damageTypeMax], baseMultiplier, source.type and "weapon" or "skill"))
else
t_insert(breakdown[damageType], s_format("%d to %d ^8(base damage from %s)", source[damageTypeMin], source[damageTypeMax], source.type and "weapon" or "skill"))
t_insert(breakdown[damageType], s_format("x %.2f ^8(base damage multiplier)", baseMultiplier))
end
plus = "+ "
plus = true
end
if addedMin ~= 0 or addedMax ~= 0 then
if plus then
t_insert(breakdown[damageType], "+")
end
t_insert(breakdown[damageType], s_format("%d to %d ^8(added damage)", addedMin, addedMax))
if damageEffectiveness ~= 1 then
t_insert(breakdown[damageType], s_format("%s(%d to %d) x %.2f ^8(added damage multiplied by damage effectiveness)", plus, addedMin, addedMax, damageEffectiveness))
else
t_insert(breakdown[damageType], s_format("%s%d to %d ^8(added damage)", plus, addedMin, addedMax))
t_insert(breakdown[damageType], s_format("x %.2f ^8(damage effectiveness)", damageEffectiveness))
end
if addedMult ~= 1 then
t_insert(breakdown[damageType], s_format("x %.2f ^8(added damage multiplier)", addedMult))
end
end
t_insert(breakdown[damageType], s_format("= %.1f to %.1f", baseMin, baseMax))
Expand Down