Skip to content

Commit 2ebe0ff

Browse files
committed
Fixes issue where life was being converted prior to CI life reduction. Example is Ghostwrite (#% of Maximum Life is converted to Energy Shield)
1 parent f7feb73 commit 2ebe0ff

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed

src/Data/ModCache.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4752,7 +4752,7 @@ c["You have a Smoke Cloud around you while stationary"]={nil,"a Smoke Cloud arou
47524752
c["You have no Accuracy Penalty at Distance"]={{[1]={flags=0,keywordFlags=0,name="NoAccuracyDistancePenalty",type="FLAG",value=true}},nil}
47534753
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}
47544754
c["You have no Life Regeneration"]={{[1]={flags=0,keywordFlags=0,name="NoLifeRegen",type="FLAG",value=true}},nil}
4755-
c["You have no Mana"]={{[1]={flags=0,keywordFlags=0,name="Mana",type="MORE",value=-100}},nil}
4755+
c["You have no Mana"]={{[1]={flags=0,keywordFlags=0,name="Mana",type="OVERRIDE",value=0}},nil}
47564756
c["You have no Spirit"]={{[1]={flags=0,keywordFlags=0,name="Spirit",type="OVERRIDE",value=0}},nil}
47574757
c["You lose 5% of maximum Energy Shield per second"]={{[1]={flags=0,keywordFlags=0,name="EnergyShieldDegenPercent",type="BASE",value=5}},nil}
47584758
c["You take 10% of damage from Blocked Hits"]={{[1]={flags=0,keywordFlags=0,name="BlockEffect",type="BASE",value=10}},nil}

src/Modules/CalcDefence.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1263,6 +1263,10 @@ function calcs.defence(env, actor)
12631263
end
12641264
for _, source in ipairs(resourceList) do
12651265
local globalBase = modDB:Sum("BASE", nil, unpack(source.mods)) + source.globalBase
1266+
local globalOverride = modDB:Override(nil, unpack(source.mods))
1267+
if globalOverride then
1268+
globalBase = globalOverride
1269+
end
12661270
for _, target in ipairs(resourceList) do
12671271
if source.name ~= target.name then
12681272
if source.defence then
@@ -1294,7 +1298,7 @@ function calcs.defence(env, actor)
12941298
local rate = source.conversionRate[target.name] + gainRate
12951299
if rate > 0 then
12961300
local targetBase = globalBase * rate / 100
1297-
target.globalBase = target.globalBase + targetBase
1301+
local targetBase = math.ceil(globalBase * rate / 100)
12981302
if breakdown then
12991303
breakdown.slot("Conversion", source.name .. " to " .. target.name, nil, targetBase, nil, unpack(target.mods))
13001304
end

src/Modules/ModParser.lua

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2192,11 +2192,11 @@ local specialModList = {
21922192
mod("LightningDamageConvertToChaos", "BASE", 100),
21932193
},
21942194
["all damage is taken from mana before life"] = { mod("DamageTakenFromManaBeforeLife", "BASE", 100) },
2195-
["removes all mana%. spend life instead of mana for skills"] = { mod("Mana", "MORE", -100), flag("CostLifeInsteadOfMana") },
2196-
["removes all mana"] = { mod("Mana", "MORE", -100) },
2197-
["you have no mana"] = { mod("Mana", "MORE", -100) },
2195+
["removes all mana%. spend life instead of mana for skills"] = { mod("Mana", "OVERRIDE", 0 ), flag("CostLifeInsteadOfMana") },
2196+
["removes all mana"] = { mod("Mana", "OVERRIDE", 0 ) },
2197+
["you have no mana"] = { mod("Mana", "OVERRIDE", 0 ) },
21982198
["doubles mana costs"] = { mod("ManaCost", "MORE", 100) },
2199-
["removes all energy shield"] = { mod("EnergyShield", "MORE", -100) },
2199+
["removes all energy shield"] = { mod("EnergyShield", "OVERRIDE", 0 ) },
22002200
["converts all energy shield to mana"] = { mod("EnergyShieldConvertToMana", "BASE", 100) },
22012201
["skills cost life instead of mana"] = { flag("CostLifeInsteadOfMana") },
22022202
["skills reserve life instead of mana"] = { flag("BloodMagicReserved") },
@@ -4555,21 +4555,21 @@ local specialModList = {
45554555
["cannot gain spirit from equipment"] = { flag("CannotGainSpiritFromEquipment")},
45564556
["life that would be lost by taking damage is instead reserved"] = { flag("DamageInsteadReservesLife") },
45574557
["you have no armour or energy shield"] = {
4558-
mod("Armour", "MORE", -100),
4559-
mod("EnergyShield", "MORE", -100),
4558+
mod("Armour", "OVERRIDE", 0 ),
4559+
mod("EnergyShield", "OVERRIDE", 0 ),
45604560
},
45614561
["you have no armour or maximum energy shield"] = {
4562-
mod("Armour", "MORE", -100),
4563-
mod("EnergyShield", "MORE", -100),
4562+
mod("Armour", "OVERRIDE", 0 ),
4563+
mod("EnergyShield", "OVERRIDE", 0 ),
45644564
},
45654565
["defences are zero"] = {
4566-
mod("Armour", "MORE", -100),
4567-
mod("EnergyShield", "MORE", -100),
4568-
mod("Evasion", "MORE", -100),
4569-
mod("Ward", "MORE", -100),
4566+
mod("Armour", "OVERRIDE", 0 ),
4567+
mod("EnergyShield", "OVERRIDE", 0 ),
4568+
mod("Evasion", "OVERRIDE", 0 ),
4569+
mod("Ward", "OVERRIDE", 0 ),
45704570
},
45714571
["you have no intelligence"] = {
4572-
mod("Int", "MORE", -100),
4572+
mod("Int", "OVERRIDE", 0 ),
45734573
},
45744574
["elemental resistances are zero"] = {
45754575
mod("FireResist", "OVERRIDE", 0),

0 commit comments

Comments
 (0)