Stop gibbed/pitted creatures from opening doors
This commit is contained in:
@@ -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) =
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user