-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGame.java
More file actions
774 lines (701 loc) · 39.9 KB
/
Game.java
File metadata and controls
774 lines (701 loc) · 39.9 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
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
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
import java.util.*;
//import java.io.IOException;
public class Game
{
public static void main(String[] args)
{
Random gen = new Random();
Scanner s = new Scanner(System.in);
int health = 100;
int points = 10;
String powerup = "None";
String [] power = new String [5];
while(health > 0){
//Random gen = new Random();
ln("Hi I'm very glad you want to play my game");
ln("What is your name?");
String name = s.next();
ln("Hi " + name + " Let's get started!");
wait(1000);
clear();
moveConfig("AN EXPERIMENT GONE WRONG", 65);
System.out.println("You are the child of two scientists. Like usual after dinner, you head to your room to sleep.");
System.out.println ("And like usual your parents are busy with their scientific research in the laboratory");
System.out.println("Just as you are about to fall asleep, you here a big boom underneath you");
System.out.println("You sit up straight in your bed and there is rumbling underneath you");
System.out.println("There is a flash of bright light and you fall through a portal that has opened up under your bed");
System.out.println("You tumble through the portal onto a cold surface of crystals and this is");
System.out.println("");
try
{
Thread.sleep(12000);
}
catch(InterruptedException ex)
{
Thread.currentThread().interrupt();
}
move("WHERE YOUR STORY BEGINS...");
int time = 2;
System.out.println("");
moveConfig(" ,.,.", time);
moveConfig(" ((((^))", time);
moveConfig(" d e_# b", time);
moveConfig(" \\._./", time);
moveConfig(" ,---i`-'i---.", time);
moveConfig(" / | `-' | |", time);
moveConfig(" |__| |__|", time);
moveConfig(" \\ | | |", time);
moveConfig(" \\______ | |", time);
moveConfig(" \\/ ) \\|| |", time);
moveConfig(" |- | |'//\"", time);
moveConfig(" |___|___|", time);
moveConfig(" | | |", time);
moveConfig(" ( | )", time);
moveConfig(" {_ |__|", time);
moveConfig(" (__|__}", time);
moveConfig(" _>= | =<_", time);
moveConfig(" (__._|_.__)", time);
moveConfig(" =/;;/-", time);
moveConfig(" +: //", time);
moveConfig(" /; /;", time);
moveConfig(" -X H.", time);
moveConfig(".//;;;:;;-, X= :+ .-;:=;:;%;.", time);
moveConfig("M- ,=;;;#:, ,:#;;:=, ,@", time);
moveConfig(":% :%.=/++++/=.$= %=", time);
moveConfig(" ,%; %/:+/;,,/++:+/ ;+.", time);
moveConfig(" ,+/. ,;@+, ,%H;, ,/+,", time);
moveConfig(" ;+;;/= @. .H##X -X :///+;", time);
moveConfig(" ;+=;;;.@, .XM@$. =X.//;=%/.", time);
moveConfig(" ,;: :@%= =$H: .+%-", time);
moveConfig(",%= %;-///==///-// =%,", time);
moveConfig(";+ :%-;;;;;;;;-X- +:", time);
moveConfig("@- .-;;;;M- =M/;;;-. -X", time);
moveConfig(" :;;::;;-. %- :+ ,-;;-;:==", time);
moveConfig(" ,X H.", time);
moveConfig(" ;/ %=", time);
moveConfig(" // +;", time);
moveConfig(" ,////,", time);
wait(1000);
clear();
//Scene 1
getInfo(health, points, "None");
String answer1;
move("This is the first start of your journey. You are in a narrow passageway lined with crystals and");
move(" there is a small door wooden door that leads to the end. You also notice that there is a red switch");
move(" next to that door. Do you decide to press the red switch next to the door or go into to the wooden door ");
move(" directly? Answer \"press\" or \"go\"");
answer1 = s.next();
if(answer1.equalsIgnoreCase("press")){
move("A trapdoor opens up underneath you and you fall");
move("over 50 feet. You lose 50 health");
health = health - 50;
getInfo(health, points, "None");
}else if(answer1.equalsIgnoreCase("go")){
move("A stoney path is lit up by torches going downhill. After walking 100 feet");
move("You find a treasure chest of a 50 coins and continue to walk for another 100 feet");
points = points + 50;
getInfo(health, points, &
E880
quot;None");
}else{
while(answer1 != "press" || answer1 != "go"){
ln("Invalid. Try Again. Answer \"press\" or \"go\"");
answer1 = s.next();
if(answer1.equalsIgnoreCase("press")){
move("A trapdoor opens up underneath you and you fall");
move("over 50 feet. You lose 50 health");
health = health - 50;
getInfo(health, points, "None");
break;
}else if(answer1.equalsIgnoreCase("go")){
move("A stoney path is lit up by torches going downhill. After walking 100 feet");
move("You find a treasure chest of a 50 coins and continue to walk for another 100 feet");
points = points + 50;
getInfo(health, points, "None");
break;
}
}
}
wait(500);
clear();
move("");
//Scene 2
getInfo(health, points, "None");
String answer2;
move("You are now in a tall cold circular room and you see two corridors ");
move("One emits a neon blue glow and the other one emits a fiery red light");
move("Do you decide to go into the blue or red corridor? ");
move(" Answer \"red\" or \"blue\"");
answer2 = s.next();
if(answer2.equalsIgnoreCase("red")){
move("A small floating wizard appears before you and will guide you through your journey");
move("The points system allows you to unlock the level to the final castle ");
move("You will need a minimum of 300 points. Here is a gift of points to you.");
int pointsadd = gen.nextInt(50) + 1;
points = points + pointsadd;
move("You get " + pointsadd + " points.");
getInfo(health, points, "None");
}else if(answer2.equalsIgnoreCase("blue")){
move("A small floating wizard appears before you and will guide you through your journey");
move("The health bar must stay above 0. Once it reaches 0 the game ends");
move("Here is a gift of health to you.");
int healthadd = gen.nextInt(30) + 1;
move("You get " + healthadd + " health");
health = health + healthadd;
getInfo(health, points, "None");
}else{
while(answer2 != "red" || answer2 != "blue"){
ln("Invalid. Try Again. Answer \"red\" or \"blue\"");
answer2 = s.next();
if(answer2.equalsIgnoreCase("red")){
move("A small floating wizard appears before you and will guide you through your journey");
move("The points system allows you to unlock the level to the final castle ");
move("You will need a minimum of 500 points. Here is a gift of points to you.");
int pointsadd = gen.nextInt(50) + 1;
move("You get " + pointsadd + " points.");
points = points + pointsadd;
getInfo(health, points, "None");
break;
}else if(answer2.equalsIgnoreCase("blue")){
move("A small floating wizard appears before you and will guide you through your journey");
move("The health bar must stay above 0. You had 100 health to start with. Once it reaches 0 the game ends");
move("Here is a gift of health to you.");
int healthadd = gen.nextInt(50) + 1;
move("You get " + healthadd + " health");
health = health + healthadd;
getInfo(health, points, "None");
break;
}
}
}
move("");
wait(500);
clear();
move("");
//Scene 3-----------------------------------
getInfo(health, points, "None");
String answer3;
// move("After you continue walking past the corridor");
move("You come out into a huge new world. It is filled with flowers and an open meadow");
move("Further into the distance, there is a huge castle with stone walls and covered by a dead forest and fogged trees");
move("Wizard: Welcome to the realm of Gapel. This once peaceful land is now encroached by an evil dark lord named Dark Master");
move("Wizard: A human was prophesized to save our wizard and sorcerer kind and now you are chosen to defeat the evil master.");
move("Wizard: But you need some food first");
move("There are some red berries in a bush, a round doughy stone, and a blue apple on the ground next to that.");
moveConfig(" ,.,.", time);
moveConfig(" ((((^))", time);
moveConfig(" d e_# b", time);
moveConfig(" \\._./", time);
moveConfig(" ,---i`-'i---.", time);
moveConfig(" / | `-' | |", time);
moveConfig(" |__| |__|", time);
moveConfig(" \\ | | |", time);
moveConfig(" \\______ | |", time);
moveConfig(" \\/ ) \\|| |", time);
moveConfig(" |- | |'//\"", time);
moveConfig(" |___|___|", time);
moveConfig(" | | | _ \'-_,# \\ | / ,--./,-.", time);
moveConfig(" ( | ) _\'--','`| '-.;;;.- / # \\", time);
moveConfig(" {_ |__| \\Berries/ -==;Stone==- | apple |", time);
moveConfig(" (__|__} \\`---` / .-';;;'-. \\ /", time);
moveConfig(" _>= | =<_ --()------", time);
moveConfig(" (__._|_.__)", time);
moveConfig("_______________________________________________________________________________________", time);
move("Which item do you choose? Answer \"berries\", \"stone\", or \"apple\"");
answer3 = s.next();
if(answer3.equalsIgnoreCase("berries")){
move("You ate berries that gave you strength and were delicious to eat");
// move("The points system allows you to unlock the level to the final castle ");
move("You get 30 health and 40 points");
points = points + 40;
health = health + 30;
getInfo(health, points, "None");
}else if(answer3.equalsIgnoreCase("stone")){
move("The stone was not food but a powerup that shields you from some of Dark Master's moves in the final battle");
move("You now have the shield powerup");
powerup = "Shield";
power[1] = "shield";
getInfo(health, points, powerup);
}else if(answer3.equalsIgnoreCase("apple")){
move("Oh no! That apple had been cursed by the dark master with a spell that causes you to faint");
move("This debalitating spell causes you to lose 25 health");
health = health - 25;
getInfo(health, points, powerup);
}
else{
while(answer3 != "berries" || answer3 != "stone" || answer3 != "apple"){
ln("Invalid. Try Again. Answer \"berries\" or \"stone\" or \"apple\"");
answer3 = s.next();
if(answer3.equalsIgnoreCase("berries")){
move("You ate berries that gave you strength and were delicious to eat");
// move("The points system allows you to unlock the level to the final castle ");
move("You get 30 health and 40 points");
points = points + 40;
health = health + 30;
getInfo(health, points, "None");
break;
}else if(answer3.equalsIgnoreCase("stone")){
move("The stone was not food but a powerup that shields you from some of Dark Master's moves in the final battle");
move("You now have the shield powerup");
powerup = "Shield";
power[1] = "shield";
getInfo(health, points, powerup);
break;
}else if(answer3.equalsIgnoreCase("apple")){
move("Oh no! That apple had been cursed by the dark master with a spell that causes you to faint");
move("This debalitating spell causes you to lose 25 health");
health = health - 25;
getInfo(health, points, powerup);
break;
}
}
}
move("");
wait(500);
clear();
move("");
//Scene 4----------------
getInfo(health, points, powerup);
String answer4;
move("After eating, you are in a huge field of tall grasses. The forest, called Door of Worlds, leading to the castle approaches but you can't see anything beyond the grass");
move("You continue tred on in the muddy ground but suddenly get stuck. Then out of nowhere one of Dark Master's minions come flying out of nowhere");
move("It is a winged lizard, the size of a dog, and it has red eyes and a red body. It's highly sharp claws can rip through anything and is preparing to attack while your stuck");
move("Wizard: Such winged demons called Landers have been set out to counter any resistance to his rule.");
move("Wizard: Us Wizards and Sorcerers have tried but our build and nature is very weak to combat the landers. ");
move("Wizard: You must defeat this Lander, he is the first of many more. Their weakness is their speed");
move("Do you try to attack, defend, or talk to the Lander? ");
answer4 = s.next();
if(answer4.equalsIgnoreCase("attack")){
move("You punch the Lander and grab hold of one of his wings");
move("The Lander tries to fly away and pulls you out of the grass. You can now proceed with a reward of 100 points");
points = points + 100;
getInfo(health, points, powerup);
}else if(answer4.equalsIgnoreCase("defend")){
move("Oh No! The Lander dives straight at you and knocks you off balance");
move("But after diving, the Lander swoops right past you as you dodge him");
move("You get 50 points but lose 10 health;");
points = points + 50;
health = health - 10;
}else if(answer4.equalsIgnoreCase("talk")){
move("This was not a good descision considering the agression of the Lander");
move("Right as you are about to move your mouth.the Lander dives i
4E3F
n and pushes you down");
move("You lose 45 health");
health = health - 45;
getInfo(health, points, powerup);
}
else{
while(answer4 != "attack" || answer4 != "defend" || answer4 != "talk"){
ln("Invalid. Try Again. Answer \"attack\" or \"defend\" or \"talk\"");
answer4 = s.next();
if(answer3.equalsIgnoreCase("attack")){
move("You punch the Lander and grab hold of one of his wings");
move("The Lander tries to fly away and pulls you out of the grass. You can now proceed with a reward of 100 points");
points = points + 100;
getInfo(health, points, powerup);
break;
}else if(answer4.equalsIgnoreCase("defend")){
move("Oh No! The Lander dives straight at you and knocks you off balance");
move("But after diving, the Lander swoops right past you as you dodge him");
move("You get 50 points but lose 10 health;");
points = points + 50;
health = health - 10;
break;
}else if(answer4.equalsIgnoreCase("talk")){
move("This was not a good descision considering the agression of the Lander");
move("Right as you are about to move your mouth.the Lander dives in and pushes you down");
move("You lose 45 health");
health = health - 45;
getInfo(health, points, powerup);
break;
}
}
}
move("");
wait(500);
clear();
move("");
//Scene 5----------------
getInfo(health, points, powerup);
String answer5;
move("You run away from the field of tall grasses and head towards the Door of Worlds forest ");
move("But unfortunately there is a river blocking your path");
move("On the river bank there is a hut, and few meters beyond that is a docked unattended boat");
move("Do you choose to go in the hut or in the boat? Answer \"hut\" or \"boat\"");
moveConfig(" |",time);
moveConfig(" \\ - /", time);
moveConfig(" -= (-) =-", time);
moveConfig(" .\\/. / \\", time);
moveConfig(".\\\\//o\\\\ ,\\/. | ", time);
moveConfig("//o\\\\|,\\/. ,.,., ,\\/. ,\\//o\\\\ |\\", time);
moveConfig(" | |//o\\ /###/#\\ //o\\ /o\\\\| /| \\", time);
moveConfig("^^|^^|^~|^^^|' '|:|^^^|^^^^^|^^|^^^\"\"\"\"\"\"\"\"(\"~~~~~~~~/_|__\\~~~~~~~~~~", time);
moveConfig(" .|'' . | '''\"\"'\"''. |`===`|'' '\"\" \"\" \" (\" ~~~~ ~ ~======~~ ~~ ~", time);
moveConfig(" ^^^^ ^^^ ^ ^^^ ^^^^ ^^^ ^^ ^^ \"\" \"\"\"( \" ~~~~~~ ~~~~~ ~~~ ~", time);
answer5 = s.next();
if(answer5.equalsIgnoreCase("hut")){
move("You go into a hut and you find a powerup. This powerup is in a vial labeled Speed and you drink the potion ");
move("While the potion gives you a speed boost for the final battle it also takes away health from you");
move("You lose 15 health, but you cross the river and reach the edge of the Door of Worlds the huge spooky forest ");
health = health - 15;
powerup = "Speed";
boolean sped = true;
power[2] = "speed";
}else if(answer5.equalsIgnoreCase("boat")){
move("You rush into the boat and start to paddle towards the other side");
move("Immediatley small waves hit the boat causing to disintegrate");
//move("But your expert maneuvering skills allow you to make it safely to the other side");
move("Your boat diassambles right as you reach the edge and your feet get wet");
move("You gain 50 points");
points = points + 50;
}else{
while(answer5 != "hut" || answer5 != "boat"){
ln("Invalid. Try Again. Answer \"hut\" or \"boat\"");
answer5 = s.next();
if(answer5.equalsIgnoreCase("boat")){
move("You go into a hut and you find a powerup. This powerup is in a vial labeled Speed and you drink the potion ");
move("While the potion gives you a speed boost for the final battle it also takes away health from you");
move("You lose 15 health");
health = health - 15;
powerup = "Speed";
power [2] = "speed";
break;
}else if(answer5.equalsIgnoreCase("hut")){
move("You rush into the boat and start to paddle towards the other side");
move("Immediatley small waves hit the boat causing it to disintegrate");
//move("But your expert maneuvering skills allow you to make it safely to the other side");
move("Your boat diassambles right as you reach the edge and your feet get wet");
move("You gain 50 points");
points = points + 50;
break;
}
}
}
move("");
wait(500);
clear();
move("");
//Scene 6-----------
getInfo(health, points, powerup);
move("Wizard: Welcome to........the Door of Worlds");
moveConfig(" .__ ._ \\_", time);
moveConfig(" _, _. ' \\/ \\.- /", time);
moveConfig(" .-\"\"\"\"-. \\. ' \\`. || \\.-' /", time);
moveConfig(" F Y .-.`-( _/\\ V/ \\\\//,-' >-' ._,", time);
moveConfig(" F Y .__/ `. \\. ' J ) ./ / __._/", time);
moveConfig(" J \\, I ' _/ \\ \\ | | / / .'-'.-' `._,", time);
moveConfig(" ( L \\_.--.| \\_. ' .___ `\\: | / .--'.-'\" \\", time);
moveConfig(" \\ '\\ . L / \\\\/ ._/`-.` \\ .'.' .'---./__ '", time);
moveConfig(" \\__ '\\ ) \\._/ `-.__. ` \\\\_. ' .---. \\ / / , ` `", time);
moveConfig(" --' \\\\ ): // \\, `-.`__.' `- \\ / / _/-.---.__.- .", time);
moveConfig(" _.-`.'/ /'\\_, ._ >--.-\"\"'____.--\"`_ ' /.'..' \\ \\ _/`", time);
moveConfig(" _ .---._\\ \\'/ '__./__.-.. / .-|( x_.-'___ | :' / _..---_' \\", time);
moveConfig(" .:' /`\\ `. `..'.--'\\ /.' /`-`._ `-,' ` ' I '_.--'__--..___.--._.-", time);
moveConfig(" ` `. `\\/'/ _. _.-' _.____./ .-.--\"\"-. .-\" ' _..-.---' \\", time);
moveConfig(" -._ .--.\\ / /-./ / .---'-//.___. .-' \\__ .--. ` `. '`-", time);
moveConfig(" ,--'/.-. ^. .-.--. ` _/ _// ./ _.. .' `. \\ \\ |_.", time);
moveConfig(" /' | >. ' | \\._.- ' _..' `.' . `. ) | |\\ `", time);
moveConfig(" ./ \\ \\' ) c| / \\ \\_.. .--' ,\\ \\_/` : ) (`-. `.|`\\\\", time);
moveConfig(" \\' / ,-. | ` ./` ._/ `\\\\'.--.,-(( `.`.__ | _/ \\ |) `--._/`", time);
moveConfig("______'\\ | < __________ //' // _) )/-._`. (,-') ) / \\_. /\\. _____", time);
moveConfig("a:f | | .__./ // '\\ |// `.\\ '\\ ( ( <` ._ '", time);
moveConfig(" > | _. / ..-\\ _ _/ \\_. \\ `\\ \\_ `---.-'__", time);
moveConfig(" . / `- _.' / ` _/| J /` `-,,-----.`-.", time);
moveConfig(" ' .:' '` ' < ` f I // `\\_,", time);
moveConfig(" ' \\. J I/\\_. ./", time);
moveConfig(" __/ `: I .: K ` `", time);
moveConfig(" \\/ ) `, J L", time);
moveConfig(" )_(_ . F .-' J", time);
moveConfig(" / `. . I (. . I _.-.._", time);
moveConfig(" ' <' \\ ) _.---.J/ :' L -'", time);
moveConfig(" .:. \\. _.->/ _.-'_.) ` `-.`---.,_.", time);
moveConfig(":< ( \\ .--\"\" .F' J) `.`L.__`-.___", time);
moveConfig(".: |-'\\_.| Y ..Z )) `--' `-", time);
moveConfig(". ) | > : . ' :'", time);
moveConfig(" / ) L_J .x,.", time);
moveConfig(" L_J ., .:<.,", time);
moveConfig(" .'` ` :J.,`", time);
wait(100);
move("Wizard: You will find a swarm of Landers and a pool of lava that you will have to cross");
move("Wizard: Stay safe human...Stay safe");
move("You venture deeper into the forest and cross over dead branches");
move("You pass by many dead trees and stumble upon an invisibility powerup");
move("Do you take it?");
String p = s.next();
if(p.equalsIgnoreCase("Yes")){
powerup = "Invisibility";
boolean invis = true;
}
//move("Your Powerups: Invisibility: " + invis + " ");
move("The swarm of Landers are approaching. Here you will quickly have to combat many landers in a series of attacks");
move("Let's Begin");
String [] landers;
String ansStreak;
String [] landers1 = {"Agility", "Flight", "Speed", "Punch", "Vision", "Reasoning", "Reflexes", "Speed", "Vision", "Talons"};
for(int i = 0; i < 10; i++){
move("Lander " + (i+1) + ": Weakness - " + landers1[i]);
move("Do you choose to fight, defend, duck, or talk? Answer \"fight\", \"defend\", \"duck\" or \"talk\" " );
ansStreak = s.next();
if(ansStreak.equalsIgnoreCase("fight") && (landers1[i].equalsIgnoreCase("Speed")|| landers1[i].equalsIgnoreCase("Talons") || landers1[i].equalsIgnoreCase("Agility") || landers1[i].equalsIgnoreCase("Flight") )){
move("You beat Lander " + (i + 1) + ". You get 75 points and 35 health");
points = points + 75;
health += 35;
getInfo(health, points, powerup);
wait(100);
}else if(ansStreak.equalsIgnoreCase("fight")){
move("You beat Lander " + (i + 1) + ", but with great difficulty. You get 50 points and lose 15 health");
points = points + 50;
health -= 15;
getInfo(health, points, powerup);
wait(100);
}
if(ansStreak.equalsIgnoreCase("Defend") && (landers1[i].equalsIgnoreCase("Vision") || landers1[i].equalsIgnoreCase("Reflexes") || landers1[i].equalsIgnoreCase("Punch") )){
move("You beat Lander " + (i + 1) + ". You get 75 points and 50 health");
health += 50;
points = points + 75;
getInfo(health, points, powerup);
wait(100);
}else if(ansStreak.equalsIgnoreCase("Defend")){
move("You lost to Lander " + (i + 1) + ", but with great difficulty. You get 30 points and lose 10 health");
points = points + 30;
health -= 10;
getInfo(health, points, powerup);
wait(100);
}
if(ansStreak.equalsIgnoreCase("Duck") && (landers1[i].equalsIgnoreCase("Reflexes") || landers1[i].equalsIgnoreCase("Vision") || landers1[i].equalsIgnoreCase("Talons") )){
move("You beat Lander " + (i + 1) + ". You get 75 points and 50 health");
health = health + 50;
points = points + 75;
getInfo(health, points, powerup);
wait(100);
}else if(ansStreak.equalsIgnoreCase("Duck")){
move("You lost to Lander " + (i + 1) + ", but with great difficulty. You get 10 points and lose 20 health");
points = points + 10;
health -= 20;
getInfo(health, points, powerup);
wait(100);
}
if(ansStreak.equalsIgnoreCase("Talk") && (landers1[i].equalsIgnoreCase("Reasoning"))){
move("You beat Lander " + (i + 1) + ". You get 60 points");
points = points + 75;
getInfo(health, points, powerup);
wait(100);
}else if(ansStreak.equalsIgnoreCase("Talk")){
move("You lost to Lander " + (i + 1) + " with great difficulty. You get 10 points and lose 25 health");
points = points + 10;
health -= 25;
getInfo(health, points, powerup);
wait(100);
}
//getInfo(health, points, powerup);
wait(500);
clear();
}
//Scene 8--------
getInfo(health, points, powerup);
String answer8;
move("Wizard: You made it. Now how do you wish to cross the lava lake? Answer \"boat\" or \"zipline\"");
answer8 = s.next();
if(answer8.equalsIgnoreCase("boat")){
move("The boat melts in the lava lake and you barely manage to jump across with a loss of 10 health");
health = health - 10;
getInfo(health, points, powerup);
}else if(answer8.equalsIgnoreCase("zipline")){
move("You safely reach across. You get 100 points");
points = points + 100;
getInfo(health, points, powerup);
}
wait(500);
clear();
//Scene Final Battle
getInfo(health, points, powerup);
move("You have reached the final castle and must battle the Dark Master");
move("Wizard: Go in the castle and save Gapel!");
move("You go into the castle and you see the Dark Master in the center of a room of dark blue torches");
move("Dark Master: I've been expecting you. We must battle for control of this realm");
move("Dark Master: I also have the portal you desire");
move("Say something back to the Dark Master >>>");
String dialogue = s.next();
move("Fine Let's Begin");
move("You find a health boost of 150");
health = health + 150;
moveConfig(" , , /\\ /\\", time);
moveConfig(" /( /\\ )\\ _\\ \\_/ /_", time);
moveConfig(" |\\_||_/| < \\_ _/ >", time);
moveConfig(" \\______/ \\|0 0|/", time);
moveConfig(" _\\/_ _(_ ^ _)_", time);
moveConfig(" ( () ) /`\\|V\"\"\"V|/`\\", time);
moveConfig(" {} \\ \\_____/ /", time);
moveConfig(" () /\\ )=( /\\", time);
moveConfig(" {} / \\_/\\=/\\_/ \\", time);
move("Make your moves...Get Ready...");
int dh = 350;
String finalb;
int at;
int st;
if(points > 300){
while(dh > 0){
move("Make your move >>>");
move("Your Moves: Attack, Defend, Powerup");
finalb = s.next();
if(finalb.equalsIgnoreCase("Attack")){
at = gen.nextInt(40) + 1;
move("You: You did " + at + " damage to the Dark Master");
st = gen.nextInt(25) + 1;
move("Dark Master: He did " + st + " damage to you");
dh = dh - at;
health = health - st;
move("Dark Master Health: " + dh);
getInfo(health, points, powerup);
}else if(finalb.equalsIgnoreCase("Defend")){
st = gen.nextInt(15) + 1;
move("You blocked his move and only took " + st + " damage");
health = health - st;
at = gen.nextInt(25) + 1;
move("You dealt " + at + " damage");
dh = dh - at;
move("You also get 5 health");
health = health + 5;
move("Dark Master Health: " + dh);
getInfo(health, points, powerup);
}else if(finalb.equalsIgnoreCase("Powerup")){
if(powerup.equalsIgnoreCase("shield")){
move("You get 50 health");
health = health + 50;
powerup = "None";
getInfo(health, points, powerup);
}else if(powerup.equalsIgnoreCase("speed")){
move("You do 40 damage and get 30 health");
health = health + 30;
dh = dh - 40;
powerup = "None";
}else if(powerup.equalsIgnoreCase("invisibility")){
move("With invisibility, you creep past him and attack. You do 60 damage");
dh = dh - 60;
move("Dark Master Health: " + dh);
powerup = "None";
getInfo(health, points, powerup);
}else{
move("No powerup");
}
}
}
move("Finally you reach the portal and your back in your bedroom.");
move("You fall right back to asleep like it was a dream all along");
move("The End. Thank You For Playing!");
wait(10000);
System.exit(0);
}else{
move("You get a 100 points");
points = points + 100;
while(dh > 350){
move("Make your move >>>");
finalb = s.next();
move("Your Move: Attack, Defend, Powerup");
if(finalb.equalsIgnoreCase("Attack")){
at = gen.nextInt(40) + 1;
move("You: You did " + at + " to the Dark Master");
st = gen.nextInt(25) + 1;
move("Dark Master: He did " + st + " damage to you");
dh = dh - at;
health = health - st;
move("Dark Master Health: " + dh);
getInfo(health, points, powerup);
}else if(finalb.equalsIgnoreCase("Defend")){
st = gen.nextInt(15) + 1;
move("You blocked his move and only took " + st + " damage");
health = health - st;
at = gen.nextInt(25) + 1;
move("You dealt " + at + " damage");
dh = dh - at;
move("You also get 5 health");
health = health + 5;
move("Dark Master Health: " + dh);
getInfo(health, points, powerup);
}else if(finalb.equalsIgnoreCase("Powerup")){
if(powerup.equalsIgnoreCase("shield")){
move("You get 50 health");
health = health + 50;
powerup = "None";
getInfo(health, points, powerup);
}else if(powerup.equalsIgnoreCase("speed")){
move("You do 40 damage and get 30 health");
health = health + 30;
dh = dh - 40;
powerup = "None";
}else if(powerup.equalsIgnoreCase("invisibility")){
move("You do 60 damage");
dh = dh - 60;
move("Dark Master Health: " + dh);
powerup = "None";
getInfo(health, points, powerup);
}else{
move("No powerup");
}
}
}
move("Finally you reach the portal and your back in your bedroom.");
move("You fall right back to asleep like it was a dream all along");
}
}//while
move("You Lost! Better luck next time");
}
public static void ln(String l){
System.out.println(l);
}
public static void print(String l){
System.out.print(l);
}
public static void feed(){
System.out.print("\n");
}
static char test [] = new char[100000];
public static void move(String l){
test = l.toCharArray();
for(int k = 0; k < l.length(); k++){
System.out.print(test[k]);
try
{
Thread.sleep(40);
}
catch(InterruptedException ex)
{
Thread.currentThread().interrupt();
}
}
System.out.println("");
}
public static void moveConfig(String l, int q){
test = l.toCharArray();
for(int k = 0; k < l.length(); k++){
System.out.print(test[k]);
try
{
Thread.sleep(q);
}
catch(InterruptedException ex)
{
Thread.currentThread().interrupt();
}
}
System.out.println("");
}
public static void clear(){
System.out.print("\u000c");
}
public static void wait(int q){
try
{
Thread.sleep(1500 + q);
}
catch(InterruptedException ex)
{
Thread.currentThread().interrupt();
}
}
static int Config = 10;
public static void getInfo(int health, int points, String powerup){
ln("");
moveConfig("Health: " + health, Config);
moveConfig("points: " + points, 10);
moveConfig("Powerup: " + powerup, 10);
ln("");
}
}