Skip to content

Commit 4ce3362

Browse files
author
LocalIdentity
committed
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
1 parent ff97c9a commit 4ce3362

7 files changed

Lines changed: 51 additions & 46 deletions

File tree

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("ThornsModifiersApplyToHits"),
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: 2 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.",
@@ -20759,4 +20760,4 @@ skills["WolfPackPlayer"] = {
2075920760
},
2076020761
},
2076120762
}
20762-
}
20763+
}

src/Data/Skills/sup_int.lua

Lines changed: 2 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, },
@@ -7997,4 +7998,4 @@ skills["SupportZenithPlayerTwo"] = {
79977998
},
79987999
},
79998000
}
8000-
}
8001+
}

src/Export/Skills/act_str.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,7 @@ end,
925925
#skillEnd
926926

927927
#skill ScavengedPlatingPlayer
928+
grantsThornsDamage = true,
928929
#set ScavengedPlatingPlayer
929930
#flags duration
930931
statMap = {
@@ -1237,4 +1238,4 @@ statMap = {
12371238
#set WolfPackPlayer
12381239
#flags minion
12391240
#mods
1240-
#skillEnd
1241+
#skillEnd

src/Export/Skills/sup_int.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ statMap = {
413413
#skillEnd
414414

415415
#skill SupportCracklingBarrierPlayer
416+
grantsThornsDamage = true,
416417
#set SupportCracklingBarrierPlayer
417418
statMap = {
418419
["return_%_of_maximum_mana_as_lightning_damage_to_attacker_while_channelling"] = {
@@ -1521,4 +1522,4 @@ statMap = {
15211522
#skill SupportZenithPlayerTwo
15221523
#set SupportZenithPlayerTwo
15231524
#mods
1524-
#skillEnd
1525+
#skillEnd

src/Modules/CalcOffence.lua

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -761,33 +761,10 @@ function calcs.offence(env, actor, activeSkill)
761761
end
762762

763763
-- Apply thorns-derived modifiers to hits
764-
if skillModList:Flag(nil, "thorns") then
765-
-- % increased Thorns damage
764+
if skillModList:Flag(nil, "ThornsDamageApplyToAttackDamage") then
766765
for _, value in ipairs(skillModList:Tabulate("INC", { flags = ModFlag.Thorns }, "Damage")) do
767766
local mod = value.mod
768-
skillModList:NewMod("Damage", "INC", mod.value, mod.source, ModFlag.Hit, mod.keywordFlags, unpack(mod))
769-
end
770-
771-
-- Thorns crit chance
772-
for _, value in ipairs(skillModList:Tabulate("BASE", { flags = ModFlag.Thorns }, "CritChance")) do
773-
local mod = value.mod
774-
skillModList:NewMod("CritChance", "BASE", mod.value, mod.source, mod.flags, mod.keywordFlags, unpack(mod))
775-
end
776-
for _, value in ipairs(skillModList:Tabulate("INC", { flags = ModFlag.Thorns }, "CritChance")) do
777-
local mod = value.mod
778-
skillModList:NewMod("CritChance", "INC", mod.value, mod.source, mod.flags, mod.keywordFlags, unpack(mod))
779-
end
780-
781-
-- Thorns crit multiplier
782-
for _, value in ipairs(skillModList:Tabulate("INC", { flags = ModFlag.Thorns }, "CritMultiplier")) do
783-
local mod = value.mod
784-
skillModList:NewMod("CritMultiplier", "INC", mod.value, mod.source, mod.flags, mod.keywordFlags, unpack(mod))
785-
end
786-
787-
-- Thorns chance to ignore enemy armour
788-
for _, value in ipairs(skillModList:Tabulate("BASE", { flags = ModFlag.Thorns }, "ChanceToIgnoreEnemyArmour")) do
789-
local mod = value.mod
790-
skillModList:NewMod("ChanceToIgnoreEnemyArmour", "BASE", mod.value, mod.source, mod.flags, mod.keywordFlags, unpack(mod))
767+
skillModList:NewMod("Damage", "INC", mod.value, mod.source, bor(band(mod.flags, bnot(ModFlag.Thorns)), ModFlag.Attack), mod.keywordFlags, unpack(mod))
791768
end
792769
end
793770

src/Modules/CalcSetup.lua

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,31 +1491,55 @@ function calcs.initEnv(build, mode, override, specEnv)
14911491
end
14921492

14931493
do
1494+
local hasThornsDamage = env.modDB:HasMod("BASE", { flags = ModFlag.Thorns }, "PhysicalMin", "PhysicalMax", "FireMin", "FireMax", "ColdMin", "ColdMax", "LightningMin", "LightningMax", "ChaosMin", "ChaosMax")
1495+
if not hasThornsDamage then
1496+
for _, socketGroup in pairs(build.skillsTab.socketGroupList) do
1497+
if socketGroup.source ~= "Thorns" and socketGroup.enabled ~= false then
1498+
for _, gem in ipairs(socketGroup.gemList) do
1499+
local grantedEffect = gem.enabled ~= false and env.data.skills[gem.skillId]
1500+
if grantedEffect and grantedEffect.grantsThornsDamage then
1501+
hasThornsDamage = true
1502+
break
1503+
end
1504+
end
1505+
end
1506+
if hasThornsDamage then
1507+
break
1508+
end
1509+
end
1510+
end
1511+
14941512
local group
14951513
for _, socketGroup in pairs(build.skillsTab.socketGroupList) do
14961514
if socketGroup.source == "Thorns" then
14971515
group = socketGroup
14981516
break
14991517
end
15001518
end
1501-
if not group then
1502-
group = { label = "Thorns", enabled = true, gemList = { }, source = "Thorns", noSupports = true }
1503-
t_insert(build.skillsTab.socketGroupList, group)
1504-
end
1519+
if not hasThornsDamage then
1520+
if group then
1521+
wipeTable(group.gemList)
1522+
end
1523+
else
1524+
if not group then
1525+
group = { label = "Thorns", enabled = true, gemList = { }, source = "Thorns", noSupports = true }
1526+
t_insert(build.skillsTab.socketGroupList, group)
1527+
end
15051528

1506-
group.thornsSources = env.thornsSources
1507-
wipeTable(group.gemList)
1529+
group.thornsSources = env.thornsSources
1530+
wipeTable(group.gemList)
15081531

1509-
local activeGemInstance = {
1510-
skillId = "ThornsPlayer",
1511-
quality = 0,
1512-
enabled = true,
1513-
level = 1,
1514-
triggered = true,
1515-
}
1516-
t_insert(group.gemList, activeGemInstance)
1517-
markList[group] = true
1518-
build.skillsTab:ProcessSocketGroup(group)
1532+
local activeGemInstance = {
1533+
skillId = "ThornsPlayer",
1534+
quality = 0,
1535+
enabled = true,
1536+
level = 1,
1537+
triggered = true,
1538+
}
1539+
t_insert(group.gemList, activeGemInstance)
1540+
markList[group] = true
1541+
build.skillsTab:ProcessSocketGroup(group)
1542+
end
15191543
end
15201544

15211545

0 commit comments

Comments
 (0)