Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Sandstorm Visage crit mod #5398

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 11 additions & 2 deletions src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2213,6 +2213,14 @@ function calcs.offence(env, actor, activeSkill)
else
local critOverride = skillModList:Override(cfg, "CritChance")
local baseCrit = critOverride or source.CritChance or 0

local baseCritFromMainHand = skillModList:Flag(cfg, "BaseCritFromMainHand")
if baseCritFromMainHand then
if actor.itemList["Weapon 1"] and actor.itemList["Weapon 1"].weaponData and actor.itemList["Weapon 1"].weaponData[1] then
baseCrit = actor.weaponData1.CritChance
end
end

if critOverride == 100 then
output.PreEffectiveCritChance = 100
output.CritChance = 100
Expand Down Expand Up @@ -2242,10 +2250,11 @@ function calcs.offence(env, actor, activeSkill)
end
if breakdown and output.CritChance ~= baseCrit then
breakdown.CritChance = { }
local baseCritFromMainHandStr = baseCritFromMainHand and " from main weapon" or ""
if base ~= 0 then
t_insert(breakdown.CritChance, s_format("(%g + %g) ^8(base)", baseCrit, base))
t_insert(breakdown.CritChance, s_format("(%g + %g) ^8(base%s)", baseCrit, base, baseCritFromMainHandStr))
else
t_insert(breakdown.CritChance, s_format("%g ^8(base)", baseCrit + base))
t_insert(breakdown.CritChance, s_format("%g ^8(base%s)", baseCrit + base, baseCritFromMainHandStr))
end
if inc ~= 0 then
t_insert(breakdown.CritChance, s_format("x %.2f", 1 + inc/100).." ^8(increased/reduced)")
Expand Down
1 change: 1 addition & 0 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3668,6 +3668,7 @@ local specialModList = {
["when you lose temporal chains you gain maximum rage"] = { flag("Condition:CanGainRage") },
["your critical strike multiplier is (%d+)%%"] = function(num) return { mod("CritMultiplier", "OVERRIDE", num) } end,
["base critical strike chance for attacks with weapons is ([%d%.]+)%%"] = function(num) return { mod("WeaponBaseCritChance", "OVERRIDE", num) } end,
["base critical strike chance of spells is the critical strike chance of your main hand weapon"] = { flag("BaseCritFromMainHand", nil, ModFlag.Spell) },
["critical strike chance is (%d+)%% for hits with this weapon"] = function(num) return { mod("CritChance", "OVERRIDE", num, nil, ModFlag.Hit, { type = "Condition", var = "{Hand}Attack" }, { type = "SkillType", skillType = SkillType.Attack }) } end,
["maximum critical strike chance is (%d+)%%"] = function(num) return {
mod("CritChanceCap", "OVERRIDE", num),
Expand Down