diff options
author | Griffin Smith <root@gws.fyi> | 2020-01-05T17·55-0500 |
---|---|---|
committer | Griffin Smith <root@gws.fyi> | 2020-01-05T17·55-0500 |
commit | 0f79a06733c30ddca4bc0746ddc99e1626775fff (patch) | |
tree | 7f9bffb1740a531ac11c3130020bb86723bde5a8 /src/Xanthous/Game | |
parent | 6b0bab0e85266ce66836c4584f8cc83b307a3af5 (diff) |
Add staircases, and moving between levels
Currently we just pick randomly between the cave and dungeon level generators. There's a lot of bugs here, but it's *sorta* working, so I'm leaving it as is.
Diffstat (limited to 'src/Xanthous/Game')
-rw-r--r-- | src/Xanthous/Game/Arbitrary.hs | 10 | ||||
-rw-r--r-- | src/Xanthous/Game/State.hs | 3 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/Xanthous/Game/Arbitrary.hs b/src/Xanthous/Game/Arbitrary.hs index 3be711099c23..d6f4784d55ff 100644 --- a/src/Xanthous/Game/Arbitrary.hs +++ b/src/Xanthous/Game/Arbitrary.hs @@ -5,7 +5,7 @@ -------------------------------------------------------------------------------- module Xanthous.Game.Arbitrary where -------------------------------------------------------------------------------- -import Xanthous.Prelude hiding (levels, foldMap) +import Xanthous.Prelude hiding (foldMap) -------------------------------------------------------------------------------- import Test.QuickCheck import System.Random @@ -23,13 +23,13 @@ instance Arbitrary GameState where chr <- arbitrary @Character charPos <- arbitrary _messageHistory <- arbitrary - levels <- arbitrary + levs <- arbitrary let (_characterEntityID, currentLevel) = EntityMap.insertAtReturningID charPos (SomeEntity chr) - $ extract levels - _levels = levels & current .~ currentLevel + $ extract levs + _levels = levs & current .~ currentLevel _revealedPositions <- fmap setFromList . sublistOf - $ foldMap EntityMap.positions levels + $ foldMap EntityMap.positions levs _randomGen <- mkStdGen <$> arbitrary let _promptState = NoPrompt -- TODO _activePanel <- arbitrary diff --git a/src/Xanthous/Game/State.hs b/src/Xanthous/Game/State.hs index 7587618c968b..36a2c2c174e5 100644 --- a/src/Xanthous/Game/State.hs +++ b/src/Xanthous/Game/State.hs @@ -7,6 +7,7 @@ module Xanthous.Game.State ( GameState(..) , entities + , levels , revealedPositions , messageHistory , randomGen @@ -58,7 +59,7 @@ module Xanthous.Game.State , allRevealed ) where -------------------------------------------------------------------------------- -import Xanthous.Prelude hiding (levels) +import Xanthous.Prelude -------------------------------------------------------------------------------- import Data.List.NonEmpty ( NonEmpty((:|))) import qualified Data.List.NonEmpty as NonEmpty |