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:
1 parent
24a6a808ba
commit
9703626b71
12 files changed
+985
-383
No files matched your search
+85
-54
@@ -137,9 +137,9 @@ local pandorasStages = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 11, 11, 13 }
|
||||
local altStages = { [10] = false, [11] = true, [12] = false, [13] = true }
|
||||
-- Greed Mode Absolute Stage / Pandora's Box Behavior: 1: B2, 3: C2, 5: D2, 7: W1, 10: Sheol, 0: Chest
|
||||
local greedStages = { -1, 1, -1, 3, -1, 5, 7, -1, -1, 10, -1, -1, 0, -1 }
|
||||
EID.PandorasGreedConditional = false -- helper variable to let item reminder know that we have the 6-entry greed pandora desc
|
||||
|
||||
local function PandorasBoxCallback(descObj)
|
||||
local strangeKeyOwned = EID.isRepentance and EID:PlayersHaveTrinket(175)
|
||||
local pandoraCount = 0
|
||||
local level = game:GetLevel()
|
||||
local stageNum = level:GetAbsoluteStage()
|
||||
@@ -157,10 +157,15 @@ local function PandorasBoxCallback(descObj)
|
||||
end
|
||||
end
|
||||
local skip9and12 = false
|
||||
EID.PandorasGreedConditional = false
|
||||
-- many localizations do not have the ???/Void entry and the Dark Room entry
|
||||
-- this seemed better than forcing them to have it
|
||||
if totalCount == (EID.isRepentance and 12 or 11) then
|
||||
skip9and12 = true
|
||||
-- If the localization has a simplified Greed Mode desc, it will only have 6 entries
|
||||
elseif totalCount == 6 then
|
||||
EID.PandorasGreedConditional = true
|
||||
greedStages = { 1, 3, 5, 7, 10, 0 }
|
||||
end
|
||||
|
||||
for w in string.gmatch(descObj.Description, "([^#;]+)") do
|
||||
@@ -185,9 +190,6 @@ local function PandorasBoxCallback(descObj)
|
||||
if pandoraCount == (EID.isRepentance and 14 or 13) then break end
|
||||
end
|
||||
end
|
||||
if strangeKeyOwned then
|
||||
descObj.Description = descObj.Description .. "#{{Trinket175}} " .. EID:getDescriptionEntry("PandorasBoxStrangeKeyEffect")
|
||||
end
|
||||
return descObj
|
||||
end
|
||||
|
||||
@@ -242,6 +244,40 @@ local function BlackFeatherCallback(descObj)
|
||||
return descObj
|
||||
end
|
||||
|
||||
-- Handle VURP description addition
|
||||
local function VurpCallback(descObj)
|
||||
local adjustedID = EID:getAdjustedSubtype(descObj.ObjType, descObj.ObjVariant, descObj.ObjSubType)
|
||||
if adjustedID - 1 ~= PillEffect.PILLEFFECT_VURP then return descObj end
|
||||
|
||||
for i = 1,#EID.coopAllPlayers do
|
||||
local player = EID.coopAllPlayers[i]
|
||||
local playerID = EID:getPlayerID(player, true)
|
||||
local playerType = player:GetPlayerType()
|
||||
local pickupHistory = EID.PlayerItemInteractions[playerID].pickupHistory
|
||||
if pickupHistory then
|
||||
local lastUsedPill = PillEffect.PILLEFFECT_VURP + 1
|
||||
local lastUsedPillColor = 1
|
||||
local j = 1
|
||||
while (j <= #pickupHistory) do
|
||||
local entry = pickupHistory[j]
|
||||
-- ignore the pill if the pill color is Golden
|
||||
if entry[1] == "pill" and entry[2] % 2048 ~= 14 then
|
||||
lastUsedPill = entry[3]
|
||||
lastUsedPillColor = entry[2]
|
||||
break
|
||||
end
|
||||
j = j + 1
|
||||
end
|
||||
local tableName = EID:getTableName(descObj.ObjType, descObj.ObjVariant, descObj.ObjSubType)
|
||||
local name = EID:getPillName(lastUsedPill, tableName == "horsepills")
|
||||
if #EID.coopAllPlayers == 1 then EID:appendToDescription(descObj, "#{{Pill" .. lastUsedPillColor .. "}}")
|
||||
else EID:appendToDescription(descObj, "#" .. EID:GetPlayerIcon(playerType, "P" .. i .. ":")) end
|
||||
EID:appendToDescription(descObj, " {{ColorPill}}" .. name)
|
||||
end
|
||||
end
|
||||
return descObj
|
||||
end
|
||||
|
||||
if EID.isRepentance then
|
||||
-- Handle Birthright
|
||||
local function BirthrightCallback(descObj)
|
||||
@@ -262,7 +298,7 @@ if EID.isRepentance then
|
||||
return descObj
|
||||
end
|
||||
|
||||
-- Handle Glowing Hourglass description
|
||||
-- Handle Glowing Hourglass changed back into Hourglass description
|
||||
local function GlowingHourglassCallback(descObj)
|
||||
if REPENTOGON and EID.collectiblesOwned[422] then
|
||||
local transformedText = EID:getDescriptionEntry("GlowingHourglassTransformed")
|
||||
@@ -302,13 +338,6 @@ if EID.isRepentance then
|
||||
return descObj
|
||||
end
|
||||
|
||||
--simple decimal rounding
|
||||
local function SimpleRound(num, dp)
|
||||
dp = dp or 2
|
||||
local mult = 10^dp
|
||||
return math.floor(num * mult + 0.5)/mult
|
||||
end
|
||||
|
||||
-- 3 coins, 1 bomb, 1 key, 1 soul heart, 2 red hearts
|
||||
local consolationPickups = { "5.20", "5.40", "5.30", "5.10.3", "5.10" }
|
||||
local consolationQuantity = { "3", "1", "1", "1", "2" }
|
||||
@@ -321,10 +350,10 @@ if EID.isRepentance then
|
||||
local playerName = player:GetName()
|
||||
|
||||
local playerStats = {}
|
||||
playerStats[1] = SimpleRound((player.MoveSpeed * 4.5) - 2)
|
||||
playerStats[2] = SimpleRound((((30/(player.MaxFireDelay + 1))^0.75) * 2.120391) - 2)
|
||||
playerStats[3] = SimpleRound(((player.Damage^0.56)*2.231179) - 2)
|
||||
playerStats[4] = SimpleRound(((player.TearRange - 230) / 60) + 2)
|
||||
playerStats[1] = EID:SimpleRound((player.MoveSpeed * 4.5) - 2)
|
||||
playerStats[2] = EID:SimpleRound((((30/(player.MaxFireDelay + 1))^0.75) * 2.120391) - 2)
|
||||
playerStats[3] = EID:SimpleRound(((player.Damage^0.56)*2.231179) - 2)
|
||||
playerStats[4] = EID:SimpleRound(((player.TearRange - 230) / 60) + 2)
|
||||
|
||||
local playerPickups = {}
|
||||
playerPickups[1] = player:GetNumCoins()
|
||||
@@ -517,8 +546,42 @@ if EID.isRepentance then
|
||||
return descObj
|
||||
end
|
||||
|
||||
local hasTarot = false
|
||||
-- Handle Wild Card description addition
|
||||
local function WildCardCallback(descObj)
|
||||
for i = 1,#EID.coopAllPlayers do
|
||||
local player = EID.coopAllPlayers[i]
|
||||
local playerID = EID:getPlayerID(player, true)
|
||||
local playerType = player:GetPlayerType()
|
||||
if EID.WildCardEffects[playerID] then
|
||||
EID:appendToDescription(descObj, "#")
|
||||
|
||||
if #EID.coopAllPlayers > 1 then EID:appendToDescription(descObj, EID:GetPlayerIcon(playerType, "P" .. i .. ":") .. " ") end
|
||||
if EID.WildCardPillColor[playerID] then -- show the correct pill color; unnecessary attention to detail but why not
|
||||
EID:appendToDescription(descObj, "{{Pill" .. EID.WildCardPillColor[playerID] .. "}} {{NameOnly" .. EID.WildCardEffects[playerID] .. "}}")
|
||||
else EID:appendToDescription(descObj, "{{Name" .. EID.WildCardEffects[playerID] .. "}}") end
|
||||
end
|
||||
end
|
||||
return descObj
|
||||
end
|
||||
|
||||
-- Handle The Stars? description addition
|
||||
local function TheStarsCallback(descObj)
|
||||
EID:UpdateAllPlayerPassiveItems()
|
||||
for i = 1,#EID.coopAllPlayers do
|
||||
local player = EID.coopAllPlayers[i]
|
||||
local playerID = EID:getPlayerID(player, true)
|
||||
local playerType = player:GetPlayerType()
|
||||
if EID.OldestItemIndex[playerID] and EID.RecentlyTouchedItems[playerID] then
|
||||
local oldestItem = EID.RecentlyTouchedItems[playerID][EID.OldestItemIndex[playerID]]
|
||||
if oldestItem then
|
||||
EID:appendToDescription(descObj, "#")
|
||||
if #EID.coopAllPlayers > 1 then EID:appendToDescription(descObj, EID:GetPlayerIcon(playerType, "P" .. i .. ":") .. " ") end
|
||||
EID:appendToDescription(descObj, "{{NameC" .. oldestItem .. "}}")
|
||||
end
|
||||
end
|
||||
end
|
||||
return descObj
|
||||
end
|
||||
|
||||
local function VariableCharge(descObj, metadata, collID, chargeText)
|
||||
local text = EID:getDescriptionEntry(chargeText or "VariableCharge")
|
||||
@@ -528,6 +591,7 @@ if EID.isRepentance then
|
||||
end
|
||||
end
|
||||
|
||||
local hasTarot = false
|
||||
-- Handle Blank Card description addition
|
||||
local function BlankCardCallback(descObj)
|
||||
VariableCharge(descObj, EID.cardMetadata[descObj.ObjSubType], 286, "BlankCardCharge")
|
||||
@@ -552,42 +616,6 @@ if EID.isRepentance then
|
||||
VariableCharge(descObj, EID.pillMetadata[adjustedID-1], 348, "PlaceboCharge")
|
||||
return descObj
|
||||
end
|
||||
|
||||
-- Handle VURP description addition
|
||||
local function VurpCallback(descObj)
|
||||
local adjustedID = EID:getAdjustedSubtype(descObj.ObjType, descObj.ObjVariant, descObj.ObjSubType)
|
||||
if adjustedID - 1 ~= PillEffect.PILLEFFECT_VURP then return descObj end
|
||||
|
||||
for i = 1,#EID.coopAllPlayers do
|
||||
local player = EID.coopAllPlayers[i]
|
||||
local playerID = EID:getPlayerID(player)
|
||||
local playerType = player:GetPlayerType()
|
||||
local pickupHistory = EID.PlayerItemInteractions[playerID].pickupHistory
|
||||
-- Dead Tainted Lazarus exception
|
||||
if playerType == 38 then
|
||||
pickupHistory = EID.PlayerItemInteractions[playerID].altPickupHistory or pickupHistory
|
||||
end
|
||||
if pickupHistory then
|
||||
local lastUsedPill = PillEffect.PILLEFFECT_VURP + 1
|
||||
local j = 1
|
||||
while (j <= #pickupHistory) do
|
||||
local entry = pickupHistory[j]
|
||||
-- ignore the pill if the pill color is Golden
|
||||
if entry[1] == "pill" and entry[2] ~= 14 then
|
||||
lastUsedPill = entry[3]
|
||||
break
|
||||
end
|
||||
j = j + 1
|
||||
end
|
||||
local tableName = EID:getTableName(descObj.ObjType, descObj.ObjVariant, descObj.ObjSubType)
|
||||
local name = EID:getPillName(lastUsedPill, tableName == "horsepills")
|
||||
if #EID.coopAllPlayers == 1 then EID:appendToDescription(descObj, "#{{Pill}}")
|
||||
else EID:appendToDescription(descObj, "#" .. EID:GetPlayerIcon(playerType, "P" .. i .. ":")) end
|
||||
EID:appendToDescription(descObj, " {{ColorSilver}}" .. name)
|
||||
end
|
||||
end
|
||||
return descObj
|
||||
end
|
||||
|
||||
-- Handle Experimental Pill description addition
|
||||
local function ExperimentalPillCallback(descObj)
|
||||
@@ -734,11 +762,12 @@ if EID.isRepentance then
|
||||
|
||||
if EID.collectiblesOwned[286] and not EID.blankCardHidden[descObj.ObjSubType] and EID.cardMetadata[descObj.ObjSubType] then table.insert(callbacks, BlankCardCallback) end
|
||||
if EID.collectiblesOwned[263] and EID.runeIDs[descObj.ObjSubType] and EID.cardMetadata[descObj.ObjSubType] then table.insert(callbacks, ClearRuneCallback) end
|
||||
if descObj.ObjSubType == 80 then table.insert(callbacks, WildCardCallback) end
|
||||
if descObj.ObjSubType == 73 then table.insert(callbacks, TheStarsCallback) end
|
||||
-- Pill Callbacks
|
||||
elseif descObj.ObjVariant == PickupVariant.PICKUP_PILL 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
|
||||
@@ -782,6 +811,8 @@ local function EIDConditionsAB(descObj)
|
||||
|
||||
elseif descObj.ObjVariant == PickupVariant.PICKUP_TRINKET then
|
||||
if descObj.ObjSubType == 80 then table.insert(callbacks, BlackFeatherCallback) end
|
||||
elseif descObj.ObjVariant == PickupVariant.PICKUP_PILL then
|
||||
table.insert(callbacks, VurpCallback)
|
||||
end
|
||||
return callbacks
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user