Skip to content

Commit 7b2da20

Browse files
LocalIdentityLocalIdentity
andauthored
Add support for 8s Recoup and new mods (#54)
Changes the base recoup time to 8 and adds support for some of the new elemental damage recoup mods Doesn't include support for minion recoup, phys damage prevented recoup or recoup speed Co-authored-by: LocalIdentity <[email protected]>
1 parent 3e5bdc2 commit 7b2da20

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

src/Data/ModCache.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ c["15% increased maximum Energy Shield"]={{[1]={[1]={type="Global"},flags=0,keyw
975975
c["15% increased maximum Life"]={{[1]={flags=0,keywordFlags=0,name="Life",type="INC",value=15}},nil}
976976
c["15% more Maximum Life"]={{[1]={flags=0,keywordFlags=0,name="Life",type="MORE",value=15}},nil}
977977
c["15% more Maximum Lightning Damage"]={{[1]={flags=0,keywordFlags=0,name="MaxLightningDamage",type="MORE",value=15}},nil}
978-
c["15% of Elemental Damage taken Recouped as Life"]={{[1]={flags=0,keywordFlags=0,name="ElementalDamageTaken",type="BASE",value=15}}," Recouped as Life "}
978+
c["15% of Elemental Damage taken Recouped as Life"]={{[1]={flags=0,keywordFlags=0,name="LightningLifeRecoup",type="BASE",value=15},[2]={flags=0,keywordFlags=0,name="ColdLifeRecoup",type="BASE",value=15},[3]={flags=0,keywordFlags=0,name="FireLifeRecoup",type="BASE",value=15}},nil}
979979
c["15% of Physical Damage prevented Recouped as Life"]={{[1]={flags=0,keywordFlags=0,name="PhysicalDamage",type="BASE",value=15}}," prevented Recouped as Life "}
980980
c["15% of Physical Damage taken Recouped as Life"]={{[1]={flags=0,keywordFlags=0,name="PhysicalLifeRecoup",type="BASE",value=15}},nil}
981981
c["15% reduced Attack Speed"]={{[1]={flags=1,keywordFlags=0,name="Speed",type="INC",value=-15}},nil}
@@ -1723,7 +1723,7 @@ c["40% less Evasion Rating"]={{[1]={flags=0,keywordFlags=0,name="Evasion",type="
17231723
c["40% less minimum Physical Attack Damage"]={{[1]={[1]={skillType=1,type="SkillType"},flags=0,keywordFlags=0,name="MinPhysicalDamage",type="MORE",value=-40}},nil}
17241724
c["40% more Damage against Heavy Stunned Enemies"]={{[1]={[1]={actor="enemy",type="ActorCondition",var="HeavyStunned"},flags=0,keywordFlags=0,name="Damage",type="MORE",value=40}},nil}
17251725
c["40% more maximum Physical Attack Damage"]={{[1]={[1]={skillType=1,type="SkillType"},flags=0,keywordFlags=0,name="MaxPhysicalDamage",type="MORE",value=40}},nil}
1726-
c["40% of Elemental Damage taken Recouped as Energy Shield"]={{[1]={flags=0,keywordFlags=0,name="ElementalDamageTaken",type="BASE",value=40}}," Recouped as Energy Shield "}
1726+
c["40% of Elemental Damage taken Recouped as Energy Shield"]={{[1]={flags=0,keywordFlags=0,name="LightningEnergyShieldRecoup",type="BASE",value=40},[2]={flags=0,keywordFlags=0,name="ColdEnergyShieldRecoup",type="BASE",value=40},[3]={flags=0,keywordFlags=0,name="FireEnergyShieldRecoup",type="BASE",value=40}},nil}
17271727
c["40% of Physical Damage taken as Fire Damage"]={{[1]={flags=0,keywordFlags=0,name="PhysicalDamageTakenAsFire",type="BASE",value=40}},nil}
17281728
c["40% reduced Chill Duration on you"]={{[1]={flags=0,keywordFlags=0,name="SelfChillDuration",type="INC",value=-40}},nil}
17291729
c["40% reduced Damage"]={{[1]={flags=0,keywordFlags=0,name="Damage",type="INC",value=-40}},nil}
@@ -2870,7 +2870,7 @@ c["Projectiles have 40% increased Critical Damage Bonus against Enemies within 2
28702870
c["Projectiles have 5% chance to Chain an additional time from terrain"]={{[1]={flags=1024,keywordFlags=0,name="TerrainChainChance",type="BASE",value=5}},nil}
28712871
c["Projectiles have 75% chance for an additional Projectile when Forking"]={{[1]={flags=1024,keywordFlags=0,name="ProjectileCount",type="BASE",value=75}}," for an additional when Forking "}
28722872
c["Quarterstaff Skills that consume Power Charges count as consuming an additional Power Charge"]={nil,"Quarterstaff Skills that consume Power Charges count as consuming an additional Power Charge "}
2873-
c["Recoup Effects instead occur over 4 seconds"]={nil,"Recoup Effects instead occur over 4 seconds "}
2873+
c["Recoup Effects instead occur over 4 seconds"]={{[1]={flags=0,keywordFlags=0,name="4SecondRecoup",type="FLAG",value=true}},nil}
28742874
c["Recover 1% of Life on Kill"]={{[1]={[1]={percent=1,stat="Life",type="PercentStat"},flags=0,keywordFlags=0,name="LifeOnKill",type="BASE",value=1}},nil}
28752875
c["Recover 10% of Missing Life before being Hit by an Enemy"]={nil,"Recover 10% of Missing Life before being Hit by an Enemy "}
28762876
c["Recover 2% of Life and Mana when you use a Warcry"]={nil,"Recover 2% of Life and Mana when you use a Warcry "}

src/Modules/CalcDefence.lua

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,10 +1427,10 @@ function calcs.defence(env, actor)
14271427
breakdown[recoupType.."Recoup"] = {
14281428
s_format("%d%% ^8(base)", baseRecoup),
14291429
s_format("* %.2f ^8(recovery rate modifier)", output[recoupType.."RecoveryRateMod"]),
1430-
s_format("= %.1f%% over %d seconds", output[recoupType.."Recoup"], (modDB:Flag(nil, "3Second"..recoupType.."Recoup") or modDB:Flag(nil, "3SecondRecoup")) and 3 or 4)
1430+
s_format("= %.1f%% over %d seconds", output[recoupType.."Recoup"], (modDB:Flag(nil, "4Second"..recoupType.."Recoup") or modDB:Flag(nil, "4SecondRecoup")) and 4 or 8)
14311431
}
14321432
else
1433-
breakdown[recoupType.."Recoup"] = { s_format("%d%% over %d seconds", output[recoupType.."Recoup"], (modDB:Flag(nil, "3Second"..recoupType.."Recoup") or modDB:Flag(nil, "3SecondRecoup")) and 3 or 4) }
1433+
breakdown[recoupType.."Recoup"] = { s_format("%d%% over %d seconds", output[recoupType.."Recoup"], (modDB:Flag(nil, "4Second"..recoupType.."Recoup") or modDB:Flag(nil, "4SecondRecoup")) and 4 or 8) }
14341434
end
14351435
end
14361436
end
@@ -1443,10 +1443,10 @@ function calcs.defence(env, actor)
14431443
breakdown.ElementalEnergyShieldRecoup = {
14441444
s_format("%d%% ^8(base)", ElementalEnergyShieldRecoup),
14451445
s_format("* %.2f ^8(recovery rate modifier)", output.EnergyShieldRecoveryRateMod),
1446-
s_format("= %.1f%% over %d seconds", output.ElementalEnergyShieldRecoup, (modDB:Flag(nil, "3SecondEnergyShieldRecoup") or modDB:Flag(nil, "3SecondRecoup")) and 3 or 4)
1446+
s_format("= %.1f%% over %d seconds", output.ElementalEnergyShieldRecoup, (modDB:Flag(nil, "4SecondEnergyShieldRecoup") or modDB:Flag(nil, "4SecondRecoup")) and 4 or 8)
14471447
}
14481448
else
1449-
breakdown.ElementalEnergyShieldRecoup = { s_format("%d%% over %d seconds", output.ElementalEnergyShieldRecoup, (modDB:Flag(nil, "3SecondEnergyShieldRecoup") or modDB:Flag(nil, "3SecondRecoup")) and 3 or 4) }
1449+
breakdown.ElementalEnergyShieldRecoup = { s_format("%d%% over %d seconds", output.ElementalEnergyShieldRecoup, (modDB:Flag(nil, "4SecondEnergyShieldRecoup") or modDB:Flag(nil, "4SecondRecoup")) and 4 or 8) }
14501450
end
14511451
end
14521452

@@ -1459,10 +1459,10 @@ function calcs.defence(env, actor)
14591459
breakdown[damageType.."LifeRecoup"] = {
14601460
s_format("%d%% ^8(base)", LifeRecoup),
14611461
s_format("* %.2f ^8(recovery rate modifier)", output.LifeRecoveryRateMod),
1462-
s_format("= %.1f%% over %d seconds", output[damageType.."LifeRecoup"], (modDB:Flag(nil, "3SecondLifeRecoup") or modDB:Flag(nil, "3SecondRecoup")) and 3 or 4)
1462+
s_format("= %.1f%% over %d seconds", output[damageType.."LifeRecoup"], (modDB:Flag(nil, "4SecondLifeRecoup") or modDB:Flag(nil, "4SecondRecoup")) and 4 or 8)
14631463
}
14641464
else
1465-
breakdown[damageType.."LifeRecoup"] = { s_format("%d%% over %d seconds", output[damageType.."LifeRecoup"], (modDB:Flag(nil, "3SecondLifeRecoup") or modDB:Flag(nil, "3SecondRecoup")) and 3 or 4) }
1465+
breakdown[damageType.."LifeRecoup"] = { s_format("%d%% over %d seconds", output[damageType.."LifeRecoup"], (modDB:Flag(nil, "4SecondLifeRecoup") or modDB:Flag(nil, "4SecondRecoup")) and 4 or 8) }
14661466
end
14671467
end
14681468
end
@@ -2945,7 +2945,7 @@ function calcs.buildDefenceEstimations(env, actor)
29452945
end
29462946
local recoupTypeList = {"Life", "Mana", "EnergyShield"}
29472947
for i, recoupType in ipairs(recoupTypeList) do
2948-
local recoupTime = (modDB:Flag(nil, "3Second"..recoupType.."Recoup") or modDB:Flag(nil, "3SecondRecoup")) and 3 or 4
2948+
local recoupTime = (modDB:Flag(nil, "4Second"..recoupType.."Recoup") or modDB:Flag(nil, "4SecondRecoup")) and 4 or 8
29492949
output["Total"..recoupType.."RecoupRecovery"] = (output[recoupType.."Recoup"] or 0) / 100 * totalDamage
29502950
if (output["Elemental"..recoupType.."Recoup"] or 0) > 0 and totalElementalDamage > 0 then
29512951
output["Total"..recoupType.."RecoupRecovery"] = output["Total"..recoupType.."RecoupRecovery"] + output["Elemental"..recoupType.."Recoup"] / 100 * totalElementalDamage

src/Modules/ModParser.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,9 @@ local modNameList = {
388388
["cold damage taken recouped as life"] = "ColdLifeRecoup",
389389
["fire damage taken recouped as life"] = "FireLifeRecoup",
390390
["chaos damage taken recouped as life"] = "ChaosLifeRecoup",
391+
["elemental damage taken recouped as life"] = { "LightningLifeRecoup", "ColdLifeRecoup", "FireLifeRecoup" },
391392
["damage taken recouped as energy shield"] = "EnergyShieldRecoup",
393+
["elemental damage taken recouped as energy shield"] = { "LightningEnergyShieldRecoup", "ColdEnergyShieldRecoup", "FireEnergyShieldRecoup" },
392394
["damage taken recouped as mana"] = "ManaRecoup",
393395
["damage taken recouped as life, mana and energy shield"] = { "LifeRecoup", "EnergyShieldRecoup", "ManaRecoup" },
394396
-- Stun/knockback modifiers
@@ -4179,8 +4181,8 @@ local specialModList = {
41794181
["replenishes energy shield by (%d+)%% of armour when you block"] = function(num) return { mod("EnergyShieldOnBlock", "BASE", 1, { type = "PercentStat", stat = "Armour", percent = num }) } end,
41804182
["recover energy shield equal to (%d+)%% of armour when you block"] = function(num) return { mod("EnergyShieldOnBlock", "BASE", 1, { type = "PercentStat", stat = "Armour", percent = num }) } end,
41814183
["(%d+)%% of damage taken while affected by clarity recouped as mana"] = function(num) return { mod("ManaRecoup", "BASE", num, { type = "Condition", var = "AffectedByClarity" }) } end,
4182-
["recoup effects instead occur over 3 seconds"] = { flag("3SecondRecoup") },
4183-
["life recoup effects instead occur over 3 seconds"] = { flag("3SecondLifeRecoup") },
4184+
["recoup effects instead occur over 4 seconds"] = { flag("4SecondRecoup") },
4185+
["life recoup effects instead occur over 4 seconds"] = { flag("4SecondLifeRecoup") },
41844186
["([%d%.]+)%% of physical damage prevented from hits in the past (%d+) seconds is regenerated as life per second"] = function(num, _, duration) return {
41854187
mod("PhysicalDamageMitigatedLifePseudoRecoup", "BASE", num * duration),
41864188
mod("PhysicalDamageMitigatedLifePseudoRecoupDuration", "BASE", duration),

0 commit comments

Comments
 (0)