Safe Haskell | None |
---|---|
Language | Haskell2010 |
The type of kinds of weapons, treasure, organs, blasts, etc.
Synopsis
- data ItemKind = ItemKind {}
- makeData :: [ItemKind] -> ContentData ItemKind
- data Effect
- = Burn Dice
- | Explode (GroupName ItemKind)
- | RefillHP Int
- | RefillCalm Int
- | Dominate
- | Impress
- | Summon (GroupName ItemKind) Dice
- | Ascend Bool
- | Escape
- | Paralyze Dice
- | InsertMove Dice
- | Teleport Dice
- | CreateItem CStore (GroupName ItemKind) TimerDice
- | DropItem Int Int CStore (GroupName ItemKind)
- | PolyItem
- | Identify
- | Detect DetectKind Int
- | SendFlying ThrowMod
- | PushActor ThrowMod
- | PullActor ThrowMod
- | DropBestWeapon
- | ActivateInv Char
- | ApplyPerfume
- | OneOf [Effect]
- | OnSmash Effect
- | Recharging Effect
- | Composite [Effect]
- | Temporary Text
- data DetectKind
- data TimerDice
- data ThrowMod = ThrowMod {
- throwVelocity :: Int
- throwLinger :: Int
- data Feature
- data ItemSpeedup
- emptyItemSpeedup :: ItemSpeedup
- getKindMean :: ContentId ItemKind -> ItemSpeedup -> KindMean
- speedupItem :: ContentData ItemKind -> ItemSpeedup
- boostItemKindList :: StdGen -> [ItemKind] -> [ItemKind]
- forApplyEffect :: Effect -> Bool
- onlyMinorEffects :: ItemKind -> Bool
- filterRecharging :: [Effect] -> [Effect]
- stripRecharging :: [Effect] -> [Effect]
- stripOnSmash :: [Effect] -> [Effect]
- strengthOnSmash :: ItemKind -> [Effect]
- getDropOrgans :: ItemKind -> [GroupName ItemKind]
- getToThrow :: ItemKind -> ThrowMod
- getHideAs :: ItemKind -> Maybe (GroupName ItemKind)
- getEqpSlot :: ItemKind -> Maybe EqpSlot
- isEffEscape :: Effect -> Bool
- isEffAscend :: Effect -> Bool
- isEffEscapeOrAscend :: Effect -> Bool
- isMelee :: ItemKind -> Bool
- isTmpCondition :: ItemKind -> Bool
- isBlast :: ItemKind -> Bool
- isHumanTrinket :: ItemKind -> Bool
- goesIntoEqp :: ItemKind -> Bool
- goesIntoInv :: ItemKind -> Bool
- goesIntoSha :: ItemKind -> Bool
- itemTrajectory :: ItemKind -> [Point] -> ([Vector], (Speed, Int))
- totalRange :: ItemKind -> Int
- damageUsefulness :: ItemKind -> Double
- tmpNoLonger :: Text -> Effect
- tmpLess :: Text -> Effect
- toVelocity :: Int -> Feature
- toLinger :: Int -> Feature
- timerNone :: TimerDice
- isTimerNone :: TimerDice -> Bool
- foldTimer :: a -> (Dice -> a) -> (Dice -> a) -> TimerDice -> a
- toOrganBad :: GroupName ItemKind -> Dice -> Effect
- toOrganGood :: GroupName ItemKind -> Dice -> Effect
- toOrganNoTimer :: GroupName ItemKind -> Effect
- meanAspect :: ItemKind -> AspectRecord
- boostItemKind :: ItemKind -> ItemKind
- majorEffect :: Effect -> Bool
- validateSingle :: ItemKind -> [Text]
- validateAll :: [ItemKind] -> ContentData ItemKind -> [Text]
- validateDups :: ItemKind -> Feature -> [Text]
- validateDamage :: Dice -> [Text]
- hardwiredItemGroups :: [GroupName ItemKind]
Documentation
Item properties that are fixed for a given kind of items.
Note that this type is mutually recursive with Effect
and Feature
.
ItemKind | |
|
Instances
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.
Burn Dice | burn with this damage |
Explode (GroupName ItemKind) | explode producing this group of blasts |
RefillHP Int | modify HP of the actor by this amount |
RefillCalm Int | modify Calm of the actor by this amount |
Dominate | change actor's allegiance |
Impress | make actor susceptible to domination |
Summon (GroupName ItemKind) Dice | summon the given number of actors of this group |
Ascend Bool | ascend to another level of the dungeon |
Escape | escape from the dungeon |
Paralyze Dice | paralyze for this many game clips |
InsertMove Dice | give free time to actor of this many actor turns |
Teleport Dice | teleport actor across rougly this distance |
CreateItem CStore (GroupName ItemKind) TimerDice | create an item of the group and insert into the store with the given random timer |
DropItem Int Int CStore (GroupName ItemKind) | make the actor drop items of the given group from the given store; the first integer says how many item kinds to drop, the second, how many copies of each kind to drop; for non-organs, beware of not dropping all, or cluttering store with rubbish becomes beneficial |
PolyItem | find a suitable (i.e., numerous enough) item, starting from the floor, and polymorph it randomly |
Identify | find a suitable (i.e., not identified) item, starting from the floor, and identify it |
Detect DetectKind Int | detect something on the map in the given radius |
SendFlying ThrowMod | send an actor flying (push or pull, depending) |
PushActor ThrowMod | push an actor |
PullActor ThrowMod | pull an actor |
DropBestWeapon | make the actor drop its best weapon |
ActivateInv Char | activate all items with this symbol in inventory; space character means all symbols |
ApplyPerfume | remove all smell on the level |
OneOf [Effect] | trigger one of the effects with equal probability |
OnSmash Effect | trigger the effect when item smashed (not when applied nor meleed) |
Recharging Effect | this effect inactive until timeout passes |
Composite [Effect] | only fire next effect if previous fully activated |
Temporary Text | the item is temporary, vanishes at even void Periodic activation, unless Durable and not Fragile, and shows message with this verb at last copy activation or at each activation unless Durable and Fragile |
Instances
data DetectKind Source #
Instances
Specification of how to randomly roll a timer at item creation to obtain a fixed timer for the item's lifetime.
Instances
Eq TimerDice Source # | |
Show TimerDice Source # | |
Generic TimerDice Source # | |
Binary TimerDice Source # | |
NFData TimerDice Source # | |
Defined in Game.LambdaHack.Content.ItemKind | |
type Rep TimerDice Source # | |
Defined in Game.LambdaHack.Content.ItemKind type Rep TimerDice = D1 (MetaData "TimerDice" "Game.LambdaHack.Content.ItemKind" "LambdaHack-0.8.1.2-9Fmfvbfsr9xEInnejydwaW" False) (C1 (MetaCons "TimerNone" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "TimerGameTurn" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Dice)) :+: C1 (MetaCons "TimerActorTurn" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Dice)))) |
Parameters modifying a throw of a projectile or flight of pushed actor. Not additive and don't start at 0.
ThrowMod | |
|
Instances
Eq ThrowMod Source # | |
Ord ThrowMod Source # | |
Defined in Game.LambdaHack.Content.ItemKind | |
Show ThrowMod Source # | |
Generic ThrowMod Source # | |
Binary ThrowMod Source # | |
NFData ThrowMod Source # | |
Defined in Game.LambdaHack.Content.ItemKind | |
type Rep ThrowMod Source # | |
Defined in Game.LambdaHack.Content.ItemKind type Rep ThrowMod = D1 (MetaData "ThrowMod" "Game.LambdaHack.Content.ItemKind" "LambdaHack-0.8.1.2-9Fmfvbfsr9xEInnejydwaW" False) (C1 (MetaCons "ThrowMod" PrefixI True) (S1 (MetaSel (Just "throwVelocity") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Int) :*: S1 (MetaSel (Just "throwLinger") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Int))) |
Features of item. Affect only the item in question, not the actor carrying it, and so not additive in any sense.
ELabel Text | extra label of the item; it's not pluralized |
Fragile | drop and break at target tile, even if no hit |
Lobable | drop at target tile, even if no hit |
Durable | don't break even when hitting or applying |
ToThrow ThrowMod | parameters modifying a throw |
HideAs (GroupName ItemKind) | until identified, presents as this unique kind |
Equipable | AI and UI flag: consider equipping (independent of
|
Meleeable | AI and UI flag: consider meleeing with |
Precious | AI and UI flag: don't risk identifying by use; also, can't throw or apply if not calm enough |
Tactic Tactic | overrides actor's tactic; WIP; move? |
Blast | the item is an explosion blast particle |
EqpSlot EqpSlot | AI and UI flag that leaks item intended use |
Unique | at most one copy can ever be generated |
Periodic | in eqp, triggered as often as |
MinorEffects | override: the effects on this item are considered minor and so not causing identification on use, and so this item will identify on pick-up |
Instances
data ItemSpeedup Source #
Map from an item kind identifier to the mean aspect value for the kind.
Significant portions of this map are unused and so intentially kept unevaluated.
Instances
Eq ItemSpeedup Source # | |
Defined in Game.LambdaHack.Content.ItemKind (==) :: ItemSpeedup -> ItemSpeedup -> Bool # (/=) :: ItemSpeedup -> ItemSpeedup -> Bool # | |
Show ItemSpeedup Source # | |
Defined in Game.LambdaHack.Content.ItemKind showsPrec :: Int -> ItemSpeedup -> ShowS # show :: ItemSpeedup -> String # showList :: [ItemSpeedup] -> ShowS # | |
Generic ItemSpeedup Source # | |
Defined in Game.LambdaHack.Content.ItemKind type Rep ItemSpeedup :: * -> * # from :: ItemSpeedup -> Rep ItemSpeedup x # to :: Rep ItemSpeedup x -> ItemSpeedup # | |
type Rep ItemSpeedup Source # | |
Defined in Game.LambdaHack.Content.ItemKind type Rep ItemSpeedup = D1 (MetaData "ItemSpeedup" "Game.LambdaHack.Content.ItemKind" "LambdaHack-0.8.1.2-9Fmfvbfsr9xEInnejydwaW" True) (C1 (MetaCons "ItemSpeedup" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Vector KindMean)))) |
getKindMean :: ContentId ItemKind -> ItemSpeedup -> KindMean Source #
forApplyEffect :: Effect -> Bool Source #
Whether the effect has a chance of exhibiting any potentially
noticeable behaviour, except when the item is destroyed.
We assume at least one of OneOf
effects must be noticeable.
onlyMinorEffects :: ItemKind -> Bool Source #
filterRecharging :: [Effect] -> [Effect] Source #
stripRecharging :: [Effect] -> [Effect] Source #
stripOnSmash :: [Effect] -> [Effect] Source #
strengthOnSmash :: ItemKind -> [Effect] Source #
getToThrow :: ItemKind -> ThrowMod Source #
isEffEscape :: Effect -> Bool Source #
isEffAscend :: Effect -> Bool Source #
isEffEscapeOrAscend :: Effect -> Bool Source #
isTmpCondition :: ItemKind -> Bool Source #
isHumanTrinket :: ItemKind -> Bool Source #
goesIntoEqp :: ItemKind -> Bool Source #
goesIntoInv :: ItemKind -> Bool Source #
goesIntoSha :: ItemKind -> Bool Source #
totalRange :: ItemKind -> Int Source #
damageUsefulness :: ItemKind -> Double Source #
tmpNoLonger :: Text -> Effect Source #
toVelocity :: Int -> Feature Source #
isTimerNone :: TimerDice -> Bool Source #
Internal operations
meanAspect :: ItemKind -> AspectRecord Source #
boostItemKind :: ItemKind -> ItemKind Source #
majorEffect :: Effect -> Bool Source #
validateSingle :: ItemKind -> [Text] Source #
Catch invalid item kind definitions.
validateAll :: [ItemKind] -> ContentData ItemKind -> [Text] Source #
Validate all item kinds.
validateDamage :: Dice -> [Text] Source #