{- Rooms that connect other rooms, blocking sight. -} module Dodge.Room.Door where import Geometry import Dodge.RoomLink import Dodge.Data import Dodge.Default.Room import Dodge.Default.Door import Dodge.Placement.Instance import Color import Data.Maybe door :: Room door = defaultRoom { _rmPolys = [rectNSWE 40 0 0 40] , _rmLinks = lnks , _rmPath = doublePairSet (V2 20 35,V2 20 5) -- door extends into side walls (for shadows as rendered 12/03) , _rmPmnts = [putAutoDoor (V2 0 20) (V2 40 20)] , _rmName = "autoDoor" , _rmBound = [rectNSWE 21 19 0 40] } where lnks = [uncurry outLink (V2 20 35,0) ,uncurry inLink (V2 20 5,pi) ] triggerDoorRoom :: Int -> Room triggerDoorRoom inplid = defaultRoom { _rmPolys = [rectNSWE 40 0 0 40] , _rmLinks = [uncurry outLink (V2 20 35,0) ,uncurry inLink(V2 20 5,pi) ] , _rmPath = doublePairSet (V2 20 35,V2 20 5) , _rmInPmnt = [InPlacement f inplid] , _rmName = "triggerDoorRoom" -- door extends into side walls (for shadows as rendered 12/03/21) -- note no bounds } where f (pmnt:_) = putDoubleDoor DoorObstacle (switchWallCol red) (cond pmnt) (V2 0 20) (V2 40 20) 2 f _ = error "tried to put a door using an empty placement list" cond pmnt = WdTrig $ fromJust (_plMID pmnt)