Add looping sound, add sound to terminals

This commit is contained in:
2022-03-16 09:23:17 +00:00
parent 5623747b01
commit 5aeb04ba05
24 changed files with 156 additions and 133 deletions
+8 -10
View File
@@ -8,7 +8,6 @@ module Dodge.PlacementSpot
, anyUnusedSpot
, unusedSpotAwayFromLink
, isUnusedLnk
, isUnusedLnk'
, isInLnk
, unusedSpotNearInLink
, randDirPS
@@ -20,11 +19,12 @@ module Dodge.PlacementSpot
, unusedOffPathAwayFromLink
, setFallback
, twoRoomPoss
, isUnusedLinkType
, isUnusedLnkType
, rprBoolShift
, rprBool
, shiftInBy
, resetPLUse
, psposAddLabel
) where
import Dodge.LevelGen.Data
import Geometry
@@ -53,14 +53,12 @@ isUnusedLnk rp _ = case _rpLinkStatus rp of
UnusedLink {} -> _rpPlacementUse rp == 0
_ -> False
isUnusedLnk' :: RoomPos -> Bool
isUnusedLnk' rp = case _rpLinkStatus rp of
UnusedLink {} -> _rpPlacementUse rp == 0
_ -> False
anyUnusedSpot :: PlacementSpot
anyUnusedSpot = rprBool $ \rp _ -> _rpLinkStatus rp == NotLink && _rpPlacementUse rp == 0
psposAddLabel :: RoomPosType -> PlacementSpot -> PlacementSpot
psposAddLabel lab = psSelect %~ (\f rp r -> f rp r & _Just . _2 . rpType %~ S.insert lab)
rprBool :: (RoomPos -> Room -> Bool) -> PlacementSpot
rprBool t = PSPos (useRoomPosRoomCond t) (const id) Nothing
@@ -141,9 +139,9 @@ useRoomPosRoomCond t rp r
| t rp r = Just (PS (_rpPos rp) (_rpDir rp), rp & rpPlacementUse +~ 1)
| otherwise = Nothing
isUnusedLinkType :: RoomLinkType -> RoomPos -> Bool
isUnusedLinkType rlt rp = case _rpLinkStatus rp of
UnusedLink{_rplsType = rlts} -> rlt `S.member` rlts
isUnusedLnkType :: RoomLinkType -> RoomPos -> Room -> Bool
isUnusedLnkType rlt rp _ = case _rpLinkStatus rp of
UnusedLink{_rplsType = rlts} -> rlt `S.member` rlts && _rpPlacementUse rp == 0
_ -> False
unusedSpotNearInLink :: Float -> PlacementSpot