Cleanup
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -157,22 +157,21 @@ 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
|
||||||
|
| b - b' > 0.01 = w & wCam . camRot +~ 0.01
|
||||||
|
| b - b' < negate 0.01 = w & wCam . camRot -~ 0.01
|
||||||
|
| otherwise = w
|
||||||
where
|
where
|
||||||
rotateUsing a
|
a = argV (uncurry (-.-) $ _wlLine wl) - w ^. wCam . camRot
|
||||||
| b - b' > 0.01 = w & wCam . camRot +~ 0.01
|
b = a * (4 / pi) -- for 8 way cardinal orientation wrt wall
|
||||||
| b - b' < negate 0.01 = w & wCam . camRot -~ 0.01
|
b' = fromIntegral (round b :: Int)
|
||||||
| otherwise = w
|
|
||||||
where
|
|
||||||
b = a * (4 / pi)
|
|
||||||
b' = fromIntegral (round b :: Int)
|
|
||||||
|
|
||||||
zoomFromItem :: ItZoom -> Float
|
zoomFromItem :: ItZoom -> Float
|
||||||
zoomFromItem ItZoom{_izMax = zMax, _izMin = zMin, _izFac = zFac} =
|
zoomFromItem ItZoom{_izMax = zMax, _izMin = zMin, _izFac = zFac} =
|
||||||
|
|||||||
Reference in New Issue
Block a user