From 096c202b1811abbf99adad8b3584944e8d9c3cc6 Mon Sep 17 00:00:00 2001 From: Wofsauge Date: Sun, 2 Mar 2025 21:14:13 +0100 Subject: [PATCH] Abyss: Added pluralization and default text for normal items --- descriptions/rep/de.lua | 3 ++- descriptions/rep/en_us.lua | 3 ++- descriptions/rep/ko_kr.lua | 1 + features/eid_modifiers.lua | 37 +++++++++++++++++++------------------ 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/descriptions/rep/de.lua b/descriptions/rep/de.lua index 7398c5e3..f843b2bd 100644 --- a/descriptions/rep/de.lua +++ b/descriptions/rep/de.lua @@ -691,7 +691,8 @@ EID.descriptions[languageCode].bookOfVirtuesWisps = { ---------- Abyss Locust description parts ---------- EID.descriptions[languageCode].AbyssTexts = { - InfoText = "{amount} x{size}{speed} Heuschrecke ({dmg})", -- values inside {} brackets will be replaced with text parts below + InfoText = "Eine {size}{speed}Heuschrecke ({dmg})", -- values inside {} brackets will be replaced with text parts below. + InfoTextPlural = "{amount} {size}{speed}Heuschrecken ({dmg})", -- Will be shown when more than 1 locust will spawn Chance = " ({1}% Chance)", -- {1} will be replaced with the chance SpeedSlow = "schnelle", -- Speed < 1 SpeedFast = "langsame", -- Speed > 1 diff --git a/descriptions/rep/en_us.lua b/descriptions/rep/en_us.lua index 5c5083d3..fd532405 100644 --- a/descriptions/rep/en_us.lua +++ b/descriptions/rep/en_us.lua @@ -650,7 +650,8 @@ EID.descriptions[languageCode].bookOfVirtuesWisps = { ---------- Abyss Locust description parts ---------- EID.descriptions[languageCode].AbyssTexts = { - InfoText = "{amount} x{size}{speed} locust ({dmg})", -- values inside {} brackets will be replaced with text parts below + InfoText = "{amount} {size}{speed}locust ({dmg})", -- values inside {} brackets will be replaced with text parts below + InfoTextPlural = "{amount} {size}{speed}locusts ({dmg})", -- Will be shown when more than 1 locust will spawn Chance = " ({1}% Chance)", -- {1} will be replaced with the chance SpeedSlow = "slow", -- Speed < 1 SpeedFast = "fast", -- Speed > 1 diff --git a/descriptions/rep/ko_kr.lua b/descriptions/rep/ko_kr.lua index d19fe193..f7e74e03 100644 --- a/descriptions/rep/ko_kr.lua +++ b/descriptions/rep/ko_kr.lua @@ -749,6 +749,7 @@ EID.descriptions[languageCode].bookOfVirtuesWisps = { -- Special Locust effects when Item was eaten by Abyss EID.descriptions[languageCode].AbyssTexts = { InfoText = "{speed}{size}파리 x{amount} ({dmg})", -- values inside {} brackets will be replaced with text parts below + InfoTextPlural = "{speed}{size}파리 x{amount} ({dmg})", -- Will be shown when more than 1 locust will spawn Chance = " ({1}% 확률)", -- {1} will be replaced with the chance SpeedSlow = "느린 ", -- Speed < 1 SpeedFast = "빠른 ", -- Speed > 1 diff --git a/features/eid_modifiers.lua b/features/eid_modifiers.lua index 7f51483c..e27fbb17 100644 --- a/features/eid_modifiers.lua +++ b/features/eid_modifiers.lua @@ -1010,29 +1010,29 @@ if EID.isRepentance then end local function AbyssCallback(descObj) - local textColor= "{{ColorRed}}" + local textColor = "{{ColorRed}}" -- Display explicit "abyssSynergies" table entry, if present local overrideDesc = EID:getDescriptionEntry("abyssSynergies", descObj.ObjSubType) if overrideDesc then - EID:appendToDescription(descObj, "#{{Collectible706}} ".. textColor .. overrideDesc) + EID:appendToDescription(descObj, "#{{Collectible706}} " .. textColor .. overrideDesc) return descObj end - -- Display default description, if no XML entry exists - if not EID.XMLLocusts or not EID.XMLLocusts[descObj.ObjSubType] then - return descObj - end - -- Display automatically generated description otherwise + -- Display automatically generated description - -- Get locust Data. Format: {Color, numLocusts, size, speed, locustFlags1, locustFlags2, tearFlags1, tearFlags2, procChance} - local locustData = EID.XMLLocusts[descObj.ObjSubType] + -- Default locust Data + local locustData = { "default", 1, 1, 1, { -1 }, { -1 }, { -1 }, { -1 }, { -1 }, { -1 }, 1, 1, 1, 1, 1, 0 } + -- Check if an XML entry exists and load if exists + if EID.XMLLocusts and EID.XMLLocusts[descObj.ObjSubType] then + locustData = EID.XMLLocusts[descObj.ObjSubType] + end local descriptionText = "" --local colors = locustData[1] -- colors flag: useless info right now local amount = locustData[2] local scale = locustData[3] local speed = locustData[4] - local locustFlags1 = locustData[5] -- array - local locustFlags2 = locustData[6] -- array - local locustFlags3 = locustData[7] -- array + local locustFlags1 = locustData[5] -- array + local locustFlags2 = locustData[6] -- array + local locustFlags3 = locustData[7] -- array local tearFlags1 = locustData[8] -- array local tearFlags2 = locustData[9] -- array local tearFlags3 = locustData[10] -- array @@ -1050,16 +1050,17 @@ if EID.isRepentance then -- size local scaleText = "" - if scale < 1 then scaleText = " " .. EID:getDescriptionEntry("AbyssTexts", "SizeSmall") - elseif scale > 1 then scaleText = " " .. EID:getDescriptionEntry("AbyssTexts", "SizeBig") end + if scale < 1 then scaleText = EID:getDescriptionEntry("AbyssTexts", "SizeSmall") .. " " + elseif scale > 1 then scaleText = EID:getDescriptionEntry("AbyssTexts", "SizeBig") .. " " end -- speed local speedText = "" - if speed < 1 then speedText = " " .. EID:getDescriptionEntry("AbyssTexts", "SpeedSlow") - elseif speed >=6 then speedText = " " .. EID:getDescriptionEntry("AbyssTexts", "SpeedDash") - elseif speed > 1 then speedText = " " .. EID:getDescriptionEntry("AbyssTexts", "SpeedFast") end + if speed < 1 then speedText = EID:getDescriptionEntry("AbyssTexts", "SpeedSlow") .. " " + elseif speed >=6 then speedText = EID:getDescriptionEntry("AbyssTexts", "SpeedDash") .. " " + elseif speed > 1 then speedText = EID:getDescriptionEntry("AbyssTexts", "SpeedFast") .. " " end -- overview / headline - descriptionText = "#{{Collectible706}} " .. textColor .. EID:getDescriptionEntry("AbyssTexts", "InfoText") + local infoText = EID:getDescriptionEntry("AbyssTexts", amount > 1 and "InfoTextPlural" or "InfoText") + descriptionText = "#{{Collectible706}} " .. textColor .. infoText descriptionText = EID:ReplaceVariableStr(descriptionText, "amount", amount) descriptionText = EID:ReplaceVariableStr(descriptionText, "size", scaleText) descriptionText = EID:ReplaceVariableStr(descriptionText, "speed", speedText)