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

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Content.ItemKind

Description

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

Synopsis

Documentation

data ItemKind Source #

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

Constructors

ItemKind 

Fields

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.

Constructors

NoEffect !Text 
Hurt !Dice 
Burn !Dice 
Explode !(GroupName ItemKind)

explode, producing this group of blasts

RefillHP !Int 
OverfillHP !Int 
RefillCalm !Int 
OverfillCalm !Int 
Dominate 
Impress 
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 
Identify 
SendFlying !ThrowMod 
PushActor !ThrowMod 
PullActor !ThrowMod 
DropBestWeapon 
ActivateInv !Char

symbol ' ' means all

ApplyPerfume 
OneOf ![Effect] 
OnSmash !Effect

trigger if item smashed (not applied nor meleed)

Recharging !Effect

this effect inactive until timeout passes

Temporary !Text

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

Instances

Eq Effect Source # 

Methods

(==) :: Effect -> Effect -> Bool #

(/=) :: Effect -> Effect -> Bool #

Ord Effect Source # 
Read Effect Source # 
Show Effect Source # 
Generic Effect Source # 

Associated Types

type Rep Effect :: * -> * #

Methods

from :: Effect -> Rep Effect x #

to :: Rep Effect x -> Effect #

Binary Effect Source # 

Methods

put :: Effect -> Put #

get :: Get Effect #

putList :: [Effect] -> Put #

NFData Effect Source # 

Methods

rnf :: Effect -> () #

Hashable Effect Source # 

Methods

hashWithSalt :: Int -> Effect -> Int #

hash :: Effect -> Int #

type Rep Effect Source # 
type Rep Effect = D1 (MetaData "Effect" "Game.LambdaHack.Content.ItemKind" "LambdaHack-0.5.0.0-74KPJ5W83IH4twh4vUgyBt" False) ((:+:) ((:+:) ((:+:) ((:+:) (C1 (MetaCons "NoEffect" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Text))) ((:+:) (C1 (MetaCons "Hurt" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Dice))) (C1 (MetaCons "Burn" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Dice))))) ((:+:) ((:+:) (C1 (MetaCons "Explode" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 (GroupName ItemKind)))) (C1 (MetaCons "RefillHP" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int)))) ((:+:) (C1 (MetaCons "OverfillHP" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int))) (C1 (MetaCons "RefillCalm" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int)))))) ((:+:) ((:+:) ((:+:) (C1 (MetaCons "OverfillCalm" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int))) (C1 (MetaCons "Dominate" PrefixI False) U1)) ((:+:) (C1 (MetaCons "Impress" PrefixI False) U1) (C1 (MetaCons "CallFriend" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Dice))))) ((:+:) ((:+:) (C1 (MetaCons "Summon" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Freqs ItemKind))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Dice)))) (C1 (MetaCons "Ascend" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int)))) ((:+:) (C1 (MetaCons "Escape" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int))) (C1 (MetaCons "Paralyze" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Dice))))))) ((:+:) ((:+:) ((:+:) ((:+:) (C1 (MetaCons "InsertMove" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Dice))) (C1 (MetaCons "Teleport" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Dice)))) ((:+:) (C1 (MetaCons "CreateItem" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 CStore)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 (GroupName ItemKind))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 TimerDice))))) (C1 (MetaCons "DropItem" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 CStore)) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 (GroupName ItemKind))) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Bool))))))) ((:+:) ((:+:) (C1 (MetaCons "PolyItem" PrefixI False) U1) (C1 (MetaCons "Identify" PrefixI False) U1)) ((:+:) (C1 (MetaCons "SendFlying" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ThrowMod))) (C1 (MetaCons "PushActor" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ThrowMod)))))) ((:+:) ((:+:) ((:+:) (C1 (MetaCons "PullActor" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 ThrowMod))) (C1 (MetaCons "DropBestWeapon" PrefixI False) U1)) ((:+:) (C1 (MetaCons "ActivateInv" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Char))) (C1 (MetaCons "ApplyPerfume" PrefixI False) U1))) ((:+:) ((:+:) (C1 (MetaCons "OneOf" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 [Effect]))) (C1 (MetaCons "OnSmash" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Effect)))) ((:+:) (C1 (MetaCons "Recharging" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Effect))) (C1 (MetaCons "Temporary" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Text))))))))

data TimerDice Source #

Instances

Eq TimerDice Source # 
Ord TimerDice Source # 
Read TimerDice Source # 
Show TimerDice Source # 
Generic TimerDice Source # 

Associated Types

type Rep TimerDice :: * -> * #

Binary TimerDice Source # 
NFData TimerDice Source # 

Methods

rnf :: TimerDice -> () #

Hashable TimerDice Source # 
type Rep TimerDice Source # 
type Rep TimerDice = D1 (MetaData "TimerDice" "Game.LambdaHack.Content.ItemKind" "LambdaHack-0.5.0.0-74KPJ5W83IH4twh4vUgyBt" False) ((:+:) (C1 (MetaCons "TimerNone" PrefixI False) U1) ((:+:) (C1 (MetaCons "TimerGameTurn" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Dice))) (C1 (MetaCons "TimerActorTurn" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Dice)))))

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.

Constructors

Unique

at most one copy can ever be generated

Periodic

in equipment, apply as often as Timeout permits

Timeout !a

some effects will be disabled until item recharges

AddHurtMelee !a

percentage damage bonus in melee

AddHurtRanged !a

percentage damage bonus in ranged

AddArmorMelee !a

percentage armor bonus against melee

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 Source # 

Methods

fmap :: (a -> b) -> Aspect a -> Aspect b #

(<$) :: a -> Aspect b -> Aspect a #

Foldable Aspect Source # 

Methods

fold :: Monoid m => Aspect m -> m #

foldMap :: Monoid m => (a -> m) -> Aspect a -> m #

foldr :: (a -> b -> b) -> b -> Aspect a -> b #

foldr' :: (a -> b -> b) -> b -> Aspect a -> b #

foldl :: (b -> a -> b) -> b -> Aspect a -> b #

foldl' :: (b -> a -> b) -> b -> Aspect a -> b #

foldr1 :: (a -> a -> a) -> Aspect a -> a #

foldl1 :: (a -> a -> a) -> Aspect a -> a #

toList :: Aspect a -> [a] #

null :: Aspect a -> Bool #

length :: Aspect a -> Int #

elem :: Eq a => a -> Aspect a -> Bool #

maximum :: Ord a => Aspect a -> a #

minimum :: Ord a => Aspect a -> a #

sum :: Num a => Aspect a -> a #

product :: Num a => Aspect a -> a #

Traversable Aspect Source # 

Methods

traverse :: Applicative f => (a -> f b) -> Aspect a -> f (Aspect b) #

sequenceA :: Applicative f => Aspect (f a) -> f (Aspect a) #

mapM :: Monad m => (a -> m b) -> Aspect a -> m (Aspect b) #

sequence :: Monad m => Aspect (m a) -> m (Aspect a) #

Eq a => Eq (Aspect a) Source # 

Methods

(==) :: Aspect a -> Aspect a -> Bool #

(/=) :: Aspect a -> Aspect a -> Bool #

Ord a => Ord (Aspect a) Source # 

Methods

compare :: Aspect a -> Aspect a -> Ordering #

(<) :: Aspect a -> Aspect a -> Bool #

(<=) :: Aspect a -> Aspect a -> Bool #

(>) :: Aspect a -> Aspect a -> Bool #

(>=) :: Aspect a -> Aspect a -> Bool #

max :: Aspect a -> Aspect a -> Aspect a #

min :: Aspect a -> Aspect a -> Aspect a #

Read a => Read (Aspect a) Source # 
Show a => Show (Aspect a) Source # 

Methods

showsPrec :: Int -> Aspect a -> ShowS #

show :: Aspect a -> String #

showList :: [Aspect a] -> ShowS #

Generic (Aspect a) Source # 

Associated Types

type Rep (Aspect a) :: * -> * #

Methods

from :: Aspect a -> Rep (Aspect a) x #

to :: Rep (Aspect a) x -> Aspect a #

Binary a => Binary (Aspect a) Source # 

Methods

put :: Aspect a -> Put #

get :: Get (Aspect a) #

putList :: [Aspect a] -> Put #

Hashable a => Hashable (Aspect a) Source # 

Methods

hashWithSalt :: Int -> Aspect a -> Int #

hash :: Aspect a -> Int #

type Rep (Aspect a) Source # 
type Rep (Aspect a) = D1 (MetaData "Aspect" "Game.LambdaHack.Content.ItemKind" "LambdaHack-0.5.0.0-74KPJ5W83IH4twh4vUgyBt" False) ((:+:) ((:+:) ((:+:) (C1 (MetaCons "Unique" PrefixI False) U1) ((:+:) (C1 (MetaCons "Periodic" PrefixI False) U1) (C1 (MetaCons "Timeout" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 a))))) ((:+:) ((:+:) (C1 (MetaCons "AddHurtMelee" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 a))) (C1 (MetaCons "AddHurtRanged" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 a)))) ((:+:) (C1 (MetaCons "AddArmorMelee" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 a))) (C1 (MetaCons "AddArmorRanged" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 a)))))) ((:+:) ((:+:) (C1 (MetaCons "AddMaxHP" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 a))) ((:+:) (C1 (MetaCons "AddMaxCalm" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 a))) (C1 (MetaCons "AddSpeed" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 a))))) ((:+:) ((:+:) (C1 (MetaCons "AddSkills" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Skills))) (C1 (MetaCons "AddSight" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 a)))) ((:+:) (C1 (MetaCons "AddSmell" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 a))) (C1 (MetaCons "AddLight" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 a)))))))

data ThrowMod Source #

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

Constructors

ThrowMod 

Fields

Instances

Eq ThrowMod Source # 
Ord ThrowMod Source # 
Read ThrowMod Source # 
Show ThrowMod Source # 
Generic ThrowMod Source # 

Associated Types

type Rep ThrowMod :: * -> * #

Methods

from :: ThrowMod -> Rep ThrowMod x #

to :: Rep ThrowMod x -> ThrowMod #

Binary ThrowMod Source # 

Methods

put :: ThrowMod -> Put #

get :: Get ThrowMod #

putList :: [ThrowMod] -> Put #

NFData ThrowMod Source # 

Methods

rnf :: ThrowMod -> () #

Hashable ThrowMod Source # 

Methods

hashWithSalt :: Int -> ThrowMod -> Int #

hash :: ThrowMod -> Int #

type Rep ThrowMod Source # 
type Rep ThrowMod = D1 (MetaData "ThrowMod" "Game.LambdaHack.Content.ItemKind" "LambdaHack-0.5.0.0-74KPJ5W83IH4twh4vUgyBt" False) (C1 (MetaCons "ThrowMod" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "throwVelocity") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int)) (S1 (MetaSel (Just Symbol "throwLinger") NoSourceUnpackedness SourceStrict DecidedUnpack) (Rec0 Int))))

data Feature Source #

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

Constructors

Fragile

drop and break at target tile, even if no hit

Durable

don't break even when 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

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)

Instances

Eq Feature Source # 

Methods

(==) :: Feature -> Feature -> Bool #

(/=) :: Feature -> Feature -> Bool #

Ord Feature Source # 
Show Feature Source # 
Generic Feature Source # 

Associated Types

type Rep Feature :: * -> * #

Methods

from :: Feature -> Rep Feature x #

to :: Rep Feature x -> Feature #

Binary Feature Source # 

Methods

put :: Feature -> Put #

get :: Get Feature #

putList :: [Feature] -> Put #

Hashable Feature Source # 

Methods

hashWithSalt :: Int -> Feature -> Int #

hash :: Feature -> Int #

type Rep Feature Source # 

data EqpSlot Source #

Instances

Eq EqpSlot Source # 

Methods

(==) :: EqpSlot -> EqpSlot -> Bool #

(/=) :: EqpSlot -> EqpSlot -> Bool #

Ord EqpSlot Source # 
Show EqpSlot Source # 
Generic EqpSlot Source # 

Associated Types

type Rep EqpSlot :: * -> * #

Methods

from :: EqpSlot -> Rep EqpSlot x #

to :: Rep EqpSlot x -> EqpSlot #

Binary EqpSlot Source # 

Methods

put :: EqpSlot -> Put #

get :: Get EqpSlot #

putList :: [EqpSlot] -> Put #

Hashable EqpSlot Source # 

Methods

hashWithSalt :: Int -> EqpSlot -> Int #

hash :: EqpSlot -> Int #

type Rep EqpSlot Source # 
type Rep EqpSlot = D1 (MetaData "EqpSlot" "Game.LambdaHack.Content.ItemKind" "LambdaHack-0.5.0.0-74KPJ5W83IH4twh4vUgyBt" False) ((:+:) ((:+:) ((:+:) (C1 (MetaCons "EqpSlotPeriodic" PrefixI False) U1) ((:+:) (C1 (MetaCons "EqpSlotTimeout" PrefixI False) U1) (C1 (MetaCons "EqpSlotAddHurtMelee" PrefixI False) U1))) ((:+:) ((:+:) (C1 (MetaCons "EqpSlotAddArmorMelee" PrefixI False) U1) (C1 (MetaCons "EqpSlotAddHurtRanged" PrefixI False) U1)) ((:+:) (C1 (MetaCons "EqpSlotAddArmorRanged" PrefixI False) U1) (C1 (MetaCons "EqpSlotAddMaxHP" PrefixI False) U1)))) ((:+:) ((:+:) (C1 (MetaCons "EqpSlotAddMaxCalm" PrefixI False) U1) ((:+:) (C1 (MetaCons "EqpSlotAddSpeed" PrefixI False) U1) (C1 (MetaCons "EqpSlotAddSkills" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Ability))))) ((:+:) ((:+:) (C1 (MetaCons "EqpSlotAddSight" PrefixI False) U1) (C1 (MetaCons "EqpSlotAddSmell" PrefixI False) U1)) ((:+:) (C1 (MetaCons "EqpSlotAddLight" PrefixI False) U1) (C1 (MetaCons "EqpSlotWeapon" PrefixI False) U1)))))

validateSingleItemKind :: ItemKind -> [Text] Source #

Catch invalid item kind definitions.

validateAllItemKind :: [ItemKind] -> [Text] Source #

Validate all item kinds.