Add (cosmetic, indestructible) pipe connecting storage/distributer
This commit is contained in:
@@ -33,7 +33,6 @@ data Machine = Machine
|
|||||||
, _mcMaterial :: Material
|
, _mcMaterial :: Material
|
||||||
, _mcPos :: Point2
|
, _mcPos :: Point2
|
||||||
, _mcDir :: Float
|
, _mcDir :: Float
|
||||||
-- , _mcColor :: Color
|
|
||||||
, _mcHP :: Int
|
, _mcHP :: Int
|
||||||
, _mcDamage :: [Damage]
|
, _mcDamage :: [Damage]
|
||||||
, _mcType :: MachineType
|
, _mcType :: MachineType
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import Geometry
|
|||||||
import Quaternion
|
import Quaternion
|
||||||
|
|
||||||
verticalPipe :: Float -> Shape
|
verticalPipe :: Float -> Shape
|
||||||
verticalPipe = flip (upperBox Small Typical) (polyCirc 2 5)
|
verticalPipe = flip (upperCylinder Small Typical) (polyCirc 2 5)
|
||||||
|
|
||||||
horPipe :: Float -> Point2 -> Point2 -> Shape
|
horPipe :: Float -> Point2 -> Point2 -> Shape
|
||||||
horPipe h x y = translateSH (x `v2z` h) $ overPosSH (rotateToZ (V3 xd yd 0)) $ verticalPipe (dist x y)
|
horPipe h x y = translateSH (x `v2z` h) $ overPosSH (rotateToZ (V3 xd yd 0)) $ verticalPipe (dist x y)
|
||||||
|
|||||||
+19
-1
@@ -13,6 +13,10 @@ module Dodge.Room.Room (
|
|||||||
distributerRoom,
|
distributerRoom,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
import Linear
|
||||||
|
import Color
|
||||||
|
import Dodge.Placement.Instance.Pipe
|
||||||
|
import ShapePicture
|
||||||
import Shape
|
import Shape
|
||||||
import Dodge.Default
|
import Dodge.Default
|
||||||
import Dodge.Data.AmmoType
|
import Dodge.Data.AmmoType
|
||||||
@@ -411,6 +415,7 @@ critsRoom i =
|
|||||||
distributerRoom :: AmmoType -> Int -> State LayoutVars Room
|
distributerRoom :: AmmoType -> Int -> State LayoutVars Room
|
||||||
distributerRoom atype aamount = do
|
distributerRoom atype aamount = do
|
||||||
i <- nextLayoutInt
|
i <- nextLayoutInt
|
||||||
|
i1 <- nextLayoutInt
|
||||||
w <- state $ randomR (100, 400)
|
w <- state $ randomR (100, 400)
|
||||||
h <- state $ randomR (200, 400)
|
h <- state $ randomR (200, 400)
|
||||||
r <- roomRectAutoLinks w h
|
r <- roomRectAutoLinks w h
|
||||||
@@ -425,8 +430,21 @@ distributerRoom atype aamount = do
|
|||||||
dst gw = let mj = gw ^? genPmnt . ix i . plMID . _Just
|
dst gw = let mj = gw ^? genPmnt . ix i . plMID . _Just
|
||||||
in sps (unusedOffPathAwayFromLink 50)
|
in sps (unusedOffPathAwayFromLink 50)
|
||||||
(PutMachine (reverse $ square 10) (mcdist mj) Nothing)
|
(PutMachine (reverse $ square 10) (mcdist mj) Nothing)
|
||||||
|
& plExternalID ?~ i1
|
||||||
|
thepipe gw =
|
||||||
|
let p1 = gw ^?! genPmnt . ix i . plSpot . psPos
|
||||||
|
p2 = gw ^?! genPmnt . ix i1 . plSpot . psPos
|
||||||
|
in sps (PS p1 0)
|
||||||
|
(PutForeground
|
||||||
|
(ForegroundShape 0 0
|
||||||
|
(noPic . colorSH orange $ horPipe 70 0 (p2 - p1)
|
||||||
|
<> translateSH (V3 0 0 30) (verticalPipe (70 - 30))
|
||||||
|
<> translateSH (0 & _xy .~p2 - p1) (verticalPipe 70)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
return $ r & rmPmnts .:~ store
|
return $ r & rmPmnts .:~ store
|
||||||
& rmInPmnt .:~ (0,dst)
|
& rmInPmnt <>~ [(0,dst),(1,thepipe)]
|
||||||
|
|
||||||
-- cor <- shuffleLinks corridor
|
-- cor <- shuffleLinks corridor
|
||||||
-- return $ tToBTree "corDoor" $ treePost [door,cor,cleatOnward door]
|
-- return $ tToBTree "corDoor" $ treePost [door,cor,cleatOnward door]
|
||||||
|
|||||||
Reference in New Issue
Block a user