mirror of
https://github.com/bryanthaboi/gen1recomp
synced 2026-09-28 06:49:29 -04:00
aed3bbced7
- Battle Animation Pipeline:
* Eliminate 90-frame audio polling stall in anim_vm end/waitsound opcodes,
allowing attack animations to transition instantly into target hit flicker
and HP bar drain.
* Correct visual task counting in AnimVm:visualCount to match pret gAnimVisualTaskCount.
* Signal bg task completion on restorebg (vm.args[7] = -1).
* Fix termination conditions on shake tasks (ShakeMon, ShakeMon2, ShakeBattleTerrain),
WaterSport droplet arcs, and StartSinAnimTimer.
* Handle RGB555 color args in start_blend_anim_sprite_color and route P.destroyTask
to AnimTasks.destroy.
- RNG System & Seeding Parity:
* Replace math.random in Party.giveMon with Rng.Random32() for personality values
and Rng.Random() for IV bitfield extraction (HP/Atk/Def/Spe/SpA/SpD) matching GBA format.
* Seed RNG on Title Screen A/Start press via Rng.seedNewGame() (matching SeedRngAndSetTrainerId)
and perturb RNG state on title menu inputs.
* Route NPC overworld idle/wander timers and wild encounter slot rolls through Rng.compat.
- Pokédex Habitat & Area Maps:
* Fix encounter tables extraction and map indexing to resolve Pokemon habitat
locations across Kanto/Sevii maps rather than showing Area Unknown.
* Render steady semi-transparent red overlays for Pokédex area map locations.
- Multichoice Menus & UI:
* Implement multichoice table extraction and data population for Viridian blackboard
status ailments and special dialog interactions.
* Improve choice box borders, pagination, and Town Map wall viewing.
- Overworld Events & Flags:
* Fix Route 1 entrance girl NPC spawning and script triggers after starter selection.
* Ensure consistent save reload state in Oak's Lab.
84 lines
4.2 KiB
Lua
84 lines
4.2 KiB
Lua
-- Test suite for Game3 Pokédex Area & Where-to-Find extraction and rendering logic.
|
|
|
|
local GameVersion = require("src.core.GameVersion")
|
|
GameVersion.set("firered")
|
|
|
|
local PokedexData = require("src.core.game3.pokedex_data")
|
|
assert(PokedexData.init(), "PokedexData should initialize successfully")
|
|
|
|
print("[test] 1. Dynamic wild area extraction for common Kanto species")
|
|
local pidgeyAreas = PokedexData.getWildAreasForSpecies(16)
|
|
assert(#pidgeyAreas > 0, "Pidgey (16) must have wild area locations")
|
|
local pidgeyHasRoute1 = false
|
|
for _, a in ipairs(pidgeyAreas) do
|
|
if a == "DEX_AREA_ROUTE_1" then pidgeyHasRoute1 = true end
|
|
assert(PokedexData.getAreaMarker(a) ~= nil, "Area marker for " .. a .. " must exist")
|
|
end
|
|
assert(pidgeyHasRoute1, "Pidgey must have DEX_AREA_ROUTE_1")
|
|
|
|
local rattataAreas = PokedexData.getWildAreasForSpecies(19)
|
|
assert(#rattataAreas > 0, "Rattata (19) must have wild area locations")
|
|
local rattataHasRoute22 = false
|
|
for _, a in ipairs(rattataAreas) do
|
|
if a == "DEX_AREA_ROUTE_22" then rattataHasRoute22 = true end
|
|
assert(PokedexData.getAreaMarker(a) ~= nil, "Area marker for " .. a .. " must exist")
|
|
end
|
|
assert(rattataHasRoute22, "Rattata must have DEX_AREA_ROUTE_22")
|
|
|
|
local pikachuAreas = PokedexData.getWildAreasForSpecies(25)
|
|
assert(#pikachuAreas >= 2, "Pikachu must have Viridian Forest and Power Plant")
|
|
local pikaViridian, pikaPower = false, false
|
|
for _, a in ipairs(pikachuAreas) do
|
|
if a == "DEX_AREA_VIRIDIAN_FOREST" then pikaViridian = true end
|
|
if a == "DEX_AREA_POWER_PLANT" then pikaPower = true end
|
|
end
|
|
assert(pikaViridian and pikaPower, "Pikachu must spawn in Viridian Forest and Power Plant")
|
|
|
|
local diglettAreas = PokedexData.getWildAreasForSpecies(50)
|
|
assert(#diglettAreas > 0, "Diglett (50) must have wild area locations")
|
|
assert(diglettAreas[1] == "DEX_AREA_DIGLETTS_CAVE", "Diglett must spawn in Diglett's Cave")
|
|
|
|
print("[test] 2. Sevii Island species wild area extraction and map assignment")
|
|
local dunsparceAreas = PokedexData.getWildAreasForSpecies(206)
|
|
assert(#dunsparceAreas > 0, "Dunsparce (206) must have wild area locations")
|
|
assert(dunsparceAreas[1] == "DEX_AREA_THREE_ISLE_PATH", "Dunsparce spawns in Three Isle Path")
|
|
assert(PokedexData.getAreaMapKey("DEX_AREA_THREE_ISLE_PATH") == "three_island", "Three Isle Path belongs to three_island")
|
|
|
|
local slugmaAreas = PokedexData.getWildAreasForSpecies(218)
|
|
assert(#slugmaAreas > 0, "Slugma (218) must have wild area locations")
|
|
assert(slugmaAreas[1] == "DEX_AREA_MT_EMBER", "Slugma spawns in Mt. Ember")
|
|
assert(PokedexData.getAreaMapKey("DEX_AREA_MT_EMBER") == "one_island", "Mt Ember belongs to one_island")
|
|
|
|
local phanpyAreas = PokedexData.getWildAreasForSpecies(231)
|
|
assert(#phanpyAreas > 0, "Phanpy (231) must have wild area locations")
|
|
assert(PokedexData.getAreaMapKey("DEX_AREA_SEVAULT_CANYON") == "seven_island", "Sevault Canyon belongs to seven_island")
|
|
|
|
print("[test] 3. Non-wild species return empty area table (Area Unknown)")
|
|
local bulbasaurAreas = PokedexData.getWildAreasForSpecies(1)
|
|
assert(#bulbasaurAreas == 0, "Starter Bulbasaur has no wild areas (Area Unknown)")
|
|
|
|
local mewtwoAreas = PokedexData.getWildAreasForSpecies(150)
|
|
assert(#mewtwoAreas == 0, "Mewtwo has no wild grass encounter table (Area Unknown)")
|
|
|
|
local deoxysAreas = PokedexData.getWildAreasForSpecies(386)
|
|
assert(#deoxysAreas == 0, "Deoxys has no wild grass encounter table (Area Unknown)")
|
|
|
|
print("[test] 4. All extracted markers have valid shape and coordinates")
|
|
local checkedCount = 0
|
|
for sp = 1, 386 do
|
|
local areas = PokedexData.getWildAreasForSpecies(sp)
|
|
for _, aKey in ipairs(areas) do
|
|
local m = PokedexData.getAreaMarker(aKey)
|
|
assert(m ~= nil, "Marker must exist for " .. aKey)
|
|
assert(type(m.x) == "number" and type(m.y) == "number", "Coordinates must be numbers for " .. aKey)
|
|
assert(type(m.shape) == "string", "Shape must be string for " .. aKey)
|
|
local mapKey = PokedexData.getAreaMapKey(aKey)
|
|
assert(type(mapKey) == "string", "Map key must be string for " .. aKey)
|
|
checkedCount = checkedCount + 1
|
|
end
|
|
end
|
|
assert(checkedCount > 100, "Should have verified > 100 area marker references")
|
|
print(string.format("OK: Verified %d area marker references across all species", checkedCount))
|
|
|
|
print("[ALL TESTS PASSED] Pokédex Area & Where-to-Find extraction is 100% verified.")
|