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