Misc item reminder updates (#695)

* Change wisp checking

* Change selected item var

* Trinket and wisp checks

* add a simple room counter

* various changes

* update my todo list

* Gulped trinket support

* Reset selected items better

* update todo list

* add poop nuggets to pickup names

* add glyph of balance

* add a helper function for xml names

* overhaul special description modifiers

* Pandora's Box greed

* Pandora's Box tweak

* Pandora's Box overview desc

* let Card Reading Boss portal get modified

* move Strange Key to conditionals

* Update eid_conditionals.lua

* misc helper functions

* whitelists

* small text pos modifier tweaks

* wild card + glowing hourglass + void ab+

* move vurp, add wild card

* move SimpleRound

* add wild card, move simpleround, fix pill icon stuff

* Echo Chamber color

* update todo list

* starting work on The Stars? preview

* remove collectible count check; bad for tainted eden

* Tainted Laz overhaul

* fix 4.5 volt with timed pocket actives

* fix pocket active check functions

* Tainted Laz overhaul + The Stars?

* more conditionals

* Battery and bean synergies
This commit is contained in:
Buurazu authored and GitHub committed 2024-07-14 22:07:10 +02:00
1 parent 24a6a808ba
commit 9703626b71
12 files changed
+985 -383

No files matched your search

+81 -17
View File
@@ -123,12 +123,13 @@ end
Argument 4 (optional): Table with any additional options, usually not needed:
variableText: If there's a {1} in the desc, it will be replaced with this; can be a function for more dynamic text results, it will get descObj passed into it
locTable: Specify a different table to look for the localization string in, rather than ConditionalDescs
noTable: Set to true to look in the base localizations only (requires modText) (not used yet...)
noTable: Set to true to look in the base localizations only (requires modText)
lineColor: Appended lines will be highlighted with this color
replaceColor: Find/replace text will be highlighted with this color
bulletpoint: Appended lines will begin with this bulletpoint
noFallback: Don't fallback to English if this isn't localized; by default, conditionals don't fallback, to avoid printing English text in unupdated languages
usePedestalName: If true, display the pedestal item's name in place of {1}
useResult: If true, use the result from the conditional function to find the localization string
layer: A number used in determining the order that conditionals should be checked in, default -1
checkLayers: If true, don't print this condition if a higher layer condition was applied already
uniqueID: Only one conditional with the given unique ID will be printed
@@ -260,6 +261,19 @@ function EID:IsHardMode()
return game.Difficulty == 1 or game.Difficulty == 3
end
function EID:InStageNum(stageNum)
return game:GetLevel():GetAbsoluteStage() == stageNum
end
function EID:InStageVoid()
return EID:InStageNum(12)
end
function EID:InStageNoTreasureRoom()
return game:GetLevel():GetAbsoluteStage() > 6
end
function EID:InStageTheShop()
return EID:IsGreedMode() and EID:InStageNum(0)
end
-- Check if we have any characters that can't have Red Health, to print additions to descs like Dead Cat
function EID:CheckForNoRedHealthPlayer()
if EID.InsideItemReminder then
@@ -276,26 +290,54 @@ function EID:CheckForNoRedHealthPlayer()
return false
end
-- Check if we have characters with Schoolbag or a pocket active item
function EID:CheckForMultipleActives(onlyChargeablePockets)
function EID:CheckForTaintedPlayer()
if EID.InsideItemReminder then
local player = EID.ItemReminderPlayerEntity
if player:HasCollectible(534) then return true end
local id = player:GetPlayerType()
if EID.isRepentance and (EID.PocketActivePlayerIDs[id] == 0 or (not onlyChargeablePockets and EID.PocketActivePlayerIDs[id])) then return true end
return EID.TaintedIDs[player:GetPlayerType()]
else
for i = 0, game:GetNumPlayers() - 1 do
local player = Isaac.GetPlayer(i)
if player:HasCollectible(534) then return true end
if EID.TaintedIDs[player:GetPlayerType()] then
return true
end
end
end
return false
end
-- Check if we have characters with Schoolbag or a pocket active item
function EID:CheckForMultipleActives(descObj, onlyChargeablePockets)
if EID.InsideItemReminder then
local player = EID.ItemReminderPlayerEntity
if player:HasCollectible(534) then return 534 end
local id = player:GetPlayerType()
if EID.isRepentance and (EID.PocketActivePlayerIDs[id] == 0 or (not onlyChargeablePockets and EID.PocketActivePlayerIDs[id])) then return player:GetActiveItem(2) end
else
for i = 0, game:GetNumPlayers() - 1 do
local player = Isaac.GetPlayer(i)
if player:HasCollectible(534) then return 534 end
local id = player:GetPlayerType()
if EID.isRepentance and (EID.PocketActivePlayerIDs[id] == 0 or (not onlyChargeablePockets and EID.PocketActivePlayerIDs[id])) then return true end
if EID.isRepentance and (EID.PocketActivePlayerIDs[id] == 0 or (not onlyChargeablePockets and EID.PocketActivePlayerIDs[id])) then return player:GetActiveItem(2) end
end
end
return false
end
-- Check if we have characters with Schoolbag or a chargeable pocket active item (for 4.5 Volt)
function EID:CheckForMultipleChargeableActives()
return EID:CheckForMultipleActives(true)
function EID:CheckForMultipleChargeableActives(descObj)
return EID:CheckForMultipleActives(descObj, true)
end
-- Check if we have a character with a pocket active
function EID:CheckForPocketActives()
if EID.InsideItemReminder then
local player = EID.ItemReminderPlayerEntity
return EID.PocketActivePlayerIDs[player:GetPlayerType()]
else
for i = 0, game:GetNumPlayers() - 1 do
local player = Isaac.GetPlayer(i)
if EID.PocketActivePlayerIDs[player:GetPlayerType()] then return true end
end
end
return false
end
-- When we have Car Battery, change active pedestal descriptions
@@ -303,8 +345,15 @@ function EID:CheckForCarBattery(descObj)
if EID.CarBatteryNoSynergy[descObj.ObjSubType] then return "No Effect" end
return descObj.ObjSubType
end
-- When we're looking at a Car Battery pedestal, check our actives for having no effect
-- When we're looking at a Car Battery pedestal, check our actives for having an effect or no effect
function EID:CheckActivesForCarBattery(descObj)
if EID.InsideItemReminder then return false end
for k,v in pairs(EID.CarBatteryPedestalWhitelist) do
if v and EID:PlayersHaveCollectible(k) then return k end
end
return false
end
function EID:CheckActivesForNoCarBattery(descObj)
if EID.InsideItemReminder then return false end
for k,v in pairs(EID.CarBatteryNoSynergy) do
if v and EID:PlayersHaveCollectible(k) then return k end
@@ -324,8 +373,22 @@ function EID:CheckForHiveMind(descObj)
return "N/A"
end
-- When we're looking at a BFFS pedestal, check our familiars for having no effect (only finds the earliest one, but whatever)
-- When we're looking at a BFFS pedestal, check our familiars for having an effect (only finds the earliest one)
function EID:CheckFamiliarsForBFFS(descObj)
if EID.InsideItemReminder then return false end
for k,v in pairs(EID.BFFSPedestalWhitelist) do
if v and EID:PlayersHaveCollectible(k) then return "5.100." .. k end
end
return false
end
function EID:CheckFamiliarsForHiveMind(descObj)
if EID.InsideItemReminder then return false end
for k,v in pairs(EID.BFFSPedestalWhitelist) do
if EID.HiveMindFamiliars[k] and v and EID:PlayersHaveCollectible(k) then return "5.100." .. k end
end
return false
end
function EID:CheckFamiliarsForNoBFFS(descObj)
if EID.InsideItemReminder then return false end
for k,v in pairs(EID.BFFSNoSynergy) do
if v and EID:PlayersHaveCollectible(k) then return k end
@@ -336,7 +399,7 @@ end
-- Check for a player having an active item with a specific quantity of charges, or charge type
-- 0 = normal, 1 = timed, 2 = special
function EID:CheckPlayersForActiveChargeType(maxCharge, chargeType, checkPockets)
checkPockets = checkPockets or true
if checkPockets == nil then checkPockets = true end
local players = {}
if EID.InsideItemReminder then
players[1] = EID:ItemReminderGetAllPlayers()[EID.ItemReminderSelectedPlayer + 1] or EID.player
@@ -440,6 +503,7 @@ function EID:applyConditionals(descObj)
local locTable = cond.locTable or "ConditionalDescs"
local text = nil
local modifierText = type(cond.modifierText) == "function" and cond.modifierText(EID, descObj) or cond.modifierText
if cond.useResult then modifierText = result end
-- Find our string in the base localization table
if cond.noTable then
@@ -459,11 +523,11 @@ function EID:applyConditionals(descObj)
if cond.layer > highestLayer then highestLayer = cond.layer end
if cond.uniqueID then printedDescs[cond.uniqueID] = true end
local variableText, bulletpoint
-- If the condition returned a value, use that value
-- If the condition returned a value, use that value as an item ID for the bulletpoint/{1} replacement
if result ~= true then
-- For the time being, we assume the result was a collectible number (will support more soon)
variableText = "{{NameOnlyC"..result.."}}"
bulletpoint = "Collectible"..result
if type(result) == "number" then result = "5.100." .. result end
variableText = "{{NameOnly"..result.."}}"
bulletpoint = "Item"..result
else
variableText = type(cond.variableText) == "function" and cond.variableText(EID, descObj) or cond.variableText
bulletpoint = cond.bulletpoint