summaryrefslogtreecommitdiff
path: root/generate_room_images.py
blob: 9bddd8c49962f5b4a2c7c5b0649de604ca1ecd77 (plain)
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
#!/usr/bin/env python3
"""
Generate spectacular room images for the adventure game
Creates unique artwork for each of the 22 rooms
"""

from PIL import Image, ImageDraw, ImageFont
import os

# Create res directory if it doesn't exist
os.makedirs('res', exist_ok=True)

def create_gradient(draw, width, height, color1, color2, direction='vertical'):
    """Create a gradient background"""
    if direction == 'vertical':
        for i in range(height):
            ratio = i / height
            r = int(color1[0] * (1 - ratio) + color2[0] * ratio)
            g = int(color1[1] * (1 - ratio) + color2[1] * ratio)
            b = int(color1[2] * (1 - ratio) + color2[2] * ratio)
            draw.line([(0, i), (width, i)], fill=(r, g, b))
    else:  # horizontal
        for i in range(width):
            ratio = i / width
            r = int(color1[0] * (1 - ratio) + color2[0] * ratio)
            g = int(color1[1] * (1 - ratio) + color2[1] * ratio)
            b = int(color1[2] * (1 - ratio) + color2[2] * ratio)
            draw.line([(i, 0), (i, height)], fill=(r, g, b))

def add_text_overlay(draw, width, height, text, color=(255, 255, 255)):
    """Add text overlay to image"""
    try:
        font = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf", 24)
    except:
        font = ImageFont.load_default()
    
    # Get text size
    bbox = draw.textbbox((0, 0), text, font=font)
    text_width = bbox[2] - bbox[0]
    text_height = bbox[3] - bbox[1]
    
    # Center text
    x = (width - text_width) // 2
    y = height - 40
    
    # Add shadow
    draw.text((x+2, y+2), text, fill=(0, 0, 0), font=font)
    # Add main text
    draw.text((x, y), text, fill=color, font=font)

def draw_geometric_pattern(draw, width, height, pattern_type='triangles'):
    """Draw geometric patterns"""
    if pattern_type == 'triangles':
        for i in range(0, width, 40):
            for j in range(0, height, 40):
                points = [(i, j+20), (i+20, j), (i+40, j+20), (i+20, j+40)]
                draw.polygon(points, fill=(255, 255, 255, 30))
    elif pattern_type == 'circles':
        for i in range(20, width, 60):
            for j in range(20, height, 60):
                draw.ellipse([i, j, i+30, j+30], fill=(255, 255, 255, 20))

def create_room_001():
    """Entrance Chamber - Stone chamber with torches"""
    img = Image.new('RGB', (400, 300), (40, 30, 20))
    draw = ImageDraw.Draw(img)
    
    # Stone wall gradient
    create_gradient(draw, 400, 300, (60, 50, 40), (30, 25, 20))
    
    # Draw torch flames
    for x in [80, 320]:
        for y in [60, 240]:
            # Torch flame
            draw.ellipse([x-15, y-30, x+15, y], fill=(255, 140, 0))
            draw.ellipse([x-10, y-25, x+10, y-5], fill=(255, 200, 0))
            
    # Draw tripwire
    draw.line([(50, 150), (350, 150)], fill=(192, 192, 192), width=2)
    draw.line([(50, 152), (350, 152)], fill=(128, 128, 128), width=1)
    
    add_text_overlay(draw, 400, 300, "ENTRANCE CHAMBER", (255, 215, 0))
    img.save('res/room_001.png')

