mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-12 00:10:56 +02:00
Run the field-move white blink under its text, not after (#320)
The vanilla surf/strength flow closed the menu, showed the overworld, then fired a solid-white blink on the empty map, and set the surfing sprite while the player was still on land. pokered's GBPalWhiteOutWithDelay3 runs while the text is still up, so the blink reads as a text flash. The blink now sits under the textbox on the stack (only the top state updates, so it holds its frames until the text closes), and surfing applies only when the step onto the water happens. Same reorder for the party-menu STRENGTH texts. The parity surf tests now dismiss the got-on text before asserting the mount, matching the new order.
This commit is contained in:
@@ -607,6 +607,38 @@ do
|
||||
end)
|
||||
end
|
||||
|
||||
do
|
||||
-- issue #320: the surf blink sits UNDER the "got on" text (pokered's
|
||||
-- GBPalWhiteOutWithDelay3 runs while the text is up), and the surfing
|
||||
-- sprite swap waits for the actual step onto the water
|
||||
require("src.render.Font").load(Data)
|
||||
local save = {
|
||||
flags = {},
|
||||
inventory = { SOULBADGE = 1 },
|
||||
party = { { species = "SQUIRTLE", moves = { { id = "SURF" } } } },
|
||||
player = { name = "RED" },
|
||||
}
|
||||
local stack = { states = {} }
|
||||
function stack:push(s) self.states[#self.states + 1] = s end
|
||||
function stack:pop() return table.remove(self.states) end
|
||||
function stack:top() return self.states[#self.states] end
|
||||
local game = { data = Data, save = save, stack = stack }
|
||||
check(bindGame(OW.trySurf, game), "trySurf binds a test Game")
|
||||
check(bindGame(OW.partyKnows, game), "partyKnows binds the same Game")
|
||||
local ow = setmetatable({ player = { facing = "down" } }, { __index = OW })
|
||||
ow.stepForwardOrCrossEdge = function(_, dir) ow.stepped = dir end
|
||||
|
||||
ow:trySurf(10, 10)
|
||||
local bottom, top = stack.states[1], stack.states[2]
|
||||
check(bottom and bottom.frames ~= nil and top and top.pages ~= nil,
|
||||
"the blink sits under the surf text on the stack")
|
||||
check(not ow.player.surfing, "no surfing sprite while the text is up")
|
||||
|
||||
top.onDone()
|
||||
check(ow.player.surfing == true, "surfing applies with the step")
|
||||
check(ow.stepped == "down", "the step onto the water fires")
|
||||
end
|
||||
|
||||
do
|
||||
-- warp.destination reroutes one door without owning the warp table
|
||||
local warpDef = Data.maps.PALLET_TOWN.warps[1]
|
||||
|
||||
Reference in New Issue
Block a user