Skip to content

Commit e58871f

Browse files
MrHB212LocalIdentity
andauthored
Added support for Darkness (#715)
* added support for darkness * removed some unneccesary code * added support for grasp of the void also added a box in config tab to manually set the reserved darkness * reverted unintended line removal * moved box in config tab to when in combat * calculation is done in seperate function * unreserved darkness config only shows when player has darkness * Fix PR * Fix spaces --------- Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent 1eef33a commit e58871f

File tree

5 files changed

+38
-13
lines changed

5 files changed

+38
-13
lines changed

src/Data/ModCache.lua

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ c["+45 to Strength"]={{[1]={flags=0,keywordFlags=0,name="Str",type="BASE",value=
541541
c["+5 to Dexterity"]={{[1]={flags=0,keywordFlags=0,name="Dex",type="BASE",value=5}},nil}
542542
c["+5 to Dexterity and Intelligence"]={{[1]={flags=0,keywordFlags=0,name="Dex",type="BASE",value=5},[2]={flags=0,keywordFlags=0,name="Int",type="BASE",value=5},[3]={flags=0,keywordFlags=0,name="DexInt",type="BASE",value=5}},nil}
543543
c["+5 to Intelligence"]={{[1]={flags=0,keywordFlags=0,name="Int",type="BASE",value=5}},nil}
544-
c["+5 to Maximum Darkness per Level"]={{}," Maximum Darkness "}
544+
c["+5 to Maximum Darkness per Level"]={{[1]={[1]={type="Multiplier",var="Level"},flags=0,keywordFlags=0,name="Darkness",type="BASE",value=5}},nil}
545545
c["+5 to Strength"]={{[1]={flags=0,keywordFlags=0,name="Str",type="BASE",value=5}},nil}
546546
c["+5 to Strength and Dexterity"]={{[1]={flags=0,keywordFlags=0,name="Str",type="BASE",value=5},[2]={flags=0,keywordFlags=0,name="Dex",type="BASE",value=5},[3]={flags=0,keywordFlags=0,name="StrDex",type="BASE",value=5}},nil}
547547
c["+5 to Strength and Intelligence"]={{[1]={flags=0,keywordFlags=0,name="Str",type="BASE",value=5},[2]={flags=0,keywordFlags=0,name="Int",type="BASE",value=5},[3]={flags=0,keywordFlags=0,name="StrInt",type="BASE",value=5}},nil}
@@ -812,7 +812,7 @@ c["10% increased chance to Ignite"]={{[1]={flags=0,keywordFlags=0,name="EnemyIgn
812812
c["10% increased chance to Shock"]={{[1]={flags=0,keywordFlags=0,name="EnemyShockChance",type="INC",value=10}},nil}
813813
c["10% increased chance to inflict Ailments"]={{[1]={flags=0,keywordFlags=0,name="AilmentChance",type="INC",value=10}},nil}
814814
c["10% increased effect of Arcane Surge on you"]={{[1]={flags=0,keywordFlags=0,name="ArcaneSurgeEffect",type="INC",value=10}},nil}
815-
c["10% increased maximum Darkness"]={{}," maximum Darkness "}
815+
c["10% increased maximum Darkness"]={{[1]={flags=0,keywordFlags=0,name="Darkness",type="INC",value=10}},nil}
816816
c["10% increased maximum Energy Shield"]={{[1]={[1]={type="Global"},flags=0,keywordFlags=0,name="EnergyShield",type="INC",value=10}},nil}
817817
c["10% increased maximum Life"]={{[1]={flags=0,keywordFlags=0,name="Life",type="INC",value=10}},nil}
818818
c["10% less Movement and Skill Speed per Dodge Roll in the past 20 seconds"]={{[1]={flags=0,keywordFlags=0,name="Speed",type="MORE",value=-10},[2]={flags=0,keywordFlags=0,name="WarcrySpeed",type="MORE",value=-10}}," Movement and per Dodge Roll in the past 20 seconds "}
@@ -2368,10 +2368,10 @@ c["Aura Skills have 1% more Aura Effect per 2% of maximum Mana they Reserve"]={{
23682368
c["Auras from your Skills can only affect you"]={{[1]={flags=0,keywordFlags=0,name="SelfAurasOnlyAffectYou",type="FLAG",value=true}},nil}
23692369
c["Base Critical Hit Chance for Attacks with Weapons is 8%"]={{[1]={flags=0,keywordFlags=0,name="WeaponBaseCritChance",type="OVERRIDE",value=8}},nil}
23702370
c["Base Critical Hit Chance for Spells is 15%"]={{[1]={[1]={skillType=2,type="SkillType"},flags=0,keywordFlags=0,name="CritChanceBase",type="OVERRIDE",value=15}},nil}
2371-
c["Base Maximum Darkness is 100"]={{},"Base Maximum Darkness "}
2372-
c["Base Maximum Darkness is 100 Damage taken is Reserved from Darkness before being taken from Life or Energy Shield"]={{[1]={flags=0,keywordFlags=0,name="DamageTaken",type="OVERRIDE",value=100}},"Base Maximum Darkness is Reserved from Darkness before being taken from Life or Energy Shield "}
2373-
c["Base Maximum Darkness is 100 Damage taken is Reserved from Darkness before being taken from Life or Energy Shield Darkness Reservation lasts for 10 seconds"]={{[1]={flags=0,keywordFlags=0,name="DamageTaken",type="OVERRIDE",value=100}},"Base Maximum Darkness is Reserved from Darkness before being taken from Life or Energy Shield Darkness Reservation lasts "}
2374-
c["Base Maximum Darkness is 100 Damage taken is Reserved from Darkness before being taken from Life or Energy Shield Darkness Reservation lasts for 10 seconds +5 to Maximum Darkness per Level"]={{[1]={[1]={type="Multiplier",var="Level"},flags=0,keywordFlags=0,name="DamageTaken",type="OVERRIDE",value=100}},"Base Maximum Darkness is Reserved from Darkness before being taken from Life or Energy Shield Darkness Reservation lasts +5 to Maximum Darkness "}
2371+
c["Base Maximum Darkness is 100"]={{[1]={flags=0,keywordFlags=0,name="Darkness",type="OVERRIDE",value=100}},"Base "}
2372+
c["Base Maximum Darkness is 100 Damage taken is Reserved from Darkness before being taken from Life or Energy Shield"]={{[1]={flags=0,keywordFlags=0,name="Darkness",type="OVERRIDE",value=100}},"Base Damage taken is Reserved from Darkness before being taken from Life or Energy Shield "}
2373+
c["Base Maximum Darkness is 100 Damage taken is Reserved from Darkness before being taken from Life or Energy Shield Darkness Reservation lasts for 10 seconds"]={{[1]={flags=0,keywordFlags=0,name="Darkness",type="OVERRIDE",value=100}},"Base Damage taken is Reserved from Darkness before being taken from Life or Energy Shield Darkness Reservation lasts "}
2374+
c["Base Maximum Darkness is 100 Damage taken is Reserved from Darkness before being taken from Life or Energy Shield Darkness Reservation lasts for 10 seconds +5 to Maximum Darkness per Level"]={{[1]={[1]={type="Multiplier",var="Level"},flags=0,keywordFlags=0,name="Darkness",type="OVERRIDE",value=100}},"Base Damage taken is Reserved from Darkness before being taken from Life or Energy Shield Darkness Reservation lasts +5 to Maximum Darkness "}
23752375
c["Become Ignited when you deal a Critical Hit, taking 15% of your Life and Energy Shield as Fire Damage per second"]={nil,"Become Ignited when you deal a Critical Hit, taking 15% of your Life and Energy Shield as Fire Damage per second "}
23762376
c["Become Ignited when you deal a Critical Hit, taking 15% of your Life and Energy Shield as Fire Damage per second 30% more Critical Damage Bonus"]={nil,"Become Ignited when you deal a Critical Hit, taking 15% of your Life and Energy Shield as Fire Damage per second 30% more Critical Damage Bonus "}
23772377
c["Benefits from consuming Frenzy Charges for your Skills have 50% chance to be doubled"]={nil,"Benefits from consuming Frenzy Charges for your Skills have 50% chance to be doubled "}
@@ -2643,7 +2643,7 @@ c["Gain 1 Rage on Melee Axe Hit"]={{[1]={flags=0,keywordFlags=0,name="Condition:
26432643
c["Gain 1 Rage on Melee Hit"]={{[1]={flags=0,keywordFlags=0,name="Condition:CanGainRage",type="FLAG",value=true}},nil}
26442644
c["Gain 1 Spirit for every 15 Evasion Rating on equipped Body Armour"]={{[1]={[1]={div=15,stat="EvasionOnBody Armour",type="PerStat"},flags=0,keywordFlags=0,name="Spirit",type="BASE",value=1}},nil}
26452645
c["Gain 1 Spirit for every 6 Energy Shield on equipped Body Armour"]={{[1]={[1]={div=6,stat="EnergyShieldOnBody Armour",type="PerStat"},flags=0,keywordFlags=0,name="Spirit",type="BASE",value=1}},nil}
2646-
c["Gain 1% of Damage as Extra Chaos Damage per 20 Unreserved Darkness"]={{[1]={flags=0,keywordFlags=0,name="DamageGainAsChaos",type="BASE",value=1}}," per 20 Unreserved Darkness "}
2646+
c["Gain 1% of Damage as Extra Chaos Damage per 20 Unreserved Darkness"]={{[1]={[1]={div=20,stat="UnreservedDarkness",type="PerStat"},flags=0,keywordFlags=0,name="PhysicalDamageGainAsChaos",type="BASE",value=1}},nil}
26472647
c["Gain 10 Life per Enemy Killed"]={{[1]={flags=0,keywordFlags=0,name="LifeOnKill",type="BASE",value=10}},nil}
26482648
c["Gain 10 Mana per Enemy Killed"]={{[1]={flags=0,keywordFlags=0,name="ManaOnKill",type="BASE",value=10}},nil}
26492649
c["Gain 10 Rage when Critically Hit by an Enemy"]={{}," Rage when Critically Hit by an Enemy "}
@@ -3122,11 +3122,7 @@ c["Remembrancing 8000 songworthy deeds by the line of Olroth"]={{[1]={flags=0,ke
31223122
c["Remembrancing 8000 songworthy deeds by the line of Vorana"]={{[1]={flags=0,keywordFlags=0,name="JewelData",type="LIST",value={key="conqueredBy",value={conqueror={id=1,type="kalguur"},id=8000}}}},nil}
31233123
c["Remove a Curse when you use a Mana Flask"]={nil,"Remove a Curse when you use a Mana Flask "}
31243124
c["Removes all Mana"]={{[1]={flags=0,keywordFlags=0,name="Mana",type="MORE",value=-100}},nil}
3125-
c["Removes all Spirit"]={nil,"Removes all Spirit "}
3126-
c["Removes all Spirit Base Maximum Darkness is 100"]={{[1]={flags=0,keywordFlags=0,name="Spirit",type="OVERRIDE",value=100}},"Removes all Base Maximum Darkness "}
3127-
c["Removes all Spirit Base Maximum Darkness is 100 Damage taken is Reserved from Darkness before being taken from Life or Energy Shield"]={{[1]={flags=0,keywordFlags=0,name="Spirit",type="OVERRIDE",value=100}},"Removes all Base Maximum Darkness Damage taken is Reserved from Darkness before being taken from Life or Energy Shield "}
3128-
c["Removes all Spirit Base Maximum Darkness is 100 Damage taken is Reserved from Darkness before being taken from Life or Energy Shield Darkness Reservation lasts for 10 seconds"]={{[1]={flags=0,keywordFlags=0,name="Spirit",type="OVERRIDE",value=100}},"Removes all Base Maximum Darkness Damage taken is Reserved from Darkness before being taken from Life or Energy Shield Darkness Reservation lasts "}
3129-
c["Removes all Spirit Base Maximum Darkness is 100 Damage taken is Reserved from Darkness before being taken from Life or Energy Shield Darkness Reservation lasts for 10 seconds +5 to Maximum Darkness per Level"]={{[1]={[1]={type="Multiplier",var="Level"},flags=0,keywordFlags=0,name="Spirit",type="OVERRIDE",value=100}},"Removes all Base Maximum Darkness Damage taken is Reserved from Darkness before being taken from Life or Energy Shield Darkness Reservation lasts +5 to Maximum Darkness "}
3125+
c["Removes all Spirit"]={{[1]={flags=0,keywordFlags=0,name="Spirit",type="OVERRIDE",value=0}},nil}
31303126
c["Reserves 25% of Life"]={{[1]={flags=0,keywordFlags=0,name="ExtraLifeReserved",type="BASE",value=25}},nil}
31313127
c["Right ring slot: Projectiles from Spells Chain +1 times"]={{[1]={[1]={num=2,type="SlotNumber"},flags=1026,keywordFlags=0,name="ChainCountMax",type="BASE",value=1}},nil}
31323128
c["Right ring slot: Projectiles from Spells cannot Fork"]={{[1]={[1]={num=2,type="SlotNumber"},flags=1026,keywordFlags=0,name="CannotFork",type="FLAG",value=true}},nil}

src/Modules/BuildDisplayStats.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ local displayStats = {
108108
{ },
109109
{ stat = "MainHand", childStat = "Accuracy", label = "MH Accuracy", fmt = "d", condFunc = function(v,o) return o.PreciseTechnique end, warnFunc = function(v,o) return v < o.Life and "You do not have enough Accuracy for Precise Technique" end, warnColor = true },
110110
{ stat = "OffHand", childStat = "Accuracy", label = "OH Accuracy", fmt = "d", condFunc = function(v,o) return o.PreciseTechnique end, warnFunc = function(v,o) return v < o.Life and "You do not have enough Accuracy for Precise Technique" end, warnColor = true },
111+
{ },
112+
{ stat = "Darkness", label = "Total Darkness", fmt = "d", color = colorCodes.CHAOS},
113+
{ stat = "ReservedDarkness", label = "Reserved Darkness", fmt ="d", color = colorCodes.CHAOS},
114+
{ },
111115
{ stat = "Life", label = "Total Life", fmt = "d", color = colorCodes.LIFE, compPercent = true },
112116
{ stat = "Spec:LifeInc", label = "%Inc Life", fmt = "d%%", color = colorCodes.LIFE, condFunc = function(v,o) return v > 0 and o.Life > 1 end },
113117
{ stat = "LifeUnreserved", label = "Unreserved Life", fmt = "d", color = colorCodes.LIFE, condFunc = function(v,o) return v < o.Life end, compPercent = true, warnFunc = function(v) return v <= 0 and "Your unreserved Life is below 1" end },

src/Modules/CalcDefence.lua

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,22 @@ function calcs.doActorLifeManaSpirit(actor)
104104
output.LowestOfMaximumLifeAndMaximumMana = m_min(output.Life, output.Mana)
105105
end
106106

107+
108+
-- Calculate Darkness and Darkness Reservation
109+
---@param actor table
110+
function calcs.doActorDarkness(actor)
111+
local modDB = actor.modDB
112+
local output = actor.output
113+
local condList = modDB.conditions
114+
local inc = modDB:Sum("INC", nil, "Darkness")
115+
local base = modDB:Sum("BASE", nil, "Darkness")
116+
output.Darkness = base * (1+inc/100)
117+
118+
local reserved = modDB:Sum("BASE", nil, "ReservedDarkness")
119+
output.ReservedDarkness = m_min(reserved, output.Darkness)
120+
output.UnreservedDarkness = output.Darkness - output.ReservedDarkness
121+
end
122+
107123
-- Calculate life/mana/spirit reservation
108124
---@param actor table
109125
function calcs.doActorLifeManaSpiritReservation(actor)
@@ -1281,6 +1297,9 @@ function calcs.defence(env, actor)
12811297
-- Calculate life and mana reservations
12821298
calcs.doActorLifeManaSpiritReservation(actor)
12831299

1300+
-- Calculate darkness and darkness reservation
1301+
calcs.doActorDarkness(actor)
1302+
12841303
-- Stormweaver's Force of Will adds effect per max mana. Needs to happen before mana regen is calculated
12851304
if modDB.conditions["AffectedByArcaneSurge"] or modDB:Flag(nil, "Condition:ArcaneSurge") then
12861305
modDB.conditions["AffectedByArcaneSurge"] = true

src/Modules/ConfigOptions.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,6 +1432,9 @@ Huge sets the radius to 11.
14321432
{ var = "multiplierPvpDamage", type = "count", label = "Custom PvP Damage multiplier percent:", ifFlag = "isPvP", tooltip = "This multiplies the damage of a given skill in pvp, for instance any with damage multiplier specific to pvp (from skill or support or item like sire of shards)", apply = function(val, modList, enemyModList)
14331433
modList:NewMod("PvpDamageMultiplier", "MORE", val - 100, "Config")
14341434
end },
1435+
{ var = "reservedDarkness", type = "count", label = "Reserved Darkness:", ifStat = "UnreservedDarkness", apply = function(val, modList, enemyModList)
1436+
modList:NewMod("ReservedDarkness", "BASE", val, "Config")
1437+
end },
14351438
-- Section: Effective DPS options
14361439
{ section = "For Effective DPS", col = 1 },
14371440
{ var = "skillForkCount", type = "count", label = "# of times Skill has Forked:", ifFlag = "forking", apply = function(val, modList, enemyModList)

src/Modules/ModParser.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ local modNameList = {
141141
["attributes"] = { "Str", "Dex", "Int", "All" },
142142
["all attributes"] = { "Str", "Dex", "Int", "All" },
143143
["devotion"] = "Devotion",
144-
-- Life/Mana/Spirit
144+
-- Life/Mana/Spirit/Darkness
145+
["maximum darkness"] = "Darkness",
145146
["spirit"] = "Spirit",
146147
["maximum spirit"] = "Spirit",
147148
["life"] = "Life",
@@ -2870,6 +2871,8 @@ local specialModList = {
28702871
["targets can be affected by two of your chills at the same time"] = { flag("ChillCanStack"), mod("ChillStacksMax", "OVERRIDE", 2) },
28712872
["your chills can slow targets by up to a maximum of (%d+)%%"] = function(num) return { mod("ChillMax", "OVERRIDE", num)} end,
28722873
-- Monk - Chayula
2874+
["gain (%d+)%% of damage as extra chaos damage per 20 unreserved darkness"] = function(num) return { mod("PhysicalDamageGainAsChaos", "BASE", num ,{ type = "PerStat", div=20, stat="UnreservedDarkness"})} end,
2875+
["removes all spirit"] = { mod("Spirit", "OVERRIDE", 0) },
28732876
["(%d+)%% chance to gain (%d+)%% of damage with hits as extra (%a+) damage"] = function(num, _, num2, strType) return {
28742877
mod("DamageGainAs"..firstToUpper(strType), "BASE", tonumber(num2) * (num / 100), nil, ModFlag.Hit, 0),
28752878
} end,

0 commit comments

Comments
 (0)