packages feed

ironforge 0.1.0.20 → 0.1.0.22

raw patch · 4 files changed

+362/−170 lines, 4 filesdep ~antisplice

Dependency ranges changed: antisplice

Files

Game/Antisplice/Dungeon/Ironforge.hs view
@@ -41,6 +41,8 @@ import System.Chatty.Misc import Text.Chatty.Extended.Printer import Game.Antisplice+import Game.Antisplice.Dungeon.Ironforge.Cambridge+import Game.Antisplice.Dungeon.Ironforge.IronforgeCity import Game.Antisplice.Dungeon.Ironforge.School import Control.Monad import Control.Monad.Error.Class@@ -48,154 +50,9 @@  ironforge :: Constructor () ironforge = do-  --  IRONFORGE : THE GREAT FORGE-  greatForge <- constructRoom $ do-    ctorRoom "The Great Forge" "This is the Great Forge."-    addRoomObject $ do-      ctorSign-            ("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. 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 "++-             "too much.\n\nAnyways, have fun and good luck :)")-            ["green"]-      addDescSeg "On one wall there is a green sign. Type \"read sign\" to read it."-    onFirstEnter $ do-      ebracket (Vivid Yellow) $ do-        mprintLn "** Welcome to IRONFORGE, an experimental dungeon on top of Antisplice."-        mprintLn "**"-        mprintLn "** This is not a stable branch, but rather a technical demo."-        mprintLn "**"-        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)-      mputv "user" $ Literal "Bernd"-      mprintLn ""-      mnomask =<< expand "Alright $user, here you are!\n"-      mprintLn ""-      -  --  IRONFORGE : THE MILITARY WARD-  militaryW <- constructRoom $ do-    ctorRoom "The Military Ward" "This is where the anti-terror act of the Asocial Network will happen."-  cangaroo <- withRoom militaryW $ addRoomObject $ do-    ctorMob "a cangaroo" ["cangaroo","communist"] "This is a communist cangaroo, who has fought for Vietcong." []-  withObject cangaroo $ do-    onFirstSight $ do-      let laugh :: Handler-          laugh = guardObjectInRoom cangaroo militaryW $ do-            mprintLn "\"Haha!\", the cangaroo says and laughs."-            schedule 10000 laugh-      schedule 10000 laugh-  bipath greatForge militaryW SouthEast-  -  --  IRONFORGE : THE COMMONS-  commonsW <- constructRoom $ do-    ctorRoom "The Commons" "Here you see the bank and the auction house."-    addRoomObject $ do-      ctorAcq "a cup" "One might fill this with coffee." ["cup"] []-      addDescSeg "There is a cup lying on the floor."-  unipath greatForge commonsW South-  unipath greatForge commonsW West-  unipath commonsW greatForge NorthEast-  bipath commonsW militaryW East-   -  --  IRONFORGE : THE TAVERN-  tavernW <- constructRoom $ do-    ctorRoom "The Tavern" "This is the tavern of Ironforge. It is known for its strong beer, so you might want to try one. To the west there is the toilet. The exit is to the east."-    addRoomObject $ do-      ctorAcq "a rusty dagger" "This is a rusty old dagger, probably lost by a rouge." ["dagger"] ["rusty","old"]-      addDescSeg "A rusty old dagger lies on the ground."-      addEquipSlot MainHand-      addEquipSlot OffHand-      rustyDaggerSte <- registerStereo $ statsStereo $-        \get k -> case k of-          AttackPower -> 7-          _ -> 0-      addFeature $ Stereo Worn $ rustyDaggerSte-  unipath tavernW commonsW East-  withRoom commonsW $ do-    addRoomObject $ do-      ctorRoomNesting "the tavern" "This is the Ironforge tavern." ["tavern"] [] tavernW-      addDescSeg "Straight in front of you there is the tavern of Ironforge."-      -  --  IRONFORGE : THE TAVERN'S TOILET-  toiletW <- constructRoom $ do-    ctorRoom "The Toilet" "This is the tavern's toilet."-  withRoom toiletW $ addRoomObject $ do-      ctorMob "%{V1;I}%{V2;g}%{D1;o}%{D2;r}" ["igor"] "This is Igor. I guess he doesn't like you." []-      setMobRoute [tavernW]-      o <- getObjectState-      onSight $ schedule 0 $ guardRoom toiletW $ do-        mprintLn "You enter the occupied toilet and see Igor sitting on the pot."-        mprintLn "\"Oops, I'm sorry.\", you say and quickly return to the main room."-        enterAndAnnounce tavernW-        schedule 3000 $ continueMobRoute $ objectIdOf o-  bipath toiletW tavernW East-  -  --  IRONFORGE : THE MYSTIC WARD-  mysticSte <- registerStereoM $ do-    mergeStereo $ statsStereo $-      \get k -> case k of-        Intelligence -> get Intelligence * 99-        _ -> 0-    mergeSkill $ skill "pray" !+ implyGlobalCooldownA !+ bareAction (\_ -> mprintLn "You're falling to your knees praying.\nYou stand up again.")-  mysticW <- constructRoom $ do-    ctorRoom "The Mystic Ward" "Here you will find a lot of mages."-    addRoomObject $ do-      addFeature $ Stereo Near mysticSte-      addDescSeg "You feel intellectual."-  bipath greatForge mysticW NorthWest-  bipath commonsW mysticW North-  -  --  IRONFORGE : THE FORLORN CAVERN-  cavernW <- constructRoom $ ctorRoom "The Forlorn Cavern" "Uncanny."-  guardedPath mysticW cavernW East $ return False-  unipath cavernW mysticW West-  -  --  IRONFORGE : HALL OF EXPLORERS-  halloeW <- constructRoom $ ctorRoom "Hall of Explorers" "Here you can be rewarded."-  bipath cavernW halloeW East-  bipath greatForge halloeW NorthEast-  -  --  IRONFORGE : TINKER TOWN-  tinkerW <- constructRoom $ ctorRoom "Tinker Town" "Engineers all around you."-  bipath halloeW tinkerW South-  bipath tinkerW militaryW South-    -  -- IRONFORGE : DEEPRUN TRAM STATION-  stationW <- constructRoom $ do-    ctorRoom "Ironforge Deeprun Tram Station" "This is the tram station of Ironforge, Dun Morogh."-    addRoomObject $ ctorMob "the station overseer" ["overseer"]-      "This is the badly-paid station overseer. His job is to answer all your questions, but probably he won't be that friendly."-      ["badly-paid","unfriendly"]-  bipath tinkerW stationW East-  -  -- CAMBRIDGE : DEEPRUN TRAM STATION-  stationC <- constructRoom $ do-    ctorRoom "Cambridge Deeprun Tram Station" "This is the tram station of Cambridge, Massachusetts."-    addRoomObject $ addDescSeg "On the right there are stairs." -- TODO: Introduce OnUse-    addRoomObject $ do-      ctorMob "the station overseer" ["overseer","murderer"]-        "This one is a very special case. The company didn't check his background, so they hired a recorded murderer. I'd better keep in distance."-        ["recorded"]-      murdererA <- newAtom-      putAtom murdererA 0-      onLook $ do-        a <- getAtom murdererA-        case a :: Int of-          0 -> mprintLn "This one is a very special case. The company didn't check his background, so they hired a recorded murderer. I'd better keep in distance."-          1 -> mprintLn "He comes somewhat nearer."-          2 -> mprintLn "He stands just three meters away from you."-          3 -> mprintLn "The murderer finally arrives at you." >> schedule 2000 (eprintLn (Vivid Red) "The murderer takes his knife and kills you." >> throwError QuitError)-          _ -> noneM-        putAtom murdererA (a+1)+  money <- registerCurrency "Money" "Money is measured in Iron Dollars."+  (greatForge, stationW, commonsW) <- ironforgeCity+  stationC <- cambridge money            -- Tram   insertVocab "tram" Noun@@ -220,24 +77,6 @@         mprintLn "You have arrived at your destination: Ironforge, Dun Morogh."         enterAndAnnounce stationW         -  -- CAMBRIDGE : GERT BROELEMANN AVENUE-  broeleC <- constructRoom $ ctorRoom "Gert Broelemann Avenue" "This is a long street to the east and to the west. You see the entrance to the Deeprun Tram."-  bipath stationC broeleC Up-  let broeleAv = constructRoom $ ctorRoom "Gert Broelemann Avenue" "This is a long street to the east and to the west."-  broele1WC <- broeleAv-  bipath broeleC broele1WC West-  broele2WC <- broeleAv-  bipath broele1WC broele2WC West-  unipath broele2WC broele2WC West-  broele1EC <- broeleAv-  bipath broeleC broele1EC East-  -  -- Kalle-  withRoom broeleC $ do-    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@@ -261,3 +100,4 @@     setStatM Haste 5     setStatM CooldownDuration 1000     addStereo steDef+    modifyCurrency money (+2000)
+ Game/Antisplice/Dungeon/Ironforge/Cambridge.hs view
@@ -0,0 +1,164 @@+{-# LANGUAGE FlexibleContexts, RankNTypes #-}++{-+  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.Cambridge 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+import Text.Printf++cambridge :: CurrencyId -> Constructor NodeId+cambridge money = do+  -- CAMBRIDGE : DEEPRUN TRAM STATION+  stationC <- constructRoom $ do+    ctorRoom "Cambridge Deeprun Tram Station" "This is the tram station of Cambridge, Massachusetts."+    addRoomObject $ addDescSeg "On the right there are stairs." -- TODO: Introduce OnUse+    addRoomObject $ do+      ctorMob "the station overseer" ["overseer","murderer"]+        "This one is a very special case. The company didn't check his background, so they hired a recorded murderer. I'd better keep in distance."+        ["recorded"]+      murdererA <- newAtom+      putAtom murdererA 0+      onLook $ do+        a <- getAtom murdererA+        case a :: Int of+          0 -> mprintLn "This one is a very special case. The company didn't check his background, so they hired a recorded murderer. I'd better keep in distance."+          1 -> mprintLn "He comes somewhat nearer."+          2 -> mprintLn "He stands just three meters away from you."+          3 -> mprintLn "The murderer finally arrives at you." >> schedule 2000 (eprintLn (Vivid Red) "The murderer takes his knife and kills you." >> throwError QuitError)+          _ -> noneM+        putAtom murdererA (a+1)++  -- CAMBRIDGE : GERT BROELEMANN AVENUE+  broeleC <- constructRoom $ ctorRoom "Gert Broelemann Avenue" "This is a long street to the east and to the west. You see the entrance to the Deeprun Tram."+  bipath stationC broeleC Up+  let broeleAv = constructRoom $ ctorRoom "Gert Broelemann Avenue" "This is a long street to the east and to the west."+  broele1WC <- broeleAv+  bipath broeleC broele1WC West+  broele2WC <- broeleAv+  bipath broele1WC broele2WC West+  broele3WC <- broeleAv+  bipath broele2WC broele3WC West+  unipath broele3WC broele3WC West+  broele1EC <- broeleAv+  bipath broeleC broele1EC East+  unipath broele1EC broele1EC East+  +  -- Kalle+  withRoom broeleC $ do+    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++  -- CAMBRIDGE : SUPERMARKET+  cartA <- newAtom+  putAtom cartA 0+  superMarket <- constructRoom $ do+    ctorRoom "Cambridge Supermarket" "This is the supermarket of Cambridge. To the west there is the produce section and to the north you can see the beverages section. To the south there is the street."+    cashier <- addRoomObject $ do+      ctorMob "the cashier" ["cashier"] "The cashier looks very bored." ["bored"]+      onSight $ schedule 0 $ getAtom cartA >>= \a -> case a :: Int of+        0 -> mprintLn "Cashier: \"Welcome!\""+        n -> mprintLn $ printf "Cashier: \"That's $%i.%02i.\"" (n `div` 100) (n `mod` 100)+      cashierSte <- registerStereoM $ do+        a <- getAtom cartA+        mergeSkill $ skill "pay" !+ consumeCurrencyA money a+                                 !+ bareAction (\_ -> mprintLn "Cashier: \"Thank you for choosing our market!\"")+                                 !+ bareAction (\_ -> putAtom cartA 0)+      addFeature $ Stereo Near cashierSte+    return ()+  withRoom broele2WC $ addRoomDesc "To the north there is the supermarket."+  bipath superMarket broele2WC South++  -- CAMBRIDGE : SUPERMARKET PRODUCE SECTION+  let regGood :: (MonadAtoms m,MonadVocab m) => KindId -> NodeId -> String -> String -> [String] -> [String] -> Int -> m (Atom ObjectState)+      regGood k r t d ns as p = do+        a <- newAtom+        o <- constructObject (do+          ctorAcq t d ns as+          onAcquire $ guardKindNotInRoom k r $ do+            instanciateForm a+            void $ mapAtom (+p) cartA) Nothing k+        putAtom a o+        return a+  [kCabbage,kCarrot,kCereliac,kLeek,kBeetroot,kPotato,kApple,kBanana] <- forM [1..8] $ const registerKind+  produceM <- constructRoom $ do+    ctorRoom "Produce Section" "Fruits and vegetables all around you. There are cabbage, carrots, cereliac, leek, beetroots, potatos, apples, bananas..."+  fCabbage <- regGood kCabbage produceM "a cabbage" "This is a very delicious-looking cabbage."+              ["cabbage","vegetable"] ["delicious","delicious-looking"] 140+  fCarrot <- regGood kCarrot produceM "a carrot" "This is a thick and long carrot, going to taste great!"+             ["carrot","vegetable"] ["delicious","delicious-looking","thick","long"] 5+  fCereliac <- regGood kCereliac produceM "a cereliac" "This is a thick and delicious-looking cereliac. Yumm!"+               ["cereliac","vegetable"] ["thick","delicious","delicious-looking"] 90+  fLeek <- regGood kLeek produceM "a stick of leek" "This is a long and delicious stick of leek."+           ["leek","stick","vegetable"] ["long","delicious","delicious-looking"] 30+  fBeetroot <- regGood kBeetroot produceM "a beetroot" "This is a thick red beetroot."+               ["beetroot","beet","vegetable"] ["thick","red","delicious","delicious-looking"] 15+  fPotato <- regGood kPotato produceM "a potato" "This is a thick potato. Imagine they could end up as crisps..."+             ["potato","vegetable"] ["thick"] 10+  fApple <- regGood kApple produceM "an apple" "This is a thick and delicious-looking apple."+            ["apple","fruit"] ["thick","delicious","delicious-looking"] 50+  fBanana <- regGood kBanana produceM "a banana" "This is a banana. Imagine you were a GDR citizen :o"+             ["banana","fruit"] ["delicious","delicious-looking"] 80+  withRoom produceM $ mapM_ instanciateForm [fCabbage, fCarrot, fCereliac, fLeek, fBeetroot, fPotato, fApple, fBanana]+  bipath superMarket produceM West+    +  -- CAMBRIDGE : AI LAB ENTRANCE+  janA <- newAtom+  putAtom janA True+  entranceL <- constructRoom $ do+    ctorRoom "Entrance" "This is the entrance to the MIT's AI Lab. To the south there is the main room.x"+    addRoomObject $ do+      ctorMob "Jan" ["jan","geek","enthusiast"] "This is Jan, an enthusiastic - but sometimes a little clumsy - computer geek. And he loooves pancakes." ["enthusiastic","clumsy"]+      onSight $ schedule 0 $ getAtom janA >>= \a -> when a $ do+        mprintLn "Jan: \"Bring me pancakes!\"\nJan: \"A lot of them!\"\nJan: \"And don't forget the apple sauce!\""+  withRoom broele1WC $ addRoomDesc "To the south you see the MIT's AI Lab."+  bipath broele1WC entranceL South++  -- CAMBRIDGE : AI LAB MAIN ROOM+  mainRoomL <- constructRoom $ do+    ctorRoom "Main Room" "This is the AI Lab's main room."+  guardedPath entranceL mainRoomL South $ liftM not $ getAtom janA+  unipath mainRoomL entranceL North++  return stationC
+ Game/Antisplice/Dungeon/Ironforge/IronforgeCity.hs view
@@ -0,0 +1,188 @@+{-# 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.IronforgeCity 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++ironforgeCity :: Constructor (NodeId,NodeId,NodeId)+ironforgeCity = do+  --  IRONFORGE : THE GREAT FORGE+  greatForge <- constructRoom $ do+    ctorRoom "The Great Forge" "This is the Great Forge."+    addRoomObject $ do+      ctorSign+            ("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. 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 "+++             "too much.\n\nAnyways, have fun and good luck :)")+            ["green"]+      addDescSeg "On one wall there is a green sign. Type \"read sign\" to read it."+    onFirstEnter $ do+      ebracket (Vivid Yellow) $ do+        mprintLn "** Welcome to IRONFORGE, an experimental dungeon on top of Antisplice."+        mprintLn "**"+        mprintLn "** This is not a stable branch, but rather a technical demo."+        mprintLn "**"+        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 ""+      mputv "user" $ Literal "Bernd"+      mprintLn ""+      mnomask =<< expand "Alright $user, here you are!\n"+      mprintLn ""+      +  --  IRONFORGE : THE MILITARY WARD+  militaryW <- constructRoom $ do+    ctorRoom "The Military Ward" "This is where the anti-terror act of the Asocial Network will happen."+  cangaroo <- withRoom militaryW $ addRoomObject $ do+    ctorMob "a cangaroo" ["cangaroo","communist"] "This is a communist cangaroo, who has fought for Vietcong." []+  withObject cangaroo $ do+    onFirstSight $ do+      let laugh :: Handler+          laugh = guardRoom militaryW $ guardObjectInRoom cangaroo militaryW $ do+            mprintLn "\"Haha!\", the cangaroo says and laughs."+            schedule 10000 laugh+      schedule 10000 laugh+  bipath greatForge militaryW SouthEast+  +  --  IRONFORGE : THE COMMONS+  commonsW <- constructRoom $ do+    ctorRoom "The Commons" "Here you see the bank and the auction house."+    addRoomObject $ do+      ctorAcq "a cup" "One might fill this with coffee." ["cup"] []+      addDescSeg "There is a cup lying on the floor."+  unipath greatForge commonsW South+  unipath greatForge commonsW West+  unipath commonsW greatForge NorthEast+  bipath commonsW militaryW East++  --  IRONFORGE : THE BANK+  bankW <- constructRoom $ ctorRoom "The Bank" "This is the bank of Ironforge."+  withRoom commonsW $ do+    addRoomObject $ ctorRoomNesting "the bank" "This is the Ironforge bank." ["bank"] [] bankW++  --  IRONFORGE : THE AUCTION HOUSE+  auctionW <- constructRoom $ ctorRoom "The Auction House" "This is the auction house of Ironforge."+  withRoom commonsW $ do+    addRoomObject $ ctorRoomNesting "the auction house" "This is the Ironforge auction house." ["house"] ["auction"] auctionW -- TODO!+   +  --  IRONFORGE : THE TAVERN+  tavernW <- constructRoom $ do+    ctorRoom "The Tavern" "This is the tavern of Ironforge. It is known for its strong beer, so you might want to try one. To the west there is the toilet. The exit is to the east."+    addRoomObject $ do+      ctorAcq "a rusty dagger" "This is a rusty old dagger, probably lost by a rouge." ["dagger"] ["rusty","old"]+      addDescSeg "A rusty old dagger lies on the ground."+      addEquipSlot MainHand+      addEquipSlot OffHand+      rustyDaggerSte <- registerStereo $ statsStereo $+        \get k -> case k of+          AttackPower -> 7+          _ -> 0+      addFeature $ Stereo Worn $ rustyDaggerSte+  unipath tavernW commonsW East+  withRoom commonsW $ do+    addRoomObject $ do+      ctorRoomNesting "the tavern" "This is the Ironforge tavern." ["tavern"] [] tavernW+      addDescSeg "Straight in front of you there is the tavern of Ironforge."+      +  --  IRONFORGE : THE TAVERN'S TOILET+  toiletW <- constructRoom $ do+    ctorRoom "The Toilet" "This is the tavern's toilet."+  withRoom toiletW $ addRoomObject $ do+      ctorMob "%{V1;I}%{V2;g}%{D1;o}%{D2;r}" ["igor"] "This is Igor. I guess he doesn't like you." []+      setMobRoute [tavernW]+      o <- getObjectState+      onSight $ schedule 0 $ guardRoom toiletW $ do+        mprintLn "You enter the occupied toilet and see Igor sitting on the pot."+        mprintLn "\"Oops, I'm sorry.\", you say and quickly return to the main room."+        enterAndAnnounce tavernW+        schedule 3000 $ continueMobRoute $ objectIdOf o+  bipath toiletW tavernW East+  +  --  IRONFORGE : THE MYSTIC WARD+  mysticSte <- registerStereoM $ do+    mergeStereo $ statsStereo $+      \get k -> case k of+        Intelligence -> get Intelligence * 99+        _ -> 0+    mergeSkill $ skill "pray" !+ implyGlobalCooldownA !+ bareAction (\_ -> mprintLn "You're falling to your knees praying.\nYou stand up again.")+  mysticW <- constructRoom $ do+    ctorRoom "The Mystic Ward" "Here you will find a lot of mages."+    addRoomObject $ do+      addFeature $ Stereo Near mysticSte+      addDescSeg "You feel intellectual."+  bipath greatForge mysticW NorthWest+  bipath commonsW mysticW North+  +  --  IRONFORGE : THE FORLORN CAVERN+  cavernW <- constructRoom $ ctorRoom "The Forlorn Cavern" "Uncanny."+  guardedPath mysticW cavernW East $ return False+  unipath cavernW mysticW West+  +  --  IRONFORGE : HALL OF EXPLORERS+  halloeW <- constructRoom $ ctorRoom "Hall of Explorers" "Here you can be rewarded."+  bipath cavernW halloeW East+  bipath greatForge halloeW NorthEast+  +  --  IRONFORGE : TINKER TOWN+  tinkerW <- constructRoom $ ctorRoom "Tinker Town" "Engineers all around you."+  bipath halloeW tinkerW South+  bipath tinkerW militaryW South+    +  -- IRONFORGE : DEEPRUN TRAM STATION+  stationW <- constructRoom $ do+    ctorRoom "Ironforge Deeprun Tram Station" "This is the tram station of Ironforge, Dun Morogh."+    addRoomObject $ ctorMob "the station overseer" ["overseer"]+      "This is the badly-paid station overseer. His job is to answer all your questions, but probably he won't be that friendly."+      ["badly-paid","unfriendly"]+  bipath tinkerW stationW East++  return (greatForge, stationW, commonsW)
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.20+version:             0.1.0.22  -- 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, Game.Antisplice.Dungeon.Ironforge.School+  exposed-modules:  Game.Antisplice.Dungeon.Ironforge, Game.Antisplice.Dungeon.Ironforge.School, Game.Antisplice.Dungeon.Ironforge.IronforgeCity, Game.Antisplice.Dungeon.Ironforge.Cambridge -  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+  build-depends:       base >=4.6 && <4.7, chatty >=0.5.2 && <0.6, antisplice >=0.13.2 && <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.13 && <0.14, 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.2 && <0.14, mtl >= 2.1 && < 2.2, transformers >= 0.3 && < 0.4      -- Directories containing source files.   -- hs-source-dirs: