Hlint pass
This commit is contained in:
@@ -143,7 +143,7 @@ collide3Floors sp cs (ep, mn) = maybe (ep, mn) (,Just (V3 0 0 1, OFloor)) mp
|
|||||||
let g (a, b) = isRHS a b (V2 x y)
|
let g (a, b) = isRHS a b (V2 x y)
|
||||||
f = any g
|
f = any g
|
||||||
guard (all (f . loopPairs) cs)
|
guard (all (f . loopPairs) cs)
|
||||||
return $ (V3 x y z)
|
return (V3 x y z)
|
||||||
|
|
||||||
collide3Wall :: Point3 -> Wall -> (Point3, MPO) -> (Point3, MPO)
|
collide3Wall :: Point3 -> Wall -> (Point3, MPO) -> (Point3, MPO)
|
||||||
collide3Wall sp wl (ep, mo) = maybe (ep, mo) (,Just (n, OWall wl)) $ intersectSegSurface sp ep p n ss
|
collide3Wall sp wl (ep, mo) = maybe (ep, mo) (,Just (n, OWall wl)) $ intersectSegSurface sp ep p n ss
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ rightHandPQ cr
|
|||||||
off = 8
|
off = 8
|
||||||
sLen = _strideLength $ _crStance cr
|
sLen = _strideLength $ _crStance cr
|
||||||
f i = negate 2 + negate 6 * (sLen - i) / sLen
|
f i = negate 2 + negate 6 * (sLen - i) / sLen
|
||||||
g i = negate 2 + negate 6 * (i) / sLen
|
g i = negate 2 + negate 6 * i / sLen
|
||||||
|
|
||||||
translateToRightHand :: Creature -> SPic -> SPic
|
translateToRightHand :: Creature -> SPic -> SPic
|
||||||
translateToRightHand = overPosSP . translatePointToRightHand
|
translateToRightHand = overPosSP . translatePointToRightHand
|
||||||
@@ -59,7 +59,7 @@ leftHandPQ cr
|
|||||||
off = 8
|
off = 8
|
||||||
sLen = _strideLength $ _crStance cr
|
sLen = _strideLength $ _crStance cr
|
||||||
f i = negate 2 + negate 6 * (sLen - i) / sLen
|
f i = negate 2 + negate 6 * (sLen - i) / sLen
|
||||||
g i = negate 2 + negate 6 * ( i) / sLen
|
g i = negate 2 + negate 6 * i / sLen
|
||||||
|
|
||||||
translatePointToLeftHand :: Creature -> Point3 -> Point3
|
translatePointToLeftHand :: Creature -> Point3 -> Point3
|
||||||
translatePointToLeftHand cr p = fst (leftHandPQ cr `Q.comp` (p,Q.qID))
|
translatePointToLeftHand cr p = fst (leftHandPQ cr `Q.comp` (p,Q.qID))
|
||||||
@@ -103,7 +103,7 @@ translateToRightLeg :: Creature -> SPic -> SPic
|
|||||||
translateToRightLeg cr = overPosSP (\p -> fst (rightLegPQ cr `Q.comp` (p,Q.qID)))
|
translateToRightLeg cr = overPosSP (\p -> fst (rightLegPQ cr `Q.comp` (p,Q.qID)))
|
||||||
|
|
||||||
translateToHead :: Creature -> SPic -> SPic
|
translateToHead :: Creature -> SPic -> SPic
|
||||||
translateToHead cr = overPosSP (\p -> fst $ (headPQ cr `Q.comp` (p,Q.qID)))
|
translateToHead cr = overPosSP (\p -> fst (headPQ cr `Q.comp` (p,Q.qID)))
|
||||||
|
|
||||||
headPQ :: Creature -> Point3Q
|
headPQ :: Creature -> Point3Q
|
||||||
headPQ cr
|
headPQ cr
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ scalp cr = overPosSH (\p -> fst (headPQ cr `Q.comp` (p,Q.qID))) fhead
|
|||||||
|
|
||||||
torso :: Creature -> Shape
|
torso :: Creature -> Shape
|
||||||
{-# INLINE torso #-}
|
{-# INLINE torso #-}
|
||||||
torso cr = overPosSH (\p -> fst $ (backPQ cr `Q.comp` (p,Q.qID))) tsh
|
torso cr = overPosSH (\p -> fst (backPQ cr `Q.comp` (p,Q.qID))) tsh
|
||||||
-- | oneH cr = rotateSH 0.5 tsh
|
-- | oneH cr = rotateSH 0.5 tsh
|
||||||
-- | twists cr =
|
-- | twists cr =
|
||||||
-- translateSHxy 0 3 . rotateSH (-1.3) $ tsh
|
-- translateSHxy 0 3 . rotateSH (-1.3) $ tsh
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ crUpdate' f cr =
|
|||||||
. g
|
. g
|
||||||
. updateWalkCycle cid
|
. updateWalkCycle cid
|
||||||
where
|
where
|
||||||
cid = (cr ^. crID)
|
cid = cr ^. crID
|
||||||
g w' = maybe id f (w' ^? cWorld . lWorld . creatures . ix cid) w'
|
g w' = maybe id f (w' ^? cWorld . lWorld . creatures . ix cid) w'
|
||||||
|
|
||||||
checkDeath :: Int -> World -> World
|
checkDeath :: Int -> World -> World
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ destroyAllInvItems cr w = foldl' (flip $ destroyInvItem (cr ^. crID)) w
|
|||||||
destroyItem :: Int -> World -> World
|
destroyItem :: Int -> World -> World
|
||||||
destroyItem itid w = case w ^? cWorld . lWorld . itemLocations . ix itid of
|
destroyItem itid w = case w ^? cWorld . lWorld . itemLocations . ix itid of
|
||||||
Nothing -> error $ "Tried to destroy item that does not exist; item id: "++ show itid
|
Nothing -> error $ "Tried to destroy item that does not exist; item id: "++ show itid
|
||||||
Just (InInv {_ilCrID = cid, _ilInvID = invid}) -> destroyInvItem cid invid w
|
Just InInv {_ilCrID = cid, _ilInvID = invid} -> destroyInvItem cid invid w
|
||||||
Just (OnTurret{}) -> error "need to write code for destroying items on turrets"
|
Just OnTurret{} -> error "need to write code for destroying items on turrets"
|
||||||
Just (OnFloor (NInt i)) -> w & cWorld . lWorld . itemLocations . at itid .~ Nothing
|
Just (OnFloor (NInt i)) -> w & cWorld . lWorld . itemLocations . at itid .~ Nothing
|
||||||
& cWorld . lWorld . floorItems . unNIntMap . at i .~ Nothing
|
& cWorld . lWorld . floorItems . unNIntMap . at i .~ Nothing
|
||||||
Just InVoid -> w & cWorld . lWorld . itemLocations . at itid .~ Nothing
|
Just InVoid -> w & cWorld . lWorld . itemLocations . at itid .~ Nothing
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
{-# LANGUAGE LambdaCase #-}
|
--{-# LANGUAGE LambdaCase #-}
|
||||||
|
|
||||||
--{-# OPTIONS_GHC -Wno-unused-imports #-}
|
--{-# OPTIONS_GHC -Wno-unused-imports #-}
|
||||||
module Dodge.Projectile.Update (updateProjectile) where
|
module Dodge.Projectile.Update (updateProjectile) where
|
||||||
|
|
||||||
@@ -74,7 +73,7 @@ shellHitWall p n wl pj w
|
|||||||
, abs (dot (pj ^. pjVel) (normalize n)) < x =
|
, abs (dot (pj ^. pjVel) (normalize n)) < x =
|
||||||
w
|
w
|
||||||
& topj . pjVel %~ reflectInNormal n
|
& topj . pjVel %~ reflectInNormal n
|
||||||
& topj . pjPos .~ p + (normalize n)
|
& topj . pjPos .~ p + normalize n
|
||||||
& soundStart (ShellSound (pj ^. pjID)) (pj ^. pjPos . _xy) click1S Nothing
|
& soundStart (ShellSound (pj ^. pjID)) (pj ^. pjPos . _xy) click1S Nothing
|
||||||
| otherwise =
|
| otherwise =
|
||||||
w & topj . pjPos .~ p
|
w & topj . pjPos .~ p
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ rezBox :: LightSource -> Room
|
|||||||
rezBox ls =
|
rezBox ls =
|
||||||
roomRect 40 60 1 1
|
roomRect 40 60 1 1
|
||||||
& rmPmnts .~ [sPS (V2 20 1) 0 $ PutLS ls
|
& rmPmnts .~ [sPS (V2 20 1) 0 $ PutLS ls
|
||||||
, putMessageTerminal terminalColor (defaultTerminal & tmBootLines .~ (makeTermPara s) <> tlSetStatus (TerminalPressTo "QUIT") <> [TLine 1 [] TmWdWdDeactivateTerminal])
|
, putMessageTerminal terminalColor (defaultTerminal & tmBootLines .~ makeTermPara s <> tlSetStatus (TerminalPressTo "QUIT") <> [TLine 1 [] TmWdWdDeactivateTerminal])
|
||||||
& plSpot .~ PS (V2 20 0) 0
|
& plSpot .~ PS (V2 20 0) 0
|
||||||
]
|
]
|
||||||
& restrictInLinks (\(V2 _ h, _) -> h < 1)
|
& restrictInLinks (\(V2 _ h, _) -> h < 1)
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ damageCodeCommand = PTE.singleton "DAMAGECODE" $ PTE.fromList $ mapMaybe f [minB
|
|||||||
s <- g st
|
s <- g st
|
||||||
return (s, [TLine 0 [] $ TmGetDamageCoding st])
|
return (s, [TLine 0 [] $ TmGetDamageCoding st])
|
||||||
g =
|
g =
|
||||||
fmap (map toUpper) . fmap reverse . List.stripPrefix (reverse "Sensor")
|
fmap (map toUpper . reverse) . List.stripPrefix (reverse "Sensor")
|
||||||
. reverse
|
. reverse
|
||||||
. show
|
. show
|
||||||
|
|
||||||
|
|||||||
@@ -218,8 +218,8 @@ updateMouseClickInGame cfig w = case w ^. input . mouseContext of
|
|||||||
&& isGroupSelectableSection (fst x) ->
|
&& isGroupSelectableSection (fst x) ->
|
||||||
w & input . mouseContext .~ OverInvDragSelect x (Just $ snd x)
|
w & input . mouseContext .~ OverInvDragSelect x (Just $ snd x)
|
||||||
OverInvSelect x -> startDrag x cfig w
|
OverInvSelect x -> startDrag x cfig w
|
||||||
OverTerminal tmid (TerminalTextInput {}) -> terminalReturnEffect tmid w
|
OverTerminal tmid TerminalTextInput{} -> terminalReturnEffect tmid w
|
||||||
OverTerminal tmid (TerminalPressTo{}) -> continueTerminal tmid w
|
OverTerminal tmid TerminalPressTo{} -> continueTerminal tmid w
|
||||||
OutsideTerminal -> w & hud . hudElement . subInventory .~ NoSubInventory
|
OutsideTerminal -> w & hud . hudElement . subInventory .~ NoSubInventory
|
||||||
OverCombSelect x ->
|
OverCombSelect x ->
|
||||||
w & hud . hudElement . subInventory . ciSelection ?~ f x
|
w & hud . hudElement . subInventory . ciSelection ?~ f x
|
||||||
@@ -392,7 +392,7 @@ updateKeysInTerminal tmid u = fromMaybe u $ do
|
|||||||
|
|
||||||
updateKeyContinueTerminal :: Int -> Universe -> Universe
|
updateKeyContinueTerminal :: Int -> Universe -> Universe
|
||||||
updateKeyContinueTerminal tmid u
|
updateKeyContinueTerminal tmid u
|
||||||
| any (==0) $ u ^. uvWorld . input . pressedKeys =
|
| elem 0 $ u ^. uvWorld . input . pressedKeys =
|
||||||
u & uvWorld %~ continueTerminal tmid
|
u & uvWorld %~ continueTerminal tmid
|
||||||
| otherwise = u
|
| otherwise = u
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{-# LANGUAGE TupleSections #-}
|
--{-# LANGUAGE TupleSections #-}
|
||||||
module Dodge.Update.Scroll (
|
module Dodge.Update.Scroll (
|
||||||
updateWheelEvent,
|
updateWheelEvent,
|
||||||
) where
|
) where
|
||||||
|
|||||||
Reference in New Issue
Block a user