Skip to content

Commit 4260901

Browse files
author
LocalIdentity
committed
Fix while affected by no flasks when using instant flasks
The Screams of the Desiccated belt only grants you the shrine effects when you do not have any active flask effects Mana and Life flasks with instant effects do not ever count as being under the effect of a flask Same with having a utility flask but having the Bloodline for utility flasks are disabled Added support flasks are instant while on low life and made a helper function in CalcPerform as there are 2 different spots where instPerc are used Tested Vaal Pact and the mana flask mod for effect is instant at end of duration and those both disable the shrine The life flask mod for additional recovery over x seconds does not count as being under a flask effect however
1 parent f0ad4a9 commit 4260901

3 files changed

Lines changed: 35 additions & 16 deletions

File tree

src/Classes/Item.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,6 +1568,7 @@ function ItemClass:BuildModListForSlotNum(baseList, slotNum)
15681568
if self.base.flask.life or self.base.flask.mana then
15691569
-- Recovery flask
15701570
flaskData.instantPerc = calcLocal(modList, "FlaskInstantRecovery", "BASE", 0)
1571+
flaskData.instantLowLifePerc = calcLocal(modList, "FlaskLowLifeInstantRecovery", "BASE", 0)
15711572
local recoveryMod = 1 + calcLocal(modList, "FlaskRecovery", "INC", 0) / 100
15721573
local rateMod = 1 + calcLocal(modList, "FlaskRecoveryRate", "INC", 0) / 100
15731574
flaskData.duration = round(self.base.flask.duration * (1 + durationInc / 100) / rateMod * durationMore, 1)

src/Modules/CalcPerform.lua

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,6 +1480,20 @@ function calcs.perform(env, skipEHP)
14801480
end
14811481

14821482
-- Merge flask modifiers
1483+
local function getFlaskInstantRecovery(item)
1484+
local instantPerc = item.flaskData.instantPerc or 0
1485+
if modDB:Flag(nil, "Condition:LowLife") then
1486+
instantPerc = instantPerc + (item.flaskData.instantLowLifePerc or 0)
1487+
end
1488+
if item.base.flask.life then
1489+
instantPerc = instantPerc + modDB:Sum("BASE", nil, "LifeFlaskInstantRecovery")
1490+
end
1491+
if item.base.flask.mana then
1492+
instantPerc = instantPerc + modDB:Sum("BASE", nil, "ManaFlaskInstantRecovery")
1493+
end
1494+
return m_min(100, instantPerc)
1495+
end
1496+
14831497
local function calcFlaskRecovery(type, item)
14841498
local out = {}
14851499
local lType = type:lower()
@@ -1491,7 +1505,7 @@ function calcs.perform(env, skipEHP)
14911505
local name = item.name
14921506
local base = item.flaskData[lType.."Base"]
14931507
local dur = item.flaskData.duration
1494-
local instPerc = item.flaskData.instantPerc
1508+
local instPerc = getFlaskInstantRecovery(item)
14951509
local flaskRecInc = modDB:Sum("INC", nil, "Flask"..type.."Recovery")
14961510
local flaskRecMore = modDB:More(nil, "Flask"..type.."Recovery")
14971511
local flaskRateInc = modDB:Sum("INC", nil, "Flask"..type.."RecoveryRate")
@@ -1596,19 +1610,22 @@ function calcs.perform(env, skipEHP)
15961610
for item in pairs(flasks) do
15971611
flaskBuffsPerBase[item.baseName] = flaskBuffsPerBase[item.baseName] or {}
15981612
flaskBuffsPerBaseNonPlayer[item.baseName] = flaskBuffsPerBaseNonPlayer[item.baseName] or {}
1599-
flaskConditions["UsingFlask"] = true
1600-
flaskConditionsNonUtility["UsingFlask"] = true
1601-
flaskConditions["Using"..item.baseName:gsub("%s+", "")] = true
1602-
if item.base.flask.life or item.base.flask.mana then
1603-
flaskConditionsNonUtility["Using"..item.baseName:gsub("%s+", "")] = true
1604-
end
1605-
if item.base.flask.life and not modDB:Flag(nil, "CannotRecoverLifeOutsideLeech") then
1606-
flaskConditions["UsingLifeFlask"] = true
1607-
flaskConditionsNonUtility["UsingLifeFlask"] = true
1608-
end
1609-
if item.base.flask.mana then
1610-
flaskConditions["UsingManaFlask"] = true
1611-
flaskConditionsNonUtility["UsingManaFlask"] = true
1613+
local instantPerc = getFlaskInstantRecovery(item)
1614+
if instantPerc < 100 then
1615+
flaskConditions["UsingFlask"] = true
1616+
flaskConditions["Using"..item.baseName:gsub("%s+", "")] = true
1617+
if item.base.flask.life or item.base.flask.mana then
1618+
flaskConditionsNonUtility["UsingFlask"] = true
1619+
flaskConditionsNonUtility["Using"..item.baseName:gsub("%s+", "")] = true
1620+
end
1621+
if item.base.flask.life and not modDB:Flag(nil, "CannotRecoverLifeOutsideLeech") then
1622+
flaskConditions["UsingLifeFlask"] = true
1623+
flaskConditionsNonUtility["UsingLifeFlask"] = true
1624+
end
1625+
if item.base.flask.mana then
1626+
flaskConditions["UsingManaFlask"] = true
1627+
flaskConditionsNonUtility["UsingManaFlask"] = true
1628+
end
16121629
end
16131630

