result: skipping the reveal lands the rank plate instead of dropping it #59
@@ -27,6 +27,19 @@ local function rank_of(score)
|
|||||||
return r
|
return r
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- the score_rank clip for rank 1..7 at this seat (nil when it can't load)
|
||||||
|
local function rank_clip(rank, is_2p)
|
||||||
|
local side = is_2p and "R" or "L"
|
||||||
|
local pos = (rank == 7) and KIWAMI_POS[side] or RANK_POS[side]
|
||||||
|
local clip = (rank == 7) and "rank_result_kiwami" or "rank_result"
|
||||||
|
local obj = ClipPlayer.new("game/ending_anim/" .. clip, "game", clip .. "_anim", pos[1], pos[2])
|
||||||
|
if obj then
|
||||||
|
obj.hold_last = true
|
||||||
|
if rank < 7 then obj.shape_map = { [74] = RANK_SHAPES[rank], [76] = RANK_SHAPES[rank] } end -- clip uses plate 74 then 76
|
||||||
|
end
|
||||||
|
return obj
|
||||||
|
end
|
||||||
|
|
||||||
local digit_ok, dg_anim = pcall(require, "anim/sampler")
|
local digit_ok, dg_anim = pcall(require, "anim/sampler")
|
||||||
if not digit_ok then dg_anim = { safe = function()
|
if not digit_ok then dg_anim = { safe = function()
|
||||||
local n = {}
|
local n = {}
|
||||||
@@ -315,22 +328,29 @@ function ResultPlayer:update(current_ms, fade_in_finished,
|
|||||||
self.msg_at = self.crown_at + ((self.gauge_state >= 1) and CROWN_TO_ACTION or 0)
|
self.msg_at = self.crown_at + ((self.gauge_state >= 1) and CROWN_TO_ACTION or 0)
|
||||||
end
|
end
|
||||||
if self.skipped and self.fade_in_started then
|
if self.skipped and self.fade_in_started then
|
||||||
self.rank_obj = nil
|
-- the rank plate lands on its last frame like every other skipped state (no sound),
|
||||||
|
-- once the score it depends on is in
|
||||||
|
if not self.rank_settled and self.score ~= "" then
|
||||||
|
self.rank_settled = true
|
||||||
|
self.rank_done = true
|
||||||
|
local rank = rank_of(math.floor(tonumber(self.score) or 0))
|
||||||
|
if rank > 0 then
|
||||||
|
self.rank_obj = self.rank_obj or rank_clip(rank, self.is_2p)
|
||||||
|
if self.rank_obj then
|
||||||
|
self.rank_obj:start(current_ms - self.rank_obj.data.nframes * (1000 / 60)) -- clips run at 60 fps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
self.crown_at = math.min(self.crown_at or current_ms, current_ms)
|
self.crown_at = math.min(self.crown_at or current_ms, current_ms)
|
||||||
self.msg_at = math.min(self.msg_at or current_ms, current_ms)
|
self.msg_at = math.min(self.msg_at or current_ms, current_ms)
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.crown_at and current_ms >= self.crown_at and not self.rank_done then
|
if self.crown_at and current_ms >= self.crown_at and not self.rank_done then
|
||||||
self.rank_done = true
|
self.rank_done = true
|
||||||
local rank = (not self.skipped) and rank_of(math.floor(tonumber(self.score) or 0)) or 0
|
local rank = rank_of(math.floor(tonumber(self.score) or 0))
|
||||||
if rank > 0 then
|
if rank > 0 then
|
||||||
local side = self.is_2p and "R" or "L"
|
self.rank_obj = rank_clip(rank, self.is_2p)
|
||||||
local pos = (rank == 7) and KIWAMI_POS[side] or RANK_POS[side]
|
|
||||||
local clip = (rank == 7) and "rank_result_kiwami" or "rank_result"
|
|
||||||
self.rank_obj = ClipPlayer.new("game/ending_anim/" .. clip, "game", clip .. "_anim", pos[1], pos[2])
|
|
||||||
if self.rank_obj then
|
if self.rank_obj then
|
||||||
self.rank_obj.hold_last = true
|
|
||||||
if rank < 7 then self.rank_obj.shape_map = { [74] = RANK_SHAPES[rank], [76] = RANK_SHAPES[rank] } end -- clip uses plate 74 then 76
|
|
||||||
self.rank_obj:start(current_ms)
|
self.rank_obj:start(current_ms)
|
||||||
-- se_result `scorerank_NN_<seat>`: one sample for every rank, seat like the crown
|
-- se_result `scorerank_NN_<seat>`: one sample for every rank, seat like the crown
|
||||||
audio.play_sound("scorerank" .. (self.has_2p and (self.is_2p and "_r" or "_l") or "_c"), "sound")
|
audio.play_sound("scorerank" .. (self.has_2p and (self.is_2p and "_r" or "_l") or "_c"), "sound")
|
||||||
|
|||||||
Reference in new issue
Block a user