Skip to content

Commit d7b6c98

Browse files
committed
Merge branch 'dev' into hollowPalm
2 parents 7063de0 + 0eecb27 commit d7b6c98

78 files changed

Lines changed: 1281 additions & 1088 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/modSyntax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Often a mod will only apply under certain conditions, apply multiple times based
6060
* effectEnemyCond: Specify a condition so this mod applies to the enemy when that condition is fulfilled
6161
* effectStackVar: Multiplies the mod by this variable (usually another mod)
6262
* modCond: Apply the mod when the actor has this condition
63-
* unscaleable: boolean that determines whether this buff can be scaled by buff effect
63+
* unscalable: boolean that determines whether this buff can be scaled by buff effect
6464
* DistanceRamp: A rare type that is used on skills and effects that do different things at different distances from the character
6565
* ramp: Numbers to multiply the mod by at different distances. e.g. `ramp = {{35,0},{70,1}}` means the mod does nothing at 35 units, but has its full value at 70 units.
6666
* ModFlagOr: Used when you only need one ModFlag to match, e.g. `["with axes or swords"] = { flags = ModFlag.Hit, tag = { type = "ModFlagOr", modFlags = bor(ModFlag.Axe, ModFlag.Sword) } },` needs `Hit`, but can use either of the other two flags

spec/System/TestAttacks_spec.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ describe("TestAttacks", function()
88
end)
99

