Stop gibbed/pitted creatures from opening doors

This commit is contained in:
2026-03-23 22:59:35 +00:00
parent daba012e83
commit 7917192b77
6 changed files with 20 additions and 21 deletions
+2 -1
View File
@@ -106,7 +106,8 @@ collide3Chasms sp w m =
foldl'
(flip (collide3Chasm sp))
m
(foldMap loopPairs $ w ^. cWorld . chasms)
--(foldMap loopPairs $ w ^. cWorld . chasms)
(w ^. cWorld . cliffs)
collide3Chasm :: Point3 -> (Point2, Point2) -> (Point3, MPO) -> (Point3, MPO)
collide3Chasm sp ab (ep, m) =
+9
View File
@@ -22,6 +22,7 @@ module Dodge.Creature.Test (
crHasTarget,
crStratConMatches,
crSafeDistFromTarg,
hasAutoDoorBody,
) where
import Linear
@@ -136,3 +137,11 @@ isAnimate :: Creature -> Bool
isAnimate cr = case _crActionPlan cr of
Inanimate -> False
_ -> True
hasAutoDoorBody :: Creature -> Bool
hasAutoDoorBody cr = case cr ^. crHP of
HP {} -> True
CrIsCorpse {} -> True
CrIsGibs -> False
CrIsPitted -> False
+1
View File
@@ -34,6 +34,7 @@ doCrBl cb = case cb of
CrCanShoot -> error "got rid of crCanShoot"
CrIsAiming -> crIsAiming
CrIsAnimate -> isAnimate
CrOpenAutoDoor -> \cr -> isAnimate cr && hasAutoDoorBody cr
doCrAc :: CrAc -> Creature -> Action
doCrAc ca = case ca of
+1
View File
@@ -18,6 +18,7 @@ data WdCrBl
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data CrBl = CrCanShoot | CrIsAiming | CrIsAnimate
| CrOpenAutoDoor
deriving (Eq, Ord, Show, Read) --Generic, Flat)
data CrAc = CrTurnAround
+1 -1
View File
@@ -93,7 +93,7 @@ putAutoDoor a b = Placement (PS 0 0) (PutCoord a) Nothing Nothing $ \_ apl ->
in Just $
putDoubleDoor
defaultAutoWall
(WdBlCrFilterNearPoint 40 (0.5 *^ (x + y)) CrIsAnimate)
(WdBlCrFilterNearPoint 40 (0.5 *^ (x + y)) CrOpenAutoDoor)
a
b
3