mirror of
https://github.com/bryanthaboi/gen1recomp
synced 2026-09-26 13:33:27 -04:00
a9ce423bdc
CLOSES #1275, CLOSES #1295, CLOSES #1384, CLOSES #1628, CLOSES #1677, CLOSES #1682, CLOSES #1691, CLOSES #1813, CLOSES #1822, CLOSES #1861, CLOSES #1867, CLOSES #1868, CLOSES #1869, CLOSES #1870, CLOSES #1871, CLOSES #1872, CLOSES #1874, CLOSES #1876, CLOSES #1878, CLOSES #1880, CLOSES #1881, CLOSES #1882, CLOSES #1884, CLOSES #1885, CLOSES #1886, CLOSES #1887, CLOSES #1888, CLOSES #1889, CLOSES #1890, CLOSES #1891, CLOSES #1892, CLOSES #1893, CLOSES #1894, CLOSES #1895, CLOSES #1896, CLOSES #1899, CLOSES #1900, CLOSES #1901
49 lines
1.5 KiB
Lua
49 lines
1.5 KiB
Lua
-- engine/battle_anims/anim_commands.asm:213 (#1896)
|
|
|
|
package.path = "./?.lua;./?/init.lua;" .. package.path
|
|
|
|
love = require("tests.love_stub")
|
|
|
|
local T = require("tests.harness")
|
|
local AnimRunner = require("src.battle.gen2.AnimRunner")
|
|
|
|
local function runnerWith(rows, palettes)
|
|
local runner = AnimRunner.new({
|
|
animId = "ANIM_THROW_POKE_BALL",
|
|
battleTurn = 0,
|
|
data = { scripts = { click = rows } },
|
|
})
|
|
runner:start("click")
|
|
runner.objects.playFrame = function(objects)
|
|
objects.oam = {}
|
|
for _, name in ipairs(palettes) do
|
|
objects.oam[#objects.oam + 1] = { x = 80, y = 80, tile = 0, attr = 0,
|
|
palette = name }
|
|
end
|
|
return false
|
|
end
|
|
return runner
|
|
end
|
|
|
|
do
|
|
local runner = runnerWith({ { "keepsprites" }, { "ret" } },
|
|
{ "PAL_BATTLE_OB_RED", "PAL_BATTLE_OB_BLUE" })
|
|
T.eq(runner:step(), false, "keepsprites + ret ends the script the same frame")
|
|
T.eq(runner.keepSprites, true, "and BATTLEANIM_KEEPSPRITES_F is set")
|
|
T.eq(#runner:oam(), 2, "the ball's OBJs stay on screen")
|
|
for _, obj in ipairs(runner:oam()) do
|
|
T.eq(obj.palette, "PAL_BATTLE_OB_ENEMY",
|
|
"every kept OBJ is remapped onto the wild mon's palette")
|
|
end
|
|
end
|
|
|
|
do
|
|
local runner = runnerWith({ { "ret" } },
|
|
{ "PAL_BATTLE_OB_RED", "PAL_BATTLE_OB_BLUE" })
|
|
T.eq(runner:step(), false, "a break-free ret still ends the script")
|
|
T.eq(runner.keepSprites, false, "with no keepsprites flag")
|
|
T.eq(#runner:oam(), 0, "so BattleAnim_ClearOAM deletes the sprites instead")
|
|
end
|
|
|
|
T.finish("gen2 caught ball palette bug 1896")
|