-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_catalog.py
More file actions
614 lines (559 loc) · 25.1 KB
/
build_catalog.py
File metadata and controls
614 lines (559 loc) · 25.1 KB
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
#!/usr/bin/env python3
"""
Indexador SlotForge — lê assets + specs espalhados pelo workspace e gera
data/catalog.json com estrutura uniforme por hero.
Cada hero: id, title, series, image_path, fullscreen_prompt (recriável),
spec (variáveis que alimentam o prompt), research (se houver dossier),
layers (prompts por camada quando existirem).
"""
import os
import sys
import json
import re
import importlib.util
from pathlib import Path
ROOT = Path("/home/user/workspace")
GALLERY = ROOT / "slotforge_gallery"
ASSETS = GALLERY / "assets"
OUT = Path("/home/user/workspace/slotforge_catalog/data/catalog.json")
STATIC_IMG = Path("/home/user/workspace/slotforge_catalog/static/heroes")
STATIC_IMG.mkdir(parents=True, exist_ok=True)
def load_hero_clean_specs():
"""Carrega o módulo hero_clean_gen e extrai TEMPLATE + GAMES."""
spec = importlib.util.spec_from_file_location(
"hero_clean_gen", GALLERY / "hero_clean_gen.py"
)
mod = importlib.util.module_from_spec(spec)
# Evitar execução de requests network: stub HTTP
sys.modules["hero_clean_gen"] = mod
# Evitar rodar main: setar __name__ != __main__ (importlib já faz isso)
spec.loader.exec_module(mod)
return mod.TEMPLATE, mod.GAMES
def render_prompt(template, game_spec):
"""Aplica .format() com os vars do spec para reconstruir o prompt."""
mapping = {
"LOGO": game_spec.get("logo", ""),
"LOGO_ORNAMENT": game_spec.get("logo_ornament", ""),
"REEL_FRAME": game_spec.get("reel_frame", ""),
"BUTTON_BAR": game_spec.get("button_bar", ""),
"SYM1": game_spec.get("sym1", ""),
"SYM2": game_spec.get("sym2", ""),
"SYM3": game_spec.get("sym3", ""),
"SYM4": game_spec.get("sym4", ""),
"SYM5": game_spec.get("sym5", ""),
"BACKGROUND": game_spec.get("background", ""),
"PALETTE": game_spec.get("palette", ""),
}
try:
return template.format(**mapping)
except KeyError as e:
return f"[PROMPT RECONSTRUCTION ERROR: missing {e}]"
def pretty_title(hero_id: str) -> str:
"""top10_01_bison_ascent -> 'Bison Ascent'."""
parts = hero_id.split("_")
# Descartar prefixo 'top10', 'tgs', 'diamond' e número
keep = []
for i, p in enumerate(parts):
if i == 0 and p in {"top10", "tgs", "diamond"}:
continue
if p.isdigit() or (len(p) == 2 and p.isdigit()):
continue
keep.append(p)
return " ".join(w.capitalize() for w in keep)
def series_from_id(hero_id: str) -> str:
if hero_id.startswith("top10"):
return "Top 10 Diamond Demo"
if hero_id.startswith("tgs_"):
return "TGS Reimagined"
if hero_id.startswith("diamond_"):
return "Diamond Demo"
if hero_id.startswith("bison_express"):
return "Bison Express Series"
if hero_id.startswith("coin_baron"):
return "Coin Baron Kingdom Series"
return "Other"
def copy_image_to_static(src_path: Path, hero_id: str) -> str | None:
"""Copia imagem pra static/heroes/ e retorna URL relativa ao servidor."""
if not src_path.exists():
return None
dst = STATIC_IMG / f"{hero_id}{src_path.suffix}"
if not dst.exists() or dst.stat().st_mtime < src_path.stat().st_mtime:
dst.write_bytes(src_path.read_bytes())
return f"/static/heroes/{dst.name}"
def build_hero_clean_entries(template, games):
"""Constrói entradas para os 18 heroes clean (top10 + tgs + diamond_01)."""
entries = []
for g in games:
hero_id = g["id"]
title = pretty_title(hero_id)
series = series_from_id(hero_id)
# Localizar imagem
img_path = ASSETS / "hero_clean_1x5" / f"{hero_id}.png"
if not img_path.exists():
# Fallback: top10/ ou tgs_reimagined/
if hero_id.startswith("top10_"):
alt = ASSETS / "top10" / f"{hero_id[6:]}.png"
if alt.exists():
img_path = alt
elif hero_id.startswith("tgs_"):
num_theme = hero_id[4:] # ex "01_paradise_cove_riches"
alt = ASSETS / "tgs_reimagined" / f"{num_theme}.png"
if alt.exists():
img_path = alt
image_url = copy_image_to_static(img_path, hero_id) if img_path.exists() else None
prompt = render_prompt(template, g)
entries.append({
"id": hero_id,
"title": title,
"series": series,
"form_factor": "iPad landscape 1x5 (MadLab)",
"canonical_size": "2048x1536",
"image_url": image_url,
"has_image": image_url is not None,
"fullscreen_prompt": prompt,
"spec": {
"logo": g.get("logo", ""),
"logo_ornament": g.get("logo_ornament", ""),
"reel_frame": g.get("reel_frame", ""),
"button_bar": g.get("button_bar", ""),
"symbols": [g.get(f"sym{i}", "") for i in range(1, 6)],
"background": g.get("background", ""),
"palette": g.get("palette", ""),
},
"model": "gemini-3-pro-image-preview",
"source_script": "hero_clean_gen.py",
"layers": None, # heroes clean são fullscreen single-pass
})
return entries
def build_coin_baron_entries():
"""Coin Baron tem 8 form factors em slotforge_gallery/assets/coin_baron/."""
folder = ASSETS / "coin_baron"
if not folder.exists():
return []
form_factors = {
"cabinet_5x3.png": ("Cabinet 1080x1920 portrait 5x3", "1080x1920"),
"web_portrait.png": ("Web portrait", "1080x1920"),
"web_landscape.png": ("Web landscape", "1920x1080"),
"ipad_portrait.png": ("iPad portrait", "2048x2732"),
"ipad_landscape.png": ("iPad landscape", "2752x2064"),
"mobile_portrait.png": ("Mobile portrait", "1170x2532"),
"mobile_landscape.png": ("Mobile landscape", "2532x1170"),
"mn_pulltab.png": ("Minnesota pulltab", "1080x1920"),
}
entries = []
for fname, (label, size) in form_factors.items():
src = folder / fname
if not src.exists():
continue
hero_id = f"coin_baron_{fname.replace('.png', '')}"
image_url = copy_image_to_static(src, hero_id)
entries.append({
"id": hero_id,
"title": f"Coin Baron Kingdom — {label}",
"series": "Coin Baron Kingdom Series",
"form_factor": label,
"canonical_size": size,
"image_url": image_url,
"has_image": True,
"fullscreen_prompt": "(prompt stored in hero_pipeline_v2 + specific form factor scripts — see layers)",
"spec": {"note": "Multi form factor da série Coin Baron Kingdom"},
"model": "nano-banana-pro",
"source_script": "hero_pipeline_v2.py / hero_ipad_gen.py",
"layers": None,
})
return entries
def build_bison_express_entries():
folder = ASSETS / "bison_express"
if not folder.exists():
return []
entries = []
for src in sorted(folder.glob("*.png")):
hero_id = f"bison_express_{src.stem}"
image_url = copy_image_to_static(src, hero_id)
entries.append({
"id": hero_id,
"title": f"Bison Express — {src.stem.replace('_', ' ').title()}",
"series": "Bison Express Series",
"form_factor": "Multi",
"canonical_size": "varies",
"image_url": image_url,
"has_image": True,
"fullscreen_prompt": "(prompt em hero_pipeline_v2 / scripts específicos)",
"spec": {"note": "Bison Express evolution série"},
"model": "nano-banana-pro",
"source_script": "hero_pipeline_v2.py",
"layers": None,
})
return entries
def build_run_entries():
"""Carrega runs salvos do forgingslots (Diamond Dazzle, Mystic Throne)."""
runs_dir = ROOT / "slotforge_data" / "forgingslots_runs"
if not runs_dir.exists():
return []
entries = []
for rj in runs_dir.glob("*_run.json"):
try:
with open(rj) as f:
data = json.load(f)
except Exception:
continue
concept = data.get("concept", {})
hero_id = rj.stem.replace("_run", "") # ex ca87bc94dc9c_diamond_dazzle
img_candidate = runs_dir / f"{hero_id}.png"
image_url = copy_image_to_static(img_candidate, hero_id) if img_candidate.exists() else None
entries.append({
"id": hero_id,
"title": concept.get("title", hero_id),
"series": "Forging Slots Runs",
"form_factor": "Portrait 9:16 fullscreen UI",
"canonical_size": "1080x1920",
"image_url": image_url,
"has_image": image_url is not None,
"fullscreen_prompt": concept.get("fullscreen_prompt", ""),
"spec": {
"tagline": concept.get("tagline", ""),
"family_hint": concept.get("family_hint", ""),
"palette": concept.get("palette", []),
"hero_character": concept.get("hero_character", ""),
"symbols": concept.get("symbols", []),
"special": concept.get("special", {}),
"background": concept.get("background", ""),
"reel_grid": concept.get("reel_grid", {}),
},
"model": "nano-banana-pro",
"source_script": "forgingslots.py (Flask app)",
"layers": None,
"base_codename": data.get("base_codename"),
"base_slug": data.get("base_slug"),
})
return entries
def read_prompt_file(prompt_path: Path) -> str:
"""Lê arquivo de prompt associado a uma imagem, se existir."""
if not prompt_path.exists():
return ""
try:
return prompt_path.read_text().strip()
except Exception:
return ""
def build_thunder_drum_wyrm_entries():
"""Série Thunder Drum Wyrm — 3 pipelines paralelos (v1, v2 5x3, seq) em phase2_mystic_throne.
Inclui cabinet portrait + mobile portrait + iPad portrait + web landscape + iPad landscape."""
base = ROOT / "phase2_mystic_throne"
entries = []
# Pipeline v1 (thunder_drum_wyrm — 5 form factors)
p1 = base / "pipeline_thunder_drum_wyrm"
if p1.exists():
form_factors = {
"cabinet_vertical.png": ("Cabinet portrait vertical", "1080x1920"),
"mobile_portrait.png": ("Mobile portrait", "1170x2532"),
"ipad_portrait.png": ("iPad portrait", "2048x2732"),
"ipad_landscape.png": ("iPad landscape", "2752x2064"),
"web_landscape.png": ("Web landscape", "1920x1080"),
}
for fname, (label, size) in form_factors.items():
src = p1 / fname
if not src.exists():
continue
stem = src.stem
hero_id = f"tdw_v1_{stem}"
image_url = copy_image_to_static(src, hero_id)
prompt = read_prompt_file(p1 / f"{stem}_prompt.txt")
entries.append({
"id": hero_id,
"title": f"Thunder Drum Wyrm — {label} (v1)",
"series": "Thunder Drum Wyrm Pipeline",
"form_factor": label,
"canonical_size": size,
"image_url": image_url,
"has_image": True,
"fullscreen_prompt": prompt or "(prompt em pipeline_thunder_drum_wyrm)",
"spec": {"note": "Thunder Drum Wyrm — primeira rodada de form factors"},
"model": "nano-banana-pro",
"source_script": "pipeline_thunder_drum_wyrm/",
"layers": None,
})
# Pipeline v2 (thunder_drum_wyrm — grade 5x3 padronizada)
p2 = base / "pipeline_v2_thunder_drum_wyrm"
if p2.exists():
for src in sorted(p2.glob("*.png")):
stem = src.stem
# label legível a partir do stem
label = stem.replace("_", " ").title()
hero_id = f"tdw_v2_{stem}"
image_url = copy_image_to_static(src, hero_id)
prompt = read_prompt_file(p2 / f"{stem}_prompt.txt")
# heurística de tamanho
size = "1080x1920" if "cabinet" in stem or "mobile_portrait" in stem else (
"2048x2732" if "ipad_portrait" in stem else (
"2752x2064" if "ipad_landscape" in stem else "1920x1080"
)
)
entries.append({
"id": hero_id,
"title": f"Thunder Drum Wyrm — {label} (v2 5x3)",
"series": "Thunder Drum Wyrm Pipeline",
"form_factor": label,
"canonical_size": size,
"image_url": image_url,
"has_image": True,
"fullscreen_prompt": prompt or "(prompt em pipeline_v2_thunder_drum_wyrm)",
"spec": {"note": "Thunder Drum Wyrm v2 grade 5x3 padronizada"},
"model": "nano-banana-pro",
"source_script": "pipeline_v2_thunder_drum_wyrm/",
"layers": None,
})
# Pipeline sequential (thunder_drum_wyrm — cabinet seq 5x3)
p3 = base / "pipeline_seq_thunder_drum_wyrm"
if p3.exists():
for src in sorted(p3.glob("*.png")):
stem = src.stem
label = stem.replace("_", " ").title()
hero_id = f"tdw_seq_{stem}"
image_url = copy_image_to_static(src, hero_id)
prompt = read_prompt_file(p3 / f"{stem}_prompt.txt")
entries.append({
"id": hero_id,
"title": f"Thunder Drum Wyrm — {label} (seq)",
"series": "Thunder Drum Wyrm Pipeline",
"form_factor": label,
"canonical_size": "1080x1920",
"image_url": image_url,
"has_image": True,
"fullscreen_prompt": prompt or "(prompt em pipeline_seq_thunder_drum_wyrm)",
"spec": {"note": "Pipeline sequencial — fonte de gravação cabinet"},
"model": "nano-banana-pro",
"source_script": "pipeline_seq_thunder_drum_wyrm/",
"layers": None,
})
return entries
def build_bison_express_pipeline_entries():
"""pipeline_bison_express — cabinet + ipad portrait + web + mobile.
Complementa build_bison_express_entries (que lê slotforge_gallery/assets/bison_express)."""
folder = ROOT / "phase2_mystic_throne" / "pipeline_bison_express"
if not folder.exists():
return []
entries = []
# Selecionar só finais (exclui _rejected, _bonus_mode, prompt-only txt)
finals = [
("01_cabinet_vertical_5x5_1080x1920.png", "Cabinet portrait 5x5 1080x1920", "1080x1920"),
("01_cabinet_vertical_5x5_nb_v1.png", "Cabinet portrait 5x5 (nb v1)", "variável"),
("01_cabinet_vertical_5x5_nb_v1_1080x1920.png", "Cabinet portrait 5x5 (nb v1 1080x1920)", "1080x1920"),
("02_ipad_portrait_5x5_v3.png", "iPad portrait 5x5 v3", "2048x2732"),
("03_ipad_landscape_1x5_nb_v3.png", "iPad landscape 1x5 (nb v3)", "2752x2064"),
("03_ipad_landscape_1x5_nb_v5.png", "iPad landscape 1x5 (nb v5)", "2752x2064"),
("04_web_landscape_5x5_v2.png", "Web landscape 5x5 v2", "1920x1080"),
("05_mobile_portrait_3x5.png", "Mobile portrait 3x5", "1170x2532"),
]
for fname, label, size in finals:
src = folder / fname
if not src.exists():
continue
stem = src.stem
hero_id = f"bison_pipeline_{stem}"
image_url = copy_image_to_static(src, hero_id)
prompt = read_prompt_file(folder / f"{stem}_prompt.txt")
entries.append({
"id": hero_id,
"title": f"Bison Express Pipeline — {label}",
"series": "Bison Express Pipeline",
"form_factor": label,
"canonical_size": size,
"image_url": image_url,
"has_image": True,
"fullscreen_prompt": prompt or "(prompt em pipeline_bison_express)",
"spec": {"note": "Bison Express — pipeline multi-form com variações nano_banana"},
"model": "nano-banana-pro",
"source_script": "pipeline_bison_express/",
"layers": None,
})
return entries
def build_heroes_official_entries():
"""heroes_official/ tem 4 subpastas: 01 kingdom_gabinete, 02 devices, 03 ipad_unified, 04 mn_pulltab.
Coin Baron em múltiplas versões oficiais."""
base = ROOT / "phase2_mystic_throne" / "heroes_official"
if not base.exists():
return []
entries = []
# 01 HERO kingdom gabinete
p1 = base / "01_HERO_kingdom_gabinete"
if p1.exists():
for fname, label, size in [
("coin_baron_kingdom_HERO.png", "Kingdom gabinete HERO", "1080x1920"),
("coin_baron_kingdom_HERO_FULLRES.png", "Kingdom gabinete HERO (fullres)", "1080x1920"),
]:
src = p1 / fname
if not src.exists():
continue
hero_id = f"heroes_official_01_{src.stem}"
image_url = copy_image_to_static(src, hero_id)
prompt = read_prompt_file(p1 / "coin_baron_kingdom_HERO_prompt.txt")
entries.append({
"id": hero_id,
"title": f"Coin Baron — {label}",
"series": "Heroes Official — Coin Baron",
"form_factor": label,
"canonical_size": size,
"image_url": image_url,
"has_image": True,
"fullscreen_prompt": prompt or "(prompt em heroes_official/01_HERO_kingdom_gabinete)",
"spec": {"note": "Gabinete portrait oficial de Coin Baron Kingdom"},
"model": "nano-banana-pro",
"source_script": "heroes_official/01_HERO_kingdom_gabinete/",
"layers": None,
})
# 02 HERO devices (trio portrait + trio landscape)
p2 = base / "02_HERO_devices"
if p2.exists():
device_map = {
"coin_baron_MOBILE_portrait.png": ("Mobile portrait", "1170x2532"),
"coin_baron_MOBILE_landscape.png": ("Mobile landscape", "2532x1170"),
"coin_baron_iPad_portrait.png": ("iPad portrait", "2048x2732"),
"coin_baron_iPad_landscape.png": ("iPad landscape", "2752x2064"),
"coin_baron_WEB_portrait.png": ("Web portrait", "1080x1920"),
"coin_baron_WEB_landscape.png": ("Web landscape", "1920x1080"),
}
for fname, (label, size) in device_map.items():
src = p2 / fname
if not src.exists():
continue
stem = src.stem
hero_id = f"heroes_official_02_{stem}"
image_url = copy_image_to_static(src, hero_id)
prompt = read_prompt_file(p2 / f"{stem}_prompt.txt")
entries.append({
"id": hero_id,
"title": f"Coin Baron Devices — {label}",
"series": "Heroes Official — Coin Baron",
"form_factor": label,
"canonical_size": size,
"image_url": image_url,
"has_image": True,
"fullscreen_prompt": prompt or "(prompt em heroes_official/02_HERO_devices)",
"spec": {"note": "Trio de devices oficial — portrait + landscape"},
"model": "nano-banana-pro",
"source_script": "heroes_official/02_HERO_devices/",
"layers": None,
})
# 03 HERO ipad unified (v1/v2/v3)
p3 = base / "03_HERO_ipad_unified"
if p3.exists():
for src in sorted(p3.glob("*.png")):
stem = src.stem
hero_id = f"heroes_official_03_{stem}"
image_url = copy_image_to_static(src, hero_id)
prompt = read_prompt_file(p3 / "coin_baron_ipad_unified_prompt.txt")
entries.append({
"id": hero_id,
"title": f"Coin Baron — iPad Unified {stem.split('_')[-1].upper()}",
"series": "Heroes Official — Coin Baron",
"form_factor": "iPad unified portrait",
"canonical_size": "2048x2732",
"image_url": image_url,
"has_image": True,
"fullscreen_prompt": prompt or "(prompt em heroes_official/03_HERO_ipad_unified)",
"spec": {"note": "iPad unified — 3 variações"},
"model": "nano-banana-pro",
"source_script": "heroes_official/03_HERO_ipad_unified/",
"layers": None,
})
# 04 HERO mn pulltab (HERO + empty v1/v2/v3 + with_values v1/v2/v3)
p4 = base / "04_HERO_mn_pulltab"
if p4.exists():
pulltab_items = [
("coin_baron_mn_pulltab_HERO.png", "Minnesota pulltab HERO", "coin_baron_mn_pulltab_HERO_prompt.txt"),
("coin_baron_mn_pulltab_empty_v1.png", "MN pulltab empty v1", "coin_baron_mn_pulltab_empty_prompt.txt"),
("coin_baron_mn_pulltab_empty_v2.png", "MN pulltab empty v2", "coin_baron_mn_pulltab_empty_prompt.txt"),
("coin_baron_mn_pulltab_empty_v3.png", "MN pulltab empty v3", "coin_baron_mn_pulltab_empty_prompt.txt"),
("coin_baron_mn_pulltab_with_values_v1.png", "MN pulltab with values v1", "coin_baron_mn_pulltab_with_values_prompt.txt"),
("coin_baron_mn_pulltab_with_values_v2.png", "MN pulltab with values v2", "coin_baron_mn_pulltab_with_values_prompt.txt"),
("coin_baron_mn_pulltab_with_values_v3.png", "MN pulltab with values v3", "coin_baron_mn_pulltab_with_values_prompt.txt"),
]
for fname, label, prompt_name in pulltab_items:
src = p4 / fname
if not src.exists():
continue
hero_id = f"heroes_official_04_{src.stem}"
image_url = copy_image_to_static(src, hero_id)
prompt = read_prompt_file(p4 / prompt_name)
entries.append({
"id": hero_id,
"title": f"Coin Baron — {label}",
"series": "Heroes Official — Coin Baron",
"form_factor": label,
"canonical_size": "1080x1920",
"image_url": image_url,
"has_image": True,
"fullscreen_prompt": prompt or "(prompt em heroes_official/04_HERO_mn_pulltab)",
"spec": {"note": "Minnesota pulltab oficial — empty + with values"},
"model": "nano-banana-pro",
"source_script": "heroes_official/04_HERO_mn_pulltab/",
"layers": None,
})
return entries
def build_pigs_olympus_entries():
"""Pigs of Olympus — série com bonus/characters/symbols em workspace/pigs_of_olympus."""
folder = ROOT / "pigs_of_olympus"
if not folder.exists():
return []
entries = []
# Refs principais
refs = folder / "refs"
if refs.exists():
for src in sorted(refs.glob("*.png")):
hero_id = f"pigs_olympus_ref_{src.stem}"
image_url = copy_image_to_static(src, hero_id)
entries.append({
"id": hero_id,
"title": f"Pigs of Olympus — {src.stem.replace('_', ' ').title()}",
"series": "Pigs of Olympus (GDD v3.2)",
"form_factor": "Reference art",
"canonical_size": "varies",
"image_url": image_url,
"has_image": True,
"fullscreen_prompt": "(ver OLYMPIGS_GDD_v3.2.pdf + gen_symbol.py / gen_bonus.py)",
"spec": {"note": "Referência principal do GDD"},
"model": "nano-banana-pro",
"source_script": "gen_symbol.py / gen_bonus.py",
"layers": None,
})
return entries
def main():
template, games = load_hero_clean_specs()
catalog = {
"generated_at": "2026-04-20",
"template_fullscreen": template,
"template_notes": "Template usado por hero_clean_gen.py para heroes iPad 1x5 (18 entradas). Outras séries têm templates específicos.",
"heroes": [],
}
catalog["heroes"].extend(build_hero_clean_entries(template, games))
catalog["heroes"].extend(build_coin_baron_entries())
catalog["heroes"].extend(build_bison_express_entries())
catalog["heroes"].extend(build_run_entries())
catalog["heroes"].extend(build_pigs_olympus_entries())
catalog["heroes"].extend(build_thunder_drum_wyrm_entries())
catalog["heroes"].extend(build_bison_express_pipeline_entries())
catalog["heroes"].extend(build_heroes_official_entries())
# Stats por série
series_counts = {}
with_image = 0
for h in catalog["heroes"]:
s = h["series"]
series_counts[s] = series_counts.get(s, 0) + 1
if h["has_image"]:
with_image += 1
catalog["stats"] = {
"total_heroes": len(catalog["heroes"]),
"with_image": with_image,
"by_series": series_counts,
}
OUT.parent.mkdir(parents=True, exist_ok=True)
with open(OUT, "w") as f:
json.dump(catalog, f, indent=2, ensure_ascii=False)
print(f"Catalog escrito: {OUT}")
print(f"Total heroes: {catalog['stats']['total_heroes']}")
print(f"Com imagem: {catalog['stats']['with_image']}")
print("Por série:")
for s, c in series_counts.items():
print(f" {s}: {c}")
if __name__ == "__main__":
main()