You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support for "Penetrate" (Amazon Ascendancy Notable) (#932)
* Adjust SumInternal from ModDB to work with source that contain multiple ":"
* Add isMartialWeapon local function to CalcOffence
* Add certain weapon base stats to output in CalcOffence for "PerStat" mods
* Add support for generic "attacks using your weapons" mods via preFlag
* Add support for "Penetrate" (Amazon Ascendancy Notable)
* Fix typo "calssified" to "classified"
---------
Co-authored-by: majochem <majochem@users.noreply.github.com>
ifmod.type==modTypeandband(flags, mod.flags) ==mod.flagsandMatchKeywordFlags(keywordFlags, mod.keywordFlags) and (notsourceor ( mod.sourceandmod.source:match("[^:]+") ==source )) then
99
+
ifmod.type==modTypeandband(flags, mod.flags) ==mod.flagsandMatchKeywordFlags(keywordFlags, mod.keywordFlags) and (notsourceor ( mod.sourceand(mod.source:match("[^:]+") ==sourceormod.source==source))) then
Copy file name to clipboardExpand all lines: src/Data/ModCache.lua
+2-4Lines changed: 2 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -3452,8 +3452,8 @@ c["Attacks have +1% to Critical Hit Chance"]={{[1]={flags=1,keywordFlags=0,name=
3452
3452
c["Attacks have 10% chance to Maim on Hit"]={{}," to Maim "}
3453
3453
c["Attacks have 25% chance to Maim on Hit"]={{}," to Maim "}
3454
3454
c["Attacks used by Totems have 4% increased Attack Speed"]={{[1]={flags=1,keywordFlags=16384,name="Speed",type="INC",value=4}},nil}
3455
-
c["Attacks using your Weapons have Added Physical Damage equal"]={nil,"Attacks using your Weapons have Added Physical Damage equal "}
3456
-
c["Attacks using your Weapons have Added Physical Damage equal to 25% of the Accuracy Rating on the Weapon"]={nil,"Attacks using your Weapons have Added Physical Damage equal to 25% of the Accuracy Rating on the Weapon "}
3455
+
c["Attacks using your Weapons have Added Physical Damage equal"]={nil,"Added Physical Damage equal "}
3456
+
c["Attacks using your Weapons have Added Physical Damage equal to 25% of the Accuracy Rating on the Weapon"]={{[1]={[1]={percent="25",stat="AccuracyOnWeapon 1",type="PercentStat"},[2]={neg=true,skillType=167,type="SkillType"},[3]={type="Condition",var="MainHandAttack"},flags=1,keywordFlags=0,name="PhysicalMin",type="BASE",value=1},[2]={[1]={percent="25",stat="AccuracyOnWeapon 1",type="PercentStat"},[2]={neg=true,skillType=167,type="SkillType"},[3]={type="Condition",var="MainHandAttack"},flags=1,keywordFlags=0,name="PhysicalMax",type="BASE",value=1},[3]={[1]={percent="25",stat="AccuracyOnWeapon 2",type="PercentStat"},[2]={neg=true,skillType=167,type="SkillType"},[3]={type="Condition",var="OffHandAttack"},flags=1,keywordFlags=0,name="PhysicalMin",type="BASE",value=1},[4]={[1]={percent="25",stat="AccuracyOnWeapon 2",type="PercentStat"},[2]={neg=true,skillType=167,type="SkillType"},[3]={type="Condition",var="OffHandAttack"},flags=1,keywordFlags=0,name="PhysicalMax",type="BASE",value=1}},nil}
3457
3457
c["Attacks with this Weapon gain 50% of Physical damage as Extra damage of each Element"]={{[1]={[1]={type="Condition",var="{Hand}Attack"},[2]={skillType=1,type="SkillType"},flags=0,keywordFlags=0,name="PhysicalDamage",type="BASE",value=50}}," as Extra damage of each Element "}
3458
3458
c["Attribute Requirements of Gems can be satisified by your highest Attribute"]={{[1]={flags=0,keywordFlags=0,name="GemAttributeRequirementsSatisfiedByHighestAttribute",type="FLAG",value=true}},nil}
3459
3459
c["Aura Skills have 1% more Aura Effect per 2% of maximum Mana they Reserve"]={{[1]={[1]={skillType=39,type="SkillType"},[2]={div=2,stat="ManaReservedPercent",type="PerStat"},flags=0,keywordFlags=0,name="AuraEffect",type="MORE",value=1}},nil}
@@ -4678,8 +4678,6 @@ c["of their maximum Life as Physical Damage"]={nil,"of their maximum Life as Phy
4678
4678
c["of their maximum Life as Physical Damage Chance is doubled against Undead and Demons"]={nil,"of their maximum Life as Physical Damage Chance is doubled against Undead and Demons "}
4679
4679
c["the enemy's Power for 6 seconds, up to a total of 500"]={nil,"the enemy's Power for 6 seconds, up to a total of 500 "}
4680
4680
c["the same damage to enemies within 1.8 metres"]={nil,"the same damage to enemies within 1.8 metres "}
4681
-
c["to 25% of the Accuracy Rating on the Weapon"]={nil,"to 25% of the Accuracy Rating on the Weapon "}
4682
-
c["to 25% of your main hand Weapon's Damage"]={nil,"to 25% of your main hand Weapon's Damage "}
4683
4681
c["until you take no Damage to Life for 5 seconds"]={nil,"until you take no Damage to Life for 5 seconds "}
4684
4682
c["your Ailments on them"]={nil,"your Ailments on them "}
4685
4683
c["your Ailments on them 30% reduced Duration of Ignite, Shock and Chill on Enemies"]={nil,"your Ailments on them 30% reduced Duration of Ignite, Shock and Chill on Enemies "}
Copy file name to clipboardExpand all lines: src/Modules/CalcOffence.lua
+34Lines changed: 34 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -527,6 +527,22 @@ function calcs.offence(env, actor, activeSkill)
527
527
func(activeSkill, output, breakdown)
528
528
end
529
529
end
530
+
-- Checks if a given item is classified as a martial weapon base on global data.weaponTypeInfo table
531
+
-- Note: long-term it might be better to add "MartialWeapon" flags to items instead potentially once PR #688 is complete
532
+
---@paramitemtable @item as contained in actor.itemList
533
+
---@returnboolean
534
+
localfunctionisMartialWeapon(item)
535
+
localitemType=item.typeor"None"
536
+
ifitemType=="Staff" andnot (item.base.subType=="Warstaff" or (item.baseNameanditem.baseName:find("Quarterstaff"))) thenreturnfalseend-- Workaround to rule out caster staves
537
+
localnonMartialWeapons= {"None", "Wand", "Fishing Rod" } -- filter out other non-martial bases
538
+
for_, valinpairs(nonMartialWeapons) do
539
+
ifval==itemTypethenreturnfalseend
540
+
end
541
+
forkey, _inpairs(data.weaponTypeInfo) do
542
+
ifitemType==keythenreturntrueend
543
+
end
544
+
returnfalse
545
+
end
530
546
531
547
runSkillFunc("initialFunc")
532
548
@@ -617,6 +633,24 @@ function calcs.offence(env, actor, activeSkill)
617
633
end
618
634
end
619
635
end
636
+
-- Add weapon base stats to output for use in mods like Tactician's ""Watch How I Do It" Ascendancy notable" and Amazon's "Penetrate"
637
+
-- Note: This might run into issues with Energy Blade or similar mechanics that could "replace" the weapon items, but it's hard to test because PoE2 doesn't have those mechanics yet
638
+
foriinpairs({ "1", "2" }) do
639
+
-- Section for martial weapons only for now
640
+
ifactor.itemList["Weapon " ..i] andisMartialWeapon(actor.itemList["Weapon " ..i]) then
641
+
-- Add base min and max damage
642
+
for_, damageTypeinipairs(dmgTypeList) do
643
+
ifactor.itemList["Weapon " ..i] andactor["weaponData" ..i][damageType.."Min"] then
["chance to hit with attacks can exceed 100%%"] = {flag("Condition:HitChanceCanExceed100", { type = "Skilltype", skillType = SkillType.Attack})},
2412
2413
["gain additional critical hit chance equal to (%d+)%% of excess chance to hit with attacks"] = function(num) return { mod("CritChance", "BASE", 0.01 * num, { type = "Multiplier", var = "ExcessHitChance" }, { type = "SkillType", skillType = SkillType.Attack})} end,
2414
+
["attacks using your weapons have added (%a+) damage equal to (%d+)%% of the accuracy rating on the weapon"] = function(_, dmgType, num) return {
2415
+
mod(firstToUpper(dmgType) .. "Min", "BASE", 1, nil, ModFlag.Attack, { type = "PercentStat", stat = "AccuracyOnWeapon 1", percent = num }, { type = "SkillType", skillType = SkillType.NonWeaponAttack, neg = true } , { type = "Condition", var = "MainHandAttack" }),
2416
+
mod(firstToUpper(dmgType) .. "Max", "BASE", 1, nil, ModFlag.Attack, { type = "PercentStat", stat = "AccuracyOnWeapon 1", percent = num }, { type = "SkillType", skillType = SkillType.NonWeaponAttack, neg = true } , { type = "Condition", var = "MainHandAttack" }),
2417
+
mod(firstToUpper(dmgType) .. "Min", "BASE", 1, nil, ModFlag.Attack, { type = "PercentStat", stat = "AccuracyOnWeapon 2", percent = num }, { type = "SkillType", skillType = SkillType.NonWeaponAttack, neg = true } , { type = "Condition", var = "OffHandAttack" }),
2418
+
mod(firstToUpper(dmgType) .. "Max", "BASE", 1, nil, ModFlag.Attack, { type = "PercentStat", stat = "AccuracyOnWeapon 2", percent = num }, { type = "SkillType", skillType = SkillType.NonWeaponAttack, neg = true } , { type = "Condition", var = "OffHandAttack" }),
0 commit comments