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
60 lines
2.2 KiB
Lua
60 lines
2.2 KiB
Lua
package.path = "./?.lua;./?/init.lua;" .. package.path
|
|
|
|
local T = require("tests.harness")
|
|
local GenSave = require("src.save_convert.GenSave")
|
|
local romText = require("src.core.RomText")
|
|
|
|
local localized = {
|
|
text = {
|
|
_MoveIsDisabledText = "The move {RAM:wNameBuffer} from {USER} is disabled!",
|
|
},
|
|
}
|
|
T.eq(romText(localized, "_MoveIsDisabledText", "%s's %s is disabled!", {
|
|
USER = "PIKACHU", ["RAM:wNameBuffer"] = "THUNDER",
|
|
}), "The move THUNDER from PIKACHU is disabled!",
|
|
"named ROM tokens survive translation reordering")
|
|
|
|
GenSave.setCharmap(loadfile("src/save_convert/data/charmap.lua")())
|
|
local data = {
|
|
pokemon = {}, moves = {}, items = {},
|
|
-- home/overworld.asm:2016 (#1691)
|
|
maps = { PALLET_TOWN = { id = "PALLET_TOWN", index = 0, tileset = "OVERWORLD",
|
|
width = 10, height = 9 } },
|
|
hiddenItems = loadfile("src/save_convert/data/hidden_items.lua")(),
|
|
}
|
|
loadfile("tests/fixture_data/map_window.lua")()(data, "PALLET_TOWN")
|
|
local save = {
|
|
player = { name = "RED", id = 1, map = "PALLET_TOWN", x = 0, y = 0 },
|
|
rival = { name = "BLUE" }, party = {}, boxes = {}, inventory = {},
|
|
pcItems = {}, flags = {}, pokedex = { seen = {}, owned = {} },
|
|
hiddenTaken = {
|
|
VIRIDIAN_FOREST_1_18 = true,
|
|
VIRIDIAN_CITY_14_4 = true,
|
|
},
|
|
}
|
|
for i = 1, 12 do save.boxes[i] = {} end
|
|
local bytes = GenSave.encode(save, data, nil)
|
|
local decoded = GenSave.decode(bytes, data)
|
|
T.check(decoded.hiddenTaken.VIRIDIAN_FOREST_1_18,
|
|
"Viridian Forest hidden potion imports from wObtainedHiddenItemsFlags")
|
|
T.check(decoded.hiddenTaken.VIRIDIAN_CITY_14_4,
|
|
"Viridian City hidden potion imports from wObtainedHiddenItemsFlags")
|
|
T.check(not decoded.hiddenTaken.ROUTE_9_14_7,
|
|
"an uncollected hidden item remains available")
|
|
|
|
love = love or require("tests.love_stub")
|
|
local start = require("src.ui.StartMenu").new({
|
|
data = {}, save = {
|
|
flags = {}, party = {}, inventory = {}, options = {},
|
|
player = { name = "RED" }, pokedex = { owned = {} },
|
|
},
|
|
})
|
|
local pokemonRow
|
|
for _, row in ipairs(start.items) do
|
|
if row.label == "POKéMON" then pokemonRow = row break end
|
|
end
|
|
T.check(pokemonRow and pokemonRow.keepOpen,
|
|
"the empty-party POKéMON row leaves the start menu open")
|
|
|
|
T.finish("open menu bugs 949 and 1149")
|