#!/usr/bin/perl ############################################################################### # chapter2.pl # ############################################################################### # Chapter 2 of Artemis Fowl # # =========================================================================== # # This is a Perl game of the first Artemis Fowl book. This second part is # # the second chapter. (No, really?) It also contains parts of Chapter Four, # # to connect the same "story arc." # # =========================================================================== # # Disclaimer: # # This game is based on the book series Artemis Fowl by Eoin Colfer. No # # profit is being made from this and all is done purely for the sake of # # entertainment. No claim is being made to the ownership of Artemis Fowl. # # The rights to this series and all fictional elements associated with it go # # to Eoin Colfer, Puffin Books, Penguin Books, Hyperion and Miramax Books. # # No infringement of any international copyright law is intended here. # # # # The ASCII art in the game was obtained from an Internet ASCII generator # # (http://www.network-science.de/ascii/) based on FIGlet. # # HTML-Frontend (c) 1996-2006 by Jorg Seyfferth # # FIGlet (http://www.figlet.org/) # # (c) 1991, 1993, 1994 Glenn Chappell and Ian Chai # # Credits for the 140-150 fonts are listed in the font database # # (http://www.figlet.org/fontdb.cgi) # # =========================================================================== # # This work is licensed under the # # Creative Commons Attribution-NonCommercial-NoDerivs2.5 License. # # To view a copy of this license, visit # # http://creativecommons.org/licenses/by-nc-nd/2.5/ # # or send a letter to Creative Commons, 543 Howard Street, # # 5th Floor, San Francisco, California, 94105, USA. # # =========================================================================== # # Thanks to: The White Lily for all her help during alpha testing. # # Nindra, Diana, voldy92, Stupid Ape, and Koru of AFC for beta testing. # # =========================================================================== # # Version: 0.6beta # # Released: October 1, 2006. # # Programed by: Gus (gussiki@gmail.com) # ############################################################################### use strict; use warnings; use Text::Wrap qw(wrap $columns $huge); $columns = 80; $huge = "wrap"; sub BEGIN { # This subroutine is only in place for the publicly-available versions # It does not appear in the original old releases print " # =========================================================================== # # Disclaimer: # # This game is based on the book series Artemis Fowl by Eoin Colfer. No # # profit is being made from this and all is done purely for the sake of # # entertainment. No claim is being made to the ownership of Artemis Fowl. # # The rights to this series and all fictional elements associated with it go # # to Eoin Colfer, Puffin Books, Penguin Books, Hyperion and Miramax Books. # # No infringement of any international copyright law is intended here. # # # # The ASCII art in the game was obtained from an Internet ASCII generator # # (http://www.network-science.de/ascii/) based on FIGlet. # # HTML-Frontend (c) 1996-2004 by Jörg Seyfferth # # FIGlet (http://www.figlet.org/) # # (c) 1991, 1993, 1994 Glenn Chappell and Ian Chai # # Credits for the 140-150 fonts are listed in the font database # # (http://www.figlet.org/fontdb.cgi) # # =========================================================================== # ===Please Hit Enter to Continue==="; ; print " # =========================================================================== # # This work is licensed under the # # Creative Commons Attribution-NonCommercial-NoDerivs2.5 License. # # # # To view a copy of this license, visit # # http://creativecommons.org/licenses/by-nc-nd/2.5/ # # or send a letter to Creative Commons, 543 Howard Street, # # 5th Floor, San Francisco, California, 94105, USA. # # =========================================================================== # ===Please Hit Enter to Begin===\n"; ; } ### The actual program starts here. ### begin: # Declare the variables here my ($output, $invalid, $quit, $help, $restart, $choice, $rand, $rand2, $loop, $talkangeline, $getpills, $seepills, $pills, $cable, $julietfoyer, $flickswitch, $pluggedin, $computeron, $fixcurtains, $doorlocked, $key, $seedoor, $opencurtains, $count, $takenpills, $takencable); # Define the variables $talkangeline = 0; $getpills = 0; $seepills = 0; $pills = 0; $cable = 0; $flickswitch = 0; $pluggedin = 0; $computeron = 0; $fixcurtains = 0; $key = 0; $seedoor = 0; $count = 0; $takenpills = 0; $takencable = 0; $loop = 1; $julietfoyer = 1; $doorlocked = 1; $opencurtains = 1; $invalid = "\nSorry, but that is an invalid option.\n"; ### Subroutines ### # The "put" subroutine, stealing a command from Turing sub put { $output = $_[0]; $output =~ s/( ){3,}//g; $output =~ s/\t//g; print wrap("", "", $output); } # The "quit" subroutine sub quit { quit: &put("\nAre you sure you want to exit? Y/N > "); $quit = ; chomp($quit); if ($quit =~ /^(y|yes)$/i) { die "\nThanks for playing!\n"; } elsif ($quit =~ /^(n|no)$/i) { &put("You have chosen to continue playing. ===Please Hit Enter to Continue===\n"); ; } else { print $invalid; $quit = ""; goto quit; } } # The "help" subroutine sub help { $help = " === Help Screen Page 1 of 2=== The object of this game is to complete this chapter. In this case, you have to obtain the objects neccesary to translate the Book. In this chapter, you are playing the character of Artemis Fowl II. This game has deviated from the original text of the book for creativity and a greater challenge. If you get stuck, start again and record your steps. It is also a good idea to read everything carefully. Please note that there is no way to save your progress. To obtain this screen again, type \"help\". ===Please Hit Enter to Continue==\n"; $help =~ s/( ){3,}//g; print wrap("", "", $help); ; $help = " === Help Screen Page 2 of 2=== Here are some basic commands. Please note that there are more options not listed here. look = Shows information about your surroundings go = Specify where you want to go with full or abbreviated compass directions. Room names are also accepted. i/inv/inventory = Shows your inventory who/whoami = Tells you which character you're currently playing as talk/talk to = Talk to a person for advice or clues examine/look at = Examine an object for clues get/take = Get an object to use later on in the game type [INPUT] = Type text into a computer help = Access this screen restart = Restart game exit/quit = Exit the game ===Please Hit Enter to Continue==\n"; $help =~ s/( ){3,}//g; print wrap("", "", $help); ; } # The "restart" subroutine sub restart { restart: print "\nWould you like to restart? Y/N\n> "; $restart = ; chomp($restart); if ($restart =~ /^(y|yes)$/i) { goto begin; } elsif ($restart =~ /^(n|no)$/i) { &put("\n\nThanks for staying! ===Please Hit Enter to Continue===\n"); ; } else { print $invalid; goto restart; } } # The "choice" subroutine sub choice { &put("\n\nWhat would you like to do? > "); $choice = ; chomp($choice); } # The "inventory" subroutine. Very limited. sub inventory { print "\nYou have:\n"; if ($pills) { print "\nBottle of sleeping pills"; } if ($cable) { print "\nPower cable for your computer"; } if ($key) { print "\nKey"; } if (!$pills && !$cable && !$key) { print "\nNothing"; } } # Common commands sub common { if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /^i(nv)?(entory)?\b/i) { &inventory; } elsif ($choice =~ /^restart\b/i) { &restart; } elsif ($choice =~ /^(who|whoami)\b/i) { print "\nYou are Artemis Fowl II."; } elsif ($choice =~ /^(examine|look at)$/i) { &put("\n\L\u$1\E what?"); } elsif ($choice =~ /^(get|take)$/i) { &put("\n\L\u$1\E what?"); } elsif ($choice =~ /\bkill\b/i) { &put("\nYou really shouldn't be getting homicidal urges. We wouldn't want you to become a serial killer, would we?"); } elsif ($choice =~ /^(go to|visit) (crim|(the )?orion( awards)?)$/i) { &put("\nYou don't want to go there. The fangirls would rip you apart. Not even Butler could save you."); } elsif ($choice =~ /^rent (a )?gondola$/i) { &put("\nGondolas are not Ireland. They're in Venice, ski resorts, and your fandom."); } elsif ($choice =~ /^crack(.*)knuckles$/i) { &put("\nYou go ahead and crack your knuckles, ignoring the fact that you absolutely dislike this habit. You hypocrite."); } elsif ($choice =~ /^translate (the )?book(e)?$/i) { &put("\nYou need a computer to do that."); } elsif ($choice =~ /^go (insane|crazy)$/i) { &put("\nAren't you already insane?"); } elsif ($choice =~ /\bfortune\b/i) { &put("\nThis file will self-destruct in five seconds."); } elsif ($choice =~ /\bgiggle\b/i) { &put("\nYou start giggling insanely. I never knew your insanity stretched this far..."); } elsif ($choice =~ /\bdrink perky juice\b/i) { &put("\nUm... why would you want to drink a concoction that is supersaturated with sugare and caffeine?"); } elsif ($choice =~ /\b((put|pull) on|wear) (tlp|tight leather pants)\b/i) { &put("\nPlease. You've got enough drooling fangirls after you. Unless you want to drown in fangirl!drool, I advise you to put your tight leather pants away."); } elsif ($choice =~ /^simon says (.*)$/i) { &put("\nYou $1. Don't act so surprised. First of all, your name isn't Simon. And second of all, you don't order me around."); } elsif ($choice =~ /\b(gus|gussiki|gussuki)\b/i) { &put("Gus is the programmer. He's unavailable at the moment. No, he will not give you hints or tips. And no, he won't take a message."); } elsif ($choice =~ /\b(lily|whilily|(the( )?)?white( )?lily)\b/i) { &put("The White Lily is the alpha tester. Give her thanks for putting in her time to test this game. Don't even think about asking her to help you beat this game."); } else { $rand = int(rand 20) + 1; if ($rand == 1) { &put("\nIs this supposed to be some underlying motive in an overall large scheme to dominate the world?"); } elsif ($rand == 6) { &put("\nOnce upon a time, there was a little, arrogant (and possibly somewhat intelligent) boy named Artemis Fowl II. On a futile attempt to translate the Book, he got rather confused and passed an invalid command to me. I never really understood what Artemis Fowl was talking about, and treated him to a tale of his stupidity. The moral of this story? Use. Proper. Commands."); } elsif ($rand == 11) { &put("\n\"$choice\"? What in the name of Pathologicaly Eclectic Rubbish Lists are you talking about? Next time you want to do something, try a valid command."); } elsif ($rand == 16) { &put("\nIs this supposed to be a new swear word in a language you're inventing?"); } elsif ($rand == 20) { &put("\nIf a drunken gnome can't understand that, how am I supposed to?"); } else { print $invalid; } } } ### Yay! Now the game actually starts! ### print " _____ _ _ _____ _ | _ |___| |_ ___ _____|_|___ | __|___ _ _ _| | | | _| _| -_| | |_ -| | __| . | | | | | |__|__|_| |_| |___|_|_|_|_|___| |__| |___|_____|_| _____ _ _ ___ | | |_ ___ ___| |_ ___ ___ |_ | | --| | .'| . | _| -_| _| | _| |_____|_|_|__,| _|_| |___|_| |___| |_| Programmed by Gus ===Please Hit Enter to Begin===\n"; ; &help; # Print help screen at the begining. ## Introductory text ## &put("\nYou have just arrived at Fowl Manor, after your trip to Vietnam to obtain a copy of the Book. Your copy of the Book is sitting on hard drive in the study. Butler has gone to the surveillance booth to check Fowl Manor's security. You make your way to the main foyer.\n"); ## The Foyer (of Fowls) foyer: &put("\nYou are standing in the middle of the main foyer. The \"Foyer of Fowls\" as Butler's sister, Juliet, so aptly named it. With good reason, because the walls are covered with portraits of your ancestors. The most ostentatious spot in the foyer is reserved for a plaque. The front door is to the east, and the kitchen is to the west. The staircase is also to the west, and goes to the second floor."); if ($julietfoyer) { &put("\n\nJuliet is sitting on the bottom step of the staircase."); } while ($loop == 1) { &choice; if ($choice =~ /^look$/i) { goto foyer; } elsif ($choice =~ /^go\b/i) { if ($choice =~ /\bn(orth( (corridor|wing|hall))?)?$/i) { &put("\nNothing of interest there, just the garage and conference room.\n"); } elsif ($choice =~ /\b(e(ast)?|front door|outside)$/i) { if ($julietfoyer) { &put("\nYou just were outside. No, you didn't drop anything. Trust me.\n"); } elsif (!$julietfoyer) { &put("\nYou go outside.\n"); goto outside; } } elsif ($choice =~ /\b(w(est)?|kitchen)$/i) { &put("\nYou go to the kitchen.\n"); goto kitchen; } elsif ($choice =~ /\bup(stairs| (grand )?staircase)?$/i) { &put("\nYou go up the grand staircase.\n"); goto landing; } elsif ($choice =~ /\bs(outh( (corridor|wing|hall))?)?$/i) { &put("\nNothing of interest there. Just a few cellars and storage rooms.\n"); } else { &put("\nYou try to $choice but you trip over your costly loafers and fall to the ground. Maybe you shouldn't go there."); } } elsif ($choice =~ /^(look( at)?|examine)\b/i) { if ($choice =~ /\bfoyer( of fowls)?$/i) { &put("\nWhere you're standing. Big, empty. Quite dreary in my opinion, actually."); } elsif ($choice =~ /\b(portrait|picture)(s)?$/i) { &put("\nThose are your ancestors. Nothing special about them. Just a bunch of criminals."); } elsif ($choice =~ /\b(plaque)$/i) { &put("\nYour family motto is engraved on the plaque. \"Aurum Potestas Est.\" Gold is Power."); } elsif ($choice =~ /\b(plague)$/i) { &put("\nA plague o' both your houses! What, you don't appreciate Shakespeare?"); } elsif ($choice =~ /\b(stairs|(grand )?staircase)$/i) { &put("\nBig. Grand. Old. A hallmark of your family's ancestry and wealth. It goes upstairs."); } elsif ($choice =~ /\bjuliet$/i) { if ($julietfoyer) { &put("\nButler's sister. Your mother's maid. If you get any thoughts about dating her, you'd better drop them, before she drops you with a suplex."); } elsif (!$julietfoyer) { &put("\nShe left to take the sleeping pills to your mother, remember?"); } } else { &put("\nI don't see one to \L$1\E."); } } elsif ($choice =~ /^(get|take)\b/i) { &put("\nAre you blind or crazy? You can't \L$1\E that!"); } elsif ($choice =~ /^talk( to)?\b/i) { if ($choice =~ /\bjuliet$/i) { if ($julietfoyer) { if ($talkangeline) { if ($pills && $getpills) { &put("\nBefore you can speak, Juliet sees the pills in your hand. \"Thank you, thank you,\" she gasps. \"Oh, before I take these to Madam Fowl, the package you ordered last week is outside. I'm sorry, I forgot to take it in for you.\" Juliet takes the pills from you and scurries up the stairs."); $julietfoyer = 0; $pills = 0; } elsif ($getpills && !$pills) { if ($count %2 == 0) { &put("\n\"I told you Arty, I can't find the sleeping pills. I'm sorry!\" Juliet says."); } elsif ($count %2 == 1) { &put("\n\"I'm almost certain I had them this morning!\" Juliet wails."); } } elsif (!$getpills) { &put("\nYou tell Juliet that your mother is having trouble falling asleep. \"I'd take her some sleeping pills,\" Juliet says, \"but I seem to have misplaced them this morning. I'm sure I had them when I was making breakfast for Madam Fowl!\""); $getpills = 1; } } elsif (!$talkangeline) { if ($fixcurtains && $seedoor && $key) { if ($count %2 == 0) { &put("\n\"Is there anything else Madam Fowl needs?\" Juliet asks you."); } elsif ($count %2 == 1) { &put("\n\"Haven't you gone up to talk to Madam Fowl?\" Julit asks."); } } elsif ($fixcurtains && $seedoor && $doorlocked && !$key) { &put("\n\"I'm so sorry, Arty,\" Juliet apologizes. \"I had to lock Madame Fowl in earlier this morning; she would have left the attic and injured herself. Here's the key.\" Juliet hands you a key."); $key = 1; } elsif ($fixcurtains && !$seedoor) { if ($count %2 == 0) { &put("\nJuliet looks at you and asks \"Shouldn't you be visiting your mother? Madam Fowl is very worried about you...\""); } elsif ($count %2 == 1) { &put("\n\"You might also want to close the curtains for her. She wouldn't want to see me,\" Juliet explains."); } } elsif (!$fixcurtains) { &put("\n\"I'm sorry,\" Juliet says. \"I left a gap in the curtains; Madam Fowl couldn't sleep.\""); $fixcurtains = 1; } } } elsif (!$julietfoyer) { &put("\nShe left to take the sleeping pills to your mother, remember?"); } } elsif ($choice =~ /\bbutler$/i) { &put("\nHe's in the surveillance booth, remember?"); } else { &put("\nSince when were you the outgoing, talkative type?"); } } elsif ($choice =~ /^(give|offer|show) (sleeping )?(pills|(pill )?bottle)( (to )?juliet)?\b/i) { if ($pills) { if ($talkangeline && $julietfoyer && $getpills) { &put("\nBefore you can speak, Juliet sees that pills in your hand. \"Thank you, thank you,\" she gasps. \"Oh, before I take these to Madam Fowl, the package you ordered last week is outside. I'm sorry, I forgot to take it in for you.\" Juliet takes the pills from you and scurries up the stairs."); $julietfoyer = 0; $pills = 0; } elsif (!$talkangeline || !$getpills) { &put("\nWhy? Does Juliet even need those sleeping pills?"); } } elsif (!$pills) { &put("\nA nice gesture, but you don't even have any pills to give!"); } elsif (!$julietfoyer) { &put("\nShe left to take the sleeping pills to your mother, remember?"); } } elsif ($choice =~ /^(quit|exit)\b/i) { &quit; goto foyer; } else { &common; } $count++; } ## Outside outside: &put("\nYou are standing on the very doorstep of Fowl Manor."); if (!$cable && !$takencable) { &put("\n\nThere is a package on the doorstep."); } &put("\n\nYou can go west to go back into Fowl Manor."); while ($loop == 1) { &choice; if ($choice =~ /^look$/i) { goto outside; } elsif ($choice =~ /^go\b/i) { if ($choice =~ /\b(w(est)?|foyer|inside)$/i) { &put("\nYou go to the main foyer.\n"); goto foyer; } else { &put("\nYou try to $choice but you trip over your costly loafers and fall to the ground. Maybe you shouldn't go there."); } } elsif ($choice =~ /^(look( at)?|examine)\b/i) { if ($choice =~ /\bpackage$/i) { &put("\nIt's the computer power cord you ordered last week. It finally arrived."); } elsif ($choice =~ /\bdoorstep$/i) { &put("\nRather ornate, for just a simple doorstep. Take care that you don't trip over it."); } else { &put("\nI don't see one to \L$1\E."); } } elsif ($choice =~ /^(get|take)\b/i) { if ($choice =~ /\bpackage$/i) { if ($cable || $takencable) { &put("\nUm, you already picked up the package, remember?"); } elsif (!$cable && !$takencable) { &put("\nYou pick up the package."); $takencable = 1; $cable = 1; } } else { &put("\nAre you blind or crazy? You can't \L$1\E that!"); } } elsif ($choice =~ /^talk( to)?\b/i) { if ($choice =~ /\bbutler$/i) { &put("\nHe's in the surveillance booth, remember?"); } else { &put("\nSince when were you the outgoing, talkative type?"); } } elsif ($choice =~ /\btrip\b/i) { &put("\nYou somehow manage to trip over air and fall onto the ground. Rather painfully, I must admit."); } elsif ($choice =~ /^(quit|exit)\b/i) { &quit; goto outside; } else { &common; } $count++; } ## Kitchen kitchen: &put("\nYou are in the kitchen. In contrast to the antiquity of the main foyer, the kitchen has state-of-the-art appliances. The foyer is to the east, and the door to the north takes you to the pantry."); while ($loop == 1) { &choice; if ($choice =~ /^look$/i) { goto kitchen; } elsif ($choice =~ /^go\b/i) { if ($choice =~ /\b(e(ast)?|foyer)$/i) { &put("\nYou go to the main foyer.\n"); goto foyer; } elsif ($choice =~ /\b(n(orth)?|pantry)$/i) { &put("\nYou go to the pantry.\n"); goto pantry; } else { &put("\nYou try to $choice but you trip over your costly loafers and fall to the ground. Maybe you shouldn't go there."); } } elsif ($choice =~ /^(look( at)?|examine)\b/i) { if ($choice =~ /\bkitchen$/i) { &put("\nI already told you. State-of-the-art appliances. Not that you'd care."); } elsif ($choice =~ /\bappliances$/i) { &put("\nI'm not going to bother telling you something that you wouldn't care about."); } else { &put("\nI don't see one to \L$1\E."); } } elsif ($choice =~ /^(get|take)\b/i) { if ($choice =~ /\bfood$/i) { &put("\nToo bad. Everything is cleaned up and there isn't anything to eat. Unless you enjoy eating state-of-the-art appliances? I didn't think so."); } else { &put("\nAre you blind or crazy? You can't \L$1\E that!"); } } elsif ($choice =~ /^talk( to)?\b/i) { if ($choice =~ /\bbutler$/i) { &put("\nHe's in the surveillance booth, remember?"); } elsif ($choice =~ /\bappliances$/i) { &put("\nYou really must have gone bonkers, to think that you can talk to a kitchen appliance."); } else { &put("\nSince when were you the outgoing, talkative type?"); } } elsif ($choice =~ /^(make|cook)\b/i) { &put("\nAren't you a bit too young to operate those state-of-the-art appliances?"); } elsif ($choice =~ /^eat\b/i) { &put("\nThere's nothing to eat."); } elsif ($choice =~ /^(quit|exit)\b/i) { &quit; goto kitchen; } else { &common; } $count++; } ## Pantry pantry: &put("\nThis is the pantry. There's really no point coming here. Juliet and Butler do the cooking and come here to get the food. You don't cook, therefore you don't need to come here. There are shelves and shelves of food, drink, and cookware, tidily arranged for the most part."); if (!$pills && !$takenpills) { &put(" Something's wrong, though."); } &put("\n\nThe only exit is to the kitchen, which is south."); while ($loop == 1) { &choice; if ($choice =~ /^look$/i) { goto pantry; } elsif ($choice =~ /^go\b/i) { if ($choice =~ /\b(s(outh)?|kitchen)$/i) { &put("\nYou go to the kitchen.\n"); goto kitchen; } else { &put("\nYou try to $choice but you trip over your costly loafers and fall to the ground. Maybe you shouldn't go there."); } } elsif ($choice =~ /^(look( at)?|examine)\b/i) { if ($choice =~ /\bpantry$/i) { &put("\nPots and pans. Food. Drinks. Supplies."); } elsif ($choice =~ /\bperky juice$/i) { &put("\nWhat makes you think the pantry is a Perky Juice Storeroom? Do you even want to drink that foul brew?"); } elsif ($choice =~ /\b(food|drink(s)?)$/i) { &put("\nAll packaged up and ready to be cooked."); } elsif ($choice =~ /\b(pots|pans|cookware|cooking untensils)$/i) { if ($seepills) { &put("\nEverything is neatly packed onto the shelf."); } elsif (!$seepills) { &put("\nEverything is neatly packed onto the shelf. Except for one upturned pot at the back of one of the shelves."); } } elsif ($choice =~ /\b(shelf|shelves)$/i) { if ($pills) { &put("\nFull of food, drinks, and cookware."); } elsif ($seepills && !$pills) { &put("\nFull of food, drinks, and cookware. At the bottom of one of the shelves is a bottle of pills."); } elsif (!$seepills) { &put("\nFull of food, drinks, and cookware. However, there's something wrong with one shelf. At the very back of the shelf, one of the pots has been upturned."); } } elsif ($choice =~ /\b(upturned pot)$/i) { if ($seepills) { &put("\nYou already flipped the pot over."); } elsif (!$seepills) { &put("\nAll the other pots here have the rim facing up, but this one has the rim facing down."); } } elsif ($choice =~ /\b(pots|pans|cookware|cooking utensils)$/i) { &put("\nAgain, state-of-the-art \L$1\E."); } elsif ($choice =~ /\b(bottle( of pills)?|pills)$/i) { if ($seepills) { &put("\nA close inspection reveals them to be sleeping pills."); } elsif (!$seepills) { &put("\nWhat pills?"); } } else { &put("\nI don't see one to \L$1\E."); } } elsif ($choice =~ /^(get|take)\b/i) { if ($choice =~ /\bfood$/i) { &put("\nYes, I'll admit there's food here. But you aren't hungry."); } elsif ($choice =~ /\b(pots|pans|cookware|cooking utensils)$/i) { &put("\nWhat are you going to do with \L$1\E? Attack an Orc?"); } elsif ($choice =~ /\bperky juice$/i) { &put("\nThere is no Perky Juice here. Let me repeat it: There is no Perky Juice here. Capisce?"); } elsif ($choice =~ /\b(upturned pot)\b/i) { if ($seepills) { &put("\nYou already flipped the pot over."); } elsif (!$seepills) { &put("\nYou reach to the back of the shelf and pick up the pot. To your surprise, a bottle of pills falls to the floor."); $seepills = 1; } } elsif ($choice =~ /\b(bottle( of pills)?|pills)$/i) { if ($pills) { &put("\nYou already have the pills!"); } elsif ($takenpills) { &put("\nYou've already taken the pills!"); } elsif ($seepills && !$pills && !$takenpills) { &put("\nYou take the pills and replace the pot onto the shelf."); $pills = 1; $takenpills = 1; } elsif (!$seepills) { &put("\nWhat pills?"); } } else { &put("\nAre you blind or crazy? You can't \L$1\E that!"); } } elsif ($choice =~ /^((fix|tip|flip( over)?|turn( over)?) (upturned )?pot)$/i) { if ($seepills) { &put("\nYou already flipped the pot over."); } elsif (!$seepills) { &put("\nYou reach to the back of the shelf and flip over the pot. To your surprise, a bottle of pills falls to the floor."); $seepills = 1; } } elsif ($choice =~ /\bcapisce\b/i) { &put("\nIt's Italian. It means, figuratively, \"do you understand?\" Capisce?"); } elsif ($choice =~ /^talk( to)?\b/i) { if ($choice =~ /\bbutler$/i) { &put("\nHe's in the surveillance booth, remember?"); } elsif ($choice =~ /\b(pots|pans|cookware|cooking utnesils)$/i) { &put("\n\"Hello there, Master Fowl,\" they say to you. Or you think they say. After all, it could easily be your insane imagination."); } else { &put("\nSince when were you the outgoing, talkative type?"); } } elsif ($choice =~ /^(quit|exit)\b/i) { &quit; goto pantry; } else { &common; } $count++; } ## Landing, the top of the stairs landing: &put("\nYou are at the very top of the staircase. You can go down to the foyer on the main floor, continuing going up to the attic, or go north through the hallway to your study."); while ($loop == 1) { &choice; if ($choice =~ /^look$/i) { goto landing; } elsif ($choice =~ /^go\b/i) { if ($choice =~ /\b(n(orth)?|hallway|corridor)$/i) { &put("\nYou walk to the very end of the hallway.\n"); goto outsidestudy; } elsif ($choice =~ /\b(up(stairs)?|attic)$/i) { if ($doorlocked) { &put("\nYou can't go upstairs because the door is locked. Curious. You didn't lock it; you just got here. Butler didn't lock it; he was with you all the time."); $seedoor = 1; } elsif (!$doorlocked) { &put("\nYou continue going up the stairs.\n"); goto attic; } } elsif ($choice =~ /\b(down(stairs)?|(grand )?staircase|foyer)$/i) { &put("\nYou go down the stairs, to the foyer.\n"); goto foyer; } else { &put("\nYou try to $choice but you trip over your costly loafers and fall to the ground. Maybe you shouldn't go there."); } } elsif ($choice =~ /^(look( at)?|examine)\b/i) { if ($choice =~ /\b(stairs|(grand )?staircase)$/i) { &put("\nBig. Grand. Old. A hallmark of your family's ancestry and wealth. You can go up or down."); } else { &put("\nI don't see one to \L$1\E."); } } elsif ($choice =~ /^slide(.*)(banister|rail(ing)?|handle)\b/i) { &put("\nIgnoring the fact that you are a criminal mastermind, and not an immature child, you hop onto the banister and slide down it.\n"); goto foyer; } elsif ($choice =~ /^(get|take)\b/i) { &put("\nAre you blind or crazy? You can't \L$1\E that!"); } elsif ($choice =~ /^(unlock|open)(.*)door\b/i) { if ($key) { &put("\nYou pull the key out of your pocket and unlock the door. You open the door, and the stairs seem to beckon to you."); $doorlocked = 0; } elsif (!$key) { &put("\nNice idea, but you don't have the key."); } } elsif ($choice =~ /^pick lock\b/i) { &put("\nYou may be skilled at gaining unauthorized entry into a computer, but you are definitely not skilled at gaining unauthorized entry through a locked door."); } elsif ($choice =~ /^(force|batter|break( down)?|smash)(.*)(door|lock)\b/i) { &put("\nYou kick the door, but achieve nothing except for a rather painful stubbed toe."); } elsif ($choice =~ /^talk( to)?\b/i) { &put("\nThere's nobody to talk to. You're all alone, genius boy."); } elsif ($choice =~ /^(quit|exit)\b/i) { &quit; goto landing; } else { &common; } $count++; } ## End of the hallway, outside the study outsidestudy: &put("\nYou are at the very end of the hallway, right outside the study. You can go to the staircase, which is south, or go west and enter the study."); while ($loop == 1) { &choice; if ($choice =~ /^look$/i) { goto outsidestudy; } elsif ($choice =~ /^go\b/i) { if ($choice =~ /\b(s(outh)?|(grand )?staircase|stairs)$/i) { &put("\nYou walk south, toward the grand staircase..\n"); goto landing; } elsif ($choice =~ /\b(w(est)?|study)$/i) { &put("\nYou go inside the study.\n"); goto studyroom; } else { &put("\nYou try to $choice but you trip over your costly loafers and fall to the ground. Maybe you shouldn't go there."); } } elsif ($choice =~ /^(look( at)?|examine)\b/i) { if ($choice =~ /\b((hall(way)?)|corridor)$/i) { &put("\nThis hallway runs south to north, from the staircase to your study."); } elsif ($choice =~ /\b(study)$/i) { &put("It's on the west. It used to be your father's study, until his painful demise. Oh, tis that a painful topic? I'm sorry about that."); } else { &put("\nI don't see one to \L$1\E."); } } elsif ($choice =~ /^(get|take)\b/i) { &put("\nAre you blind or crazy? You can't \L$1\E that!"); } elsif ($choice =~ /^talk( to)?\b/i) { &put("\nThere's nobody to talk to. You're all alone, genius boy."); } elsif ($choice =~ /^(quit|exit)\b/i) { &quit; goto outsidestudy; } else { &common; } $count++; } ## The study studyroom: &put("\nYou are inside the study. It used to belong to your father. You have a network of Apple computers set up in the study. One computer is set up with a projector, to display CNN's website on the back wall. Any news of your father's rescue would appear there first."); if ($computeron) { &put("\n\nYour main computer, a powerful workhorse, is sitting in a corner. It is turned on and the fans whirring, waiting for you to use it."); } elsif ($pluggedin && !$computeron) { &put("\n\nYour main computer, a powerful workhorse, is sitting in a corner, with the power turned off. It is plugged into the power outlet."); } elsif (!$pluggedin) { &put("\n\nYour main computer, a powerful workhorse, is sitting in a corner, with the power turned off."); } &put("\n\nThe door to the hallway is to the east."); while ($loop == 1) { &choice; if ($choice =~ /^look$/i) { goto studyroom; } elsif ($choice =~ /^go\b/i) { if ($choice =~ /\b(e(ast)?|outside|corridor|hall(way)?)$/i) { &put("\nYou exit the study and walk into the hallway.\n"); goto outsidestudy; } else { &put("\nYou try to $choice but you trip over your costly loafers and fall to the ground. Maybe you shouldn't go there."); } } elsif ($choice =~ /^(look( at)?|examine)\b/i) { if ($choice =~ /\b(back wall|CNN(web( |-)?site)?)$/i) { &put("\nNope. No news about your father. Better luck next time."); } elsif ($choice =~ /\b(network|mac(s)?|(apple )?computers)$/i) { &put("\nIt's a little network of computers. Highly reliable. But its main purpose is to be a server for your email and stuff. Don't bother using those computers to translate the Book."); } elsif ($choice =~ /\b(workhorse|(main )?computer)$/i) { if ($computeron) { &put("\nThis is the most powerful computer in Fowl Manor. Great for work. It cost about as much as a small car. But there's just one little problem. You're not logged in."); } elsif ($flickswitch && !$pluggedin) { &put("\nThere's something wrong with the workhorse. You flicked the switch, but it isn't turned on. A close inspection reveals that the power cable is missing. Earlier this week the cable was damaged, and you had to order a new one. It should have arrived by now..."); } elsif (($pluggedin && !$computeron) or (!$flickswitch)) { &put("\nThis is the most powerful computer in Fowl Manor. Great for work. It cost about as much as a small car. But there's just one little problem. It's not turned on."); } } else { &put("\nI don't see one to \L$1\E."); } } elsif ($choice =~ /^(get|take)\b/i) { if ($choice =~ /\b(computer(s)?|mac(s)?|workhorse)$/i) { &put("\nThose are desktops. They're not meant to be carried around. Yeah, you've got a few laptops lying around, but it's not as if you need them."); } elsif ($choice =~ /\b(network)$/i) { &put("\nTell me, how you are going to carry around something that is not only intangible, but virtual?"); } elsif ($choice =~ /\b(laptop(s)?)$/i) { &put("\nThose little laptops aren't powerful enough to translate the Book. Besides, where are you going to take them? This is the best place to do your work."); } else { &put("\nAre you blind or crazy? You can't \L$1\E that!"); } } elsif ($choice =~ /^((turn|switch) on (workhorse|computer)|(turn|switch) (workhorse|computer) on|(press|switch|push|flip|flick) (power )?(button|switch)( on)?)$/i) { if ($computeron) { &put("\nYour computer is already on. You just turned it on! What kind of memory do you have?"); } elsif ($pluggedin && !$computeron) { &put("\nYou flick the power switch on your computer and your computer whirs into life."); $computeron = 1; $flickswitch = 1; } elsif (!$pluggedin) { &put("\nYou flick the power switch on your computer, but nothing turns on."); $flickswitch = 1; } } elsif ($choice =~ /^((turn|switch) off (workhorse|computer)|(turn|switch) (workhorse|computer) off)$/i) { if ($computeron) { &put("\nIgnoring the hazards of crashing a computer, you press the power button and turn it off."); $computeron = 0; } elsif (!$computeron) { &put("\nYour computer isn't even on!"); } } elsif ($choice =~ /^(log( )?(in|on))\b/i) { if ($computeron) { &put("\nYou need a password to log in."); } elsif (!$computeron) { &put("\nYou need to turn the computer on first."); } } elsif ($choice =~ /^type\b/i) { if ($choice =~ /\b(aurumestpotestas|aurum est potestas)$/i) { &put("\nUm, that's not quite your family motto. Your family motto uses proper Latin."); } elsif ($choice =~ /\baurumpotestasest$/i) { &put("\nThat's close... but it's not all lumped together in one single word."); } elsif ($choice =~ /\baurum potestas est$/i) { &put("\nYou $choice into your computer and your account logs in.\n"); goto endgame; } elsif ($choice =~ /\bformat$/i) { &put("\nYou really think it's a good idea to format your hard drive?"); } else { &put("\nWrong password. I'll give you a hint. It's your family motto."); } } elsif ($choice =~ /^((plug|insert|push|put)( in)?( power)? (cable|cord|computer|workhorse)( in)?)$/i) { if ($pluggedin) { &put("\nYour computer is already plugged in."); } elsif ($cable) { &put("\nYou whip out the mail package and take the cable out. You reach over to your computer and plug it in. Your computer is still off."); $pluggedin = 1; $cable = 0; } elsif (!$cable && !$pluggedin) { &put("\nErm, you don't have one of those. That's why you ordered one."); } } elsif ($choice =~ /^((unplug|remove|pull|yank)( out)?( power)? (cable|cord|computer|workhorse)( in)?)$/i) { if ($pluggedin && $computeron) { &put("\nYou yank out the power cord and watch as the fans in your computer wind down."); $pluggedin = 0; $computeron = 0; } elsif ($pluggedin && !$computeron) { &put("\nYou yank out the power cord.."); $pluggedin = 0; } elsif (!$pluggedin) { &put("\nWhy would you do that, even if your computer was plugged in?"); } } elsif ($choice =~ /^talk( to)?\b/i) { &put("\nThere's nobody to talk to. You're all alone, genius boy."); } elsif ($choice =~ /\bdefenestrate\b/i) { &put("\nThe only thing worth throwing out a window is Windows, which, fortunately, you don't have. In fact, Mac OS X doesn't even suit you. Unix would suit you far better. (Yes, yes, I know that Mac OS X is derived from Unix, but oh well.)"); } elsif ($choice =~ /^(quit|exit)\b/i) { &quit; goto studyroom; } else { &common; } $count++; } ## The attic attic: &put("\nYou are inside the attic. Your mother is slightly out of touch with reality and sanity, and spends all her time in her bed in the attic. She has been this way since your father's disappearance."); if ($opencurtains) { &put("\n\nThere is a gap in the curtains. It is a small one, but it is enough to flood the attic with light."); } elsif (!$opencurtains) { &put("\n\nThe curtains are tightly shut, not letting any light in."); } if (!$julietfoyer) { &put("\n\nYour mother is asleep. Apparently, Juliet has already given her the sleeping pills."); } &put("\n\nYou can stay, or go downstairs."); while ($loop == 1) { &choice; if ($choice =~ /^look$/i) { goto attic; } elsif ($choice =~ /^go\b/i) { if ($choice =~ /\b(down(stairs)?)$/i) { &put("\nYou leave the attic and go downstairs.\n"); goto landing; } else { &put("\nYou try to $choice but you trip over your costly loafers and fall to the ground. Maybe you shouldn't go there."); } } elsif ($choice =~ /^(look( at)?|examine)\b/i) { if ($choice =~ /\b(angeline|mother)$/i) { if ($julietfoyer && $opencurtains) { &put("\n\"Arty dear, could you close the curtains for me?\" your mother asks."); } elsif ($julietfoyer && !$opencurtains) { &put("\n\"That maid has been nothing but trouble since she arrived! She left those curtains open and I couldn't sleep at all!\" your mother complains. \"I want you to talk to have a stern talking to her, Arty! She's completely useless, I tell you!\""); $talkangeline = 1; } elsif (!$julietfoyer) { &put("\nYour mother is asleep. Apparently, Juliet has already given her the sleeping pills."); } } elsif ($choice =~ /\blint$/i) { &put("\nThere's a lot of lint here. Too bad you couldn't transform it into a valuable parsley substitute. Now that would make you rich."); } else { &put("\nI don't see one to \L$1\E."); } } elsif ($choice =~ /^(get|take)\b/i) { &put("\nAre you blind or crazy? You can't \L$1\E that!"); } elsif ($choice =~ /^give (pills|bottle( of pills)?)( to (mother|angeline))?\b/i) { if ($pills) { &put("\nWhy does your mother need the pills?"); } elsif (!$pills) { &put("\nYou don't even have any pills to give!"); } } elsif ($choice =~ /^hug (mother|angeline)\b/i) { &put("\n\"Arty, give me a hug,\" your mother asks. You hug her, and notice how weak she really is."); } elsif ($choice =~ /^eat (mother|angeline)\b/i) { &put("\nGoing to take part in cannabalism?"); } elsif ($choice =~ /^(close|pull( together)?|draw) (curtains|drapes)\b/i) { if ($opencurtains) { &put("\nYou reach towards the curtains and pull them together, extinguishing most of the light in the room."); $opencurtains = 0; } elsif (!$opencurtains) { &put("\nYou already closed them! Surely you aren't that forgetful!"); } } elsif ($choice =~ /^(open|pull( apart)?|yank( open)?) (curtains|drapes)\b/i) { if ($opencurtains) { &put("\nThe curtains already are open!"); } elsif (!$opencurtains) { &put("\nWhy would you want to do that?"); } } elsif ($choice =~ /^talk( to)?\b/i) { if ($choice =~ /\b(mother|angeline)$/i) { if ($julietfoyer && $opencurtains) { if ($count %2 == 0) { &put("\n\"Arty dear, could you close the curtains for me?\" your mother asks."); } elsif ($count %2 == 1) { &put("\n\"I can't sleep in this blinding light,\" your mother says."); } } elsif ($julietfoyer && !$opencurtains) { &put("\n\"That maid has been nothing but trouble since she arrived! She left those curtains open and I couldn't sleep at all!\" your mother complains. \"I want you to talk to have a stern talking to her, Arty! She's completely useless, I tell you!\""); $talkangeline = 1; } elsif (!$julietfoyer) { &put("\nYour mother is asleep. Apparently, Juliet has already given her the sleeping pills."); } } elsif ($choice =~ /\bbutler$/i) { &put("\nHe's in the surveillance booth, remember?"); } else { &put("\nSince when were you the outgoing, talkative type?"); } } elsif ($choice =~ /^(quit|exit)\b/i) { &quit; goto attic; } else { &common; } $count++; } ## The endgame! endgame: &put("\nNow that you're logged in, you set to work translating the Book. Many difficulties arrive, but after a whole day of solid work, you have finally translated the Book. The first human to do so. You read through the Book, and already, a plan is forming in your mind. Fairies must replenish their magic by performing the \"Ritual.\" This \"Ritual\" must be performed at a specific place and a specific time. With this knowledge, you and Butler can stake out one of these hotspots and wait for a vulnerable fairy to arrive. Then you can capture the fairy and hold him ransom for gold. You decide to get some sleep before sharing your plan with Butler. ===Please Hit Enter to Continue===\n"); ; &put("\nCongratulations. You have beaten the level. The adventure continues... ===Please Hit Enter to Exit===\n"); ;