More hlinting
This commit is contained in:
@@ -207,8 +207,8 @@ mcProxTest w = \case
|
||||
RequireHealth x -> fromMaybe 0 (cr ^? crHP . _HP) >= x
|
||||
RequireEquipment ct ->
|
||||
any
|
||||
(\itm -> _itType itm == ct)
|
||||
((\k -> w ^?! cWorld . lWorld . items . ix k) <$> _crInv cr)
|
||||
((\itm -> _itType itm == ct)
|
||||
. (\k -> w ^?! cWorld . lWorld . items . ix k)) (_crInv cr)
|
||||
RequireDeadCreatures is -> all (\x -> null (x ^? crHP . _HP))
|
||||
(IM.restrictKeys (w ^. cWorld . lWorld . creatures) (IS.fromList is))
|
||||
where
|
||||
|
||||
@@ -153,7 +153,7 @@ damageDirt dm _ w =
|
||||
|
||||
damageGlass :: Damage -> ECW -> World -> (Int,World)
|
||||
damageGlass dm ecw w = case dm of
|
||||
Lasering {} -> f 0 $ id
|
||||
Lasering {} -> f 0 id
|
||||
Piercing _ p t ->
|
||||
f dmam $ makeSpark NormalSpark (outTo p t) (rdir p t)
|
||||
-- . makeDustAt Stone 200 (addZ 20 (outTo p t))
|
||||
@@ -219,7 +219,7 @@ damageGlass dm ecw w = case dm of
|
||||
|
||||
damageCrystal :: Damage -> ECW -> World -> (Int,World)
|
||||
damageCrystal dm ecw w = case dm of
|
||||
Lasering {} -> f $ id
|
||||
Lasering {} -> f id
|
||||
Piercing _ p t ->
|
||||
f $ makeSpark NormalSpark (outTo p t) (rdir p t)
|
||||
. randsound p [marimbaC5S,marimbaE5S,marimbaG5S,marimbaB6S]
|
||||
|
||||
@@ -62,11 +62,7 @@ triggerSwitch col ps = psPtCont ps (PutTrigger False) $
|
||||
where
|
||||
trigid tp = fromJust $ _plMID tp
|
||||
|
||||
putLitButOnPos ::
|
||||
Color ->
|
||||
PlacementSpot ->
|
||||
(Placement -> Maybe Placement) ->
|
||||
Placement
|
||||
putLitButOnPos :: Color -> PlacementSpot -> (Placement -> Maybe Placement) -> Placement
|
||||
putLitButOnPos col theps subpl =
|
||||
plSpot .~ theps $
|
||||
mntLSOn aShape (Just col) ls 0 (V3 0 (-40) 40) $
|
||||
@@ -77,20 +73,19 @@ putLitButOnPos col theps subpl =
|
||||
<&> plSpot
|
||||
.~ _plSpot plmnt
|
||||
where
|
||||
changeLight lsid = SetLSCol (V3 0 0.5 0) lsid
|
||||
changeLight = SetLSCol (V3 0 0.5 0)
|
||||
ls = lsColPosRad (V3 0.5 0 0) (V3 0 0 50) 50
|
||||
|
||||
-- creates a lit external trigger, passes the trigger placement forward
|
||||
extTrigLitPos :: PlacementSpot -> (Placement -> Maybe Placement) -> Placement
|
||||
extTrigLitPos ps f = psPtCont ps (PutTrigger False) $
|
||||
\tp -> Just $
|
||||
pContID (ps' tp) (PutLS thels) $
|
||||
pContID (_plSpot tp) (PutLS thels) $
|
||||
\lsid ->
|
||||
Just $
|
||||
pContID (ps' tp) (PutMod $ themod lsid tp) $
|
||||
pContID (_plSpot tp) (PutMod $ themod lsid tp) $
|
||||
const (f tp)
|
||||
where
|
||||
ps' tp = _plSpot tp
|
||||
themod lsid tp =
|
||||
ModIDID
|
||||
{ _mdID = 0
|
||||
@@ -126,6 +121,6 @@ putLitButOnPosExtTrig' col thePS cnt =
|
||||
.~ _plSpot plmnt
|
||||
where
|
||||
trigid tp = fromJust $ _plMID tp
|
||||
oneff tid = SetTrigger True tid
|
||||
oneff = SetTrigger True
|
||||
changeLight = SetLSCol (V3 0 0.5 0)
|
||||
ls = lsColPosRad (V3 0.5 0 0) (V3 0 0 50) 50
|
||||
|
||||
@@ -57,11 +57,10 @@ placePlainPSSpot w rid plmnt shift = case plmnt ^. plType of
|
||||
f x gw = fromMaybe gw $ do
|
||||
j <- x ^. plExternalID
|
||||
return $ gw & genPmnt . at j ?~ x
|
||||
recrPlace newplmnt w' pl =
|
||||
recrPlace newplmnt w' =
|
||||
placeSpot
|
||||
rid
|
||||
(w' & genRooms . ix rid . rmPmnts .:~ newplmnt)
|
||||
pl
|
||||
|
||||
-- this should be tidied up
|
||||
placeSpotUsingLink ::
|
||||
|
||||
@@ -87,8 +87,8 @@ plLineBlock basePane blwidth a b gw =
|
||||
$ upperBox Medium Typical 3
|
||||
[a + x + n - midp, a + x - (n + midp), b - (n + x + midp), b + n - (x + midp)]
|
||||
)
|
||||
midp = (0.5 * (a + b))
|
||||
x = (blwidth + 1) *^ (normalize $ a - b)
|
||||
midp = 0.5 * (a + b)
|
||||
x = (blwidth + 1) *^ normalize (a - b)
|
||||
n = vNormal x
|
||||
insertBlock (i, p) =
|
||||
insertWalls (makeWallAt p i)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{-# LANGUAGE TupleSections #-}
|
||||
module Dodge.Render.InfoBox (
|
||||
renderInfoListAt,
|
||||
renderInfoListsAt,
|
||||
) where
|
||||
|
||||
-- this should be imported implicitly
|
||||
import Dodge.Base
|
||||
import Dodge.Data.Camera
|
||||
import Dodge.Data.CardinalPoint
|
||||
@@ -13,6 +13,7 @@ import Dodge.Render.Connectors
|
||||
import Dodge.Render.List
|
||||
import Geometry
|
||||
import Picture
|
||||
import Control.Lens
|
||||
|
||||
renderInfoListAt ::
|
||||
Float ->
|
||||
@@ -22,7 +23,7 @@ renderInfoListAt ::
|
||||
(Point2, [String]) ->
|
||||
Picture
|
||||
renderInfoListAt x y cfig cam (p, ss) =
|
||||
toTopLeft cfig (renderListAt x y (zip ss (repeat white)))
|
||||
toTopLeft cfig (renderListAt x y (ss <&> (,white)))
|
||||
<> color white (lConnect (V2 (x - hw) (hh -25 - y)) (worldPosToScreen cam p))
|
||||
<> toTopLeft
|
||||
cfig
|
||||
|
||||
@@ -49,7 +49,7 @@ worldSPic cfig u =
|
||||
pointIsClose = cullPoint cfig w
|
||||
|
||||
drawBlock :: Block -> SPic
|
||||
drawBlock = (noPic . _blDraw)
|
||||
drawBlock = noPic . _blDraw
|
||||
|
||||
drawChasm :: [Point2] -> SPic
|
||||
drawChasm = foldMap (Prelude.uncurry drawCliff) . loopPairs
|
||||
|
||||
@@ -99,8 +99,7 @@ roomCross x y =
|
||||
, (V2 (- x) (20 - y), pi / 2)
|
||||
, (V2 (20 - y) (- x), pi)
|
||||
]
|
||||
++ [ uncurry inLink (V2 (y -20) (- x), pi)
|
||||
]
|
||||
++ [ inLink (V2 (y -20) (- x)) pi ]
|
||||
, _rmPath = mempty
|
||||
, _rmPmnts =
|
||||
[ spanLightI (V2 (x + 5) x) (V2 (x + 5) (- x))
|
||||
|
||||
+11
-11
@@ -31,10 +31,10 @@ corridor =
|
||||
where
|
||||
poly = rectNSWE 80 0 0 40
|
||||
lnks' =
|
||||
[ uncurry outLink (V2 20 70, 0)
|
||||
, uncurry outLink (V2 20 70, pi / 6)
|
||||
, uncurry outLink (V2 20 70, negate $ pi / 6)
|
||||
, uncurry inLink (V2 20 10, pi)
|
||||
[ outLink (V2 20 70) 0
|
||||
, outLink (V2 20 70) (pi / 6)
|
||||
, outLink (V2 20 70) (negate $ pi / 6)
|
||||
, inLink (V2 20 10) pi
|
||||
]
|
||||
|
||||
keyholeCorridor :: Room
|
||||
@@ -64,8 +64,8 @@ corridorN =
|
||||
}
|
||||
where
|
||||
lnks =
|
||||
[ uncurry outLink (V2 20 70, 0)
|
||||
, uncurry inLink (V2 20 10, pi)
|
||||
[ outLink (V2 20 70) 0
|
||||
, inLink (V2 20 10) pi
|
||||
]
|
||||
pth = doublePairSet (V2 20 70, V2 20 10)
|
||||
|
||||
@@ -82,8 +82,8 @@ corridorWallN =
|
||||
}
|
||||
where
|
||||
lnks =
|
||||
[ uncurry outLink (V2 20 70, 0)
|
||||
, uncurry inLink (V2 20 10, pi)
|
||||
[ outLink (V2 20 70) 0
|
||||
, inLink (V2 20 10) pi
|
||||
]
|
||||
pth = doublePairSet (V2 20 70, V2 20 10)
|
||||
|
||||
@@ -108,9 +108,9 @@ tEast =
|
||||
, (V2 0 10, pi)
|
||||
]
|
||||
lnks' =
|
||||
[ uncurry outLink (V2 30 60, - pi / 2)
|
||||
, uncurry outLink (V2 (-30) 60, pi / 2)
|
||||
, uncurry inLink (V2 0 10, pi)
|
||||
[ outLink (V2 30 60) (- pi / 2)
|
||||
, outLink (V2 (-30) 60) (pi / 2)
|
||||
, inLink (V2 0 10) pi
|
||||
]
|
||||
|
||||
tWest :: Room
|
||||
|
||||
@@ -23,15 +23,15 @@ door =
|
||||
}
|
||||
where
|
||||
lnks =
|
||||
[ uncurry outLink (V2 20 35, 0)
|
||||
, uncurry inLink (V2 20 5, pi)
|
||||
[ outLink (V2 20 35) 0
|
||||
, inLink (V2 20 5) pi
|
||||
]
|
||||
|
||||
triggerDoorRoom :: Int -> Room
|
||||
triggerDoorRoom i =
|
||||
defaultRoom
|
||||
{ _rmPolys = [rectNSWE 40 0 0 40]
|
||||
, _rmLinks = [uncurry outLink (V2 20 35, 0), uncurry inLink (V2 20 5, pi)]
|
||||
, _rmLinks = [outLink (V2 20 35) 0, inLink (V2 20 5) pi]
|
||||
, _rmPath = doublePairSet (V2 20 35, V2 20 5)
|
||||
, _rmInPmnt = [(0,f)]
|
||||
, _rmName = "triggerDoorRoom"
|
||||
|
||||
@@ -48,7 +48,7 @@ twinSlowDoorRoom w h x =
|
||||
[ (V2 w (h / 2), negate $ pi / 2)
|
||||
, (V2 (- w) (h / 2), pi / 2)
|
||||
]
|
||||
++ [uncurry inLink (V2 0 (- h), pi)]
|
||||
++ [inLink (V2 0 (- h)) pi]
|
||||
, _rmPath = mempty
|
||||
, _rmPmnts =
|
||||
[ pContID (PS (V2 0 (h -5)) pi) (PutButton $ makeButton col NoWorldEffect) $
|
||||
|
||||
@@ -111,7 +111,7 @@ rezBoxesWpCrit = do
|
||||
treeFromTrunk [rezBox thecol, door] $
|
||||
Node centralRoom (rezrooms ++ [onwardpassage])
|
||||
where
|
||||
adddoor rm = treeFromPost [door & rmConnectsTo .~ S.member (OnEdge North)] rm
|
||||
adddoor = treeFromPost [door & rmConnectsTo .~ S.member (OnEdge North)]
|
||||
|
||||
crAdd :: Room -> Room
|
||||
crAdd = rmPmnts .:~ sPS (V2 20 10) (0.5 * pi) randC1
|
||||
|
||||
@@ -429,7 +429,7 @@ distributerRoom atype aamount = do
|
||||
(PutMachine (reverse $ polyCirc 4 20) mcstore Nothing) & plExternalID ?~ i
|
||||
dst gw = let mj = gw ^? genPmnt . ix i . plMID . _Just
|
||||
in putTerminal (mcdist mj) (defaultTerminal & tmBootLines .~ tmDistributeLines)
|
||||
& plSpot .~ (unusedOffPathAwayFromLink 50)
|
||||
& plSpot .~ unusedOffPathAwayFromLink 50
|
||||
& plExternalID ?~ i1
|
||||
thepipe gw =
|
||||
let p1 = gw ^?! genPmnt . ix i . plSpot . psPos
|
||||
|
||||
@@ -30,7 +30,7 @@ triLootRoom w h =
|
||||
[ tri
|
||||
, base
|
||||
]
|
||||
, _rmLinks = [uncurry inLink (V2 0 (-80), pi)]
|
||||
, _rmLinks = [inLink (V2 0 (-80)) pi]
|
||||
, _rmPath = doublePairSet (V2 0 (-80), V2 0 (h / 2))
|
||||
, _rmPmnts =
|
||||
[ sPS (V2 (15 - w) 15) 0 $ PutID 0
|
||||
|
||||
@@ -103,7 +103,7 @@ tutDrop = do
|
||||
treePost
|
||||
[x & rmInPmnt .:~ (0, t j), y, cleatOnward rm]
|
||||
where
|
||||
t j = \gw ->
|
||||
t j gw =
|
||||
let x = gw ^? genInts . ix j
|
||||
in putMessageTerminal
|
||||
(defaultTerminal & tmBootLines .~ ss <> tlSetStatus (TerminalPressTo $ show x <> "QUIT") <> tlDoEffect TmWdWdPowerDownTerminal)
|
||||
|
||||
@@ -187,7 +187,7 @@ updateMouseReleaseInGame w = case w ^. input . mouseContext of
|
||||
_ -> w
|
||||
where
|
||||
getuniques x y = IS.union x y IS.\\ IS.intersection x y
|
||||
f (x, y) z = Sel x y z
|
||||
f (x, y) = Sel x y
|
||||
h (k, i) j = fold $ do
|
||||
sss <- w ^? hud . diSections . ix k . ssItems
|
||||
let (_, xss) = IM.split (min i j -1) sss
|
||||
@@ -353,7 +353,7 @@ shiftInvItemsDown j is w = fromMaybe w $ do
|
||||
guard . isJust $ w ^? hud . diSections . ix j . ssItems . ix i
|
||||
return $ IS.foldr f w is
|
||||
where
|
||||
f i' w' = swapItemWith g (j, i') w'
|
||||
f i' = swapItemWith g (j, i')
|
||||
g i' m = fst <$> IM.lookupGT i' m
|
||||
|
||||
updateFunctionKeys :: Universe -> Universe
|
||||
|
||||
@@ -77,6 +77,6 @@ makeExplosionAt p vel w =
|
||||
fdamps = replicateM 100 (state $ randomR (0, 1)) & evalState $ _randGen w
|
||||
sizes = randomRs (2, 9) $ _randGen w
|
||||
times = randomRs (15, 20) $ _randGen w
|
||||
mF v damp size time = makeFlamelet p (v + damp *^ vel) size time
|
||||
mF v damp = makeFlamelet p (v + damp *^ vel)
|
||||
newFs = zipWith4 mF fVs fdamps sizes times
|
||||
addFlames w' = foldl' (&) w' newFs
|
||||
|
||||
Reference in New Issue
Block a user