Cleanup constructors FooUse -> UseFoo

This commit is contained in:
2024-10-03 20:39:41 +01:00
parent 6b4cf596b1
commit 127d85e7ce
10 changed files with 49 additions and 92 deletions
+8 -16
View File
@@ -229,14 +229,10 @@ itemInvSideEffect cr itm = case _itType itm of
-- this probably needs to be set to null when dropped as well?
updateItemTargeting :: TargetingType -> Creature -> Item -> World -> World
updateItemTargeting tt cr itm w = case tt of
_
| not isattached ->
w
& pointItUse . tgPos .~ Nothing
& pointItUse . tgActive .~ False
TARGETLASER
| crIsAiming cr ->
w
_ | not isattached -> w
& pointItUse . tgPos .~ Nothing
& pointItUse . tgActive .~ False
TARGETLASER | crIsAiming cr -> w
& cWorld . lWorld . lasers
.:~ LaserStart
{ _lpPhaseV = 1
@@ -246,19 +242,15 @@ updateItemTargeting tt cr itm w = case tt of
, _lpType = TargetingLaser (_itID itm)
}
TARGETLASER -> w & pointItUse . tgPos .~ Nothing
TargetRBPress
| rbpressed ->
w
TargetRBPress | rbpressed -> w
& pointItUse . tgPos %~ maybe (Just $ mouseWorldPos (w ^. input) (w ^. wCam)) Just
& pointItUse . tgActive .~ True
TargetRBPress ->
w
TargetRBPress -> w
& pointItUse . tgPos .~ Nothing
& pointItUse . tgActive .~ False
TargetRBCreature -> w & pointItUse %~ setRBCreatureTargeting cr w
TargetCursor ->
w & pointItUse
.~ TargetingUse
TargetCursor -> w
& pointItUse .~ UseTargeting
(Just (mouseWorldPos (w ^. input) (w ^. wCam)))
Nothing
True