From fb587847ff0056dc8b32b6efae192c3e778a6eb8 Mon Sep 17 00:00:00 2001 From: Anthony Samms Date: Sun, 26 Oct 2025 19:05:41 -0400 Subject: [PATCH] finish all idolmaster collabs --- libs/background.py | 25 ++++++++++------- libs/bg_collabs/__init__.py | 1 + libs/bg_collabs/a3.py | 5 ++-- libs/bg_collabs/animal.py | 5 ++-- libs/bg_collabs/buttoburst.py | 5 ++-- libs/bg_collabs/dan.py | 5 ++-- libs/bg_collabs/imas.py | 53 +++++++++++++++++++++++++++++------ libs/bg_collabs/oshiri.py | 5 ++-- libs/bg_objects/dancer.py | 3 +- 9 files changed, 73 insertions(+), 34 deletions(-) diff --git a/libs/background.py b/libs/background.py index 1c2b12f..154b442 100644 --- a/libs/background.py +++ b/libs/background.py @@ -14,12 +14,15 @@ from libs.texture import TextureWrapper class Background: """The background class for the game.""" COLLABS = { - "A3": libs.bg_collabs.a3.Background, - "ANIMAL": libs.bg_collabs.animal.Background, - "BUTTOBURST": libs.bg_collabs.buttoburst.Background, - "OSHIRI": libs.bg_collabs.oshiri.Background, - "IMAS": libs.bg_collabs.imas.Background, - "DAN": libs.bg_collabs.dan.Background + "A3": (libs.bg_collabs.a3.Background, 'background/collab/a3', 4), + "ANIMAL": (libs.bg_collabs.animal.Background, 'background/collab/animal', 5), + "BUTTOBURST": (libs.bg_collabs.buttoburst.Background, 'background/collab/buttoburst', 4), + "OSHIRI": (libs.bg_collabs.oshiri.Background, 'background/collab/oshiri', 5), + "IMAS": (libs.bg_collabs.imas.Background, 'background/collab/imas', 5), + "IMAS_CG": (libs.bg_collabs.imas.Background, 'background/collab/imas_cg', 3), + "IMAS_ML": (libs.bg_collabs.imas.Background, 'background/collab/imas_ml', 3), + "IMAS_SIDEM": (libs.bg_collabs.imas_sidem.Background, 'background/collab/imas_sidem', 3), + "DAN": (libs.bg_collabs.dan.Background, 'background/collab/dan', 1) } def __init__(self, player_num: int, bpm: float, scene_preset: str = ''): """ @@ -46,8 +49,9 @@ class Background: self.fever = None self.dancer = None else: - collab_bg = Background.COLLABS[scene_preset](self.tex_wrapper, 1, bpm) - self.max_dancers = 5 + bg_obj, path, max_dancers = Background.COLLABS[scene_preset] + collab_bg = bg_obj(self.tex_wrapper, 1, bpm, path, max_dancers) + self.max_dancers = max_dancers self.don_bg = collab_bg.don_bg self.don_bg_2 = collab_bg.don_bg self.bg_normal = None @@ -69,8 +73,9 @@ class Background: self.renda = RendaController(self.tex_wrapper, random.randint(0, 2)) self.chibi = ChibiController(self.tex_wrapper, random.randint(0, 13), bpm) else: - collab_bg = Background.COLLABS[scene_preset](self.tex_wrapper, player_num, bpm) - self.max_dancers = collab_bg.max_dancers + bg_obj, path, max_dancers = Background.COLLABS[scene_preset] + collab_bg = bg_obj(self.tex_wrapper, 1, bpm, path, max_dancers) + self.max_dancers = max_dancers self.don_bg = collab_bg.don_bg self.don_bg_2 = None self.bg_normal = collab_bg.bg_normal diff --git a/libs/bg_collabs/__init__.py b/libs/bg_collabs/__init__.py index 4daea71..08c1d93 100644 --- a/libs/bg_collabs/__init__.py +++ b/libs/bg_collabs/__init__.py @@ -4,3 +4,4 @@ from . import buttoburst from . import oshiri from . import imas from . import dan +from . import imas_sidem diff --git a/libs/bg_collabs/a3.py b/libs/bg_collabs/a3.py index e222147..3591484 100644 --- a/libs/bg_collabs/a3.py +++ b/libs/bg_collabs/a3.py @@ -9,10 +9,9 @@ from libs.bg_objects.renda import RendaController from libs.texture import TextureWrapper class Background: - def __init__(self, tex: TextureWrapper, player_num: int, bpm: float): + def __init__(self, tex: TextureWrapper, player_num: int, bpm: float, path: str, max_dancers: int): self.tex_wrapper = tex - path = 'background/collab/a3' - self.max_dancers = 4 + self.max_dancers = max_dancers self.don_bg = DonBG(self.tex_wrapper, 0, 1, path) self.bg_normal = BGNormal(self.tex_wrapper, 0, path) self.bg_fever = BGFever(self.tex_wrapper, 0, path) diff --git a/libs/bg_collabs/animal.py b/libs/bg_collabs/animal.py index e797260..c6a8ad7 100644 --- a/libs/bg_collabs/animal.py +++ b/libs/bg_collabs/animal.py @@ -11,10 +11,9 @@ from libs.bg_objects.don_bg import DonBG4 class Background: - def __init__(self, tex: TextureWrapper, player_num: int, bpm: float): + def __init__(self, tex: TextureWrapper, player_num: int, bpm: float, path: str, max_dancers: int): self.tex_wrapper = tex - path = 'background/collab/animal' - self.max_dancers = 5 + self.max_dancers = max_dancers self.don_bg = DonBG4(self.tex_wrapper, 4, player_num, 'background') self.bg_normal = BGNormalBase(self.tex_wrapper, 0, path) self.bg_fever = BGFever(self.tex_wrapper, 0, path) diff --git a/libs/bg_collabs/buttoburst.py b/libs/bg_collabs/buttoburst.py index 0220eef..08d5aeb 100644 --- a/libs/bg_collabs/buttoburst.py +++ b/libs/bg_collabs/buttoburst.py @@ -10,10 +10,9 @@ from libs.bg_objects.don_bg import DonBG4 class Background: - def __init__(self, tex: TextureWrapper, player_num: int, bpm: float): + def __init__(self, tex: TextureWrapper, player_num: int, bpm: float, path: str, max_dancers: int): self.tex_wrapper = tex - path = 'background/collab/buttoburst' - self.max_dancers = 4 + self.max_dancers = max_dancers self.don_bg = DonBG4(self.tex_wrapper, 4, player_num, 'background') self.bg_normal = BGNormalBase(self.tex_wrapper, 0, path) self.bg_fever = BGFever(self.tex_wrapper, 0, path) diff --git a/libs/bg_collabs/dan.py b/libs/bg_collabs/dan.py index dd67b32..7d5e8f1 100644 --- a/libs/bg_collabs/dan.py +++ b/libs/bg_collabs/dan.py @@ -6,10 +6,9 @@ from libs.bg_objects.footer import Footer from libs.texture import TextureWrapper class Background: - def __init__(self, tex: TextureWrapper, player_num: int, bpm: float): + def __init__(self, tex: TextureWrapper, player_num: int, bpm: float, path: str, max_dancers: int): self.tex_wrapper = tex - path = 'background/collab/dan' - self.max_dancers = 5 + self.max_dancers = max_dancers self.don_bg = DonBG(self.tex_wrapper, 0, 1, path) self.bg_normal = BGNormalBase(self.tex_wrapper, 0, path) self.bg_fever = None diff --git a/libs/bg_collabs/imas.py b/libs/bg_collabs/imas.py index 89f7e54..e060c6d 100644 --- a/libs/bg_collabs/imas.py +++ b/libs/bg_collabs/imas.py @@ -9,15 +9,16 @@ from libs.bg_objects.renda import RendaController from libs.texture import TextureWrapper from libs.bg_objects.don_bg import DonBGBase +import pyray as ray + class Background: - def __init__(self, tex: TextureWrapper, player_num: int, bpm: float): + def __init__(self, tex: TextureWrapper, player_num: int, bpm: float, path: str, max_dancers: int): self.tex_wrapper = tex - path = 'background/collab/imas' - self.max_dancers = 5 + self.max_dancers = max_dancers self.don_bg = DonBGBase(self.tex_wrapper, 0, player_num, path) - self.bg_normal = BGNormalBase(self.tex_wrapper, 0, path) - self.bg_fever = BGFeverBase(self.tex_wrapper, 0, path) + self.bg_normal = BGNormal(self.tex_wrapper, 0, path) + self.bg_fever = BGFever(self.tex_wrapper, 0, path) self.footer = Footer(self.tex_wrapper, 0, path) self.fever = Fever(self.tex_wrapper, 0, bpm, path) self.dancer = BaseDancerGroup(self.tex_wrapper, 0, bpm, self.max_dancers, path) @@ -41,9 +42,45 @@ class Fever(BaseFever): class BGNormal(BGNormalBase): def __init__(self, tex: TextureWrapper, index: int, path: str): super().__init__(tex, index, path) + self.overlay_fade = Animation.create_fade(1000, initial_opacity=0.0, final_opacity=1.0, reverse_delay=500, delay=500) + self.overlay_fade.loop = True + self.overlay_fade.start() + self.spotlight_colors = [ray.Color(0, 255, 255, 255), ray.YELLOW, ray.MAGENTA, ray.Color(0, 255, 255, 255), ray.YELLOW] - def update(self, current_time_ms: float, bpm: float): - super().update(current_time_ms, bpm) + def update(self, current_time_ms: float): + super().update(current_time_ms) + self.overlay_fade.update(current_time_ms) def draw(self, tex: TextureWrapper): - pass + super().draw(tex) + tex.draw_texture(self.name, 'overlay', fade=self.overlay_fade.attribute) + for i in range(5): + if i % 2 == 0: + fade = min(0.5, self.overlay_fade.attribute) + else: + fade = min(0.5, 1 - self.overlay_fade.attribute) + tex.draw_texture(self.name, 'spotlight', index=i, color=self.spotlight_colors[i], fade=fade) + +class BGFever(BGFeverBase): + def __init__(self, tex: TextureWrapper, index: int, path: str): + super().__init__(tex, index, path) + self.overlay_fade = Animation.create_fade(1000, initial_opacity=0.0, final_opacity=1.0, reverse_delay=500, delay=500) + self.overlay_fade.loop = True + self.overlay_fade.start() + self.spotlight_colors = [ray.Color(0, 255, 255, 255), ray.YELLOW, ray.MAGENTA, ray.Color(0, 255, 255, 255), ray.YELLOW] + + def update(self, current_time_ms: float): + super().update(current_time_ms) + self.overlay_fade.update(current_time_ms) + + def draw(self, tex: TextureWrapper): + tex.draw_texture(self.name, 'background') + tex.draw_texture(self.name, 'overlay', fade=self.overlay_fade.attribute) + tex.draw_texture(self.name, 'light_orange', fade=self.overlay_fade.attribute) + tex.draw_texture(self.name, 'light_green', fade=1 - self.overlay_fade.attribute) + for i in range(5): + if i % 2 == 0: + fade = min(0.5, self.overlay_fade.attribute) + else: + fade = min(0.5, 1 - self.overlay_fade.attribute) + tex.draw_texture(self.name, 'spotlight', index=i, color=self.spotlight_colors[i], fade=fade) diff --git a/libs/bg_collabs/oshiri.py b/libs/bg_collabs/oshiri.py index b3ea3b8..179a20e 100644 --- a/libs/bg_collabs/oshiri.py +++ b/libs/bg_collabs/oshiri.py @@ -10,10 +10,9 @@ from libs.bg_objects.renda import RendaController from libs.texture import TextureWrapper class Background: - def __init__(self, tex: TextureWrapper, player_num: int, bpm: float): + def __init__(self, tex: TextureWrapper, player_num: int, bpm: float, path: str, max_dancers: int): self.tex_wrapper = tex - path = 'background/collab/oshiri' - self.max_dancers = 5 + self.max_dancers = max_dancers self.don_bg = DonBG(self.tex_wrapper, 0, 1, path) self.bg_normal = BGNormalBase(self.tex_wrapper, 0, path) self.bg_fever = BGFever(self.tex_wrapper, 0, path) diff --git a/libs/bg_objects/dancer.py b/libs/bg_objects/dancer.py index 489dac8..014096d 100644 --- a/libs/bg_objects/dancer.py +++ b/libs/bg_objects/dancer.py @@ -134,7 +134,8 @@ class BaseDancerGroup(): self.active_count = 0 tex.load_zip(path, f'dancer/{self.name}') # center (2), left (1), right (3), far left (0), far right (4) - self.spawn_positions = [2, 1, 3, 0, 4] + all_positions = [2, 1, 3, 0, 4] + self.spawn_positions = [pos for pos in all_positions if pos < max_dancers] self.active_dancers = [None] * max_dancers dancer_classes = [BaseDancer] tex_set = set()