#!/usr/bin/env python3 """Build MONKEY post-lane BLP2 LUT strips and MonkeyZoneGrade.dbc. Outputs ordinary loose patch-tree files below this directory. Copy the resulting DBFilesClient/ and World/ trees into an isolated Data directory for capture runs. """ from pathlib import Path import math import struct ROOT = Path(__file__).resolve().parent.parent / "data" LUT_DIR = ROOT / "World" / "LUTs" DBC_DIR = ROOT / "DBFilesClient" def clamp(value): return max(0.0, min(1.0, value)) def identity(c): return c def elwynn(c): r, g, b = c return (clamp(r * 1.025 + 0.010 * g), clamp(g * 1.035 + 0.012 * r), clamp(b * 0.975)) def duskwood(c): r, g, b = c y = r * 0.299 + g * 0.587 + b * 0.114 r, g, b = (y + (r - y) * 0.78, y + (g - y) * 0.78, y + (b - y) * 0.78) return (clamp(r * 0.94), clamp(g * 0.97), clamp(b * 1.045 + 0.008)) def westfall(c): r, g, b = c return (clamp(r * 1.045 + 0.008 * g), clamp(g * 1.018), clamp(b * 0.94)) def redridge(c): r, g, b = c return (clamp(r * 1.055 + 0.008), clamp(g * 0.982), clamp(b * 0.955)) def write_blp(path, transform): width, height = 1024, 32 header_bytes = 148 palette_bytes = 256 * 4 pixel_offset = header_bytes + palette_bytes pixel_size = width * height * 4 header = bytearray(header_bytes) header[0:4] = b"BLP2" struct.pack_into("