-- | Temporary pseudo-organ (condition) definitions.
module Content.ItemKindTemporary
  ( temporaries
  ) where

import Prelude ()

import Game.LambdaHack.Core.Prelude

import Game.LambdaHack.Content.ItemKind
import Game.LambdaHack.Core.Dice
import Game.LambdaHack.Definition.Ability
import Game.LambdaHack.Definition.Color
import Game.LambdaHack.Definition.Defs
import Game.LambdaHack.Definition.Flavour

temporaries :: [ItemKind]
temporaries :: [ItemKind]
temporaries =
  [ItemKind
tmpStrengthened, ItemKind
tmpWeakened, ItemKind
tmpProtectedMelee, ItemKind
tmpProtectedRanged, ItemKind
tmpVulnerable, ItemKind
tmpResolute, ItemKind
tmpFast20, ItemKind
tmpSlow10, ItemKind
tmpFarSighted, ItemKind
tmpBlind, ItemKind
tmpKeenSmelling, ItemKind
tmpFoulSmelling, ItemKind
tmpRoseSmelling, ItemKind
tmpNoctovision, ItemKind
tmpDeafened, ItemKind
tmpDeaf, ItemKind
tmpDrunk, ItemKind
tmpBonusSkAggresion, ItemKind
tmpNoSkMove, ItemKind
tmpNoSkMelee, ItemKind
tmpNoSkDisplace, ItemKind
tmpNoSkAlter, ItemKind
tmpNoSkWait, ItemKind
tmpNoSkMoveItem, ItemKind
tmpNoSkProject, ItemKind
tmpNoSkApply, ItemKind
tmpBonusSkMove, ItemKind
tmpBonusSkMelee, ItemKind
tmpBonusSkDisplace, ItemKind
tmpBonusSkAlter, ItemKind
tmpBonusSkWait, ItemKind
tmpBonusSkMoveItem, ItemKind
tmpBonusSkProject, ItemKind
tmpBonusSkApply, ItemKind
tmpRegenerating, ItemKind
tmpPoisoned, ItemKind
tmpSlow10Resistant, ItemKind
tmpPoisonResistant]

tmpStrengthened,    tmpWeakened, tmpProtectedMelee, tmpProtectedRanged, tmpVulnerable, tmpResolute, tmpFast20, tmpSlow10, tmpFarSighted, tmpBlind, tmpKeenSmelling, tmpFoulSmelling, tmpRoseSmelling, tmpNoctovision, tmpDeafened, tmpDeaf, tmpDrunk, tmpBonusSkAggresion, tmpNoSkMove, tmpNoSkMelee, tmpNoSkDisplace, tmpNoSkAlter, tmpNoSkWait, tmpNoSkMoveItem, tmpNoSkProject, tmpNoSkApply, tmpBonusSkMove, tmpBonusSkMelee, tmpBonusSkDisplace, tmpBonusSkAlter, tmpBonusSkWait, tmpBonusSkMoveItem, tmpBonusSkProject, tmpBonusSkApply, tmpRegenerating, tmpPoisoned, tmpSlow10Resistant, tmpPoisonResistant :: ItemKind

