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

[3.25] Vaal Pact implementation #7732

Merged
merged 3 commits into from
Jul 21, 2024
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
23 changes: 13 additions & 10 deletions src/Modules/CalcDefence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -989,14 +989,12 @@ function calcs.defence(env, actor)
"Total: "..output.SpellDodgeChance+output.SpellDodgeChanceOverCap.."%",
}
end

-- Gain on Block
output.LifeOnBlock = modDB:Sum("BASE", nil, "LifeOnBlock")
output.ManaOnBlock = modDB:Sum("BASE", nil, "ManaOnBlock")
output.EnergyShieldOnBlock = modDB:Sum("BASE", nil, "EnergyShieldOnBlock")

-- Recovery modifiers
output.LifeRecoveryRateMod = calcLib.mod(modDB, nil, "LifeRecoveryRate")
output.LifeRecoveryRateMod = 1
if not modDB:Flag(nil, "CannotRecoverLifeOutsideLeech") then
output.LifeRecoveryRateMod = calcLib.mod(modDB, nil, "LifeRecoveryRate")
end
output.ManaRecoveryRateMod = calcLib.mod(modDB, nil, "ManaRecoveryRate")
output.EnergyShieldRecoveryRateMod = calcLib.mod(modDB, nil, "EnergyShieldRecoveryRate")

Expand Down Expand Up @@ -1115,7 +1113,7 @@ function calcs.defence(env, actor)
end

-- Energy Shield Recharge
output.EnergyShieldRechargeAppliesToLife = modDB:Flag(nil, "EnergyShieldRechargeAppliesToLife")
output.EnergyShieldRechargeAppliesToLife = modDB:Flag(nil, "EnergyShieldRechargeAppliesToLife") and not modDB:Flag(nil, "CannotRecoverLifeOutsideLeech")
output.EnergyShieldRechargeAppliesToEnergyShield = not (modDB:Flag(nil, "NoEnergyShieldRecharge") or modDB:Flag(nil, "CannotGainEnergyShield") or output.EnergyShieldRechargeAppliesToLife)

if output.EnergyShieldRechargeAppliesToLife or output.EnergyShieldRechargeAppliesToEnergyShield then
Expand Down Expand Up @@ -1272,13 +1270,18 @@ function calcs.defence(env, actor)
end

-- recovery on block, needs to be after primary defences
output.LifeOnBlock = modDB:Sum("BASE", nil, "LifeOnBlock")
output.LifeOnBlock = 0
output.LifeOnSuppress = 0
if not modDB:Flag(nil, "CannotRecoverLifeOutsideLeech") then
output.LifeOnBlock = modDB:Sum("BASE", nil, "LifeOnBlock")
output.LifeOnSuppress = modDB:Sum("BASE", nil, "LifeOnSuppress")
end

output.ManaOnBlock = modDB:Sum("BASE", nil, "ManaOnBlock")

output.EnergyShieldOnBlock = modDB:Sum("BASE", nil, "EnergyShieldOnBlock")
output.EnergyShieldOnSpellBlock = modDB:Sum("BASE", nil, "EnergyShieldOnSpellBlock")

output.EnergyShieldOnSuppress = modDB:Sum("BASE", nil, "EnergyShieldOnSuppress")
output.LifeOnSuppress = modDB:Sum("BASE", nil, "LifeOnSuppress")

