1
2 /*
3
4 This is a Madlibs-style random Hootscript generator. It is only used to display
5 a sample script when somebody clicks on the link in hoot.html.
6
7 */
8
9
10
11 function generateExampleScript(){
12 function madness(x){
13 return x[Math.floor(Math.random() * x.length)];
14 }
15
16
17
18 var place = madness([
19 "a beautiful forest"
20 ,"a sewage treatment plant"
21 ,"the secret druidic ruin"
22 ,"a vast parking lot"
23 ]);
24
25 var day = madness([
26 "balmy like a jungle"
27 ,"cold as the arctic"
28 ,"generally quite acceptable in terms of temperature and humidity"
29 ]);
30
31 var thoughts = madness([
32 "the old man you had run over with your car yesterday"
33 ,"donating to charity"
34 ,"trying your hand at living off the land"
35 ,"celery"
36 ,"animal husbandry"
37 ]);
38
39 var food = madness([
40 "a ham sandwich"
41 ,"an apple (which fell from the greatest apple tree in all of the forest and is thought to have incredible magic power)"
42 ,"a bowl of soup"
43 ,"a human head"
44 ]);
45
46 var adjective = madness([
47 "mighty"
48 ,"slippery"
49 ,"tainted"
50 ]);
51
52 var item = madness([
53 "sword"
54 ,"Staff of Eternal Light"
55 ,"cat"
56 ,"guide to the underworld (with all of the really naughty pages bookmarked)"
57 ,"rock"
58 ]);
59
60 var reason = madness([
61 "keeping the demons at bay"
62 ,"lighting your way"
63 ,"helping you calm yourself (and concentrate on something positive when the evil powers test your already questionable sanity to the point of breaking)"
64 ]);
65
66 var action = madness([
67 "figure out the great mystery of the purpose of life"
68 ,"decide to become celibate"
69 ,"uncover a vast fortune underground which will lead you to a life of great opulence and eternal fame"
70 ,"eat a burrito"
71 ,"have some life-changing experience so profound that you will decide to change your name to 'Cool Wind Hammer'"
72 ,"eat enormous quantities of cheese"
73 ]);
74
75 var adjective2 = madness([
76 "insane"
77 ,"bug-eyed"
78 ,"flea-bitten"
79 ,"beautiful"
80 ,"dirty and foul-smelling"
81 ]);
82
83 var creatures = madness([
84 "wolves"
85 ,"sheep"
86 ,"manatees in protective land-going suits"
87 ,"robots"
88 ,"druids"
89 ]);
90
91 var items = madness([
92 "poisoned knives"
93 ,"scrolls enchanted with powerful destructive spells"
94 ,"flutes"
95 ,"guns"
96 ]);
97
98 var place2 = madness([
99 "cave"
100 ,"car dealership"
101 ,"bean cannery"
102 ]);
103
104 var action = madness([
105 "find a place to relieve your bladder"
106 ,"knit a sweater very quickly"
107 ,"assume everything will be fine"
108 ]);
109
110 var profession = madness([
111 "a drug dealer"
112 ,"a dental hygienist"
113 ,"a marine biologist"
114 ,"an accountant"
115 ,"a teen horse exorcist"
116 ,"a cat behavior historian"
117 ]);
118
119 var beastlike = madness([
120 "an enraged mother bear"
121 ,"a badger with lava for blood and red coals for eyes"
122 ,"a duck inside another duck"
123 ,"all of the martial artists of the world compacted into a sphere of energy and shot out of a cannon into space"
124 ]);
125
126 var defeated = madness([
127 "extremely dead"
128 ,"severely wounded and tending to their hurts"
129 ,"at odds with their own self-images of their abilities and left to contemplate a different sort of existence, perhaps one free of violence and friction"
130 ,"bleeding, but surprisingly pleased to have finally been beaten after many years of monotonous victory"
131 ]);
132
133 var mentorwords = madness([
134 "The path of least resistance is a slippery slope to a pit with lots of things that are hard to hold onto."
135 ,"Never leave that light on. It uses too much electricity."
136 ,"You can't learn to paint with these poor quality brushes. Look at all of these bristles! It's a mess. In fact, the heck with all of this. Let's get some lunch."
137 ,"Someday all of this will seem funny."
138 ]);
139
140
141
142 // the script
143 // for the sake of all that is holy, turn on wordwrap to view this.
144 // or better yet, just see it in the gamebuilder
145 return "[start]:\n/You are walking through "+place+". The day is "+day+", but you find yourself thinking of "+thoughts+". You've packed light and have just "+food+" to eat and a "+adjective+" "+item+" for "+reason+".\n__\nYou ponder the narrow path before you. You wonder where it will lead. Perhaps before the day is through, you'll "+action+". After a pause to contemplate this, you resume walking. _Let's see where that leads you_./\n\n[Let's see where that leads you]:\n/Without warning, you are attacked by a pack of "+adjective2+" "+creatures+" with "+items+"! They appear to have come from a nearby "+place2+". You will need to either _fight like a beast_ with the "+item+" or _"+action+"_./\n\n\n[fight like a beast]:\n/You confront the "+creatures+" head-on with your "+item+" gripped firmly in your fists like "+beastlike+". The battle is brief and extraordinarily violent, but ends with you standing in triumph and your enemies "+defeated+".\n__\nYou have won! Masterfully done!/\n\n\n["+action+"]:\n/Having been "+profession+" for most of your life, you reason that the best course of action is to "+action+". Unfortunately, the "+creatures+" are upon you too quickly and they are far too "+adjective2+" for your tactic to work! You scream as they use their "+items+" upon your face and neck area! You are dying.\n__\nAs the lights fade out and you drift off to the next plane of existence, you hear the voice of your mentor one last time saying, \""+mentorwords+"\"\n__\nOh dear. Perhaps you would like to _try again_?/\n\n\n[try again]:\n/Good idea. Let's give that another shot.__/\nrun [Let's see where that leads you]\n";
146 }
147