forked from Yonokid/YataiDONNijiiro
Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
750fb87759 | ||
|
|
ff708041d5 | ||
|
|
3f6124a09c | ||
|
|
0fed3df419 | ||
|
|
99aa932bb8 | ||
|
|
e6afffc67b |
No files matched your search
@@ -0,0 +1,103 @@
|
|||||||
|
-- This skin's gauge: the parent's script with render() replaced. The parent's render() is laid
|
||||||
|
-- out for its 87-cell flash gauge; this skin's 50 x 21 px grid fades each new cell in:
|
||||||
|
-- * gauge_cell_fade_in: the fading sprite is the new cell itself, so it sits on cell
|
||||||
|
-- length-1 (at length it left a dark gap cell before it)
|
||||||
|
-- * the clear mark sits gauge_clear_mark_offset cells (skin_config: 1, the cell edge) before
|
||||||
|
-- the exact clear fraction, not the parent's 87/60
|
||||||
|
-- Everything else is the parent's file, loaded from its own copy.
|
||||||
|
|
||||||
|
-- the parent skin's copy of a script: the second match on package.path (the first is this file)
|
||||||
|
local function load_parent(name)
|
||||||
|
local seen = false
|
||||||
|
for tmpl in package.path:gmatch("[^;]+") do
|
||||||
|
local chunk = loadfile((tmpl:gsub("%?", name)))
|
||||||
|
if chunk then
|
||||||
|
if seen then return chunk end
|
||||||
|
seen = true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
assert(load_parent("game/gauge"), "game/gauge: the parent skin has no gauge script")()
|
||||||
|
|
||||||
|
local function clamp(v, lo, hi) return math.max(lo, math.min(hi, v)) end
|
||||||
|
|
||||||
|
local parent_new = Gauge.new
|
||||||
|
function Gauge.new(...)
|
||||||
|
local self = parent_new(...)
|
||||||
|
local mark = tex.get_skin_config("gauge_clear_mark_offset")
|
||||||
|
self.clear_mark_offset = mark and mark.x
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
function Gauge:render(y, mirror, idx, points, previous_points, max_points, clear_points,
|
||||||
|
is_clear, is_rainbow, anim_active, anim_alpha, rainbow_fade, rainbow_frac, fire_frame)
|
||||||
|
-- blit(t, mirror, x, y, x2, fade, frame, index, scale, center, cap)
|
||||||
|
if not self.no_border then self:blit(self.border, mirror, nil, y, nil, nil, nil, idx) end
|
||||||
|
self:blit(self.unfilled, mirror, nil, y, nil, nil, nil, idx)
|
||||||
|
|
||||||
|
local units, bw = self.bar_units, self.bar_width
|
||||||
|
local length, solid, alpha, show_up, pending, fade_in =
|
||||||
|
self:cells(points, previous_points, max_points, anim_active, anim_alpha)
|
||||||
|
local clear_point = clamp(clear_points * units // max_points, 1, units)
|
||||||
|
-- the parent's art: the clear mark at the exact fraction minus 87/60 cells (x 897/967/1037 on
|
||||||
|
-- easy/normal/hard), not on a cell edge
|
||||||
|
local cpx = clear_points * units / max_points - (self.clear_mark_offset or units / 60)
|
||||||
|
|
||||||
|
if solid > 0 then
|
||||||
|
self:blit(self.bar, nil, nil, y,
|
||||||
|
math.min(solid, cpx) * bw - bw, nil, nil, idx)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- first gold cell lights exactly when the gauge is cleared (not by a cell-count test:
|
||||||
|
-- on 87 cells 8000 -> 69.6 would light it a cell early/late vs. the clear state)
|
||||||
|
if is_clear and not (fade_in and pending and length == clear_point) then
|
||||||
|
self:blit(self.clear_transition, mirror, cpx * bw, y, nil, nil, nil, idx)
|
||||||
|
end
|
||||||
|
|
||||||
|
-- gold zone: cells clear_point .. solid-1, one cell wide piece so stretch is (n-1)*bw
|
||||||
|
local gold_x = (cpx + 1) * bw
|
||||||
|
if solid * bw >= gold_x + bw then
|
||||||
|
local gold_x2 = solid * bw - gold_x - bw
|
||||||
|
self:blit(self.clear_top, mirror, gold_x, y, gold_x2, nil, nil, idx)
|
||||||
|
self:blit(self.clear_bottom, nil, gold_x, y, gold_x2, nil, nil, idx)
|
||||||
|
end
|
||||||
|
|
||||||
|
if is_rainbow and rainbow_fade >= 0 then
|
||||||
|
local frame_a = math.floor(rainbow_frac) % 8
|
||||||
|
local frame_b = (frame_a + 1) % 8
|
||||||
|
local f = rainbow_frac - math.floor(rainbow_frac)
|
||||||
|
self:blit(self.rainbow, mirror, nil, y, nil, rainbow_fade, frame_a, idx)
|
||||||
|
self:blit(self.rainbow, mirror, nil, y, nil, rainbow_fade * f, frame_b, idx)
|
||||||
|
end
|
||||||
|
|
||||||
|
if show_up then
|
||||||
|
-- flash: the glow rides the leading edge of the fill; fade-in: the sprite is the new
|
||||||
|
-- cell itself (the fill stops one cell short until it lands)
|
||||||
|
local fx = (fade_in and length - 1 or length) * bw
|
||||||
|
if length == clear_point then
|
||||||
|
self:blit(self.clear_transition_fade, mirror, cpx * bw, y, nil, alpha, nil, idx)
|
||||||
|
elseif length > clear_point then
|
||||||
|
self:blit(self.clear_fade, nil, fx, y, nil, alpha, nil, idx)
|
||||||
|
else
|
||||||
|
self:blit(self.bar_fade, nil, fx, y, nil, alpha, nil, idx)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
self:blit(self.overlay, mirror, nil, y, nil, 0.15, nil, idx, nil, nil, true)
|
||||||
|
if self.footer then self:blit(self.footer, nil, nil, y, nil, nil, nil, idx) end
|
||||||
|
|
||||||
|
self:draw_fire(y, idx, is_rainbow, fire_frame)
|
||||||
|
|
||||||
|
local label = self.art_tier + idx * 3
|
||||||
|
if is_clear then
|
||||||
|
self:blit(self.clear, nil, nil, y, nil, nil, nil, label)
|
||||||
|
self:blit(self.tamashii, nil, nil, y, nil, nil, nil, idx)
|
||||||
|
if is_rainbow and (fire_frame == 0 or fire_frame == 1 or fire_frame == 4 or fire_frame == 5) then
|
||||||
|
self:blit(self.tamashii_overlay, nil, nil, y, nil, 0.5, nil, idx, nil, nil, true)
|
||||||
|
end
|
||||||
|
else
|
||||||
|
self:blit(self.clear_dark, nil, nil, y, nil, nil, nil, label)
|
||||||
|
self:blit(self.tamashii_dark, nil, nil, y, nil, nil, nil, idx)
|
||||||
|
end
|
||||||
|
end
|
||||||
@@ -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")
|
||||||
|
|||||||
+2
-1
@@ -4374,7 +4374,7 @@ d21dc53600bab83b80352bad38cd598d216c6e1279a4d54a0a085ad82ad1430d *./Graphics/res
|
|||||||
684c22481d2a0e4bb2d6dd67b5df87650e081edfeadffcc70c377c393334c06d *./Graphics/result/score/score_shinuchi_en.png
|
684c22481d2a0e4bb2d6dd67b5df87650e081edfeadffcc70c377c393334c06d *./Graphics/result/score/score_shinuchi_en.png
|
||||||
1c160a1a14016ea3a5f761b040db433420476363224011d615613af660e7d0e1 *./Graphics/result/score/score_shinuchi_ja.png
|
1c160a1a14016ea3a5f761b040db433420476363224011d615613af660e7d0e1 *./Graphics/result/score/score_shinuchi_ja.png
|
||||||
89c4d6afafb8010ec4da0b9f72f10f677ec8c87677fcb3d2c9edde923a5b5f9f *./Graphics/result/score/texture.json
|
89c4d6afafb8010ec4da0b9f72f10f677ec8c87677fcb3d2c9edde923a5b5f9f *./Graphics/result/score/texture.json
|
||||||
a3283a68c842ac605adda06316eb56353602a51f3a53284f679b3f092aeae159 *./Graphics/skin_config.json
|
546297e182cf47f1d498cf09c0dfa0bc46b162bab5fc7820077f6ee2a1003754 *./Graphics/skin_config.json
|
||||||
a05d23f0997446d4db2b745602bff7fc3d2cdce968a1c24e078684d41cf2982c *./Graphics/song_select/animation.json
|
a05d23f0997446d4db2b745602bff7fc3d2cdce968a1c24e078684d41cf2982c *./Graphics/song_select/animation.json
|
||||||
27e427b29774e04dc739b1c58a7205565de88cea6370876b623f8e13a7106b5c *./Graphics/song_select/box/back_graphic.png
|
27e427b29774e04dc739b1c58a7205565de88cea6370876b623f8e13a7106b5c *./Graphics/song_select/box/back_graphic.png
|
||||||
b74432db46ec6d7ec080fbee6df6029c1451e243d30813fcf597a21704de4e74 *./Graphics/song_select/box/background/0.png
|
b74432db46ec6d7ec080fbee6df6029c1451e243d30813fcf597a21704de4e74 *./Graphics/song_select/box/background/0.png
|
||||||
@@ -5334,3 +5334,4 @@ c567acc69bf6e9a239e66a195f2d65a7ec6455acff3ee248f4302477d01c193d *./Videos/attra
|
|||||||
54f561d89b48feff2fa31999e7485e370f2c55b9f360102b2014310078d20fc3 *./Videos/attract_videos/attractdemo_kor.mp4
|
54f561d89b48feff2fa31999e7485e370f2c55b9f360102b2014310078d20fc3 *./Videos/attract_videos/attractdemo_kor.mp4
|
||||||
3801f84ff85f56376828abef0b12bd8a1e336b4bc739557bc0ccfa386d79668e *./Videos/op_videos/title.mp4
|
3801f84ff85f56376828abef0b12bd8a1e336b4bc739557bc0ccfa386d79668e *./Videos/op_videos/title.mp4
|
||||||
ff683df979890751a798250df629989280257eb35d560eefaa3111530430a4f7 *./Scripts/background/bg_objects/packed_channel.lua
|
ff683df979890751a798250df629989280257eb35d560eefaa3111530430a4f7 *./Scripts/background/bg_objects/packed_channel.lua
|
||||||
|
8f8f0910e33b6cc90646e81c2674a3c31004106ff9fe2b38788bcd2067691ffc *./Scripts/game/gauge.lua
|
||||||
Reference in new issue
Block a user