1010
it("creates an item and has the correct crit chance", function()
11-
assert.are.equals(build.calcsTab.mainOutput.CritChance, 0)
11+
assert.are.equals(build.calcsTab.mainOutput.CritChance, data.unarmedWeaponData[0].CritChance * build.calcsTab.mainOutput.HitChance / 100)
1212
build.itemsTab:CreateDisplayItemFromRaw([[
1313
New Item
1414
Heavy Bow

spec/System/TestItemMods_spec.lua

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,48 @@ describe("TetsItemMods", function()
176176

177177
assert.are_not.equals(baseLife, build.calcsTab.mainOutput.Life)
178178
end)
179+
180+
it("globalLimit mods", function()
181+
build.configTab.input.customMods = [[
182+
-1000% to cold resistance
183+
]]
184+
build.configTab:BuildModList()
185+
build.itemsTab:CreateDisplayItemFromRaw([[Replica Nebulis
186+
Clasped Sceptre
187+
League: Heist
188+
Quality: 20
189+
Sockets: B-B-B
190+
LevelReq: 68
191+
Implicits: 1
192+
40% increased Elemental Damage
193+
{fractured}{range:1}(15-20)% increased Cast Speed
194+
{range:1}(15-20)% increased Cold Damage per 1% Missing Cold Resistance, up to a maximum of 300%
195+
{range:1}(15-20)% increased Fire Damage per 1% Missing Fire Resistance, up to a maximum of 300%]])
196+
build.itemsTab:AddDisplayItem()
197+
build.skillsTab:PasteSocketGroup("Slot: Weapon 1\nFireball 20/0 Default 1\n")
198+
runCallback("OnFrame")
199+
200+
assert.are_not.equals(340, build.calcsTab.mainEnv.modDB:Sum("INC", "FireDamage"))
201+
assert.are_not.equals(340, build.calcsTab.mainEnv.modDB:Sum("INC", "ColdDamage"))
202+
203+
newBuild()
204+
205+
build.configTab.input.customMods = [[
206+
Gain 25% increased Armour per 5 Power for 8 seconds when you Warcry, up to a maximum of 100%
207+
Warcries have infinite Power
208+
warcries grant arcane surge to you and allies, with 10% increased effect per 5 power, up to 100%
209+
]]
210+
build.configTab:BuildModList()
211+
build.itemsTab:CreateDisplayItemFromRaw([[
212+
New Item
213+
Fur Plate
214+
Armour: 60
215+
]])
216+
build.itemsTab:AddDisplayItem()
217+
build.skillsTab:PasteSocketGroup("Arc 20/0 Default 1")
218+
219+
assert.are_not.equals(20, build.calcsTab.mainEnv.modDB:Sum("MORE", { flags = ModFlag.Cast }, "Speed"))
220+
assert.are_not.equals(120, build.calcsTab.mainOutput.Armour)
221+
runCallback("OnFrame")
222+
end)
179223
end)

src/Classes/GemSelectControl.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ end)
4848

4949
function GemSelectClass:CalcOutputWithThisGem(calcFunc, gemData, useFullDPS)
5050
local gemList = self.skillsTab.displayGroup.gemList
51+
local displayGemList = self.skillsTab.displayGroup.displayGemList
5152
local oldGem
5253
if gemList[self.index] then
5354
oldGem = copyTable(gemList[self.index], true)
@@ -82,7 +83,9 @@ function GemSelectClass:CalcOutputWithThisGem(calcFunc, gemData, useFullDPS)
8283
else
8384
gemList[self.index] = nil
8485
end
85-
86+
87+
self.skillsTab.displayGroup.displayGemList = displayGemList
88+
8689
return output, gemInstance
8790
end
8891

src/Classes/ImportTab.lua

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,11 @@ function ImportTabClass:ImportItemsAndSkills(charData)
733733
gemInstance.nameSpec = self.build.data.gems[gemId].name
734734
for _, property in pairs(skillData.properties) do
735735
if property.name == "Level" then
736-
gemInstance.level = tonumber(property.values[1][1]:match("%d+"))
736+
if skillData.properties[_ + 1] and skillData.properties[_ + 1].values[1][1]:match("(%d+) Level[s]? from Gem") then
737+
gemInstance.level = tonumber(skillData.properties[_ + 1].values[1][1]:match("(%d+) Level[s]? from Gem"))
738+
else
739+
gemInstance.level = tonumber(property.values[1][1]:match("%d+"))
740+
end
737741
elseif escapeGGGString(property.name) == "Quality" then
738742
gemInstance.quality = tonumber(property.values[1][1]:match("%d+"))
739743
end
@@ -935,6 +939,7 @@ function ImportTabClass:ImportItem(itemData, slotName)
935939
item.mirrored = itemData.mirrored
936940
item.corrupted = itemData.corrupted
937941
item.fractured = itemData.fractured
942+
item.desecrated = itemData.desecrated
938943
if itemData.sockets and itemData.sockets[1] then
939944
item.sockets = { }
940945
item.itemSocketCount = 0
@@ -1006,6 +1011,14 @@ function ImportTabClass:ImportItem(itemData, slotName)
10061011
end
10071012
end
10081013
end
1014+
if itemData.desecratedMods then
1015+
for _, line in ipairs(itemData.desecratedMods) do
1016+
for line in line:gmatch("[^\n]+") do
1017+
local modList, extra = modLib.parseMod(line)
1018+
t_insert(item.explicitModLines, { line = line, extra = extra, mods = modList or { }, desecrated = true })
1019+
end
1020+
end
1021+
end
10091022

10101023
if itemData.grantedSkills then
10111024
for _, grantedSkillInfo in ipairs(itemData.grantedSkills) do

src/Classes/Item.lua

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ local ItemClass = newClass("Item", function(self, raw, rarity, highQuality)
5757
end)
5858

5959
local lineFlags = {
60-
["custom"] = true, ["fractured"] = true, ["enchant"] = true, ["implicit"] = true, ["rune"] = true,
60+
["custom"] = true, ["fractured"] = true, ["desecrated"] = true, ["enchant"] = true, ["implicit"] = true, ["rune"] = true,
6161
}
6262

6363
-- Special function to store unique instances of modifier on specific item slots
@@ -383,6 +383,8 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
383383
self.corrupted = true
384384
elseif line == "Fractured Item" then
385385
self.fractured = true
386+
elseif line == "Desecrated Item" then
387+
self.desecrated = true
386388
elseif line == "Requirements:" then
387389
-- nothing to do
388390
else
@@ -1154,12 +1156,16 @@ function ItemClass:BuildRaw()
11541156
if modLine.fractured then
11551157
line = "{fractured}" .. line
11561158
end
1159+
if modLine.desecrated then
1160+
line = "{desecrated}" .. line
1161+
end
11571162
if modLine.variantList then
11581163
local varSpec
11591164
for varId in pairs(modLine.variantList) do
11601165
varSpec = (varSpec and varSpec .. "," or "") .. varId
11611166
end
1162-
line = "{variant:" .. varSpec .. "}" .. line
1167+
local var = "{variant:" .. varSpec .. "}"
1168+
line = var .. line:gsub("\n", "\n" .. var) -- Variants that go over 1 line need to have the gsub to fix there being no "variant:" at the start
11631169
end
11641170
if modLine.modTags and #modLine.modTags > 0 then
11651171
line = "{tags:" .. table.concat(modLine.modTags, ",") .. "}" .. line

src/Classes/ItemDBControl.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ function ItemDBClass:DoesItemMatchFilters(item)
133133
if (self.controls.requirement.selIndex == 2 or self.controls.requirement.selIndex == 4) and item.requirements.level and item.requirements.level > self.itemsTab.build.characterLevel then
134134
return false
135135
end
136-
if self.controls.requirement.selIndex > 2 and item.requirements and (item.requirements.str > self.itemsTab.build.calcsTab.mainOutput.Str or item.requirements.dex > self.itemsTab.build.calcsTab.mainOutput.Dex or item.requirements.int > self.itemsTab.build.calcsTab.mainOutput.Int) then
136+
if self.controls.requirement.selIndex > 2 and item.requirements and (item.requirements.strMod > self.itemsTab.build.calcsTab.mainOutput.Str or item.requirements.dexMod > self.itemsTab.build.calcsTab.mainOutput.Dex or item.requirements.intMod > self.itemsTab.build.calcsTab.mainOutput.Int) then
137137
return false
138138
end
139139
end

src/Classes/ItemsTab.lua

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2605,9 +2605,6 @@ function ItemsTabClass:AddItemTooltip(tooltip, item, slot, dbMode)
26052605
else
26062606
tooltip:AddLine(20, rarityCode..item.namePrefix..item.baseName:gsub(" %(.+%)","")..item.nameSuffix)
26072607
end
2608-
if item.fractured then
2609-
tooltip:AddLine(16, colorCodes.FRACTURED.."Fractured Item")
2610-
end
26112608

26122609
tooltip:AddSeparator(10)
26132610

src/Classes/ModDB.lua

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,7 @@ function ModDBClass:SumInternal(context, modType, cfg, flags, keywordFlags, sour
9898
local mod = modList[i]
9999
if mod.type == modType and band(flags, mod.flags) == mod.flags and MatchKeywordFlags(keywordFlags, mod.keywordFlags) and (not source or ( mod.source and (mod.source:match("[^:]+") == source or mod.source == source))) then
100100
if mod[1] then
101-
local value = context:EvalMod(mod, cfg) or 0
102-
if mod[1].globalLimit and mod[1].globalLimitKey then
103-
globalLimits[mod[1].globalLimitKey] = globalLimits[mod[1].globalLimitKey] or 0
104-
if globalLimits[mod[1].globalLimitKey] + value > mod[1].globalLimit then
105-
value = mod[1].globalLimit - globalLimits[mod[1].globalLimitKey]
106-
end
107-
globalLimits[mod[1].globalLimitKey] = globalLimits[mod[1].globalLimitKey] + value
108-
end
101+
local value = context:EvalMod(mod, cfg, globalLimits) or 0
109102
result = result + value
110103
else
111104
result = result + mod.value
@@ -133,14 +126,7 @@ function ModDBClass:MoreInternal(context, cfg, flags, keywordFlags, source, ...)
133126
if mod.type == "MORE" and band(flags, mod.flags) == mod.flags and MatchKeywordFlags(keywordFlags, mod.keywordFlags) and (not source or mod.source:match("[^:]+") == source) then
134127
local value
135128
if mod[1] then
136-
value = context:EvalMod(mod, cfg) or 0
137-
if mod[1].globalLimit and mod[1].globalLimitKey then
138-
globalLimits[mod[1].globalLimitKey] = globalLimits[mod[1].globalLimitKey] or 0
139-
if globalLimits[mod[1].globalLimitKey] + value > mod[1].globalLimit then
140-
value = mod[1].globalLimit - globalLimits[mod[1].globalLimitKey]
141-
end
142-
globalLimits[mod[1].globalLimitKey] = globalLimits[mod[1].globalLimitKey] + value
143-
end
129+
value = context:EvalMod(mod, cfg, globalLimits) or 0
144130
else
145131
value = mod.value or 0
146132
end
@@ -249,15 +235,7 @@ function ModDBClass:TabulateInternal(context, result, modType, cfg, flags, keywo
249235
if (mod.type == modType or not modType) and band(flags, mod.flags) == mod.flags and MatchKeywordFlags(keywordFlags, mod.keywordFlags) and (not source or mod.source:match("[^:]+") == source) then
250236
local value
251237
if mod[1] then
252-
value = context:EvalMod(mod, cfg)
253-
if mod[1].globalLimit and mod[1].globalLimitKey then
254-
value = value or 0
255-
globalLimits[mod[1].globalLimitKey] = globalLimits[mod[1].globalLimitKey] or 0
256-
if globalLimits[mod[1].globalLimitKey] + value > mod[1].globalLimit then
257-
value = mod[1].globalLimit - globalLimits[mod[1].globalLimitKey]
258-
end
259-
globalLimits[mod[1].globalLimitKey] = globalLimits[mod[1].globalLimitKey] + value
260-
end
238+
value = context:EvalMod(mod, cfg, globalLimits)
261239
else
262240
value = mod.value
263241
end

src/Classes/ModList.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function ModListClass:ReplaceModInternal(mod)
4646
end
4747

4848
function ModListClass:MergeMod(mod)
49-
if mod.type == "BASE" or mod.type == "INC" then
49+
if mod.type == "BASE" or mod.type == "INC" or mod.type == "MORE" then
5050
for i = 1, #self do
5151
if modLib.compareModParams(self[i], mod) then
5252
self[i] = copyTable(self[i], true)

0 commit comments

Comments
 (0)