From c0e7ae26421e8ecb82ada5a963d9682624d3967c Mon Sep 17 00:00:00 2001 From: Buurazu Date: Mon, 27 Jun 2022 09:32:05 -0400 Subject: [PATCH 1/6] D1 rep start --- eid_itemprediction.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/eid_itemprediction.lua b/eid_itemprediction.lua index f409bdb6..1fa6f280 100644 --- a/eid_itemprediction.lua +++ b/eid_itemprediction.lua @@ -268,3 +268,24 @@ function EID:VoidRNGCheck(player, isRune) -- if there were no absorbable pedestals, the "single increase" stats are the same as the "one extra" stats if count == 0 then eidTable[3] = {table.unpack(increases)} end end + +-- Afterbirth blacklist includes things like Rune of Jera? Mimic Chest? +local D1blacklist = { [41] = true, [100] = true, [150] = true, [340] = true, [370] = true, [380] = true, [390] = true } +local D1chests = { [50] = true, [51] = true, [52] = true, [53] = true, [54] = true, [55] = true, [56] = true, [57] = true, [58] = true, [60] = true, [360] = true } +function EID:D1Prediction(rng) + local poss = {} + for i,v in ipairs(Isaac.FindByType(5)) do + if not D1blacklist[v.Variant] then + table.insert(poss, v) + end + end + if #poss == 0 then return end + rng = EID:RNGNext(rng) + local sel = (rng % #poss) + 1 + local fullID = "5." .. poss[sel].Variant .. "." .. poss[sel].SubType + -- in rep, we don't care about subtype... + fullID = "5." .. poss[sel].Variant + if D1chests[poss[sel].Variant] then fullID = "5.50" end + local pickupNames = EID:getDescriptionEntry("GlitchedItemText") + print(pickupNames[fullID] or EID.XMLEntityNames[fullID]) +end From 2f7a2cdd4702149925f16cab3f181e97101fa93e Mon Sep 17 00:00:00 2001 From: Buurazu Date: Wed, 29 Jun 2022 21:48:50 -0400 Subject: [PATCH 2/6] PickupNames --- descriptions/ab+/en_us.lua | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/descriptions/ab+/en_us.lua b/descriptions/ab+/en_us.lua index 680414b0..f685401b 100644 --- a/descriptions/ab+/en_us.lua +++ b/descriptions/ab+/en_us.lua @@ -893,3 +893,34 @@ EID.descriptions[languageCode].HoldMapHeader = " Result" EID.descriptions[languageCode].RoomTypeNames = { "Normal Room", "Shop", "I AM ERROR Room", "Treasure Room", "Boss Room", "Miniboss Room", "Secret Room", "Super Secret Room", "Arcade Room", "Curse Room", "Challenge Room", "Library", "Sacrifice Room", "Devil Room", "Angel Room", "Crawlspace Room", "Boss Rush Room", "Isaac's Room", "Barren Room", "Chest Room", "Dice Room", "Black Market", "Exit Room", "Planetarium", "Teleporter Entrance", "Teleporter Exit", "Alt Path Trapdoor", "Blue Key Room", "Ultra Secret Room", -- Not technically room types but still potentially useful to have localized [666] = "Angel/Devil Room", [1024] = "Red Room", [1025] = "Special Red Room" } + +-- currently used for D1 +EID.descriptions[languageCode].PickupNames = { + ["5.0"] = "None", + + ["5.10"] = "{{Heart}} Heart", + ["5.10.1"] = "{{Heart}} Heart", ["5.10.2"] = "{{HalfHeart}} Half Heart", ["5.10.3"] = "{{SoulHeart}} Soul Heart", ["5.10.4"] = "{{EternalHeart}} Eternal Heart", ["5.10.5"] = "{{Heart}} Double Heart", ["5.10.6"] = "{{BlackHeart}} Black Heart", ["5.10.7"] = "{{GoldHeart}} Gold Heart", ["5.10.8"] = "{{HalfSoulHeart}} Half Soul Heart", ["5.10.9"] = "{{Heart}} Scared Heart", ["5.10.10"] = "{{BlendedHeart}} Blended Heart", ["5.10.11"] = "{{EmptyBoneHeart}} Bone Heart", ["5.10.12"] = "{{RottenHeart}} Rotten Heart", + + ["5.20"] = "{{Coin}} Coin", + ["5.20.1"] = "{{Crafting8}} Penny", ["5.20.2"] = "{{Crafting9}} Nickel", ["5.20.3"] = "{{Crafting10}} Dime", ["5.20.4"] = "{{Crafting8}} Double Penny", ["5.20.5"] = "{{Crafting11}} Lucky Penny", ["5.20.6"] = "{{Crafting9}} Sticky Nickel", ["5.20.7"] = "{{Crafting26}} Golden Penny", + + ["5.30"] = "{{Key}} Key", + ["5.30.1"] = "{{Crafting12}} Key", ["5.30.2"] = "{{Crafting13}} Golden Key", ["5.30.3"] = "{{Crafting12}} Key Ring", ["5.30.4"] = "{{Crafting14}} Charged Key", + + ["5.40"] = "{{Bomb}} Bomb", + ["5.40.1"] = "{{Crafting15}} Bomb", ["5.40.2"] = "{{Crafting15}} Double Bomb", ["5.40.3"] = "{{Crafting15}} Troll Bomb", ["5.40.4"] = "{{Crafting16}} Golden Bomb", ["5.40.5"] = "{{Crafting15}} Megatroll Bomb", ["5.40.7"] = "{{Crafting17}} Giga Bomb", + + ["5.90"] = "{{Battery}} Battery", + ["5.90.0"] = "{{Crafting19}} Lil' Battery", --AB+ didn't have subtypes for batteries + ["5.90.1"] = "{{Crafting19}} Lil' Battery", ["5.90.2"] = "{{Crafting18}} Micro Battery", ["5.90.3"] = "{{Crafting20}} Mega Battery", ["5.90.4"] = "{{Crafting28}} Golden Battery", + + ["5.50"] = "{{Chest}} Chest", ["5.51"] = "{{BombChest}} Bomb Chest", ["5.52"] = "{{SpikedChest}} Spiked Chest", ["5.53"] = "{{EternalChest}} Eternal Chest", ["5.54"] = "{{MimicChest}} Mimic Chest", ["5.55"] = "{{OldChest}} Old Chest", ["5.56"] = "{{WoodenChest}} Wooden Chest", ["5.57"] = "{{MegaChest}} Mega Chest", ["5.58"] = "{{HauntedChest}} Haunted Chest", ["5.60"] = "{{GoldenChest}} Golden Chest", ["5.360"] = "{{RedChest}} Red Chest", + + ["5.69"] = "{{GrabBag}} Grab Bag", ["5.69.1"] = "{{GrabBag}} Grab Bag", ["5.69.2"] = "{{BlackSack}} Black Sack", + + ["5.70"] = "{{Pill}} Pill", + ["5.300"] = "{{Card}} Card", + ["5.301"] = "{{Rune}} Rune", -- not a real id + ["5.350"] = "{{Trinket}} Trinket", + +} From 6b1cf847f075632959386b6f28b46eef8b24b67d Mon Sep 17 00:00:00 2001 From: Buurazu Date: Wed, 29 Jun 2022 21:49:29 -0400 Subject: [PATCH 3/6] fix puberty tracking in AB+ --- main.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/main.lua b/main.lua index ffff617a..44f0a364 100644 --- a/main.lua +++ b/main.lua @@ -1614,6 +1614,7 @@ if REPENTANCE then end function EID:OnUsePill(pillEffectID, player) + player = player or EID.player --AB+ doesn't receive player in callback arguments! local playerID = EID:getPlayerID(player) -- Dead Tainted Lazarus exceptions local pillsTable = EID.PlayerItemInteractions[playerID].pills From 421a3d142e56b1c8f43784faa42ecd5cad32f361 Mon Sep 17 00:00:00 2001 From: Buurazu Date: Wed, 29 Jun 2022 21:49:55 -0400 Subject: [PATCH 4/6] add more spelling/word aliases --- eid_data.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/eid_data.lua b/eid_data.lua index 12047e13..7f16d4ef 100644 --- a/eid_data.lua +++ b/eid_data.lua @@ -118,7 +118,13 @@ EID.TextReplacementPairs = { {"{{Hashtag}}", "ǂ"}, -- Hashtag {"{{CR}}", "{{ColorReset}}"}, -- Shortcut for Color Resetting {"{{EthernalHeart}}", "{{EternalHeart}}"}, -- fix spelling error - {"{{CONFIG_BoC_Toggle}}", function(_) return EID.ButtonToIconMap[EID.Config["BagOfCraftingToggleKey"]] or "{{ButtonSelect}}" end}, -- fix spelling error + {"{{CONFIG_BoC_Toggle}}", function(_) return EID.ButtonToIconMap[EID.Config["BagOfCraftingToggleKey"]] or "{{ButtonSelect}}" end}, + -- more common/official names + {"{{MimicChest}}", "{{TrapChest}}"}, {"{{EternalChest}}", "{{HolyChest}}"}, {"{{BombChest}}", "{{StoneChest}}"}, + {"{{OldChest}}", "{{DirtyChest}}"}, {"{{CurseRoom}}", "{{CursedRoom}}"}, {"{{Crawlspace}}", "{{LadderRoom}}"}, + {"{{GoldHeart}}", "{{GoldenHeart}}"}, + + } local controllerSprites = Sprite() controllerSprites:Load("gfx/ui/buttons.anm2", true) From 87d46a9c2913009f98861c66cb68aa483c3f6ed6 Mon Sep 17 00:00:00 2001 From: Buurazu Date: Wed, 29 Jun 2022 21:51:12 -0400 Subject: [PATCH 5/6] add D1 --- eid_holdmapdesc.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eid_holdmapdesc.lua b/eid_holdmapdesc.lua index e14017b8..39e34ef0 100644 --- a/eid_holdmapdesc.lua +++ b/eid_holdmapdesc.lua @@ -104,6 +104,9 @@ function EID:getHoldMapDescription(player, checkingTwin) elseif heldActive == 489 then blacklist["5.100.489"] = true addObjectDesc(5, 100, EID:CurrentDInfinity(getSeed(489), currentPlayer), "{{Collectible489}}") + elseif heldActive == 476 and EID.Config["ItemReminderShowRNGCheats"] then + blacklist["5.100.476"] = true + append("{{Collectible476}}", EID:getObjectName(5,100,476) .. EID:getDescriptionEntry("HoldMapHeader"), EID:D1Prediction(getSeed(476))) else addObjectDesc(5, 100, heldActive) end From 0b81c743da78512ccfac24047b53f184a97086ee Mon Sep 17 00:00:00 2001 From: Buurazu Date: Wed, 29 Jun 2022 21:53:51 -0400 Subject: [PATCH 6/6] finish D1 --- eid_itemprediction.lua | 52 ++++++++++++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 10 deletions(-) diff --git a/eid_itemprediction.lua b/eid_itemprediction.lua index 1fa6f280..898f79c4 100644 --- a/eid_itemprediction.lua +++ b/eid_itemprediction.lua @@ -1,6 +1,7 @@ -- This file is for various functions that are able to calculate the result effect that an item will have local game = Game() +local variantToName = { [70] = "Pill", [100] = "Collectible", [300] = "Card", [350] = "Trinket" } -- reimplementation of RNG:Next() -- Default RNG shift values for many things are 5, 9, 7 function EID:RNGNext(rngNum, shift1, shift2, shift3) @@ -269,23 +270,54 @@ function EID:VoidRNGCheck(player, isRune) if count == 0 then eidTable[3] = {table.unpack(increases)} end end --- Afterbirth blacklist includes things like Rune of Jera? Mimic Chest? -local D1blacklist = { [41] = true, [100] = true, [150] = true, [340] = true, [370] = true, [380] = true, [390] = true } +-- D1 -- + +local D1blacklist = { [41] = true, [100] = true, [110] = true, [150] = true, [340] = true, [370] = true, [380] = true, [390] = true } +if not REPENTANCE then D1blacklist[54] = true end -- Mimic Chest blacklist in AB+ +-- These Variants all duplicate into a Chest in Repentance (and should have their SubType ignored in AB+) local D1chests = { [50] = true, [51] = true, [52] = true, [53] = true, [54] = true, [55] = true, [56] = true, [57] = true, [58] = true, [60] = true, [360] = true } + +-- These Card variants duplicate as themselves in Repentance +local specialCards = {[49] = true, [50] = true, [78] = true} + function EID:D1Prediction(rng) local poss = {} - for i,v in ipairs(Isaac.FindByType(5)) do - if not D1blacklist[v.Variant] then + for i,v in ipairs(Isaac.FindByType(5,-1,-1)) do + -- Check the blacklist, as well as Rune of Jera in AB+, and empty chests in Rep + if not D1blacklist[v.Variant] and (REPENTANCE or v.Variant ~= 300 or v.SubType ~= 33) and (not REPENTANCE or v:ToPickup():CanReroll()) then table.insert(poss, v) end end - if #poss == 0 then return end + if #poss == 0 then return EID:getDescriptionEntry("PickupNames")["5.0"] end rng = EID:RNGNext(rng) local sel = (rng % #poss) + 1 local fullID = "5." .. poss[sel].Variant .. "." .. poss[sel].SubType - -- in rep, we don't care about subtype... - fullID = "5." .. poss[sel].Variant - if D1chests[poss[sel].Variant] then fullID = "5.50" end - local pickupNames = EID:getDescriptionEntry("GlitchedItemText") - print(pickupNames[fullID] or EID.XMLEntityNames[fullID]) + if REPENTANCE then + -- in rep, we don't care about subtype... + fullID = "5." .. poss[sel].Variant + if poss[sel].Variant == 300 then + if specialCards[poss[sel].SubType] then + local objName = EID:getObjectName(5, poss[sel].Variant, poss[sel].SubType, poss[sel]) + return "{{" .. variantToName[poss[sel].Variant] .. poss[sel].SubType .. "}} " .. objName + elseif EID.runeIDs[poss[sel].SubType] then + fullID = "5.301" + end + end + -- all Chest variants turn into a random Chest + if D1chests[poss[sel].Variant] then fullID = "5.50" end + else + if D1chests[poss[sel].Variant] then fullID = "5." .. poss[sel].Variant + -- display the item name for pills, cards, and trinkets in AB+ + elseif poss[sel].Variant == 70 or poss[sel].Variant == 300 or poss[sel].Variant == 350 then + local objName = EID:getObjectName(5, poss[sel].Variant, poss[sel].SubType, poss[sel]) + -- don't display the name of unidentified pills! + if poss[sel].Variant == 70 and not EID.Config["ShowUnidentifiedPillDescriptions"] and not game:GetItemPool():IsPillIdentified(poss[sel].SubType) then + objName = EID:getDescriptionEntry("unidentifiedPill") + end + return "{{" .. variantToName[poss[sel].Variant] .. poss[sel].SubType .. "}} " .. objName + end + end + + local pickupNames = EID:getDescriptionEntry("PickupNames") or {} + return pickupNames[fullID] or EID.XMLEntityNames[fullID] or fullID end