Skip to content

Commit

Permalink
Fixed dissolution of the flesh changing maximum hit pools (#6791)
Browse files Browse the repository at this point in the history
* Added dissolution of the flesh mod

Added a flag to the modifier on dissolution of the flesh to change recoverable life to full life pool rather than just unreserved life.

* Covered dissolution of the flesh edge case

Added a new stat "Uncancellable_<pool>Reservation" this holds the percent of a given pool that cannot be unreserved for example by blood sacrament skill or midnight bargain item.

* Add config to disable Blood Sacrament reservation mod

---------

Co-authored-by: LocalIdentity <[email protected]>
  • Loading branch information
ProFrenchToast and LocalIdentity authored Dec 6, 2023
1 parent c2ef3c3 commit d66a1e4
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Data/ModCache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3482,8 +3482,7 @@ c["20% increased Mana Regeneration Rate"]={{[1]={flags=0,keywordFlags=0,name="Ma
c["20% increased Mana Reservation Efficiency of Curse Aura Skills"]={{[1]={[1]={skillType=43,type="SkillType"},flags=0,keywordFlags=2,name="ManaReservationEfficiency",type="INC",value=20}},nil}
c["20% increased Mana Reservation Efficiency of Herald Skills"]={{[1]={[1]={skillType=62,type="SkillType"},flags=0,keywordFlags=0,name="ManaReservationEfficiency",type="INC",value=20}},nil}
c["20% increased Mana Reservation Efficiency of Skills"]={{[1]={flags=0,keywordFlags=0,name="ManaReservationEfficiency",type="INC",value=20}},nil}
c["20% increased Maximum Energy Shield if both Equipped Rings have an Explicit Evasion Modifier"]={{[1]={flags=0,keywordFlags=0,name="EnergyShield",type="INC",value=20}}," if both Equipped Rings have an Explicit Evasion Modifier "}
c["20% increased Maximum Energy Shield if both Equipped Rings have an Explicit Evasion Modifier 40% increased Energy Shield Recharge Rate if Equipped Amulet has an Explicit Evasion Modifier"]={{[1]={[1]={itemSlot="amulet",searchCond="explicit evasion",type="ItemCondition"},flags=0,keywordFlags=0,name="EnergyShield",type="INC",value=20}}," if both Equipped Rings have an Explicit Evasion Modifier 40% increased Energy Shield Recharge Rate "}
c["20% increased Maximum Energy Shield if both Equipped Rings have an Explicit Evasion Modifier"]={{[1]={[1]={bothSlots=true,itemSlot="ring",searchCond="explicit evasion",type="ItemCondition"},flags=0,keywordFlags=0,name="EnergyShield",type="INC",value=20}},nil}
c["20% increased Maximum total Life Recovery per second from Leech"]={{[1]={flags=0,keywordFlags=0,name="MaxLifeLeechRate",type="INC",value=20}},nil}
c["20% increased Melee Critical Strike Chance"]={{[1]={flags=256,keywordFlags=0,name="CritChance",type="INC",value=20}},nil}
c["20% increased Melee Damage"]={{[1]={flags=256,keywordFlags=0,name="Damage",type="INC",value=20}},nil}
Expand Down Expand Up @@ -8527,8 +8526,7 @@ c["Life Recovery from Regeneration is not applied"]={{[1]={flags=0,keywordFlags=
c["Life Regeneration is applied to Energy Shield instead"]={{[1]={flags=0,keywordFlags=0,name="ZealotsOath",type="FLAG",value=true}},nil}
c["Life and Mana Leech are instant during effect"]={{[1]={[1]={type="Condition",var="UsingFlask"},flags=0,keywordFlags=0,name="InstantLifeLeech",type="BASE",value=100},[2]={[1]={type="Condition",var="UsingFlask"},flags=0,keywordFlags=0,name="InstantManaLeech",type="BASE",value=100}},nil}
c["Life and Mana Leech from Critical Strikes are instant"]={{[1]={[1]={type="Condition",var="CriticalStrike"},flags=0,keywordFlags=0,name="InstantLifeLeech",type="BASE",value=100},[2]={[1]={type="Condition",var="CriticalStrike"},flags=0,keywordFlags=0,name="InstantManaLeech",type="BASE",value=100}},nil}
c["Life that would be lost by taking Damage is instead Reserved"]={nil,"Life that would be lost by taking Damage is instead Reserved "}
c["Life that would be lost by taking Damage is instead Reserved until you take no Damage to Life for 2 seconds"]={nil,"Life that would be lost by taking Damage is instead Reserved until you take no Damage to Life for 2 seconds "}
c["Life that would be lost by taking Damage is instead Reserved"]={{[1]={flags=0,keywordFlags=0,name="DamageInsteadReservesLife",type="FLAG",value=true}},nil}
c["Light Radius is based on Energy Shield instead of Life"]={nil,"Light Radius is based on Energy Shield instead of Life "}
c["Lightning Damage from Enemies Hitting you is Lucky"]={nil,"Lightning Damage from Enemies Hitting you is Lucky "}
c["Lightning Damage from Enemies Hitting you is Lucky Nearby Allies' Damage with Hits is Lucky"]={nil,"Lightning Damage from Enemies Hitting you is Lucky Nearby Allies' Damage with Hits is Lucky "}
Expand Down
1 change: 1 addition & 0 deletions src/Data/Skills/other.lua
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ skills["BloodSacramentUnique"] = {
baseMods = {
skill("radius", 5),
mod("Multiplier:BloodSacramentMaxStages", "BASE", 33),
flag("HasUncancellableReservation", { type = "Condition", var = "BloodSacramentReservationeHP" }),
},
constantStats = {
{ "flameblast_hundred_times_radius_+_per_1%_life_reserved", 30 },
Expand Down
1 change: 1 addition & 0 deletions src/Export/Skills/other.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ local skills, mod, flag, skill = ...
#skill BloodSacramentUnique
#baseMod skill("radius", 5)
#baseMod mod("Multiplier:BloodSacramentMaxStages", "BASE", 33)
#baseMod flag("HasUncancellableReservation", { type = "Condition", var = "BloodSacramentReservationeHP" })
#flags spell area
fromItem = true,
initialFunc = function(activeSkill, output)
Expand Down
5 changes: 5 additions & 0 deletions src/Modules/CalcDefence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1822,6 +1822,11 @@ function calcs.buildDefenceEstimations(env, actor)
output.CappingLife = true
end
end

-- Dissolution of the flesh life pool change
if modDB:Flag(nil, "DamageInsteadReservesLife") then
output.LifeRecoverable = (output.LifeCancellableReservation / 100) * output.Life
end

-- Prevented life loss taken over 4 seconds (and Petrified Blood)
do
Expand Down
8 changes: 8 additions & 0 deletions src/Modules/CalcPerform.lua
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,13 @@ local function doActorLifeManaReservation(actor)
if max > 0 then
local lowPerc = modDB:Sum("BASE", nil, "Low" .. pool .. "Percentage")
reserved = (actor["reserved_"..pool.."Base"] or 0) + m_ceil(max * (actor["reserved_"..pool.."Percent"] or 0) / 100)
uncancellableReservation = actor["uncancellable_"..pool.."Reservation"] or 0
output[pool.."Reserved"] = m_min(reserved, max)
output[pool.."ReservedPercent"] = m_min(reserved / max * 100, 100)
output[pool.."Unreserved"] = max - reserved
output[pool.."UnreservedPercent"] = (max - reserved) / max * 100
output[pool.."UncancellableReservation"] = m_min(uncancellableReservation, 0)
output[pool.."CancellableReservation"] = 100 - uncancellableReservation
if (max - reserved) / max <= (lowPerc > 0 and lowPerc or data.misc.LowPoolThreshold) then
condList["Low"..pool] = true
end
Expand Down Expand Up @@ -1488,6 +1491,8 @@ function calcs.perform(env, fullDPSSkipEHP)
env.player.reserved_LifePercent = modDB:Sum("BASE", nil, "ExtraLifeReserved")
env.player.reserved_ManaBase = 0
env.player.reserved_ManaPercent = 0
env.player.uncancellable_LifeReservation = modDB:Sum("BASE", nil, "ExtraLifeReserved")
env.player.uncancellable_ManaReservation = modDB:Sum("BASE", nil, "ExtraManaReserved")
if breakdown then
breakdown.LifeReserved = { reservations = { } }
breakdown.ManaReserved = { reservations = { } }
Expand Down Expand Up @@ -1582,6 +1587,9 @@ function calcs.perform(env, fullDPSSkipEHP)
})
end
end
if skillModList:Flag(skillCfg, "HasUncancellableReservation") then
env.player["uncancellable_"..name.."Reservation"] = env.player["uncancellable_"..name.."Reservation"] + values.reservedPercent
end
end
end
end
Expand Down
4 changes: 4 additions & 0 deletions src/Modules/ConfigOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,10 @@ return {
{ var = "bladestormInSandstorm", type = "check", label = "Are you in a Sandstorm?", ifSkill = "Bladestorm", apply = function(val, modList, enemyModList)
modList:NewMod("Condition:BladestormInSandstorm", "FLAG", true, "Config", { type = "SkillName", skillName = "Bladestorm" })
end },
{ label = "Blood Sacrament:", ifSkill = "Blood Sacrament" },
{ var = "bloodSacramantReservationeHP", type = "check", label = "Count Skill Reservation towards eHP?", ifSkill = "Blood Sacrament", tooltip = "Use this option to disable the skill reservation factoring into eHP calculations",apply = function(val, modList, enemyModList)
modList:NewMod("Condition:BloodSacramentReservationeHP", "FLAG", true, "Config")
end },
{ label = "Trauma:", ifFlag = "HasTrauma" },
{ var = "traumaStacks", type = "count", label = "# of Trauma Stacks:", ifFlag = "HasTrauma", apply = function(val, modList, enemyModList)
modList:NewMod("Multiplier:TraumaStacks", "BASE", val, "Config", { type = "Condition", var = "Combat" })
Expand Down
1 change: 1 addition & 0 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3937,6 +3937,7 @@ local specialModList = {
["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" }) },
["life that would be lost by taking damage is instead reserved"] = { flag("DamageInsteadReservesLife") },
["you have no armour or energy shield"] = {
mod("Armour", "MORE", -100),
mod("EnergyShield", "MORE", -100),
Expand Down

0 comments on commit d66a1e4

Please sign in to comment.