Move flame into its own datatype
This commit is contained in:
+12
-21
@@ -10,6 +10,8 @@ circular imports are probably not a good idea.
|
||||
{-# LANGUAGE DerivingStrategies #-}
|
||||
module Dodge.Data
|
||||
( module Dodge.Data
|
||||
, module Dodge.Data.Flame
|
||||
, module Dodge.Data.Magnet
|
||||
, module Dodge.Data.Spark
|
||||
, module Dodge.Data.Bullet
|
||||
, module Dodge.Data.Door
|
||||
@@ -31,7 +33,7 @@ module Dodge.Data
|
||||
, module Dodge.Data.Sensor
|
||||
, module Dodge.Combine.Data
|
||||
, module Dodge.Distortion.Data
|
||||
, module Dodge.Data.DamageType
|
||||
, module Dodge.Data.Damage
|
||||
, module Dodge.Data.SoundOrigin
|
||||
, module Dodge.Creature.State.Data
|
||||
, module Dodge.Creature.Stance.Data
|
||||
@@ -48,6 +50,8 @@ module Dodge.Data
|
||||
, module Dodge.Data.RadarBlip
|
||||
, module Dodge.Data.PathGraph
|
||||
) where
|
||||
import Dodge.Data.Flame
|
||||
import Dodge.Data.Magnet
|
||||
import Dodge.Data.Spark
|
||||
import Dodge.Data.Bullet
|
||||
import Dodge.Data.Door
|
||||
@@ -80,7 +84,7 @@ import Dodge.Creature.Memory.Data
|
||||
import Dodge.Distortion.Data
|
||||
import Dodge.Equipment.Data
|
||||
import Dodge.Data.SoundOrigin
|
||||
import Dodge.Data.DamageType
|
||||
import Dodge.Data.Damage
|
||||
import Dodge.Combine.Data
|
||||
import Dodge.Config.Data
|
||||
import Dodge.Config.KeyConfig
|
||||
@@ -149,6 +153,7 @@ data World = World
|
||||
, _bullets :: [Bullet]
|
||||
, _instantParticles :: [Particle]
|
||||
, _particles :: [Particle]
|
||||
, _flames :: [Flame]
|
||||
, _sparks :: [Spark]
|
||||
, _radarBlips :: [RadarBlip]
|
||||
, _flares :: [Flare]
|
||||
@@ -232,13 +237,6 @@ data TimeFlowStatus
|
||||
data SaveSlot = QuicksaveSlot | LevelStartSlot
|
||||
deriving (Eq,Ord)
|
||||
|
||||
data Magnet = Magnet
|
||||
{ _mgID :: Int
|
||||
, _mgUpdate :: Magnet -> Maybe Magnet
|
||||
, _mgPos :: Point2
|
||||
, _mgField :: Magnet -> Bullet -> Bullet
|
||||
}
|
||||
|
||||
data OptionScreenFlag = NormalOptions | GameOverOptions
|
||||
data ScreenLayer
|
||||
= OptionScreen
|
||||
@@ -558,17 +556,6 @@ data Particle
|
||||
, _ptPoints :: [Point2]
|
||||
, _ptColor :: Color
|
||||
}
|
||||
| PtFlame
|
||||
{ _ptUpdate :: World -> Particle -> (World, Maybe Particle)
|
||||
, _ptVel :: Point2
|
||||
, _ptColor :: Color
|
||||
, _ptPos :: Point2
|
||||
, _ptWidth :: Float
|
||||
, _ptTimer :: Int
|
||||
, _ptHitEff :: HitEffect
|
||||
, _ptZ :: Float
|
||||
, _ptOriginalVel :: Point2
|
||||
}
|
||||
| PtIncBall
|
||||
{ _ptUpdate :: World -> Particle -> (World, Maybe Particle)
|
||||
, _ptVel :: Point2
|
||||
@@ -621,6 +608,10 @@ type HitEffect = Particle
|
||||
-> Stream (Of (Point2, Either Creature Wall)) Identity ()
|
||||
-> World
|
||||
-> (World,Maybe Particle)
|
||||
type HitEffect' = Flame
|
||||
-> Stream (Of (Point2, Either Creature Wall)) Identity ()
|
||||
-> World
|
||||
-> (World,Maybe Flame)
|
||||
|
||||
data AmmoType
|
||||
= ProjectileAmmo
|
||||
@@ -1355,7 +1346,6 @@ makeLenses ''MachineType
|
||||
makeLenses ''Universe
|
||||
makeLenses ''ItemParams
|
||||
makeLenses ''ItemTweaks
|
||||
makeLenses ''Magnet
|
||||
makeLenses ''Gust
|
||||
makeLenses ''GunBarrels
|
||||
makeLenses ''Targeting
|
||||
@@ -1381,5 +1371,6 @@ makeLenses ''PSType
|
||||
makeLenses ''PlacementSpot
|
||||
makeLenses ''Placement
|
||||
|
||||
|
||||
crSel :: Creature -> Int
|
||||
crSel = _iselPos . _crInvSel
|
||||
|
||||
Reference in New Issue
Block a user