Make examine inventory controlled by item, perhaps still buggy

This commit is contained in:
2025-01-01 21:14:38 +00:00
parent 86aba6d115
commit 5b978d9f1c
25 changed files with 523 additions and 502 deletions
+11
View File
@@ -3,6 +3,8 @@ module Dodge.ItEffect (
doInvEffect,
) where
import Dodge.BlBl
import Dodge.Item.Location
import Control.Lens
import Dodge.Data.World
import Dodge.Euse
@@ -15,6 +17,15 @@ doInvEffect = \case
RemoveShieldWall -> removeShieldWall
EffectWhileRoot f -> rootNotrootEff f NoInvEffect
EffectWhileAttached f -> effectWhileAttached f
ItemUseToggle f -> \itm _
-> pointerToItemID (itm ^. itID) . itUse . useToggle %~ doBlBl f
ItemCancelExamineInventory -> \_ _ -> cancelExamineInventory
cancelExamineInventory :: World -> World
cancelExamineInventory = hud . hudElement . subInventory %~ f
where
f ExamineInventory = NoSubInventory
f x = x
rootNotrootEff :: ItInvEffect -> ItInvEffect -> Item -> Creature -> World -> World
rootNotrootEff f g it