-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
690 lines (655 loc) · 21.9 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
"""Ролевая игра по мотивам настолки «Манчкин»."""
import time
import shelve
from asciimatics.screen import Screen
from colorama import just_fix_windows_console
from termcolor import colored, cprint
from functions import (
animation, check_have_dagger, game_begins, game_passed, new_character,
playsound, save_dagger, save_game, SAVES_PATH, save_rank, save_race_klass,
show_image, show_last_points, show_rating_table, teleprint, tower_assault
)
from doors_game.text import DOORS_INTRO
import mini_game
from texts import (
chapter_1, chapter_2, chapter_3, chapter_4, chapter_5, chapter_6,
chapter_7, chapter_8, chapter_9, chapter_10, chapter_12,
character_creation, colored_text as clr
)
from texts.intro import INTRO_1, INTRO_2
just_fix_windows_console() # use Colorama to make Termcolor work on Windows
def start_game():
"""Стартовое меню игры."""
print('╤' * 63, clr.ATTENTION, '╧' * 63, '\n', sep='\n')
cprint('► Г Л А В Н О Е М Е Н Ю ◄', 'black', attrs=['bold'])
print('▬' * 27)
with shelve.open(SAVES_PATH) as db:
last_save = db.get('LAST_SAVE')
game_passed = db.get('GAME_PASSED')
if last_save is None:
while input(clr.START_GAME).lower() != 'начать':
pass
print()
return play_intro()
cprint('Введи "Заново" - начать игру с самого начала', 'blue', end='')
cprint(' (последнее сохранение будет сброшено!)', 'red')
cprint('Введи "Продолжить" - загрузить последнее сохранение', 'blue')
checking = ['заново', 'продолжить']
if game_passed is not None:
cprint('Введи "Рейтинг" - покоряй башню повторно и получи '
'максимальный рейтинг', 'blue')
checking.append('рейтинг')
while (decision := input(colored('>>> ', 'blue')).lower()) not in checking:
pass
print()
if decision == 'заново':
return play_intro()
if decision == 'продолжить':
return GAME_STAGES[last_save]()
if decision == 'рейтинг':
show_rating_table()
print(clr.CHALLENGE)
input(clr.PUSH_ENTER)
new_character()
tower_assault()
print(show_last_points())
return start_game()
def play_intro():
"""Введение."""
cprint('§ Введение', 'black', attrs=['bold'])
print('•' * 27)
teleprint(INTRO_1)
input(clr.PUSH_ENTER)
show_image('country', 'Вымышляндия')
teleprint(INTRO_2)
input(clr.PUSH_ENTER)
return play_character_creation()
def play_character_creation():
"""Создание персонажа."""
cprint('§ Создание персонажа', 'black', attrs=['bold'])
save_game('character_creation')
time.sleep(1)
teleprint(character_creation.A)
input(clr.PUSH_ENTER)
teleprint(character_creation.DESCRIBE_CHARACTER)
while len(input(clr.CHAR_DESCR)) < 100:
print(character_creation.DETAILED_DESCRIPTION)
cprint('\n► Автоматическая генерация персонажа по описанию...\n', 'blue')
time.sleep(3)
show_image('character', character_creation.B)
teleprint(character_creation.CHAR_CREATED)
print()
while not input(clr.PRINT_NAME):
pass
print()
teleprint(character_creation.D)
print()
while input(clr.YES_OR_NO).lower() not in ('да', 'нет'):
pass
print()
teleprint(character_creation.E)
input(clr.PUSH_ENTER)
teleprint(character_creation.F)
time.sleep(2)
Screen.wrapper(game_begins)
print()
return play_chapter_1()
def play_chapter_1():
"""Начало."""
cprint('§ Начало', 'black', attrs=['bold'])
save_game('chapter_1')
time.sleep(1)
teleprint(chapter_1.A)
input(clr.PUSH_ENTER)
playsound('birds_song')
show_image('city', 'городок Токийск Алтайского края')
teleprint(chapter_1.A_2)
input(clr.PUSH_ENTER)
show_image('thief', 'класс Вор')
teleprint(chapter_1.B_1)
input(clr.PUSH_ENTER)
show_image('dagger', 'Кинжал измены')
show_image('cloak', 'Плащ замутнённости')
teleprint(chapter_1.B_2)
input(clr.PUSH_ENTER)
teleprint(chapter_1.C)
input(clr.PUSH_ENTER)
playsound('shatunov')
show_image('market', 'Белые розы, белые розы - беззащитны шипы...')
teleprint(chapter_1.D)
input(clr.PUSH_ENTER)
cprint(chapter_1.TRY_TO_THIEF, 'blue')
while input(clr.ROLL_DICE).lower() != 'бросаю кубик':
pass
print()
playsound('dice')
time.sleep(2)
show_image('dice_six', 'На кубике выпало...')
teleprint(chapter_1.THEFT_SUCCESS)
input(clr.PUSH_ENTER)
teleprint(chapter_1.E)
input(clr.PUSH_ENTER)
teleprint(chapter_1.OTHER_THEFT, '\n')
while input(clr.ROLL_DICE).lower() != 'бросаю кубик':
pass
print()
playsound('dice')
time.sleep(2)
show_image('dice_one', 'На кубике выпало...')
teleprint(chapter_1.OTHER_THEFT_FAIL)
input(clr.PUSH_ENTER)
teleprint(chapter_1.DANGER)
teleprint(chapter_1.CHEET_DICE)
print()
while input(clr.USE_CHEET_DICE).lower() != 'использовать читерский кубик':
pass
print()
time.sleep(1)
show_image('cheet_dice', 'Читерский кубик')
teleprint(chapter_1.OTHER_THEFT_SUCCESS)
input(clr.PUSH_ENTER)
teleprint(chapter_1.F)
input(clr.PUSH_ENTER)
teleprint(chapter_1.F_2)
print()
while input(
clr.FORGIVE_ME
).lower() != 'простите меня, я больше так не буду':
pass
print()
teleprint(chapter_1.G)
input(clr.PUSH_ENTER)
teleprint(chapter_1.H)
input(clr.PUSH_ENTER)
show_image('market_fight', 'Самое "уютное" местечко в городке...')
return play_chapter_2()
def play_chapter_2():
"""Погоня."""
cprint('§ Погоня', 'black', attrs=['bold'])
save_game('chapter_2')
time.sleep(1)
teleprint(chapter_2.A)
input(clr.PUSH_ENTER)
show_image('lame_goblin', 'Увечный гоблин')
show_image('platycore', 'Утконтикора')
teleprint(chapter_2.A_2)
input(clr.PUSH_ENTER)
teleprint(chapter_2.B)
input(clr.PUSH_ENTER)
teleprint(chapter_2.C)
input(clr.PUSH_ENTER)
teleprint(chapter_2.C_2)
input(clr.PUSH_ENTER)
show_image('fast_boots', 'Башмаки реально быстрого бега')
teleprint(chapter_2.C_3)
input(clr.PUSH_ENTER)
show_image('instant_wall', 'Стенка-мгновенка')
teleprint(chapter_2.D)
input(clr.PUSH_ENTER)
teleprint(chapter_2.E)
print()
while input(clr.ATAS).lower() != 'атас, меня спалили!':
pass
print()
teleprint(chapter_2.F)
input(clr.PUSH_ENTER)
show_image('onion_bag', 'Маскировка восьмидесятого левела')
teleprint(chapter_2.G)
input(clr.PUSH_ENTER)
show_image('gippogrif', 'Гиппогриф (второй за кадром)')
teleprint(chapter_2.H_1)
input(clr.PUSH_ENTER)
teleprint(chapter_2.H_2)
input(clr.PUSH_ENTER)
teleprint(chapter_2.H_3)
input(clr.PUSH_ENTER)
teleprint(chapter_2.IA)
input(clr.PUSH_ENTER)
playsound('danger')
show_image('floating_nose', 'Блуждающий нос')
teleprint(chapter_2.J)
input(clr.PUSH_ENTER)
teleprint(chapter_2.K)
input(clr.PUSH_ENTER)
teleprint(chapter_2.L)
input(clr.PUSH_ENTER)
teleprint(chapter_2.M)
input(clr.PUSH_ENTER)
return play_chapter_3()
def play_chapter_3():
"""Развязка."""
cprint('§ Развязка', 'black', attrs=['bold'])
save_game('chapter_3')
time.sleep(1)
teleprint(chapter_3.A)
input(clr.PUSH_ENTER)
teleprint(chapter_3.EXP_1)
input(clr.PUSH_ENTER)
teleprint(chapter_3.EXP_2)
input(clr.PUSH_ENTER)
show_image('pursuit', 'Без преувеличения - эпическая погоня!')
show_image('plasmic_gun', 'Эка диковина приблуда')
teleprint(chapter_3.EXP_3)
print()
while input(clr.WHAT_FILM) == '':
pass
print()
teleprint(chapter_3.EXP_4)
input(clr.PUSH_ENTER)
teleprint(chapter_3.B)
input(clr.PUSH_ENTER)
show_image('stink_potion', 'Зелье ротовой вони')
teleprint(chapter_3.C)
input(clr.PUSH_ENTER)
print(chapter_3.DECISION)
while ((choise := input(clr.CHOICE))not in ('1', '2')):
pass
print()
if choise == '2':
teleprint(chapter_3.D)
input(clr.PUSH_ENTER)
show_image('monster_killed', 'Типа победил Носа...')
teleprint(chapter_3.E)
have_dagger = True
elif choise == '1':
teleprint(chapter_3.F)
print()
while input(clr.SHOW_DAGGER).lower() != 'отдать кинжал':
pass
print()
teleprint(chapter_3.G)
input(clr.PUSH_ENTER)
show_image('dagger', 'Кинжал измены')
teleprint(chapter_3.H)
have_dagger = False
input(clr.PUSH_ENTER)
teleprint(chapter_3.IA)
input(clr.PUSH_ENTER)
save_dagger(have_dagger)
return play_chapter_4()
def play_chapter_4():
"""Неожиданный поворот."""
cprint('§ Неожиданный поворот', 'black', attrs=['bold'])
save_game('chapter_4')
time.sleep(1)
teleprint(chapter_4.A)
input(clr.PUSH_ENTER)
show_image('bones_brothers', 'Бледные Братья')
print(chapter_4.B_CHOICE)
while (result := input(clr.CHOICE)) not in ('1', '2'):
pass
if result == '2':
print()
if check_have_dagger():
teleprint(chapter_4.X_1)
input(clr.PUSH_ENTER)
else:
teleprint(chapter_4.X_2)
input(clr.PUSH_ENTER)
show_image('rat_on_stick', 'Крыса на палочке')
elif result == '1':
print()
teleprint(chapter_4.C)
input(clr.PUSH_ENTER)
show_image('glue', 'Тюбик клея')
teleprint(chapter_4.D)
input(clr.PUSH_ENTER)
teleprint(chapter_4.E)
input(clr.PUSH_ENTER)
show_image('tuba_of_charm', 'Чарующая дуда')
teleprint(chapter_4.F)
input(clr.PUSH_ENTER)
show_image('dragon', 'Плутониевый дракон')
teleprint(chapter_4.G)
input(clr.PUSH_ENTER)
show_image('plant', 'Огорошенная трава')
teleprint(chapter_4.H)
input(clr.PUSH_ENTER)
teleprint(chapter_4.IA)
input(clr.PUSH_ENTER)
show_image('dead_horse', 'Конь андедный')
teleprint(chapter_4.J)
input(clr.PUSH_ENTER)
return play_chapter_5()
def play_chapter_5():
"""Таинственное место."""
cprint('§ Таинственное место', 'black', attrs=['bold'])
save_game('chapter_5')
time.sleep(1)
teleprint(chapter_5.A)
input(clr.PUSH_ENTER)
teleprint(chapter_5.A_1)
input(clr.PUSH_ENTER)
show_image('oil_lamp', 'Та самая лампа...')
teleprint(chapter_5.B)
input(clr.PUSH_ENTER)
print(chapter_5.CHOISE)
while (result := input(clr.CHOICE)) not in ('1', '2'):
pass
print()
if result == '1':
teleprint(chapter_5.D_1)
elif result == '2':
teleprint(chapter_5.D_2)
input(clr.PUSH_ENTER)
teleprint(chapter_5.E)
input(clr.PUSH_ENTER)
teleprint(chapter_5.F)
input(clr.PUSH_ENTER)
teleprint(chapter_5.G)
input(clr.PUSH_ENTER)
show_image('princess_kenny', 'Принцесса Кенни')
return play_chapter_6()
def play_chapter_6():
"""Серьёзный разговор."""
cprint('§ Серьёзный разговор', 'black', attrs=['bold'])
save_game('chapter_6')
time.sleep(1)
teleprint(chapter_6.MISTAKE)
input(clr.PUSH_ENTER)
playsound('skrimer')
time.sleep(0.2)
show_image('princess_terrible', 'Буууууууууу!')
teleprint(chapter_6.MISTAKE_1)
input(clr.PUSH_ENTER)
show_image('princess_ugly', 'О, какая красотка! Как тебе?')
teleprint(chapter_6.MISTAKE_2)
input(clr.PUSH_ENTER)
show_image('princess', 'Теперь-то доволен? Всё устраивает?')
teleprint(chapter_6.A)
input(clr.PUSH_ENTER)
teleprint(chapter_6.B)
input(clr.PUSH_ENTER)
teleprint(chapter_6.C)
input(clr.PUSH_ENTER)
teleprint(chapter_6.D)
input(clr.PUSH_ENTER)
playsound('kirkorov')
show_image('kirkorov', 'Истинный король эстрады!!!')
teleprint(chapter_6.E)
input(clr.PUSH_ENTER)
teleprint(chapter_6.F)
input(clr.PUSH_ENTER)
teleprint(chapter_6.G)
input(clr.PUSH_ENTER)
playsound('star_wars')
show_image('star_wars', 'Гонятся за Дартом Вейдером')
teleprint(chapter_6.G_1)
input(clr.PUSH_ENTER)
show_image('mademonuazeli', 'Мадемонуазели')
teleprint(chapter_6.G_2)
input(clr.PUSH_ENTER)
teleprint(chapter_6.H)
input(clr.PUSH_ENTER)
print(chapter_6.H_CHOICE)
while (result := input(clr.CHOICE)) not in ('1', '2'):
pass
print()
if result == '1':
teleprint(chapter_6.H_1)
elif result == '2':
teleprint(chapter_6.H_2)
input(clr.PUSH_ENTER)
teleprint(chapter_6.IA)
input(clr.PUSH_ENTER)
show_image('cthulhu', 'Великий и ужасный Ктулху')
teleprint(chapter_6.J)
input(clr.PUSH_ENTER)
teleprint(chapter_6.K)
input(clr.PUSH_ENTER)
return play_chapter_7()
def play_chapter_7():
"""Радужные перспективы."""
cprint('§ Радужные перспективы', 'black', attrs=['bold'])
save_game('chapter_7')
time.sleep(1)
teleprint(chapter_7.A)
input(clr.PUSH_ENTER)
teleprint(chapter_7.B)
input(clr.PUSH_ENTER)
show_image('octaedron', 'Желатиновый октаэдр')
teleprint(chapter_7.C)
input(clr.PUSH_ENTER)
teleprint(chapter_7.D)
input(clr.PUSH_ENTER)
teleprint(chapter_7.E)
input(clr.PUSH_ENTER)
show_image('kalmadzilla', 'Кальмадзилла\n от кальмар и годзилла')
teleprint(chapter_7.E_1)
input(clr.PUSH_ENTER)
teleprint(chapter_7.F)
input(clr.PUSH_ENTER)
show_image('druid', 'Чародей из любой RPG игры')
teleprint(chapter_7.G)
input(clr.PUSH_ENTER)
print(chapter_7.G_CHOICE)
while (result := input(clr.CHOICE)) not in ('1', '2'):
pass
print()
if result == '1':
teleprint(chapter_7.G_1)
elif result == '2':
teleprint(chapter_7.G_2)
input(clr.PUSH_ENTER)
teleprint(chapter_7.H)
input(clr.PUSH_ENTER)
teleprint(chapter_7.IA)
input(clr.PUSH_ENTER)
teleprint(chapter_7.J)
input(clr.PUSH_ENTER)
teleprint(chapter_7.K)
input(clr.PUSH_ENTER)
teleprint(chapter_7.L)
input(clr.PUSH_ENTER)
while input(chapter_7.M).lower() != chapter_7.M_1.lower():
pass
print()
teleprint(chapter_7.N)
input(clr.PUSH_ENTER)
teleprint(chapter_7.OA)
input(clr.PUSH_ENTER)
show_image('tester', 'Эта штука изменит твою жизнь навсегда!')
teleprint(chapter_7.OA_1)
input(clr.PUSH_ENTER)
return play_chapter_8()
def play_chapter_8():
"""Специальная подготовка."""
cprint('§ Специальная подготовка', 'black', attrs=['bold'])
save_game('chapter_8')
time.sleep(1)
teleprint(chapter_8.A)
input(clr.PUSH_ENTER)
playsound('fanfars')
show_image('fanfars', 'Фанфары в твою честь')
teleprint(chapter_8.B)
input(clr.PUSH_ENTER)
for question in (
chapter_8.C_1, chapter_8.C_2, chapter_8.C_3, chapter_8.C_4
):
print(question)
while input(clr.ANSWER_OPTION).lower() not in ('а', 'б', 'в', 'г'):
pass
print()
print(chapter_8.C_5)
while (choice_1 := input(clr.ANSWER_OPTION)).lower() not in (
'а', 'б', 'в'
):
pass
print()
teleprint(chapter_8.D)
input(clr.PUSH_ENTER)
print(chapter_8.E_1)
while input(clr.ANSWER_OPTION).lower() not in ('а', 'б', 'в'):
pass
print()
show_image('fallout', 'Из теста К.О.З.А.')
print(chapter_8.E_2)
while input(clr.ANSWER_OPTION).lower() not in ('а', 'б', 'в'):
pass
print()
print(chapter_8.F)
while (choice_2 := input(clr.ANSWER_OPTION)).lower() not in (
'а', 'б', 'в'
):
pass
cprint('\n► Тестирование успешно завершено! Обработка результатов...\n',
'blue')
time.sleep(3)
teleprint(chapter_8.G)
input(clr.PUSH_ENTER)
race = clr.RACES[choice_1.lower()]
klass = clr.KLASSES[choice_2.lower()]
teleprint(chapter_8.H.format(char=clr.CHAR_NAME,
result=colored(f'{race}-{klass}', 'green')))
input(clr.PUSH_ENTER)
show_image(clr.FILES_RACES[choice_1], 'раса ' + race)
show_image(clr.FILES_CLASSES[choice_2], 'класс ' + klass)
teleprint(chapter_8.IA)
input(clr.PUSH_ENTER)
teleprint(chapter_8.J)
input(clr.PUSH_ENTER)
save_race_klass(race, klass)
return play_chapter_9()
def play_chapter_9():
"""Чебуратор."""
cprint('§ Чебуратор', 'black', attrs=['bold'])
save_game('chapter_9')
time.sleep(1)
teleprint(chapter_9.A)
input(clr.PUSH_ENTER)
teleprint(chapter_9.Aa)
input(clr.PUSH_ENTER)
teleprint(chapter_9.B)
input(clr.PUSH_ENTER)
teleprint(chapter_9.C)
input(clr.PUSH_ENTER)
playsound('garmon')
show_image('cheburator', 'Серьёзно? Он сделал из Гены гармошку?!!')
teleprint(chapter_9.Cc)
input(clr.PUSH_ENTER)
print(chapter_9.D_CHOICE)
while (result := input(clr.CHOICE)) not in ('1', '2'):
pass
print()
if result == '1':
teleprint(chapter_9.D_1)
elif result == '2':
teleprint(chapter_9.D_2)
input(clr.PUSH_ENTER)
teleprint(chapter_9.E)
input(clr.PUSH_ENTER)
teleprint(chapter_9.F)
input(clr.PUSH_ENTER)
teleprint(chapter_9.G)
input(clr.PUSH_ENTER)
print(mini_game.RULES_1)
input(clr.PUSH_ENTER)
print(mini_game.RULES_2)
input(clr.PUSH_ENTER)
rank = mini_game.start()
save_rank(rank)
print(chapter_9.H.format(rank, colored(f'{rank} ранг', 'green')))
input(clr.PUSH_ENTER)
return play_chapter_10()
def play_chapter_10():
"""Портал."""
cprint('§ Портал', 'black', attrs=['bold'])
save_game('chapter_10')
time.sleep(1)
teleprint(chapter_10.A)
input(clr.PUSH_ENTER)
teleprint(chapter_10.B)
input(clr.PUSH_ENTER)
teleprint(chapter_10.C)
input(clr.PUSH_ENTER)
teleprint(chapter_10.D)
input(clr.PUSH_ENTER)
show_image('portal', 'Порталус Маджификус')
teleprint(chapter_10.E)
input(clr.PUSH_ENTER)
teleprint(chapter_10.F)
input(clr.PUSH_ENTER)
teleprint(chapter_10.G)
input(clr.PUSH_ENTER)
print(chapter_10.H_CHOICE)
while (result := input(clr.CHOICE)) not in ('1', '2'):
pass
print()
if result == '1':
teleprint(chapter_10.H_1)
elif result == '2':
teleprint(chapter_10.H_2)
input(clr.PUSH_ENTER)
teleprint(chapter_10.J)
input(clr.PUSH_ENTER)
return play_chapter_11()
def play_chapter_11():
"""Башня Ктулху."""
cprint('§ Башня Ктулху', 'black', attrs=['bold'])
save_game('chapter_11')
time.sleep(1)
teleprint(DOORS_INTRO)
input(clr.PUSH_ENTER)
tower_assault()
return play_chapter_12()
def play_chapter_12():
"""Хэппи энд."""
cprint('§ Хэппи энд', 'black', attrs=['bold'])
save_game('chapter_12')
time.sleep(1)
teleprint(chapter_12.A)
input(clr.PUSH_ENTER)
teleprint(chapter_12.B)
input(clr.PUSH_ENTER)
teleprint(chapter_12.C)
input(clr.PUSH_ENTER)
teleprint(chapter_12.D)
input(clr.PUSH_ENTER)
print(chapter_12.E_CHOICE)
while (result := input(clr.CHOICE)) not in ('1', '2'):
pass
print()
if result == '1':
teleprint(chapter_12.E_1)
elif result == '2':
teleprint(chapter_12.E_2)
input(clr.PUSH_ENTER)
teleprint(chapter_12.F)
input(clr.PUSH_ENTER)
teleprint(chapter_12.G)
input(clr.PUSH_ENTER)
playsound('alarm_clock', True)
time.sleep(1)
teleprint(chapter_12.H)
input(clr.PUSH_ENTER)
teleprint(chapter_12.J)
input(clr.PUSH_ENTER)
print(f'{colored("Конец игры!", "blue", attrs=["bold"])}\n')
game_passed()
print(show_last_points())
teleprint(clr.THE_END)
input(f'{colored("Для завершения нажми", "blue")} '
f'{colored("[Enter]", "blue", attrs=["bold", "underline"])}')
return None
if __name__ == '__main__':
GAME_STAGES = {
'character_creation': play_character_creation,
'chapter_1': play_chapter_1,
'chapter_2': play_chapter_2,
'chapter_3': play_chapter_3,
'chapter_4': play_chapter_4,
'chapter_5': play_chapter_5,
'chapter_6': play_chapter_6,
'chapter_7': play_chapter_7,
'chapter_8': play_chapter_8,
'chapter_9': play_chapter_9,
'chapter_10': play_chapter_10,
'chapter_11': play_chapter_11,
'chapter_12': play_chapter_12
}
try:
Screen.wrapper(animation)
start_game()
except Exception as error:
print(f'{colored("!!! Критическая ошибка !!!", "red")}\n{error}')
input('Нажатие Enter завершит работу программы...')