Move bullet bouncing into separate datatype field

This commit is contained in:
2022-07-17 20:23:50 +01:00
parent b860de70a7
commit 6c6fe43bc0
9 changed files with 98 additions and 67 deletions
-10
View File
@@ -1,6 +1,5 @@
module Dodge.Wall.DamageEffect where
import Dodge.Data
import Dodge.Bullet
import Dodge.Spark
import Dodge.Base.Wall
import Dodge.Wall.Dust
@@ -132,15 +131,6 @@ dirtWallDamage dm wl = case _dmType dm of
wallDamageEffect :: Damage -> Wall -> World -> World
wallDamageEffect dm wl w = case _dmEffect dm of
BounceBullet bt -> w & instantBullets .:~ thebouncer
where
reflectVel = reflVelWall wl (_buVel bt)
thebouncer = aBulAt Nothing --id
pOut reflectVel (_buDrag bt) (_buHitEff bt) (_buWidth bt) BasicBulletTrajectory
& buTimer .~ _buTimer bt - 1
pOut = p +.+ squashNormalizeV (sp -.- p)
p = _dmAt dm
sp = _dmFrom dm
DamageSpawn f -> w & instantParticles .:~ thepart
& randGen .~ g
where