Refactor, try to limit dependencies
This commit is contained in:
@@ -1,15 +1,10 @@
|
||||
module Dodge.Particle.Damage where
|
||||
import Dodge.Data
|
||||
|
||||
import Dodge.Data.Bullet
|
||||
import Geometry
|
||||
|
||||
--simpleDam :: DamageType -> Int -> Particle -> Point2 -> [Damage]
|
||||
--simpleDam dt amount bt p = [ Damage dt amount sp p ep NoDamageEffect ]
|
||||
-- where
|
||||
-- sp = _ptPos bt
|
||||
-- bulVel = _ptVel bt
|
||||
-- ep = sp +.+ bulVel
|
||||
simpleDam' :: DamageType -> Int -> Bullet -> Point2 -> [Damage]
|
||||
simpleDam' dt amount bt p = [ Damage dt amount sp p ep NoDamageEffect ]
|
||||
simpleDam' dt amount bt p = [Damage dt amount sp p ep NoDamageEffect]
|
||||
where
|
||||
sp = _buPos bt
|
||||
bulVel = _buVel bt
|
||||
@@ -17,12 +12,12 @@ simpleDam' dt amount bt p = [ Damage dt amount sp p ep NoDamageEffect ]
|
||||
|
||||
hvBulDams :: [Damage]
|
||||
hvBulDams =
|
||||
[ Damage PIERCING 25 0 0 0 NoDamageEffect
|
||||
, Damage PIERCING 25 0 0 0 NoDamageEffect
|
||||
, Damage PIERCING 25 0 0 0 NoDamageEffect
|
||||
, Damage PIERCING 25 0 0 0 NoDamageEffect
|
||||
, Damage PIERCING 25 0 0 0 NoDamageEffect
|
||||
, Damage PIERCING 25 0 0 0 NoDamageEffect
|
||||
, Damage TORQUEDAM 1 0 0 0 $ TorqueDamage 0.7
|
||||
, Damage PUSHDAM 1 0 0 0 $ PushBackDamage 3
|
||||
]
|
||||
[ Damage PIERCING 25 0 0 0 NoDamageEffect
|
||||
, Damage PIERCING 25 0 0 0 NoDamageEffect
|
||||
, Damage PIERCING 25 0 0 0 NoDamageEffect
|
||||
, Damage PIERCING 25 0 0 0 NoDamageEffect
|
||||
, Damage PIERCING 25 0 0 0 NoDamageEffect
|
||||
, Damage PIERCING 25 0 0 0 NoDamageEffect
|
||||
, Damage TORQUEDAM 1 0 0 0 $ TorqueDamage 0.7
|
||||
, Damage PUSHDAM 1 0 0 0 $ PushBackDamage 3
|
||||
]
|
||||
|
||||
@@ -1,54 +1,15 @@
|
||||
module Dodge.Particle.Draw where
|
||||
import Dodge.Data
|
||||
|
||||
import Dodge.Data.Laser
|
||||
import Picture
|
||||
|
||||
--drawParticle :: Particle -> Picture
|
||||
--drawParticle pt = case pt of
|
||||
-- ShockLine {} -> drawSonicWave pt
|
||||
--
|
||||
--drawShockwave :: Particle -> Picture
|
||||
--drawShockwave pt = setDepth 20
|
||||
-- . setLayer BloomLayer
|
||||
-- . uncurryV translate (_ptPos pt)
|
||||
-- . color (_ptColor pt)
|
||||
-- $ thickCircle rad thickness
|
||||
-- where
|
||||
-- r = _ptRad pt
|
||||
-- thickness = tFraction**2 * r
|
||||
-- rad = r - (3/4) * r * tFraction
|
||||
-- tFraction = fromIntegral (_ptTimer pt) / fromIntegral (_ptMaxTime pt)
|
||||
|
||||
--drawInverseShockwave :: Particle -> Picture
|
||||
--drawInverseShockwave pt
|
||||
-- = setLayer BloomLayer $ setDepth 20 $ uncurryV translate p
|
||||
-- $ color cyan $ thickCircle rad thickness
|
||||
-- where
|
||||
-- p = _ptPos pt
|
||||
-- r = _ptRad pt
|
||||
-- t = _ptTimer pt
|
||||
-- rad = r - 0.1 * r * fromIntegral (10 - t)
|
||||
-- thickness = fromIntegral (10 - t) **2 * rad / 40
|
||||
|
||||
--drawTeslaArc :: Particle -> Picture
|
||||
--drawTeslaArc pt = setLayer BloomNoZWrite $ pictures
|
||||
-- [ setDepth 20.5 $ color (brightX 2 1 $ _ptColor pt) $ thickLine 3 ps
|
||||
-- , setDepth 20 $ color (V4 0 0 0 0.5) $ thickLine 10 ps
|
||||
-- ]
|
||||
-- where
|
||||
-- ps = _ptPoints pt
|
||||
|
||||
drawTargetLaser :: Laser -> Picture
|
||||
drawTargetLaser pt = setLayer BloomNoZWrite $ pictures
|
||||
[ setDepth 19 . color (brightX 0 0.5 col) $ thickLine 5 (sp:ps)
|
||||
, setDepth 19.5 . color (brightX 5 1 col) $ thickLine 1 (sp:ps)
|
||||
]
|
||||
drawTargetLaser pt =
|
||||
setLayer BloomNoZWrite $
|
||||
pictures
|
||||
[ setDepth 19 . color (brightX 0 0.5 col) $ thickLine 5 (sp : ps)
|
||||
, setDepth 19.5 . color (brightX 5 1 col) $ thickLine 1 (sp : ps)
|
||||
]
|
||||
where
|
||||
col = _laColor pt
|
||||
(sp:ps) = _laPoints pt
|
||||
|
||||
--drawSonicWave :: Particle -> Picture
|
||||
--drawSonicWave pt = foldMap (color (_ptColor pt) . setLayer BloomNoZWrite . setDepth 20
|
||||
-- . lineThick 20
|
||||
-- . map fst)
|
||||
-- $ _ptPointDirs pt
|
||||
|
||||
(sp : ps) = _laPoints pt
|
||||
|
||||
Reference in New Issue
Block a user