Remove ComposedItem, to be replaced with PartiallyComposedItem

This commit is contained in:
2024-11-29 10:39:39 +00:00
parent a9edab0e31
commit 7148051b31
12 changed files with 80 additions and 70 deletions
+5 -3
View File
@@ -27,17 +27,19 @@ useRootItem crid w = (worldEventFlags . at InventoryChange ?~ ()) . fromMaybe w
cr <- w ^? cWorld . lWorld . creatures . ix crid
itRef <- cr ^? crManipulation . manObject . imRootSelectedItem
itmtree <- invRootTrees (_crInv cr) ^? ix itRef
let itm = itmtree ^. ldtValue . cItem
case itmtree ^. ldtValue . cItemFunction of
let itm = itmtree ^. ldtValue . _1
case itmtree ^. ldtValue . _2 of
WeaponPlatformSF ->
return $
heldEffect (bimap _iatType _cItem itmtree) cr w
heldEffect (bimap _iatType fst3 itmtree) cr w
& pointerToItem itm . itUse . heldHammer .~ HammerDown
EquipmentPlatformSF -> do
guard (_crHammerPosition cr == HammerUp)
invid <- itm ^? itLocation . ilInvID
return $ toggleEquipmentAt invid cr w
_ -> Nothing
where
fst3 (x,_,_) = x
-- where
-- UseHotkey{} -> doequipmentchange