16141631
if onlyRecovery then

src/Modules/ModParser.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2993,10 +2993,11 @@ local specialModList = {
29932993
mod("InstantManaLeech", "BASE", num, nil, ModFlag.Hit, { type = "Condition", var = "{Hand}Attack" }, { type = "SkillType", skillType = SkillType.Attack }, { type = "Multiplier", var = "EnemyPower"}),
29942994
mod("InstantEnergyShieldLeech", "BASE", num, nil, ModFlag.Hit, { type = "Condition", var = "{Hand}Attack" }, { type = "SkillType", skillType = SkillType.Attack }, { type = "Multiplier", var = "EnemyPower"}),
29952995
} end,
2996-
["instant recovery"] = { mod("FlaskInstantRecovery", "BASE", 100) },
2996+
["instant recovery"] = { mod("FlaskInstantRecovery", "BASE", 100) },
2997+
["(%d+)%% of recovery applied instantly"] = function(num) return { mod("FlaskInstantRecovery", "BASE", num) } end,
2998+
["instant recovery when on low life"] = { mod("FlaskLowLifeInstantRecovery", "BASE", 100), mod("Dummy", "DUMMY", 1, "", { type = "Condition", var = "LowLife" }) },
29972999
["life flasks used while on low life apply recovery instantly"] = { mod("LifeFlaskInstantRecovery", "BASE", 100, { type = "Condition", var = "LowLife" }) },
29983000
["mana flasks used while on low mana apply recovery instantly"] = { mod("ManaFlaskInstantRecovery", "BASE", 100, { type = "Condition", var = "LowMana" }) },
2999-
["(%d+)%% of recovery applied instantly"] = function(num) return { mod("FlaskInstantRecovery", "BASE", num) } end,
30003001
["has no attribute requirements"] = { flag("NoAttributeRequirements") },
30013002
["trigger a socketed spell when you attack with this weapon"] = { mod("ExtraSupport", "LIST", { skillId = "SupportTriggerSpellOnAttack", level = 1 }, { type = "SocketedIn", slotName = "{SlotName}" }) },
30023003
["trigger a socketed spell when you attack with this weapon, with a ([%d%.]+) second cooldown"] = { mod("ExtraSupport", "LIST", { skillId = "SupportTriggerSpellOnAttack", level = 1 }, { type = "SocketedIn", slotName = "{SlotName}" }) },

0 commit comments

Comments
 (0)