!============================================================================ ! Entry point functions [ Amusing; print "Have you tried... ^^"; ]; [ Deathmessage; switch(deadflag) { 3: print "You have violated simulation parameters. Please UNDO."; default: "This branch of the game universe has come to an end."; } ]; [ Timepasses; if (em.ingame) score = em.points; if (clockoff == true) return true; if (the_time == 0){ daynumber = daynumber + 1; ! print "^Midnight strikes and a new day dawns.^(This is day number ", daynumber,")^"; switch(daynumber){ default: return true; } } ]; [ Initialise; lookmode = 1; notify_mode = false; location = base; player.description = "You are a human being in search of the Enlightened Master."; move gear to player; settime(0,60); print "^^You are finally nearing the end of your journey to the Enlightened Master.^^"; getenter(); ]; [ PrintTaskName task_number; switch (task_number) { } ]; !============================================================================ ! Utility functions [ Checkgame; em.balllaunched = 0; if(em.balls == 0) { em.ingame = 0; stopdaemon(em); print "^Out of balls. Final score: ", em.points, "^"; if(em.points > em.hiscore) { em.hiscore = em.points; print "That's a new high score! Congratulations!^"; } switch(em.gamenumber) { 1: "~I hope that was fun for you, we are just getting started! You want to play again, right?~"; 2: "~Are you starting to get warmed up? I know there's a lot to learn, but since you came all this way to play with me, I hope you have the patience for it.~"; 3: "~This feels good to me. Thanks for sticking with it, you are making real progress.~"; default: "~I will keep on trying for as long as you want, as long as you put effort in, so will I.~"; } } ]; [ Getenter; print "^Press enter to continue.^^"; keycharprimitive(); ]; !============================================================================ ! Verb functions [ Aboutsub; "Enlightened Master is a puzzleless game of philosophical exploration."; ]; [ Bindsub; "^You attempt the bind of ", (name) noun, " on top of ", (name) second, " but nothing interesting happens..."; ]; [ Campsub; "There isn't a good place to camp here."; ]; [ Clockonsub; clockoff = false; "Clock story triggers set to on. >sleep advances to the next day, >story advances to the next major plot event."; ]; [ Clockoffsub; clockoff = true; "Clock story triggers set to off. No plot events will occur automatically. >clockon to reactivate."; ]; [ Contentsub; "This game should be suitable for any player interested in its ideas."; ]; [ Creditssub; "^Written and programmed by Ben Kidwell (mycroftiv) ^Co-written, edited and tested by Maevele Straw ^Thanks to Inform Designer's Manual, Inform Beginner's Guide and all Inform 6 resources ^Written and playtested entirely in Plan 9 ANTS, 9front and Bell Labs variants^"; ]; [ Dancesub; "You dance in a loose, disorganized fashion, but it feels good."; ]; [ Designsub; "Thanks, and I hope you are enjoying the game."; ]; [ Drivesub; <>; ]; [ Eastereggsub; ]; [ Exitssub; location.cant_go(); ]; [ Exploresub; "You search the area, but find nothing not already described."; ]; [ Footnotesub; switch(noun) { 1: "Not many footnotes yet, are there?"; default: "Probably a special case of the Navier-Stokes equations."; }; ]; [ Goalssub; ]; [ Helpsub; "Move around using compass directions (n s e w ne nw se sw up down in out), examine things (x NAME), take things and look in your inventory (take NAME, i), and talk to characters (talk to NAME). An intro/guide: http://inform7.com/learn/eg/dm/IntroductionToIF.pdf ^ ^You can come up with ideas for what to do next if you >think (or check >goals). Specific hints from the >hint command are available based on your location and progression in the story. You can also type >hint NAME for hints about objects in your vicinity. All required plot-advancing conversations are triggered by >talk to. Characters may have new >talk to responses after story events. Optional conversations are available with >ask NAME about and >tell NAME about. If you are not progressing on your own, the game will automatically trigger some plot events based on an internal timer. You can use >sleep to advance a day, and >story to skip to the next event. >clockoff will deactivate automatic story progression. >clockon to reactivate. >verblist will show all verbs needed to score all points. >summary will provide a mildly spoilery overview of the general plot of the game, and >walkthrough will provide a comprehensive command list to score all 999 points. >about and >credits provide some additional background and authorship information.^"; ]; [ Hintsub; print "(Different hints are available depending on your location and story progress. hint NAME will give object specific hints for things you can see.)^^"; "The maximum score is 999 points. Many of those points can be missed if certain optional actions are not performed before plot events."; ]; [ Lunarsub; "The Moon smiles down at you."; ]; [ Petsub; "You affectionately stroke the ", (name) noun, " but it doesn't reciprocate your affections."; ]; [ Playsub; "Your skills don't extend so far as to be able to play the ", (name) noun; ]; [ Plughsub; print "You speak the magic word, and you catch a glimpse of an ancient realm of college mainframe computers and 5 1/4 floppies...^"; ]; [ Randomtestsub a b c d e f g h i j; a = 0; b = 0; c = 0; d = 0; e = 0; f = 0; g = 0; h = 0; i = 0; j = 0; print "Testing 10000 random numbers^"; for(x=0: x<10000: x++) { roll=random(99); if(roll <= 10) a++; if(roll > 10 && roll <= 20) b++; if(roll > 20 && roll <= 30) c++; if(roll > 30 && roll <= 40) d++; if(roll > 40 && roll <= 50) e++; if(roll > 50 && roll <= 60) f++; if(roll > 60 && roll <= 70) g++; if(roll > 70 && roll <= 80) h++; if(roll > 80 && roll <= 90) i++; if(roll > 90) j++; } print a, " | ", b, " | ", c, " | ", d, " | ", e, " | ", f, " | ", g, " | ", h, " | ", j, "^"; ]; [ Reviewsub; "A strange concept."; ]; [ Ridesub; "You can't ride that."; ]; [ Skillsub; print "Current pinball skills:"; print "^Launch: ", skill.launch; print "^Shoot: ", skill.shoot; print "^Catch: ", skill.catch; print "^Nudge: ", skill.nudge; print "^"; ]; [ Sleepwaitsub; ! daynumber = daynumber + 1; settime(1380, 60); print "You take a long nap.^"; ]; [ Talksub; if(noun hasnt animate) "The soundwaves of your voice bounce off the ", (name) noun, " affecting its molecular structure in subtle ways."; "Your words go unanswered."; ]; [ Targetssub; objectloop(x has shootable) print (name) x, "^"; ]; [ Testsub; x = "wompit"; if(x == "wompit") "Yeah thats a wompit"; switch(x){ 1: "switched a wompit"; } print x; print "|^"; print (string) x; ]; [ Titlesub; "Alternate titles:"; ]; [ Usesub; if(noun hasnt animate) "Either the ", (name) noun, " can't be used, or you need to find a more specific verb."; "To interact with characters, try talk to NAME, ask NAME about THING, tell NAME about THING, or give THING to NAME."; ]; [ Verblistsub; "n s e w ne nw se sw u d in out, examine, take, drop, give, talk to, tell, use, play"; ]; [ Walkthroughsub; ]; [ Winsub; deadflag = 2; "Sure, you win! Success is for you to define. If you want to keep playing, just >undo."; ]; [ Xyzzysub; print "There is a trans-dimensional short-circuit of interactive fiction tradition, and you catch a brief glimpse of a brick building near a stream and a metal grate before you blink and find yourself...^"; playerto(master_chamber); ]; !============================================================================ ! Pinball Actions [ Catchsub; if(em.ingame == 0) "You need to be playing Enlightened Master."; if(em.balllaunched == 0) "You need to LAUNCH first."; em.didthing = 1; skill.catch++; roll = random(99) + skill.luck + (skill.nudge * skill.nudgeflag); skill.nudgeflag = 0; skill.luck = 0; if(roll <= 20) { em.balls--; print "You fail the catch, and the ball drops between the flippers and leaves the playfield.^"; checkgame(); return true; } if(roll <= 40) { skill.luck = -10; "You miss the catch and the ball bounces oddly, decreasing your luck on the next shot.^"; } if(roll + skill.catch > 100) { skill.luck = 35; skill.catch++; "You successfully catch the ball and it now rests in the angle between the flipper and guide rail. Your next shot will have substantially increased accuracy."; } skill.luck = 5; "You fail the catch but the angle is good for your next shot."; ]; [ Flipsub; if(em.ingame == 0) "You need to play a new game."; if(em.balllaunched == 0) "You need to LAUNCH first."; em.didthing = 1; switch(random(4)) { 1: em.balls--; em.points = em.points + 1; print "You find the machine's actions baffling, and lose your ball quickly. +1 point^"; checkgame(); 2: em.balls--; em.points = em.points + 25; print "You make a few shots, and a woman's voice commends you and tells you that you are making progress on the Path. +25 points^"; checkgame(); 3: em.balls--; em.points = em.points + 100; print "You hit both sides of the figure 8 ramp system in succession, and the Master announces that you have transcended the finite and reached a countable infinity, the first step toward transcendence. +100 points^"; checkgame(); 4: em.balls--; em.points = em.points + 237; print "Without fully understanding your own reflexive reactions, you manage to light a series of targets that spell out Definable Powerset, and a small doorway in the corner of the playfield clicks open. 'Constructible universe G now open' says the Master enticingly. +237 points^"; checkgame(); }; ]; [ Launchsub; if(em.ingame == 0) "You need to PLAY a new game first."; if(em.balllaunched == 1) "The ball has already been launched, SHOOT a target instead, CATCH, or NUDGE."; em.didthing = 1; skill.launch++; em.balllaunched = 1; print em.balls, " balls remaining. "; roll = random(99) + skill.launch; if(roll <= 40) { skill.luck = skill.luck - 5; "The ball hits nothing on its way onto the playfield and approaches your flippers at an awkward angle."; } if(roll <= 70) { em.points = em.points + 10; "The ball scores a 10 point launch bonus and heads toward your flippers. ~Okay, you're live!~"; } em.points = em.points + 25; "The ball scores a 25 point launch bonus and bounces into the playfield. ~Time to dance!~"; ]; [ Nudgesub; if(em.ingame == 0) "You need to be playing Enlightened Master."; if(em.balllaunched == 0) "You need to LAUNCH first."; if(skill.nudgeflag == 1) "You have already nudged for the next shot."; if(skill.nudgecount > 10) "Your nudging muscles are fatigued, no more nudging this game."; ! em.didthing = 1; skill.nudgecount++; skill.nudge++; skill.nudgeflag = 1; "You brace yourself to give the Master a helpful nudge for the next action."; ]; [ Shootsub; if(noun hasnt gametarget) "You can only shoot objects in the pinball game."; if(noun hasnt shootable) "That target isnt available to shoot at right now."; if(em.ingame == 0) "You need to be playing Enlightened Master."; if(em.balllaunched == 0) "You need to LAUNCH first."; em.didthing = 1; skill.shoot++; roll = random(99) + skill.luck + (skill.nudge * skill.nudgeflag); skill.nudgeflag = 0; skill.luck = 0; if(roll <= 10) { em.balls--; print "You miss, and the ball takes an unlucky bounce down the left outlane.^"; checkgame(); return true; } if(roll + skill.shoot <= noun.risk) { em.balls--; print "You miss the shot and the ball drains straight down the middle.^"; checkgame(); return true; } if(roll <= 20) { skill.luck = skill.luck + 10; "You miss the shot but the ball takes a nice bounce, increasing your luck on the next shot.^"; } if(roll + skill.shoot <= noun.difficulty) "You miss your target, but the ball returns toward your flippers."; noun.hit(); noun.triggers(); ]; !============================================================================ ! Grammar and Verbs Include "Grammar"; Verb "about" * -> About; Verb "bind" * noun noun -> Bind * noun 'to'/'with'/'and'/'on'/'in' noun -> Bind; Verb "camp" * -> Camp; Verb "catch" * -> Catch; Verb "clockon" * -> Clockon; Verb "clockoff" * -> Clockoff; Verb "content" * -> Content; Verb "credits" * -> Credits; Verb "dance" * -> Dance; Verb "design" * -> Design; Verb "drive" * -> Drive; Verb "easter" * 'egg' -> Easteregg; Verb "exits" * -> Exits; Verb "explore" * -> Explore; Verb "flip" * -> Flip; Verb "footnote" * number -> Footnote; Verb "goals" * -> Goals; Verb "help" * -> Help; Verb "hint" * -> Hint * noun -> Hint; Verb "launch" * -> Launch; Verb "lunar" * -> Lunar; Verb "nudge" * -> Nudge; Verb "pet" * noun -> Pet; Verb "play" * noun -> Play * 'with' noun -> Play; Verb "plugh" * -> Plugh; Verb "randomtest" * -> Randomtest; Verb "review" * -> Review; Verb "ride" * noun -> Ride; Verb "shoot" "sh" * noun -> Shoot; Verb "skill" "skills" * -> Skill; Extend "sleep" replace * -> Sleepwait; Verb "spin" = 'turn'; Verb "talk" * noun -> Talk * 'to'/'with' noun -> Talk; Verb "targets" * -> Targets; Verb "test" * -> Test; Verb "titles" * -> Title; Verb "use" * noun -> Use; Verb "verblist" * -> Verblist; Verb "walkthrough" * -> Walkthrough; Verb "win" * -> Win; Verb "xyzzy" * -> Xyzzy;