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

Safe Haskell | None
Language | Haskell2010

Game.LambdaHack.Common.Item

Contents

- Internal operations

Description

Weapons, treasure and all the other items in the game.

Synopsis

- data Item = Item {
  - jkind :: ItemIdentity
  - jfid :: Maybe FactionId
  - jflavour :: Flavour
  }
- data ItemIdentity
  - = IdentityObvious (ContentId ItemKind)
  - | IdentityCovered ItemKindIx (ContentId ItemKind)
- data ItemKindIx
- data ItemDisco
  - = ItemDiscoFull AspectRecord
  - | ItemDiscoMean KindMean
- data ItemFull = ItemFull {
  - itemBase :: Item
  - itemKindId :: ContentId ItemKind
  - itemKind :: ItemKind
  - itemDisco :: ItemDisco
  - itemSuspect :: Bool
  }
- type ItemFullKit = (ItemFull, ItemQuant)
- type DiscoveryKind = EnumMap ItemKindIx (ContentId ItemKind)
- type DiscoveryAspect = EnumMap ItemId AspectRecord
- type ItemIxMap = EnumMap ItemKindIx (EnumSet ItemId)
- data Benefit = Benefit {
  - benInEqp :: Bool
  - benPickup :: Double
  - benApply :: Double
  - benMelee :: Double
  - benFling :: Double
  }
- type DiscoveryBenefit = EnumMap ItemId Benefit
- data ItemTimer
- type ItemTimers = [ItemTimer]
- type ItemQuant = (Int, ItemTimers)
- type ItemBag = EnumMap ItemId ItemQuant
- type ItemDict = EnumMap ItemId Item
- toItemKindIx :: Word16 -> ItemKindIx
- quantSingle :: ItemQuant
- itemToFull6 :: COps -> DiscoveryKind -> DiscoveryAspect -> ItemId -> Item -> ItemFull
- aspectRecordFull :: ItemFull -> AspectRecord
- strongestSlot :: DiscoveryBenefit -> EqpSlot -> [(ItemId, ItemFullKit)] -> [(Int, (ItemId, ItemFullKit))]
- itemTimerZero :: ItemTimer
- createItemTimer :: Time -> Delta Time -> ItemTimer
- shiftItemTimer :: Delta Time -> ItemTimer -> ItemTimer
- deltaOfItemTimer :: Time -> ItemTimer -> Delta Time
- charging :: Time -> ItemTimer -> Bool
- ncharges :: Time -> ItemQuant -> Int
- hasCharge :: Time -> ItemQuant -> Bool
- strongestMelee :: Bool -> Maybe DiscoveryBenefit -> Time -> [(ItemId, ItemFullKit)] -> [(Double, Bool, Int, Int, ItemId, ItemFullKit)]
- unknownMeleeBonus :: [ItemFull] -> Bool
- unknownSpeedBonus :: [ItemFull] -> Bool
- conditionMeleeBonus :: [ItemFullKit] -> Int
- conditionSpeedBonus :: [ItemFullKit] -> Int
- armorHurtCalculation :: Bool -> Skills -> Skills -> Int
- mergeItemQuant :: ItemQuant -> ItemQuant -> ItemQuant
- listToolsToConsume :: [(ItemId, ItemFullKit)] -> [(ItemId, ItemFullKit)] -> [((CStore, Bool), (ItemId, ItemFullKit))]
- subtractIidfromGrps :: (EnumMap CStore ItemBag, [(CStore, (ItemId, ItemFull))], [(Bool, Int, GroupName ItemKind)]) -> ((CStore, Bool), (ItemId, ItemFullKit)) -> (EnumMap CStore ItemBag, [(CStore, (ItemId, ItemFull))], [(Bool, Int, GroupName ItemKind)])
- sortIids :: (ItemId -> ItemFull) -> [(ItemId, ItemQuant)] -> [(ItemId, ItemQuant)]
- data TileAction
  - = EmbedAction (ItemId, ItemQuant)
  - | ToAction (GroupName TileKind)
  - | WithAction [(Int, GroupName ItemKind)] (GroupName TileKind)