-- The @name@ is be used in item description, so it should be an adjective
-- describing the temporary set of aspects.
-- The messages are needed also under @OnSmash@ to display when item removed
-- via @DropItem@ and not via natural periodic activation.
tmpAspects :: Text -> [Aspect] -> ItemKind
tmpAspects :: Text -> [Aspect] -> ItemKind
tmpAspects name :: Text
name aspects :: [Aspect]
aspects = $WItemKind :: Char
-> Text
-> Freqs ItemKind
-> [Flavour]
-> Dice
-> Rarity
-> Text
-> Int
-> Dice
-> [Aspect]
-> [Effect]
-> [(GroupName ItemKind, CStore)]
-> Text
-> ItemKind
ItemKind
  { isymbol :: Char
isymbol  = '+'
  , iname :: Text
iname    = Text
name
  , ifreq :: Freqs ItemKind
ifreq    = [(Text -> GroupName ItemKind
forall a. Text -> GroupName a
toGroupName Text
name, 1), ("condition", 1)]
  , iflavour :: [Flavour]
iflavour = [Color] -> [Flavour]
zipPlain [Color
BrWhite]
  , icount :: Dice
icount   = 1
  , irarity :: Rarity
irarity  = [(1, 1)]
  , iverbHit :: Text
iverbHit = "affect"
  , iweight :: Int
iweight  = 0
  , idamage :: Dice
idamage  = 0
  , iaspects :: [Aspect]
iaspects = -- timeout is 0; activates and vanishes soon,
               -- depending on initial timer setting
               [Aspect]
aspects [Aspect] -> [Aspect] -> [Aspect]
forall a. [a] -> [a] -> [a]
++ [Flag -> Aspect
SetFlag Flag
Periodic, Flag -> Aspect
SetFlag Flag
Fragile, Flag -> Aspect
SetFlag Flag
Condition]
  , ieffects :: [Effect]
ieffects = [ Effect -> Effect
OnSmash (Effect -> Effect) -> Effect -> Effect
forall a b. (a -> b) -> a -> b
$ Text -> Effect
verbMsgLess Text
name  -- announce partial neutralization
               -- not spamming for normal periodic wear each turn
               , Effect -> Effect
OnSmash (Effect -> Effect) -> Effect -> Effect
forall a b. (a -> b) -> a -> b
$ Text -> Effect
verbMsgNoLonger Text
name  -- for forced neutralization
               , Text -> Effect
verbMsgNoLonger Text
name ]  -- for periodic wear of last copy
  , idesc :: Text
idesc    = ""  -- no description needed; powers are enough
  , ikit :: [(GroupName ItemKind, CStore)]
ikit     = []
  }

tmpEffects :: Text -> Dice -> [Effect] -> ItemKind
tmpEffects :: Text -> Dice -> [Effect] -> ItemKind
tmpEffects name :: Text
name icount :: Dice
icount effects :: [Effect]
effects =
  let tmp :: ItemKind
tmp = Text -> [Aspect] -> ItemKind
tmpAspects Text
name []
  in ItemKind
tmp { Dice
icount :: Dice
icount :: Dice
icount
         , ieffects :: [Effect]
ieffects = [Effect]
effects [Effect] -> [Effect] -> [Effect]
forall a. [a] -> [a] -> [a]
++ ItemKind -> [Effect]
ieffects ItemKind
tmp
         }