-- damage avoidances
output.specificTypeAvoidance = false
Expand Down
4 changes: 2 additions & 2 deletions src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3219,7 +3219,7 @@ function calcs.offence(env, actor, activeSkill)
output.EnergyShieldOnHit = 0
output.ManaOnHit = 0
else
output.LifeOnHit = not skillModList:Flag(cfg, "CannotGainLife") and (skillModList:Sum("BASE", cfg, "LifeOnHit") + enemyDB:Sum("BASE", cfg, "SelfLifeOnHit")) or 0
output.LifeOnHit = not skillModList:Flag(cfg, "CannotGainLife") and not skillModList:Flag(cfg, "CannotRecoverLifeOutsideLeech") and (skillModList:Sum("BASE", cfg, "LifeOnHit") + enemyDB:Sum("BASE", cfg, "SelfLifeOnHit")) or 0
output.EnergyShieldOnHit = not skillModList:Flag(cfg, "CannotGainEnergyShield") and (skillModList:Sum("BASE", cfg, "EnergyShieldOnHit") + enemyDB:Sum("BASE", cfg, "SelfEnergyShieldOnHit")) or 0
output.ManaOnHit = not skillModList:Flag(cfg, "CannotGainMana") and (skillModList:Sum("BASE", cfg, "ManaOnHit") + enemyDB:Sum("BASE", cfg, "SelfManaOnHit")) or 0
end
Expand All @@ -3233,7 +3233,7 @@ function calcs.offence(env, actor, activeSkill)
output.EnergyShieldOnKill = 0
output.ManaOnKill = 0
else
output.LifeOnKill = not skillModList:Flag(cfg, "CannotGainLife") and (m_floor(skillModList:Sum("BASE", cfg, "LifeOnKill"))) or 0
output.LifeOnKill = not skillModList:Flag(cfg, "CannotGainLife") and not skillModList:Flag(cfg, "CannotRecoverLifeOutsideLeech") and (m_floor(skillModList:Sum("BASE", cfg, "LifeOnKill"))) or 0
output.EnergyShieldOnKill = not skillModList:Flag(cfg, "CannotGainEnergyShield") and (m_floor(skillModList:Sum("BASE", cfg, "EnergyShieldOnKill"))) or 0
output.ManaOnKill = not skillModList:Flag(cfg, "CannotGainMana") and (m_floor(skillModList:Sum("BASE", cfg, "ManaOnKill"))) or 0
end
Expand Down
4 changes: 2 additions & 2 deletions src/Modules/CalcPerform.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1442,15 +1442,15 @@ function calcs.perform(env, skipEHP)
flaskBuffsPerBaseNonPlayer[item.baseName] = flaskBuffsPerBaseNonPlayer[item.baseName] or {}
flaskConditions["UsingFlask"] = true
flaskConditions["Using"..item.baseName:gsub("%s+", "")] = true
if item.base.flask.life then
if item.base.flask.life and not modDB:Flag(nil, "CannotRecoverLifeOutsideLeech") then
flaskConditions["UsingLifeFlask"] = true
end
if item.base.flask.mana then
flaskConditions["UsingManaFlask"] = true
end

if onlyRecovery then
if item.base.flask.life then
if item.base.flask.life and not modDB:Flag(nil, "CannotRecoverLifeOutsideLeech") then
calcFlaskMods(item, "LifeFlask", calcFlaskRecovery("Life", item), {})
end
if item.base.flask.mana then
Expand Down
5 changes: 5 additions & 0 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2658,6 +2658,7 @@ local specialModList = {
["attacks with this weapon deal double damage to chilled enemies"] = { mod("DoubleDamageChance", "BASE", 100, nil, ModFlag.Hit, { type = "Condition", var = "{Hand}Attack" }, { type = "SkillType", skillType = SkillType.Attack }, { type = "ActorCondition", actor = "enemy", var = "Chilled" }) },
["life leech from hits with this weapon applies instantly"] = { mod("InstantLifeLeech", "BASE", 100, { type = "Condition", var = "{Hand}Attack" }) },
["life leech from hits with this weapon is instant"] = { mod("InstantLifeLeech", "BASE", 100, { type = "Condition", var = "{Hand}Attack" }) },
["life leech from melee damage is instant"] = { mod("InstantLifeLeech", "BASE", 100, nil, ModFlag.Melee) },
["gain life from leech instantly from hits with this weapon"] = { mod("InstantLifeLeech", "BASE", 100, { type = "Condition", var = "{Hand}Attack" }, { type = "SkillType", skillType = SkillType.Attack }) },
["(%d+)%% of leech from hits with this weapon is instant per enemy power"] = function(num) return { mod("InstantLifeLeech", "BASE", num, nil, ModFlag.Hit, { type = "Condition", var = "{Hand}Attack" }, { type = "SkillType", skillType = SkillType.Attack }, { type = "Multiplier", var = "EnemyPower"}) } end,
["instant recovery"] = { mod("FlaskInstantRecovery", "BASE", 100) },
Expand Down Expand Up @@ -4018,6 +4019,10 @@ local specialModList = {
["cannot gain energy shield"] = { flag("CannotGainEnergyShield") },
["cannot gain life"] = { flag("CannotGainLife") },
["cannot gain mana"] = { flag("CannotGainMana") },
["cannot recover life other than from leech"] = {
flag("CannotRecoverLifeOutsideLeech"),
flag("NoLifeRegen"),
},
["cannot gain energy shield during f?l?a?s?k? ?effect"] = { flag("CannotGainEnergyShield", { type = "Condition", var = "UsingFlask" }) },
["cannot gain life during f?l?a?s?k? ?effect"] = { flag("CannotGainLife", { type = "Condition", var = "UsingFlask" }) },
["cannot gain mana during f?l?a?s?k? ?effect"] = { flag("CannotGainMana", { type = "Condition", var = "UsingFlask" }) },
Expand Down
Loading