Simplify item placement during generation
This commit is contained in:
+11
-31
@@ -25,6 +25,8 @@ import Dodge.Room.Placement
|
||||
import Dodge.Room.Procedural
|
||||
import Dodge.Room.Corridor
|
||||
import Dodge.Room.Link
|
||||
import Dodge.Room.Branch
|
||||
import Dodge.Room.Door
|
||||
import Geometry
|
||||
import Picture
|
||||
|
||||
@@ -112,18 +114,6 @@ roomPadCut ps p = Room
|
||||
, _rmPS = []
|
||||
, _rmBound = []
|
||||
}
|
||||
door :: Room
|
||||
door = Room
|
||||
{ _rmPolys = [rectNSWE 40 0 0 40]
|
||||
, _rmLinks = lnks
|
||||
, _rmPath = [((20,35),(20,5))]
|
||||
-- door extends into side walls (for shadows as rendered 12/03)
|
||||
, _rmPS = [PS (0,20) 0 $ PutAutoDoor (0,0) (40,0)]
|
||||
, _rmBound = []
|
||||
}
|
||||
where lnks = [((20,35),0)
|
||||
,((20, 5),pi)
|
||||
]
|
||||
roomPillars :: Room
|
||||
roomPillars = over rmLinks init $ set rmPS plmnts $ roomRect 240 240 2 2
|
||||
where
|
||||
@@ -313,16 +303,16 @@ randomCorridorFrom xs = do
|
||||
|
||||
randFirstWeapon :: State StdGen PSType
|
||||
randFirstWeapon = do
|
||||
r <- state $ randomR (-pi,pi)
|
||||
-- r <- state $ randomR (-pi,pi)
|
||||
takeOne $ map PutFlIt
|
||||
[ defaultFlIt {_flItRot=r,_flIt = pistol}
|
||||
, defaultFlIt {_flItRot=r,_flIt = ltAutoGun}
|
||||
-- , defaultFlIt {_flItRot=r,_flIt = autoGun}
|
||||
, defaultFlIt {_flItRot=r,_flIt = spreadGun}
|
||||
, defaultFlIt {_flItRot=r,_flIt = multGun}
|
||||
, defaultFlIt {_flItRot=r,_flIt = launcher}
|
||||
-- , defaultFlIt {_flItRot=r,_flIt = lasGun}
|
||||
-- , defaultFlIt {_flItRot=r,_flIt = flamer}
|
||||
[ pistol
|
||||
, ltAutoGun
|
||||
-- , autoGun
|
||||
, spreadGun
|
||||
, multGun
|
||||
, launcher
|
||||
-- , lasGun
|
||||
-- , flamer
|
||||
]
|
||||
|
||||
--randC1 :: State StdGen PSType
|
||||
@@ -457,16 +447,6 @@ roomCCrits = do
|
||||
lamps = [PS (50,100) 0 putLamp , PS (175,100) 0 putLamp]
|
||||
return $ connectRoom $ over rmPS ((lamps ++) . (plmnts ++)) $ roomC 200 200
|
||||
|
||||
branchRectWith :: RandomGen g => State g (Tree (Either Room Room)) -> State g (Tree (Either Room Room))
|
||||
branchRectWith t = do
|
||||
x <- state $ randomR (100,200)
|
||||
y <- state $ randomR (100,200)
|
||||
b <- t
|
||||
root <- randomiseOutLinks $ roomRectAutoLinks x y
|
||||
return $ Node (Left root) [Node (Right door) [], fmap rToL $ treeTrunk [Left door] b]
|
||||
where rToL :: Either a a -> Either a a
|
||||
rToL (Right r) = Left r
|
||||
rToL (Left r) = Left r
|
||||
|
||||
slowDoorRoom :: RandomGen g => State g (Tree (Either Room Room))
|
||||
slowDoorRoom = do
|
||||
|
||||
Reference in New Issue
Block a user