Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Locale;
- import java.util.Scanner;
- public class SomethingFun {
- public static void main(String[] args) {
- //welcome message
- //start game
- //enter your name
- //introductory story
- //walk tutorial
- //***interact items*** left to do
- //walk around
- //***inventory*** left to do
- //***item description*** left to do
- // intro
- int Health = 10;
- int SwordAtk = 5;
- int Slime1HP = 10;
- int Slime1Dmg = 2;
- System.out.println("Hello and welcome to the jungle. \nI would love for you to have a nice vacation but it seems there are some wild animals on the lose. \nHere have a hardened wooden stick to protect yourself! Be safe out there!");
- Scanner SwordYes = new Scanner(System.in);
- System.out.print("\nYOU RECEIVED A WOODEN STICK!\nPress 1 to continue!");
- String SwordDecider = SwordYes.nextLine();
- //name
- if (SwordDecider.equals("1")) {
- System.out.println("\nBy the way newcomer, would you like to share your name?");
- Scanner NameDecider = new Scanner(System.in);
- System.out.print("Would you like to share your name?(YES/NO)");
- String NameDecision = NameDecider.nextLine().toLowerCase();
- if (NameDecision.equals("yes")){
- Scanner NameInput = new Scanner(System.in);
- System.out.print("So your name is? ");
- String NameFinal = NameInput.nextLine();
- System.out.println("\nAh! "+NameFinal+". A wonderful sounding name! I hope your stay is safe!");
- }
- else {
- System.out.println("I see you've not decided to share your name, though it doesn't matter but it does make me a little sad.\nAnyways I do hope your stay here is safe!");
- }
- //starts here
- System.out.println("\nYOU HAVE ENTERED THE JUNGLE. BEWARE!\n\nTutorial: Sometimes you'll see a direction marked with a '?', this means there's an item there which can be picked. \nMake use of these items to make your journey through the forest easier!\n\nThere will also be spaces marked with '!'\nThese indicate there's a strong wild animal there. Be wary of these spaces.");
- Scanner EnteringDirection = new Scanner(System.in);
- //main first direction***
- //main first direction***
- //main first direction***
- System.out.println("\n\nYour current health = "+Health+"\nWhich direction would you like to go? (N/W(?)/E(!))\nDisclaimer: Do not choose West its not coded in yet.");
- String Dir1 = EnteringDirection.nextLine().toLowerCase();
- //1st chosen NORTH
- if (Dir1.equals("n")){
- System.out.println("You've moved 5 spaces North. There's no item around.");
- Scanner NDir1 = new Scanner(System.in);
- System.out.println("Your current health = "+Health+"\nYou're 5 steps from entrance. Where would you like to go next?\n(N(end)/W/E(?))");
- String NChoose1 = NDir1.nextLine().toLowerCase();
- if (NChoose1.equals("n")){
- System.out.println("Congratulations! You've cleared the game! Now that you've exited the forest I hope you get to your destination safe and sound!");
- }
- if (NChoose1.equals("e")){
- System.out.println("Your current health = "+Health+"\nYou moved 5 spaces East.\nThere's an antidote on the ground. GAINED ANTIDOTE!");
- Scanner NDir2 = new Scanner(System.in);
- System.out.println("Your current health = "+Health+"\nYou're 10 steps from entrance.\nWhich direction would you like to go? (N/W)");
- String NChoose2 = NDir2.nextLine().toLowerCase();
- if (NChoose2.equals("n")){
- System.out.println("Your current health is "+Health+"\nYou moved 5 spaces North. There's nothing here.");
- Scanner NDir3 = new Scanner(System.in);
- System.out.println("\nYou are 15 steps from entrance.\nWhich direction would you like to go? (W(end))");
- String NChoose3 = NDir3.nextLine().toLowerCase();
- if (NChoose3.equals("w")){
- System.out.println("Congratulations! You've cleared the game! Now that you've exited the forest I hope you get to your destination safe and sound!");
- }
- }
- if (NChoose2.equals("w")){
- System.out.println("You've moved 5 steps West.\nYou're 5 steps from start.\nYour current health is "+Health+"There's nothing here.");
- Scanner NDir4 = new Scanner(System.in);
- System.out.println("Which direction would you like to go? (N(end))");
- String NChoose4 = NDir4.nextLine().toLowerCase();
- if (NChoose4.equals("n")){
- System.out.println("Congratulations! You've cleared the game! Now that you've exited the forest I hope you get to your destination safe and sound!");
- }
- }
- }
- }
- //1st chosen EAST
- if (Dir1.equals("e")){
- System.out.println("You moved 5 spaces East.\nYou've encountered a wild Slime!");
- while (Slime1HP!=0){
- Slime1HP-=SwordAtk;
- Health-=Slime1Dmg;
- System.out.println("You dealt "+SwordAtk+"dmg to the slime. It has "+Slime1HP+" HP left.\nThe slime dealt "+Slime1Dmg+" damage to you leaving you with "+Health+" HP left.");
- break;
- }
- System.out.println("You defeated a slime ");
- Scanner EDir1 = new Scanner(System.in);
- System.out.println("Your current health = "+Health+"\nYou're 5 steps from entrance. Where would you like to go next?\n(N(?))");
- String EChoose1 = EDir1.nextLine().toLowerCase();
- if (EChoose1.equals("n")){
- System.out.println("Your current health = "+(Health)+"\nYou moved 5 spaces North.\nThere's an potion on the ground.");
- Scanner EMainInventory = new Scanner(System.in);
- System.out.println("Would you like to use the potion?(Yes/No)");
- String EUseInventory = EMainInventory.nextLine().toLowerCase();
- if (EUseInventory.equals("yes")){
- System.out.println("Your poison has been healed!");
- Scanner EDir2 = new Scanner(System.in);
- System.out.println("Your current health = "+(Health)+"\nYou're 10 steps from entrance.\nWhich direction would you like to go? (N/W)");
- String EChoose2 = EDir2.nextLine().toLowerCase();
- if (EChoose2.equals("n")){
- System.out.println("Your current health is "+ (Health)+"\nYou moved 5 spaces North. There's nothing here.");
- Scanner EDir3 = new Scanner(System.in);
- System.out.println("\nYou are 15 steps from entrance.\nWhich direction would you like to go? (W(end))");
- String EChoose3 = EDir3.nextLine().toLowerCase();
- if (EChoose3.equals("w")){
- System.out.println("Congratulations! You've cleared the game! Now that you've exited the forest I hope you get to your destination safe and sound!");
- }
- }
- else {
- System.out.println("Your current health is "+ (Health)+"\nThere's nothing here.");
- Scanner EDir4 = new Scanner(System.in);
- System.out.println("\nYou are 15 steps from entrance.\nWhich direction would you like to go? (N(end))");
- String EChoose4 = EDir4.nextLine().toLowerCase();
- if (EChoose4.equals("n")){
- System.out.println("Congratulations! You've cleared the game! Now that you've exited the forest I hope you get to your destination safe and sound!");
- }
- }
- }
- }
- }
- //1st chosen WEST
- if (Dir1.equals("w")){
- System.out.println("You've moved 5 spaces West. There's a piece of stone lying around.\nYOU RECEIVED A STONE!");
- Scanner WDir1 = new Scanner(System.in);
- System.out.println("Your current health = "+Health+"\nYou're 5 steps from entrance. Where would you like to go next?\n(N)");
- String WChoose1 = WDir1.nextLine().toLowerCase();
- switch (WChoose1){
- case "n":
- System.out.println("You moved 5 steps North.");
- }
- }
- }
- else {
- System.out.println("So it seems you do not want to get the sword and be ruthlessly hurt by the animals? Well be my guest good bye :)\nGAME OVER");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement