Stop tracking aim twist amount, use fixed number
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -13,7 +13,7 @@ import Geometry
|
||||
|
||||
holsterWeapon, drawWeapon :: Action
|
||||
holsterWeapon = DoImpulses [ChangePosture AtEase, MakeSound whiteNoiseFadeOutS]
|
||||
drawWeapon = DoImpulses [ChangePosture (Aiming 0), MakeSound whiteNoiseFadeInS]
|
||||
drawWeapon = DoImpulses [ChangePosture Aiming, MakeSound whiteNoiseFadeInS]
|
||||
|
||||
shootTillEmpty :: Action
|
||||
--shootTillEmpty = (crCanShoot `DoActionWhile` DoImpulses [UseItem])
|
||||
|
||||
@@ -162,21 +162,19 @@ setAimPosture cr = fromMaybe cr $ do
|
||||
astance <- cr ^? crInv . ix itRef . itUse . heldAim . aimStance
|
||||
case astance of
|
||||
TwoHandUnder ->
|
||||
return $ cr & crStance . posture .~ Aiming (twistamount * pi)
|
||||
& crDir -~ (twistamount * pi)
|
||||
return $ cr & crStance . posture .~ Aiming
|
||||
& crDir -~ twoHandTwistAmount
|
||||
TwoHandOver ->
|
||||
return $ cr & crStance . posture .~ Aiming (twistamount * pi)
|
||||
& crDir -~ (twistamount * pi)
|
||||
_ -> return $ cr & crStance . posture .~ Aiming 0
|
||||
where
|
||||
twistamount :: Float
|
||||
twistamount = 1.6
|
||||
return $ cr & crStance . posture .~ Aiming
|
||||
& crDir -~ twoHandTwistAmount
|
||||
_ -> return $ cr & crStance . posture .~ Aiming
|
||||
|
||||
twoHandTwistAmount :: Float
|
||||
twoHandTwistAmount = 1.6 * pi
|
||||
|
||||
removeAimPosture :: Creature -> Creature
|
||||
removeAimPosture cr = fromMaybe cr $ do
|
||||
x <- cr ^? crStance . posture . aimTwist
|
||||
return $ cr
|
||||
& crDir +~ x
|
||||
removeAimPosture cr = cr
|
||||
& crDir +~ twoHandTwistAmount
|
||||
& crStance . posture .~ AtEase
|
||||
|
||||
wasdMovement :: Input -> Camera -> Float -> Creature -> Creature
|
||||
@@ -198,14 +196,6 @@ aimTurn a cr = creatureTurnTowardDir a (x * 0.2) cr
|
||||
itRef <- cr ^? crManipulation . manObject . imRootSelectedItem
|
||||
cr ^? crInv . ix itRef . itUse . heldAim . aimTurnSpeed
|
||||
|
||||
{- | Set posture according to mouse presses.
|
||||
(should you be aiming without a selected item?)
|
||||
-}
|
||||
setCrPosture :: M.Map SDL.MouseButton Int -> Creature -> Creature
|
||||
setCrPosture pkeys
|
||||
| SDL.ButtonRight `M.member` pkeys = crStance . posture .~ Aiming 0
|
||||
| otherwise = crStance . posture .~ AtEase
|
||||
|
||||
tryClickUse :: M.Map SDL.MouseButton Int -> World -> World
|
||||
tryClickUse pkeys w = fromMaybe w $ do
|
||||
ltime <- pkeys ^? ix SDL.ButtonLeft
|
||||
|
||||
@@ -36,7 +36,7 @@ data FootForward
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
data Posture
|
||||
= Aiming {_aimTwist :: Float}
|
||||
= Aiming
|
||||
| AtEase
|
||||
deriving (Eq, Ord, Show, Read) --Generic, Flat)
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ module Dodge.Render.Picture (
|
||||
) where
|
||||
|
||||
import Control.Lens
|
||||
import Control.Monad
|
||||
import Data.Maybe
|
||||
import Dodge.Base.Coordinate
|
||||
import Dodge.Base.Window
|
||||
|
||||
@@ -26,7 +26,7 @@ import qualified IntMapHelp as IM
|
||||
import qualified Data.Map.Strict as M
|
||||
|
||||
testStringInit :: Universe -> [String]
|
||||
testStringInit u = []
|
||||
testStringInit _ = []
|
||||
-- foldMap prettyShort $ u ^? uvWorld . cWorld . lWorld . creatures . ix 0 . crTwist
|
||||
-- prettyShort $ u ^.. uvWorld . cWorld . lWorld . teslaArcs . ix 0 . taArcSteps . each . asObject
|
||||
--testStringInit u = foldMap prettyShort $ u ^. uvWorld . cWorld . lWorld . projectiles
|
||||
|
||||
Reference in New Issue
Block a user