mirror of
https://github.com/bryanthaboi/gen1recomp
synced 2026-10-06 09:05:48 -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
58 lines
1.9 KiB
Lua
58 lines
1.9 KiB
Lua
-- scripts/LancesRoom.asm:54
|
|
return function(game)
|
|
local U = dofile("tests/drivers/util.lua")
|
|
local DIR = os.getenv("POKEPORT_SHOT_DIR") or "/tmp/shots"
|
|
local Pokemon = require("src.pokemon.Pokemon")
|
|
local ok = true
|
|
|
|
local function check(label, cond)
|
|
print((cond and "PASS " or "FAIL ") .. label)
|
|
if not cond then ok = false end
|
|
return cond
|
|
end
|
|
|
|
local function finish()
|
|
U.wait(5)
|
|
love.event.quit(ok and 0 or 1)
|
|
while true do coroutine.yield() end
|
|
end
|
|
|
|
local function findLance(ow)
|
|
for _, npc in ipairs(ow.npcs or {}) do
|
|
if npc.def and npc.def.name == "LANCESROOM_LANCE" then return npc end
|
|
end
|
|
end
|
|
|
|
local function approach(fromX, fromY, dir, label, shotName)
|
|
U.teleport(game, "LANCES_ROOM", fromX, fromY, dir)
|
|
local ow = game.overworld
|
|
if not check(label .. " overworld up in LANCES_ROOM", ow and ow.map.id == "LANCES_ROOM") then
|
|
return false
|
|
end
|
|
local lance = findLance(ow)
|
|
if not check(label .. " Lance present", lance ~= nil) then return false end
|
|
check(label .. " Lance starts facing down", lance.facing == "down")
|
|
U.hold(game, dir, 4)
|
|
local opened = false
|
|
for _ = 1, 600 do
|
|
if game.stack:top() ~= ow then opened = true break end
|
|
U.wait(1)
|
|
end
|
|
check(label .. " pre-battle text opens", opened)
|
|
U.wait(40)
|
|
check(label .. " Lance still faces down during his text", lance.facing == "down")
|
|
if lance.facing ~= "down" then U.log(label, "lance facing", lance.facing) end
|
|
U.still(game, DIR .. "/" .. shotName)
|
|
return true
|
|
end
|
|
|
|
game.save.party = { Pokemon.new(game.data, "MEWTWO", 100) }
|
|
game.save.flags.EVENT_BEAT_LANCE = nil
|
|
game.save.flags.EVENT_LANCES_ROOM_LOCK_DOOR = true
|
|
|
|
approach(5, 2, "up", "2669 side (5,1)", "2669_01_side_tile_lance_faces_down.png")
|
|
approach(6, 3, "up", "2669 front (6,2)", "2669_02_front_tile_lance_faces_down.png")
|
|
|
|
finish()
|
|
end
|