-
Notifications
You must be signed in to change notification settings - Fork 0
/
World of Lazurcraft.py
2007 lines (1895 loc) · 117 KB
/
World of Lazurcraft.py
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
#### IMPORTS ####
import time
from datetime import datetime
import csv
import pandas as pd
import getpass
import random
import sys
startTime = time.time()
def register_account():
now = datetime.now()
def distribute_skillpoints():
global characterStartingSkills
global characterStrength
global characterAgility
global characterIntelligence
while True:
try:
characterStrength = int(input("How many points would you like to allocate to Strength?"))
print("Your character's Strength is now set to ", characterStrength)
break;
except ValueError:
print("Your answer can only be a number.")
while True:
try:
characterAgility = int(input("How many points would you like to allocate to Agility?"))
print("Your character's Agility is now set to ", characterAgility)
break;
except ValueError:
print("Your answer can only be a number.")
while True:
try:
characterIntelligence = int(input("How many points would you like to allocate to Intelligence?"))
print("Your character's Agility is now set to ", characterIntelligence)
break;
except ValueError:
print("Your answer can only be a number.")
characterStartingSkills = characterStrength + characterAgility + characterIntelligence
if int(characterStartingSkills) <= 5:
print("Your character was successfully created.")
time.sleep(2)
print("Name: ", characterName)
print("Date of birth: ", characterDateAndTimeOfBirth)
print("Strength: ", characterStrength)
print("Agility: ", characterAgility)
print("Intelligence: ", characterIntelligence)
else:
print(
"You spent more than 5 skill points, thus your character wasn't created! Please re-distribute NO more than 5 skill points accordingly.")
time.sleep(2)
distribute_skillpoints()
print("Welcome to World of LazurCraft Character Creation panel!")
time.sleep(1)
####CharacterName Creation
characterName = input(
"Please write down your character's name (it is recommended to use a 1-word name that starts with a capital letter for the best gaming experience.):")
print("Your character's name has been set to " + characterName)
time.sleep(1)
###Set Password + Confirm
while True:
characterPassword = getpass.getpass(prompt="Please set your password. Minimum password length is 6 characters and maximum password length is 20 characters.")
if len(characterPassword) < 6:
print("Make sure your password is at least 6 characters long.")
elif len(characterPassword) > 20:
print("Make sure your password is not longer than 20 characters.")
else:
print("Your password was set.")
break
time.sleep(1)
while True:
characterPasswordConfirm = getpass.getpass(prompt="Please write down your password once again to confirm it.")
if characterPasswordConfirm != characterPassword:
print("The passwords you've provided don't match.")
else:
print("Your password was successfully registered.")
break
time.sleep(1)
characterQuestion = input(
"Please set a secret question that will help you recover your password in case you forget it.")
time.sleep(1)
characterAnswer = input(
"Please set an answer to the secret question. The question will be presented to you in case you forget your password.")
time.sleep(1)
while True:
try:
characterDateAndTimeOfBirth = datetime.strptime(
input("Please select your character's date and time of birth. (Ex. 1997-11-06 16:00)"),
'%Y-%m-%d %H:%M')
break;
except ValueError:
print("Please abide to the format: YYYY-MM-DD HH:MM")
print("Your character's date and time of birth has been set to", characterDateAndTimeOfBirth)
time.sleep(1)
print(
"Your character starts as Level 1 and has 5 skill points to allocate between Strength, Agility and Intelligence. Choose wisely as you can only do this once.")
time.sleep(2)
# DISTRIBUTE SKILLPOINTS
distribute_skillpoints()
print("Welcome to World of Lazurcraft, ", characterName, " !")
time.sleep(4)
print("**DATE AND TIME**:", characterDateAndTimeOfBirth)
time.sleep(3)
print("**LOCATION**: A hospital in Burgas, Bulgaria")
time.sleep(5)
print("DOCTOR: Push harder, miss! Push harder!")
time.sleep(3)
print("RANDOM MOTHER: Ugh-...Ugh-..")
time.sleep(4)
print("**A FEW MOMENTS LATER**")
time.sleep(5)
print("DOCTOR: There it is-.. How are you going to call this lovely boy?")
time.sleep(4)
print("RANDOM MOTHER: I'll call him ", characterName)
time.sleep(4)
print("DOCTOR: That's such a beautiful name! I'm sure he'll make you proud!")
time.sleep(4)
print("RANDOM MOTHER: I hope he does.")
time.sleep(4)
print("**FAST FORWARDING TIME...**")
time.sleep(4)
print("**DATE AND TIME**: 12th July, 2010")
time.sleep(3)
print("**LOCATION**: Bench in front of Acho, Lazur.")
time.sleep(3)
print("You will now be sent to the starting screen where you can login with your newly created account.")
time.sleep(3)
characterSave = open("character.csv", 'w', encoding='UTF8', newline='')
characterNameSave = [characterName]
characterDateAndTimeOfBirthSave = [characterDateAndTimeOfBirth]
characterStrengthSave = [characterStrength]
characterAgilitySave = [characterAgility]
characterIntelligenceSave = [characterIntelligence]
characterQuestionSave = [characterQuestion]
characterAnswerSave = [characterAnswer]
writer = csv.writer(characterSave)
writer.writerow(['Character Data'])
writer.writerow(characterNameSave) # Name
writer.writerow(characterDateAndTimeOfBirthSave) # DOB
writer.writerow(characterStrengthSave) # Strength
writer.writerow(characterAgilitySave) # Agility
writer.writerow(characterIntelligenceSave) # Intelligence
writer.writerow(['Bench in front of Acho']) # Location
writer.writerow([1]) # Level
writer.writerow([5]) # Coins
writer.writerow([100]) # Reputation
writer.writerow([characterPassword]) # Password
writer.writerow([0]) # Played Time
writer.writerow(characterQuestionSave) # Secret Question
writer.writerow(characterAnswerSave) # Secret Answer
characterSave.close()
def recover_account():
loadsave = pd.read_csv("character.csv")
characterName = loadsave.iloc[0, 0] # Name
characterDateAndTimeOfBirth = loadsave.iloc[1, 0] # DOB
characterStrength = loadsave.iloc[2, 0] # Strength
characterAgility = loadsave.iloc[3, 0] # Agility
characterIntelligence = loadsave.iloc[4, 0] # Intelligence
characterLocation = loadsave.iloc[5, 0] # Location
characterLevel = loadsave.iloc[6, 0] # Level
characterCoins = loadsave.iloc[7, 0] # Coins
characterReputation = loadsave.iloc[8, 0] # Reputation
characterPassword = loadsave.iloc[9, 0] # Password
characterPlayed = loadsave.iloc[10, 0] # Played Time
characterQuestion = loadsave.iloc[11, 0] # Secret Question
characterAnswer = loadsave.iloc[12, 0] # Secret Answer
print("Welcome to the World of Lazurcraft Recovery Panel!")
time.sleep(2)
while True:
checkCharacterName = input("Please enter your character's name.")
if checkCharacterName == characterName:
print("Alright, entering recovery mode for ", characterName)
time.sleep(2)
print("The Secret Question for ", characterName, "is - ", characterQuestion)
time.sleep(2)
while True:
checkCharacterAnswer = input("Please enter your character's secret answer")
if checkCharacterAnswer == characterAnswer:
print("Alright. You can now set a new password for your character.")
while True:
characterPassword = getpass.getpass(prompt="Please set a NEW password. Minimum password length is 6 characters and maximum password length is 20 characters.")
if len(characterPassword) < 6:
print("Make sure your password is at least 6 characters long.")
elif len(characterPassword) > 20:
print("Make sure your password is not longer than 20 characters.")
else:
print("Your NEW password was set.")
break
while True:
characterPasswordConfirm = getpass.getpass(prompt="Please write down your NEW password once again to confirm it.")
if characterPasswordConfirm != characterPassword:
print("The passwords you've provided don't match.")
else:
print("Your NEW password was successfully set.")
endTimeSave = time.time()
totalPlayedNow = endTimeSave - startTime
characterPlayedNew = int(characterPlayed) + int(totalPlayedNow)
characterSave = open('character.csv', 'w', encoding='UTF8', newline='')
characterNameSave = [characterName] # Name
characterDateAndTimeOfBirthSave = [characterDateAndTimeOfBirth] # DOB
characterStrengthSave = ([characterStrength]) # Strength
characterAgilitySave = ([characterAgility]) # Agility
characterIntelligenceSave = ([characterIntelligence]) # Intelligence
characterLocationSave = [characterLocation] # Location
characterLevelSave = ([characterLevel]) # Level
characterCoinsSave = ([characterCoins]) # Coins
characterReputationSave = ([characterReputation]) # Reputation
characterPasswordSave = ([characterPassword]) # Password
characterPlayedSave = ([characterPlayedNew]) # Total Played
characterQuestionSave = [characterQuestion] # Secret Question
characterAnswerSave = [characterAnswer] # Secret Answer
writer = csv.writer(characterSave)
writer.writerow(['Character Data'])
writer.writerow(characterNameSave) # Name
writer.writerow(characterDateAndTimeOfBirthSave) # DOB
writer.writerow(characterStrengthSave) # Strength
writer.writerow(characterAgilitySave) # Agility
writer.writerow(characterIntelligenceSave) # Intelligence
writer.writerow(characterLocationSave) # Location
writer.writerow(characterLevelSave) # Level
writer.writerow(characterCoinsSave) # Coins
writer.writerow(characterReputationSave) # Reputation
writer.writerow(characterPasswordSave) # Password
writer.writerow(characterPlayedSave) # Time Played
writer.writerow(characterQuestionSave) # Secret Question
writer.writerow(characterAnswerSave) # Secret Answer
characterSave.close()
print("You'll now be sent to the starting screen where you can login with your NEW password.")
time.sleep(3)
return
else:
print("There's no character with this name. Please write down your character's name correctly.")
continue
##LOGIN, REGISTER OR PASSWORD RECOVERY
while True:
print("*** Welcome to World of Lazurcraft! Would you like to login in your account, register a new account or recover your lost password? ***")
time.sleep(3)
loginRegisterOrRecover = input("Type !login, !register or !recover")
if loginRegisterOrRecover == "!login":
loadsave = pd.read_csv("character.csv")
characterName = loadsave.iloc[0, 0] # Name
characterDateAndTimeOfBirth = loadsave.iloc[1, 0] # DOB
characterStrength = loadsave.iloc[2, 0] # Strength
characterAgility = loadsave.iloc[3, 0] # Agility
characterIntelligence = loadsave.iloc[4, 0] # Intelligence
characterLocation = loadsave.iloc[5, 0] # Location
characterLevel = loadsave.iloc[6, 0] # Level
characterCoins = loadsave.iloc[7, 0] # Coins
characterReputation = loadsave.iloc[8, 0] # Reputation
characterPassword = loadsave.iloc[9, 0] # Password
characterPlayed = loadsave.iloc[10, 0] # Played Time
characterQuestion = loadsave.iloc[11, 0] # Secret Question
characterAnswer = loadsave.iloc[12, 0] # Secret Answer
###### LISTS ######
actionsList = ['!visitginko', '!visitgorskiq', '!visitprimo', '!visittheliar', '!visitcrazyblondewoman',
'!visitshitthrower', '!visitthejupiter', '!visithatman', '!runfromyani', '!greetyani',
'!workout']
utilitiesList = ['!stats', '!location', '!save', '!help', '!quit', '!played']
###### DICTIONARIES ######
locationsList = {
"!achobench": "Bench in front of Acho",
"!mesta": "Mesta Street",
"!koprivshtitsa": "Koprivshtitsa Street",
"!yavorov": "Yavorov Primary School",
"!perla": "Perlata",
"!seagarden": "The Sea Garden"
}
######################### ############################## FUNCTIONS ############################################
################################# UTILITY ########################
# SAVE game with !save
def save_game():
endTimeSave = time.time()
totalPlayedNow = endTimeSave - startTime
characterPlayedNew = int(characterPlayed) + int(totalPlayedNow)
characterSave = open('character.csv', 'w', encoding='UTF8', newline='')
characterNameSave = [characterName] # Name
characterDateAndTimeOfBirthSave = [characterDateAndTimeOfBirth] # DOB
characterStrengthSave = ([characterStrength]) # Strength
characterAgilitySave = ([characterAgility]) # Agility
characterIntelligenceSave = ([characterIntelligence]) # Intelligence
characterLocationSave = [characterLocation] # Location
characterLevelSave = ([characterLevel]) # Level
characterCoinsSave = ([characterCoins]) # Coins
characterReputationSave = ([characterReputation]) # Reputation
characterPasswordSave = ([characterPassword]) # Password
characterPlayedSave = ([characterPlayedNew]) # Total Played
characterQuestionSave = [characterQuestion] # Secret Question
characterAnswerSave = [characterAnswer] # Secret Answer
writer = csv.writer(characterSave)
writer.writerow(['Character Data'])
writer.writerow(characterNameSave) # Name
writer.writerow(characterDateAndTimeOfBirthSave) # DOB
writer.writerow(characterStrengthSave) # Strength
writer.writerow(characterAgilitySave) # Agility
writer.writerow(characterIntelligenceSave) # Intelligence
writer.writerow(characterLocationSave) # Location
writer.writerow(characterLevelSave) # Level
writer.writerow(characterCoinsSave) # Coins
writer.writerow(characterReputationSave) # Reputation
writer.writerow(characterPasswordSave) # Password
writer.writerow(characterPlayedSave) # Time Played
writer.writerow(characterQuestionSave) # Secret Question
writer.writerow(characterAnswerSave) # Secret Answer
characterSave.close()
# PRINT !played command
def played_time():
TotalTimeNow = time.time() - startTime
characterPlayedCheck = int(characterPlayed) + int(TotalTimeNow)
print('Your total played time is: ', time.strftime("%H:%M:%S", time.gmtime(characterPlayedCheck)))
# PRINT !stats command
def print_stats():
print("Name:", characterName)
print("Date of Birth:", characterDateAndTimeOfBirth)
print("Level:", characterLevel)
print("Strength:", characterStrength)
print("Agility:", characterAgility)
print("Intelligence:", characterIntelligence)
print("Coins:", characterCoins)
print("Reputation:", characterReputation)
# PRINT !location command
def print_location():
if characterLocation == "Bench in front of Acho":
print("You are currently located at: ", characterLocation)
print("You can go down to Mesta Street with !mesta")
print("Or you can go up to Koprivshtitsa Street with !koprivshtitsa")
elif characterLocation == "Mesta Street":
print("You are currently located at: ", characterLocation)
print("You can go down to Perlata with !perla")
print("Or you can go up to Bench in front of Acho with !achobench")
elif characterLocation == "Koprivshtitsa Street":
print("You are currently located at: ", characterLocation)
print("You can go down to Bench in front of Acho with !achobench")
print("Or you can go up to Yavorov Primary School with !yavorov")
elif characterLocation == "Yavorov Primary School":
print("You are currently located at: ", characterLocation)
print("You can go down to Koprivshtitsa Street with !koprivshtitsa")
elif characterLocation == "Perlata":
print("You are currently located at: ", characterLocation)
print("You can go down to The Sea Garden with !seagarden")
print("Or you can go up to Mesta with !mesta")
elif characterLocation == "The Sea Garden":
print("You are currently located at: ", characterLocation)
print("You can go up to Perlata with !perla")
# PRINT Reputation command
def print_reputation():
print("Your reputation is:", characterReputation)
# PRINT Coins command
def print_coins():
print("Your coins are: ", characterCoins)
# PRINT Level command
def print_level():
print("Your level is:", characterLevel)
# PRINT Strength command
def print_strength():
print("Your strength is:", characterStrength)
# PRINT Agility command
def print_agility():
print("Your agility is:", characterAgility)
# PRINT Intelligence command
def print_intelligence():
print("Your intelligence is:", characterIntelligence)
# PRINT !help command
def print_help():
print("!stats to check your character stats.")
print("!location to check where your character is located and where you can go..")
print("!save to save your current progress.")
print("!quit to quit the game.")
print("!played to check your played time.")
# QUIT game with !quit
def quit_game():
print("Would you like to save your progress before quitting the game?")
time.sleep(1)
saveorNot = input("To save and exit, type !yes. To exit without saving, type !no.")
while True:
if saveorNot == "!yes":
save_game()
print("Your game was successfully saved.")
time.sleep(0.5)
print("Quitting game in 3-..")
time.sleep(1)
print("Quitting game in 2-..")
time.sleep(1)
print("Quitting game in 1-..")
time.sleep(1)
print("See you around!")
sys.exit()
elif saveorNot == "!no":
print("You decided not to save your progress.")
time.sleep(0.5)
print("Quitting game in 3-..")
time.sleep(1)
print("Quitting game in 2-..")
time.sleep(1)
print("Quitting game in 1-..")
time.sleep(1)
print("See you around!")
sys.exit()
# LOGIN FUNCTION
def login_function():
while True:
Name = input("Please input your character's name to login.(case sensitive)")
Password = getpass.getpass(prompt="Please input your character's password to login.")
if Name != characterName or Password != characterPassword:
print("The specified name or password is incorrect. Please try again.")
else:
print("Login successful!")
break
# WELCOME MESSAGE
def welcome():
print("Welcome to World of Lazurcraft, " + characterName + "!")
time.sleep(2)
print("Here are your current character details:")
time.sleep(1)
print("Name:", characterName)
print("Date of Birth:", characterDateAndTimeOfBirth)
print("Level:", characterLevel)
print("Location:", characterLocation)
print("Strength:", characterStrength)
print("Agility:", characterAgility)
print("Intelligence:", characterIntelligence)
print("Coins:", characterCoins)
print("Reputation:", characterReputation)
time.sleep(2)
print("For a list of all available commands, type !help")
# Prints the current location, along with the available quests and options.
def show_location_and_reputation(location, reputation):
print("You're at " + location + "!")
time.sleep(2)
if location == 'Bench in front of Acho':
if int(reputation) >= 200:
time.sleep(2)
print("You look around and you see Gorskiq sitting at 'The Stone'!")
time.sleep(2)
print("If you'd like to go see Gorskiq, type !visitgorskiq")
else:
print("You look around and you see Ginko sitting at 'The Stone'!")
time.sleep(2)
print("If you'd like to go see Ginko, type !visitginko")
time.sleep(2)
print("If you'd like to go towards Koprivshtitsa Street, type !koprivshtitsa")
time.sleep(1)
print("If you'd like to go towards Mesta Street, type !mesta")
elif location == "Koprivshtitsa Street":
if int(reputation) >= 200:
time.sleep(2)
print("You look around and you see Itso - The Liar down the street!")
time.sleep(2)
print("If you'd like to talk to The Liar, type !visittheliar")
else:
print("You look around and you see the Primo Store!")
time.sleep(2)
print("If you'd like to head towards the Primo Store, type !visitprimo")
time.sleep(2)
print("If you'd like to go up towards Yavorov Primary School, type !yavorov")
time.sleep(1)
print("If you'd like to go down towards the bench in front of acho, type !achobench")
elif location == "Mesta Street":
if int(reputation) >= 200:
time.sleep(2)
print("You look around and you see that a crazy blonde woman approaches down from the Sea Garden.")
time.sleep(2)
print("If you'd like to talk to her, type !visitcrazyblondewoman ")
else:
print("You look around and you see the Shitthrower Store.")
time.sleep(2)
print("If you'd like to enter the Shitthrower Store, type !visitshitthrower")
time.sleep(1)
time.sleep(2)
print("If you'd like to go down towards Perla, type !perla")
time.sleep(2)
print("If you'd like to go up towards the bench in front of Acho, type !achobench")
elif location == "Perlata":
if int(reputation) >= 200:
time.sleep(2)
print("You look around and you see a communist-looking man, wearing a hat, approaching the Perla area.")
time.sleep(2)
print("If you'd like to interact with him, type !visithatman")
else:
time.sleep(2)
print("You look around and you see George The Jupiter exiting the Perla Store.")
time.sleep(2)
print("If you'd like to approach George The Jupiter, type !visitthejupiter")
print("If you'd like to go down towards the Sea Garden, type !seagarden")
time.sleep(2)
print("If you'd like to go up towards Mesta Street, type !mesta")
elif location == "Yavorov Primary School":
if int(reputation) >= 200:
time.sleep(2)
print("Soon after entering the school, you notice Yani The Tyson approaching the entrance of Yavkata.")
time.sleep(2)
if int(characterCoins) >= 10:
print("If you'd like to greet him, type !greetyani, or if you'd like to run like a pussy,trying to protect the enormous amount of coins that you have, type !runfromyani")
else:
print("If you'd like to greet him, type !greetyani, or if you'd like to run like a pussy,trying to protect the very few coins that you have, type !runfromyani")
else:
time.sleep(2)
print("You enter the school and you see people everywhere. To start the workout quest, type !workout")
time.sleep(2)
print("If you'd like to go down towards Koprivshtitsa Street, type !koprivshtitsa")
elif location == "The Sea Garden":
if int(reputation) >= 200:
print("CONTENT TO BE ADDED IN NEXT PATCH")
time.sleep(1)
print("Please go back to Perlata by typing !perla")
else:
print("CONTENT TO BE ADDED IN NEXT PATCH")
time.sleep(1)
print("Please go back to Perlata by typing !perla")
# Check if move is a change of location, action or utility and respond.
def player_move_function(move):
global characterLocation
if move in locationsList.keys():
characterLocation = locationsList[move]
show_location_and_reputation(characterLocation, characterReputation)
elif move in actionsList:
if move == "!visitginko":
time.sleep(2)
print("You approach Ginko near the Stone.")
ginko_quest()
elif move == "!visitgorskiq":
time.sleep(2)
print("You approach Gorskiq near the Stone.")
gorskiq_quest()
elif move == "!visitprimo":
time.sleep(2)
print("You head towards the Primo store with a confident walk.")
primo_quest()
elif move == "!visittheliar":
print("You approach Itso the Liar.")
time.sleep(2)
visittheliar_quest()
elif move == "!visitshitthrower":
print("You head towards the Shitthrower store.")
time.sleep(2)
shitthrower_quest()
elif move == "!greetyani":
time.sleep(2)
greetyani_quest()
elif move == "!runfromyani":
time.sleep(2)
runfromyani_quest()
elif move == "!workout":
print("Alright, now we have to decide what kind of workout we'll do.")
time.sleep(2)
workout_quest()
elif move == "!visitthejupiter":
print("You approach George The Jupiter")
time.sleep(2)
thejupiter_quest()
elif move in utilitiesList:
if move == "!help":
print_help()
elif move == "!stats":
print_stats()
elif move == "!location":
print_location()
elif move == "!save":
save_game()
print("Your game was successfully saved! Feel free to exit now!")
elif move == "!quit":
quit_game()
elif move == "!played":
played_time()
else:
print("This is an invalid command!")
####################################### QUESTS LOW REP #####################################################
#### GINKO QUEST ####
def ginko_quest():
global characterReputation
global characterLevel
global characterStrength
global characterAgility
global characterIntelligence
time.sleep(3)
print(characterName + ": Hey, Ginko!")
time.sleep(2.5)
print("GINKO: Boy-..")
time.sleep(2.5)
print("GINKO: Cawn yew gewt mew my wine?")
time.sleep(2.5)
print("*** WOULD YOU LIKE TO ACCEPT THIS QUEST? ***")
while True:
acceptQuest = input("Type in !yes to accept or !no to refuse!")
if acceptQuest == "!yes":
print(characterName + ": Sure thing, Ginko! Where have you left it?")
time.sleep(3)
print("GINKO: I think it's-..")
time.sleep(3)
print("GINKO: In the gawden be'aind thirty-sixth-..")
time.sleep(3)
print(characterName + ": Okay, I'll check it for you.")
time.sleep(3)
print("*** YOU WALK BEHIND 36TH ***")
time.sleep(3)
print("*** YOU SEE AN ALCOHOLIC SLEEPING ON A BENCH WITH A 5L BOTTLE OF SUSPICIOUS RED LIQUID! ***")
time.sleep(3)
print("WOULD YOU LIKE TO APPROACH HIM QUIETLY OR WOULD YOU RUSH TO HIM AND GRAB THE BOTTLE?")
time.sleep(3)
while True:
quietOrRush = input("Type in !quiet for a quiet approach and !rush to rush for the bottle.")
if quietOrRush == "!quiet":
time.sleep(3)
print("*** YOU APPROACH THE STRANGER QUIETLY AND YOU REACH FOR THE BOTTLE'S HANDLE ***")
time.sleep(3)
print("*** YOU GRAB THE BOTTLE'S HANDLE AND YOU HEAR-... ***")
time.sleep(3)
print("*** A LOUD FART ***")
time.sleep(3)
print("*** YOU REMAIN CALM AND YOU WALK AWAY BACK TO THE STONE ***")
time.sleep(3.5)
print("GINKO: Heeeeeyw-...")
time.sleep(3)
print("GINKO: Grewt jowb-.. boyw!")
time.sleep(2.5)
print("GINKO: What's yer name?")
time.sleep(2.5)
print(characterName + ": I'm " + characterName + "!")
time.sleep(3)
print("GINKO: A'right, " + characterName + " thank yew!")
time.sleep(3)
print("QUEST GINKO COMPLETED!")
time.sleep(3)
print(
"*** CONGRATULATIONS! YOU'VE EARNED +10 REPUTATION, GAINED A LEVEL AND INCREASED YOUR INTELLIGENCE BY 1.")
time.sleep(3)
characterReputation = int(characterReputation) + 10
characterLevel = int(characterLevel) + 1
characterIntelligence = int(characterIntelligence) + 1
print_reputation()
time.sleep(0.5)
print_level()
time.sleep(0.5)
print_intelligence()
time.sleep(0.5)
return
elif quietOrRush == "!rush":
time.sleep(2)
print("*** YOU RUSH FOR THE BENCH AND GRAB THE BOTTLE'S HANDLE ***")
time.sleep(2)
print("*** SUDDENLY, THE STRANGER WAKES UP AND SHOUTS! ***")
time.sleep(2.5)
print("STRANGER: Hey you! That's mine!")
time.sleep(2)
print("*** YOU IGNORE HIM AND START RUNNING TOWARDS GINKO AT THE STONE")
time.sleep(2)
print("*** AS YOU APPROACH THE STONE YOU REALIZE THAT THE STRANGER HAS BEEN CHASING YOU")
time.sleep(2)
print("*** YOU DROP THE BOTTLE IN FRONT OF GINKO AND YOU TURN AROUND ***")
time.sleep(2)
print("*** GINKO STANDS UP FROM THE STONE AND CHARGES AT THE STRANGER ***")
time.sleep(1)
print("WOULD YOU LIKE TO HELP GINKO IN THE FIGHT?")
while True:
fightForGinko = input(
"Type in !fight if you'd like to join the fight or !run if you'd like to run towards the bench in front of Acho!")
if fightForGinko == "!fight":
print(
"*** YOU CHARGE TOWARDS THE STRANGER ALONG WITH GINKO AND SWING A RIGHT PUNCH IN HIS FACE!")
time.sleep(2.5)
print(
"*** THE PUNCH CONNECTS WHILE GINKO FORCEFULLY PUSHES THE STRANGER WITH BOTH HIS ARMS ***")
time.sleep(2.5)
print(
"*** THE STRANGER FALLS ON HIS BACK AND QUICKLY STANDS UP AND START RUNNING TOWARDS THE GARDEN ***")
time.sleep(3)
print("*** GINKO EXHALES *** GINKO: Ha, tha's wha' ye' get fo' stealin' mew wine!")
time.sleep(3)
print("*** GINKO TURNS TOWARDS YOU, BREATHING HEAVILY ***")
time.sleep(2.5)
print("GINKO: Grewt jowb-.. boyw!")
time.sleep(1.5)
print("GINKO: What's yer name?")
time.sleep(1.5)
print(characterName + ": I'm " + characterName + "!")
time.sleep(2)
print("GINKO: A'right, " + characterName + " thank yew!")
time.sleep(2)
print("QUEST GINKO COMPLETED!")
time.sleep(2)
print(
"*** CONGRATULATIONS! YOU'VE EARNED +10 REPUTATION, GAINED 2 LEVELS AND INCREASED YOUR STRENGTH BY 1")
time.sleep(3)
characterReputation = int(characterReputation) + 10
characterLevel = int(characterLevel) + 2
characterStrength = int(characterStrength) + 1
print_level()
time.sleep(0.5)
print_reputation()
time.sleep(0.5)
print_strength()
time.sleep(0.5)
return
elif fightForGinko == "!run":
print("*** YOU MAKE A RUN TOWARDS THE BENCH IN FRONT OF ACHO INTO SAFETY ***")
time.sleep(2.5)
print("QUEST GINKO COMPLETED!")
time.sleep(2)
print(
"*** CONGRATULATIONS! YOU'VE EARNED +10 REPUTATION, GAINED 1 LEVEL AND INCREASED YOUR AGILITY BY 2")
time.sleep(2)
characterReputation = int(characterReputation) + 10
characterLevel = int(characterLevel) + 1
characterAgility = int(characterAgility) + 2
print_level()
time.sleep(0.5)
print_reputation()
time.sleep(0.5)
print_agility()
time.sleep(0.5)
return
else:
print("This is an invalid command!")
continue
else:
print("This is an invalid command!")
continue
elif acceptQuest == "!no":
time.sleep(2)
print(characterName + ": Sorry Ginko, but not today. I got better things to do right now.")
time.sleep(2)
print("*** YOU TURN AROUND AND YOU WALK BACK TOWARDS THE BENCH IN FRONT OF ACHO ***")
return
else:
print("This is an invalid command!")
continue
#### PRIMO QUEST ####
def primo_quest():
global characterReputation
global characterLevel
global characterStrength
global characterAgility
global characterIntelligence
global characterCoins
global characterName
time.sleep(3)
print("*** As you approach the Primo store, you wonder what you'll be getting ***")
time.sleep(3)
print("*** Is it going to be Instant Noodles? A cup of Frozen Juice? Or maybe a Coffee Cola by Derby? ***")
time.sleep(3)
print(
"*** You enter the Primo and you pass by a boy who appears to be a bit younger than you. Did you decide what you'll be getting already? ***")
time.sleep(3)
while True:
primoDecision = input(
"Type !noodles to look for Instant Noodles, !frozenjuice to look for a cup of Frozen Juice or !coffeecola to look for a bottle of Coffee Cola by Derby ***")
if primoDecision == "!noodles" or primoDecision == "!frozenjuice" or primoDecision == "!coffeecola":
print(
"*** As you approach the shelf, containing your sterile manufactured product, you hear the cashier shouting-.. ***")
time.sleep(3)
print("CASHIER: HEY YOU! COME BACK!")
time.sleep(3)
print(
"*** You turn towards the exit and you see the boy heading for the exit while skipping the pay desk ***")
time.sleep(3)
while True:
primoDecision2 = input("Type !chase to chase the boy or !ignore to ignore what's happening.")
if primoDecision2 == "!chase":
print("*** You drop your high-quality product as you rush after the kid ***")
time.sleep(2.5)
print(
"*** The boy turns right and starts running as he exits while slamming the door closed in front of you.")
time.sleep(3)
print(
"*** You open the door and start chasing him down as he runs on the sidewalk of Koprivshtitsa towards the side of 35th. ***")
time.sleep(3)
print(
"*** You soon approach the boy and have to decide whether to try to tackle his feet from behind or to try to get closer and grab him by his T-shirt.")
while True:
primoDecision3 = input(
"Type !tackle to try to tackle the boy from behind or !grab to try to get even closer and grab him by his T-shirt.")
if primoDecision3 == "!tackle":
print("*** You swing your leg at the kid's feet and successfully tackle him. ***")
time.sleep(3)
print(
"*** The little vagabont drops on the floor as he spills the large pack of popcorn he had stolen just a few moments ago.")
time.sleep(3)
print(characterName,
": That's what you get from stealing from this neighborhood, fool.")
time.sleep(3)
print("*** The fool stands up while crying and heads down towards the Sea Garden.")
time.sleep(3)
print(
"*** You receive +15 reputation and you level up for your deed. The little thief was punished and Lazur Mahala is once again a safe place to patrol. ***")
time.sleep(3)
print("*** Your strength has increased by 1 ***")
characterStrength = int(characterStrength) + 1
characterReputation = int(characterReputation) + 15
characterLevel = int(characterLevel) + 1
time.sleep(2)
print_level()
time.sleep(0.5)
print_reputation()
time.sleep(0.5)
print_strength()
time.sleep(0.5)
return
elif primoDecision3 == "!grab":
print(
"*** You get even closer and reach out for the little vagabont's T-shirt. ***")
time.sleep(3)
print(
"*** Just a few moments later, you grab the thief's T-shirt and he stops. ***")
time.sleep(3)
print("Little Thief shouting: Please, please, don't hurt me-...")
time.sleep(2.5)
print("*** The boy starts crying ***")
time.sleep(3)
print("Little Thief: Here, take this")
time.sleep(3)
print(
"*** The kid offers you a pack of popcorn. Apparently, that's the stolen loot. ***")
time.sleep(3)
print(
"*** You teach the poor boy a lesson as you recover ownership of the pack of popcorn ***")
time.sleep(3)
print(
"*** But now you have a choice to make. Would you return the popcorn to the Primo store or would you keep it for yourself? ***")
time.sleep(3)
while True:
primoDecision4 = input(
"Type !return to return the popcorn to the Primo store or !keep to keep it and enjoy the free snack.")
if primoDecision4 == ("!return"):
print(
"*** You go back to the Primo store and return the pack of popcorn as the cashier thanks you and is very proud of you.")
time.sleep(3)
print(
"*** The cashier takes the pack of popcorn and puts it back on the shelf ***")
time.sleep(3)
print(
"Your reputation has increased by 20, you level up and your agility has increased by 1")
characterReputation = int(characterReputation) + 20
characterLevel = int(characterLevel) + 1
characterAgility = int(characterAgility) + 1
print_reputation()
time.sleep(0.5)
print_level()
time.sleep(0.5)
print_agility()
time.sleep(0.5)
return
elif primoDecision4 == ("!keep"):
print(
"*** You decide to keep the pack of popcorn that you just received. ***")
time.sleep(3)
print(
"*** You sit on the Stone in front of Nikolai and start munching the popcorn ***")
time.sleep(3)
print(
"Your reputation has increased by 15, you level up and your agility and intelligence has increased by 1")
characterReputation = int(characterReputation) + 15
characterLevel = int(characterLevel) + 1
characterAgility = int(characterAgility) + 1
characterIntelligence = int(characterIntelligence) + 1
time.sleep(1.5)
print_reputation()
time.sleep(0.5)
print_level()
time.sleep(0.5)
print_agility()
time.sleep(0.5)
print_intelligence()
time.sleep(0.5)
return
else:
print("That's an invalid command. Didn't you learn already?")
continue
else:
print("That's an invalid command. Didn't you learn already?")
continue
elif primoDecision2 == "!ignore":
print("*** You ignore the situation and the kid escapes with his loot ***")
time.sleep(3)
print("CASHIER while looking at you: C'mon, won't you do anything?")
time.sleep(3)
print("CASHIER while looking at you: And you're not even ashamed of yourself-...")
time.sleep(3)
print(
"CASHIER while looking at you: The whole new generation is like that. Back in the days, that wouldn't happen.")
time.sleep(3)
print(
"*** You quietly pass through the pay desk as you pay for your high-quality product and you leave the Primo store ***")
time.sleep(3)
if characterLevel >= 2:
characterLevel = int(characterLevel) - 1
characterReputation = int(characterReputation) - 10
print(
"*** You lose 10 Reputation and 1 Level for your deed. A store in Lazur Mahala was robbed today.")
time.sleep(2)
print_reputation()
time.sleep(0.5)
print_level()
time.sleep(0.5)
return
else:
characterReputation = int(characterReputation) - 10
print(
"*** You lose 10 Reputation for your deed. A store in Lazur Mahala was robbed today.")
time.sleep(2)
print_reputation()
time.sleep(1)
return
else:
print("That's an invalid command. Didn't you learn already?")
continue
else:
print("That's an invalid command. didn't you learn already?")
continue
#### STREET FITNESS QUEST ####
def workout_quest():
global characterReputation
global characterLevel
global characterStrength
global characterAgility
global characterIntelligence
global characterCoins
global characterName
while True:
workoutDecision = input(
"Type !streetfitness for a street fitness workout. Type !jogging to jog around the football pitch or type !rest if you dont feel like working out and prefer to rest on a bench.")