def create_room_002():
    """Serpent's Lair - Dark cavern with snake"""
    img = Image.new('RGB', (400, 300), (20, 40, 20))
    draw = ImageDraw.Draw(img)
    
    # Dark green cave gradient
    create_gradient(draw, 400, 300, (40, 60, 40), (15, 25, 15))
    
    # Draw bones scattered on floor
    for x, y in [(100, 250), (200, 260), (300, 245), (150, 270)]:
        draw.ellipse([x, y, x+20, y+8], fill=(220, 220, 180))
        draw.ellipse([x+25, y, x+35, y+8], fill=(220, 220, 180))
    
    # Draw snake coiled in corner
    snake_points = []
    import math
    for i in range(50):
        angle = i * 0.3
        radius = 30 + i * 0.5
        x = 320 + radius * math.cos(angle)
        y = 200 + radius * math.sin(angle)
        snake_points.append((int(x), int(y)))
    
    for i in range(len(snake_points) - 1):
        draw.line([snake_points[i], snake_points[i+1]], fill=(0, 100, 0), width=8)
    
    # Snake head
    draw.ellipse([305, 185, 325, 205], fill=(0, 120, 0))
    # Eyes
    draw.ellipse([310, 190, 314, 194], fill=(255, 0, 0))
    draw.ellipse([316, 190, 320, 194], fill=(255, 0, 0))
    
    add_text_overlay(draw, 400, 300, "SERPENT'S LAIR", (255, 100, 100))
    img.save('res/room_002.png')

def create_room_003():
    """Marble Corridor - Elegant hallway"""
    img = Image.new('RGB', (400, 300), (240, 240, 240))
    draw = ImageDraw.Draw(img)
    
    # Marble gradient
    create_gradient(draw, 400, 300, (250, 250, 250), (200, 200, 200))
    
    # Draw marble columns
    for x in [80, 160, 240, 320]:
        draw.rectangle([x-15, 50, x+15, 280], fill=(220, 220, 220))
        draw.rectangle([x-20, 45, x+20, 65], fill=(200, 200, 200))
        draw.rectangle([x-20, 260, x+20, 280], fill=(200, 200, 200))
    
    # Draw light patterns from windows
    for i in range(5):
        y = 80 + i * 30
        draw.polygon([(50, y), (100, y+10), (50, y+20)], fill=(255, 255, 200, 100))
        draw.polygon([(350, y), (300, y+10), (350, y+20)], fill=(255, 255, 200, 100))
    
    add_text_overlay(draw, 400, 300, "MARBLE CORRIDOR", (100, 100, 150))
    img.save('res/room_003.png')

def create_room_004():
    """Guard Post - Fortified checkpoint"""
    img = Image.new('RGB', (400, 300), (80, 70, 60))
    draw = ImageDraw.Draw(img)
    
    # Stone fortress gradient
    create_gradient(draw, 400, 300, (100, 90, 80), (60, 50, 40))
    
    # Draw iron gate
    for x in range(150, 250, 10):
        draw.rectangle([x, 80, x+5, 220], fill=(60, 60, 60))
    for y in range(100, 200, 20):
        draw.rectangle([150, y, 245, y+5], fill=(60, 60, 60))
    
    # Draw guard figure
    # Body
    draw.rectangle([280, 180, 320, 240], fill=(100, 100, 150))
    # Head
    draw.ellipse([285, 150, 315, 180], fill=(200, 150, 120))
    # Helmet
    draw.ellipse([280, 145, 320, 175], fill=(150, 150, 150))
    # Sword
    draw.rectangle([270, 160, 275, 200], fill=(192, 192, 192))
    draw.rectangle([268, 155, 277, 165], fill=(139, 69, 19))
    
    add_text_overlay(draw, 400, 300, "GUARD POST", (255, 215, 0))
    img.save('res/room_004.png')

