# Conflicts:
#	data/scripts/story4.lua
#	src/ui/DexEntryMenu.lua
#	tests/drivers/fighting_dojo_bug197_test.lua
This commit is contained in:
bryanthaboi
2026-08-05 14:43:05 -04:00
7 changed files with 143 additions and 50 deletions
+9 -18
View File
@@ -164,13 +164,18 @@ local function dojoBall(species, ownBall, otherBall, askKey)
push(game, "You'll have to\nbeat the master\nfirst!", done)
return
end
local function offer()
-- Examining a ball shows that species' POKéDEX entry first
-- (DisplayPokedex in FightingDojo.asm, which also marks it seen),
-- then the yes/no take-it prompt (#853).
local Commands = require("src.script.Commands")
local ctx = { save = game.save, game = game, overworld = ow }
Commands.mark_seen(ctx, species)
local DexEntryMenu = require("src.ui.DexEntryMenu")
game.stack:push(DexEntryMenu.new(game, species, function()
ask(game, t[askKey] or ("You want\n" .. species .. "?"), function(yes)
if not yes then done() return end
flags["EVENT_GOT_" .. species] = true
flags.EVENT_DEFEATED_FIGHTING_DOJO = true
local Commands = require("src.script.Commands")
local ctx = { save = game.save, game = game, overworld = ow }
Commands.give_pokemon(ctx, species, 30)
-- Hide ONLY the chosen ball; the other stays (FightingDojo.asm hides
-- just the picked object's index) and routes to the greedy line above
@@ -178,21 +183,7 @@ local function dojoBall(species, ownBall, otherBall, askKey)
Commands.hide_object(ctx, "FIGHTING_DOJO", ownBall)
push(game, ("%s got\n%s!"):format(game.save.player.name, species), done)
end)
end
-- FightingDojoHitmonleePokeBallText / ...HitmonchanPokeBallText run
-- `ld a, HITMONLEE / call DisplayPokedex` BEFORE .Text and YesNoChoice,
-- so the ball opens the prize's dex page first and the offer follows
-- it. _DisplayPokedex (engine/events/display_pokedex.asm) sets only
-- the SEEN bit, so the page stays the name-and-sprite preview until
-- the mon is owned, the same shape as the Fuchsia exhibit signs in
-- data/scripts/flavor/fuchsia_city.lua (#853).
local dex = game.save.pokedex
if dex then
dex.seen = dex.seen or {}
dex.seen[species] = true
end
require("src.ui.Screens").push(game, "DexEntryMenu",
{ species = species, onClose = offer })
end))
end
end