Fix bugs in item locations

This commit is contained in:
2024-09-23 13:12:09 +01:00
parent 4f6431968c
commit 5262355368
10 changed files with 133 additions and 175 deletions
+7 -8
View File
@@ -21,7 +21,7 @@ import Dodge.EnergyBall
import Dodge.Euse
import Dodge.Hammer
import Dodge.ItEffect
import Dodge.LightSource.Torch
--import Dodge.LightSource.Torch
import Dodge.Prop.Gib
import Dodge.SoundLogic
import Dodge.Targeting
@@ -247,24 +247,23 @@ invSideEff cr w =
w' & maybe id (\g -> doInvEffect g it cr) (it ^? itEffect . ieInv)
itemInvSideEffect :: Creature -> Item -> World -> World
itemInvSideEffect cr it
itemInvSideEffect _ _
--itemInvSideEffect cr it
-- | hastorchattach = createAttachLight cr it
| otherwise = id
where
-- hastorchattach = it ^? itType . iyModules . ix ModHeldAttach == Just ATTACHTORCH && _itIsRoot it
createAttachLight :: Creature -> Item -> World -> World
createAttachLight cr it = createTorchLightOffset cr it attachoff
where
attachoff = it ^?! itDimension . dimAttachPos
--createAttachLight :: Creature -> Item -> World -> World
--createAttachLight cr it = createTorchLightOffset cr it attachoff
-- where
-- attachoff = it ^?! itDimension . dimAttachPos
itemUpdate :: Creature -> Int -> Item -> Item
itemUpdate cr i =
updateAutoRecharge
. (itUse %~ useUpdate)
. (itLocation .~ InInv (_crID cr) i itmisselected itmisroot)
-- . (itIsRoot .~ itmisroot)
-- . (itIsSelected .~ itmisselected)
where
itmisroot = Just i == (cr ^? crManipulation . manObject . inInventory . imRootItem)
itmisselected = Just i == (cr ^? crManipulation . manObject . inInventory . imSelectedItem)