Skip to content

Instantly share code, notes, and snippets.

@zmike
Created March 6, 2019 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zmike/6b1374b0245824bca3f4cf961d0c5538 to your computer and use it in GitHub Desktop.
Save zmike/6b1374b0245824bca3f4cf961d0c5538 to your computer and use it in GitHub Desktop.
wip on consecrated ground changes
diff --git a/Modules/CalcOffence-3_0.lua b/Modules/CalcOffence-3_0.lua
index 80dfc15..b6bc675 100644
--- a/Modules/CalcOffence-3_0.lua
+++ b/Modules/CalcOffence-3_0.lua
@@ -780,6 +780,7 @@ function calcs.offence(env, actor, activeSkill)
local inc = skillModList:Sum("INC", cfg, "CritChance")
local more = skillModList:More(cfg, "CritChance")
local enemyExtra = env.mode_effective and enemyDB:Sum("BASE", nil, "SelfExtraCritChance") or 0
+ local enemyInc = skillModList:Sum("INC", cfg, "SelfIncCritChance")
output.CritChance = (baseCrit + base) * (1 + inc / 100) * more
local preCapCritChance = output.CritChance
output.CritChance = m_min(output.CritChance, 95)
@@ -794,6 +795,10 @@ function calcs.offence(env, actor, activeSkill)
if env.mode_effective and skillModList:Flag(cfg, "CritChanceLucky") then
output.CritChance = (1 - (1 - output.CritChance / 100) ^ 2) * 100
end
+ local preEnemyIncCritChance = output.CritChance
+ if enemyInc ~= 0 then
+ output.CritChance = output.CritChance * (1 + enemyInc / 100)
+ end
local preHitCheckCritChance = output.CritChance
if env.mode_effective then
output.CritChance = output.CritChance * output.HitChance / 100
@@ -823,7 +828,12 @@ function calcs.offence(env, actor, activeSkill)
if env.mode_effective and skillModList:Flag(cfg, "CritChanceLucky") then
t_insert(breakdown.CritChance, "Crit Chance is Lucky:")
t_insert(breakdown.CritChance, s_format("1 - (1 - %.4f) x (1 - %.4f)", preLuckyCritChance / 100, preLuckyCritChance / 100))
- t_insert(breakdown.CritChance, s_format("= %.2f%%", preHitCheckCritChance))
+ t_insert(breakdown.CritChance, s_format("= %.2f%%", preEnemyIncCritChance))
+ end
+ if enemyInc ~= 0 then
+ t_insert(breakdown.CritChance, "Enemy has increased chance to be Crit:")
+ t_insert(breakdown.CritChance, s_format("+ %g ^8(increased chance for enemy to be crit)", enemyInc))
+ t_insert(breakdown.CritChance, s_format("= %.2f%% ^8(chance to crit against enemy)", preHitCheckCritChance))
end
if env.mode_effective and output.HitChance < 100 then
t_insert(breakdown.CritChance, "Crit confirmation roll:")
diff --git a/Modules/CalcSections-3_0.lua b/Modules/CalcSections-3_0.lua
index 6067387..28a20ba 100644
--- a/Modules/CalcSections-3_0.lua
+++ b/Modules/CalcSections-3_0.lua
@@ -357,6 +357,7 @@ return {
{ breakdown = "CritChance" },
{ label = "Player modifiers", modName = "CritChance", cfg = "skill" },
{ label = "Enemy modifiers", modName = "SelfExtraCritChance", enemy = true },
+ { label = "Enemy increase modifiers", modName = "SelfIncCritChance", enemy = true },
}, },
{ label = "Crit Multiplier", notFlag = "attack", { format = "x {2:output:CritMultiplier}",
{ breakdown = "CritMultiplier" },
diff --git a/Modules/CalcSetup.lua b/Modules/CalcSetup.lua
index 3948395..6af59d1 100644
--- a/Modules/CalcSetup.lua
+++ b/Modules/CalcSetup.lua
@@ -42,6 +42,7 @@ function calcs.initModDB(env, modDB)
modDB:NewMod("TotemPlacementTime", "BASE", 0.6, "Base")
modDB:NewMod("ActiveTotemLimit", "BASE", 1, "Base")
modDB:NewMod("LifeRegenPercent", "BASE", 6, "Base", { type = "Condition", var = "OnConsecratedGround" })
+ modDB:NewMod("SelfIncCritChance", "INC", 100.0, "Base", { type = "Condition", var = "OnConsecratedGround" })
modDB:NewMod("DamageTaken", "INC", 50, "Base", { type = "Condition", var = "Shocked" })
modDB:NewMod("HitChance", "MORE", -50, "Base", { type = "Condition", var = "Blinded" })
modDB:NewMod("MovementSpeed", "INC", -30, "Base", { type = "Condition", var = "Maimed" })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment