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

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Common.Actor

Contents

Description

Actors in the game: heroes, monsters, etc.

Synopsis

Actor identifiers

The Actor type, its components and operations on them

data Actor Source #

Actor properties that are changing throughout the game. If they appear dublets of properties of actor kinds, e.g. HP, they may be results of casting the dice specified in their respective actor kind and/or may be modified temporarily, but return to the original value from their respective kind over time.

Constructors

Actor 

Fields

Instances

Eq Actor Source # 

Methods

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

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

Show Actor Source # 

Methods

showsPrec :: Int -> Actor -> ShowS #

show :: Actor -> String #

showList :: [Actor] -> ShowS #

Generic Actor Source # 

Associated Types

type Rep Actor :: * -> * #

Methods

from :: Actor -> Rep Actor x #

to :: Rep Actor x -> Actor #

Binary Actor Source # 

Methods

put :: Actor -> Put #

get :: Get Actor #

putList :: [Actor] -> Put #

type Rep Actor Source # 
type Rep Actor = D1 * (MetaData "Actor" "Game.LambdaHack.Common.Actor" "LambdaHack-0.7.0.0-3XPyz9bw1i28qJIoWU6CaM" False) (C1 * (MetaCons "Actor" PrefixI True) ((:*:) * ((:*:) * ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "btrunk") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 * ItemId)) (S1 * (MetaSel (Just Symbol "bhp") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 * Int64))) ((:*:) * (S1 * (MetaSel (Just Symbol "bhpDelta") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 * ResDelta)) (S1 * (MetaSel (Just Symbol "bcalm") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 * Int64)))) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "bcalmDelta") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 * ResDelta)) (S1 * (MetaSel (Just Symbol "bpos") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 * Point))) ((:*:) * (S1 * (MetaSel (Just Symbol "boldpos") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 * (Maybe Point))) (S1 * (MetaSel (Just Symbol "blid") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 * LevelId))))) ((:*:) * ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "bfid") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 * FactionId)) (S1 * (MetaSel (Just Symbol "btrajectory") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 * (Maybe ([Vector], Speed))))) ((:*:) * (S1 * (MetaSel (Just Symbol "borgan") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 * ItemBag)) (S1 * (MetaSel (Just Symbol "beqp") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 * ItemBag)))) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "binv") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 * ItemBag)) (S1 * (MetaSel (Just Symbol "bweapon") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 * Int))) ((:*:) * (S1 * (MetaSel (Just Symbol "bwait") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 * Bool)) (S1 * (MetaSel (Just Symbol "bproj") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 * Bool)))))))

data ResDelta Source #

Constructors

ResDelta 

Fields

Instances

Eq ResDelta Source # 
Show ResDelta Source # 
Generic ResDelta Source # 

Associated Types

type Rep ResDelta :: * -> * #

Methods

from :: ResDelta -> Rep ResDelta x #

to :: Rep ResDelta x -> ResDelta #

Binary ResDelta Source # 

Methods

put :: ResDelta -> Put #

get :: Get ResDelta #

putList :: [ResDelta] -> Put #

type Rep ResDelta Source # 
type Rep ResDelta = D1 * (MetaData "ResDelta" "Game.LambdaHack.Common.Actor" "LambdaHack-0.7.0.0-3XPyz9bw1i28qJIoWU6CaM" False) (C1 * (MetaCons "ResDelta" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "resCurrentTurn") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 * (Int64, Int64))) (S1 * (MetaSel (Just Symbol "resPreviousTurn") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 * (Int64, Int64)))))

braced :: Actor -> Bool Source #

Whether an actor is braced for combat this clip.

Assorted

type ActorDict = EnumMap ActorId Actor Source #

All actors on the level, indexed by actor identifier.

monsterGenChance :: AbsDepth -> AbsDepth -> Int -> Int -> Rnd Bool Source #

Chance that a new monster is generated. Currently depends on the number of monsters already present, and on the level. In the future, the strength of the character and the strength of the monsters present could further influence the chance, and the chance could also affect which monster is generated. How many and which monsters are generated will also depend on the cave kind used to build the level.

smellTimeout :: Delta Time Source #

How long until an actor's smell vanishes from a tile.