This commit is contained in:
2025-06-01 09:31:29 +01:00
parent b7cd91b56e
commit 39753755af
2 changed files with 10 additions and 13 deletions
+2 -4
View File
@@ -135,10 +135,8 @@ doAimTwist :: Float -> Creature -> Creature
doAimTwist x cr = fromMaybe cr $ do doAimTwist x cr = fromMaybe cr $ do
itRef <- cr ^? crManipulation . manObject . imRootSelectedItem itRef <- cr ^? crManipulation . manObject . imRootSelectedItem
astance <- cr ^? crInv . ix itRef . itUse . heldAim . aimStance astance <- cr ^? crInv . ix itRef . itUse . heldAim . aimStance
return $ case astance of guard $ astance == TwoHandOver || astance == TwoHandUnder
TwoHandUnder -> cr & crDir +~ x return $ cr & crDir +~ x
TwoHandOver -> cr & crDir +~ x
_ -> cr
removeAimPosture :: Creature -> Creature removeAimPosture :: Creature -> Creature
removeAimPosture = (crStance . posture .~ AtEase) . doAimTwist twoHandTwistAmount removeAimPosture = (crStance . posture .~ AtEase) . doAimTwist twoHandTwistAmount
+4 -5
View File
@@ -157,21 +157,20 @@ rotateToOverlappingWall w =
maybe maybe
id id
(doWallRotate . snd) (doWallRotate . snd)
(overlapCircWallsClosest p (_crRad cr + 5) (filter _wlRotateTo $ wlsNearPoint p w)) (overlapCircWallsClosest p (_crRad cr + 10) (filter _wlRotateTo $ wlsNearPoint p w))
w w
where where
cr = you w cr = you w
p = _crPos (you w) p = _crPos (you w)
doWallRotate :: Wall -> World -> World doWallRotate :: Wall -> World -> World
doWallRotate wl w = rotateUsing $ (argV . uncurry (-.-) $ _wlLine wl) - (w ^. wCam . camRot) doWallRotate wl w
where
rotateUsing a
| b - b' > 0.01 = w & wCam . camRot +~ 0.01 | b - b' > 0.01 = w & wCam . camRot +~ 0.01
| b - b' < negate 0.01 = w & wCam . camRot -~ 0.01 | b - b' < negate 0.01 = w & wCam . camRot -~ 0.01
| otherwise = w | otherwise = w
where where
b = a * (4 / pi) a = argV (uncurry (-.-) $ _wlLine wl) - w ^. wCam . camRot
b = a * (4 / pi) -- for 8 way cardinal orientation wrt wall
b' = fromIntegral (round b :: Int) b' = fromIntegral (round b :: Int)
zoomFromItem :: ItZoom -> Float zoomFromItem :: ItZoom -> Float