Simplify item placement during generation
This commit is contained in:
@@ -1,6 +1,42 @@
|
||||
{-
|
||||
Rooms that contain valuable items, typically protected in some manner.
|
||||
Typically dead ends.
|
||||
-}
|
||||
module Dodge.Room.Treasure
|
||||
where
|
||||
import Geometry
|
||||
import Dodge.Room.Data
|
||||
import Dodge.LevelGen.Data
|
||||
|
||||
import Control.Monad.State
|
||||
import System.Random
|
||||
|
||||
{-
|
||||
A triangular room with loot at the top (with 'PutID' 2),
|
||||
creatures in the bottom two corners (with 'PutID' 0),
|
||||
and (single) entrance bottom middle.
|
||||
-}
|
||||
triLootRoom
|
||||
:: Float -- Width
|
||||
-> Float -- Height
|
||||
-> State g Room
|
||||
triLootRoom w h = pure $ Room
|
||||
{ _rmPolys = [poly]
|
||||
, _rmLinks = [((0,10),pi)]
|
||||
, _rmPath = doublePair ((0,10),(0,h/2))
|
||||
, _rmPS =
|
||||
[PS (15-w,15) 0 $ PutID 0
|
||||
,PS (w-15,15) 0 $ PutID 0
|
||||
,PS (0,h-15) 0 $ PutID 2
|
||||
]
|
||||
, _rmBound = poly
|
||||
}
|
||||
where
|
||||
poly =
|
||||
[ ( -w,30)
|
||||
, ( -w, 0)
|
||||
, ( w, 0)
|
||||
, ( w,30)
|
||||
, ( 20, h)
|
||||
, (-20, h)
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user