Trainers.info gave a trainer the player's chosen rival name only when its
class was called "RIVAL". A mod that translates the class (RIVALE in
German and Italian) made the rival battle as the ROM's placeholder TERRY,
and the champion, whose class is CHAMPION, was always TERRY. pret's
B_TXT_TRAINER1_NAME names TRAINER_CLASS_RIVAL_EARLY, _RIVAL_LATE and
_CHAMPION by the rival's name (pokefirered/src/battle_message.c:2078);
Trainers.info now does the same, by class id.
Three screens that show a single mon still drew an egg as the species it
will hatch into, and printed its stored nickname untranslated:
- The PC's hovered-mon panel drew the hatch species' front pic, the stored
"EGG" nickname, "/PICHU", gender, level and held item. pret draws the
SPECIES_OR_EGG pic and, for an egg, prints only gText_EggNickname with the
other lines blank (pokemon_storage_system_data.c:1034, :1091).
- The summary's egg page drew the hatch species' front pic, where pret uses
SPECIES_OR_EGG (pokemon_summary_screen.c:4016). It also recognised an egg by
mon.isEgg alone; it now uses Pokemon.isEgg like the rest of the engine.
- The trade scene drew a traded egg as its species and named it by the stored
nickname (trade_scene.c:757, :1239).
The script string buffers (BufferMonNickname and the other nicknameOf
helpers) now also give the language's EGG for an egg, as GetMonData
(MON_DATA_NICKNAME) does (pokemon.c:3020).
The party, the PC boxes and the release animation drew an egg with the icon
of the species it will hatch into, so a Pichu egg showed as a Pichu. pret's
party menu picks the icon from GetMonData(MON_DATA_SPECIES_OR_EGG), which is
SPECIES_EGG for any egg (pokefirered/src/pokemon.c:3245, party_menu.c:2655).
Pokemon.speciesOrEgg does the same, and the icon call sites use it. The
species pass only extracted icons up to NUM_SPECIES - 1, so the egg extractor
now also bakes gMonIconTable[SPECIES_EGG] as pokemon/icons/412.rgba. Cache
version 114 re-imports existing caches so the icon appears.
Party.giveMon stores "EGG" as a new egg's nickname (party.lua for a
gift egg, breeding.lua for the Day-Care's), and the party slots and the
other screens that name a mon through Pokemon.displayName and
displayMonName print that nickname as it is. A translated game therefore
listed its eggs as EGG, while the summary, which prints Strings("EGG")
for an egg, already said OEUF, EI, HUEVO or UOVO.
The cart does not rely on the stored nickname either: its Day-Care
writes the Japanese タマゴ there (daycare.c:1100), and GetMonData
returns gText_EggNickname for any egg's nickname (pokemon.c:3020). Do the
same in both name helpers: an egg reads as Strings("EGG"), whatever its
nickname holds, which also covers the eggs saves already carry. A
hatched egg, whose nickname is cleared, goes back to its species name.
The rest of the Gen 3 review fixes, each with a gated suite in tests/engine/.
ROM semantics were checked against pret/pokefirered.
Scripts
- givemon carried the wrong operand layout, found earlier; four more layout
desyncs came out of pret asm/macros/event.inc: comparestat is {byte,word},
and setptr / loadbytefromptr / setptrbyte each carry a leading byte plus a
word. A wrong size mis-decodes every instruction after the bad one, so
Versions.CACHE_VERSION moves to 113 and existing caches re-import.
- handlers for previously handler-less verbs: comparestat,
bufferitemnameplural, setmonmove, setmonmetlocation, the modern
fateful-encounter pair, the script-locals family (copylocal, setptr,
loadbytefromptr, setptrbyte, copybyte, compare_local_to_* and
compare_ptr_to_*), the RAM-script family (setvaddress, vgoto, vcall,
vgoto_if, vcall_if, vmessage, vbuffermessage, vbufferstring, endram,
returnram) and the same-map forms of the *at verbs.
- setdooropen / setdoorclosed read their coordinates through VarGet.
Battles
- Knock Off and Thief / Trick persist the item change instead of only
touching the in-battle copy.
- knocked-off party slots are tracked in a bitmask, so a slot reused later
does not inherit the flag.
Field and UI
- Player.reset restores facing and clears the surf flags.
- a definition-less Map.load no longer leaves collision unbound.
- an unresolved region-map section no longer reports PALLET TOWN.
- the naming screen splits input from the timer, so update(dt) stops
indexing a number.
- the hall of fame commits through the engine save path and serializes its
fields.
Persistence
- gameStats, the link-battle records and the trainer card are serialized.
- the PC deposit refuses at the 999 cap instead of destroying the overflow.
Robustness
- Data.load runs cached modules sandboxed.
- the file browser quotes shell arguments.
- .meta dimensions are bounds-checked and mids.idx validates its header.
- Save Editor: Implement full Gen 3 FireRed save editing including PID/personality, IVs/EVs, natures, ability slots, gender, shiny toggles, held items, Pokédex flags, and event/trainer toggles.
- Scripting & Specials: Add Pokédex rating evaluations, Magikarp/Heracross size records, Trainer Fan Club tracking, and FireRed event flag mappings.
- Overworld & Rendering: Interleave metatile and actor draw calls by row bucket with OAM elevation priority sorting for bridges and overhead layers.
- ROM Extractor: Parallelize Gen 3 extraction across 4 concurrent love.thread workers with love.filesystem searchers for cross-platform support (Switch/Xbox/Mobile/Desktop).
- LZ77 Decompressor: Accelerate GBA LZ77 with preallocated FFI buffers and 0-based displacement indexing ensuring 100% byte-for-byte asset parity.
- Testing: Add unit test suites for LZ77, size records, Pokédex rating, Fan Club, elevation priority, Seafoam puzzles, and Gen 3 save editor operations.
Only src/import/gba/versions.lua conflicted, and not on the value: both
branches had independently taken CACHE_VERSION 111 for unrelated cache
layouts. dev's 111 is the hidden-item bitfield fix in
extract_map_events.lua (id % 256, qty % 128); this branch's 111 is the new
deoxys_rock_fragments field effect. Sharing one number would let a cache
stamped by dev be treated as fresh, silently dropping the meteorite
shatter artwork, so the Deoxys artwork moves to 112.
src/core/game3/field_view.lua auto-merged: dev's Doors.draw viewport
arguments and this branch's bg_flash veil do not overlap.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Two Birth Island visuals were broken; both are now verified on screen.
1. The meteorite never reddened as the triangle puzzle progressed.
OwSprites.recolour_sprite called Image:newImageData, which LOVE 11 does
not have, so the pcall always failed and setObjectPalette silently
returned false for all ten steps. Keep the ImageData the sheet was
decoded from in load_one and clone() it before mapPixel (which mutates
in place); the override copy keeps its imageData in step too.
2. The shatter happened, but the shards were invisible. The flash was a
whole-screen Renderer.screenVeil painted after the composite, and the
shards only live ~8 frames, so they were drawn underneath it. pret
(field_effect.c:3946) blends PALETTES_BG only -- BlendPalettes plus
BeginNormalPaletteFade -- so the OBJ shards, which share the
meteorite's palette tag 4371, keep their colours against a white map.
Replace startWhiteFlash with startBgFlash, drawn by FieldView.draw
between the last map layer and the actors. Also match pret's shake
cadence (flip every second frame) and its `++tTimer > 120` test.
Adds tests/drivers/game3_deoxys_visual.lua, which walks all eleven puzzle
positions, shatters the rock, and counts shard-coloured pixels in the
saved frames: 492 px at the shatter frame, 192 px a few frames later
(0 before this fix).
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Two Birth Island visuals were missing against pokefirered.
The rock never reddened as the puzzle progressed. pret loads
sDeoxysObjectPals[num] into the rock's OBJ palette (field_specials.c:2398);
the engine can only substitute colours into the already-baked sprite, and the
ramp it matched against held the .pal ASCII values (32/82/139) while the ROM
bakes 33/82/140, so almost every pixel missed the lookup. ROCK_PALS now holds
the 8-bit expansion of the ROM ramp at 0x3F6206 (verified byte-exact against
all 11 palettes), sourcePalette() supplies the pristine colours the meteorite
is baked with, and recolour_sprite falls back to the nearest source colour
within a small tolerance so a one-unit rounding difference can never silently
kill the swap again. A swap that matches nothing now returns nil and says so.
The rock vanished instead of shattering. FLDEFF_DESTROY_DEOXYS_ROCK already
ran the camera shake and thunder, but the fragment stage had no artwork and
moved the shards wrongly. Added the four 8x8 tiles from ROM 0x3CBDB0 with
palette 0x3F6346 (ramp step 10, the awakened red pret inherits from the rock);
decoding them through the field-effect extractor reproduces the original
graphics exactly, so no nibble handling was needed. The shards now all spawn
at the rock's own corner and travel +/-16 x / +/-12 y per frame with no
gravity (field_effect.c:3993), dropping out once they leave the viewport, while
the shake decays from amplitude 4 and the rock is removed.
Cache version 111 forces existing caches to re-import so the new sheet appears.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Ports pokefirered's Birth Island Deoxys puzzle and its battle in full.
Puzzle (src/core/game3/deoxys.lua), from src/field_specials.c:2319-2456:
- Task_DoDeoxysTriangleInteraction with the 11 rock positions, the 10
per-step caps and the pre-reset step-counter read that pret uses.
- IncrementBirthIslandRockStepCount wired into StepEvents.onStepTaken.
- MoveDeoxysObject / SetDeoxysTrianglePalette palette swaps, realised via
a new OwSprites.setObjectPalette colour substitution because palettes
are baked to RGBA at extract time.
- FLDEFF_MOVE_DEOXYS_ROCK (67) and FLDEFF_DESTROY_DEOXYS_ROCK (68), plus
setfieldeffectargument plumbing and the rock-move lerp / rock-shatter
field effects.
- DoDeoxysTriangleInteraction = 0x1AB added to Std.SPECIAL, with real
handlers for it and SetDeoxysTrianglePalette.
Battle: seteventmon SPECIES_DEOXYS, 30 expands to CreateEnemyEventMon,
which the engine already implements, so the encounter flows through
Encounters._pendingWild into StartLegendaryBattle. No new code needed
there; tests now pin the whole chain.
Fixes the Deoxys battle theme. Both battle-BGM sites gated on species
386, but FRLG's SPECIES_DEOXYS is 410 (species.h:419) and 386 is
SPECIES_VOLBEAT (species.h:395), so Deoxys silently fell through to the
generic wild theme. Extracted Audio.legendaryBattleSong as the single
source of truth, keyed by the FRLG internal species id, matching the
switch in src/battle_setup.c:349.
Verification: 24/24 Deoxys groups, game3_special_events_test,
engine tier 593/593, luacheck 0/0 in 970 files, plus the hand-run
game3 battle/field-effect/object/step suites.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Four of the 22 Easy Chat groups carry no text of their own: POKéMON,
POKéMON (NAT), MOVE 1 and MOVE 2 are lists of species and move ids, and
pret prints them through gSpeciesNames and gMoveNames. The extractor
resolves them the same way, so easy_chat_data.lua ended up holding 807
copies of names the dataset already has -- copies that go stale the
moment anything renames a species or a move. A mod that renames them,
a translation filling the species_names and move_names catalogs first
of all, changed every screen but this one: the picker still offered
the cart's English names, and the profile read back in them.
Resolve those two kinds of word at draw time instead, against the same
Pokemon.name / Pokemon.moveName the party screen and the Pokédex use.
When the dataset has no entry for an id it answers with a placeholder
("POKéMON 063", "-------"), which is worse than the word the cart
shipped, so that case keeps the extracted text. An entry that names
the group ("easyChat.POKéMON|PIKACHU") still wins over both, since a
species name may need a wording other screens do not use. A bare-key
entry does not: bare keys are shared with menu labels this engine
already translates (CUT, FLASH, STRENGTH), and one of those should not
decide what a move is called here.
tools/modkit.py keeps emitting those 807 rows, since the species and
move catalogs it writes come from the Gen 1 dataset and do not list a
Hoenn species or a Gen 3 move; its note now says an empty entry shows
the game's own name, so a translator only fills the ones nothing else
renames.
The Easy Chat screen picks its words from src/core/game3/easy_chat_data.lua, the ROM's own word tables as the extractor writes them: 1,813 English words across 22 groups, plus the group names the picker lists. It drew them straight from that table, so every word the player composes with stayed English, and the screen's own prompts -- routed through Strings() already -- sat in a frame of untranslated vocabulary.
src/core/game3/easy_chat_text.lua is the seam. The data module stays exactly what the extractor produced, because it is regenerated from the ROM and anything written into it would be lost on the next import; the words are translated where they are drawn instead, the same split the rest of game3 uses for extracted text. Five sites go through it: the group list, its header, the word list, the word sitting in a slot, and the saved profile a message box prints (ShowEasyChatMessage). The ids the save file stores are untouched.
Each word carries its group's context ("easyChat.FEELINGS"), because the same English word means different things in different groups and 155 of them collide with labels this engine already translates elsewhere (ATTACK, BAG, CANCEL, BACK...). Strings() falls back to the plain key, so a catalog that does not need the distinction lands with one entry -- with the consequence that a mod which already translates BAG for the menus now sees that wording in the Easy Chat list too, until it adds a context-specific entry.
A seam nothing can discover is not much use: tools/modkit.py's catalog generator emits these keys too. The literal harvester cannot see them (the picker looks each word up at draw time, not at a Strings("...") call site), so the dataset dump walks EasyChatData.GROUPS and writes 1,835 rows into lang/strings.lua, where a translator finds them beside the rest of the engine text.
Each word is clipped to the box it sits in: in the picker, the red selection rectangle; in the phrase frame, the slot's own frame. The cart's words fit those boxes (72 px at most); a longer translation is cut at the box edge instead of running past the highlight, into the next slot's cursor, or off screen. Group names get the room up to the scroll arrows instead, because an official translation already needs more than the rectangle: the French cart's VIE QUOTIDIEN. is 83 px.
tests/engine/game3_easy_chat_text_test.lua covers the context lookup, the fallback to a plain key, the untouched English with no catalog, and that the extracted data itself is never rewritten. It lives in tests/engine so the T1/T2 tier actually runs it.
1. The Cerulean City Policeman remained in front of the burgled house at `(30, 12)` even after receiving the S.S. Ticket from Bill.
2. Bill remained standing inside the cell separator teleporter door at `(3, 3)` upon returning to Sea Cottage after helping him.
- State.new and Battle.start now default the initial active battler slot to the first usable (non-egg, HP > 0) Pokémon in the party instead of unconditionally selecting slot 1.
- In double battles, slots 0 and 2 correctly select the first and second conscious Pokémon.
- Add regression test in tests/game3_battle_fainted_lead_test.lua verifying single, double, and party-order behavior when the lead slot is fainted.
- Doors:
- Fix Viridian City Gym and Dojo warp doors registering as wooden house doors; map metatile 0x15B to SlidingDouble animation and SE_SLIDING_DOOR (18).
- Embed full FRLG metatile fallback lookup table and support CacheFs/Dataset.cache() for door textures and manifests.
- Scripting & Movement (Fixes#2356):
- Add support for jump movement opcodes (jump_2_down, jump_in_place, etc.) for both player and NPC objects.
- Implement scriptJump routines updating cell coords and triggering jump trajectory animations.
- CacheFS & GBA ROM Extraction:
- Wire CacheFS persistence across storage, region map, battle AI/moves, items, pokedex chrome, multichoice, and easy chat extractors for Android portability.
- Fix box storage chrome extraction palette/shadow colors and duplicate label bug.
- Add region map chrome extraction and interactive Town Map rendering.
- Performance & Android Optimization:
- Eliminate dynamic per-frame require/pcall lookups in battle render/update loops.
- Pre-allocate particle sort comparator in AnimVm to avoid per-frame closures.
- Cache palette shader uniform uploads and blend state in AnimPal/AnimVm.
- Pool scratch color tables in FrlgFont to remove garbage generation during text token scanning.
- Harden audio FFI caching and m4a worker initialization for sandboxed environments.
- Tests:
- Add test suites for Viridian Gym doors, jump opcodes, storage chrome, and town map caching.
fixes#2356fixes#2357
The SBC and RG34XXSP ports hand LÖVE a source *directory*
(`love <dir>`), so `love.filesystem.isFused()` is false there and
`Boot.run` bailed on its first line. The launcher still offered
"Update vX.Y.Z" and "Restart to update", so an update downloaded,
verified, and then was silently ignored forever.
- Boot.canUpdateInPlace() replaces the fused-only gate: a packaged
build updates whether it is fused (AppImage, Flatpak game.love) or
unpacked, and only a dev / source checkout (engine "0.0.0-dev") is
excluded. Fails closed when the host cannot be established.
Prelaunch.updateAllowed now delegates to it, so the boot gate and the
`--update` gate cannot disagree.
- Check.hostPort() reads the release-target marker, with
POKEPORT_HANDHELD as a legacy fallback (the SBC launcher has always
exported it, so packs predating this change still identify
themselves). The marker was read from the environment but never
exported, so a full-package fallback on a handheld resolved to a
desktop AppImage that cannot run there.
- A handheld now fetches its own package ("Download port update",
reusing the worker's cross-platform download_full) instead of
offering a URL it has no browser to open, and reports "Update package
ready" once it is in the save directory for a manual re-extract.
- Launchers export POKEPORT_PORTMASTER / POKEPORT_RG34XXSP.
An in-place update only ever mounts a payload over the running source,
so relaxing the gate is less invasive than the fused path it joins.
A runtime bump still needs a full package, which the minShell gate
already reports as needs_full.
Tests: tests/engine/update_boot_host_gate.lua (new, 10 checks) pins the
gate; update_check_tests.lua pins both port asset names and hostPort().
scripts/test.sh --quick: all tiers passed; scripts/lint.sh: 0 errors.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The popup shown on entering an area takes its text from MapSectionsExtract.SECTIONS, the cart's English section names, with the floor suffix map_name_popup.c adds (" 3F", " B1F", " ROOFTOP") glued on in English. Nothing in a translation mod could reach either.
getInfo now also returns the name before the suffix (baseName), and the popup passes it through Strings() and translates the floor as a whole label ("3F", "B1F", "ROOFTOP"): the European carts number floors differently (3F is "2E" in French, "2S" in German), so a template around the number could not say it. The forest preview's name window (MapPreviewScreen), which shows the ROM's English section name, and the summary's met-location fallback go through Strings() too.
Species, move, item and trainer names reach a translation mod through registries, but nothing renames abilities: battle messages ("<POKéMON>'s <ability> prevents ...") and the summary page printed the ROM's English name whatever the language.
Abilities.name and the summary's ability line now pass the name through Strings(), keyed by the cart's English name ("SPEED BOOST", "COMPOUNDEYES"). The identifiers the battle code compares (SPEED_BOOST) and the description lookup are unchanged.
SummaryData looks a move or ability description up as MOVE_<name> / ABILITY_<name>, built from the name the summary shows. A translation mod renames moves in place (the moves registry writes Pokemon._moveNames), so with one enabled the key became MOVE_<translated name>, nothing matched, and the summary and TM Case showed "---" instead of the description.
Pokemon.install now keeps a copy of the ROM's English move and ability names before any mod patches them, exposed as Pokemon.romMoveName / romAbilityName, and the description lookups use it, falling back to the name passed in when the pack has none.
Strings() formats with string.format, which fills directives in argument order. A language that puts two values the other way round from English ("ATTACK de PIKACHU" for "PIKACHU's ATTACK") could not say so: the translation either kept the English order or swapped the values. The official FireRed, Gold and Red localizations reorder values like this in dozens of battle and menu lines.
A translation can now number its directives the way POSIX printf does ("%2$s de\n%1$s monte!"), and Strings() hands the arguments over in that order. Flags and widths are kept ("%3$03d") and "%%" stays a literal percent. A translation numbers all of its directives or none, and may only number arguments the source has; it may leave one out, as the official translations sometimes drop a name. Otherwise it falls back to the English source and logs one warning, like a translation with the wrong number of directives.
Sources never carry numbered directives, and a translation without them takes the same string.format path as before, so English and existing catalogs render the same text. A translation that still cannot format its arguments falls back to the English source formatted with them, instead of the raw template. An older engine given a numbered translation cannot format it and prints the template, so a catalog using numbered directives needs this engine.
Field move texts, item-use results, Pokédex and summary fallbacks, trainer class and send-out lines, step events (repel, whiteout, fainting), VS Seeker and multichoice labels were plain literals or string.format calls, so a translation mod could not reach them.
Messages built at call time now go through Strings() with whole-sentence templates. Tables built at module load keep English sources marked with Strings.source() and are translated when read: FieldMoves.TEXT through an __index proxy, the Oak's lab rival fallback dialogs when the trainer is built, and ItemsData.POCKET_LABEL by its caller. Nature names and ability/move descriptions are translated where the summary asks for them. Values the engine stores or compares (box names, identifiers, quest-log keys) are left as they are.
Every message the game3 battle engine prints was built by concatenating English fragments around names ("X" .. " is hurt\nby poison!"), so a translation mod could not reach them, nor phrase a sentence other than as English splits it. They are now whole-sentence Strings() templates with the names as arguments (Strings("%s is hurt\nby poison!", name)), which renders the same English and lets a catalog word the whole sentence around each value. The one visible change is that effect messages now name abilities through Abilities.name, as the cart prints them (COMPOUNDEYES, LIGHTNINGROD) rather than from the identifier (COMPOUND EYES). Values still fill the template in call order (Strings() formats with string.format).
Fragment tables become full templates: status infliction, charge-turn and semi-invulnerable moves, Truant, berry flavours, held-item and enemy-item cures, and the stat-change lines (one template per rose/sharply rose/fell/harshly fell instead of a translated verb glued after the stat). Tables built at load time mark their keys with Strings.source() and are translated where they are said, since no catalog exists yet when the module loads. Stat names, the Ally/Foe prefixes, weather lines and screen names are translated at the time they are shown; the "a boosted" EXP line and the trainer send-out line become one template per variant rather than a fragment passed as an argument.
Code that read the English text back is fixed too: the double-battle send-out (animated and headless intros) no longer parses the trainer out of the translated "sent out" line, the battle UI paces the move-used line by its catalog wording, and AnimSeq recognises the miss, confusion, substitute, move-used and fainted lines it paces animations on through their catalog wording.
Game and Game2 hand the merged mod data to Strings.load right after the mod merge, so a translation mod's strings registry is what Strings() answers from. Game3:_loadMods did not: on a FireRed boot Strings() kept the catalog the launcher preloaded, which is every enabled mod's lang/strings.lua whatever game it targets, with no defined precedence, and never a registration made from mod code. Call Strings.load(self.data) after the merge, as the other two games do.
- Hidden Items & Itemfinder (fixes#2314):
* Extract BG_EVENT_HIDDEN_ITEM (kind 7) from GBA ROM with proper flag calculation (0x3E8 + id), underfoot flags, and quantities.
* Implement overworld Itemfinder scan logic (7-tile radius, directional response, underfoot detection, SFX 65, and OEM text).
* Wire up Bag Menu Itemfinder dispatch to overworld field runtime.
- Opponent Battle HUD Caught Marker (fixes#2313):
* Add authentic Pokédex caught Poké Ball icon (B_INTERFACE_GFX_BALL_CAUGHT / tile 70) to opponent healthbox.
* Match pokefirered parity in TryAddPokeballIconToHealthbox (wild encounters only, non-tutorial, non-ghost, checked against Dex).
* Ensure status ailment icons (PSN, PAR, SLP, FRZ, BRN) take rendering priority over the caught ball marker.
- Level-Up Learnset & Movepool Assignment (fixes#2315):
* Fix wild and generated Pokémon moveset assignment to assign the 4 most recent level-up moves up to the current level instead of getting stuck on basic moves (e.g. Tackle).
- Easy Chat / Profile Quick Chat:
* Extract full word groups, categories, and dictionary entries from ROM.
* Build Easy Chat interface with group selection, paginated word lists, and alphabetized filtering.
* Fix dialog text overflowing when exiting profile / quick chat prompts.
- Nurse Joy & PC Storage / Map Polishing:
* Implement Nurse Joy healing tray animation flow and audio cues in standard scripts.
* Fix PC storage box header/wallpaper rendering and storage data extraction.
* Correct Sevii Islands / Island 1 map section lookups and region map coordinate handling.
* Fix circular dependency in battle residual handlers (partialTrap).
fixes#2325fixes#2322fixes#2315fixes#2314fixes#2313
The bag's party-select screen read session.party, which battle_bridge only
writes back when the battle ends. Mid-battle it therefore showed pre-battle
HP and refused heals that would in fact work ("It won't have any effect.").
- Add PartyView.live(session): flushes the active player battlers into
st.playerParty and returns it, falling back to session.party outside
battle.
- bag_menu: read the live party, and stop re-mapping the party slot. The
battleOrder wrapper in PartyMenu.show already yields a real slot, so the
second map healed the wrong mon.
- Extract the battle hand-off into BagMenu.battleUse and route the Berry
Pouch's USE through it. The pouch fell back to ItemUse.useField, which
also only knows session.party, so a berry was eaten with no effect.
- Add tests/game3_battle_item_party_test.lua (7 blocks).
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>