Remove force fields, cleanup

This commit is contained in:
2021-10-31 16:27:41 +00:00
parent 74a4267393
commit e3a8417f07
11 changed files with 46 additions and 105 deletions
+3 -7
View File
@@ -1,5 +1,5 @@
{- |
Effects of bullets upon impact with walls or creatures, and possibly force fields.
Effects of bullets upon impact with walls or creatures.
-}
module Dodge.Particle.Bullet.HitEffect
where
@@ -22,9 +22,6 @@ import Picture
import System.Random
import Control.Lens
import Control.Monad.State
--import Data.Maybe
--import qualified Data.IntMap.Strict as IM
--
-- | Basic bullet hit creature effect.
bulHitCr :: Particle -> Point2 -> Creature -> World -> World
bulHitCr bt p cr w
@@ -187,14 +184,13 @@ bulConWall'
bulConWall' _ p wl = damageBlocksBy 1 wl .
over worldEvents ( makeShockwaveAt [] p 15 4 1 white . )
hvBulHitWall'
hvBulHitWall
:: Particle
-> Point2 -- ^ Impact point
-> Wall
-> World
-> World
hvBulHitWall' bt p x w = damageBlocksBy 5 x $ set randGen g $ foldr ($) w (sparks pOut sv)
hvBulHitWall bt p x w = damageBlocksBy 5 x $ set randGen g $ foldr ($) w (sparks pOut sv)
where
sp = head $ _btTrail' bt
pOut = p +.+ safeNormalizeV (sp -.- p)