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

Safe HaskellNone

Game.LambdaHack.Common.Effect

Description

Effects of content on the game state. No operation in this module involves state or monad types.

Synopsis

Documentation

data Effect a 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

NoEffect !Text 
Hurt !Dice 
Burn !Int 
Explode !GroupName

explode, producing this group of shrapnel

RefillHP !Int 
RefillCalm !Int 
Dominate 
Impress 
CallFriend !a 
Summon !Freqs !a 
CreateItem !a 
Ascend !Int 
Escape !Int

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

Paralyze !a 
InsertMove !a 
Teleport !a 
PolyItem !CStore 
Identify !CStore 
SendFlying !ThrowMod 
PushActor !ThrowMod 
PullActor !ThrowMod 
DropBestWeapon 
DropEqp !Char !Bool

symbol ' ' means all, True means hit on drop

ActivateInv !Char

symbol ' ' means all

ApplyPerfume 
OneOf ![Effect a] 
OnSmash !(Effect a)

trigger if item smashed (not applied nor meleed)

TimedAspect !Int !(Aspect a)

enable the aspect for k clips

Instances

Functor Effect 
Eq a => Eq (Effect a) 
Ord a => Ord (Effect a) 
Read a => Read (Effect a) 
Show a => Show (Effect a) 
Generic (Effect a) 
Binary a => Binary (Effect a) 
Hashable a => Hashable (Effect a) 

data Aspect a Source

Aspects of items. Additive (starting at 0) for all items wielded by an actor and affect the actor (except Periodic that only affect the item and so is not additive).

Constructors

Periodic !a

is activated this many times in 100

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

Instances

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) 

data ThrowMod Source

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

Constructors

ThrowMod 

Fields

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.

Constructors

ChangeTo !GroupName

change to this group when altered

Fragile

break even when not hitting an enemy

Durable

don't break even hitting or applying

ToThrow !ThrowMod

parameters modifying a throw

Identified

the item starts identified

Applicable

AI and uI flag: consider applying

EqpSlot !EqpSlot !Text

AI and uI flag: goes to inventory

Precious

AI and UI flag: careful, can be precious; don't risk identifying by use

Tactic !Tactic

overrides actor's tactic (TODO)

effectTrav :: Effect a -> (a -> State s b) -> State s (Effect b)Source

Transform an effect using a stateful function.

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

Transform an aspect using a stateful function.