Add attached/aiming checks on item usage

This commit is contained in:
2025-01-01 11:36:33 +00:00
parent 99114c7351
commit 91111fc89c
10 changed files with 393 additions and 423 deletions
+3 -2
View File
@@ -58,7 +58,7 @@ translateFloatingCamera theinput cam = fromMaybe cam $ do
cam & camCenter +~ thetran
& camViewFrom +~ thetran
else do
a <- (theinput ^. heldPos . at SDL.ButtonRight)
a <- theinput ^. heldPos . at SDL.ButtonRight
return $ cam & camRot -~ angleBetween (theinput ^. mousePos) a
translateFloatingCameraKeys :: Input -> Camera -> Camera
@@ -93,7 +93,8 @@ moveZoomCamera cfig theinput cr w campos =
where
mremotepos = do
i <- cr ^? crManipulation . manObject . imSelectedItem
j <- cr ^? crInv . ix i . itUse . uaParams . apLinkedProjectile . _Just
j <- cr ^? crInv . ix i . itUse . uaParams . apProjectiles . ix 0
guard $ Just REMOTESCREEN == cr ^? crInv . ix i . itType . ibtAttach
w ^? cWorld . lWorld . projectiles . ix j . pjPos
docamrot = rotateV (campos ^. camRot)
offset = fromMaybe noscopeoffset $ do