mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-26 07:21:22 +02:00
69c7ee89b5
Seed Mt Moon Super Nerd dialogue (#1743), play item-use heal jingles (#1635), use white fades for fly/teleport warps (#1644), add a Yellow-only Advanced palette overlay (#1639), parse Yellow Super Rod data including Safari Dragonair (#1074), and apply title rOBP0 when baking Pikachu eye OAM so pupils stay black with white glints.
35 lines
1.1 KiB
Python
35 lines
1.1 KiB
Python
#!/usr/bin/env python3
|
|
"""Title rOBP0=$E0 remaps eye OAM shades 1/2 to white (#1639 pupils)."""
|
|
|
|
from pathlib import Path
|
|
from unittest import TestCase, main
|
|
import sys
|
|
import tempfile
|
|
|
|
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "tools"))
|
|
import build_rom_data as b # noqa: E402
|
|
from PIL import Image # noqa: E402
|
|
|
|
|
|
class TitleObp0Test(TestCase):
|
|
def test_mid_and_dark_become_white(self):
|
|
img = Image.new("RGBA", (4, 1), (0, 0, 0, 0))
|
|
img.putpixel((0, 0), b.GB_SHADES[1])
|
|
img.putpixel((1, 0), b.GB_SHADES[2])
|
|
img.putpixel((2, 0), b.GB_SHADES[3])
|
|
img.putpixel((3, 0), b.GB_SHADES[0])
|
|
b._apply_title_obp0(img)
|
|
self.assertEqual(img.getpixel((0, 0)), b.GB_SHADES[0])
|
|
self.assertEqual(img.getpixel((1, 0)), b.GB_SHADES[0])
|
|
self.assertEqual(img.getpixel((2, 0)), b.GB_SHADES[3])
|
|
self.assertEqual(img.getpixel((3, 0)), b.GB_SHADES[0])
|
|
|
|
def test_transparent_untouched(self):
|
|
img = Image.new("RGBA", (1, 1), (0, 0, 0, 0))
|
|
b._apply_title_obp0(img)
|
|
self.assertEqual(img.getpixel((0, 0))[3], 0)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|