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
56 lines
1.9 KiB
Lua
56 lines
1.9 KiB
Lua
-- engine/pokegear/radio.asm:1 (#1871)
|
|
|
|
package.path = "./?.lua;./?/init.lua;" .. package.path
|
|
|
|
local T = require("tests.harness")
|
|
local check = T.check
|
|
love = love or require("tests.love_stub")
|
|
|
|
local FlagNames = require("src.core.gen2.FlagNames")
|
|
local Pokegear = require("src.ui.gen2.Pokegear")
|
|
|
|
local TOWER = FlagNames.engine.ENGINE_ROCKETS_IN_RADIO_TOWER
|
|
local SIGNAL = FlagNames.engine.ENGINE_ROCKET_SIGNAL_ON_CH20
|
|
|
|
local function newGear(save, world)
|
|
local gear = setmetatable({
|
|
save = save,
|
|
game = { world = world },
|
|
landmarks = { landmarks = {} },
|
|
}, { __index = Pokegear })
|
|
gear.region = function() return "johto" end
|
|
gear.hiddenPeople = function() return {} end
|
|
gear.radioWeekday = function() return 1 end
|
|
gear.timeOfDayIndex = function() return 1 end
|
|
return gear
|
|
end
|
|
|
|
check(TOWER == 18, "ENGINE_ROCKETS_IN_RADIO_TOWER is gold id 18")
|
|
check(SIGNAL == 14, "ENGINE_ROCKET_SIGNAL_ON_CH20 is gold id 14")
|
|
|
|
local armed = newGear({ engineFlags = { [TOWER] = true } })
|
|
check(armed:radioData().rocketsInRadioTower == true,
|
|
"the takeover reads straight off save.engineFlags")
|
|
|
|
local quiet = newGear({ engineFlags = {} })
|
|
check(quiet:radioData().rocketsInRadioTower == false,
|
|
"and stays off while the tower is clear")
|
|
|
|
local legacy = newGear({ flags = { ROCKETS_IN_RADIO_TOWER = true } })
|
|
check(legacy:radioData().rocketsInRadioTower == false,
|
|
"save.flags is not the takeover's store")
|
|
|
|
local crystal = newGear({ engineFlags = { [TOWER + 1] = true } }, {
|
|
engineFlagId = function(_, name)
|
|
return name == "ENGINE_ROCKETS_IN_RADIO_TOWER" and TOWER + 1 or nil
|
|
end,
|
|
})
|
|
check(crystal:radioData().rocketsInRadioTower == true,
|
|
"and Crystal's shifted id resolves through the world")
|
|
|
|
local rage = newGear({ engineFlags = { [SIGNAL] = true } })
|
|
check(rage:radioContext().rocketSignal == true,
|
|
"the Lake of Rage signal reads the same store")
|
|
|
|
T.finish("gen2 radio rocket flag bug 1871")
|