    {-# LANGUAGE TemplateHaskell #-}
    -- | Game rules and assorted game setup data.
    module Content.RuleKind
      ( standardRules
      ) where

    import Prelude ()

    import Game.LambdaHack.Core.Prelude

    import qualified Data.Ini.Reader as Ini
    import           Instances.TH.Lift ()
    import           Language.Haskell.TH.Syntax
    import           System.FilePath
    import           System.IO
      (IOMode (ReadMode), hGetContents, hSetEncoding, openFile, utf8)

    -- Cabal
    import qualified Paths_LambdaHack as Self (version)

    import Game.LambdaHack.Content.ItemKind (ItemSymbolsUsedInEngine (..))
    import Game.LambdaHack.Content.RuleKind
    import Game.LambdaHack.Definition.DefsInternal

    standardRules :: RuleContent
    standardRules :: RuleContent
    standardRules = RuleContent
      { rtitle :: SectionName
    rtitle = SectionName
    "LambdaHack"
      , rWidthMax :: X
    rWidthMax = X
    80
      , rHeightMax :: X
    rHeightMax = X
    21
      , rexeVersion :: Version
    rexeVersion = Version
    Self.version
      -- The strings containing the default configuration file
      -- included from config.ui.default.
      , rcfgUIName :: SectionName
    rcfgUIName = SectionName
    "config.ui" SectionName -> SectionName -> SectionName
    <.> SectionName
    "ini"
      , rcfgUIDefault :: (Text, Config)
    rcfgUIDefault = $(do
          let path = "GameDefinition" </> "config.ui" <.> "default"
          qAddDependentFile path
          !s <- qRunIO $ do
            inputHandle <- openFile path ReadMode
            hSetEncoding inputHandle utf8
            hGetContents inputHandle
          let !cfgUIDefault =
                either (error . ("Ini.parse of default config" `showFailure`)) id
                $ Ini.parse s
          lift (s, cfgUIDefault))
      , rwriteSaveClips :: X
    rwriteSaveClips = X
    1000
      , rleadLevelClips :: X
    rleadLevelClips = X
    50
      , rscoresFileName :: SectionName
    rscoresFileName = SectionName
    "LambdaHack.scores"
      , rnearby :: X
    rnearby = X
    20
      , rstairWordCarried :: [Text]
    rstairWordCarried = [Text
    "staircase"]  -- only one, so inert
      , ritemSymbols :: ItemSymbolsUsedInEngine
    ritemSymbols = ItemSymbolsUsedInEngine
          { rsymbolProjectile :: Char
    rsymbolProjectile = Char -> Char
    forall c. Char -> Char
    toContentSymbol Char
    '|'
          , rsymbolLight :: Char
    rsymbolLight      = Char -> Char
    forall c. Char -> Char
    toContentSymbol Char
    '('
          , rsymbolTool :: Char
    rsymbolTool       = Char -> Char
    forall c. Char -> Char
    toContentSymbol Char
    '('
          , rsymbolSpecial :: Char
    rsymbolSpecial    = Char -> Char
    forall c. Char -> Char
    toContentSymbol Char
    '*'
                                  -- don't overuse; it clashes with projectiles
          , rsymbolGold :: Char
    rsymbolGold       = Char -> Char
    forall c. Char -> Char
    toContentSymbol Char
    '$'
                                  -- also gems
          , rsymbolNecklace :: Char
    rsymbolNecklace   = Char -> Char
    forall c. Char -> Char
    toContentSymbol Char
    '"'
          , rsymbolRing :: Char
    rsymbolRing       = Char -> Char
    forall c. Char -> Char
    toContentSymbol Char
    '='
          , rsymbolPotion :: Char
    rsymbolPotion     = Char -> Char
    forall c. Char -> Char
    toContentSymbol Char
    '!'
                                  -- also concoction, bottle, jar, vial
          , rsymbolFlask :: Char
    rsymbolFlask      = Char -> Char
    forall c. Char -> Char
    toContentSymbol Char
    '!'
          , rsymbolScroll :: Char
    rsymbolScroll     = Char -> Char
    forall c. Char -> Char
    toContentSymbol Char
    '?'
                                  -- also book, note, tablet, card
          , rsymbolTorsoArmor :: Char
    rsymbolTorsoArmor = Char -> Char
    forall c. Char -> Char
    toContentSymbol Char
    '['
          , rsymbolMiscArmor :: Char
    rsymbolMiscArmor  = Char -> Char
    forall c. Char -> Char
    toContentSymbol Char
    '['
          , rsymbolClothes :: Char
    rsymbolClothes    = Char -> Char
    forall c. Char -> Char
    toContentSymbol Char
    '['
          , rsymbolShield :: Char
    rsymbolShield     = Char -> Char
    forall c. Char -> Char
    toContentSymbol Char
    ']'
          , rsymbolPolearm :: Char
    rsymbolPolearm    = Char -> Char
    forall c. Char -> Char
    toContentSymbol Char
    ')'
          , rsymbolEdged :: Char
    rsymbolEdged      = Char -> Char
    forall c. Char -> Char
    toContentSymbol Char
    ')'
          , rsymbolHafted :: Char
    rsymbolHafted     = Char -> Char
    forall c. Char -> Char
    toContentSymbol Char
    ')'
          , rsymbolWand :: Char
    rsymbolWand       = Char -> Char
    forall c. Char -> Char
    toContentSymbol Char
    '/'
                                  -- also magical rod, pistol, instrument
          , rsymbolFood :: Char
    rsymbolFood       = Char -> Char
    forall c. Char -> Char
    toContentSymbol Char
    ','
              -- also body part; distinct enough from floor, which is middle dot
          }
      }