tmpStrengthened :: ItemKind
tmpStrengthened = Text -> [Aspect] -> ItemKind
tmpAspects "strengthened" [Skill -> Dice -> Aspect
AddSkill Skill
SkHurtMelee 20]
tmpWeakened :: ItemKind
tmpWeakened = Text -> [Aspect] -> ItemKind
tmpAspects "weakened"
                         [Skill -> Dice -> Aspect
AddSkill Skill
SkHurtMelee (-30)]  -- don't cancel out ^
tmpProtectedMelee :: ItemKind
tmpProtectedMelee = Text -> [Aspect] -> ItemKind
tmpAspects "protected from melee"
                               [Skill -> Dice -> Aspect
AddSkill Skill
SkArmorMelee 50]
tmpProtectedRanged :: ItemKind
tmpProtectedRanged = Text -> [Aspect] -> ItemKind
tmpAspects "protected from ranged"
                                [Skill -> Dice -> Aspect
AddSkill Skill
SkArmorRanged 25]
tmpVulnerable :: ItemKind
tmpVulnerable = Text -> [Aspect] -> ItemKind
tmpAspects "defenseless" [ Skill -> Dice -> Aspect
AddSkill Skill
SkArmorMelee (-50)
                                         , Skill -> Dice -> Aspect
AddSkill Skill
SkArmorRanged (-25) ]
tmpResolute :: ItemKind
tmpResolute = Text -> [Aspect] -> ItemKind
tmpAspects "resolute" [Skill -> Dice -> Aspect
AddSkill Skill
SkMaxCalm 60]
tmpFast20 :: ItemKind
tmpFast20 = Text -> [Aspect] -> ItemKind
tmpAspects "hasted" [Skill -> Dice -> Aspect
AddSkill Skill
SkSpeed 20]
tmpSlow10 :: ItemKind
tmpSlow10 = Text -> [Aspect] -> ItemKind
tmpAspects "slowed" [Skill -> Dice -> Aspect
AddSkill Skill
SkSpeed (-10)]
tmpFarSighted :: ItemKind
tmpFarSighted = Text -> [Aspect] -> ItemKind
tmpAspects "far-sighted" [Skill -> Dice -> Aspect
AddSkill Skill
SkSight 5]
tmpBlind :: ItemKind
tmpBlind = Text -> [Aspect] -> ItemKind
tmpAspects "blind" [Skill -> Dice -> Aspect
AddSkill Skill
SkSight (-99)]
tmpKeenSmelling :: ItemKind
tmpKeenSmelling = Text -> [Aspect] -> ItemKind
tmpAspects "keen-smelling" [Skill -> Dice -> Aspect
AddSkill Skill
SkSmell 2]
tmpFoulSmelling :: ItemKind
tmpFoulSmelling = Text -> [Aspect] -> ItemKind
tmpAspects "foul-smelling" [Skill -> Dice -> Aspect
AddSkill Skill
SkOdor 2]
tmpRoseSmelling :: ItemKind
tmpRoseSmelling = Text -> [Aspect] -> ItemKind
tmpAspects "rose-smelling" [Skill -> Dice -> Aspect
AddSkill Skill
SkOdor (-4)]
tmpNoctovision :: ItemKind
tmpNoctovision = Text -> [Aspect] -> ItemKind
tmpAspects "shiny-eyed" [Skill -> Dice -> Aspect
AddSkill Skill
SkNocto 2]
tmpDeafened :: ItemKind
tmpDeafened = Text -> [Aspect] -> ItemKind
tmpAspects "deafened" [Skill -> Dice -> Aspect
AddSkill Skill
SkHearing (-10)]
tmpDeaf :: ItemKind
tmpDeaf = Text -> [Aspect] -> ItemKind
tmpAspects "deaf" [Skill -> Dice -> Aspect
AddSkill Skill
SkHearing (-99)]
tmpDrunk :: ItemKind
tmpDrunk = Text -> [Aspect] -> ItemKind
tmpAspects "drunk" [ Skill -> Dice -> Aspect
AddSkill Skill
SkHurtMelee 30  -- fury
                              , Skill -> Dice -> Aspect
AddSkill Skill
SkArmorMelee (-20)
                              , Skill -> Dice -> Aspect
AddSkill Skill
SkArmorRanged (-20)
                              , Skill -> Dice -> Aspect
AddSkill Skill
SkSight (-8)
                              ]
tmpBonusSkAggresion :: ItemKind
tmpBonusSkAggresion =
  Text -> [Aspect] -> ItemKind
tmpAspects "frenzied" [Skill -> Dice -> Aspect
AddSkill Skill
SkAggression 5]

tmpNoSkMove :: ItemKind
tmpNoSkMove =
  Text -> [Aspect] -> ItemKind
tmpAspects "immobile" [Skill -> Dice -> Aspect
AddSkill Skill
SkMove (-99)]
tmpNoSkMelee :: ItemKind
tmpNoSkMelee =
  Text -> [Aspect] -> ItemKind
tmpAspects "pacified" [Skill -> Dice -> Aspect
AddSkill Skill
SkMelee (-99)]
tmpNoSkDisplace :: ItemKind
tmpNoSkDisplace =
  Text -> [Aspect] -> ItemKind
tmpAspects "irreplaceable" [Skill -> Dice -> Aspect
AddSkill Skill
SkDisplace (-99)]
tmpNoSkAlter :: ItemKind
tmpNoSkAlter =
  Text -> [Aspect] -> ItemKind
tmpAspects "retaining" [Skill -> Dice -> Aspect
AddSkill Skill
SkAlter (-99)]
tmpNoSkWait :: ItemKind
tmpNoSkWait =
  Text -> [Aspect] -> ItemKind
tmpAspects "impatient" [Skill -> Dice -> Aspect
AddSkill Skill
SkWait (-99)]
tmpNoSkMoveItem :: ItemKind
tmpNoSkMoveItem =
  Text -> [Aspect] -> ItemKind
