diff --git a/src/Dodge/Base/Collide.hs b/src/Dodge/Base/Collide.hs index fe2071027..393374d08 100644 --- a/src/Dodge/Base/Collide.hs +++ b/src/Dodge/Base/Collide.hs @@ -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) f = any g guard (all (f . loopPairs) cs) - return $ (V3 x y z) + return (V3 x y z) 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 diff --git a/src/Dodge/Creature/HandPos.hs b/src/Dodge/Creature/HandPos.hs index f167838ce..e6a38df3d 100644 --- a/src/Dodge/Creature/HandPos.hs +++ b/src/Dodge/Creature/HandPos.hs @@ -37,7 +37,7 @@ rightHandPQ cr off = 8 sLen = _strideLength $ _crStance cr 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 = overPosSP . translatePointToRightHand @@ -59,7 +59,7 @@ leftHandPQ cr off = 8 sLen = _strideLength $ _crStance cr 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 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))) 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 cr diff --git a/src/Dodge/Creature/Picture.hs b/src/Dodge/Creature/Picture.hs index 568d8363d..47b2a56ca 100644 --- a/src/Dodge/Creature/Picture.hs +++ b/src/Dodge/Creature/Picture.hs @@ -99,7 +99,7 @@ scalp cr = overPosSH (\p -> fst (headPQ cr `Q.comp` (p,Q.qID))) fhead torso :: Creature -> Shape {-# 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 -- | twists cr = -- translateSHxy 0 3 . rotateSH (-1.3) $ tsh diff --git a/src/Dodge/Creature/Update.hs b/src/Dodge/Creature/Update.hs index 9a8c0106f..3f6c80b07 100644 --- a/src/Dodge/Creature/Update.hs +++ b/src/Dodge/Creature/Update.hs @@ -61,7 +61,7 @@ crUpdate' f cr = . g . updateWalkCycle cid where - cid = (cr ^. crID) + cid = cr ^. crID g w' = maybe id f (w' ^? cWorld . lWorld . creatures . ix cid) w' checkDeath :: Int -> World -> World diff --git a/src/Dodge/Inventory.hs b/src/Dodge/Inventory.hs index 2f16346b9..1e0db478d 100644 --- a/src/Dodge/Inventory.hs +++ b/src/Dodge/Inventory.hs @@ -64,8 +64,8 @@ destroyAllInvItems cr w = foldl' (flip $ destroyInvItem (cr ^. crID)) w destroyItem :: Int -> World -> World 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 - Just (InInv {_ilCrID = cid, _ilInvID = invid}) -> destroyInvItem cid invid w - Just (OnTurret{}) -> error "need to write code for destroying items on turrets" + Just InInv {_ilCrID = cid, _ilInvID = invid} -> destroyInvItem cid invid w + Just OnTurret{} -> error "need to write code for destroying items on turrets" Just (OnFloor (NInt i)) -> w & cWorld . lWorld . itemLocations . at itid .~ Nothing & cWorld . lWorld . floorItems . unNIntMap . at i .~ Nothing Just InVoid -> w & cWorld . lWorld . itemLocations . at itid .~ Nothing diff --git a/src/Dodge/Projectile/Update.hs b/src/Dodge/Projectile/Update.hs index 19e9cdd75..1ff335e35 100644 --- a/src/Dodge/Projectile/Update.hs +++ b/src/Dodge/Projectile/Update.hs @@ -1,5 +1,4 @@ -{-# LANGUAGE LambdaCase #-} - +--{-# LANGUAGE LambdaCase #-} --{-# OPTIONS_GHC -Wno-unused-imports #-} module Dodge.Projectile.Update (updateProjectile) where @@ -74,7 +73,7 @@ shellHitWall p n wl pj w , abs (dot (pj ^. pjVel) (normalize n)) < x = w & topj . pjVel %~ reflectInNormal n - & topj . pjPos .~ p + (normalize n) + & topj . pjPos .~ p + normalize n & soundStart (ShellSound (pj ^. pjID)) (pj ^. pjPos . _xy) click1S Nothing | otherwise = w & topj . pjPos .~ p diff --git a/src/Dodge/Room/RezBox.hs b/src/Dodge/Room/RezBox.hs index 4b70851dc..bceb7844f 100644 --- a/src/Dodge/Room/RezBox.hs +++ b/src/Dodge/Room/RezBox.hs @@ -26,7 +26,7 @@ rezBox :: LightSource -> Room rezBox ls = roomRect 40 60 1 1 & 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 ] & restrictInLinks (\(V2 _ h, _) -> h < 1) diff --git a/src/Dodge/Terminal.hs b/src/Dodge/Terminal.hs index 29bd58efe..04640b456 100644 --- a/src/Dodge/Terminal.hs +++ b/src/Dodge/Terminal.hs @@ -74,7 +74,7 @@ damageCodeCommand = PTE.singleton "DAMAGECODE" $ PTE.fromList $ mapMaybe f [minB s <- g st return (s, [TLine 0 [] $ TmGetDamageCoding st]) g = - fmap (map toUpper) . fmap reverse . List.stripPrefix (reverse "Sensor") + fmap (map toUpper . reverse) . List.stripPrefix (reverse "Sensor") . reverse . show diff --git a/src/Dodge/Update/Input/InGame.hs b/src/Dodge/Update/Input/InGame.hs index 6d3034201..c20d8ee80 100644 --- a/src/Dodge/Update/Input/InGame.hs +++ b/src/Dodge/Update/Input/InGame.hs @@ -218,8 +218,8 @@ updateMouseClickInGame cfig w = case w ^. input . mouseContext of && isGroupSelectableSection (fst x) -> w & input . mouseContext .~ OverInvDragSelect x (Just $ snd x) OverInvSelect x -> startDrag x cfig w - OverTerminal tmid (TerminalTextInput {}) -> terminalReturnEffect tmid w - OverTerminal tmid (TerminalPressTo{}) -> continueTerminal tmid w + OverTerminal tmid TerminalTextInput{} -> terminalReturnEffect tmid w + OverTerminal tmid TerminalPressTo{} -> continueTerminal tmid w OutsideTerminal -> w & hud . hudElement . subInventory .~ NoSubInventory OverCombSelect x -> w & hud . hudElement . subInventory . ciSelection ?~ f x @@ -392,7 +392,7 @@ updateKeysInTerminal tmid u = fromMaybe u $ do updateKeyContinueTerminal :: Int -> Universe -> Universe updateKeyContinueTerminal tmid u - | any (==0) $ u ^. uvWorld . input . pressedKeys = + | elem 0 $ u ^. uvWorld . input . pressedKeys = u & uvWorld %~ continueTerminal tmid | otherwise = u diff --git a/src/Dodge/Update/Scroll.hs b/src/Dodge/Update/Scroll.hs index dc8333abc..1d4471dbb 100644 --- a/src/Dodge/Update/Scroll.hs +++ b/src/Dodge/Update/Scroll.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE TupleSections #-} +--{-# LANGUAGE TupleSections #-} module Dodge.Update.Scroll ( updateWheelEvent, ) where