more buggies CLOSES #960, CLOSES #961, CLOSES #968, CLOSES #995, CLOSES #1006, CLOSES #1009, CLOSES #1013, CLOSES #1021, CLOSES #1031, CLOSES #1044, CLOSES #1049, CLOSES #1050, CLOSES #1045,,

This commit is contained in:
bryanthaboi
2026-08-10 17:06:24 -04:00
parent 7fa758602a
commit c3855cebec
20 changed files with 1837 additions and 70 deletions
+2
View File
@@ -207,6 +207,8 @@ local function changeBox(game)
if not yes then return end
game.save.currentBox = item.value
if game.writeSave then game:writeSave() end
-- ChangeBox (engine/menus/save.asm) rings SFX_SAVE after SaveGameData (#1044)
require("src.core.Sound").play(game.data, "Save")
list:close()
end,
}))
+8 -6
View File
@@ -2,8 +2,8 @@
-- flashes back and forth with the evolved form, speeding up, then the
-- new form appears with its cry and the congratulations text.
-- pokered engine/movie/evolution.asm (Evolution_CheckForCancel) polls the
-- joypad during the flash: holding B aborts the evolution -- the mon keeps
-- its species and _StoppedEvolvingText ("Huh? MON stopped evolving!")
-- joypad during the flash: a fresh B press aborts the evolution -- the mon
-- keeps its species and _StoppedEvolvingText ("Huh? MON stopped evolving!")
-- prints. Two kinds are exempt: trade evolutions, which evos_moves.asm
-- routes past the poll entirely (wLinkState == LINK_STATE_TRADING, #213),
-- and stone evolutions, where the B press is read but thrown away because
@@ -47,6 +47,8 @@ function EvolutionState:sgbPalettes(game)
end
local FLASH_FRAMES = 220
-- evolution.asm EvolveMon delays 80 frames before .animLoop, polling nothing (#968, #1031)
local CANCEL_GRACE_FRAMES = 80
local function frontSprite(game, species, mon)
local path, trueColor = require("src.pokemon.Sprites").path(
@@ -83,10 +85,10 @@ function EvolutionState:update(dt)
self.t = self.t + 1
if self.done then return end
local game = self.game
-- evos_moves.asm EvolveMon: each flash iteration polls hJoyHeld and, for
-- a cancelable evolution, aborts when B is held -- the mon keeps its
-- species (Evolution.apply never runs) and _StoppedEvolvingText prints.
if self.cancelable and game.input:isDown("b") then
-- evolution.asm Evolution_CheckForCancel reads hJoy5, a fresh edge rather
-- than a hold, so B held from the level-up box must not cancel (#968, #1031)
if self.cancelable and self.t > CANCEL_GRACE_FRAMES
and game.input:wasPressed("b") then
self.done = true
self.canceled = true
local TextBox = require("src.render.TextBox")
+9 -3
View File
@@ -164,8 +164,14 @@ local function toss(game)
}))
end
function PlayerPC.new(game)
-- opts.direct marks the bedroom PC (OpenRedsPC), the one entry outside the main menu
function PlayerPC.new(game, opts)
game.save.pcItems = game.save.pcItems or {}
-- ExitPlayerPC (players_pc.asm) rings SFX_TURN_OFF_PC only while
-- BIT_USING_GENERIC_PC is clear (#960)
local logOff = function()
if opts and opts.direct then Sound.play(game.data, "Turn_Off_PC") end
end
return Menu.new(game, {
-- keepOpen so B in the item lists returns here instead of dropping the
-- whole PC session (players_pc.asm re-shows the PC menu); same pattern
@@ -173,10 +179,10 @@ function PlayerPC.new(game)
{ label = Strings("WITHDRAW ITEM"), keepOpen = true, onSelect = function() withdraw(game) end },
{ label = Strings("DEPOSIT ITEM"), keepOpen = true, onSelect = function() deposit(game) end },
{ label = Strings("TOSS ITEM"), keepOpen = true, onSelect = function() toss(game) end },
{ label = Strings("LOG OFF") },
{ label = Strings("LOG OFF"), onSelect = logOff },
-- silent PC session (BIT_NO_MENU_BUTTON_SOUND); players_pc.asm
-- PlayersPCMenu TextBoxBorder (0,0) b=8 c=14 → 16x10
}, { tx = 0, ty = 0, tw = 16, th = 10, noSound = true })
}, { tx = 0, ty = 0, tw = 16, th = 10, noSound = true, onCancel = logOff })
end
return PlayerPC