-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
5597 lines (4613 loc) · 272 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
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Imports
import base64
import getpass
import random as r
import sys
import time as cas
import webbrowser
import time
from tkinter import messagebox
from types import NoneType
import cv2
import numpy as np
import pygame
import requests
from bs4 import BeautifulSoup as bs
from ffpyplayer.player import MediaPlayer
from camera import Camera
from config import *
from controls import Controls
from leaderboard import Leaderboard
from lyz import Cinematic, Lyziarsky
from quest import Quest
from save_progress import SaveProgress
from sprites import *
class Game:
"""
Main class for game
"""
def __init__(self):
"""
Main game
"""
# Pygame initialization
pygame.init()
# Game version
# web = requests.get('https://aeternix-forum.herokuapp.com/releases/')
# soup = bs(web.text, 'html.parser').find('main').find_next('main').find_next('div').find_next('h1').text.split("v")[-1] if web.status_code != 503 else None
self.__LOCAL_VERSION__ = 1.21 # float(open('version_info.txt', 'r').read())
self.__REMOTE_VERSION__ = 1.21 # float(soup) if soup is not None else self.__LOCAL_VERSION__
# Screen, time, font, running
self.screen = pygame.display.set_mode((WIN_WIDTH, WIN_HEIGHT))
'''Main game screen'''
self.clock = pygame.time.Clock()
'''FPS shenanigans'''
self.game_running = True
'''Ye, it's running alright'''
self.big_font = pygame.font.Font("Caveat.ttf", 40)
'''BIIG FOOONT'''
self.bigger_font = pygame.font.Font("Caveat.ttf", 32)
'''BIGGERR FOOONT'''
self.font = pygame.font.Font("Roboto.ttf", 22)
'''just a normal font'''
self.small_font = pygame.font.Font("Roboto.ttf", 12)
'''Small font for long texts'''
self.settings_font = pygame.font.Font("Caveat.ttf", 45)
'''Another font, but now usable for settings'''
self.lrob_font = pygame.font.Font("Roboto.ttf", 13)
'''And there was also an OSY font'''
self.timer_font = pygame.font.Font("Roboto.ttf", 155)
'''Font for showing the timer for certain things'''
# Spritesheets
self.character_spritesheet = Spritesheet("img/character.png")
self.terrain_spritesheet = Spritesheet("img/terrain.png")
self.npcs_spritesheet = Spritesheet("img/npc.png")
# Inrto and Game Over backgrounds
self.intro_background = pygame.image.load("img/intro_background.png")
self.settings_background = pygame.image.load("img/settings_bg.jpg")
# Window icon and title
icon = pygame.image.load('img/spselogo2.png')
pygame.display.set_icon(icon)
pygame.display.set_caption('SPŠE ADVENTURE - REVENGEANCE')
self.rooms: List[List[str]] = [ground_floor, first_floor, second_floor, third_floor, fourth_floor, ending_hallway, basement]
'''Rooms where player can go'''
self.lyz_rooms: List[List[str]] = [lyz_outside, lyz_ground, lyz_first, lyz_second, lyz_room, lyz_ski_map, lyz_reject_room, lyz_fifa_room, lyz_diner, lyz_outside_modif]
'''Rooms where player can go in the Lyziarsky DLC'''
self.in_room: List[str] = self.rooms[GROUND_FLOOR]
'''Floor where player is rn (starting point) that's ground floor for those who don't know'''
self.saved_room_data: str = "017"
'''Room where player is rn (starting point) that's Satna for those who don't know'''
self.quest = Quest(self)
'''More complex quests'''
self.controls = Controls(self)
'''Controls to set for the game - usually those you play with'''
self.animations = Cinematic(self)
'''Used for cinematic shorts, breaks between quests for longer playtime'''
self.grades: dict[str, int] = {}
'''Player's grades'''
self.endings: List[str] = []
'''Endings that player has already achieved'''
self.camera = Camera(self)
'''Camera for the game'''
self.leaderboarding = Leaderboard(self)
'''Yes, good name for a specific yet easy to use variable, used only once'''
# Player name and password
self.player_name: str = ""
self._password: str = "P@ssw0rd.+"
self.time_played = cas.time()
# Lyziarksy DLC variables
self.bought: bool = True
'''Player has bought the DLC'''
self.lyz_saved_data: str = ""
'''Just in case you get lost on Lyziarsky'''
self.lyz_in_room = self.lyz_rooms[OUTSIDE]
'''Where are you hiding???'''
self.lyz_created: bool = False
'''Are we there yet?'''
# LYZ quests
self.vybalenie: bool = True
self.nap: bool = True
self.friends: bool = True
# 2nd day
self.ski_suit_on: bool = True
self.skied_two: bool = True
self.talked_with_teacher: bool = True
# 3rd day
self.lyz_bratko_count = 1
self.lyz_repaired_speaker: bool = True
self.repaired_bed = True
self.cards = True
# 4th day
self.ski_suit: bool = True
self.skied_four: bool = True
self.enjoyed_show: bool = True
self.lyz_samko_follow_counter = 0
# ...
self.lyz_day_number: int = 1
self.lyz_day = Lyziarsky(self, self.lyz_day_number)
# Settings
self.music_on: bool = True
'''Music on/off'''
self.talking_speed_number: int = 90
'''Talking speed for the game'''
self.reseting_game_values()
# Npc list
self.npc = []
# Sounds
self.wow_iphone = pygame.mixer.Sound("sounds/wow_iphone.mp3")
self.wow_iphone.set_volume(0.5)
self.lyz_poof = pygame.mixer.Sound("sounds/poof.mp3")
self.lyz_poof.set_volume(0.3)
self.theme = pygame.mixer.Sound("sounds/theme.mp3")
self.theme.set_volume(0.25)
self.kacurovanie = pygame.mixer.Sound("sounds/kacurovanie.mp3")
self.kacurovanie.set_volume(0.05)
self.tsv_theme = pygame.mixer.Sound("sounds/bench.mp3")
self.tsv_theme.set_volume(0.05)
self.fall = pygame.mixer.Sound("sounds/fall.mp3")
self.fall.set_volume(0.25)
self.lost = pygame.mixer.Sound("sounds/lost.mp3")
self.lost.set_volume(0.5)
self.lock = pygame.mixer.Sound("sounds/lock.mp3")
self.lock.set_volume(0.25)
self.door_open = pygame.mixer.Sound("sounds/door.mp3")
self.door_open.set_volume(0.25)
self.speed = pygame.mixer.Sound("sounds/speed.mp3")
self.speed.set_volume(0.15)
self.wrong_house = pygame.mixer.Sound("sounds/wrong_house.mp3")
self.wrong_house.set_volume(0.5)
self.guy = pygame.mixer.Sound("sounds/lost_guy.mp3")
self.guy.set_volume(0.15)
self.lucky = pygame.mixer.Sound("sounds/lucky.mp3")
self.lucky.set_volume(0.25)
self.unlucky = pygame.mixer.Sound("sounds/unlucky.mp3")
self.unlucky.set_volume(0.1)
# Lost guy
self.g_move = False
self.g_leave = False
self.player_follow = False
self.show_update()
def __new_version(self): return True if self.__LOCAL_VERSION__ < self.__REMOTE_VERSION__ else False
def show_update(self):
if self.__new_version():
if messagebox.askyesno("New update", "Update the game?"):
webbrowser.open('-------------------------')
sys.exit()
else: sys.exit()
def set_level_camera(self, level: List[str]):
"""
Moves camera and player to stairs
"""
# Ground floor
if level == self.rooms[GROUND_FLOOR]:
for sprite in self.all_sprites:
sprite.rect.x -= 39 * TILE_SIZE
sprite.rect.y -= 7 * TILE_SIZE
self.player.rect.x -= 120 * TILE_SIZE
self.player.rect.y += 8 * TILE_SIZE
# First floor
elif level == self.rooms[FIRST_FLOOR]:
for sprite in self.all_sprites:
sprite.rect.x -= 47 * TILE_SIZE
sprite.rect.y -= 17 * TILE_SIZE
self.player.rect.x -= 124 * TILE_SIZE
self.player.rect.y += 2 * TILE_SIZE
# Second floor
elif level == self.rooms[SECOND_FLOOR]:
for sprite in self.all_sprites:
sprite.rect.x -= 47 * TILE_SIZE
sprite.rect.y -= 19 * TILE_SIZE
self.player.rect.x -= 124 * TILE_SIZE
self.player.rect.y += 2 * TILE_SIZE
# Third floor
elif level == self.rooms[THIRD_FLOOR]:
for sprite in self.all_sprites:
sprite.rect.x -= 62 * TILE_SIZE
sprite.rect.y -= 4 * TILE_SIZE
# Fourth floor
elif level == self.rooms[FOURTH_FLOOR]:
for sprite in self.all_sprites:
sprite.rect.x -= 62 * TILE_SIZE
sprite.rect.y -= 4 * TILE_SIZE
# Basement
elif level == self.rooms[BASEMENT_FLOOR]:
for sprite in self.all_sprites: sprite.rect.x -= 34 * TILE_SIZE
self.player.rect.x -= 45 * TILE_SIZE
def reseting_game_values(self):
"""
When player wants to restart
"""
# Room and floor
self.saved_room_data = "017"
self.in_room = self.rooms[GROUND_FLOOR]
self.lyz_saved_data = ''
self.lyz_in_room = self.lyz_rooms[OUTSIDE]
self.lyz_created = False
# Objects you can interact with
self.interacted: List[str] = ["", "", "", "", ""]
self.interactive = {}
# Inventory
self.inv: dict[str, str] = {}
# Variables for endings
self.without_light: int = 0
self.caught: int = 0
# LYZ quests
self.vybalenie: bool = True
self.nap: bool = True
self.friends: bool = True
self.ski_suit_on: bool = True
self.skied_two: bool = True
self.talked_with_teacher: bool = True
self.lyz_day_number: int = 1
self.lyz_repaired_speaker = True
self.repaired_bed = True
self.cards = True
self.ski_suit = True
self.skied_four = True
self.enjoyed_show = True
# Quests variables
self.__gul_counter: int = 0
self.connected_router = True
# Variables for finding items/doing stuff
self.lyz_samko_follow = False
self.lyz_bratko_follow = False
self.lyz_samko_preko_follow = False
self.key_in_trash: bool = True
self.locked_locker: bool = True
self.locked_changing_room: bool = True
self.amper_locked: bool = True
self.amper_key_in_trash: bool = True
self.number_kokosky: int = 0
self.kokosky_in_locker: bool = True
self.kokosky_in_bookshelf: bool = True
self.kokosky_under_bench: bool = True
self.kokosky_in_trash: bool = True
self.vtipnicek: bool = True
self.dumbbell_lifted: bool = True
self.program_test: bool = True
self.phone_in_trash: bool = True
self.suplovanie: bool = True
self.anj_test: bool = True
self.mat_test: bool = True
self.sjl_test: bool = True
self.obn_test: bool = True
self.referat: bool = True
self.gul_quest: bool = True
self.nepusti: bool = True
self.closed_window: bool = True
self.five_min_sooner: bool = True
self.resistor: bool = True
self.osy: bool = True
self.iot: bool = True
self.icdl: bool = True
self.haram_test: bool = True
self.lost_guy: bool = True
self.not_saint: bool = True
self.prayed: bool = False
self.locker_stuff: dict[str, bool] = {"crocs": True, "boots": False, "key": True}
# Bananok
self.number_bananok: int = 0
self.bananky_in_trash: dict[str, dict[str, int]] = {
"ground floor": {
"2113": 2,
"2313": 3,
"3413": 4,
"8313": 1,
"8513": 5,
"10513": 3,
"14113": 2,
"16313": 1,
"2021": 4,
"3021": 2,
"9321": 3,
"12921": 2
},
"first floor": {
"1747": 1,
"7823": 1,
"8023": 2,
"11323": 3,
"11523": 2,
"16724": 4,
"10231": 2,
"138": 2,
"7038": 5,
"15638": 2
},
"second floor": {
"16712": 3,
"13415": 2,
"9624": 2,
"11324": 4,
"13224": 2,
"16725": 1,
"139": 1
},
"fourth floor":{
"557": 2,
"5516": 2
}
}
self.bananky_on_ground: dict[str, dict[str, bool]] = {
"ground floor": {
"11": True,
"151": True,
"161": True,
"181": True,
"191": True,
"211": True,
"641": True,
"831": True,
"851": True,
"1031": True,
"1201": True,
"1411": True,
"1431": True,
"1631": True,
"12": True,
"152": True,
"162": True,
"182": True,
"192": True,
"212": True,
"642": True,
"832": True,
"852": True,
"1032": True,
"1202": True,
"1412": True,
"1432": True,
"1632": True,
"13": True,
"14": True,
"15": True,
"16": True,
"17": True,
"18": True,
"1059": True,
"1189": True,
"10510": True,
"11810": True,
"2311": True,
"11811": True,
"2312": True,
"4312": True,
"4313": True,
"10421": True,
"14721": True,
"14821": True,
"14722": True,
"14822": True,
"127": True,
"227": True,
"327": True,
"427": True,
"527": True,
"627": True,
"727": True,
"827": True,
"927": True,
"1027": True,
"10427": True
},
"first floor": {
"1671": True,
"1681": True,
"1691": True,
"1701": True,
"1891": True,
"1901": True,
"1911": True,
"1672": True,
"1682": True,
"1692": True,
"1673": True,
"1683": True,
"1674": True,
"1897": True,
"1907": True,
"1917": True,
"1899": True,
"1909": True,
"1919": True,
"7611": True,
"7711": True,
"7811": True,
"9311": True,
"9411": True,
"9511": True,
"9611": True,
"12811": True,
"12911": True,
"13011": True,
"13111": True,
"13211": True,
"15711": True,
"15811": True,
"15911": True,
"7612": True,
"7712": True,
"7812": True,
"9312": True,
"9412": True,
"9512": True,
"9612": True,
"12812": True,
"12912": True,
"13012": True,
"13112": True,
"13212": True,
"15712": True,
"15812": True,
"15912": True,
"18915": True,
"19015": True,
"19115": True,
"18831": True,
"18931": True,
"19031": True,
"19131": True,
"18832": True,
"18932": True,
"19032": True,
"19132": True,
"18833": True,
"18933": True,
"19033": True,
"19133": True,
"10238": True,
"10338": True,
"10438": True,
"10538": True
},
"second floor": {
"1671": True,
"1681": True,
"1691": True,
"1701": True,
"1711": True,
"1721": True,
"1731": True,
"1741": True,
"1751": True,
"1761": True,
"1771": True,
"1781": True,
"1791": True,
"1801": True,
"1811": True,
"1821": True,
"1831": True,
"1841": True,
"1851": True,
"1861": True,
"1871": True,
"1881": True,
"1891": True,
"1901": True,
"1911": True,
"1893": True,
"1903": True,
"1913": True,
"115": True,
"215": True,
"315": True,
"415": True,
"515": True,
"615": True,
"715": True,
"815": True,
"915": True,
"1015": True,
"1215": True,
"2615": True,
"6115": True,
"8015": True,
"8115": True,
"11515": True,
"11615": True,
"14415": True,
"1216": True,
"2616": True,
"6116": True,
"8016": True,
"8116": True,
"11516": True,
"11616": True,
"14416": True,
"1217": True,
"1218": True,
"1219": True,
"2619": True,
"6119": True,
"8019": True,
"8119": True,
"11519": True,
"11619": True,
"14419": True,
"1220": True,
"2620": True,
"6120": True,
"8020": True,
"8120": True,
"11520": True,
"11620": True,
"14420": True,
"1221": True,
"1222": True,
"1223": True,
"2623": True,
"6123": True,
"8023": True,
"8123": True,
"11523": True,
"11623": True,
"14423": True,
"1224": True,
"2624": True,
"6124": True,
"8024": True,
"8124": True,
"11524": True,
"11624": True,
"14424": True,
"125": True,
"126": True,
"128": True,
"129": True,
"131": True,
"132": True,
"12132": True,
"12232": True,
"12432": True,
"12532": True,
"12732": True,
"12832": True,
"13032": True,
"13132": True,
"13232": True,
"14132": True,
"14232": True,
"14432": True,
"14532": True,
"14732": True,
"14832": True,
"15032": True,
"15132": True,
"15232": True,
"14133": True,
"14233": True,
"14433": True,
"14533": True,
"14733": True,
"14833": True,
"15033": True,
"15133": True,
"15233": True,
"134": True,
"135": True,
"4735": True,
"4835": True,
"5135": True,
"5235": True,
"5935": True,
"6035": True,
"6235": True,
"6335": True,
"4736": True,
"4836": True,
"5136": True,
"5236": True,
"5936": True,
"6036": True,
"6236": True,
"6336": True,
"4737": True,
"4837": True,
"4937": True,
"5037": True,
"5137": True,
"5237": True,
"5937": True,
"6037": True,
"6137": True,
"6237": True,
"6337": True,
"1238": True,
"1338": True,
"13938": True,
"14038": True,
"14238": True,
"14338": True,
"14538": True,
"14638": True,
"14838": True,
"14938": True,
"15138": True,
"15238": True,
"1239": True,
"1339": True,
"12139": True,
"12239": True,
"12439": True,
"12539": True,
"12739": True,
"12839": True,
"13039": True,
"13139": True,
"13239": True,
"13939": True,
"14039": True,
"14239": True,
"14339": True,
"14539": True,
"14639": True,
"14839": True,
"14939": True,
"15139": True,
"15239": True,
"18239": True,
"18339": True,
"18439": True,
"18539": True,
"18639": True
},
"third floor": {
"11": True,
"21": True,
"31": True,
"41": True,
"51": True,
"61": True,
"71": True,
"81": True,
"91": True,
"101": True,
"12": True,
"22": True,
"32": True,
"42": True,
"52": True,
"62": True,
"72": True,
"82": True,
"92": True,
"102": True,
"13": True,
"23": True,
"33": True,
"43": True,
"53": True,
"63": True,
"73": True,
"83": True,
"93": True,
"103": True,
"14": True,
"24": True,
"34": True,
"44": True,
"54": True,
"64": True,
"74": True,
"84": True,
"94": True,
"104": True,
"15": True,
"25": True,
"35": True,
"45": True,
"55": True,
"65": True,
"75": True,
"85": True,
"95": True,
"105": True,
"16": True,
"26": True,
"36": True,
"46": True,
"56": True,
"66": True,
"76": True,
"86": True,
"96": True,
"106": True,
"7318": True,
"7418": True,
"7518": True,
"7618": True,
"7718": True,
"7818": True,
"7918": True,
"8018": True,
"8118": True,
"8218": True
},
"fourth floor": {
"5515": True,
"6418": True,
"6518": True,
"6718": True,
"6818": True,
"7018": True,
"7118": True,
"7318": True,
"7418": True,
"7618": True,
"7718": True,
"5526": True,
"5626": True,
"5726": True,
"5826": True,
"6426": True,
"6526": True,
"6726": True,
"6826": True,
"7026": True,
"7126": True,
"7326": True,
"7426": True,
"7626": True,
"7726": True
}
}
# Amper stuff
self.amper_stuff = ["level teleporter", "referat", "map", "retake", "vujcheek fender"]
# Grader
self.grades: dict[str, int] = {}
def create_tile_map(self, room: List[str] = None, regenerate: bool = False):
"""
Creates tile map
"""
self.interactive = {}
floors = ["ground floor", "first floor", "second floor", "third floor", "fourth floor", "ending hallway", "basement"]
# Destroying previous sprites
for sprite in self.all_sprites: sprite.kill()
# Creating sprites
if self.lyz_created:
if room is not None: tmp_room: list[str] = room
else: tmp_room: List[str] = self.samko_placement() if self.lyz_in_room != self.lyz_rooms[LYZ_SKI_MAP] else self.lyz_in_room # Room with Samko
if self.lyz_day_number == 5 and not regenerate: self.lyz_in_room = lyz_outside_modif.copy(); tmp_room = self.lyz_in_room.copy(); self.lyz_saved_room_data = 'outside_modif'
for i, row in enumerate(tmp_room):
for j, column in enumerate(row):
Ground(self, j, i, snow=True) if self.lyz_saved_data not in ('diner', 'ground', 'first', 'second', 'room', 'rejected_room', 'fifa_room') else Ground(self, j, i)
if column == '´': Ground(self, j, i, dirt=True)
if column == "↨": Ground(self, j, i, carpet=True)
elif column == "P": self.player = Player(self, j, i) # Player
elif column in ("!", "W"): Block(self, j, i, column) # No entry ground
elif column == "w": self.interactive[Block(self, j, i, "w")] = "w" + str(i) + str(j) # Window
elif column == "L": self.interactive[Block(self, j, i, "L")] = "L" + str(i) + str(j) # Locker
elif column == "Ľ": self.interactive[Block(self, j, i, "Ľ")] = "Ľ" + str(i) + str(j) # Locker
elif column == "ľ": self.interactive[Block(self, j, i, "ľ")] = "ľ" + str(i) + str(j) # Locker
elif column == "S": self.interactive[Block(self, j, i, "S")] = "S" + str(i) + str(j) # Stairs
elif column == "Z": self.interactive[Block(self, j, i, "Z")] = "Z" + str(i) + str(j) # Stairs
elif column == "s": self.interactive[Block(self, j, i, "s")] = "s" + str(i) + str(j) # Stairs down
elif column == "z": self.interactive[Block(self, j, i, "z")] = "z" + str(i) + str(j) # Stairs down
elif column == "D": self.interactive[Block(self, j, i, "D")] = "D" + str(i) + str(j) # Door
elif column == "G": self.interactive[Block(self, j, i, "G")] = "G" + str(i) + str(j) # Glass door
elif column == "B": self.interactive[Block(self, j, i, "B")] = "B" + str(i) + str(j) # Bench (vertical)
elif column == "h": self.interactive[Block(self, j, i, "h")] = "h" + str(i) + str(j) # Bench (horizontal)
elif column == "y": self.interactive[Block(self, j, i, "y")] = "y" + str(i) + str(j) # Benchpress
elif column == "Y": self.interactive[Block(self, j, i, "Y")] = "Y" + str(i) + str(j) # Benchpress with dumbbells
elif column == "l": self.interactive[Block(self, j, i, "l")] = "l" + str(i) + str(j) # Desk + chair (vertical) left
elif column == "k": self.interactive[Block(self, j, i, "k")] = "k" + str(i) + str(j) # Desk no chair (vertical) left
elif column == "é": self.interactive[Block(self, j, i, "é")] = "é" + str(i) + str(j) # Desk special (vertical)
elif column == "u": self.interactive[Block(self, j, i, "u")] = "u" + str(i) + str(j) # Desk + chair (vertical) right
elif column == "ä": self.interactive[Block(self, j, i, "ä")] = "ä" + str(i) + str(j) # Desk + chair + baterries (vertical) right
elif column == "e": self.interactive[Block(self, j, i, "e")] = "e" + str(i) + str(j) # Desk no chair (vertical) right
elif column == "g": self.interactive[Block(self, j, i, "g")] = "g" + str(i) + str(j) # Desk + chair + PC (vertical) right
elif column == "a": self.interactive[Block(self, j, i, "a")] = "a" + str(i) + str(j) # Desk + chair + PC (vertical) left
elif column == "U": self.interactive[Block(self, j, i, "U")] = "U" + str(i) + str(j) # LCUJ Desk
elif column == "J": self.interactive[Block(self, j, i, "J")] = "J" + str(i) + str(j) # LCUJ Desk
elif column == "j": self.interactive[Block(self, j, i, "j")] = "j" + str(i) + str(j) # Desk + chair (horizontal) up
elif column == "m": self.interactive[Block(self, j, i, "m")] = "m" + str(i) + str(j) # Desk no chair (horizontal) up
elif column == "i": self.interactive[Block(self, j, i, "i")] = "i" + str(i) + str(j) # Desk + chair (horizontal) down
elif column == "n": self.interactive[Block(self, j, i, "n")] = "n" + str(i) + str(j) # Desk no chair (horizontal) down
elif column == "q": self.interactive[Block(self, j, i, "q")] = "q" + str(i) + str(j) # Desk + chair + PC (horizontal) up
elif column == "Q": self.interactive[Block(self, j, i, "Q")] = "Q" + str(i) + str(j) # Desk + chair + PC (horizontal) down
elif column == "t": self.interactive[Block(self, j, i, "t")] = "t" + str(i) + str(j) # Trashcan
elif column == "T": self.interactive[Block(self, j, i, "T")] = "T" + str(i) + str(j) # Toilet
elif column == "Ť": self.interactive[Block(self, j, i, "Ť")] = "Ť" + str(i) + str(j) # Toilet
elif column == "R": self.interactive[Block(self, j, i, "R")] = "R" + str(i) + str(j) # Rails
elif column == "r": self.interactive[Block(self, j, i, "r")] = "r" + str(i) + str(j) # Rails
elif column == "Ř": self.interactive[Block(self, j, i, "Ř")] = "Ř" + str(i) + str(j) # Rails ground_floor
elif column == "Ŕ": self.interactive[Block(self, j, i, "Ŕ")] = "Ŕ" + str(i) + str(j) # Rails second_floor
elif column == "ŕ": self.interactive[Block(self, j, i, "ŕ")] = "ŕ" + str(i) + str(j) # Rails second_floor
elif column == "ř": self.interactive[Block(self, j, i, "ř")] = "ř" + str(i) + str(j) # Rails ground_floor
elif column == "/": self.interactive[Block(self, j, i, "/")] = "/" + str(i) + str(j) # Rails fourth_floor
elif column == "|": self.interactive[Block(self, j, i, "|")] = "|" + str(i) + str(j) # Rails fourth_floor
elif column == "b": self.interactive[Block(self, j, i, "b")] = "b" + str(i) + str(j) # Basement
elif column == "d": self.interactive[Block(self, j, i, "d")] = "d" + str(i) + str(j) # Basement
elif column == "O": self.interactive[Block(self, j, i, "O")] = "O" + str(i) + str(j) # Bookshelf
elif column == "o": self.interactive[Block(self, j, i, "o")] = "o" + str(i) + str(j) # Bookshelf
elif column == "ó": self.interactive[Block(self, j, i, "ó")] = "ó" + str(i) + str(j) # Bookshelf
elif column == "Ó": self.interactive[Block(self, j, i, "Ó")] = "Ó" + str(i) + str(j) # Bookshelf
elif column == "]": self.interactive[Block(self, j, i, "]")] = "]" + str(i) + str(j) # Whiteboard -> (that way)
elif column == "[": self.interactive[Block(self, j, i, "[")] = "[" + str(i) + str(j) # Whiteboard <- (that way)
elif column == "-": self.interactive[Block(self, j, i, "-")] = "-" + str(i) + str(j) # Whiteboard ^ (that way)
elif column == "=": self.interactive[Block(self, j, i, "=")] = "=" + str(i) + str(j) # Whiteboard V (that way)
elif column == "}": self.interactive[Block(self, j, i, "}")] = "}" + str(i) + str(j) # Blackboard -> (that way)
elif column == "{": self.interactive[Block(self, j, i, "{")] = "{" + str(i) + str(j) # Blackboard <- (that way)
elif column == "^": self.interactive[Block(self, j, i, "^")] = "^" + str(i) + str(j) # Blackboard ^ (that way)
elif column == "V": self.interactive[Block(self, j, i, "V")] = "V" + str(i) + str(j) # Blackboard V (that way)
elif column == "x": self.interactive[Block(self, j, i, "x")] = "x" + str(i) + str(j) # Double Vertical Whiteboard
elif column == "X": self.interactive[Block(self, j, i, "X")] = "X" + str(i) + str(j) # Double Horizontal Whiteboard
elif column == "E": self.interactive[Block(self, j, i, "E")] = "E" + str(i) + str(j) # Router
elif column == "ý": self.interactive[Block(self, j, i, "ý")] = "ý" + str(i) + str(j) # ý as in Yellow Taburetka
elif column == "ž": self.interactive[Block(self, j, i, "ž")] = "ž" + str(i) + str(j) # ž as in Green (želena) Taburetka
elif column == "ň": self.interactive[Block(self, j, i, "ň")] = "ň" + str(i) + str(j) # ň as in Brown (hňeda) Taburetka
elif column == "ú": self.interactive[Block(self, j, i, "ú")] = "ú" + str(i) + str(j) # ú as in Blúe Taburetka
elif column == "$": self.interactive[Block(self, j, i, "$")] = "$" + str(i) + str(j) # Corner desk
elif column == "č": self.interactive[Block(self, j, i, "č")] = "č" + str(i) + str(j) # dč as in Red (červena) Taburetka
elif column == "@": self.interactive[Block(self, j, i, "@")] = "@" + str(i) + str(j) # Up facing green chair
elif column == "#": self.interactive[Block(self, j, i, "#")] = "#" + str(i) + str(j) # Right facing green chair
elif column == "*": self.interactive[Block(self, j, i, "*")] = "*" + str(i) + str(j) # Left facing green chair
elif column == "~": self.interactive[Block(self, j, i, "~")] = "~" + str(i) + str(j) # Coffee machine
elif column == "&": self.interactive[Block(self, j, i, "&")] = "&" + str(i) + str(j) # Gym machine
elif column == "0": self.interactive[Block(self, j, i, "0")] = "0" + str(i) + str(j) # Basketball hoop (R)
elif column == "ô": self.interactive[Block(self, j, i, "ô")] = "ô" + str(i) + str(j) # Basketball hoop (L)
elif column == "ˇ": self.interactive[Block(self, j, i, "ˇ")] = "ˇ" + str(i) + str(j) # Dumbell rack
elif column == "Ž": self.interactive[Block(self, j, i, "Ž")] = "Ž" + str(i) + str(j) # Rebrina (idk in english)
elif column == "A": self.interactive[Block(self, j, i, "A")] = "A" + str(i) + str(j) # Pult in Amper
elif column == "3": self.interactive[Block(self, j, i, "3")] = "3" + str(i) + str(j) # Pong ping
elif column == "4": self.interactive[Block(self, j, i, "4")] = "4" + str(i) + str(j) # Pong ping
elif column == "5": self.interactive[Block(self, j, i, "5")] = "5" + str(i) + str(j) # Pong ping
elif column == "6": self.interactive[Block(self, j, i, "6")] = "6" + str(i) + str(j) # Pong ping
elif column == "7": self.interactive[Block(self, j, i, "7")] = "7" + str(i) + str(j) # Pong ping
elif column == "8": self.interactive[Block(self, j, i, "8")] = "8" + str(i) + str(j) # Pong ping
elif column == "ď": self.interactive[Block(self, j, i, "ď")] = "ď" + str(i) + str(j) # Laďďer
elif column == "Ú": self.interactive[Block(self, j, i, "Ú")] = "Ú" + str(i) + str(j) # Sink
elif column == "Ů": self.interactive[Block(self, j, i, "Ů")] = "Ů" + str(i) + str(j) # Sink
elif column == "▼": self.interactive[Block(self, j, i, "▼")] = "▼" + str(i) + str(j) # Sink
elif column == "š": self.interactive[Block(self, j, i, "š")] = "š" + str(i) + str(j) # Wood
elif column == "ś": self.interactive[Block(self, j, i, "ś")] = "ś" + str(i) + str(j) # Wood ^ 2
elif column == "▬": self.interactive[Block(self, j, i, "▬")] = "▬" + str(i) + str(j) # Shoe rack
elif column == "∟": self.interactive[Block(self, j, i, "∟")] = "∟" + str(i) + str(j) # Stairs
elif column == "↔": self.interactive[Block(self, j, i, "↔")] = "↔" + str(i) + str(j) # More stairs
elif column == "♂": self.interactive[Block(self, j, i, "♂")] = "♂" + str(i) + str(j) # Desk for TV
elif column == "◙": self.interactive[Block(self, j, i, "◙")] = "◙" + str(i) + str(j) # Desk with TV
elif column == "♀": self.interactive[Block(self, j, i, "♀")] = "♀" + str(i) + str(j) # Flags for skiing
elif column == "♪": self.interactive[Block(self, j, i, "♪")] = "♪" + str(i) + str(j) # Rocks
elif column == "╩": self.interactive[Block(self, j, i, "╩")] = "╩" + str(i) + str(j) # Snowman
elif column == "N": self.interactive[Npc(self, j, i, "")] = "N" + str(i) + str(j) # NPC
elif column == ":": self.interactive[Npc(self, j, i, ":")] = ":" + str(i) + str(j) # Samko NPC
elif column == "K": self.interactive[Npc(self, j, i, "K")] = "K" + str(i) + str(j) # Kacka
elif column == "p": self.npc.append(Npc(self, j, i, "p")) # People
if self.lyz_in_room != self.lyz_rooms[LYZ_SKI_MAP]: self.talking_with_samko()
else:
for i, row in enumerate(self.in_room):
for j, column in enumerate(row):
Ground(self, j, i)
if column in ("_", "?"): Blockade(self, j, i, column) # Grass or Black
elif column == "P": self.player = Player(self, j, i) # Player
elif column in ("!", "W"): Block(self, j, i, column) # No entry ground
elif column == "w": self.interactive[Block(self, j, i, "w")] = "w" + str(i) + str(j) # Window
elif column == "L": self.interactive[Block(self, j, i, "L")] = "L" + str(i) + str(j) # Locker
elif column == "Ľ": self.interactive[Block(self, j, i, "Ľ")] = "Ľ" + str(i) + str(j) # Locker
elif column == "ľ": self.interactive[Block(self, j, i, "ľ")] = "ľ" + str(i) + str(j) # Locker
elif column == "S": self.interactive[Block(self, j, i, "S")] = "S" + str(i) + str(j) # Stairs
elif column == "Z": self.interactive[Block(self, j, i, "Z")] = "Z" + str(i) + str(j) # Stairs
elif column == "s": self.interactive[Block(self, j, i, "s")] = "s" + str(i) + str(j) # Stairs down
elif column == "z": self.interactive[Block(self, j, i, "z")] = "z" + str(i) + str(j) # Stairs down
elif column == "D": self.interactive[Block(self, j, i, "D")] = "D" + str(i) + str(j) # Door
elif column == "G": self.interactive[Block(self, j, i, "G")] = "G" + str(i) + str(j) # Glass door
elif column == "B": self.interactive[Block(self, j, i, "B")] = "B" + str(i) + str(j) # Bench (vertical)
elif column == "h": self.interactive[Block(self, j, i, "h")] = "h" + str(i) + str(j) # Bench (horizontal)
elif column == "y": self.interactive[Block(self, j, i, "y")] = "y" + str(i) + str(j) # Benchpress
elif column == "Y": self.interactive[Block(self, j, i, "Y")] = "Y" + str(i) + str(j) # Benchpress with dumbbells
elif column == "l": self.interactive[Block(self, j, i, "l")] = "l" + str(i) + str(j) # Desk + chair (vertical) left
elif column == "k": self.interactive[Block(self, j, i, "k")] = "k" + str(i) + str(j) # Desk no chair (vertical) left
elif column == "é": self.interactive[Block(self, j, i, "é")] = "é" + str(i) + str(j) # Desk special (vertical)
elif column == "u": self.interactive[Block(self, j, i, "u")] = "u" + str(i) + str(j) # Desk + chair (vertical) right
elif column == "ä": self.interactive[Block(self, j, i, "ä")] = "ä" + str(i) + str(j) # Desk + chair + baterries (vertical) right
elif column == "e": self.interactive[Block(self, j, i, "e")] = "e" + str(i) + str(j) # Desk no chair (vertical) right
elif column == "g": self.interactive[Block(self, j, i, "g")] = "g" + str(i) + str(j) # Desk + chair + PC (vertical) right
elif column == "a": self.interactive[Block(self, j, i, "a")] = "a" + str(i) + str(j) # Desk + chair + PC (vertical) left
elif column == "U": self.interactive[Block(self, j, i, "U")] = "U" + str(i) + str(j) # LCUJ Desk
elif column == "J": self.interactive[Block(self, j, i, "J")] = "J" + str(i) + str(j) # LCUJ Desk
elif column == "j": self.interactive[Block(self, j, i, "j")] = "j" + str(i) + str(j) # Desk + chair (horizontal) up
elif column == "m": self.interactive[Block(self, j, i, "m")] = "m" + str(i) + str(j) # Desk no chair (horizontal) up
elif column == "i": self.interactive[Block(self, j, i, "i")] = "i" + str(i) + str(j) # Desk + chair (horizontal) down
elif column == "n": self.interactive[Block(self, j, i, "n")] = "n" + str(i) + str(j) # Desk no chair (horizontal) down
elif column == "q": self.interactive[Block(self, j, i, "q")] = "q" + str(i) + str(j) # Desk + chair + PC (horizontal) up
elif column == "Q": self.interactive[Block(self, j, i, "Q")] = "Q" + str(i) + str(j) # Desk + chair + PC (horizontal) down
elif column == "t": self.interactive[Block(self, j, i, "t")] = "t" + str(i) + str(j) # Trashcan
elif column == "T": self.interactive[Block(self, j, i, "T")] = "T" + str(i) + str(j) # Toilet
elif column == "Ť": self.interactive[Block(self, j, i, "Ť")] = "Ť" + str(i) + str(j) # Toilet
elif column == "R": self.interactive[Block(self, j, i, "R")] = "R" + str(i) + str(j) # Rails
elif column == "r": self.interactive[Block(self, j, i, "r")] = "r" + str(i) + str(j) # Rails
elif column == "Ř": self.interactive[Block(self, j, i, "Ř")] = "Ř" + str(i) + str(j) # Rails ground_floor
elif column == "Ŕ": self.interactive[Block(self, j, i, "Ŕ")] = "Ŕ" + str(i) + str(j) # Rails second_floor
elif column == "ŕ": self.interactive[Block(self, j, i, "ŕ")] = "ŕ" + str(i) + str(j) # Rails second_floor
elif column == "ř": self.interactive[Block(self, j, i, "ř")] = "ř" + str(i) + str(j) # Rails ground_floor
elif column == "/": self.interactive[Block(self, j, i, "/")] = "/" + str(i) + str(j) # Rails fourth_floor
elif column == "|": self.interactive[Block(self, j, i, "|")] = "|" + str(i) + str(j) # Rails fourth_floor
elif column == "b": self.interactive[Block(self, j, i, "b")] = "b" + str(i) + str(j) # Basement
elif column == "d": self.interactive[Block(self, j, i, "d")] = "d" + str(i) + str(j) # Basement
elif column == "O": self.interactive[Block(self, j, i, "O")] = "O" + str(i) + str(j) # Bookshelf
elif column == "o": self.interactive[Block(self, j, i, "o")] = "o" + str(i) + str(j) # Bookshelf
elif column == "ó": self.interactive[Block(self, j, i, "ó")] = "ó" + str(i) + str(j) # Bookshelf
elif column == "Ó": self.interactive[Block(self, j, i, "Ó")] = "Ó" + str(i) + str(j) # Bookshelf
elif column == "]": self.interactive[Block(self, j, i, "]")] = "]" + str(i) + str(j) # Whiteboard -> (that way)
elif column == "[": self.interactive[Block(self, j, i, "[")] = "[" + str(i) + str(j) # Whiteboard <- (that way)
elif column == "-": self.interactive[Block(self, j, i, "-")] = "-" + str(i) + str(j) # Whiteboard ^ (that way)
elif column == "=": self.interactive[Block(self, j, i, "=")] = "=" + str(i) + str(j) # Whiteboard V (that way)
elif column == "}": self.interactive[Block(self, j, i, "}")] = "}" + str(i) + str(j) # Blackboard -> (that way)
elif column == "{": self.interactive[Block(self, j, i, "{")] = "{" + str(i) + str(j) # Blackboard <- (that way)
elif column == "^": self.interactive[Block(self, j, i, "^")] = "^" + str(i) + str(j) # Blackboard ^ (that way)
elif column == "V": self.interactive[Block(self, j, i, "V")] = "V" + str(i) + str(j) # Blackboard V (that way)
elif column == "x": self.interactive[Block(self, j, i, "x")] = "x" + str(i) + str(j) # Double Vertical Whiteboard
elif column == "X": self.interactive[Block(self, j, i, "X")] = "X" + str(i) + str(j) # Double Horizontal Whiteboard
elif column == "E": self.interactive[Block(self, j, i, "E")] = "E" + str(i) + str(j) # Router
elif column == "ý": self.interactive[Block(self, j, i, "ý")] = "ý" + str(i) + str(j) # ý as in Yellow Taburetka
elif column == "ž": self.interactive[Block(self, j, i, "ž")] = "ž" + str(i) + str(j) # ž as in Green (želena) Taburetka
elif column == "ň": self.interactive[Block(self, j, i, "ň")] = "ň" + str(i) + str(j) # ň as in Brown (hňeda) Taburetka
elif column == "ú": self.interactive[Block(self, j, i, "ú")] = "ú" + str(i) + str(j) # ú as in Blúe Taburetka
elif column == "$": self.interactive[Block(self, j, i, "$")] = "$" + str(i) + str(j) # Corner desk
elif column == "č": self.interactive[Block(self, j, i, "č")] = "č" + str(i) + str(j) # dč as in Red (červena) Taburetka
elif column == "@": self.interactive[Block(self, j, i, "@")] = "@" + str(i) + str(j) # Up facing green chair
elif column == "#": self.interactive[Block(self, j, i, "#")] = "#" + str(i) + str(j) # Right facing green chair
elif column == "*": self.interactive[Block(self, j, i, "*")] = "*" + str(i) + str(j) # Left facing green chair
elif column == "~": self.interactive[Block(self, j, i, "~")] = "~" + str(i) + str(j) # Coffee machine
elif column == "&": self.interactive[Block(self, j, i, "&")] = "&" + str(i) + str(j) # Gym machine
elif column == "0": self.interactive[Block(self, j, i, "0")] = "0" + str(i) + str(j) # Basketball hoop (R)
elif column == "ô": self.interactive[Block(self, j, i, "ô")] = "ô" + str(i) + str(j) # Basketball hoop (L)
elif column == "ˇ": self.interactive[Block(self, j, i, "ˇ")] = "ˇ" + str(i) + str(j) # Dumbell rack
elif column == "Ž": self.interactive[Block(self, j, i, "Ž")] = "Ž" + str(i) + str(j) # Rebrina (idk in english)