Creature springs checks for heights

This commit is contained in:
2026-04-04 08:33:09 +01:00
parent 615295ca3e
commit def204d211
8 changed files with 96 additions and 66 deletions
+7 -3
View File
@@ -32,6 +32,7 @@ module Dodge.Base.Collide (
anythingHitCirc,
collide3WallsFloor,
collide3,
crHeight,
) where
import Data.Foldable
@@ -174,10 +175,13 @@ collide3Creature sp cr (ep, m) = fromMaybe (ep, m) $ do
crHeight :: Creature -> Maybe Float
crHeight cr = case cr ^. crHP of
HP{} -> Just 25
HP{} -> Just $ case cr ^. crType of
HoverCrit {} -> 10
ChaseCrit {} -> 25
Avatar {} -> 25
_ -> error "Need to define crHeight for this crType"
CrIsCorpse{} -> Just 5
CrIsGibs -> Nothing
CrIsPitted -> Nothing
CrDestroyed{} -> Nothing
wallToSurface :: Wall -> (Point3, Point3, [(Point3, Point3)])
wallToSurface wl = (g x, g $ vNormal (x - y), [(g x, g (y - x)), (g y, g (x - y))])