Safe Haskell | None |
---|
Running and disturbance.
- canRun :: MonadClient m => ActorId -> (Vector, Int) -> m Bool
- continueRunDir :: MonadClientAbort m => ActorId -> (Vector, Int) -> m (Vector, Int)
Documentation
canRun :: MonadClient m => ActorId -> (Vector, Int) -> m BoolSource
Start running in the given direction and with the given number of tiles already traversed (usually 0). The first turn of running succeeds much more often than subsequent turns, because most of the disturbances are ignored, since the player is aware of them and still explicitly requests a run.
continueRunDir :: MonadClientAbort m => ActorId -> (Vector, Int) -> m (Vector, Int)Source
This function implements the actual logic of running. It checks if we have to stop running because something interesting cropped up, it ajusts the direction given by the vector if we reached a corridor's corner (we never change direction except in corridors) and it increments the counter of traversed tiles.