Remove force fields, cleanup
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
module Dodge.Particle.Bullet.Spawn
|
||||
where
|
||||
( aGenBulAt
|
||||
, aDelayedBulAt
|
||||
, aCurveBulAt
|
||||
) where
|
||||
import Dodge.Data
|
||||
import Dodge.Particle.Bullet.Draw
|
||||
import Dodge.Particle.Bullet.Update
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
{-
|
||||
Bullet update.
|
||||
-}
|
||||
{- Bullet update. -}
|
||||
module Dodge.Particle.Bullet.Update
|
||||
where
|
||||
( mvGenBullet
|
||||
) where
|
||||
import Dodge.Data
|
||||
--import Dodge.Base
|
||||
import Dodge.WorldEvent.ThingsHit
|
||||
@@ -10,20 +9,16 @@ import Dodge.WorldEvent.ThingsHit
|
||||
import Geometry
|
||||
|
||||
import Control.Lens
|
||||
--import Data.Maybe
|
||||
--import Data.List
|
||||
--import Data.Bifunctor
|
||||
--import qualified Data.IntMap.Strict as IM
|
||||
|
||||
{-
|
||||
Update for a generic bullet.
|
||||
-}
|
||||
mvGenBullet :: World -> Particle -> (World, Maybe Particle)
|
||||
mvGenBullet w bt
|
||||
| t <= 0 = (w, Nothing)
|
||||
| t < 4 = (w, Just $ set btPassThrough' Nothing
|
||||
$ set btTrail' (p:p:ps)
|
||||
$ set btTimer' (t-1) bt
|
||||
| t < 4 = (w, Just $ bt
|
||||
& btPassThrough' .~ Nothing
|
||||
& btTrail' .~ (p:p:ps)
|
||||
& btTimer' -~ 1
|
||||
)
|
||||
| otherwise = hiteff bt (thingsHitExceptCr mcr p (p +.+ vel) w) w
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user