Constant Story "MADNESS"; Constant Headline "^Madness and the Minotaur^ By Spectral Associates 1981^ zcode translation by Chris Cantrell 2011^ See computerarcheology.com for the disassembly of the original^^"; Serial "020811"; Release 2; Include "Parser"; Include "VerbLib"; Global physicalCondition; Global lastRoom; Include "MadRooms.inf"; Include "MadRoomActions.inf"; Include "MadPassages.inf"; Include "MadBlocks.inf"; Include "MadItems.inf"; Include "MadSpells.inf"; Include "MadBanner.inf"; Include "MadDebug.inf"; Include "MadGameLoop.inf"; ! TODO ! ! I am working down the in-room actions ! ! Individual commands ! Back command and back timer ! Between room actions ! Lamp and fill ! Bottle and fill ! Oracle ! Move/attack creatures [ Initialise; ! TODO for testing ... lock the random seeding random(-14); ! in look-mode 2 (verbose) description are always printed. This is how ! M&M does it. lookmode = 2; InitGame(); ! The original M&M prints this at the start of every room description. This ! makes a nice shortcut. string 01 "You are"; print "Enter 'BANNER' to see original M&M tape-loading-banner.^"; ! M&M starts like this print "^WELCOME TO THE LABYRINTH!!^"; print "BEWARE OF THE MINOTAUR AND GOOD^"; print "LUCK.^^"; ]; [ InitGame x; ! M&M always starts the player in room 10 (right below the forest treasure room) location = Room_10; lastRoom = Room_10; physicalCondition = $FF; ! Place the objects around the rooms InitCarry(); objectloop(x ofclass Item) { x.placeObject(); } ! Place the spells objectloop(x ofclass MadSpell) { x.place(); } ! Place the room-actions objectloop(x ofclass RoomAction) { x.place(); } ! Daemons run at the end of every turn. That is when M&M gives you the spell ! that was in the room you were in before you gave a command. StartDaemon(GameLoop); ]; [ GetPackWeight x w; w = 0; objectloop(x in player && x ofclass Item) { w = w + x.weight; } return w; ]; [ GetPackBulk x b; b = 0; objectloop(x in player && x ofclass Item) { b = b + x.bulk; } return b; ]; [ Anything i; if (scope_stage == 1) rfalse; if (scope_stage == 2) { objectloop (i ofclass Item || i ofclass MadSpell) { ! TODO we shouldn't check the real_location if we can stop the auto-select for "get " if(parent(i)==real_location) { PlaceInScope(i); } } rtrue; } "No such object in game."; ]; [ AnythingAtAll i; if (scope_stage == 1) rfalse; if (scope_stage == 2) { objectloop (i ofclass Item || i ofclass MadSpell) { PlaceInScope(i); } rtrue; } "No such object in game."; ]; ! Include "Grammar"; #Stub AfterLife 0; #Stub AfterPrompt 0; #Stub Amusing 0; #Stub BeforeParsing 0; #Stub ChooseObjects 2; #Stub DarkToDark 0; #Stub DeathMessage 0; #Stub GamePostRoutine 0; #Stub GamePreRoutine 0; #Stub InScope 1; #Stub LookRoutine 0; #Stub NewRoom 0; #Stub ParseNumber 2; #Stub PrintTaskName 1; #Stub PrintVerb 1; #Stub TimePasses 0; #Stub UnknownVerb 1; [ PrintRank; "."; ]; [ ParseNoun obj; obj = obj; return -1; ]; ! The global routines are all in MadGameLoop.inf Verb 'inv' * -> MadInv; Verb 'get' 'take' 'grab' * scope=Anything -> MadTake * ->MadTake ; Verb 'drop' 'throw' * noun -> MadDrop * -> MadDrop ; Verb 'ask' * 'oracle' -> MadAsk; Verb 'score' * -> MadnessPrintScore; Verb 'uncle' * -> MadUncle; Verb 'banner' * -> MadBanner; ! TODO done to here Verb 'look' * 'scarab' -> MadLookScarab * 'tablet' -> MadLookTablet * 'pool' -> MadLookPool * 'parchment' -> MadLookParchment * 'pit' -> MadLookPit * 'urn' -> MadLookUrn * 'bottle' -> MadLookBottle * -> MadLook ; Verb 'quiet' * -> MadQuiet; Verb 'help' * -> MadHelp; Verb 'back' * -> MadBack; Verb 'climb' * -> MadClimb; Verb 'jump' * -> MadJump; Verb 'lamp' * 'on' -> MadLampOn * 'off' -> MadLampOff ; Verb 'open' * 'crypt' -> MadOpenCrypt * 'drapes' -> MadOpenDrapes * 'scroll' -> MadOpenScroll * 'jewlebox' -> MadOpenJewelbox ; Verb 'eat' * 'food' -> MadEatFood * 'mushroom' -> MadEatMushroom * 'powder' -> MadEatPowder ; Verb 'drink' * 'sprite' -> MadDrinkSprite * 'potion' -> MadDrinkPotion * 'water' -> MadDrinkWater ; Verb 'run' * -> MadRun; Verb 'fill' * 'lamp' -> MadFillLamp * 'bottle' -> MadFillBottle * 'urn' -> MadFillUrn ; Verb 'play' * 'flute' -> MadPlayFlute; Verb 'kill' * 'hydra' -> MadKillHydra * 'oracle' -> MadKillOracle * noun -> MadKillCreature ; Verb 'tie' * -> MadTie; Verb 'stab' * -> MadStab; ! Nothing fancy here ... just list the spell verbs out brute-force Verb 'vetar' * -> MadSpellVETAR; Verb 'mitra' * -> MadSpellMITRA; Verb 'okkan' * -> MadSpellOKKAN; Verb 'akhirom' * -> MadSpellAKHIROM; Verb 'nergal' * -> MadSpellNERGAL; Verb 'belrog' * -> MadSpellBELROG; Verb 'crom' * -> MadSpellCROM; Verb 'ishtar' * -> MadSpellISHTAR; ! Debugging for development. These are implemented ! in 'MadDebug.inf' ! Verb 'mad' * 'objects' -> MadDebObjects * 'move' number -> MadDebMove * 'spells' -> MadDebSpells * 'actions' ->MadDebActions * 'get' scope=AnythingAtAll ->MadDebGet * 'stats' ->MadDebStats * 'oracle' ->MadDebOracle * 'damage' number ->MadDebDamage ;