packages feed

Allure 0.4.4 → 0.4.6

raw patch · 14 files changed

+273/−136 lines, 14 filesdep ~LambdaHack

Dependency ranges changed: LambdaHack

Files

Allure.cabal view
@@ -1,9 +1,9 @@ cabal-version: >= 1.10 name:          Allure-version:       0.4.4+version:       0.4.6 license:       OtherLicense license-file:  LICENSE-tested-with:   GHC == 7.2.2, GHC == 7.4.1+tested-with:   GHC == 7.2.2, GHC == 7.4.1, GHC == 7.6.1 data-files:    LICENSE, CREDITS, PLAYING.md, README.md,                config.default, config.bot, scores author:        Andres Loeh, Mikolaj Konarski and others@@ -13,9 +13,7 @@                The game is barely fun at this stage and not yet                really Sci-Fi. See the wiki for design notes and contribute.                .-               New in this release are missiles flying for three turns-               (by an old kosmikus' idea), visual feedback for targeting-               and animations of combat and individual monster moves.+               New in this release are the Main Menu and improved squad combat.                Long term goals are high replayability and auto-balancing                through procedural content generation and persistent content                modification based on player behaviour.@@ -33,19 +31,21 @@   location:          git://github.com/Mikolaj/Allure.git  executable Allure+  hs-source-dirs:  src   main-is:         Main.hs   other-modules:   Content.ActorKind,                    Content.CaveKind,+                   Content.FactionKind,                    Content.ItemKind,                    Content.PlaceKind,                    Content.RuleKind,+                   Content.StrategyKind,                    Content.TileKind,                    Multiline,-                   ConfigDefault-  hs-source-dirs:  src-  other-modules:   Paths_Allure-  build-depends:   LambdaHack >= 0.2.1   && < 0.2.2,+                   Paths_Allure+  build-depends:   LambdaHack == 0.2.6,                    template-haskell >= 2.6 && < 3,+                    ConfigFile >= 1.1.1   && < 2,                    array      >= 0.3.0.3 && < 1,                    base       >= 4       && < 5,
PLAYING.md view
@@ -20,7 +20,8 @@ Terrain ------- -The goal of the hero is to explore an old, once luxurious space liner,+The heroes are marked on the map with symbol '@' and with '1', '2', ..., '9'.+Their goal is to explore an old, gigantic, once luxurious space liner, battle the horrors within, gather as much gold coins and precious gems as possible, and escape to tell the tale. The spaceship consists of many levels covered with varying terrain of the following basic kinds:@@ -55,8 +56,9 @@                 /|\       /|\                1 2 3     b j n -SHIFT (or CTRL) and a movement key make the hero run in the indicated-direction, until anything of interest is spotted. '5' and '.' skip a turn.+SHIFT (or CTRL) and a movement key make the selected hero run in the indicated+direction, until anything of interest is spotted. '5' and '.' use a turn+to brace for combat, which gives a chance to block blows next turn. Melee, searching for secret doors and opening closed doors can be done by bumping into a monster, a wall and a door, respectively. @@ -68,8 +70,9 @@                <       ascend a level*                >       descend a level*                ?       display help-               Q       quit without saving-               X       save and exit the game+               R       restart game*+               S       save game+               X       save and exit*                a       apply a consumable*                c       close a door*                d       drop an object*@@ -92,21 +95,23 @@ than the selected hero). The targeting commands and all the less used commands are listed below. None of them takes hero time. -               key     command-               ESC     cancel action-               RET     accept choice-               SPACE   clear messages-               TAB     cycle among heroes on level-               *       target monster-               /       target location-               D       dump current configuration-               P       display previous messages-               V       display game version-               [       target next shallower level-               ]       target next deeper level-               {       target 10 levels shallower-               }       target 10 levels deeper-               0--9    select a hero anywhere in the spaceship+               key       command+               ESC       cancel action+               RET       accept choice+               SPACE     clear messages+               TAB       cycle among heroes on level+               SHIFT-TAB cycle among heroes in the dungeon+               *         target monster+               +         swerve targeting line+               -         unswerve targeting line+               /         target location+               D         dump current configuration+               P         display previous messages+               [         target next shallower level+               ]         target next deeper level+               {         target 10 levels shallower+               }         target 10 levels deeper+               0--9      select a hero anywhere in the spaceship  There are also some debug and cheat keys, all entered with the CTRL key modifier. Use at your own peril!@@ -120,9 +125,9 @@ Monsters -------- -The hero is not alone in the spaceship. Monsters roam the dark halls+Heroes are not alone in the spaceship. Monsters roam the dark halls and crawl from damp air-ducts day and night. While heroes pay attention-to all other party members and take moves sequentially, one after another,+to all other party members and take care to move one at a time, monsters don't care about each other and all move at once, sometimes brutally colliding by accident. 
README.md view
@@ -26,9 +26,8 @@ Compatibility notes ------------------- -The current code was tested with GHC 7.2.2 and several pre-release versions-of GHC 7.4. A [few tweaks] [7] are needed to compile with 7.0-and some more are needed for 6.12.+The current code was tested with GHC 7.6.1, but probably works with GHC > 7.2.+A [few tweaks] [7] are needed to compile with 7.0.  If you are using the curses or vty frontends, numerical keypad may not work correctly depending on the versions
config.default view
@@ -25,6 +25,7 @@ ; plus: EpsIncr True ; minus: EpsIncr False ; Tab: HeroCycle+; ISO_Left_Tab: HeroBack ; ; ; ; Items. ; g: Pickup@@ -37,13 +38,13 @@ ; z: Project { verb = "zap", object = "mechanism", syms = "-" } ; t: Project { verb = "throw", object = "projectile", syms = "}{" } ; ;-; ; Saving or ending the game.-; X: GameSave-; Q: GameQuit+; ; Saving, exiting and restarting the game.+; X: GameExit+; R: GameRestart+; S: GameSave ; ; ; ; Information for the player. ; P: History-; V: Version ; question: Help ; D: CfgDump ; ;@@ -51,7 +52,7 @@ ; KP_Begin: Wait ; Escape: Cancel ; Return: Accept-; space: Redraw+; space: Clear  ; [dungeon] ; ; Fixed caves for the first levels, then randomly picked caves.@@ -81,8 +82,9 @@ ; HeroName_4: Samuel Saunders ; HeroName_5: Roger Robin ; baseHP: 50-; extraHeroes: 0+; extraHeroes: 2 ; firstDeathEnds: False+; faction: hero  ; [macros] ; ; This sections can be empty, but has to be there.
− src/ConfigDefault.hs
@@ -1,22 +0,0 @@-{-# LANGUAGE CPP, QuasiQuotes #-}--- Copyright (c) 2008--2011 Andres Loeh, 2010--2012 Mikolaj Konarski--- This file is a part of the computer game Allure of the Stars--- and is released under the terms of the GNU Affero General Public License.--- For license and copyright information, see the file LICENSE.------ | The default configurations file included via CPP as a Haskell string.-module ConfigDefault ( configDefault ) where--import Multiline---- Consider code.haskell.org/~dons/code/compiled-constants (dead link, BTW?)--- as soon as the config file grows very big.---- | The string containing the default configuration--- included from file config.default.--- Warning: cabal does not detect that the default config is changed,--- so touching this file is needed to reinclude config and recompile.-configDefault :: String-configDefault = [multiline|-#include "../config.default"-|]
src/Content/ActorKind.hs view
@@ -6,14 +6,15 @@ -- | Monsters and heroes for Allure of the Stars. module Content.ActorKind ( cdefs ) where +import Game.LambdaHack.Ability import Game.LambdaHack.Color-import qualified Game.LambdaHack.Content as Content+import Game.LambdaHack.CDefs import Game.LambdaHack.Content.ActorKind import Game.LambdaHack.Random import Game.LambdaHack.Time -cdefs :: Content.CDefs ActorKind-cdefs = Content.CDefs+cdefs :: CDefs ActorKind+cdefs = CDefs   { getSymbol = asymbol   , getName = aname   , getFreq = afreq@@ -34,6 +35,7 @@   , asmell  = False   , aiq     = 13  -- Can see hidden doors, when he is under alien control.   , aregen  = 500+  , acanDo  = [minBound..maxBound]   }  projectile = ActorKind  -- includes homing missiles@@ -47,24 +49,26 @@   , asmell  = False   , aiq     = 0   , aregen  = maxBound+  , acanDo  = [Track]   }  eye = ActorKind   { asymbol = 'r'   , aname   = "deranged household robot"-  , afreq   = [("monster", 60), ("summon", 50)]+  , afreq   = [("robot", 60), ("summon", 50)]   , acolor  = BrYellow-  , ahp     = RollDice 3 4+  , ahp     = RollDice 7 4   , aspeed  = toSpeed 2   , asight  = True   , asmell  = False   , aiq     = 8   , aregen  = 100+  , acanDo  = [minBound..maxBound]   } fastEye = ActorKind   { asymbol = 'm'   , aname   = "deformed monkey"-  , afreq   = [("monster", 15)]+  , afreq   = [("animal", 15)]   , acolor  = BrMagenta   , ahp     = RollDice 1 4   , aspeed  = toSpeed 4@@ -72,16 +76,18 @@   , asmell  = False   , aiq     = 12   , aregen  = 5  -- Regenerates fast (at max HP most of the time!).+  , acanDo  = [minBound..maxBound]   } nose = ActorKind   { asymbol = 'h'   , aname   = "tentacled horror"-  , afreq   = [("monster", 20), ("summon", 100)]+  , afreq   = [("alien", 20), ("summon", 100)]   , acolor  = Green-  , ahp     = RollDice 7 2+  , ahp     = RollDice 17 2   , aspeed  = toSpeed 1.8   , asight  = False   , asmell  = True   , aiq     = 0   , aregen  = 100+  , acanDo  = [minBound..maxBound]   }
src/Content/CaveKind.hs view
@@ -8,13 +8,13 @@  import Data.Ratio -import qualified Game.LambdaHack.Content as Content+import Game.LambdaHack.CDefs import Game.LambdaHack.Misc import Game.LambdaHack.Random as Random import Game.LambdaHack.Content.CaveKind -cdefs :: Content.CDefs CaveKind-cdefs = Content.CDefs+cdefs :: CDefs CaveKind+cdefs = CDefs   { getSymbol = csymbol   , getName = cname   , getFreq = cfreq@@ -40,7 +40,7 @@   , cdoorChance   = 1%2   , copenChance   = 1%10   , chiddenChance = 1%5-  , citemNum      = RollDice 5 2+  , citemNum      = RollDice 7 2   , cdefaultTile    = "fillerWall"   , ccorridorTile   = "darkCorridor"   , cfillerTile     = "fillerWall"@@ -57,7 +57,7 @@   , cdarkChance   = (RollDice 1 80, RollDice 1 60)   , cvoidChance   = 1%3   , cnonVoidMin   = 2-  , citemNum      = RollDice 3 2  -- few rooms+  , citemNum      = RollDice 4 2  -- few rooms   , cdefaultTile  = "floorArenaLit"   , ccorridorTile = "path"   }@@ -72,7 +72,7 @@   , cvoidChance   = 3%4   , cnonVoidMin   = 1   , cminStairDist = 50-  , citemNum      = RollDice 6 2  -- whole floor strewn with treasure+  , citemNum      = RollDice 8 2  -- whole floor strewn with treasure   , cdefaultTile  = "floorRoomLit"   , ccorridorTile = "floorRoomLit"   }@@ -85,7 +85,7 @@   , cdarkChance   = (RollDice 1 80, RollDice 1 40)   , cvoidChance   = 0   , cnonVoidMin   = 0-  , citemNum      = RollDice 3 2  -- few rooms+  , citemNum      = RollDice 4 2  -- few rooms   , cdefaultTile  = "noiseSet"   , ccorridorTile = "path"   }
+ src/Content/FactionKind.hs view
@@ -0,0 +1,63 @@+-- Copyright (c) 2008--2011 Andres Loeh, 2010--2012 Mikolaj Konarski+-- This file is a part of the computer game Allure of the Stars+-- and is released under the terms of the GNU Affero General Public License.+-- For license and copyright information, see the file LICENSE.+--+-- | Game factions (heroes, enemies, NPCs, etc.) for Allure of the Stars.+module Content.FactionKind ( cdefs ) where++import Game.LambdaHack.CDefs+import Game.LambdaHack.Content.FactionKind++cdefs :: CDefs FactionKind+cdefs = CDefs+  { getSymbol = fsymbol+  , getName = fname+  , getFreq = ffreq+  , validate = fvalidate+  , content =+      [hero, alien, animal, robot]+  }+hero,        alien, animal, robot :: FactionKind++hero = FactionKind+  { fsymbol     = '@'+  , fname       = "hero"+  , ffreq       = [("hero", 1), ("playable", 50)]+  , fAiSelected = "noAbility"  -- no AI, fully manual control+  , fAiIdle     = "meleeAdjacent"+  , fenemy      = ["alien"]+  , fally       = []+  }++-- Includes alien-operated robots, alien-conditioned animals and hybrids.+alien = FactionKind+  { fsymbol     = 'a'+  , fname       = "alien"+  , ffreq       = [("alien", 1), ("playable", 50), ("spawn", 1)]+  , fAiSelected = "fullAbility"+  , fAiIdle     = "fullAbility"+  , fenemy      = ["hero"]+  , fally       = []+  }++animal = FactionKind+  { fsymbol     = 'd'+  , fname       = "animal"+  , ffreq       = [("animal", 1), ("spawn", 50)]+  , fAiSelected = "fullAbility"+  , fAiIdle     = "fullAbility"+  , fenemy      = ["hero", "alien"]  -- animals hunt external intruders+  , fally       = []+  }++-- Autonomous robots.+robot = FactionKind+  { fsymbol     = 'r'+  , fname       = "robot"+  , ffreq       = [("robot", 1), ("spawn", 30)]+  , fAiSelected = "fullAbility"+  , fAiIdle     = "fullAbility"+  , fenemy      = ["hero", "alien", "animal", "robot"]  -- hunt all that moves+  , fally       = []+  }
src/Content/ItemKind.hs view
@@ -9,14 +9,14 @@ import qualified Data.List as L  import Game.LambdaHack.Color-import qualified Game.LambdaHack.Content as Content+import Game.LambdaHack.CDefs import Game.LambdaHack.Effect import Game.LambdaHack.Flavour import Game.LambdaHack.Random import Game.LambdaHack.Content.ItemKind -cdefs :: Content.CDefs ItemKind-cdefs = Content.CDefs+cdefs :: CDefs ItemKind+cdefs = CDefs   { getSymbol = isymbol   , getName = iname   , getFreq = ifreq@@ -182,7 +182,7 @@ scroll = ItemKind   { isymbol  = '?'   , iname    = "tablet"-  , ifreq    = [("dng", 6)]+  , ifreq    = [("dng", 4)]   , iflavour = zipFancy darkCol  -- arcane and old   , ieffect  = NoEffect   , icount   = intToDeep 1@@ -196,8 +196,7 @@   { ieffect  = SummonFriend   } scroll2 = scroll-  { ifreq    = [("dng", 3)]-  , ieffect  = SummonEnemy+  { ieffect  = SummonEnemy   } scroll3 = scroll   { ieffect  = Descend
src/Content/PlaceKind.hs view
@@ -6,11 +6,11 @@ -- | Rooms, halls and passages for Allure of the Stars. module Content.PlaceKind ( cdefs ) where -import qualified Game.LambdaHack.Content as Content+import Game.LambdaHack.CDefs import Game.LambdaHack.Content.PlaceKind -cdefs :: Content.CDefs PlaceKind-cdefs = Content.CDefs+cdefs :: CDefs PlaceKind+cdefs = CDefs   { getSymbol = psymbol   , getName = pname   , getFreq = pfreq
src/Content/RuleKind.hs view
@@ -1,9 +1,10 @@+{-# LANGUAGE CPP, QuasiQuotes #-} -- Copyright (c) 2008--2011 Andres Loeh, 2010--2012 Mikolaj Konarski -- This file is a part of the computer game Allure of the Stars -- and is released under the terms of the GNU Affero General Public License. -- For license and copyright information, see the file LICENSE. ----- | Game rules and assorted data for Allure of the Stars.+-- | Game rules and assorted game setup data for Allure of the Stars. module Content.RuleKind ( cdefs ) where  -- Cabal@@ -12,10 +13,11 @@ import Game.LambdaHack.Content.RuleKind import Game.LambdaHack.Content.TileKind import qualified Game.LambdaHack.Feature as F-import qualified Game.LambdaHack.Content as Content+import Game.LambdaHack.CDefs+import Multiline -cdefs :: Content.CDefs RuleKind-cdefs = Content.CDefs+cdefs :: CDefs RuleKind+cdefs = CDefs   { getSymbol = rsymbol   , getName = rname   , getFreq = rfreq@@ -39,4 +41,55 @@   , rpathsVersion  = Self.version   , ritemMelee     = "/|\\"   , ritemProject   = "!?,-~}{"-  }+  -- The string containing the default configuration+  -- included from file config.default.+  -- Warning: cabal does not detect that the default config is changed,+  -- so touching this file is needed to reinclude config and recompile.+  -- Note: consider code.haskell.org/~dons/code/compiled-constants+  -- as soon as the config file grows very big.+  , rconfigDefault = [multiline|+#include "../../config.default"+|]+  -- ASCII art for the Main Menu. Only pure 7-bit ASCII characters are+  -- allowed. The picture should be exactly 24 rows by 80 columns,+  -- plus an extra frame of any charecters that is ignored for all purposes.+  -- For a different screen size, the picture is centered and the outermost+  -- rows and columns cloned. When displayed in the Main Menu screen,+  -- it's overwritten with the game version string and keybinding strings.+  -- The game version string begins and ends with a space and is placed+  -- in the very bottom right corner. The keybindings overwrite places+  -- marked with 25 left curly brace signs '{' in a row. The sign is forbidden+  -- everywhere else. Exactly five such places with 25 left braces+  -- are required, at most one per row, and all are overwritten+  -- with text that is flushed left and padded with spaces.+  -- The Main Menu is displayed dull white on black.+  -- TODO: Highlighted keybinding is in inverse video or bright white on grey+  -- background. The spaces that pad keybindings are not highlighted.+  , rmainMenuArt   = [multiline|+----------------------------------------------------------------------------------+|                                                                                |+|                                                                                |+|                      >> Allure of the Stars <<                                 |+|                                                                                |+|                                                                                |+|                                                                                |+|                      {{{{{{{{{{{{{{{{{{{{{{{{{                                 |+|                                                                                |+|                      {{{{{{{{{{{{{{{{{{{{{{{{{                                 |+|                                                                                |+|                      {{{{{{{{{{{{{{{{{{{{{{{{{                                 |+|                                                                                |+|                      {{{{{{{{{{{{{{{{{{{{{{{{{                                 |+|                                                                                |+|                      {{{{{{{{{{{{{{{{{{{{{{{{{                                 |+|                                                                                |+|                                                                                |+|                                                                                |+|                                                                                |+|                                                                                |+|                                                                                |+|                                                                                |+|                                                                                |+|                        Version X.X.X (frontend: gtk, engine: LambdaHack X.X.X) |+----------------------------------------------------------------------------------+|]}
+ src/Content/StrategyKind.hs view
@@ -0,0 +1,57 @@+-- Copyright (c) 2008--2011 Andres Loeh, 2010--2012 Mikolaj Konarski+-- This file is a part of the computer game Allure of the Stars+-- and is released under the terms of the GNU Affero General Public License.+-- For license and copyright information, see the file LICENSE.+--+-- | AI strategies for Allure of the Stars.+module Content.StrategyKind ( cdefs ) where++import Game.LambdaHack.Ability+import Game.LambdaHack.CDefs+import Game.LambdaHack.Content.StrategyKind++cdefs :: CDefs StrategyKind+cdefs = CDefs+  { getSymbol = ssymbol+  , getName = sname+  , getFreq = sfreq+  , validate = svalidate+  , content =+      [noAbility, onlyFollowTrack, meleeAdjacent, meleeAndRanged, fullAbility]+  }+noAbility,        onlyFollowTrack, meleeAdjacent, meleeAndRanged, fullAbility :: StrategyKind++noAbility = StrategyKind  -- not even projectiles will fly+  { ssymbol    = '@'+  , sname      = "noAbility"+  , sfreq      = [("noAbility", 1)]+  , sabilities = []+  }++onlyFollowTrack = StrategyKind  -- projectiles enabled+  { ssymbol    = '@'+  , sname      = "onlyFollowTrack"+  , sfreq      = [("onlyFollowTrack", 1)]+  , sabilities = [Track]+  }++meleeAdjacent = StrategyKind+  { ssymbol    = '@'+  , sname      = "meleeAdjacent"+  , sfreq      = [("meleeAdjacent", 1)]+  , sabilities = [Melee, Track]+  }++meleeAndRanged = StrategyKind  -- melee and reaction fire+  { ssymbol    = '@'+  , sname      = "meleeAndRanged"+  , sfreq      = [("meleeAndRanged", 1)]+  , sabilities = [Melee, Ranged, Track]+  }++fullAbility = StrategyKind+  { ssymbol    = '@'+  , sname      = "fullAbility"+  , sfreq      = [("fullAbility", 1)]+  , sabilities = [minBound..maxBound]+  }
src/Content/TileKind.hs view
@@ -7,14 +7,14 @@ module Content.TileKind ( cdefs ) where  import Game.LambdaHack.Color-import qualified Game.LambdaHack.Content as Content+import Game.LambdaHack.CDefs import qualified Game.LambdaHack.Effect as Effect import Game.LambdaHack.Feature import Game.LambdaHack.Content.TileKind import Game.LambdaHack.Random -cdefs :: Content.CDefs TileKind-cdefs = Content.CDefs+cdefs :: CDefs TileKind+cdefs = CDefs   { getSymbol = tsymbol   , getName = tname   , getFreq = tfreq
src/Main.hs view
@@ -8,57 +8,32 @@ -- resulting in an executable game. module Main ( main ) where -import Data.Maybe--import qualified Game.LambdaHack.Display as Display import qualified Game.LambdaHack.Kind as Kind import qualified Content.ActorKind import qualified Content.CaveKind+import qualified Content.FactionKind import qualified Content.ItemKind import qualified Content.PlaceKind import qualified Content.RuleKind+import qualified Content.StrategyKind import qualified Content.TileKind-import qualified Game.LambdaHack.Start as Start-import Game.LambdaHack.Command-import Game.LambdaHack.Display-import qualified Game.LambdaHack.Config as Config+import Game.LambdaHack.Turn import Game.LambdaHack.Action-import qualified Game.LambdaHack.BindingAction as BindingAction--import qualified ConfigDefault---- | Gather together the content and verify its consistency.-cops :: Kind.COps-cops = Kind.COps-  { coactor = Kind.createOps Content.ActorKind.cdefs-  , cocave  = Kind.createOps Content.CaveKind.cdefs-  , coitem  = Kind.createOps Content.ItemKind.cdefs-  , coplace = Kind.createOps Content.PlaceKind.cdefs-  , corule  = Kind.createOps Content.RuleKind.cdefs-  , cotile  = Kind.createOps Content.TileKind.cdefs-  }---- | Wire together config, content and the definitions of game commands--- to form the starting game session. Evaluate to check for errors.-sess :: Config.CP -> FrontendSession -> Session-sess config sfs =-  let !skeyb = BindingAction.stdBinding config cmdSemantics cmdDescription-      !scops = cops-  in Session{..}---- | Create the starting game config from the default config file--- and initialize the engine with the starting session.-start :: IO (String, FrontendSession -> IO ())-start = do-  config <- Config.mkConfig ConfigDefault.configDefault-  -- The only option taken not from conif in savegame, but from fresh config.-  let configFont = fromMaybe "" $ Config.getOption config "ui" "font"-  return (configFont, Start.start config . sess config)+import Game.LambdaHack.BindingAction --- | Fire up the frontend with the engine fueled by config and content.+-- | Fire up the frontend with the engine fueled by content. -- Which of the frontends is run depends on the flags supplied -- when compiling the engine library. main :: IO ()-main = do-  (configFont, loop) <- start-  Display.startup configFont loop+main =+  let cops = Kind.COps+        { coactor = Kind.createOps Content.ActorKind.cdefs+        , cocave  = Kind.createOps Content.CaveKind.cdefs+        , cofact  = Kind.createOps Content.FactionKind.cdefs+        , coitem  = Kind.createOps Content.ItemKind.cdefs+        , coplace = Kind.createOps Content.PlaceKind.cdefs+        , corule  = Kind.createOps Content.RuleKind.cdefs+        , costrat = Kind.createOps Content.StrategyKind.cdefs+        , cotile  = Kind.createOps Content.TileKind.cdefs+        }+  in startFrontend cops stdBinding handleTurn