Remove external corpses, handle them as creatures

This commit is contained in:
2025-09-25 09:31:58 +01:00
parent fcb02850d0
commit 23f61081cf
33 changed files with 184 additions and 159 deletions
+2 -2
View File
@@ -201,12 +201,12 @@ sensorReqToString = \case
mcProxTest :: World -> ProximityRequirement -> Bool
mcProxTest w = \case
RequireHealth x -> _crHP cr >= x
RequireHealth x -> fromMaybe 0 (cr ^? crHP . _HP) >= x
RequireEquipment ct ->
any
(\itm -> _itType itm == ct)
((\k -> w ^?! cWorld . lWorld . items . ix k) <$> _crInv cr)
RequireDeadCreatures is -> all (\x -> _crHP x < 0)
RequireDeadCreatures is -> all (\x -> null (x ^? crHP . _HP))
(IM.restrictKeys (w ^. cWorld . lWorld . creatures) (IS.fromList is))
where
cr = you w