Custom Poop API support. (#738)

* Dynamic health HealingRed removal list

HealingRed lines removal for custom health types support

fixed orphan socks description not showing the soul heart markup

Added and changed a lot of stuff from the Spanish EID

* fixed a typo in the Spanish EID

* Custom Poop API support.
This commit is contained in:
Tiburones202 authored and GitHub committed 2024-10-27 21:23:58 +01:00
1 parent b11db096bf
commit 0cf767bc51
4 files changed
+45 -2

No files matched your search

+11
View File
@@ -279,6 +279,17 @@ function EID:addIcon(shortcut, animationName, animationFrame, width, height, lef
EID.InlineIcons[shortcut] = {animationName, animationFrame, width, height, leftOffset, topOffset, spriteObject}
end
-- Adds a custom poop spell to T???'s poop descriptions. This spell should be added with the "Custom Poop API" library to actually appear in-game.
-- Token is the name of the spell in the Custom Poop API code. Examples: "CORNY", "BURNING", "BOMB".
-- Name is the actual name you want to display. Examples: "Corny Poop", "Burning Poop", "Bomb".
-- Icon is the displayed poop icon. Should be a markup.
-- Description is the actual description showed to the player. Examples: "Spawns blue flies while intact", "Deals contact damage while intact#Leaves a fire behind when destroyed", "Normal throwable bomb".
-- Language is the language you want to add it to. Examples: "en_us", "spa", "ru".
-- EXAMPLE: EID:addCustomPoopSpell("MYPOOP", "I Made This Poop", "{{PoopSpell1}}", "Can be throwed to deal damage", "en_us")
function EID:addCustomPoopSpell(token, name, icon, description, language)
EID.descriptions[language]["poopSpells"][token] = {icon, name, description}
end
-- Adds a new color object with the shortcut defined in the "shortcut" variable (e.g. "{{shortcut}}" = your color)
-- Shortcuts are case Sensitive! Shortcuts can be overriden with this function to allow for full control over everything
-- Define a callback to let it be called when interpreting the color-markup. define a kColor otherwise for a simple color change
+26
View File
@@ -600,6 +600,32 @@ function EID:ItemReminderHandlePoopSpells(player)
local descsAvailableToRender = numAvailableDescriptionSlots
for i = 0, 5 do -- max 6 poop spell slots
local nextPoop = player:GetPoopSpell(i)
--Custom Poop support
if CustomPoopAPI then
local poopSaveData = CustomPoopAPI.GetPersistentPlayerData(player)
nextPoop = PoopSpellType["SPELL_"..poopSaveData.Poops[i + 1]] --Yes, this works LOL
if nextPoop == nil then --Not a spell from the base game. Might add custom poop support eventually instead of skipping the creep.
nextPoop = PoopSpellType.SPELL_NONE --Prevent from rendering normally
local customPoop = EID:getDescriptionEntry("poopSpells")[poopSaveData.Poops[i + 1]]
local ignoreExisting = false
if customPoop == nil then --If the poop still doesn't exist, use the unkown one instead
customPoop = EID:getDescriptionEntry("poopSpells")["Unknown"] or EID.descriptions["en_us"]["poopSpells"]["Unknown"]
ignoreExisting = true
end
if ignoreExisting or not displayedPoopTypes[customPoop] then
EID:ItemReminderAddTempDescriptionEntry(customPoop[1], customPoop[2], customPoop[3])
displayedPoopTypes[customPoop] = true
descsAvailableToRender = descsAvailableToRender - 1
end
end
end
--End of custom poop support
if not displayedPoopTypes[nextPoop] then
EID:ItemReminderAddTempDescriptionEntry("{{PoopSpell" .. nextPoop .. "}}", poopInfo[nextPoop][1],
poopInfo[nextPoop][2])