LambdaHack-0.11.0.1: A game engine library for tactical squad ASCII roguelike dungeon crawlers

Safe Haskell | None
Language | Haskell2010

Game.LambdaHack.Common.ItemAspect

Contents

- Internal operations

Description

The type of item aspects and its operations.

Synopsis

- data AspectRecord = AspectRecord {
  - aTimeout :: Int
  - aSkills :: Skills
  - aFlags :: Flags
  - aELabel :: Text
  - aToThrow :: ThrowMod
  - aPresentAs :: Maybe (GroupName ItemKind)
  - aEqpSlot :: Maybe EqpSlot
  }
- data KindMean = KindMean {
  - kmConst :: Bool
  - kmMean :: AspectRecord
  }
- emptyAspectRecord :: AspectRecord
- addMeanAspect :: AspectRecord -> Aspect -> AspectRecord
- castAspect :: AbsDepth -> AbsDepth -> AspectRecord -> Aspect -> Rnd AspectRecord
- aspectsRandom :: [Aspect] -> Bool
- aspectRecordToList :: AspectRecord -> [Aspect]
- rollAspectRecord :: [Aspect] -> AbsDepth -> AbsDepth -> Rnd AspectRecord
- getSkill :: Skill -> AspectRecord -> Int
- checkFlag :: Flag -> AspectRecord -> Bool
- meanAspect :: ItemKind -> AspectRecord
- onlyMinorEffects :: AspectRecord -> ItemKind -> Bool
- itemTrajectory :: AspectRecord -> ItemKind -> [Point] -> ([Vector], (Speed, Int))
- totalRange :: AspectRecord -> ItemKind -> Int
- isHumanTrinket :: ItemKind -> Bool
- goesIntoEqp :: AspectRecord -> Bool
- loreFromContainer :: AspectRecord -> Container -> SLore
- ceilingMeanDice :: Dice -> Int

# Documentation

data AspectRecord Source #

Record of skills conferred by an item as well as of item flags and other item aspects.

Constructors

AspectRecord |

Fields

- aTimeout :: Int
- aSkills :: Skills
- aFlags :: Flags
- aELabel :: Text
- aToThrow :: ThrowMod
- aPresentAs :: Maybe (GroupName ItemKind)
- aEqpSlot :: Maybe EqpSlot

#### Instances

Instances details

Binary AspectRecord Source # |
Instance details Defined in Game.LambdaHack.Common.ItemAspect Methods put :: AspectRecord -> Put Source # get :: Get AspectRecord Source # putList :: [AspectRecord] -> Put Source #
Generic AspectRecord Source # |

Instance details

Defined in Game.LambdaHack.Common.ItemAspect

Associated Types

type Rep AspectRecord |

Instance details

Defined in Game.LambdaHack.Common.ItemAspect

