Continue tweaking sounds
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
module Dodge.Material.Damage (damageMaterial) where
|
||||
module Dodge.Material.Damage (damMatSideEffect) where
|
||||
|
||||
import Color
|
||||
import Control.Lens
|
||||
@@ -11,8 +11,8 @@ import RandomHelp
|
||||
|
||||
type ECW = Either Creature Wall
|
||||
|
||||
damageMaterial :: Damage -> Material -> ECW -> World -> World
|
||||
damageMaterial dm mt = case mt of
|
||||
damMatSideEffect :: Damage -> Material -> ECW -> World -> World
|
||||
damMatSideEffect dm mt = case mt of
|
||||
Stone -> damageStone dm
|
||||
Metal -> damageMetal dm
|
||||
Flesh -> damageFlesh dm
|
||||
@@ -56,10 +56,10 @@ damageStone dm ecw w =
|
||||
damageMetal :: Damage -> ECW -> World -> World
|
||||
damageMetal dm ecw w =
|
||||
w & case dm of
|
||||
Lasering _ p t -> makeSpark FireSpark (outTo p t) (argV $ reflectIn v t)
|
||||
Lasering _ p t -> makeSpark FireSpark (outTo p t) (rdir p t)
|
||||
Piercing _ p t ->
|
||||
makeSpark NormalSpark (outTo p t) (argV $ reflectIn v t)
|
||||
. randsound p [tingS, ting1S, ting2S, ting3S]
|
||||
makeSpark NormalSpark (outTo p t) (rdir p t)
|
||||
. randsound p [tingS, ting1S, ting2S, ting3S, ting4S, ting5S]
|
||||
Blunt _ p t -> id
|
||||
Shattering _ p t -> id
|
||||
Crushing{} -> id
|
||||
@@ -71,9 +71,11 @@ damageMetal dm ecw w =
|
||||
Enterrement{} -> id
|
||||
Flashing{} -> id
|
||||
where
|
||||
v = case ecw of
|
||||
Right wl -> uncurry (-) $ _wlLine wl
|
||||
Left cr -> undefined
|
||||
rdir p t = argV $ reflectIn v t
|
||||
where
|
||||
v = case ecw of
|
||||
Right wl -> uncurry (-) $ _wlLine wl
|
||||
Left cr -> vNormal (p - _crPos cr)
|
||||
outTo x t = x -.- squashNormalizeV t
|
||||
randsound p xs =
|
||||
let (x, g) = runState (takeOne xs) $ _randGen w
|
||||
@@ -95,6 +97,7 @@ damageFlesh dm ecw w = w & case dm of
|
||||
, bloodShort7S
|
||||
, bloodShort8S
|
||||
]
|
||||
. smokeCloudAt red 20 200 1 (addZ 20 (outTo p t))
|
||||
Blunt _ p t -> id
|
||||
Shattering _ p t -> id
|
||||
Crushing{} -> id
|
||||
|
||||
Reference in New Issue
Block a user