Skip to content

Commit e112b12

Browse files
DS-KoalaLocalIdentityDragoonWraithLocalIdentity
authored
Fixes unsupported Thorns calculations and related support interactions (#1778)
* Add support for thorns crit and ignore armour passives * Add thorns damage support and thorns-based support interactions * Fix thorns ailment handling and mana scaling (modflag not yet implemented) * Removed CannotBleed and CannotPoison from ThornsPlayer * Added support for Stag Idol's Bonded modifier (Thorns Damage has 40% chance to ignore Enemy Armour) * Update to use ModFlag.Thorns Changed the calcs to use a ModFlag as it reduces the amount of extra code required Still need to fix implementation for when Thorns damage is applied to hits * Fix crash * Fix Thornskin not working * Fix Quill Burst thorns damage calculation * Fix Quill Burst support so it won't be overwritten when re-exporting skills data * Support for Crackling Barrier support * Support for thorns damage from Scavenged Plating * Fix Quill Burst damage calculation more/better? * Fix thorns damage calculation to consider thorns-flagged skills * Add basic Barbs support, make Thorns skill unsupportable, remove some unused code * Fix issue Add back logic to hide thorns skill unless you have base damage in your build Fix calc offence logic and remove extra lines * Fix thorns mod finding logic * Fix Blistering Bond test --------- Co-authored-by: LocalIdentity <localidentity2@gmail.com> Co-authored-by: DragoonWraith (github: krryan) <dragoonwraith@gmail.com> Co-authored-by: LocalIdentity <31035929+LocalIdentity@users.noreply.github.com>
1 parent 195e801 commit e112b12

20 files changed

Lines changed: 498 additions & 61 deletions

spec/System/TestItemMods_spec.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,6 @@ describe("TetsItemMods", function()
684684
{variant:2}{range:0.5}Adds (8-12) to (16-18) Physical Damage
685685
{range:0.5}+(10-15) to Strength
686686
Causes Bleeding on Hit
687-
{range:0.5}(4-5) to (8-10) Physical Thorns damage
688687
]])
689688
build.itemsTab:AddDisplayItem()
690689
runCallback("OnFrame")

src/Data/Global.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ ModFlag.Spell = 0x0000000000000002
225225
ModFlag.Hit = 0x0000000000000004
226226
ModFlag.Dot = 0x0000000000000008
227227
ModFlag.Cast = 0x0000000000000010
228+
ModFlag.Thorns = 0x0000000000000020
228229
-- Damage sources
229230
ModFlag.Melee = 0x0000000000000100
230231
ModFlag.Area = 0x0000000000000200

src/Data/ModCache.lua

Lines changed: 42 additions & 41 deletions
Large diffs are not rendered by default.

src/Data/SkillStatMap.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ return {
10231023
mod("ImprovedSpellDamageAppliesToAttacks", "MAX", nil),
10241024
},
10251025
["additive_thorns_damage_modifiers_apply_to_attack_damage"] = {
1026-
flag("ThornsDamageAppliesToHits"),
1026+
flag("ThornsDamageApplyToAttackDamage"),
10271027
},
10281028
["active_skill_main_hand_weapon_damage_+%_final"] = {
10291029
mod("Damage", "MORE", nil, 0, 0, { type = "Condition", var = "MainHandAttack" }),

src/Data/Skills/act_str.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16047,6 +16047,7 @@ skills["RollingSlamPlayer"] = {
1604716047
skills["ScavengedPlatingPlayer"] = {
1604816048
name = "Scavenged Plating",
1604916049
baseTypeName = "Scavenged Plating",
16050+
grantsThornsDamage = true,
1605016051
icon = "Art/2DArt/SkillIcons/BruteScavengedPlating.dds",
1605116052
color = 1,
1605216053
description = "While active, uses fragments of armour scavenged from enemies to bolster your own. Fully Breaking an enemy's Armour grants you stacks of Scavenged Plating for a duration based on the enemy's rarity, and you gain Armour and Thorns per stack. Normal enemies grant 1 stack, Magic enemies grant 2 stacks, Rare enemies grant 5 stacks and Unique enemies grant 10 stacks.",
@@ -16107,6 +16108,12 @@ skills["ScavengedPlatingPlayer"] = {
1610716108
["scavenged_plating_armour_+%_final_per_stack"] = {
1610816109
mod("Armour", "MORE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Scavenged Plating" }, { type = "Multiplier", var = "ScavengedPlatingStacks", limitVar = "ScavengedPlatingStacksLimit" }),
1610916110
},
16111+
["scavenged_plating_thorns_minimum_physical_damage"] = {
16112+
mod("PhysicalMin", "BASE", nil, ModFlag.Thorns, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Scavenged Plating" }, { type = "Multiplier", var = "ScavengedPlatingStacks", limitVar = "ScavengedPlatingStacksLimit" }),
16113+
},
16114+
["scavenged_plating_thorns_maximum_physical_damage"] = {
16115+
mod("PhysicalMax", "BASE", nil, ModFlag.Thorns, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Scavenged Plating" }, { type = "Multiplier", var = "ScavengedPlatingStacks", limitVar = "ScavengedPlatingStacksLimit" }),
16116+
},
1611016117
["scavenged_plating_maximum_stacks_display"] = {
1611116118
mod("Multiplier:ScavengedPlatingStacksLimit", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Scavenged Plating"}),
1611216119
},
@@ -20753,4 +20760,4 @@ skills["WolfPackPlayer"] = {
2075320760
},
2075420761
},
2075520762
}
20756-
}
20763+
}

src/Data/Skills/other.lua

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9377,6 +9377,34 @@ skills["VoidIllusionSpawnPlayer"] = {
93779377
},
93789378
}
93799379
}
9380+
skills["ThornsPlayer"] = {
9381+
name = "Thorns",
9382+
hidden = true,
9383+
fromItem = true,
9384+
skillTypes = { [SkillType.Damage] = true },
9385+
cannotBeSupported = true,
9386+
qualityStats = {},
9387+
levels = {
9388+
[1] = { levelRequirement = 0 },
9389+
},
9390+
statSets = {
9391+
[1] = {
9392+
label = "Thorns",
9393+
incrementalEffectiveness = 0,
9394+
statDescriptionScope = "skill_stat_descriptions",
9395+
baseFlags = {
9396+
thorns = true,
9397+
},
9398+
baseMods = {
9399+
},
9400+
constantStats = {},
9401+
stats = {},
9402+
levels = {
9403+
[1] = {},
9404+
},
9405+
},
9406+
}
9407+
}
93809408

