Skip to content

Commit eb94bc0

Browse files
LocalIdentityLocalIdentity
andauthored
Fix increased Chance to Block mod on Shields not working (#8010)
Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent baa231a commit eb94bc0

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

src/Classes/Item.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1385,6 +1385,7 @@ function ItemClass:BuildModListForSlotNum(baseList, slotNum)
13851385
local energyShieldVariance = (self.base.armour.EnergyShieldBaseMax or 0) - (self.base.armour.EnergyShieldBaseMin or 0)
13861386
local armourEnergyShieldBase = calcLocal(modList, "ArmourAndEnergyShield", "BASE", 0)
13871387
local wardBase = calcLocal(modList, "Ward", "BASE", 0) + (self.base.armour.WardBaseMin or 0)
1388+
local blockBase = calcLocal(modList, "BlockChance", "BASE", 0)
13881389
local wardVariance = (self.base.armour.WardBaseMax or 0) - (self.base.armour.WardBaseMin or 0)
13891390
local armourInc = calcLocal(modList, "Armour", "INC", 0)
13901391
local armourEvasionInc = calcLocal(modList, "ArmourAndEvasion", "INC", 0)
@@ -1393,6 +1394,7 @@ function ItemClass:BuildModListForSlotNum(baseList, slotNum)
13931394
local energyShieldInc = calcLocal(modList, "EnergyShield", "INC", 0)
13941395
local wardInc = calcLocal(modList, "Ward", "INC", 0)
13951396
local armourEnergyShieldInc = calcLocal(modList, "ArmourAndEnergyShield", "INC", 0)
1397+
local blockInc = calcLocal(modList, "BlockChance", "INC", 0)
13961398
local defencesInc = calcLocal(modList, "Defences", "INC", 0)
13971399
local qualityScalar = self.quality
13981400
if calcLocal(modList, "AlternateQualityArmour", "BASE", 0) > 0 then
@@ -1435,7 +1437,7 @@ function ItemClass:BuildModListForSlotNum(baseList, slotNum)
14351437
end
14361438

14371439
if self.base.armour.BlockChance then
1438-
armourData.BlockChance = self.base.armour.BlockChance + calcLocal(modList, "BlockChance", "BASE", 0)
1440+
armourData.BlockChance = m_floor((self.base.armour.BlockChance + blockBase) * (1 + blockInc / 100))
14391441
end
14401442
if self.base.armour.MovementPenalty then
14411443
modList:NewMod("MovementSpeed", "INC", -self.base.armour.MovementPenalty, self.modSource, { type = "Condition", var = "IgnoreMovementPenalties", neg = true })

src/Data/ModCache.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2368,7 +2368,7 @@ c["10% reduced maximum Energy Shield"]={{[1]={flags=0,keywordFlags=0,name="Energ
23682368
c["10% reduced maximum Life"]={{[1]={flags=0,keywordFlags=0,name="Life",type="INC",value=-10}},nil}
23692369
c["10.5% increased Movement Speed"]={{[1]={flags=0,keywordFlags=0,name="MovementSpeed",type="BASE",value=10}},".5% increased "}
23702370
c["100% Chance to Cause Monster to Flee on Block"]={{}," to Cause Monster to Flee on Block "}
2371-
c["100% Chance to Cause Monster to Flee on Block +20% Chance to Block Attack Damage from Cursed Enemies"]={{[1]={[1]={actor="enemy",type="ActorCondition",var="Cursed"},flags=0,keywordFlags=0,name="BlockChance",type="BASE",value=100}}," to Cause Monster to Flee on Block +20% Chance "}
2371+
c["100% Chance to Cause Monster to Flee on Block +20% Chance to Block Attack Damage from Cursed Enemies"]={{[1]={[1]={actor="enemy",type="ActorCondition",var="Cursed"},flags=0,keywordFlags=0,name="BlockChance",type="BASE",value=100}}," to Cause Monster to Flee on Block +20% Attack Damage "}
23722372
c["100% Increased Armour"]={{[1]={flags=0,keywordFlags=0,name="Armour",type="INC",value=100}},nil}
23732373
c["100% Increased Armour and Energy Shield"]={{[1]={flags=0,keywordFlags=0,name="ArmourAndEnergyShield",type="INC",value=100}},nil}
23742374
c["100% Increased Evasion Rating"]={{[1]={flags=0,keywordFlags=0,name="Evasion",type="INC",value=100}},nil}
@@ -3392,7 +3392,7 @@ c["20% chance to Blind Enemies on Hit with Attacks 20% increased Blind Effect"]=
33923392
c["20% chance to Blind Enemies on Hit with Attacks 40% increased Damage with Hits and Ailments against Blinded Enemies"]={{[1]={[1]={actor="enemy",type="ActorCondition",var="Blinded"},flags=4,keywordFlags=0,name="Damage",type="BASE",value=20}}," to Blind Enemies with Attacks 40% increased with Hits and Ailments "}
33933393
c["20% chance to Blind Enemies with Off Hand Hits"]={{}," to Blind Enemies Hits "}
33943394
c["20% chance to Cover Rare or Unique Enemies in Ash for 10 Seconds on Hit"]={{}," to Cover Rare or Unique Enemies in Ash "}
3395-
c["20% chance to Cover Rare or Unique Enemies in Ash for 10 Seconds on Hit +6% Chance to Block Attack Damage"]={{[1]={flags=4,keywordFlags=0,name="BlockChance",type="BASE",value=20}}," to Cover Rare or Unique Enemies in Ash +6% Chance "}
3395+
c["20% chance to Cover Rare or Unique Enemies in Ash for 10 Seconds on Hit +6% Chance to Block Attack Damage"]={{[1]={flags=4,keywordFlags=0,name="BlockChance",type="BASE",value=20}}," to Cover Rare or Unique Enemies in Ash +6% Attack Damage "}
33963396
c["20% chance to Cover Rare or Unique Enemies in Ash for 10 Seconds on Hit Unaffected by Ignite"]={{}," to Cover Rare or Unique Enemies in Ash Unaffected by Ignite "}
33973397
c["20% chance to Cover Rare or Unique Enemies in Ash for 10 Seconds on Hit Unaffected by Ignite 20% increased Warcry Buff Effect"]={{[1]={flags=4,keywordFlags=0,name="BuffEffect",type="BASE",value=20}}," to Cover Rare or Unique Enemies in Ash Unaffected by Ignite 20% increased Warcry "}
33983398
c["20% chance to Cover Rare or Unique Enemies in Ash for 10 Seconds on Hit Unaffected by Ignite 20% increased Warcry Buff Effect 10% increased Strength"]={{[1]={flags=4,keywordFlags=0,name="BuffEffect",type="BASE",value=20}}," to Cover Rare or Unique Enemies in Ash Unaffected by Ignite 20% increased Warcry 10% increased Strength "}
@@ -3892,9 +3892,9 @@ c["25% chance that if you would gain Power Charges, you instead gain up to"]={{}
38923892
c["25% chance that if you would gain Power Charges, you instead gain up to your maximum number of Power Charges"]={{}," that if you would gain Power Charges, you instead gain up to your maximum number of Power Charges "}
38933893
c["25% chance to Aggravate Bleeding on targets you Critically Strike with Attacks"]={{}," to Aggravate Bleeding on targets you Critically Strike "}
38943894
c["25% chance to Aggravate Bleeding on targets you Hit with Attacks"]={{}," to Aggravate Bleeding on targets you Hit "}
3895-
c["25% chance to Aggravate Bleeding on targets you Hit with Attacks Gain 50% Chance to Block from Equipped Shield instead of the Shield's value"]={{[1]={flags=0,keywordFlags=65536,name="BlockChance",type="BASE",value=25}}," to Aggravate Bleeding on targets you Hit Gain 50% Chance from Equipped Shield instead of the Shield's value "}
3896-
c["25% chance to Aggravate Bleeding on targets you Hit with Attacks Gain 50% Chance to Block from Equipped Shield instead of the Shield's value Inherent Bonuses from Dual Wielding are doubled"]={{[1]={flags=0,keywordFlags=65536,name="BlockChance",type="BASE",value=25}}," to Aggravate Bleeding on targets you Hit Gain 50% Chance from Equipped Shield instead of the Shield's value Inherent Bonuses from Dual Wielding are doubled "}
3897-
c["25% chance to Aggravate Bleeding on targets you Hit with Attacks Gain 50% Chance to Block from Equipped Shield instead of the Shield's value Inherent Bonuses from Dual Wielding are doubled Deal 1% more Damage with Hits and Ailments to Rare and Unique Enemies for every 2 seconds they've ever been in your Presence, up to a maximum of 50%"]={{[1]={flags=0,keywordFlags=65536,name="BlockChance",type="BASE",value=25}}," to Aggravate Bleeding on targets you Hit Gain 50% Chance from Equipped Shield instead of the Shield's value Inherent Bonuses from Dual Wielding are doubled Deal 1% more Damage with Hits and Ailments to Rare and Unique Enemies for every 2 seconds they've ever been in your Presence, up to a maximum of 50% "}
3895+
c["25% chance to Aggravate Bleeding on targets you Hit with Attacks Gain 50% Chance to Block from Equipped Shield instead of the Shield's value"]={{[1]={flags=0,keywordFlags=65536,name="BlockChance",type="BASE",value=25}}," to Aggravate Bleeding on targets you Hit Gain 50% from Equipped Shield instead of the Shield's value "}
3896+
c["25% chance to Aggravate Bleeding on targets you Hit with Attacks Gain 50% Chance to Block from Equipped Shield instead of the Shield's value Inherent Bonuses from Dual Wielding are doubled"]={{[1]={flags=0,keywordFlags=65536,name="BlockChance",type="BASE",value=25}}," to Aggravate Bleeding on targets you Hit Gain 50% from Equipped Shield instead of the Shield's value Inherent Bonuses from Dual Wielding are doubled "}
3897+
c["25% chance to Aggravate Bleeding on targets you Hit with Attacks Gain 50% Chance to Block from Equipped Shield instead of the Shield's value Inherent Bonuses from Dual Wielding are doubled Deal 1% more Damage with Hits and Ailments to Rare and Unique Enemies for every 2 seconds they've ever been in your Presence, up to a maximum of 50%"]={{[1]={flags=0,keywordFlags=65536,name="BlockChance",type="BASE",value=25}}," to Aggravate Bleeding on targets you Hit Gain 50% from Equipped Shield instead of the Shield's value Inherent Bonuses from Dual Wielding are doubled Deal 1% more Damage with Hits and Ailments to Rare and Unique Enemies for every 2 seconds they've ever been in your Presence, up to a maximum of 50% "}
38983898
c["25% chance to Aggravate Bleeding on targets you Hit with Exerted Attacks"]={{}," to Aggravate Bleeding on targets you Hit with Exerted Attacks "}
38993899
c["25% chance to Avoid Elemental Ailments"]={{[1]={flags=0,keywordFlags=0,name="AvoidElementalAilments",type="BASE",value=25}},nil}
39003900
c["25% chance to Avoid Elemental Ailments while Phasing"]={{[1]={[1]={type="Condition",var="Phasing"},flags=0,keywordFlags=0,name="AvoidElementalAilments",type="BASE",value=25}},nil}

src/Modules/ModParser.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ local modNameList = {
320320
["to block attacks"] = "BlockChance",
321321
["to block attack damage"] = "BlockChance",
322322
["block chance"] = "BlockChance",
323+
["chance to block"] = "BlockChance",
323324
["block chance with staves"] = { "BlockChance", tag = { type = "Condition", var = "UsingStaff" } },
324325
["to block with staves"] = { "BlockChance", tag = { type = "Condition", var = "UsingStaff" } },
325326
["block chance against projectiles"] = "ProjectileBlockChance",

0 commit comments

Comments
 (0)