-
Notifications
You must be signed in to change notification settings - Fork 0
/
TrisenaiiClass.java
1991 lines (1986 loc) · 88.6 KB
/
TrisenaiiClass.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
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
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package trisenaii;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.FileNotFoundException;
import java.lang.Thread;
import java.util.Scanner;
import java.util.Random;
class pubstatints {
public static String invitems;
public static String currentweapon;
public static int location;
public static boolean successornot;
}
class createFile extends Thread {
public void run() {
File inv = new File("inventory.txt");
File weapon = new File("weapon.txt");
try {
if (inv.exists() == false) {
inv.createNewFile();
}
if (weapon.exists() == false) {
weapon.createNewFile();
}
if (inv.exists() && weapon.exists()) {
pubstatints.successornot = true;
} else {
pubstatints.successornot = false;
}
} catch (IOException e) {}
}
/*
* String heavystick = "Heavy stick"; String policebaton = "Police baton";
* String wackywhacker = "Wacky whacker"; String velociraptortooth =
* "Velociraptor tooth"; String woodensword = "Wooden sword"; String ironsword =
* "Iron sword"; String streetmagicianwand = "Street magician wand"; String
* magestaff = "Mage staff"; String houdinisscepter = "Houdini's scepter";
* String damagedcable = "Damaged cable"; String lightningrod = "Lightning rod";
* String zeuslightningbolt = "Zeus' lightning bolt"; try { FileWriter newWriter
* = new FileWriter("inventory.txt"); newWriter.close(); } catch (Exception e)
* {}
*/
}
class menu extends Thread {
public void run() {
Scanner anytimeObj = new Scanner(System.in);
for (int i = 10; i > 0;) {
String typeanytime = anytimeObj.nextLine();
if (typeanytime.equals("Quit")) {
break;
}
if (typeanytime.equals("Menu")) {
System.out.println("\n");
System.out.println("Menu:");
try {
File inv = new File("inventory.txt");
Scanner newReader = new Scanner(inv);
File weapon = new File("weapon.txt");
Scanner anothernewReader = new Scanner(weapon);
System.out.println("Items in inventory:");
while (newReader.hasNextLine()) {
pubstatints.invitems = newReader.nextLine();
System.out.println(pubstatints.invitems);
}
newReader.close();
System.out.println("Current weapon:");
while (anothernewReader.hasNextLine()) {
pubstatints.currentweapon = anothernewReader.nextLine();
System.out.println(pubstatints.currentweapon);
}
anothernewReader.close();
switch (pubstatints.location) {
case 0:
System.out.println("Location: Outside your house (Tutorial).");
break;
case 1:
System.out.println("Location: Reo-Nonepre.");
break;
case 2:
System.out.println("Location: Wilderness.");
break;
case 3:
System.out.println("Location: Yevvinir.");
break;
case 4:
System.out.println("Location: Dareuth.");
break;
}
} catch (FileNotFoundException e) {
}
} else {
System.out.println("Error: User input not recognized. Do you mean: 'Menu'?");
}
} // for ends here
}
}
public class TrisenaiiClass extends Thread {
public static void main(String[] args) throws Exception {
{
File inv = new File("inventory.txt");
File weapon = new File("weapon.txt");
inv.delete();
weapon.delete();
}
createFile cf = new createFile();
menu mnu = new menu();
cf.start();
System.out.print("\033[H\033[2J");
System.out.print("Loading...");
int dotcount = 0;
for (;!pubstatints.successornot == true;) {
Thread.sleep(1500);
System.out.print(".");
dotcount = dotcount + 1;
if (dotcount > 10) {
System.out.println("Oops, something went wrong. The game's taking too much time to load. Please try restarting the program.");
Thread.sleep(999999999);
}
}
System.out.println();
Thread.sleep(1000);
System.out.print("\033[H\033[2J");
System.out.println(" __ __ __ __ ___ ___ __ _____ ___ _____ __ __ __ ___ __ __ ___ ___ ___ ");
Thread.sleep(800);
System.out.println("/ / /\\ \\ \\/__\\/ / / __\\ /___\\/\\/\\ /__\\ /__ \\/___\\ /__ \\/\\ /\\/__\\ / / /\\ \\ \\/___\\/__\\ / / / \\ /___\\/ __\\");
Thread.sleep(800);
System.out.println("\\ \\/ \\/ /_\\ / / / / // // \\ /_\\ / /\\// // / /\\/ /_/ /_\\ \\ \\/ \\/ // // \\// / / / /\\ / // // _\\ ");
Thread.sleep(800);
System.out.println(" \\ /\\ //__/ /___/ /___/ \\_// /\\/\\ \\//__ / / / \\_// / / / __ //__ \\ /\\ / \\_// _ \\/ /___/ /_// / \\_// / ");
Thread.sleep(800);
System.out.println(" \\/ \\/\\__/\\____/\\____/\\___/\\/ \\/\\__/ \\/ \\___/ \\/ \\/ /_/\\__/ \\/ \\/\\___/\\/ \\_/\\____/___,' \\___/\\/ ");
Thread.sleep(4000);
System.out.println(" _____ __ _____ __ __ __ _ _____ _____ ");
System.out.println("/__ \\/__\\ \\_ \\/ _\\ /__\\/\\ \\ \\/_\\ \\_ \\\\_ \\");
System.out.println(" / /\\/ \\// / /\\/\\ \\ /_\\ / \\/ //_\\\\ / /\\/ / /\\/");
System.out.println(" / / / _ \\/\\/ /_ _\\ \\//__/ /\\ / _ \\/\\/ /_/\\/ /_ ");
System.out.println(" \\/ \\/ \\_/\\____/ \\__/\\__/\\_\\ \\/\\_/ \\_/\\____/\\____/ ");
Scanner newObj = new Scanner(System.in);
System.out.println();
System.out.println();
System.out.println();
System.out.println();
System.out.println(" Type 'Play' to continue.");
String start = newObj.nextLine();
String Play = "Play";
if (start.equals(Play)) {
System.out.print("\033[H\033[2J");
System.out.println("You wake to the sound of someone banging on your door.");
pubstatints.location = 0;
} else {
while (!start.equals(Play)) {
System.out.println("Error: User input not recognized. Try again?");
start = newObj.nextLine();
}
System.out.print("\033[H\033[2J");
System.out.println("You wake to the sound of someone banging on your door.");
pubstatints.location = 0;
}
Thread.sleep(3000);
System.out.println("You yawn, stretch, get dressed, and open the door.");
Thread.sleep(4500);
System.out.println("Whoever was knocking on your door is gone. There is a note taped to the door, however.");
Thread.sleep(4500);
System.out.println("The note reads: ATTENTION, CITIZEN. You've been awoken at this untimely hour to report immediately at the town hall for a town meeting. Make haste!");
Thread.sleep(8000);
System.out.println("There's something on the back, too. You flip the paper over. The back reads: TUTORIAL TIME!");
Thread.sleep(4500);
System.out.println("Betcha didn't see that coming.");
Thread.sleep(3000);
System.out.println("Okay, let's just get this over with. We'll start off with the different types of text you'll see displayed.");
Thread.sleep(6000);
System.out.println("When you see text like this sentence, it means I, the narrator, am either telling you something or am describing you.");
Thread.sleep(4500);
System.out.println("Example 1:");
Thread.sleep(4000);
System.out.println("You grab the sword.");
Thread.sleep(4000);
System.out.println("Example 2:");
Thread.sleep(4000);
System.out.println("I don't think you have a good chance of survival.");
Thread.sleep(4000);
System.out.println("(The example ended. This and the stuff that I'll say after isn't part of it.)");
Thread.sleep(4500);
System.out.println("When NPCs talk, it will be a bit different from when I'm talking to you. First off, you'll be able to tell who is talking by their name, which will be in front of whatever they say. Also, everything that they say will be enclosed in brackets. P.S. some people won't have names, they'll just be called 'Man' or something.");
Thread.sleep(7000);
System.out.println("Example:");
Thread.sleep(4000);
System.out.println("Farmer Mike: <bruh.>");
Thread.sleep(4000);
System.out.println("Now let's get started on decisions. Throughout the game, you'll be presented with a few choices about what to do in a situation. You'll have to type in the choice that you choose. When you have options to talk to NPCs, to get out of the situation, type 'Walk' to walk away.");
Thread.sleep(6000);
System.out.println("Example:");
Thread.sleep(4000);
System.out.println("You arrive at Berryblood Street, Lichalade. Looks like there's a few people about.");
Thread.sleep(4000);
System.out.println(" Actions:");
System.out.println("Talk to man Talk to other man Talk to woman Talk to other woman Walk");
boolean done = false;
Scanner tutorialObj = new Scanner(System.in);
while (done == false) {
String tutorialexample = tutorialObj.nextLine();
if (tutorialexample.equals("Walk")) { // walk
System.out.println("You walk past the people.");
done = true;
} else if (tutorialexample.equals("Talk to man")) {// man
System.out.println("Man: <Welcome, stranger!>");
} else if (tutorialexample.equals("Talk to other man")) {// talktootherman
System.out.println("Other man: <What 'r you lookin' at?>");
} else if (tutorialexample.equals("Talk to woman")) {// woman
System.out.println("Woman: <Nice weather, isn't it?>");
} else if (tutorialexample.equals("Talk to other woman")) {// otherwoman
System.out.println("Other woman: <Tutorials sure are stupid, aren't they? They always treat you like you're five and it's your first videogame.>");
} else { // wrong
System.out.println("Error: User input not recognized. Try again?");
System.out.println(" Actions:");
System.out.println("Talk to man Talk to other man Talk to woman Talk to other woman Walk");
}
}
Thread.sleep(4000);
System.out.println("Let's talk about the menu now. The menu contains important information that you may want to know about your character. For example, if you want to check to see what's in your inventory, you can type in 'Menu' to go to the menu and see what's in it. To close the menu, just type in 'Quit'. You can open the menu at any point in the game. Now, you try opening the menu.");
mnu.start();
mnu.join();
System.out.println("Finally, we arrive at the fun part: BATTLES! To discuss that, however, we have to go over weapons. All weapons have a primary attack and a secondary attack (except clubs, which just have a primary attack). Primary attacks deal damage, while secondary attacks can be pretty much anything, from increasing attacking damage, to blocking enenmy attacks. The status effects that secondary attacks give you usually just last for a turn or two.");
Thread.sleep(23000);
System.out.println("There are 4 different classes of weapons.");
System.out.println("First weapon class: Clubs. These only deal damage, and have no secondary attacks. The damage they do deal, however, is the most of any weapon class.");
Thread.sleep(9000);
System.out.println("Second weapon class: Swords. Their primary attacks deal damage, and their secondary attacks block enemy attacks, which lowers the amount of damage an enemy deals to you.");
Thread.sleep(9000);
System.out.println("Third weapon class: Magic weapons. Their primary attacks deal damage. Unlike the other weapon class, the secondary attacks for these change from weapon to weapon. For example, one magic weapon's secondary attack might be leeching an enemy's health, while another's would be, well, different from that.");
Thread.sleep(14000);
System.out.println("Fourth and final weapon class: Electric weapons. Their primary attacks deal damage and chain damage to other enemies if there are more than one. Their secondary attacks deal damage to every enemy after some amount of turns.");
Thread.sleep(12000);
System.out.println("This tutorial's already gone on for long enough. Let's end this by pitting you against an Olbap, a pretty common enemy in the game. Which starter weapon do you choose to use to fight against it and use in the game until you find a better weapon? (You can always switch weapon types. For example, just because you picked the starter sword right now doesn't mean you can't use electric weapons later on.)");
Thread.sleep(21000);
System.out.println(" Weapons:");
System.out.println("Heavy stick (club) Velociraptor tooth (sword) Street magician wand (magic weapon) Damaged cable (electric weapon)");
System.out.println("Type in the name of the weapon you choose. Don't type in the weapon class it belongs to, just the name of it. For example, just type in 'Damaged cable' if you choose that weapon.");
FileWriter newWriter = new FileWriter("inventory.txt", true);
boolean exitforloop = false;
Scanner startwponObj = new Scanner(System.in);
String startwponpick = startwponObj.nextLine();
for (; !exitforloop;) {
exitforloop = true;
switch (startwponpick) {
case "Heavy stick":
System.out.println("Your starter weapon: Heavy stick");
newWriter.write("Heavy stick");
newWriter.write("\n");
newWriter.close();
break;
case "Velociraptor tooth":
System.out.println("Your starter weapon: Velociraptor tooth");
newWriter.write("Velociraptor tooth");
newWriter.write("\n");
newWriter.close();
break;
case "Street magician wand":
System.out.println("Your starter weapon: Street magician wand");
newWriter.write("Street magician wand");
newWriter.write("\n");
newWriter.close();
break;
case "Damaged cable":
System.out.println("Your starter weapon: Damaged cable");
newWriter.write("Damaged cable");
newWriter.write("\n");
newWriter.close();
break;
default:
exitforloop = false;
for (; !startwponpick.equals("Heavy stick") && !startwponpick.equals("Velociraptor tooth")
&& !startwponpick.equals("Street magician wand") && !startwponpick.equals("Damaged cable");) {
System.out.println("Error: User input not recognized. Try again?");
startwponpick = startwponObj.nextLine();
}
}
} // exitforloop end
System.out.println("Battle time!");
Thread.sleep(4000);
System.out.print("\033[H\033[2J");
int olbaphealth = 80;
int yourhealth = 100;
int money = 0;
System.out.println("Enemy Olbap health: " + olbaphealth);
System.out.println("Your health: " + yourhealth);
System.out.println("Your turn:");
switch (startwponpick) {
case "Heavy stick":
System.out.println("Primary attack: Heavy hit[20-30 damage dealt]");
break;
case "Velociraptor tooth":
System.out.println("Primary attack: Vicious slice[20-25 damage dealt] Secondary attack: Block[1/4 less damage taken from enemy attacks, lasts for 2 turns, cooldown is 1 turn]");
break;
case "Street magician wand":
System.out.println("Primary attack: Health goes poof[18-22 damage dealt] Secondary attack: Leech[+8-10 health per attack, lasts for 3 turns, cooldown is 2 turns]");
break;
case "Damaged cable":
System.out.println("Primary attack: Electric shock[12-18 damage dealt, 5-10 damage chained to other enemies] Secondary attack: Charging up [Two turns after the attack is used, 30 damage will be dealt to every enemy, cooldown is 3 turns]");
break;
}
System.out.println("To do a primary attack or secondary attack, type in its name. Don't type in the damage it deals or how long it lasts, just the name.");
Scanner tutrlbttlObj = new Scanner(System.in);
String tutrlbttl = tutrlbttlObj.nextLine();
Random rng1 = new Random();
int yourdmgeheavystick = rng1.nextInt(10) + 20;
Random rng = new Random();
int olbapattckdmgehs = rng.nextInt(18) + 5;
Random rng2 = new Random();
int yourdmgevelotth = rng2.nextInt(5) + 20;
Random rng3 = new Random();
int olbapattckdmgevt = rng3.nextInt(18) + 5;
int olbapdcreasedmgebruh = olbapattckdmgevt/4;
int olbapdcreasedmge = olbapattckdmgevt - olbapdcreasedmgebruh;
Random rng4 = new Random();
int yourdmgestrtmagwnd = rng4.nextInt(4) + 18;
int olbapattckdmgesmw = rng4.nextInt(18) + 5;
int yourhealthincr = rng4.nextInt(2) + 8;
Random rng5 = new Random();
int yourdmgedcable = rng5.nextInt(6) + 12;
int olbapattckdmgedcable = rng5.nextInt(18) + 5;
boolean winornot = false;
switch (tutrlbttl) {
case "Heavy hit":
yourdmgeheavystick = rng1.nextInt(10) + 20;
Thread.sleep(1000);
System.out.println("You dealt " + yourdmgeheavystick + " damage to the enemy Olbap.");
olbaphealth = olbaphealth - yourdmgeheavystick;
System.out.println("Enemy Olbap health: " + olbaphealth);
for (; olbaphealth > 0 && yourhealth > 0;) {
olbapattckdmgehs = rng.nextInt(18) + 5;
Thread.sleep(2000);
System.out.println("You took " + olbapattckdmgehs + " damage from the enemy Olbap.");
yourhealth = yourhealth - olbapattckdmgehs;
System.out.println("Your health: " + yourhealth);
Thread.sleep(2000);
System.out.println("Your turn:");
System.out.println("Primary attack: Heavy hit[20-30 damage dealt]");
tutrlbttl = tutrlbttlObj.nextLine();
if (tutrlbttl.equals("Heavy hit")) {
yourdmgeheavystick = rng1.nextInt(10) + 20;
System.out.println("You dealt " + yourdmgeheavystick + " damage to the enemy Olbap.");
olbaphealth = olbaphealth - yourdmgeheavystick;
System.out.println("Enemy Olbap health: " + olbaphealth);
continue;
} else {
for (; !tutrlbttl.equals("Heavy hit");) {
System.out.println("Error: User input not recognized. Try again?");
tutrlbttl = tutrlbttlObj.nextLine();
}
}
yourdmgeheavystick = rng.nextInt(10) + 20;
System.out.println("You dealt " + yourdmgeheavystick + " damage to the enemy Olbap.");
olbaphealth = olbaphealth - yourdmgeheavystick;
System.out.println("Enemy Olbap health: " + olbaphealth);
} // end for (;olbaphealth > 0 && yourhealth > 0;)
if (olbaphealth <= 0) {
money = money + 15;
System.out.println("You won the battle and rid the world of one wicked Olbap! Rewards: $15");
System.out.println("Current amount of money: " + money);
winornot = true;
}
if (yourhealth <= 0) {
System.out.println("You lost the battle...");
winornot = false;
}
break;
case "Vicious slice":
yourdmgevelotth = rng2.nextInt(5) + 20;
Thread.sleep(1000);
System.out.println("You dealt " + yourdmgevelotth + " damage to the enemy Olbap.");
olbaphealth = olbaphealth - yourdmgevelotth;
System.out.println("Enemy Olbap health: " + olbaphealth);
for (; olbaphealth > 0 && yourhealth > 0;) {
if (olbaphealth <= 0) {
break;
}
if (yourhealth <= 0) {
break;
}
olbapattckdmgevt = rng3.nextInt(18) + 5;
Thread.sleep(2000);
System.out.println("You took " + olbapattckdmgevt + " damage from the enemy Olbap.");
yourhealth = yourhealth - olbapattckdmgevt;
System.out.println("Your health: " + yourhealth);
Thread.sleep(2000);
System.out.println("Your turn:");
System.out.println("Primary attack: Vicious slice[20-25 damage dealt] Secondary attack: Block[1/4 less damage taken from enemy attacks, lasts for 2 turns, cooldown is 1 turn]");
tutrlbttl = tutrlbttlObj.nextLine();
if (!tutrlbttl.equals("Vicious slice") && !tutrlbttl.equals("Block")) {
for (; !tutrlbttl.equals("Vicious slice") && !tutrlbttl.equals("Block");) {
System.out.println("Error: User input not recognized. Try again?");
tutrlbttl = tutrlbttlObj.nextLine();
}
}
if (tutrlbttl.equals("Vicious slice")) {
yourdmgevelotth = rng2.nextInt(5) + 20;
Thread.sleep(2000);
System.out.println("You dealt " + yourdmgevelotth + " damage to the enemy Olbap.");
olbaphealth = olbaphealth - yourdmgevelotth;
System.out.println("Enemy Olbap health: " + olbaphealth);
continue;
} else if (tutrlbttl.equals("Block")) {
System.out.println("You blocked. The damage that incoming enemy attacks will do to you will be reduced by 1/4.");
for (int counter = 0; olbaphealth > 0 && yourhealth > 0 && counter < 2; ++counter) {
if (olbaphealth <= 0) {
break;
}
if (yourhealth <= 0) {
break;
}
olbapattckdmgevt = rng3.nextInt(18) + 5;
olbapdcreasedmgebruh = olbapattckdmgevt / 4;
olbapdcreasedmge = olbapattckdmgevt - olbapdcreasedmgebruh;
Thread.sleep(2000);
System.out.println("You took " + olbapdcreasedmge + " damage from the enemy Olbap.");
yourhealth = yourhealth - olbapdcreasedmge;
System.out.println("Your health: " + yourhealth);
Thread.sleep(2000);
System.out.println("Your turn:");
System.out.println("Primary attack: Vicious slice[20-25 damage dealt] Secondary attack: Block[On cooldown]");
tutrlbttl = tutrlbttlObj.nextLine();
if (tutrlbttl.equals("Vicious slice")) {
yourdmgevelotth = rng2.nextInt(5) + 20;
Thread.sleep(2000);
System.out.println("You dealt " + yourdmgevelotth + " damage to the enemy Olbap.");
olbaphealth = olbaphealth - yourdmgevelotth;
System.out.println("Enemy Olbap health: " + olbaphealth);
continue;
} else if (tutrlbttl.equals("Block")) {
for (; !tutrlbttl.equals("Vicious slice");) {
System.out.println("Error: Attack is on cooldown. Try again?");
tutrlbttl = tutrlbttlObj.nextLine();
}
} else {
for (; !tutrlbttl.equals("Vicious slice");) {
if (!tutrlbttl.equals("Block")) {
System.out.println("Error: User input not recognized. Try again?");
} else {
System.out.println("Error: Attack is on cooldown. Try again?");
}
tutrlbttl = tutrlbttlObj.nextLine();
}
}
yourdmgevelotth = rng2.nextInt(5) + 20;
Thread.sleep(2000);
System.out.println("You dealt " + yourdmgevelotth + " damage to the enemy Olbap.");
olbaphealth = olbaphealth - yourdmgevelotth;
System.out.println("Enemy Olbap health: " + olbaphealth);
}
for (int counter1 = 0; olbaphealth > 0 && yourhealth > 0 && counter1 < 1; ++counter1) {
olbapattckdmgevt = rng3.nextInt(18) + 5;
Thread.sleep(2000);
System.out.println("You took " + olbapattckdmgevt + " damage from the enemy Olbap.");
yourhealth = yourhealth - olbapattckdmgevt;
System.out.println("Your health: " + yourhealth);
if (olbaphealth <= 0) {
break;
}
if (yourhealth <= 0) {
break;
}
Thread.sleep(2000);
System.out.println("Your turn:");
System.out.println("Primary attack: Vicious slice[20-25 damage dealt] Secondary attack: Block[On cooldown]");
tutrlbttl = tutrlbttlObj.nextLine();
if (tutrlbttl.equals("Vicious slice")) {
yourdmgevelotth = rng2.nextInt(5) + 20;
Thread.sleep(2000);
System.out.println("You dealt " + yourdmgevelotth + " damage to the enemy Olbap.");
olbaphealth = olbaphealth - yourdmgevelotth;
System.out.println("Enemy Olbap health: " + olbaphealth);
continue;
} else if (tutrlbttl.equals("Block")) {
for (; !tutrlbttl.equals("Vicious slice");) {
System.out.println("Error: Attack is on cooldown. Try again?");
tutrlbttl = tutrlbttlObj.nextLine();
}
} else {
for (; !tutrlbttl.equals("Vicious slice");) {
if (!tutrlbttl.equals("Block")) {
System.out.println("Error: User input not recognized. Try again?");
} else {
System.out.println("Error: Attack is on cooldown. Try again?");
}
tutrlbttl = tutrlbttlObj.nextLine();
}
}
yourdmgevelotth = rng2.nextInt(5) + 20;
Thread.sleep(2000);
System.out.println("You dealt " + yourdmgevelotth + " damage to the enemy Olbap.");
olbaphealth = olbaphealth - yourdmgevelotth;
System.out.println("Enemy Olbap health: " + olbaphealth);
}
}
}
if (olbaphealth <= 0) {
money = money + 15;
System.out.println("You won the battle and rid the world of one wicked Olbap! Rewards: $15");
System.out.println("Current amount of money: " + money);
winornot = true;
}
if (yourhealth <= 0) {
System.out.println("You lost the battle...");
winornot = false;
}
break;
case "Block":
System.out.println("You blocked. The damage that incoming enemy attacks will do to you will be reduced by 1/4.");
Thread.sleep(2000);
for (int counter = 0; olbaphealth > 0 && yourhealth > 0 && counter < 2; ++counter) {
if (olbaphealth <= 0) {
break;
}
if (yourhealth <= 0) {
break;
}
olbapattckdmgevt = rng3.nextInt(18) + 5;
olbapdcreasedmgebruh = olbapattckdmgevt / 4;
olbapdcreasedmge = olbapattckdmgevt - olbapdcreasedmgebruh;
Thread.sleep(2000);
System.out.println("You took " + olbapdcreasedmge + " damage from the enemy Olbap.");
yourhealth = yourhealth - olbapdcreasedmge;
System.out.println("Your health: " + yourhealth);
Thread.sleep(2000);
System.out.println("Your turn:");
System.out.println("Primary attack: Vicious slice[20-25 damage dealt] Secondary attack: Block[On cooldown]");
tutrlbttl = tutrlbttlObj.nextLine();
if (tutrlbttl.equals("Vicious slice")) {
yourdmgevelotth = rng2.nextInt(5) + 20;
Thread.sleep(2000);
System.out.println("You dealt " + yourdmgevelotth + " damage to the enemy Olbap.");
olbaphealth = olbaphealth - yourdmgevelotth;
System.out.println("Enemy Olbap health: " + olbaphealth);
continue;
} else if (tutrlbttl.equals("Block")) {
for (; !tutrlbttl.equals("Vicious slice");) {
System.out.println("Error: Attack is on cooldown. Try again?");
tutrlbttl = tutrlbttlObj.nextLine();
}
} else {
for (; !tutrlbttl.equals("Vicious slice");) {
if (!tutrlbttl.equals("Block")) {
System.out.println("Error: User input not recognized. Try again?");
} else {
System.out.println("Error: Attack is on cooldown. Try again?");
}
tutrlbttl = tutrlbttlObj.nextLine();
}
}
yourdmgevelotth = rng2.nextInt(5) + 20;
Thread.sleep(2000);
System.out.println("You dealt " + yourdmgevelotth + " damage to the enemy Olbap.");
olbaphealth = olbaphealth - yourdmgevelotth;
System.out.println("Enemy Olbap health: " + olbaphealth);
}
for (int counter1 = 0; olbaphealth > 0 && yourhealth > 0 && counter1 < 1; ++counter1) {
if (olbaphealth <= 0) {
break;
}
if (yourhealth <= 0) {
break;
}
olbapattckdmgevt = rng3.nextInt(18) + 5;
Thread.sleep(2000);
System.out.println("You took " + olbapattckdmgevt + " damage from the enemy Olbap.");
yourhealth = yourhealth - olbapattckdmgevt;
System.out.println("Your health: " + yourhealth);
Thread.sleep(2000);
System.out.println("Your turn:");
System.out.println("Primary attack: Vicious slice[20-25 damage dealt] Secondary attack: Block[On cooldown]");
tutrlbttl = tutrlbttlObj.nextLine();
if (tutrlbttl.equals("Vicious slice")) {
yourdmgevelotth = rng2.nextInt(5) + 20;
Thread.sleep(2000);
System.out.println("You dealt " + yourdmgevelotth + " damage to the enemy Olbap.");
olbaphealth = olbaphealth - yourdmgevelotth;
System.out.println("Enemy Olbap health: " + olbaphealth);
continue;
} else if (tutrlbttl.equals("Block")) {
for (; !tutrlbttl.equals("Vicious slice");) {
System.out.println("Error: Attack is on cooldown. Try again?");
tutrlbttl = tutrlbttlObj.nextLine();
}
} else {
for (; !tutrlbttl.equals("Vicious slice");) {
if (!tutrlbttl.equals("Block")) {
System.out.println("Error: User input not recognized. Try again?");
} else {
System.out.println("Error: Attack is on cooldown. Try again?");
}
tutrlbttl = tutrlbttlObj.nextLine();
}
}
yourdmgevelotth = rng2.nextInt(5) + 20;
Thread.sleep(2000);
System.out.println("You dealt " + yourdmgevelotth + " damage to the enemy Olbap.");
olbaphealth = olbaphealth - yourdmgevelotth;
System.out.println("Enemy Olbap health: " + olbaphealth);
}
for (; olbaphealth > 0 && yourhealth > 0;) {
if (olbaphealth <= 0) {
break;
}
if (yourhealth <= 0) {
break;
}
olbapattckdmgevt = rng3.nextInt(18) + 5;
Thread.sleep(2000);
System.out.println("You took " + olbapattckdmgevt + " damage from the enemy Olbap.");
yourhealth = yourhealth - olbapattckdmgevt;
System.out.println("Your health: " + yourhealth);
Thread.sleep(2000);
System.out.println("Your turn:");
System.out.println("Primary attack: Vicious slice[20-25 damage dealt] Secondary attack: Block[1/4 less damage taken from enemy attacks, lasts for 2 turns, cooldown is 1 turn]");
tutrlbttl = tutrlbttlObj.nextLine();
if (!tutrlbttl.equals("Vicious slice") && !tutrlbttl.equals("Block")) {
for (; !tutrlbttl.equals("Vicious slice") && !tutrlbttl.equals("Block");) {
System.out.println("Error: User input not recognized. Try again?");
tutrlbttl = tutrlbttlObj.nextLine();
}
}
if (tutrlbttl.equals("Vicious slice")) {
yourdmgevelotth = rng2.nextInt(5) + 20;
Thread.sleep(2000);
System.out.println("You dealt " + yourdmgevelotth + " damage to the enemy Olbap.");
olbaphealth = olbaphealth - yourdmgevelotth;
System.out.println("Enemy Olbap health: " + olbaphealth);
continue;
} else if (tutrlbttl.equals("Block")) {
System.out.println("You blocked. The damage that incoming enemy attacks will do to you will be reduced by 1/4.");
for (int counter = 0; olbaphealth > 0 && yourhealth > 0 && counter < 2; ++counter) {
if (olbaphealth <= 0) {
break;
}
if (yourhealth <= 0) {
break;
}
olbapattckdmgevt = rng3.nextInt(18) + 5;
olbapdcreasedmgebruh = olbapattckdmgevt / 4;
olbapdcreasedmge = olbapattckdmgevt - olbapdcreasedmgebruh;
Thread.sleep(2000);
System.out.println("You took " + olbapdcreasedmge + " damage from the enemy Olbap.");
yourhealth = yourhealth - olbapdcreasedmge;
System.out.println("Your health: " + yourhealth);
if (olbaphealth <= 0) {
break;
}
if (yourhealth <= 0) {
break;
}
Thread.sleep(2000);
System.out.println("Your turn:");
System.out.println("Primary attack: Vicious slice[20-25 damage dealt] Secondary attack: Block[On cooldown]");
tutrlbttl = tutrlbttlObj.nextLine();
if (tutrlbttl.equals("Vicious slice")) {
yourdmgevelotth = rng2.nextInt(5) + 20;
Thread.sleep(2000);
System.out.println("You dealt " + yourdmgevelotth + " damage to the enemy Olbap.");
olbaphealth = olbaphealth - yourdmgevelotth;
System.out.println("Enemy Olbap health: " + olbaphealth);
continue;
} else if (tutrlbttl.equals("Block")) {
for (; !tutrlbttl.equals("Vicious slice");) {
System.out.println("Error: Attack is on cooldown. Try again?");
tutrlbttl = tutrlbttlObj.nextLine();
}
} else {
for (; !tutrlbttl.equals("Vicious slice");) {
if (!tutrlbttl.equals("Block")) {
System.out.println("Error: User input not recognized. Try again?");
} else {
System.out.println("Error: Attack is on cooldown. Try again?");
}
tutrlbttl = tutrlbttlObj.nextLine();
}
}
yourdmgevelotth = rng2.nextInt(5) + 20;
Thread.sleep(2000);
System.out.println("You dealt " + yourdmgevelotth + " damage to the enemy Olbap.");
olbaphealth = olbaphealth - yourdmgevelotth;
System.out.println("Enemy Olbap health: " + olbaphealth);
}
for (int counter1 = 0; olbaphealth > 0 && yourhealth > 0 && counter1 < 1; ++counter1) {
if (olbaphealth <= 0) {
break;
}
if (yourhealth <= 0) {
break;
}
olbapattckdmgevt = rng3.nextInt(18) + 5;
Thread.sleep(2000);
System.out.println("You took " + olbapattckdmgevt + " damage from the enemy Olbap.");
yourhealth = yourhealth - olbapattckdmgevt;
System.out.println("Your health: " + yourhealth);
Thread.sleep(2000);
System.out.println("Your turn:");
System.out.println("Primary attack: Vicious slice[20-25 damage dealt] Secondary attack: Block[On cooldown]");
tutrlbttl = tutrlbttlObj.nextLine();
if (tutrlbttl.equals("Vicious slice")) {
yourdmgevelotth = rng2.nextInt(5) + 20;
Thread.sleep(2000);
System.out.println("You dealt " + yourdmgevelotth + " damage to the enemy Olbap.");
olbaphealth = olbaphealth - yourdmgevelotth;
System.out.println("Enemy Olbap health: " + olbaphealth);
continue;
} else if (tutrlbttl.equals("Block")) {
for (; !tutrlbttl.equals("Vicious slice");) {
System.out.println("Error: Attack is on cooldown. Try again?");
tutrlbttl = tutrlbttlObj.nextLine();
}
} else {
for (; !tutrlbttl.equals("Vicious slice");) {
if (!tutrlbttl.equals("Block")) {
System.out.println("Error: User input not recognized. Try again?");
} else {
System.out.println("Error: Attack is on cooldown. Try again?");
}
tutrlbttl = tutrlbttlObj.nextLine();
}
}
yourdmgevelotth = rng2.nextInt(5) + 20;
Thread.sleep(2000);
System.out.println("You dealt " + yourdmgevelotth + " damage to the enemy Olbap.");
olbaphealth = olbaphealth - yourdmgevelotth;
System.out.println("Enemy Olbap health: " + olbaphealth);
}
}
}
if (olbaphealth <= 0) {
money = money + 15;
System.out.println("You won the battle and rid the world of one wicked Olbap! Rewards: $15");
System.out.println("Current amount of money: " + money);
winornot = true;
}
if (yourhealth <= 0) {
System.out.println("You lost the battle...");
winornot = false;
}
break;
case "Health goes poof":
yourdmgestrtmagwnd = rng4.nextInt(4) + 18;
Thread.sleep(1000);
System.out.println("You dealt " + yourdmgestrtmagwnd + " damage to the enemy Olbap.");
olbaphealth = olbaphealth - yourdmgestrtmagwnd;
System.out.println("Enemy Olbap health: " + olbaphealth);
for (; olbaphealth > 0 && yourhealth > 0;) {
if (olbaphealth <= 0) {
break;
}
if (yourhealth <= 0) {
break;
}
olbapattckdmgesmw = rng.nextInt(18) + 5;
Thread.sleep(2000);
System.out.println("You took " + olbapattckdmgesmw + " damage from the enemy Olbap.");
yourhealth = yourhealth - olbapattckdmgesmw;
System.out.println("Your health: " + yourhealth);
if (olbaphealth <= 0) {
break;
}
if (yourhealth <= 0) {
break;
}
Thread.sleep(2000);
System.out.println("Your turn:");
System.out.println("Primary attack: Health goes poof[18-22 damage dealt] Secondary attack: Leech[+8-10 health per attack, lasts for 3 turns, cooldown is 2 turns]");
tutrlbttl = tutrlbttlObj.nextLine();
if (!tutrlbttl.equals("Health goes poof") && !tutrlbttl.equals("Leech")) {
for(; !tutrlbttl.equals("Health goes poof") && !tutrlbttl.equals("Leech");) {
System.out.println("Error: User input not recognized. Try again?");
tutrlbttl = tutrlbttlObj.nextLine();
}
}
if (tutrlbttl.equals("Health goes poof")) {
yourdmgestrtmagwnd = rng4.nextInt(4) + 18;
Thread.sleep(2000);
System.out.println("You dealt " + yourdmgestrtmagwnd + " damage to the enemy Olbap.");
olbaphealth = olbaphealth - yourdmgestrtmagwnd;
System.out.println("Enemy Olbap health: " + olbaphealth);
if (olbaphealth <= 0) {
break;
}
if (yourhealth <= 0) {
break;
}
continue;
}
else if (tutrlbttl.equals("Leech")) {
System.out.println("You leeched your enemy's health. From now on for 3 turns, whenever it's your turn and you attack the enemy, you will gain between 8 and 10 health, and of course, still damage the enemy.");
for (int countermagwnd = 0; olbaphealth > 0 && yourhealth > 0 && countermagwnd < 3; ++countermagwnd) {
if (olbaphealth <= 0) {
break;
}
if (yourhealth <= 0) {
break;
}
olbapattckdmgesmw = rng.nextInt(18) + 5;
Thread.sleep(2000);
System.out.println("You took " + olbapattckdmgesmw + " damage from the enemy Olbap.");
yourhealth = yourhealth - olbapattckdmgesmw;
System.out.println("Your health: " + yourhealth);
if (olbaphealth <= 0) {
break;
}
if (yourhealth <= 0) {
break;
}
Thread.sleep(2000);
System.out.println("Your turn:");
System.out.println("Primary attack: Health goes poof[18-22 damage dealt] Secondary attack: Leech[On cooldown]");
tutrlbttl = tutrlbttlObj.nextLine();
if (!tutrlbttl.equals("Health goes poof") && !tutrlbttl.equals("Leech")) {
for(; !tutrlbttl.equals("Health goes poof") && !tutrlbttl.equals("Leech");) {
System.out.println("Error: User input not recognized. Try again?");
tutrlbttl = tutrlbttlObj.nextLine();
}
}
if (tutrlbttl.equals("Health goes poof")) {
yourdmgestrtmagwnd = rng4.nextInt(4) + 18;
yourhealthincr = rng4.nextInt(2) + 8;
Thread.sleep(2000);
System.out.println("You dealt " + yourdmgestrtmagwnd + " damage to the enemy Olbap.");
System.out.println("You gained " + yourhealthincr + " health.");
olbaphealth = olbaphealth - yourdmgestrtmagwnd;
yourhealth = yourhealth + yourhealthincr;
System.out.println("Enemy Olbap health: " + olbaphealth);
System.out.println("Your health: " + yourhealth);
if (olbaphealth <= 0) {
break;
}
if (yourhealth <= 0) {
break;
}
continue;
}
else if (tutrlbttl.equals("Leech")) {
for (;!tutrlbttl.equals("Health goes poof");) {
System.out.println("Error: Attack is on cooldown. Try again?");
tutrlbttl = tutrlbttlObj.nextLine();
}
}
yourdmgestrtmagwnd = rng4.nextInt(4) + 18;
yourhealthincr = rng4.nextInt(2) + 8;
Thread.sleep(2000);
System.out.println("You dealt " + yourdmgestrtmagwnd + " damage to the enemy Olbap.");
System.out.println("You gained " + yourhealthincr + " health.");
olbaphealth = olbaphealth - yourdmgestrtmagwnd;
yourhealth = yourhealth + yourhealthincr;
System.out.println("Enemy Olbap health: " + olbaphealth);
System.out.println("Your health: " + yourhealth);
if (olbaphealth <= 0) {
break;
}
if (yourhealth <= 0) {
break;
}
}
for (int cntercldwnsmw = 0; olbaphealth > 0 && yourhealth > 0 && cntercldwnsmw < 2; ++cntercldwnsmw) {
if (olbaphealth <= 0) {
break;
}
if (yourhealth <= 0) {
break;
}
olbapattckdmgesmw = rng.nextInt(18) + 5;
Thread.sleep(2000);
System.out.println("You took " + olbapattckdmgesmw + " damage from the enemy Olbap.");
yourhealth = yourhealth - olbapattckdmgesmw;
System.out.println("Your health: " + yourhealth);
if (olbaphealth <= 0) {
break;
}
if (yourhealth <= 0) {
break;
}
Thread.sleep(2000);
System.out.println("Your turn:");
System.out.println("Primary attack: Health goes poof[18-22 damage dealt] Secondary attack: Leech[On cooldown]");
tutrlbttl = tutrlbttlObj.nextLine();
if (!tutrlbttl.equals("Health goes poof") && !tutrlbttl.equals("Leech")) {
for(; !tutrlbttl.equals("Health goes poof") && !tutrlbttl.equals("Leech");) {
System.out.println("Error: User input not recognized. Try again?");
tutrlbttl = tutrlbttlObj.nextLine();
}
}
if (tutrlbttl.equals("Health goes poof")) {
yourdmgestrtmagwnd = rng4.nextInt(4) + 18;
Thread.sleep(2000);
System.out.println("You dealt " + yourdmgestrtmagwnd + " damage to the enemy Olbap.");
olbaphealth = olbaphealth - yourdmgestrtmagwnd;
System.out.println("Enemy Olbap health: " + olbaphealth);
if (olbaphealth <= 0) {
break;
}
if (yourhealth <= 0) {
break;
}
continue;
}
else if (tutrlbttl.equals("Leech")) {
for (;!tutrlbttl.equals("Health goes poof");) {
System.out.println("Error: Attack is on cooldown. Try again?");
tutrlbttl = tutrlbttlObj.nextLine();
}
}
yourdmgestrtmagwnd = rng4.nextInt(4) + 18;
Thread.sleep(2000);
System.out.println("You dealt " + yourdmgestrtmagwnd + " damage to the enemy Olbap.");
olbaphealth = olbaphealth - yourdmgestrtmagwnd;
System.out.println("Enemy Olbap health: " + olbaphealth);
if (olbaphealth <= 0) {
break;
}
if (yourhealth <= 0) {
break;
}
}
}
}
if (olbaphealth <= 0) {
money = money + 15;
System.out.println("You won the battle and rid the world of one wicked Olbap! Rewards: $15");
System.out.println("Current amount of money: " + money);
winornot = true;
}
if (yourhealth <= 0) {
System.out.println("You lost the battle...");
winornot = false;
}
break;
case ("Leech"):
System.out.println("You leeched your enemy's health. From now on for 3 turns, whenever it's your turn and you attack the enemy, you will gain between 8 and 10 health, and of course, still damage the enemy.");
Thread.sleep(3500);
for (int countermagwnd = 0; olbaphealth > 0 && yourhealth > 0 && countermagwnd < 3; ++countermagwnd) {
if (olbaphealth <= 0) {
break;
}
if (yourhealth <= 0) {
break;
}
olbapattckdmgesmw = rng.nextInt(18) + 5;
Thread.sleep(2000);
System.out.println("You took " + olbapattckdmgesmw + " damage from the enemy Olbap.");
yourhealth = yourhealth - olbapattckdmgesmw;
System.out.println("Your health: " + yourhealth);
if (olbaphealth <= 0) {
break;
}
if (yourhealth <= 0) {
break;
}
Thread.sleep(2000);
System.out.println("Your turn:");
System.out.println("Primary attack: Health goes poof[18-22 damage dealt] Secondary attack: Leech[On cooldown]");
tutrlbttl = tutrlbttlObj.nextLine();
if (!tutrlbttl.equals("Health goes poof") && !tutrlbttl.equals("Leech")) {
for(; !tutrlbttl.equals("Health goes poof") && !tutrlbttl.equals("Leech");) {
System.out.println("Error: User input not recognized. Try again?");
tutrlbttl = tutrlbttlObj.nextLine();
}
}
if (tutrlbttl.equals("Health goes poof")) {
yourdmgestrtmagwnd = rng4.nextInt(4) + 18;
yourhealthincr = rng4.nextInt(2) + 8;
Thread.sleep(2000);
System.out.println("You dealt " + yourdmgestrtmagwnd + " damage to the enemy Olbap.");
System.out.println("You gained " + yourhealthincr + " health.");
olbaphealth = olbaphealth - yourdmgestrtmagwnd;
yourhealth = yourhealth + yourhealthincr;
System.out.println("Enemy Olbap health: " + olbaphealth);
System.out.println("Your health: " + yourhealth);
if (olbaphealth <= 0) {
break;
}
if (yourhealth <= 0) {
break;
}
continue;
}
else if (tutrlbttl.equals("Leech")) {
for (;!tutrlbttl.equals("Health goes poof");) {
System.out.println("Error: Attack is on cooldown. Try again?");
tutrlbttl = tutrlbttlObj.nextLine();
}
}
yourdmgestrtmagwnd = rng4.nextInt(4) + 18;
yourhealthincr = rng4.nextInt(2) + 8;
Thread.sleep(2000);
System.out.println("You dealt " + yourdmgestrtmagwnd + " damage to the enemy Olbap.");
System.out.println("You gained " + yourhealthincr + " health.");
olbaphealth = olbaphealth - yourdmgestrtmagwnd;
yourhealth = yourhealth + yourhealthincr;
System.out.println("Enemy Olbap health: " + olbaphealth);