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

Safe HaskellSafe-Infered



The effectToAction function and all it depends on. This file should not depend on Actions.hs nor ItemAction.hs. TODO: Add an export list and document after it's rewritten according to #17.



effectToAction :: Effect -> Int -> ActorId -> ActorId -> Int -> Action (Bool, Bool)Source

The source actor affects the target actor, with a given effect and power. The second argument is verbosity of the resulting message. Both actors are on the current level and can be the same actor. The first bool result indicates if the effect was spectacular enough for the actors to identify it (and the item that caused it, if any). The second bool tells if the effect was seen by or affected the party.

eff :: Effect -> Int -> ActorId -> ActorId -> Int -> Action (Bool, String)Source

The boolean part of the result says if the ation was interesting and the string part describes how the target reacted (not what the source did).

switchLevel :: LevelId -> Action ()Source

Change level and reset it's time and update the times of all actors. The player may be added to lactor of the new level only after this operation is executed.

fleeDungeon :: Action ()Source

The player leaves the dungeon.

itemEffectAction :: Int -> ActorId -> ActorId -> Item -> Action ()Source

The source actor affects the target actor, with a given item. If the event is seen, the item may get identified.

discover :: Item -> Action ()Source

Make the item known to the player.

selectPlayer :: ActorId -> Action BoolSource

Make the actor controlled by the player. Focus on the actor if level changes. False, if nothing to do.

checkPartyDeath :: Action ()Source

Remove dead heroes (or dead dominated monsters). Check if game is over. For now we only check the selected hero and at current level, but if poison, etc. is implemented, we'd need to check all heroes on any level.

gameOver :: Bool -> Action ()Source

End game, showing the ending screens, if requested.

itemOverlay :: Bool -> Bool -> [Item] -> Action [Overlay]Source

Create a list of item names, split into many overlays.

doLook :: ActionFrame ()Source

Perform look around in the current location of the cursor.