Work on sensor machines, remove some datatypes associated with placements

This commit is contained in:
2021-11-01 23:07:58 +00:00
parent 82de39657b
commit 7ef1da9be5
16 changed files with 265 additions and 220 deletions
+22
View File
@@ -0,0 +1,22 @@
module Dodge.WorldEvent.Damage
( damThingHitWith
) where
import Dodge.Data
import Dodge.Data.DamageType
import Dodge.Creature.State.Data
import Geometry
import Dodge.Wall.Damage
import Control.Lens
damThingHitWith
:: (Point2 -> Point2 -> Point2 -> DamageType)
-> Point2
-> Point2
-> Maybe (Point2, Either Creature Wall)
-> World
-> World
damThingHitWith partDT sp ep mayEiCrWl = case mayEiCrWl of
Just (hitp,Left cr ) -> creatures . ix (_crID cr) . crState . crDamage %~ (partDT sp hitp ep :)
Just (hitp,Right wl) -> damageWall (partDT sp hitp ep) wl
Nothing -> id