132 lines
5.1 KiB
Lua
132 lines
5.1 KiB
Lua
-- YataiDON-HSS override of PyTaikoGreen/background/bg_collabs/animal.lua
|
|
-- (ROUND 52, r52-lua-divergence-fixes): byte-copy of the parent plus the reference
|
|
-- dance_b_* dancer-count model, the fever falling edge, and the renda
|
|
-- drumroll-only rule -- see collab_dancer_model.lua / background.lua.
|
|
local DonBG4 = require("background/bg_objects/donbg/4")
|
|
local BGNormal = require("background/bg_objects/bg_normal")
|
|
local Fever = require("background/bg_objects/fever")
|
|
local Footer = require("background/bg_objects/footer")
|
|
local Dancer = require("background/bg_objects/dancer")
|
|
local RendaController = require("background/bg_objects/renda")
|
|
local ChibiController = require("background/bg_objects/chibi")
|
|
local DancerModel = require("background/bg_objects/collab_dancer_model")
|
|
|
|
local COLLAB_PATH = "background/collab/animal"
|
|
local MAX_DANCERS = 5
|
|
|
|
-- BGFever: simple instant-transition, draws only background
|
|
local AnimalBGFever = {}
|
|
AnimalBGFever.__index = AnimalBGFever
|
|
|
|
function AnimalBGFever.new()
|
|
local self = setmetatable({}, AnimalBGFever)
|
|
self.name = "bg_fever_0"
|
|
tex.load_folder(COLLAB_PATH, "bg_fever/" .. self.name)
|
|
self.transitioned = false
|
|
self._id_bg = tex.get_id(self.name, "background") or 0
|
|
return self
|
|
end
|
|
|
|
function AnimalBGFever:start() self.transitioned = true end
|
|
|
|
function AnimalBGFever:update(current_time_ms) end
|
|
|
|
function AnimalBGFever:draw() tex.draw_texture(self._id_bg) end
|
|
|
|
function AnimalBGFever:destroy() tex.unload_folder(COLLAB_PATH, "bg_fever/" .. self.name) end
|
|
|
|
-- Background
|
|
|
|
local AnimalBackground = {}
|
|
AnimalBackground.__index = AnimalBackground
|
|
|
|
function AnimalBackground.new(player_num, bpm)
|
|
local self = setmetatable({}, AnimalBackground)
|
|
self.donbg = DonBG4.new(5, player_num, "background")
|
|
self.bg_normal = BGNormal.Base.new(0, COLLAB_PATH)
|
|
self.bg_fever = AnimalBGFever.new()
|
|
self.footer = Footer.new(COLLAB_PATH, 0)
|
|
-- ROUND 60 (r60-collab-fix-all): class Fever3, folder fever_0 -- see
|
|
-- oshiri.lua (Fever.create(3, ...) loaded the nonexistent fever_3).
|
|
self.fever = Fever.Fever3.new(0, bpm, COLLAB_PATH)
|
|
self.dancer = Dancer.BaseDancerGroup.new(0, bpm, MAX_DANCERS, COLLAB_PATH)
|
|
self.renda = RendaController.new(COLLAB_PATH, 0)
|
|
self.chibi = ChibiController.new(bpm, COLLAB_PATH, 0)
|
|
self.is_clear = false
|
|
self.is_rainbow = false
|
|
-- ROUND 52 (r52-lua-divergence-fixes): reference dance_b_* count model
|
|
-- (collab_dancer_model.lua) replaces the pre-R18 milestone counter.
|
|
self.dancer_model = DancerModel.new(MAX_DANCERS)
|
|
return self
|
|
end
|
|
|
|
function AnimalBackground:update(current_ms, bpm)
|
|
self.donbg:update(current_ms)
|
|
self.bg_fever:update(current_ms)
|
|
self.fever:update(current_ms, bpm)
|
|
self.dancer:update(current_ms, bpm)
|
|
self.renda:update(current_ms)
|
|
self.chibi:update(current_ms, bpm)
|
|
end
|
|
|
|
function AnimalBackground:handle_good(player_num) self.chibi:add_chibi(player_num, false) end
|
|
|
|
function AnimalBackground:handle_ok(player_num) self.chibi:add_chibi(player_num, false) end
|
|
|
|
function AnimalBackground:handle_bad(player_num) self.chibi:add_chibi(player_num, true) end
|
|
|
|
function AnimalBackground:handle_drumroll(player_num) self.renda:add_renda() end
|
|
|
|
-- ROUND 52: no renda on balloons/kusudama -- the reference build RendaEffect fires for
|
|
-- note kinds 6/9 (drumrolls) only; see background.lua.
|
|
function AnimalBackground:handle_balloon(player_num) end
|
|
|
|
function AnimalBackground:handle_gauge(player_num, progress, is_clear, is_rainbow, clear_progress)
|
|
self.donbg:set_clear(is_clear)
|
|
-- ROUND 52: both edges, re-triggerable (the reference build BgFever/FeverEffect::Process).
|
|
if is_clear and not self.is_clear then self.bg_fever:start() end
|
|
if not is_clear and self.is_clear and self.bg_fever.reset then self.bg_fever:reset() end
|
|
if is_rainbow and not self.is_rainbow then self.fever:start() end
|
|
if not is_rainbow and self.is_rainbow and self.fever.stop then self.fever:stop() end
|
|
self.is_clear = is_clear
|
|
self.is_rainbow = is_rainbow
|
|
|
|
-- ROUND 52: reference dance_b_* model, symmetric every frame.
|
|
self.dancer_model:apply(self.dancer, progress, is_clear, clear_progress)
|
|
end
|
|
|
|
function AnimalBackground:draw_back()
|
|
if self.is_clear then
|
|
if not self.bg_fever.transitioned then
|
|
self.bg_normal:draw()
|
|
self.bg_fever:draw()
|
|
else
|
|
self.bg_fever:draw()
|
|
end
|
|
else
|
|
self.bg_normal:draw()
|
|
end
|
|
self.donbg:draw()
|
|
self.renda:draw()
|
|
self.dancer:draw()
|
|
self.footer:draw()
|
|
-- ROUND 52: covers the exit ramp, not just the raw flag.
|
|
if self.fever.is_visible and self.fever:is_visible() then self.fever:draw() end
|
|
self.chibi:draw()
|
|
end
|
|
|
|
function AnimalBackground:draw_fore() end
|
|
|
|
function AnimalBackground:destroy()
|
|
self.donbg:destroy()
|
|
self.bg_normal:destroy()
|
|
self.bg_fever:destroy()
|
|
self.fever:destroy()
|
|
self.dancer:destroy()
|
|
self.footer:destroy()
|
|
self.renda:destroy()
|
|
self.chibi:destroy()
|
|
end
|
|
|
|
return AnimalBackground
|