From 81ac1005d83653a4c4b87356cb5eb8c6f92b472b Mon Sep 17 00:00:00 2001 From: Wofsauge Date: Sat, 11 Dec 2021 03:13:05 +0100 Subject: [PATCH] Added synergy informations for Blank Card, Clear Rune and Placebo --- descriptions/rep/en_us.lua | 5 +++ eid_modifiers.lua | 90 ++++++++++++++++++++++++++++++++++++++ main.lua | 2 +- 3 files changed, 96 insertions(+), 1 deletion(-) diff --git a/descriptions/rep/en_us.lua b/descriptions/rep/en_us.lua index e5e5ea5b..93ea9509 100644 --- a/descriptions/rep/en_us.lua +++ b/descriptions/rep/en_us.lua @@ -925,6 +925,11 @@ EID.descriptions["en_us"].CraftingPreviewBackup = "!!! If this item's locked, it EID.descriptions["en_us"].CraftingResults = "(Scroll: hold {{CONFIG_BoC_Toggle}} + {{ButtonY}} {{ButtonA}},#Lock: {{ButtonX}}, Refresh: {{ButtonB}})" +EID.descriptions["en_us"].BlankCardCharge = "Blank Card charge:" +EID.descriptions["en_us"].BlankCardQCard = "Teleport to I Am Error Room#Blank Card and ?-Card will be destroyed" +EID.descriptions["en_us"].ClearRuneCharge = "Clear Rune charge:" +EID.descriptions["en_us"].PlaceboCharge = "Placebo charge:" + EID.descriptions["en_us"].AchievementWarningTitle = "{{ColorYellow}}!!! WARNING !!!" EID.descriptions["en_us"].AchievementWarningText = "Achievements are disabled!#In order to enable progression and achievements, you first need to kill Mom (Depths II) without any mods enabled.#(If you've defeated Mom, this message is a bug and can be ignored)#(This warning can be disabled in the config)" diff --git a/eid_modifiers.lua b/eid_modifiers.lua index 7ed68541..b7c3c0ad 100644 --- a/eid_modifiers.lua +++ b/eid_modifiers.lua @@ -202,4 +202,94 @@ local game = Game() return descObj end EID:addDescriptionModifier("ItemID", ItemIDCondition, ItemIDCallback) + + + + -- Handle Blank Card description addition + local blankCardHidden = {[32]=true,[33]=true,[34]=true,[35]=true,[36]=true,[37]=true,[38]=true,[39]=true,[40]=true,[41]=true,[49]=true,[50]=true,[55]=true,[78]=true} + local function BlankCardCondition(descObj) + if not REPENTANCE or descObj.ObjType ~= 5 or descObj.ObjVariant ~= PickupVariant.PICKUP_TAROTCARD or blankCardHidden[descObj.ObjSubType] or descObj.ObjSubType > 80 then + return false + end + for i = 0, game:GetNumPlayers() - 1 do + local player = Isaac.GetPlayer(i) + if player:HasCollectible(CollectibleType.COLLECTIBLE_BLANK_CARD) then + return true + end + end + return false + end + + local function BlankCardCallback(descObj) + local text = EID:getDescriptionEntry("BlankCardCharge") + local charge = EID.cardMetadata[descObj.ObjSubType] + if text ~= nil and charge ~= nil then + local iconStr = "#{{Collectible286}} {{ColorSilver}}" + if descObj.ObjSubType == 48 then -- ? card + text = EID:getDescriptionEntry("BlankCardQCard") + EID:appendToDescription(descObj, iconStr..text:gsub("#",iconStr)) + else + EID:appendToDescription(descObj, iconStr..text.." {{"..charge.mimiccharge.."}}{{Battery}}") + end + end + return descObj + end + EID:addDescriptionModifier("Blank Card", BlankCardCondition, BlankCardCallback) + + + + -- Handle Clear Rune description addition + local runeIDs = {[32]=true,[33]=true,[34]=true,[35]=true,[36]=true,[37]=true,[38]=true,[39]=true,[40]=true,[41]=true,[55]=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,} + local function ClearRuneCondition(descObj) + if not REPENTANCE or descObj.ObjType ~= 5 or descObj.ObjVariant ~= PickupVariant.PICKUP_TAROTCARD or not runeIDs[descObj.ObjSubType] then + return false + end + for i = 0, game:GetNumPlayers() - 1 do + local player = Isaac.GetPlayer(i) + if player:HasCollectible(CollectibleType.COLLECTIBLE_CLEAR_RUNE) then + return true + end + end + return false + end + + local function ClearRuneCallback(descObj) + local text = EID:getDescriptionEntry("ClearRuneCharge") + local charge = EID.cardMetadata[descObj.ObjSubType] + if text ~= nil and charge ~= nil then + local iconStr = "#{{Collectible263}} {{ColorSilver}}" + EID:appendToDescription(descObj, iconStr..text.." {{"..charge.mimiccharge.."}}{{Battery}}") + end + return descObj + end + EID:addDescriptionModifier("Clear Rune", ClearRuneCondition, ClearRuneCallback) + + + + -- Handle Placebo description addition + local function PlaceboCondition(descObj) + if not REPENTANCE or descObj.ObjType ~= 5 or descObj.ObjVariant ~= PickupVariant.PICKUP_PILL then + return false + end + for i = 0, game:GetNumPlayers() - 1 do + local player = Isaac.GetPlayer(i) + if player:HasCollectible(CollectibleType.COLLECTIBLE_PLACEBO) then + return true + end + end + return false + end + + local function PlaceboCallback(descObj) + local text = EID:getDescriptionEntry("PlaceboCharge") + local adjustedID = EID:getAdjustedSubtype(descObj.ObjType, descObj.ObjVariant, descObj.ObjSubType) + local charge = EID.pillMetadata[adjustedID-1] + if text ~= nil and charge ~= nil then + local iconStr = "#{{Collectible348}} {{ColorSilver}}" + EID:appendToDescription(descObj, iconStr..text.." {{"..charge.mimiccharge.."}}{{Battery}}") + end + return descObj + end + EID:addDescriptionModifier("Placebo", PlaceboCondition, PlaceboCallback) + end diff --git a/main.lua b/main.lua index 66c53e9a..0d214f28 100644 --- a/main.lua +++ b/main.lua @@ -8,7 +8,7 @@ local game = Game() require("eid_config") EID.Config = EID.UserConfig -EID.Config.Version = "3.2" -- note: changing this will reset everyone's settings to default! +EID.Config.Version = "3.2" EID.ModVersion = "4.3" EID.DefaultConfig.Version = EID.Config.Version EID.isHidden = false