Start adding machines for storing/distributing items
This commit is contained in:
@@ -10,8 +10,12 @@ module Dodge.Room.Room (
|
||||
corDoor,
|
||||
weaponBehindPillar,
|
||||
critsRoom,
|
||||
distributerRoom,
|
||||
) where
|
||||
|
||||
import Shape
|
||||
import Dodge.Default
|
||||
import Dodge.Data.AmmoType
|
||||
import qualified Data.Set as S
|
||||
import Dodge.Cleat
|
||||
import Dodge.Creature
|
||||
@@ -404,5 +408,25 @@ critsRoom i =
|
||||
, return <$> glassSwitchBackCrits i
|
||||
]
|
||||
|
||||
distributerRoom :: AmmoType -> Int -> State LayoutVars Room
|
||||
distributerRoom atype aamount = do
|
||||
i <- nextLayoutInt
|
||||
w <- state $ randomR (100, 400)
|
||||
h <- state $ randomR (200, 400)
|
||||
r <- roomRectAutoLinks w h
|
||||
let mcstore = defaultMachine
|
||||
& mcMaterial .~ Metal
|
||||
& mcType .~ McStorage atype aamount
|
||||
mcdist mj = defaultMachine
|
||||
& mcMaterial .~ Metal
|
||||
& mcType .~ McDistributer mj
|
||||
store = sps (unusedOffPathAwayFromLink 50)
|
||||
(PutMachine (reverse $ polyCirc 4 20) mcstore Nothing) & plExternalID ?~ i
|
||||
dst gw = let mj = gw ^? genPmnt . ix i . plMID . _Just
|
||||
in sps (unusedOffPathAwayFromLink 50)
|
||||
(PutMachine (reverse $ square 10) (mcdist mj) Nothing)
|
||||
return $ r & rmPmnts .:~ store
|
||||
& rmInPmnt .:~ (0,dst)
|
||||
|
||||
-- cor <- shuffleLinks corridor
|
||||
-- return $ tToBTree "corDoor" $ treePost [door,cor,cleatOnward door]
|
||||
|
||||
Reference in New Issue
Block a user