From 5c5aa14a3dcb5c172eaf8d2236b41020c8e92051 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Fri, 3 Jan 2020 12:04:08 -0500 Subject: Don't render moving entities that aren't visible When the character walks away from or around the corner from entities that move such that they're no longer visible, stop rendering them. Still render static entities like walls, doors, and items though. This prevents entities walking into a "revealed position" after the character's left being visible despite not being in a line of sight any more. --- src/Xanthous/AI/Gormlak.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Xanthous/AI/Gormlak.hs') diff --git a/src/Xanthous/AI/Gormlak.hs b/src/Xanthous/AI/Gormlak.hs index 8b30bc2c9de0..3e950f67f364 100644 --- a/src/Xanthous/AI/Gormlak.hs +++ b/src/Xanthous/AI/Gormlak.hs @@ -90,10 +90,13 @@ newtype GormlakBrain = GormlakBrain Creature instance Brain GormlakBrain where step ticks = fmap coerce . stepGormlak ticks . coerce + entityCanMove = const True -------------------------------------------------------------------------------- -instance Brain Creature where step = brainVia GormlakBrain +instance Brain Creature where + step = brainVia GormlakBrain + entityCanMove = const True instance Entity Creature where blocksVision _ = False -- cgit 1.4.1