mirror of
https://github.com/bryanthaboi/gen1recomp
synced 2026-10-09 01:59:15 -04:00
72f2294d8d
CLOSES #2649, CLOSES #2650, CLOSES #2652, CLOSES #2653, CLOSES #2654, CLOSES #2657, CLOSES #2658, CLOSES #2659, CLOSES #2660, CLOSES #2662, CLOSES #2664, CLOSES #2665, CLOSES #2666, CLOSES #2669, CLOSES #2671, CLOSES #2672, CLOSES #2674, CLOSES #2676, CLOSES #2682, CLOSES #2683, CLOSES #2684, CLOSES #2685, CLOSES #2686, CLOSES #2687, CLOSES #2688, CLOSES #2689
46 lines
1.4 KiB
Lua
46 lines
1.4 KiB
Lua
package.path = "./?.lua;./?/init.lua;" .. package.path
|
|
|
|
local T = require("tests.modkit")
|
|
local Music = require("src.core.Music")
|
|
local BattleState = require("src.battle.BattleState")
|
|
|
|
local played
|
|
local realPlayVictory = Music.playVictory
|
|
Music.playVictory = function(data, kind) played = kind end
|
|
|
|
local function run(kind, id, partyIndex)
|
|
local b = setmetatable({
|
|
data = {},
|
|
kind = kind,
|
|
oppClass = id,
|
|
partyIndex = partyIndex,
|
|
trainer = id and { id = id } or nil,
|
|
}, { __index = BattleState })
|
|
b.musicKind = b:computeMusicKind()
|
|
played = nil
|
|
b:playVictoryMusic()
|
|
return b.musicKind, played
|
|
end
|
|
|
|
local cases = {
|
|
{ "trainer", "OPP_LANCE", 1, "gym", "trainer" },
|
|
{ "trainer", "OPP_LORELEI", 1, "trainer", "trainer" },
|
|
{ "trainer", "OPP_AGATHA", 1, "trainer", "trainer" },
|
|
{ "trainer", "OPP_BROCK", 1, "gym", "gym" },
|
|
{ "trainer", "OPP_GIOVANNI", 3, "gym", "gym" },
|
|
{ "trainer", "OPP_GIOVANNI", 2, "trainer", "trainer" },
|
|
{ "trainer", "OPP_RIVAL3", 1, "final", "gym" },
|
|
{ "trainer", "OPP_YOUNGSTER", 1, "trainer", "trainer" },
|
|
{ "wild", nil, nil, "wild", "wild" },
|
|
}
|
|
|
|
for _, c in ipairs(cases) do
|
|
local label = tostring(c[2] or "wild") .. "#" .. tostring(c[3] or "-")
|
|
local battleKind, victoryKind = run(c[1], c[2], c[3])
|
|
T.eq(battleKind, c[4], label .. " battle theme kind")
|
|
T.eq(victoryKind, c[5], label .. " victory theme kind")
|
|
end
|
|
|
|
Music.playVictory = realPlayVictory
|
|
T.finish("lance victory music bug2659")
|