Refactor world events

This commit is contained in:
2022-07-22 14:30:53 +01:00
parent 7fdb70dd1c
commit 43e7d20b21
14 changed files with 95 additions and 40 deletions
+7 -5
View File
@@ -223,8 +223,8 @@ data World = World
, _randGen :: StdGen
, _modifications :: IM.IntMap Modification
, _yourID :: Int
, _worldEvents :: World -> World
, _delayedEvents :: [(Int,World -> World)]
, _worldEvents :: [WorldEffect]
, _delayedEvents :: [(Int,WorldEffect)]
, _pressPlates :: IM.IntMap PressPlate
, _buttons :: IM.IntMap Button
, _toPlaySounds :: M.Map SoundOrigin Sound
@@ -241,7 +241,7 @@ data World = World
, _tempLightSources :: [TempLightSource]
, _closeObjects :: [Either FloorItem Button]
, _rbOptions :: RightButtonOptions
, _seenLocations :: IM.IntMap (World -> Point2,String)
, _seenLocations :: IM.IntMap (WdP2,String)
, _selLocation :: Int
, _sideEffects :: Universe -> IO Universe
, _distortions :: [Distortion]
@@ -272,6 +272,7 @@ data WorldHammer
newtype GenParams = GenParams
{ _sensorCoding :: M.Map DamageType (PaletteColor,DecorationShape)
}
deriving (Eq,Ord,Show,Read)
data DecorationShape = PLUS | SQUARE | CIRCLE | THREELINES
deriving (Eq,Ord,Enum,Show,Read)
@@ -279,12 +280,13 @@ data TimeFlowStatus
= RewindingNow
| RewindingLastFrame
| NormalTimeFlow
deriving (Eq,Ord)
deriving (Eq,Ord,Show,Read)
data SaveSlot = QuicksaveSlot | LevelStartSlot
deriving (Eq,Ord)
deriving (Eq,Ord,Show,Read)
data OptionScreenFlag = NormalOptions | GameOverOptions
deriving (Eq,Ord,Show,Read)
data ScreenLayer
= OptionScreen
{ _scTitle :: Universe -> String