File size: 32,853 Bytes
c298b43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="ru">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Breaking Bad Quest</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        @import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400;700&display=swap');
        
        body {
            font-family: 'Roboto Condensed', sans-serif;
            background-color: #111;
            color: #fff;
            background-image: url('https://images.unsplash.com/photo-1588072432836-e10032774350?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1472&q=80');
            background-size: cover;
            background-position: center;
            background-attachment: fixed;
        }
        
        .scene {
            background-color: rgba(0, 0, 0, 0.85);
            border-left: 4px solid #f7931a;
        }
        
        .btn-primary {
            background-color: #f7931a;
            transition: all 0.3s;
        }
        
        .btn-primary:hover {
            background-color: #d97e0d;
            transform: translateY(-2px);
        }
        
        .character-img {
            filter: drop-shadow(0 0 10px rgba(247, 147, 26, 0.5));
            transition: all 0.3s;
        }
        
        .character-img:hover {
            filter: drop-shadow(0 0 15px rgba(247, 147, 26, 0.8));
            transform: scale(1.05);
        }
        
        .inventory-item {
            transition: all 0.3s;
        }
        
        .inventory-item:hover {
            transform: scale(1.1);
        }
        
        @keyframes pulse {
            0% { opacity: 0.6; }
            50% { opacity: 1; }
            100% { opacity: 0.6; }
        }
        
        .pulse {
            animation: pulse 2s infinite;
        }
        
        .typewriter {
            overflow: hidden;
            border-right: .15em solid #f7931a;
            white-space: nowrap;
            letter-spacing: .15em;
            animation: 
                typing 3.5s steps(40, end),
                blink-caret .75s step-end infinite;
        }
        
        @keyframes typing {
            from { width: 0 }
            to { width: 100% }
        }
        
        @keyframes blink-caret {
            from, to { border-color: transparent }
            50% { border-color: #f7931a; }
        }
    </style>
</head>
<body class="min-h-screen">
    <div class="container mx-auto px-4 py-8 max-w-4xl">
        <!-- Header -->
        <header class="flex justify-between items-center mb-8 border-b border-orange-500 pb-4">
            <div class="flex items-center">
                <i class="fas fa-flask text-orange-500 text-3xl mr-3"></i>
                <h1 class="text-3xl font-bold text-orange-500">BREAKING BAD QUEST</h1>
            </div>
            <div class="flex items-center space-x-4">
                <div class="bg-gray-800 px-3 py-1 rounded-full">
                    <span class="text-orange-400 font-bold" id="health">100</span>
                    <i class="fas fa-heart text-red-500 ml-1"></i>
                </div>
                <div class="bg-gray-800 px-3 py-1 rounded-full">
                    <span class="text-blue-400 font-bold" id="money">$0</span>
                    <i class="fas fa-dollar-sign text-green-500 ml-1"></i>
                </div>
            </div>
        </header>
        
        <!-- Main Game Area -->
        <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
            <!-- Scene Description -->
            <div class="lg:col-span-2 scene rounded-lg p-6 shadow-lg">
                <div id="scene-description" class="mb-6">
                    <h2 class="text-2xl font-bold text-orange-500 mb-4 typewriter">Добро пожаловать в Альбукерке</h2>
                    <p class="text-gray-300 mb-4">Вы - Уолтер Уайт, 50-летний школьный учитель химии, которому только что поставили диагноз: неоперабельный рак легких. Срок жизни - около двух лет. У вас есть беременная жена и сын-инвалид. Денег на лечение и обеспечение семьи после вашей смерти нет.</p>
                    <p class="text-gray-300 mb-4">Во время поездки с DEA на облаве нарколаборатории вы встречаете своего бывшего ученика Джесси Пинкмана, сбегающего с места преступления. Это наводит вас на мысль...</p>
                    <p class="text-orange-400 font-bold text-lg">Что вы решаете делать?</p>
                </div>
                
                <!-- Choices -->
                <div id="choices" class="space-y-3">
                    <button class="btn-primary w-full py-3 px-4 rounded-lg font-bold text-white text-left" onclick="makeChoice(1)">
                        <i class="fas fa-mortar-pestle mr-2"></i> Использовать знания химии для приготовления метамфетамина
                    </button>
                    <button class="btn-primary w-full py-3 px-4 rounded-lg font-bold text-white text-left" onclick="makeChoice(2)">
                        <i class="fas fa-hand-holding-medical mr-2"></i> Попытаться найти легальные способы заработать на лечение
                    </button>
                    <button class="btn-primary w-full py-3 px-4 rounded-lg font-bold text-white text-left" onclick="makeChoice(3)">
                        <i class="fas fa-user-secret mr-2"></i> Шантажировать бывшего партнера по бизнесу Гретхен и Эллиота
                    </button>
                </div>
                
                <!-- Inventory -->
                <div id="inventory" class="mt-8 hidden">
                    <h3 class="text-xl font-bold text-orange-500 mb-3 border-b border-gray-700 pb-2">
                        <i class="fas fa-backpack mr-2"></i> Инвентарь
                    </h3>
                    <div class="grid grid-cols-4 gap-3" id="inventory-items">
                        <!-- Items will be added here dynamically -->
                    </div>
                </div>
            </div>
            
            <!-- Character and Stats -->
            <div class="space-y-6">
                <!-- Character Image -->
                <div class="bg-gray-900 rounded-lg p-4 shadow-lg">
                    <img id="character-img" src="https://upload.wikimedia.org/wikipedia/en/0/03/Walter_White_S5B.png" alt="Walter White" class="w-full h-auto rounded-lg character-img">
                    <div class="mt-3 text-center">
                        <h3 class="text-xl font-bold text-orange-500" id="character-name">Уолтер Уайт</h3>
                        <p class="text-gray-400" id="character-alias">АКА Гейзенберг</p>
                    </div>
                </div>
                
                <!-- Stats -->
                <div class="bg-gray-900 rounded-lg p-4 shadow-lg">
                    <h3 class="text-xl font-bold text-orange-500 mb-3 border-b border-gray-700 pb-2">
                        <i class="fas fa-chart-line mr-2"></i> Характеристики
                    </h3>
                    <div class="space-y-2">
                        <div>
                            <div class="flex justify-between mb-1">
                                <span class="text-gray-300">Химия</span>
                                <span class="text-orange-500 font-bold" id="chem-skill">95%</span>
                            </div>
                            <div class="w-full bg-gray-700 rounded-full h-2.5">
                                <div class="bg-orange-500 h-2.5 rounded-full" style="width: 95%"></div>
                            </div>
                        </div>
                        <div>
                            <div class="flex justify-between mb-1">
                                <span class="text-gray-300">Криминал</span>
                                <span class="text-orange-500 font-bold" id="crime-skill">15%</span>
                            </div>
                            <div class="w-full bg-gray-700 rounded-full h-2.5">
                                <div class="bg-orange-500 h-2.5 rounded-full" style="width: 15%"></div>
                            </div>
                        </div>
                        <div>
                            <div class="flex justify-between mb-1">
                                <span class="text-gray-300">Репутация</span>
                                <span class="text-orange-500 font-bold" id="rep-skill">30%</span>
                            </div>
                            <div class="w-full bg-gray-700 rounded-full h-2.5">
                                <div class="bg-orange-500 h-2.5 rounded-full" style="width: 30%"></div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- Partners -->
                <div class="bg-gray-900 rounded-lg p-4 shadow-lg hidden" id="partners-section">
                    <h3 class="text-xl font-bold text-orange-500 mb-3 border-b border-gray-700 pb-2">
                        <i class="fas fa-users mr-2"></i> Партнеры
                    </h3>
                    <div class="grid grid-cols-2 gap-3" id="partners-list">
                        <!-- Partners will be added here dynamically -->
                    </div>
                </div>
            </div>
        </div>
        
        <!-- Modal for special events -->
        <div id="modal" class="fixed inset-0 bg-black bg-opacity-75 flex items-center justify-center hidden z-50">
            <div class="bg-gray-900 rounded-lg p-6 max-w-md w-full mx-4 border-2 border-orange-500 relative">
                <button onclick="closeModal()" class="absolute top-3 right-3 text-gray-400 hover:text-white">
                    <i class="fas fa-times"></i>
                </button>
                <h2 id="modal-title" class="text-2xl font-bold text-orange-500 mb-4"></h2>
                <p id="modal-text" class="text-gray-300 mb-6"></p>
                <div id="modal-choices" class="space-y-2"></div>
            </div>
        </div>
    </div>

    <script>
        // Game state
        const gameState = {
            health: 100,
            money: 0,
            chemSkill: 95,
            crimeSkill: 15,
            repSkill: 30,
            currentScene: 0,
            inventory: [],
            partners: [],
            isHeisenberg: false,
            hasLab: false,
            hasCar: false,
            hasGun: false,
            jesseRelationship: 0,
            skylerRelationship: 50,
            hankRelationship: 70
        };

        // Scenes data
        const scenes = [
            {
                id: 0,
                title: "Добро пожаловать в Альбукерке",
                description: `<p class="text-gray-300 mb-4">Вы - Уолтер Уайт, 50-летний школьный учитель химии, которому только что поставили диагноз: неоперабельный рак легких. Срок жизни - около двух лет. У вас есть беременная жена и сын-инвалид. Денег на лечение и обеспечение семьи после вашей смерти нет.</p>
                <p class="text-gray-300 mb-4">Во время поездки с DEA на облаве нарколаборатории вы встречаете своего бывшего ученика Джесси Пинкмана, сбегающего с места преступления. Это наводит вас на мысль...</p>
                <p class="text-orange-400 font-bold text-lg">Что вы решаете делать?</p>`,
                choices: [
                    {
                        text: "Использовать знания химии для приготовления метамфетамина",
                        nextScene: 1,
                        action: function() {
                            gameState.crimeSkill += 10;
                            updateStats();
                        }
                    },
                    {
                        text: "Попытаться найти легальные способы заработать на лечение",
                        nextScene: 2,
                        action: function() {
                            gameState.repSkill += 5;
                            updateStats();
                        }
                    },
                    {
                        text: "Шантажировать бывшего партнера по бизнесу Гретхен и Эллиота",
                        nextScene: 3,
                        action: function() {
                            gameState.repSkill -= 5;
                            updateStats();
                        }
                    }
                ]
            },
            {
                id: 1,
                title: "Первая варка",
                description: `<p class="text-gray-300 mb-4">Вы находите Джесси и предлагаете партнерство. Вместе вы ремонтируете старый фургон и отправляетесь в пустыню для первой варки.</p>
                <p class="text-gray-300 mb-4">Ваши знания химии позволяют создать продукт чистотой 99.1% - это невероятно! Но во время варки появляются два наркоторговца, Краус и Эмилио.</p>
                <p class="text-orange-400 font-bold text-lg">Как вы поступите?</p>`,
                choices: [
                    {
                        text: "Использовать красный фосфор, чтобы отравить наркоторговцев",
                        nextScene: 4,
                        action: function() {
                            gameState.crimeSkill += 15;
                            gameState.inventory.push({name: "Репутация", icon: "fa-skull", description: "Вы совершили первое убийство"});
                            updateInventory();
                            updateStats();
                        }
                    },
                    {
                        text: "Попытаться договориться и предложить сотрудничество",
                        nextScene: 5,
                        action: function() {
                            gameState.money += 5000;
                            updateStats();
                        }
                    },
                    {
                        text: "Сбежать, бросив Джесси",
                        nextScene: 6,
                        action: function() {
                            gameState.jesseRelationship -= 20;
                            updateStats();
                        }
                    }
                ]
            },
            {
                id: 2,
                title: "Легальные заработки",
                description: `<p class="text-gray-300 mb-4">Вы устраиваетесь на вторую работу мойщиком машин. Деньги мизерные, но честные. Ваше здоровье ухудшается, лечение дорожает.</p>
                <p class="text-gray-300 mb-4">На школьной парковке вы снова сталкиваетесь с Джесси, который предлагает "быстрый заработок".</p>
                <p class="text-orange-400 font-bold text-lg">Ваши действия?</p>`,
                choices: [
                    {
                        text: "Согласиться на предложение Джесси",
                        nextScene: 1,
                        action: function() {
                            gameState.crimeSkill += 5;
                            updateStats();
                        }
                    },
                    {
                        text: "Отказаться и продолжать честную работу",
                        nextScene: 7,
                        action: function() {
                            gameState.health -= 10;
                            gameState.repSkill += 5;
                            updateStats();
                        }
                    },
                    {
                        text: "Доложить о Джесси в полицию",
                        nextScene: 8,
                        action: function() {
                            gameState.repSkill += 10;
                            gameState.jesseRelationship = -50;
                            updateStats();
                        }
                    }
                ]
            },
            {
                id: 3,
                title: "Шантаж",
                description: `<p class="text-gray-300 mb-4">Вы приходите на вечеринку к Гретхен и Эллиоту и наедине угрожаете раскрыть их "грязные секреты", если они не оплатят ваше лечение.</p>
                <p class="text-gray-300 mb-4">Эллиот предлагает вам работу в его компании с хорошей страховкой, но это унизительно.</p>
                <p class="text-orange-400 font-bold text-lg">Что вы выберете?</p>`,
                choices: [
                    {
                        text: "Принять предложение работы",
                        nextScene: 9,
                        action: function() {
                            gameState.money += 20000;
                            gameState.repSkill += 10;
                            updateStats();
                        }
                    },
                    {
                        text: "Отказаться и уйти, хлопнув дверью",
                        nextScene: 1,
                        action: function() {
                            gameState.repSkill -= 10;
                            updateStats();
                        }
                    },
                    {
                        text: "Угрожать физической расправой",
                        nextScene: 10,
                        action: function() {
                            gameState.crimeSkill += 10;
                            gameState.repSkill -= 15;
                            updateStats();
                        }
                    }
                ]
            },
            // More scenes would be added here...
            {
                id: 99,
                title: "Конец игры",
                description: `<p class="text-gray-300 mb-4">Ваше путешествие в мире криминала подошло к концу.</p>
                <p class="text-orange-400 font-bold text-lg">${getEndingText()}</p>`,
                choices: [
                    {
                        text: "Начать заново",
                        nextScene: 0,
                        action: function() {
                            resetGame();
                        }
                    }
                ]
            }
        ];

        // Initialize the game
        function initGame() {
            updateScene(0);
            updateStats();
        }

        // Update the current scene
        function updateScene(sceneId) {
            gameState.currentScene = sceneId;
            const scene = scenes.find(s => s.id === sceneId);
            
            document.getElementById('scene-description').innerHTML = `
                <h2 class="text-2xl font-bold text-orange-500 mb-4">${scene.title}</h2>
                ${scene.description}
            `;
            
            const choicesContainer = document.getElementById('choices');
            choicesContainer.innerHTML = '';
            
            scene.choices.forEach((choice, index) => {
                const button = document.createElement('button');
                button.className = 'btn-primary w-full py-3 px-4 rounded-lg font-bold text-white text-left';
                button.innerHTML = `<i class="fas ${getChoiceIcon(index)} mr-2"></i> ${choice.text}`;
                button.onclick = function() {
                    if (choice.action) choice.action();
                    updateScene(choice.nextScene);
                    
                    // Special events
                    if (choice.nextScene === 1 && !gameState.partners.some(p => p.name === "Джесси Пинкман")) {
                        gameState.partners.push({
                            name: "Джесси Пинкман",
                            icon: "fa-user",
                            relationship: 50
                        });
                        updatePartners();
                    }
                    
                    if (sceneId === 1 && choice.nextScene === 4) {
                        showModal(
                            "Первое убийство",
                            "Вы использовали свои знания химии, чтобы убить Крауса и Эмилио. Тела растворяются в плавиковой кислоте, но фургон приходится сжечь.",
                            [
                                {
                                    text: "Продолжить",
                                    action: function() {
                                        gameState.hasCar = false;
                                        closeModal();
                                    }
                                }
                            ]
                        );
                    }
                    
                    // Check for game over conditions
                    if (gameState.health <= 0) {
                        gameState.health = 0;
                        updateScene(99);
                    }
                };
                choicesContainer.appendChild(button);
            });
            
            // Show inventory if not empty
            if (gameState.inventory.length > 0) {
                document.getElementById('inventory').classList.remove('hidden');
            } else {
                document.getElementById('inventory').classList.add('hidden');
            }
            
            // Update character image based on state
            updateCharacterImage();
        }

        // Update character image based on game state
        function updateCharacterImage() {
            const characterImg = document.getElementById('character-img');
            const characterName = document.getElementById('character-name');
            const characterAlias = document.getElementById('character-alias');
            
            if (gameState.isHeisenberg) {
                characterImg.src = 'https://upload.wikimedia.org/wikipedia/en/c/c6/Heisenberg5.jpg';
                characterName.textContent = 'Гейзенберг';
                characterAlias.textContent = 'АКА Уолтер Уайт';
            } else {
                characterImg.src = 'https://upload.wikimedia.org/wikipedia/en/0/03/Walter_White_S5B.png';
                characterName.textContent = 'Уолтер Уайт';
                characterAlias.textContent = 'АКА Гейзенберг';
            }
        }

        // Update stats display
        function updateStats() {
            document.getElementById('health').textContent = gameState.health;
            document.getElementById('money').textContent = `$${gameState.money}`;
            document.getElementById('chem-skill').textContent = `${gameState.chemSkill}%`;
            document.getElementById('crime-skill').textContent = `${gameState.crimeSkill}%`;
            document.getElementById('rep-skill').textContent = `${gameState.repSkill}%`;
            
            // Update skill bars
            document.querySelector('#chem-skill').parentNode.nextElementSibling.firstElementChild.style.width = `${gameState.chemSkill}%`;
            document.querySelector('#crime-skill').parentNode.nextElementSibling.firstElementChild.style.width = `${gameState.crimeSkill}%`;
            document.querySelector('#rep-skill').parentNode.nextElementSibling.firstElementChild.style.width = `${gameState.repSkill}%`;
            
            // Check for Heisenberg transformation
            if (gameState.crimeSkill >= 50 && !gameState.isHeisenberg) {
                gameState.isHeisenberg = true;
                showModal(
                    "Рождение Гейзенберга",
                    "Ваши криминальные навыки достигли нового уровня. Теперь вы - Гейзенберг, опасный наркобарон Альбукерке.",
                    [
                        {
                            text: "Я тот, кто стучит!",
                            action: function() {
                                closeModal();
                                updateCharacterImage();
                            }
                        }
                    ]
                );
            }
        }

        // Update inventory display
        function updateInventory() {
            const inventoryContainer = document.getElementById('inventory-items');
            inventoryContainer.innerHTML = '';
            
            gameState.inventory.forEach(item => {
                const itemElement = document.createElement('div');
                itemElement.className = 'inventory-item bg-gray-800 p-2 rounded-lg text-center cursor-pointer';
                itemElement.innerHTML = `
                    <i class="fas ${item.icon} text-orange-500 text-2xl mb-1"></i>
                    <div class="text-xs text-gray-300">${item.name}</div>
                `;
                itemElement.title = item.description;
                inventoryContainer.appendChild(itemElement);
            });
            
            if (gameState.inventory.length > 0) {
                document.getElementById('inventory').classList.remove('hidden');
            }
        }

        // Update partners display
        function updatePartners() {
            if (gameState.partners.length > 0) {
                document.getElementById('partners-section').classList.remove('hidden');
                const partnersContainer = document.getElementById('partners-list');
                partnersContainer.innerHTML = '';
                
                gameState.partners.forEach(partner => {
                    const partnerElement = document.createElement('div');
                    partnerElement.className = 'bg-gray-800 p-2 rounded-lg text-center';
                    partnerElement.innerHTML = `
                        <i class="fas ${partner.icon} text-orange-500 text-xl mb-1"></i>
                        <div class="text-sm font-bold">${partner.name}</div>
                        <div class="text-xs text-gray-400">Отношения: ${partner.relationship > 0 ? '❤️' : '💔'} ${Math.abs(partner.relationship)}%</div>
                    `;
                    partnersContainer.appendChild(partnerElement);
                });
            }
        }

        // Show modal dialog
        function showModal(title, text, choices) {
            document.getElementById('modal-title').textContent = title;
            document.getElementById('modal-text').innerHTML = text;
            
            const choicesContainer = document.getElementById('modal-choices');
            choicesContainer.innerHTML = '';
            
            choices.forEach(choice => {
                const button = document.createElement('button');
                button.className = 'btn-primary w-full py-2 px-4 rounded-lg font-bold text-white';
                button.textContent = choice.text;
                button.onclick = function() {
                    if (choice.action) choice.action();
                    closeModal();
                };
                choicesContainer.appendChild(button);
            });
            
            document.getElementById('modal').classList.remove('hidden');
        }

        // Close modal dialog
        function closeModal() {
            document.getElementById('modal').classList.add('hidden');
        }

        // Get icon for choice based on index
        function getChoiceIcon(index) {
            const icons = ['fa-mortar-pestle', 'fa-hand-holding-medical', 'fa-user-secret', 'fa-running', 'fa-handshake'];
            return icons[index % icons.length];
        }

        // Get ending text based on game state
        function getEndingText() {
            if (gameState.health <= 0) {
                return "Вы проиграли. Рак победил, а ваша семья осталась без средств к существованию.";
            } else if (gameState.crimeSkill >= 80) {
                return "Вы стали самым опасным наркобароном Альбукерке, но потеряли семью и друзей. Цена успеха оказалась слишком высокой.";
            } else if (gameState.repSkill >= 70) {
                return "Вы выбрали честный путь и сохранили свою репутацию, но лечение оказалось слишком дорогим.";
            } else {
                return "Ваша история закончилась неожиданно. Никто не знает, что случилось с Уолтером Уайтом.";
            }
        }

        // Reset the game
        function resetGame() {
            gameState.health = 100;
            gameState.money = 0;
            gameState.chemSkill = 95;
            gameState.crimeSkill = 15;
            gameState.repSkill = 30;
            gameState.currentScene = 0;
            gameState.inventory = [];
            gameState.partners = [];
            gameState.isHeisenberg = false;
            gameState.hasLab = false;
            gameState.hasCar = false;
            gameState.hasGun = false;
            gameState.jesseRelationship = 0;
            gameState.skylerRelationship = 50;
            gameState.hankRelationship = 70;
            
            updateScene(0);
            updateStats();
            updateInventory();
            updatePartners();
        }

        // Shortcut for making choices
        function makeChoice(index) {
            const scene = scenes.find(s => s.id === gameState.currentScene);
            if (scene && scene.choices[index - 1]) {
                const choice = scene.choices[index - 1];
                if (choice.action) choice.action();
                updateScene(choice.nextScene);
            }
        }

        // Start the game when page loads
        window.onload = initGame;
    </script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Phoenixoni/breaking-bad" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>