type Rep AspectRecord = D1 ('MetaData "AspectRecord" "Game.LambdaHack.Common.ItemAspect" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) (C1 ('MetaCons "AspectRecord" 'PrefixI 'True) ((S1 ('MetaSel ('Just "aTimeout") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: (S1 ('MetaSel ('Just "aSkills") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Skills) :*: S1 ('MetaSel ('Just "aFlags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Flags))) :*: ((S1 ('MetaSel ('Just "aELabel") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "aToThrow") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ThrowMod)) :*: (S1 ('MetaSel ('Just "aPresentAs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (GroupName ItemKind))) :*: S1 ('MetaSel ('Just "aEqpSlot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe EqpSlot))))))

Methods

from :: AspectRecord -> Rep AspectRecord x Source #

to :: Rep AspectRecord x -> AspectRecord Source #

Show AspectRecord Source # |
Instance details Defined in Game.LambdaHack.Common.ItemAspect Methods showsPrec :: Int -> AspectRecord -> ShowS Source # show :: AspectRecord -> String Source # showList :: [AspectRecord] -> ShowS Source #
Eq AspectRecord Source # |
Instance details Defined in Game.LambdaHack.Common.ItemAspect Methods (==) :: AspectRecord -> AspectRecord -> Bool Source # (/=) :: AspectRecord -> AspectRecord -> Bool Source #
Ord AspectRecord Source # |

Instance details

Defined in Game.LambdaHack.Common.ItemAspect

Methods

compare :: AspectRecord -> AspectRecord -> Ordering Source #

(<) :: AspectRecord -> AspectRecord -> Bool Source #

(<=) :: AspectRecord -> AspectRecord -> Bool Source #

(>) :: AspectRecord -> AspectRecord -> Bool Source #

(>=) :: AspectRecord -> AspectRecord -> Bool Source #

max :: AspectRecord -> AspectRecord -> AspectRecord Source #

min :: AspectRecord -> AspectRecord -> AspectRecord Source #

Hashable AspectRecord Source # |
Instance details Defined in Game.LambdaHack.Common.ItemAspect Methods hashWithSalt :: Int -> AspectRecord -> Int Source # hash :: AspectRecord -> Int Source #
type Rep AspectRecord Source # |

Instance details

Defined in Game.LambdaHack.Common.ItemAspect

type Rep AspectRecord = D1 ('MetaData "AspectRecord" "Game.LambdaHack.Common.ItemAspect" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) (C1 ('MetaCons "AspectRecord" 'PrefixI 'True) ((S1 ('MetaSel ('Just "aTimeout") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int) :*: (S1 ('MetaSel ('Just "aSkills") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Skills) :*: S1 ('MetaSel ('Just "aFlags") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Flags))) :*: ((S1 ('MetaSel ('Just "aELabel") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "aToThrow") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ThrowMod)) :*: (S1 ('MetaSel ('Just "aPresentAs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe (GroupName ItemKind))) :*: S1 ('MetaSel ('Just "aEqpSlot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe EqpSlot))))))

data KindMean Source #

Partial information about an item, deduced from its item kind. These are assigned to each `ItemKind`. The `kmConst` flag says whether the item's aspect record is constant rather than random or dependent on item creation dungeon level.

Constructors

KindMean |

Fields

- kmConst :: Bool

  whether the item doesn't need second identification

- kmMean :: AspectRecord

  mean value of item's possible aspect records

#### Instances

Instances details

Show KindMean Source # |
Instance details Defined in Game.LambdaHack.Common.ItemAspect Methods showsPrec :: Int -> KindMean -> ShowS Source # show :: KindMean -> String Source # showList :: [KindMean] -> ShowS Source #
Eq KindMean Source # |
Instance details Defined in Game.LambdaHack.Common.ItemAspect Methods (==) :: KindMean -> KindMean -> Bool Source # (/=) :: KindMean -> KindMean -> Bool Source #
Ord KindMean Source # |

Instance details

Defined in Game.LambdaHack.Common.ItemAspect

Methods

compare :: KindMean -> KindMean -> Ordering Source #

(<) :: KindMean -> KindMean -> Bool Source #

(<=) :: KindMean -> KindMean -> Bool Source #

(>) :: KindMean -> KindMean -> Bool Source #

(>=) :: KindMean -> KindMean -> Bool Source #

max :: KindMean -> KindMean -> KindMean Source #

min :: KindMean -> KindMean -> KindMean Source #

emptyAspectRecord :: AspectRecord Source #

addMeanAspect :: AspectRecord -> Aspect -> AspectRecord Source #

castAspect :: AbsDepth -> AbsDepth -> AspectRecord -> Aspect -> Rnd AspectRecord Source #

aspectsRandom :: [Aspect] -> Bool Source #

aspectRecordToList :: AspectRecord -> [Aspect] Source #

rollAspectRecord :: [Aspect] -> AbsDepth -> AbsDepth -> Rnd AspectRecord Source #

getSkill :: Skill -> AspectRecord -> Int Source #

checkFlag :: Flag -> AspectRecord -> Bool Source #

meanAspect :: ItemKind -> AspectRecord Source #

onlyMinorEffects :: AspectRecord -> ItemKind -> Bool Source #

itemTrajectory :: AspectRecord -> ItemKind -> [Point] -> ([Vector], (Speed, Int)) Source #

totalRange :: AspectRecord -> ItemKind -> Int Source #

isHumanTrinket :: ItemKind -> Bool Source #

goesIntoEqp :: AspectRecord -> Bool Source #

loreFromContainer :: AspectRecord -> Container -> SLore Source #

# Internal operations

ceilingMeanDice :: Dice -> Int Source #