- parseTileAction :: Bool -> Bool -> [(ItemKind, (ItemId, ItemQuant))] -> Feature -> Maybe TileAction
- valueAtEqpSlot :: EqpSlot -> AspectRecord -> Int
- unknownAspect :: (Aspect -> [Dice]) -> ItemFull -> Bool
- countIidConsumed :: ItemFullKit -> [(Bool, Int, GroupName ItemKind)] -> (Int, Int, [(Bool, Int, GroupName ItemKind)])

# Documentation

data Item Source #

Game items in actor possesion or strewn around the dungeon. The information contained in this time is available to the player from the moment the item is first seen and is never mutated.

Some items are not created identified (`IdentityCovered`). Then they are presented as having a template kind that is really not their own, though usually close. Full kind information about item's kind is available through the `ItemKindIx` index once the item is identified and full information about the value of item's aspect record is available elsewhere (both `IdentityObvious` and `IdentityCovered` items may or may not need identification of their aspect record).

Constructors

Item |

Fields

- jkind :: ItemIdentity

  the kind of the item, or an indirection

- jfid :: Maybe FactionId

  the faction that created the item, if any

- jflavour :: Flavour

  flavour, always the real one, it's not hidden; people may not recognize shape, but they remember colour and old vs fancy look

#### Instances

Instances details

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

Instance details

Defined in Game.LambdaHack.Common.Item

Associated Types

type Rep Item |

Instance details

Defined in Game.LambdaHack.Common.Item

type Rep Item = D1 ('MetaData "Item" "Game.LambdaHack.Common.Item" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) (C1 ('MetaCons "Item" 'PrefixI 'True) (S1 ('MetaSel ('Just "jkind") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ItemIdentity) :*: (S1 ('MetaSel ('Just "jfid") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe FactionId)) :*: S1 ('MetaSel ('Just "jflavour") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Flavour))))

Methods

from :: Item -> Rep Item x Source #

to :: Rep Item x -> Item Source #

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

Instance details

Defined in Game.LambdaHack.Common.Item

type Rep Item = D1 ('MetaData "Item" "Game.LambdaHack.Common.Item" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) (C1 ('MetaCons "Item" 'PrefixI 'True) (S1 ('MetaSel ('Just "jkind") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ItemIdentity) :*: (S1 ('MetaSel ('Just "jfid") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe FactionId)) :*: S1 ('MetaSel ('Just "jflavour") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Flavour))))

data ItemIdentity Source #

Either the explicit obvious kind of the item or the kind it's hidden under, with the details covered under the index indirection.

Constructors

IdentityObvious (ContentId ItemKind) |
IdentityCovered ItemKindIx (ContentId ItemKind) |

#### Instances

Instances details

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

Instance details

Defined in Game.LambdaHack.Common.Item

Associated Types

type Rep ItemIdentity |

Instance details

Defined in Game.LambdaHack.Common.Item