def create_room_005():
    """Treasure Antechamber - Victory room"""
    img = Image.new('RGB', (400, 300), (255, 215, 0))
    draw = ImageDraw.Draw(img)
    
    # Golden gradient
    create_gradient(draw, 400, 300, (255, 215, 0), (218, 165, 32))
    
    # Draw treasure piles
    for x, y in [(100, 220), (200, 200), (300, 210)]:
        # Gold coins
        for i in range(10):
            for j in range(5):
                coin_x = x + i * 8 + j * 4
                coin_y = y + j * 8
                if coin_x < 380 and coin_y < 280:
                    draw.ellipse([coin_x, coin_y, coin_x+15, coin_y+8], fill=(255, 223, 0))
    
    # Draw jeweled walls
    for i in range(20):
        x = 20 + (i % 4) * 90
        y = 50 + (i // 4) * 40
        # Jewels
        colors = [(255, 0, 0), (0, 255, 0), (0, 0, 255), (255, 0, 255)]
        color = colors[i % 4]
        draw.ellipse([x, y, x+20, y+20], fill=color)
        draw.ellipse([x+5, y+5, x+15, y+15], fill=(255, 255, 255))
    
    add_text_overlay(draw, 400, 300, "TREASURE CHAMBER", (139, 69, 19))
    img.save('res/room_005.png')

def create_room_006():
    """Rose Garden - Beautiful garden"""
    img = Image.new('RGB', (400, 300), (50, 150, 50))
    draw = ImageDraw.Draw(img)
    
    # Garden gradient
    create_gradient(draw, 400, 300, (100, 200, 100), (30, 100, 30))
    
    # Draw roses
    rose_positions = [(80, 100), (150, 120), (250, 90), (320, 110), (180, 180), (280, 200)]
    for x, y in rose_positions:
        # Rose petals
        for angle in range(0, 360, 45):
            import math
            px = x + 15 * math.cos(math.radians(angle))
            py = y + 15 * math.sin(math.radians(angle))
            draw.ellipse([px-8, py-8, px+8, py+8], fill=(255, 100, 150))
        # Rose center
        draw.ellipse([x-5, y-5, x+5, y+5], fill=(255, 200, 200))
        # Stem
        draw.line([(x, y+10), (x, y+40)], fill=(0, 150, 0), width=3)
    
    # Draw crystal fountain in center
    draw.ellipse([180, 220, 220, 260], fill=(200, 230, 255))
    draw.ellipse([185, 225, 215, 255], fill=(150, 200, 255))
    
    # Pink key glimmer
    draw.ellipse([300, 250, 320, 270], fill=(255, 192, 203))
    draw.ellipse([305, 255, 315, 265], fill=(255, 255, 255))
    
    add_text_overlay(draw, 400, 300, "ROSE GARDEN", (255, 192, 203))
    img.save('res/room_006.png')

def create_room_007():
    """Spider's Web - Dark chamber with webs"""
    img = Image.new('RGB', (400, 300), (30, 20, 40))
    draw = ImageDraw.Draw(img)
    
    # Dark gradient
    create_gradient(draw, 400, 300, (50, 40, 60), (20, 10, 30))
    
    # Draw spider webs
    # Web 1
    web_center = (120, 100)
    for radius in range(20, 80, 15):
        draw.ellipse([web_center[0]-radius, web_center[1]-radius, 
                     web_center[0]+radius, web_center[1]+radius], 
                    outline=(200, 200, 200), width=1)
    for angle in range(0, 360, 30):
        import math
        x2 = web_center[0] + 80 * math.cos(math.radians(angle))
        y2 = web_center[1] + 80 * math.sin(math.radians(angle))
        draw.line([web_center, (x2, y2)], fill=(200, 200, 200), width=1)
    
    # Draw spider
    spider_x, spider_y = 120, 100
    # Body
    draw.ellipse([spider_x-10, spider_y-15, spider_x+10, spider_y+15], fill=(50, 20, 20))
    # Legs
    for i in range(8):
        angle = i * 45
        import math
        x1 = spider_x + 10 * math.cos(math.radians(angle))
        y1 = spider_y + 10 * math.sin(math.radians(angle))
        x2 = spider_x + 25 * math.cos(math.radians(angle))
        y2 = spider_y + 25 * math.sin(math.radians(angle))
        draw.line([(x1, y1), (x2, y2)], fill=(80, 40, 40), width=2)
    
    # Green key caught in web
    draw.ellipse([280, 180, 300, 200], fill=(0, 255, 0))
    draw.ellipse([285, 185, 295, 195], fill=(255, 255, 255))
    # Web strands over key
    draw.line([(270, 170), (310, 210)], fill=(200, 200, 200), width=1)
    draw.line([(270, 210), (310, 170)], fill=(200, 200, 200), width=1)
    
    add_text_overlay(draw, 400, 300, "SPIDER'S WEB", (200, 200, 200))
    img.save('res/room_007.png')

def create_room_008():
    """Armory - Well-maintained weapons room"""
    img = Image.new('RGB', (400, 300), (70, 60, 50))
    draw = ImageDraw.Draw(img)
    
    # Stone armory gradient
    create_gradient(draw, 400, 300, (90, 80, 70), (50, 40, 30))
    
    # Draw weapon racks
    for x in [60, 340]:
        draw.rectangle([x-5, 50, x+5, 250], fill=(139, 69, 19))
        for y in range(80, 220, 30):
            draw.rectangle([x-30, y, x+30, y+5], fill=(139, 69, 19))
    
    # Draw weapons on walls
    weapons = [(90, 90), (90, 120), (90, 150), (310, 90), (310, 120), (310, 150)]
    for x, y in weapons:
        # Sword blade
        draw.rectangle([x-25, y-3, x+25, y+3], fill=(192, 192, 192))
        # Sword hilt
        draw.rectangle([x-30, y-8, x-20, y+8], fill=(139, 69, 19))
    
    # Special Spider Killer Sword (glowing)
    sword_x, sword_y = 200, 150
    # Glow effect
    for i in range(5):
        draw.rectangle([sword_x-30-i, sword_y-8-i, sword_x+30+i, sword_y+8+i], 
                      outline=(255, 215, 0, 100), width=1)
    # Blade
    draw.rectangle([sword_x-25, sword_y-3, sword_x+25, sword_y+3], fill=(255, 255, 255))
    # Hilt
    draw.rectangle([sword_x-30, sword_y-8, sword_x-20, sword_y+8], fill=(218, 165, 32))
    
    # Draw shields
    for x, y in [(150, 200), (250, 200)]:
        draw.ellipse([x-20, y-25, x+20, y+25], fill=(150, 150, 150))
        draw.ellipse([x-15, y-20, x+15, y+20], fill=(100, 100, 150))
    
    add_text_overlay(draw, 400, 300, "ARMORY", (255, 215, 0))
    img.save('res/room_008.png')

def create_room_009():
    """Giant Spider's Domain"""
    img = Image.new('RGB', (400, 300), (20, 10, 30))
    draw = ImageDraw.Draw(img)
    
    # Very dark cave
    create_gradient(draw, 400, 300, (40, 20, 50), (10, 5, 15))
    
    # Massive web covering most of the room
    web_center = (200, 150)
    for radius in range(30, 150, 20):
        draw.ellipse([web_center[0]-radius, web_center[1]-radius, 
                     web_center[0]+radius, web_center[1]+radius], 
                    outline=(150, 150, 150), width=2)
    for angle in range(0, 360, 20):
        import math
        x2 = web_center[0] + 140 * math.cos(math.radians(angle))
        y2 = web_center[1] + 140 * math.sin(math.radians(angle))
        draw.line([web_center, (x2, y2)], fill=(150, 150, 150), width=2)
    
    # Giant spider
    spider_x, spider_y = 200, 150
    # Body
    draw.ellipse([spider_x-25, spider_y-35, spider_x+25, spider_y+35], fill=(80, 20, 20))
    draw.ellipse([spider_x-15, spider_y-25, spider_x+15, spider_y+25], fill=(120, 40, 40))
    # Giant legs
    for i in range(8):
        angle = i * 45
        import math
        x1 = spider_x + 25 * math.cos(math.radians(angle))
        y1 = spider_y + 25 * math.sin(math.radians(angle))
        x2 = spider_x + 70 * math.cos(math.radians(angle))
        y2 = spider_y + 70 * math.sin(math.radians(angle))
        draw.line([(x1, y1), (x2, y2)], fill=(100, 40, 40), width=6)
    # Eyes
    for i in range(8):
        angle = i * 45
        import math
        x = spider_x + 15 * math.cos(math.radians(angle))
        y = spider_y + 15 * math.sin(math.radians(angle))
        draw.ellipse([x-3, y-3, x+3, y+3], fill=(255, 0, 0))
    
    # Gold glittering underneath
    for i in range(20):
        import random
        x = spider_x + random.randint(-60, 60)
        y = spider_y + random.randint(20, 50)
        if 50 < x < 350 and 180 < y < 280:
            draw.ellipse([x-3, y-3, x+3, y+3], fill=(255, 215, 0))
    
    add_text_overlay(draw, 400, 300, "GIANT SPIDER'S DOMAIN", (255, 0, 0))
    img.save('res/room_009.png')

def create_room_010():
    """Bat Cave"""
    img = Image.new('RGB', (400, 300), (30, 20, 50))
    draw = ImageDraw.Draw(img)
    
    # Cave gradient
    create_gradient(draw, 400, 300, (50, 40, 70), (20, 10, 30))
    
    # Cave stalactites
    stalactites = [(80, 0), (150, 0), (220, 0), (290, 0), (350, 0)]
    for x, y in stalactites:
        points = [(x, y), (x-15, y+40), (x+15, y+40)]
        draw.polygon(points, fill=(60, 50, 40))
    
    # Giant bat hanging upside down
    bat_x, bat_y = 200, 80
    # Bat body
    draw.ellipse([bat_x-20, bat_y, bat_x+20, bat_y+40], fill=(50, 30, 30))
    # Bat wings (spread wide)
    wing_points_left = [(bat_x-20, bat_y+10), (bat_x-80, bat_y-20), (bat_x-60, bat_y+30), (bat_x-20, bat_y+25)]
    wing_points_right = [(bat_x+20, bat_y+10), (bat_x+80, bat_y-20), (bat_x+60, bat_y+30), (bat_x+20, bat_y+25)]
    draw.polygon(wing_points_left, fill=(40, 20, 20))
    draw.polygon(wing_points_right, fill=(40, 20, 20))
    # Wing membrane details
    for i in range(3):
        x_offset = -60 + i * 20
        draw.line([(bat_x-20, bat_y+15), (bat_x+x_offset, bat_y-10)], fill=(60, 40, 40), width=1)
        x_offset = 20 + i * 20
        draw.line([(bat_x+20, bat_y+15), (bat_x+x_offset, bat_y-10)], fill=(60, 40, 40), width=1)
    
    # Bat head
    draw.ellipse([bat_x-15, bat_y+30, bat_x+15, bat_y+50], fill=(60, 40, 40))
    # Red eyes
    draw.ellipse([bat_x-8, bat_y+35, bat_x-3, bat_y+40], fill=(255, 0, 0))
    draw.ellipse([bat_x+3, bat_y+35, bat_x+8, bat_y+40], fill=(255, 0, 0))
    # Ears
    draw.polygon([(bat_x-15, bat_y+30), (bat_x-25, bat_y+15), (bat_x-10, bat_y+25)], fill=(60, 40, 40))
    draw.polygon([(bat_x+15, bat_y+30), (bat_x+25, bat_y+15), (bat_x+10, bat_y+25)], fill=(60, 40, 40))
    
    # Blue key in bat's talons
    draw.ellipse([bat_x-8, bat_y+45, bat_x+8, bat_y+60], fill=(0, 100, 255))
    draw.ellipse([bat_x-3, bat_y+50, bat_x+3, bat_y+55], fill=(255, 255, 255))
    
    # Sound waves (beating wings)
    for i in range(3):
        radius = 60 + i * 20
        draw.ellipse([bat_x-radius, bat_y-radius//2, bat_x+radius, bat_y+radius//2], 
                    outline=(100, 100, 100, 50), width=1)
    
    add_text_overlay(draw, 400, 300, "BAT CAVE", (100, 100, 255))
    img.save('res/room_010.png')

def create_remaining_rooms():
    """Create rooms 11-22"""
    
    # Room 011 - Key Chamber with combination lock
    img = Image.new('RGB', (400, 300), (100, 80, 120))
    draw = ImageDraw.Draw(img)
    create_gradient(draw, 400, 300, (120, 100, 140), (80, 60, 100))
    
    # Circular room
    draw.ellipse([50, 50, 350, 250], outline=(200, 200, 200), width=3)
    
    # Combination lock on wall
    draw.rectangle([150, 80, 250, 150], fill=(100, 100, 100))
    draw.rectangle([160, 90, 240, 140], fill=(50, 50, 50))
    # Lock dials
    for i, x in enumerate([175, 195, 215, 235]):
        draw.ellipse([x-10, 105, x+10, 125], fill=(200, 200, 200))
        draw.ellipse([x-8, 107, x+8, 123], fill=(150, 150, 150))
    
    # Pink key on pedestal
    draw.rectangle([180, 180, 220, 220], fill=(150, 150, 150))
    draw.ellipse([190, 160, 210, 180], fill=(255, 192, 203))
    draw.ellipse([195, 165, 205, 175], fill=(255, 255, 255))
    
    add_text_overlay(draw, 400, 300, "KEY CHAMBER", (255, 192, 203))
    img.save('res/room_011.png')
    
    # Room 012 - Rat Warren
    img = Image.new('RGB', (400, 300), (60, 40, 30))
    draw = ImageDraw.Draw(img)
    create_gradient(draw, 400, 300, (80, 60, 50), (40, 20, 10))
    
    # Draw 4 rats in different positions
    rat_positions = [(100, 200), (200, 180), (280, 220), (150, 240)]
    for i, (x, y) in enumerate(rat_positions):
        # Rat body
        draw.ellipse([x-15, y-8, x+15, y+8], fill=(80, 60, 40))
        # Rat head
        draw.ellipse([x+10, y-5, x+25, y+5], fill=(90, 70, 50))
        # Tail
        import math
        tail_x = x - 15 - 20 * math.cos(i * 0.5)
        tail_y = y + 10 * math.sin(i * 0.5)
        draw.line([(x-15, y), (tail_x, tail_y)], fill=(70, 50, 30), width=3)
        # Eyes (glowing)
        draw.ellipse([x+18, y-3, x+22, y+1], fill=(255, 255, 0))
        draw.ellipse([x+13, y-3, x+17, y+1], fill=(255, 255, 0))
    
    add_text_overlay(draw, 400, 300, "RAT WARREN - COUNT: 4", (255, 255, 0))
    img.save('res/room_012.png')
    
    # Room 013 - Second Serpent's Den
    img = Image.new('RGB', (400, 300), (30, 50, 30))
    draw = ImageDraw.Draw(img)
    create_gradient(draw, 400, 300, (50, 70, 50), (20, 30, 20))
    
    # Snake coiled around yellow key
    import math
    snake_points = []
    center_x, center_y = 200, 150
    for i in range(40):
        angle = i * 0.4
        radius = 20 + i * 0.8
        x = center_x + radius * math.cos(angle)
        y = center_y + radius * math.sin(angle)
        snake_points.append((int(x), int(y)))
    
    for i in range(len(snake_points) - 1):
        draw.line([snake_points[i], snake_points[i+1]], fill=(0, 120, 0), width=6)
    
    # Snake head
    draw.ellipse([185, 135, 205, 155], fill=(0, 140, 0))
    draw.ellipse([190, 140, 194, 144], fill=(255, 0, 0))  # Eye
    draw.ellipse([196, 140, 200, 144], fill=(255, 0, 0))  # Eye
    
    # Yellow key in center
    draw.ellipse([195, 145, 205, 155], fill=(255, 255, 0))
    draw.ellipse([197, 147, 203, 153], fill=(255, 255, 255))
    
    add_text_overlay(draw, 400, 300, "SECOND SERPENT'S DEN", (255, 255, 0))
    img.save('res/room_013.png')
    
    # Continue with remaining rooms...
    # Room 014 - Emerald Chamber
    img = Image.new('RGB', (400, 300), (0, 100, 0))
    draw = ImageDraw.Draw(img)
    create_gradient(draw, 400, 300, (0, 150, 0), (0, 80, 0))
    
    # Green mystical glow effect
    for i in range(10):
        alpha = 255 - i * 20
        draw.ellipse([50+i*5, 50+i*5, 350-i*5, 250-i*5], 
                    outline=(0, 255, 0, alpha), width=2)
    
    # Green key with magical aura
    key_x, key_y = 200, 150
    # Aura
    for i in range(5):
        draw.ellipse([key_x-20-i*3, key_y-10-i*3, key_x+20+i*3, key_y+10+i*3], 
                    outline=(0, 255, 0, 100-i*20), width=1)
    # Key
    draw.ellipse([key_x-15, key_y-8, key_x+15, key_y+8], fill=(0, 255, 0))
    draw.ellipse([key_x-10, key_y-5, key_x+10, key_y+5], fill=(255, 255, 255))
    
    add_text_overlay(draw, 400, 300, "EMERALD CHAMBER", (255, 255, 255))
    img.save('res/room_014.png')
    
    # Room 015 - Shadow Spider's Lair
    img = Image.new('RGB', (400, 300), (10, 5, 20))
    draw = ImageDraw.Draw(img)
    create_gradient(draw, 400, 300, (20, 10, 30), (5, 2, 10))
    
    # Barely visible spider in shadows
    spider_x, spider_y = 300, 100
    # Spider outline (very faint)
    draw.ellipse([spider_x-12, spider_y-18, spider_x+12, spider_y+18], 
                outline=(40, 40, 40), width=1)
    # Faint legs
    for i in range(8):
        angle = i * 45
        import math
        x1 = spider_x + 12 * math.cos(math.radians(angle))
        y1 = spider_y + 12 * math.sin(math.radians(angle))
        x2 = spider_x + 25 * math.cos(math.radians(angle))
        y2 = spider_y + 25 * math.sin(math.radians(angle))
        draw.line([(x1, y1), (x2, y2)], fill=(30, 30, 30), width=1)
    # Only eyes are clearly visible
    draw.ellipse([spider_x-3, spider_y-3, spider_x+3, spider_y+3], fill=(255, 0, 0))
    
    add_text_overlay(draw, 400, 300, "SHADOW SPIDER'S LAIR", (100, 100, 100))
    img.save('res/room_015.png')
    
    # Room 016 - Merchant's Shop
    img = Image.new('RGB', (400, 300), (139, 118, 76))
    draw = ImageDraw.Draw(img)
    create_gradient(draw, 400, 300, (160, 140, 100), (120, 100, 60))
    
    # Shop counter
    draw.rectangle([50, 150, 350, 200], fill=(139, 69, 19))
    draw.rectangle([50, 140, 350, 155], fill=(160, 82, 45))
    
    # Merchant figure
    # Body
    draw.rectangle([280, 100, 320, 150], fill=(100, 150, 200))
    # Head
    draw.ellipse([285, 70, 315, 100], fill=(220, 180, 140))
    # Hat
    draw.polygon([(290, 70), (310, 70), (300, 50)], fill=(200, 0, 0))
    # Smile
    draw.arc([290, 80, 310, 95], 0, 180, fill=(150, 100, 100), width=2)
    
    # Bow displayed prominently
    bow_x, bow_y = 150, 120
    # Bow curve
    draw.arc([bow_x-30, bow_y-40, bow_x+30, bow_y+40], 270, 90, 
            fill=(139, 69, 19), width=5)
    # Bow string
    draw.line([(bow_x-25, bow_y-35), (bow_x-25, bow_y+35)], 
             fill=(220, 220, 220), width=2)
    # Arrow
    draw.line([(bow_x-20, bow_y), (bow_x+40, bow_y)], 
             fill=(139, 69, 19), width=3)
    draw.polygon([(bow_x+40, bow_y), (bow_x+35, bow_y-5), (bow_x+35, bow_y+5)], 
                fill=(192, 192, 192))
    
    add_text_overlay(draw, 400, 300, "MERCHANT'S SHOP", (255, 215, 0))
    img.save('res/room_016.png')
    
    # Rooms 017-022 (simplified for space)
    room_configs = [
        (17, "GREAT HALL", (100, 90, 80), (80, 70, 60)),
        (18, "NEXUS CHAMBER", (80, 60, 100), (60, 40, 80)),
        (19, "CRYSTAL CAVERN", (150, 100, 200), (100, 50, 150)),
        (20, "ABANDONED ARMORY", (60, 50, 40), (40, 30, 20)),
        (21, "STARTING CHAMBER", (100, 120, 100), (80, 100, 80)),
        (22, "FINAL KEY CHAMBER", (200, 180, 100), (180, 160, 80))
    ]
    
    for room_num, title, color1, color2 in room_configs:
        img = Image.new('RGB', (400, 300), color1)
        draw = ImageDraw.Draw(img)
        create_gradient(draw, 400, 300, color1, color2)
        
        if room_num == 17:  # Great Hall - add columns
            for x in [100, 200, 300]:
                draw.rectangle([x-10, 50, x+10, 250], fill=(120, 110, 100))
        elif room_num == 18:  # Nexus - energy effects
            for i in range(3):
                size = 100 - i*30
                x1, y1 = 200 - size//2, 150 - size//2
                x2, y2 = 200 + size//2, 150 + size//2
                if x2 > x1 and y2 > y1:
                    draw.ellipse([x1, y1, x2, y2], outline=(255, 255, 255), width=2)
        elif room_num == 19:  # Crystal Cavern - crystals
            crystal_pos = [(80, 100), (150, 80), (250, 120), (320, 90)]
            for x, y in crystal_pos:
                draw.polygon([(x, y-20), (x-15, y+20), (x+15, y+20)], 
                           fill=(200, 150, 255))
        elif room_num == 20:  # Abandoned Armory - rusty sword
            draw.rectangle([190, 140, 240, 150], fill=(139, 69, 19))  # Rusty blade
            draw.rectangle([180, 135, 195, 155], fill=(101, 67, 33))  # Handle
        elif room_num == 21:  # Starting Chamber - blue door
            draw.rectangle([300, 100, 320, 200], fill=(0, 100, 255))
            draw.ellipse([305, 145, 315, 155], fill=(255, 215, 0))  # Door handle
        elif room_num == 22:  # Final Key Chamber - yellow key on table
            draw.rectangle([150, 180, 250, 200], fill=(139, 69, 19))  # Table
            draw.ellipse([190, 160, 210, 180], fill=(255, 255, 0))  # Yellow key
            draw.ellipse([195, 165, 205, 175], fill=(255, 255, 255))
        
        add_text_overlay(draw, 400, 300, title, (255, 255, 255))
        img.save(f'res/room_{room_num:03d}.png')

# Generate all room images
print("🎨 Generating spectacular room images...")

create_room_001()
create_room_002()
create_room_003()
create_room_004()
create_room_005()
create_room_006()
create_room_007()
create_room_008()
create_room_009()
create_room_010()
create_remaining_rooms()

print("✨ All 22 room images generated successfully!")
print("📁 Images saved in res/ directory as room_001.png through room_022.png")