This commit is contained in:
2021-10-19 15:13:41 +01:00
parent 1f8b4b8565
commit 982c8d81e1
12 changed files with 22 additions and 62 deletions
+11 -7
View File
@@ -15,7 +15,6 @@ import Dodge.Creature.Perception.Data
import Dodge.Creature.Memory.Data
import Dodge.Data.SoundOrigin
import Dodge.Data.DamageType
import Dodge.Zone.Data
import Dodge.Config.Data
import Dodge.Config.KeyConfig
import Dodge.Item.Attachment.Data
@@ -57,7 +56,7 @@ data World = World
, _props :: IM.IntMap Prop
, _particles :: ![Particle]
, _walls :: !(IM.IntMap Wall)
, _doors :: IM.IntMap Door'
, _doors :: IM.IntMap Door
, _wallsZone :: Zone (IM.IntMap Wall)
, _forceFields :: IM.IntMap ForceField
, _floorItems :: IM.IntMap FloorItem
@@ -80,7 +79,7 @@ data World = World
, _pathPoints :: ~(IM.IntMap (IM.IntMap [(Int,Point2)]))
, _savedWorlds :: M.Map SaveSlot World
, _menuLayers :: [ScreenLayer]
, _worldTriggers :: S.Set WorldTrigger
, _worldFlags :: S.Set WorldFlag
, _carteDisplay :: !Bool
, _carteCenter :: !Point2
, _carteZoom :: !Float
@@ -236,7 +235,7 @@ data CrMvType
, _mvTurnJit :: Float
, _mvAimSpeed :: Float -> Float
}
data WorldTrigger
data WorldFlag
= ResetLevel Int
| GameOver
deriving (Eq,Ord)
@@ -536,12 +535,12 @@ data Prop
, _pjTimer :: Int
}
data Either3 a b c = E3x1 a | E3x2 b | E3x3 c
data Door' = Door'
data Door = Door
{ _drID :: Int
, _drWallIDs :: [Int]
, _drStatus :: DoorStatus
, _drTrigger :: World -> Bool
, _drMech :: Door' -> World -> World
, _drMech :: Door -> World -> World
}
data DoorStatus = DoorOpen | DoorClosed | DoorHalfway | DoorInt Int
deriving (Eq, Ord, Show)
@@ -736,6 +735,10 @@ data Goal
| Kill Int
| SentinelAt Point2 Float
newtype Zone a = Zone
{ _znObjects :: IM.IntMap (IM.IntMap a)
}
makeLenses ''World
makeLenses ''Cloud
makeLenses ''Creature
@@ -761,7 +764,8 @@ makeLenses ''Action
makeLenses ''CrGroupParams
makeLenses ''CrMvType
makeLenses ''Intention
makeLenses ''Door'
makeLenses ''Door
makeLenses ''Zone
numColor :: Int -> Color
numColor 0 = toV4 (1,0,0,1)
numColor 1 = toV4 (0,1,0,1)