type Rep ItemIdentity = D1 ('MetaData "ItemIdentity" "Game.LambdaHack.Common.Item" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) (C1 ('MetaCons "IdentityObvious" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ContentId ItemKind))) :+: C1 ('MetaCons "IdentityCovered" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ItemKindIx) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ContentId ItemKind))))

Methods

from :: ItemIdentity -> Rep ItemIdentity x Source #

to :: Rep ItemIdentity x -> ItemIdentity Source #

Show ItemIdentity Source # |
Instance details Defined in Game.LambdaHack.Common.Item Methods showsPrec :: Int -> ItemIdentity -> ShowS Source # show :: ItemIdentity -> String Source # showList :: [ItemIdentity] -> ShowS Source #
Eq ItemIdentity Source # |
Instance details Defined in Game.LambdaHack.Common.Item Methods (==) :: ItemIdentity -> ItemIdentity -> Bool Source # (/=) :: ItemIdentity -> ItemIdentity -> Bool Source #
Hashable ItemIdentity Source # |
Instance details Defined in Game.LambdaHack.Common.Item Methods hashWithSalt :: Int -> ItemIdentity -> Int Source # hash :: ItemIdentity -> Int Source #
type Rep ItemIdentity Source # |

Instance details

Defined in Game.LambdaHack.Common.Item

type Rep ItemIdentity = D1 ('MetaData "ItemIdentity" "Game.LambdaHack.Common.Item" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) (C1 ('MetaCons "IdentityObvious" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ContentId ItemKind))) :+: C1 ('MetaCons "IdentityCovered" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ItemKindIx) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (ContentId ItemKind))))

data ItemKindIx Source #

An index of the kind identifier of an item. Clients have partial knowledge how these idexes map to kind ids. They gain knowledge by identifying items. The indexes and kind identifiers are 1-1.

#### Instances

Instances details

Binary ItemKindIx Source # |
Instance details Defined in Game.LambdaHack.Common.Item Methods put :: ItemKindIx -> Put Source # get :: Get ItemKindIx Source # putList :: [ItemKindIx] -> Put Source #
Enum ItemKindIx Source # |

Instance details

Defined in Game.LambdaHack.Common.Item

Methods

succ :: ItemKindIx -> ItemKindIx Source #

pred :: ItemKindIx -> ItemKindIx Source #

toEnum :: Int -> ItemKindIx Source #

fromEnum :: ItemKindIx -> Int Source #

enumFrom :: ItemKindIx -> [ItemKindIx] Source #

enumFromThen :: ItemKindIx -> ItemKindIx -> [ItemKindIx] Source #

enumFromTo :: ItemKindIx -> ItemKindIx -> [ItemKindIx] Source #

enumFromThenTo :: ItemKindIx -> ItemKindIx -> ItemKindIx -> [ItemKindIx] Source #

Ix ItemKindIx Source # |

Instance details

Defined in Game.LambdaHack.Common.Item

Methods

range :: (ItemKindIx, ItemKindIx) -> [ItemKindIx] Source #

index :: (ItemKindIx, ItemKindIx) -> ItemKindIx -> Int Source #

unsafeIndex :: (ItemKindIx, ItemKindIx) -> ItemKindIx -> Int Source #

inRange :: (ItemKindIx, ItemKindIx) -> ItemKindIx -> Bool Source #

rangeSize :: (ItemKindIx, ItemKindIx) -> Int Source #

unsafeRangeSize :: (ItemKindIx, ItemKindIx) -> Int Source #

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

Instance details

Defined in Game.LambdaHack.Common.Item

Methods

compare :: ItemKindIx -> ItemKindIx -> Ordering Source #

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

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

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

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

max :: ItemKindIx -> ItemKindIx -> ItemKindIx Source #

min :: ItemKindIx -> ItemKindIx -> ItemKindIx Source #

Hashable ItemKindIx Source # |
Instance details Defined in Game.LambdaHack.Common.Item Methods hashWithSalt :: Int -> ItemKindIx -> Int Source # hash :: ItemKindIx -> Int Source #

data ItemDisco Source #

The secret part of the information about an item. If a faction knows the aspect record of the item, this is the complete secret information. Items that don't need second identification (the `kmConst` flag is set) may be identified or not and both cases are OK (their display flavour will differ and that may be the point).

Constructors

ItemDiscoFull AspectRecord |
ItemDiscoMean KindMean |

#### Instances

Instances details

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

Instance details

Defined in Game.LambdaHack.Common.Item

Methods

compare :: ItemDisco -> ItemDisco -> Ordering Source #

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

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

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

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

max :: ItemDisco -> ItemDisco -> ItemDisco Source #

min :: ItemDisco -> ItemDisco -> ItemDisco Source #

data ItemFull Source #

Full information about an item.

Constructors

ItemFull |

Fields

- itemBase :: Item
- itemKindId :: ContentId ItemKind
- itemKind :: ItemKind
- itemDisco :: ItemDisco
- itemSuspect :: Bool

#### Instances

Instances details

Show ItemFull Source # |
Instance details Defined in Game.LambdaHack.Common.Item Methods showsPrec :: Int -> ItemFull -> ShowS Source # show :: ItemFull -> String Source # showList :: [ItemFull] -> ShowS Source #

type ItemFullKit = (ItemFull, ItemQuant) Source #

type DiscoveryKind = EnumMap ItemKindIx (ContentId ItemKind) Source #

The map of item kind indexes to item kind ids. The full map, as known by the server, is 1-1. Because it's sparse and changes, we don't represent it as an (unboxed) vector, until it becomes a bottleneck (if ever, likely on JS, where only vectors are fast).

type DiscoveryAspect = EnumMap ItemId AspectRecord Source #

The map of item ids to item aspect record. The full map is known by the server.

type ItemIxMap = EnumMap ItemKindIx (EnumSet ItemId) Source #

The map of item kind indexes to identifiers of items that have that kind. Used to update data about items when their kinds become known, e.g., AI item use benefit data.

data Benefit Source #

The fields are, in order: 1. whether the item should be kept in equipment (not in stash) 2. the total benefit from picking the item up (to use or to put in equipment) 3. the benefit of applying the item to self 4. the (usually negative, for him) value of hitting a foe in melee with it 5. the (usually negative, for him) value of flinging the item at an opponent

Constructors

Benefit |

Fields

- benInEqp :: Bool
- benPickup :: Double
- benApply :: Double
- benMelee :: Double
- benFling :: Double

#### Instances

Instances details

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

Instance details

Defined in Game.LambdaHack.Common.Item

Associated Types

type Rep Benefit |

Instance details

Defined in Game.LambdaHack.Common.Item

type Rep Benefit = D1 ('MetaData "Benefit" "Game.LambdaHack.Common.Item" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) (C1 ('MetaCons "Benefit" 'PrefixI 'True) ((S1 ('MetaSel ('Just "benInEqp") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "benPickup") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Double)) :*: (S1 ('MetaSel ('Just "benApply") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Double) :*: (S1 ('MetaSel ('Just "benMelee") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Just "benFling") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Double)))))

