Skip to content

Commit

Permalink
fix merge issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Regisle committed Jul 22, 2024
1 parent fb55e26 commit 03d4a0c
Showing 1 changed file with 20 additions and 37 deletions.
57 changes: 20 additions & 37 deletions src/Modules/CalcDefence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2488,50 +2488,33 @@ function calcs.buildDefenceEstimations(env, actor)
end


do
local DamageIn = { }
local BlockChance = output.EffectiveBlockChance / 100
if damageCategoryConfig ~= "Melee" and damageCategoryConfig ~= "Untyped" then
BlockChance = output["Effective"..damageCategoryConfig.."BlockChance"] / 100
end
local blockEffect = (1 - BlockChance * output.BlockEffect / 100)
local suppressChance = 0
local suppressionEffect = 1
local ExtraAvoidChance = 0
local averageAvoidChance = 0
if not env.configInput.DisableEHPGainOnBlock then
DamageIn.LifeWhenHit = output.LifeOnBlock * BlockChance
DamageIn.ManaWhenHit = output.ManaOnBlock * BlockChance
DamageIn.EnergyShieldWhenHit = output.EnergyShieldOnBlock * BlockChance
if damageCategoryConfig == "Spell" or damageCategoryConfig == "SpellProjectile" then
DamageIn.EnergyShieldWhenHit = DamageIn.EnergyShieldWhenHit + output.EnergyShieldOnSpellBlock * BlockChance
elseif damageCategoryConfig == "Average" then
DamageIn.EnergyShieldWhenHit = DamageIn.EnergyShieldWhenHit + output.EnergyShieldOnSpellBlock / 2 * BlockChance
end
end
-- suppression
if damageCategoryConfig == "Spell" or damageCategoryConfig == "SpellProjectile" or damageCategoryConfig == "Average" then
suppressChance = output.EffectiveSpellSuppressionChance / 100
end
-- We include suppression in damage reduction if it is 100% otherwise we handle it here.
if suppressChance < 1 then
if damageCategoryConfig == "Average" then
suppressChance = suppressChance / 2
do
local DamageIn = { }
local BlockChance = output.EffectiveBlockChance / 100
if damageCategoryConfig ~= "Melee" and damageCategoryConfig ~= "Untyped" then
BlockChance = output["Effective"..damageCategoryConfig.."BlockChance"] / 100
end
local blockEffect = (1 - BlockChance * output.BlockEffect / 100)
local suppressChance = 0
local suppressionEffect = 1
local ExtraAvoidChance = 0
local averageAvoidChance = 0
if not env.configInput.DisableEHPGainOnBlock then
DamageIn.LifeWhenHit = output.LifeOnBlock * BlockChance
DamageIn.ManaWhenHit = output.ManaOnBlock * BlockChance
DamageIn.EnergyShieldWhenHit = output.EnergyShieldOnBlock * BlockChance
if damageCategoryConfig == "Spell" or damageCategoryConfig == "SpellProjectile" then
DamageIn.EnergyShieldWhenHit = DamageIn.EnergyShieldWhenHit + output.EnergyShieldOnSpellBlock * BlockChance
elseif damageCategoryConfig == "Average" then
DamageIn.EnergyShieldWhenHit = DamageIn.EnergyShieldWhenHit + output.EnergyShieldOnSpellBlock / 2 * BlockChance
end
end
-- suppression
if damageCategoryConfig == "Spell" or damageCategoryConfig == "SpellProjectile" or damageCategoryConfig == "Average" then
suppressChance = output.EffectiveSpellSuppressionChance / 100
end
-- We include suppression in damage reduction if it is 100% otherwise we handle it here.
if suppressChance < 1 then
-- unlucky config to lower the value of block, dodge, evade etc for ehp
local worstOf = env.configInput.EHPUnluckyWorstOf or 1
if worstOf > 1 then
suppressChance = suppressChance * suppressChance
if worstOf == 4 then
suppressChance = suppressChance * suppressChance
end
end
if damageCategoryConfig == "Average" then
suppressChance = suppressChance / 2
end
Expand Down

0 comments on commit 03d4a0c

Please sign in to comment.