KAZIK/tools/generators/pack_russian_party.py
Artvasil09 881a0061dc Add native NPC visitors with contracts, Clover slots, Pyramid, and party table scenes
Implement 32x32 BFS visitor navigation and daily contracts system with companion .npc journals; add native assembly scenes for Clover slots, Pyramid cards, Blackjack Party and Russian Party; package animation and sprite packs; add comprehensive offline test suites and rebuild shipping binaries.
2026-10-13 09:47:33 +03:00

28 lines
1 KiB
Python

"""Offline packing of neutral seated guest artwork, not game logic."""
import struct
from pathlib import Path
from PIL import Image
ROOT = Path(__file__).resolve().parents[2]
def main():
image = Image.open(ROOT / "assets/sprites/roulette/participants-v1.png").convert("RGBA")
assert image.size == (1536, 1024)
frames = []
for row in range(2):
for col in range(3):
frame = image.crop((col * 512, row * 512, (col + 1) * 512, (row + 1) * 512))
frame = frame.resize((192, 192), Image.Resampling.NEAREST)
assert frame.getpixel((0, 0))[3] == 0
assert sum(a >= 240 for a in frame.getchannel("A").get_flattened_data()) > 8000
frames.append(frame.tobytes("raw", "BGRA"))
data = b"".join(frames)
output = ROOT / "assets/animations/roulette/participants-v1.bin"
output.write_bytes(struct.pack("<4sIIII", b"ANM1", 192, 192, 6, len(data)) + data)
print("Packed six neutral seated guest frames for native Russian roulette")
if __name__ == "__main__":
main()