LambdaHack-0.2.0: A roguelike game engine in early and very active development

Safe HaskellNone

Game.LambdaHack.Actions

Description

The game action stuff that is independent from ItemAction.hs (both depend on EffectAction.hs). TODO: Add an export list and document after it's rewritten according to #17.

Synopsis

Documentation

ifRunning :: ((Vector, Int) -> Action a) -> Action a -> Action aSource

guessBump :: Ops TileKind -> Feature -> Id TileKind -> Action ()Source

Guess and report why the bump command failed.

bumpTile :: Point -> Feature -> Action ()Source

Player tries to trigger a tile using a feature.

triggerTile :: Point -> Action ()Source

Perform the action specified for the tile in case it's triggered.

playerTriggerDir :: Feature -> Action ()Source

Ask for a direction and trigger a tile, if possible.

playerBumpDir :: Feature -> Vector -> Action ()Source

Player tries to trigger a tile in a given direction.

playerTriggerTile :: Feature -> Action ()Source

Player tries to trigger the tile he's standing on.

actorOpenDoor :: ActorId -> Vector -> Action ()Source

An actor opens a door. Player (hero or controlled monster) or enemy.

tgtAscend :: Int -> Action ()Source

Change the displayed level in targeting mode to (at most) k levels shallower. Enters targeting mode, if not already in one.

cycleHero :: Action ()Source

Switches current hero to the next hero on the level, if any, wrapping.

search :: Action ()Source

Search for hidden doors.

moveOrAttackSource

Arguments

:: Bool

allow attacks?

-> ActorId

who's moving?

-> Vector

in which direction?

-> Action () 

This function performs a move (or attack) by any actor, i.e., it can handle monsters, heroes and both.

actorAttackActor :: ActorId -> ActorId -> Action ()Source

Resolves the result of an actor moving into another. Usually this involves melee attack, but with two heroes it just changes focus. Actors on blocked locations can be attacked without any restrictions. For instance, an actor embedded in a wall can be attacked from an adjacent position. This function is analogous to projectGroupItem, but for melee and not using up the weapon.

actorRunActor :: ActorId -> ActorId -> Action ()Source

Resolves the result of an actor running (not walking) into another. This involves switching positions of the two actors.

rollMonster :: COps -> Perception -> State -> Rnd StateSource

Create a new monster in the level, at a random position.

generateMonster :: Action ()Source

Generate a monster, possibly.

regenerateLevelHP :: Action ()Source

Possibly regenerate HP for all actors on the current level.