✅ Organized existing assets into subfolders: - sovrazniki/ → bossi/ (26), zombiji/ (36), mutanti/ (6) - orozje/ → hladno/ (4), strelno/ (6) - rastline/ → posevki/ (47) ✅ Created generator scripts: - generate_anomalous_fauna.py (8 zones, 40 creatures) - categorize_assets.py (auto-categorization) ✅ Documentation: - API_KEY_SETUP.md (instructions for API key) Total: 68 enemies, 10 weapons, 47 crops organized! 🎯
127 lines
3.7 KiB
Python
127 lines
3.7 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
📊 CATEGORIZE EXISTING ASSETS
|
|
Moves files into correct subfolders based on their prefixes
|
|
"""
|
|
|
|
import shutil
|
|
from pathlib import Path
|
|
|
|
REPO = Path("/Users/davidkotnik/repos/novafarma")
|
|
SLIKE = REPO / "assets/slike"
|
|
|
|
print("="*70)
|
|
print("📊 CATEGORIZING EXISTING ASSETS")
|
|
print("="*70)
|
|
|
|
# 1. SOVRAZNIKI - categorize by prefix
|
|
print("\n🟥 Categorizing SOVRAZNIKI...")
|
|
sovrazniki = SLIKE / "sovrazniki"
|
|
|
|
categories = {
|
|
"bossi": ["bossi_", "boss_"],
|
|
"zombiji": ["zombiji_", "zombie_"],
|
|
"mutanti": ["mutanti_", "mutant_", "slime_"]
|
|
}
|
|
|
|
stats = {"bossi": 0, "zombiji": 0, "mutanti": 0}
|
|
|
|
for png in sovrazniki.glob("*.png"):
|
|
moved = False
|
|
for category, prefixes in categories.items():
|
|
if any(png.name.startswith(prefix) for prefix in prefixes):
|
|
dest_folder = sovrazniki / category
|
|
dest_folder.mkdir(exist_ok=True)
|
|
dest = dest_folder / png.name
|
|
|
|
if not dest.exists():
|
|
shutil.move(str(png), str(dest))
|
|
stats[category] += 1
|
|
print(f" ✅ {png.name} → {category}/")
|
|
moved = True
|
|
break
|
|
|
|
if not moved and png.name.endswith('.png'):
|
|
print(f" ⚠️ {png.name} - no category match")
|
|
|
|
print(f"\n📊 Sovrazniki Stats:")
|
|
for cat, count in stats.items():
|
|
print(f" {cat}: {count} files")
|
|
|
|
# 2. OROZJE - categorize by type
|
|
print("\n🟪 Categorizing OROZJE...")
|
|
orozje = SLIKE / "orozje"
|
|
|
|
hladno_keywords = ["sword", "axe", "club", "dagger", "mace", "spear", "hammer"]
|
|
strelno_keywords = ["bow", "arrow", "crossbow", "gun"]
|
|
|
|
hladno_folder = orozje / "hladno"
|
|
strelno_folder = orozje / "strelno"
|
|
hladno_folder.mkdir(exist_ok=True)
|
|
strelno_folder.mkdir(exist_ok=True)
|
|
|
|
hladno_count = 0
|
|
strelno_count = 0
|
|
|
|
for png in orozje.glob("*.png"):
|
|
name_lower = png.name.lower()
|
|
|
|
if any(kw in name_lower for kw in hladno_keywords):
|
|
dest = hladno_folder / png.name
|
|
if not dest.exists():
|
|
shutil.move(str(png), str(dest))
|
|
hladno_count += 1
|
|
print(f" ✅ {png.name} → hladno/")
|
|
|
|
elif any(kw in name_lower for kw in strelno_keywords):
|
|
dest = strelno_folder / png.name
|
|
if not dest.exists():
|
|
shutil.move(str(png), str(dest))
|
|
strelno_count += 1
|
|
print(f" ✅ {png.name} → strelno/")
|
|
|
|
print(f"\n📊 Orozje Stats:")
|
|
print(f" hladno: {hladno_count} files")
|
|
print(f" strelno: {strelno_count} files")
|
|
|
|
# 3. RASTLINE - categorize by type
|
|
print("\n🟫 Categorizing RASTLINE...")
|
|
rastline = SLIKE / "rastline"
|
|
|
|
posevki_keywords = ["wheat", "crop", "seed", "tilled", "farm"]
|
|
drevesa_keywords = ["tree", "oak", "pine", "cherry", "palm"]
|
|
|
|
posevki_folder = rastline / "posevki"
|
|
drevesa_folder = rastline / "drevesa"
|
|
posevki_folder.mkdir(exist_ok=True)
|
|
drevesa_folder.mkdir(exist_ok=True)
|
|
|
|
posevki_count = 0
|
|
drevesa_count = 0
|
|
|
|
for png in rastline.glob("*.png"):
|
|
name_lower = png.name.lower()
|
|
|
|
if any(kw in name_lower for kw in posevki_keywords):
|
|
dest = posevki_folder / png.name
|
|
if not dest.exists():
|
|
shutil.move(str(png), str(dest))
|
|
posevki_count += 1
|
|
print(f" ✅ {png.name} → posevki/")
|
|
|
|
elif any(kw in name_lower for kw in drevesa_keywords):
|
|
dest = drevesa_folder / png.name
|
|
if not dest.exists():
|
|
shutil.move(str(png), str(dest))
|
|
drevesa_count += 1
|
|
print(f" ✅ {png.name} → drevesa/")
|
|
|
|
print(f"\n📊 Rastline Stats:")
|
|
print(f" posevki: {posevki_count} files")
|
|
print(f" drevesa: {drevesa_count} files")
|
|
|
|
print("\n" + "="*70)
|
|
print("✅ CATEGORIZATION COMPLETE!")
|
|
print("="*70)
|
|
print("\nAll assets organized into subfolders! 🎯")
|