Refactoring, add screen when generating level
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
{- | 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.Room.Data
|
||||
import Dodge.Room.Procedural
|
||||
import Dodge.Room.Link
|
||||
import Dodge.RandomHelp
|
||||
import Dodge.LevelGen.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
|
||||
=> Int -- ^ Door id
|
||||
-> State g Room
|
||||
centerVaultExplosiveExit drID = do
|
||||
cr <- takeOne [miniGunCrit, autoCrit]
|
||||
let extraPS =
|
||||
[PS (0,175) 0 $ PutCrit explosiveBarrel
|
||||
,PS (5,195) 0 $ PutCrit explosiveBarrel
|
||||
,PS (0,200) 0 $ PutCrit explosiveBarrel
|
||||
,PS (-4,195) 0 $ PutCrit explosiveBarrel
|
||||
,PS (0,0) 0 $ PutCrit (cr & crState . crDropsOnDeath .~ DropAll)
|
||||
]
|
||||
r <- centerVaultRoom drID 200 200 50 <&> rmPS %~ (extraPS ++)
|
||||
randomiseLinksBy shuffleTail r <&> rmLinks %~ take 2
|
||||
Reference in New Issue
Block a user