Cleanup damages further
This commit is contained in:
@@ -8,6 +8,8 @@ import Geometry
|
||||
import Color
|
||||
import LensHelp
|
||||
|
||||
import Control.Monad.State
|
||||
|
||||
defaultWallDamage :: Damage -> Wall -> World -> World
|
||||
defaultWallDamage dm wl = wallDamageEffect dm wl . case _dmType dm of
|
||||
Lasering -> colSpark 8 lSparkCol outTo (reflDirWall sp p wl)
|
||||
@@ -31,8 +33,8 @@ defaultWallDamage dm wl = wallDamageEffect dm wl . case _dmType dm of
|
||||
lSparkCol = V4 20 (-5) 0 1
|
||||
|
||||
wallDamageEffect :: Damage -> Wall -> World -> World
|
||||
wallDamageEffect dm wl = case _dmEffect dm of
|
||||
BounceBullet bt -> instantParticles .:~ thebouncer
|
||||
wallDamageEffect dm wl w = case _dmEffect dm of
|
||||
BounceBullet bt -> w & instantParticles .:~ thebouncer
|
||||
where
|
||||
reflectVel = reflVelWall wl (_ptVel bt)
|
||||
thebouncer = (aBulAt Nothing id (Just (_ptColor bt)) Nothing pOut reflectVel (_btDrag bt) (_ptHitEff bt) (_ptWidth bt)
|
||||
@@ -40,4 +42,8 @@ wallDamageEffect dm wl = case _dmEffect dm of
|
||||
pOut = p +.+ squashNormalizeV (sp -.- p)
|
||||
p = _dmAt dm
|
||||
sp = _dmFrom dm
|
||||
_ -> id
|
||||
DamageSpawn f -> w & instantParticles .:~ thepart
|
||||
& randGen .~ g
|
||||
where
|
||||
(thepart,g) = runState (f (Right wl) dm) $ _randGen w
|
||||
_ -> w
|
||||
|
||||
Reference in New Issue
Block a user