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

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Client.UI.RunM

Contents

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

Documentation

continueRun :: MonadClientUI m => LevelId -> RunParams -> m (Either Text RequestAnyAbility) 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.