CLOSES #1211, CLOSES #1228, CLOSES #1229, CLOSES #1232, CLOSES #1251, CLOSES #1265, CLOSES #1267, CLOSES #1276, CLOSES #1279, CLOSES #1282, CLOSES #1293, CLOSES #1296, CLOSES #1303, CLOSES #1329, CLOSES #1338, CLOSES #1341, CLOSES #1343, CLOSES #1344, CLOSES #1368, CLOSES #1385, CLOSES #1388, CLOSES #1389, CLOSES #1391

This commit is contained in:
bryanthaboi
2026-08-16 08:55:40 -04:00
parent 65128e13a4
commit 1151c188a7
50 changed files with 2835 additions and 276 deletions
@@ -0,0 +1,58 @@
-- engine/battle_anims/anim_commands.asm:755 BattleAnimCmd_BattlerGFX_1Row
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 findLoaded(runner, gfx)
for _, entry in ipairs(runner.loaded) do
if entry.gfx == gfx then return entry end
end
return nil
end
do
local runner = AnimRunner.new({})
runner:start(nil)
runner:loadBattlerGfx(1)
local head = findLoaded(runner, "BATTLE_ANIM_GFX_PLAYERHEAD")
local feet = findLoaded(runner, "BATTLE_ANIM_GFX_ENEMYFEET")
T.check(head and feet, "both pseudo-sheets registered")
T.eq(head.battler, "enemy",
"GFX_PLAYERHEAD's tiles are the ENEMY's feet row")
T.eq(head.tiles, 7, "seven tiles, the enemy pic's width")
T.eq(head.tile, (0x80 - 6 - 7) - 49, "at the asm's fixed base")
T.eq(feet.battler, "player",
"GFX_ENEMYFEET's tiles are the PLAYER's head row")
T.eq(feet.tiles, 6, "six tiles, the backpic's width")
T.eq(feet.tile, (0x80 - 6) - 49, "at the asm's fixed base")
T.eq(head.rows, 1, "one row each")
T.eq(feet.rows, 1, "on both sheets")
end
do
local runner = AnimRunner.new({})
runner:start(nil)
runner:loadBattlerGfx(2)
local head = findLoaded(runner, "BATTLE_ANIM_GFX_PLAYERHEAD")
local feet = findLoaded(runner, "BATTLE_ANIM_GFX_ENEMYFEET")
T.eq(head.battler, "enemy", "2ROW keeps the same crossing")
T.eq(head.tiles, 14, "two enemy rows")
T.eq(feet.battler, "player", "on both sides")
T.eq(feet.tiles, 12, "two player rows")
T.eq(head.tile, (0x80 - 6 * 2 - 7 * 2) - 49, "2ROW base")
T.eq(feet.tile, (0x80 - 6 * 2) - 49, "2ROW base")
end
do
local runner = AnimRunner.new({})
runner:start(nil)
AnimRunner.COMMANDS.battlergfx_1row(runner)
local head = findLoaded(runner, "BATTLE_ANIM_GFX_PLAYERHEAD")
T.eq(head and head.battler, "enemy", "the script command routes the same way")
end
T.finish("gen2 battler gfx row attribution bug 1231")