#!/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.4.6alpha # # Released (for alpha testing): December 11, 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 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. # # =========================================================================== # ===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 ($help, $output, $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 "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 === 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 to 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"; $help =~ s/( ){3,}//g; print wrap("", "", $help); ; } # The "choice" subroutine sub choice { &put("\n\nWhat would you like to do? > "); $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\n"; print "GG AA AA MM M M MM EE OO OO VV VV EE RR RR\n"; print "GG GG AAAAAA MM M M MM EEEEEE OO OO VV VV EEEEEE RRRRR\n"; print "GG GG AA AA MM M MM EE OO OO VV VV EE RR RR\n"; print "GGGGGG AA AA MM MM EEEEEE OOOOOO VV EEEEEE RR RR\n"; print "\nWould you like to restart? Y/N\n> "; $restart = ; chomp($restart); if ($restart =~ /^(y|yes)$/i) { goto begin; } elsif ($restart =~ /^(n|no)$/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 # Waiting for Nguyen Xuan ## saigon: &put("\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."); if (!$toothpick && !$cup) { &put("\nOn the table, there is a toothpick and a cup of tea."); } elsif (!$toothpick) { &put("\nOn the table, there is a toothpick."); } elsif (!$cup) { &put("\nOn the table, there is a cup of tea."); } else { &put("\nThere is nothing on the table."); } until ($count == 7) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /^look$/i) { goto saigon; } elsif ($choice =~ /^(examine|look at)$/i) { &put("\n\L\u$1\E what?"); $count++; } elsif ($choice =~ /^eat toothpick$/i) { &put("\nIs this supposed to be some underlying motive in an overall large scheme to dominate the world?"); $count++; } elsif ($choice =~ /^(examine|look|look at)/i) { if ($choice =~ /((cup of)? tea|cup)$/i) { &put("\nIt is a cup of tea. It is most definitely not Earl Grey, but it is tolerable."); $count++; } elsif ($choice =~ /toothpick$/i) { &put("\nA very blunt toothpick. It won't hurt anybody. But it's quite sturdy, for a toothpick."); $count++; } elsif ($choice =~ /((ho chi minh )?city|saigon)$/i) { &put("\nHo Chi Minh City. Also known as Saigon. Capital of Vietnam. You should already know this, being a criminal mastermind. Stop wasting time."); $count++; } elsif ($choice =~ /(bodyguard|butler)$/i) { &put("\nYeah, the big guy sitting beside you is Butler. Your bodyguard. He's been your bodyguard since you've been born. You should remember, unless your memory is fading. Such a shame, memory loss at this age."); $count++; } elsif ($choice =~ /cafe$/i) { &put("\nA pathetic cafe. Out in the sun. Their parasols don't even provide shade."); $count++; } else { &put("\nI don't see one to \L$1\E."); $count++; } } elsif ($choice =~ /^(get|take)$/i) { &put("\n\L\u$1\E what?"); $count++; } elsif ($choice =~ /^(get|take)/i) { if ($choice =~ /toothpick$/i) { if ($toothpick == 0) { $toothpick = 1; $count++; &put("\nYou take the toothpick."); } else { &put("\nAre you blind? You already have the toothpick!"); $count++; } } elsif ($choice =~ /((cup of )?tea|cup)$/i) { if ($cup == 0) { $cup = 1; $count++; &put("\nYou take the $1."); } else { &put("\nAre you blind? You already have the $1!"); $count++; } } elsif ($choice =~ /((ho chi minh )?city|saigon)$/i) { &put("\nGenius as you are, it would be impossible to steal the city. Nice try."); $count++; } elsif ($choice =~ /cafe$/i) { &put("\nI'd like to see you try."); $count++; } elsif ($choice =~ /(umbrella|parasol)$/i) { &put("\nWhy? It's large and bulky, and useless."); $count++; } else { &put("\nAre you blind? That's not on the table!"); $count++; } } elsif ($choice =~ /^use toothpick\b/i) { if ($toothpick) { &put("\nHow?"); $count++; } else { &put("\nYou don't even have a toothpick!"); $count++; } } elsif ($choice =~ /^drink tea\b/i) { if ($cup) { &put("\nWhy would you drink that? It's not even Earl Grey!"); $count++; } else { &put("\nYou don't even have tea to drink."); $count++; } } elsif ($choice =~ /^talk( to)?/i) { if ($choice =~ /butler$/i) { &put("\n\"Nguyen Xuan should be arriving soon,\" Butler says to you."); $count++; } elsif ($choice =~ /(table|cafe|city|toothpick|umbrella|parasol|(cup of )?tea|cup)$/i) { &put("\nWow. I always knew that genii were insane, but I never knew it happened at this age."); $count++; } else { &put("\nWhy waste time to talk and further dehydrate yourself? Just sit down and wait. Patience is a virtue."); $count++; } } elsif ($choice =~ /^wait\b/i) { $count++; } elsif ($choice =~ /^(quit|exit)\b/i) { &quit; goto saigon; } else { print $invalid; } } ## Prompt 2 # Mysterious waiter arrives ## &put("\nA waiter arrives at your table, and asks: \"More tea, sirs?\""); $count = 0; waiter: until ($count == 3) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /^wait\b/i) { $count++; } elsif ($choice =~ /^look$/i) { &put("\nA waiter is asking if you want more tea."); } elsif ($choice =~ /^(examine|look at)$/i) { &put("\n\L\u$1\E what?"); $count++; } elsif ($choice =~ /^(examine|look|look at)$/i) { if ($choice =~ /waiter$/i) { &put("\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++; } else { &put("\nI don't see one to \L$1\E."); $count++; } } elsif ($choice =~ /^((ignore( him|( the)? waiter)?)|no( tea| thanks)?)$/i) { &put("\nThe waiter goes away. You get impatient and call off the mission. You go back to Fowl Manor."); &gameover; } elsif ($choice =~ /^((yes|tea|more( tea)?)?( please)?)$/i) { &put("\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 =~ /^((say )?(tell (waiter|him) to )?sit( down)?)$/i) { goto nguyen; } elsif ($choice =~ /^talk( to)?/i) { if ($choice =~ /butler$/i) { &put("\n\"Unless I am very mistaken, that is not a waiter,\" Butler mutters to you."); $count++; } elsif ($choice =~ /waiter$/i) { &put("\n\"Would you like some tea, young master?\" the water asks you."); $count++; } elsif ($choice =~ /(table|cafe|city|toothpick|umbrella|parasol|(cup of )?tea|cup)$/i) { &put("\nWow. I always knew that genii were insane, but I never knew it happened at this age."); $count++; } else { &put("\nWhy waste time to talk and further dehydrate yourself?"); $count++; } } elsif ($choice =~ /^(quit|exit)\b/i) { &quit; &put("\nA waiter is asking if you want more tea."); } else { print $invalid; } } &put("\nThe waiter goes away. You get impatient and call off the mission. You go back to Fowl Manor."); &gameover; ## Prompt 3 # Nguyen Xuan gives you a Polaroid ## nguyen: &put("\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; until ($count == 5) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /^wait\b/i) { $count++; } elsif ($choice =~ /^look$/i) { &put("\nThe Polaroid is on the table. Nguyen Xuan looks at you nervously."); } elsif ($choice =~ /^(examine|look at)$/i) { &put("\n\L\u$1\E what?"); $count++; } elsif ($choice =~ /^(examine|look|look at)/i) { if ($choice =~ /(polaroid|picture|photo)$/i) { goto explain; } else { &put("\nI don't see one to \L$1\E."); $count++; } } elsif ($choice =~ /^(quit|exit)\b/i) { &quit; &put("\nThe Polaroid is on the table. Nguyen Xuan looks at you nervously."); } elsif ($choice =~ /^talk( to)?/i) { if ($choice =~ /butler$/i) { &put("\n\"Take a look at it. It's why we came here,\" Butler says to you."); $count++; } elsif ($choice =~ /(table|cafe|city|toothpick|umbrella|polaroid|picture|photograph|parasol|(cup of )?tea|cup)$/i) { &put("\nWow. I always knew that genii were insane, but I never knew it happened at this age."); $count++; } elsif ($choice =~ /(nguyen|xuan|nguyen xuan)$/i) { &put("\n\"Go on,\" Nguyen urges you. \"Take a look.\"."); $count++; } else { &put("\nWhy waste time to talk and further dehydrate yourself?"); $count++; } } elsif ($choice =~ /^eat (polaroid|picture)$/i) { &put("\nUnder an insane impulse, you snatch up the Polaroid and stuff it down your throat before Butler can react. You suffocate and lose conciousness."); &gameover; } elsif ($choice =~ /^(tear|destroy|rip( up)? (polaroid|picture))$/i) { &put("\nYou are so arrogant and stuck up that you believe Nguyen is not worth your time. Ignoring his cries of protest, you rip the Polaroid to shreds. You haven't even noticed what is on it. You have failed your mission."); &gameover; } else { print $invalid; } } &put("\nNguyen Xuan gets fed up. He picks up the Polaroid and leaves."); &gameover; ## Prompt 4 # What are we waiting for? He tries to run ## explain: &put("\nIt's a Polaroid. It shows a hand in the midst of shadows. A green hand. Of course, it could be fake. Nguyen explains. He says that the woman is a drunken healer, who works for wine. You notice a lot of sweat on Nguyen's forehead, even though he is used to the climate. He looks around nervously, almost as if he wants to run away."); $count = 0; until ($count == 3) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /^wait\b/i) { $count++; } elsif ($choice =~ /^look$/i) { &put("\nNguyen Xuan is sweating, even though he is used to the climate. He looks around nervously."); } elsif ($choice =~ /^(quit|exit)\b/i) { &quit; &put("\nNguyen Xuan is sweating, even though he is used to the climate. He looks around nervously."); } elsif ($choice =~ /^talk( to)?/i) { if ($choice =~ /butler$/i) { &put("\n\"He's uneasy, nervous,\" Butler says to you."); $count++; } elsif ($choice =~ /(table|cafe|city|toothpick|umbrella|parasol|(cup of )?tea|cup)$/i) { &put("\nWow. I always knew that genii were insane, but I never knew it happened at this age."); $count++; } elsif ($choice =~ /(nguyen|xuan|nguyen xuan)$/i) { &put("\n\"I hope my information has been satisfactory...\" Nguyen mumbles."); $count++; } else { &put("\nWhy waste time to talk and further dehydrate yourself?"); $count++; } } elsif ($choice =~ /^eat (polaroid|picture)$/i) { &put("\nUnder an insane impulse, you snatch up the Polaroid and stuff it down your throat before Butler can react. You suffocate and lose conciousness."); &gameover; } elsif ($choice =~ /^(tear|destroy|rip( up)? (polaroid|picture))$/i) { &put("\nYou are so arrogant and stuck up that you believe Nguyen is not worth your time. Ignoring his cries of protest, you rip the Polaroid to shreds. He is offended, gets up, and walks away."); &gameover; } else { print $invalid; } } ## Prompt 5 # He runs away ## &put("\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 =~ /^wait\b/i) { &put("\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 =~ /^look$/i) { &put("\nNguyen Xuan is running away. You may still be able to stop him."); } elsif ($choice =~ /^(quit|exit)\b/i) { &quit; &put("\nNguyen Xuan is running away. You may still be able to stop him."); } elsif ($choice =~ /^((stop( him( butler)?)?)|halt|butler|come back|stay)$/i) { last; # Break out of the loop } elsif ($choice =~ /^talk( to)?/i) { if ($choice =~ /butler$/i) { &put("\n\"It's too late. He's gone.\" Butler says to you. You do not know where the healer is. You have failed."); &gameover; } elsif ($choice =~ /(nguyen|xuan|nguyen xuan)$/i) { &put("\nTalk to him? Nguyen Xuan is gone. You do not know where the healer is. The mission is now worthless. You leave for the airport."); &gameover; } else { &put("\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 =~ /^eat (polaroid|picture)$/i) { &put("\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 =~ /^(tear|destroy|rip( up)? (polaroid|picture))$/i) { &put("\nNguyen Xuan is gone. You do not know where the healer is. The mission is now worthless. You leave for the airport."); &gameover; } else { print $invalid; } } ## Prompt 6 # Butler stops him and we go into the Jeep ## &put("\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) { &put("\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) { &put("\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 =~ /^look$/i) { if (!$pebble && !$tea) { &put("\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) { &put("\nYou are in a narrow, but crowded alley."); } elsif (!$pebble && $tea) { &put("\nYou are in a narrow, but crowded alley. There is a pebble on the ground."); } elsif ($pebble && !$tea) { &put("\nYou are in a narrow, but crowded alley. You start to get thirsty from the heat."); } } elsif ($choice =~ /^wait\b/i) { &put("\nYou stop walking and stand still in the alley. \nButler calls to you: \"Master Artemis, are you coming?\""); $count++; } elsif ($choice =~ /^(walk|keep walking|follow)$/) { &put("\nYou continue walking.\n"); if ($count == 3) { &put("\nA pickpocket tries to steal Butler's wallet. Butler breaks the pickpocket's fingers without looking.\n"); } elsif ($count == 5) { &put("\nNguyen Xuan looks around, as if he wants to run away. One glance from Butler makes him cower and abandon the idea.\n"); } elsif ($count == 8) { &put("\nYou can see a fire escape at the end of the alley."); } if (!$pebble && !$tea) { &put("\nThere is a pebble on the ground. You start to get thirsty from the heat."); } elsif ($pebble && $tea) { } elsif (!$pebble && $tea) { &put("\nThere is a pebble on the ground."); } elsif ($pebble && !$tea) { &put("\nYou start to get thirsty from the heat."); } $count++; } elsif ($choice =~ /^talk( to)?/i) { if ($choice =~ /butler$/i) { &put("\n\"Be careful you don't get dehydrated,\" Butler warns."); $count++; } elsif ($choice =~ /(nguyen|xuan|nguyen xuan)$/i) { &put("\nNguyen is too scared to talk."); $count++; } elsif ($choice =~ /(toothpick|(cup of )?tea|cup|pebble|alley|thirst)$/i) { &put("\nWow. I always knew that genii were insane, but I never knew it happened at this age."); $count++; } else { &put("\nWhy waste time to talk and further dehydrate yourself?"); $count++; } } elsif ($choice =~ /^eat/i) { if ($choice =~ /toothpick$/i) { if ($toothpick) { &put("\nYou stuff the toothpick down your throat, ignoring the pain. It's quite tasty, actually."); $toothpick = 0; $count++; } else { &put("\nWhy would you eat a toothpick, even if you had one?"); $count++; } } elsif ($choice =~ /pebble$/i) { &put("\nIs this supposed to be some underlying motive in an overall large scheme to dominate the world?"); $count++; } else { &put("\nAre you hungry?"); } } elsif ($choice =~ /^(examine|look at)$/i) { &put("\n\L\u$1\E what?"); $count++; } elsif ($choice =~ /^(examine|look|look at)/i) { if ($choice =~ /pebble$/i) { &put("\nIt's a pebble. Small and hard. Might be a good way to get somebody's attention..."); $count++; } elsif ($choice =~ /alley$/i) { &put("\nIt's crowded. And hot."); $count++; } else { &put("\nI don't see one to \L$1\E."); $count++; } } elsif ($choice =~ /^(get|take)/i) { if ($choice =~ /pebble$/i) { &put("\nYou take the pebble."); $pebble = 1; $count++; } else { &put("\nAre you blind? You can't $1 that?."); } } elsif ($choice =~ /^drink tea$/i) { if (!$cup) { &put("\nYou don't have any tea to drink, but you wish you did."); } elsif ($cup && !$tea) { &put("\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 ($tea) { &put("\nWhat tea? You already drank it."); } $count++; } elsif ($choice =~ /^drop/i) { if ($choice =~ /((cup of )?tea|cup)$/i) { &put("\nYou smash the $1 onto the ground."); $cup = 0; $count++; } elsif ($choice =~ /pebble$/i) { if ($pebble) { &put("\nYou drop the pebble onto the ground."); $pebble = 0; $count++; } elsif (!$pebble) { &put("\nYou don't have a pebble to drop."); $count++; } } } elsif ($choice =~ /^(quit|exit)\b/i) { &quit; if (!$pebble) { &put("\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) { &put("\nYou are in a narrow, but crowded alley. You start to get thirsty from the heat."); } } else { print $invalid; } } if (!$tea) { &put("\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; } ## Prompt 7 # How to attract the healer's attention? ## &put("\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 =~ /^wait\b/i) { $count++; } elsif ($choice =~ /^look$/i) { &put("\nThe healer is somewhere under the fire escape. You need to get her attention..."); } elsif ($choice =~ /^(examine|look at)$/i) { &put("\n\L\u$1\E what?"); $count++; } elsif ($choice =~ /^(examine|look|look at)\b/i) { if ($choice =~ /pebble$/i) { &put("\nIt's a pebble. Small and hard. Might be a good way to get somebody's attention..."); $count++; } elsif ($choice =~ /(fire escape|shadow(s)?)$/i) { &put("\nDark. You can't see anything in there."); $count++; } elsif ($choice =~ /(darkness|shadows)$/i) { &put("\nIt's dark. Are you scared of the dark?"); $count++; } else { &put("\nI don't see one to \L$1\E."); } } elsif ($choice =~ /^talk( to)?/i) { if ($choice =~ /butler$/i) { &put("\n\"You need some way to get her attention,\" Butler advises."); $count++; } elsif ($choice =~ /(nguyen|xuan|nguyen xuan)$/i) { &put("\nNguyen is too scared to talk. He just points at the fire escape."); $count++; } elsif ($choice =~ /(toothpick|pebble|shadows|darkness|fire escape)$/i) { &put("\nWow. I always knew that genii were insane, but I never knew it happened at this age."); $count++; } elsif ($choice =~ /(fairy|healer|sprite)$/i) { &put("\nYou yell into the fire escape, but all you hear are echoes of your voice."); $count++; } else { &put("\nWhy waste time to talk and further dehydrate yourself?"); $count++; } } elsif ($choice =~ /^eat/i) { if ($choice =~ /toothpick$/i) { if ($toothpick) { &put("\nYou stuff the toothpick down your throat, ignoring the pain. It's quite tasty, actually."); $toothpick = 0; $count++; } else { &put("\nWhy would you eat a toothpick, even if you had one?"); $count++; } } elsif ($choice =~ /pebble$/i) { if ($pebble) { &put("\nYou stuff the pebble down your throat, for some odd reason."); $count++; } else { &put("\nWhy would you want to do that, even if you had a pebble?"); $count++; } } elsif ($choice =~ /(fire escape|shadow(s)?)$/i) { &put("\nHow are you going to do that?"); $count++; } else { &put("\nAre you hungry?"); } } elsif ($choice =~ /^(quit|exit)\b/i) { &quit; &put("\nThe helear is somewhere under the fire escape. You need to get her attention..."); } elsif ($choice =~ /^(get( healer's)? attention)$/i) { &put("\nHow are you going to do that?"); $count++; } elsif ($choice =~ /^use pebble$/i) { if (!$pebble) { &put("\nYou do not have a pebble!"); } elsif ($pebble) { &put("\nHow are you going to use it?"); } $count++; } elsif ($choice =~ /^(throw|toss) pebble$/i) { if (!$pebble) { &put("\nYou do not have a pebble!"); } elsif ($pebble) { goto sprite; } } elsif ($choice =~ /^(leave|walk away)$/i) { &put("\nYou decide to call off the mission. You \L$1."); &gameover; } elsif ($choice =~ /^(butler|(night( |-)vision )?goggles|(butler )?hand me the (night( |-)vision )?goggles( butler)?)$/i) { &put("\nWhy? You haven't gotten the healer's attention yet."); $count++; } elsif ($choice =~ /^(butler|((butler )?hand me the )?(wine|whiskey)( butler)?)$/i) { &put("\nWhy? You haven't gotten the healer's attention yet."); $count++; } elsif ($choice =~ /^(offer|dangle|show|give|wave) (wine|whiskey|bottle|holy water)( to (healer|sprite|fairy)?)$/i) { &put("\nWhy? You haven't gotten the healer's attention yet. Besides, you don't even have wine."); $count++; } else { print $invalid; } } &put("\nNothing happens. Nguyen Xuan quietly walks away. You get impatient and call off the mission. You go back to Fowl Manor."); &gameover; ## Prompt 8 # Ah! Toss a pebble! How to see? ## sprite: &put("\nYou toss the pebble into the shadows. It makes a loud clanging noise. A 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 =~ /^wait\b/i) { $count++; } elsif ($choice =~ /^look$/i) { &put("\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 =~ /^(examine|look at)$/i) { &put("\n\L\u$1\E what?"); $count++; } elsif ($choice =~ /^(examine|look|look at)/i) { if ($choice =~ /darkness$/i) { &put("\nIt's darkness. There's no light. Never seen darkness before?"); $count++; } elsif ($choice =~ /(fire escape|shadow(s)?)$/i) { &put("\nDark. You can't see anything in there."); $count++; } elsif ($choice =~ /(sprite|healer|fairy)/i) { &put("\nYou can't see her."); $count++; } elsif ($choice =~ /(darkness|shadows)$/i) { &put("\nIt's dark. Are you scared of the dark?"); $count++; } else { &put("\nThere isn't one to \L$1\E!"); } } elsif ($choice =~ /^talk( to)?/i) { if ($choice =~ /butler$/i) { &put("\n\"Do you need the night-vision goggles?\" Butler asks."); $count++; } elsif ($choice =~ /(nguyen|xuan|nguyen xuan)$/i) { &put("\nNguyen is too scared to talk. He seems afraid of the healer and wants to run, but he's more afraid of Butler."); $count++; } elsif ($choice =~ /(fairy|healer|sprite)$/i) { &put("\n\"Wine,\" the \L$1 demands."); $count++; } elsif ($choice =~ /(toothpick|shadows|darkness|fire escape)$/i) { &put("\nWow. I always knew that genii were insane, but I never knew it happened at this age."); $count++; } else { &put("\nWhy waste time to talk and further dehydrate yourself?"); $count++; } } elsif ($choice =~ /^eat/i) { if ($choice =~ /toothpick$/i) { if ($toothpick) { &put("\nYou stuff the toothpick down your throat, ignoring the pain. It's quite tasty, actually."); $toothpick = 0; $count++; } else { &put("\nWhy would you eat a toothpick, even if you had one?"); $count++; } } elsif ($choice =~ /(fire escape|shadow(s)?)$/i) { &put("\nHow are you going to do that?"); $count++; } else { &put("\nAre you hungry?"); } } elsif ($choice =~ /^(quit|exit)\b/i) { &quit; &put("\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 =~ /^(leave|walk away)$/i) { &put("\nYou decide to call off the mission. You \L$1."); &gameover; } elsif ($choice =~ /^(butler|(night( |-)vision )?goggles|(butler )?hand me the (night( |-)vision )?goggles( butler)?)$/i) { goto goggles; } elsif ($choice =~ /^(butler|((butler )?hand me the )?(wine|whiskey)( butler)?)$/i) { &put("\nWhy? You can't even see the healer."); $count++; } elsif ($choice =~ /^(offer|dangle|show|give|wave) (wine|whiskey|bottle|holy water)( to (healer|sprite|fairy)?)$/i) { &put("\nWhy? You can't even see the healer. Besides, you don't even have wine."); $count++; } else { print $invalid; } } &put("\nNothing happens. Nguyen Xuan quietly walks away. You get impatient and call off the mission. You go back to Fowl Manor."); &gameover; ## Prompt 9 # Now we need to offer the ho- wine ## goggles: &put("\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 =~ /^wait\b/i) { $count++; } elsif ($choice =~ /^talk( to)?/i) { if ($choice =~ /butler$/i) { &put("\n\"I have some Irish whiskey, if you need some,\" Butler advises."); $count++; } elsif ($choice =~ /((night( |-)vision )?goggles|toothpick|shadows|darkness|fire escape)$/i) { &put("\nWow. I always knew that genii were insane, but I never knew it happened at this age."); $count++; } elsif ($choice =~ /(nguyen|xuan|nguyen xuan)$/i) { &put("\nNguyen is too scared to talk. He seems afraid of the healer and wants to run, but he's more afraid of Butler."); $count++; } elsif ($choice =~ /(fairy|healer|sprite)$/i) { &put("\n\"Wine,\" the \L$1 demands."); $count++; } else { &put("\nWhy waste time to talk and further dehydrate yourself?"); $count++; } } elsif ($choice =~ /^eat/i) { if ($choice =~ /toothpick$/i) { if ($toothpick) { &put("\nYou stuff the toothpick down your throat, ignoring the pain. It's quite tasty, actually."); $toothpick = 0; $count++; } else { &put("\nWhy would you eat a toothpick, even if you had one?"); $count++; } } elsif ($choice =~ /(fire escape|shadow(s)?)$/i) { &put("\nHow are you going to do that?"); $count++; } else { &put("\nAre you hungry?"); } } elsif ($choice =~ /^look$/i) { &put("\nThe healer wants wine from you."); } elsif ($choice =~ /^(examine|look at)$/i) { &put("\n\L\u$1\E what?"); $count++; } elsif ($choice =~ /^(examine|look|look at)/i) { if ($choice =~ /healer$/i) { &put("\nIt's a healer. She's abnormally small. And she's demanding wine from you."); $count++; } elsif ($choice =~ /(darkness|shadows)$/i) { &put("\nIt's dark. Are you scared of the dark?"); $count++; } else { &put("\nThere isn't one to \L$1\E!"); } } elsif ($choice =~ /^(quit|exit)\b/i) { &quit; &put("\nThe healer wants wine from you."); } elsif ($choice =~ /^(butler|((butler )?hand me the )?(wine|whiskey)( butler)?)$/i) { goto wine; } elsif ($choice =~ /^(leave|walk away)$/i) { &put("\nYou decide to call off the mission. You \L$1."); &gameover; } elsif ($choice =~ /^(offer|dangle|show|give|wave) (wine|whiskey|bottle|holy water)( to (healer|sprite|fairy)?)$/i) { &put("\nWhy? You don't even have wine!"); $count++; } elsif ($choice =~ /^(butler|(night( |-)vision )?goggles|(butler )?hand me the (night( |-)vision )?goggles( butler)?)$/i) { &put("\nYou already have the goggles! The ages kids start getting faulty memories..."); $count++; } else { print $invalid; } } &put("\nNothing happens. Nguyen Xuan quietly walks away. You get impatient and call off the mission. You go back to Fowl Manor."); &gameover; ## Prompt 10 # Butler gives you the hol- whiskey ## wine: &put("\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 =~ /^wait\b/i) { $count++; } elsif ($choice =~ /^look$/i) { &put("\nThe healer wants wine from you. You have half a pint of Irish whiskey in your hands."); } elsif ($choice =~ /^(examine|look at)$/i) { &put("\n\L\u$1\E what?"); $count++; } elsif ($choice =~ /^(examine|look|look at)/i) { if ($choice =~ /healer$/i) { &put("\nIt's a healer. She's abnormally small. And she's demanding wine from you."); $count++; } elsif ($choice =~ /(darkness|shadows)$/i) { &put("\nIt's dark. Are you scared of the dark?"); $count++; } elsif ($choice =~ /(wine|(irish )?whiskey)$/i) { &put("\nIt's a pint of Irish whiskey. Really."); $count++; } elsif ($choice =~ /holy water$/i) { &put("\nWhat holy water?"); $count++; } else { &put("\nThere isn't one to \L$1\E!"); $count++; } } elsif ($choice =~ /^talk( to)?/i) { if ($choice =~ /butler$/i) { &put("\n\"Are you going to offer the whiskey to her?\" Butler asks."); $count++; } elsif ($choice =~ /(nguyen|xuan|nguyen xuan)$/i) { &put("\nNguyen is too scared to talk. He seems afraid of the healer and wants to run, but he's more afraid of Butler."); $count++; } elsif ($choice =~ /(bottle|wine|(irish )?whiskey|(night( |-)vision )?goggles|toothpick|shadows|darkness|fire escape)$/i) { &put("\nWow. I always knew that genii were insane, but I never knew it happened at this age."); $count++; } elsif ($choice =~ /(fairy|healer|sprite)$/i) { &put("\n\"Wine,\" the \L$1 demands. And you have a bottle of wine."); $count++; } else { &put("\nWhy waste time to talk and further dehydrate yourself?"); $count++; } } elsif ($choice =~ /^eat/i) { if ($choice =~ /toothpick$/i) { if ($toothpick) { &put("\nYou stuff the toothpick down your throat, ignoring the pain. It's quite tasty, actually."); $toothpick = 0; $count++; } else { &put("\nWhy would you eat a toothpick, even if you had one?"); $count++; } } elsif ($choice =~ /(fire escape|shadow(s)?)$/i) { &put("\nHow are you going to do that?"); $count++; } elsif ($choice =~ /(bottle( of (wine|whiskey)?))$/i) { &put("\nYou stuff the bottle down your throat and choke. You lose consciousness."); &gameover; } else { &put("\nAre you hungry?"); } } elsif ($choice =~ /^(quit|exit)\b/i) { &quit; &put("\nThe healer wants wine from you. You have half a pint of Irish whiskey in your hands."); } elsif ($choice =~ /^(drink (wine|whiskey|bottle( of (wine|whiskey)?)))\b/i) { &put("\nYou decide to conduct some scientific research into the effects of intoxication via single-malt Irish whiskey. Not surprisingly, you get so drunk that you have to abandon the mission."); &gameover; } elsif ($choice =~ /^(leave|walk away)$/i) { &put("\nYou decide to call off the mission. You \L$1."); &gameover; } elsif ($choice =~ /^(offer|dangle|show|give|wave) (wine|whiskey|bottle|holy water)( to (healer|sprite|fairy)?)$/i) { goto offerwine; } elsif ($choice =~ /^(butler|(night( |-)vision )?goggles|(butler )?hand me the (night( |-)vision )?goggles( butler)?)$/i) { &put("\nYou already have the goggles! The ages kids start getting faulty memories..."); $count++; } elsif ($choice =~ /^(butler|((butler )?hand me the )?(wine|whiskey)( butler)?)$/i) { &put("\nYou already have the whiskey! The ages kids start getting faulty memories..."); $count++; } else { print $invalid; } } &put("\nNothing happens. Nguyen Xuan quietly walks away. You get impatient and call off the mission. You go back to Fowl Manor."); &gameover; ## Prompt 11 # Remove your goggles quick! ## offerwine: &put("\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 =~ /^wait\b/i) { &put("\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 =~ /^look$/i) { &put("\nYou're offering the wine to the healer."); } elsif ($choice =~ /^(examine|look|look at)/i) { if ($choice =~ /healer$/i) { &put("\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 =~ /(darkness|shadows)$/i) { &put("\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 =~ /(wine|(irish )?whiskey)$/i) { &put("\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 =~ /holy water$/i) { &put("\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; } else { &put("\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 =~ /^talk( to)?/i) { if ($choice =~ /butler$/i) { &put("\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 =~ /(nguyen|xuan|nguyen xuan)$/i) { &put("\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 =~ /(fairy|healer|sprite)$/i) { &put("\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; } else { &put("\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 =~ /^eat/i) { if ($choice =~ /toothpick$/i) { &put("\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 =~ /(fire escape|shadow(s)?)$/i) { &put("\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 =~ /(bottle( of (wine|whiskey)?))$/i) { &put("\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; } else { &put("\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 =~ /^(quit|exit)\b/i) { &quit; &put("\nYou're offering the wine to the healer."); } elsif ($choice =~ /^(remove|take off) (night( |-)vision )?goggles$/i) { last; # Break out of loop } elsif ($choice =~ /^(drink (wine|whiskey|bottle( of (wine|whiskey)?)))\b/i) { &put("\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 =~ /^(leave|walk away)$/i) { &put("\nYou decide to call off the mission. You \L$1."); &gameover; } elsif ($choice =~ /^(butler|(night( |-)vision )?goggles|(butler )?hand me the (night( |-)vision )?goggles( butler)?)$/i) { &put("\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 =~ /^(butler|((butler )?hand me the )?(wine|whiskey)( butler)?)$/i) { &put("\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 =~ /^(offer|dangle|show|give|wave) (wine|whiskey|bottle|holy water)( to (healer|sprite|fairy)?)$/i) { &put("\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; } else { print $invalid; } } ## Prompt 12 # Pay Nguyen. He deserves it ## &put("\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. You 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) { &put("\"Do you doubt me? Just let me enslave your will. It will be trivial.\""); } elsif ($count == 1) { &put("\nThe fairy continues. \"Do you want to become pig droppings? I can do it easily...\""); } elsif ($count == 2) { &put("\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) { &put("\n\"You are a fool,\" the healer says, \"to meddle with magic.\""); } elsif ($count == 4) { &put("\n\"I will kill you!\" the fairy roars, spraying her alcohol-laced spit everywhere."); } &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /^wait\b/i) { $count++; } elsif ($choice =~ /^look$/i) { $count++ } elsif ($choice =~ /^(examine|look at)$/i) { &put("\n\L\u$1\E what?"); $count++; } elsif ($choice =~ /^(examine|look|look at)/i) { if ($choice =~ /healer$/i) { &put("\nIt's a healer. She's abnormally small. And she's threatening you."); $count++; } elsif ($choice =~ /(darkness|shadows)$/i) { &put("\nIt's dark. Are you scared of the dark?"); $count++; } else { &put("\nThere isn't one to \L$1\E!"); $count++; } } elsif ($choice =~ /^talk( to)?/i) { if ($choice =~ /butler$/i) { &put("\n\"She'll give up soon,\" Butler comments."); $count++; } elsif ($choice =~ /(nguyen|xuan|nguyen xuan)$/i) { &put("\nHe's gone. You just paid him."); $count++; } elsif ($choice =~ /(toothpick|shadows|darkness|fire escape)$/i) { &put("\nWow. I always knew that genii were insane, but I never knew it happened at this age."); $count++; } elsif ($choice =~ /(fairy|healer|sprite)$/i) { $count++; } else { &put("\nWhy waste time to talk and further dehydrate yourself?"); $count++; } } elsif ($choice =~ /^eat/i) { if ($choice =~ /toothpick$/i) { if ($toothpick) { &put("\nYou stuff the toothpick down your throat, ignoring the pain. It's quite tasty, actually."); $toothpick = 0; $count++; } else { &put("\nWhy would you eat a toothpick, even if you had one?"); $count++; } } elsif ($choice =~ /(fire escape|shadow(s)?)$/i) { &put("\nHow are you going to do that?"); $count++; } else { &put("\nAre you hungry?"); } } elsif ($choice =~ /^(quit|exit)\b/i) { &quit; } elsif ($choice =~ /^(offer|dangle|show|give|wave) (wine|whiskey|bottle|holy water)( to (healer|sprite|fairy)?)$/i) { &put("\nYou've already given her the whiskey! The ages kids start getting faulty memories..."); $count++; } elsif ($choice =~ /^(butler|(night( |-)vision )?goggles|(butler )?hand me the (night( |-)vision )?goggles( butler)?)$/i) { &put("\nYou already have the goggles! The ages kids start getting faulty memories..."); $count++; } elsif ($choice =~ /^(butler|((butler )?hand me the )?(wine|whiskey)( butler)?)$/i) { &put("\nYou already gave the healer the whiskey! The ages kids start getting faulty memories..."); $count++; } elsif ($choice =~ /^(leave|walk away)$/i) { &put("\nYou are easily intimidated by the healer, and run away. You go back to Fowl Manor."); &gameover; } else { print $invalid; } } ## Prompt 13 # Let's make a deal! ## &put("\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 =~ /^look$/i) { &put("\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 =~ /^wait\b/i) { $count++; } elsif ($choice =~ /^(quit|exit)\b/i) { &quit; &put("\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 =~ /^(examine|look at)$/i) { &put("\n\L\u$1\E what?"); $count++; } elsif ($choice =~ /^(examine|look|look at)\b/i) { if ($choice =~ /(healer|sprite|fairy)$/i) { &put("\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 =~ /(darkness|shadows)$/i) { &put("\nIt's dark. Are you scared of the dark?"); $count++; } else { &put("\nThere isn't one to \L$1\E!"); $count++; } } elsif ($choice =~ /^talk( to)?/i) { if ($choice =~ /butler$/i) { &put("\n\"If we don't save her now she'll die,\" Butler comments."); $count++; } elsif ($choice =~ /(nguyen|xuan|nguyen xuan)$/i) { &put("\nHe's gone. Don't you remember?"); $count++; } elsif ($choice =~ /(toothpick|shadows|darkness|fire escape)$/i) { &put("\nWow. I always knew that genii were insane, but I never knew it happened at this age."); $count++; } elsif ($choice =~ /(fairy|healer|sprite)$/i) { &put("\n\"Are you going to help me?\" the sprite demands."); $count++; } else { &put("\nWhy waste time to talk and further dehydrate yourself?"); $count++; } } elsif ($choice =~ /^eat/i) { if ($choice =~ /toothpick$/i) { if ($toothpick) { &put("\nYou stuff the toothpick down your throat, ignoring the pain. It's quite tasty, actually."); $toothpick = 0; $count++; } else { &put("\nWhy would you eat a toothpick, even if you had one?"); $count++; } } elsif ($choice =~ /(fire escape|shadow(s)?)$/i) { &put("\nHow are you going to do that?"); $count++; } else { &put("\nAre you hungry?"); } } elsif ($choice =~ /^(butler|(night( |-)vision )?goggles|(butler )?hand me the (night( |-)vision )?goggles( butler)?)$/i) { &put("\nYou already have the goggles! The ages kids start getting faulty memories..."); $count++; } elsif ($choice =~ /^(butler|((butler )?hand me the )?(wine|whiskey)( butler)?)$/i) { &put("\nYou already gave the healer the whiskey! The ages kids start getting faulty memories..."); $count++; } elsif ($choice =~ /^(leave|walk away)$/i) { &put("\nYou decide to abandon the mission. You go back to Fowl Manor."); &gameover; } elsif ($choice =~ /^(butler|heal (fairy|healer|sprite))|(((butler )?the|(give|offer) )?(vial|antidote|tara water|injection)( butler)?)$/i) { goto vial; } else { print $invalid; } } &put("\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; ## Prompt 14 # Don't steal the Book! ## vial: &put("\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 =~ /^wait\b/i) { $count++; } elsif ($choice =~ /^look$/i) { &put("\nThe sprite is holding out the Book for you to take."); } elsif ($choice =~ /^(examine|look at)$/i) { &put("\n\L\u$1\E what?"); $count++; } elsif ($choice =~ /^(examine|look|look at)\b/i) { if ($choice =~ /(healer|sprite|fairy)$/i) { &put("\nIt's a healer. She's abnormally small. And she's holding out the Book for you to take."); $count++; } elsif ($choice =~ /(darkness|shadows)$/i) { &put("\nIt's dark. Are you scared of the dark?"); $count++; } elsif ($choice =~ /book$/i) { &put("\nIt's gold. It's small. It's in the sprite's hand. And time is running out."); $count++; } else { &put("\nThere isn't one to \L$1\E!"); $count++; } } elsif ($choice =~ /^(get|take)$/i) { &put("\n\L\u$1\E what?"); $count++; } elsif ($choice =~ /^(get|take)/i) { if ($choice =~ /book$/i) { goto camera; } else { &put("\nThere isn't one to \L$1\E!"); $count++; } } elsif ($choice =~ /^talk( to)?/i) { if ($choice =~ /butler$/i) { &put("\n\"Are you going to take it?\" Butler asks."); $count++; } elsif ($choice =~ /(nguyen|xuan|nguyen xuan)$/i) { &put("\nHe's gone."); $count++; } elsif ($choice =~ /(toothpick|book|shadows|darkness|fire escape)$/i) { &put("\nWow. I always knew that genii were insane, but I never knew it happened at this age."); $count++; } elsif ($choice =~ /(fairy|healer|sprite)$/i) { &put("\n\"Here's the book,\" she says."); $count++; } else { &put("\nWhy waste time to talk and further dehydrate yourself?"); $count++; } } elsif ($choice =~ /^eat/i) { if ($choice =~ /toothpick$/i) { if ($toothpick) { &put("\nYou stuff the toothpick down your throat, ignoring the pain. It's quite tasty, actually."); $toothpick = 0; $count++; } else { &put("\nWhy would you eat a toothpick, even if you had one?"); $count++; } } elsif ($choice =~ /(fire escape|shadow(s)?)$/i) { &put("\nHow are you going to do that?"); $count++; } elsif ($choice =~ /book$/i) { &put("\nYou take the Book and stuff it down your throat. It combusts, burning your throat. You choke and Butler rushes you to hospital."); &gameover; } else { &put("\nAre you hungry?"); } } elsif ($choice =~ /^(quit|exit)\b/i) { &quit; &put("\nThe sprite is holding out the Book for you to take."); } elsif ($choice =~ /^(offer|dangle|show|give|wave) (wine|whiskey|bottle|holy water)( to (healer|sprite|fairy)?)$/i) { &put("\nYou've already given her the whiskey! The ages kids start getting faulty memories..."); $count++; } elsif ($choice =~ /^(butler|(night( |-)vision )?goggles|(butler )?hand me the (night( |-)vision )?goggles( butler)?)$/i) { &put("\nYou already have the goggles! The ages kids start getting faulty memories..."); $count++; } elsif ($choice =~ /^(butler|((butler )?hand me the )?(wine|whiskey)( butler)?)$/i) { &put("\nYou already gave the healer the whiskey! The ages kids start getting faulty memories..."); $count++; } elsif ($choice =~ /^(leave|walk away)$/i) { &put("\nYou give up on the mission. You go back to Fowl Manor."); &gameover; } else { print $invalid; } } &put("\n\"You're not going to take it?\" the sprite asks. \"Very well.\" She puts her Book away. Your chance is gone."); &gameover; ## Prompt 15 # You can't take the Book away, so you'll have to improvise ## camera: &put("\nYou take the Book and hand it to Butler."); $count = 0; until ($count == 20) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /^look$/i) { &put("\nButler (looking somewhat confused) is holding the Book."); } elsif ($choice =~ /^wait\b/i) { $count++; } elsif ($choice =~ /^(examine|look at)$/i) { &put("\n\L\u$1\E what?"); $count++; } elsif ($choice =~ /^(examine|look|look at)\b/i) { if ($choice =~ /book$/i) { &put("\nIt's gold. It's small. It's in Butler's hand. And time is running out."); $count++; } else { &put("\nThere isn't one to \L$1\E!"); $count++; } } elsif ($choice =~ /^(quit|exit)\b/i) { &quit; &put("\nButler (looking somewhat confused) is holding the Book."); } elsif ($choice =~ /^(butler|(butler )?(photograph|take pictures of) book( butler)?)$/i) { goto takepictures; } elsif ($choice =~ /^talk( to)?/i) { if ($choice =~ /butler$/i) { &put("\n\"What do you want me to do?\" Butler asks."); $count++; } elsif ($choice =~ /(nguyen|xuan|nguyen xuan)$/i) { &put("\nHe's gone."); $count++; } elsif ($choice =~ /(toothpick|book|shadows|darkness|fire escape)$/i) { &put("\nWow. I always knew that genii were insane, but I never knew it happened at this age."); $count++; } elsif ($choice =~ /(fairy|healer|sprite)$/i) { &put("\n\"Hurry up, time's runningout,\" she says."); $count++; } else { &put("\nWhy waste time to talk and further dehydrate yourself?"); $count++; } } elsif ($choice =~ /^eat/i) { if ($choice =~ /toothpick$/i) { if ($toothpick) { &put("\nYou stuff the toothpick down your throat, ignoring the pain. It's quite tasty, actually."); $toothpick = 0; $count++; } else { &put("\nWhy would you eat a toothpick, even if you had one?"); $count++; } } elsif ($choice =~ /(fire escape|shadow(s)?)$/i) { &put("\nHow are you going to do that?"); $count++; } elsif ($choice =~ /book$/i) { &put("\nYou take the Book and stuff it down your throat. It combusts, burning your throat. You choke and Butler rushes you to hospital."); &gameover; } else { &put("\nAre you hungry?"); } } elsif ($choice =~ /^(offer|dangle|show|give|wave) (wine|whiskey|bottle|holy water)( to (healer|sprite|fairy)?)$/i) { &put("\nYou've already given her the whiskey! The ages kids start getting faulty memories..."); $count++; } elsif ($choice =~ /^(butler|(night( |-)vision )?goggles|(butler )?hand me the (night( |-)vision )?goggles( butler)?)$/i) { &put("\nYou already have the goggles! The ages kids start getting faulty memories..."); $count++; } elsif ($choice =~ /^(butler|((butler )?hand me the )?(wine|whiskey)( butler)?)$/i) { &put("\nYou already gave the healer the whiskey! The ages kids start getting faulty memories..."); $count++; } elsif ($choice =~ /^(leave|walk away)$/i) { &put("\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 { print $invalid; } } &put("\n\"Time's up,\" the sprite says. You reluctantly hand the Book back to her. Your chance is gone."); &gameover; ## Prompt 16 # Oh no, the camera doesn't work! ## takepictures: &put("\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 pencil, maybe?\""); until ($count == 20) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /^wait\b/i) { $count++; } elsif ($choice =~ /^look$/i) { &put("\nButler (looking somewhat confused) is holding the Book. He needs something small and thin to reset the camera."); } elsif ($choice =~ /^(examine|look at)$/i) { &put("\n\L\u$1\E what?"); $count++; } elsif ($choice =~ /^(examine|look|look at)\b/i) { if ($choice =~ /book$/i) { &put("\nIt's gold. It's small. It's in Butler's hand. And time is running out."); $count++; } elsif ($choice =~ /(darkness|shadows)$/i) { &put("\nIt's dark. Are you scared of the dark?"); $count++; } elsif ($choice =~ /camera$/i) { &put("\nIt needs to be reset. The button cannot be pressed without a pen."); $count++; } else { &put("\nThere isn't one to \L$1\E!"); $count++; } } elsif ($choice =~ /^talk( to)?/i) { if ($choice =~ /butler$/i) { &put("\n\"The camera doesn't work,\" Butler says."); $count++; } elsif ($choice =~ /(nguyen|xuan|nguyen xuan)$/i) { &put("\nHe's gone."); $count++; } elsif ($choice =~ /(toothpick|camera|book|shadows|darkness|fire escape)$/i) { &put("\nWow. I always knew that genii were insane, but I never knew it happened at this age."); $count++; } elsif ($choice =~ /(fairy|healer|sprite)$/i) { &put("\n\"Here's the book,\" she says."); $count++; } else { &put("\nWhy waste time to talk and further dehydrate yourself?"); $count++; } } elsif ($choice =~ /^(quit|exit)\b/i) { &quit; &put("\nButler (looking somewhat confused) is holding the Book. He needs something small and thin to reset the camera."); } elsif ($choice =~ /^((use|offer|give|produce|reveal|show) pen( to butler)?)$/i) { &put("\nThat would be great, if you had a pen. Do you have a pen? No? I didn't think so."); $count++; } elsif ($choice =~ /^eat/i) { if ($choice =~ /toothpick$/i) { if ($toothpick) { &put("\nYou stuff the toothpick down your throat, ignoring the pain. It's quite tasty, actually."); $toothpick = 0; $count++; } else { &put("\nWhy would you eat a toothpick, even if you had one?"); $count++; } } elsif ($choice =~ /(fire escape|shadow(s)?)$/i) { &put("\nHow are you going to do that?"); $count++; } elsif ($choice =~ /book$/i) { &put("\nYou take the Book and stuff it down your throat. It combusts, burning your throat. You choke and Butler rushes you to hospital."); &gameover; } elsif ($choice =~ /camera$/i) { &put("\nYou stuff the camera down your throat. You choke and Butler rushes you to hospital."); &gameover; } else { &put("\nAre you hungry?"); } } elsif ($choice =~ /^(offer|dangle|show|give|wave) (wine|whiskey|bottle|holy water)( to (healer|sprite|fairy)?)$/i) { &put("\nYou've already given her the whiskey! The ages kids start getting faulty memories..."); $count++; } elsif ($choice =~ /^(butler|(night( |-)vision )?goggles|(butler )?hand me the (night( |-)vision )?goggles( butler)?)$/i) { &put("\nYou already have the goggles! The ages kids start getting faulty memories..."); $count++; } elsif ($choice =~ /^(butler|((butler )?hand me the )?(wine|whiskey)( butler)?)$/i) { &put("\nYou already gave the healer the whiskey! The ages kids start getting faulty memories..."); $count++; } elsif ($choice =~ /^((use|offer|give|produce|reveal|show) toothpick( to butler)?)$/i) { if (!$toothpick) { &put("\nThat would be a great idea, if you had a toothpick."); $count++; } elsif ($toothpick) { goto toothpick; } } elsif ($choice =~ /^(leave|walk away)$/i) { &put("\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 { print $invalid; } } &put("\n\"Time's up,\" the sprite says. You reluctantly hand the Book back to her. Your chance is gone."); &gameover; ## Prompt 17 # The camera works now ## toothpick: &put("\nYou give the toothpick to Butler. He resets the camera. Butler photographs each page of the Book. The entire contents of the Book are now stored on a chip."); until ($count == 20) { &choice; if ($choice =~ /\bhelp\b/i) { &help; } elsif ($choice =~ /^wait\b/i) { $count++; } elsif ($choice =~ /^look$/i) { &put("\nButler (looking somewhat confused) is holding the Book. He has just taken pictures of every page of the Book."); } elsif ($choice =~ /^(examine|look|look at)\b/i) { if ($choice =~ /book$/i) { &put("\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 =~ /(darkness|shadows)$/i) { &put("\nIt's dark. Are you scared of the dark?"); $count++; } else { &put("\nThere isn't one to \L$1\E!"); $count++; } } elsif ($choice =~ /^talk( to)?/i) { if ($choice =~ /butler$/i) { &put("\n\"I'm done. Now what?\" Butler asks."); $count++; } elsif ($choice =~ /(nguyen|xuan|nguyen xuan)$/i) { &put("\nHe's gone."); $count++; } elsif ($choice =~ /(camera|book|shadows|darkness|fire escape)$/i) { &put("\nWow. I always knew that genii were insane, but I never knew it happened at this age."); $count++; } elsif ($choice =~ /(fairy|healer|sprite)$/i) { &put("\n\"Here's the book,\" she says."); $count++; } else { &put("\nWhy waste time to talk and further dehydrate yourself?"); $count++; } } elsif ($choice =~ /^eat/i) { if ($choice =~ /(fire escape|shadow(s)?)$/i) { &put("\nHow are you going to do that?"); $count++; } elsif ($choice =~ /book$/i) { &put("\nYou take the Book and stuff it down your throat. It combusts, burning your throat. You choke and Butler rushes you to hospital."); &gameover; } else { &put("\nAre you hungry?"); } } elsif ($choice =~ /^(offer|dangle|show|give|wave) (wine|whiskey|bottle|holy water)( to (healer|sprite|fairy)?)$/i) { &put("\nYou've already given her the whiskey! The ages kids start getting faulty memories..."); $count++; } elsif ($choice =~ /^(butler|(night( |-)vision )?goggles|(butler )?hand me the (night( |-)vision )?goggles( butler)?)$/i) { &put("\nYou already have the goggles! The ages kids start getting faulty memories..."); $count++; } elsif ($choice =~ /^(butler|((butler )?hand me the )?(wine|whiskey)( butler)?)$/i) { &put("\nYou already gave the healer the whiskey! The ages kids start getting faulty memories..."); $count++; } elsif ($choice =~ /^((use|offer|give|produce|reveal|show) toothpick( to butler)?)$/i) { &put("\nThe camera already works! In fact, you've already taken the pictures! The ages kids start getting faulty memories..."); $count++; } elsif ($choice =~ /^(quit|exit)\b/i) { &quit; &put("\nButler (looking somewhat confused) is holding the Book. He has just taken pictures of every page of the Book."); } elsif ($choice =~ /^(leave|walk away)$/i) { &put("\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 =~ /^((e(-)?mail|upload|send|backup|load|save) (book|pictures|chip|photos|photographs|pics|files)( to (server|fowl manor))?)$/i) { $email = 1; last; # Break out of loop } elsif ($choice =~ /^return book( to (healer|sprite|fairy))?$/i) { last; # Break out of loop } else { print $invalid; } } ## Prompt 18 # Did you email the files? ## if ($email) { &put("\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) { &put("\nButler returns the Book back to the sprite.\n"); } &put("\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 =~ /^wait\b/i) { $count++; } elsif ($choice =~ /^look$/i) { &put("\nThe sprite is on the ground. You should leave before all the alcohol is violently expelled from the sprite."); } elsif ($choice =~ /^(examine|look at)$/i) { &put("\n\L\u$1\E what?"); $count++; } elsif ($choice =~ /^(examine|look|look at)\b/i) { if ($choice =~ /(sprite|fairy|healer)$/i) { &put("\nThe sprite is on the ground. You should leave before all the alcohol is violently expelled from the sprite."); $count++; } elsif ($choice =~ /(darkness|shadows)$/i) { &put("\nIt's dark. Are you scared of the dark?"); $count++; } else { &put("\nThere isn't one to \L$1\E!"); $count++; } } elsif ($choice =~ /^talk( to)?/i) { if ($choice =~ /butler$/i) { &put("\n\"Maybe we should leave,\" Butler suggests."); $count++; } elsif ($choice =~ /(nguyen|xuan|nguyen xuan)$/i) { &put("\nHe's gone."); $count++; } elsif ($choice =~ /(toothpick|shadows|darkness|fire escape)$/i) { &put("\nWow. I always knew that genii were insane, but I never knew it happened at this age."); $count++; } elsif ($choice =~ /(fairy|healer|sprite)$/i) { &put("\nShe's in no condition to talk."); $count++; } else { &put("\nWhy waste time to talk and further dehydrate yourself?"); $count++; } } elsif ($choice =~ /^eat/i) { if ($choice =~ /(fire escape|shadow(s)?)$/i) { &put("\nHow are you going to do that?"); $count++; } else { &put("\nAre you hungry?"); } } elsif ($choice =~ /^(offer|dangle|show|give|wave) (wine|whiskey|bottle|holy water)( to (healer|sprite|fairy)?)$/i) { &put("\nYou've already given her the whiskey! The ages kids start getting faulty memories..."); $count++; } elsif ($choice =~ /^(butler|(night( |-)vision )?goggles|(butler )?hand me the (night( |-)vision )?goggles( butler)?)$/i) { &put("\nYou already have the goggles! The ages kids start getting faulty memories..."); $count++; } elsif ($choice =~ /^(butler|((butler )?hand me the )?(wine|whiskey)( butler)?)$/i) { &put("\nYou already gave the healer the whiskey! The ages kids start getting faulty memories..."); $count++; } elsif ($choice =~ /^((use|offer|give|produce|reveal|show) toothpick( to butler)?)$/i) { &put("\nOld news. You've done that and more."); $count++; } elsif ($choice =~ /^(quit|exit)\b/i) { &quit; &put("\nThe sprite is on the ground. You should leave before all the alcohol is violently expelled from the sprite."); } elsif ($choice =~ /^(leave|walk away|go to the airport)$/i) { last; # Break out of loop } else { print $invalid; } } &put("\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."); if (!$email) { &put("\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; } ## Final Screen ## &put("\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"); ; &put("\nCongratulations. You have beaten the level. The adventure continues... ===Please Hit Enter to Exit===\n"); ;