38 lines
1.3 KiB
Haskell
38 lines
1.3 KiB
Haskell
{- | Rooms that can be successfully tackled without having any items. -}
|
|
module Dodge.Room.NoNeedWeapon
|
|
( centerVaultExplosiveExit
|
|
) where
|
|
import Dodge.Data
|
|
import Dodge.Creature
|
|
--import Dodge.Creature.Inanimate
|
|
import Dodge.LevelGen.Data
|
|
import Dodge.Room.Procedural
|
|
import Dodge.Room.Link
|
|
import Dodge.RandomHelp
|
|
--import Dodge.LevelGen.Data
|
|
import Geometry.Data
|
|
|
|
import Control.Lens
|
|
--import Control.Monad
|
|
import Control.Monad.State
|
|
import System.Random
|
|
{- |
|
|
A room designed to be /passable/ with no weapons.
|
|
Highlights an issue: when trying to place next door rooms, if the level generation fails it will try a different link.
|
|
So if there are multiple such, we cannot assume that a given link will be chosen.
|
|
To solve this, here we delete unwanted links.
|
|
-}
|
|
centerVaultExplosiveExit
|
|
:: RandomGen g
|
|
=> State g Room
|
|
centerVaultExplosiveExit = do
|
|
cr <- takeOne [miniGunCrit, autoCrit]
|
|
let extraPS =
|
|
[sPS (V2 0 110) 0 $ PutCrit explosiveBarrel
|
|
,sPS (V2 5 115) 0 $ PutCrit explosiveBarrel
|
|
,sPS (V2 0 120) 0 $ PutCrit explosiveBarrel
|
|
,sPS (V2 0 0) 0 $ PutCrit (cr & crState . crDropsOnDeath .~ DropAll)
|
|
]
|
|
r <- centerVaultRoom 120 120 50 <&> rmPmnts %~ (extraPS ++)
|
|
randomiseLinksBy shuffleTail r <&> rmLinks %~ take 2
|