Breed at the Day-Care, hatch Eggs, draw MAIL stationery and browse the Hall of Fame (Closes #29)

- Day-Care and breeding: deposits, withdrawal pricing and growth,
  compatibility, egg species, DVs and moves, DayCareStep, egg
  collection and the Odd Egg, compared with the cartridge's routines.
- CountStep: walking happiness, DoEggStep, DayCareStep and DoBikeStep
  in the original's order; HatchEggs with the ROM's hatch animation,
  compared frame by frame with the original.
- MAIL: all ten stationery types and the Portrait MAIL picture,
  compared with the cartridge's tilemaps, graphics and palettes.
- Printing: Bill's PC boxes, Pokedex PRNT, MAIL and the Photo Studio
  take the original's absent-printer path.
- Hall of Fame records (saved apart from the League flag, ready for the
  League to call) and the Hall of Fame PC, compared with the cartridge's
  _HallOfFamePC on 255 pages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
kawaandClaude Opus 5.5 committed 2026-10-17 08:52:30 +02:00
1 parent 7d03f5c5ca
commit e49bc6de9a
49 files changed
+6028 -88

No files matched your search

+20 -10
View File
@@ -3,7 +3,9 @@ import { SOUND } from "../audio/constants";
import type { RomReader } from "../rom/reader";
import type { PokemonData } from "../rom/pokemon";
import { ENGINE_FLAGS, MENU, PC, RAM } from "../rom/profile";
import { copyMail } from "../party/mail";
import { hallOfFamePC } from "./hall-of-fame";
import { readMail } from "./mail";
import { printerDisconnected } from "./printer";
import { receiveItem, removeFromSlot, type ItemSlot } from "../party/bag";
import {
BOX_NAME_PATTERN,
@@ -47,6 +49,7 @@ export interface PcHost {
const PCPCITEM_PLAYERS_PC = 0,
PCPCITEM_BILLS_PC = 1,
PCPCITEM_OAKS_PC = 2,
PCPCITEM_HALL_OF_FAME = 3,
PCPCITEM_TURN_OFF = 4;
/** _PlayersPC's menu items (PLAYERSPCITEM_*). */
const PLAYERSPCITEM_WITHDRAW_ITEM = 0,
@@ -154,9 +157,11 @@ export class PcSession {
const whose = this.pages(PC.PokecenterPCWhoseText);
let cursor = 0;
for (;;) {
// .ChooseWhichPCListToUse: PCPC_BEFORE_POKEDEX or PCPC_BEFORE_HOF.
// No Hall of Fame entry exists before the League is ported.
const set = this.state.flags.has(ENGINE_FLAGS.pokedex) ? 1 : 0;
// .ChooseWhichPCListToUse: PCPC_BEFORE_POKEDEX, PCPC_BEFORE_HOF, or
// PCPC_POSTGAME once wHallOfFameCount (not the League flag) is set.
const set = this.state.flags.has(ENGINE_FLAGS.pokedex)
? this.state.hallOfFameCount ? 2 : 1
: 0;
const items = this.indexSet(PC["PokemonCenterPC.WhichPC"], set);
const choice = yield* this.menu(
whose,
@@ -185,11 +190,19 @@ export class PcSession {
yield* this.print(PC.PokecenterOaksPCText);
yield* this.oaksPC();
break;
case PCPCITEM_HALL_OF_FAME:
yield* hallOfFamePC(
this.host.data,
this.state.hallOfFameTeams,
this.state.options.textboxFrame,
this.host.sound,
);
break;
case PCPCITEM_TURN_OFF:
yield* this.print(PC.PokecenterPCOaksClosedText);
return;
default:
throw new Error("The Hall of Fame PC is not ported.");
throw new Error("Unknown Pokémon Center PC entry.");
}
}
}
@@ -261,7 +274,7 @@ export class PcSession {
if (index < 0 || index >= mailbox.length) return;
cursor = index;
const action = yield* this.menu([], actions);
if (action === 0) yield { kind: "mail", mail: copyMail(mailbox[index]) };
if (action === 0) yield* readMail(this.host.data, mailbox[index], this.state.options.textboxFrame);
else if (action === 1) yield* this.putMailInPack(index);
else if (action === 2) yield* this.attachMail(index);
}
@@ -824,10 +837,7 @@ export class PcSession {
this.string(PC["BillsPC_PlaceEmptyBoxString_SFX.NoMonString"]),
);
else
yield {
kind: "notice",
text: "Printing needs a Game Boy Printer, which is not supported.",
};
yield* printerDisconnected(this.host.reader, this.state.options.textboxFrame);
}
}
}