-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQuestionBank.java
186 lines (112 loc) · 5.02 KB
/
QuestionBank.java
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
package com.apcs;
import java.util.Scanner;
public class QuestionBank {
public void circeQuestions() {
int question = 1;
int userChoice2 = 0;
if (question == 1) {
System.out.println("");
System.out.println("What animals did Circe turn men into when they arrived upon her island? ");
System.out.println("1) Guinea Pigs");
System.out.println("2) Cows ");
System.out.println("3) Pigs ");
System.out.println("4) Birds ");
Scanner scanner = new Scanner(System.in);
try {
userChoice2 = scanner.nextInt();
scanner.nextLine();
} catch (Exception e) {
System.out.println("Bad input. Please enter a number between 1 and 4.");
System.out.println("");
}
if (userChoice2 == 3) {
System.out.println("Correct! You are free to pass, but first, feel free to purchase anything else you might need from the shop.");
// add shop call here
} else {
System.out.println("Incorrect. Your crew has upset Circe, as she turns your crew into pigs and ends your journey early. GAME OVER.");
System.exit(0);
}
} else {
System.out.println("Bad input. Please enter a number between 1 and 4.");
}
}
public void straitsQuestion(Quest quest) {
while (true) {
int userChoice3 = 0;
System.out.println("");
System.out.println("What will your decision be? ");
System.out.println("1) Scylla");
System.out.println("2) Charybdis ");
System.out.println("3) How many CREW MEMBERS do I have alive? ");
System.out.print("Choice: ");
Scanner scanner = new Scanner(System.in);
try {
userChoice3 = scanner.nextInt();
scanner.nextLine();
} catch (Exception e) {
System.out.println("Bad input. Please enter a number between 1 and 3.");
System.out.println("");
}
if (userChoice3 == 1) {
System.out.println("");
System.out.println("You chose to travel by Scylla. ");
quest.getCrew().killCrewMember();
quest.getCrew().killCrewMember();
if (quest.getCrew().getCount() == 0) {
System.out.println("");
System.out.println("Your entire crew has died! GAME OVER. ");
System.exit(0);
} else {
System.out.println("");
System.out.println("Your crew managed to survive Scylla! ");
break;
}
} else if (userChoice3 == 2) {
int decisionStraits = 0;
System.out.println("You chose to travel by Charybdis. ");
decisionStraits = Utilities.randomCalcStraits();
if (decisionStraits == 1 || decisionStraits == 2) {
System.out.println("Your entire crew has died! GAME OVER. ");
System.exit(0);
} else {
System.out.println("Your crew managed to survive Charybdis! ");
break;
}
} else if (userChoice3 == 3) {
System.out.println("You currently have " + quest.getCrew().getCount() + " surviving crew mates.");
Utilities.pressEnterToContinue();
} else {
System.out.println("Bad input. Please enter a number between 1 and 3.");
System.out.println("");
}
}
}
public void finalQuestion() {
int question = 1;
int userChoice2 = 0;
if (question == 1) {
System.out.println("");
System.out.println("What gold-haired, winged animal provided the fleece of the Golden Fleece? ");
System.out.println("1) A ram");
System.out.println("2) A tiger ");
System.out.println("3) A wolf");
System.out.println("4) A pegasus ");
Scanner scanner = new Scanner(System.in);
try {
userChoice2 = scanner.nextInt();
scanner.nextLine();
} catch (Exception e) {
System.out.println("Bad input. Please enter a number between 1 and 4.");
System.out.println("");
}
if (userChoice2 == 1) {
System.out.println("Correct! You have defeated the Cyclops and can now take the Golden Fleece safely!");
} else {
System.out.println("Incorrect. Your crew has failed to fight the Cyclops, as it kills your remaining crew and ends your journey early. GAME OVER.");
System.exit(0);
}
} else {
System.out.println("Bad input. Please enter a number between 1 and 4.");
}
}
}