diff --git a/src/Dodge/Room/Pillar.hs b/src/Dodge/Room/Pillar.hs new file mode 100644 index 000000000..92f271839 --- /dev/null +++ b/src/Dodge/Room/Pillar.hs @@ -0,0 +1,47 @@ +module Dodge.Room.Pillar where +import Dodge.Data +import Dodge.PlacementSpot +import Dodge.Room.Foreground +import Dodge.LevelGen.Data +import Dodge.Placement.Instance +--import Dodge.LevelGen.Data +import Dodge.Room.Procedural +import Geometry +import LensHelp + +import qualified Data.Set as S + +blockPillar :: Float -> Float -> Placement +blockPillar w' h' = ps0jPushPS (aline tl tr) + $ ps0jPushPS (aline tr br) + $ ps0jPushPS (aline br bl) + $ sps0 (aline bl tl) + where + w = w' - 9 + h = h' - 9 + tl = V2 (-w) h + tr = V2 w h + br = V2 w (-h) + bl = V2 (-w) (-h) + aline = PutLineBlock baseBlockPane StoneBlock 9 9 + + +roomPillars :: Float -> Float -> Float -> Int -> Int -> Room +roomPillars pillarsize w h wn hn = r + & rmPmnts .~ plmnts + & rmName .~ "rectPillars" + where + r = roomRect w h wn hn + pilw = (( w - 40 * (fromIntegral wn +1) ) / fromIntegral wn) - pillarsize + pilh = (( h - 40 * (fromIntegral hn +1) ) / fromIntegral hn) - pillarsize + npillars = length $ filter (S.member RoomPosOffPath . _rpType) $ _rmPos r + plmnts = spanLightI (V2 120 24) (V2 120 216) + : mntLS vShape (V2 12 12) (V3 25 25 70) + : mntLS vShape (V2 228 228) (V3 215 215 70) + : sps0 (PutShape $ thinHighBar 75 (V2 26 25) (V2 120 25)) + : sps0 (PutShape $ thinHighBar 75 (V2 214 215) (V2 120 215)) + : replicate npillars (blockPillar (0.5*pilw) (0.5*pilh) & plSpot .~ rprBool + (\rp _ -> and [RoomPosOffPath `S.member` _rpType rp + , _rpPlacementUse rp == 0 + , _rpLinkStatus rp == NotLink ] ) + )