#!/usr/bin/perl ############################################################################### # ch1-help.pl # ############################################################################### # Help file for chapter 1 of Artemis Fowl # # =========================================================================== # # This is a help file in Perl, for my Artemis Fowl game. The game should # # be included in this package. # # =========================================================================== # # 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. # # =========================================================================== # # Thanks to: # # The White Lily for alpha testing and her hard work to help me. # # =========================================================================== # # Version: 0.5beta # # Released: March 1, 2006. # # Programmed by: Gus (gussiki@gmail.com) # ############################################################################### use strict; use Text::Wrap qw(wrap $columns $huge); my $columns = 80; my $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"; ; } ### Actual help file begins here. ### begin: # Declare the variables here my ($invalid, $quit, $choice, $output, $help, $help2); # Define the variables $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 "\nBye bye!\n"; } elsif ($quit =~ /^(n|no)$/i) { &put("You have chosen to stay. ===Please Hit Enter to Continue===\n"); ; } else { print $invalid; $quit = ""; goto quit; } } # The "help" subroutine sub help { $help = " === Help Screen === This is the help/hints file for the game. If you are viewing this, you probably have difficulties playing the game. This program will give tips and hints, without revealing too much of the story. Please note that a walkthrough would make the whole game pointless. Simply navigate your way around this file with numbers and letters. To exit, type in the letter \"x\". To obtain this screen again, type the letter \"h\". ===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); if ($choice =~ /^(h|help)$/i) { &help; } elsif ($choice =~ /^(x|exit)$/i) { &quit; } } ## Yay! The help file actually begins! &help; # Print out the file for the first time. # Main screen. The "crossroads." main: &put("\nThese are your options: 1. Any general hints or tips for me? 2. What's with the toothpick/cup of tea? 3. Who is the waiter? What does he want? 4. Nguyen Xuan just sits there and does nothing! Then he leaves. Why? 5. Nguyen Xuan runs away and I can't stop him! [1-5: view hint] [m: more hints] [h: help] [x: exit]"); &choice; if ($choice =~ /^1$/) { $help2 = "\nBASIC COMMANDS Here are some basic commands. Please note that there are more options not listed here. wait = Wait a turn look = Shows information about your surroundings i/inv/inventory = Shows your inventory who/whoami = Tells you which character you're currently playing as talk/talk to = Talk to a person for advice or clues examine/look at = Examine an object for clues get/take = Get an object to use later on in the game help = Access this screen restart = Restart game exit/quit = Exit the game ===Please Hit Enter to Continue==="; $help2 =~ s/( ){3,}//g; print wrap("", "", $help2); ; &put("\nWHY ISN'T MY COMMAND ACCEPTED? There can be several reasons why your command isn't accepted. The most obvious reason would be because you can't do it. It gets more problematic with other reasons. Note that although it is case insensitive (ie \"get\" is the same as \"gET\"), punctuation will not be accepted. It would also be a good idea to rephrase your command. A lot of times this will be the problem. ===Please Hit Enter to Continue==="); ; &put("\nHINTS AND TIPS THAT I WILL WILLINGLY DIVULGE Well, the problem that most people seem to be encountering is phrasing the commands properly. It might help to keep track of what commands work or don't work. If you see an object that you can pick up, it might be best to pick it up. Unless there's a very good reason not to. There's a reason it can be picked up (whether for good or for ill, it's for you to decide.) Also, your progress in this game isn't saved. So making a record of your progress would be helpful (if your memory isn't too good...). But most of all, have patience and don't give up. Text-based games are daunting if you haven't played them before, but with time you'll learn the tricks of the trade. Have fun! ===Please Hit Enter to Continue==="); ; } elsif ($choice =~ /^2$/) { goto toothcup; } elsif ($choice =~ /^3$/) { goto waiter; } elsif ($choice =~ /^4$/) { goto nguyensit; } elsif ($choice =~ /^5$/) { goto nguyenrun; } elsif ($choice =~ /^(m|more)$/i) { goto main2; } else { print $invalid; $choice = ""; } goto main; # Toothcup - information about the toothpick and cup toothcup: &put("\nWHAT'S WITH THE TOOTHPICK AND CUP? Well, there's a lot about them. Saying too much would spoil it. I'll just say that if it wasn't important, it wouldn't be there. [m: more - tell me more about the items] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main; } elsif ($choice =~ /^(m|more)$/i) { toothcup2: &put("\nMORE ABOUT THE TOOTHPICK AND CUP. Well, they are very important. Without them, you can't beat the game. You'll have to start over again to obtain these objects. [m: more - I want more information] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main; } elsif ($choice =~ /^(m|more)$/i) { &put("\nEVEN MORE ABOUT THE TOOTHPICK AND CUP Well, this toothpick comes into play later in the game. Very late in the game. Don't drop the toothpick. Or misuse it. The cup of tea is quite important. You need it about halfway through the game. Don't drop it. And don't worry, you can't drink it ahead of time. And that's all I'm saying. For now. ==Please Hit Enter to Continue==="); ; goto main; } else { print $invalid; $choice = ""; } goto toothcup2; } else { print $invalid; $choice = ""; } goto toothcup; ## waiter - information about the mysterious waiter waiter: &put("\nWHO IS THE WAITER? Oh, he's a pretty important guy. Last thing you want to do is to be rude to him. [m: more - anything else to tell me?] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main; } elsif ($choice =~ /^(m|more)$/i) { waiter2: &put("\nMORE ABOUT THE WAITER Well, would a waiter be so well dressed? Would a waiter have studied English at Oxford? He's not a waiter. He's somebody else. [m: more - who is he?] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main; } elsif ($choice =~ /^(m|more)$/i) { waiter3: &put("\nWHO IS THE WAITER? He's somebody you want to meet. But that's not the problem. The problem is that you can send him off -- and he won't come back, or he calls the police to arrest you. You don't want to get any more tea, but you don't want to send him off either. Be courteous and offer him a seat. [m: I give up - what do I say?] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main; } elsif ($choice =~ /^(m|more)$/i) { &put("\nWHAT DO I SAY? Have you tried something as simple as SIT DOWN? ===Please Hit Enter to Continue==="); ; goto main; } else { print $invalid; $choice = ""; } goto waiter3; } else { print $invalid; $choice = ""; } goto waiter2; } else { print $invalid; $choice = ""; } goto waiter; # Information about your meeting with Nguyen Xuan nguyensit: &put("\nWHY DOES NGUYEN XUAN DO NOTHING BUT SIT? THEN WHY DOES HE LEAVE? Well, he's waiting. He obviously got impatient and left. [m: more - What is he waiting for?] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main; } elsif ($choice =~ /^(m|more)$/i) { &put("\nWHAT IS HE WAITING FOR? Many things. He's waiting for you to come to your senses. He's waiting for you to regain your manners. In other words, he just gave you something he wanted you to look at. Why aren't you examining it? ===Please Hit Enter to Continue==="); ; goto main; } else { print $invalid; $choice = ""; } goto nguyensit; # Information about Nguyen fleeing nguyenrun: &put("\nWHY DOES HE RUN AWAY? Well, he's scared. No, there isn't anything you can do to prevent it. [m: more - how do I stop him?] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main; } elsif ($choice =~ /^(m|more)$/i) { nguyenrun2: &put("\nHOW DO I STOP NGUYEN? Don't think of some complex invention that you will concoct in three milliseconds. Think simple. Very simple. Or ask somebody -- important -- for help. [m: I give up - what do I say?] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main; } elsif ($choice =~ /^(m|more)$/i) { nguyenrun2: &put("\nWHAT DO I SAY? Isn't STOP simple enough? ===Please Hit Enter to Continue==="); ; goto main2; } else { print $invalid; $choice = ""; } goto nguyenrun2; } else { print $invalid; $choice = ""; } goto nguyenrun; # Main screen, page 2. Part 2 of the "crossroads." main2: &put("\nThese are your options: 1. What's with the pebble? 2. I don't go anywhere in the alleyway! 3. I keep getting dehydrated in the alleyway! 4. I can't talk to the healer! 5. I can't see the healer! [1-5: view hint] [m: more hints] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main; } elsif ($choice =~ /^1$/) { &put("\nWHAT IS THE PEBBLE DOING THERE? You'll trip over it if you don't pick it up. Metaphorically of course. Again, if it isn't important, it won't be there. You'll need it later. ===Please Hit Enter to Continue==="); ; goto main2; } elsif ($choice =~ /^2$/) { &put("\nWHY CAN'T I LEAVE THE ALLEY? Well, what are you doing? You can't leave the alley if you don't WALK! ===Please Hit Enter to Continue==="); ; goto main2; } elsif ($choice =~ /^3$/) { goto dehydrate; } elsif ($choice =~ /^4$/) { goto getattention; } elsif ($choice =~ /^5$/) { goto getgoggles; } elsif ($choice =~ /^(m|more)$/i) { goto main3; } else { print $invalid; $choice = ""; } goto main2; # Information about dehydration dehydrate: &put("\nWHY YOU GETS DEHYDRATED It's summer in Vietnam. Very hot. Anybody would get dehydrated. Especially Artemis, a young child who isn't physically fit. [m: more - how can I stop the dehydration?] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main2; } elsif ($choice =~ /^(m|more)$/i) { dehydrate2: &put("\nHOW YOU CAN STOP DEHYDRATION You know that dehydration is when you don't get enough water. (At least, I hope you know.) So you have to drink something. Before you get dehydrated. But only when you are thirsty. [m: more - what can I drink?] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main2; } elsif ($choice =~ /^(m|more)$/i) { &put("\nWHAT CAN I DRINK? Something that you (should have) picked up earlier in the game. Any more hints would be giving out the answer. ===Please Hit Enter to Continue==="); ; goto main2; } else { print $invalid; $choice = ""; } goto dehydrate2; } else { print $invalid; $choice = ""; } goto dehydrate; # How to Get a Healer's Attention for Dummies getattention: &put("\nGETTING THE HEALER'S ATTENTION Throw something at her. Well, maybe not directly at her. But somewhere to make noise. [m: more - throw what?] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main2; } elsif ($choice =~ /^(m|more)$/i) { &put("\nWHAT TO THROW AT THE HEALER Something you (should have) picked up earlier. ===Please Hit Enter to Continue==="); ; goto main2; } else { print $invalid; $choice = ""; } goto getattention; # Information about the goggles getgoggles: &put("\nWHY YOU CAN'T SEE THE HEALER It's too dark. You don't have night-vision. You don't have a magical ability to see in the dark. But you have technology. [m: more - what kind of technology?] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main2; } elsif ($choice =~ /^(m|more)$/i) { getgoggles2: &put("\nWHAT IS THIS NIGHT-VISION TECHNOLOGY? Never heard of night-vision goggles? [m: more - how do I obtain these goggles?] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main2; } elsif ($choice =~ /^(m|more)$/i) { getgoggles3: &put("\nHOW TO GET THE GOGGLES Well, you can't just \"get\" or \"take\" them, because they aren't out in the open. Somebody else has them. You could ask for them. [m: I give up - what do I say?] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main2; } elsif ($choice =~ /^(m|more)$/i) { &put("\nWHAT DO I SAY? Even I can understand something as vague as GOGGLES. ===Please Hit Enter to Continue==="); ; goto main3; } else { print $invalid; $choice = ""; } goto getgoggles3; } else { print $invalid; $choice = ""; } goto getgoggles2; } else { print $invalid; $choice = ""; } goto getgoggles; # Main screen, page 3. Part 3 of the "crossroads." main3: &put("\nThese are your options: 1. I don't have any whiskey to offer! 2. I have the whiskey. Now what? 3. The game suddenly ends when I try to give the whiskey to the healer! 4. Why does she keep threatening me? 5. She accepts the offer. Now what? [1-5: view hint] [m: more hints] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main2; } elsif ($choice =~ /^1$/) { obtainwhiskey: &put("\nI DON'T HAVE WHISKEY You just have to obtain it. Somebody else has it. Note that you can't \"get\" or \"take\" it, because it isn't in the open. Try asking for it. [m: I give up - what do I say?] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main3; } elsif ($choice =~ /^(m|more)$/i) { &put("\nWHAT DO I SAY? It's simple! As simple as WHISKEY. ===Please Hit Enter to Continue==="); ; goto main3; } else { print $invalid; $choice = ""; } goto obtainwhiskey; } elsif ($choice =~ /^2$/) { whatdo: &put("\nWHAT DO I DO WITH THE WHISKEY? Somebody wants the whiskey. It would be really impolite to not offer it. No, this doesn't mean you should drink it. [m: I give up - what do I say?] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main3; } elsif ($choice =~ /^(m|more)$/i) { &put("\nWHAT DO I SAY? Just OFFER WHISKEY! ===Please Hit Enter to Continue==="); ; goto main3; } else { print $invalid; $choice = ""; } goto whatdo; } elsif ($choice =~ /^3$/) { gameends: &put("\nWHY THE GAME SUDDENLY ENDS Read the text carefully. You have no idea whether the healer is a sprite or just some alcoholic ripping wine off of innocent bystanders. [m: more - tell me more] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main3; } elsif ($choice =~ /^(m|more)$/i) { gameends2: &put("\nMORE ABOUT THE SUDDEN END OF THE GAME Remember, sprites have green skin. A bit of a problem, since everything looks green through the night-vision goggles. Oh, also, the healer may be an alcoholic, but she's still fast enough to snatch it away from you. [m: I give up - what do I say?] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main3; } elsif ($choice =~ /^(m|more)$/i) { &put("\nWHAT DO I SAY? You have to REMOVE GOGGLES to see properly. ===Please Hit Enter to Continue==="); ; goto main3; } else { print $invalid; $choice = ""; } goto gameends2; } else { print $invalid; $choice = ""; } goto gameends; } elsif ($choice =~ /^4$/) { &put("\nWHY THE HEALER KEEPS MAKING THREATS She doesn't want to give up her Book. So she's resorting to some rather crude scare tactics. There's not much you can do except to WAIT it out. Let them bluff until they can't bluff any more. ===Please Hit Enter to Continue==="); ; goto main3; } elsif ($choice =~ /^5$/) { goto offer; } elsif ($choice =~ /^(m|more)$/i) { goto main4; } else { print $invalid; $choice = ""; } goto main3; # Info about giving the "virus" offer: &put("\nWHAT DO I DO ABOUT THE OFFER I MADE? She accepted it. You have to uphold your end of the deal. [m: more - what's my end of the deal?] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main3; } elsif ($choice =~ /^(m|more)$/i) { offer2: &put("\nWHAT DO I HAVE TO DO? She's dying. Don't you have to cure her? [m: more - where can I get the cure?] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main3; } elsif ($choice =~ /^(m|more)$/i) { offer3: &put("\nWHERE TO GET THE CURE Somebody has it (not you) and it might be best to ask for it. Of course, since it's not in the open, you can't simply \"get\" or \"take\" it. [m: I give up - what do I say?] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main3; } elsif ($choice =~ /^(m|more)$/i) { &put("\nWHAT DO I SAY? I think that HEAL SPRITE is self explanatory. ===Please Hit Enter to Continue==="); ; goto main4; } else { print $invalid; $choice = ""; } goto offer3; } else { print $invalid; $choice = ""; } goto offer2; } else { print $invalid; $choice = ""; } goto offer; # Main screen, page 4. Part 4 of the "crossroads." main4: &put("\nThese are your options: 1. She offers me the Book. And then she puts it away. Why? 2. I have obtained the Book. Do I walk away with it or what? 3. What's with the camera? 4. Why has the data been wiped? How do I prevent this? 5. I'm finished the game. [1-5: view hint] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main3; } elsif ($choice =~ /^1$/) { &put("\nWHY SHE PUTS THE BOOK AWAY She's offering it to you. Why don't you TAKE it? ===Please Hit Enter to Continue==="); ; goto main4; } elsif ($choice =~ /^2$/) { goto whatbook; } elsif ($choice =~ /^3$/) { goto camera; } elsif ($choice =~ /^4$/) { goto wipebook; } elsif ($choice =~ /^5$/) { &put("\nI'M FINISHED THE GAME That's not even a question. And I couldn't care less. I'm just a help file! Oh, you want to know what to now? Well, you can get on with your life, or you can continue playing this game. Yeah, you've beaten the game, but have you found all the easter eggs and cool things that you can do? Or you could simply wait for the next installment, which will probably take months. It's your choice. (I recommend getting on with your life.) ===Please Hit Enter to Continue==="); ; goto main4; } else { print $invalid; $choice = ""; } goto main4; # What to do with the Book? whatbook: &put("\nWHAT TO DO WITH THE BOOK Don't just sit there! You've got thirty minutes, and the clock's ticking! And don't try taking it away. You need some way of \"copying\" the Book. [m: more - how do I copy the book?] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main4; } elsif ($choice =~ /^(m|more)$/i) { whatbook2: &put("\nHOW TO COPY THE BOOK No, you don't whip out a pencil and a notebook. That's so lo-tech, not to mention slow. Think hi-tech. No, not a flatbed scanner. Not that hi-tech. But something similar. [m: I give up - what do I say?] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main4; } elsif ($choice =~ /^(m|more)$/i) { &put("\nWHAT DO I SAY? I'm sure you know how to PHOTOGRAPH BOOK. ===Please Hit Enter to Continue==="); ; goto main4; } else { print $invalid; $choice = ""; } goto whatbook2; } else { print $invalid; $choice = ""; } goto whatbook; # How to fix the camera camera: &put("\nWHAT'S WITH THE CAMERA It should be fairly self explanatory. It doesn't work. [m: more - how to fix the camera] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main4; } elsif ($choice =~ /^(m|more)$/i) { camera2: &put("\nHOW TO FIX THE CAMERA You need something long, thin, and sturdy to reset it. Don't worry, you should have it if you've followed all the proper steps. [m: I give up - what do I say?] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main4; } elsif ($choice =~ /^(m|more)$/i) { &put("\nWHAT DO I SAY? You simply OFFER TOOTHPICK. ===Please Hit Enter to Continue==="); ; goto main4; } else { print $invalid; $choice = ""; } goto camera2; } else { print $invalid; $choice = ""; } goto camera; # How to preserve data wipebook: &put("\nWHY IS THE DATA WIPED? Well, airport security creates a strong magnetic field that wi - oh, you want to know how to stop it. It might be a good idea to not bring your data through the airport. [m: more - how do I do this?] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main4; } elsif ($choice =~ /^(m|more)$/i) { wipebook2: &put("\nHOW TO KEEP THE DATA Evolve! Get out of the Stone Age! Ever heard of email? [m: I give up - what do I say?] [b: back] [h: help] [x: exit]"); &choice; if ($choice =~ /^(b|back)$/i) { goto main4; } elsif ($choice =~ /^(m|more)$/i) { &put("\nWHAT DO I SAY? There are many things you can say. EMAIL BOOK may or may not be one of them. ===Please Hit Enter to Continue==="); ; goto main4; } else { print $invalid; $choice = ""; } goto wipebook2; } else { print $invalid; $choice = ""; } goto wipebook;