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
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 ""
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
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
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
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
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."
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
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
cavernW <- constructRoom $ ctorRoom "The Forlorn Cavern" "Uncanny."
guardedPath mysticW cavernW East $ return False
unipath cavernW mysticW West
halloeW <- constructRoom $ ctorRoom "Hall of Explorers" "Here you can be rewarded."
bipath cavernW halloeW East
bipath greatForge halloeW NorthEast
tinkerW <- constructRoom $ ctorRoom "Tinker Town" "Engineers all around you."
bipath halloeW tinkerW South
bipath tinkerW militaryW South
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)