From 558b3f8673658c3a1d8491db39889ed7bde78f9a Mon Sep 17 00:00:00 2001 From: David Hope Date: Mon, 25 Aug 2025 22:34:10 -0400 Subject: [PATCH 1/3] changes to fix issue where CI wasn't correctly overriding life before conversions (like conversion to ES from GhostWrithe) occur --- src/Modules/CalcDefence.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Modules/CalcDefence.lua b/src/Modules/CalcDefence.lua index d3f07bab77..7ded792ebb 100644 --- a/src/Modules/CalcDefence.lua +++ b/src/Modules/CalcDefence.lua @@ -1263,6 +1263,10 @@ function calcs.defence(env, actor) end for _, source in ipairs(resourceList) do local globalBase = modDB:Sum("BASE", nil, unpack(source.mods)) + source.globalBase + local globalOverride = modDB:Override(nil, unpack(source.mods)) + if globalOverride then + globalBase = globalOverride + end for _, target in ipairs(resourceList) do if source.name ~= target.name then if source.defence then @@ -1293,7 +1297,7 @@ function calcs.defence(env, actor) local gainRate = modDB:Sum("BASE", nil, source.name .. "GainAs" .. target.name) local rate = source.conversionRate[target.name] + gainRate if rate > 0 then - local targetBase = globalBase * rate / 100 + local targetBase = math.ceil(globalBase * rate / 100) target.globalBase = target.globalBase + targetBase if breakdown then breakdown.slot("Conversion", source.name .. " to " .. target.name, nil, targetBase, nil, unpack(target.mods)) From 554eccad7e3746068b45f48ff12ae1838f829b8b Mon Sep 17 00:00:00 2001 From: David Hope Date: Thu, 28 Aug 2025 07:58:34 -0400 Subject: [PATCH 2/3] Fixes issue where life was being converted prior to CI life reduction. Example is Ghostwrite (#% of Maximum Life is converted to Energy Shield), and a similar issue regarding Mana and Blood Magic --- src/Data/ModCache.lua | 2 +- src/Modules/ModParser.lua | 27 ++++++++++++++------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/Data/ModCache.lua b/src/Data/ModCache.lua index a3a2108cc7..81cb75c646 100755 --- a/src/Data/ModCache.lua +++ b/src/Data/ModCache.lua @@ -4752,7 +4752,7 @@ c["You have a Smoke Cloud around you while stationary"]={nil,"a Smoke Cloud arou c["You have no Accuracy Penalty at Distance"]={{[1]={flags=0,keywordFlags=0,name="NoAccuracyDistancePenalty",type="FLAG",value=true}},nil} c["You have no Elemental Resistances"]={{[1]={flags=0,keywordFlags=0,name="FireResist",type="OVERRIDE",value=0},[2]={flags=0,keywordFlags=0,name="ColdResist",type="OVERRIDE",value=0},[3]={flags=0,keywordFlags=0,name="LightningResist",type="OVERRIDE",value=0}},nil} c["You have no Life Regeneration"]={{[1]={flags=0,keywordFlags=0,name="NoLifeRegen",type="FLAG",value=true}},nil} -c["You have no Mana"]={{[1]={flags=0,keywordFlags=0,name="Mana",type="MORE",value=-100}},nil} +c["You have no Mana"]={{[1]={flags=0,keywordFlags=0,name="Mana",type="OVERRIDE",value=0}},nil} c["You have no Spirit"]={{[1]={flags=0,keywordFlags=0,name="Spirit",type="OVERRIDE",value=0}},nil} c["You lose 5% of maximum Energy Shield per second"]={{[1]={flags=0,keywordFlags=0,name="EnergyShieldDegenPercent",type="BASE",value=5}},nil} c["You take 10% of damage from Blocked Hits"]={{[1]={flags=0,keywordFlags=0,name="BlockEffect",type="BASE",value=10}},nil} diff --git a/src/Modules/ModParser.lua b/src/Modules/ModParser.lua index 58f752d8da..6c3cb6b7f8 100644 --- a/src/Modules/ModParser.lua +++ b/src/Modules/ModParser.lua @@ -2131,6 +2131,7 @@ local specialModList = { mod("SpellSuppressionChance", "OVERRIDE", 0, "Acrobatics"), }, ["maximum chance to dodge spell hits is (%d+)%%"] = function(num) return { mod("SpellDodgeChanceMax", "OVERRIDE", num, "Acrobatics") } end, + ["halves the amount of life granted by strength"] = { flag("HalvesLifeFromStrength")}, ["dexterity provides no bonus to evasion rating"] = { flag("NoDexBonusToEvasion") }, ["dexterity provides no inherent bonus to evasion rating"] = { flag("NoDexBonusToEvasion") }, ["your hits can't be evaded"] = { flag("CannotBeEvaded") }, @@ -2191,11 +2192,11 @@ local specialModList = { mod("LightningDamageConvertToChaos", "BASE", 100), }, ["all damage is taken from mana before life"] = { mod("DamageTakenFromManaBeforeLife", "BASE", 100) }, - ["removes all mana%. spend life instead of mana for skills"] = { mod("Mana", "MORE", -100), flag("CostLifeInsteadOfMana") }, - ["removes all mana"] = { mod("Mana", "MORE", -100) }, - ["you have no mana"] = { mod("Mana", "MORE", -100) }, + ["removes all mana%. spend life instead of mana for skills"] = { mod("Mana", "OVERRIDE", 0 ), flag("CostLifeInsteadOfMana") }, + ["removes all mana"] = { mod("Mana", "OVERRIDE", 0 ) }, + ["you have no mana"] = { mod("Mana", "OVERRIDE", 0 ) }, ["doubles mana costs"] = { mod("ManaCost", "MORE", 100) }, - ["removes all energy shield"] = { mod("EnergyShield", "MORE", -100) }, + ["removes all energy shield"] = { mod("EnergyShield", "OVERRIDE", 0 ) }, ["converts all energy shield to mana"] = { mod("EnergyShieldConvertToMana", "BASE", 100) }, ["skills cost life instead of mana"] = { flag("CostLifeInsteadOfMana") }, ["skills reserve life instead of mana"] = { flag("BloodMagicReserved") }, @@ -4554,21 +4555,21 @@ local specialModList = { ["cannot gain spirit from equipment"] = { flag("CannotGainSpiritFromEquipment")}, ["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), + mod("Armour", "OVERRIDE", 0 ), + mod("EnergyShield", "OVERRIDE", 0 ), }, ["you have no armour or maximum energy shield"] = { - mod("Armour", "MORE", -100), - mod("EnergyShield", "MORE", -100), + mod("Armour", "OVERRIDE", 0 ), + mod("EnergyShield", "OVERRIDE", 0 ), }, ["defences are zero"] = { - mod("Armour", "MORE", -100), - mod("EnergyShield", "MORE", -100), - mod("Evasion", "MORE", -100), - mod("Ward", "MORE", -100), + mod("Armour", "OVERRIDE", 0 ), + mod("EnergyShield", "OVERRIDE", 0 ), + mod("Evasion", "OVERRIDE", 0 ), + mod("Ward", "OVERRIDE", 0 ), }, ["you have no intelligence"] = { - mod("Int", "MORE", -100), + mod("Int", "OVERRIDE", 0 ), }, ["elemental resistances are zero"] = { mod("FireResist", "OVERRIDE", 0), From a6fc41c5e793dbcaa94498efa5121d17f267cf19 Mon Sep 17 00:00:00 2001 From: David Hope Date: Thu, 28 Aug 2025 08:07:52 -0400 Subject: [PATCH 3/3] removed irrelevant change --- src/Modules/ModParser.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Modules/ModParser.lua b/src/Modules/ModParser.lua index 6c3cb6b7f8..aed29de07e 100644 --- a/src/Modules/ModParser.lua +++ b/src/Modules/ModParser.lua @@ -2131,7 +2131,6 @@ local specialModList = { mod("SpellSuppressionChance", "OVERRIDE", 0, "Acrobatics"), }, ["maximum chance to dodge spell hits is (%d+)%%"] = function(num) return { mod("SpellDodgeChanceMax", "OVERRIDE", num, "Acrobatics") } end, - ["halves the amount of life granted by strength"] = { flag("HalvesLifeFromStrength")}, ["dexterity provides no bonus to evasion rating"] = { flag("NoDexBonusToEvasion") }, ["dexterity provides no inherent bonus to evasion rating"] = { flag("NoDexBonusToEvasion") }, ["your hits can't be evaded"] = { flag("CannotBeEvaded") },