Methods

from :: Benefit -> Rep Benefit x Source #

to :: Rep Benefit x -> Benefit Source #

Show Benefit Source # |
Instance details Defined in Game.LambdaHack.Common.Item Methods showsPrec :: Int -> Benefit -> ShowS Source # show :: Benefit -> String Source # showList :: [Benefit] -> ShowS Source #
type Rep Benefit Source # |

Instance details

Defined in Game.LambdaHack.Common.Item

type Rep Benefit = D1 ('MetaData "Benefit" "Game.LambdaHack.Common.Item" "LambdaHack-0.11.0.1-BLuOaw8nuizISmzkanqI8h" 'False) (C1 ('MetaCons "Benefit" 'PrefixI 'True) ((S1 ('MetaSel ('Just "benInEqp") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool) :*: S1 ('MetaSel ('Just "benPickup") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Double)) :*: (S1 ('MetaSel ('Just "benApply") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Double) :*: (S1 ('MetaSel ('Just "benMelee") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Just "benFling") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Double)))))

type DiscoveryBenefit = EnumMap ItemId Benefit Source #

data ItemTimer Source #

The absolute level's local time at which an item's copy becomes operational again. Even if item is not identified and so its timeout unknown, it's enough to compare this to the local level time to learn whether an item is recharged.

This schema causes timeout jumps for items in stash, but timeout is reset when items move, so this is a minor problem. Global time can't be used even only for items in stash, or exploit would be possible when an actor on a desolate level waits to recharge items for actors on a busy level. It's probably impossible to avoid such exploits or, otherwise, timeout jumps, particularly for faction where many actors move on many levels and so an item in stash is not used by a single actor at a time.

#### Instances

Instances details

Binary ItemTimer Source # |
Instance details Defined in Game.LambdaHack.Common.Item Methods put :: ItemTimer -> Put Source # get :: Get ItemTimer Source # putList :: [ItemTimer] -> Put Source #
Show ItemTimer Source # |
Instance details Defined in Game.LambdaHack.Common.Item Methods showsPrec :: Int -> ItemTimer -> ShowS Source # show :: ItemTimer -> String Source # showList :: [ItemTimer] -> ShowS Source #
Eq ItemTimer Source # |
Instance details Defined in Game.LambdaHack.Common.Item Methods (==) :: ItemTimer -> ItemTimer -> Bool Source # (/=) :: ItemTimer -> ItemTimer -> Bool Source #

type ItemTimers = [ItemTimer] Source #

type ItemQuant = (Int, ItemTimers) Source #

Number of items in a bag, together with recharging timer, in case of items that need recharging, exists only temporarily or auto-activate at regular intervals. Data invariant: the length of the timer should be less or equal to the number of items.

type ItemBag = EnumMap ItemId ItemQuant Source #

A bag of items, e.g., one of the stores of an actor or the items on a particular floor position or embedded in a particular map tile.

type ItemDict = EnumMap ItemId Item Source #

All items in the dungeon (including those carried by actors), indexed by item identifier.

toItemKindIx :: Word16 -> ItemKindIx Source #

quantSingle :: ItemQuant Source #

itemToFull6 :: COps -> DiscoveryKind -> DiscoveryAspect -> ItemId -> Item -> ItemFull Source #

aspectRecordFull :: ItemFull -> AspectRecord Source #

strongestSlot :: DiscoveryBenefit -> EqpSlot -> [(ItemId, ItemFullKit)] -> [(Int, (ItemId, ItemFullKit))] Source #

itemTimerZero :: ItemTimer Source #

createItemTimer :: Time -> Delta Time -> ItemTimer Source #

shiftItemTimer :: Delta Time -> ItemTimer -> ItemTimer Source #

deltaOfItemTimer :: Time -> ItemTimer -> Delta Time Source #

charging :: Time -> ItemTimer -> Bool Source #

ncharges :: Time -> ItemQuant -> Int Source #

hasCharge :: Time -> ItemQuant -> Bool Source #

strongestMelee :: Bool -> Maybe DiscoveryBenefit -> Time -> [(ItemId, ItemFullKit)] -> [(Double, Bool, Int, Int, ItemId, ItemFullKit)] Source #

unknownMeleeBonus :: [ItemFull] -> Bool Source #

unknownSpeedBonus :: [ItemFull] -> Bool Source #

conditionMeleeBonus :: [ItemFullKit] -> Int Source #

conditionSpeedBonus :: [ItemFullKit] -> Int Source #

armorHurtCalculation :: Bool -> Skills -> Skills -> Int Source #

Damage calculation. The armor and hurt skills are additive. They can't be multiplicative, because then 100% armor would minimize damage regardless of even 200% hurt skill. However, additive skills make the relative effectiveness of weapons dependent on the enemy, so even with -100% hurt skill a kinetic weapon can't be removed from the list, because an enemy may have negative armor skill. This is bad, but also KISS.

mergeItemQuant :: ItemQuant -> ItemQuant -> ItemQuant Source #

listToolsToConsume :: [(ItemId, ItemFullKit)] -> [(ItemId, ItemFullKit)] -> [((CStore, Bool), (ItemId, ItemFullKit))] Source #

subtractIidfromGrps :: (EnumMap CStore ItemBag, [(CStore, (ItemId, ItemFull))], [(Bool, Int, GroupName ItemKind)]) -> ((CStore, Bool), (ItemId, ItemFullKit)) -> (EnumMap CStore ItemBag, [(CStore, (ItemId, ItemFull))], [(Bool, Int, GroupName ItemKind)]) Source #

sortIids :: (ItemId -> ItemFull) -> [(ItemId, ItemQuant)] -> [(ItemId, ItemQuant)] Source #

data TileAction Source #

Constructors

EmbedAction (ItemId, ItemQuant) |
ToAction (GroupName TileKind) |
WithAction [(Int, GroupName ItemKind)] (GroupName TileKind) |

#### Instances

Instances details

Show TileAction Source # |
Instance details Defined in Game.LambdaHack.Common.Item Methods showsPrec :: Int -> TileAction -> ShowS Source # show :: TileAction -> String Source # showList :: [TileAction] -> ShowS Source #

parseTileAction :: Bool -> Bool -> [(ItemKind, (ItemId, ItemQuant))] -> Feature -> Maybe TileAction Source #

# Internal operations

valueAtEqpSlot :: EqpSlot -> AspectRecord -> Int Source #

unknownAspect :: (Aspect -> [Dice]) -> ItemFull -> Bool Source #

countIidConsumed :: ItemFullKit -> [(Bool, Int, GroupName ItemKind)] -> (Int, Int, [(Bool, Int, GroupName ItemKind)]) Source #