This commit is contained in:
2022-07-24 00:23:03 +01:00
parent 5b9e9968f3
commit 5a2f529182
6 changed files with 12 additions and 37 deletions
+1 -11
View File
@@ -380,17 +380,7 @@ data WorldBeams = WorldBeams
{- Objects without ids.
Update themselves, perhaps with side effects. -}
data Particle
= PtInvShockwave
{ _ptUpdate :: World -> Particle -> (World, Maybe Particle)
, _ptColor :: Color
, _ptPos :: Point2
, _ptRad :: Float
, _ptDam :: Int
, _ptPush :: Float
, _ptMaxTime :: Int
, _ptTimer :: Int
}
| ShockLine
= ShockLine
{ _ptUpdate :: World -> Particle -> (World, Maybe Particle)
, _ptPointDirs :: [[(Point2,Float)]]
, _ptTimer :: Int
+1 -2
View File
@@ -27,7 +27,6 @@ import Dodge.SoundLogic
import Dodge.Item.Weapon.LaserPath
--import Dodge.Item.Attachment.Data
import Dodge.Creature.Test
import Dodge.WorldEvent.HelperParticle
import Picture
import Geometry.Vector
import LensHelp
@@ -138,7 +137,7 @@ targetLaserUpdate _ cr w t
& tgActive .~ False
)
where
(mp, ps) = reflectLaserAlong 0.2 sp ep w
(mp, _) = reflectLaserAlong 0.2 sp ep w
sp = _crPos cr +.+ 15 *.* unitVectorAtAngle (_crDir cr)
ep = sp +.+ 5000 *.* normalizeV (mouseWorldPos w -.- sp)
addLaserPic = lasers .:~ LaserStart
+10 -11
View File
@@ -1,6 +1,5 @@
module Dodge.Particle.Draw where
import Dodge.Data
import Geometry
import Picture
drawParticle :: Particle -> Picture
@@ -19,16 +18,16 @@ drawParticle pt = case pt of
-- 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
--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
-7
View File
@@ -11,7 +11,6 @@ flicker : potentially long, moving, abrupt changes in alpha
module Dodge.WorldEvent.Flash
( explosionFlashAt
, muzFlareAt
, ptFlicker
, flareCircleAt
) where
import Dodge.Data
@@ -48,9 +47,3 @@ flareCircleAt col alphax tranv = flares .:~ CircFlare
explosionFlashAt :: Point2 -> World -> World
explosionFlashAt p = tempLightSources .:~ tlsTimeRadFunPos 20 150 (TLSFade 1 10) (addZ 20 p)
ptFlicker :: Particle -> World -> World
ptFlicker pt
| _ptTimer pt `mod` 7 == 0 = tempLightSources
.:~ tlsTimeRadColPos 1 70 (0.5 *.*.* xyzV4 (_ptColor pt)) (addZ 10 $ _ptPos pt)
| otherwise = id
-5
View File
@@ -2,16 +2,11 @@ module Dodge.WorldEvent.Shockwave
( makeShockwaveAt
, inverseShockwaveAt
) where
import Dodge.Zoning.Wall
import Dodge.Data
import Dodge.Wall.Damage
import Dodge.Base
import Geometry
import Picture
import LensHelp
import Data.Foldable
import qualified IntMapHelp as IM
-- currently very effective against walls
makeShockwaveAt
:: [Int] -- ^ IDs of invulnerable creatures.
-1
View File
@@ -6,7 +6,6 @@ module Dodge.WorldEvent.SpawnParticle
, randParticleAt
) where
import Dodge.Data
import Dodge.WorldEvent.Shockwave
import RandomHelp
import Picture
import Geometry