fix Golden Pill issues

This commit is contained in:
Buurazu authored and GitHub committed 2021-12-17 13:57:46 -05:00
1 parent cf99778d5f
commit 58cf71bafc
1 file changed
+6 -2
+6 -2
View File
@@ -371,7 +371,7 @@ function EID:getAdjustedSubtype(Type, Variant, SubType)
return SubType - 32768
end
elseif tableName == "pills" or tableName == "horsepills" then
if SubType == 14 then
if SubType % PillColor.PILL_GIANT_FLAG == PillColor.PILL_GOLD then
return 9999
end
local pool = game:GetItemPool()
@@ -451,7 +451,11 @@ function EID:getObjectName(Type, Variant, SubType)
return name or (not string.find(vanillaName, "^#") and vanillaName) or EID.descriptions["en_us"][tableName][SubType][2] or vanillaName
elseif tableName == "pills" or tableName == "horsepills" then
local adjustedSubtype = EID:getAdjustedSubtype(Type, Variant, SubType)
local vanillaName = EID.itemConfig:GetPillEffect(adjustedSubtype - 1).Name
local vanillaName = nil
-- fix Gold Pill bug
if EID.itemConfig:GetPillEffect(adjustedSubtype - 1) then
vanillaName = EID.itemConfig:GetPillEffect(adjustedSubtype - 1).Name
end
name = name or (not string.find(vanillaName, "^#") and vanillaName) or EID.descriptions["en_us"][tableName][adjustedSubtype][2] or vanillaName
return string.gsub(name,"I'm Excited!!!","I'm Excited!!") -- prevent markup trigger
elseif tableName == "sacrifice" then