Refactor damages to materials

This commit is contained in:
2025-06-22 08:31:18 +01:00
parent df3fde5d3e
commit 9fa3e060d7
17 changed files with 576 additions and 609 deletions
-20
View File
@@ -1,20 +0,0 @@
module Dodge.WorldEvent.Damage (
damThingHitWith,
) where
import Dodge.Data.World
import Dodge.Wall.Damage
import Geometry
import LensHelp
damThingHitWith ::
(Point2 -> Point2 -> Point2 -> Damage) ->
Point2 ->
Point2 ->
Maybe (Point2, Either Creature Wall) ->
World ->
World
damThingHitWith partDT sp ep mayEiCrWl = case mayEiCrWl of
Just (hitp, Left cr) -> cWorld . lWorld . creatures . ix (_crID cr) . crDamage .:~ partDT sp hitp ep
Just (hitp, Right wl) -> damageWall (partDT sp hitp ep) wl
Nothing -> id