Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spec/System/TestDefence_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@
local minionLife = build.calcsTab.mainEnv.player.allyLifeList.TotalMinionLife[1].life
assert.are.equals(15, output.MinionAllyDamageMitigation)
assert.are.equals(minionLife, output.TotalMinionLife)
assert.are.near(unsupportedLife * 1.6, minionLife, 20)
assert.are.near(unsupportedLife, minionLife, 20)
end)

it("requires exactly one summoned minion for Companionship", function()
Expand Down Expand Up @@ -844,12 +844,12 @@

it("combines different Spectres without depending on the first one's Life", function()
local chieftain = "Metadata/Monsters/BloodChieftain/MonkeyChiefBloodEnrage"
local meatsack = "Metadata/Monsters/LeagueAzmeri/SpecialCorpses/TankyZombieHigh"

Check warning on line 847 in spec/System/TestDefence_spec.lua

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (Tanky)

Check warning on line 847 in spec/System/TestDefence_spec.lua

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (meatsack)
build.spectreList = { chieftain, meatsack }

Check warning on line 848 in spec/System/TestDefence_spec.lua

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (meatsack)
build.skillsTab:PasteSocketGroup("Raise Spectre 20/0 1")
build.skillsTab:PasteSocketGroup("Raise Spectre 20/0 1\nMinion Life 20/0 1")
build.skillsTab.socketGroupList[1].gemList[1].skillMinion = chieftain
build.skillsTab.socketGroupList[2].gemList[1].skillMinion = meatsack

Check warning on line 852 in spec/System/TestDefence_spec.lua

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (meatsack)
build.configTab:BuildModList()
build.configTab.modList:NewMod("takenFromSpectresBeforeYou", "BASE", 15, "Test")
build.calcsTab:BuildOutput()
Expand Down
30 changes: 29 additions & 1 deletion spec/System/TestItemParse_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,34 @@ describe("TestItemParse", function()
assert.are.equals("Plate Vest", item.baseName)
end)

it("adds talisman base mods as enchants", function()
local baseName = "Test Talisman"
data.itemBases[baseName] = {
type = "Amulet",
subType = "Talisman",
tags = { amulet = true, talisman = true },
req = { },
enchant = "+10 to Strength",
enchantModTypes = { { "attribute" } },
cannotBeAnointed = true,
}

local item = new("Item", "Rarity: Normal\n" .. baseName)

assert.are.equals(1, #item.enchantModLines)
assert.are.equals("+10 to Strength", item.enchantModLines[1].line)
assert.truthy(item.enchantModLines[1].crafted)
assert.truthy(item.enchantModLines[1].implicit)
assert.are.same({ "attribute" }, item.enchantModLines[1].modTags)
assert.truthy(item.base.cannotBeAnointed)

item:BuildAndParseRaw()
assert.are.equals(1, #item.enchantModLines)
assert.truthy(item.enchantModLines[1].crafted)
assert.truthy(item.enchantModLines[1].implicit)
data.itemBases[baseName] = nil
end)

it("Two-Toned Boots", function()
local item = new("Item", raw("", "Two-Toned Boots"))
assert.are.equals("Two-Toned Boots (Armour/Energy Shield)", item.baseName)
Expand Down Expand Up @@ -943,4 +971,4 @@ describe("TestAdvancedItemParse #item", function()
assert.equal(8, spellDamage())
end)
end)
end)
end)
20 changes: 20 additions & 0 deletions spec/System/TestItemTools_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,24 @@ Can be Anointed
assert.are.equals("Belt", overrides[1].repSlotName)
assert.are.equals("Belt", overrides[2].repSlotName)
end)

it("does not report missing anoints for non-anointable talisman bases", function()
if not common.classes.ItemsTab then
LoadModule("Classes/ItemsTab")
end
local fakeItemsTab = setmetatable({ }, common.classes.ItemsTab)
local item = {
base = {
type = "Amulet",
cannotBeAnointed = true,
},
enchantModLines = { },
scourgeModLines = { },
implicitModLines = { },
explicitModLines = { },
crucibleModLines = { },
}

assert.are.equals(0, fakeItemsTab:getMissingAnointCount(item))
end)
end)
8 changes: 4 additions & 4 deletions spec/System/TestSkills_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@ describe("TestAttacks", function()
end)
it("Test cost efficiency modifiers", function()
-- Test Mana Cost Efficiency
build.skillsTab:PasteSocketGroup("Ball Lightning 1/0 1\n")
build.skillsTab:PasteSocketGroup("Hydrosphere 1/0 1\n")
runCallback("OnFrame")

-- Get base mana cost (Ball Lightning level 1 has 12 mana cost)
-- Get base mana cost (Hydrosphere level 1 has 12 mana cost)
local baseCost = build.calcsTab.mainOutput.ManaCost
assert.are.equals(12, baseCost)

Expand All @@ -185,7 +185,7 @@ describe("TestAttacks", function()

-- Test generic cost efficiency (should also affect mana)
newBuild()
build.skillsTab:PasteSocketGroup("Ball Lightning 1/0 1\n")
build.skillsTab:PasteSocketGroup("Hydrosphere 1/0 1\n")
build.configTab.input.customMods = "25% increased Cost Efficiency"
build.configTab:BuildModList()
runCallback("OnFrame")
Expand All @@ -205,7 +205,7 @@ describe("TestAttacks", function()

it("Test cost efficiency with cost modifiers", function()
-- Test interaction between cost efficiency and cost multipliers
build.skillsTab:PasteSocketGroup("Ball Lightning 1/0 1\n")
build.skillsTab:PasteSocketGroup("Hydrosphere 1/0 1\n")

-- Add cost multiplier and efficiency
build.configTab.input.customMods = "50% increased Mana Cost\n50% increased Mana Cost Efficiency"
Expand Down
20 changes: 20 additions & 0 deletions src/Classes/Item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
self.rawLines = { }
-- Find non-blank lines and trim whitespace
for line in raw:gmatch("%s*([^\n]*%S)") do
line = escapeGGGString(line)
t_insert(self.rawLines, line)
end
local mode = rarity and "GAME" or "WIKI"
Expand Down Expand Up @@ -1314,6 +1315,22 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
self:NormaliseQuality()
end
end
if self.base and self.base.enchant and #self.enchantModLines == 0 then
local enchantIndex = 1
for line in self.base.enchant:gmatch("[^\n]+") do
local modList, extra = modLib.parseMod(line)
t_insert(self.enchantModLines, {
line = line,
crafted = true,
implicit = true,
enchant = true,
extra = extra,
modList = modList or { },
modTags = self.base.enchantModTypes and self.base.enchantModTypes[enchantIndex] or { },
})
enchantIndex = enchantIndex + 1
end
end
self:BuildModList()
if deferJewelRadiusIndexAssignment then
self.jewelRadiusIndex = self.jewelData.radiusIndex
Expand Down Expand Up @@ -1515,6 +1532,9 @@ function ItemClass:BuildRaw()
if modLine.crafted then
line = "{crafted}" .. line
end
if modLine.enchant then
line = "{enchant}" .. line
end
if modLine.custom then
line = "{custom}" .. line
end
Expand Down
5 changes: 3 additions & 2 deletions src/Classes/ItemsTab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ for _, entry in pairs(data.flavourText) do
end

local function isAnointable(item)
return (item.canBeAnointed or item.base.type == "Amulet")
return item and item.base and not item.base.cannotBeAnointed
and (item.canBeAnointed or item.base.type == "Amulet")
end

local function buildModSortList()
Expand Down Expand Up @@ -2627,7 +2628,7 @@ end
---@param item table @The item to inspect
---@return number @How many additional anoints can still be applied
function ItemsTabClass:getMissingAnointCount(item)
if not item or not item.base or not (item.canBeAnointed or item.base.type == "Amulet") then
if not isAnointable(item) then
return 0
end
local maxAnoints = item.canHaveFourEnchants and 4 or item.canHaveThreeEnchants and 3 or item.canHaveTwoEnchants and 2 or 1
Expand Down
10 changes: 10 additions & 0 deletions src/Classes/PassiveSpec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1171,6 +1171,16 @@
jewelType = 4
elseif conqueredBy.conqueror.type == "kalguur" then
jewelType = 6
elseif conqueredBy.conqueror.type == "abyssTecrod" then
jewelType = 7
elseif conqueredBy.conqueror.type == "abyssUlaman" then
jewelType = 8
elseif conqueredBy.conqueror.type == "abyssKurgal" then
jewelType = 9
elseif conqueredBy.conqueror.type == "abyssAmanamu" then
jewelType = 10
elseif conqueredBy.conqueror.type == "abyssZorath" then

Check warning on line 1182 in src/Classes/PassiveSpec.lua

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (Zorath)
jewelType = 11
end
local seed = conqueredBy.id
if jewelType == 5 then
Expand Down
Loading
Loading