LambdaHack-0.4.100.0: A game engine library for roguelike dungeon crawlers

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Common.Misc

Contents

Description

Hacks that haven't found their home yet.

Synopsis

Game object identifiers

data FactionId Source

A unique identifier of a faction in a game.

data LevelId Source

Abstract level identifiers.

newtype AbsDepth Source

Absolute depth in the dungeon. When used for the maximum depth of the whole dungeon, this can be different than dungeon size, e.g., when the dungeon is branched, and it can even be different than the length of the longest branch, if levels at some depths are missing.

Constructors

AbsDepth Int 

data ActorId Source

A unique identifier of an actor in the dungeon.

Item containers

data Container Source

Item container type.

Constructors

CFloor !LevelId !Point 
CEmbed !LevelId !Point 
CActor !ActorId !CStore 
CTrunk !FactionId !LevelId !Point

for bootstrapping actor bodies

Assorted

normalLevelBound :: (Int, Int) Source

Level bounds. TODO: query terminal size instead and scroll view.

divUp :: Integral a => a -> a -> a infixl 7 Source

Integer division, rounding up.

type Freqs a = [(GroupName a, Int)] Source

For each group that the kind belongs to, denoted by a GroupName in the first component of a pair, the second component of a pair shows how common the kind is within the group.

breturn :: MonadPlus m => Bool -> a -> m a Source

breturn b a = [a | b]

type Rarity = [(Int, Int)] Source

Rarity on given depths.

data Tactic Source

Constructors

TBlock

always only wait, even if enemy in melee range

TFollow

always follow leader's target or his position if no target

TExplore

if enemy nearby, attack, if no items, etc., explore unknown

TRoam

if enemy nearby, attack, if no items, etc., roam randomly

TPatrol

find an open and uncrowded area, patrol it according to sight radius and fallback temporarily to TRoam when enemy is seen by the faction and is within the actor's sight radius TODO (currently the same as TExplore; should it chase targets too (TRoam) and only switch to TPatrol when none?)