Merge pull request #2082 from Nostrademous/ScorchedGround

Scorched Ground Support
This commit is contained in:
Trevor Lund
2021-02-06 14:57:25 -06:00
committed by GitHub
5 changed files with 31 additions and 4 deletions

View File

@@ -3220,7 +3220,7 @@ function calcs.offence(env, actor, activeSkill)
end
end
end
if (output.ScorchChanceOnHit + output.ScorchChanceOnCrit) > 0 then
if (output.ScorchChanceOnHit + output.ScorchChanceOnCrit) > 0 or enemyDB:Flag(nil, "Condition:AlreadyScorched") then
local sourceHitDmg = 0
local sourceCritDmg = 0
if output.ScorchChanceOnCrit == 0 and output.ScorchChanceOnHit > 0 then
@@ -3235,7 +3235,7 @@ function calcs.offence(env, actor, activeSkill)
output.ScorchChanceOnHit = 0
end
local baseVal = calcAilmentDamage("Scorch", sourceHitDmg, sourceCritDmg)
if baseVal > 0 then
if baseVal > 0 or enemyDB:Flag(nil, "Condition:AlreadyScorched") then
skillFlags.scorch = true
output.ScorchEffectMod = skillModList:Sum("INC", cfg, "EnemyScorchEffect")
output.ScorchDurationMod = 1 + skillModList:Sum("INC", cfg, "EnemyScorchDuration") / 100 + enemyDB:Sum("INC", nil, "SelfScorchDuration") / 100

View File

@@ -736,7 +736,7 @@ function calcs.perform(env)
end
output.BonechillEffect = m_max(output.BonechillEffect or 0, modDB:Override(nil, "BonechillEffect") or output.BonechillDotEffect or 0)
end
if (activeSkill.activeEffect.grantedEffect.name == "Vaal Lightning Trap" or activeSkill.activeEffect.grantedEffect.name == "Shock Ground") then
if (activeSkill.activeEffect.grantedEffect.name == "Vaal Lightning Trap" or activeSkill.activeEffect.grantedEffect.name == "Shock Ground") then
modDB:NewMod("ShockOverride", "BASE", activeSkill.skillModList:Sum("BASE", nil, "ShockedGroundEffect"), "Shocked Ground", { type = "ActorCondition", actor = "enemy", var = "OnShockedGround" } )
end
if activeSkill.activeEffect.grantedEffect.name == "Summon Skitterbots" then
@@ -1612,7 +1612,6 @@ function calcs.perform(env)
-- Calculates maximum Shock, then applies the strongest Shock effect to the enemy
if (enemyDB:Sum("BASE", nil, "ShockVal") > 0 or modDB:Sum(nil, "ShockBase", "ShockOverride")) and not enemyDB:Flag(nil, "Condition:AlreadyShocked") then
local baseShock = (modDB:Override(nil, "ShockBase") or 0) * (1 + modDB:Sum("INC", nil, "EnemyShockEffect") / 100)
local overrideShock = 0
for i, value in ipairs(modDB:Tabulate("BASE", { }, "ShockBase", "ShockOverride")) do
local mod = value.mod
@@ -1633,6 +1632,28 @@ function calcs.perform(env)
enemyDB:NewMod("Condition:AlreadyShocked", "FLAG", true, { type = "Condition", var = "Shocked"} ) -- Prevents Shock from applying doubly for minions
end
-- Calculates maximum Scorch, then applies the strongest Scorch effect to the enemy
if (enemyDB:Sum("BASE", nil, "ScorchVal") > 0 or modDB:Sum(nil, "ScorchBase", "ScorchOverride")) and not enemyDB:Flag(nil, "Condition:AlreadyScorched") then
local overrideScorch = 0
for i, value in ipairs(modDB:Tabulate("BASE", { }, "ScorchBase", "ScorchOverride")) do
local mod = value.mod
local inc = 1 + modDB:Sum("INC", nil, "EnemyScorchEffect") / 100
local effect = mod.value
if mod.name == "ScorchOverride" then
enemyDB:NewMod("Condition:Scorched", "FLAG", true, mod.source)
end
if mod.name == "ScorchBase" then
effect = effect * inc
modDB:NewMod("ScorchOverride", "BASE", effect, mod.source, mod.flags, mod.keywordFlags, unpack(mod))
end
overrideScorch = m_max(overrideScorch or 0, effect or 0)
end
output.MaximumScorch = modDB:Override(nil, "ScorchMax") or 50
output.CurrentScorch = m_floor(m_min(m_max(overrideScorch, enemyDB:Sum("BASE", nil, "ScorchVal")), output.MaximumScorch))
enemyDB:NewMod("ElementalResist", "BASE", -m_floor(output.CurrentScorch), "Scorch", { type = "Condition", var = "Scorched"} )
enemyDB:NewMod("Condition:AlreadyScorched", "FLAG", true, { type = "Condition", var = "Scorched"} ) -- Prevents Scorch from applying doubly for minions
end
-- Check for extra auras
for _, value in ipairs(modDB:List(nil, "ExtraAura")) do
local modList = { value.mod }

