Skip to content

Commit

Permalink
Add Support for many Runecraft Enchants (#8217)
Browse files Browse the repository at this point in the history
Adds support for the following mods:
Gain Arcane Surge after Spending a total of 200 Life
Adds 5% of your Maximum Energy Shield as Cold Damage to Attacks with this Weapon
Adds 5% of your Maximum Mana as Fire Damage to Attacks with this Weapon
Damage cannot be Reflected
Mana Leech from Hits with this Weapon is Instant
Chaos Damage with Hits is Lucky
(7-10)% increased Fire Damage per 1% Fire Resistance above 75%

Mods that still need support:
Haunted by Tormented Spirits
Trigger a Socketed Fire Spell on Hit, with a 0.25 second Cooldown
Gain Flaming, Icy or Crackling Runesurge at random for 4 seconds every 10 seconds
Gain a random shrine buff every 10 seconds

Co-authored-by: LocalIdentity <localidentity2@gmail.com>
  • Loading branch information
LocalIdentity and LocalIdentity committed Aug 31, 2024
1 parent f151b4c commit f6ee17f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Data/ModCache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7656,7 +7656,7 @@ c["Damage Penetrates 7% Chaos Resistance"]={{[1]={flags=0,keywordFlags=0,name="C
c["Damage Penetrates 8% Lightning Resistance"]={{[1]={flags=0,keywordFlags=0,name="LightningPenetration",type="BASE",value=8}},nil}
c["Damage Penetrates 8% of Enemy Elemental Resistances"]={{[1]={flags=0,keywordFlags=0,name="ElementalPenetration",type="BASE",value=8}},nil}
c["Damage Penetrates 9% Elemental Resistances while you are Chilled"]={{[1]={[1]={type="Condition",var="Chilled"},flags=0,keywordFlags=0,name="ElementalPenetration",type="BASE",value=9}},nil}
c["Damage cannot be Reflected"]={nil,"Damage cannot be Reflected "}
c["Damage cannot be Reflected"]={{[1]={[1]={effectType="Global",type="GlobalEffect",unscalable=true},flags=0,keywordFlags=0,name="ReflectedDamageTaken",type="MORE",value=-100}},nil}
c["Damage from Enemies Hitting you is Unlucky while you are Cursed with Vulnerability"]={nil,"Damage from Enemies Hitting you is Unlucky while you are Cursed with Vulnerability "}
c["Damage from Enemies Hitting you is Unlucky while you are Cursed with Vulnerability You count as on Full Life while you are Cursed with Vulnerability"]={nil,"Damage from Enemies Hitting you is Unlucky while you are Cursed with Vulnerability You count as on Full Life while you are Cursed with Vulnerability "}
c["Damage from your Critical Strikes cannot be Reflected"]={nil,"Damage from your Critical Strikes cannot be Reflected "}
Expand Down
1 change: 1 addition & 0 deletions src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2967,6 +2967,7 @@ function calcs.offence(env, actor, activeSkill)
or (pass == 2 and damageType == "Lightning" and skillModList:Flag(skillCfg, "LightningNoCritLucky"))
or (pass == 1 and skillModList:Flag(skillCfg, "CritLucky"))
or (damageType == "Lightning" and modDB:Flag(nil, "LightningLuckHits"))
or (damageType == "Chaos" and modDB:Flag(nil, "ChaosLuckyHits"))
or ((damageType == "Lightning" or damageType == "Cold" or damageType == "Fire") and skillModList:Flag(skillCfg, "ElementalLuckHits")) then
damageTypeLuckyChance = 1
else
Expand Down
17 changes: 17 additions & 0 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1379,6 +1379,7 @@ local modTagList = {
["per (%d+)%% chaos resistance"] = function(num) return { tag = { type = "PerStat", stat = "ChaosResist", div = num } } end,
["per (%d+)%% cold resistance above 75%%"] = function(num) return { tag = { type = "PerStat", stat = "ColdResistOver75", div = num } } end,
["per (%d+)%% lightning resistance above 75%%"] = function(num) return { tag = { type = "PerStat", stat = "LightningResistOver75", div = num } } end,
["per (%d+)%% fire resistance above 75%%"] = function(num) return { tag = { type = "PerStat", stat = "FireResistOver75", div = num } } end,
["per (%d+) devotion"] = function(num) return { tag = { type = "PerStat", stat = "Devotion", actor = "parent", div = num } } end,
["per (%d+)%% missing fire resistance, up to a maximum of (%d+)%%"] = function(num, _, limit) return { tag = { type = "PerStat", stat = "MissingFireResist", div = num, globalLimit = tonumber(limit), globalLimitKey = "ReplicaNebulisFire" } } end,
["per (%d+)%% missing cold resistance, up to a maximum of (%d+)%%"] = function(num, _, limit) return { tag = { type = "PerStat", stat = "MissingColdResist", div = num, globalLimit = tonumber(limit), globalLimitKey = "ReplicaNebulisCold" } } end,
Expand Down Expand Up @@ -2757,6 +2758,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" }) },
["mana leech from hits with this weapon is instant"] = { mod("InstantManaLeech", "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,
Expand Down Expand Up @@ -3502,6 +3504,7 @@ local specialModList = {
} end,
["nearby allies' damage with hits is lucky"] = { mod("ExtraAura", "LIST", { onlyAllies = true, mod = flag("LuckyHits") }) },
["your damage with hits is lucky"] = { flag("LuckyHits") },
["chaos damage with hits is lucky"] = { flag("ChaosLuckyHits") },
["elemental damage with hits is lucky while you are shocked"] = { flag("ElementalLuckHits", { type = "Condition", var = "Shocked" }) },
["allies' aura buffs do not affect you"] = { flag("AlliesAurasCannotAffectSelf") },
["(%d+)%% increased effect of non%-curse auras from your skills on enemies"] = function(num) return {
Expand Down Expand Up @@ -3597,6 +3600,9 @@ local specialModList = {
["gain arcane surge after spending a total of (%d+) mana"] = function(num) return {
mod("ExtraAura", "LIST", { mod = flag("Condition:ArcaneSurge")}, { type = "MultiplierThreshold", var = "ManaSpentRecently", threshold = num }),
} end,
["gain arcane surge after spending a total of (%d+) life"] = function(num) return {
mod("ExtraAura", "LIST", { mod = flag("Condition:ArcaneSurge")}, { type = "MultiplierThreshold", var = "LifeSpentRecently", threshold = num }),
} end,
["gain onslaught for (%d+) seconds on hit while at maximum frenzy charges"] = { flag("Onslaught", { type = "StatThreshold", stat = "FrenzyCharges", thresholdStat = "FrenzyChargesMax" }, { type = "Condition", var = "HitRecently" }) },
["enemies in your chilling areas take (%d+)%% increased lightning damage"] = function(num) return { mod("EnemyModifier", "LIST", { mod = mod("LightningDamageTaken", "INC", num) }, { type = "ActorCondition", actor = "enemy", var = "InChillingArea" }) } end,
["warcries count as having (%d+) additional nearby enemies"] = function(num) return {
Expand Down Expand Up @@ -4124,6 +4130,9 @@ local specialModList = {
mod("ReflectedDamageTaken", "INC", -tonumber(num), { type = "GlobalEffect", effectType = "Global", unscalable = true }),
mod("MinionModifier", "LIST", { mod = mod("ReflectedDamageTaken", "INC", -tonumber(num), { type = "GlobalEffect", effectType = "Global", unscalable = true }) }),
} end,
["damage cannot be reflected"] = function(num) return {
mod("ReflectedDamageTaken", "MORE", -100, { type = "GlobalEffect", effectType = "Global", unscalable = true }),
} end,
["you have mind over matter while at maximum power charges"] = { mod("Keystone", "LIST", "Mind Over Matter", { type = "StatThreshold", stat = "PowerCharges", thresholdStat = "PowerChargesMax" }) },
["cannot evade enemy attacks"] = { flag("CannotEvade") },
["attacks cannot hit you"] = { flag("AlwaysEvade") },
Expand Down Expand Up @@ -4711,9 +4720,17 @@ local specialModList = {
["attacks with this weapon have added maximum lightning damage equal to (%d+)%% of your maximum energy shield"] = function(num) return {
mod("LightningMax", "BASE", 1, { type = "PercentStat", stat = "EnergyShield" , percent = num }, { type = "Condition", var = "{Hand}Attack" }, { type = "SkillType", skillType = SkillType.Attack }),
} end,
["adds (%d+)%% of your maximum energy shield as cold damage to attacks with this weapon"] = function(num) return {
mod("ColdMin", "BASE", 1, { type = "PercentStat", stat = "EnergyShield" , percent = num }, { type = "Condition", var = "{Hand}Attack" }, { type = "SkillType", skillType = SkillType.Attack }),
mod("ColdMax", "BASE", 1, { type = "PercentStat", stat = "EnergyShield" , percent = num }, { type = "Condition", var = "{Hand}Attack" }, { type = "SkillType", skillType = SkillType.Attack }),
} end,
["attacks with this weapon have added maximum lightning damage equal to (%d+)%% of player'?s? maximum energy shield"] = function(num) return {
mod("LightningMax", "BASE", 1, { type = "PercentStat", stat = "EnergyShield" , percent = num, actor = "parent" }, { type = "Condition", var = "{Hand}Attack" }, { type = "SkillType", skillType = SkillType.Attack }),
} end,
["adds (%d+)%% of your maximum mana as fire damage to attacks with this weapon"] = function(num) return {
mod("FireMin", "BASE", 1, { type = "PercentStat", stat = "Mana" , percent = num }, { type = "Condition", var = "{Hand}Attack" }, { type = "SkillType", skillType = SkillType.Attack }),
mod("FireMax", "BASE", 1, { type = "PercentStat", stat = "Mana" , percent = num }, { type = "Condition", var = "{Hand}Attack" }, { type = "SkillType", skillType = SkillType.Attack }),
} end,
["gain added chaos damage equal to (%d+)%% of ward"] = function(num) return {
mod("ChaosMin", "BASE", 1, { type = "PercentStat", stat = "Ward", percent = num }),
mod("ChaosMax", "BASE", 1, { type = "PercentStat", stat = "Ward", percent = num }),
Expand Down

0 comments on commit f6ee17f

Please sign in to comment.