Finishing BFFs / Hive Mind / Greed conditionals (#689)

* Finish BFFS/Hive Mind

* Finishing BFFS/Hive Mind

* finishing BFFS/Hive Mind/Greed conditionals

* BFFS/greed conditionals

* finishing BFFS/Hive Mind/Greed conditionals

* uncapitalize Chance

* Update en_us.lua

* ? card single use

* fix Moving Box + Void

* Big restructuring

* self conditional wip

* add a one sided synergy function

* Update eid_conditionals.lua

* new conditionals + reorganizing

* new conditionals + reorganizing

* todo update

* more conditionals

* more conditionals

* Black Feather gray highlight color

* add item colors, make icons stay with first word

* Update eid_conditionals_funcs.lua

* Update eid_data.lua

* more conditionals

* tech 2 conditional

* tech 2 conditional
This commit is contained in:
Buurazu authored and GitHub committed 2024-06-24 19:34:14 +02:00
1 parent ac796d239a
commit e1bb46308d
8 files changed
+561 -235

No files matched your search

+26 -15
View File
@@ -718,6 +718,7 @@ function EID:replaceShortMarkupStrings(text)
return text
end
local VariantToColorText = { [100] = "{{ColorYellow}}", [350] = "{{ColorYellow}}", [300] = "{{ColorCard}}", [70] = "{{ColorPill}}" }
-- Replaces name markup objects with the actual name
function EID:replaceNameMarkupStrings(text)
for word in string.gmatch(text, "{{Name.-}}") do
@@ -737,21 +738,25 @@ function EID:replaceNameMarkupStrings(text)
table.insert(entityID, tonumber(e))
end
local iconText = ""
if showIcon then
if entityID[1] == 1 then iconText = "{{Player" .. entityID[3] .. "}} "
else iconText = "{{" .. EID:GetIconNameByVariant(entityID[2]) .. entityID[3] .. "}} " end
local colorText = ""
if entityID[1] == 1 then
if showIcon then iconText = "{{Player" .. entityID[3] .. "}} " end
colorText = "{{ColorIsaac}}"
else
if showIcon then iconText = "{{" .. EID:GetIconNameByVariant(entityID[2]) .. entityID[3] .. "}} " end
colorText = VariantToColorText[entityID[2]] or ""
end
name = iconText .. EID:getObjectName(entityID[1], entityID[2], entityID[3])
name = iconText .. colorText .. EID:getObjectName(entityID[1], entityID[2], entityID[3]) .. "{{CR}}"
elseif indicator == "C" then -- Collectible
name = (showIcon and "{{Collectible"..id.."}} " or "")..EID:getObjectName(5, 100, id)
name = (showIcon and "{{Collectible"..id.."}} " or "") .. "{{ColorYellow}}" .. EID:getObjectName(5, 100, id) .. "{{CR}}"
elseif indicator == "T" then -- Trinket
name = (showIcon and "{{Trinket"..id.."}} " or "")..EID:getObjectName(5, 350, id)
name = (showIcon and "{{Trinket"..id.."}} " or "") .. "{{ColorYellow}}" .. EID:getObjectName(5, 350, id) .. "{{CR}}"
elseif indicator == "P" then -- Pills
name = (showIcon and "{{Pill"..id.."}} " or "")..EID:getPillName(id, false)
name = (showIcon and "{{Pill"..id.."}} " or "") .. "{{ColorPill}}" .. EID:getPillName(id, false) .. "{{CR}}"
elseif indicator == "K" then -- Card
name = (showIcon and "{{Card"..id.."}} " or "")..EID:getObjectName(5, 300, id)
name = (showIcon and "{{Card"..id.."}} " or "") .. "{{ColorCard}}" .. EID:getObjectName(5, 300, id) .. "{{CR}}"
elseif indicator == "I" then -- Player (I for Isaac)
name = (showIcon and "{{Player"..id.."}} " or "")..EID:getPlayerName(id)
name = (showIcon and "{{Player"..id.."}} " or "") .. "{{ColorIsaac}}" .. EID:getPlayerName(id) .. "{{CR}}"
end
text = string.gsub(text, word, name, 1)
end
@@ -997,15 +1002,19 @@ function EID:replaceAllMarkupWithSpaces(text, checkBulletpoint)
return ""
end
end
-- iconsFound is used to make the next space after a markup icon be immune to line breaks, but only if it's just one icon with no other text
local iconsFound = 0; if text:gsub(" ", ""):gsub("{{.-}}","") ~= "" then iconsFound = -999 end
for word in string.gmatch(text, "{{.-}}") do
local lookup = EID:getIcon(word)
if lookup[1] ~= "ERROR" then
text = string.gsub(text, word, EID:generatePlaceholderString(lookup[3]), 1)
iconsFound = iconsFound + 1
else
text = string.gsub(text, word, "", 1)
end
end
return text
return text, iconsFound
end
-- Fits a given string to a specific width
@@ -1013,8 +1022,8 @@ end
function EID:fitTextToWidth(str, textboxWidth, breakUtf8Chars)
local formattedLines = {}
-- Lines with a {{NoLineBreak}} tag should be left in one continuous line
if str:find("{{NoLineBreak}}") then
str = str:gsub("{{NoLineBreak}}","")
if str:find("{{NoLineBreak}}") or str:find("{{NoLB}}") then
str = str:gsub("{{NoLineBreak}}",""):gsub("{{NoLB}}","")
table.insert(formattedLines,str)
return formattedLines
end
@@ -1022,6 +1031,8 @@ function EID:fitTextToWidth(str, textboxWidth, breakUtf8Chars)
local text = {}
-- the first word we run into might actually be a bulletpoint icon, which should be zero width
local isBulletpoint = true
-- if we find an icon by itself, we should skip the following space
local previousWordWasIcon = false
local cursor = 1
local word_begin_index = 1
@@ -1088,11 +1099,11 @@ function EID:fitTextToWidth(str, textboxWidth, breakUtf8Chars)
-- we can break after str[cursor]
local word = sub(str, word_begin_index, cursor)
local wordFiltered = EID:replaceAllMarkupWithSpaces(word, isBulletpoint)
local wordFiltered, iconsFound = EID:replaceAllMarkupWithSpaces(word, isBulletpoint)
isBulletpoint = false
local wordLength = EID:getStrWidth(wordFiltered)
if curLength + wordLength <= textboxWidth or curLength < 17 then
if curLength + wordLength <= textboxWidth or curLength < 17 or previousWordWasIcon then
table.insert(text, word)
curLength = curLength + wordLength
else
@@ -1100,7 +1111,7 @@ function EID:fitTextToWidth(str, textboxWidth, breakUtf8Chars)
text = { word }
curLength = wordLength
end
previousWordWasIcon = (iconsFound == 1)
-- next word starts here
word_begin_index = cursor + 1
end
+218 -112
View File
@@ -16,102 +16,76 @@ Argument 4: Optional table that can define a variety of different settings
]]
-- General conditions
-- Tarot Cloth (AB+ and Rep) (fallback to English because most are just find+replace)
------ GENERAL CONDITIONS ------
-- Tarot Cloth
if not EID.isRepentance then
EID:AddItemConditional("5.300", 451, nil, {locTable = "tarotClothBuffsAB", replaceColor = "ColorShinyPurple", noFallback = false})
else EID:AddItemConditional("5.300", 451, nil, {locTable = "tarotClothBuffs", replaceColor = "ColorShinyPurple", noFallback = false}) end
EID:AddItemConditional("5.100", 356, EID.CheckForCarBattery, {locTable = "carBattery", replaceColor = "BlinkYellowGreen", noFallback = false}) -- Car Battery
EID:AddItemConditional("5.100", 247, EID.CheckForBFFS, {locTable = "BFFSSynergies", replaceColor = "BlinkPink", noFallback = false}) -- BFFS!
-- IV Bag conditions (need to be applied in a specific order)
EID:AddItemConditional(135, 75, "PHD") -- PHD improves IV Bag
EID:AddPlayerConditional(135, 14, "Keeper 0-1") -- Keeper gets 0-1 coins
if EID.isRepentance then EID:AddConditional(135, EID.IsHardMode, "Hard Mode") end -- Hard Mode pays out less
-- Car Battery
EID:AddItemConditional("5.100", 356, EID.CheckForCarBattery, {locTable = "carBattery", replaceColor = "BlinkYellowGreen", noFallback = false})
EID:AddConditional(356, EID.CheckActivesForCarBattery, "No Effect") -- "No effect" text for Car Battery pedestal
-- Greed Mode
-- "No effect" append
EID:AddConditional({134, 241, 464, "5.300.22", "5.350.59", "5.350.83", "5.350.84", "5.350.85", "5.350.102", "5.350.110", "5.350.111", "5.350.124"}, EID.IsGreedMode, "No Effect (Greed)") -- Guppy's Tail, Contract from Below, Glyph of Balance, The World, Cain's Eye, Store Key, Rib of Greed, Karma, Fragmented Card, Silver Dollar, Bloody Crown, Door Stop
EID:AddConditional({483, 535, "5.300.15", "5.300.19", "5.300.20"}, EID.IsGreedMode) -- Mama Mega, Blanket, Temperance, The Moon, The Sun
-- todo: isaac's fork; and maybe some other "room" effects that also work on wave clear could mention waves
-- change the "room clear reward" trinkets (like ace of spades) to not mention room clears
-- broken modem room clear duplication shouldn't be mentioned?
-- BFFS! / Hive Mind
EID:AddItemConditional({"5.100","5.350.54","5.350.57"}, 247, EID.CheckForBFFS, {locTable = "BFFSSynergies", replaceColor = "BlinkPink", noFallback = false})
EID:AddConditional(247, EID.CheckFamiliarsForBFFS, "No Effect") -- "No effect" text for BFFS pedestal
if EID.isRepentance then
EID:AddConditional({344, 416, "5.300.74"}, EID.IsGreedMode) -- Match Book, Deep Pockets, The Moon?
EID:AddItemConditional({"5.300.96", "5.350.142", "5.350.176", "5.350.182", "5.350.186"}, 247, EID.CheckForBFFS, {locTable = "BFFSSynergies", replaceColor = "BlinkPink", noFallback = false}) -- BFFS! Repentance soulstone/trinkets
EID:AddItemConditional("5.100", 248, EID.CheckForHiveMind, {locTable = "BFFSSynergies", replaceColor = "BlinkBlue", noFallback = false}) -- Hive Mind
EID:AddSynergyConditional(247, 248, "No Effect (Familiars)") -- Already having Hive Mind / BFFS!
end
-- Different effect for No Red Health players
EID:AddConditional({442, "5.350.107", "5.350.119"}, function() return EID:CheckForNoRedHealthPlayer() end, "No Red") -- Dark Prince's Crown, Crow Heart, Stem Cell
EID:AddConditional(81, function() return EID:CheckForNoRedHealthPlayer() end) -- Dead Cat
-- Abyss, Birthright Book of Belial, Binge Eater
if EID.isRepentance then
EID:AddItemConditional("5.100", 706, nil, { locTable = "abyssSynergies", lineColor = "ColorRed" }, false) -- Abyss (no item reminder)
EID:AddItemConditional("5.100", 59, nil, { locTable = "bookOfBelialBuffs" }) -- Belial Birthright
EID:AddItemConditional("5.100", 664, nil, { locTable = "bingeEaterBuffs" }) -- Binge Eater
end
-- Achievement checks (these always return true without REPENTOGON)
------ GREED MODE ------
-- "No effect" append
EID:AddConditional({134, 241, 464, "5.300.22", "5.350.59", "5.350.83", "5.350.84", "5.350.85", "5.350.102", "5.350.110", "5.350.111", "5.350.124", 21, 54, 249, 376, 437}, EID.IsGreedMode, "No Effect (Greed)") -- Guppy's Tail, Contract from Below, Glyph of Balance, The World, Cain's Eye, Store Key, Rib of Greed, Karma, Fragmented Card, Silver Dollar, Bloody Crown, Door Stop, Treasure Map, Compass, There's Options, Restock, D7
-- Not bothering with Repentance no effect items because they're all tagged nogreed
-- change the word "room" to "wave"
EID:AddConditional({266, "5.350.46", 385}, EID.IsGreedMode, "Room to Wave")
-- append/overwrite some descriptions
EID:AddConditional({483, 535, "5.300.15", "5.300.19", "5.300.20", 246, 333, "5.350.120", "5.350.34", "5.350.36", "5.350.41", "5.350.44", "5.350.45", "5.350.72", 514 }, EID.IsGreedMode) -- Mama Mega, Blanket, Temperance, The Moon, The Sun, Blue Map, The Mind, Hairpin, some nogreed trinkets, Broken Modem
EID:AddConditional({"5.350.5", 208}, EID.IsGreedMode, "No Champion Drops")
if EID.isRepentance then
EID:AddConditional({567, 693, "5.350.163", "5.350.167", }, EID.IsGreedMode, "Room to Wave")
EID:AddConditional({344, 416, "5.300.74", 566, 580, "5.300.83", "5.350.162"}, EID.IsGreedMode) -- Match Book, Deep Pockets, The Moon?, Dream Catcher, Red Key, Soul of Cain, Azazel's Stump
end
------ ACHIEVEMENT CHECKS ------
-- Achievement functions always return true without REPENTOGON, so use them how you need to have non-ogon players see what they should.
EID:AddConditional("5.350.23", function() return EID:HaveNotUnlockedAchievement(82) end) -- Sacrifice Poster unlocks The Lost
EID:AddConditional(297, function() return not EID:HaveNotUnlockedAchievement(366) end) -- Pandora's Box unlocking Moving Box
-- Specific character synergies/changes
------ NO RED HEALTH PLAYERS ------
EID:AddConditional({442, "5.350.107", "5.350.119"}, EID.CheckForNoRedHealthPlayer, "No Red") -- Dark Prince's Crown, Crow Heart, Stem Cell
EID:AddConditional(81, EID.CheckForNoRedHealthPlayer) -- Dead Cat
if EID.isRepentance then
EID:AddConditional({569, 671, 676}, EID.CheckForNoRedHealthPlayer, "No Red") -- Blood Oath, Candy Heart, Empty Heart
EID:AddPlayerConditional({671, 676}, 14, "No Effect") -- Candy Heart / Empty Heart + Keeper
EID:AddPlayerConditional(676, 16, "No Effect", nil, false) -- Empty Heart + Forgotten (not Tainted)
end
------ SPECIFIC CHARACTER SYNERGIES/CHANGES ------
-- Note that passing "false" as a 5th variable to AddPlayerConditional will make it so the Tainted version of the char doesn't count, otherwise it does
EID:AddPlayerConditional(549, { 10, 14 }) -- Keeper/Lost + Brittle Bones
EID:AddPlayerConditional(108, 14, "No Effect") -- Keeper + The Wafer
EID:AddPlayerConditional(227, 14, "Keeper 0-1") -- Keeper + Piggy Bank
EID:AddPlayerConditional(501, 14) -- Keeper + Greed's Gullet
EID:AddPlayerConditional(230, 14, "Keeper") -- Keeper + Abaddon
-- Item Synergies
EID:AddSynergyConditional(7, {34, "5.300.16"}) -- Martyr + Book of Belial/The Devil
EID:AddSynergyConditional(316, 260) -- Black Candle + Cursed Eye
EID:AddItemConditional("5.300.48", 286, nil, { lineColor = "ColorSilver" }) -- Blank Card + ? Card
EID:AddSynergyConditional({475, "5.300.46"}, {210}, "Suicide 1", "Suicide 2") -- Plan C + Gnawed Leaf
EID:AddSynergyConditional({475, "5.300.46"}, {276, 313}, "Suicide 1", "Suicide 2") -- Plan C, Suicide King + Isaac's Heart, Holy Mantle
EID:AddSynergyConditional(368, {69, 118, 316, 229, 395, 114, 329}, "Almost No Effect") -- Epiphora + Charge Shots / Ludovico
-- 9 Volt + 1 Room/Timed Charges
-- This got a bit complicated, since it looks at a trait of every collectible + you having another, but hey, it's compact
EID:AddConditional(116, function() return EID:CheckPlayersForActiveChargeType(1) end, "1 Room", { useResult = true })
EID:AddConditional(116, function() return EID:CheckPlayersForActiveChargeType(nil, 1) end, "Timed", { useResult = true })
EID:AddConditional("5.100", function(descObj) return EID:PlayersHaveCollectible(116) and EID:CheckActiveChargeType(descObj.ObjSubType, 1) end, "1 Room", { bulletpoint = "Collectible116" })
EID:AddConditional("5.100", function(descObj) return EID:PlayersHaveCollectible(116) and EID:CheckActiveChargeType(descObj.ObjSubType, nil, 1) end, "Timed", { bulletpoint = "Collectible116" })
-- Items that have no effect from multiple copies (AddSelfConditional adds it when holding Diplopia automatically)
-- 3 Dollar Bill,
EID:AddSelfConditional({191}, "No Effect (Copies)")
if not EID.isRepentance then
-- Anti-Gravity,
EID:AddSelfConditional({222}, "No Effect (Copies)")
end
EID:AddPlayerConditional(152, 2, "Technology 2 One Eye") -- Cain + Technology 2
if EID.isRepentance then
-- 2Spooky,
EID:AddSelfConditional({554}, "No Effect (Copies)")
end
-- Overridden / Overrides by Epic Fetus, Brimstone, Mom's Knife
-- Haven't done it yet but I'm sure preparing the system for it
-- Remember some of these will be AB+ only (not EID.isRepentance)
-- AB+ only conditionals
if not EID.isRepentance then
EID:AddItemConditional(205, {116, 276}, "No Effect") -- Sharp Plug + 9 Volt, Isaac's Heart
EID:AddItemConditional(205, 108, "Wafer") -- Sharp Plug + The Wafer
EID:AddSynergyConditional(205, 441, "Can't Charge", "Can't Be Charged") -- Sharp Plug + Mega Blast
EID:AddConditional(208, function() return EID:IsHardMode() end) -- Champion Belt
end
-- Rep only conditionals
if EID.isRepentance then
-- General conditions
EID:AddItemConditional("5.100", 706, nil, { locTable = "abyssSynergies", lineColor = "ColorRed" }, false) -- Abyss (no item reminder)
EID:AddItemConditional("5.100", 59, nil, { locTable = "bookOfBelialBuffs" }) -- Belial Birthright
EID:AddItemConditional("5.100", 664, nil, { locTable = "bingeEaterBuffs" }) -- Binge Eater
-- Co-op friendly items
-- todo: which? (extension cord)
EID:AddConditional(45, function() return EID:MultiplePlayerCharacters() end) -- Yum Heart
-- No red health
EID:AddConditional({569, 671, 676}, function() return EID:CheckForNoRedHealthPlayer() end, "No Red") -- Blood Oath, Candy Heart, Empty Heart
EID:AddPlayerConditional({671, 676}, 14, "No Effect") -- Candy Heart / Empty Heart + Keeper
EID:AddPlayerConditional(676, 16, "No Effect", nil, false) -- Empty Heart + Forgotten (not Tainted)
-- Tainted characters reviving as themselves
EID:AddPlayerConditional({ 161, "5.350.28" }, 25, "Tainted Revive") -- Ankh, Broken Ankh
EID:AddPlayerConditional(311, 24, "Tainted Revive") -- Judas's Shadow
@@ -121,7 +95,7 @@ if EID.isRepentance then
-- Specific character synergies/changes
EID:AddPlayerConditional("5.350.1", 14, "Keeper 0-1") -- Keeper + Swallowed Penny
EID:AddPlayerConditional(188, 2) -- Cain + Abel
EID:AddPlayerConditional(360, 13) -- Incubus + Lilith
EID:AddPlayerConditional({ 360, 728 }, 13) -- Incubus/Gello + Lilith
EID:AddPlayerConditional({ 240, 644 }, 21) -- Tainted Isaac + Experimental Treatment, Consolation Prize
EID:AddPlayerConditional({ 642, 694 }, 10) -- Lost + Magic Skin, Heartbreak
EID:AddPlayerConditional(694, 14, "Keeper", nil, false) -- Keeper + Heartbreak
@@ -132,50 +106,182 @@ if EID.isRepentance then
EID:AddPlayerConditional(245, 14, "Keeper") -- 20/20 + Keeper
EID:AddPlayerConditional(705, { 12, 24 }) -- Dark Arts + Dark/Tainted Judas
EID:AddPlayerConditional(205, 22, "Tainted Magdalene")-- Tainted Magdalene + Sharp Plug
EID:AddPlayerConditional({"5.350.100", "5.350.101"}, 18, "Bethany", nil, false) -- Bethany + Vibrant/Dim Bulb
EID:AddPlayerConditional({"5.350.100", "5.350.101"}, 36, "Tainted Bethany") -- Tainted Bethany + Vibrant/Dim Bulb
end
------ DUPLICATE COPIES OF ITEMS ------
-- Items that have no effect from multiple copies (AddSelfConditional adds it when holding Diplopia automatically)
-- This list is mostly taken from Diplopia's wiki page, there's a lot more with no effect out there I'm sure
EID:AddSelfConditional({7, 55, 63, 69, 87, 104, 106, 108, 109, 116, 122, 132, 139, 149, 152, 156, 162, 169, 191, 200, 203, 214, 221, 225, 231, 233, 238, 239, 243, 244, 247, 248, 249, 261, 276, 299, 300, 313, 316, 330, 350, 356, 366, 368, 371, 374, 379, 400, 401, 408, 411, 412, 414, 416, 423, 429, 444, 446, 447, 450, 451, 458, 494, 495, 496, 501, 524, 525, 529, 532, 533, 534, 540, 546, }, "No Effect (Copies)")
-- Items that have an interesting effect from multiple copies
EID:AddSelfConditional({2, 64, 118, 153, 245, 358}, "Copies")
-- Items that can't be duplicated
EID:AddItemConditional(347, 347, "Can't Be Duplicated", nil, false) -- Diplopia
if not EID.isRepentance then
EID:AddSelfConditional({115, 222, 224, 228, 531}, "No Effect (Copies)")
EID:AddSelfConditional({440}, "Copies")
end
if EID.isRepentance then
EID:AddSelfConditional({399, 440, 554, 561, 577, 586, 600, 612, 616, 634, 651, 656, 670, 671, 674, 678, 686, 701}, "No Effect (Copies)")
EID:AddSelfConditional({531}, "Copies")
EID:AddItemConditional({"5.350", "5.300.33"}, 347, "Can't Be Duplicated", nil, false) -- Trinkets, Jera
end
------ OVERRIDES / OVERRIDDEN BY -----
-- huge TODO here, a lot of AB+ only ones too
if not EID.isRepentance then
end
if EID.isRepentance then
EID:AddSynergyConditional(330, 561, "Overridden", "Overrides") -- Soy Milk + Almond Milk
end
----- MISC. ITEM CONDITIONS ------
-- IV Bag conditions (need to be applied in a specific order)
EID:AddItemConditional(135, 75, "PHD") -- PHD improves IV Bag
EID:AddPlayerConditional(135, 14, "Keeper 0-1") -- Keeper gets 0-1 coins
if EID.isRepentance then EID:AddConditional(135, EID.IsHardMode, "Hard Mode") end -- Hard Mode pays out less
-- Suicide item interactions
EID:AddSynergyConditional({475, "5.300.46"}, {210, 276, 313}, "Suicide 1", "Suicide 2") -- Plan C, Suicide King + Isaac's Heart, Holy Mantle, Gnawed Leaf
if EID.isRepentance then
EID:AddSynergyConditional({577, 656}, {276, 313}, "Suicide 1", "Suicide 2") -- Damocles + Isaac's Heart, Holy Mantle
EID:AddSynergyConditional({577, 656, 475, "5.300.46"}, {674, 694}, "Suicide 1", "Suicide 2") -- Damocles, Plan C, Suicide King + Spirit Shackles, Heartbreak
end
-- Actives with certain charge types interactions
-- 9 Volt + 1 Room/Timed
EID:AddConditional(116, function() return EID:CheckPlayersForActiveChargeType(1, 0) end, "1 Room")
EID:AddConditional(116, function() return EID:CheckPlayersForActiveChargeType(nil, 1) end, "Timed")
EID:AddConditional("5.100", function(EID, descObj) return EID:CheckActiveChargeType(descObj.ObjSubType, 1, 0, 116) end, "9 Volt 1 Room", { bulletpoint = "Collectible116" })
EID:AddConditional("5.100", function(EID, descObj) return EID:CheckActiveChargeType(descObj.ObjSubType, nil, 1, 116) end, "9 Volt Timed", { bulletpoint = "Collectible116" })
-- Vibrant/Dim Bulb
EID:AddConditional({"5.350.100", "5.350.101"}, EID.CheckForMultipleActives, "Bulb Multiple") -- Vibrant/Dim Bulb + Having multiple actives
EID:AddConditional({"5.350.100", "5.350.101"}, function() return EID:CheckPlayersForActiveChargeType(0, nil, false) end, "Bulb Zero") -- Vibrant/Dim Bulb + Having a 0-charge active
EID:AddConditional("5.350.101", function() return EID:CheckPlayersForActiveChargeType(nil, 1, false) end, "Timed") -- Dim Bulb + Having a timed active
if not EID.isRepentance then
-- AB+ Sharp Plug oddities
EID:AddItemConditional(205, {116, 276}, "No Effect") -- Sharp Plug + 9 Volt, Isaac's Heart
EID:AddItemConditional(205, 108, "Wafer") -- Sharp Plug + The Wafer
EID:AddSynergyConditional(205, 441, "Can't Charge", "Can't Be Charged") -- Sharp Plug + Mega Blast
end
if EID.isRepentance then
-- 9 Volt, Sharp Plug + Special Charge Actives
EID:AddConditional({116, 205}, function() return EID:CheckPlayersForActiveChargeType(nil, 2) end, "Can't Charge")
EID:AddConditional("5.100", function(EID, descObj) return EID:CheckActiveChargeType(descObj.ObjSubType, nil, 2, 116) end, "Can't Be Charged", { bulletpoint = "Collectible116", variableText = "{{NameOnlyC116}}" })
EID:AddConditional("5.100", function(EID, descObj) return EID:CheckActiveChargeType(descObj.ObjSubType, nil, 2, 205) end, "Can't Be Charged", { bulletpoint = "Collectible205", variableText = "{{NameOnlyC205}}" })
-- 4.5 Volt interactions
EID:AddConditional(647, function() return EID:CheckPlayersForActiveChargeType(nil, 1) end, "4.5 Volt Timed") -- 4.5 Volt + Having a timed active
EID:AddConditional("5.100", function(EID, descObj) return EID:CheckActiveChargeType(descObj.ObjSubType, nil, 1, 647) end, "4.5 Volt Timed", { bulletpoint = "Collectible647"})
EID:AddItemConditional(534, 647, "4.5 Volt Multiple") -- Schoolbag + 4.5 Volt
EID:AddConditional(647, EID.CheckForMultipleActives, "4.5 Volt Multiple")-- 4.5 Volt + Schoolbag/Pocket Actives
end
-- Sacrificial Altar interactions
EID:AddSynergyConditional(504, 536, "Sacrificial Nugget") -- Sacrificial Altar + Brown Nugget
EID:AddOneSidedSynergyConditional({112, 363, 390}, 536, "Sacrificial Angels") -- Sacrificial Altar + Angel Familiars
EID:AddOneSidedSynergyConditional({412, 413}, 536, "Sacrificial Conception") -- Sacrificial Altar + Cambion/Immaculate Conception
if not EID.isRepentance then
EID:AddSynergyConditional(477, 536, "Sacrificial Void") -- Sacrificial Altar + Void (AB+ only)
end
if EID.isRepentance then
EID:AddSynergyConditional(712, 536, "Sacrificial Item Wisps") -- Sacrificial Altar + Lemegeton
EID:AddSynergyConditional(650, 536, "Sacrificial Plum") -- Sacrificial Altar + Plum Flute
EID:AddSynergyConditional(661, 536, "Sacrificial Quints") -- Sacrificial Altar + Quints
EID:AddSynergyConditional(706, 536, "Sacrificial Abyss") -- Sacrificial Altar + Abyss Locusts
EID:AddSynergyConditional(651, 536, "Sacrificial Star") -- Sacrificial Altar + Star of Bethlehem
EID:AddSynergyConditional(713, 536, "Sacrificial Clots") -- Sacrificial Altar + Sumptorium
end
-- Miscellaneous Item Synergies
EID:AddSynergyConditional(7, {34, "5.300.16"}) -- Martyr + Book of Belial/The Devil
EID:AddSynergyConditional(316, 260) -- Black Candle + Cursed Eye
EID:AddItemConditional("5.300.48", 286, nil, { lineColor = "ColorSilver" }) -- Blank Card + ? Card
EID:AddSynergyConditional(368, {69, 118, 316, 229, 395, 114, 329}, "Almost No Effect") -- Epiphora + Charge Shots / Ludovico
EID:AddSynergyConditional({127, 297, 347, 490, 483, 515, 475, 536}, "5.300.48", "? Card Single Use") -- ? Card + Single Use Actives
if EID.isRepentance then EID:AddSynergyConditional({585, 577, 628, 636}, "5.300.48", "? Card Single Use") end -- ? Card + Single Use Actives
EID:AddConditional(521, EID.PlayersHaveRestock) -- Coupon + Restock/Greed
for k,_ in pairs(EID.blackFeatherItems) do EID:AddItemConditional(k, "5.350.80", "Black Feather", {lineColor="BlinkGray"}) end -- Black Feather
for k,_ in pairs(EID.blackFeatherTrinkets) do EID:AddItemConditional("5.350." .. k, "5.350.80", "Black Feather", {lineColor="BlinkGray"}) end -- Black Feather
EID:AddItemConditional("5.70.28", 358) -- Wizard pill + The Wiz
EID:AddItemConditional(523, 477) -- Moving Box is a passive to Void
EID:AddItemConditional({8, 113, 163, 167, 99, 100, 174, 95, 268, 67}, 322, "Mongo Babies") -- Mongo Baby + Copiable familiars
if EID.isRepentance then EID:AddItemConditional(608, 322, "Mongo Babies") end
-- AB+ only misc conditionals
if not EID.isRepentance then
EID:AddConditional(208, EID.IsHardMode, nil, {noFallback = false}) -- Champion Belt (AB+ Hard Mode)
end
-- Rep only misc conditionals
if EID.isRepentance then
-- Co-op friendly items
-- todo: what items have a cool co-op synergy?
EID:AddConditional({45, "5.350.125"}, EID.MultiplePlayerCharacters) -- Yum Heart, Extension Cord
EID:AddConditional({"1000.76.0", "1000.76.5"}, EID.MultiplePlayerCharacters) -- Dice Room 1 and 6
-- Item Synergies
EID:AddItemConditional(201, 147) -- Iron Bar refills Notched Axe
EID:AddItemConditional("5.350.172", 260) -- Black Candle + Cursed Penny
EID:AddItemConditional(501, 416) -- Greed's Gullet + Deep Pockets
EID:AddSynergyConditional(245, { 2, 153, 169 }, nil, "20/20") -- 20/20 + The Inner Eye, Mutant Spider, Polyphemus
EID:AddSynergyConditional(330, 561, "Overridden", "Overrides") -- Soy Milk + Almond Milk
EID:AddSynergyConditional({577, 656}, {276, 313}, "Suicide 1", "Suicide 2") -- Damocles + Isaac's Heart, Holy Mantle
EID:AddSynergyConditional({577, 656, 475, "5.300.46"}, {674, 694}, "Suicide 1", "Suicide 2") -- Damocles, Plan C, Suicide King + Spirit Shackles, Heartbreak
EID:AddSynergyConditional(596, {"5.350.118", 704, 62, "5.350.60", 520, 411, 621, "5.350.58", "5.350.189", 657}, "Ice Tears") -- Uranus + On Kill Effects
EID:AddPlayerConditional(596, 27, "Ice Tears") -- Uranus + Tainted Samson
EID:AddSynergyConditional(495, 616, "Both Peppers") -- Ghost Pepper + Bird's Eye
EID:AddSynergyConditional(726, {408, 646, 293, 679, 275, 399, 680, 441, 49, 533}, "Hemoptysis") -- Hemoptysis + Brimstone effects
-- 9 Volt, Sharp Plug + Special Charge Actives
EID:AddConditional({116, 205}, function() return EID:CheckPlayersForActiveChargeType(nil, 2) end, "Can't Charge", { useResult = true })
EID:AddConditional("5.100", function(descObj) return EID:PlayersHaveCollectible(116) and EID:CheckActiveChargeType(descObj.ObjSubType, nil, 2) end, "Can't Be Charged", { bulletpoint = "Collectible116", variableText = "{{NameOnlyC116}}" })
EID:AddConditional("5.100", function(descObj) return EID:PlayersHaveCollectible(205) and EID:CheckActiveChargeType(descObj.ObjSubType, nil, 2) end, "Can't Be Charged", { bulletpoint = "Collectible205", variableText = "{{NameOnlyC205}}" })
-- eye drops + passives like brimstone go here but there's a lot of them
EID:AddPlayerConditional(600, {2, 7, 13, 16}) -- Eye Drops + Cain, Azazel, Lilith, Forgotten
EID:AddSynergyConditional(152, {708, 444}, "Technology 2 One Eye") -- Technology 2 + Stapler, Lead Pencil
end
--[[
TODO STUFF:
BUURAZU'S TODO STUFF:
Overridden / Overrides (Brimstone, Mom's Knife, Epic Fetus stuff)
Co-op benefit items (not sure what they are tbh)
Spoiler achievement descriptions (plus a config setting possibly, to always show the spoilers) (Chaos Card and Plan C?)
BFFs / Hive Mind + Tainted Apollyon, Tainted Eve, Tainted Lilith; melody trinket + Tainted Eve/Lilith; these are insane synergies that deserve attention
Maybe a find/replace pair for some Keeper descriptions that talk about Red hearts but work for him, Red -> Coin or Red/Coin; Could be good for Dead Cat. or just leave it be
Crystal Key + Pandora's Box should be moved here? Or leave it in modifiers
Are Blank Card + Placebo + Clear Rune ready to get moved to here now that I have good ways to return values?
Jacob's Ladder synergies with other battery items (I didn't even know about this)
Bean synergies with ghost pepper/bird's eye
Car Battery / BFFS whitelist for showing certain lines on the car/bffs pedestal, not just "No effect"
Implement a system where similar texts don't get shown multiple times in one apply conditionals function (hive minds/bffs)
hallowed ground / midas touch + the poop / card against humanity / everything jar synergies
Add Void synergy information for some active items (which?) (warn on things like mom's box you don't get double trinket power?)
TODOS I'VE DECIDED NOT TODO RIGHT NOW:
Incubus effects; a lot are AB+ only; annoying to test; plus Lilith has to be added for all of them too
TODOs unrelated to conditionals:
Luck modifier that prints out a percentage for the effect based on your current luck stat
Glyph of Balance prediction in Item Reminder?
Purity's current stat boost, if possible
Implement the standardized colors for characters, items, map names, etc
Character info tab in item reminder
Make Glitched Crown type pedestals work better in EID (pause on one item and press tab to switch to the next item)
Don't show Void stat ups depending on what Void has absorbed (abyss absorbed = no void stat ups etc, reroll item = might become actives)
Wild Card vurp-like desc modifier
MAYBE SOME DAYS:
Bag of Crafting "sort by recipe nearest completion in bag" option
no recipes mode could suggest ingredient replacement (replace: {lowest}->{highest})
super bum shouldn't count duplicate progress
Add a background or something to overlapping local descs
Pre-cache an entity's description in some way before even looking at them using coroutines
Reorganize eid_api better, maybe split it in two, shouldn't the api only contain functions other modders would use?
Make api functions for conditionals/other new features I've made that might be difficult for modders to approach
"Add golden trinket / mom's box / is rune / is card / placebo recharge / false phd info for mods to add in EID:addCard/Pill?" - did most of these happen?
check the actual github wiki, i've never looked at that, maybe I should update that some time
As eid_modifiers' usefulness dwindles, maybe it should add its modifiers like how external mods would add them
new config options for spoiler-heavy descriptions if we make any (chaos card and plan C?)
CO-OP BENEFIT ITEMS! tech zero / extension cord in co-op? yum heart and such
Items that override other items (brimstone, mom's knife, epic fetus stuff)
BFFs / the fly booster + Tainted Apollyon, Tainted Eve; melody trinket + Tainted Eve; these are insane synergies that deserve attention
TODO: Make some of these coll/char IDs be from the enum for readability? or just keep it to comments
TODO: A find/replace pair for some Keeper descriptions that talk about Red hearts but work for him, Red -> Coin or Red/Coin; Could be good for Dead Cat. or just leave it be
-- hey what if all these Luck addons that I kinda don't like instead showed an accurate percentage of what they do at your current luck (although this is Modifier territory, with a per character display) (might be annoying though)
-- todo: TrinketConditional, use it for the crystal key + pandora's box or whichever key it is, and Black Feather items maybe (leave the damage calc to modifiers, but we can append text to black feather items)
-- todo: Vibrant/Dim Bulb + doesn't work with pocket consumables
-- todo: idk about the BFFs synergy stuff but I noticed that Brown Nugget is incorrectly dealt with, it gained double damage in rep
-- hive mind and BFFs synergy has a lot of overlap also, need a data list of hivemind familiars
-- brown nugget + sacrificial altar in AB+?!
-- ? Card + single use actives in Repentance? Alabaster Box. is there a way to detect an active is a single-use active or do we need a hardcode list?
-- unrelated to conditionals: Glyph of Balance prediction in Item Reminder?
-- Jacob's Ladder synergies with other battery items (I didn't even know about this)
-- Bean actives synegies with ghost pepper/bird's eye
-- todo: head of krampus damage (needs rep version), shoop da whoop damage / tick count (differs by 1 in repentance lol ok), head of krampus car battery, rep car battery
-- Greed Mode useless World card, Moon warps to super secret, Glyph of Balance very bad in AB+ (removed from Greed in rep), Blanket bad, Deep Pockets bad
car battery "no effect" items (also apply this as a synergy where car battery has no effect text, and other bad synergies, based on your active)
-- overall todo: remove "tick" language from all descriptions; Lil brimstone, black powder, black hole
Cain + items that close his eyes? mostly AB+ only?
Pandora's Box achievement check if moving box is unlocked find replace that with "nothing"
]]
+112 -46
View File
@@ -7,6 +7,7 @@ local game = Game()
If you're adding a condition that applies to an entire type of item, pass in a string in Type.Var format
Argument 2: The function that will apply the condition if it returns true; descObj will be passed into this function
This function can return a collectible ID, which will be used for bulletpoints/variable text
Argument 3 (optional): Additional text for finding the string in the localization file
For example, if you put "Overridden" here, modifying Tech X, it will look for ConditionalDescs["5.100.395 (Overridden)"] AND ConditionalDescs["Overridden"]
@@ -20,22 +21,30 @@ local game = Game()
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
useResult: The condition function can return a collectible ID; if true, use that ID to generate bulletpoint/variable text. This is to be able to use specific collectible icons/names while using more general modded-item-friendly conditions
usePedestalName: If true, display the pedestal item's name in place of {1}
Argument 5 (very optional): The position in the table to insert this new condition, in case mods want to insert modifiers before our base ones
]]
local function CopyTable(t1)
local newTable = {}; for k, v in pairs(t1) do newTable[k] = v end
return newTable
end
function EID:AddConditional(IDs, funcText, modText, extraTable, insertPoint)
if type(IDs) ~= "table" then IDs = { IDs } end
if modText == "" then modText = nil end
extraTable = extraTable or {}
-- make a shallow copy of the passed-in table
local newTable = {}; for k, v in pairs(extraTable) do newTable[k] = v end
newTable.func = funcText;
newTable.modifierText = modText;
if newTable.noFallback == nil then newTable.noFallback = true end
if extraTable.noFallback == nil then extraTable.noFallback = true end
for _, id in ipairs(IDs) do
if type(id) ~= "string" then id = "5.100." .. id end
EID.DescriptionConditions[id] = EID.DescriptionConditions[id] or {}
local newTable = CopyTable(extraTable)
newTable.func = funcText;
newTable.modifierText = modText;
if newTable.usePedestalName then
newTable.variableText = "{{NameOnly" .. id .. "}}"
end
if insertPoint then
table.insert(EID.DescriptionConditions[id], insertPoint, newTable)
else
@@ -48,13 +57,14 @@ end
-- By default, they'll have a bulletpoint for the item/char, and {1} becomes the item/char's name
-- checkInReminder is for if a synergy is no longer relevant once the item isn't obtainable (e.g. Abyss locusts) (true by default)
function EID:AddItemConditional(IDs, ownedIDs, modText, extraTable, checkInReminder)
if type(ownedIDs) ~= "table" then ownedIDs = { ownedIDs } end
if checkInReminder == nil then checkInReminder = true end
extraTable = extraTable or {}
for _, ownedID in ipairs(ownedIDs) do
EID.collectiblesToCheck[ownedID] = true
local newTable = {}; for k, v in pairs(extraTable) do newTable[k] = v end
local newTable = CopyTable(extraTable)
local tvs = ownedID; if type(ownedID) == "number" then tvs = "5.100." .. ownedID end
if newTable.variableText == nil then newTable.variableText = "{{NameOnly" .. tvs .. "}}" end
@@ -69,14 +79,23 @@ function EID:AddSynergyConditional(IDs, ownedIDs, modText1, modText2, extraTable
EID:AddItemConditional(IDs, ownedIDs, modText1, extraTable1, checkInReminder)
EID:AddItemConditional(ownedIDs, IDs, modText2 or modText1, extraTable2 or extraTable1, checkInReminder)
end
-- For adding a synergy pair where the same item name should be used for the descriptions of both sides of it
-- e.g. Sacrificial Altar synergies are displayed on both the Altar and the familiar, but only the familiar's name matters
function EID:AddOneSidedSynergyConditional(IDs, ownedIDs, modText, extraTable, checkInReminder)
extraTable = extraTable or {}
local newTable = CopyTable(extraTable)
newTable.usePedestalName = true
EID:AddItemConditional(IDs, ownedIDs, modText, newTable, checkInReminder)
EID:AddItemConditional(ownedIDs, IDs, modText, extraTable, checkInReminder)
end
-- For adding a conditional that looks at owning itself; item reminder is of course disabled
-- Holding Diplopia should probably also trigger this type of conditional, so it's included by default
-- Holding Diplopia or Crooked Penny should probably also trigger this type of conditional, so it's included by default
function EID:AddSelfConditional(ownedIDs, modText, extraTable, includeDiplopia)
if type(ownedIDs) ~= "table" then ownedIDs = { ownedIDs } end
if includeDiplopia == nil then includeDiplopia = true end
for _, ownedID in ipairs(ownedIDs) do
if includeDiplopia then EID:AddItemConditional(ownedID, {ownedID, 347}, modText, extraTable, false)
if includeDiplopia then EID:AddItemConditional(ownedID, {ownedID, 347, 485}, modText, extraTable, false)
else EID:AddItemConditional(ownedID, ownedID, modText, extraTable, false) end
end
end
@@ -87,7 +106,7 @@ function EID:AddPlayerConditional(IDs, charIDs, modText, extraTable, includeTain
if includeTainted == nil then includeTainted = true end
extraTable = extraTable or {}
for _, charID in ipairs(charIDs) do
local newTable = {}; for k, v in pairs(extraTable) do newTable[k] = v end
local newTable = CopyTable(extraTable)
if newTable.variableText == nil then newTable.variableText = "{{NameOnlyI" .. charID .. "}}" end
if newTable.bulletpoint == nil then newTable.bulletpoint = "Player" .. charID end
EID:AddConditional(IDs, function() return EID:ConditionalCharCheck(charID, includeTainted) end, modText, newTable)
@@ -102,8 +121,8 @@ function EID:ConditionalItemCheck(itemID, checkInReminder)
if not checkInReminder then return false end
local player = EID.ItemReminderPlayerEntity
if EID:PlayerHasItem(player, itemID) or EID:PlayerVoidedCollectible(player, itemID) then return true end
else
return EID.collectiblesOwned[itemID] or EID.collectiblesAbsorbed[itemID]
elseif EID.collectiblesOwned[itemID] or EID.collectiblesAbsorbed[itemID] then
return true
end
end
@@ -129,18 +148,18 @@ function EID:IsGreedModePlusTarot()
return game:IsGreedMode() and EID:ConditionalItemCheck(451, true)
end
function EID:PlayersHaveRestock()
return EID:PlayersHaveCollectible(376) or EID:IsGreedMode()
end
function EID:IsHardMode()
if game.Difficulty == 1 or game.Difficulty == 3 then
return true
else
return false
end
return game.Difficulty == 1 or game.Difficulty == 3
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
local player = EID:ItemReminderGetAllPlayers()[EID.ItemReminderSelectedPlayer + 1] or EID.player
local player = EID.ItemReminderPlayerEntity
return EID.NoRedHeartsPlayerIDs[player:GetPlayerType()]
else
for i = 0, game:GetNumPlayers() - 1 do
@@ -153,30 +172,65 @@ function EID:CheckForNoRedHealthPlayer()
return false
end
function EID:CheckForCarBattery(descObj)
if EID.CarBatteryNoSynergy[descObj.ObjSubType] then return "No Effect"
else return descObj.ObjSubType end
end
function EID:CheckForBFFS(descObj)
local config = EID.itemConfig:GetCollectible(descObj.ObjSubType)
-- Check for no effect, then the table of synergies (will we end up not doing the defualt "double damage" text?)
if EID.BFFSNoSynergy[descObj.ObjSubType] then return "No Effect" end
if config ~= nil and config.Type == ItemType.ITEM_FAMILIAR then
return descObj.fullItemString
-- Check if we have characters with Schoolbag or a pocket active item
function EID:CheckForMultipleActives(onlyChargeablePockets)
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
else
for i = 0, game:GetNumPlayers() - 1 do
local player = Isaac.GetPlayer(i)
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
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)
end
-- When we have Car Battery, change active pedestal descriptions
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
function EID:CheckActivesForCarBattery(descObj)
if EID.InsideItemReminder then return false end
for k,_ in pairs(EID.CarBatteryNoSynergy) do
if EID:PlayersHaveCollectible(k) then return k end
end
return false
end
-- When we have BFFS/Hive Mind, change familiar pedestal descriptions
function EID:CheckForBFFS(descObj)
if descObj.ObjVariant == 100 and EID.BFFSNoSynergy[descObj.ObjSubType] then return "No Effect" end
return descObj.fullItemString
end
function EID:CheckForHiveMind(descObj)
if EID.HiveMindFamiliars[descObj.ObjSubType] then return EID:CheckForBFFS(descObj) end
return "N/A"
end
function EID:CheckForHiveMind(descObj)
if EID.HiveMindFamiliars[descObj.ObjSubType] then return descObj.fullItemString end
return "N/A"
-- When we're looking at a BFFS pedestal, check our familiars for having no effect (only finds the earliest one, but whatever)
function EID:CheckFamiliarsForBFFS(descObj)
if EID.InsideItemReminder then return false end
for k,_ in pairs(EID.BFFSNoSynergy) do
if EID:PlayersHaveCollectible(k) then return k end
end
return false
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)
function EID:CheckPlayersForActiveChargeType(maxCharge, chargeType, checkPockets)
checkPockets = checkPockets or true
local players = {}
if EID.InsideItemReminder then
players[1] = EID:ItemReminderGetAllPlayers()[EID.ItemReminderSelectedPlayer + 1] or EID.player
@@ -185,22 +239,31 @@ function EID:CheckPlayersForActiveChargeType(maxCharge, chargeType)
table.insert(players, Isaac.GetPlayer(i))
end
end
local maxSlot = EID.isRepentance and 1 or 0
if EID.isRepentance and checkPockets then maxSlot = 3 end
for i = 1, #players do
local player = players[i]
for j = 0, EID.isRepentance and 3 or 0 do
for j = 0, maxSlot do
local activeID = player:GetActiveItem(j)
if EID:CheckActiveChargeType(activeID, maxCharge, chargeType) then return activeID end
end
end
return false
end
function EID:CheckActiveChargeType(itemID, maxCharge, chargeType)
local active = EID.itemConfig:GetCollectible(itemID)
if active then
if active.MaxCharges == maxCharge and active.ChargeType ~= 2 then return true
elseif EID.isRepentance and active.ChargeType == chargeType then return true
elseif not EID.isRepentance and chargeType == 1 and active.MaxCharges >= 30 then return true end
-- Check the given item ID for the given max charge and/or charge type (as well as check if the players have the additional collectible ID provided)
function EID:CheckActiveChargeType(itemID, maxCharge, chargeType, requiredCollectible)
if requiredCollectible == nil or EID:ConditionalItemCheck(requiredCollectible) then
local active = EID.itemConfig:GetCollectible(itemID)
if active and active.Type == ItemType.ITEM_ACTIVE then
local result = true
if maxCharge and active.MaxCharges ~= maxCharge then result = false end
if EID.isRepentance then
if chargeType and active.ChargeType ~= chargeType then result = false end
else
if chargeType == 1 and active.MaxCharges < 30 then result = false end
end
return result
end
end
return false
end
@@ -251,9 +314,10 @@ end
function EID:applyConditionals(descObj)
EID:CheckPlayersCollectibles()
local adjustedSubtype = EID:getAdjustedSubtype(descObj.ObjType, descObj.ObjVariant, descObj.ObjSubType)
local typeVar = descObj.ObjType.."."..descObj.ObjVariant -- for general conditions (Tarot Cloth, Book of Virtues)
local typeVarSub = descObj.fullItemString -- for specific conditions
local typeVarSub = descObj.ObjType.."."..descObj.ObjVariant.."."..adjustedSubtype -- for specific conditions
-- Combine specific+generic conditions into one table (in that order)
local conds = {}
if EID.DescriptionConditions[typeVarSub] then TableConcat(conds, EID.DescriptionConditions[typeVarSub]) end
@@ -279,10 +343,12 @@ function EID:applyConditionals(descObj)
end
-- If we find the localization string for this condition, and it passes the test, modify the description text
local result = cond.func(descObj)
local result = cond.func(EID, descObj)
if text ~= nil and result then
local variableText, bulletpoint
if cond.useResult then
-- If the condition returned a value, use that value
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
else
+18 -6
View File
@@ -709,7 +709,8 @@ EID.InlineColors = {
["ColorBagOverfill"] = KColor(1, 0.5, 0.1, 0.6),
["ColorIsaac"] = KColor(0.89, 0.776, 0.773, 1),
["ColorTaintedIsaac"] = KColor(0.812, 0.612, 0.608, 1),
["ColorCard"] = KColor(0.815, 0.651, 0.494, 1), -- actually taken from Ouija Board, real card brown would be too dark for descriptions
["ColorPill"] = KColor(0.306, 0.651, 0.851, 1),
-- Swag Colors
-- Rainbow color effect
@@ -731,11 +732,19 @@ EID.InlineColors = {
local c = EID.InlineColors
return SwagColors({c["ColorYellow"], c["ColorRed"]})
end,
-- Silver to gray, for Black Feather?
["BlinkGray"] = function(_)
local c = EID.InlineColors
return SwagColors({c["ColorGray"], c["ColorSilver"]})
end,
-- Pink for BFFs <3, the two shades come from Nancy Bombs and Eraser
["BlinkPink"] = function(_)
local c = EID.InlineColors
return SwagColors({KColor(1, 0.698, 0.886, 1), KColor(1, 0.5, 1, 1)})
end,
-- Blue for Hive Mind, the two shades come from Hive Mind
["BlinkBlue"] = function(_)
return SwagColors({KColor(0.341, 0.529, 0.906, 1), KColor(0.592, 0.717, 0.937, 1)})
end,
-- Shiny purple color effect
["ColorShinyPurple"] = function(_)
return SwagColors({KColor(0.812, 0.627, 1, 1), KColor(0.62, 0.251, 1, 1)}, 40)
@@ -933,7 +942,7 @@ if EID.isRepentance then
EID.CarBatteryNoSynergy[323] = false -- Isaac's Tears
EID.CarBatteryNoSynergy[386] = false -- D12
EID.CarBatteryNoSynergy[421] = true -- Kidney Bean
EID.CarBatteryNoSynergy[522] = false -- Telekinesis TODO: REPENTANCE DIFFERENCES IN MAIN DESC TOO
EID.CarBatteryNoSynergy[522] = false -- Telekinesis
EID.CarBatteryNoSynergy[523] = true -- Moving Box
-- Repentance actives
EID.CarBatteryNoSynergy[555] = true; EID.CarBatteryNoSynergy[577] = true; EID.CarBatteryNoSynergy[578] = true; EID.CarBatteryNoSynergy[580] = true;
@@ -949,6 +958,7 @@ EID.BFFSNoSynergy = { [10] = true, [11] = true, [81] = true, [178] = true, [238]
if EID.isRepentance then
EID.BFFSNoSynergy[178] = false -- Holy Water
EID.BFFSNoSynergy[276] = false -- Isaac's Heart
EID.BFFSNoSynergy[325] = true -- Scissors
EID.BFFSNoSynergy[405] = true -- GB Bug
EID.BFFSNoSynergy[467] = false -- Finger!
EID.BFFSNoSynergy[504] = false -- Brown Nugget
@@ -959,12 +969,14 @@ if EID.isRepentance then
end
-- Familiars that count for Hive Mind in Repentance (although it could give them No Effect if it just increases size)
EID.HiveMindFamiliars = { [10] = true, [57] = true, [128] = true, [170] = true, [264] = true, [272] = true, [274] = true, [279] = true, [320] = true, [364] = true, [365] = true, [403] = true, [426] = true, [430] = true, [504] = true, [511] = true, [575] = true, [581] = true, [629] = true, }
EID.HiveMindFamiliars = { [10] = true, [57] = true, [128] = true, [170] = true, [264] = true, [272] = true, [274] = true, [279] = true, [320] = true, [364] = true, [365] = true, [403] = true, [426] = true, [430] = true, [504] = true, [511] = true, [575] = true, [581] = true, [629] = true, [649] = true, [650] = true, [706] = true, }
-- Tainted character's respective normal version ID, for conditionals that apply to both versions of the character
-- To help with other character pairs, Esau = Jacob, Dead Tainted Lazarus = Tainted Lazarus, Tainted Soul = Tainted Forgotten
EID.TaintedToRegularID = { [20] = 19, [21] = 0, [22] = 1, [23] = 2, [24] = 3, [25] = 4, [26] = 5, [27] = 6, [28] = 7, [29] = 8, [30] = 9, [31] = 10, [32] = 13,
[33] = 14, [34] = 15, [35] = 16, [36] = 18, [37] = 19, [38] = 29, [39] = 37, [40] = 35 }
-- Player IDs of Tainted characters, might be useful for something
EID.TaintedIDs = {}; for i = 21, 40 do EID.TaintedIDs[i] = true end
-- Character IDs that are Soul/Black Hearts only: ???, The Lost, The Soul
EID.NoRedHeartsPlayerIDs = { [4] = true, [10] = true, [17] = true }
@@ -972,8 +984,8 @@ if EID.isRepentance then
-- ???, The Lost, Black Judas, The Soul, Tainted Judas, Tainted ???, Tainted Lost, Tainted Forgotten, Tainted Bethany, Tainted Soul
EID.NoRedHeartsPlayerIDs = { [4] = true, [10] = true, [12] = true, [17] = true, [24] = true, [25] = true, [31] = true, [35] = true, [36] = true, [40] = true }
end
-- Character IDs that have a pocket active
EID.PocketActivePlayerIDs = { [22] = true, [23] = true, [24] = true, [25] = true, [26] = true, [29] = true, [34] = true, [36] = true, [37] = true, [38] = true, [39] = true }
-- Character IDs that have a pocket active (0 = normal, 1 = timed, 2 = special)
EID.PocketActivePlayerIDs = { [22] = 0, [23] = 2, [24] = 1, [25] = 2, [26] = 1, [29] = 0, [34] = 0, [36] = 0, [37] = 1, [38] = 0, [39] = 1 }
-- Cards that don't work with Blank Card in Repentance (Note: ? Card is blacklisted here, don't use this for determining what is a card)
EID.blankCardHidden = {[32]=true,[33]=true,[34]=true,[35]=true,[36]=true,[37]=true,[38]=true,[39]=true,[40]=true,[41]=true,[48]=true,[49]=true,[50]=true,[55]=true,[78]=true,[81]=true,[82]=true,[83]=true,[84]=true,[85]=true,[86]=true,[87]=true,[88]=true,[89]=true,[90]=true,[91]=true,[92]=true,[93]=true,[94]=true,[95]=true,[96]=true,[97]=true,}
+2 -1
View File
@@ -246,7 +246,8 @@ function EID:VoidRoomCheck()
(not EID.isRepentance or pickup.OptionsPickupIndex == 0 or EID.VoidOptionIndexes[pickup.OptionsPickupIndex] == nil) then
numRunable = numRunable + 1
if EID.isRepentance then EID.VoidOptionIndexes[pickup.OptionsPickupIndex] = entity.SubType end
if (EID.itemConfig:GetCollectible(entity.SubType).Type ~= ItemType.ITEM_ACTIVE) then
-- Moving Box (523) is counted as a passive item
if (EID.itemConfig:GetCollectible(entity.SubType).Type ~= ItemType.ITEM_ACTIVE or entity.SubType == 523) then
numVoidable = numVoidable + 1
else
table.insert(activesAbsorbed, entity.SubType)
+1 -1
View File
@@ -232,7 +232,7 @@ local function BlackFeatherCallback(descObj)
local isGolden = EID.isRepentance and ((descObj.ObjSubType & TrinketType.TRINKET_GOLDEN_FLAG) == TrinketType.TRINKET_GOLDEN_FLAG)
local base = EID.isRepentance and 0.5 or 0.2
local damageMultiplied = base * itemCounter * (hasBox and 2 or 1) * (isGolden and 2 or 1)
local dmgColor = (hasBox or isGolden) and "ColorGold" or "ColorLime"
local dmgColor = itemCounter == 0 and "CR" or (hasBox or isGolden) and "ColorGold" or "BlinkGray"
local description = EID:getDescriptionEntry("BlackFeatherInformation")
description, _ = EID:ReplaceVariableStr(description, 1, tostring(itemCounter))