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 Data.Chatty.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)