-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathEncounterRoomsTester.java
More file actions
81 lines (71 loc) · 2.3 KB
/
EncounterRoomsTester.java
File metadata and controls
81 lines (71 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import java.util.Scanner;
public class EncounterRoomsTester extends Encounter
{
public static void main(String[] args)
{
Encounter terminator = new Encounter("The Terminato",100 ,10, 10, 10 ,"What is my name?" ,"The Terminator" ,"It's already been said");
Encounter jackiechan = new Encounter("Jackie Chan",100 ,10, 10, 50 ,"What is my name?" ,"Jackie Chan" ,"It's already been said");
System.out.println("1.attack");
System.out.println("2.run");
System.out.println("3.ask riddle");
System.out.println("4.answer riddle");
System.out.println("5.get hint");
Scanner input = new Scanner(System.in);
System.out.println("The Terminator has been encountered");
String userInput = input.nextLine();
if (userInput.equals("attack"))
{
terminator.attack();
}
else if (userInput.equals("run"))
{
terminator.run();
}
else if (userInput.equals("ask riddle"))
{
terminator.askRiddle();
}
else if (userInput.equals("answer riddle"))
{
System.out.println("What is your answer");
String n = input.nextLine();
terminator.answerRiddle( n );
}
else if (userInput.equals("get hint"))
{
terminator.getHint();
}
else
{
System.out.println("Invalid choice....please choose from the above options");
}
System.out.println("Jackie Chan has been encountered");
String userInput2 = input.nextLine();
if (userInput2.equals("attack"))
{
jackiechan.attack();
}
else if (userInput2.equals("run"))
{
jackiechan.run();
}
else if (userInput2.equals("ask riddle"))
{
jackiechan.askRiddle();
}
else if (userInput2.equals("answer riddle"))
{
System.out.println("What is your answer");
String n = input.nextLine();
jackiechan.answerRiddle( n );
}
else if (userInput2.equals("get hint"))
{
jackiechan.getHint();
}
else
{
System.out.println("Invalid choice....please choose from the above options");
}
}
}