-
Notifications
You must be signed in to change notification settings - Fork 0
/
Quests.java
326 lines (292 loc) · 11.3 KB
/
Quests.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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
import java.util.Scanner;
import java.util.concurrent.TimeUnit;
/*
* Marcy's quests is #27
* Cook's quest is #28
* Main quest is #1
*/
public class Quests {
public int questNumber;
public int currentIndex;
public String[] questLog;
public boolean isComplete;
public int decisionInt;
public static boolean hasSeenShit;
public Quests(int mapNumber) {
this.questNumber = mapNumber;
this.currentIndex = 0;
questLog = NpcData.questData(mapNumber);
isComplete = false;
this.decisionInt = 0;
}
public void increaseIndex() {
currentIndex += 1;
}
public String toString() {
return questLog[currentIndex];
}
public static String[] nonStaticDialogue(char objectChar, Player p) {
switch (objectChar) {
case 't':
return NpcData.dialogueStorage(p.currentMap.mapNumber, objectChar);
case 'p':
switch (p.currentMap.mapNumber) {
case 27:
//System.out.println(p.pHasQuest(27));
if (!p.pHasQuest(27)) {
return NpcData.dialogueStorage(p.currentMap.mapNumber, objectChar);
}
if (p.quests[p.getQuestArrayNumber(27)].currentIndex == 0) {
String[] return1 = {"Keep looking for my cat man, "
+ "I need him back as soon as possible\n"};
//System.out.println(p.inventory[0].itemNumber);
return return1;
}
if (p.checkInv(13)) {
String[] return2 = {"\"Thank you so much for returning Mr. Jim for me!\nI can't thank you enough\""};
return return2;
} else {
String[] return3 = {"\"Thanks for your help man\""};
return return3;
}
case 26:
return NpcData.dialogueStorage(p.currentMap.mapNumber, objectChar);
}
break;
//Marcy's cat's dialogue
case 'ø': //
for (int i = 0; i < 10; i++) {
if(!p.pHasQuest(27)) {
String[] haventStartedQuest = {"\"Go away\"", "Holy shit a talking cat..."};
return haventStartedQuest;
} else if (p.quests[p.getQuestArrayNumber(27)].decisionInt == 0){
String[] startedQuest = {
"\"Go away!\"", "Holy shit a talking cat...",
"\"Leave me alone\"", "Marcy has been looking for you, I'm here to take you back right meow",
"\"\"","\"I'm sorry that she's sent you out to do her dirty work, but I ran away for a reason\"",
"\"All that woman ever does is parade me around to show me off because of my ability to speak\"",
"\"She doesn't actually love me, she only loves showing me off\"",
"\"Listen, if you leave me alone and go back to her and tell her I'm dead\n"
+ " I'll teach you how to more efficiently skin Cows so you'll get 2 hides instead of 1"};
return startedQuest;
}
}
case 'œ':
if(!p.pHasQuest(Player.currentMap.mapNumber)) {
return NpcData.dialogueStorage(Player.currentMap.mapNumber, objectChar);
} else if (p.quests[p.getQuestArrayNumber(28)].currentIndex == 1) {
String[] return1 = {"Keep lookin for the 'weed man... I'm dyin over here"};
return return1;
} else {
String[] return2 = {"Dude!! You're the man! Thanks a ton, you can use the range as much as you want"};
MapBuilder.g28Flag = true;
//p.quests[p.getQuestArrayNumber(28)].increaseIndex();
return return2;
}
}
String[] poop = {""};
return poop; // stub
}
public static void nonStaticInteractions(int mapNumber, char objChar, Player p) {
Scanner in = new Scanner(System.in);
switch (objChar) {
//Marcy's cat
case 'ø':
boolean flag = false;
while (!flag) {
int i = 0;
if(p.quests == null || p.quests[i] == null)
break;
if (p.quests[i].questNumber == 27) {
flag = true;
}
i++;
}
if(p.quests == null || !flag) {
System.out.println("I wonder if this cat belongs to anyone...");
} else if (p.quests[p.getQuestArrayNumber(27)].decisionInt == 0) {
System.out.println("Enter 1 to take the cat back to Marcy, 2 to leave him be.");
String input = in.nextLine();
if(input.equals("1")) {
p.quests[p.getQuestArrayNumber(27)].decisionInt = 1;
InventoryItems cat = new InventoryItems(13, "Marcy's Cat", p);
p.addItem(cat, 1);
p.quests[p.getQuestArrayNumber(27)].currentIndex = 2;
} else if (input.equals("2")) {
p.quests[p.getQuestArrayNumber(27)].decisionInt = 2;
p.quests[p.getQuestArrayNumber(27)].isComplete = true;
p.quests[p.getQuestArrayNumber(27)].currentIndex = 4;
break;
} else {
System.out.println("Read the dialogue again and enter a 1 or a 2");
}
} else if (p.quests[p.getQuestArrayNumber(27)].isComplete &&
p.quests[p.getQuestArrayNumber(27)].decisionInt == 2) {
System.out.println("\"Thanks for not taking me back man, that was a good decision\"");
break;
} else if (p.quests[p.getQuestArrayNumber(27)].decisionInt == 1) {
System.out.println("Here's where that talking cat used to sit...\n"
+ "I wonder where he is now...");
if(p.checkInv(13)) {
System.out.println("Oh wait he's in my inventory.");
}
}
break;
case 'p':
switch (mapNumber) {
case 27:
if (p.quests[p.getQuestArrayNumber(27)].decisionInt == 1 &&
!p.quests[p.getQuestArrayNumber(27)].isComplete) {
InventoryItems removedCat = new InventoryItems(13, "Marcy's Cat", p);
p.removeItem(removedCat, 1);
InventoryItems Hides = new InventoryItems(-1, "Hides", p);
p.addItem(Hides, 7);
p.quests[p.getQuestArrayNumber(27)].isComplete = true;
p.quests[p.getQuestArrayNumber(27)].currentIndex = 3;
break;
}
}
break;
case 'g':
Attributes wd = new Attributes(0, 0, 0, 0, 0, 0, 1, false);
InventoryItems Weed = new InventoryItems(13, "1g of Gilliweed", p, 2, wd);
if(p.pHasQuest(28) && (p.quests[p.getQuestArrayNumber(28)].currentIndex == 0 ||
p.quests[p.getQuestArrayNumber(28)].currentIndex == 1)) {
System.out.println("Aha! You find some Gilliweed would you like to pull it up?\n"
+ "Enter y if you want to");
if(in.nextLine().equals("y")) {
p.quests[p.getQuestArrayNumber(28)].increaseIndex();
p.addItem(Weed, 1);
crazyCookQuestShit(p);
}
} else {
System.out.println("Hmm some Gilliweed, this stuff smells kinda funny");
}
break;
case 'œ':
Attributes wd1 = new Attributes(0, 0, 0, 0, 0, 0, 1, false);
InventoryItems Weed1 = new InventoryItems(13, "1g of Gilliweed", p, 2, wd1);
if(MapBuilder.g28Flag) {
Player.removeItem(Weed1, 2);
}
if(Player.quests[Player.getQuestArrayNumber(28)].currentIndex == 2) {
Player.quests[Player.getQuestArrayNumber(28)].increaseIndex();
Player.quests[Player.getQuestArrayNumber(28)].isComplete = true;
break;
}
}
}
public static void checkQuestItem(InventoryItems item, int mapNumber, Player p){
switch (mapNumber) {
case 13: //Checking to see if the player is buying gilliweed in cook quest
if(p.pHasQuest(28) && (p.quests[p.getQuestArrayNumber(28)].currentIndex == 0 ||
p.quests[p.getQuestArrayNumber(28)].currentIndex == 1)) {
p.quests[p.getQuestArrayNumber(28)].increaseIndex();
}
}
}
public static void crazyCookQuestShit(Player p) {
if(!hasSeenShit) {
Scanner in = new Scanner(System.in);
for(int i = 0; i < 10; i++) {
try {
TimeUnit.SECONDS.sleep(1);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("You begin to pull it up...");
double j = Math.random();
if(j < .3) {
System.out.println("The world around you begins to collapse...");
} else if(Math.random() > .6) {
System.out.println(j * 3000);
}
}
for(int i = 0; i < 3; i++) {
for (int k = 0; k < 20; k++) {
for (int l = 0; l <= k; l++) {
try {
TimeUnit.MILLISECONDS.sleep(10);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.print("*");
}
System.out.println();
}
for (int k = 20; k > 0; k--) {
for (int l = 0; l <= k; l++) {
System.out.print("*");
}
System.out.println();
}
}
for (int k = 0; k < 20; k++) {
for (int l = 0; l <= k; l++) {
try {
TimeUnit.MILLISECONDS.sleep(10);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.print("*");
}
System.out.println();
}
for (int k = 0; k < 15; k++) {
try {
TimeUnit.MILLISECONDS.sleep(300);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("*************************************************************");
}
System.out.println("\n\n~You feel your eyes and skin begin to burn and smolder as an extremely\n"
+ "intense light begins to penetrate your very being. Your hair fries and the pain is insurmountable~\n"
+ "Press enter to continue.");
in.nextLine();
System.out.println("\n\n\n\n~All of a sudden it all vannishes, your wounds healed and the light subsides.~"
+ "\nPress enter to continue.\n");
in.nextLine();
System.out.println("~You are floating in an empty void of nothingness; you hear a voice.~");
System.out.println("Press enter to continue.");
in.nextLine();
System.out.println("\"You have been chosen by the gods to protect the land you live in called the Land of Gnar\"");
System.out.println("Press enter to continue.");
in.nextLine();
System.out.println("What in the actual fuck is going on?? Jesus H. Pogosticking Christ! You people nearly\n"
+ "fried my fucking brains out!!! Who's there? Let me out of here!");
System.out.println("Press enter to continue.");
in.nextLine();
System.out.println("\"We are the Gods of Gnar, we have chosen you to be the savior of our land\"");
System.out.println("\"For years we have looked over Gnar in all its glory, but our powers have been subverted and must be restored.\"");
System.out.println("Press enter to continue.");
in.nextLine();
System.out.println("\"Our powers are manifested in three items that have been taken over by demons that plague our land\"");
System.out.println("\"These items were taken by those who fear the Gnar, who stray away and live sedentary lives of void\"");
System.out.println("\"You must go out to the land and take back these items so that we again may have our powers back\"");
System.out.println("Press enter to continue.");
in.nextLine();
System.out.println("\"You must gather:\n1. The Brown Claw.\n2. Water from the mighty River of Jimothy"
+ "\n3. Slay the Boater of the Club and eat his heart\"");
System.out.println("Press enter to continue.");
in.nextLine();
System.out.println("Eat his heart? Are you serious???");
System.out.println("Press enter to continue.");
in.nextLine();
System.out.println("\"Yes\"");
System.out.println("Enter 1 if you wish to help the Gods, or 2 to refuse");
if (in.nextLine().equals("2")) {
System.out.println("\"Fine. You can just watch all of this dialogue again then.\"");
} else {
System.out.println("\"Very good, we will be in contact again once you have gathered the items\"");
Quests mainQuest = new Quests(1);
p.addQuest(mainQuest);
hasSeenShit = true;
}
}
}
}