Cleanup
This commit is contained in:
@@ -135,10 +135,8 @@ doAimTwist :: Float -> Creature -> Creature
|
||||
doAimTwist x cr = fromMaybe cr $ do
|
||||
itRef <- cr ^? crManipulation . manObject . imRootSelectedItem
|
||||
astance <- cr ^? crInv . ix itRef . itUse . heldAim . aimStance
|
||||
return $ case astance of
|
||||
TwoHandUnder -> cr & crDir +~ x
|
||||
TwoHandOver -> cr & crDir +~ x
|
||||
_ -> cr
|
||||
guard $ astance == TwoHandOver || astance == TwoHandUnder
|
||||
return $ cr & crDir +~ x
|
||||
|
||||
removeAimPosture :: Creature -> Creature
|
||||
removeAimPosture = (crStance . posture .~ AtEase) . doAimTwist twoHandTwistAmount
|
||||
|
||||
@@ -157,22 +157,21 @@ rotateToOverlappingWall w =
|
||||
maybe
|
||||
id
|
||||
(doWallRotate . snd)
|
||||
(overlapCircWallsClosest p (_crRad cr + 5) (filter _wlRotateTo $ wlsNearPoint p w))
|
||||
(overlapCircWallsClosest p (_crRad cr + 10) (filter _wlRotateTo $ wlsNearPoint p w))
|
||||
w
|
||||
where
|
||||
cr = you w
|
||||
p = _crPos (you w)
|
||||
|
||||
doWallRotate :: Wall -> World -> World
|
||||
doWallRotate wl w = rotateUsing $ (argV . uncurry (-.-) $ _wlLine wl) - (w ^. wCam . camRot)
|
||||
doWallRotate wl w
|
||||
| b - b' > 0.01 = w & wCam . camRot +~ 0.01
|
||||
| b - b' < negate 0.01 = w & wCam . camRot -~ 0.01
|
||||
| otherwise = w
|
||||
where
|
||||
rotateUsing a
|
||||
| b - b' > 0.01 = w & wCam . camRot +~ 0.01
|
||||
| b - b' < negate 0.01 = w & wCam . camRot -~ 0.01
|
||||
| otherwise = w
|
||||
where
|
||||
b = a * (4 / pi)
|
||||
b' = fromIntegral (round b :: Int)
|
||||
a = argV (uncurry (-.-) $ _wlLine wl) - w ^. wCam . camRot
|
||||
b = a * (4 / pi) -- for 8 way cardinal orientation wrt wall
|
||||
b' = fromIntegral (round b :: Int)
|
||||
|
||||
zoomFromItem :: ItZoom -> Float
|
||||
zoomFromItem ItZoom{_izMax = zMax, _izMin = zMin, _izFac = zFac} =
|
||||
|
||||
Reference in New Issue
Block a user