Rename (indexed) particles to projectiles
This commit is contained in:
+51
-71
@@ -35,57 +35,53 @@ import qualified Data.DList as DL
|
||||
|
||||
--}}}
|
||||
-- datatypes {{{
|
||||
|
||||
|
||||
|
||||
|
||||
data World = World
|
||||
{ _keys :: !(S.Set Keycode)
|
||||
, _mouseButtons :: !(S.Set MouseButton)
|
||||
, _cameraPos :: !Point2
|
||||
, _cameraAimTime :: Int
|
||||
, _cameraRot :: !Float
|
||||
, _cameraZoom :: !Float
|
||||
, _cameraCenter :: !Point2
|
||||
, _creatures :: IM.IntMap Creature
|
||||
, _creaturesZone :: IM.IntMap (IM.IntMap (IM.IntMap Creature))
|
||||
, _itemPositions :: IM.IntMap ItemPos
|
||||
, _clouds :: IM.IntMap Cloud
|
||||
, _cloudsZone :: IM.IntMap (IM.IntMap (IM.IntMap Cloud))
|
||||
, _particles :: IM.IntMap Particle
|
||||
, _particles' :: ![Particle']
|
||||
, _smoke :: [Smoke]
|
||||
, _walls :: !(IM.IntMap Wall)
|
||||
, _wallsZone :: (IM.IntMap (IM.IntMap (IM.IntMap Wall)))
|
||||
, _forceFields :: IM.IntMap ForceField
|
||||
, _floorItems :: IM.IntMap FloorItem
|
||||
, _randGen :: StdGen
|
||||
, _mousePos :: !(Float,Float)
|
||||
, _testString :: String
|
||||
, _yourID :: !Int
|
||||
, _worldEvents :: !(World -> World)
|
||||
, _pressPlates :: IM.IntMap PressPlate
|
||||
, _buttons :: IM.IntMap Button
|
||||
, _soundQueue :: [Int]
|
||||
, _sounds :: M.Map SoundOrigin Sound
|
||||
, _decorations :: IM.IntMap Drawing
|
||||
, _corpses :: IM.IntMap (IM.IntMap [Corpse])
|
||||
, _lbClickMousePos :: (Float,Float)
|
||||
, _lbRotation :: Float
|
||||
, _pathGraph :: ~(Gr Point2 Float)
|
||||
, _pathGraph' :: ~[(Point2,Point2)]
|
||||
, _pathPoints :: ~(IM.IntMap (IM.IntMap [(Int,Point2)]))
|
||||
, _pathInc :: ~(M.Map Point2 [Point2])
|
||||
, _storedLevel :: Maybe World
|
||||
, _menuState :: MenuState
|
||||
, _worldState :: M.Map WorldState Bool
|
||||
, _windowX :: Float
|
||||
, _windowY :: Float
|
||||
, _mapDisplay :: (Bool, Float)
|
||||
, _lightSources :: !(IM.IntMap LightSource)
|
||||
{ _keys :: !(S.Set Keycode)
|
||||
, _mouseButtons :: !(S.Set MouseButton)
|
||||
, _cameraPos :: !Point2
|
||||
, _cameraAimTime :: Int
|
||||
, _cameraRot :: !Float
|
||||
, _cameraZoom :: !Float
|
||||
, _cameraCenter :: !Point2
|
||||
, _creatures :: IM.IntMap Creature
|
||||
, _creaturesZone :: IM.IntMap (IM.IntMap (IM.IntMap Creature))
|
||||
, _itemPositions :: IM.IntMap ItemPos
|
||||
, _clouds :: IM.IntMap Cloud
|
||||
, _cloudsZone :: IM.IntMap (IM.IntMap (IM.IntMap Cloud))
|
||||
, _projectiles :: IM.IntMap Projectile
|
||||
, _particles' :: ![Particle']
|
||||
, _smoke :: [Smoke]
|
||||
, _walls :: !(IM.IntMap Wall)
|
||||
, _wallsZone :: (IM.IntMap (IM.IntMap (IM.IntMap Wall)))
|
||||
, _forceFields :: IM.IntMap ForceField
|
||||
, _floorItems :: IM.IntMap FloorItem
|
||||
, _randGen :: StdGen
|
||||
, _mousePos :: !(Float,Float)
|
||||
, _testString :: String
|
||||
, _yourID :: !Int
|
||||
, _worldEvents :: !(World -> World)
|
||||
, _pressPlates :: IM.IntMap PressPlate
|
||||
, _buttons :: IM.IntMap Button
|
||||
, _soundQueue :: [Int]
|
||||
, _sounds :: M.Map SoundOrigin Sound
|
||||
, _decorations :: IM.IntMap Drawing
|
||||
, _corpses :: IM.IntMap (IM.IntMap [Corpse])
|
||||
, _lbClickMousePos :: (Float,Float)
|
||||
, _lbRotation :: Float
|
||||
, _pathGraph :: ~(Gr Point2 Float)
|
||||
, _pathGraph' :: ~[(Point2,Point2)]
|
||||
, _pathPoints :: ~(IM.IntMap (IM.IntMap [(Int,Point2)]))
|
||||
, _pathInc :: ~(M.Map Point2 [Point2])
|
||||
, _storedLevel :: Maybe World
|
||||
, _menuState :: MenuState
|
||||
, _worldState :: M.Map WorldState Bool
|
||||
, _windowX :: Float
|
||||
, _windowY :: Float
|
||||
, _mapDisplay :: (Bool, Float)
|
||||
, _lightSources :: !(IM.IntMap LightSource)
|
||||
, _tempLightSources :: ![TempLightSource]
|
||||
, _closeActiveObjects :: [Either FloorItem Button]
|
||||
, _remap :: Keycode -> Keycode
|
||||
, _remap :: Keycode -> Keycode
|
||||
} --deriving (Show)
|
||||
|
||||
type Drawing = Picture
|
||||
@@ -435,9 +431,10 @@ data ItemIdentity
|
||||
deriving (Eq,Show,Ord,Enum)
|
||||
|
||||
data Particle' =
|
||||
Particle' { _ptPict' :: Drawing
|
||||
, _ptUpdate' :: World -> Particle' -> (World, Maybe Particle')
|
||||
}
|
||||
Particle'
|
||||
{ _ptPict' :: Drawing
|
||||
, _ptUpdate' :: World -> Particle' -> (World, Maybe Particle')
|
||||
}
|
||||
| Bul' { _ptPict' :: Drawing
|
||||
, _ptUpdate' :: World -> Particle' -> (World, Maybe Particle')
|
||||
, _btVel' :: Point2
|
||||
@@ -478,31 +475,14 @@ type HitEffect = Particle' -> [(Point2, (Either3 Creature Wall ForceField))] ->
|
||||
-> (World,Maybe Particle')
|
||||
|
||||
|
||||
data Particle =
|
||||
Particle { _ptPos :: Point2
|
||||
data Projectile =
|
||||
Projectile { _ptPos :: Point2
|
||||
, _ptStartPos :: Point2
|
||||
, _ptVel :: Point2
|
||||
, _ptPict :: Drawing
|
||||
, _ptID :: Int
|
||||
, _ptUpdate :: World -> World
|
||||
}
|
||||
| Bullet { _ptPos :: Point2
|
||||
, _ptVel :: Point2
|
||||
, _ptPict :: Drawing
|
||||
, _ptID :: Int
|
||||
, _ptUpdate :: World -> World
|
||||
, _btTrail :: [Point2]
|
||||
, _btPassThrough :: Maybe Int
|
||||
, _btColor :: Color
|
||||
, _btWidth :: Float
|
||||
}
|
||||
| Bullet'
|
||||
{ _ptPos :: Point2
|
||||
, _ptVel :: Point2
|
||||
, _ptPict :: Drawing
|
||||
, _ptID :: Int
|
||||
, _ptUpdate :: World -> World
|
||||
}
|
||||
|
||||
data DamageType = Piercing {_dmAmount :: Int , _dmFrom :: Point2 , _dmAt :: Point2 , _dmTo :: Point2 }
|
||||
| Blunt {_dmAmount :: Int , _dmFrom :: Point2 , _dmAt :: Point2 , _dmTo :: Point2 }
|
||||
@@ -656,7 +636,7 @@ makeLenses ''ItEffect
|
||||
makeLenses ''ItAttachment
|
||||
makeLenses ''ItZoom
|
||||
makeLenses ''FloorItem
|
||||
makeLenses ''Particle
|
||||
makeLenses ''Projectile
|
||||
makeLenses ''Particle'
|
||||
makeLenses ''Wall
|
||||
makeLenses ''Smoke
|
||||
|
||||
Reference in New Issue
Block a user