71 lines
3.4 KiB
Lua
71 lines
3.4 KiB
Lua
local Mh3 = require("background/bg_objects/mh3")
|
|
local Timing = require("background/bg_objects/timing")
|
|
|
|
local pose_at = Timing.pose_at
|
|
|
|
-- Monster Hunter 3G (see bg_objects/mh3.lua for the parts it shares with Portable 3rd)
|
|
|
|
-- Fever: a beat after the rainbow, Lagiacrus runs left across the stage and back again
|
|
-- every 16 beats, its legs cycling eight frames a beat, leaving bombs behind it. Each bomb
|
|
-- is a green puddle that turns yellow, swells into a red dome and blows up in a blast and
|
|
-- three puffs of smoke. Losing the rainbow fades it all out over a beat. Timed in beats;
|
|
-- positions are centres, from where the run is anchored.
|
|
local FEVER_AT = { 955.45, 644.15 }
|
|
|
|
local LAGIACRUS = {
|
|
{ 0, 0, 590, -104, to = { -1222, -104 } }, -- runs left
|
|
{ 7.525, 0, hide = true },
|
|
{ 8.125, 0, -1322, -104, mirror = true, to = { 570, -104 } }, -- and back right
|
|
{ 15.625, 0, hide = true },
|
|
}
|
|
|
|
-- where each bomb is dropped: { beat, x, y } of its puddle's centre
|
|
local BOMBS = {
|
|
{ 1.25, 213, 30 }, { 2.35, -30, 27 }, { 3.15, -307, 30 }, { 4.15, -524, 27 }, { 5.425, -783, 30 },
|
|
{ 9.925, -822, 30 }, { 10.675, -573, 27 }, { 11.825, -309, 27 }, { 12.65, -98, 30 }, { 13.6, 132, 27 },
|
|
}
|
|
-- a bomb's parts, in beats from its drop and px from its puddle
|
|
local BOMB = {
|
|
{ key = "puddle", { 0, 0, 0, 0 }, { 0.75, 0, hide = true } },
|
|
{ key = "puddle", { 0.475, 1, 0, 0, alpha = 0, to = { 0, 0, alpha = 1 } }, { 0.725, 1 }, { 0.75, 1, hide = true } },
|
|
{ key = "dome", { 0.75, 0, 0, -3, sy = 0.52, to = { 0, -32, sy = 1.6 } }, { 0.975, 0, hide = true } },
|
|
{ key = "blast",
|
|
{ 0.975, 0, 0, -80, scale = 0.7, to = { 0, -114, sy = 1 } },
|
|
{ 1.125, 0, sx = 0.7, to = { 0, -138, sx = 0.96, sy = 1.2, alpha = 0 } },
|
|
{ 1.325, 0, hide = true } },
|
|
{ key = "smoke", { 1.125, 0, -14, -80, scale = 0.66, to = { -143, -122, scale = 1, alpha = 0 } }, { 1.75, 0, hide = true } },
|
|
{ key = "smoke", { 1.125, 0, 18, -85, scale = 0.66, to = { 149, -114, scale = 1, alpha = 0 } }, { 1.75, 0, hide = true } },
|
|
{ key = "smoke", { 1.125, 0, -1, -99, scale = 0.66, to = { -9, -176, scale = 0.91, alpha = 0 } }, { 1.75, 0, hide = true } },
|
|
}
|
|
|
|
local Mh3GFever = Mh3.Fever.define({
|
|
keys = { "lagiacrus", "puddle", "dome", "blast", "smoke" }, loop = 16, delay = 1, fade_beats = 0.975,
|
|
})
|
|
|
|
function Mh3GFever:draw_loop(t)
|
|
local run = pose_at(LAGIACRUS, t)
|
|
if run then
|
|
local leg = t >= LAGIACRUS[3][1] and LAGIACRUS[3][1] or 0
|
|
run.frame = math.floor((t - leg) * 8) % 8
|
|
self:draw_part("lagiacrus", run, FEVER_AT[1] + run.x, FEVER_AT[2] + run.y)
|
|
end
|
|
for _, bomb in ipairs(BOMBS) do
|
|
local bt = t - bomb[1]
|
|
for _, part in ipairs(BOMB) do
|
|
local p = bt >= 0 and pose_at(part, bt)
|
|
if p then self:draw_part(part.key, p, FEVER_AT[1] + bomb[2] + p.x, FEVER_AT[2] + bomb[3] + p.y) end
|
|
end
|
|
end
|
|
end
|
|
|
|
return Mh3.background("background/collab/mh3G", {
|
|
-- the Rathalos crest scrolls a tile every 5.3 s; the emblem glows every 1.3 s
|
|
donbg = { scroll = 5333, pulse = { { 667, 5757 }, { 667, -5757 } } },
|
|
-- wave panel over a strip of crests
|
|
bg_fever = { tile = 320, phase = -180, strip = { tile = 1280, x = 640 } },
|
|
-- Lumen's slots, left to right: dancers 3, 1, 4, 0, 2
|
|
heights = { [0] = 288, [1] = 288, [2] = 256, [3] = 256, [4] = 312 },
|
|
centers = { 208, 412, 640, 848, 1067 },
|
|
fever = Mh3GFever,
|
|
})
|