LambdaHack-0.11.0.1: A game engine library for tactical squad ASCII roguelike dungeon crawlers

Safe Haskell | None
Language | Haskell2010

Game.LambdaHack.Client.UI.RunM

Contents

- Internal operations

Description

Running and disturbance.

The general rule is: whatever is behind you (and so ignored previously), determines what you ignore moving forward. This is calcaulated separately for the tiles to the left, to the right and in the middle along the running direction. So, if you want to ignore something start running when you stand on it (or to the right or left, respectively) or by entering it (or passing to the right or left, respectively).

Some things are never ignored, such as: enemies seen, imporant messages heard, solid tiles and actors in the way.

Synopsis

- continueRun :: MonadClientUI m => LevelId -> RunParams -> m (Either Text RequestTimed)
- continueRunDir :: MonadClientUI m => RunParams -> m (Either Text Vector)
- walkableDir :: COps -> Level -> Point -> Vector -> Bool
- tryTurning :: MonadClientRead m => ActorId -> m (Either Text Vector)
- checkAndRun :: MonadClientRead m => ActorId -> Vector -> m (Either Text Vector)

# Documentation

continueRun :: MonadClientUI m => LevelId -> RunParams -> m (Either Text RequestTimed) Source #

Continue running in the given direction.

# Internal operations

continueRunDir :: MonadClientUI m => RunParams -> m (Either Text Vector) 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.

Note that while goto-xhair commands ignore items on the way, here we stop wnenever we touch an item. Running is more cautious to compensate that the player cannot specify the end-point of running. It's also more suited to open, already explored terrain. Goto-xhair works better with unknown terrain, e.g., it stops whenever an item is spotted, but then ignores the item, leaving it to the player to mark the item position as a goal of the next goto.

walkableDir :: COps -> Level -> Point -> Vector -> Bool Source #

tryTurning :: MonadClientRead m => ActorId -> m (Either Text Vector) Source #

checkAndRun :: MonadClientRead m => ActorId -> Vector -> m (Either Text Vector) Source #