Skip to content

Commit c2cc53c

Browse files
committed
Find matching spectre reservation for spectres like Rotted Rat and Terracotta Soldier
1 parent 242b7ac commit c2cc53c

2 files changed

Lines changed: 21 additions & 3 deletions

File tree

src/Classes/ImportTab.lua

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,8 +705,17 @@ function ImportTabClass:ImportItemsAndSkills(charData)
705705
local spectreList = data.spectres
706706
if typeLine:sub(1, 8) == "Spectre:" then
707707
local spectreName = typeLine:sub(10) -- gets monster name after "Spectre: "
708+
for _, property in pairs(skillData.properties) do
709+
if property.name == "Reservation" and property.values and property.values[1] and property.values[1][1] then
710+
-- Example: "42 [Spirit]"
711+
local reservationValue = property.values[1][1]:match("(%d+)")
712+
if reservationValue then
713+
gemInstance.reservation = tonumber(reservationValue)
714+
end
715+
end
716+
end
708717
for id, spectre in pairs(spectreList) do
709-
if spectre.name == spectreName then
718+
if spectre.name == spectreName and gemInstance.reservation == spectre.spectreReservation then
710719
if not isValueInArray(self.build.spectreList, id) then
711720
t_insert(self.build.spectreList, id)
712721
end
@@ -718,8 +727,17 @@ function ImportTabClass:ImportItemsAndSkills(charData)
718727
end
719728
if typeLine:sub(1, 10) == "Companion:" then
720729
local companionName = typeLine:sub(12)
730+
for _, property in pairs(skillData.properties) do
731+
if property.name == "Reservation" and property.values and property.values[1] and property.values[1][1] then
732+
-- Example: "42.3% [Spirit]"
733+
local companionReservation = property.values[1][1]:match("([%d%.]+)%%?")
734+
if companionReservation then
735+
gemInstance.companionReservation = tonumber(companionReservation)
736+
end
737+
end
738+
end
721739
for id, spectre in pairs(spectreList) do
722-
if spectre.name == companionName then
740+
if spectre.name == companionName and gemInstance.companionReservation == spectre.companionReservation then
723741
if not isValueInArray(self.build.beastList, id) then
724742
t_insert(self.build.beastList, id)
725743
end

src/Export/spec.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12260,7 +12260,7 @@ return {
1226012260
name="BaseDamageIgnoresAttackSpeed",
1226112261
refTo="",
1226212262
type="Bool",
12263-
width=80
12263+
width=200
1226412264
},
1226512265
[10]={
1226612266
list=false,

0 commit comments

Comments
 (0)