93819409
skills["MetaMirageDeadeyePlayer"] = {
93829410
name = "Mirage Deadeye",

src/Data/Skills/sup_int.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2347,6 +2347,7 @@ skills["TriggeredDeadlyCurrentPlayer"] = {
23472347
skills["SupportCracklingBarrierPlayer"] = {
23482348
name = "Crackling Barrier",
23492349
description = "Supports Channelling Skills. While Channelling Supported Skills, you gain Lightning Thorns based off of your maximum Mana.",
2350+
grantsThornsDamage = true,
23502351
color = 3,
23512352
support = true,
23522353
requireSkillTypes = { SkillType.Channel, },
@@ -2362,6 +2363,12 @@ skills["SupportCracklingBarrierPlayer"] = {
23622363
label = "Crackling Barrier",
23632364
incrementalEffectiveness = 0.054999999701977,
23642365
statDescriptionScope = "gem_stat_descriptions",
2366+
statMap = {
2367+
["return_%_of_maximum_mana_as_lightning_damage_to_attacker_while_channelling"] = {
2368+
mod("LightningMin", "BASE", nil, ModFlag.Thorns, 0, { type = "PercentStat", stat = "Mana", percent = 1 }, { type = "GlobalEffect", effectType = "Buff", effectName = "Crackling Barrier" }, { type = "Condition", var = "Channelling" }),
2369+
mod("LightningMax", "BASE", nil, ModFlag.Thorns, 0, { type = "PercentStat", stat = "Mana", percent = 1 }, { type = "GlobalEffect", effectType = "Buff", effectName = "Crackling Barrier" }, { type = "Condition", var = "Channelling" }),
2370+
},
2371+
},
23652372
baseFlags = {
23662373
},
23672374
constantStats = {
@@ -7991,4 +7998,4 @@ skills["SupportZenithPlayerTwo"] = {
79917998
},
79927999
},
79938000
}
7994-
}
8001+
}

src/Data/Skills/sup_str.lua

Lines changed: 116 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,11 @@ skills["SupportBarbsPlayer"] = {
541541
label = "Barbs I",
542542
incrementalEffectiveness = 0.054999999701977,
543543
statDescriptionScope = "gem_stat_descriptions",
544+
statMap = {
545+
["deal_thorns_damage_on_hit_for_X_hits_after_thorns_trigger"] = {
546+
-- handled by TriggeredBarbsPlayer as an additionalGrantedEffect hard-coded in Modules/Data.lua
547+
},
548+
},
544549
baseFlags = {
545550
},
546551
constantStats = {
@@ -554,6 +559,35 @@ skills["SupportBarbsPlayer"] = {
554559
},
555560
}
556561
}
562+
skills["TriggeredBarbsPlayer"] = {
563+
name = "Barbs I",
564+
hidden = true,
565+
description = "Deal your thorns damage.",
566+
skillTypes = { [SkillType.Damage] = true, [SkillType.SkillGrantedBySupport] = true, [SkillType.AttackInPlace] = true },
567+
cannotBeSupported = true,
568+
qualityStats = {},
569+
levels = {
570+
[1] = { levelRequirement = 0 },
571+
},
572+
statSets = {
573+
[1] = {
574+
label = "Barbs I",
575+
incrementalEffectiveness = 0,
576+
statDescriptionScope = "skill_stat_descriptions",
577+
baseFlags = {
578+
thorns = true,
579+
},
580+
baseMods = {
581+
},
582+
constantStats = {},
583+
stats = {},
584+
levels = {
585+
[1] = {},
586+
},
587+
},
588+
},
589+
}
590+
557591
skills["SupportBarbsPlayerTwo"] = {
558592
name = "Barbs II",
559593
description = "Supports Melee Strike Skills. Supported Skills deal your Thorns Damage on Hit after you've Retaliated with Thorns Damage.",
@@ -572,6 +606,11 @@ skills["SupportBarbsPlayerTwo"] = {
572606
label = "Barbs II",
573607
incrementalEffectiveness = 0.054999999701977,
574608
statDescriptionScope = "gem_stat_descriptions",
609+
statMap = {
610+
["deal_thorns_damage_on_hit_for_X_hits_after_thorns_trigger"] = {
611+
-- handled by TriggeredBarbsPlayerTwo as an additionalGrantedEffect hard-coded in Modules/Data.lua
612+
},
613+
},
575614
baseFlags = {
576615
},
577616
constantStats = {
@@ -585,6 +624,35 @@ skills["SupportBarbsPlayerTwo"] = {
585624
},
586625
}
587626
}
627+
skills["TriggeredBarbsPlayerTwo"] = {
628+
name = "Barbs II",
629+
hidden = true,
630+
description = "Deal your thorns damage.",
631+
skillTypes = { [SkillType.Damage] = true, [SkillType.SkillGrantedBySupport] = true, [SkillType.AttackInPlace] = true },
632+
cannotBeSupported = true,
633+
qualityStats = {},
634+
levels = {
635+
[1] = { levelRequirement = 0 },
636+
},
637+
statSets = {
638+
[1] = {
639+
label = "Barbs II",
640+
incrementalEffectiveness = 0,
641+
statDescriptionScope = "skill_stat_descriptions",
642+
baseFlags = {
643+
thorns = true,
644+
},
645+
baseMods = {
646+
},
647+
constantStats = {},
648+
stats = {},
649+
levels = {
650+
[1] = {},
651+
},
652+
},
653+
},
654+
}
655+
588656
skills["SupportBarbsPlayerThree"] = {
589657
name = "Barbs III",
590658
description = "Supports Melee Strike Skills. Supported Skills deal your Thorns Damage on Hit twice after you've Retaliated with Thorns Damage.",
@@ -603,6 +671,11 @@ skills["SupportBarbsPlayerThree"] = {
603671
label = "Barbs III",
604672
incrementalEffectiveness = 0.054999999701977,
605673
statDescriptionScope = "gem_stat_descriptions",
674+
statMap = {
675+
["deal_thorns_damage_twice_on_hit_for_X_hits_after_thorns_trigger"] = {
676+
-- handled by TriggeredBarbsPlayerThree as an additionalGrantedEffect hard-coded in Modules/Data.lua
677+
},
678+
},
606679
baseFlags = {
607680
},
608681
constantStats = {
@@ -616,6 +689,36 @@ skills["SupportBarbsPlayerThree"] = {
616689
},
617690
}
618691
}
692+
skills["TriggeredBarbsPlayerThree"] = {
693+
name = "Barbs III",
694+
hidden = true,
695+
description = "Deal twice your thorns damage.",
696+
skillTypes = { [SkillType.Damage] = true, [SkillType.SkillGrantedBySupport] = true, [SkillType.AttackInPlace] = true },
697+
cannotBeSupported = true,
698+
qualityStats = {},
699+
levels = {
700+
[1] = { levelRequirement = 0 },
701+
},
702+
statSets = {
703+
[1] = {
704+
label = "Barbs III",
705+
incrementalEffectiveness = 0,
706+
statDescriptionScope = "skill_stat_descriptions",
707+
baseFlags = {
708+
thorns = true,
709+
},
710+
baseMods = {
711+
mod("DoubleDamageChance", "BASE", 100, 0, 0),
712+
},
713+
constantStats = {},
714+
stats = {},
715+
levels = {
716+
[1] = {},
717+
},
718+
},
719+
},
720+
}
721+
619722
skills["SupportBattershoutPlayer"] = {
620723
name = "Battershout",
621724
description = "Supports Warcry Skills. Supported Skills Consume Fully Broken Armour to trigger Physical Damage explosions on Enemies within their range but cannot themselves Break Armour. ",
@@ -4976,6 +5079,11 @@ skills["SupportQuillburstPlayer"] = {
49765079
label = "Quill Burst",
49775080
incrementalEffectiveness = 0.054999999701977,
49785081
statDescriptionScope = "gem_stat_descriptions",
5082+
statMap = {
5083+
["trigger_spiked_gauntlets_for_X_hits_after_thorns_trigger"] = {
5084+
flag("EnableTriggeredQuillburst"),
5085+
},
5086+
},
49795087
baseFlags = {
49805088
},
49815089
constantStats = {
@@ -5006,7 +5114,13 @@ skills["TriggeredQuillburstPlayer"] = {
50065114
label = "Quill Burst",
50075115
incrementalEffectiveness = 0.054999999701977,
50085116
statDescriptionScope = "triggered_spiked_gauntlets",
5117+
statMap = {
5118+
["display_skill_deals_thorns_damage"] = {
5119+
-- display only
5120+
},
5121+
},
50095122
baseFlags = {
5123+
thorns = true,
50105124
},
50115125
constantStats = {
50125126
{ "triggered_by_spiked_gauntlets_support_%", 100 },
@@ -6714,7 +6828,7 @@ skills["SupportThornskinPlayer"] = {
67146828
statDescriptionScope = "gem_stat_descriptions",
67156829
statMap = {
67166830
["support_thorns_spirit_cost_thorns_damage_+%"] = {
6717-
mod("ThornsDamage", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Thornskin I" }),
6831+
mod("Damage", "INC", nil, ModFlag.Thorns, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Thornskin I" }),
67186832
},
67196833
},
67206834
baseFlags = {
@@ -6749,7 +6863,7 @@ skills["SupportThornskinPlayerTwo"] = {
67496863
statDescriptionScope = "gem_stat_descriptions",
67506864
statMap = {
67516865
["support_thorns_spirit_cost_thorns_damage_+%"] = {
6752-
mod("ThornsDamage", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Thornskin II" }),
6866+
mod("Damage", "INC", nil, ModFlag.Thorns, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Thornskin II" }),
67536867
},
67546868
},
67556869
baseFlags = {

src/Export/Skills/act_str.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,12 +925,19 @@ end,
925925
#skillEnd
926926

927927
#skill ScavengedPlatingPlayer
928+
grantsThornsDamage = true,
928929
#set ScavengedPlatingPlayer
929930
#flags duration
930931
statMap = {
931932
["scavenged_plating_armour_+%_final_per_stack"] = {
932933
mod("Armour", "MORE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Scavenged Plating" }, { type = "Multiplier", var = "ScavengedPlatingStacks", limitVar = "ScavengedPlatingStacksLimit" }),
933934
},
935+
["scavenged_plating_thorns_minimum_physical_damage"] = {
936+
mod("PhysicalMin", "BASE", nil, ModFlag.Thorns, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Scavenged Plating" }, { type = "Multiplier", var = "ScavengedPlatingStacks", limitVar = "ScavengedPlatingStacksLimit" }),
937+
},
938+
["scavenged_plating_thorns_maximum_physical_damage"] = {
939+
mod("PhysicalMax", "BASE", nil, ModFlag.Thorns, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Scavenged Plating" }, { type = "Multiplier", var = "ScavengedPlatingStacks", limitVar = "ScavengedPlatingStacksLimit" }),
940+
},
934941
["scavenged_plating_maximum_stacks_display"] = {
935942
mod("Multiplier:ScavengedPlatingStacksLimit", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", effectName = "Scavenged Plating"}),
936943
},
@@ -1231,4 +1238,4 @@ statMap = {
12311238
#set WolfPackPlayer
12321239
#flags minion
12331240
#mods
1234-
#skillEnd
1241+
#skillEnd

src/Export/Skills/other.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -801,3 +801,32 @@ statMap = {
801801
#flags
802802
#mods
803803
#skillEnd
804+
805+
skills["ThornsPlayer"] = {
806+
name = "Thorns",
807+
hidden = true,
808+
fromItem = true,
809+
skillTypes = { [SkillType.Damage] = true },
810+
cannotBeSupported = true,
811+
qualityStats = {},
812+
levels = {
813+
[1] = { levelRequirement = 0 },
814+
},
815+
statSets = {
816+
[1] = {
817+
label = "Thorns",
818+
incrementalEffectiveness = 0,
819+
statDescriptionScope = "skill_stat_descriptions",
820+
baseFlags = {
821+
thorns = true,
822+
},
823+
baseMods = {
824+
},
825+
constantStats = {},
826+
stats = {},
827+
levels = {
828+
[1] = {},
829+
},
830+
},
831+
}
832+
}

0 commit comments

Comments
 (0)