diff --git a/src/Dodge/Data.hs b/src/Dodge/Data.hs index 1f7ad5b0a..016386bed 100644 --- a/src/Dodge/Data.hs +++ b/src/Dodge/Data.hs @@ -1408,7 +1408,8 @@ data PSType = PutCrit {_unPutCrit :: Creature} | PutCoord Point2 | PutMod Modification | PutTrigger (World -> Bool) - | PutLineBlock {_putWall :: Wall , _putStartPoint :: Point2, _putEndPoint :: Point2} + | PutLineBlock {_putWall :: Wall , _putWidth :: Float + , _putStartPoint :: Point2, _putEndPoint :: Point2} | PutWall { _pwPoly :: [Point2] , _pwWall :: Wall } | PutSlideDr Door Wall Float Point2 Point2 | PutDoor Color (World -> Bool) [(Point2,Point2)] diff --git a/src/Dodge/Placement/Instance/Wall.hs b/src/Dodge/Placement/Instance/Wall.hs index 328525219..500dd0f37 100644 --- a/src/Dodge/Placement/Instance/Wall.hs +++ b/src/Dodge/Placement/Instance/Wall.hs @@ -37,20 +37,20 @@ singleBlock a = Places a line of blocks between two points. -} blockLine :: Point2 -> Point2 -> Placement -blockLine a b = sps0 $ PutLineBlock baseBlockPane a b +blockLine a b = sps0 $ PutLineBlock baseBlockPane 9 a b {- Places an breakable window between two points. Width 8, also extends out from each point by 8. -} windowLine :: Point2 -> Point2 -> Placement -windowLine a b = sps0 $ PutLineBlock defaultWindow a b +windowLine a b = sps0 $ PutLineBlock defaultWindow 8 a b {- Places an unbreakable window between two points. Width 7, also extends out from each point by 7. -} crystalLine :: Point2 -> Point2 -> Placement -crystalLine a b = sps0 $ PutLineBlock defaultCrystalWall a b +crystalLine a b = sps0 $ PutLineBlock defaultCrystalWall 7 a b --crystalLine a b = sps0 $ PutWall ps defaultCrystalWall -- where -- ps = @@ -76,7 +76,7 @@ wallLine a b = sps0 $ PutWall ps defaultWall up = vNormal left windowLineType :: Point2 -> Point2 -> PSType -windowLineType = PutLineBlock defaultWindow +windowLineType = PutLineBlock defaultWindow 8 baseBlockPane :: Wall baseBlockPane = defaultWall @@ -123,7 +123,7 @@ putBlockRect' w h = ps0jPushPS (aline tl tr) tr = V2 w h br = V2 w (-h) bl = V2 (-w) (-h) - aline = PutLineBlock baseBlockPane + aline = PutLineBlock baseBlockPane 9 putBlockRect :: Float -> Float -> Float -> Float -> [Placement] putBlockRect a x b y = diff --git a/src/Dodge/Placement/PlaceSpot.hs b/src/Dodge/Placement/PlaceSpot.hs index 1c344a545..35bc7df05 100644 --- a/src/Dodge/Placement/PlaceSpot.hs +++ b/src/Dodge/Placement/PlaceSpot.hs @@ -101,7 +101,7 @@ placeSpotID ps pt w = case pt of -> plSlideDoor wl dr off (doShift a) (doShift b) w PutBlock bl wl ps' -> plBlock (map doShift ps') (bl & blPos %~ doShift & blDir .~ rot) wl w - PutLineBlock wl a b -> plLineBlock wl (doShift a) (doShift b) w + PutLineBlock wl wdth a b -> plLineBlock wl wdth (doShift a) (doShift b) w PutWall qs wl -> (0,placeWallPoly (map doShift qs) wl w) PutNothing -> (0,w) PutID i -> (i, w) diff --git a/src/Dodge/Placement/PlaceSpot/Block.hs b/src/Dodge/Placement/PlaceSpot/Block.hs index ef5522996..49a2e9ef8 100644 --- a/src/Dodge/Placement/PlaceSpot/Block.hs +++ b/src/Dodge/Placement/PlaceSpot/Block.hs @@ -44,16 +44,16 @@ plBlock (p:ps) bl wl w = (,) blid $ w {- | Splits a line into many four cornered blocks. -} plLineBlock :: Wall -- ^ Base pane + -> Float -> Point2 -- ^ Start point (symmetric) -> Point2 -- ^ End point (symmetric) -> World -> (Int, World) -plLineBlock basePane a b gw = ( 0 +plLineBlock basePane blwidth a b gw = ( 0 , foldr insertWall (insertBlocks gw) listWalls ) where - blwidth = 10 - depth = 10 + depth = blwidth psOnLine = divideLineOddNumPoints blwidth a b halfBlockWidth = dist a b / fromIntegral (length psOnLine - 1) blockCenPs = snd $ evenOddSplit psOnLine diff --git a/src/Dodge/Room/Pillar.hs b/src/Dodge/Room/Pillar.hs index 880e87e0d..62558e503 100644 --- a/src/Dodge/Room/Pillar.hs +++ b/src/Dodge/Room/Pillar.hs @@ -30,7 +30,7 @@ blockPillar w' h' = ps0jPushPS (aline tl tr) tr = V2 w h br = V2 w (-h) bl = V2 (-w) (-h) - aline = PutLineBlock baseBlockPane + aline = PutLineBlock baseBlockPane 9 smallPillar :: PSType smallPillar = PutBlock defaultBlock baseBlockPane $ reverse $ square 5 @@ -39,9 +39,9 @@ crossPillar :: Float -> Float -> Placement crossPillar w' h' = ps0jPushPS (aline (V2 (-w) 0) (V2 w 0)) $ sps0 (aline (V2 0 (-h)) (V2 0 h)) where - w = w' - 10 - h = h' - 10 - aline = PutLineBlock baseBlockPane + w = w' - 9 + h = h' - 9 + aline = PutLineBlock baseBlockPane 9 roomPillarsSquare :: RandomGen g => State g Room roomPillarsSquare = do