From 750fb877597bddc1221b96bb070387143f8f7cf4 Mon Sep 17 00:00:00 2001 From: TaikoZhong <108016253+GanYiZhong@users.noreply.github.com> Date: Wed, 14 Oct 2026 10:11:12 +0800 Subject: [PATCH] result: skipping the reveal lands the rank plate instead of dropping it Co-Authored-By: Claude Opus 5.5 --- Scripts/result/result_player.lua | 36 +++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/Scripts/result/result_player.lua b/Scripts/result/result_player.lua index 5869c23..8777183 100644 --- a/Scripts/result/result_player.lua +++ b/Scripts/result/result_player.lua @@ -27,6 +27,19 @@ local function rank_of(score) return r 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") if not digit_ok then dg_anim = { safe = function() 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) end 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.msg_at = math.min(self.msg_at or current_ms, current_ms) end if self.crown_at and current_ms >= self.crown_at and not self.rank_done then 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 - local side = self.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" - self.rank_obj = ClipPlayer.new("game/ending_anim/" .. clip, "game", clip .. "_anim", pos[1], pos[2]) + self.rank_obj = rank_clip(rank, self.is_2p) 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) -- se_result `scorerank_NN_`: 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") -- 2.54.0