#!/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.2alpha # # Released (for alpha testing): November 27, 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; # Will be commented out in final release 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"; ; } ### The actual program starts here. ### 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; $invalid = "\nSorry, but that is an invalid option.\n"; ### Subroutines ### # The "quit" subroutine sub quit { quit: print "\nAre you sure you want to exit? Y/N"; print "\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."; print "\n"; print "\n===Please Hit Enter to Continue===\n"; ; } else { &invalid; goto quit; } } # The "help" subroutine sub help { print "\n === Help Screen ==="; print "\nThis game is still in its early stages. Because of this, this help"; print "\nfile is very limited."; print "\n"; print "\nThe object of this game is to complete this chapter. In this case, you have"; print "\nto be able to obtain a copy of the Book and successfully bring it back to Fowl"; print "\nManor."; print "\n"; print "\nIn this chapter, you are playing the character of Artemis Fowl II. As such,"; print "\nthere is no need for a \"who am I\" command."; print "\n"; print "\nThis game has deviated from the original text of the book for creativity and"; print "\na greater challenge. If you get stuck, start again and record your steps."; print "\nPlease note that there is no way to save your progress."; print "\n"; print "\nTo obtain this screen again, type \"help\"."; print "\n"; print "\n===Please Hit Enter to Continue===\n"; ; } # The "choice" subroutine sub choice { print "\n\nWhat would you like to do?"; print "\n> "; $choice = ; chomp($choice); } # The "gameover" subroutine sub gameover { gameover: print "\n\n===Please Hit Enter to Continue===\n"; ; print "GGGGGG AA MMM MMM EEEEEE OOOOOO VV VV EEEEEE RRRRR"; print "\nGG AA AA MM M M MM EE OO OO VV VV EE RR RR"; print "\nGG GG AAAAAA MM M M MM EEEEEE OO OO VV VV EEEEEE RRRRR"; print "\nGG GG AA AA MM M MM EE OO OO VV VV EE RR RR"; print "\nGGGGGG AA AA MM MM EEEEEE OOOOOO VV EEEEEE RR RR\n"; print "\nWould you like to restart? Y/N"; print "\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 { print $invalid; goto gameover; } } ### Yay! Now the game actually starts! ### &help; # Print help screen at the begining. ## Prompt 1 ## saigon: print "\nYou are in Ho Chi Minh City, Vietnam with your bodyguard Butler. Your"; print "\nmission is to obtain a copy of the Book, a \"Bible\" of the fairies."; print "\n"; print "\nYou 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 =~ /\b(examine|look|look at) tea/i) { print "\nIt is a cup of tea. It is most definitely not Earl Grey, but it is"; print "\ntolerable."; $count++; } elsif ($choice =~ /\b(examine|look|look at) toothpick\b/i) { print "\nA very blunt toothpick. It won't hurt anybody. But it's quite sturdy,"; print "\nfor a toothpick."; $count++; } 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 =~ /\bwait\b/i) { $count++; } elsif ($choice =~ /\b(quit|exit)\b/i) { &quit; goto saigon; } else { print $invalid; } } ## Prompt 2 ## 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 =~ /\b(examine|look|look at) waiter\b/i) { print "\nThe waiter is wearing handmade loafers, a silk shirt, and"; print "\nthree gold signet rings. His English has a tinge of Oxford about it,"; print "\nand his nails have the soft sheen of the recently manicured."; $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."; print "\n"; print "\nYou 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)/ix) { print "\nThe waiter goes away for a while. He comes back, and sees Butler's"; print "\nguns."; print "\n"; print "\nHe immediately calls the police. You and Butler are escorted to"; print "\na police station."; &gameover; } 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/ix) { goto nguyen; } elsif ($choice =~ /\b(quit|exit)\b/i) { &quit; print "\nA waiter is asking if you want more tea."; } else { print $invalid; } } print "\nThe waiter goes away."; print "\n"; print "\nYou get impatient and call off the mission. You go back to Fowl Manor."; &gameover; ## Prompt 3 ## nguyen: print "\nThe waiter turns to Butler. He opens his mouth to speak, but you cut"; print "\nhim off."; print "\n"; print "\nYou tell him how pathetic his disguise, and exactly how easily you penetrated"; print "\nit. You also fill him in on the weapons status, listing a large number of"; print "\nweapons that Butler is carrying, and also state how dangerous Butler is, even"; print "\nwithout his weapons."; print "\n"; print "\nYou ask Nguyen Xuan what information he has for you, and whether he has proof."; print "\n"; print "\nNguyen pulls out a Polaroid from his wallet and pushes it across the table."; $count = 0; until ($count == 5) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /\b(examine|look|look at) polaroid\b/i) { goto explain; } 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 /i) { print "\nYou can't examine that!"; $count++; } elsif ($choice =~ /\bexamine\b/i) { print "\nExamine what?"; $count++; } else { print $invalid; } } print "\nNguyen Xuan gets fed up. He picks up the Polaroid and leaves."; &gameover; ## Prompt 4 ## explain: print "\nIt's a Polaroid. It shows a hand in the midst of shadows. A green"; print "\nhand."; print "\n"; print "\nOf course, it could be fake."; print "\n"; print "\nNguyen explains. He says that the woman is a drunken healer, who"; print "\nworks for wine."; print "\n"; print "\nYou notice a lot of sweat on Nguyen's forehead, even though he is"; print "\nused to the climate. He looks around nervously, almost as if he"; print "\nwants to run away."; $count = 0; 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"; print "\nlooks around nervously."; } elsif ($choice =~ /\b(quit|exit)\b/i) { &quit; print "\nNguyen Xuan is sweating, even though he is used to the climate. He"; print "\nlooks around nervously."; } else { print $invalid; } } ## Prompt 5 ## 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"; print "\nmission 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)/ix) { last; # Break out of the loop } else { print "\nNguyen Xuan is gone. You do not know where the healer is. The"; print "\nmission is now worthless. You leave for the airport."; &gameover; } } ## Prompt 6 ## print "\nQuick as a flash, Butler lashes out and pulls in the protesting informant."; print "\n"; print "\n\"Our business is not concluded yet, Mister Xuan,\" you say. \"You will now"; print "\ntake us to the healer.\""; print "\n"; print "\nThe three of you go to the rented vehicle and go to Tu Do Street, where the"; print "\nhealer lives.\n"; if (!$pebble) { print "\nEventually the streets grow too narrow for the car. Your party gets out"; print "\nand decide to walk the rest of the way. There is a pebble on the ground. You"; print "\nstart to get thirsty from the heat."; } elsif ($pebble) { print "\nEventually the streets grow too narrow for the car. Your party gets out"; print "\nand decide to walk the rest of the way. You start to get thirsty from the"; print "\nheat."; } $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."; print "\n"; print "\nButler calls to you: \"Master Artemis, are you coming?\""; $count++; } elsif ($choice =~ /(walk|keep walking|follow)/) { print "\nYou continue walking.\n"; if ($count == 3) { print "\nA pickpocket tries to steal Butler's wallet. Butler breaks the"; print "\npickpocket's fingers without looking.\n"; } elsif ($count == 5) { print "\nNguyen Xuan looks around, as if he wants to run away. One glance"; print "\nfrom Butler makes him cower and abandon the idea.\n"; } elsif ($count == 8) { print "\nYou can see a fire escape at the end of the alley.\n"; } if (!$pebble && !$tea) { print "\nThere is a pebble on the ground. You start to get thirsty from the"; print "\nheat."; } 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 =~ /\b(examine|look|look at) pebble\b/i) { print "\nIt's a pebble. Small and hard. Might be a good way to get somebody's"; print "\nattention..."; $count++; } elsif ($choice =~ /\blook\b/i) { if (!$pebble && !$tea) { print "\nYou are in a narrow, but crowded alley. There is a pebble on the"; print "\nground. 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"; print "\nground."; } elsif ($pebble && !$tea) { print "\nYou are in a narrow, but crowded alley. You start to get thirsty from"; print "\nthe heat."; } } 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"; print "\nthe 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"; print "\nground. 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"; print "\nthe heat."; } } else { print $invalid; } } if (!$tea) { print "\nBy now, you are severly dehydrated. The heat beats down on you, and"; print "\nyou feel faint."; print "\n"; print "\n\"Butler,\" you call out weakly."; print "\n"; print "\nButler identifies your condition. He gives you his water bottle, and rushes"; print "\nyou to the hospital."; &gameover; } ## Prompt 7 ## print "\nNguyen points to the shadows under a fire escape."; print "\n"; print "\n\"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 =~ /\b(examine|look|look at) pebble\b/i) { print "\nIt's a pebble. Small and hard. Might be a good way to get somebody's"; print "\nattention..."; $count++; } elsif ($choice =~ /\blook\b/i) { print "\nThe healer is somewhere under the fire escape. You need to get her"; print "\nattention..."; } elsif ($choice =~ /\b(quit|exit)\b/i) { &quit; print "\nThe helear is somewhere under the fire escape. You need to get her"; print "\nattention..."; } 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) { goto sprite; } } else { print $invalid; } } print "\nNothing happens. Nguyen Xuan quietly walks away."; print "\n"; print "\nYou get impatient and call off the mission. You go back to Fowl"; print "\nManor."; &gameover; ## Prompt 8 ## sprite: print "\nYou toss the pebble into the shadows. It makes a loud clanging noise."; print "\n"; print "\nA voice drawls out: \"Wine.\""; print "\n"; print "\nIt'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 =~ /\b(examine|look|look at) darkness\b/i) { print "\nIt's darkness. There's no light. Never seen darkness before?"; $count++; } elsif ($choice =~ /\blook\b/i) { print "\nThe helear is somewhere under the fire escape. It's too dark to"; print "\nsee 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"; print "\nsee her. Some night-vision goggles would come in handy..."; } elsif ($choice =~ /\b(butler|((night-vision|night vision) goggles|goggles)|hand me the ((night-vision| night vision) goggles|goggles)|hand me the ((night -vision|night vision) goggles|goggles) butler| butler hand me the ((night-vision|night vision) goggles|goggles))\b/ix) { goto goggles; } else { print $invalid; } } print "\nNothing happens. Nguyen Xuan quietly walks away."; print "\n"; print "\nYou get impatient and call off the mission. You go back to Fowl"; print "\nManor."; &gameover; ## Prompt 9 ## goggles: print "\nButler hands a pair of night-vision goggles to you. You put them on"; print "\nand set into the shadows. After adjusting the goggles, you see a small figure"; print "\nwrapped in a filthy shawl. Her skin is green, like everything else you see."; print "\n"; print "\n\"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 =~ /\b(examine|look|look at) healerb/i) { print "\nIt's a healer. She's abnormally small. And she's demanding wine from"; print "\nyou."; $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 =~ /\b(butler|wine|hand me the wine| hand me the wine butler| butler hand me the wine)\b/ix) { goto wine; } else { print $invalid; } } print "\nNothing happens. Nguyen Xuan quietly walks away."; print "\n"; print "\nYou get impatient and call off the mission. You go back to Fowl"; print "\nManor."; &gameover; ## Prompt 10 ## 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 =~ /\b(examine|look|look at) (wine|whiskey|irish whiskey)\b/ix) { print "\nIt's a pint of Irish whiskey. Really."; $count++; } elsif ($choice =~ /\b(examine|look|look at) holy water\b/i) { print "\nWhat holy water?"; $count++; } elsif ($choice =~ /\b(examine|look|look at) healer\b/i) { print "\nIt's a healer. She's abnormally small. And she's demanding wine from"; print "\nyou."; $count++; } elsif ($choice =~ /\blook\b/i) { print "\nThe healer wants wine from you. You have half a pint of Irish whiskey"; print "\nin 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"; print "\nin your hands."; } elsif ($choice =~ /\b((offer|dangle|show|give|wave) (wine| whiskey|bottle|holy water)|(offer|dangle|show| give|wave) (wine|whiskey|bottle| holy water) to healer)\b/ix) { goto offerwine; } else { print $invalid; } } print "\nNothing happens. Nguyen Xuan quietly walks away."; print "\n"; print "\nYou get impatient and call off the mission. You go back to Fowl"; print "\nManor."; &gameover; ## Prompt 11 ## offerwine: print "\nYou hold the bottle just beyond the shadows, and tell the healer to"; print "\nget 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"; print "\nwhether the healer is a fairy or not, and you have just blown your chances."; print "\n"; print "\nFed 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) ((night-vision|night vision) goggles|goggles)\b/ix) { last; # Break out of loop } else { print "\nThe healer's hand darts out and takes the whiskey. You have no idea"; print "\nwhether the healer is a fairy or not, and you have just blown your chances."; print "\n"; print "\nFed up, you go back to the airport."; &gameover; } } ## Prompt 12 ## print "\nYou quickly whip your goggles off. Just in time to see the healer's"; print "\ngreen hand grab the whiskey. You tell Butler to pay Nguyen. After ensuring"; print "\nthat Nguyen will remain silent, Butler hands over \$20,000 USD in cash. Nguyen"; print "\nskips away happily."; print "\n"; print "\nYou turn to the healer. She asks you what you want healed, and you"; print "\nsubtly turn the conversation to books. Her Book, in fact, for she is a fairy."; print "\nA sprite, to be specific."; print "\n"; print "\n\"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"; print "\nit easily...\""; } elsif ($count == 2) { print "\nYou wonder when the fairy will stop."; print "\n"; print "\n\"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"; print "\neverywhere."; } &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"; print "\nto Fowl Manor."; &gameover; } else { print $invalid; } } ## Prompt 13 ## print "\nYou know the threats are empty. You tell the sprite how pathetic"; print "\nshe is, how the alcohol is killing her. She has no magic."; print "\n"; print "\nYou offer to save her, but she has to give you the Book. Almost casually,"; print "\nyou mention how the healer has just drank half a pint of holy water."; print "\n"; print "\nYou offer her a chance to live, and a way to regain her magic. But only"; print "\nif she lends you the book for thirty minutes."; print "\n"; print "\nYou will counteract the holy water with some water drawn from the hill of Tara."; print "\nYou will then give her a shot of human technology. A \"virus\" which will"; print "\nflush out all the alcohol from the sprite, and restore her health."; print "\n"; print "\nThe sprite accepts."; $count = 0; until ($count == 3) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /\bwait\b/i) { $count++; } elsif ($choice =~ /\b(examine|look|look at) (healer|sprite|fairy)\b/i) { print "\nIt's a healer. She's abnormally small. And she's waiting for you"; print "\nto counteract the holy water you tricked her into drinking."; $count++; } elsif ($choice =~ /\blook\b/i) { print "\nThe healer has made a deal with you. You'll counteract the holy water"; print "\nyou 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"; print "\nyou gave her, she'll show you the Book, and you'll return her magic."; } elsif ($choice =~ /\b((give|offer) (vial|antidote| tara water|injection)|heal (fairy|sprite|healer)| butler|butler the (vial|antidote|tara water| injection)|(vial|antidote|tara water|injection)| the (vial|antidote|tara water| injection) butler)\b/ix) { goto vial; } else { print $invalid; } } print "\nToo late. The sprite falls over. The pain from the holy water must"; print "\nhave been too much."; print "\n"; print "\nYour chance of getting the Book has been blown. You go back to the airport."; &gameover; ## Prompt 14 ## vial: print "\nButler loads the vial into a syringe gun. He shoots it into the sprite's arm."; print "\n"; print "\nThe sprite is instantly relieved. After searching through her robes, she holds"; print "\nout a gold book the size of a matchbox. She comments how it's written in the"; print "\nold 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 =~ /\b(examine|look|look at) (healer|sprite|fairy)\b/i) { print "\nIt's a healer. She's abnormally small. And she's holding out the"; print "\nBook for you to take."; $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 =~ /\b(examine|look|look at) book\b/i) { print "\nIt's gold. It's small. It's in the sprite's hand. And time is"; print "\nrunning out."; $count++; } elsif ($choice =~ /\btake book\b/i) { goto camera; } else { print $invalid; } } print "\n\"You're not going to take it?\" the sprite asks. \"Very well.\""; print "\n"; print "\nShe puts her Book away. Your chance is gone."; &gameover; ## Prompt 15 ## 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 =~ /\b(examine|look|look at) book\b/i) { print "\nIt's gold. It's small. It's in Butler's hand. And time is"; print "\nrunning out."; $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 =~ /\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"; print "\nto look at the Book for half an hour."; print "\n"; print "\nThe Book combusts, burning Butler's hand."; print "\n"; print "\nYou have failed to obtain a copy of the Book."; &gameover; } else { print $invalid; } } print "\n\"Time's up,\" the sprite says."; print "\n"; print "\nYou reluctantly hand the Book back to her. Your chance is gone."; &gameover; ## Prompt 16 ## takepictures: print "\n\"Sir,\" Butler says to you. \"There's a problem with the camera. I've"; print "\njust installed new batteries, and the camera needs to be reset. I need"; print "\nsomething small, something thin to press the button. A pen, or a pencil.\""; until ($count == 20) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /\bwait\b/i) { $count++; } elsif ($choice =~ /\b(examine|look|look at) book\b/i) { print "\nIt's gold. It's small. It's in Butler's hand. And time is"; print "\nrunning out."; $count++; } elsif ($choice =~ /\b(examine|look|look at) camera\b/i) { print "\nIt needs to be reset. The button cannot be pressed without a pen."; $count++; } elsif ($choice =~ /\blook\b/i) { print "\nButler (looking somewhat confused) is holding the Book. He needs something"; print "\nsmall 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"; print "\nsmall and thin to reset the camera."; } elsif ($choice =~ /\buse pen\b/i) { print "\nThat would be great, if you had a pen. Do you have a pen? No? I"; print "\ndidn't think so."; $count++; } elsif ($choice =~ /\b((use|offer|give|produce|reveal| show) toothpick|(use|offer|give|produce|reveal| show) toothpick to butler)\b/ix) { if (!$toothpick) { print "\nThat would be a great idea, if you had a toothpick."; $count++; } elsif ($toothpick) { goto toothpick; } } elsif ($choice =~ /\b(leave|walk away)\b/i) { print "\nUnfortunately, you are not allowed to do that. You were only allowed"; print "\nto look at the Book for half an hour."; print "\n"; print "\nThe Book combusts, burning Butler's hand."; print "\n"; print "\nYou have failed to obtain a copy of the Book."; &gameover; } else { print $invalid; } } print "\n\"Time's up,\" the sprite says."; print "\n"; print "\nYou reluctantly hand the Book back to her. Your chance is gone."; &gameover; ## Prompt 17 ## toothpick: print "\nYou give the toothpick to Butler. He resets the camera."; print "\n"; print "\nButler photographs each page of the Book. The entire contents of the Book is"; print "\nnow stored on a chip."; until ($count == 20) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /\bwait\b/i) { $count++; } elsif ($choice =~ /\b(examine|look|look at) book\b/i) { print "\nIt's gold. It's small. It's in Butler's hand. You have its contents"; print "\non the camera chip. And time is running out."; $count++; } elsif ($choice =~ /\blook\b/i) { print "\nButler (looking somewhat confused) is holding the Book. He has just"; print "\ntaken 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"; print "\ntaken pictures of every page of the Book."; } elsif ($choice =~ /\b(leave|walk away)\b/i) { print "\nUnfortunately, you are not allowed to do that. You were only allowed"; print "\nto look at the Book for half an hour."; print "\n"; print "\nThe Book combusts, burning Butler's hand."; print "\n"; print "\nYou have failed to obtain a copy of the Book."; &gameover; } elsif ($choice =~ /\b((email|upload|send|backup|load|save) ( book|pictures|chip|photos|photographs)|server| fowl manor|(email|upload|send|backup|load| save) (book|pictures|chip|photos| photographs) to (server|fowl manor))\b/ix) { $email = 1; last; # Break out of loop } elsif ($choice =~ /\breturn book\b/i) { last; # Break out of loop } else { print $invalid; } } ## Prompt 18 ## if ($email) { print "\nIn case airport security erases the Book, you instruct Butler"; print "\nto use your mobile phone to email the files to Fowl Manor. Butler carries out"; print "\nyour 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"; print "\nher magic. Butler loads the second vial, and shoots it into the sprite's"; print "\ncarotid artery."; print "\n"; print "\nThe sprite collapses."; print "\n"; print "\nYou decide to leave before the sprite's body expels all the alcohol in her"; print "\nsystem."; $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"; print "\nalcohol 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"; print "\nalcohol is violently expelled from the sprite."; } elsif ($choice =~ /\b(leave|walk away|go to the airport)\b/i) { last; # Break out of loop } else { print $invalid; } } print "\nYou go to the airport. On the way to the airport, you explain to Butler"; print "\nhow it was necessary to give the second injection to the sprite. You had mixed"; print "\nan amnesiac into it, just in case the sprite plans to alert the fairies."; if (!$email) { print "\nYou pass through the airport. You decide to start decoding the Book,"; print "\nand retrieve the camera chip. Unfortunately, the data has been wiped by the"; print "\nairport security."; print "\n"; print "\nAll your hard work and planning, foiled by a few metal detectors."; &gameover; } ## Final Screen ## print "\nYou have succeded! You are now in Fowl Manor, and a copy of the Book"; print "\nis sitting on the hard drive of a computer."; print "\n"; print "\n===Please Hit Enter to Continue===\n"; ; print "\nCongratulations. You have beaten the level."; print "\n"; print "\nThe adventure continues..."; print "\n"; print "\n===Please Hit Enter to Exit===\n"; ;