tmpAspects "dispossessed" [Skill -> Dice -> Aspect
AddSkill Skill
SkMoveItem (-99)]
tmpNoSkProject :: ItemKind
tmpNoSkProject =
  Text -> [Aspect] -> ItemKind
tmpAspects "withholding" [Skill -> Dice -> Aspect
AddSkill Skill
SkProject (-99)]
tmpNoSkApply :: ItemKind
tmpNoSkApply =
  Text -> [Aspect] -> ItemKind
tmpAspects "parsimonious" [Skill -> Dice -> Aspect
AddSkill Skill
SkApply (-99)]

tmpBonusSkMove :: ItemKind
tmpBonusSkMove =
  Text -> [Aspect] -> ItemKind
tmpAspects "more mobile" [Skill -> Dice -> Aspect
AddSkill Skill
SkMove 5]
tmpBonusSkMelee :: ItemKind
tmpBonusSkMelee =
  Text -> [Aspect] -> ItemKind
tmpAspects "more combative" [Skill -> Dice -> Aspect
AddSkill Skill
SkMelee 5]
tmpBonusSkDisplace :: ItemKind
tmpBonusSkDisplace =
  Text -> [Aspect] -> ItemKind
tmpAspects "more displacing" [Skill -> Dice -> Aspect
AddSkill Skill
SkDisplace 5]
tmpBonusSkAlter :: ItemKind
tmpBonusSkAlter =
  Text -> [Aspect] -> ItemKind
tmpAspects "more altering" [Skill -> Dice -> Aspect
AddSkill Skill
SkAlter 5]
tmpBonusSkWait :: ItemKind
tmpBonusSkWait =
  Text -> [Aspect] -> ItemKind
tmpAspects "more patient" [Skill -> Dice -> Aspect
AddSkill Skill
SkWait 5]
tmpBonusSkMoveItem :: ItemKind
tmpBonusSkMoveItem =
  Text -> [Aspect] -> ItemKind
tmpAspects "more tidy" [Skill -> Dice -> Aspect
AddSkill Skill
SkMoveItem 5]
tmpBonusSkProject :: ItemKind
tmpBonusSkProject =
  Text -> [Aspect] -> ItemKind
tmpAspects "more projecting" [Skill -> Dice -> Aspect
AddSkill Skill
SkProject 8]
    -- TODO: 11, but let player control potion throwing by henchmen;
    -- beware also of capReinforced and other sources of the skill
tmpBonusSkApply :: ItemKind
tmpBonusSkApply =
  Text -> [Aspect] -> ItemKind
tmpAspects "more practical" [Skill -> Dice -> Aspect
AddSkill Skill
SkApply 5]

tmpRegenerating :: ItemKind
tmpRegenerating =
  Text -> Dice -> [Effect] -> ItemKind
tmpEffects "regenerating" (4 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 1 Int -> Int -> Dice
`d` 2) [Int -> Effect
RefillHP 1]
tmpPoisoned :: ItemKind
tmpPoisoned =
  Text -> Dice -> [Effect] -> ItemKind
tmpEffects "poisoned" (4 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 1 Int -> Int -> Dice
`d` 2) [Int -> Effect
RefillHP (-1)]
tmpSlow10Resistant :: ItemKind
tmpSlow10Resistant =
  Text -> Dice -> [Effect] -> ItemKind
tmpEffects "slow resistant" (8 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 1 Int -> Int -> Dice
`d` 4)
             [Int -> Int -> CStore -> GroupName ItemKind -> Effect
DropItem 1 1 CStore
COrgan "slowed"]
tmpPoisonResistant :: ItemKind
tmpPoisonResistant =
  Text -> Dice -> [Effect] -> ItemKind
tmpEffects "poison resistant" (8 Dice -> Dice -> Dice
forall a. Num a => a -> a -> a
+ 1 Int -> Int -> Dice
`d` 4)
             [Int -> Int -> CStore -> GroupName ItemKind -> Effect
DropItem 1 Int
forall a. Bounded a => a
maxBound CStore
COrgan "poisoned"]