#!/usr/bin/perl ############################################################################### # ch1-help.pl # ############################################################################### # Helpfile 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. # # =========================================================================== # # Version: 0.1alpha # # Released: February 26, 2006. # # Programed by: Gus (gussiki@gmail.com) # # =========================================================================== # # If you wish to modify or use the source-code, please give credit to Gus # # and inform him that you wish to do so. # ############################################################################### 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"; ; } ### 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 "\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 is the help/hints file for the the game. If you are viewing this, you probably have difficulties playing the game. This program will give tips and hints, without reealing too much of the story. Please note that a walkthrough would make the whole game pointless. Simply navigate your way around this file with the number keys. To exit, enter in the number \"99\". To obtain this screen again, enter in the number \"90\". ===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 == 90) { &help; } elsif ($choice == 99) { &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: 90. Help screen 99. Exit 1. What commands are there in the game? Why isn't my command accepted? 2. Any hints or tips for me? 3. What's with the toothpick/cup of tea? 4. Who is the waiter? What does he want? 5. Nguyen Xuan just sits there and does nothing! Then he leaves. Why? 6. Next screen"); &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. Finally, here's a tip. Try to remember what command you used, so you won't use it again. ===Please Hit Enter to Continue==="); ; } elsif ($choice == 2) { &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 flowchart of your progress would be helpfup (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 == 3) { goto toothcup; } elsif ($choice == 4) { goto waiter; } elsif ($choice == 5) { goto nguyensit; } elsif ($choice == 6) { 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. More options: 90. Help screen 99. Exit 91. Go back to the main screen 1. I don't care, I still want to know more about the toothpick and cup!"); &choice; if ($choice == 91) { goto main; } elsif ($choice == 1) { 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. More options: 90. Help screen 99. Exit 91. Go back to the main screen 1. Tell me more about the toothpick 2. Tell me more about the cup"); &choice; if ($choice == 91) { goto main; } elsif ($choice == 1) { &put("\nMORE ABOUT THE TOOTHPICK Well, this toothpick comes into play later in the game. Very late in the game. Don't drop the toothpick. Or misuse it. And that's all I'm saying about the toothpick. For now. ==Please Hit Enter to Continue==="); ; } elsif ($choice == 2) { &put("MORE ABOUT THE CUP 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==="); ; } 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. More options: 90. Help screen 99. Exit 91. Go back to the main screen 1. And? Anything else to tell me?"); &choice; if ($choice == 91) { goto main; } elsif ($choice == 1) { 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. More options: 90. Help screen 99. Exit 91. Go back to the main screen 1. Who is he?"); &choice; if ($choice == 91) { goto main; } elsif ($choice == 1) { &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. Why not offer him a seat? ===Please Hit Enter to Continue==="); ; } 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. More options: 90. Help screen 99. Exit 91. Go back to the main screen 1. What is he waiting for?"); &choice; if ($choice == 91) { goto main; } elsif ($choice == 1) { &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 looking at it? ===Please Hit Enter to Continue==="); ; } else { print $invalid; $choice = ""; } goto nguyensit; # Main screen, page 2. Part 2 of the "crossroads." main2: &put("\nThese are your options: 90. Help screen 99. Exit 91. Go back to the first screen 1. Nguyen Xuan runs away and I can't stop him! 2. What's with the pebble? 3. I don't go anywhere in the alleyway! 4. I keep getting dehydrated in the alleyway! 5. I can't talk to the healer! 6. Next screen"); &choice; if ($choice == 91) { goto main; } elsif ($choice == 1) { goto nguyenrun; } elsif ($choice == 2) { &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==="); ; } elsif ($choice == 3) { &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==="); ; } elsif ($choice == 4) { goto dehydrate; } elsif ($choice == 5) { goto getattention; } elsif ($choice == 6) { goto main3; } else { print $invalid; $choice = ""; } goto main2; # 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. More options: 90. Help screen 99. Exit 91. Go back to the second main screen 1. Then how do I stop him?"); &choice; if ($choice == 91) { goto main2; } elsif ($choice == 1) { &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. ===Please Hit Enter to Continue==="); ; } else { print $invalid; $choice = ""; } goto nguyenrun; # Information about dehydration dehydrate: &put("\nWHY ARTEMIS GETS DEHYDRATED It's summer in Vietnam. Very hot. Anybody would get dehydrated. Especially Artemis, a young child who isn't physically fit. More options: 90. Help screen 99. Exit 91. Go back to the second main screen 1. All right wise guy. How can I stop the dehydration?"); &choice; if ($choice == 91) { goto main2; } elsif ($choice == 1) { 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. More options: 90. Help screen 99. Exit 91. Go back to the second main screen 1. What can I drink? "); &choice; if ($choice == 91) { goto main2; } elsif ($choice == 1) { &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==="); ; } 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. More options: 90. Help screen 99. Exit 91. Go back to the second main screen 1. Throw what?"); &choice; if ($choice == 91) { goto main2; } elsif ($choice == 1) { &put("\nWHAT TO THROW AT THE HEALER Something you (should have) picked up earlier. ===Please Hit Enter to Continue==="); ; } else { print $invalid; $choice = ""; } goto getattention; # Main screen, page 3. Part 3 of the "crossroads." main3: &put("\nThese are your options: 90. Help screen 99. Exit 91. Go back to the second screen 1. I can't see anything! 2. I don't have any whiskey to offer! 3. I have the whiskey. Now what? 4. The game suddenly ends when I try to give the whiskey to the healer! 5. Why does she keep threatening me? 6. Next screen"); &choice; if ($choice == 91) { goto main2; } elsif ($choice == 1) { goto getgoggles; } elsif ($choice == 2) { &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. ===Please Hit Enter to Continue==="); ; } elsif ($choice == 3) { &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 can drink it. ===Please Hit Enter to Continue==="); ; } elsif ($choice == 4) { &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. 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. ===Please Hit Enter to Continue==="); ; } elsif ($choice == 5) { &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==="); ; } elsif ($choice == 6) { goto main4; } else { print $invalid; $choice = ""; } goto main3; # 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. More options: 90. Help screen 99. Exit 91. Go back to the third main screen 1. What is this \"technology\" you speak of?"); &choice; if ($choice == 91) { goto main3; } elsif ($choice == 1) { getgoggles2: &put("\nWHAT IS THIS NIGHT-VISION TECHNOLOGY? Never heard of night-vision goggles? More options: 90. Help screen 99. Exit 91. Go back to the third main screen 1. How do I obtain these goggles?"); &choice; if ($choice == 91) { goto main3; } elsif ($choice == 1) { &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. ===Please Hit Enter to Continue==="); ; } else { print $invalid; $choice = ""; } goto getgoggles2; } else { print $invalid; $choice = ""; } goto getgoggles; # Main screen, page 4. Part 4 of the "crossroads." main4: &put("\nThese are your options: 90. Help screen 99. Exit 91. Go back to the third screen 1. She accepts the offer. Now what? 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."); &choice; if ($choice == 91) { goto main3; } elsif ($choice == 1) { goto offer; } elsif ($choice == 2) { goto whatbook; } elsif ($choice == 3) { &put("\nWHAT'S WITH THE CAMERA It should be fairly self explanatory. It doesn't work. 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. ===Please Hit Enter to Continue==="); ; } elsif ($choice == 4) { &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. Evolve! Get out of the Stone Age! Ever heard of email? ===Please Hit Enter to Continue==="); ; } 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. Or you could simply wait for the next installment, which will probably take months. It's you're choice. (I recommend getting on with your life.) ===Please Hit Enter to Continue==="); ; } else { print $invalid; $choice = ""; } goto main4; # 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. Namely, cure her before she dies. The alcohol-feeding virus? The antidote? Hello? (No, the last one isn't an option.) More options: 90. Help screen 99. Exit 91. Go back to the fourth screen 1. And how do I do this?"); &choice; if ($choice == 91) { goto main4; } elsif ($choice == 1) { &put("\nHOW DO I HEAL THE SPRITE? With the Tara water? Somebody has it (not you) and it might be best to ask for it. ===Please Hit Enter to Continue==="); ; } else { print $invalid; $choice = ""; } goto offer; # 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. More options: 90. Help screen 99. Exit 91. Go back to the fourth screen 1. And how do I copy the Book?"); &choice; if ($choice == 91) { goto main4; } elsif ($choice == 1) { &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, no flatbed scanner. Not that hi-tech. But something similar. ===Please Hit Enter to Continue==="); ; } else { print $invalid; $choice = ""; } goto whatbook;