This commit is contained in:
2021-05-04 18:11:59 +02:00
parent 6d4c17fc07
commit f0e5095b5f
28 changed files with 477 additions and 584 deletions
+6 -5
View File
@@ -1,4 +1,4 @@
{-
{- |
Creation of doors that open when creatures approach them.
-}
{-# LANGUAGE BangPatterns #-}
@@ -68,11 +68,12 @@ mkAutoDoor pl pr xs = addSound $ zipWith3 (autoDoorPane (pl,pr))
addSound (x:xs) = f x : xs
f wl = over doorMech g wl
g dm w | dist wp pld > 2 && dist wp hwd > 2
= soundFrom (WallSound (head xs)) (fromIntegral doorSound) 1 0 $ dm w
| otherwise = dm w
g dm w
| dist wp pld > 2 && dist wp hwd > 2
= soundFrom (WallSound (head xs)) (fromIntegral doorSound) 1 0 $ dm w
| otherwise = dm w
where
wp = snd (_wlLine $ _walls w IM.! (head xs))
wp = snd (_wlLine $ _walls w IM.! head xs)
autoDoorPane
:: (Point2,Point2) -- ^ Trigger line