Add conditional description additions (#638)

* v1 conditional descs

* v1 conditional descs

* Update en_us.lua

* Update en_us.lua

* Update eid_api.lua for conditional descs

* Conditional descs v1

* Tarot conditional, Exp Pill callback

* fix Temperance Tarot

* Some more conditional descs

* Conditional descs update

* Update main.lua

* Change 0 to nil in repentogon's bag
This commit is contained in:
Buurazu authored and GitHub committed 2024-02-08 19:29:34 +01:00
1 parent 5798a9eb52
commit a719f198e2
7 files changed
+280 -23

No files matched your search

+46 -2
View File
@@ -501,7 +501,7 @@ if EID.isRepentance then
end
end
end
return descObj
return EID:applyConditionals(descObj,"Tarot")
end
@@ -670,6 +670,49 @@ if EID.isRepentance then
end
return descObj
end
-- Handle Experimental Pill description addition
local function ExperimentalPillCallback(descObj)
local adjustedID = EID:getAdjustedSubtype(descObj.ObjType, descObj.ObjVariant, descObj.ObjSubType)
if adjustedID - 1 ~= PillEffect.PILLEFFECT_EXPERIMENTAL then return descObj end
local horse = descObj.ObjSubType > 2048
for i = 1,#EID.coopAllPlayers do
local player = EID.coopAllPlayers[i]
local playerID = EID:getPlayerID(player)
local playerType = player:GetPlayerType()
local pillModifierID = 0
local goodAndBad = false
-- Check for PHD, Lucky Foot, Virgo, and False PHD
if player:HasCollectible(75) then pillModifierID = 75
elseif player:HasCollectible(46) then pillModifierID = 46
elseif player:HasCollectible(303) then pillModifierID = 303
end
-- Check for False PHD, and if we have good AND bad pills, just print the damage up text
if player:HasCollectible(654) then
if pillModifierID ~= 0 then goodAndBad = true end
pillModifierID = 654
end
if pillModifierID ~= 0 then
local expPillString = ""
if pillModifierID == 654 then
local damageUpString = ""
if horse then damageUpString = EID:getDescriptionEntry("FalsePHDHorseDamage")
else damageUpString = EID:getDescriptionEntry("FalsePHDDamage") end
if goodAndBad then
expPillString = damageUpString
else
expPillString = EID:getDescriptionEntry("ExperimentalPillFalsePHD") .. "#{{Collectible654}} " .. damageUpString
end
else expPillString = EID:getDescriptionEntry("ExperimentalPillPHD") end
EID:appendToDescription(descObj, "#")
if #EID.coopAllPlayers > 1 then EID:appendToDescription(descObj, (EID:getIcon("Player"..playerType) ~= EID.InlineIcons["ERROR"] and "{{Player"..playerType.."}} " or ("P" .. i .. ": "))) end
EID:appendToDescription(descObj, "{{Collectible" .. pillModifierID .. "}} " .. expPillString)
end
end
return descObj
end
-- Handle False PHD description addition
local function FalsePHDCallback(descObj)
@@ -677,7 +720,7 @@ if EID.isRepentance then
local horse = descObj.ObjSubType > 2048
local data = EID.pillMetadata[adjustedID-1]
if data ~= nil then
local damageUp = string.find(data.class,"3") and (string.find(data.class,"-") or adjustedID-1 == PillEffect.PILLEFFECT_EXPERIMENTAL)
local damageUp = string.find(data.class,"3") and string.find(data.class,"-")
if adjustedID-1 == PillEffect.PILLEFFECT_SHOT_SPEED_DOWN then damageUp = true end
-- why doesn't I'm Excited have a - in the xml data yet spawn a black heart...
local blackHeart = (string.find(data.class,"2") or string.find(data.class,"1")) and (string.find(data.class,"-") or adjustedID-1 == PillEffect.PILLEFFECT_IM_EXCITED)
@@ -793,6 +836,7 @@ if EID.isRepentance then
if EID.collectiblesOwned[654] then table.insert(callbacks, FalsePHDCallback) end
if EID.collectiblesOwned[348] then table.insert(callbacks, PlaceboCallback) end
table.insert(callbacks, VurpCallback)
table.insert(callbacks, ExperimentalPillCallback)
if EID.pillPlayer == nil and #EID.coopAllPlayers > 1 then
table.insert(callbacks, CoopPillCallback)