diff --git a/descriptions/rep/en_us.lua b/descriptions/rep/en_us.lua index 8a98a0c9..f77b57fa 100644 --- a/descriptions/rep/en_us.lua +++ b/descriptions/rep/en_us.lua @@ -326,6 +326,8 @@ EID.descriptions["en_us"].birthright ={ {"Tainted Forgotten Soul", "", "Tainted Soul gains the Recall ability {{Collectible714}}, to automatically retrieve the Tainted Forgotten from a distance"}, } +EID.descriptions["en_us"].spindownError = "Item disappears" + ---------- Trinkets ---------- local repTrinkets={ [10] = {"10", "", "Tears move in waves#↑ +0.4 Tears up#Grants spectral tears"}, -- Wiggle Worm diff --git a/descriptions/rep/ru.lua b/descriptions/rep/ru.lua index 4ba14237..4f1e9969 100644 --- a/descriptions/rep/ru.lua +++ b/descriptions/rep/ru.lua @@ -326,6 +326,8 @@ EID.descriptions["ru"].birthright ={ {"Иная Душа Забытого", "", "Получает возможность Родня хранителя {{Collectible714}} "}, --Tainted Forgotten Soul } +EID.descriptions["ru"].spindownError = "Предмет исчезает" + ---------- Trinkets ---------- local repTrinkets={ [10] = {"10", "Извивающийся червь", "Слезы двигаются волнами#↑ +0.4 Скорострельность#Дает спектральные слезы"}, -- Wiggle Worm diff --git a/eid_api.lua b/eid_api.lua index 029eb0c1..d7259d98 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -699,6 +699,15 @@ function EID:updateDescriptionsViaTable(changeTable, tableToUpdate) end end +-- Converts a given CollectibleID into the respective Spindown dice result +function EID:getSpindownResult(collectibleID) + local newID = collectibleID + repeat + newID = newID - 1 + until( EID.SpindownDiceSkipIDs[newID] == nil) + return newID +end + -- Creates a copy of a KColor object. This prevents overwriting existing function EID:copyKColor(colorObj) return KColor(colorObj.Red, colorObj.Green, colorObj.Blue, colorObj.Alpha) diff --git a/eid_data.lua b/eid_data.lua index 5018b34a..78da974e 100644 --- a/eid_data.lua +++ b/eid_data.lua @@ -1,3 +1,26 @@ +-- Item IDs that are skipped when using the Spindown dice +EID.SpindownDiceSkipIDs = { + [43]=true, + [59]=true, + [61]=true, + [235]=true, + [587]=true, + [613]=true, + [620]=true, + [630]=true, + [648]=true, + [655]=true, + [648]=true, + [662]=true, + [666]=true, + [710]=true, + [711]=true, + [713]=true, + [714]=true, + [715]=true, + [718]=true +} + -- Specific strings that will be replaced with something else. This is used to convert Shortcuts into internal markup. EID.TextReplacementPairs = { {"!!!", "{{Warning}}"}, -- Turn 3 Exclamations into Warning diff --git a/main.lua b/main.lua index e988f95d..0c1ad97c 100644 --- a/main.lua +++ b/main.lua @@ -403,6 +403,26 @@ local function onRender(t) descriptionObj.Description = "{{CustomTransformation}} {{ColorGray}}"..playerName.."{{CR}}#"..birthrightDesc[3] end end + -- Handle Spindown Dice description addition + if player:GetActiveItem() == 723 then + descriptionObj.Description = descriptionObj.Description.."#{{Collectible723}} :" + local results = {} + local refID = closest.SubType + for i = 1,3 do + local spinnedID = EID:getSpindownResult(refID) + refID = spinnedID + if spinnedID > 0 then + descriptionObj.Description = descriptionObj.Description.."{{Collectible"..spinnedID.."}}" + if i ~=3 then + descriptionObj.Description = descriptionObj.Description.." ->" + end + else + local errorMsg = EID.descriptions[EID.Config["Language"]]["spindownError"] or EID.descriptions["en_us"]["spindownError"] or nil + descriptionObj.Description = descriptionObj.Description..errorMsg + break + end + end + end EID:printDescription(descriptionObj) elseif closest.Variant == PickupVariant.PICKUP_TAROTCARD then --Handle Cards & Runes diff --git a/metadata.xml b/metadata.xml index 67745af6..10202d51 100644 --- a/metadata.xml +++ b/metadata.xml @@ -88,7 +88,7 @@ https://moddingofisaac.com/mod/1079/external-item-descriptions - Mert Dutal for creating the [b]Turkish[/b] language pack - [url=https://steamcommunity.com/id/whytefang/]adc[/url] for creating an awesome new Languagepack and providing ideas for new functionalities - 3.32 + 3.33 Public