about summary refs log tree commit diff
path: root/src/Xanthous/App.hs
diff options
context:
space:
mode:
authorGriffin Smith <root@gws.fyi>2019-09-28T19·02-0400
committerGriffin Smith <root@gws.fyi>2019-09-28T19·03-0400
commitec39dc0a5bed58e0b0b48eeac98e0fd0ceaa65db (patch)
tree65a53bd79b15020572524db0a6e65ec549b5ab24 /src/Xanthous/App.hs
parentabea2dcfac0e094bf4ce0d378763af7816b04501 (diff)
Tweak gormlak movement slightly
- Don't let gormlaks run into things like walls or each other
- Add a small element of randomness to gormlaks' motion
- Increase gormlaks' vision by a large amount
Diffstat (limited to 'src/Xanthous/App.hs')
-rw-r--r--src/Xanthous/App.hs22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/Xanthous/App.hs b/src/Xanthous/App.hs
index cff4a4d611e3..1632c39e586d 100644
--- a/src/Xanthous/App.hs
+++ b/src/Xanthous/App.hs
@@ -57,11 +57,6 @@ makeApp = pure $ Brick.App
 runAppM :: AppM a -> GameState -> EventM Name a
 runAppM appm = fmap fst . runAppT appm
 
--- testGormlak :: Creature
--- testGormlak =
---   let Just (Creature gormlak) = raw "gormlak"
---   in Creature.newWithType gormlak
-
 startEvent :: AppM ()
 startEvent = do
   initLevel
@@ -264,20 +259,3 @@ attackAt pos =
         say ["combat", "hit"] msgParams
         entities . ix creatureID . positioned .= SomeEntity creature'
     stepGame
-
-data Collision
-  = Stop
-  | Combat
-  deriving stock (Show, Eq, Ord, Generic)
-  deriving anyclass (NFData)
-
-collisionAt :: MonadState GameState m => Position -> m (Maybe Collision)
-collisionAt pos = do
-  ents <- use $ entities . EntityMap.atPosition pos
-  pure $
-    if | null ents -> Nothing
-       | any (entityIs @Creature) ents -> pure Combat
-       | all (entityIs @Item) ents -> Nothing
-       | doors@(_ : _) <- ents ^.. folded . _SomeEntity @Door
-       , all (view open) doors -> Nothing
-       | otherwise -> pure Stop