Files
PyTaikoGreen/Scripts/background/bg_collabs/yokai_yougota.lua
T

66 lines
2.6 KiB
Lua

local Yokai = require("background/bg_objects/yokai")
local Timing = require("background/bg_objects/timing")
local steps = Timing.steps
local enter, leave = Yokai.enter, Yokai.leave
-- Dancers: an 8-beat routine of quarter-beat poses, four bars of one move (the last one ending
-- on its own pair) then four of a second. Poses are offsets of their feet (texture.json y 686).
local ORIGIN = { 96, 312 }
local function bar(f)
return { { f[1], 0.25 }, { f[2], 0.25 }, { f[3], 0.25 }, { f[4], 0.25 } }
end
local function routine(a, a_end, b)
return steps(bar(a), bar(a), bar(a), bar(a_end), bar(b), bar(b), bar(b),
{ { b[1], 0.25 }, { b[2], 0.25 }, { b[3], 0.5 } })
end
-- Whisper: outline and body loops, arm outlines (under the body) and fills (over it) on the
-- routine. The whole stack leans 5 degrees one way for the first move and the other way for the
-- second, floats 10px low and dips 5px more a quarter beat into every beat; it pivots 14px
-- under his centre (texture.json y 544), where the original's does.
local WHISPER, WHISPER_ARMS = { 96, 142 }, { 128, 170 }
local function lean()
local poses = { length = 8 }
for b = 0, 7 do
local rot = b < 4 and 5 or -5
poses[#poses + 1] = { b, 0, 0, 10, rot = rot }
poses[#poses + 1] = { b + 0.25, 0, 0, 15, rot = rot }
poses[#poses + 1] = { b + 0.5, 0, 0, 10, rot = rot }
if b == 3 then poses[#poses + 1] = { 3.75, 0, 0, 10 } end
end
return poses
end
local function arms(key)
local layer = routine({ 0, 1, 2, 3 }, { 0, 1, 2, 4 }, { 5, 6, 7, 8 })
layer.key = key
return layer
end
return Yokai.background("background/collab/yokai_yougota", {
[0] = {
origin = ORIGIN, enter = enter(1, 0, 0.96), leave = leave(11),
dance = routine({ 2, 3, 4, 5 }, { 2, 3, 6, 0 }, { 7, 8, 9, 10 }),
},
[1] = {
origin = { WHISPER[1], WHISPER[2], _arms = WHISPER_ARMS, _hands = WHISPER_ARMS },
enter = enter(1, 8), leave = leave(10),
dance = { beats = 8, move = lean(),
Yokai.cycle(8, 0, "_outline"), arms("_arms"), Yokai.cycle(8, 2, "loop"), arms("_hands") },
},
[2] = {
origin = ORIGIN, enter = enter(1, 0, 0.96), leave = leave(10),
dance = routine({ 2, 3, 4, 5 }, { 2, 3, 4, 0 }, { 6, 7, 8, 9 }),
},
[3] = {
origin = ORIGIN, enter = enter(1), leave = leave(11),
dance = routine({ 2, 3, 4, 5 }, { 2, 3, 6, 0 }, { 7, 8, 9, 10 }),
},
-- centre: never removed
[4] = { origin = ORIGIN, enter = enter(0), dance = routine({ 1, 2, 3, 4 }, { 1, 2, 3, 5 }, { 6, 7, 8, 9 }) },
})