Files
YataiDONNijiiro/Scripts/background/bg_objects/donbg/4.lua
T
2026-09-02 14:25:04 -04:00

64 lines
2.7 KiB
Lua

-- YataiDON-HSS override of PyTaikoGreen/background/bg_objects/donbg/4.lua
-- ROUND 12: the cabinet's band is a single static 1920x276 plate (see base.lua),
-- so for the DEFAULT donbg pack every index is the base class (draw_layers).
--
-- ROUND 60 (r60-collab-fix-all): but DonBG4 is ALSO the class funassyi's
-- COLLAB band uses (DonBG4.new(1, player_num, "background/collab/funassyi")),
-- and the plain `return base` alias silently dropped the parent DonBG4's
-- overlay row (the funassyi flag banners, donbg/0_1/overlay, anim 2 bob) on
-- top of the collab path's tile scroll. This override restores the parent's
-- DonBG4 shape on top of the ROUND 60 base contract: for the default pack the
-- base's draw_layers path still runs (animal/buttoburst, name "4_1", DATA
-- table), for a collab path draw_textures below adds the overlay row.
local DonBGBase = require("background/bg_objects/donbg/base")
DonBG4 = setmetatable({}, { __index = DonBGBase })
DonBG4.__index = DonBG4
function DonBG4.new(index, player_num, path)
local self = setmetatable({}, DonBG4)
local base = DonBGBase.new(index, player_num, path)
for k, v in pairs(base) do self[k] = v end
self.overlay_move = tex.get_animation(2)
self.overlay_texture = tex.get_texture_info(self.name, "overlay")
self._id_overlay = tex.get_id(self.name, "overlay") -- nil = missing (ROUND 60: id 0 is valid)
return self
end
function DonBG4:update(current_time_ms)
DonBGBase.update(self, current_time_ms)
if self.overlay_move then self.overlay_move:update(current_time_ms) end
end
function DonBG4:draw_textures(fade, y, frame)
local w = self.bg_texture and self.bg_texture.x2[1] or 0
local ow = self.overlay_texture and self.overlay_texture.x2[1] or 0
local mv = self.move and self.move.attribute or 0
local omv = self.overlay_move and self.overlay_move.attribute or 0
for i = 0, 4 do
if self._id_bg then
tex.draw_texture(self._id_bg, {
frame = frame,
fade = fade,
x = (i * w) + mv,
y = y
})
end
-- parent DonBG4 geometry: banner row scrolls with the tiles and bobs
-- on anim 2. (The ghost trails this draw showed mid-round were the
-- id-0 bug -- see base.lua: the tile row was being skipped, so the
-- band was never repainted and every moving sprite smeared. With the
-- tiles painting again, the moving overlay is covered every frame.)
if self._id_overlay and self.overlay_texture then
tex.draw_texture(self._id_overlay, {
frame = frame,
fade = fade,
x = (i * ow) + mv,
y = omv + y
})
end
end
end
return DonBG4