Move wall damages to external position
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
module Dodge.Particle.HitEffect.ExpireAndDamage where
|
||||
import Dodge.Data
|
||||
import Dodge.Particle.Update
|
||||
import Dodge.Wall.Damage
|
||||
--import Dodge.Wall.Damage
|
||||
import Geometry
|
||||
import LensHelp
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
|
||||
expireAndDamage :: (Particle -> Point2 -> [Damage])
|
||||
-> Particle
|
||||
@@ -21,7 +22,6 @@ doDamages :: (Particle -> Point2 -> [Damage])
|
||||
-> World
|
||||
doDamages fdm (p,thhit) bt = case thhit of
|
||||
Left cr -> creatures . ix (_crID cr) . crState . crDamage .++~ dams
|
||||
Right wl -> flip (foldr (`damageWall` wl)) dams
|
||||
Right wl -> wallDamages %~ IM.insertWith (++) (_wlID wl) dams
|
||||
where
|
||||
dams = fdm bt p
|
||||
|
||||
|
||||
Reference in New Issue
Block a user