From 9d8267504860cf1ac17e385eef015b895c053a76 Mon Sep 17 00:00:00 2001 From: Buurazu Date: Sat, 13 Nov 2021 00:52:38 -0500 Subject: [PATCH] Book of Virtues descriptions --- eid_modifiers.lua | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/eid_modifiers.lua b/eid_modifiers.lua index 3d5ade7a..c167c6bd 100644 --- a/eid_modifiers.lua +++ b/eid_modifiers.lua @@ -53,6 +53,32 @@ local game = Game() + -- Handle Book of Virtues description addition + local function BookOfVirtuesCondition(descObj) + if descObj.ObjType ~= 5 or descObj.ObjVariant ~= PickupVariant.PICKUP_COLLECTIBLE then + return false + end + for i = 0,game:GetNumPlayers() - 1 do + local player = Isaac.GetPlayer(i) + if player:HasCollectible(CollectibleType.COLLECTIBLE_BOOK_OF_VIRTUES) then + return true + end + end + return false + end + + local function BookOfVirtuesCallback(descObj) + local wispType = EID:getDescriptionEntry("bookOfVirtuesWisps", descObj.ObjSubType) + if wispType ~= nil then + local iconStr = "#{{Collectible584}} " + EID:appendToDescription(descObj, iconStr..wispType[1]:gsub("#",iconStr)) + end + return descObj + end + EID:addDescriptionModifier("Book of Virtues", BookOfVirtuesCondition, BookOfVirtuesCallback) + + + -- Handle Spindown Dice description addition local function SpindownDiceCondition(descObj) if descObj.ObjType ~= 5 or descObj.ObjVariant ~= PickupVariant.PICKUP_COLLECTIBLE then @@ -124,7 +150,6 @@ local game = Game() EID:addDescriptionModifier("Tarot Cloth", TarotClothCondition, TarotClothCallback) - -- Handle Golden Trinket description addition local function GoldenTrinketCondition(descObj) return descObj.ObjType == 5 and descObj.ObjVariant == PickupVariant.PICKUP_TRINKET and descObj.ObjSubType > TrinketType.TRINKET_GOLDEN_FLAG @@ -149,4 +174,4 @@ local game = Game() return descObj end EID:addDescriptionModifier("ItemID", ItemIDCondition, ItemIDCallback) -end \ No newline at end of file +end