Add various capabilities for generating graphs, fixes to lasgun
This commit is contained in:
+17
-10
@@ -4,6 +4,7 @@ import Dodge.Particle.Flame
|
||||
import Dodge.Particle.TeslaArc
|
||||
import Dodge.Item.Location
|
||||
import Dodge.WorldEvent.Damage
|
||||
--import Dodge.WorldEvent.ThingsHit
|
||||
import Dodge.WorldEvent.HelperParticle
|
||||
import Dodge.Item.Weapon.LaserPath
|
||||
import Geometry
|
||||
@@ -50,12 +51,13 @@ teslaBeamCombine (p,(a,b,bm),(x,y,_)) w
|
||||
|
||||
lasRayAt :: Color -> Int -> Float -> Point2 -> Float -> Particle
|
||||
lasRayAt col dam phasev pos dir = LaserParticle
|
||||
{ _ptDraw = const blank
|
||||
{ _ptDraw = drawLaser
|
||||
, _ptUpdate = mvLaser phasev pos dir
|
||||
, _ptRange = 800
|
||||
, _ptDamage = dam
|
||||
, _ptPhaseV = phasev
|
||||
, _ptColor = col
|
||||
, _ptPoints = []
|
||||
}
|
||||
mvLaser :: Float -- ^ Phase velocity, controls deflection through windows
|
||||
-> Point2
|
||||
@@ -63,19 +65,24 @@ mvLaser :: Float -- ^ Phase velocity, controls deflection through windows
|
||||
-> World
|
||||
-> Particle
|
||||
-> (World, Maybe Particle)
|
||||
mvLaser phasev pos dir w pt
|
||||
= ( damThingHitWith (\p1 p2 p3 -> Damage LASERING dam p1 p2 p3 NoDamageEffect) pos xp thHit w
|
||||
, Just pt {_ptDraw = const pic ,_ptUpdate = ptSimpleTime 0 }
|
||||
mvLaser phasev sp dir w pt
|
||||
= ( damThingHitWith (\p1 p2 p3 -> Damage LASERING dam p1 p2 p3 NoDamageEffect) sp xp thHit w
|
||||
, Just pt {_ptPoints = sp:ps ,_ptUpdate = ptSimpleTime 0 }
|
||||
)
|
||||
where
|
||||
dam = _ptDamage pt
|
||||
xp = pos +.+ 800 *.* unitVectorAtAngle dir
|
||||
(thHit, ps) = reflectLaserAlong phasev [] pos xp w
|
||||
xp = sp +.+ 800 *.* unitVectorAtAngle dir
|
||||
-- thHit' = thingHit sp xp w
|
||||
(thHit, ps) = reflectLaserAlong phasev sp xp w
|
||||
|
||||
drawLaser :: Particle -> Picture
|
||||
drawLaser pt = setLayer BloomNoZWrite $ pictures
|
||||
[ setDepth 19 . color (brightX 0 0.5 col) $ thickLine 20 ps
|
||||
, setDepth 19.5 . color (brightX 10 1 col) $ thickLine 3 ps
|
||||
]
|
||||
where
|
||||
col = _ptColor pt
|
||||
pic = setLayer BloomNoZWrite $ pictures
|
||||
[ setDepth 19 . color (brightX 0 0.5 col) $ thickLine 20 (pos:ps)
|
||||
, setDepth 19.5 . color (brightX 10 1 col) $ thickLine 3 (pos:ps)
|
||||
]
|
||||
ps = _ptPoints pt
|
||||
|
||||
shootTeslaArc' :: ItemParams -> Point2 -> Float -> World -> (World,ItemParams)
|
||||
shootTeslaArc' ip pos dir w =
|
||||
|
||||
Reference in New Issue
Block a user