mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 11:40:13 +01:00
finish all idolmaster collabs
This commit is contained in:
@@ -14,12 +14,15 @@ from libs.texture import TextureWrapper
|
|||||||
class Background:
|
class Background:
|
||||||
"""The background class for the game."""
|
"""The background class for the game."""
|
||||||
COLLABS = {
|
COLLABS = {
|
||||||
"A3": libs.bg_collabs.a3.Background,
|
"A3": (libs.bg_collabs.a3.Background, 'background/collab/a3', 4),
|
||||||
"ANIMAL": libs.bg_collabs.animal.Background,
|
"ANIMAL": (libs.bg_collabs.animal.Background, 'background/collab/animal', 5),
|
||||||
"BUTTOBURST": libs.bg_collabs.buttoburst.Background,
|
"BUTTOBURST": (libs.bg_collabs.buttoburst.Background, 'background/collab/buttoburst', 4),
|
||||||
"OSHIRI": libs.bg_collabs.oshiri.Background,
|
"OSHIRI": (libs.bg_collabs.oshiri.Background, 'background/collab/oshiri', 5),
|
||||||
"IMAS": libs.bg_collabs.imas.Background,
|
"IMAS": (libs.bg_collabs.imas.Background, 'background/collab/imas', 5),
|
||||||
"DAN": libs.bg_collabs.dan.Background
|
"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 = ''):
|
def __init__(self, player_num: int, bpm: float, scene_preset: str = ''):
|
||||||
"""
|
"""
|
||||||
@@ -46,8 +49,9 @@ class Background:
|
|||||||
self.fever = None
|
self.fever = None
|
||||||
self.dancer = None
|
self.dancer = None
|
||||||
else:
|
else:
|
||||||
collab_bg = Background.COLLABS[scene_preset](self.tex_wrapper, 1, bpm)
|
bg_obj, path, max_dancers = Background.COLLABS[scene_preset]
|
||||||
self.max_dancers = 5
|
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 = collab_bg.don_bg
|
||||||
self.don_bg_2 = collab_bg.don_bg
|
self.don_bg_2 = collab_bg.don_bg
|
||||||
self.bg_normal = None
|
self.bg_normal = None
|
||||||
@@ -69,8 +73,9 @@ class Background:
|
|||||||
self.renda = RendaController(self.tex_wrapper, random.randint(0, 2))
|
self.renda = RendaController(self.tex_wrapper, random.randint(0, 2))
|
||||||
self.chibi = ChibiController(self.tex_wrapper, random.randint(0, 13), bpm)
|
self.chibi = ChibiController(self.tex_wrapper, random.randint(0, 13), bpm)
|
||||||
else:
|
else:
|
||||||
collab_bg = Background.COLLABS[scene_preset](self.tex_wrapper, player_num, bpm)
|
bg_obj, path, max_dancers = Background.COLLABS[scene_preset]
|
||||||
self.max_dancers = collab_bg.max_dancers
|
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 = collab_bg.don_bg
|
||||||
self.don_bg_2 = None
|
self.don_bg_2 = None
|
||||||
self.bg_normal = collab_bg.bg_normal
|
self.bg_normal = collab_bg.bg_normal
|
||||||
|
|||||||
@@ -4,3 +4,4 @@ from . import buttoburst
|
|||||||
from . import oshiri
|
from . import oshiri
|
||||||
from . import imas
|
from . import imas
|
||||||
from . import dan
|
from . import dan
|
||||||
|
from . import imas_sidem
|
||||||
|
|||||||
@@ -9,10 +9,9 @@ from libs.bg_objects.renda import RendaController
|
|||||||
from libs.texture import TextureWrapper
|
from libs.texture import TextureWrapper
|
||||||
|
|
||||||
class Background:
|
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
|
self.tex_wrapper = tex
|
||||||
path = 'background/collab/a3'
|
self.max_dancers = max_dancers
|
||||||
self.max_dancers = 4
|
|
||||||
self.don_bg = DonBG(self.tex_wrapper, 0, 1, path)
|
self.don_bg = DonBG(self.tex_wrapper, 0, 1, path)
|
||||||
self.bg_normal = BGNormal(self.tex_wrapper, 0, path)
|
self.bg_normal = BGNormal(self.tex_wrapper, 0, path)
|
||||||
self.bg_fever = BGFever(self.tex_wrapper, 0, path)
|
self.bg_fever = BGFever(self.tex_wrapper, 0, path)
|
||||||
|
|||||||
@@ -11,10 +11,9 @@ from libs.bg_objects.don_bg import DonBG4
|
|||||||
|
|
||||||
|
|
||||||
class Background:
|
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
|
self.tex_wrapper = tex
|
||||||
path = 'background/collab/animal'
|
self.max_dancers = max_dancers
|
||||||
self.max_dancers = 5
|
|
||||||
self.don_bg = DonBG4(self.tex_wrapper, 4, player_num, 'background')
|
self.don_bg = DonBG4(self.tex_wrapper, 4, player_num, 'background')
|
||||||
self.bg_normal = BGNormalBase(self.tex_wrapper, 0, path)
|
self.bg_normal = BGNormalBase(self.tex_wrapper, 0, path)
|
||||||
self.bg_fever = BGFever(self.tex_wrapper, 0, path)
|
self.bg_fever = BGFever(self.tex_wrapper, 0, path)
|
||||||
|
|||||||
@@ -10,10 +10,9 @@ from libs.bg_objects.don_bg import DonBG4
|
|||||||
|
|
||||||
|
|
||||||
class Background:
|
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
|
self.tex_wrapper = tex
|
||||||
path = 'background/collab/buttoburst'
|
self.max_dancers = max_dancers
|
||||||
self.max_dancers = 4
|
|
||||||
self.don_bg = DonBG4(self.tex_wrapper, 4, player_num, 'background')
|
self.don_bg = DonBG4(self.tex_wrapper, 4, player_num, 'background')
|
||||||
self.bg_normal = BGNormalBase(self.tex_wrapper, 0, path)
|
self.bg_normal = BGNormalBase(self.tex_wrapper, 0, path)
|
||||||
self.bg_fever = BGFever(self.tex_wrapper, 0, path)
|
self.bg_fever = BGFever(self.tex_wrapper, 0, path)
|
||||||
|
|||||||
@@ -6,10 +6,9 @@ from libs.bg_objects.footer import Footer
|
|||||||
from libs.texture import TextureWrapper
|
from libs.texture import TextureWrapper
|
||||||
|
|
||||||
class Background:
|
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
|
self.tex_wrapper = tex
|
||||||
path = 'background/collab/dan'
|
self.max_dancers = max_dancers
|
||||||
self.max_dancers = 5
|
|
||||||
self.don_bg = DonBG(self.tex_wrapper, 0, 1, path)
|
self.don_bg = DonBG(self.tex_wrapper, 0, 1, path)
|
||||||
self.bg_normal = BGNormalBase(self.tex_wrapper, 0, path)
|
self.bg_normal = BGNormalBase(self.tex_wrapper, 0, path)
|
||||||
self.bg_fever = None
|
self.bg_fever = None
|
||||||
|
|||||||
@@ -9,15 +9,16 @@ from libs.bg_objects.renda import RendaController
|
|||||||
from libs.texture import TextureWrapper
|
from libs.texture import TextureWrapper
|
||||||
from libs.bg_objects.don_bg import DonBGBase
|
from libs.bg_objects.don_bg import DonBGBase
|
||||||
|
|
||||||
|
import pyray as ray
|
||||||
|
|
||||||
|
|
||||||
class Background:
|
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
|
self.tex_wrapper = tex
|
||||||
path = 'background/collab/imas'
|
self.max_dancers = max_dancers
|
||||||
self.max_dancers = 5
|
|
||||||
self.don_bg = DonBGBase(self.tex_wrapper, 0, player_num, path)
|
self.don_bg = DonBGBase(self.tex_wrapper, 0, player_num, path)
|
||||||
self.bg_normal = BGNormalBase(self.tex_wrapper, 0, path)
|
self.bg_normal = BGNormal(self.tex_wrapper, 0, path)
|
||||||
self.bg_fever = BGFeverBase(self.tex_wrapper, 0, path)
|
self.bg_fever = BGFever(self.tex_wrapper, 0, path)
|
||||||
self.footer = Footer(self.tex_wrapper, 0, path)
|
self.footer = Footer(self.tex_wrapper, 0, path)
|
||||||
self.fever = Fever(self.tex_wrapper, 0, bpm, path)
|
self.fever = Fever(self.tex_wrapper, 0, bpm, path)
|
||||||
self.dancer = BaseDancerGroup(self.tex_wrapper, 0, bpm, self.max_dancers, path)
|
self.dancer = BaseDancerGroup(self.tex_wrapper, 0, bpm, self.max_dancers, path)
|
||||||
@@ -41,9 +42,45 @@ class Fever(BaseFever):
|
|||||||
class BGNormal(BGNormalBase):
|
class BGNormal(BGNormalBase):
|
||||||
def __init__(self, tex: TextureWrapper, index: int, path: str):
|
def __init__(self, tex: TextureWrapper, index: int, path: str):
|
||||||
super().__init__(tex, index, path)
|
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):
|
def update(self, current_time_ms: float):
|
||||||
super().update(current_time_ms, bpm)
|
super().update(current_time_ms)
|
||||||
|
self.overlay_fade.update(current_time_ms)
|
||||||
|
|
||||||
def draw(self, tex: TextureWrapper):
|
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)
|
||||||
|
|||||||
@@ -10,10 +10,9 @@ from libs.bg_objects.renda import RendaController
|
|||||||
from libs.texture import TextureWrapper
|
from libs.texture import TextureWrapper
|
||||||
|
|
||||||
class Background:
|
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
|
self.tex_wrapper = tex
|
||||||
path = 'background/collab/oshiri'
|
self.max_dancers = max_dancers
|
||||||
self.max_dancers = 5
|
|
||||||
self.don_bg = DonBG(self.tex_wrapper, 0, 1, path)
|
self.don_bg = DonBG(self.tex_wrapper, 0, 1, path)
|
||||||
self.bg_normal = BGNormalBase(self.tex_wrapper, 0, path)
|
self.bg_normal = BGNormalBase(self.tex_wrapper, 0, path)
|
||||||
self.bg_fever = BGFever(self.tex_wrapper, 0, path)
|
self.bg_fever = BGFever(self.tex_wrapper, 0, path)
|
||||||
|
|||||||
@@ -134,7 +134,8 @@ class BaseDancerGroup():
|
|||||||
self.active_count = 0
|
self.active_count = 0
|
||||||
tex.load_zip(path, f'dancer/{self.name}')
|
tex.load_zip(path, f'dancer/{self.name}')
|
||||||
# center (2), left (1), right (3), far left (0), far right (4)
|
# 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
|
self.active_dancers = [None] * max_dancers
|
||||||
dancer_classes = [BaseDancer]
|
dancer_classes = [BaseDancer]
|
||||||
tex_set = set()
|
tex_set = set()
|
||||||
|
|||||||
Reference in New Issue
Block a user