packages feed

ironforge 0.1.0.15 → 0.1.0.17

raw patch · 3 files changed

+109/−8 lines, 3 filesdep ~antisplice

Dependency ranges changed: antisplice

Files

Game/Antisplice/Dungeon/Ironforge.hs view
@@ -41,11 +41,12 @@ import System.Chatty.Misc import Text.Chatty.Extended.Printer import Game.Antisplice+import Game.Antisplice.Dungeon.Ironforge.School import Control.Monad import Control.Monad.Error.Class import Data.Monoid -ironforge :: Constructor+ironforge :: Constructor () ironforge = do   --  IRONFORGE : THE GREAT FORGE   greatForge <- constructRoom $ do@@ -55,7 +56,9 @@             ("Dear traveler,\n\nit might occur that this is your first dungeon. "++              "You can play it by just typing in what you want to do, for instance "++              "\"go east\" or \"look at green sign\". By the time you will learn new "++-             "actions by just trying them.\n\n"+++             "actions by just trying them. Alternatively, you might want to visit our "+++             "Dungeon School. You can reach it by typing \"descend\". It will teach "+++             "you everything you need to know.\n\n"++              "Ironforge is a dungeon that primarily plays in Azeroth, but includes "++              "places and scenes from other narrations or reality. Most are intended "++              "to be funny, but since the implementor is a fag you shouldn't expect "++@@ -68,8 +71,8 @@         mprintLn "**"         mprintLn "** This is not a stable branch, but rather a technical demo."         mprintLn "**"-        mprintLn "** Antisplice (c) 2014 Marvin Cohrs"-        mprintLn "** Ironforge  (c) 2014 Marvin Cohrs"+        mprintLn "** Antisplice (c) 2014 Marvin Cohrs (http://hackage.haskell.org/package/antisplice)"+        mprintLn "** Ironforge  (c) 2014 Marvin Cohrs (http://hackage.haskell.org/package/ironforge)"       mprintLn ""       --mprint "How may I call you? " >> mflush       --mscanLn >>= (mputv "user" . Literal)@@ -233,6 +236,11 @@     addRoomObject $ do       ctorMob "Karl-Heinz" ["kalle","karl-heinz","teacher"] "Karl-Heinz is an old maths teacher. Strange, but harmless." ["strange","harmless","old"]       ctorRoute [stationC,broeleC,broele1EC,broeleC,broele1WC,broele2WC,broele1WC,broeleC] 10000++  -- The School+  (schoolStart,schoolEnd) <- school+  unipath greatForge schoolStart Down+  unipath schoolEnd greatForge Up          -- Player   steDef <- registerStereoM $ do
+ Game/Antisplice/Dungeon/Ironforge/School.hs view
@@ -0,0 +1,93 @@+{-# LANGUAGE FlexibleContexts #-}++{-+  This module is part of Ironforge.+  Copyfree (f) 2014 Marvin Cohrs++  All wrongs revoked. Sharing is an act of love, not crime.+  Please share Ironforge with everyone you like.+  +  Redistribution and use in source and binary forms, with or without modification,+  are permitted provided that the following conditions are met:++      * Redistributions of source code must retain the above copyright notice,+        this list of conditions and the following disclaimer.+      * Redistributions in binary form must reproduce the above copyright notice,+        this list of conditions and the following disclaimer in the documentation+        and/or other materials provided with the distribution.+      * Neither the name of Marvin Cohrs nor the names of other+        contributors may be used to endorse or promote products derived+        from this software without specific prior written permission.+  +  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR+  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,+  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,+  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR+  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF+  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING+  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS+  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.+-}++module Game.Antisplice.Dungeon.Ironforge.School where++import Text.Chatty.Printer+import Text.Chatty.Scanner+import Text.Chatty.Expansion+import Text.Chatty.Expansion.Vars+import System.Chatty.Misc+import Text.Chatty.Extended.Printer+import Game.Antisplice+import Game.Antisplice.Utils.Graph+import Control.Monad+import Control.Monad.Error.Class+import Data.Monoid++school :: Constructor (NodeId,NodeId)+school = do+  start <- constructRoom $ do+    ctorRoom "The Dungeon School" "Here you will learn to play this dungeon."+    addRoomObject $ do+      ctorSign+        ("This dungeon consists of multiple rooms. Whenever you enter a room you haven't seen before, the room name and a description appear:\n\n"+          ++"    %{D5;The Great Forge}\n"+          ++"    %{D2;This is the Great Forge.}\n\n"+          ++"In most cases the description will tell you something about people and objects in this room, but that's not always the case. "+          ++"Keep your eyes, ears and nose open.\nYou may now enter \"list exits\" (or short \"ex\") to get a list of ways you can take "+          ++"to leave this room. After that, type \"go west\" (or short \"w\")."+        )+        ["big","rusty"]+      addDescSeg "You see a big rusty sign on the wall. Possibly you might want to read it?"+  room2 <- constructRoom $ do+    ctorRoom "The Right Path" "In this room there are actually some things around."+    addRoomObject $ do+      ctorSign+        ("The next door is locked and opens only after you have killed Justin. So... why not give it a try?\n"+         ++"Justin is strong and at the moment you're unarmed. Take the sword lying to your feet, that will make you stronger. "+         ++"You can equip it using \"equip sword\" (after you have taken it into your inventory!). "+         ++"To see your current strength, you may just type \"list score\" (or short \"sco\"); likewise you can see your current "+         ++"equipment by entering \"list equipment\" (or short \"eq\").\n"+         ++"When you're finished with preparations, repeatedly enter \"hit justin\" and see how his health decreases. "+         ++"After that you might want to look around (\"look\" or short \"l\") and then continue with the next lesson."+        ) ["green","instructory"]+      addDescSeg "On one wall there is a green instructory sign."+  justin <- withRoom room2 $ addRoomObject $ ctorMob "%{V1;Justin}" ["justin"] "This is Justin. You know you hate him. Give him what he deserves." []+  sword <- withRoom room2 $ addRoomObject $ do+    ctorAcq "a rusty old sword" "This sword is rusty and old, but it will serve for now." ["sword","blade"] ["rusty","old"]+    addEquipSlot MainHand+    swordSte <- registerStereo $ statsStereo $+      \get k -> case k of+        Strength -> 8+        _ -> 0+    addFeature $ Stereo Worn swordSte+  bipath start room2 West+  end <- constructRoom $ ctorRoom "Exit of the Dungeon School" "To be continued. Type \"ascend\" to return to the ordinary world :)"+  guardedPath room2 end West $ do+    rs <- roomOfObject justin+    case rs of+      [] -> return True+      _ -> return False+  return (start,end)
ironforge.cabal view
@@ -10,7 +10,7 @@ -- PVP summary:      +-+------- breaking API changes --                   | | +----- non-breaking API additions --                   | | | +--- code changes with no API change-version:             0.1.0.15+version:             0.1.0.17  -- A short (one-line) description of the package. synopsis:            A technical demo for Antisplice.@@ -46,9 +46,9 @@ cabal-version:       >=1.10  library-  exposed-modules:  Game.Antisplice.Dungeon.Ironforge+  exposed-modules:  Game.Antisplice.Dungeon.Ironforge, Game.Antisplice.Dungeon.Ironforge.School -  build-depends:       base >=4.6 && <4.7, chatty >=0.5.2 && <0.6, antisplice >=0.12 && <0.13, mtl >= 2.1 && < 2.2, transformers >= 0.3 && < 0.4+  build-depends:       base >=4.6 && <4.7, chatty >=0.5.2 && <0.6, antisplice >=0.13 && <0.14, mtl >= 2.1 && < 2.2, transformers >= 0.3 && < 0.4    default-language: Haskell2010 @@ -64,7 +64,7 @@   other-extensions:    FlexibleContexts      -- Other library packages from which modules are imported.-  build-depends:       base >=4.6 && <4.7, chatty >=0.5.2 && <0.6, antisplice >=0.12 && <0.13, mtl >= 2.1 && < 2.2, transformers >= 0.3 && < 0.4+  build-depends:       base >=4.6 && <4.7, chatty >=0.5.2 && <0.6, antisplice >=0.13 && <0.14, mtl >= 2.1 && < 2.2, transformers >= 0.3 && < 0.4      -- Directories containing source files.   -- hs-source-dirs: