Constant Story "Ragnarok: Twilight of the Gods"; Constant Headline "^A New Year's SpeedIF Game (with non-standard parameters: type XYZZY for details)^"; Constant MAX_SCORE = 1; Include "Parser"; Include "VerbLib"; Object kitchen "Your Kitchen" with description [; if (brokenMicrowave in self) { "This is the place where you prepare food. And by ~prepare food~, of course, I mean ~microwave frozen burritos~ and ~call for pizza~. It's fitted out with all the usual amenities: refrigerator, stove, exploded microwave, cabinets, a large disembodied brain floating in the corner. Pretty much your standard IF protagonist's kitchen. The living room is to the east"; } print "This is the place where you prepare food. And by ~prepare food~, of course, I mean ~microwave frozen burritos~ and ~call for pizza~. It's fitted out with all the usual amenities: refrigerator, stove, microwave, cabinets, a large disembodied brain floating in the corner. Pretty much your standard IF protagonist's kitchen. The living room is to the east.^"; if (self has general) { "^It's also pretty dark in here. It's a good thing you've got excellent night vision, or else that could be somewhat inconvenient."; } ], e_to livingRoom, has light; Object -> lights "lights" with name 'light' 'lights', description [; if (kitchen has general) "They're switched on, but there's no light. The power must not be working."; "The lights are on."; ], before [; SwitchOn, SwitchOff: "Messing with the light switches won't help anything."; ], after [; Examine: rtrue; ], switched_on [; ""; ], found_in kitchen livingRoom, has scenery light on pluralname; Object -> refrigerator "refrigerator" with name 'avocado-green' 'avocado' 'green' 'refrigeration' 'unit' 'refrigerator' 'fridge' 'portion', description "An avocado-green refrigeration unit, vintage about 1975. You usually keep the freezer portion stocked with frozen burritos and popsicles. The fridge portion... well, let's just say you've avoided it since that incident last March.", before [; Open, Search: if (self has general) { deadflag = 1; "You take a deep breath, brace yourself against the unknown, and open the door.^^ Do you remember that scene near the end of Raiders of the Lost Ark?^^ Yeah, well. This ain't the glory of God here, but the outcome is otherwise strikingly similar. Better luck next time around."; } give self general; "That seems like a monumentally unwise idea. The last time you opened the fridge, you ended up spending a week in the hospital and lost all memories for thirty-six hours before and after the event. But hey, if you want to give it a shot, it's your funeral."; ], has scenery openable; Object -> freezer "freezer" with name 'freezer' 'portion', description "The upper portion of your fridge.", before [; Open, Search: "Dang, no more burritos. You'll have to go to the store."; ], has scenery openable; Object -> telephone "telephone" with name 'telephone' 'phone' 'garfield' 'the' 'cat', description "A telephone in the shape of Garfield the cat which you picked up for only a quarter at a yard sale. Cha-ching!", before [; Take, Answer: "It's two in the morning. It's too late to be calling anyone on the phone."; ], has scenery; Object -> stove "stove" with name 'stove' 'oven' 'range', description "You have mixed emotions when you think back to the day you last used this stove. You were making tuna noodle casserole. You're still not exactly sure why the contents exploded, but you haven't been able to pry the oven open since.", before [; Smell: "Mmm. You can still detect that faint hint of tunafish and mushroom soup to this day."; Open: "You give it another try, just for good measure.^^Nope, no luck."; SwitchOn: "Better not: it just makes the entire place smell like very, very old tuna."; SwitchOff: "It's already off."; ], has openable scenery; Object -> mindo "Mindo" with name 'large' 'disembodied' 'brain' 'floating' 'in' 'the' 'corner' 'mind' 'mindo', description "Ah, Mindo The Mind. You and Mindo have been friends ever since third grade, when a bunch of bigger kids were picking on you for not knowing how to balance a checkbook, and Mindo defended you by telekinetically flinging all of the bullies through the air into the community swimming hole on the other side of town. Good times. He's never been much of a conversationalist, but he's an awesome roommate and the coolest disembodied brain you've ever met.", life [; Answer, Ask, Tell: "Mindo telepathically communicates, ~I don't know much about that.~"; Attack: "Mindo telepathically communicates, ~Violence isn't the answer to this one.~^^Mindo is, as usual, correct."; Give: "Mindo telepathically communicates, ~I don't seem interested.~^^Mindo is, as usual, correct."; Kiss: "Mindo telepathically communicates, ~Keep your mind on the game.~"; Order: "Mindo telepathically communicates, ~I have better things to do.~"; Show: "Mindo telepathically communicates, ~I am unimpressed.~"; ThrowAt: "Mindo telepathically communicates, ~You lack the nerve when it comes to the crucial moment.~^^Mindo is, as usual, correct."; WakeOther: "Mindo telepathically communicates, ~That seems unnecessary.~^^Mindo is, as usual, correct."; ], initial "Mindo is floating placidly in the corner.", has animate proper; Object -> microwave "microwave oven" with name 'microwave' 'oven' 'black' 'box' 'door' 'numbers', !parse_name ! [ n nextWord; ! while (true) ! { ! nextWord = NextWord(); ! if (nextWord == 'microwave' or 'oven' or 'black' or 'door' or 'numbers') ! { ! n++; ! continue; ! } ! if (nextWord == 'box') { continue; } ! ! return n; ! } ! ], description "A black box with a door and numbers on the front. You use it to reheat schezuan shrimp, nuke frozen burritos and pop popcorn.", before [; Search: "Fortunately, you haven't accidentally left anything in there overnight. This time."; SwitchOn: "But there's nothing inside of it!"; Receive: if (kitchen has general) { "You won't be microwaving anything without electricity."; } if (noun == kernels) { if (kernels hasnt general) { "You're about to put the bowl of popcorn kernels into the microwave when you feel a telekinetic tug at your arm.^^ Mindo telepathically communicates, ~You shouldn't make popcorn without oil. Unless you have an air popper. Which we don't.~^^ Mindo is, as usual, correct."; } remove self; remove kernels; move brokenMicrowave to kitchen; "You put the bowl of oiled popcorn kernels into the microwave, set it for two minutes and thirty-four seconds, and close the door.^^ A few moments later, you hear a sizzling, popping noise.^^ A few moments after that, the microwave explodes.^^ Hrm. I probably should have mentioned that it was a metal bowl. My bad."; } "There doesn't seem to be much point in nuking that."; ], after [; Open: << Search self >>; ], has openable container scenery; Object -> cabinets "cabinets" with name 'cabinets' 'cabinet', description [; print "Photographs from when you moved in suggest that they were once white. Looking at them now, you suspect those pictures may have been faked. "; << Search self >>; ], has openable container pluralname scenery; Object -> -> kernels "bowl of unpopped popcorn kernels" with name 'bowl' 'of' 'unpopped' 'popcorn' 'kernels', description [; if (self hasnt general) { "What the heck? Aren't popcorn kernels supposed to come in a paper bag? With microwave instructions on the back?"; } "What the heck? Aren't popcorn kernels supposed to come in a paper bag? With microwave instructions on the back?^^ At least the've got oil on them."; ], before [; Eat: "You try one. Ow! No wonder people pop these first."; ]; Object -> -> fuseBox "fuse box" with name 'fuse' 'box' 'fusebox', !parse_name ! [ n nextWord; ! print "trying to parse the fuse box^"; ! while (true) ! { ! nextWord = NextWord(); ! print "nextWord = ", nextWord, "^"; ! if (nextWord == 'box' or 'fusebox') ! { ! print "Word was box^"; ! n = n + 2; ! continue; ! } ! if (nextWord == 'fuse') { n++; continue; } ! ! return n; ! } ! ], description [; print "An open-faced fuse box. Conveniently, your entire home runs on just one fuse. "; << Search self >>; ], before [; Receive: if (child(self) == penny) { "There's already a fuse -- or a fuse-like object, at any rate -- in the fuse box."; } if (child(self)) { "There's already a fuse in the fuse box."; } if (noun == quarter || noun == dime) { "Good thought, but it's not quite the right size to fit."; } if (noun == goodFuse || noun == burntFuse || noun == penny) { rfalse; } "That wouldn't really make a very good substitute for a fuse."; ], after [; if (noun == penny) { give self general; give kitchen ~general; "Yowch! You suck your fingers for a moment, wondering if maybe you should get a trained electrician to stick pennies in your fuse box in the future.^^ But on the plus side, the lights are back on!"; } ], has open container static; Object -> -> -> goodFuse "dusty fuse" with name 'dusty' 'old' 'fuse', !parse_name ! [ n nextWord; ! while (true) ! { ! nextWord = NextWord(); ! if (nextWord == 'fuse' or 'dusty') ! { ! n = n + 2; ! continue; ! } ! ! return n; ! } ! ], description "It's a dusty old fuse that has served you well for years.", before [; Take: "Don't be silly. The fuse is working fine. Don't mess with it."; ]; Object burntFuse "burnt-out fuse" with name 'burnt-out' 'burnt' 'out' 'fuse', !parse_name ! [ n nextWord; ! while (true) ! { ! nextWord = NextWord(); ! if (nextWord == 'burnt-out' or 'burnt' or 'out' or 'fuse') ! { ! n = n + 2; ! continue; ! } ! ! return n; ! } ! ], description "Whoops. That should probably be replaced."; Object brokenMicrowave "microwave" with name 'microwave' 'oven' 'door' 'timer' 'display' 'black' 'scorch' 'marks' 'total' 'mess', description [; print "A total mess. The door hangs off at a decorative (but non-functional) angle, the timer display is cracked down the middle, and every part of it is pitted with black scorch marks."; if (popcorn in self) " On the plus side, the microwave is full of freshly-popped popcorn."; ""; ], has open container scenery; Object -> popcorn "popcorn" with name 'popcorn', description "Freshly popped and ready to eat.", before [; Eat: "You try a mouthful. It's tasty! Admittedly, it could use some salt, but you've already done enough for this puzzle, so we'll just call it tasty."; ], has edible; Object livingRoom "Living Room" with description [; print "Everyone is here! Lisa's settled into the big armchair, Thor is hanging out on the couch, Mindo is -- well, Mindo's still in the kitchen, but he'll come in when the movie starts, undoubtedly. You've already got the DVD in your combination TV/DVD player, so you just need to turn it on and late night movie night can begin!^"; if (kitchen has general) { "^It's also pretty dark in here. It's a good thing you've got excellent night vision, or else that could be somewhat inconvenient."; } ], each_turn [; if ((kitchen hasnt general) && (penny notin fuseBox)) { give kitchen general; remove goodFuse; move burntFuse to fusebox; "^Thor rumbles, ~The time has come for time for Ragnarok, Twilight of the Gods! THOR MUST NOT BE KEPT WAITING!~^^ Your reflexes serve you well, as you duck just before a lightning bolt arcs from Thor's fingers, passing inches from your head, and striking someplace in the kitchen behind you. Instantly, all the lights go dark.^^ ~Oops,~ rumbles Thor, ~Did I do that?~"; } ], w_to kitchen, has light; Object -> lisa "Lisa" with name 'lisa' 'armchair' 'chair' 'arm chair' 'big', description "Lisa is dozing in the big armchair.", life [; Give: if (noun == popcorn) { move popcorn to lisa; "Lisa mumbles, ~Rock on. Let's start the flick, guys.~"; } default: "Lisa mumbles, ~Wake me up when it's time for the popcorn and the movie, 'K?~"; ], has animate female proper scenery; Object -> thor "Thor" with name 'thor' 'norse' 'god' 'of' 'thunder', description "Thor, the Norse god of thunder, is hanging out on the couch.", life [; default: "Thor rumbles, ~The time has come for Ragnarok, Twilight of the Gods!~"; ], has animate scenery proper; Object -> couch with name 'couch' 'sofa' 'cushions' 'cushion', description "Can you believe someone just left an awesome couch like this sitting out on the sidewalk? It's got big fluffy cushions with a different pattern on each one -- plaid, paisley, and your personal favorite, candy cane stripes -- and it still doesn't smell at all, despite never once being cleaned since you got it.", before [; Search, Rub, LookUnder, Take: if (self has general) { "Alas, there are no more treasures to be found in the sofa for the time being."; } give self general; move wrapper to player; move quarter to player; move oil to player; move penny to player; move dime to player; move catHair to player; "You poke around between the couch cushions.^^ Thor rumbles, ~This is an indignity up with which I should not have to put!~ But he still lifts his butt cheek enough to let you check underneath the cushion he's sitting on.^^ Jackpot! You come away with a candy wrapper, a quarter, a small bottle of oil, a penny, a dime and a wad of cat hair!"; ], after [; Enter: if (self hasnt general) "The cushions feel a bit lumpy these days."; ], has supporter enterable scenery; Object -> dvdPlayer "combination TV/DVD player" with name 'combination' 'TV/DVD' 'tv' 'dvd' 'player' 'power' 'button' 'movie', description "The DVD is already in the player. You just need to turn it on.", before [; SwitchOn: if (kitchen has general) "You hit the button, but nothing happens. That might be because there's no power at the moment."; if (popcorn notin lisa) "Lisa immediately kicks the power button with her foot, turning it back off again.^^ Lisa mumbles, ~Can't watch a movie without popcorn...~^^ Thor rumbles, ~But The time has come for Ragnarok, Twilight of the Gods!~^^ From the other room, Mindo telepathically communicates, ~Providing snacks is one of your duties as a host.~^^ Mindo is, as usual, correct."; score++; deadflag = 2; print "You turn on the DVD player and TV, then join Thor on the couch. Mindo drifts in from the kitchen as the copyright notice plays. Lisa munches her popcorn, and the opening title sequence finally begins:^^"; style underline; print "RAGNAROK: TWILIGHT OF THE GODS"; style roman; "^^Thor rumbles, ~Huzzah!~"; Receive: "There's already a DVD in the player."; SwitchOff: "It's already off. You need to turn it on."; ], has scenery container; Object wrapper "candy wrapper" with name 'candy' 'wrapper' 'almond' 'joy', description "It's apparently from an Almond Joy."; Object quarter "quarter" with name 'canadian' 'quarter', description "Twenty-five cents! That's enough to buy a Garfield phone at a yard sale. Too bad it's Canadian."; Object oil "small bottle of oil" with name 'small' 'bottle' 'of' 'oil', before [; Insert, PutOn: if (second == kernels) { remove self; give kernels general; "You pour the oil over the popcorn kernels and dispose of the bottle."; } "It might be fun to oil ", (the) second, " up, but you have other things to worry about right now."; ], description "You're not really sure what kind of oil this is, but you think it might be left over from when Mindo took that massage class. It's amazing what he was able to do for the knots in your shoulders despite not actually possessing hands."; Object penny "penny" with name 'copper' 'penny', description "A miniature relief portrait of Abraham Lincoln, in copper and zinc."; Object dime "dime" with name 'dime' 'ten' 'cents', description "Ten cents. At one time, this is what you needed if you wanted to make a phone call."; Object catHair "wad of cat hair" with name 'wad' 'of' 'cat' 'hair', description "Odd, really, as neither you nor Mindo has ever actually owned a cat."; [ Initialise; location = kitchen; lookmode = 2; "^^^Late night movie night at your place! It's two AM, your friends are here, the DVD is already in the machine, and you're ready to watch.^^ Or are you?^^"; ]; [ XyzzySub; "vimes says, ~Hm. Kernels, Ragnarok, mind, a copper coin, and a badly-implemented NPC.~"; ]; [ CallSub; if (player in kitchen) { << Take telephone >>; } "But the phone is in the kitchen."; ]; Include "Grammar"; Verb 'xyzzy' * -> Xyzzy; Verb 'call' * topic -> Call; Verb 'phone' * topic -> Call; Verb 'telephone' * topic -> Call;