Refactor, try to limit dependencies
This commit is contained in:
@@ -1,36 +1,34 @@
|
||||
{- | 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 RandomHelp
|
||||
--import Dodge.LevelGen.Data
|
||||
import Geometry.Data
|
||||
-- | Rooms that can be successfully tackled without having any items.
|
||||
module Dodge.Room.NoNeedWeapon (
|
||||
centerVaultExplosiveExit,
|
||||
) where
|
||||
|
||||
import Control.Lens
|
||||
--import Control.Monad
|
||||
import Dodge.Creature
|
||||
import Dodge.Data.GenWorld
|
||||
import Dodge.LevelGen.Data
|
||||
import Dodge.Room.Procedural
|
||||
import Geometry.Data
|
||||
import RandomHelp
|
||||
|
||||
{- |
|
||||
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 ::
|
||||
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 . csDropsOnDeath .~ DropAll)
|
||||
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 . csDropsOnDeath .~ DropAll)
|
||||
]
|
||||
centerVaultRoom 120 120 50 <&> rmPmnts %~ (extraPS ++)
|
||||
--r <- centerVaultRoom 120 120 50 <&> rmPmnts %~ (extraPS ++)
|
||||
--randomiseLinksBy shuffleTail r <&> rmOutLinks %~ take 2
|
||||
|
||||
--r <- centerVaultRoom 120 120 50 <&> rmPmnts %~ (extraPS ++)
|
||||
--randomiseLinksBy shuffleTail r <&> rmOutLinks %~ take 2
|
||||
|
||||
Reference in New Issue
Block a user