LambdaHack- A game engine library for roguelike dungeon crawlers

Safe HaskellNone



The type of kinds of weapons, treasure, organs, blasts and actors.



data ItemKind Source

Item properties that are fixed for a given kind of items.




isymbol :: !Char

map symbol

iname :: !T.Text

generic name

ifreq :: !(Freqs ItemKind)

frequency within groups

iflavour :: ![Flavour]

possible flavours

icount :: !Dice

created in that quantity

irarity :: !Rarity

rarity on given depths

iverbHit :: !MU.Part

the verb for applying and melee

iweight :: !Int

weight in grams

iaspects :: ![Aspect Dice]

keep the aspect continuously

ieffects :: ![Effect]

cause the effect when triggered

ifeature :: ![Feature]

public properties

idesc :: !T.Text


ikit :: ![(GroupName ItemKind, CStore)]

accompanying organs and items


data Effect Source

Effects of items. Can be invoked by the item wielder to affect another actor or the wielder himself. Many occurences in the same item are possible. Constructors are sorted vs increasing impact/danger.


NoEffect !T.Text 
Hurt !Dice 
Burn !Int 
Explode !(GroupName ItemKind)

explode, producing this group of blasts

RefillHP !Int 
OverfillHP !Int 
RefillCalm !Int 
OverfillCalm !Int 
CallFriend !Dice 
Summon !(Freqs ItemKind) !Dice 
Ascend !Int 
Escape !Int

the Int says if can be placed on last level, etc.

Paralyze !Dice 
InsertMove !Dice 
Teleport !Dice 
CreateItem !CStore !(GroupName ItemKind) !TimerDice

create an item of the group and insert into the store with the given random timer

DropItem !CStore !(GroupName ItemKind) !Bool

DropItem CGround x True means stomp on items

PolyItem !CStore 
Identify !CStore 
SendFlying !ThrowMod 
PushActor !ThrowMod 
PullActor !ThrowMod 
ActivateInv !Char

symbol ' ' means all

OneOf ![Effect] 
OnSmash !Effect

trigger if item smashed (not applied nor meleed)

Recharging !Effect

this effect inactive until timeout passes

Temporary !T.Text

the item is temporary, vanishes at even void Periodic activation, unless Durable

data Aspect a Source

Aspects of items. Those that are named Add* are additive (starting at 0) for all items wielded by an actor and they affect the actor.



in equipment, activate as often as Timeout permits

Timeout !a

some effects will be disabled until item recharges

AddHurtMelee !a

percentage damage bonus in melee

AddArmorMelee !a

percentage armor bonus against melee

AddHurtRanged !a

percentage damage bonus in ranged

AddArmorRanged !a

percentage armor bonus against ranged

AddMaxHP !a

maximal hp

AddMaxCalm !a

maximal calm

AddSpeed !a

speed in m/10s

AddSkills !Skills

skills in particular abilities

AddSight !a

FOV radius, where 1 means a single tile

AddSmell !a

smell radius, where 1 means a single tile

AddLight !a

light radius, where 1 means a single tile


Functor Aspect 
Eq a => Eq (Aspect a) 
Ord a => Ord (Aspect a) 
Read a => Read (Aspect a) 
Show a => Show (Aspect a) 
Generic (Aspect a) 
Binary a => Binary (Aspect a) 
Hashable a => Hashable (Aspect a) 
type Rep (Aspect a) 

data ThrowMod Source

Parameters modifying a throw. Not additive and don't start at 0.




throwVelocity :: !Int

fly with this percentage of base throw speed

throwLinger :: !Int

fly for this percentage of 2 turns

data Feature Source

Features of item. Affect only the item in question, not the actor, and so not additive in any sense.



drop and break at target tile, even if no hit


don't break even when hitting or applying

ToThrow !ThrowMod

parameters modifying a throw


the item starts identified


AI and UI flag: consider applying

EqpSlot !EqpSlot !T.Text

AI and UI flag: goes to inventory


can't throw or apply if not calm enough; AI and UI flag: don't risk identifying by use

Tactic !Tactic

overrides actor's tactic (TODO)

aspectTrav :: Aspect a -> (a -> State s b) -> State s (Aspect b) Source

Transform an aspect using a stateful function.

validateSingleItemKind :: ItemKind -> [T.Text] Source

Catch invalid item kind definitions.

validateAllItemKind :: [ItemKind] -> [T.Text] Source

Validate all item kinds.