so many bugs i cannot even breathe

This commit is contained in:
bryanthaboi
2026-07-30 07:41:41 -04:00
parent e63fa70700
commit 0f581e2f69
78 changed files with 7729 additions and 523 deletions
+5 -3
View File
@@ -305,9 +305,11 @@ local function useOn(game, battle, id, target, list, moveIndex, picker)
-- HP medicine: fill the bar in the still-open picker first, then print
-- and close, the order item_effects.asm .doneHealing runs in
-- (SFX_HEAL_HP -> UpdateHPBar2 -> RedrawPartyMenu prints the message).
-- picker is nil for every other item and for in-battle use, which keeps
-- the pop-then-print path below. #252
if picker and extra and extra.healedFrom and target then
-- Only a keepOpen picker is still on the stack to animate: every other
-- item, and every in-battle use, popped it in PartyMenu before onSwitch,
-- and takes the pop-then-print path below -- which is the path that
-- spends the battle turn. #252, #379
if picker and picker.keepOpen and extra and extra.healedFrom and target then
picker:animateTo(target, extra.healedFrom, function()
showMessages(game, payload, closePicker)
end)
+4 -1
View File
@@ -486,7 +486,10 @@ end
function OakSpeech:advance()
self.step = self.step + 1
self.picFlip = false
-- picFlip belongs to the pic, not to the step: OakSpeechText2 prints 2A
-- and 2B over one flipped NIDORINO with no redraw between them
-- (oak_speech.asm:80-83), so a pic-less step must not un-mirror what is
-- still on screen; only applyPic and the demo step may change it (#397)
local steps = self.steps
if not steps then
-- enter() builds steps; keep a path for callers that advance early
+24 -15
View File
@@ -351,18 +351,23 @@ function PartyMenu:update(dt)
end })
return
elseif action == "flash" then -- FLASH lights dark tunnels
-- start_sub_menus.asm .flash: PrintText _FlashLightsAreaText, then
-- GBPalWhiteOutWithDelay3 + jp .goBackToMap
-- start_sub_menus.asm .flash: PrintText _FlashLightsAreaText runs
-- with the party menu still on screen, and only then
-- GBPalWhiteOutWithDelay3 + jp .goBackToMap. So the message reads
-- over the menu, and the cave is lit when the blink hands the
-- screen back, never under the text (#385).
local ow = self.game.overworld
local TextBox = require("src.render.TextBox")
local Transition = require("src.render.Transition")
self.game.stack:pop()
ow.dark = false
self.game.save.flashLit = true
self.game.stack:push(TextBox.new(self.game,
self.game.data.text._FlashLightsAreaText
or Strings("A blinding FLASH\nlights the area!"), function()
self.game.stack:push(Transition.whiteFlash(self.game))
self:close()
-- setDark, not a bare field write: ADVANCED carries the darkness
-- in a baked atlas, so lighting the cave rebuilds it (#383)
self.game.stack:push(Transition.whiteFlash(self.game, nil,
function() ow:setDark(false) end))
end))
return
elseif action == "surf" then
@@ -377,9 +382,11 @@ function PartyMenu:update(dt)
local reason = ow:useSurfFieldMove()
local Transition = require("src.render.Transition")
if reason == "ok" then
self.game.stack:pop() -- close the party menu (jp .goBackToMap)
-- UseItem prints _SurfingGotOnText with the party menu still up;
-- GBPalWhiteOutWithDelay3 + jp .goBackToMap only follow it, so
-- trySurf closes this menu when its text does (#385)
local fx, fy = ow.player:facingCell()
ow:trySurf(fx, fy)
ow:trySurf(fx, fy, function() self:close() end)
return
end
if reason == "dismount" then
@@ -410,9 +417,10 @@ function PartyMenu:update(dt)
-- .cannotStopSurfing prints _SurfingNoPlaceToGetOffText but
-- never zeroes wActionResultOrTookBattleTurn, so unlike the
-- other refusals the menu still closes afterwards
-- (GBPalWhiteOutWithDelay3 + .goBackToMap)
self.game.stack:pop()
-- (GBPalWhiteOutWithDelay3 + .goBackToMap), and the text prints
-- over the still-open menu like every other .loop refusal (#385)
self.game.stack:push(TextBox.new(self.game, txt, function()
self:close()
self.game.stack:push(Transition.whiteFlash(self.game))
end))
return
@@ -454,18 +462,19 @@ function PartyMenu:update(dt)
local Transition = require("src.render.Transition")
local def = self.game.data.pokemon[mon.species]
local name = mon.nickname or def.name
self.game.stack:pop() -- close the party menu (jp .goBackToMap)
ow.strengthActive = true
local t1 = (self.game.data.text._UsedStrengthText
or Strings("{RAM:wNameBuffer} used\nSTRENGTH.")):gsub("{RAM:wNameBuffer}", name)
local t2 = (self.game.data.text._CanMoveBouldersText
or Strings("{RAM:wNameBuffer} can\nmove boulders.")):gsub("{RAM:wNameBuffer}", name)
-- like surf (#320): the blink belongs UNDER the texts, not as a
-- flashbang on the empty map after them; the stack only updates
-- the top state, so the flash holds until the texts close
self.game.stack:push(Transition.whiteFlash(self.game))
-- like surf (#320, #385): both texts print with the party menu
-- still on screen, and the blink IS the menu closing afterwards,
-- not a flashbang on the empty map
self.game.stack:push(TextBox.new(self.game, t1, function()
self.game.stack:push(TextBox.new(self.game, t2))
self.game.stack:push(TextBox.new(self.game, t2, function()
self:close()
self.game.stack:push(Transition.whiteFlash(self.game))
end))
end, { auto = { sound = function()
return require("src.core.Sound").playCry(self.game.data, mon.species)
end } }))
+14 -9
View File
@@ -22,13 +22,17 @@ TitleState.isOpaque = true
-- LOGO2 blue / LOGO1 red (issue #133). A trailing trueColor zone leaves the
-- overlay's DMG black unshaded while the logo and title mon keep title pals.
--
-- ROM SuperPal whites are often {255,239,255}. Under RED++, LOGO2/MEWMON
-- come from the GBC pack (pure white) while Blue's LOGO1 stays on the ROM
-- pack (#128), so the version-ribbon row reads as a pink band. Force that
-- slot to pure white; ink colors (Blue/Red "Version" text) stay intact.
local function withPureWhite(pal)
-- Every title SuperPal shares color 0 on hardware (sgb_palettes.asm: LOGO1,
-- LOGO2 and MEWMON all start RGB 31,29,31), so the ribbon band's white has to
-- be the neighbouring zones' white. Under RED++, LOGO2/MEWMON come from the
-- GBC pack (pure white) while Blue's LOGO1 stays on the ROM pack (#128) and
-- the row reads as a pink band; taking LOGO2's white fixes that without
-- forcing pure white in SGB, where a brighter band drew two faint lines
-- across the title (#373). Ink colors (Blue/Red "Version" text) stay intact.
local function withWhiteOf(pal, ref)
if not pal then return nil end
return { { 255, 255, 255 }, pal[2], pal[3], pal[4] }
if not (ref and ref[1]) then return pal end
return { ref[1], pal[2], pal[3], pal[4] }
end
function TitleState:sgbPalettes(game)
@@ -46,9 +50,10 @@ function TitleState:sgbPalettes(game)
P.zone(logoPal, 9, 8, 10, 8),
}
else
local logoPal = P.pal(game.data, "LOGO2")
z = {
P.zone(P.pal(game.data, "LOGO2"), 0, 0, 19, 7),
P.zone(withPureWhite(P.pal(game.data, "LOGO1")), 0, 8, 19, 9),
P.zone(logoPal, 0, 0, 19, 7),
P.zone(withWhiteOf(P.pal(game.data, "LOGO1"), logoPal), 0, 8, 19, 9),
P.zone(P.pal(game.data, "MEWMON"), 0, 10, 19, 17),
}
end
@@ -427,7 +432,7 @@ end
-- the version ribbon at (7,8), Red's title art as OAM at px (82,80),
-- the title mon in the 7x7 box at tile (5,10), copyright on row 17.
-- Yellow (title_yellow.asm): logo (2,1), speech bubble (6,4), Pikachu
-- (4,8) 12x9 no version ribbon, no cycling mon, no Red OAM.
-- (4,8) 12x9 -- no version ribbon, no cycling mon, no Red OAM.
function TitleState:draw()
love.graphics.setColor(1, 1, 1, 1)
love.graphics.rectangle("fill", 0, 0, 160, 144)