finish all idolmaster collabs

This commit is contained in:
Anthony Samms
2025-10-26 19:05:41 -04:00
parent bb79582238
commit fb587847ff
9 changed files with 73 additions and 34 deletions

View File

@@ -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

View File

@@ -4,3 +4,4 @@ from . import buttoburst
from . import oshiri
from . import imas
from . import dan
from . import imas_sidem

View File

@@ -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)

View File

@@ -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)

View File

@@ -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)

View File

@@ -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

View File

@@ -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)

View File

@@ -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)

View File

@@ -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()