Port MAIL in the party menu and the PC's MAIL BOX
Giving MAIL opens the mail entry: two lines of up to sixteen characters, kept with the player's name and ID, the holder's species and the MAIL. The party submenu's MAIL reads the letter or takes it, either to the PC's MAILBOX (ten at most) or into the pack without its message. The player's PC lists the MAILBOX by author to read, put in the pack or attach, and Bill's PC keeps a Pokémon holding MAIL out of the boxes. Saves keep each holder's MAIL and the MAILBOX. The letter shows its message and author natively; the stationery's graphics are not drawn yet. Closes #27 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e2dc5ba520
commit
5c1ac9d726
17 files changed
+871
-54
No files matched your search
@@ -3,6 +3,7 @@ import { decompress } from "./lz";
|
||||
import {
|
||||
BATTLE,
|
||||
INTRO,
|
||||
MENU,
|
||||
NUM_ITEMS,
|
||||
NUM_POKEMON,
|
||||
NUM_TRAINER_CLASSES,
|
||||
@@ -161,6 +162,13 @@ export class PokemonData {
|
||||
this.checkItem(item);
|
||||
return this.reader.word(SYMBOLS.itemAttributes + (item - 1) * 7);
|
||||
}
|
||||
/** ItemIsMail: whether MailItems lists the item. */
|
||||
itemIsMail(item: number): boolean {
|
||||
const r = this.reader;
|
||||
for (let p = MENU.MailItems; r.byte(p) !== 0xff; p++)
|
||||
if (r.byte(p) === item) return true;
|
||||
return false;
|
||||
}
|
||||
/** ItemAttributes permissions, bit 7 (CANT_TOSS_F): mostly key items and
|
||||
* TMs/HMs, checked by _CheckTossableItem before a mart buys one back. */
|
||||
itemUnsellable(item: number): boolean {
|
||||
|
||||
@@ -443,6 +443,15 @@ export const PC = {
|
||||
"TossItemFromPC.ItemsDiscardedText": 0x12a4f,
|
||||
"TossItemFromPC.ItemsTooImportantText": 0x12a5b,
|
||||
"_PlayerMailBoxMenu.EmptyMailboxText": 0x447b4,
|
||||
"MailboxPC.SubMenuData": 0x4496c,
|
||||
"MailboxPC.MailClearedPutAwayText": 0x448ac,
|
||||
"MailboxPC.MailPackFullText": 0x448b1,
|
||||
"MailboxPC.MailMessageLostText": 0x448b6,
|
||||
"MailboxPC.MailAlreadyHoldingItemText": 0x4493c,
|
||||
"MailboxPC.MailEggText": 0x44941,
|
||||
"MailboxPC.MailMovedFromBoxText": 0x44946,
|
||||
PCString_RemoveMail: 0xe3544,
|
||||
"ScrollingMenu_UpdateDisplay.CancelString": 0x2485f,
|
||||
"_BillsPC.PCGottaHavePokemonText": 0xe417,
|
||||
"_BillsPC.PCWhatText": 0xe43a,
|
||||
"_BillsPC.strings": 0xe47f,
|
||||
@@ -509,6 +518,13 @@ export const MENU = {
|
||||
PokemonTookItemText: 0x12cc8,
|
||||
PokemonAskSwapItemText: 0x12ccd,
|
||||
ItemCantHeldText: 0x12cd2,
|
||||
"MonMailAction.MenuData": 0x12dd1,
|
||||
"MonMailAction.MailLoseMessageText": 0x12de2,
|
||||
"MonMailAction.MailDetachedText": 0x12de7,
|
||||
"MonMailAction.MailNoSpaceText": 0x12dec,
|
||||
"MonMailAction.MailAskSendToPCText": 0x12df1,
|
||||
"MonMailAction.MailboxFullText": 0x12df6,
|
||||
"MonMailAction.MailSentToPCText": 0x12dfb,
|
||||
"GiveItem.AnEggCantHoldAnItemText": 0x1048d,
|
||||
"MenuHeader_UsableKeyItem.MenuData": 0x10251,
|
||||
"MenuHeader_UsableItem.MenuData": 0x1027c,
|
||||
|
||||
Reference in new issue
Block a user