Cleanup, tweak aiming
This commit is contained in:
@@ -39,11 +39,10 @@ wasdWithAiming ::
|
||||
Creature ->
|
||||
Creature
|
||||
wasdWithAiming w speed cr
|
||||
-- | isAiming = addAnyTwist $ set crDir mouseDir $ theMovement cr
|
||||
| isAiming = addAnyTwist $ aimTurn mouseDir $ theMovement $ setMvAim cr
|
||||
| crIsReloading cr && SDL.ButtonRight `M.member` _mouseButtons (_input w) =
|
||||
addAnyTwist $ aimTurn (mouseDir + anytwist) $ theMovement $ setMvAim cr
|
||||
-- | otherwise = theMovement $ theTurn $ removeTwist $ setMvAim cr
|
||||
--addAnyTwist $ aimTurn (mouseDir + anytwist) $ theMovement $ setMvAim cr
|
||||
aimTurn mouseDir $ removeTwist $ theMovement $ setMvAim cr
|
||||
| otherwise = noaimmove $ theTurn $ removeTwist $ setMvAim cr
|
||||
where
|
||||
setMvAim = maybe id (crMvAim .~) dir
|
||||
@@ -55,7 +54,14 @@ wasdWithAiming w speed cr
|
||||
anytwist = case cr ^? crInv . ix (crSel cr) . itUse . heldAim . aimStance of
|
||||
Just TwoHandTwist -> twistamount * pi
|
||||
_ -> 0
|
||||
addAnyTwist = crTwist .~ anytwist
|
||||
--addAnyTwist = crTwist .~ anytwist
|
||||
addAnyTwist = case cr ^? crInv . ix (crSel cr) . itUse . heldAim . aimStance of
|
||||
Just TwoHandTwist -> case cr ^. crTwist of
|
||||
0 -> (crTwist .~ twistamount * pi)
|
||||
. (crDir -~ twistamount * pi)
|
||||
_ -> id
|
||||
_ -> id
|
||||
|
||||
theMovement
|
||||
| movDir == V2 0 0 = id
|
||||
| otherwise = crMvAbsolute (speed *.* movAbs)
|
||||
|
||||
Reference in New Issue
Block a user