about summary refs log tree commit diff
path: root/src/Xanthous/Generators/LevelContents.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Xanthous/Generators/LevelContents.hs')
-rw-r--r--src/Xanthous/Generators/LevelContents.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Xanthous/Generators/LevelContents.hs b/src/Xanthous/Generators/LevelContents.hs
index 96d64a693774..748afa96da72 100644
--- a/src/Xanthous/Generators/LevelContents.hs
+++ b/src/Xanthous/Generators/LevelContents.hs
@@ -4,6 +4,7 @@ module Xanthous.Generators.LevelContents
   , randomItems
   , randomCreatures
   , randomDoors
+  , placeDownStaircase
   , tutorialMessage
   ) where
 --------------------------------------------------------------------------------
@@ -23,7 +24,7 @@ import           Xanthous.Entities.Item (Item)
 import qualified Xanthous.Entities.Creature as Creature
 import           Xanthous.Entities.Creature (Creature)
 import           Xanthous.Entities.Environment
-                 (GroundMessage(..), Door(..), unlockedDoor)
+                 (GroundMessage(..), Door(..), unlockedDoor, Staircase(..))
 import           Xanthous.Messages (message_)
 import           Xanthous.Util.Graphics (circle)
 --------------------------------------------------------------------------------
@@ -34,6 +35,11 @@ chooseCharacterPosition = randomPosition
 randomItems :: MonadRandom m => Cells -> m (EntityMap Item)
 randomItems = randomEntities Item.newWithType (0.0004, 0.001)
 
+placeDownStaircase :: MonadRandom m => Cells -> m (EntityMap Staircase)
+placeDownStaircase cells = do
+  pos <- randomPosition cells
+  pure $ _EntityMap # [(pos, DownStaircase)]
+
 randomDoors :: MonadRandom m => Cells -> m (EntityMap Door)
 randomDoors cells = do
   doorRatio <- getRandomR subsetRange