#!/usr/bin/perl ############################################################################### # chapter1.pl # ############################################################################### # Chapter 1 of Artemis Fowl # # =========================================================================== # # This is a Perl game of the first Artemis Fowl book. This first part is # # the first chapter. # # =========================================================================== # # 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. # # =========================================================================== # # 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. # # =========================================================================== # # Version: 0.1alpha # # Released (for alpha testing): November 26, 2005 # # Programed by: Gus (gussiki@gmail.com) # # =========================================================================== # # Other notes: # # This is a very rough version of the game. Later versions will be more # # streamlined, contain other features (such as restarting, saving, loading, # # etc), and will be fully commented. # ############################################################################### use strict; use warnings; 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. # # =========================================================================== # ===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"; ; } begin: # Declare the variables here my ($quit, $invalid, $toothpick, $cup, $choice, $count, $restart, $pebble, $tea, $email); # Define the variables $toothpick = 0; $cup = 0; $count = 0; $pebble = 0; $tea = 0; $email = 0; # Subroutines # The "quit" subroutine sub quit { quit: print "\nAre you sure you want to exit? Y/N > "; $quit = ; chomp($quit); if ($quit =~ /\b(y|yes\b)/i) { die "\nThanks for playing!\n"; } elsif ($quit =~ /\b(n|no)\b/i) { print "\nYou have chosen to continue playing. ===Please Hit Enter to Continue===\n"; ; } else { &invalid; goto quit; } } # The "help" subroutine sub help { print " === Help Screen === This game is still in its early stages. Because of this, this help file is very limited. The object of this game is to complete this chapter. In this case, you have be able to obtain a copy of the Book and successfully bring it back to Fowl Manor. In this chapter, you are playing the character of Artemis Fowl II. As such, there is no need for a \"who am I\" command. 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. Please note that there is no way to save your progress. To obtain this screen again, type \"help\". ===Please Hit Enter to Continue===\n"; ; } # The "invalid" subroutine sub invalid { print "\nSorry, but that is an invalid option. ===Please Hit Enter to Try Again===\n"; ; } # The "choice" subroutine sub choice { print "\n\nWhat would you like to do? > "; $choice = ; chomp($choice); } # The "gameover" subroutine sub gameover { gameover: print "\n GGGGGG AA MMM MMM EEEEEE OOOOOO VV VV EEEEEE RRRRR GG AA AA MM M M MM EE OO OO VV VV EE RR RR GG GG AAAAAA MM M M MM EEEEEE OO OO VV VV EEEEEE RRRRR GG GG AA AA MM M MM EE OO OO VV VV EE RR RR GGGGGG AA AA MM MM EEEEEE OOOOOO VV EEEEEE RR RR\n"; print "\nWould you like to restart? Y/N > "; $restart = ; chomp($restart); if ($restart =~ /\b(y|yes\b)/i) { goto begin; } elsif ($restart =~ /\b(n|no)\b/i) { die "\nThanks for playing!\n"; } else { &invalid; goto gameover; } } # Yay! Now the game actually starts! &help; saigon: print "\nYou are in Ho Chi Minh City, Vietnam with your bodyguard Butler. Your mission is to obtain a copy of the Book, a \"Bible\" of the fairies. You are sitting outside a cafe, waiting for your informant Nguyen Xuan.\n"; if (!$toothpick && !$cup) { print "\nOn the table, there is a toothpick and a cup of tea."; } elsif (!$toothpick) { print "\nOn the table, there is a toothpick."; } elsif (!$cup) { print "\nOn the table, there is a cup of tea."; } else { print "\nThere is nothing on the table."; } until ($count == 7) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /\blook\b/i) { goto saigon; } elsif ($choice =~ /^(get|take)/i) { if ($choice =~ /toothpick$/i) { if ($toothpick == 0) { $toothpick = 1; $count++; print "\nYou take the toothpick."; } else { print "\nAre you blind? You already have the toothpick!"; $count++; } } elsif ($choice =~ /(cup|cup of tea|tea)$/i) { if ($cup == 0) { $cup = 1; $count++; print "\nYou take the tea."; } else { print "\nAre you blind? You already have the tea!"; $count++; } } else { print "\nAre you blind? That's not on the table!"; $count++; } } elsif ($choice =~ /\bexamine tea/i) { print "\nIt is a cup of tea. It is most definitely not Earl Grey, but it is tolerable."; $count++; } elsif ($choice =~ /\bexamine toothpick\b/i) { print "\nA very blunt toothpick. It won't hurt anybody. But it's quite sturdy, for a toothpick."; $count++; } elsif ($choice =~ /\bwait\b/i) { $count++; } elsif ($choice =~ /\b(quit|exit)\b/i) { &quit; goto saigon; } else { $count++; &invalid; } } print "\nA waiter arrives at your table, and asks: \"More tea, sirs?\""; $count = 0; waiter: until ($count == 5) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /\bwait\b/i) { $count++; } elsif ($choice =~ /\blook\b/i) { print "\nA waiter is asking if you want more tea."; } elsif ($choice =~ /\b(ignore|ignore him|ignore the waiter|no|no tea|no thanks)/i) { print "\nThe waiter goes away. You get impatient and call off the mission. You go back to Fowl Manor."; &gameover; } elsif ($choice =~ /\b(yes|yes please|tea please|more tea|more tea please)/i) { print "\nThe waiter goes away for a while. He comes back, and sees Butler's guns. He immediately calls the police. You and Butler are escorted to a police station."; &gameover; } elsif ($choice =~ /\bexamine waiter\b/i) { print "\nThe waiter is wearing handmade loafers, a silk shirt, and three gold signet rings. His English has a tinge of Oxford about it, and his nails have the soft sheen of the recently manicured."; $count++; } elsif ($choice =~ /\b(tell waiter to sit down|tell him to sit down|tell him to sit|tell waiter to sit|sit down|sit|say sit|say sit down)\b/i) { goto nguyen; } elsif ($choice =~ /\b(quit|exit)\b/i) { &quit; print "\nA waiter is asking if you want more tea."; } else { &invalid; $count++; } } print "\nThe waiter goes away. You get impatient and call off the mission. You go back to Fowl Manor."; &gameover; nguyen: print "\nThe waiter turns to Butler. He opens his mouth to speak, but you cut him off. You tell him how pathetic his disguise, and exactly how easily you penetrated it. You also fill him in on the weapons status, listing a large number of weapons that Butler is carrying, and also state how dangerous Butler is, even without his weapons. You ask Nguyen Xuan what information he has for you, and whether he has proof. Nguyen pulls out a Polaroid from his wallet and pushes it across the table."; $count = 0; polaroid: until ($count == 5) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /\bwait\b/i) { $count++; } elsif ($choice =~ /\blook\b/i) { print "\nThe Polaroid is on the table. Nguyen Xuan looks at you nervously."; } elsif ($choice =~ /\b(quit|exit)\b/i) { &quit; print "\nThe Polaroid is on the table. Nguyen Xuan looks at you nervously."; } elsif ($choice =~ /\bexamine polaroid\b/i) { print "\nIt's a Polaroid. It shows a hand in the midst of shadows. A green hand. Of course, it could be fake.\n"; goto explain; } elsif ($choice =~ /\bexamine /i) { print "\nYou can't examine that!"; $count++; } elsif ($choice =~ /\bexamine\b/i) { print "\nExamine what?"; $count++; } else { &invalid; $count++; } } print "\nNguyen Xuan gets fed up. He picks up the Polaroid and leaves."; &gameover; $count = 0; explain: print "\nNguyen explains. He says that the woman is a drunken healer, who works for wine."; until ($count == 3) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /\bwait\b/i) { $count++; } elsif ($choice =~ /\blook\b/i) { print "\nNguyen Xuan is sweating, even though he is used to the climate. He looks around nervously."; } elsif ($choice =~ /\b(quit|exit)\b/i) { &quit; print "\nNguyen Xuan is sweating, even though he is used to the climate. He looks around nervously."; } else { &invalid; $count++; } } print "\nSuddenly, Nguyen Xuan gets out of his chair and runs away."; $count = 0; until ($count == 8) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /\bwait\b/i) { print "\nNguyen Xuan is gone. You do not know where the healer is. The mission is now worthless. You leave for the airport."; &gameover; } elsif ($choice =~ /\blook\b/i) { print "\nNguyen Xuan is running away. You may still be able to stop him."; } elsif ($choice =~ /\b(quit|exit)\b/i) { &quit; print "\nNguyen Xuan is running away. You may still be able to stop him."; } elsif ($choice =~ /(stop|halt|stop him|stop him butler|butler|come back|stay)/i) { last; } else { print "\nNguyen Xuan is gone. You do not know where the healer is. The mission is now worthless. You leave for the airport."; &gameover; } } print "\nQuick as a flash, Butler lashes out and pulls in the protesting informant. \"Our business is not concluded yet, Mister Xuan,\" you say. \"You will now take us to the healer.\" The three of you go to the rented vehicle and go to Tu Do Street, where the healer lives.\n"; if (!$pebble) { print "\nEventually the streets grow too narrow for the car. Your party gets out and decide to walk the rest of the way. There is a pebble on the ground. You start to get thirsty from the heat."; } elsif ($pebble) { print "\nEventually the streets grow too narrow for the car. Your party gets out and decide to walk the rest of the way. You start to get thirsty from the heat."; } $count = 0; until ($count == 10) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /\bwait\b/i) { print "\nYou stop walking and stand still in the alley. Butler calls to you: \"Master Artemis, are you coming?\""; $count++; } elsif ($choice =~ /(walk|keep walking|follow)/) { print "\nYou continue walking.\n"; if (!$pebble && !$tea) { print "\nThere is a pebble on the ground. You start to get thirsty from the heat."; } elsif ($pebble && $tea) { } elsif (!$pebble && $tea) { print "\nThere is a pebble on the ground."; } elsif ($pebble && !$tea) { print "\nYou start to get thirsty from the heat."; } $count++; } elsif ($choice =~ /\blook\b/i) { if (!$pebble && !$tea) { print "\nYou are in a narrow, but crowded alley. There is a pebble on the ground. You start to get thirsty from the heat."; } elsif ($pebble && $tea) { print "\nYou are in a narrow, but crowded alley."; } elsif (!$pebble && $tea) { print "\nYou are in a narrow, but crowded alley. There is a pebble on the ground."; } elsif ($pebble && !$tea) { print "\nYou are in a narrow, but crowded alley. You start to get thirsty from the heat."; } } elsif ($choice =~ /\bexamine pebble\b/i) { print "\nIt's a pebble. Small and hard. Might be a good way to get somebody's attention..."; $count++; } elsif ($choice =~ /\bexamine /i) { print "\nYou can't examine that!"; $count++; } elsif ($choice =~ /\bexamine\b/i) { print "\nExamine what?"; $count++; } elsif ($choice =~ /\b(get|take) pebble\b/i) { print "\nYou take the pebble."; $pebble = 1; $count++; } elsif ($choice =~ /\bdrink tea\b/i) { if (!$cup) { print "\nYou don't have any tea to drink, but you wish you did."; } elsif ($cup) { print "\nYou are very thirsty, and don't care if it's not Earl Grey. You drink the tea, and your thirst is quenched."; $tea = 1; } } elsif ($choice =~ /\b(quit|exit)\b/i) { &quit; if (!$pebble) { print "\nYou are in a narrow, but crowded alley. There is a pebble on the ground. You start to get thirsty from the heat."; } elsif ($pebble) { print "\nYou are in a narrow, but crowded alley. You start to get thirsty from the heat."; } } else { &invalid; $count++; } } if ($tea) { goto tudo; } elsif (!$tea) { print "\nBy now, you are severly dehydrated. The heat beats down on you, and you feel faint. \"Butler,\" you call out weakly. Butler identifies your condition. He gives you his water bottle, and rushes you to the hospital."; &gameover; } tudo: print "\nNguyen points to the shadows under a fire escape. \"She's in there. She doesn't come out,\" he says."; $count = 0; until ($count == 5) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /\bwait\b/i) { $count++; } elsif ($choice =~ /\blook\b/i) { print "\nThe healer is somewhere under the fire escape. You need to get her attention..."; } elsif ($choice =~ /\b(quit|exit)\b/i) { &quit; print "\nThe helear is somewhere under the fire escape. You need to get her attention..."; } elsif ($choice =~ /\bexamine pebble\b/i) { print "\nIt's a pebble. Small and hard. Might be a good way to get somebody's attention..."; $count++; } elsif ($choice =~ /\b(get healer's attention|get attention)\b/i) { print "\nHow are you going to do that?"; $count++; } elsif ($choice =~ /\buse pebble\b/i) { if (!$pebble) { print "\nYou do not have a pebble!"; } elsif ($pebble) { print "\nHow are you going to use it?"; } $count++; } elsif ($choice =~ /\b(throw pebble|toss pebble)\b/i) { if (!$pebble) { print "\nYou do not have a pebble!"; } elsif ($pebble) { print "\nYou toss the pebble into the shadows. It makes a loud clanging noise."; goto sprite; } } else { &invalid; $count++; } } print "\nNothing happens. Nguyen Xuan quietly walks away. You get impatient and call off the mission. You go back to Fowl Manor."; &gameover; sprite: print "\nA voice drawls out: \"Wine.\" It's too dark to see anything."; $count = 0; until ($count == 5) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /\bwait\b/i) { $count++; } elsif ($choice =~ /\blook\b/i) { print "\nThe helear is somewhere under the fire escape. It's too dark to see her. Some night-vision goggles would come in handy..."; } elsif ($choice =~ /\b(quit|exit)\b/i) { &quit; print "\nThe helear is somewhere under the fire escape. It's too dark to see her. Some night-vision goggles would come in handy..."; } elsif ($choice =~ /\bexamine darkness\b/i) { print "\nIt's darkness. There's no light. Never seen darkness before?"; $count++; } elsif ($choice =~ /\b(butler|goggles|hand me the googgles|hand me the goggles butler|butler hand me the goggles)\b/i) { goto goggles; } else { &invalid; $count++; } } print "\nNothing happens. Nguyen Xuan quietly walks away. You get impatient and call off the mission. You go back to Fowl Manor."; &gameover; goggles: print "\nButler hands a pair of night-vision goggles to you. You put them on and set into the shadows. After adjusting the goggles, you see a small figure wrapped in a filthy shawl. Her skin is green, like everything else you see. \"Wine first, then talk,\" the healer mutters to you."; $count = 0; until ($count == 5) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /\bwait\b/i) { $count++; } elsif ($choice =~ /\blook\b/i) { print "\nThe healer wants wine from you."; } elsif ($choice =~ /\b(quit|exit)\b/i) { &quit; print "\nThe healer wants wine from you."; } elsif ($choice =~ /\bexamine healerb/i) { print "\nIt's a healer. She's abnormally small. And she's demanding wine from you."; $count++; } elsif ($choice =~ /\b(butler|wine|hand me the wine|hand me the wine butler|butler hand me the wine)\b/i) { goto wine; } else { &invalid; $count++; } } print "\nNothing happens. Nguyen Xuan quietly walks away. You get impatient and call off the mission. You go back to Fowl Manor."; &gameover; wine: print "\nButler hands you a bottle of a half pint of Irish whiskey."; $count = 0; until ($count == 5) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /\bwait\b/i) { $count++; } elsif ($choice =~ /\blook\b/i) { print "\nThe healer wants wine from you. You have half a pint of Irish whiskey in your hands."; } elsif ($choice =~ /\b(quit|exit)\b/i) { &quit; print "\nThe healer wants wine from you. You have half a pint of Irish whiskey in your hands."; } elsif ($choice =~ /\bexamine (wine|whiskey|irish whiskey)\b/i) { print "\nIt's a pint of Irish whiskey. Really."; $count++; } elsif ($choice =~ /\bexamine holy water\b/i) { print "\nWhat holy water?"; $count++; } elsif ($choice =~ /\bexamine healer\b/i) { print "\nIt's a healer. She's abnormally small. And she's demanding wine from you."; $count++; } elsif ($choice =~ /\b(offer (wine|whiskey)|offer (wine|whiskey) to healer)\b/i) { goto offerwine; } else { &invalid; $count++; } } print "\nNothing happens. Nguyen Xuan quietly walks away. You get impatient and call off the mission. You go back to Fowl Manor."; &gameover; offerwine: print "\nYou hold the bottle just beyond the shadows, and tell the healer to get it."; $count = 0; until ($count == 8) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /\bwait\b/i) { print "\nThe healer's hand darts out and takes the whiskey. You have no idea whether the healer is a fairy or not, and you have just blown your chances. Fed up, you go back to the airport."; &gameover; } elsif ($choice =~ /\blook\b/i) { print "\nYou're offering the wine to the healer."; } elsif ($choice =~ /\b(quit|exit)\b/i) { &quit; print "\nYou're offering the wine to the healer."; } elsif ($choice =~ /\b(remove|take off) goggles\b/i) { print "\nYou quickly whip your goggles off. Just in time to see the healer's green hand grab the whiskey. You tell Butler to pay Nguyen. After ensuring that Nguyen will remain silent, Butler hands over \$20,000 USD in cash. Nguyen skips away happily.\n"; last; } else { print "\nThe healer's hand darts out and takes the whiskey. You have no idea whether the healer is a fairy or not, and you have just blown your chances. Fed up, you go back to the airport."; &gameover; } } print "\nYou turn to the healer. She asks you what you want healed, and you subtly turn the conversation to books. Her Book, in fact, for she is a fairy. A sprite, to be specific. \"You know about the Book? Then you know about my magic,\" the fairy says.\n"; $count = 0; until ($count == 5) { if ($count == 0) { print "\"Do you doubt me? Just let me enslave your will. It will be trivial.\""; } elsif ($count == 1) { print "\nThe fairy continues. \"Do you want to become pig droppings? I can do it easily...\""; } elsif ($count == 2) { print "\nYou wonder when the fairy will stop. \"Listen to me!\" she says. \"You do not know what you are dealing with, human!\""; } elsif ($count == 3) { print "\n\"You are a fool,\" the healer says, \"to meddle with magic.\""; } elsif ($count == 4) { print "\n\"I will kill you!\" the fairy roars, spraying her alcohol-laced spit everywhere."; } &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /\bwait\b/i) { $count++; } elsif ($choice =~ /\blook\b/i) { $count++ } elsif ($choice =~ /\b(quit|exit)\b/i) { &quit; } elsif ($choice =~ /\b(leave|walk away)\b/i) { print "\nYou are easily threatened by the healer, and run away. You go back to Fowl Manor."; &gameover; } else { &invalid; $count++; } } print "\nYou know the threats are empty. You tell the sprite how pathetic she is, how the alcohol is killing her. She has no magic. You offer to save her, but she has to give you the Book. Almost casually, you mention how the healer has just drank half a pint of holy water. You offer her a chance to live, and a way to regain her magic. But only if she lends you the book for thirty minutes. You will counteract the holy water with some water drawn from the hill of Tara. You will then give her a shot of human technology. A \"virus\" which will flush out all the alcohol from the sprite, and restore her health. The sprite accepts."; $count = 0; until ($count == 3) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /\bwait\b/i) { $count++; } elsif ($choice =~ /\blook\b/i) { print "\nThe healer has made a deal with you. You'll counteract the holy water you gave her, she'll show you the Book, and you'll return her magic."; } elsif ($choice =~ /\b(quit|exit)\b/i) { &quit; print "\nThe healer has made a deal with you. You'll counteract the holy water you gave her, she'll show you the Book, and you'll return her magic."; } elsif ($choice =~ /\bexamine (healer|sprite|fairy)\b/i) { print "\nIt's a healer. She's abnormally small. And she's waiting for you to counteract the holy water you tricked her into drinking."; $count++; } elsif ($choice =~ /\b(butler|butler the vial|vial|the vial butler)\b/i) { goto vialone; } else { &invalid; $count++; } } print "\nToo late. The sprite falls over. The pain from the holy water must have been too much. Your chance of getting the Book has been blown. You go back to the airport."; &gameover; vialone: print "\nButler loads the vial into a syringe gun. He shoots it into the sprite's arm. The sprite is instantly relieved. After searching through her robes, she holds out a gold book the size of a matchbox. She comments how it's written in the old tongue, and how you won't understand it."; $count = 0; until ($count == 3) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /\bwait\b/i) { $count++; } elsif ($choice =~ /\blook\b/i) { print "\nThe sprite is holding out the Book for you to take."; } elsif ($choice =~ /\b(quit|exit)\b/i) { &quit; print "\nThe sprite is holding out the Book for you to take."; } elsif ($choice =~ /\bexamine (healer|sprite|fairy)\b/i) { print "\nIt's a healer. She's abnormally small. And she's holding out the Book for you to take."; $count++; } elsif ($choice =~ /\bexamine book\b/i) { print "\nIt's gold. It's small. It's in the sprite's hand. And time is running out."; $count++; } elsif ($choice =~ /\btake book\b/i) { goto camera; } else { &invalid; $count++; } } print "\n\"You're not going to take it?\" the sprite asks. \"Very well.\" She puts her Book away. Your chance is gone."; &gameover; camera: print "\nYou take the Book and hand it to Butler."; $count = 0; until ($count == 20) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /\bwait\b/i) { $count++; } elsif ($choice =~ /\blook\b/i) { print "\nButler (looking somewhat confused) is holding the Book."; } elsif ($choice =~ /\b(quit|exit)\b/i) { &quit; print "\nButler (looking somewhat confused) is holding the Book."; } elsif ($choice =~ /\bexamine book\b/i) { print "\nIt's gold. It's small. It's in Butler's hand. And time is running out."; $count++; } elsif ($choice =~ /\b(photograph book|take pictures of book|butler)\b/i) { goto takepictures; } elsif ($choice =~ /\b(leave|walk away)\b/i) { print "\nUnfortunately, you are not allowed to do that. You were only allowed to look at the Book for half an hour. The Book combusts, burning Butler's hand. You have failed to obtain a copy of the Book."; &gameover; } else { &invalid; $count++; } } print "\n\"Time's up,\" the sprite says. You reluctantly hand the Book back to her. Your chance is gone."; &gameover; takepictures: print "\n\"Sir,\" Butler says to you. \"There's a problem with the camera. I've just installed new batteries, and the camera needs to be reset. I need something small, something thin to press the button. A pen, or a toothpick.\""; until ($count == 20) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /\bwait\b/i) { $count++; } elsif ($choice =~ /\blook\b/i) { print "\nButler (looking somewhat confused) is holding the Book. He needs something small and thin to reset the camera."; } elsif ($choice =~ /\b(quit|exit)\b/i) { &quit; print "\nButler (looking somewhat confused) is holding the Book. He needs something small and thin to reset the camera."; } elsif ($choice =~ /\bexamine book\b/i) { print "\nIt's gold. It's small. It's in Butler's hand. And time is running out."; $count++; } elsif ($choice =~ /\bexamine camera\b/i) { print "\nIt needs to be reset. The button cannot be pressed without a pen. Or a toothpick."; $count++; } elsif ($choice =~ /\buse pen\b/i) { print "\nThat would be great, if you had a pen. Do you have a pen? No? I didn't think so."; $count++; } elsif ($choice =~ /\buse toothpick\b/i) { if (!$toothpick) { print "\nThat would be a great idea, if you had a toothpick."; $count++; } elsif ($choice =~ /\b(leave|walk away)\b/i) { print "\nUnfortunately, you are not allowed to do that. You were only allowed to look at the Book for half an hour. The Book combusts, burning Butler's hand. You have failed to obtain a copy of the Book."; &gameover; } elsif ($toothpick) { goto toothpick; } } else { &invalid; $count++; } } print "\n\"Time's up,\" the sprite says. You reluctantly hand the Book back to her. Your chance is gone."; &gameover; toothpick: print "\nYou give the toothpick to Butler. He resets the camera. Butler photographs each page of the Book. The entire contents of the Book is now stored on a chip."; until ($count == 20) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /\bwait\b/i) { $count++; } elsif ($choice =~ /\blook\b/i) { print "\nButler (looking somewhat confused) is holding the Book. He has just taken pictures of every page of the Book."; } elsif ($choice =~ /\b(quit|exit)\b/i) { &quit; print "\nButler (looking somewhat confused) is holding the Book. He has just taken pictures of every page of the Book."; } elsif ($choice =~ /\bexamine book\b/i) { print "\nIt's gold. It's small. It's in Butler's hand. You have its contents on the camera chip. And time is running out."; $count++; } elsif ($choice =~ /\b(leave|walk away)\b/i) { print "\nUnfortunately, you are not allowed to do that. You were only allowed to look at the Book for half an hour. The Book combusts, burning Butler's hand. You have failed to obtain a copy of the Book."; &gameover; } elsif ($choice =~ /\bemail (book|pictures)\b/i) { $email = 1; last; } elsif ($choice =~ /\breturn book\b/i) { last; } else { &invalid; $count++; } } if ($email) { print "\nIn case airport security erases the Book, you instruct Butler to use your mobile phone to email the files to Fowl Manor. Butler carries out your instructions, and hands the Book back to the sprite.\n"; } elsif (!$email) { print "\nButler returns the Book back to the sprite.\n"; } print "\nThe sprite asks for the second potion, the one which would restore her magic. Butler loads the second vial, and shoots it into the sprite's carotid artery. The sprite collapses. You decide to leave before the sprite's body expels all the alcohol in her system."; $count = 0; until ($count == 3) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /\bwait\b/i) { $count++; } elsif ($choice =~ /\blook\b/i) { print "\nThe sprite is on the ground. You should leave before all the alcohol is violently expelled from the sprite."; } elsif ($choice =~ /\b(quit|exit)\b/i) { &quit; print "\nThe sprite is on the ground. You should leave before all the alcohol is violently expelled from the sprite."; } elsif ($choice =~ /\b(leave|walk away|go to the airport)\b/i) { } else { &invalid; $count++; } } print "\nYou go to the airport. On the way to the airport, you explain to Butler how it was necessary to give the second injection to the sprite. You had mixed an amnesiac into it, just in case the sprite plans to alert the fairies. ===Please Hit Enter to Continue===\n"; ; if (!$email) { print "\nYou pass through the airport. You decide to start decoding the Book, and retrieve the camera chip. Unfortunately, the data has been wiped by the airport security. All your hard work and planning, foiled by a few metal detectors."; &gameover; } print "\nYou have succeded! You are now in Fowl Manor, and a copy of the Book is sitting on the hard drive of a computer. ===Please Hit Enter to Continue===\n"; ; print "\nCongratulations. You have beaten the level. The adventure continues... ===Please Hit Enter to Exit===\n"; ;