-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmain.py
986 lines (865 loc) · 42.3 KB
/
main.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
import msvcrt
import os
import pickle
import sys
import time
import colorama
from colorama import Fore, Style
from components.common_functions import clear_terminal, print_slow, shop_help, help_user, connect_help, mail_help, \
system_help
from conversations.calls import intro_call, first_call, second_call, third_call, fourth_call, fifth_call, sixth_call, \
markus_seen_call
from conversations.minigame_calls import code_shatter_call
from minigames.code_shatter_minigame import code_shatter_minigame
from minigames.eye_spy_minigame import port_scanning
from systems.level_1.amy.amy_system import AmySystem
from systems.level_1.billy.billy_system import BillySystem
from systems.level_1.cameras.camera_1 import camera_first
from systems.level_1.markus.markus_system import MarkusSystem
# Set the PYGAME_HIDE_SUPPORT_PROMPT environment variable
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "1"
import pygame
# Initialize pygame mixer
pygame.mixer.init()
# Load the bg music file and loop it
pygame.mixer.music.load('bg_music.mp3')
pygame.mixer.music.play(-1)
# sets the volume to 20% (change value to adjust)
pygame.mixer.music.set_volume(0.2)
# Define the global variables at the module level
inventory = []
balance = 300
emails = []
has_read_email = False
has_read_file = False
has_intro_call = False
seen_markus = False
evidence = []
amy_system = AmySystem()
billy_system = BillySystem()
markus_system = MarkusSystem()
bg_music_enabled = True
player_level = 1
has_started_game = False
# Save the game state to a file
def save_game():
global inventory, balance, emails, has_read_email, evidence, player_level, has_intro_call, has_started_game, seen_markus
with open('savegame.pkl', 'wb') as f:
pickle.dump(
(inventory, balance, emails, has_read_email, evidence, player_level, has_intro_call, has_started_game, seen_markus),
f)
# Load the game state from a file
def load_game():
global inventory, balance, emails, has_read_email, evidence, player_level, has_intro_call, has_started_game, seen_markus
if os.path.exists('savegame.pkl'):
with open('savegame.pkl', 'rb') as f:
inventory, balance, emails, has_read_email, evidence, player_level, has_intro_call, has_started_game, seen_markus = pickle.load(
f)
else:
# If the savegame file doesn't exist, set the default values
inventory = []
player_level = 1
evidence = []
has_intro_call = False
has_started_game = False
seen_markus = False
balance = 30000
emails = [
{
"sender": "Hacker's Digest",
"subject": "Weekly Hacker's Digest",
"body": (
"Issue #143\n\n"
"Cipher,\n\n"
"Welcome to the latest edition of Hacker's Digest! In this issue: \n\n"
"- Unveiling the Latest Exploits\n"
"- Spotlight on Cryptocurrency Security\n"
"- Interview with a Grey Hat Hacker\n"
"- Tool of the Week: EnigmaLink\n\n"
"Don't miss out on the latest in the world of hacking and cybersecurity. Stay informed and stay secure!\n\n"
"Best regards,\n"
"Hacker's Digest Team"
)
},
{
"sender": "The Cyber Mythbuster",
"subject": "Busting Cybersecurity Myths",
"body": (
"Cipher,\n\n"
"Heard any wild cybersecurity myths lately? This week, we're busting the craziest ones, including:\n\n"
"- Using 'Password123' for Maximum Security\n"
"- Cyber Ninjas and Their Stealthy VPNs\n"
"- USB Drives: The Fountain of Eternal Data\n\n"
"Stay myth-free and keep on hacking (responsibly)!\n\n"
"Mythbustingly,\n"
"The Cyber Mythbuster"
)
},
{
"sender": "CyberSilliness",
"subject": "Where Cyber Meets Comedy",
"body": (
"Welcome to the CyberSilliness Gazette\n"
"Where we believe that a good laugh is the ultimate antivirus! In this week's hilarity-packed issue:\n\n"
"- Cyber Jokes to Crack You Up (Without Cracking Your Passwords)\n"
"- Tech Support Horror Stories: A Comedy of Errors\n"
"- Chuckle Challenge: Share Your Funniest Cybersecurity Anecdote\n"
"- Meet the Cyber Clowns: Our Team's Silly Security Habits Revealed\n\n"
"Laughter is contagious, and so is good cybersecurity. Dive into the giggles and stay safe!\n\n"
"Silly Regards,\n"
"The CyberSilliness Team"
)
},
{
"sender": "Security Insight Weekly",
"subject": "Navigating the Cybersecurity Landscape",
"body": (
"Hello Cipher,\n\n"
"Welcome to Security Insight Weekly, your reliable source for navigating the ever-evolving cybersecurity landscape. In this week's issue:\n\n"
"- Threat Analysis: Understanding Recent Cybersecurity Incidents\n"
"- Best Practices for Endpoint Security\n"
"- Industry Spotlight: Healthcare Cybersecurity Challenges\n"
"- Security Compliance Update: Staying Aligned with Regulations\n\n"
"Stay informed and empowered as we delve into the serious aspects of cybersecurity. Your security is our priority.\n\n"
"Best regards,\n"
"The Security Insight Team"
)
},
]
# New function for game settings
def game_settings():
global bg_music_enabled
print_slow(Fore.GREEN + "░██████╗███████╗████████╗████████╗██╗███╗░░██╗░██████╗░░██████╗")
print_slow(Fore.GREEN + "██╔════╝██╔════╝╚══██╔══╝╚══██╔══╝██║████╗░██║██╔════╝░██╔════╝")
print_slow(Fore.GREEN + "╚█████╗░█████╗░░░░░██║░░░░░░██║░░░██║██╔██╗██║██║░░██╗░╚█████╗░")
print_slow(Fore.GREEN + "░╚═══██╗██╔══╝░░░░░██║░░░░░░██║░░░██║██║╚████║██║░░╚██╗░╚═══██╗")
print_slow(Fore.GREEN + "██████╔╝███████╗░░░██║░░░░░░██║░░░██║██║░╚███║╚██████╔╝██████╔╝")
print_slow(Fore.GREEN + "╚═════╝░╚══════╝░░░╚═╝░░░░░░╚═╝░░░╚═╝╚═╝░░╚══╝░╚═════╝░╚═════╝░" + Style.RESET_ALL)
print_slow("")
print_slow("")
print_slow("")
print_slow(Fore.GREEN + " --------------------------------------------" + Style.RESET_ALL)
print_slow(
Fore.GREEN + f"| [Background Music] {'Enabled |' if bg_music_enabled else 'Disabled |'}" + Style.RESET_ALL)
print_slow(Fore.GREEN + "| |" + Style.RESET_ALL)
print_slow(Fore.GREEN + "| [Delete Savegame] |" + Style.RESET_ALL)
print_slow(Fore.GREEN + "| |" + Style.RESET_ALL)
print_slow(Fore.GREEN + "| [Back to Main Menu] |" + Style.RESET_ALL)
print_slow(Fore.GREEN + " --------------------------------------------" + Style.RESET_ALL)
choice = input(Fore.GREEN + "\n> " + Style.RESET_ALL)
if choice.lower() == "background music":
# Toggle background music
bg_music_enabled = not bg_music_enabled
if bg_music_enabled:
pygame.mixer.music.play(-1)
print_slow(Fore.GREEN + "\nBackground Music Enabled" + Style.RESET_ALL)
time.sleep(1)
clear_terminal()
game_settings()
else:
pygame.mixer.music.stop()
print_slow(Fore.RED + "\nBackground Music Disabled" + Style.RESET_ALL)
time.sleep(1)
clear_terminal()
game_settings()
elif choice.lower() == "delete savegame":
# Delete savegame
confirm = input(Fore.RED + "\nAre you sure you want to delete the savegame? (yes/no): " + Style.RESET_ALL)
if confirm.lower() == "yes":
try:
os.remove("savegame.pkl")
print_slow(Fore.GREEN + "\nSavegame Deleted" + Style.RESET_ALL)
time.sleep(1)
clear_terminal()
game_settings()
except FileNotFoundError:
print_slow(Fore.RED + "\nSavegame not found" + Style.RESET_ALL)
time.sleep(1)
clear_terminal()
game_settings()
elif choice.lower() == "back" or choice.lower() == "back to main menu":
# Return to Main Menu
print_slow(Fore.GREEN + "\nReturning to Main Menu..." + Style.RESET_ALL)
time.sleep(1)
clear_terminal()
else:
print_slow(Fore.RED + "\nInvalid choice, please try again." + Style.RESET_ALL)
time.sleep(1)
clear_terminal()
game_settings()
# Function to add an item to the inventory
def add_to_inventory(item):
inventory.append(item)
def remove_from_inventory(item):
if item in inventory:
inventory.remove(item)
def add_evidence(evidence_item):
evidence.append(evidence_item)
def has_evidence(evidence_item):
return evidence_item in evidence
# Prints the games title
def main():
clear_terminal()
colorama.init()
print_slow(Fore.GREEN + "██████╗░██╗░░░░░░█████╗░░█████╗░██╗░░██╗██╗░░██╗░█████╗░████████╗" + Style.RESET_ALL)
print_slow(Fore.GREEN + "██╔══██╗██║░░░░░██╔══██╗██╔══██╗██║░██╔╝██║░░██║██╔══██╗╚══██╔══╝" + Style.RESET_ALL)
print_slow(Fore.GREEN + "██████╦╝██║░░░░░███████║██║░░╚═╝█████═╝░███████║███████║░░░██║░░░" + Style.RESET_ALL)
print_slow(Fore.GREEN + "██╔══██╗██║░░░░░██╔══██║██║░░██╗██╔═██╗░██╔══██║██╔══██║░░░██║░░░" + Style.RESET_ALL)
print_slow(Fore.GREEN + "██████╦╝███████╗██║░░██║╚█████╔╝██║░╚██╗██║░░██║██║░░██║░░░██║░░░" + Style.RESET_ALL)
print_slow(Fore.GREEN + "╚═════╝░╚══════╝╚═╝░░╚═╝░╚════╝░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚═╝░░░╚═╝░░░" + Style.RESET_ALL)
# Pause for 2 seconds before clearing the console
time.sleep(5)
# Clear the console
clear_terminal()
# Main menu loop
while True:
print_slow(Fore.GREEN + "███╗░░░███╗░█████╗░██╗███╗░░██╗ ███╗░░░███╗███████╗███╗░░██╗██╗░░░██╗")
print_slow(Fore.GREEN + "████╗░████║██╔══██╗██║████╗░██║ ████╗░████║██╔════╝████╗░██║██║░░░██║")
print_slow(Fore.GREEN + "██╔████╔██║███████║██║██╔██╗██║ ██╔████╔██║█████╗░░██╔██╗██║██║░░░██║")
print_slow(Fore.GREEN + "██║╚██╔╝██║██╔══██║██║██║╚████║ ██║╚██╔╝██║██╔══╝░░██║╚████║██║░░░██║")
print_slow(Fore.GREEN + "██║░╚═╝░██║██║░░██║██║██║░╚███║ ██║░╚═╝░██║███████╗██║░╚███║╚██████╔╝")
print_slow(
Fore.GREEN + "╚═╝░░░░░╚═╝╚═╝░░╚═╝╚═╝╚═╝░░╚══╝ ╚═╝░░░░░╚═╝╚══════╝╚═╝░░╚══╝░╚═════╝░" + Style.RESET_ALL)
print_slow("")
print_slow("")
print_slow("")
print_slow(Fore.GREEN + " --------------------------------------------" + Style.RESET_ALL)
print_slow(Fore.GREEN + "| [Start] Start the game |" + Style.RESET_ALL)
print_slow(Fore.GREEN + "| |" + Style.RESET_ALL)
print_slow(Fore.GREEN + "| [Options] Change the settings |" + Style.RESET_ALL)
print_slow(Fore.GREEN + "| |" + Style.RESET_ALL)
print_slow(Fore.GREEN + "| [Exit] Exit the game |" + Style.RESET_ALL)
print_slow(Fore.GREEN + " --------------------------------------------" + Style.RESET_ALL)
choice = input(Fore.GREEN + "\n> " + Style.RESET_ALL)
# Start the game
if choice.lower() == "start":
load_game()
start_game()
# Open game settings
elif choice.lower() == "options":
clear_terminal()
game_settings()
# Exit the game
elif choice.lower() == "exit":
print_slow(Fore.GREEN + "\nExiting..." + Style.RESET_ALL)
pygame.mixer.music.stop()
sys.exit()
else:
print_slow(Fore.RED + "\nInvalid choice, please try again." + Style.RESET_ALL)
time.sleep(2)
clear_terminal()
# Function to get the user's balance
def get_balance():
return balance
# Function to add money to the user's balance
def add_money(amount):
global balance
balance += amount
# Function to subtract money from the user's balance
def subtract_money(amount):
global balance
balance -= amount
def add_level(level):
global player_level
player_level += level
# Function to print the user's balance
def print_balance():
print_slow(f"Your current balance is: £{get_balance()}")
# Function to read files and marks files as evidence
def read_file(file_content, file_name):
global has_read_file, evidence
global balance
# Print the file content
print_slow(Fore.LIGHTBLUE_EX + f"\n{file_name}:\n\n{file_content}" + Style.RESET_ALL)
print_slow("")
# Check if the file is one of the specific files that increases evidence count
if file_name.lower() in ["employee_performance_review.txt"]:
evidence_item = 4
if not has_evidence(evidence_item):
print_slow("Adding evidence to the list...")
print_slow("")
print_slow(Fore.GREEN + "Evidence Secured" + Style.RESET_ALL)
add_evidence(evidence_item)
print_slow("")
print_slow("")
time.sleep(3)
print_slow(Fore.GREEN + "Incoming Call..." + Style.RESET_ALL)
input(Fore.GREEN + "> " + Style.RESET_ALL)
fourth_call()
if file_name.lower() in ["meeting_minutes.txt"]:
evidence_item = 5
if not has_evidence(evidence_item):
print_slow("Adding evidence to the list...")
print_slow("")
print_slow(Fore.GREEN + "Evidence Secured" + Style.RESET_ALL)
add_evidence(evidence_item)
print_slow("")
print_slow("")
time.sleep(3)
print_slow(Fore.GREEN + "Incoming Call..." + Style.RESET_ALL)
input(Fore.GREEN + "> " + Style.RESET_ALL)
fifth_call()
# Add more file names here as needed
# Add money to balance based on the file name
if file_name.lower() == "employee_performance_review.txt":
balance += 30
elif file_name.lower() == "meeting_minutes.txt":
balance += 50
# List of available upgrades
upgrades = [
{"name": "EnigmaLink", "description": "Application required to connect to Enigma Corps network.", "price": 100},
{"name": "CodeShatter", "description": "A powerful password breaker that can crack even the strongest passwords.",
"price": 250},
{"name": "EyeSpy", "description": "A privacy breaker to gain access to the smallest of cameras.", "price": 500},
{"name": "Rift", "description": "Break the barrier between the Server and Network.", "price": 800}
]
# Function to display the shop
def shop():
clear_terminal()
print_slow(Fore.YELLOW + r''' ██╗░░██╗░█████╗░░█████╗░██╗░░██╗███████╗██████╗░ ███╗░░░███╗░█████╗░██████╗░██╗░░██╗███████╗████████╗
██║░░██║██╔══██╗██╔══██╗██║░██╔╝██╔════╝██╔══██╗ ████╗░████║██╔══██╗██╔══██╗██║░██╔╝██╔════╝╚══██╔══╝
███████║███████║██║░░╚═╝█████═╝░█████╗░░██████╔╝ ██╔████╔██║███████║██████╔╝█████═╝░█████╗░░░░░██║░░░
██╔══██║██╔══██║██║░░██╗██╔═██╗░██╔══╝░░██╔══██╗ ██║╚██╔╝██║██╔══██║██╔══██╗██╔═██╗░██╔══╝░░░░░██║░░░
██║░░██║██║░░██║╚█████╔╝██║░╚██╗███████╗██║░░██║ ██║░╚═╝░██║██║░░██║██║░░██║██║░╚██╗███████╗░░░██║░░░
╚═╝░░╚═╝╚═╝░░╚═╝░╚════╝░╚═╝░░╚═╝╚══════╝╚═╝░░╚═╝ ╚═╝░░░░░╚═╝╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚═╝╚══════╝░░░╚═╝░░░''' + Style.RESET_ALL)
print_slow(Fore.YELLOW + "\nWelcome to the Hacker's Market!" + Style.RESET_ALL)
print_slow("")
print_slow(Fore.YELLOW + "Here you can buy upgrades to improve your hacking abilities.\n" + Style.RESET_ALL)
while True:
# Display the list of available upgrades
for i, upgrade in enumerate(upgrades):
print_slow(
Fore.YELLOW + f"\n{upgrade['name']} - {upgrade['description']} - £{upgrade['price']}" + Style.RESET_ALL)
# Get the user's choice
command = input(Fore.YELLOW + "\n> " + Style.RESET_ALL)
# Buy the chosen upgrade
if command.lower() == 'exit':
print_slow(Fore.YELLOW + "\nExiting Hacker's Market" + Style.RESET_ALL)
time.sleep(1)
clear_terminal()
start_game()
elif command.lower() == 'help':
shop_help()
elif command.lower().startswith('buy '):
upgrade_name = command[4:]
# [4:] removes first 4 characters
if has_item('EnigmaLink'):
if upgrade_name.lower() == 'enigmalink':
print_slow("")
print_slow(Fore.RED + "Sold Out" + Style.RESET_ALL)
time.sleep(1)
clear_terminal()
shop()
else:
for upgrade in upgrades:
if upgrade_name.lower() == upgrade['name'].lower():
if get_balance() >= upgrade['price']:
print_slow("")
print_slow(
Fore.GREEN + f"You have successfully purchased {upgrade['name']} for ${upgrade['price']}!" + Style.RESET_ALL)
subtract_money(upgrade['price'])
print_slow("")
print_balance()
add_to_inventory(upgrade['name'])
time.sleep(2)
clear_terminal()
# Check if the purchased upgrade is CodeShatter
if upgrade_name.lower() == 'codeshatter':
print_slow("")
print_slow(Fore.GREEN + "Incoming Call..." + Style.RESET_ALL)
input(Fore.GREEN + "> " + Style.RESET_ALL)
code_shatter_call()
shop()
else:
clear_terminal()
shop()
else:
print_slow(
Fore.RED + "You don't have enough money to buy this upgrade." + Style.RESET_ALL)
time.sleep(1)
clear_terminal()
shop()
else:
print_slow(Fore.RED + "Invalid choice, please try again." + Style.RESET_ALL)
time.sleep(1)
clear_terminal()
shop()
else:
for upgrade in upgrades:
if upgrade_name.lower() == upgrade['name'].lower():
if get_balance() >= upgrade['price']:
print_slow("")
print_slow(
Fore.GREEN + f"You have successfully purchased {upgrade['name']} for ${upgrade['price']}!" + Style.RESET_ALL)
subtract_money(upgrade['price'])
print_slow("")
print_balance()
add_to_inventory(upgrade['name'])
time.sleep(2)
clear_terminal()
shop()
else:
print_slow(
Fore.RED + "You don't have enough money to buy this upgrade." + Style.RESET_ALL)
shop()
else:
print_slow(Fore.RED + "Invalid choice, please try again." + Style.RESET_ALL)
time.sleep(1)
clear_terminal()
shop()
# Function to start the game
def start_game():
global has_intro_call, has_started_game, seen_markus
if has_intro_call:
clear_terminal()
pass
else:
print_slow("\nStarting game...")
time.sleep(1)
print_slow("\nLoading assets...")
time.sleep(1)
clear_terminal()
print_slow(Fore.GREEN + "Incoming Call..." + Style.RESET_ALL)
input(Fore.GREEN + "> " + Style.RESET_ALL)
intro_call()
has_intro_call = True
has_started_game = True
print_slow(Fore.MAGENTA + "\nHint: Type 'help' to get a list of available commands." + Style.RESET_ALL)
pass
if seen_markus:
print_slow(Fore.GREEN + "Incoming Call..." + Style.RESET_ALL)
input(Fore.GREEN + "> " + Style.RESET_ALL)
markus_seen_call()
else:
pass
# Game command loop
command = input(Fore.GREEN + "> " + Style.RESET_ALL)
# Connect to the network
if command.lower() == "connect":
connect()
# Access the mail system
elif command.lower() == "mail":
mail()
# Display help message
elif command.lower() == "help":
help_user()
# Check balance
elif command.lower() == "balance":
print_balance()
# Enter shop
elif command.lower() == "shop":
shop()
# Clear terminal
elif command.lower() == "clear":
clear_terminal()
# Return to the main menu
elif command.lower() == "exit":
print_slow("Returning to Main Menu...")
time.sleep(1)
main()
else:
print_slow("Invalid command, please try again.")
time.sleep(1)
clear_terminal()
start_game()
# Save the game state
save_game()
# Function to check if an item is in the inventory
def has_item(item):
return item in inventory
def scan():
print_slow("")
print_slow(Fore.YELLOW + "Scanning network..." + Style.RESET_ALL)
time.sleep(2)
print_slow("")
print_slow(Fore.YELLOW + "\nAvailable Systems:" + Style.RESET_ALL)
print_slow("")
for system in all_systems:
if system['level'] == player_level:
print_slow("")
print_slow(f"{system['name']} ({system['type']})")
print_slow("")
def getpass_star(prompt="Password: "):
print(prompt, end='', flush=True)
password = []
while True:
char = msvcrt.getch().decode('utf-8')
if char == '\r' or char == '\n':
break
elif char == '\b': # Backspace
if password:
password.pop()
print('\b \b', end='', flush=True)
else:
password.append(char)
print('*', end='', flush=True)
print() # Move to the next line
return ''.join(password)
def hack(system_name):
global seen_markus
# Find the system in the all_systems list
system = next((s for s in all_systems if s['name'].lower() == system_name.lower()), None)
if system:
if system['level'] == player_level:
# Check for CodeShatter before prompting for password
if system['name'] == 'Markus' and has_item("CodeShatter"):
clear_terminal()
code_shatter_minigame()
print_slow("Password Cracked: 735@&!//")
input("Press [Enter] to continue")
clear_terminal()
markus_system_command_loop(markus_system)
add_level(player_level)
remove_from_inventory(item="CodeShatter")
seen_markus = True
elif system['name'] == 'Lobby Camera' and has_item("EyeSpy"):
port_scanning()
add_level(player_level)
camera_first()
else:
# Prompt the user for the password
print_slow("")
password = getpass_star("Enter password: ")
print_slow("")
if password == system['password']:
print_slow("")
print_slow(Fore.GREEN + "Access granted!" + Style.RESET_ALL)
if system['name'] == 'Amy':
amy_system_command_loop(amy_system)
elif system['name'] == 'Billy':
billy_system_command_loop(billy_system)
elif system['name'] == 'Markus':
markus_system_command_loop(markus_system)
add_level(player_level)
seen_markus = True
elif system['name'] == 'Lobby Camera':
camera_first()
elif system['name'] == 'Kyle':
# Implement Kyle System
else:
# Add more conditions for other systems
pass
else:
print_slow("")
print_slow(Fore.RED + "Access denied! Incorrect password." + Style.RESET_ALL)
else:
print_slow("")
print_slow(Fore.RED + "System not found! Please try again." + Style.RESET_ALL)
else:
print_slow("")
print_slow(Fore.RED + "System not found! Please try again." + Style.RESET_ALL)
def list_emails(emails):
print_slow(Fore.LIGHTBLUE_EX + "\nEmails:" + Style.RESET_ALL)
for i, email in enumerate(emails):
print_slow(Fore.LIGHTBLUE_EX + f"\n{email['subject']} - From: {email['sender']}" + Style.RESET_ALL)
def read_email(emails, subject):
global has_read_email, evidence
global balance
email_found = False
for email in emails:
if email['subject'].lower() == subject.lower():
email_found = True
print_slow(
Fore.LIGHTBLUE_EX + f"\nFrom: {email['sender']}\nSubject: {email['subject']}\n\n{email['body']}" + Style.RESET_ALL)
# Check if the email is one of the specific emails that increases evidence count
if email['subject'].lower() in ["project update"]:
evidence_item = 3
if not has_evidence(evidence_item):
print_slow("Adding evidence to the list...")
print_slow("")
print_slow(Fore.GREEN + "Evidence Secured" + Style.RESET_ALL)
add_evidence(evidence_item)
print_slow("")
print_slow("")
time.sleep(3)
print_slow(Fore.GREEN + "Incoming Call..." + Style.RESET_ALL)
input(Fore.GREEN + "> " + Style.RESET_ALL)
third_call()
if email['subject'].lower() in ["professional development"]:
evidence_item = 2
if not has_evidence(evidence_item):
print_slow("Adding evidence to the list...")
print_slow("")
print_slow(Fore.GREEN + "Evidence Secured" + Style.RESET_ALL)
add_evidence(evidence_item)
print_slow("")
print_slow("")
time.sleep(3)
print_slow(Fore.GREEN + "Incoming Call..." + Style.RESET_ALL)
input(Fore.GREEN + "> " + Style.RESET_ALL)
second_call()
if email['subject'].lower() == "can't stop thinking about you" and email['sender'].lower() == 'amy':
evidence_item = 1
if not has_evidence(evidence_item):
print_slow("Adding evidence to the list...")
print_slow("")
print_slow(Fore.GREEN + "Evidence Secured" + Style.RESET_ALL)
add_evidence(evidence_item)
print_slow("")
print_slow("")
time.sleep(3)
print_slow(Fore.GREEN + "Incoming Call..." + Style.RESET_ALL)
input(Fore.GREEN + "> " + Style.RESET_ALL)
first_call()
if email['subject'].lower() == "upcoming software update" and email['sender'].lower() == 'markus':
evidence_item = 6
if not has_evidence(evidence_item):
print_slow("Adding evidence to the list...")
print_slow("")
print_slow(Fore.GREEN + "Evidence Secured" + Style.RESET_ALL)
add_evidence(evidence_item)
print_slow("")
print_slow("")
time.sleep(3)
print_slow(Fore.GREEN + "Incoming Call..." + Style.RESET_ALL)
input(Fore.GREEN + "> " + Style.RESET_ALL)
sixth_call()
# Add money to balance based on the email subject
if email['subject'].lower() == "professional development":
balance += 30
elif email['subject'].lower() == "project update":
balance += 50
elif email['subject'].lower() == "can't stop thinking about you":
balance += 20
elif email['subject'].lower() == "upcoming software update":
balance += 50
if not email_found:
print_slow(Fore.RED + "\nNo email found with that subject, please try again." + Style.RESET_ALL)
def connect():
if has_item("EnigmaLink"):
print_slow("")
print_slow(Fore.GREEN + "Connecting to Enigma Corps network using EnigmaLink..." + Style.RESET_ALL)
time.sleep(0.5)
print_slow("")
print_slow(Fore.GREEN + "Establishing connection...")
time.sleep(1)
print_slow("")
print_slow(Fore.GREEN + "Linking EnigmaLink to remote server...")
time.sleep(2)
print_slow("")
print_slow(Fore.GREEN + "Decrypting server security protocols...")
time.sleep(3)
print_slow("")
print_slow(Fore.GREEN + "Bypassing firewall...")
time.sleep(2)
print_slow("")
print_slow(Fore.GREEN + "Connection established!")
time.sleep(2)
print_slow("")
print_slow(Fore.GREEN + "You are now connected to Enigma Corps network.")
print_slow("")
# Network command loop
while True:
command = input(Fore.GREEN + "> " + Style.RESET_ALL)
# Scan the network for systems and vulnerabilities
if command.lower() == "scan":
scan()
# Hack into a system or vulnerability
elif command.lower().startswith("hack "):
target = command[5:]
hack(target)
# Display connect help message
elif command.lower() == "help":
connect_help()
# Exit the network
elif command.lower() == "exit":
print_slow("Disconnecting from EnigmaLink...")
time.sleep(2)
print_slow("")
print_slow("Connection terminated.")
print_slow("")
time.sleep(1)
start_game()
else:
print_slow("Invalid command, please try again.")
else:
print_slow(
Fore.RED + "You need to purchase EnigmaLink from the shop to connect to Enigma Corps network." + Style.RESET_ALL)
def mail():
print_slow("")
print_slow(Fore.LIGHTBLUE_EX + "Mail System:" + Style.RESET_ALL)
while True:
command = input(
Fore.LIGHTBLUE_EX + "\n> " + Style.RESET_ALL)
if command.lower() == 'l':
# List emails
list_emails(emails)
elif command.lower().startswith('r '):
# Read email
subject = command[2:]
read_email(emails, subject)
elif command.lower() == 'clear':
clear_terminal()
elif command.lower() == 'help':
# Display mail help message
mail_help()
elif command.lower() == 'exit':
# Exit mail system
print_slow(Fore.LIGHTBLUE_EX + "\nExiting Mail System..." + Style.RESET_ALL)
print_slow("")
time.sleep(1)
start_game()
else:
print_slow(Fore.RED + "\nInvalid command, please try again." + Style.RESET_ALL)
# Function to list emails
# List of all systems in the game
all_systems = [
{"name": "Amy", "type": "Computer", "level": 1, "password": "sexinthecity"},
{"name": "Markus", "type": "Computer", "level": 1, "password": "735@&!//"},
{"name": "Billy", "type": "Computer", "level": 1, "password": "football"},
{"name": "Lobby Camera", "type": "Camera", "level": 2, "password": "camera1"},
{"name": "Kyle", "type": "Computer", "level": 3, "password": "12345"},
{"name": "Camera2", "type": "Camera", "level": 4, "password": "camera2"},
{"name": "Server", "type": "Computer", "level": 5, "password": "server123"}
]
def amy_system_command_loop(system):
print_slow("")
print_slow(Fore.YELLOW + "Connected to Amy's system." + Style.RESET_ALL)
while True:
command = input(Fore.YELLOW + "> " + Style.RESET_ALL)
if command.lower() == "l":
system.list_files()
elif command.lower().startswith("r "):
file_name = command[2:]
file_content = system.read_file(file_name) # Store the file content in a variable
if file_content: # Check if the file was found
read_file(file_content, file_name) # Pass the file content to the read_file function
elif command.lower() == "mail":
amy_mail()
elif command.lower() == "clear":
clear_terminal()
elif command.lower() == "help":
system_help()
elif command.lower() == "disconnect":
print_slow(Fore.YELLOW + "\nDisconnecting from system...")
print_slow("")
time.sleep(1)
print_slow(Fore.YELLOW + "\nDisconnected ")
break
else:
print_slow(Fore.RED + "\nInvalid command, please try again." + Style.RESET_ALL)
# Function to access Amy's mail system
def amy_mail():
print_slow("")
print_slow(Fore.LIGHTBLUE_EX + "Amy's Mail System:" + Style.RESET_ALL)
while True:
command = input(
Fore.LIGHTBLUE_EX + "\n> " + Style.RESET_ALL)
if command.lower() == 'l':
# List emails
list_emails(amy_system.emails)
elif command.lower().startswith('r '):
# Read email
subject = command[2:]
read_email(amy_system.emails, subject)
elif command.lower() == 'help':
# Display mail help message
mail_help()
elif command.lower() == 'clear':
clear_terminal()
elif command.lower() == 'exit':
# Exit mail system
print_slow(Fore.LIGHTBLUE_EX + "\nExiting Mail System..." + Style.RESET_ALL)
break
else:
print_slow(Fore.RED + "\nInvalid command, please try again." + Style.RESET_ALL)
def billy_system_command_loop(system):
print_slow("")
print_slow(Fore.YELLOW + "Connected to Billy's system." + Style.RESET_ALL)
while True:
command = input(Fore.YELLOW + "> " + Style.RESET_ALL)
if command.lower() == "l":
system.list_files()
print_slow("")
elif command.lower().startswith("r "):
file_name = command[2:]
file_content = system.read_file(file_name) # Store the file content in a variable
if file_content: # Check if the file was found
read_file(file_content, file_name) # Pass the file content to the read_file function
elif command.lower() == "mail":
billy_mail()
elif command.lower() == "help":
system_help()
elif command.lower() == "clear":
clear_terminal()
elif command.lower() == "disconnect":
print_slow(Fore.YELLOW + "\nDisconnecting from system...")
print_slow("")
time.sleep(1)
print_slow(Fore.YELLOW + "\nDisconnected ")
break
else:
print_slow(Fore.RED + "\nInvalid command, please try again." + Style.RESET_ALL)
def billy_mail():
print_slow("")
print_slow(Fore.LIGHTBLUE_EX + "Billy's Mail System:" + Style.RESET_ALL)
while True:
command = input(
Fore.LIGHTBLUE_EX + "\n> " + Style.RESET_ALL)
if command.lower() == 'l':
# List emails
list_emails(billy_system.emails)
elif command.lower().startswith('r '):
# Read email
subject = command[2:]
read_email(billy_system.emails, subject)
elif command.lower() == 'help':
# Display mail help message
mail_help()
elif command.lower() == 'exit':
# Exit mail system
print_slow(Fore.LIGHTBLUE_EX + "\nExiting Mail System..." + Style.RESET_ALL)
break
else:
print_slow(Fore.RED + "\nInvalid command, please try again." + Style.RESET_ALL)
def markus_system_command_loop(system):
print_slow("")
print_slow(Fore.YELLOW + "Connected to Markus' system." + Style.RESET_ALL)
while True:
command = input(Fore.YELLOW + "> " + Style.RESET_ALL)
if command.lower() == "l":
system.list_files()
print_slow("")
elif command.lower().startswith("r "):
file_name = command[2:]
file_content = system.read_file(file_name) # Store the file content in a variable
if file_content: # Check if the file was found
read_file(file_content, file_name) # Pass the file content to the read_file function
elif command.lower() == "mail":
markus_mail()
elif command.lower() == "help":
system_help()
elif command.lower() == "disconnect":
print_slow(Fore.YELLOW + "\nDisconnecting from system...")
print_slow("")
time.sleep(1)
print_slow(Fore.YELLOW + "\nDisconnected ")
break
else:
print_slow(Fore.RED + "\nInvalid command, please try again." + Style.RESET_ALL)
# Function to access Amy's mail system
def markus_mail():
print_slow("")
print_slow(Fore.LIGHTBLUE_EX + "Markus' Mail System:" + Style.RESET_ALL)
while True:
command = input(
Fore.LIGHTBLUE_EX + "\n> " + Style.RESET_ALL)
if command.lower() == 'l':
# List emails
list_emails(markus_system.emails)
elif command.lower().startswith('r '):
# Read email
subject = command[2:]
read_email(markus_system.emails, subject)
elif command.lower() == 'help':
# Display mail help message
mail_help()
elif command.lower() == 'exit':
# Exit mail system
print_slow(Fore.LIGHTBLUE_EX + "\nExiting Mail System..." + Style.RESET_ALL)
break
else:
print_slow(Fore.RED + "\nInvalid command, please try again." + Style.RESET_ALL)
# Run the main function when the script is executed
if __name__ == "__main__":
main()