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

46 lines
2.0 KiB
Lua

local Yokai = require("background/bg_objects/yokai")
local Timing = require("background/bg_objects/timing")
local steps = Timing.steps
local enter, leave, squash = Yokai.enter, Yokai.leave, Yokai.squash
-- Dancers: the Yo-kai Watch set with new art, dancing a 4-beat routine: six poses in triplets,
-- then a whole-beat squash and a whole-beat pose. Poses are offsets of their feet (texture.json
-- y 686); Fumika's frames are 8px taller, padded to 320.
local ORIGIN, TALL = { 128, 312 }, { 128, 316 }
local T = 1 / 3
-- triplets a b a b a c, then d squashed and e
local function routine(a, b, c, d, e)
return steps({ { a, T, x = 0, y = 0 }, { b, T }, { a, T }, { b, T }, { a, T }, { c, T } },
{ squash(d, 0.95, 0.425, 0.1, 0.475) }, { { e, 1 } })
end
-- Whisper: arm outlines (under) and fills (over) follow the routine around his body loop
local function arms(key)
local layer = steps({ { 0, T, x = 0, y = 0 }, { 1, T }, { 0, T }, { 1, T }, { 0, T }, { 2, T },
{ 3, 1 }, { 4, 1 } })
layer.key = key
return layer
end
local WHISPER_BODY = Yokai.cycle(4, 2, "loop")
for _, p in ipairs(WHISPER_BODY) do p[4] = -156 end
WHISPER_BODY.origin = { 128, 156 }
return Yokai.background("background/collab/yokai_hatsukoi", {
-- Komasan: his own triplets, a squash late in the bar
[0] = {
origin = ORIGIN, enter = enter(0), leave = leave(0),
dance = steps({ { 1, T, x = 0, y = 0 }, { 2, T }, { 3, T }, { 2, T }, { 3, T }, { 2, T }, { 4, T } },
{ squash(4, 0.95, 0.4, 0.1, 0.5) }, { { 1, 2 * T } }),
},
[1] = {
origin = ORIGIN, enter = enter(1), leave = leave(10),
dance = { beats = 4, move = Yokai.bob(4), arms("_arms"), WHISPER_BODY, arms("_hands") },
},
[2] = { origin = ORIGIN, enter = enter(1), leave = leave(7), dance = routine(2, 3, 4, 5, 6) },
[3] = { origin = TALL, enter = enter(1), leave = leave(7), dance = routine(2, 3, 4, 5, 6) },
-- Jibanyan, centre: never removed
[4] = { origin = ORIGIN, enter = enter(0), dance = routine(1, 2, 3, 4, 5) },
})