Implement basic laser sensor

This commit is contained in:
2021-11-01 18:20:45 +00:00
parent 0dcb1d2c07
commit 82de39657b
7 changed files with 59 additions and 21 deletions
+4 -6
View File
@@ -120,12 +120,10 @@ bulIncCr' bt p cr w
incFlamelets = over worldEvents $ (.) (makeFlameletTimed p 20 v Nothing 3 20)
{- | Creates a shockwave when hitting a creature. -}
bulConCr :: Particle -> Point2 -> Creature -> World -> World
bulConCr bt p cr w
= over (creatures . ix cid . crState . crDamage)
( Blunt 10 sp p ep : )
$ bulletHitSound p
$ (worldEvents %~ (makeShockwaveAt [] p 15 4 1 white . ))
w
bulConCr bt p cr
= over (creatures . ix cid . crState . crDamage) (Blunt 10 sp p ep :)
. over worldEvents (makeShockwaveAt [] p 15 4 1 white .)
. bulletHitSound p
where
cid = _crID cr
sp = head $ _btTrail' bt