View File

@@ -921,6 +921,7 @@ return {
{ breakdown = "ScorchChance" },
{ label = "Player modifiers", modName = "EnemyScorchChance", cfg = "skill" },
{ label = "Enemy modifiers", modName = "SelfScorchChance", enemy = true },
{ label = "Guaranteed Scorches", modName = "ScorchOverride", modType = "BASE" },
}, },
{ label = "Scorch Dur. Mod", haveOutput = "ScorchDurationMod", flag = "scorch", { format = "x {2:output:ScorchDurationMod}",
{ label = "Player modifiers", modName = "EnemyScorchDuration", cfg = "skill" },

View File

@@ -1082,6 +1082,10 @@ return {
{ var = "conditionScorchedEffect", type = "count", label = "Effect of Scorched:", ifOption = "conditionEnemyScorched", tooltip = "This effect will only be applied while you can inflict Scorched.", apply = function(val, modList, enemyModList)
enemyModList:NewMod("ElementalResist", "BASE", -m_min(val, 30), "Config", { type = "Condition", var = "Scorched" }, { type = "ActorCondition", actor = "enemy", var = "CanInflictScorch" })
end },
{ var = "conditionEnemyOnScorchedGround", type = "check", label = "Is the enemy on Scorched Ground?", tooltip = "This also implies that the enemy is Scorched.", ifEnemyCond = "OnScorchedGround", apply = function(val, modList, enemyModList)
enemyModList:NewMod("Condition:Scorched", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
enemyModList:NewMod("Condition:OnScorchedGround", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
end },
{ var = "conditionEnemyChilled", type = "check", label = "Is the enemy Chilled?", apply = function(val, modList, enemyModList)
enemyModList:NewMod("Condition:Chilled", "FLAG", true, "Config", { type = "Condition", var = "Effective" })
end },

View File

@@ -1964,6 +1964,7 @@ local specialModList = {
mod("EnemyModifier", "LIST", { mod = flag("Condition:Shocked") }, { type = "Condition", var = "Focused" } ),
},
["drops shocked ground while moving, lasting (%d+) seconds"] = { mod("ShockOverride", "BASE", 10, { type = "ActorCondition", actor = "enemy", var = "OnShockedGround"} ) },
["drops scorched ground while moving, lasting (%d+) seconds"] = { mod("ScorchBase", "BASE", 10, { type = "ActorCondition", actor = "enemy", var = "OnScorchedGround"} ) },
-- Bleed
["melee attacks cause bleeding"] = { mod("BleedChance", "BASE", 100, nil, ModFlag.Melee) },
["attacks cause bleeding when hitting cursed enemies"] = { mod("BleedChance", "BASE", 100, nil, ModFlag.Attack, { type = "ActorCondition", actor = "enemy", var = "Cursed" }) },