diff --git a/asm/macros/scrcmd.inc b/asm/macros/scrcmd.inc index 179013a933..01678ce813 100644 --- a/asm/macros/scrcmd.inc +++ b/asm/macros/scrcmd.inc @@ -2985,13 +2985,13 @@ StartEndSafariGame SAFARI_GAME_INACTIVE .endm - .macro ScrCmd_203 arg0, arg1, arg2, arg3, arg4 - .short SCRCMD_203 - .short \arg0 - .short \arg1 - .short \arg2 - .short \arg3 - .short \arg4 + .macro WarpToColosseum mapID, warpID, x, z, dir + .short SCRCMD_WARPTOCOLOSSEUM + .short \mapID + .short \warpID + .short \x + .short \z + .short \dir .endm .macro ScrCmd_204 @@ -3352,9 +3352,9 @@ .short \destVar .endm - .macro ScrCmd_239 arg0 - .short SCRCMD_239 - .short \arg0 + .macro OpenBattleRegulationMenu destVar + .short SCRCMD_OPENBATTLEREGULATIONMENU + .short \destVar .endm .macro GetPartyMonFootprintType hasPrintVar, printTypeVar, partySlot @@ -4035,14 +4035,14 @@ .short \item .endm - .macro ScrCmd_2A3 arg0 - .short SCRCMD_2A3 - .short \arg0 + .macro CheckHasWiFiListValidLogin destVar + .short SCRCMD_CHECKHASWIFILISTVALIDLOGIN + .short \destVar .endm - .macro ScrCmd_2A4 arg0 - .short SCRCMD_2A4 - .short \arg0 + .macro GetWiFListValidFriendsCount destVar + .short SCRCMD_GETWIFLISTVALIDFRIENDSCOUNT + .short \destVar .endm .macro OpenPartyMenuForTrade @@ -4744,9 +4744,9 @@ .short \species .endm - .macro ScrCmd_31D arg0 - .short SCRCMD_31D - .short \arg0 + .macro TryRevertPartyPokemonForms destVar + .short SCRCMD_TRYREVERTPARTYPOKEMONFORMS + .short \destVar .endm .macro TryRevertPokemonForm partySlot, destVar @@ -4772,9 +4772,9 @@ .short SCRCMD_FINISHDISTORTIONWORLDGIRATINASHADOWEVENT .endm - .macro ScrCmd_323 arg0 - .short SCRCMD_323 - .short \arg0 + .macro CheckNoWiFiPlazaCooldown destVar + .short SCRCMD_CHECKNOWIFIPLAZACOOLDOWN + .short \destVar .endm .macro GetBattleHallRecordKeeperStats curStreakIdx, passedMilestoneIdx, nextMilestoneIdx, earnedBPIdx, nextMilestone, response diff --git a/generated/text_banks.txt b/generated/text_banks.txt index 9019ff860a..67f64120ea 100644 --- a/generated/text_banks.txt +++ b/generated/text_banks.txt @@ -219,7 +219,7 @@ TEXT_BANK_CONTEST_COMMON TEXT_BANK_CONTEST_RESULTS TEXT_BANK_STATUS_CONDITION_NAMES TEXT_BANK_OPTIONS_MENU -TEXT_BANK_POKEMON_CENTER_2F_ATTENDANTS +TEXT_BANK_POKEMON_CENTER_2F_COMMON TEXT_BANK_OREBURGH_MINE_B1F TEXT_BANK_OREBURGH_MINE_B2F TEXT_BANK_VALLEY_WINDWORKS_OUTSIDE @@ -428,7 +428,7 @@ TEXT_BANK_DUMMY_0426 TEXT_BANK_GENERIC_NAMES TEXT_BANK_UNK_0428 TEXT_BANK_FOLLOWER_PARTNERS -TEXT_BANK_POKEMON_CENTER_B1F_ATTENDANTS +TEXT_BANK_POKEMON_CENTER_B1F_COMMON TEXT_BANK_RECORD_CHATOT_CRY TEXT_BANK_POFFIN_COMMON TEXT_BANK_LOCATION_NAMES diff --git a/generated/vars_flags.txt b/generated/vars_flags.txt index d39f4d2b14..0af7fedd0c 100644 --- a/generated/vars_flags.txt +++ b/generated/vars_flags.txt @@ -4192,7 +4192,7 @@ VAR_ROAMING_MESPRIT_STATE VAR_RESORT_VILLA_VISITOR_MESSAGE_NUM VAR_DISTORTION_WORLD_CYRUS_APPEARANCE VAR_WIFI_PLAZA_RETURN_WARP_ID -VAR_UNK_0x405D +VAR_WIFI_PLAZA_ATTENDANT_ID VAR_ROAMING_MOLTRES_STATE VAR_ROAMING_ZAPDOS_STATE VAR_ROAMING_ARTICUNO_STATE @@ -4227,7 +4227,7 @@ VAR_PASTORIA_STATE VAR_VEILSTONE_WAREHOUSE_GUARDS_FIGHTABLE VAR_SUNYSHORE_STATE VAR_SNOWPOINT_CITY_STATE -VAR_UNK_0x4080 +VAR_ENTERED_WIFI_PLAZA VAR_FIGHT_AREA_STATE VAR_UNK_0x4082 VAR_UNK_0x4083 @@ -4311,8 +4311,8 @@ VAR_HAS_SEEN_UNDERGROUND_ROARK_INTRO VAR_HAS_ENTERED_HEARTHOME_GYM_BEFORE VAR_UNK_0x40D2 VAR_LAKE_ACUITY_STATE -VAR_UNK_0x40D4 -VAR_UNK_0x40D5 +VAR_VISITED_POKEMON_CENTER_B1F +VAR_COMMUNICATION_LOAD_ACTION VAR_GALACTIC_HQ_4F_STATE VAR_PASTORIA_CITY_OBSERVATORY_GATE_1F_STATE VAR_BATTLE_TOWER_LOBBY_LOAD_ACTION diff --git a/include/battle_regulation.h b/include/battle_regulation.h index 6b505a94f9..648356ae9d 100644 --- a/include/battle_regulation.h +++ b/include/battle_regulation.h @@ -13,8 +13,8 @@ typedef struct BattleRegulation { u8 maxLevel; s8 heightRestriction; s8 weightRestriction; - u8 speciesRestriction : 1; - u8 itemRestriction : 1; + u8 evolutionRestriction : 1; + u8 specialSpeciesRestriction : 1; u8 speciesUniqueness : 1; u8 itemUniqueness : 1; u8 moveRestrictions : 1; @@ -28,14 +28,14 @@ enum BattleRegulationRule { BATTLE_REGULATION_RULE_TEAM_SIZE = 1, BATTLE_REGULATION_RULE_MAX_LEVEL, BATTLE_REGULATION_RULE_MAX_TOTAL_LEVEL, - BATTLE_REGULATION_RULE_SPECIES_RESTRICT, + BATTLE_REGULATION_RULE_EVOLUTION_RESTRICT, BATTLE_REGULATION_RULE_HEIGHT_RESTRICT, BATTLE_REGULATION_RULE_HEIGHT_TYPE, BATTLE_REGULATION_RULE_WEIGHT_RESTRICT, BATTLE_REGULATION_RULE_WEIGHT_TYPE, BATTLE_REGULATION_RULE_ITEM_UNIQUE, BATTLE_REGULATION_RULE_SPECIES_UNIQUE, - BATTLE_REGULATION_RULE_ITEM_RESTRICT, + BATTLE_REGULATION_RULE_SPECIAL_SPECIES_RESTRICT, BATTLE_REGULATION_RULE_MOVE_RESTRICTIONS, }; diff --git a/include/battle_regulation_validation.h b/include/battle_regulation_validation.h index d5664a06a2..ede659dd91 100644 --- a/include/battle_regulation_validation.h +++ b/include/battle_regulation_validation.h @@ -6,17 +6,17 @@ #include "pokedex_heightweight.h" #include "pokemon.h" -enum BattleRegulationValidationError { - BATTLE_REGULATION_VALIDATION_SUCCESS = 0, - BATTLE_REGULATION_VALIDATION_ERROR_TOTAL_LEVEL_EXCEEDED = 1, - BATTLE_REGULATION_VALIDATION_ERROR_DUPLICATE_SPECIES = 2, - BATTLE_REGULATION_VALIDATION_ERROR_DUPLICATE_ITEMS = 3, - BATTLE_REGULATION_VALIDATION_ERROR_INVALID_TEAM_SIZE = 4, - BATTLE_REGULATION_VALIDATION_ERROR_INVALID_POKEMON = 5, +enum BattleRegulationValidationResult { + BATTLE_REGULATION_VALIDATION_RESULT_SUCCESS = 0, + BATTLE_REGULATION_VALIDATION_RESULT_TOTAL_LEVEL_EXCEEDED, + BATTLE_REGULATION_VALIDATION_RESULT_DUPLICATE_SPECIES, + BATTLE_REGULATION_VALIDATION_RESULT_DUPLICATE_ITEMS, + BATTLE_REGULATION_VALIDATION_RESULT_INVALID_TEAM_SIZE, + BATTLE_REGULATION_VALIDATION_RESULT_INVALID_POKEMON, }; BOOL BattleRegulation_ValidatePokemon(const BattleRegulation *regulation, Pokemon *mon, const HeightWeightData *heightWeightData); -enum BattleRegulationValidationError BattleRegulation_ValidatePartySelection(const BattleRegulation *regulation, Party *party, const HeightWeightData *heightWeightData, u8 *selectedSlots); -enum BattleRegulationValidationError BattleRegulation_SelectValidPokemon(const BattleRegulation *regulation, Party *party, const HeightWeightData *heightWeightData); +enum BattleRegulationValidationResult BattleRegulation_ValidatePartySelection(const BattleRegulation *regulation, Party *party, const HeightWeightData *heightWeightData, u8 *selectedSlots); +enum BattleRegulationValidationResult BattleRegulation_SelectValidPokemon(const BattleRegulation *regulation, Party *party, const HeightWeightData *heightWeightData); #endif // POKEPLATINUM_BATTLE_REGULATION_VALIDATION_H diff --git a/include/data/scripts/scrcmd.h b/include/data/scripts/scrcmd.h index 86fe02b350..c96d125c6e 100644 --- a/include/data/scripts/scrcmd.h +++ b/include/data/scripts/scrcmd.h @@ -520,7 +520,7 @@ ScriptCommand(SCRCMD_MESSAGESEENBANLISTSPECIES, ScrCm ScriptCommand(SCRCMD_GETPREVIOUSMAPID, ScrCmd_GetPreviousMapID) ScriptCommand(SCRCMD_GETCURRENTMAPID, ScrCmd_GetCurrentMapID) ScriptCommand(SCRCMD_STARTENDSAFARIGAME, ScrCmd_StartEndSafariGame) -ScriptCommand(SCRCMD_203, ScrCmd_203) +ScriptCommand(SCRCMD_WARPTOCOLOSSEUM, ScrCmd_WarpToColosseum) ScriptCommand(SCRCMD_204, ScrCmd_204) ScriptCommand(SCRCMD_205, ScrCmd_205) ScriptCommand(SCRCMD_STARTGREATMARSHLOOKOUT, ScrCmd_StartGreatMarshLookout) @@ -574,7 +574,7 @@ ScriptCommand(SCRCMD_CALLTVBROADCAST, ScrCm ScriptCommand(SCRCMD_SAVETVSEGMENTHIDDENITEM, ScrCmd_SaveTVSegmentHiddenItem) ScriptCommand(SCRCMD_CALLTVINTERVIEW, ScrCmd_CallTVInterview) ScriptCommand(SCRCMD_CHECKTVINTERVIEWELIGIBLE, ScrCmd_CheckTVInterviewEligible) -ScriptCommand(SCRCMD_239, ScrCmd_239) +ScriptCommand(SCRCMD_OPENBATTLEREGULATIONMENU, ScrCmd_OpenBattleRegulationMenu) ScriptCommand(SCRCMD_GETPARTYMONFOOTPRINTTYPE, ScrCmd_GetPartyMonFootprintType) ScriptCommand(SCRCMD_PLAYPOKECENTERHEALINGANIMATION, ScrCmd_PlayPokecenterHealingAnimation) ScriptCommand(SCRCMD_PLAYELEVATORANIMATION, ScrCmd_PlayElevatorAnimation) @@ -680,8 +680,8 @@ ScriptCommand(SCRCMD_29F, ScrCm ScriptCommand(SCRCMD_STARTTAGBATTLE, ScrCmd_StartTagBattle) ScriptCommand(SCRCMD_UNUSED_2A1, ScrCmd_Unused_2A1) ScriptCommand(SCRCMD_TRYSETUNUSEDCOLLECTEDORBFLAG, ScrCmd_TrySetUnusedCollectedOrbFlag) -ScriptCommand(SCRCMD_2A3, ScrCmd_2A3) -ScriptCommand(SCRCMD_2A4, ScrCmd_2A4) +ScriptCommand(SCRCMD_CHECKHASWIFILISTVALIDLOGIN, ScrCmd_CheckHasWiFiListValidLogin) +ScriptCommand(SCRCMD_GETWIFLISTVALIDFRIENDSCOUNT, ScrCmd_GetWiFListValidFriendsCount) ScriptCommand(SCRCMD_OPENPARTYMENUFORTRADE, ScrCmd_OpenPartyMenuForTrade) ScriptCommand(SCRCMD_GETGAMECORNERPRIZEDATA, ScrCmd_GetGameCornerPrizeData) ScriptCommand(SCRCMD_CHECKITEMISPLATE, ScrCmd_CheckItemIsPlate) @@ -802,13 +802,13 @@ ScriptCommand(SCRCMD_STARTGIRATINAORIGINBATTLE, ScrCm ScriptCommand(SCRCMD_SETSPECIESSEEN, ScrCmd_SetSpeciesSeen) ScriptCommand(SCRCMD_GETCURRENTSAFARIGAMECAUGHTNUM, ScrCmd_GetCurrentSafariGameCaughtNum) ScriptCommand(SCRCMD_FINDPARTYSLOTWITHFATEFULENCOUNTERSPECIES, ScrCmd_FindPartySlotWithFatefulEncounterSpecies) -ScriptCommand(SCRCMD_31D, ScrCmd_31D) +ScriptCommand(SCRCMD_TRYREVERTPARTYPOKEMONFORMS, ScrCmd_TryRevertPartyPokemonForms) ScriptCommand(SCRCMD_TRYREVERTPOKEMONFORM, ScrCmd_TryRevertPokemonForm) ScriptCommand(SCRCMD_RESETDISTORTIONWORLDPERSISTEDCAMERAANGLES, ScrCmd_ResetDistortionWorldPersistedCameraAngles) ScriptCommand(SCRCMD_DODWWARP, ScrCmd_DoDWWarp) ScriptCommand(SCRCMD_STARTDISTORTIONWORLDGIRATINASHADOWEVENT, ScrCmd_StartDistortionWorldGiratinaShadowEvent) ScriptCommand(SCRCMD_FINISHDISTORTIONWORLDGIRATINASHADOWEVENT, ScrCmd_FinishDistortionWorldGiratinaShadowEvent) -ScriptCommand(SCRCMD_323, ScrCmd_323) +ScriptCommand(SCRCMD_CHECKNOWIFIPLAZACOOLDOWN, ScrCmd_CheckNoWiFiPlazaCooldown) ScriptCommand(SCRCMD_GETBATTLEHALLRECORDKEEPERSTATS, ScrCmd_GetBattleHallRecordKeeperStats) ScriptCommand(SCRCMD_GETNUMSPECIESWITHBATTLEHALLRECORDS, ScrCmd_GetNumSpeciesWithBattleHallRecords) ScriptCommand(SCRCMD_GETBATTLEHALLTOTALSINGLESRECORD, ScrCmd_GetBattleHallTotalSinglesRecord) diff --git a/include/overlay005/ov5_021F6454.h b/include/overlay005/ov5_021F6454.h index 59d67c9341..95a4b1bbaf 100644 --- a/include/overlay005/ov5_021F6454.h +++ b/include/overlay005/ov5_021F6454.h @@ -5,7 +5,7 @@ BOOL ScrCmd_ShowBattleHallRecordMonSelectionMenu(ScriptContext *ctx); BOOL ScrCmd_JudgeStats(ScriptContext *ctx); -BOOL ScrCmd_31D(ScriptContext *param0); +BOOL ScrCmd_TryRevertPartyPokemonForms(ScriptContext *ctx); BOOL ScrCmd_TryRevertPokemonForm(ScriptContext *param0); BOOL ScrCmd_2F1(ScriptContext *param0); BOOL ScrCmd_GetPartyRotomCountAndFirst(ScriptContext *ctx); diff --git a/include/overlay007/battle_regulation_menu.h b/include/overlay007/battle_regulation_menu.h new file mode 100644 index 0000000000..e6ab978935 --- /dev/null +++ b/include/overlay007/battle_regulation_menu.h @@ -0,0 +1,8 @@ +#ifndef POKEPLATINUM_BATTLE_REGULATION_MENU_H +#define POKEPLATINUM_BATTLE_REGULATION_MENU_H + +#include "field_task.h" + +void OpenBattleRegulationMenu(FieldTask *task, u16 *result); + +#endif // POKEPLATINUM_BATTLE_REGULATION_MENU_H diff --git a/include/overlay007/ov7_0224B4E8.h b/include/overlay007/ov7_0224B4E8.h deleted file mode 100644 index 843e1fad09..0000000000 --- a/include/overlay007/ov7_0224B4E8.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef POKEPLATINUM_OV7_0224B4E8_H -#define POKEPLATINUM_OV7_0224B4E8_H - -#include "field_task.h" - -void ov7_0224BE7C(FieldTask *param0, u16 *param1); - -#endif // POKEPLATINUM_OV7_0224B4E8_H diff --git a/include/script_manager.h b/include/script_manager.h index 74731ecb6c..ed58845bbd 100644 --- a/include/script_manager.h +++ b/include/script_manager.h @@ -98,9 +98,9 @@ enum ScriptContextType { #define SCRIPT_ID_OFFSET_RECORD_CHATOT_CRY 8900 #define SCRIPT_ID_OFFSET_VS_SEEKER 8950 #define SCRIPT_ID_OFFSET_POKE_RADAR 8970 -#define SCRIPT_ID_OFFSET_POKEMON_CENTER_2F_ATTENDANTS 9000 +#define SCRIPT_ID_OFFSET_POKEMON_CENTER_2F_COMMON 9000 #define SCRIPT_ID_OFFSET_COMMUNICATION_CLUB 9100 -#define SCRIPT_ID_OFFSET_POKEMON_CENTER_B1F_ATTENDANTS 9200 +#define SCRIPT_ID_OFFSET_POKEMON_CENTER_B1F_COMMON 9200 #define SCRIPT_ID_OFFSET_GROUP_CONNECTION 9300 #define SCRIPT_ID_OFFSET_POFFIN_COMMON 9400 #define SCRIPT_ID_OFFSET_DAY_CARE_COMMON 9500 diff --git a/include/wifi_list.h b/include/wifi_list.h index 18a8b1f16a..ef12c8dad3 100644 --- a/include/wifi_list.h +++ b/include/wifi_list.h @@ -20,8 +20,8 @@ u16 *sub_0202AEF0(WiFiList *wiFiList, int param1); void sub_0202AF0C(WiFiList *wiFiList, int param1, String *param2); u16 *sub_0202AF34(WiFiList *wiFiList, int param1); void sub_0202AF50(WiFiList *wiFiList, int param1, String *param2); -BOOL sub_0202AF78(WiFiList *wiFiList, int param1); -int sub_0202AF94(WiFiList *wiFiList); +BOOL WiFiList_IsValidFriendData(WiFiList *wiFiList, int param1); +int WiFiList_GetValidFriendsCount(WiFiList *wiFiList); int sub_0202AFB4(WiFiList *wiFiList); void sub_0202AFD4(WiFiList *wiFiList, int param1); void sub_0202B0F8(WiFiList *wiFiList); diff --git a/platinum.us/main.lsf b/platinum.us/main.lsf index 3c1be72edd..aa13c554d9 100644 --- a/platinum.us/main.lsf +++ b/platinum.us/main.lsf @@ -596,7 +596,7 @@ Overlay overlay7 { After overlay6 Object main.nef.p/src_overlay007_communication_club.c.o - Object main.nef.p/src_overlay007_ov7_0224B4E8.c.o + Object main.nef.p/src_overlay007_battle_regulation_menu.c.o Object main.nef.p/src_overlay007_accessory_shop.c.o Object main.nef.p/src_overlay007_shop_menu.c.o } diff --git a/res/field/scripts/meson.build b/res/field/scripts/meson.build index 0c068a308b..7231181a59 100644 --- a/res/field/scripts/meson.build +++ b/res/field/scripts/meson.build @@ -246,7 +246,7 @@ scr_seq_files = files( 'scripts_unk_0210.s', 'scripts_common.s', 'scripts_contests.s', - 'scripts_pokemon_center_2f_attendants.s', + 'scripts_pokemon_center_2f_common.s', 'scripts_oreburgh_mine_b1f.s', 'scripts_oreburgh_mine_b2f.s', 'scripts_valley_windworks_outside.s', @@ -456,7 +456,7 @@ scr_seq_files = files( 'scripts_acuity_lakefront.s', 'scripts_unk_0421.s', 'scripts_follower_partners.s', - 'scripts_pokemon_center_b1f_attendants.s', + 'scripts_pokemon_center_b1f_common.s', 'scripts_record_chatot_cry.s', 'scripts_poke_radar.s', 'scripts_poffin_common.s', diff --git a/res/field/scripts/scripts.order b/res/field/scripts/scripts.order index 3c8dd1005f..501ab88f22 100644 --- a/res/field/scripts/scripts.order +++ b/res/field/scripts/scripts.order @@ -211,7 +211,7 @@ scripts_fight_area_south_house scripts_unk_0210 scripts_common scripts_contests -scripts_pokemon_center_2f_attendants +scripts_pokemon_center_2f_common scripts_oreburgh_mine_b1f scripts_oreburgh_mine_b2f scripts_valley_windworks_outside @@ -421,7 +421,7 @@ scripts_grand_lake_valor_lakefront_west_house scripts_acuity_lakefront scripts_unk_0421 scripts_follower_partners -scripts_pokemon_center_b1f_attendants +scripts_pokemon_center_b1f_common scripts_record_chatot_cry scripts_poke_radar scripts_poffin_common diff --git a/res/field/scripts/scripts_contests.s b/res/field/scripts/scripts_contests.s index 57575130e4..702435bd0e 100644 --- a/res/field/scripts/scripts_contests.s +++ b/res/field/scripts/scripts_contests.s @@ -32,7 +32,7 @@ Contests_LobbyOnFrameExitContestHall: SetVar VAR_RESULT, 7 Call Contests_ExitContestHall ClearFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE - SetVar VAR_UNK_0x40D5, 0 + SetVar VAR_COMMUNICATION_LOAD_ACTION, 0 ReleaseAll End @@ -221,7 +221,7 @@ Contests_ContestMenu: Contests_ContestMenuExit: EndCommunication - SetVar VAR_UNK_0x40D5, 0 + SetVar VAR_COMMUNICATION_LOAD_ACTION, 0 ClearFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE Message ContestCommon_Text_LookForwardToParticipation WaitButton @@ -588,7 +588,7 @@ Contests_OfficialContestDoor: Contests_LinkContestDoor: SetFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE - SetVar VAR_UNK_0x40D5, 5 + SetVar VAR_COMMUNICATION_LOAD_ACTION, 5 LoadDoorAnimation 0, 0, 7, 5, ANIMATION_TAG_DOOR_1 Call Contests_DoorOpenAnimation WaitMovement @@ -816,7 +816,7 @@ Contests_EndContest: SetVar VAR_RESULT, 7 Call Contests_ExitContestHall ClearFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE - SetVar VAR_UNK_0x40D5, 0 + SetVar VAR_COMMUNICATION_LOAD_ACTION, 0 GoTo Contests_End Contests_OfficialContestReturnToReceptionist: diff --git a/res/field/scripts/scripts_global_terminal_1f.s b/res/field/scripts/scripts_global_terminal_1f.s index aaa3ecb080..daf291dde9 100644 --- a/res/field/scripts/scripts_global_terminal_1f.s +++ b/res/field/scripts/scripts_global_terminal_1f.s @@ -28,7 +28,7 @@ ScriptEntryEnd GlobalTerminal1F_OnResume: - CallIfEq VAR_UNK_0x40D5, 6, GlobalTerminal1F_HidePlayer + CallIfEq VAR_COMMUNICATION_LOAD_ACTION, 6, GlobalTerminal1F_HidePlayer End GlobalTerminal1F_HidePlayer: @@ -53,7 +53,7 @@ GlobalTerminal1F_ExitGTSRoom: ApplyMovement LOCALID_PLAYER, GlobalTerminal1F_Movement_PlayerWalkSouth WaitMovement Call GlobalTerminal1F_PlayDoorCloseAnimation - SetVar VAR_UNK_0x40D5, 0 + SetVar VAR_COMMUNICATION_LOAD_ACTION, 0 Return GlobalTerminal1F_PlayDoorOpenAnimation: @@ -163,7 +163,7 @@ GlobalTerminal1F_BeginTrade: SetVar VAR_RESULT, VAR_MAP_LOCAL_0 GoToIfEq VAR_RESULT, 0, GlobalTerminal1F_ReceptionistGTSEnd HealParty - SetVar VAR_UNK_0x40D5, 6 + SetVar VAR_COMMUNICATION_LOAD_ACTION, 6 Message GlobalTerminal1F_Text_EnjoyVisitToGTS CloseMessage ApplyMovement LOCALID_PLAYER, GlobalTerminal1F_Movement_PlayerWalkToGate @@ -204,7 +204,7 @@ GlobalTerminal1F_ExitAndEnd: End GlobalTerminal1F_ReceptionistGTSEnd: - SetVar VAR_UNK_0x40D5, 0 + SetVar VAR_COMMUNICATION_LOAD_ACTION, 0 Message GlobalTerminal1F_Text_PleaseVisitAgain WaitButton CloseMessage @@ -257,7 +257,7 @@ GlobalTerminal1F_Movement_PlayerFaceSouth: EndMovement GlobalTerminal1F_HasBadEgg: - CallCommonScript 0x2338 @ CommonScript_HasBadEgg; outputs pl_msg_00000221_00127 + CallCommonScript 0x2338 @ PokemonCenter2FCommon_HasBadEggReturnCommon WaitButton CloseMessage ReleaseAll diff --git a/res/field/scripts/scripts_init_canalave_city_pokecenter_2f.s b/res/field/scripts/scripts_init_canalave_city_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_canalave_city_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_canalave_city_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_canalave_city_pokecenter_b1f.s b/res/field/scripts/scripts_init_canalave_city_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_canalave_city_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_canalave_city_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_celestic_town_pokecenter_2f.s b/res/field/scripts/scripts_init_celestic_town_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_celestic_town_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_celestic_town_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_celestic_town_pokecenter_b1f.s b/res/field/scripts/scripts_init_celestic_town_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_celestic_town_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_celestic_town_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_contest_hall_lobby.s b/res/field/scripts/scripts_init_contest_hall_lobby.s index e7318367dd..f718cb4d48 100644 --- a/res/field/scripts/scripts_init_contest_hall_lobby.s +++ b/res/field/scripts/scripts_init_contest_hall_lobby.s @@ -6,7 +6,7 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 5, 0x2648 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 5, 0x2648 InitScriptGoToIfEqual VAR_CONTEST_HALL_LOBBY_STATE, 0, 1 InitScriptFrameTableEnd diff --git a/res/field/scripts/scripts_init_eterna_city_pokecenter_2f.s b/res/field/scripts/scripts_init_eterna_city_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_eterna_city_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_eterna_city_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_eterna_city_pokecenter_b1f.s b/res/field/scripts/scripts_init_eterna_city_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_eterna_city_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_eterna_city_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_fight_area_pokecenter_2f.s b/res/field/scripts/scripts_init_fight_area_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_fight_area_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_fight_area_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_fight_area_pokecenter_b1f.s b/res/field/scripts/scripts_init_fight_area_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_fight_area_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_fight_area_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_floaroma_town_pokecenter_2f.s b/res/field/scripts/scripts_init_floaroma_town_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_floaroma_town_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_floaroma_town_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_floaroma_town_pokecenter_b1f.s b/res/field/scripts/scripts_init_floaroma_town_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_floaroma_town_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_floaroma_town_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_global_terminal_1f.s b/res/field/scripts/scripts_init_global_terminal_1f.s index e6afd353dd..61cf638705 100644 --- a/res/field/scripts/scripts_init_global_terminal_1f.s +++ b/res/field/scripts/scripts_init_global_terminal_1f.s @@ -6,7 +6,7 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 6, 12 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 6, 12 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_hearthome_city_pokecenter_2f.s b/res/field/scripts/scripts_init_hearthome_city_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_hearthome_city_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_hearthome_city_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_hearthome_city_pokecenter_b1f.s b/res/field/scripts/scripts_init_hearthome_city_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_hearthome_city_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_hearthome_city_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_jubilife_city_pokecenter_2f.s b/res/field/scripts/scripts_init_jubilife_city_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_jubilife_city_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_jubilife_city_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_jubilife_city_pokecenter_b1f.s b/res/field/scripts/scripts_init_jubilife_city_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_jubilife_city_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_jubilife_city_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_oreburgh_city_pokecenter_2f.s b/res/field/scripts/scripts_init_oreburgh_city_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_oreburgh_city_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_oreburgh_city_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_oreburgh_city_pokecenter_b1f.s b/res/field/scripts/scripts_init_oreburgh_city_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_oreburgh_city_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_oreburgh_city_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_pastoria_city_pokecenter_2f.s b/res/field/scripts/scripts_init_pastoria_city_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_pastoria_city_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_pastoria_city_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_pastoria_city_pokecenter_b1f.s b/res/field/scripts/scripts_init_pastoria_city_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_pastoria_city_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_pastoria_city_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_pokemon_league_north_pokecenter_2f.s b/res/field/scripts/scripts_init_pokemon_league_north_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_pokemon_league_north_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_pokemon_league_north_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_pokemon_league_north_pokecenter_b1f.s b/res/field/scripts/scripts_init_pokemon_league_north_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_pokemon_league_north_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_pokemon_league_north_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_pokemon_league_south_pokecenter_2f.s b/res/field/scripts/scripts_init_pokemon_league_south_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_pokemon_league_south_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_pokemon_league_south_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_pokemon_league_south_pokecenter_b1f.s b/res/field/scripts/scripts_init_pokemon_league_south_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_pokemon_league_south_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_pokemon_league_south_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_resort_area_pokecenter_2f.s b/res/field/scripts/scripts_init_resort_area_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_resort_area_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_resort_area_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_resort_area_pokecenter_b1f.s b/res/field/scripts/scripts_init_resort_area_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_resort_area_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_resort_area_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_sandgem_town_pokecenter_2f.s b/res/field/scripts/scripts_init_sandgem_town_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_sandgem_town_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_sandgem_town_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_sandgem_town_pokecenter_b1f.s b/res/field/scripts/scripts_init_sandgem_town_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_sandgem_town_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_sandgem_town_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_snowpoint_city_pokecenter_2f.s b/res/field/scripts/scripts_init_snowpoint_city_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_snowpoint_city_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_snowpoint_city_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_snowpoint_city_pokecenter_b1f.s b/res/field/scripts/scripts_init_snowpoint_city_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_snowpoint_city_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_snowpoint_city_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_solaceon_town_pokecenter_2f.s b/res/field/scripts/scripts_init_solaceon_town_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_solaceon_town_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_solaceon_town_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_solaceon_town_pokecenter_b1f.s b/res/field/scripts/scripts_init_solaceon_town_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_solaceon_town_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_solaceon_town_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_sunyshore_city_pokecenter_2f.s b/res/field/scripts/scripts_init_sunyshore_city_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_sunyshore_city_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_sunyshore_city_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_sunyshore_city_pokecenter_b1f.s b/res/field/scripts/scripts_init_sunyshore_city_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_sunyshore_city_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_sunyshore_city_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_survival_area_pokecenter_2f.s b/res/field/scripts/scripts_init_survival_area_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_survival_area_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_survival_area_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_survival_area_pokecenter_b1f.s b/res/field/scripts/scripts_init_survival_area_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_survival_area_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_survival_area_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_veilstone_city_pokecenter_2f.s b/res/field/scripts/scripts_init_veilstone_city_pokecenter_2f.s index 5407aa1cd6..5137a91be4 100644 --- a/res/field/scripts/scripts_init_veilstone_city_pokecenter_2f.s +++ b/res/field/scripts/scripts_init_veilstone_city_pokecenter_2f.s @@ -6,10 +6,10 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D5, 1, 0x2334 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 2, 0x2335 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 4, 0x2336 - InitScriptGoToIfEqual VAR_UNK_0x40D5, 3, 0x2337 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 1, 0x2334 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 2, 0x2335 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 4, 0x2336 + InitScriptGoToIfEqual VAR_COMMUNICATION_LOAD_ACTION, 3, 0x2337 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_init_veilstone_city_pokecenter_b1f.s b/res/field/scripts/scripts_init_veilstone_city_pokecenter_b1f.s index 6d1d9a531b..8e66f71326 100644 --- a/res/field/scripts/scripts_init_veilstone_city_pokecenter_b1f.s +++ b/res/field/scripts/scripts_init_veilstone_city_pokecenter_b1f.s @@ -6,8 +6,8 @@ InitScriptEntryEnd InitScriptFrameTable: - InitScriptGoToIfEqual VAR_UNK_0x40D4, 0, 0x23F0 - InitScriptGoToIfEqual VAR_UNK_0x4080, 1, 0x23F5 + InitScriptGoToIfEqual VAR_VISITED_POKEMON_CENTER_B1F, 0, 0x23F0 + InitScriptGoToIfEqual VAR_ENTERED_WIFI_PLAZA, 1, 0x23F5 InitScriptFrameTableEnd InitScriptEnd diff --git a/res/field/scripts/scripts_poke_radar.s b/res/field/scripts/scripts_poke_radar.s index e4d5159032..66f7cb0f66 100644 --- a/res/field/scripts/scripts_poke_radar.s +++ b/res/field/scripts/scripts_poke_radar.s @@ -2,11 +2,11 @@ #include "res/text/bank/bag.h" - ScriptEntry _000A - ScriptEntry _001C + ScriptEntry PokeRadar_BatteryHasRunDry + ScriptEntry PokeRadar_GrassyPatchRemainedQUiet ScriptEntryEnd -_000A: +PokeRadar_BatteryHasRunDry: LockAll BufferNumber 0, VAR_0x8000 Message Bag_Text_BatteryHasRunDry @@ -15,7 +15,7 @@ _000A: ReleaseAll End -_001C: +PokeRadar_GrassyPatchRemainedQUiet: LockAll Message Bag_Text_GrassyPatchRemainedQuiet WaitButton diff --git a/res/field/scripts/scripts_pokemon_center_2f_attendants.s b/res/field/scripts/scripts_pokemon_center_2f_attendants.s deleted file mode 100644 index fd82645794..0000000000 --- a/res/field/scripts/scripts_pokemon_center_2f_attendants.s +++ /dev/null @@ -1,533 +0,0 @@ -#include "macros/scrcmd.inc" -#include "res/text/bank/pokemon_center_2f_attendants.h" -#include "res/text/bank/menu_entries.h" -#include "constants/map_object.h" - - - ScriptEntry _0046 - ScriptEntry _0108 - ScriptEntry _051E - ScriptEntry _0544 - ScriptEntry _0694 - ScriptEntry _0696 - ScriptEntry _0698 - ScriptEntry _069A - ScriptEntry _069C - ScriptEntry _069E - ScriptEntry _06A0 - ScriptEntry _06B4 - ScriptEntry _005B - ScriptEntry _0075 - ScriptEntry _005B - ScriptEntry _005B - ScriptEntry CommonScript_HasBadEgg @ 0x2338 - ScriptEntryEnd - -_0046: - CallIfNe VAR_UNK_0x40D5, 0, _0055 - End - -_0055: - HideObject LOCALID_PLAYER - Return - -_005B: - SetVar VAR_MAP_LOCAL_0, 13 - SetVar VAR_MAP_LOCAL_1, 5 - SetVar VAR_MAP_LOCAL_2, 2 - GoTo _008F - End - -_0075: - SetVar VAR_MAP_LOCAL_0, 8 - SetVar VAR_MAP_LOCAL_1, 5 - SetVar VAR_MAP_LOCAL_2, 2 - GoTo _008F - End - -_008F: - LockAll - LoadDoorAnimation 0, 0, VAR_MAP_LOCAL_0, VAR_MAP_LOCAL_2, ANIMATION_TAG_DOOR_1 - Call _050B - ShowObject LOCALID_PLAYER - ApplyMovement LOCALID_PLAYER, _00F0 - WaitMovement - Call _0513 - ApplyMovement LOCALID_PLAYER, _00F8 - WaitMovement - LoadDoorAnimation 0, 0, VAR_MAP_LOCAL_0, VAR_MAP_LOCAL_1, ANIMATION_TAG_DOOR_1 - Call _050B - ApplyMovement LOCALID_PLAYER, _0100 - WaitMovement - Call _0513 - ClearFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE - SetVar VAR_UNK_0x40D5, 0 - ReleaseAll - End - - .balign 4, 0 -_00F0: - WalkNormalSouth - EndMovement - - .balign 4, 0 -_00F8: - WalkNormalSouth - EndMovement - - .balign 4, 0 -_0100: - WalkNormalSouth 2 - EndMovement - -_0108: - PlaySE SEQ_SE_CONFIRM - LockAll - FacePlayer - CheckPartyHasBadEgg VAR_RESULT - GoToIfEq VAR_RESULT, 1, _0755 - Message 0 - GoTo _012C - End - -_012C: - Message 1 - InitGlobalTextListMenu 1, 1, 1, VAR_RESULT - AddListMenuEntry MenuEntries_Text_BattlesForTwo, LIST_MENU_BUILDER_HEADER - AddListMenuEntry MenuEntries_Text_SingleBattle, 0 - AddListMenuEntry MenuEntries_Text_DoubleBattle, 1 - AddListMenuEntry MenuEntries_Text_MixBattle, 2 - AddListMenuEntry MenuEntries_Text_BattlesForFour, LIST_MENU_BUILDER_HEADER - AddListMenuEntry MenuEntries_Text_MultiBattle, 3 - AddListMenuEntry MenuEntries_Text_Info, 4 - AddListMenuEntry MenuEntries_Text_Exit2, 5 - ShowListMenu - SetVar VAR_0x8008, VAR_RESULT - GoToIfEq VAR_0x8008, 0, _01DE - GoToIfEq VAR_0x8008, 1, _01F2 - GoToIfEq VAR_0x8008, 2, _021A - GoToIfEq VAR_0x8008, 3, _0242 - GoToIfEq VAR_0x8008, 4, _01C8 - GoTo _01D3 - End - -_01C8: - Message 2 - GoTo _012C - End - -_01D3: - Message 15 - WaitButton - CloseMessage - ReleaseAll - End - -_01DE: - SetVar VAR_0x8004, 1 - GoTo _026A - -Unk213_Unused: - GoTo _0290 - End - -_01F2: - SetVar VAR_0x8004, 2 - CountPartyNonEggs VAR_RESULT - GoToIfLt VAR_RESULT, 2, _020F - GoTo _026A - -_020F: - Message 6 - WaitButton - CloseMessage - ReleaseAll - End - -_021A: - SetVar VAR_0x8004, 3 - CountPartyNonEggs VAR_RESULT - GoToIfLt VAR_RESULT, 3, _0237 - GoTo _0290 - -_0237: - Message 126 - WaitButton - CloseMessage - ReleaseAll - End - -_0242: - SetVar VAR_0x8004, 4 - CountPartyNonEggs VAR_RESULT - GoToIfLt VAR_RESULT, 3, _025F - GoTo _0290 - -_025F: - Message 125 - WaitButton - CloseMessage - ReleaseAll - End - -_026A: - ScrCmd_239 VAR_RESULT - GoToIfEq VAR_RESULT, 1, _0290 - GoToIfEq VAR_RESULT, 3, _0290 - GoTo _01D3 - End - -_0290: - SetVar VAR_0x8005, 0 - GoTo _02E4 - End - -Unk213_Unused2: - SetVar VAR_0x8005, 0 - GoTo _02E4 - End - -Unk213_Unused3: - SetVar VAR_0x8005, 1 - GoTo _02E4 - End - -Unk213_Unused4: - SetVar VAR_0x8005, 2 - GoTo _02E4 - End - -Unk213_Unused5: - SetVar VAR_0x8005, 3 - GoTo _02E4 - End - -Unk213_Unused6: - SetVar VAR_0x8005, 4 - GoTo _02E4 - End - -_02E4: - HealParty - Common_SaveGame - SetVar VAR_RESULT, VAR_MAP_LOCAL_0 - GoToIfEq VAR_RESULT, 1, _0305 - GoTo _01D3 - End - -_0305: - CallIfEq VAR_0x8004, 1, _037A - CallIfEq VAR_0x8004, 2, _037A - CallIfEq VAR_0x8004, 3, _037A - CallIfEq VAR_0x8004, 4, _037F - InitGlobalTextMenu 30, 1, 0, VAR_RESULT - SetMenuXOriginToRight - AddMenuEntryImm 13, 0 - AddMenuEntryImm 14, 1 - AddMenuEntryImm 5, 2 - ShowMenu - SetVar VAR_0x8008, VAR_RESULT - GoToIfEq VAR_0x8008, 0, _0384 - GoToIfEq VAR_0x8008, 1, _03F7 - GoTo _01D3 - End - -_037A: - Message 22 - Return - -_037F: - Message 43 - Return - -_0384: - Message 124 - ShowYesNoMenu VAR_RESULT - GoToIfEq VAR_RESULT, MENU_NO, _0305 - CloseMessage - StartBattleClient VAR_0x8004, VAR_0x8005, 0, VAR_RESULT - GoToIfEq VAR_RESULT, COMM_CLUB_RET_CANCEL, _03D3 - GoToIfEq VAR_RESULT, COMM_CLUB_RET_ERROR, _03DD - GoToIfEq VAR_RESULT, COMM_CLUB_RET_4, _03EA - GoTo _046A - End - -_03D3: - EndCommunication - GoTo _0305 - End - -_03DD: - EndCommunication - Message 16 - WaitButton - CloseMessage - ReleaseAll - End - -_03EA: - EndCommunication - Message 15 - WaitButton - CloseMessage - ReleaseAll - End - -_03F7: - Message 124 - ShowYesNoMenu VAR_RESULT - GoToIfEq VAR_RESULT, MENU_NO, _0305 - CloseMessage - StartBattleServer VAR_0x8004, VAR_0x8005, 0, VAR_RESULT - GoToIfEq VAR_RESULT, COMM_CLUB_RET_CANCEL, _0446 - GoToIfEq VAR_RESULT, COMM_CLUB_RET_ERROR, _0450 - GoToIfEq VAR_RESULT, COMM_CLUB_RET_4, _045D - GoTo _046A - End - -_0446: - EndCommunication - GoTo _0305 - End - -_0450: - EndCommunication - Message 16 - WaitButton - CloseMessage - ReleaseAll - End - -_045D: - EndCommunication - Message 15 - WaitButton - CloseMessage - ReleaseAll - End - -_046A: - SetVar VAR_UNK_0x40D5, 1 - SetFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE - MessageNoSkip 52 - WaitABPressTime 45 - ScrCmd_135 96 - CloseMessage - LoadDoorAnimation 0, 0, 13, 5, ANIMATION_TAG_DOOR_1 - Call _050B - ApplyMovement LOCALID_PLAYER, _0524 - WaitMovement - Call _0513 - ApplyMovement LOCALID_PLAYER, _0530 - WaitMovement - LoadDoorAnimation 0, 0, 13, 2, ANIMATION_TAG_DOOR_1 - Call _050B - ApplyMovement LOCALID_PLAYER, _0538 - WaitMovement - Call _0513 - GoToIfEq VAR_0x8004, 4, _04F3 - GetCurNetID VAR_RESULT - AddVar VAR_RESULT, 7 - ScrCmd_203 0x14C, 0, VAR_RESULT, 11, 0 - End - -_04F3: - GetCurNetID VAR_RESULT - AddVar VAR_RESULT, 6 - ScrCmd_203 0x14D, 0, VAR_RESULT, 11, 0 - End - -_050B: - PlayDoorOpenAnimation ANIMATION_TAG_DOOR_1 - WaitForAnimation ANIMATION_TAG_DOOR_1 - Return - -_0513: - PlayDoorCloseAnimation ANIMATION_TAG_DOOR_1 - WaitForAnimation ANIMATION_TAG_DOOR_1 - UnloadAnimation ANIMATION_TAG_DOOR_1 - Return - -_051E: - StartLinkBattle - FieldCommEnterBattleRoom - End - - .balign 4, 0 -_0524: - WalkNormalEast - WalkNormalNorth 2 - EndMovement - - .balign 4, 0 -_0530: - WalkNormalNorth - EndMovement - - .balign 4, 0 -_0538: - WalkNormalNorth - SetInvisible - EndMovement - -_0544: - PlaySE SEQ_SE_CONFIRM - LockAll - FacePlayer - CheckPartyHasBadEgg VAR_RESULT - GoToIfEq VAR_RESULT, 1, _0755 - GoTo _0565 - End - -_0565: - Message 57 - InitGlobalTextMenu 1, 1, 0, VAR_RESULT - AddMenuEntryImm 41, 0 - AddMenuEntryImm 42, 1 - AddMenuEntryImm 10, 2 - ShowMenu - SetVar VAR_0x8008, VAR_RESULT - GoToIfEq VAR_0x8008, 0, _05CF - GoToIfEq VAR_0x8008, 1, _01D3 - GoToIfEq VAR_0x8008, 2, _05B3 - GoTo _01D3 - End - -_05B3: - Message 58 - ShowYesNoMenu VAR_RESULT - GoToIfEq VAR_RESULT, MENU_YES, _05CF - GoTo _01D3 - End - -_05CF: - SetVar VAR_0x8004, 9 - HealParty - Message 124 - ShowYesNoMenu VAR_RESULT - GoToIfEq VAR_RESULT, MENU_NO, _01D3 - ScrCmd_31D VAR_RESULT - GoToIfEq VAR_RESULT, 0xFF, _068E - SetVar VAR_UNK_0x40D5, 2 - SetFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE - Common_SaveGame - SetVar VAR_RESULT, VAR_MAP_LOCAL_0 - GoToIfEq VAR_RESULT, 1, _062D - SetVar VAR_UNK_0x40D5, 0 - ClearFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE - GoTo _01D3 - -_062D: - SetVar VAR_UNK_0x40D5, 2 - SetFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE - Message 63 - CloseMessage - LoadDoorAnimation 0, 0, 8, 5, ANIMATION_TAG_DOOR_1 - Call _050B - ApplyMovement LOCALID_PLAYER, _0524 - WaitMovement - Call _0513 - ApplyMovement LOCALID_PLAYER, _0530 - WaitMovement - LoadDoorAnimation 0, 0, 8, 2, ANIMATION_TAG_DOOR_1 - Call _050B - ApplyMovement LOCALID_PLAYER, _0538 - WaitMovement - Call _0513 - ReleaseAll - ScrCmd_153 - End - -_068E: - Common_GriseousOrbCouldNotBeRemoved - End - -_0694: - End - -_0696: - End - -_0698: - End - -_069A: - End - -_069C: - End - -_069E: - End - -_06A0: - WaitForTransition - ScrCmd_0A3 - ReturnToField - FadeScreenIn - WaitFadeScreen - End - -_06B4: - PlaySE SEQ_SE_CONFIRM - LockAll - FacePlayer - SetFlag FLAG_UNK_0x00AA - Message 102 - GoTo _06CB - End - -_06CB: - Message 103 - InitGlobalTextMenu 1, 1, 0, VAR_RESULT - AddMenuEntryImm 41, 0 - AddMenuEntryImm 42, 1 - AddMenuEntryImm 10, 2 - ShowMenu - SetVar VAR_0x8008, VAR_RESULT - GoToIfEq VAR_0x8008, 0, _0724 - GoToIfEq VAR_0x8008, 1, _074A - GoToIfEq VAR_0x8008, 2, _0719 - GoTo _074A - End - -_0719: - Message 105 - GoTo _06CB - End - -_0724: - CloseMessage - FadeScreenOut - WaitFadeScreen - StartSignatureApp - ReturnToField - FadeScreenIn - WaitFadeScreen - GoTo _074A - End - -_074A: - Message 104 - WaitButton - CloseMessage - ReleaseAll - End - -_0755: - Call _076D - WaitButton - CloseMessage - ReleaseAll - End - -CommonScript_HasBadEgg: - Call _076D - ReturnCommonScript - End - -_076D: - Message pl_msg_00000221_00127 - Return - - .balign 4, 0 diff --git a/res/field/scripts/scripts_pokemon_center_2f_common.s b/res/field/scripts/scripts_pokemon_center_2f_common.s new file mode 100644 index 0000000000..2319951c4a --- /dev/null +++ b/res/field/scripts/scripts_pokemon_center_2f_common.s @@ -0,0 +1,533 @@ +#include "macros/scrcmd.inc" +#include "res/text/bank/pokemon_center_2f_common.h" +#include "res/text/bank/menu_entries.h" +#include "constants/map_object.h" + + + ScriptEntry PokemonCenter2FCommon_OnResume + ScriptEntry PokemonCenter2FCommon_AttendantColosseum + ScriptEntry _051E + ScriptEntry PokemonCenter2FCommon_AttendantUnionRoom + ScriptEntry PokemonCenter2FCommon_UnusedScript9004 + ScriptEntry PokemonCenter2FCommon_UnusedScript9005 + ScriptEntry PokemonCenter2FCommon_UnusedScript9006 + ScriptEntry PokemonCenter2FCommon_UnusedScript9007 + ScriptEntry PokemonCenter2FCommon_UnusedScript9008 + ScriptEntry PokemonCenter2FCommon_UnusedScript9009 + ScriptEntry _06A0 + ScriptEntry PokemonCenter2FCommon_AttendantSignTrainerCard + ScriptEntry PokemonCenter2FCommon_OnFrameExitColosseum + ScriptEntry PokemonCenter2FCommon_OnFrameExitUnionRoom + ScriptEntry PokemonCenter2FCommon_OnFrameExitColosseum + ScriptEntry PokemonCenter2FCommon_OnFrameExitColosseum + ScriptEntry PokemonCenter2FCommon_HasBadEggReturnCommon @ 0x2338 + ScriptEntryEnd + +PokemonCenter2FCommon_OnResume: + CallIfNe VAR_COMMUNICATION_LOAD_ACTION, 0, PokemonCenter2FCommon_HidePlayer + End + +PokemonCenter2FCommon_HidePlayer: + HideObject LOCALID_PLAYER + Return + +PokemonCenter2FCommon_OnFrameExitColosseum: + SetVar VAR_MAP_LOCAL_0, 13 + SetVar VAR_MAP_LOCAL_1, 5 + SetVar VAR_MAP_LOCAL_2, 2 + GoTo PokemonCenter2FCommon_PlayerEnter + End + +PokemonCenter2FCommon_OnFrameExitUnionRoom: + SetVar VAR_MAP_LOCAL_0, 8 + SetVar VAR_MAP_LOCAL_1, 5 + SetVar VAR_MAP_LOCAL_2, 2 + GoTo PokemonCenter2FCommon_PlayerEnter + End + +PokemonCenter2FCommon_PlayerEnter: + LockAll + LoadDoorAnimation 0, 0, VAR_MAP_LOCAL_0, VAR_MAP_LOCAL_2, ANIMATION_TAG_DOOR_1 + Call PokemonCenter2FCommon_DoorOpenAnimation + ShowObject LOCALID_PLAYER + ApplyMovement LOCALID_PLAYER, PokemonCenter2FCommon_Movement_PlayerEnter + WaitMovement + Call PokemonCenter2FCommon_DoorCloseAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenter2FCommon_Movement_PlayerWalkToGate + WaitMovement + LoadDoorAnimation 0, 0, VAR_MAP_LOCAL_0, VAR_MAP_LOCAL_1, ANIMATION_TAG_DOOR_1 + Call PokemonCenter2FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenter2FCommon_Movement_PlayerExitThroughGate + WaitMovement + Call PokemonCenter2FCommon_DoorCloseAnimation + ClearFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE + SetVar VAR_COMMUNICATION_LOAD_ACTION, 0 + ReleaseAll + End + + .balign 4, 0 +PokemonCenter2FCommon_Movement_PlayerEnter: + WalkNormalSouth + EndMovement + + .balign 4, 0 +PokemonCenter2FCommon_Movement_PlayerWalkToGate: + WalkNormalSouth + EndMovement + + .balign 4, 0 +PokemonCenter2FCommon_Movement_PlayerExitThroughGate: + WalkNormalSouth 2 + EndMovement + +PokemonCenter2FCommon_AttendantColosseum: + PlaySE SEQ_SE_CONFIRM + LockAll + FacePlayer + CheckPartyHasBadEgg VAR_RESULT + GoToIfEq VAR_RESULT, TRUE, PokemonCenter2FCommon_HasBadEggEnd + Message PokemonCenter2FCommon_Text_WelcomeToColosseum + GoTo PokemonCenter2FCommon_BattleModeMenu + End + +PokemonCenter2FCommon_BattleModeMenu: + Message PokemonCenter2FCommon_Text_WhichBattleMode + InitGlobalTextListMenu 1, 1, 1, VAR_RESULT + AddListMenuEntry MenuEntries_Text_BattlesForTwo, LIST_MENU_BUILDER_HEADER + AddListMenuEntry MenuEntries_Text_SingleBattle, 0 + AddListMenuEntry MenuEntries_Text_DoubleBattle, 1 + AddListMenuEntry MenuEntries_Text_MixBattle, 2 + AddListMenuEntry MenuEntries_Text_BattlesForFour, LIST_MENU_BUILDER_HEADER + AddListMenuEntry MenuEntries_Text_MultiBattle, 3 + AddListMenuEntry MenuEntries_Text_Info, 4 + AddListMenuEntry MenuEntries_Text_Exit2, 5 + ShowListMenu + SetVar VAR_0x8008, VAR_RESULT + GoToIfEq VAR_0x8008, 0, PokemonCenter2FCommon_SingleBattle + GoToIfEq VAR_0x8008, 1, PokemonCenter2FCommon_DoubleBattle + GoToIfEq VAR_0x8008, 2, PokemonCenter2FCommon_MixBattle + GoToIfEq VAR_0x8008, 3, PokemonCenter2FCommon_MultiBattle + GoToIfEq VAR_0x8008, 4, PokemonCenter2FCommon_Info + GoTo PokemonCenter2FCommon_Exit + End + +PokemonCenter2FCommon_Info: + Message PokemonCenter2FCommon_Text_BattleModesInfo + GoTo PokemonCenter2FCommon_BattleModeMenu + End + +PokemonCenter2FCommon_Exit: + Message PokemonCenter2FCommon_Text_PleaseVisitAgain + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenter2FCommon_SingleBattle: + SetVar VAR_0x8004, 1 + GoTo PokemonCenter2FCommon_SingleDoubleBattle + +PokemonCenter2FCommon_Unused: + GoTo PokemonCenter2FCommon_SelectedValidBattleMode + End + +PokemonCenter2FCommon_DoubleBattle: + SetVar VAR_0x8004, 2 + CountPartyNonEggs VAR_RESULT + GoToIfLt VAR_RESULT, 2, PokemonCenter2FCommon_NeedTwoPokemonDoubleBattle + GoTo PokemonCenter2FCommon_SingleDoubleBattle + +PokemonCenter2FCommon_NeedTwoPokemonDoubleBattle: + Message PokemonCenter2FCommon_Text_NeedTwoPokemonDoubleBattle + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenter2FCommon_MixBattle: + SetVar VAR_0x8004, 3 + CountPartyNonEggs VAR_RESULT + GoToIfLt VAR_RESULT, 3, PokemonCenter2FCommon_NeedThreePokemonMixBattle + GoTo PokemonCenter2FCommon_SelectedValidBattleMode + +PokemonCenter2FCommon_NeedThreePokemonMixBattle: + Message PokemonCenter2FCommon_Text_NeedThreePokemonMixBattle + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenter2FCommon_MultiBattle: + SetVar VAR_0x8004, 4 + CountPartyNonEggs VAR_RESULT + GoToIfLt VAR_RESULT, 3, PokemonCenter2FCommon_NeedThreePokemonMultiBattle + GoTo PokemonCenter2FCommon_SelectedValidBattleMode + +PokemonCenter2FCommon_NeedThreePokemonMultiBattle: + Message PokemonCenter2FCommon_Text_NeedThreePokemonMultiBattle + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenter2FCommon_SingleDoubleBattle: + OpenBattleRegulationMenu VAR_RESULT + GoToIfEq VAR_RESULT, 1, PokemonCenter2FCommon_SelectedValidBattleMode + GoToIfEq VAR_RESULT, 3, PokemonCenter2FCommon_SelectedValidBattleMode + GoTo PokemonCenter2FCommon_Exit + End + +PokemonCenter2FCommon_SelectedValidBattleMode: + SetVar VAR_0x8005, 0 + GoTo PokemonCenter2FCommon_HealPartySaveBeforeBattle + End + +PokemonCenter2FCommon_Unused2: + SetVar VAR_0x8005, 0 + GoTo PokemonCenter2FCommon_HealPartySaveBeforeBattle + End + +PokemonCenter2FCommon_Unused3: + SetVar VAR_0x8005, 1 + GoTo PokemonCenter2FCommon_HealPartySaveBeforeBattle + End + +PokemonCenter2FCommon_Unused4: + SetVar VAR_0x8005, 2 + GoTo PokemonCenter2FCommon_HealPartySaveBeforeBattle + End + +PokemonCenter2FCommon_Unused5: + SetVar VAR_0x8005, 3 + GoTo PokemonCenter2FCommon_HealPartySaveBeforeBattle + End + +PokemonCenter2FCommon_Unused6: + SetVar VAR_0x8005, 4 + GoTo PokemonCenter2FCommon_HealPartySaveBeforeBattle + End + +PokemonCenter2FCommon_HealPartySaveBeforeBattle: + HealParty + Common_SaveGame + SetVar VAR_RESULT, VAR_MAP_LOCAL_0 + GoToIfEq VAR_RESULT, 1, PokemonCenter2FCommon_DecideLeader + GoTo PokemonCenter2FCommon_Exit + End + +PokemonCenter2FCommon_DecideLeader: + CallIfEq VAR_0x8004, 1, PokemonCenter2FCommon_DecideWhichOfTwoBecomesLeader + CallIfEq VAR_0x8004, 2, PokemonCenter2FCommon_DecideWhichOfTwoBecomesLeader + CallIfEq VAR_0x8004, 3, PokemonCenter2FCommon_DecideWhichOfTwoBecomesLeader + CallIfEq VAR_0x8004, 4, PokemonCenter2FCommon_DecideWhichOfFourBecomesLeader + InitGlobalTextMenu 30, 1, 0, VAR_RESULT + SetMenuXOriginToRight + AddMenuEntryImm MenuEntries_Text_JoinGroup, 0 + AddMenuEntryImm MenuEntries_Text_BecomeLeader, 1 + AddMenuEntryImm MenuEntries_Text_Exit, 2 + ShowMenu + SetVar VAR_0x8008, VAR_RESULT + GoToIfEq VAR_0x8008, 0, PokemonCenter2FCommon_JoinGroup + GoToIfEq VAR_0x8008, 1, PokemonCenter2FCommon_BecomeLeader + GoTo PokemonCenter2FCommon_Exit + End + +PokemonCenter2FCommon_DecideWhichOfTwoBecomesLeader: + Message PokemonCenter2FCommon_Text_DecideWhichOfTwoBecomesLeader + Return + +PokemonCenter2FCommon_DecideWhichOfFourBecomesLeader: + Message PokemonCenter2FCommon_Text_DecideWhichOfFourBecomesLeader + Return + +PokemonCenter2FCommon_JoinGroup: + Message PokemonCenter2FCommon_Text_CommsWillBeLaunched + ShowYesNoMenu VAR_RESULT + GoToIfEq VAR_RESULT, MENU_NO, PokemonCenter2FCommon_DecideLeader + CloseMessage + StartBattleClient VAR_0x8004, VAR_0x8005, 0, VAR_RESULT + GoToIfEq VAR_RESULT, COMM_CLUB_RET_CANCEL, PokemonCenter2FCommon_JoinGroupCancel + GoToIfEq VAR_RESULT, COMM_CLUB_RET_ERROR, PokemonCenter2FCommon_JoinGroupError + GoToIfEq VAR_RESULT, COMM_CLUB_RET_4, PokemonCenter2FCommon_JoinGroupRet4 + GoTo PokemonCenter2FCommon_EnterColosseum + End + +PokemonCenter2FCommon_JoinGroupCancel: + EndCommunication + GoTo PokemonCenter2FCommon_DecideLeader + End + +PokemonCenter2FCommon_JoinGroupError: + EndCommunication + Message PokemonCenter2FCommon_Text_RepeatProcessFromBeginning + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenter2FCommon_JoinGroupRet4: + EndCommunication + Message PokemonCenter2FCommon_Text_PleaseVisitAgain + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenter2FCommon_BecomeLeader: + Message PokemonCenter2FCommon_Text_CommsWillBeLaunched + ShowYesNoMenu VAR_RESULT + GoToIfEq VAR_RESULT, MENU_NO, PokemonCenter2FCommon_DecideLeader + CloseMessage + StartBattleServer VAR_0x8004, VAR_0x8005, 0, VAR_RESULT + GoToIfEq VAR_RESULT, COMM_CLUB_RET_CANCEL, PokemonCenter2FCommon_BecomeLeaderCancel + GoToIfEq VAR_RESULT, COMM_CLUB_RET_ERROR, PokemonCenter2FCommon_BecomeLeaderError + GoToIfEq VAR_RESULT, COMM_CLUB_RET_4, PokemonCenter2FCommon_BecomeLeaderRet4 + GoTo PokemonCenter2FCommon_EnterColosseum + End + +PokemonCenter2FCommon_BecomeLeaderCancel: + EndCommunication + GoTo PokemonCenter2FCommon_DecideLeader + End + +PokemonCenter2FCommon_BecomeLeaderError: + EndCommunication + Message PokemonCenter2FCommon_Text_RepeatProcessFromBeginning + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenter2FCommon_BecomeLeaderRet4: + EndCommunication + Message PokemonCenter2FCommon_Text_PleaseVisitAgain + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenter2FCommon_EnterColosseum: + SetVar VAR_COMMUNICATION_LOAD_ACTION, 1 + SetFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE + MessageNoSkip PokemonCenter2FCommon_Text_MembersGatheredEnterRoom + WaitABPressTime 45 + ScrCmd_135 96 + CloseMessage + LoadDoorAnimation 0, 0, 13, 5, ANIMATION_TAG_DOOR_1 + Call PokemonCenter2FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenter2FCommon_Movement_PlayerEnterThroughGate + WaitMovement + Call PokemonCenter2FCommon_DoorCloseAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenter2FCommon_Movement_PlayerWalkToDoor + WaitMovement + LoadDoorAnimation 0, 0, 13, 2, ANIMATION_TAG_DOOR_1 + Call PokemonCenter2FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenter2FCommon_Movement_PlayerEnterDoor + WaitMovement + Call PokemonCenter2FCommon_DoorCloseAnimation + GoToIfEq VAR_0x8004, 4, PokemonCenter2FCommon_WarpColosseum4P + GetCurNetID VAR_RESULT + AddVar VAR_RESULT, 7 + WarpToColosseum MAP_HEADER_COMMUNICATION_CLUB_COLOSSEUM_2P, 0, VAR_RESULT, 11, 0 + End + +PokemonCenter2FCommon_WarpColosseum4P: + GetCurNetID VAR_RESULT + AddVar VAR_RESULT, 6 + WarpToColosseum MAP_HEADER_COMMUNICATION_CLUB_COLOSSEUM_4P, 0, VAR_RESULT, 11, 0 + End + +PokemonCenter2FCommon_DoorOpenAnimation: + PlayDoorOpenAnimation ANIMATION_TAG_DOOR_1 + WaitForAnimation ANIMATION_TAG_DOOR_1 + Return + +PokemonCenter2FCommon_DoorCloseAnimation: + PlayDoorCloseAnimation ANIMATION_TAG_DOOR_1 + WaitForAnimation ANIMATION_TAG_DOOR_1 + UnloadAnimation ANIMATION_TAG_DOOR_1 + Return + +_051E: + StartLinkBattle + FieldCommEnterBattleRoom + End + + .balign 4, 0 +PokemonCenter2FCommon_Movement_PlayerEnterThroughGate: + WalkNormalEast + WalkNormalNorth 2 + EndMovement + + .balign 4, 0 +PokemonCenter2FCommon_Movement_PlayerWalkToDoor: + WalkNormalNorth + EndMovement + + .balign 4, 0 +PokemonCenter2FCommon_Movement_PlayerEnterDoor: + WalkNormalNorth + SetInvisible + EndMovement + +PokemonCenter2FCommon_AttendantUnionRoom: + PlaySE SEQ_SE_CONFIRM + LockAll + FacePlayer + CheckPartyHasBadEgg VAR_RESULT + GoToIfEq VAR_RESULT, TRUE, PokemonCenter2FCommon_HasBadEggEnd + GoTo PokemonCenter2FCommon_UnionRoomMenu + End + +PokemonCenter2FCommon_UnionRoomMenu: + Message PokemonCenter2FCommon_Text_WelcomeEnterUnionRoom + InitGlobalTextMenu 1, 1, 0, VAR_RESULT + AddMenuEntryImm MenuEntries_Text_Yes, 0 + AddMenuEntryImm MenuEntries_Text_No, 1 + AddMenuEntryImm MenuEntries_Text_Info, 2 + ShowMenu + SetVar VAR_0x8008, VAR_RESULT + GoToIfEq VAR_0x8008, 0, PokemonCenter2FCommon_TryEnterUnionRoom + GoToIfEq VAR_0x8008, 1, PokemonCenter2FCommon_Exit + GoToIfEq VAR_0x8008, 2, PokemonCenter2FCommon_UnionRoomInfo + GoTo PokemonCenter2FCommon_Exit + End + +PokemonCenter2FCommon_UnionRoomInfo: + Message PokemonCenter2FCommon_Text_UnionRoomInfo + ShowYesNoMenu VAR_RESULT + GoToIfEq VAR_RESULT, MENU_YES, PokemonCenter2FCommon_TryEnterUnionRoom + GoTo PokemonCenter2FCommon_Exit + End + +PokemonCenter2FCommon_TryEnterUnionRoom: + SetVar VAR_0x8004, 9 + HealParty + Message PokemonCenter2FCommon_Text_CommsWillBeLaunched + ShowYesNoMenu VAR_RESULT + GoToIfEq VAR_RESULT, MENU_NO, PokemonCenter2FCommon_Exit + TryRevertPartyPokemonForms VAR_RESULT + GoToIfEq VAR_RESULT, 0xFF, PokemonCenter2FCommon_GriseousOrbCouldNotBeRemoved + SetVar VAR_COMMUNICATION_LOAD_ACTION, 2 + SetFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE + Common_SaveGame + SetVar VAR_RESULT, VAR_MAP_LOCAL_0 + GoToIfEq VAR_RESULT, 1, PokemonCenter2FCommon_EnterUnionRoom + SetVar VAR_COMMUNICATION_LOAD_ACTION, 0 + ClearFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE + GoTo PokemonCenter2FCommon_Exit + +PokemonCenter2FCommon_EnterUnionRoom: + SetVar VAR_COMMUNICATION_LOAD_ACTION, 2 + SetFlag FLAG_COMMUNICATION_CLUB_ACCESSIBLE + Message PokemonCenter2FCommon_Text_EnjoyUnionRoom + CloseMessage + LoadDoorAnimation 0, 0, 8, 5, ANIMATION_TAG_DOOR_1 + Call PokemonCenter2FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenter2FCommon_Movement_PlayerEnterThroughGate + WaitMovement + Call PokemonCenter2FCommon_DoorCloseAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenter2FCommon_Movement_PlayerWalkToDoor + WaitMovement + LoadDoorAnimation 0, 0, 8, 2, ANIMATION_TAG_DOOR_1 + Call PokemonCenter2FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenter2FCommon_Movement_PlayerEnterDoor + WaitMovement + Call PokemonCenter2FCommon_DoorCloseAnimation + ReleaseAll + ScrCmd_153 + End + +PokemonCenter2FCommon_GriseousOrbCouldNotBeRemoved: + Common_GriseousOrbCouldNotBeRemoved + End + +PokemonCenter2FCommon_UnusedScript9004: + End + +PokemonCenter2FCommon_UnusedScript9005: + End + +PokemonCenter2FCommon_UnusedScript9006: + End + +PokemonCenter2FCommon_UnusedScript9007: + End + +PokemonCenter2FCommon_UnusedScript9008: + End + +PokemonCenter2FCommon_UnusedScript9009: + End + +_06A0: + WaitForTransition + ScrCmd_0A3 + ReturnToField + FadeScreenIn + WaitFadeScreen + End + +PokemonCenter2FCommon_AttendantSignTrainerCard: + PlaySE SEQ_SE_CONFIRM + LockAll + FacePlayer + SetFlag FLAG_UNK_0x00AA + Message PokemonCenter2FCommon_Text_YouMaySignTrainerCard + GoTo PokemonCenter2FCommon_SignTrainerCardMenu + End + +PokemonCenter2FCommon_SignTrainerCardMenu: + Message PokemonCenter2FCommon_Text_WouldYouSignTrainerCard + InitGlobalTextMenu 1, 1, 0, VAR_RESULT + AddMenuEntryImm MenuEntries_Text_Yes, 0 + AddMenuEntryImm MenuEntries_Text_No, 1 + AddMenuEntryImm MenuEntries_Text_Info, 2 + ShowMenu + SetVar VAR_0x8008, VAR_RESULT + GoToIfEq VAR_0x8008, 0, PokemonCenter2FCommon_SignTrainerCard + GoToIfEq VAR_0x8008, 1, PokemonCenter2FCommon_SignTrainerCardEnd + GoToIfEq VAR_0x8008, 2, PokemonCenter2FCommon_SignTrainerCardInfo + GoTo PokemonCenter2FCommon_SignTrainerCardEnd + End + +PokemonCenter2FCommon_SignTrainerCardInfo: + Message PokemonCenter2FCommon_Text_SignTrainerCardInfo + GoTo PokemonCenter2FCommon_SignTrainerCardMenu + End + +PokemonCenter2FCommon_SignTrainerCard: + CloseMessage + FadeScreenOut + WaitFadeScreen + StartSignatureApp + ReturnToField + FadeScreenIn + WaitFadeScreen + GoTo PokemonCenter2FCommon_SignTrainerCardEnd + End + +PokemonCenter2FCommon_SignTrainerCardEnd: + Message PokemonCenter2FCommon_Text_PleaseVisitAgain2 + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenter2FCommon_HasBadEggEnd: + Call PokemonCenter2FCommon_AtLeastOnePokemonCantBeTaken + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenter2FCommon_HasBadEggReturnCommon: + Call PokemonCenter2FCommon_AtLeastOnePokemonCantBeTaken + ReturnCommonScript + End + +PokemonCenter2FCommon_AtLeastOnePokemonCantBeTaken: + Message PokemonCenter2FCommon_Text_AtLeastOnePokemonCantBeTaken + Return + + .balign 4, 0 diff --git a/res/field/scripts/scripts_pokemon_center_b1f_attendants.s b/res/field/scripts/scripts_pokemon_center_b1f_attendants.s deleted file mode 100644 index 03655b769f..0000000000 --- a/res/field/scripts/scripts_pokemon_center_b1f_attendants.s +++ /dev/null @@ -1,458 +0,0 @@ -#include "macros/scrcmd.inc" -#include "res/text/bank/pokemon_center_b1f_attendants.h" - - - ScriptEntry _001A - ScriptEntry _00F4 - ScriptEntry _01A3 - ScriptEntry _043C - ScriptEntry _048E - ScriptEntry _0650 - ScriptEntryEnd - -_001A: - LockAll - Message 0 - CloseMessage - ApplyMovement LOCALID_PLAYER, _00D8 - WaitMovement - Message 1 - SetVar VAR_0x8004, ITEM_PAL_PAD - SetVar VAR_0x8005, 1 - Common_GiveItemQuantity - GoTo _0046 - End - -_0046: - Message 2 - InitGlobalTextMenu 31, 13, 0, VAR_RESULT - SetMenuXOriginToRight - AddMenuEntryImm 153, 0 - AddMenuEntryImm 154, 1 - ShowMenu - SetVar VAR_0x8008, VAR_RESULT - GoToIfEq VAR_0x8008, 0, _0086 - GoToIfEq VAR_0x8008, 1, _00C6 - GoTo _00C6 - End - -_0086: - Message 3 - InitGlobalTextMenu 31, 13, 0, VAR_RESULT - SetMenuXOriginToRight - AddMenuEntryImm 155, 0 - AddMenuEntryImm 154, 1 - ShowMenu - SetVar VAR_0x8008, VAR_RESULT - GoToIfEq VAR_0x8008, 0, _0086 - GoToIfEq VAR_0x8008, 1, _00C6 - GoTo _00C6 - End - -_00C6: - SetVar VAR_UNK_0x40D4, 1 - Message 4 - WaitButton - CloseMessage - ReleaseAll - End - - .balign 4, 0 -_00D8: - WalkOnSpotNormalNorth - Delay8 2 - WalkNormalNorth 4 - WalkNormalWest - FaceNorth - Delay8 2 - EndMovement - -_00F4: - PlaySE SEQ_SE_CONFIRM - LockAll - FacePlayer - Message 5 - ShowYesNoMenu VAR_RESULT - GoToIfEq VAR_RESULT, MENU_YES, _0123 - GoTo _0118 - End - -_0118: - Message 4 - WaitButton - CloseMessage - ReleaseAll - End - -_0123: - Message 6 - InitGlobalTextMenu 31, 13, 0, VAR_RESULT - SetMenuXOriginToRight - AddMenuEntryImm 153, 0 - AddMenuEntryImm 154, 1 - ShowMenu - SetVar VAR_0x8008, VAR_RESULT - GoToIfEq VAR_0x8008, 0, _0163 - GoToIfEq VAR_0x8008, 1, _0118 - GoTo _0118 - End - -_0163: - Message 3 - InitGlobalTextMenu 31, 13, 0, VAR_RESULT - SetMenuXOriginToRight - AddMenuEntryImm 155, 0 - AddMenuEntryImm 154, 1 - ShowMenu - SetVar VAR_0x8008, VAR_RESULT - GoToIfEq VAR_0x8008, 0, _0163 - GoToIfEq VAR_0x8008, 1, _0118 - GoTo _0118 - End - -_01A3: - PlaySE SEQ_SE_CONFIRM - LockAll - FacePlayer - CheckPartyHasBadEgg VAR_RESULT - GoToIfEq VAR_RESULT, 1, _0430 - GoTo _01C4 - End - -_01C4: - Message 7 - InitLocalTextMenu 31, 11, 0, VAR_RESULT - SetMenuXOriginToRight - AddMenuEntryImm 14, 0 - AddMenuEntryImm 15, 1 - AddMenuEntryImm 16, 2 - ShowMenu - SetVar VAR_0x8008, VAR_RESULT - GoToIfEq VAR_0x8008, 0, _0213 - GoToIfEq VAR_0x8008, 1, _0208 - GoTo _026C - End - -_0208: - Message 13 - GoTo _01C4 - End - -_0213: - ScrCmd_2A4 VAR_RESULT - GoToIfEq VAR_RESULT, 0, _022C - GoTo _0277 - End - -_022C: - ScrCmd_2A3 VAR_RESULT - GoToIfEq VAR_RESULT, 1, _0261 - GoTo _0245 - End - -_0245: - Message 11 - ShowYesNoMenu VAR_RESULT - GoToIfEq VAR_RESULT, MENU_YES, _0277 - GoTo _026C - End - -_0261: - Message 12 - WaitButton - CloseMessage - ReleaseAll - End - -_026C: - Message 8 - WaitButton - CloseMessage - ReleaseAll - End - -_0277: - ScrCmd_31D VAR_RESULT - GoToIfEq VAR_RESULT, 0xFF, _02A9 - HealParty - Common_SaveGame - SetVar VAR_RESULT, VAR_MAP_LOCAL_0 - GoToIfEq VAR_RESULT, 1, _02AF - GoTo _026C - End - -_02A9: - Common_GriseousOrbCouldNotBeRemoved - End - -_02AF: - Message 10 - CloseMessage - GetPlayerMapPos VAR_0x8004, VAR_0x8005 - ApplyMovement LOCALID_PLAYER, _03B8 - WaitMovement - GoTo _02CC - End - -_02CC: - LoadDoorAnimation 0, 0, 9, 5, ANIMATION_TAG_DOOR_1 - Call _0320 - ApplyMovement LOCALID_PLAYER, _03C4 - WaitMovement - Call _0328 - ApplyMovement LOCALID_PLAYER, _03CC - WaitMovement - LoadDoorAnimation 0, 0, 9, 2, ANIMATION_TAG_DOOR_1 - Call _0320 - ApplyMovement LOCALID_PLAYER, _03D4 - WaitMovement - Call _0328 - GoTo _0333 - End - -_0320: - PlayDoorOpenAnimation ANIMATION_TAG_DOOR_1 - WaitForAnimation ANIMATION_TAG_DOOR_1 - Return - -_0328: - PlayDoorCloseAnimation ANIMATION_TAG_DOOR_1 - WaitForAnimation ANIMATION_TAG_DOOR_1 - UnloadAnimation ANIMATION_TAG_DOOR_1 - Return - -_0333: - FadeScreenOut - WaitFadeScreen - WaitForTransition - ScrCmd_2A4 VAR_RESULT - GoToIfEq VAR_RESULT, 0, _035A - ScrCmd_0A3 - GoTo _035C - -_035A: - ScrCmd_0A3 -_035C: - ReturnToField - FadeScreenIn - WaitFadeScreen - LoadDoorAnimation 0, 0, 8, 2, ANIMATION_TAG_DOOR_1 - Call _0320 - ApplyMovement LOCALID_PLAYER, _03EC - WaitMovement - Call _0328 - ApplyMovement LOCALID_PLAYER, _03FC - WaitMovement - LoadDoorAnimation 0, 0, 8, 5, ANIMATION_TAG_DOOR_1 - Call _0320 - ApplyMovement LOCALID_PLAYER, _0404 - WaitMovement - Call _0328 - End - - .balign 4, 0 -_03B8: - WalkNormalEast - WalkOnSpotNormalNorth - EndMovement - - .balign 4, 0 -_03C4: - WalkNormalNorth 2 - EndMovement - - .balign 4, 0 -_03CC: - WalkNormalNorth - EndMovement - - .balign 4, 0 -_03D4: - WalkNormalNorth - SetInvisible - EndMovement - - .balign 4, 0 -_03E0: - WalkNormalNorth 2 - SetInvisible - EndMovement - - .balign 4, 0 -_03EC: - FaceSouth - SetVisible - WalkNormalSouth - EndMovement - - .balign 4, 0 -_03FC: - WalkNormalSouth - EndMovement - - .balign 4, 0 -_0404: - WalkNormalSouth 2 - EndMovement - - .balign 4, 0 -_040C: - WalkOnSpotNormalEast - EndMovement - - .balign 4, 0 -_0414: - WalkNormalNorth - WalkNormalEast - WalkOnSpotNormalNorth - EndMovement - - .balign 4, 0 -_0424: - WalkNormalNorth - SetInvisible - EndMovement - -_0430: - CallCommonScript 0x2338 - WaitButton - CloseMessage - ReleaseAll - End - -_043C: - Dummy1F9 VAR_BATTLE_FACTORY_CHALLENGE_TYPE - SetVar VAR_BATTLE_TOWER_CORRIDOR_MULTI_LOAD_ACTION, 0 - SetVar VAR_BATTLE_TOWER_MULTI_BATTLE_ROOM_LOAD_ACTION, 0 - SetVar VAR_BATTLE_FACTORY_CHALLENGE_TYPE, 0 - SetVar VAR_BATTLE_FACTORY_CHALLENGE_LEVEL, 0 - SetVar VAR_BATTLE_CASTLE_CHALLENGE_TYPE, 0 - SetVar VAR_BATTLE_HALL_CHALLENGE_TYPE, 0 - SetVar VAR_BATTLE_ARCADE_CHALLENGE_TYPE, 0 - SetVar VAR_BATTLE_TOWER_LOBBY_LOAD_ACTION, 0 - SetVar VAR_BATTLE_FACTORY_LOBBY_LOAD_ACTION, 0 - SetVar VAR_BATTLE_CASTLE_LOBBY_LOAD_ACTION, 0 - SetVar VAR_BATTLE_HALL_LOBBY_LOAD_ACTION, 0 - SetVar VAR_BATTLE_ARCADE_LOBBY_LOAD_ACTION, 0 - Dummy1F9 VAR_BATTLE_FACTORY_CHALLENGE_TYPE - End - -_048E: - PlaySE SEQ_SE_CONFIRM - LockAll - FacePlayer - ScrCmd_323 VAR_RESULT - GoToIfEq VAR_RESULT, 0, _04BC - GetCurrentMapID VAR_WIFI_PLAZA_RETURN_WARP_ID - SetVar VAR_UNK_0x405D, VAR_LAST_TALKED - Message 17 - GoTo _04C7 - End - -_04BC: - Message 25 - GoTo _0513 - End - -_04C7: - InitLocalTextMenu 31, 11, 0, VAR_RESULT - SetMenuXOriginToRight - AddMenuEntryImm 22, 0 - AddMenuEntryImm 23, 1 - AddMenuEntryImm 24, 2 - ShowMenu - SetVar VAR_0x8008, VAR_RESULT - GoToIfEq VAR_0x8008, 0, _0526 - GoToIfEq VAR_0x8008, 1, _051B - GoTo _0508 - End - -_0508: - Message 20 - GoTo _0513 - End - -_0513: - WaitButton - CloseMessage - ReleaseAll - End - -_051B: - Message 21 - GoTo _04C7 - End - -_0526: - HealParty - Common_SaveGame - SetVar VAR_RESULT, VAR_MAP_LOCAL_0 - GoToIfEq VAR_RESULT, 0, _0508 - Message 19 - CloseMessage - ApplyMovement LOCALID_PLAYER, _03B8 - WaitMovement - LoadDoorAnimation 0, 0, 5, 5, ANIMATION_TAG_DOOR_1 - Call _0320 - ApplyMovement VAR_LAST_TALKED, _040C - ApplyMovement LOCALID_PLAYER, _03C4 - WaitMovement - Call _0328 - ApplyMovement VAR_LAST_TALKED, _0414 - WaitMovement - LoadDoorAnimation 0, 0, 5, 2, ANIMATION_TAG_DOOR_1 - Call _0320 - ApplyMovement LOCALID_PLAYER, _03E0 - ApplyMovement VAR_LAST_TALKED, _0424 - WaitMovement - Call _0328 - SetVar VAR_MAP_LOCAL_3, 0 - FadeScreenOut - WaitFadeScreen - Warp MAP_HEADER_WIFI_PLAZA_ENTRANCE, 0, 20, 11, DIR_NORTH - FadeScreenIn - WaitFadeScreen - End - -Unk423_Unused: - FadeScreenOut - WaitFadeScreen - WaitForTransition - ScrCmd_0B3 VAR_RESULT - SetVar VAR_0x8004, VAR_RESULT - ScrCmd_2F7 VAR_0x8004 - ReturnToField - FadeScreenIn - WaitFadeScreen - LoadDoorAnimation 0, 0, 5, 2, ANIMATION_TAG_DOOR_1 - Call _0320 - ApplyMovement LOCALID_PLAYER, _03EC - WaitMovement - Call _0328 - ApplyMovement LOCALID_PLAYER, _03FC - WaitMovement - LoadDoorAnimation 0, 0, 5, 5, ANIMATION_TAG_DOOR_1 - Call _0320 - ApplyMovement LOCALID_PLAYER, _0404 - WaitMovement - Call _0328 - ReleaseAll - End - -_0650: - LockAll - LoadDoorAnimation 0, 0, 5, 2, ANIMATION_TAG_DOOR_1 - Call _0320 - ApplyMovement LOCALID_PLAYER, _03EC - WaitMovement - Call _0328 - ApplyMovement LOCALID_PLAYER, _03FC - WaitMovement - LoadDoorAnimation 0, 0, 5, 5, ANIMATION_TAG_DOOR_1 - Call _0320 - ApplyMovement LOCALID_PLAYER, _0404 - WaitMovement - Call _0328 - SetVar VAR_UNK_0x4080, 0 - ReleaseAll - End diff --git a/res/field/scripts/scripts_pokemon_center_b1f_common.s b/res/field/scripts/scripts_pokemon_center_b1f_common.s new file mode 100644 index 0000000000..b97b73e140 --- /dev/null +++ b/res/field/scripts/scripts_pokemon_center_b1f_common.s @@ -0,0 +1,459 @@ +#include "macros/scrcmd.inc" +#include "res/text/bank/pokemon_center_b1f_common.h" +#include "res/text/bank/menu_entries.h" + + + ScriptEntry PokemonCenterB1FCommon_OnFrameReceivePalPad + ScriptEntry PokemonCenterB1FCommon_AttendantInfo + ScriptEntry PokemonCenterB1FCommon_AttendantWiFiClub + ScriptEntry PokemonCenterB1FCommon_OnLoad + ScriptEntry PokemonCenterB1FCommon_AttendantWifiPlaza + ScriptEntry PokemonCenterB1FCommon_OnFrameExitWiFiClub + ScriptEntryEnd + +PokemonCenterB1FCommon_OnFrameReceivePalPad: + LockAll + Message PokemonCenterB1FCommon_Text_HelloRightThisWay + CloseMessage + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerWalkToAttendantEast + WaitMovement + Message PokemonCenterB1FCommon_Text_GuideToWiFiClub + SetVar VAR_0x8004, ITEM_PAL_PAD + SetVar VAR_0x8005, 1 + Common_GiveItemQuantity + GoTo PokemonCenterB1FCommon_ExplainPalPad + End + +PokemonCenterB1FCommon_ExplainPalPad: + Message PokemonCenterB1FCommon_Text_ExplainPalPad + InitGlobalTextMenu 31, 13, 0, VAR_RESULT + SetMenuXOriginToRight + AddMenuEntryImm MenuEntries_Text_PalPadInfo_RegisterAFriend, 0 + AddMenuEntryImm MenuEntries_Text_PalPadInfo_Understood, 1 + ShowMenu + SetVar VAR_0x8008, VAR_RESULT + GoToIfEq VAR_0x8008, 0, PokemonCenterB1FCommon_ExplainPalPadRegisterAFriend + GoToIfEq VAR_0x8008, 1, PokemonCenterB1FCommon_ReceivePalPadEnd + GoTo PokemonCenterB1FCommon_ReceivePalPadEnd + End + +PokemonCenterB1FCommon_ExplainPalPadRegisterAFriend: + Message PokemonCenterB1FCommon_Text_ExplainRegisterAFriend + InitGlobalTextMenu 31, 13, 0, VAR_RESULT + SetMenuXOriginToRight + AddMenuEntryImm MenuEntries_Text_PalPadInfo_TellMeAgain, 0 + AddMenuEntryImm MenuEntries_Text_PalPadInfo_Understood, 1 + ShowMenu + SetVar VAR_0x8008, VAR_RESULT + GoToIfEq VAR_0x8008, 0, PokemonCenterB1FCommon_ExplainPalPadRegisterAFriend + GoToIfEq VAR_0x8008, 1, PokemonCenterB1FCommon_ReceivePalPadEnd + GoTo PokemonCenterB1FCommon_ReceivePalPadEnd + End + +PokemonCenterB1FCommon_ReceivePalPadEnd: + SetVar VAR_VISITED_POKEMON_CENTER_B1F, 1 + Message PokemonCenterB1FCommon_Text_EnjoyNintendoWFC + WaitButton + CloseMessage + ReleaseAll + End + + .balign 4, 0 +PokemonCenterB1FCommon_Movement_PlayerWalkToAttendantEast: + WalkOnSpotNormalNorth + Delay8 2 + WalkNormalNorth 4 + WalkNormalWest + FaceNorth + Delay8 2 + EndMovement + +PokemonCenterB1FCommon_AttendantInfo: + PlaySE SEQ_SE_CONFIRM + LockAll + FacePlayer + Message PokemonCenterB1FCommon_Text_MayIHelpWithAnything + ShowYesNoMenu VAR_RESULT + GoToIfEq VAR_RESULT, MENU_YES, PokemonCenterB1FCommon_ExplainWiFiClub + GoTo PokemonCenterB1FCommon_EnjoyNintendoWFC + End + +PokemonCenterB1FCommon_EnjoyNintendoWFC: + Message PokemonCenterB1FCommon_Text_EnjoyNintendoWFC + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenterB1FCommon_ExplainWiFiClub: + Message PokemonCenterB1FCommon_Text_ExplainWiFiClub + InitGlobalTextMenu 31, 13, 0, VAR_RESULT + SetMenuXOriginToRight + AddMenuEntryImm MenuEntries_Text_PalPadInfo_RegisterAFriend, 0 + AddMenuEntryImm MenuEntries_Text_PalPadInfo_Understood, 1 + ShowMenu + SetVar VAR_0x8008, VAR_RESULT + GoToIfEq VAR_0x8008, 0, PokemonCenterB1FCommon_ExplainRegisterAFriend + GoToIfEq VAR_0x8008, 1, PokemonCenterB1FCommon_EnjoyNintendoWFC + GoTo PokemonCenterB1FCommon_EnjoyNintendoWFC + End + +PokemonCenterB1FCommon_ExplainRegisterAFriend: + Message PokemonCenterB1FCommon_Text_ExplainRegisterAFriend + InitGlobalTextMenu 31, 13, 0, VAR_RESULT + SetMenuXOriginToRight + AddMenuEntryImm MenuEntries_Text_PalPadInfo_TellMeAgain, 0 + AddMenuEntryImm MenuEntries_Text_PalPadInfo_Understood, 1 + ShowMenu + SetVar VAR_0x8008, VAR_RESULT + GoToIfEq VAR_0x8008, 0, PokemonCenterB1FCommon_ExplainRegisterAFriend + GoToIfEq VAR_0x8008, 1, PokemonCenterB1FCommon_EnjoyNintendoWFC + GoTo PokemonCenterB1FCommon_EnjoyNintendoWFC + End + +PokemonCenterB1FCommon_AttendantWiFiClub: + PlaySE SEQ_SE_CONFIRM + LockAll + FacePlayer + CheckPartyHasBadEgg VAR_RESULT + GoToIfEq VAR_RESULT, TRUE, PokemonCenterB1FCommon_HasBadEgg + GoTo PokemonCenterB1FCommon_WiFiClubMenu + End + +PokemonCenterB1FCommon_WiFiClubMenu: + Message PokemonCenterB1FCommon_Text_WiFiClubUseNintendoWFC + InitLocalTextMenu 31, 11, 0, VAR_RESULT + SetMenuXOriginToRight + AddMenuEntryImm PokemonCenterB1FCommon_Text_GoToWiFiClub, 0 + AddMenuEntryImm PokemonCenterB1FCommon_Text_InfoWiFiClub, 1 + AddMenuEntryImm PokemonCenterB1FCommon_Text_ExitWiFiClub, 2 + ShowMenu + SetVar VAR_0x8008, VAR_RESULT + GoToIfEq VAR_0x8008, 0, PokemonCenterB1FCommon_CheckFriendsToEnterWiFiClub + GoToIfEq VAR_0x8008, 1, PokemonCenterB1FCommon_WiFiClubInfo + GoTo PokemonCenterB1FCommon_PleaseComeAgain + End + +PokemonCenterB1FCommon_WiFiClubInfo: + Message PokemonCenterB1FCommon_Text_WiFiClubInfo + GoTo PokemonCenterB1FCommon_WiFiClubMenu + End + +PokemonCenterB1FCommon_CheckFriendsToEnterWiFiClub: + GetWiFListValidFriendsCount VAR_RESULT + GoToIfEq VAR_RESULT, 0, PokemonCenterB1FCommon_NoFriendsCheckValidLogin + GoTo PokemonCenterB1FCommon_TryEnterWiFiClub + End + +PokemonCenterB1FCommon_NoFriendsCheckValidLogin: + CheckHasWiFiListValidLogin VAR_RESULT + GoToIfEq VAR_RESULT, TRUE, PokemonCenterB1FCommon_NoRegisteredFriends + GoTo PokemonCenterB1FCommon_NoFriendsAskGetAFriendCode + End + +PokemonCenterB1FCommon_NoFriendsAskGetAFriendCode: + Message PokemonCenterB1FCommon_Text_NoFriendsGetAFriendCode + ShowYesNoMenu VAR_RESULT + GoToIfEq VAR_RESULT, MENU_YES, PokemonCenterB1FCommon_TryEnterWiFiClub + GoTo PokemonCenterB1FCommon_PleaseComeAgain + End + +PokemonCenterB1FCommon_NoRegisteredFriends: + Message PokemonCenterB1FCommon_Text_NoRegisteredFriends + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenterB1FCommon_PleaseComeAgain: + Message PokemonCenterB1FCommon_Text_PleaseComeAgain + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenterB1FCommon_TryEnterWiFiClub: + TryRevertPartyPokemonForms VAR_RESULT + GoToIfEq VAR_RESULT, 0xFF, PokemonCenterB1FCommon_GriseousOrbCouldNotBeRemoved + HealParty + Common_SaveGame + SetVar VAR_RESULT, VAR_MAP_LOCAL_0 + GoToIfEq VAR_RESULT, 1, PokemonCenterB1FCommon_EnterWiFiClub + GoTo PokemonCenterB1FCommon_PleaseComeAgain + End + +PokemonCenterB1FCommon_GriseousOrbCouldNotBeRemoved: + Common_GriseousOrbCouldNotBeRemoved + End + +PokemonCenterB1FCommon_EnterWiFiClub: + Message PokemonCenterB1FCommon_Text_RightThisWay + CloseMessage + GetPlayerMapPos VAR_0x8004, VAR_0x8005 + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerWalkEastToGate + WaitMovement + GoTo PokemonCenterB1FCommon_PlayerEnterWiFiClub + End + +PokemonCenterB1FCommon_PlayerEnterWiFiClub: + LoadDoorAnimation 0, 0, 9, 5, ANIMATION_TAG_DOOR_1 + Call PokemonCenterB1FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerEnterThroughGate + WaitMovement + Call PokemonCenterB1FCommon_DoorCloseAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerWalkToDoor + WaitMovement + LoadDoorAnimation 0, 0, 9, 2, ANIMATION_TAG_DOOR_1 + Call PokemonCenterB1FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerEnterWiFiClub + WaitMovement + Call PokemonCenterB1FCommon_DoorCloseAnimation + GoTo PokemonCenterB1FCommon_DoWiFiClub + End + +PokemonCenterB1FCommon_DoorOpenAnimation: + PlayDoorOpenAnimation ANIMATION_TAG_DOOR_1 + WaitForAnimation ANIMATION_TAG_DOOR_1 + Return + +PokemonCenterB1FCommon_DoorCloseAnimation: + PlayDoorCloseAnimation ANIMATION_TAG_DOOR_1 + WaitForAnimation ANIMATION_TAG_DOOR_1 + UnloadAnimation ANIMATION_TAG_DOOR_1 + Return + +PokemonCenterB1FCommon_DoWiFiClub: + FadeScreenOut + WaitFadeScreen + WaitForTransition + GetWiFListValidFriendsCount VAR_RESULT + GoToIfEq VAR_RESULT, 0, PokemonCenterB1FCommon_DoWiFiClubNoFriends + ScrCmd_0A3 + GoTo PokemonCenterB1FCommon_ReturnToPokemonCenter + +PokemonCenterB1FCommon_DoWiFiClubNoFriends: + ScrCmd_0A3 +PokemonCenterB1FCommon_ReturnToPokemonCenter: + ReturnToField + FadeScreenIn + WaitFadeScreen + LoadDoorAnimation 0, 0, 8, 2, ANIMATION_TAG_DOOR_1 + Call PokemonCenterB1FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerExitWiFiClub + WaitMovement + Call PokemonCenterB1FCommon_DoorCloseAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerWalkSouthToGate + WaitMovement + LoadDoorAnimation 0, 0, 8, 5, ANIMATION_TAG_DOOR_1 + Call PokemonCenterB1FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerExitThroughGate + WaitMovement + Call PokemonCenterB1FCommon_DoorCloseAnimation + End + + .balign 4, 0 +PokemonCenterB1FCommon_Movement_PlayerWalkEastToGate: + WalkNormalEast + WalkOnSpotNormalNorth + EndMovement + + .balign 4, 0 +PokemonCenterB1FCommon_Movement_PlayerEnterThroughGate: + WalkNormalNorth 2 + EndMovement + + .balign 4, 0 +PokemonCenterB1FCommon_Movement_PlayerWalkToDoor: + WalkNormalNorth + EndMovement + + .balign 4, 0 +PokemonCenterB1FCommon_Movement_PlayerEnterWiFiClub: + WalkNormalNorth + SetInvisible + EndMovement + + .balign 4, 0 +PokemonCenterB1FCommon_Movement_PlayerEnterWiFiPlaza: + WalkNormalNorth 2 + SetInvisible + EndMovement + + .balign 4, 0 +PokemonCenterB1FCommon_Movement_PlayerExitWiFiClub: + FaceSouth + SetVisible + WalkNormalSouth + EndMovement + + .balign 4, 0 +PokemonCenterB1FCommon_Movement_PlayerWalkSouthToGate: + WalkNormalSouth + EndMovement + + .balign 4, 0 +PokemonCenterB1FCommon_Movement_PlayerExitThroughGate: + WalkNormalSouth 2 + EndMovement + + .balign 4, 0 +PokemonCenterB1FCommon_Movement_AttendantWalkOnSpotEast: + WalkOnSpotNormalEast + EndMovement + + .balign 4, 0 +PokemonCenterB1FCommon_Movement_AttendantWalkToDoor: + WalkNormalNorth + WalkNormalEast + WalkOnSpotNormalNorth + EndMovement + + .balign 4, 0 +PokemonCenterB1FCommon_Movement_AttendantEnterWiFiPlaza: + WalkNormalNorth + SetInvisible + EndMovement + +PokemonCenterB1FCommon_HasBadEgg: + CallCommonScript 0x2338 + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenterB1FCommon_OnLoad: + Dummy1F9 VAR_BATTLE_FACTORY_CHALLENGE_TYPE + SetVar VAR_BATTLE_TOWER_CORRIDOR_MULTI_LOAD_ACTION, 0 + SetVar VAR_BATTLE_TOWER_MULTI_BATTLE_ROOM_LOAD_ACTION, 0 + SetVar VAR_BATTLE_FACTORY_CHALLENGE_TYPE, 0 + SetVar VAR_BATTLE_FACTORY_CHALLENGE_LEVEL, 0 + SetVar VAR_BATTLE_CASTLE_CHALLENGE_TYPE, 0 + SetVar VAR_BATTLE_HALL_CHALLENGE_TYPE, 0 + SetVar VAR_BATTLE_ARCADE_CHALLENGE_TYPE, 0 + SetVar VAR_BATTLE_TOWER_LOBBY_LOAD_ACTION, 0 + SetVar VAR_BATTLE_FACTORY_LOBBY_LOAD_ACTION, 0 + SetVar VAR_BATTLE_CASTLE_LOBBY_LOAD_ACTION, 0 + SetVar VAR_BATTLE_HALL_LOBBY_LOAD_ACTION, 0 + SetVar VAR_BATTLE_ARCADE_LOBBY_LOAD_ACTION, 0 + Dummy1F9 VAR_BATTLE_FACTORY_CHALLENGE_TYPE + End + +PokemonCenterB1FCommon_AttendantWifiPlaza: + PlaySE SEQ_SE_CONFIRM + LockAll + FacePlayer + CheckNoWiFiPlazaCooldown VAR_RESULT + GoToIfEq VAR_RESULT, FALSE, PokemonCenterB1FCommon_PleaseComeBackLater + GetCurrentMapID VAR_WIFI_PLAZA_RETURN_WARP_ID + SetVar VAR_WIFI_PLAZA_ATTENDANT_ID, VAR_LAST_TALKED + Message PokemonCenterB1FCommon_Text_WiFiPlazaUseNintendoWFC + GoTo PokemonCenterB1FCommon_WiFiPlazaMenu + End + +PokemonCenterB1FCommon_PleaseComeBackLater: + Message PokemonCenterB1FCommon_Text_PleaseComeBackLater + GoTo PokemonCenterB1FCommon_AttendantWiFiPlazaEnd + End + +PokemonCenterB1FCommon_WiFiPlazaMenu: + InitLocalTextMenu 31, 11, 0, VAR_RESULT + SetMenuXOriginToRight + AddMenuEntryImm PokemonCenterB1FCommon_Text_GoToWiFiPlaza, 0 + AddMenuEntryImm PokemonCenterB1FCommon_Text_InfoWiFiPlaza, 1 + AddMenuEntryImm PokemonCenterB1FCommon_Text_ExitWiFiPlaza, 2 + ShowMenu + SetVar VAR_0x8008, VAR_RESULT + GoToIfEq VAR_0x8008, 0, PokemonCenterB1FCommon_GoToWiFiPlaza + GoToIfEq VAR_0x8008, 1, PokemonCenterB1FCommon_WiFiPlazaInfo + GoTo PokemonCenterB1FCommon_WiFiPlazaExit + End + +PokemonCenterB1FCommon_WiFiPlazaExit: + Message PokemonCenterB1FCommon_Text_LookForwardToNextVisit + GoTo PokemonCenterB1FCommon_AttendantWiFiPlazaEnd + End + +PokemonCenterB1FCommon_AttendantWiFiPlazaEnd: + WaitButton + CloseMessage + ReleaseAll + End + +PokemonCenterB1FCommon_WiFiPlazaInfo: + Message PokemonCenterB1FCommon_Text_WiFiPlazaInfo + GoTo PokemonCenterB1FCommon_WiFiPlazaMenu + End + +PokemonCenterB1FCommon_GoToWiFiPlaza: + HealParty + Common_SaveGame + SetVar VAR_RESULT, VAR_MAP_LOCAL_0 + GoToIfEq VAR_RESULT, 0, PokemonCenterB1FCommon_WiFiPlazaExit + Message PokemonCenterB1FCommon_Text_PleaseEnterThisWay + CloseMessage + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerWalkEastToGate + WaitMovement + LoadDoorAnimation 0, 0, 5, 5, ANIMATION_TAG_DOOR_1 + Call PokemonCenterB1FCommon_DoorOpenAnimation + ApplyMovement VAR_LAST_TALKED, PokemonCenterB1FCommon_Movement_AttendantWalkOnSpotEast + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerEnterThroughGate + WaitMovement + Call PokemonCenterB1FCommon_DoorCloseAnimation + ApplyMovement VAR_LAST_TALKED, PokemonCenterB1FCommon_Movement_AttendantWalkToDoor + WaitMovement + LoadDoorAnimation 0, 0, 5, 2, ANIMATION_TAG_DOOR_1 + Call PokemonCenterB1FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerEnterWiFiPlaza + ApplyMovement VAR_LAST_TALKED, PokemonCenterB1FCommon_Movement_AttendantEnterWiFiPlaza + WaitMovement + Call PokemonCenterB1FCommon_DoorCloseAnimation + SetVar VAR_MAP_LOCAL_3, 0 + FadeScreenOut + WaitFadeScreen + Warp MAP_HEADER_WIFI_PLAZA_ENTRANCE, 0, 20, 11, DIR_NORTH + FadeScreenIn + WaitFadeScreen + End + +PokemonCenterB1FCommon_Unused: + FadeScreenOut + WaitFadeScreen + WaitForTransition + ScrCmd_0B3 VAR_RESULT + SetVar VAR_0x8004, VAR_RESULT + ScrCmd_2F7 VAR_0x8004 + ReturnToField + FadeScreenIn + WaitFadeScreen + LoadDoorAnimation 0, 0, 5, 2, ANIMATION_TAG_DOOR_1 + Call PokemonCenterB1FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerExitWiFiClub + WaitMovement + Call PokemonCenterB1FCommon_DoorCloseAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerWalkSouthToGate + WaitMovement + LoadDoorAnimation 0, 0, 5, 5, ANIMATION_TAG_DOOR_1 + Call PokemonCenterB1FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerExitThroughGate + WaitMovement + Call PokemonCenterB1FCommon_DoorCloseAnimation + ReleaseAll + End + +PokemonCenterB1FCommon_OnFrameExitWiFiClub: + LockAll + LoadDoorAnimation 0, 0, 5, 2, ANIMATION_TAG_DOOR_1 + Call PokemonCenterB1FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerExitWiFiClub + WaitMovement + Call PokemonCenterB1FCommon_DoorCloseAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerWalkSouthToGate + WaitMovement + LoadDoorAnimation 0, 0, 5, 5, ANIMATION_TAG_DOOR_1 + Call PokemonCenterB1FCommon_DoorOpenAnimation + ApplyMovement LOCALID_PLAYER, PokemonCenterB1FCommon_Movement_PlayerExitThroughGate + WaitMovement + Call PokemonCenterB1FCommon_DoorCloseAnimation + SetVar VAR_ENTERED_WIFI_PLAZA, 0 + ReleaseAll + End diff --git a/res/field/scripts/scripts_unk_0397.s b/res/field/scripts/scripts_unk_0397.s index 0f3c6428f0..58d5ad6ab0 100644 --- a/res/field/scripts/scripts_unk_0397.s +++ b/res/field/scripts/scripts_unk_0397.s @@ -43,7 +43,7 @@ _005C: _0078: SetFlag FLAG_HIDE_BLOCK_POKECENTER_BASEMENT SetVar VAR_GTS_ACCESS_STATE, 1 - SetVar VAR_UNK_0x40D4, 1 + SetVar VAR_VISITED_POKEMON_CENTER_B1F, 1 End _008A: diff --git a/res/field/scripts/scripts_wifi_plaza_entrance.s b/res/field/scripts/scripts_wifi_plaza_entrance.s index 01801b5bb7..822309fade 100644 --- a/res/field/scripts/scripts_wifi_plaza_entrance.s +++ b/res/field/scripts/scripts_wifi_plaza_entrance.s @@ -72,7 +72,7 @@ WifiPlazaEntrance_TakeWarpPanel: SetVar VAR_0x8004, VAR_RESULT ScrCmd_2F7 VAR_0x8004 ReturnToField - SetVar VAR_UNK_0x4080, 1 + SetVar VAR_ENTERED_WIFI_PLAZA, 1 HideObject LOCALID_PLAYER FadeScreenIn WaitFadeScreen diff --git a/res/text/menu_entries.json b/res/text/menu_entries.json index 8c2f3abe82..915d6f01fe 100644 --- a/res/text/menu_entries.json +++ b/res/text/menu_entries.json @@ -638,15 +638,15 @@ "en_US": "CHALLENGE EARLIER ROOM" }, { - "id": "pl_msg_00000361_00153", + "id": "MenuEntries_Text_PalPadInfo_RegisterAFriend", "en_US": "REGISTER A FRIEND?" }, { - "id": "pl_msg_00000361_00154", + "id": "MenuEntries_Text_PalPadInfo_Understood", "en_US": "UNDERSTOOD!" }, { - "id": "pl_msg_00000361_00155", + "id": "MenuEntries_Text_PalPadInfo_TellMeAgain", "en_US": "TELL ME AGAIN" }, { diff --git a/res/text/pokemon_center_2f_attendants.json b/res/text/pokemon_center_2f_common.json similarity index 56% rename from res/text/pokemon_center_2f_attendants.json rename to res/text/pokemon_center_2f_common.json index 0bb24c494d..8b676e9b96 100644 --- a/res/text/pokemon_center_2f_attendants.json +++ b/res/text/pokemon_center_2f_common.json @@ -2,7 +2,7 @@ "key": 24069, "messages": [ { - "id": "pl_msg_00000221_00000", + "id": "PokemonCenter2FCommon_Text_WelcomeToColosseum", "en_US": [ "Welcome to the Pokémon Communication\n", "Club Colosseum.\r", @@ -11,14 +11,14 @@ ] }, { - "id": "pl_msg_00000221_00001", + "id": "PokemonCenter2FCommon_Text_WhichBattleMode", "en_US": [ "Which Battle Mode would you like\n", "to play?" ] }, { - "id": "pl_msg_00000221_00002", + "id": "PokemonCenter2FCommon_Text_BattleModesInfo", "en_US": [ "There are four Battle Modes.\r", "Single Battle is for two Trainers\n", @@ -42,62 +42,62 @@ ] }, { - "id": "pl_msg_00000221_00003", + "id": "PokemonCenter2FCommon_Text_Dummy3", "garbage": 266 }, { - "id": "pl_msg_00000221_00004", + "id": "PokemonCenter2FCommon_Text_Dummy4", "garbage": 41 }, { - "id": "pl_msg_00000221_00005", + "id": "PokemonCenter2FCommon_Text_Dummy5", "garbage": 32 }, { - "id": "pl_msg_00000221_00006", + "id": "PokemonCenter2FCommon_Text_NeedTwoPokemonDoubleBattle", "en_US": [ "For a Double Battle, you must\n", "have at least two Pokémon." ] }, { - "id": "pl_msg_00000221_00007", + "id": "PokemonCenter2FCommon_Text_Dummy7", "garbage": 27 }, { - "id": "pl_msg_00000221_00008", + "id": "PokemonCenter2FCommon_Text_Dummy8", "garbage": 35 }, { - "id": "pl_msg_00000221_00009", + "id": "PokemonCenter2FCommon_Text_SaveTheGame", "en_US": "Would you like to save the game?" }, { - "id": "pl_msg_00000221_00010", + "id": "PokemonCenter2FCommon_Text_Dummy10", "garbage": 31 }, { - "id": "pl_msg_00000221_00011", + "id": "PokemonCenter2FCommon_Text_Dummy11", "garbage": 35 }, { - "id": "pl_msg_00000221_00012", + "id": "PokemonCenter2FCommon_Text_Dummy12", "garbage": 26 }, { - "id": "pl_msg_00000221_00013", + "id": "PokemonCenter2FCommon_Text_Dummy13", "garbage": 16 }, { - "id": "pl_msg_00000221_00014", + "id": "PokemonCenter2FCommon_Text_Dummy14", "garbage": 26 }, { - "id": "pl_msg_00000221_00015", + "id": "PokemonCenter2FCommon_Text_PleaseVisitAgain", "en_US": "Please do visit again." }, { - "id": "pl_msg_00000221_00016", + "id": "PokemonCenter2FCommon_Text_RepeatProcessFromBeginning", "en_US": [ "Communication error.\r", "Please repeat the registration\n", @@ -105,27 +105,27 @@ ] }, { - "id": "pl_msg_00000221_00017", + "id": "PokemonCenter2FCommon_Text_Dummy17", "garbage": 12 }, { - "id": "pl_msg_00000221_00018", + "id": "PokemonCenter2FCommon_Text_Dummy18", "garbage": 17 }, { - "id": "pl_msg_00000221_00019", + "id": "PokemonCenter2FCommon_Text_Dummy19", "garbage": 25 }, { - "id": "pl_msg_00000221_00020", + "id": "PokemonCenter2FCommon_Text_Dummy20", "garbage": 12 }, { - "id": "pl_msg_00000221_00021", + "id": "PokemonCenter2FCommon_Text_Dummy21", "garbage": 11 }, { - "id": "pl_msg_00000221_00022", + "id": "PokemonCenter2FCommon_Text_DecideWhichOfTwoBecomesLeader", "en_US": [ "Please decide which of you two\n", "will become the leader.\r", @@ -134,87 +134,87 @@ ] }, { - "id": "pl_msg_00000221_00023", + "id": "PokemonCenter2FCommon_Text_Dummy23", "garbage": 24 }, { - "id": "pl_msg_00000221_00024", + "id": "PokemonCenter2FCommon_Text_Dummy24", "garbage": 20 }, { - "id": "pl_msg_00000221_00025", + "id": "PokemonCenter2FCommon_Text_Dummy25", "garbage": 27 }, { - "id": "pl_msg_00000221_00026", + "id": "PokemonCenter2FCommon_Text_Dummy26", "garbage": 23 }, { - "id": "pl_msg_00000221_00027", + "id": "PokemonCenter2FCommon_Text_Dummy27", "garbage": 29 }, { - "id": "pl_msg_00000221_00028", + "id": "PokemonCenter2FCommon_Text_Dummy28", "garbage": 35 }, { - "id": "pl_msg_00000221_00029", + "id": "PokemonCenter2FCommon_Text_Dummy29", "garbage": 22 }, { - "id": "pl_msg_00000221_00030", + "id": "PokemonCenter2FCommon_Text_Dummy30", "garbage": 13 }, { - "id": "pl_msg_00000221_00031", + "id": "PokemonCenter2FCommon_Text_Dummy31", "garbage": 25 }, { - "id": "pl_msg_00000221_00032", + "id": "PokemonCenter2FCommon_Text_Dummy32", "garbage": 25 }, { - "id": "pl_msg_00000221_00033", + "id": "PokemonCenter2FCommon_Text_Dummy33", "garbage": 26 }, { - "id": "pl_msg_00000221_00034", + "id": "PokemonCenter2FCommon_Text_Dummy34", "garbage": 29 }, { - "id": "pl_msg_00000221_00035", + "id": "PokemonCenter2FCommon_Text_Dummy35", "garbage": 28 }, { - "id": "pl_msg_00000221_00036", + "id": "PokemonCenter2FCommon_Text_Dummy36", "garbage": 29 }, { - "id": "pl_msg_00000221_00037", + "id": "PokemonCenter2FCommon_Text_Dummy37", "garbage": 30 }, { - "id": "pl_msg_00000221_00038", + "id": "PokemonCenter2FCommon_Text_Dummy38", "garbage": 29 }, { - "id": "pl_msg_00000221_00039", + "id": "PokemonCenter2FCommon_Text_Dummy39", "garbage": 30 }, { - "id": "pl_msg_00000221_00040", + "id": "PokemonCenter2FCommon_Text_Dummy40", "garbage": 32 }, { - "id": "pl_msg_00000221_00041", + "id": "PokemonCenter2FCommon_Text_Dummy41", "garbage": 14 }, { - "id": "pl_msg_00000221_00042", + "id": "PokemonCenter2FCommon_Text_Dummy42", "garbage": 17 }, { - "id": "pl_msg_00000221_00043", + "id": "PokemonCenter2FCommon_Text_DecideWhichOfFourBecomesLeader", "en_US": [ "Please decide which of you four\n", "will become the group leader.\r", @@ -223,80 +223,80 @@ ] }, { - "id": "pl_msg_00000221_00044", + "id": "PokemonCenter2FCommon_Text_ChooseLeaderMultiBattle", "en_US": [ "Please choose the leader\n", "for a Multi Battle." ] }, { - "id": "pl_msg_00000221_00045", + "id": "PokemonCenter2FCommon_Text_PlayerAskedToRegisterAsMember", "en_US": [ "{STRVAR_1 3, 0, 0} was asked to register\n", "you as a member. Please wait." ] }, { - "id": "pl_msg_00000221_00046", + "id": "PokemonCenter2FCommon_Text_PlayerRepliedNo", "en_US": "{STRVAR_1 3, 0, 0} replied, “No...”" }, { - "id": "pl_msg_00000221_00047", + "id": "PokemonCenter2FCommon_Text_PlayerOKdRegistration", "en_US": [ "{STRVAR_1 3, 0, 0} OK’d your registration\n", "as a member." ] }, { - "id": "pl_msg_00000221_00048", + "id": "PokemonCenter2FCommon_Text_MultiBattleAwaitingMembers", "en_US": [ "Multi Battle!\n", "Awaiting other members!" ] }, { - "id": "pl_msg_00000221_00049", + "id": "PokemonCenter2FCommon_Text_MultiBattleAwaitingCommunication", "en_US": [ "Multi Battle! Awaiting\n", "communication from another player." ] }, { - "id": "pl_msg_00000221_00050", + "id": "PokemonCenter2FCommon_Text_CancelMultiBattle", "en_US": [ "Cancel the Multi Battle Mode\n", "with these members?" ] }, { - "id": "pl_msg_00000221_00051", + "id": "PokemonCenter2FCommon_Text_PlayerContactedYou", "en_US": "{STRVAR_1 3, 0, 0} contacted you." }, { - "id": "pl_msg_00000221_00052", + "id": "PokemonCenter2FCommon_Text_MembersGatheredEnterRoom", "en_US": [ "The members have gathered.\n", "Please enter the room." ] }, { - "id": "pl_msg_00000221_00053", + "id": "PokemonCenter2FCommon_Text_Dummy53", "garbage": 46 }, { - "id": "pl_msg_00000221_00054", + "id": "PokemonCenter2FCommon_Text_Dummy54", "garbage": 23 }, { - "id": "pl_msg_00000221_00055", + "id": "PokemonCenter2FCommon_Text_Dummy55", "garbage": 17 }, { - "id": "pl_msg_00000221_00056", + "id": "PokemonCenter2FCommon_Text_Dummy56", "garbage": 13 }, { - "id": "pl_msg_00000221_00057", + "id": "PokemonCenter2FCommon_Text_WelcomeEnterUnionRoom", "en_US": [ "Welcome to the Pokémon Wireless\n", "Club Union Room.\r", @@ -306,7 +306,7 @@ ] }, { - "id": "pl_msg_00000221_00058", + "id": "PokemonCenter2FCommon_Text_UnionRoomInfo", "en_US": [ "The Trainers in the Union Room\n", "will be those players around you\f", @@ -325,206 +325,206 @@ ] }, { - "id": "pl_msg_00000221_00059", + "id": "PokemonCenter2FCommon_Text_SaveTheGame2", "en_US": "Would you like to save the game?" }, { - "id": "pl_msg_00000221_00060", + "id": "PokemonCenter2FCommon_Text_OverwriteSavedFile", "en_US": [ "There is already a saved file.\n", "Is it OK to overwrite it?" ] }, { - "id": "pl_msg_00000221_00061", + "id": "PokemonCenter2FCommon_Text_SavingDontTurnOffPower", "en_US": [ "Saving...\n", "Don’t turn off the power." ] }, { - "id": "pl_msg_00000221_00062", + "id": "PokemonCenter2FCommon_Text_SavedTheGame", "en_US": "{STRVAR_1 3, 0, 0} saved the game." }, { - "id": "pl_msg_00000221_00063", + "id": "PokemonCenter2FCommon_Text_EnjoyUnionRoom", "en_US": [ "I hope you enjoy your time in\n", "the Union Room.\r" ] }, { - "id": "pl_msg_00000221_00064", + "id": "PokemonCenter2FCommon_Text_Dummy64", "garbage": 92 }, { - "id": "pl_msg_00000221_00065", + "id": "PokemonCenter2FCommon_Text_Dummy65", "garbage": 115 }, { - "id": "pl_msg_00000221_00066", + "id": "PokemonCenter2FCommon_Text_Dummy66", "garbage": 30 }, { - "id": "pl_msg_00000221_00067", + "id": "PokemonCenter2FCommon_Text_Dummy67", "garbage": 31 }, { - "id": "pl_msg_00000221_00068", + "id": "PokemonCenter2FCommon_Text_Dummy68", "garbage": 35 }, { - "id": "pl_msg_00000221_00069", + "id": "PokemonCenter2FCommon_Text_Dummy69", "garbage": 26 }, { - "id": "pl_msg_00000221_00070", + "id": "PokemonCenter2FCommon_Text_Dummy70", "garbage": 63 }, { - "id": "pl_msg_00000221_00071", + "id": "PokemonCenter2FCommon_Text_Dummy71", "garbage": 25 }, { - "id": "pl_msg_00000221_00072", + "id": "PokemonCenter2FCommon_Text_Dummy72", "garbage": 34 }, { - "id": "pl_msg_00000221_00073", + "id": "PokemonCenter2FCommon_Text_Dummy73", "garbage": 28 }, { - "id": "pl_msg_00000221_00074", + "id": "PokemonCenter2FCommon_Text_Dummy74", "garbage": 30 }, { - "id": "pl_msg_00000221_00075", + "id": "PokemonCenter2FCommon_Text_Dummy75", "garbage": 24 }, { - "id": "pl_msg_00000221_00076", + "id": "PokemonCenter2FCommon_Text_Dummy76", "garbage": 16 }, { - "id": "pl_msg_00000221_00077", + "id": "PokemonCenter2FCommon_Text_Dummy77", "garbage": 26 }, { - "id": "pl_msg_00000221_00078", + "id": "PokemonCenter2FCommon_Text_Dummy78", "garbage": 27 }, { - "id": "pl_msg_00000221_00079", + "id": "PokemonCenter2FCommon_Text_Dummy79", "garbage": 96 }, { - "id": "pl_msg_00000221_00080", + "id": "PokemonCenter2FCommon_Text_Dummy80", "garbage": 158 }, { - "id": "pl_msg_00000221_00081", + "id": "PokemonCenter2FCommon_Text_Dummy81", "garbage": 87 }, { - "id": "pl_msg_00000221_00082", + "id": "PokemonCenter2FCommon_Text_Dummy82", "garbage": 90 }, { - "id": "pl_msg_00000221_00083", + "id": "PokemonCenter2FCommon_Text_Dummy83", "garbage": 61 }, { - "id": "pl_msg_00000221_00084", + "id": "PokemonCenter2FCommon_Text_Dummy84", "garbage": 85 }, { - "id": "pl_msg_00000221_00085", + "id": "PokemonCenter2FCommon_Text_Dummy85", "garbage": 105 }, { - "id": "pl_msg_00000221_00086", + "id": "PokemonCenter2FCommon_Text_Dummy86", "garbage": 65 }, { - "id": "pl_msg_00000221_00087", + "id": "PokemonCenter2FCommon_Text_Dummy87", "garbage": 63 }, { - "id": "pl_msg_00000221_00088", + "id": "PokemonCenter2FCommon_Text_Dummy88", "garbage": 25 }, { - "id": "pl_msg_00000221_00089", + "id": "PokemonCenter2FCommon_Text_Dummy89", "garbage": 75 }, { - "id": "pl_msg_00000221_00090", + "id": "PokemonCenter2FCommon_Text_Dummy90", "garbage": 26 }, { - "id": "pl_msg_00000221_00091", + "id": "PokemonCenter2FCommon_Text_Dummy91", "garbage": 73 }, { - "id": "pl_msg_00000221_00092", + "id": "PokemonCenter2FCommon_Text_Dummy92", "garbage": 5 }, { - "id": "pl_msg_00000221_00093", + "id": "PokemonCenter2FCommon_Text_Dummy93", "garbage": 5 }, { - "id": "pl_msg_00000221_00094", + "id": "PokemonCenter2FCommon_Text_Dummy94", "garbage": 4 }, { - "id": "pl_msg_00000221_00095", + "id": "PokemonCenter2FCommon_Text_Dummy95", "garbage": 5 }, { - "id": "pl_msg_00000221_00096", + "id": "PokemonCenter2FCommon_Text_Dummy96", "garbage": 4 }, { - "id": "pl_msg_00000221_00097", + "id": "PokemonCenter2FCommon_Text_Dummy97", "garbage": 22 }, { - "id": "pl_msg_00000221_00098", + "id": "PokemonCenter2FCommon_Text_Dummy98", "garbage": 4 }, { - "id": "pl_msg_00000221_00099", + "id": "PokemonCenter2FCommon_Text_Dummy99", "garbage": 4 }, { - "id": "pl_msg_00000221_00100", + "id": "PokemonCenter2FCommon_Text_Dummy100", "garbage": 3 }, { - "id": "pl_msg_00000221_00101", + "id": "PokemonCenter2FCommon_Text_Dummy101", "garbage": 4 }, { - "id": "pl_msg_00000221_00102", + "id": "PokemonCenter2FCommon_Text_YouMaySignTrainerCard", "en_US": [ "You may sign the back of your\n", "Trainer Card here.\r" ] }, { - "id": "pl_msg_00000221_00103", + "id": "PokemonCenter2FCommon_Text_WouldYouSignTrainerCard", "en_US": [ "Would you like to sign your\n", "Trainer Card?" ] }, { - "id": "pl_msg_00000221_00104", + "id": "PokemonCenter2FCommon_Text_PleaseVisitAgain2", "en_US": "Please do visit again." }, { - "id": "pl_msg_00000221_00105", + "id": "PokemonCenter2FCommon_Text_SignTrainerCardInfo", "en_US": [ "You may sign the back of your\n", "Trainer Card here.\r", @@ -536,14 +536,14 @@ ] }, { - "id": "pl_msg_00000221_00106", + "id": "PokemonCenter2FCommon_Text_WhichSetOfRules", "en_US": [ "Which set of rules would you like\n", "to use?" ] }, { - "id": "pl_msg_00000221_00107", + "id": "PokemonCenter2FCommon_Text_NeedXPokemonForCup", "en_US": [ "You need at least {STRVAR_1 50, 1, 0} Pokémon that\n", "qualify under {STRVAR_1 26, 0, 0} Cup\f", @@ -551,59 +551,59 @@ ] }, { - "id": "pl_msg_00000221_00108", + "id": "PokemonCenter2FCommon_Text_Dummy108", "garbage": 8 }, { - "id": "pl_msg_00000221_00109", + "id": "PokemonCenter2FCommon_Text_Dummy109", "garbage": 7 }, { - "id": "pl_msg_00000221_00110", + "id": "PokemonCenter2FCommon_Text_Dummy110", "garbage": 6 }, { - "id": "pl_msg_00000221_00111", + "id": "PokemonCenter2FCommon_Text_Dummy111", "garbage": 6 }, { - "id": "pl_msg_00000221_00112", + "id": "PokemonCenter2FCommon_Text_Dummy112", "garbage": 6 }, { - "id": "pl_msg_00000221_00113", + "id": "PokemonCenter2FCommon_Text_Cup", "en_US": "{STRVAR_1 26, 0, 0} Cup" }, { - "id": "pl_msg_00000221_00114", + "id": "PokemonCenter2FCommon_Text_Cancel", "en_US": "CANCEL" }, { - "id": "pl_msg_00000221_00115", + "id": "PokemonCenter2FCommon_Text_Confirm", "en_US": "CONFIRM" }, { - "id": "pl_msg_00000221_00116", + "id": "PokemonCenter2FCommon_Text_Rules", "en_US": "RULES" }, { - "id": "pl_msg_00000221_00117", + "id": "PokemonCenter2FCommon_Text_Dummy117", "garbage": 28 }, { - "id": "pl_msg_00000221_00118", + "id": "PokemonCenter2FCommon_Text_Dummy118", "garbage": 26 }, { - "id": "pl_msg_00000221_00119", + "id": "PokemonCenter2FCommon_Text_Dummy119", "garbage": 28 }, { - "id": "pl_msg_00000221_00120", + "id": "PokemonCenter2FCommon_Text_Dummy120", "garbage": 17 }, { - "id": "pl_msg_00000221_00121", + "id": "PokemonCenter2FCommon_Text_CantFormTeamWithLevelLimit", "en_US": [ "It’s impossible to form a team of\n", "Pokémon that qualify under the\r", @@ -612,36 +612,36 @@ ] }, { - "id": "pl_msg_00000221_00122", + "id": "PokemonCenter2FCommon_Text_Dummy122", "garbage": 18 }, { - "id": "pl_msg_00000221_00123", + "id": "PokemonCenter2FCommon_Text_NoRestrictions", "en_US": "NO RESTRICTIONS" }, { - "id": "PokeCenter2FAttendants_Text_CommsWillBeLaunched", + "id": "PokemonCenter2FCommon_Text_CommsWillBeLaunched", "en_US": [ "DS Wireless Communications will be\n", "launched." ] }, { - "id": "pl_msg_00000221_00125", + "id": "PokemonCenter2FCommon_Text_NeedThreePokemonMultiBattle", "en_US": [ "For a Multi Battle, you must have\n", "at least three Pokémon." ] }, { - "id": "pl_msg_00000221_00126", + "id": "PokemonCenter2FCommon_Text_NeedThreePokemonMixBattle", "en_US": [ "For a Mix Battle, you must have\n", "at least three Pokémon." ] }, { - "id": "pl_msg_00000221_00127", + "id": "PokemonCenter2FCommon_Text_AtLeastOnePokemonCantBeTaken", "en_US": [ "You have at least one Pokémon\n", "that can’t be taken." diff --git a/res/text/pokemon_center_b1f_attendants.json b/res/text/pokemon_center_b1f_common.json similarity index 74% rename from res/text/pokemon_center_b1f_attendants.json rename to res/text/pokemon_center_b1f_common.json index 5a4cbadf1e..503a1d49e6 100644 --- a/res/text/pokemon_center_b1f_attendants.json +++ b/res/text/pokemon_center_b1f_common.json @@ -2,14 +2,14 @@ "key": 1593, "messages": [ { - "id": "pl_msg_00000430_00000", + "id": "PokemonCenterB1FCommon_Text_HelloRightThisWay", "en_US": [ "Oh, hello!\n", "Right this way, please!\r" ] }, { - "id": "pl_msg_00000430_00001", + "id": "PokemonCenterB1FCommon_Text_GuideToWiFiClub", "en_US": [ "Hello.\n", "I’m glad to meet you.\r", @@ -19,7 +19,7 @@ ] }, { - "id": "pl_msg_00000430_00002", + "id": "PokemonCenterB1FCommon_Text_ExplainPalPad", "en_US": [ "That’s your Pal Pad. You may register\n", "your friends in it.\r", @@ -30,7 +30,7 @@ ] }, { - "id": "pl_msg_00000430_00003", + "id": "PokemonCenterB1FCommon_Text_ExplainRegisterAFriend", "en_US": [ "You may meet people on the second\n", "floor of a Pokémon Center for trades\f", @@ -44,14 +44,14 @@ ] }, { - "id": "pl_msg_00000430_00004", + "id": "PokemonCenterB1FCommon_Text_EnjoyNintendoWFC", "en_US": [ "I hope you enjoy using Nintendo\n", "WFC!" ] }, { - "id": "pl_msg_00000430_00005", + "id": "PokemonCenterB1FCommon_Text_MayIHelpWithAnything", "en_US": [ "Welcome to the Pokémon Center Wi-Fi\n", "Club!\r", @@ -59,7 +59,7 @@ ] }, { - "id": "pl_msg_00000430_00006", + "id": "PokemonCenterB1FCommon_Text_ExplainWiFiClub", "en_US": [ "Let me explain how the Pokémon Wi-Fi\n", "Club is set up.\r", @@ -71,7 +71,7 @@ ] }, { - "id": "pl_msg_00000430_00007", + "id": "PokemonCenterB1FCommon_Text_WiFiClubUseNintendoWFC", "en_US": [ "Welcome to the Pokémon Wi-Fi Club!\r", "Would you like to use Nintendo Wi-Fi\n", @@ -79,22 +79,22 @@ ] }, { - "id": "pl_msg_00000430_00008", + "id": "PokemonCenterB1FCommon_Text_PleaseComeAgain", "en_US": "Please come again." }, { - "id": "pl_msg_00000430_00009", + "id": "PokemonCenterB1FCommon_Text_LaunchNintendoWFC", "en_US": [ "Would you like to launch\n", "Nintendo WFC?" ] }, { - "id": "pl_msg_00000430_00010", + "id": "PokemonCenterB1FCommon_Text_RightThisWay", "en_US": "Right this way, please.\r" }, { - "id": "pl_msg_00000430_00011", + "id": "PokemonCenterB1FCommon_Text_NoFriendsGetAFriendCode", "en_US": [ "...Oh?\r", "I’m sorry, but you don’t have any\n", @@ -106,7 +106,7 @@ ] }, { - "id": "pl_msg_00000430_00012", + "id": "PokemonCenterB1FCommon_Text_NoRegisteredFriends", "en_US": [ "...Oh?\r", "I’m sorry, but you don’t have any\n", @@ -118,7 +118,7 @@ ] }, { - "id": "pl_msg_00000430_00013", + "id": "PokemonCenterB1FCommon_Text_WiFiClubInfo", "en_US": [ "At any Wi-Fi Club, you may play using\n", "Nintendo Wi-Fi Connection.\r", @@ -136,19 +136,19 @@ ] }, { - "id": "pl_msg_00000430_00014", + "id": "PokemonCenterB1FCommon_Text_GoToWiFiClub", "en_US": "GO TO WI-FI CLUB" }, { - "id": "pl_msg_00000430_00015", + "id": "PokemonCenterB1FCommon_Text_InfoWiFiClub", "en_US": "INFO" }, { - "id": "pl_msg_00000430_00016", + "id": "PokemonCenterB1FCommon_Text_ExitWiFiClub", "en_US": "EXIT" }, { - "id": "pl_msg_00000430_00017", + "id": "PokemonCenterB1FCommon_Text_WiFiPlazaUseNintendoWFC", "en_US": [ "Hello, you may enter our Pokémon\n", "Center Wi-Fi Plaza from here.\r", @@ -157,19 +157,19 @@ ] }, { - "id": "pl_msg_00000430_00018", + "id": "PokemonCenterB1FCommon_Text_Dummy18", "garbage": 21 }, { - "id": "pl_msg_00000430_00019", + "id": "PokemonCenterB1FCommon_Text_PleaseEnterThisWay", "en_US": "Please enter this way.\r" }, { - "id": "pl_msg_00000430_00020", + "id": "PokemonCenterB1FCommon_Text_LookForwardToNextVisit", "en_US": "We look forward to your next visit." }, { - "id": "pl_msg_00000430_00021", + "id": "PokemonCenterB1FCommon_Text_WiFiPlazaInfo", "en_US": [ "The Wi-Fi Plaza is a facility where you\n", "may meet Trainers from around the\f", @@ -187,19 +187,19 @@ ] }, { - "id": "pl_msg_00000430_00022", + "id": "PokemonCenterB1FCommon_Text_GoToWiFiPlaza", "en_US": "GO TO WI-FI PLAZA" }, { - "id": "pl_msg_00000430_00023", + "id": "PokemonCenterB1FCommon_Text_InfoWiFiPlaza", "en_US": "INFO" }, { - "id": "pl_msg_00000430_00024", + "id": "PokemonCenterB1FCommon_Text_ExitWiFiPlaza", "en_US": "EXIT" }, { - "id": "pl_msg_00000430_00025", + "id": "PokemonCenterB1FCommon_Text_PleaseComeBackLater", "en_US": [ "Sorry, we’re getting things ready.\n", "Please come back later." diff --git a/res/text/unk_0353.json b/res/text/unk_0353.json index dcbd0e42b6..86e4c9fe48 100644 --- a/res/text/unk_0353.json +++ b/res/text/unk_0353.json @@ -442,111 +442,111 @@ "garbage": 1 }, { - "id": "pl_msg_00000353_00070", + "id": "Unk0353_Text_StandardCup", "en_US": "STANDARD" }, { - "id": "pl_msg_00000353_00071", + "id": "Unk0353_Text_FancyCup", "en_US": "FANCY" }, { - "id": "pl_msg_00000353_00072", + "id": "Unk0353_Text_LittleCup", "en_US": "LITTLE" }, { - "id": "pl_msg_00000353_00073", + "id": "Unk0353_Text_LightCup", "en_US": "LIGHT" }, { - "id": "pl_msg_00000353_00074", + "id": "Unk0353_Text_DoubleCup", "en_US": "DOUBLE" }, { - "id": "pl_msg_00000353_00075", + "id": "Unk0353_Text_RuleNoOfPokemon", "en_US": "No. of Pokémon:" }, { - "id": "pl_msg_00000353_00076", + "id": "Unk0353_Text_RulePokemonLevel", "en_US": "Pokémon level:" }, { - "id": "pl_msg_00000353_00077", + "id": "Unk0353_Text_RuleTotalLevels", "en_US": "Total levels:" }, { - "id": "pl_msg_00000353_00078", + "id": "Unk0353_Text_RuleHeight", "en_US": "Height:" }, { - "id": "pl_msg_00000353_00079", + "id": "Unk0353_Text_RuleWeight", "en_US": "Weight:" }, { - "id": "pl_msg_00000353_00080", + "id": "Unk0353_Text_RuleEvolvedPokemon", "en_US": "Evolved Pokémon:" }, { - "id": "pl_msg_00000353_00081", + "id": "Unk0353_Text_RuleSpecialPokemon", "en_US": "Special Pokémon:" }, { - "id": "pl_msg_00000353_00082", + "id": "Unk0353_Text_RuleSamePokemon", "en_US": "Same Pokémon:" }, { - "id": "pl_msg_00000353_00083", + "id": "Unk0353_Text_RuleSameItems", "en_US": "Same items:" }, { - "id": "pl_msg_00000353_00084", + "id": "Unk0353_Text_ValueNoOfPokemon", "en_US": "{STRVAR_1 50, 0, 0}" }, { - "id": "pl_msg_00000353_00085", + "id": "Unk0353_Text_ValueMaxLevel", "en_US": "Max. {STRVAR_1 52, 0, 0}" }, { - "id": "pl_msg_00000353_00086", + "id": "Unk0353_Text_ValueMaxTotalLevels", "en_US": "Max. {STRVAR_1 52, 0, 0}" }, { - "id": "pl_msg_00000353_00087", + "id": "Unk0353_Text_ValueMaxHeight", "en_US": "Max. {STRVAR_1 50, 0, 0}’ {STRVAR_1 50, 1, 0}”" }, { - "id": "pl_msg_00000353_00088", + "id": "Unk0353_Text_ValueMinHeight", "en_US": "Min. {STRVAR_1 50, 0, 0}’ {STRVAR_1 50, 1, 0}”" }, { - "id": "pl_msg_00000353_00089", + "id": "Unk0353_Text_ValueMaxWeight", "en_US": "Max. {STRVAR_1 51, 0, 0} lbs." }, { - "id": "pl_msg_00000353_00090", + "id": "Unk0353_Text_ValueMinWeight", "en_US": "Min. {STRVAR_1 51, 0, 0} lbs." }, { - "id": "pl_msg_00000353_00091", + "id": "Unk0353_Text_ValuePokemonPermitted", "en_US": "Permitted" }, { - "id": "pl_msg_00000353_00092", + "id": "Unk0353_Text_ValuePokemonBanned", "en_US": "Banned" }, { - "id": "pl_msg_00000353_00093", + "id": "Unk0353_Text_ValueItemsPermitted", "en_US": "Permitted" }, { - "id": "pl_msg_00000353_00094", + "id": "Unk0353_Text_ValueItemsBanned", "en_US": "Banned" }, { - "id": "pl_msg_00000353_00095", + "id": "Unk0353_Text_Cup", "en_US": "{STRVAR_1 26, 0, 0} Cup" }, { - "id": "pl_msg_00000353_00096", + "id": "Unk0353_Text_NoRestrictions", "en_US": "NO RESTRICTIONS" }, { diff --git a/src/applications/party_menu/main.c b/src/applications/party_menu/main.c index 07b8bfbd26..4d76f6bcaf 100644 --- a/src/applications/party_menu/main.c +++ b/src/applications/party_menu/main.c @@ -2149,10 +2149,10 @@ static int HandleGameWindowEvent(PartyMenuApplication *application) if (application->partyMenu->battleRegulation != NULL) { switch (BattleRegulation_ValidatePartySelection(application->partyMenu->battleRegulation, application->partyMenu->party, application->heightWeight, application->partyMenu->selectionOrder)) { - case BATTLE_REGULATION_VALIDATION_SUCCESS: + case BATTLE_REGULATION_VALIDATION_RESULT_SUCCESS: break; - case BATTLE_REGULATION_VALIDATION_ERROR_TOTAL_LEVEL_EXCEEDED: { + case BATTLE_REGULATION_VALIDATION_RESULT_TOTAL_LEVEL_EXCEEDED: { String *v1; int v2; @@ -2167,12 +2167,12 @@ static int HandleGameWindowEvent(PartyMenuApplication *application) application->stateAfterMessage = PARTY_MENU_STATE_23; Sound_PlayEffect(SEQ_SE_DP_CUSTOM06); return PARTY_MENU_STATE_SHOW_MESSAGE_THEN_NEXT_STATE; - case BATTLE_REGULATION_VALIDATION_ERROR_DUPLICATE_SPECIES: + case BATTLE_REGULATION_VALIDATION_RESULT_DUPLICATE_SPECIES: PartyMenu_PrintLongMessage(application, PartyMenu_Text_IdenticalMonNotPermitted, TRUE); application->stateAfterMessage = PARTY_MENU_STATE_23; Sound_PlayEffect(SEQ_SE_DP_CUSTOM06); return PARTY_MENU_STATE_SHOW_MESSAGE_THEN_NEXT_STATE; - case BATTLE_REGULATION_VALIDATION_ERROR_DUPLICATE_ITEMS: + case BATTLE_REGULATION_VALIDATION_RESULT_DUPLICATE_ITEMS: PartyMenu_PrintLongMessage(application, PartyMenu_Text_SomeMonHoldingIdenticalItems, TRUE); application->stateAfterMessage = PARTY_MENU_STATE_23; Sound_PlayEffect(SEQ_SE_DP_CUSTOM06); diff --git a/src/battle_regulation.c b/src/battle_regulation.c index b4e5d1cd5f..943b39dc66 100644 --- a/src/battle_regulation.c +++ b/src/battle_regulation.c @@ -58,8 +58,8 @@ int BattleRegulation_GetRuleValue(const BattleRegulation *regulation, enum Battl case BATTLE_REGULATION_RULE_MAX_TOTAL_LEVEL: ruleValue = regulation->maxTotalLevel; break; - case BATTLE_REGULATION_RULE_SPECIES_RESTRICT: - ruleValue = regulation->speciesRestriction; + case BATTLE_REGULATION_RULE_EVOLUTION_RESTRICT: + ruleValue = regulation->evolutionRestriction; break; case BATTLE_REGULATION_RULE_HEIGHT_RESTRICT: ruleValue = regulation->heightRestriction; @@ -87,8 +87,8 @@ int BattleRegulation_GetRuleValue(const BattleRegulation *regulation, enum Battl case BATTLE_REGULATION_RULE_SPECIES_UNIQUE: ruleValue = regulation->speciesUniqueness; break; - case BATTLE_REGULATION_RULE_ITEM_RESTRICT: - ruleValue = regulation->itemRestriction; + case BATTLE_REGULATION_RULE_SPECIAL_SPECIES_RESTRICT: + ruleValue = regulation->specialSpeciesRestriction; break; case BATTLE_REGULATION_RULE_MOVE_RESTRICTIONS: ruleValue = regulation->moveRestrictions; @@ -124,8 +124,8 @@ BattleRegulation BattleRegulation_PredefinedRules[] = { .maxLevel = 50, .heightRestriction = 0, .weightRestriction = 0, - .speciesRestriction = 1, - .itemRestriction = 0, + .evolutionRestriction = 1, + .specialSpeciesRestriction = 0, .speciesUniqueness = 0, .itemUniqueness = 0, .moveRestrictions = 0, @@ -137,8 +137,8 @@ BattleRegulation BattleRegulation_PredefinedRules[] = { .maxLevel = 30, .heightRestriction = -20, .weightRestriction = -20, - .speciesRestriction = 0, - .itemRestriction = 0, + .evolutionRestriction = 0, + .specialSpeciesRestriction = 0, .speciesUniqueness = 0, .itemUniqueness = 0, .moveRestrictions = 0, @@ -150,8 +150,8 @@ BattleRegulation BattleRegulation_PredefinedRules[] = { .maxLevel = 5, .heightRestriction = 0, .weightRestriction = 0, - .speciesRestriction = 0, - .itemRestriction = 0, + .evolutionRestriction = 0, + .specialSpeciesRestriction = 0, .speciesUniqueness = 0, .itemUniqueness = 0, .moveRestrictions = 1, @@ -163,8 +163,8 @@ BattleRegulation BattleRegulation_PredefinedRules[] = { .maxLevel = 50, .heightRestriction = 0, .weightRestriction = -99, - .speciesRestriction = 0, - .itemRestriction = 0, + .evolutionRestriction = 0, + .specialSpeciesRestriction = 0, .speciesUniqueness = 0, .itemUniqueness = 0, .moveRestrictions = 0, @@ -176,8 +176,8 @@ BattleRegulation BattleRegulation_PredefinedRules[] = { .maxLevel = 50, .heightRestriction = 0, .weightRestriction = 0, - .speciesRestriction = 1, - .itemRestriction = 0, + .evolutionRestriction = 1, + .specialSpeciesRestriction = 0, .speciesUniqueness = 0, .itemUniqueness = 0, .moveRestrictions = 0, @@ -191,8 +191,8 @@ BattleRegulation BattleRegulation_DefaultRule = { .maxLevel = 100, .heightRestriction = 0, .weightRestriction = 0, - .speciesRestriction = 1, - .itemRestriction = 1, + .evolutionRestriction = 1, + .specialSpeciesRestriction = 1, .speciesUniqueness = 1, .itemUniqueness = 1, .moveRestrictions = 0, @@ -217,7 +217,7 @@ void BattleRegulation_GetNameByIndex(SaveData *saveData, int index, String *stri if (index < NELEMS(BattleRegulation_PredefinedRules)) { messageLoader = MessageLoader_Init(MSG_LOADER_PRELOAD_ENTIRE_BANK, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_UNK_0353, heapID); - MessageLoader_GetString(messageLoader, pl_msg_00000353_00070 + index, string); + MessageLoader_GetString(messageLoader, Unk0353_Text_StandardCup + index, string); MessageLoader_Free(messageLoader); } else { BattleRegulation_GetName(BattleRegulation_Load(saveData, 0), string); diff --git a/src/battle_regulation_validation.c b/src/battle_regulation_validation.c index d2027009fe..45bb39a6f2 100644 --- a/src/battle_regulation_validation.c +++ b/src/battle_regulation_validation.c @@ -28,7 +28,7 @@ BOOL BattleRegulation_ValidatePokemon(const BattleRegulation *regulation, Pokemo return FALSE; } - ruleValue = BattleRegulation_GetRuleValue(regulation, BATTLE_REGULATION_RULE_SPECIES_RESTRICT); + ruleValue = BattleRegulation_GetRuleValue(regulation, BATTLE_REGULATION_RULE_EVOLUTION_RESTRICT); if (ruleValue == 0) { if (species != Pokemon_GetBaseSpeciesForBattle(species)) { @@ -68,7 +68,7 @@ BOOL BattleRegulation_ValidatePokemon(const BattleRegulation *regulation, Pokemo } } - ruleValue = BattleRegulation_GetRuleValue(regulation, BATTLE_REGULATION_RULE_ITEM_RESTRICT); + ruleValue = BattleRegulation_GetRuleValue(regulation, BATTLE_REGULATION_RULE_SPECIAL_SPECIES_RESTRICT); if (ruleValue == 0) { if (Pokemon_IsBannedFromBattleFrontier(mon)) { @@ -79,14 +79,14 @@ BOOL BattleRegulation_ValidatePokemon(const BattleRegulation *regulation, Pokemo return TRUE; } -enum BattleRegulationValidationError BattleRegulation_ValidatePartySelection(const BattleRegulation *regulation, Party *party, const HeightWeightData *heightWeightData, u8 *selectedSlots) +enum BattleRegulationValidationResult BattleRegulation_ValidatePartySelection(const BattleRegulation *regulation, Party *party, const HeightWeightData *heightWeightData, u8 *selectedSlots) { Pokemon *mon; int ruleValue, selectedCount = 0, i, j, totalLevel = 0; u16 species[MAX_PARTY_SIZE], heldItems[MAX_PARTY_SIZE]; if (regulation == NULL) { - return BATTLE_REGULATION_VALIDATION_SUCCESS; + return BATTLE_REGULATION_VALIDATION_RESULT_SUCCESS; } for (i = 0; i < MAX_PARTY_SIZE; i++) { @@ -101,7 +101,7 @@ enum BattleRegulationValidationError BattleRegulation_ValidatePartySelection(con ruleValue = BattleRegulation_GetRuleValue(regulation, BATTLE_REGULATION_RULE_TEAM_SIZE); if (selectedCount != ruleValue) { - return BATTLE_REGULATION_VALIDATION_ERROR_INVALID_TEAM_SIZE; + return BATTLE_REGULATION_VALIDATION_RESULT_INVALID_TEAM_SIZE; } for (i = 0; i < MAX_PARTY_SIZE; i++) { @@ -111,7 +111,7 @@ enum BattleRegulationValidationError BattleRegulation_ValidatePartySelection(con mon = Party_GetPokemonBySlotIndex(party, slotIndex); if (BattleRegulation_ValidatePokemon(regulation, mon, heightWeightData) == FALSE) { - return BATTLE_REGULATION_VALIDATION_ERROR_INVALID_POKEMON; + return BATTLE_REGULATION_VALIDATION_RESULT_INVALID_POKEMON; } species[i] = (u16)Pokemon_GetValue(mon, MON_DATA_SPECIES, NULL); @@ -124,7 +124,7 @@ enum BattleRegulationValidationError BattleRegulation_ValidatePartySelection(con ruleValue = BattleRegulation_GetRuleValue(regulation, BATTLE_REGULATION_RULE_MAX_TOTAL_LEVEL); if (totalLevel > ruleValue && ruleValue != 0) { - return BATTLE_REGULATION_VALIDATION_ERROR_TOTAL_LEVEL_EXCEEDED; + return BATTLE_REGULATION_VALIDATION_RESULT_TOTAL_LEVEL_EXCEEDED; } ruleValue = BattleRegulation_GetRuleValue(regulation, BATTLE_REGULATION_RULE_SPECIES_UNIQUE); @@ -137,7 +137,7 @@ enum BattleRegulationValidationError BattleRegulation_ValidatePartySelection(con for (i = 0; i < (MAX_PARTY_SIZE - 1); i++) { for (j = i + 1; j < MAX_PARTY_SIZE; j++) { if (species[i] == species[j] && species[i] != 0) { - return BATTLE_REGULATION_VALIDATION_ERROR_DUPLICATE_SPECIES; + return BATTLE_REGULATION_VALIDATION_RESULT_DUPLICATE_SPECIES; } } } @@ -152,13 +152,13 @@ enum BattleRegulationValidationError BattleRegulation_ValidatePartySelection(con for (i = 0; i < (MAX_PARTY_SIZE - 1); i++) { for (j = i + 1; j < MAX_PARTY_SIZE; j++) { if (heldItems[i] == heldItems[j] && species[i] != 0 && heldItems[i] != 0) { - return BATTLE_REGULATION_VALIDATION_ERROR_DUPLICATE_ITEMS; + return BATTLE_REGULATION_VALIDATION_RESULT_DUPLICATE_ITEMS; } } } } - return BATTLE_REGULATION_VALIDATION_SUCCESS; + return BATTLE_REGULATION_VALIDATION_RESULT_SUCCESS; } static BOOL BattleRegulation_FindValidTeamCombination(u16 *species, u16 *levels, u16 *used, int maxLevelSum, int slotIndex, int remainingSlots, int totalSlots) @@ -198,7 +198,7 @@ static BOOL BattleRegulation_FindValidTeamCombination(u16 *species, u16 *levels, return FALSE; } -enum BattleRegulationValidationError BattleRegulation_SelectValidPokemon(const BattleRegulation *regulation, Party *party, const HeightWeightData *heightWeightData) +enum BattleRegulationValidationResult BattleRegulation_SelectValidPokemon(const BattleRegulation *regulation, Party *party, const HeightWeightData *heightWeightData) { Pokemon *mon; int ruleValue, partyCount, i, j, validCount = 0; @@ -223,10 +223,10 @@ enum BattleRegulationValidationError BattleRegulation_SelectValidPokemon(const B ruleValue = BattleRegulation_GetRuleValue(regulation, BATTLE_REGULATION_RULE_SPECIES_UNIQUE); - // Remove duplicate species by keeping the higher-level Pokémon + // Remove duplicate species by keeping the lower-level Pokémon if (ruleValue == 0 && partyCount > 1) { // Compare all pairs of Pokémon to find duplicates - for (i = 0; i < (partyCount - 1); i++) { + for (i = 0; i < partyCount - 1; i++) { for (j = i + 1; j < partyCount; j++) { if (species[i] == species[j] && species[i] != 0) { if (levels[i] > levels[j]) { @@ -244,21 +244,21 @@ enum BattleRegulationValidationError BattleRegulation_SelectValidPokemon(const B ruleValue = BattleRegulation_GetRuleValue(regulation, BATTLE_REGULATION_RULE_TEAM_SIZE); if (validCount < ruleValue) { - return BATTLE_REGULATION_VALIDATION_ERROR_INVALID_TEAM_SIZE; + return BATTLE_REGULATION_VALIDATION_RESULT_INVALID_TEAM_SIZE; } requiredCount = ruleValue; ruleValue = BattleRegulation_GetRuleValue(regulation, BATTLE_REGULATION_RULE_MAX_TOTAL_LEVEL); if (ruleValue == 0) { - return BATTLE_REGULATION_VALIDATION_SUCCESS; + return BATTLE_REGULATION_VALIDATION_RESULT_SUCCESS; } for (i = 0; i < partyCount; i++) { if (BattleRegulation_FindValidTeamCombination(species, levels, used, ruleValue, i, requiredCount, partyCount)) { - return BATTLE_REGULATION_VALIDATION_SUCCESS; + return BATTLE_REGULATION_VALIDATION_RESULT_SUCCESS; } } - return BATTLE_REGULATION_VALIDATION_ERROR_TOTAL_LEVEL_EXCEEDED; + return BATTLE_REGULATION_VALIDATION_RESULT_TOTAL_LEVEL_EXCEEDED; } diff --git a/src/field_map_change.c b/src/field_map_change.c index 1b1b367157..a239a1ad0a 100644 --- a/src/field_map_change.c +++ b/src/field_map_change.c @@ -72,7 +72,7 @@ #include "unk_02070428.h" #include "vars_flags.h" -#include "res/text/bank/pokemon_center_2f_attendants.h" +#include "res/text/bank/pokemon_center_2f_common.h" FS_EXTERN_OVERLAY(underground); @@ -1135,9 +1135,9 @@ BOOL FieldTask_MapChangeToUnderground(FieldTask *task) switch (ctx->state) { case ENTER_UNDERGROUND_INIT: - MessageLoader *msgLoader = MessageLoader_Init(MSG_LOADER_LOAD_ON_DEMAND, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_POKEMON_CENTER_2F_ATTENDANTS, HEAP_ID_FIELD2); + MessageLoader *msgLoader = MessageLoader_Init(MSG_LOADER_LOAD_ON_DEMAND, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_POKEMON_CENTER_2F_COMMON, HEAP_ID_FIELD2); - ctx->string = MessageLoader_GetNewString(msgLoader, PokeCenter2FAttendants_Text_CommsWillBeLaunched); + ctx->string = MessageLoader_GetNewString(msgLoader, PokemonCenter2FCommon_Text_CommsWillBeLaunched); MessageLoader_Free(msgLoader); FieldMessage_AddWindow(fieldSystem->bgConfig, &ctx->window, BG_LAYER_MAIN_3); diff --git a/src/meson.build b/src/meson.build index fb64a088f6..9d55a2df1f 100644 --- a/src/meson.build +++ b/src/meson.build @@ -479,7 +479,7 @@ pokeplatinum_c = files( 'overlay006/ov6_02248948.c', 'overlay006/ov6_022489E4.c', 'overlay007/communication_club.c', - 'overlay007/ov7_0224B4E8.c', + 'overlay007/battle_regulation_menu.c', 'overlay007/accessory_shop.c', 'overlay007/shop_menu.c', 'overlay008/ov8_02249960.c', diff --git a/src/overlay005/ov5_021EA874.c b/src/overlay005/ov5_021EA874.c index 5d2c5d881f..3aec0c8bf0 100644 --- a/src/overlay005/ov5_021EA874.c +++ b/src/overlay005/ov5_021EA874.c @@ -106,7 +106,7 @@ static BOOL ov5_021EA8F0(UnkStruct_ov5_021EAE78 *param0) WiFiList *v2 = SaveData_GetWiFiList(param0->saveData); for (v0 = 0; v0 < 32; v0++) { - if (!sub_0202AF78(v2, v0)) { + if (!WiFiList_IsValidFriendData(v2, v0)) { sub_02039298(param0->saveData, param0->unk_8C, v0, HEAP_ID_FIELD1, 0); break; } @@ -149,7 +149,7 @@ static BOOL ov5_021EA9F8(UnkStruct_ov5_021EAE78 *param0) WiFiList *v4 = SaveData_GetWiFiList(param0->saveData); for (v2 = 0; v2 < 32; v2++) { - if (!sub_0202AF78(v4, v2)) { + if (!WiFiList_IsValidFriendData(v4, v2)) { sub_02039298(param0->saveData, param0->unk_8C, v2, HEAP_ID_FIELD1, 0); break; } @@ -254,7 +254,7 @@ static BOOL ov5_021EAB58(UnkStruct_ov5_021EAE78 *param0) { WiFiList *v0 = SaveData_GetWiFiList(param0->saveData); ListMenuTemplate v1; - int v2 = sub_0202AF94(v0); + int v2 = WiFiList_GetValidFriendsCount(v0); int v3 = 5; param0->unk_00 = StringList_New(v2 + 1, HEAP_ID_FIELD1); @@ -267,7 +267,7 @@ static BOOL ov5_021EAB58(UnkStruct_ov5_021EAE78 *param0) int v5 = 0; for (v5 = 0; v5 < 32; v5++) { - if (sub_0202AF78(v0, v5)) { + if (WiFiList_IsValidFriendData(v0, v5)) { String_CopyChars(param0->unk_08, sub_0202AEF0(v0, v5)); StringList_AddFromString(param0->unk_00, param0->unk_08, v5); } diff --git a/src/overlay005/ov5_021F6454.c b/src/overlay005/ov5_021F6454.c index 2b62a6d7b4..cfb079fa45 100644 --- a/src/overlay005/ov5_021F6454.c +++ b/src/overlay005/ov5_021F6454.c @@ -448,74 +448,72 @@ BOOL ScrCmd_JudgeStats(ScriptContext *ctx) return 0; } -BOOL ScrCmd_31D(ScriptContext *param0) +BOOL ScrCmd_TryRevertPartyPokemonForms(ScriptContext *ctx) { - Pokemon *v0; - Party *v1; - int v2, v3, v4; - int v5, v6; - u32 v7; - int v8[6]; - int v9 = 0; - FieldSystem *fieldSystem = param0->fieldSystem; - u16 *v11 = ScriptContext_GetVarPointer(param0); + Pokemon *mon; + int slot, bagNotFull; + int species, form; + int items[MAX_PARTY_SIZE]; + int griseousOrbCount = 0; + FieldSystem *fieldSystem = ctx->fieldSystem; + u16 *destVar = ScriptContext_GetVarPointer(ctx); - v1 = SaveData_GetParty(fieldSystem->saveData); - v2 = Party_GetCurrentCount(v1); - *v11 = 0; + Party *party = SaveData_GetParty(fieldSystem->saveData); + int partyCount = Party_GetCurrentCount(party); + *destVar = 0; - for (v3 = 0; v3 < v2; v3++) { - v0 = Party_GetPokemonBySlotIndex(v1, v3); - v8[v3] = Pokemon_GetValue(v0, MON_DATA_HELD_ITEM, NULL); + for (slot = 0; slot < partyCount; slot++) { + mon = Party_GetPokemonBySlotIndex(party, slot); + items[slot] = Pokemon_GetValue(mon, MON_DATA_HELD_ITEM, NULL); - if (v8[v3] == ITEM_GRISEOUS_ORB) { - v9++; + if (items[slot] == ITEM_GRISEOUS_ORB) { + griseousOrbCount++; } } - if (v9 > 0) { - v4 = Bag_TryAddItem(SaveData_GetBag(fieldSystem->saveData), ITEM_GRISEOUS_ORB, v9, HEAP_ID_FIELD1); + if (griseousOrbCount > 0) { + bagNotFull = Bag_TryAddItem(SaveData_GetBag(fieldSystem->saveData), ITEM_GRISEOUS_ORB, griseousOrbCount, HEAP_ID_FIELD1); - if (v4 == 0) { - *v11 = 0xff; - return 0; + if (bagNotFull == FALSE) { + *destVar = 0xFF; + return FALSE; } - v7 = 0; + u32 emptyHeldItem = ITEM_NONE; - for (v3 = 0; v3 < v2; v3++) { - if (v8[v3] == ITEM_GRISEOUS_ORB) { - v0 = Party_GetPokemonBySlotIndex(v1, v3); - Pokemon_SetValue(v0, MON_DATA_HELD_ITEM, &v7); + for (slot = 0; slot < partyCount; slot++) { + if (items[slot] == ITEM_GRISEOUS_ORB) { + mon = Party_GetPokemonBySlotIndex(party, slot); + Pokemon_SetValue(mon, MON_DATA_HELD_ITEM, &emptyHeldItem); } } } - for (v3 = 0; v3 < v2; v3++) { - v0 = Party_GetPokemonBySlotIndex(v1, v3); - v6 = Pokemon_GetValue(v0, MON_DATA_FORM, NULL); + for (slot = 0; slot < partyCount; slot++) { + mon = Party_GetPokemonBySlotIndex(party, slot); + form = Pokemon_GetValue(mon, MON_DATA_FORM, NULL); - if (v6 > 0) { - v5 = Pokemon_GetValue(v0, MON_DATA_SPECIES, NULL); + if (form > 0) { + species = Pokemon_GetValue(mon, MON_DATA_SPECIES, NULL); - switch (v5) { + switch (species) { case SPECIES_GIRATINA: - Pokemon_SetGiratinaFormByHeldItem(v0); + Pokemon_SetGiratinaFormByHeldItem(mon); break; case SPECIES_ROTOM: - Pokemon_SetRotomForm(v0, ROTOM_FORM_BASE, 0); + Pokemon_SetRotomForm(mon, ROTOM_FORM_BASE, 0); break; case SPECIES_SHAYMIN: - Pokemon_SetShayminForm(v0, SHAYMIN_FORM_LAND); + Pokemon_SetShayminForm(mon, SHAYMIN_FORM_LAND); break; } } } - return 0; + return FALSE; } -BOOL ScrCmd_TryRevertPokemonForm(ScriptContext *param0) +BOOL ScrCmd_TryRevertPokemonForm(ScriptContext *ctx) { Pokemon *mon; Party *party; @@ -523,9 +521,9 @@ BOOL ScrCmd_TryRevertPokemonForm(ScriptContext *param0) u32 emptyHeldItem; int currentHeldItem; int bagNotFull; - FieldSystem *fieldSystem = param0->fieldSystem; - u16 partySlot = ScriptContext_GetVar(param0); - u16 *result = ScriptContext_GetVarPointer(param0); + FieldSystem *fieldSystem = ctx->fieldSystem; + u16 partySlot = ScriptContext_GetVar(ctx); + u16 *result = ScriptContext_GetVarPointer(ctx); party = SaveData_GetParty(fieldSystem->saveData); mon = Party_GetPokemonBySlotIndex(party, partySlot); @@ -533,7 +531,7 @@ BOOL ScrCmd_TryRevertPokemonForm(ScriptContext *param0) *result = 0; if (partySlot == 0xff) { - return 0; + return FALSE; } currentHeldItem = Pokemon_GetValue(mon, MON_DATA_HELD_ITEM, NULL); @@ -541,12 +539,12 @@ BOOL ScrCmd_TryRevertPokemonForm(ScriptContext *param0) if (currentHeldItem == ITEM_GRISEOUS_ORB) { bagNotFull = Bag_TryAddItem(SaveData_GetBag(fieldSystem->saveData), ITEM_GRISEOUS_ORB, 1, HEAP_ID_FIELD1); - if (bagNotFull == 0) { - *result = 0xff; - return 0; + if (bagNotFull == FALSE) { + *result = 0xFF; + return FALSE; } - emptyHeldItem = 0; + emptyHeldItem = ITEM_NONE; Pokemon_SetValue(mon, MON_DATA_HELD_ITEM, &emptyHeldItem); } @@ -568,7 +566,7 @@ BOOL ScrCmd_TryRevertPokemonForm(ScriptContext *param0) } } - return 0; + return FALSE; } BOOL ScrCmd_2F1(ScriptContext *param0) diff --git a/src/overlay007/battle_regulation_menu.c b/src/overlay007/battle_regulation_menu.c new file mode 100644 index 0000000000..ea9eeeac2f --- /dev/null +++ b/src/overlay007/battle_regulation_menu.c @@ -0,0 +1,580 @@ +#include "overlay007/battle_regulation_menu.h" + +#include +#include + +#include "constants/field_base_tiles.h" +#include "constants/heap.h" + +#include "field/field_system.h" + +#include "battle_regulation.h" +#include "battle_regulation_validation.h" +#include "bg_window.h" +#include "field_message.h" +#include "field_task.h" +#include "font.h" +#include "heap.h" +#include "height_weight_data.h" +#include "list_menu.h" +#include "message.h" +#include "party.h" +#include "pokedex_heightweight.h" +#include "render_window.h" +#include "save_player.h" +#include "sound_playback.h" +#include "string_gf.h" +#include "string_list.h" +#include "string_template.h" +#include "system.h" +#include "text.h" + +#include "res/text/bank/pokemon_center_2f_common.h" +#include "res/text/bank/unk_0353.h" + +typedef struct BattleRegulationMenu { + ListMenu *listMenuRegulations; + ListMenu *listMenuConfirm; + StringList *strListRegulations; + StringList *strListConfirm; + FieldSystem *fieldSystem; + String *fmtString; + String *dstString; + String *regulationName; + String *cupString; + Window windowRules; + Window windowRegulations; + Window windowConfirm; + Window windowMsgBox; + StringTemplate *strTemplate; + MessageLoader *msgLoader; + HeightWeightData *heighWeightData; + u16 *result; + int printerID; + u16 cursorPosRegulations; + u16 cursorPosConfirm; + int state; + u16 unk_80; + u16 unk_82; +} BattleRegulationMenu; + +typedef struct ConfirmMenuEntry { + u32 bankEntry; + u32 index; +} ConfirmMenuEntry; + +static const ListMenuTemplate sListMenuTemplate = { + .choices = NULL, + .cursorCallback = NULL, + .printCallback = NULL, + .window = NULL, + .count = 0, + .maxDisplay = 0, + .headerXOffset = 0, + .textXOffset = 8, + .cursorXOffset = 0, + .yOffset = 0, + .textColorFg = 1, + .textColorBg = 15, + .textColorShadow = 2, + .letterSpacing = 0, + .lineSpacing = 16, + .pagerMode = PAGER_MODE_LEFT_RIGHT_PAD, + .fontID = FONT_SYSTEM, + .cursorType = 0, + .parent = NULL +}; + +static void PrintMessage(BattleRegulationMenu *menu, int entryID) +{ + if (Window_IsInUse(&menu->windowMsgBox) == FALSE) { + Window_Init(&menu->windowMsgBox); + FieldMessage_AddWindow(menu->fieldSystem->bgConfig, &menu->windowMsgBox, BG_LAYER_MAIN_3); + FieldMessage_DrawWindow(&menu->windowMsgBox, SaveData_GetOptions(menu->fieldSystem->saveData)); + } else { + FieldMessage_ClearWindow(&menu->windowMsgBox); + } + + MessageLoader_GetString(menu->msgLoader, entryID, menu->fmtString); + StringTemplate_Format(menu->strTemplate, menu->dstString, menu->fmtString); + + menu->printerID = FieldMessage_Print(&menu->windowMsgBox, menu->dstString, SaveData_GetOptions(menu->fieldSystem->saveData), 1); +} + +static void RemoveMsgBox(BattleRegulationMenu *menu, BOOL clear) +{ + if (clear) { + Window_EraseMessageBox(&menu->windowMsgBox, FALSE); + Window_ClearAndCopyToVRAM(&menu->windowMsgBox); + } + + Window_Remove(&menu->windowMsgBox); +} + +static void GetBattleRegulationName(BattleRegulationMenu *menu, int index) +{ + BattleRegulation_GetNameByIndex(menu->fieldSystem->saveData, index, menu->regulationName, HEAP_ID_FIELD1); + StringTemplate_SetString(menu->strTemplate, 0, menu->regulationName, 0, 1, GAME_LANGUAGE); +} + +static void ShowListMenuRegulations(BattleRegulationMenu *menu) +{ + ListMenuTemplate template; + Window *window = &(menu->windowRegulations); + BattleRegulation *battleRegulation = BattleRegulation_Load(menu->fieldSystem->saveData, 0); + int count = 5; + + if (battleRegulation) { + count++; + } + + if (Window_IsInUse(window) == FALSE) { + menu->strListRegulations = StringList_New(count + 2, HEAP_ID_FIELD1); + + Window_Add(menu->fieldSystem->bgConfig, window, BG_LAYER_MAIN_3, 1, 1, 16, (count + 2) * 2, 13, 1); + Window_DrawStandardFrame(&menu->windowRegulations, 1, BASE_TILE_STANDARD_WINDOW_FRAME, 11); + StringList_AddFromMessageBank(menu->strListRegulations, menu->msgLoader, PokemonCenter2FCommon_Text_NoRestrictions, 12); + + for (int i = 0; i < count; i++) { + GetBattleRegulationName(menu, i); + + MessageLoader_GetString(menu->msgLoader, PokemonCenter2FCommon_Text_Cup, menu->regulationName); + StringTemplate_Format(menu->strTemplate, menu->cupString, menu->regulationName); + StringList_AddFromString(menu->strListRegulations, menu->cupString, i); + } + + StringList_AddFromMessageBank(menu->strListRegulations, menu->msgLoader, PokemonCenter2FCommon_Text_Cancel, MENU_CANCEL); + } + + template = sListMenuTemplate; + template.count = count + 2; + template.maxDisplay = count + 2; + template.choices = menu->strListRegulations; + template.window = &menu->windowRegulations; + template.parent = menu; + + menu->listMenuRegulations = ListMenu_New(&template, 0, menu->cursorPosRegulations, HEAP_ID_FIELD1); + Window_CopyToVRAM(&menu->windowRegulations); +} + +static void RemoveListMenuRegulations(BattleRegulationMenu *menu) +{ + if (menu->listMenuRegulations) { + ListMenu_Free(menu->listMenuRegulations, NULL, NULL); + Window_EraseStandardFrame(&menu->windowRegulations, TRUE); + Bg_ScheduleTilemapTransfer(menu->windowRegulations.bgConfig, menu->windowRegulations.bgLayer); + Window_Remove(&menu->windowRegulations); + StringList_Free(menu->strListRegulations); + + menu->listMenuRegulations = NULL; + } +} + +static int ProcessListMenuInputRegulations(BattleRegulationMenu *menu) +{ + int input = ListMenu_ProcessInput(menu->listMenuRegulations); + ListMenu_GetListAndCursorPos(menu->listMenuRegulations, NULL, &menu->cursorPosRegulations); + + u16 v1 = menu->unk_80; + ListMenu_CalcTrueCursorPos(menu->listMenuRegulations, &menu->unk_80); + + if (v1 != menu->unk_80) { + Sound_PlayEffect(SEQ_SE_CONFIRM); + } + + switch (input) { + case MENU_NOTHING_CHOSEN: + return 0; + case 12: + Sound_PlayEffect(SEQ_SE_CONFIRM); + menu->fieldSystem->battleRegulation = NULL; + RemoveListMenuRegulations(menu); + return 2; + case MENU_CANCEL: + Sound_PlayEffect(SEQ_SE_CONFIRM); + menu->fieldSystem->battleRegulation = NULL; + RemoveListMenuRegulations(menu); + return -1; + default: + Sound_PlayEffect(SEQ_SE_CONFIRM); + menu->fieldSystem->battleRegulation = BattleRegulation_GetByIndex(menu->fieldSystem->saveData, input); + break; + } + + return 1; +} + +static ConfirmMenuEntry sConfirmMenuEntries[] = { + { PokemonCenter2FCommon_Text_Confirm, 1 }, + { PokemonCenter2FCommon_Text_Rules, 2 }, + { PokemonCenter2FCommon_Text_Cancel, MENU_CANCEL } +}; + +static void ShowListMenuConfirm(BattleRegulationMenu *menu) +{ + ListMenuTemplate template; + int count = 3; + int tilemapTop = 10; + int width = 9; + int tilemapLeft = 22; + ConfirmMenuEntry *menuEntry = sConfirmMenuEntries; + + menu->strListConfirm = StringList_New(count, HEAP_ID_FIELD1); + + Window_Add(menu->fieldSystem->bgConfig, &menu->windowConfirm, BG_LAYER_MAIN_3, tilemapLeft, tilemapTop, width, count * 2, 13, BASE_TILE_MESSAGE_WINDOW - width * count * 2); + Window_DrawStandardFrame(&menu->windowConfirm, 1, BASE_TILE_STANDARD_WINDOW_FRAME, 11); + + for (int i = 0; i < count; i++) { + StringList_AddFromMessageBank(menu->strListConfirm, menu->msgLoader, menuEntry->bankEntry, menuEntry->index); + menuEntry++; + } + + template = sListMenuTemplate; + template.count = count; + template.maxDisplay = count; + template.choices = menu->strListConfirm; + template.window = &menu->windowConfirm; + template.parent = menu; + + menu->listMenuConfirm = ListMenu_New(&template, 0, menu->cursorPosConfirm, HEAP_ID_FIELD1); + Window_CopyToVRAM(&menu->windowConfirm); +} + +static int ProcessListMenuInputConfirm(BattleRegulationMenu *menu) +{ + int input = ListMenu_ProcessInput(menu->listMenuConfirm); + ListMenu_GetListAndCursorPos(menu->listMenuConfirm, NULL, &menu->cursorPosConfirm); + + u16 v1 = menu->unk_82; + ListMenu_CalcTrueCursorPos(menu->listMenuConfirm, &menu->unk_82); + + if (v1 != menu->unk_82) { + Sound_PlayEffect(SEQ_SE_CONFIRM); + } + + switch (input) { + case MENU_NOTHING_CHOSEN: + return 0; + case MENU_CANCEL: + Sound_PlayEffect(SEQ_SE_CONFIRM); + input = -1; + break; + default: + Sound_PlayEffect(SEQ_SE_CONFIRM); + RemoveListMenuRegulations(menu); + break; + } + + if (menu->listMenuConfirm) { + ListMenu_Free(menu->listMenuConfirm, NULL, NULL); + Window_EraseStandardFrame(&menu->windowConfirm, TRUE); + Bg_ScheduleTilemapTransfer(menu->windowConfirm.bgConfig, menu->windowConfirm.bgLayer); + Window_Remove(&menu->windowConfirm); + StringList_Free(menu->strListConfirm); + + menu->listMenuConfirm = NULL; + } + + return input; +} + +#define RULES_COUNT 9 + +static u8 sBattleRegulationRules[RULES_COUNT] = { + BATTLE_REGULATION_RULE_TEAM_SIZE, + BATTLE_REGULATION_RULE_MAX_LEVEL, + BATTLE_REGULATION_RULE_MAX_TOTAL_LEVEL, + BATTLE_REGULATION_RULE_HEIGHT_RESTRICT, + BATTLE_REGULATION_RULE_WEIGHT_RESTRICT, + BATTLE_REGULATION_RULE_EVOLUTION_RESTRICT, + BATTLE_REGULATION_RULE_SPECIAL_SPECIES_RESTRICT, + BATTLE_REGULATION_RULE_SPECIES_UNIQUE, + BATTLE_REGULATION_RULE_ITEM_UNIQUE +}; + +static u8 sBattleRegulationValueMessages[RULES_COUNT] = { + Unk0353_Text_ValueNoOfPokemon, + Unk0353_Text_ValueMaxLevel, + Unk0353_Text_ValueMaxTotalLevels, + Unk0353_Text_ValueMaxHeight, + Unk0353_Text_ValueMaxWeight, + Unk0353_Text_ValuePokemonPermitted, + Unk0353_Text_ValuePokemonPermitted, + Unk0353_Text_ValuePokemonPermitted, + Unk0353_Text_ValueItemsPermitted +}; + +static void ShowBattleRegulationRules(BattleRegulationMenu *menu) +{ + StringTemplate *strTemplate = menu->strTemplate; + int i, ruleValue, valueMessage; + const int yOffset = 16; + const int xOffset = 2; + const int lineHeight = 15; + const int xOffsetCupName = 55; + const int xRightSide = (24 * 8) - 1; + + MessageLoader *msgLoader = MessageLoader_Init(MSG_LOADER_PRELOAD_ENTIRE_BANK, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_UNK_0353, HEAP_ID_FIELD1); + String *fmtString = String_Init(180, HEAP_ID_FIELD1); + String *dstString = String_Init(180, HEAP_ID_FIELD1); + Window *window = &menu->windowRules; + + Window_Add(menu->fieldSystem->bgConfig, window, BG_LAYER_MAIN_3, 4, 2, 24, 19, 13, 1); + Window_DrawStandardFrame(window, 1, BASE_TILE_STANDARD_WINDOW_FRAME, 11); + Window_FillTilemap(window, 15); + + GetBattleRegulationName(menu, menu->cursorPosRegulations - 1); + + MessageLoader_GetString(msgLoader, Unk0353_Text_Cup, fmtString); + StringTemplate_Format(strTemplate, dstString, fmtString); + Text_AddPrinterWithParams(window, FONT_SYSTEM, dstString, xOffset + xOffsetCupName, 0, TEXT_SPEED_NO_TRANSFER, NULL); + + for (i = 0; i < RULES_COUNT; i++) { + MessageLoader_GetString(msgLoader, Unk0353_Text_RuleNoOfPokemon + i, fmtString); + Text_AddPrinterWithParams(window, FONT_SYSTEM, fmtString, xOffset, yOffset + lineHeight * i, TEXT_SPEED_NO_TRANSFER, NULL); + } + + for (i = 0; i < RULES_COUNT; i++) { + ruleValue = BattleRegulation_GetRuleValue(menu->fieldSystem->battleRegulation, sBattleRegulationRules[i]); + valueMessage = sBattleRegulationValueMessages[i]; + + switch (sBattleRegulationRules[i]) { + case BATTLE_REGULATION_RULE_TEAM_SIZE: + StringTemplate_SetNumber(strTemplate, 0, ruleValue, 1, 1, 1); + break; + case BATTLE_REGULATION_RULE_MAX_LEVEL: + StringTemplate_SetNumber(strTemplate, 0, ruleValue, 3, 0, 1); + break; + case BATTLE_REGULATION_RULE_MAX_TOTAL_LEVEL: + if (ruleValue == 0) { + valueMessage = Unk0353_Text_NoRestrictions; + } else { + StringTemplate_SetNumber(strTemplate, 0, ruleValue, 3, 0, 1); + } + break; + case BATTLE_REGULATION_RULE_HEIGHT_RESTRICT: + ruleValue = (ruleValue >= 0) ? (((ruleValue * 10 * 1000) / 254 + 5) / 10) : -(((-ruleValue * 10 * 1000) / 254 + 5) / 10); + + StringTemplate_SetNumber(strTemplate, 0, abs(ruleValue / 12), 2, 0, 1); + StringTemplate_SetNumber(strTemplate, 1, abs(ruleValue % 12), 2, 2, 1); + + if (ruleValue == 0) { + valueMessage = Unk0353_Text_NoRestrictions; + } else if (ruleValue > 0) { + valueMessage++; + } + break; + case BATTLE_REGULATION_RULE_WEIGHT_RESTRICT: + ruleValue = (ruleValue >= 0) ? (((ruleValue * 220462) + 50000) / 100000) : -(((-ruleValue * 220462) + 50000) / 100000); + StringTemplate_SetNumber(strTemplate, 0, abs(ruleValue), 3, 0, 1); + + if (ruleValue == 0) { + valueMessage = Unk0353_Text_NoRestrictions; + } else if (ruleValue > 0) { + valueMessage++; + } + break; + case BATTLE_REGULATION_RULE_EVOLUTION_RESTRICT: + case BATTLE_REGULATION_RULE_SPECIAL_SPECIES_RESTRICT: + case BATTLE_REGULATION_RULE_SPECIES_UNIQUE: + case BATTLE_REGULATION_RULE_ITEM_UNIQUE: + if (ruleValue == 0) { + valueMessage++; + } + break; + default: + break; + } + + MessageLoader_GetString(msgLoader, valueMessage, fmtString); + StringTemplate_Format(strTemplate, dstString, fmtString); + int valueWidth = Font_CalcStringWidth(FONT_SYSTEM, dstString, 0); + int valueXOffset = xRightSide - valueWidth; + + Text_AddPrinterWithParams(window, FONT_SYSTEM, dstString, valueXOffset, yOffset + lineHeight * i, TEXT_SPEED_NO_TRANSFER, NULL); + } + + String_Free(fmtString); + String_Free(dstString); + MessageLoader_Free(msgLoader); + Window_CopyToVRAM(window); +} + +static void RemoveRulesWindow(BattleRegulationMenu *menu) +{ + Window_EraseStandardFrame(&menu->windowRules, TRUE); + Bg_ScheduleTilemapTransfer(menu->windowRules.bgConfig, menu->windowRules.bgLayer); + Window_Remove(&menu->windowRules); +} + +static BOOL HandleBattleRegulationValidationResult(BattleRegulationMenu *menu) +{ + Party *party = SaveData_GetParty(menu->fieldSystem->saveData); + enum BattleRegulationValidationResult result = BattleRegulation_SelectValidPokemon(menu->fieldSystem->battleRegulation, party, menu->heighWeightData); + int ruleValue; + + switch (result) { + case BATTLE_REGULATION_VALIDATION_RESULT_SUCCESS: + return TRUE; + case BATTLE_REGULATION_VALIDATION_RESULT_INVALID_TEAM_SIZE: + Sound_PlayEffect(SEQ_SE_DP_BOX03); + GetBattleRegulationName(menu, menu->cursorPosRegulations - 1); + ruleValue = BattleRegulation_GetRuleValue(menu->fieldSystem->battleRegulation, BATTLE_REGULATION_RULE_TEAM_SIZE); + StringTemplate_SetNumber(menu->strTemplate, 1, ruleValue, 1, PADDING_MODE_SPACES, CHARSET_MODE_EN); + PrintMessage(menu, PokemonCenter2FCommon_Text_NeedXPokemonForCup); + break; + default: + case BATTLE_REGULATION_VALIDATION_RESULT_TOTAL_LEVEL_EXCEEDED: + Sound_PlayEffect(SEQ_SE_DP_BOX03); + GetBattleRegulationName(menu, menu->cursorPosRegulations - 1); + ruleValue = BattleRegulation_GetRuleValue(menu->fieldSystem->battleRegulation, BATTLE_REGULATION_RULE_MAX_TOTAL_LEVEL); + StringTemplate_SetNumber(menu->strTemplate, 1, ruleValue, 3, PADDING_MODE_NONE, CHARSET_MODE_EN); + PrintMessage(menu, PokemonCenter2FCommon_Text_CantFormTeamWithLevelLimit); + break; + } + + return FALSE; +} + +enum BattleRegulationMenuState { + STATE_PRINT_WHICH_RULESET = 0, + STATE_SHOW_LIST_MENU_REGULATIONS, + STATE_HANDLE_INPUT_REGULATIONS, + STATE_SHOW_LIST_MENU_CONFIRM, + STATE_HANDLE_INPUT_CONFIRM, + STATE_CHECK_VALID_TEAM, + STATE_WAIT_MESSAGE_INVALID_TEAM, + STATE_PRINT_RULES, + STATE_RESHOW_MENU_AFTER_RULES, + STATE_WAIT_RESHOW_CONFIRM_MENU, + STATE_UNUSED, + STATE_EXIT, +}; + +static BOOL FieldTask_BattleRegulationMenu(FieldTask *task) +{ + FieldSystem *fieldSystem = FieldTask_GetFieldSystem(task); + BattleRegulationMenu *menu = FieldTask_GetEnv(task); + int input; + + switch (menu->state) { + case STATE_PRINT_WHICH_RULESET: + PrintMessage(menu, PokemonCenter2FCommon_Text_WhichSetOfRules); + menu->state++; + break; + case STATE_SHOW_LIST_MENU_REGULATIONS: + if (FieldMessage_FinishedPrinting(menu->printerID)) { + ShowListMenuRegulations(menu); + menu->state++; + } + break; + case STATE_HANDLE_INPUT_REGULATIONS: + input = ProcessListMenuInputRegulations(menu); + + if (input == -1) { + *menu->result = 2; + menu->state = STATE_EXIT; + } else if (input == 2) { + *menu->result = 3; + menu->state = STATE_EXIT; + } else if (input == 1) { + menu->state = STATE_SHOW_LIST_MENU_CONFIRM; + } + break; + case STATE_SHOW_LIST_MENU_CONFIRM: + ShowListMenuConfirm(menu); + menu->state++; + break; + case STATE_HANDLE_INPUT_CONFIRM: + input = ProcessListMenuInputConfirm(menu); + + if (input == -1) { + menu->state = STATE_HANDLE_INPUT_REGULATIONS; + } else if (input == 1) { + menu->state = STATE_CHECK_VALID_TEAM; + } else if (input == 2) { + menu->state = STATE_PRINT_RULES; + } + break; + case STATE_CHECK_VALID_TEAM: + if (HandleBattleRegulationValidationResult(menu)) { + *menu->result = 1; + menu->state = STATE_EXIT; + } else { + menu->state = STATE_WAIT_MESSAGE_INVALID_TEAM; + } + break; + case STATE_WAIT_MESSAGE_INVALID_TEAM: + if (FieldMessage_FinishedPrinting(menu->printerID)) { + if (gSystem.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { + menu->state = STATE_PRINT_WHICH_RULESET; + } + } + break; + case STATE_PRINT_RULES: + RemoveMsgBox(menu, TRUE); + ShowBattleRegulationRules(menu); + menu->state++; + break; + case STATE_RESHOW_MENU_AFTER_RULES: + if (gSystem.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { + RemoveRulesWindow(menu); + PrintMessage(menu, PokemonCenter2FCommon_Text_WhichSetOfRules); + ShowListMenuRegulations(menu); + menu->state = STATE_WAIT_RESHOW_CONFIRM_MENU; + } + break; + case STATE_WAIT_RESHOW_CONFIRM_MENU: + if (FieldMessage_FinishedPrinting(menu->printerID)) { + menu->state = STATE_SHOW_LIST_MENU_CONFIRM; + } + break; + case STATE_UNUSED: + break; + case STATE_EXIT: + RemoveListMenuRegulations(menu); + RemoveMsgBox(menu, FALSE); + StringTemplate_Free(menu->strTemplate); + MessageLoader_Free(menu->msgLoader); + String_Free(menu->fmtString); + String_Free(menu->dstString); + String_Free(menu->regulationName); + String_Free(menu->cupString); + HeightWeightData_Free(menu->heighWeightData); + Heap_Free(menu); + return TRUE; + default: + return TRUE; + } + + return FALSE; +} + +static BattleRegulationMenu *NewBattleRegulationMenu(FieldSystem *fieldSystem) +{ + BattleRegulationMenu *menu = Heap_AllocAtEnd(HEAP_ID_FIELD2, sizeof(BattleRegulationMenu)); + + MI_CpuClear8(menu, sizeof(BattleRegulationMenu)); + + menu->state = 0; + menu->fieldSystem = fieldSystem; + menu->fieldSystem->battleRegulation = NULL; + menu->strTemplate = StringTemplate_Default(HEAP_ID_FIELD1); + menu->msgLoader = MessageLoader_Init(MSG_LOADER_PRELOAD_ENTIRE_BANK, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_POKEMON_CENTER_2F_COMMON, HEAP_ID_FIELD1); + menu->fmtString = String_Init(180, HEAP_ID_FIELD1); + menu->dstString = String_Init(180, HEAP_ID_FIELD1); + menu->regulationName = String_Init(180, HEAP_ID_FIELD1); + menu->cupString = String_Init(180, HEAP_ID_FIELD1); + menu->heighWeightData = HeightWeightData_Load(HEAP_ID_FIELD2); + + return menu; +} + +void OpenBattleRegulationMenu(FieldTask *task, u16 *result) +{ + FieldSystem *fieldSystem = FieldTask_GetFieldSystem(task); + BattleRegulationMenu *menu = NewBattleRegulationMenu(fieldSystem); + + menu->result = result; + FieldTask_InitCall(task, FieldTask_BattleRegulationMenu, menu); +} diff --git a/src/overlay007/ov7_0224B4E8.c b/src/overlay007/ov7_0224B4E8.c deleted file mode 100644 index 6c4386c0ef..0000000000 --- a/src/overlay007/ov7_0224B4E8.c +++ /dev/null @@ -1,577 +0,0 @@ -#include "overlay007/ov7_0224B4E8.h" - -#include -#include - -#include "constants/heap.h" - -#include "field/field_system.h" - -#include "battle_regulation.h" -#include "battle_regulation_validation.h" -#include "bg_window.h" -#include "field_message.h" -#include "field_task.h" -#include "font.h" -#include "heap.h" -#include "height_weight_data.h" -#include "list_menu.h" -#include "message.h" -#include "party.h" -#include "pokedex_heightweight.h" -#include "render_window.h" -#include "save_player.h" -#include "sound_playback.h" -#include "string_gf.h" -#include "string_list.h" -#include "string_template.h" -#include "system.h" -#include "text.h" - -typedef struct { - ListMenu *unk_00; - ListMenu *unk_04; - StringList *unk_08; - StringList *unk_0C; - FieldSystem *fieldSystem; - String *unk_14; - String *unk_18; - String *unk_1C; - String *unk_20; - Window unk_24; - Window unk_34; - Window unk_44; - Window unk_54; - StringTemplate *unk_64; - MessageLoader *unk_68; - HeightWeightData *unk_6C; - u16 *unk_70; - int unk_74; - u16 unk_78; - u16 unk_7A; - int unk_7C; - u16 unk_80; - u16 unk_82; -} UnkStruct_ov7_0224B4E8; - -typedef struct { - u32 unk_00; - u32 unk_04; -} UnkStruct_ov7_0224F4D8; - -static const ListMenuTemplate Unk_ov7_0224F188 = { - NULL, - NULL, - NULL, - NULL, - 0x0, - 0x0, - 0x0, - 0x8, - 0x0, - 0x0, - 0x1, - 0xF, - 0x2, - 0x0, - 0x10, - 0x1, - 0x0, - 0x0, - NULL -}; - -static void ov7_0224B4E8(UnkStruct_ov7_0224B4E8 *param0, int param1) -{ - if (Window_IsInUse(¶m0->unk_54) == 0) { - Window_Init(¶m0->unk_54); - FieldMessage_AddWindow(param0->fieldSystem->bgConfig, ¶m0->unk_54, 3); - FieldMessage_DrawWindow(¶m0->unk_54, SaveData_GetOptions(param0->fieldSystem->saveData)); - } else { - FieldMessage_ClearWindow(¶m0->unk_54); - } - - MessageLoader_GetString(param0->unk_68, param1, param0->unk_14); - StringTemplate_Format(param0->unk_64, param0->unk_18, param0->unk_14); - - param0->unk_74 = FieldMessage_Print(¶m0->unk_54, param0->unk_18, SaveData_GetOptions(param0->fieldSystem->saveData), 1); -} - -static void ov7_0224B558(UnkStruct_ov7_0224B4E8 *param0, BOOL param1) -{ - if (param1) { - Window_EraseMessageBox(¶m0->unk_54, 0); - Window_ClearAndCopyToVRAM(¶m0->unk_54); - } - - Window_Remove(¶m0->unk_54); -} - -static void ov7_0224B57C(UnkStruct_ov7_0224B4E8 *param0, int param1) -{ - BattleRegulation_GetNameByIndex(param0->fieldSystem->saveData, param1, param0->unk_1C, HEAP_ID_FIELD1); - StringTemplate_SetString(param0->unk_64, 0, param0->unk_1C, 0, 1, GAME_LANGUAGE); -} - -static void ov7_0224B5A8(UnkStruct_ov7_0224B4E8 *param0) -{ - ListMenuTemplate v0; - Window *v1 = &(param0->unk_34); - BattleRegulation *v2 = BattleRegulation_Load(param0->fieldSystem->saveData, 0); - int v3 = 5; - - if (v2) { - v3++; - } - - if (Window_IsInUse(v1) == 0) { - int v4; - - param0->unk_08 = StringList_New(v3 + 2, HEAP_ID_FIELD1); - - Window_Add(param0->fieldSystem->bgConfig, v1, 3, 1, 1, 16, (v3 + 2) * 2, 13, 1); - Window_DrawStandardFrame(¶m0->unk_34, 1, 1024 - (18 + 12) - 9, 11); - StringList_AddFromMessageBank(param0->unk_08, param0->unk_68, 123, 12); - - for (v4 = 0; v4 < v3; v4++) { - ov7_0224B57C(param0, v4); - - MessageLoader_GetString(param0->unk_68, 113, param0->unk_1C); - StringTemplate_Format(param0->unk_64, param0->unk_20, param0->unk_1C); - StringList_AddFromString(param0->unk_08, param0->unk_20, v4); - } - - StringList_AddFromMessageBank(param0->unk_08, param0->unk_68, 114, 0xfffffffe); - } - - v0 = Unk_ov7_0224F188; - v0.count = v3 + 2; - v0.maxDisplay = v3 + 2; - v0.choices = param0->unk_08; - v0.window = ¶m0->unk_34; - v0.parent = param0; - - param0->unk_00 = ListMenu_New(&v0, 0, param0->unk_78, HEAP_ID_FIELD1); - Window_CopyToVRAM(¶m0->unk_34); -} - -static void ov7_0224B6AC(UnkStruct_ov7_0224B4E8 *param0) -{ - if (param0->unk_00) { - ListMenu_Free(param0->unk_00, NULL, NULL); - Window_EraseStandardFrame(¶m0->unk_34, 1); - Bg_ScheduleTilemapTransfer(param0->unk_34.bgConfig, param0->unk_34.bgLayer); - Window_Remove(¶m0->unk_34); - StringList_Free(param0->unk_08); - - param0->unk_00 = NULL; - } -} - -static int ov7_0224B6E8(UnkStruct_ov7_0224B4E8 *param0) -{ - int v0; - u16 v1; - - v0 = ListMenu_ProcessInput(param0->unk_00); - ListMenu_GetListAndCursorPos(param0->unk_00, NULL, ¶m0->unk_78); - - v1 = param0->unk_80; - ListMenu_CalcTrueCursorPos(param0->unk_00, ¶m0->unk_80); - - if (v1 != param0->unk_80) { - Sound_PlayEffect(SEQ_SE_CONFIRM); - } - - switch (v0) { - case 0xffffffff: - return 0; - case 12: - Sound_PlayEffect(SEQ_SE_CONFIRM); - param0->fieldSystem->battleRegulation = NULL; - ov7_0224B6AC(param0); - return 2; - case 0xfffffffe: - Sound_PlayEffect(SEQ_SE_CONFIRM); - param0->fieldSystem->battleRegulation = NULL; - ov7_0224B6AC(param0); - return -1; - default: - Sound_PlayEffect(SEQ_SE_CONFIRM); - param0->fieldSystem->battleRegulation = BattleRegulation_GetByIndex(param0->fieldSystem->saveData, v0); - break; - } - - return 1; -} - -static UnkStruct_ov7_0224F4D8 Unk_ov7_0224F4D8[] = { - { 0x73, (u32)1 }, - { 0x74, (u32)2 }, - { 0x72, (u32)0xfffffffe } -}; - -static void ov7_0224B788(UnkStruct_ov7_0224B4E8 *param0) -{ - ListMenuTemplate v0; - int v1 = 3, v2; - int v3 = 10; - int v4 = 9; - int v5 = 22; - UnkStruct_ov7_0224F4D8 *v6 = Unk_ov7_0224F4D8; - - param0->unk_0C = StringList_New(v1, HEAP_ID_FIELD1); - - Window_Add(param0->fieldSystem->bgConfig, ¶m0->unk_44, 3, v5, v3, v4, v1 * 2, 13, (((1024 - (18 + 12) - 9 - (32 * 8)) - (18 + 12 + 24)) - (27 * 4)) - v4 * v1 * 2); - Window_DrawStandardFrame(¶m0->unk_44, 1, 1024 - (18 + 12) - 9, 11); - - { - int v7; - - for (v7 = 0; v7 < v1; v7++) { - StringList_AddFromMessageBank(param0->unk_0C, param0->unk_68, v6->unk_00, v6->unk_04); - v6++; - } - } - - v0 = Unk_ov7_0224F188; - v0.count = v1; - v0.maxDisplay = v1; - v0.choices = param0->unk_0C; - v0.window = ¶m0->unk_44; - v0.parent = param0; - - param0->unk_04 = ListMenu_New(&v0, 0, param0->unk_7A, HEAP_ID_FIELD1); - Window_CopyToVRAM(¶m0->unk_44); -} - -static int ov7_0224B83C(UnkStruct_ov7_0224B4E8 *param0) -{ - int v0; - u16 v1; - - v0 = ListMenu_ProcessInput(param0->unk_04); - ListMenu_GetListAndCursorPos(param0->unk_04, NULL, ¶m0->unk_7A); - - v1 = param0->unk_82; - ListMenu_CalcTrueCursorPos(param0->unk_04, ¶m0->unk_82); - - if (v1 != param0->unk_82) { - Sound_PlayEffect(SEQ_SE_CONFIRM); - } - - switch (v0) { - case 0xffffffff: - return 0; - case 0xfffffffe: - Sound_PlayEffect(SEQ_SE_CONFIRM); - v0 = -1; - break; - default: - Sound_PlayEffect(SEQ_SE_CONFIRM); - ov7_0224B6AC(param0); - break; - } - - if (param0->unk_04) { - ListMenu_Free(param0->unk_04, NULL, NULL); - Window_EraseStandardFrame(¶m0->unk_44, 1); - Bg_ScheduleTilemapTransfer(param0->unk_44.bgConfig, param0->unk_44.bgLayer); - Window_Remove(¶m0->unk_44); - StringList_Free(param0->unk_0C); - - param0->unk_04 = NULL; - } - - return v0; -} - -static u8 Unk_ov7_0224F4C0[] = { - 0x1, - 0x2, - 0x3, - 0x5, - 0x7, - 0x4, - 0xB, - 0xA, - 0x9 -}; - -static u8 Unk_ov7_0224F4CC[] = { - 0x54, - 0x55, - 0x56, - 0x57, - 0x59, - 0x5B, - 0x5B, - 0x5B, - 0x5D -}; - -static void ov7_0224B8DC(UnkStruct_ov7_0224B4E8 *param0) -{ - MessageLoader *v0; - StringTemplate *v1 = param0->unk_64; - String *v2; - String *v3; - Window *v4; - int v5, v6, v7, v8; - const int v9 = 16; - const int v10 = 2; - const int v11 = 15; - const int v12 = 55; - const int v13 = (24 * 8) - 1; - - v0 = MessageLoader_Init(MSG_LOADER_PRELOAD_ENTIRE_BANK, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_UNK_0353, HEAP_ID_FIELD1); - v2 = String_Init((90 * 2), HEAP_ID_FIELD1); - v3 = String_Init((90 * 2), HEAP_ID_FIELD1); - v4 = ¶m0->unk_24; - - Window_Add(param0->fieldSystem->bgConfig, v4, 3, 4, 2, 24, 19, 13, 1); - Window_DrawStandardFrame(v4, 1, 1024 - (18 + 12) - 9, 11); - Window_FillTilemap(v4, 15); - - ov7_0224B57C(param0, param0->unk_78 - 1); - - MessageLoader_GetString(v0, 95, v2); - StringTemplate_Format(v1, v3, v2); - Text_AddPrinterWithParams(v4, FONT_SYSTEM, v3, v10 + v12, 0, TEXT_SPEED_NO_TRANSFER, NULL); - - for (v5 = 0; v5 < 9; v5++) { - MessageLoader_GetString(v0, 75 + v5, v2); - Text_AddPrinterWithParams(v4, FONT_SYSTEM, v2, v10, v9 + v11 * v5, TEXT_SPEED_NO_TRANSFER, NULL); - } - - for (v5 = 0; v5 < 9; v5++) { - v6 = BattleRegulation_GetRuleValue(param0->fieldSystem->battleRegulation, Unk_ov7_0224F4C0[v5]); - v7 = Unk_ov7_0224F4CC[v5]; - - switch (Unk_ov7_0224F4C0[v5]) { - case 1: - StringTemplate_SetNumber(v1, 0, v6, 1, 1, 1); - break; - case 2: - StringTemplate_SetNumber(v1, 0, v6, 3, 0, 1); - break; - case 3: - if (v6 == 0) { - v7 = 96; - } else { - StringTemplate_SetNumber(v1, 0, v6, 3, 0, 1); - } - break; - case 5: - v6 = (v6 >= 0) ? (((v6 * 10 * 1000) / 254 + 5) / 10) : -(((-v6 * 10 * 1000) / 254 + 5) / 10); - - StringTemplate_SetNumber(v1, 0, abs(v6 / 12), 2, 0, 1); - StringTemplate_SetNumber(v1, 1, abs(v6 % 12), 2, 2, 1); - - if (v6 == 0) { - v7 = 96; - } else if (v6 > 0) { - v7++; - } - break; - case 7: - v6 = (v6 >= 0) ? (((v6 * 220462) + 50000) / 100000) : -(((-v6 * 220462) + 50000) / 100000); - StringTemplate_SetNumber(v1, 0, abs(v6), 3, 0, 1); - - if (v6 == 0) { - v7 = 96; - } else if (v6 > 0) { - v7++; - } - break; - case 4: - case 11: - case 10: - case 9: - if (v6 == 0) { - v7++; - } - break; - default: - break; - } - - MessageLoader_GetString(v0, v7, v2); - StringTemplate_Format(v1, v3, v2); - { - int v14 = Font_CalcStringWidth(FONT_SYSTEM, v3, 0); - int v15 = v13 - v14; - - Text_AddPrinterWithParams(v4, FONT_SYSTEM, v3, v15, v9 + v11 * v5, TEXT_SPEED_NO_TRANSFER, NULL); - } - } - - String_Free(v2); - String_Free(v3); - MessageLoader_Free(v0); - Window_CopyToVRAM(v4); -} - -static void ov7_0224BBA0(UnkStruct_ov7_0224B4E8 *param0) -{ - Window_EraseStandardFrame(¶m0->unk_24, 1); - Bg_ScheduleTilemapTransfer(param0->unk_24.bgConfig, param0->unk_24.bgLayer); - Window_Remove(¶m0->unk_24); -} - -static BOOL ov7_0224BBC4(UnkStruct_ov7_0224B4E8 *param0) -{ - Party *v0 = SaveData_GetParty(param0->fieldSystem->saveData); - int v1 = BattleRegulation_SelectValidPokemon(param0->fieldSystem->battleRegulation, v0, param0->unk_6C); - int v2; - - switch (v1) { - case 0: - return 1; - case 4: - Sound_PlayEffect(SEQ_SE_DP_BOX03); - ov7_0224B57C(param0, param0->unk_78 - 1); - v2 = BattleRegulation_GetRuleValue(param0->fieldSystem->battleRegulation, BATTLE_REGULATION_RULE_TEAM_SIZE); - StringTemplate_SetNumber(param0->unk_64, 1, v2, 1, 1, 1); - ov7_0224B4E8(param0, 107); - break; - default: - case 1: - Sound_PlayEffect(SEQ_SE_DP_BOX03); - ov7_0224B57C(param0, param0->unk_78 - 1); - v2 = BattleRegulation_GetRuleValue(param0->fieldSystem->battleRegulation, BATTLE_REGULATION_RULE_MAX_TOTAL_LEVEL); - StringTemplate_SetNumber(param0->unk_64, 1, v2, 3, 0, 1); - ov7_0224B4E8(param0, 121); - break; - } - - return 0; -} - -static BOOL ov7_0224BC74(FieldTask *param0) -{ - FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0); - UnkStruct_ov7_0224B4E8 *v1 = FieldTask_GetEnv(param0); - int v2; - - switch (v1->unk_7C) { - case 0: - ov7_0224B4E8(v1, 106); - v1->unk_7C++; - break; - case 1: - if (FieldMessage_FinishedPrinting(v1->unk_74)) { - ov7_0224B5A8(v1); - v1->unk_7C++; - } - break; - case 2: - v2 = ov7_0224B6E8(v1); - - if (v2 == -1) { - *v1->unk_70 = 2; - v1->unk_7C = 11; - } else if (v2 == 2) { - *v1->unk_70 = 3; - v1->unk_7C = 11; - } else if (v2 == 1) { - v1->unk_7C = 3; - } - break; - case 3: - ov7_0224B788(v1); - v1->unk_7C++; - break; - case 4: - v2 = ov7_0224B83C(v1); - - if (v2 == -1) { - v1->unk_7C = 2; - } else if (v2 == 1) { - v1->unk_7C = 5; - } else if (v2 == 2) { - v1->unk_7C = 7; - } - break; - case 5: - if (ov7_0224BBC4(v1)) { - *v1->unk_70 = 1; - v1->unk_7C = 11; - } else { - v1->unk_7C = 6; - } - break; - case 6: - if (FieldMessage_FinishedPrinting(v1->unk_74)) { - if (gSystem.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { - v1->unk_7C = 0; - } - } - break; - case 7: - ov7_0224B558(v1, 1); - ov7_0224B8DC(v1); - v1->unk_7C++; - break; - case 8: - if (gSystem.pressedKeys & (PAD_BUTTON_A | PAD_BUTTON_B)) { - ov7_0224BBA0(v1); - ov7_0224B4E8(v1, 106); - ov7_0224B5A8(v1); - v1->unk_7C = 9; - } - break; - case 9: - if (FieldMessage_FinishedPrinting(v1->unk_74)) { - v1->unk_7C = 3; - } - break; - case 10: - break; - case 11: - ov7_0224B6AC(v1); - ov7_0224B558(v1, 0); - StringTemplate_Free(v1->unk_64); - MessageLoader_Free(v1->unk_68); - String_Free(v1->unk_14); - String_Free(v1->unk_18); - String_Free(v1->unk_1C); - String_Free(v1->unk_20); - HeightWeightData_Free(v1->unk_6C); - Heap_Free(v1); - return 1; - default: - return 1; - } - - return 0; -} - -static UnkStruct_ov7_0224B4E8 *ov7_0224BE10(FieldSystem *fieldSystem) -{ - UnkStruct_ov7_0224B4E8 *v0 = Heap_AllocAtEnd(HEAP_ID_FIELD2, sizeof(UnkStruct_ov7_0224B4E8)); - - MI_CpuClear8(v0, sizeof(UnkStruct_ov7_0224B4E8)); - - v0->unk_7C = 0; - v0->fieldSystem = fieldSystem; - v0->fieldSystem->battleRegulation = NULL; - v0->unk_64 = StringTemplate_Default(HEAP_ID_FIELD1); - v0->unk_68 = MessageLoader_Init(MSG_LOADER_PRELOAD_ENTIRE_BANK, NARC_INDEX_MSGDATA__PL_MSG, TEXT_BANK_POKEMON_CENTER_2F_ATTENDANTS, HEAP_ID_FIELD1); - v0->unk_14 = String_Init((90 * 2), HEAP_ID_FIELD1); - v0->unk_18 = String_Init((90 * 2), HEAP_ID_FIELD1); - v0->unk_1C = String_Init((90 * 2), HEAP_ID_FIELD1); - v0->unk_20 = String_Init((90 * 2), HEAP_ID_FIELD1); - v0->unk_6C = HeightWeightData_Load(HEAP_ID_FIELD2); - - return v0; -} - -void ov7_0224BE7C(FieldTask *param0, u16 *param1) -{ - FieldSystem *fieldSystem = FieldTask_GetFieldSystem(param0); - UnkStruct_ov7_0224B4E8 *v1 = ov7_0224BE10(fieldSystem); - - v1->unk_70 = param1; - FieldTask_InitCall(param0, ov7_0224BC74, v1); -} diff --git a/src/overlay064/ov64_0222DCE0.c b/src/overlay064/ov64_0222DCE0.c index 1c4bd2e5b1..afd17af00e 100644 --- a/src/overlay064/ov64_0222DCE0.c +++ b/src/overlay064/ov64_0222DCE0.c @@ -765,7 +765,7 @@ static u32 ov64_0222E09C(UnkStruct_ov64_0222E060 *param0, String *param1, String v5 = DWC_CreateFriendKey(WiFiList_GetUserData(v1)); for (v0 = 0; v0 < 32; v0++) { - v2 = sub_0202AF78(v1, v0); + v2 = WiFiList_IsValidFriendData(v1, v0); if (v2 == 0) { v4 = String_AtoI(param1, &v3); @@ -823,7 +823,7 @@ static void ov64_0222E164(UnkStruct_ov64_0222E060 *param0) param0->unk_08.unk_00 = 0; for (v0 = 0; v0 < (8 * 4); v0++) { - if (sub_0202AF78(v1, v0) == 1) { + if (WiFiList_IsValidFriendData(v1, v0) == 1) { param0->unk_08.unk_04[param0->unk_08.unk_00] = v0; param0->unk_08.unk_00++; } @@ -1550,7 +1550,7 @@ static BOOL ov64_0222F068(UnkStruct_ov64_0222F038 *param0, UnkStruct_ov64_0222E0 v1 = SaveData_GetWiFiList(param1->saveData); for (v0 = 0; v0 < 32; v0++) { - if (!sub_0202AF78(v1, v0)) { + if (!WiFiList_IsValidFriendData(v1, v0)) { return 1; } } diff --git a/src/overlay065/ov65_0222DCE0.c b/src/overlay065/ov65_0222DCE0.c index e96968a4bd..fecc981415 100644 --- a/src/overlay065/ov65_0222DCE0.c +++ b/src/overlay065/ov65_0222DCE0.c @@ -2201,7 +2201,7 @@ static int ov65_0222FCDC(UnkStruct_ov65_0222EBE0 *param0, int param1) param0->unk_3AC = 10; param0->unk_3A8 = 34; CommManager_LogoutWifi(); - } else if (0 == sub_0202AF94(param0->unk_00)) { + } else if (0 == WiFiList_GetValidFriendsCount(param0->unk_00)) { ov65_02232B58(param0, 26, 1); param0->unk_3A8 = 59; param0->unk_3BC = 1; diff --git a/src/overlay088/ov88_0223B140.c b/src/overlay088/ov88_0223B140.c index ac1262bb27..f10ee5a624 100644 --- a/src/overlay088/ov88_0223B140.c +++ b/src/overlay088/ov88_0223B140.c @@ -1875,7 +1875,7 @@ static int ov88_0223D5B8(UnkStruct_02095E80 *param0) static int ov88_0223D69C(UnkStruct_02095E80 *param0) { ListMenuTemplate v0; - int v1 = sub_0202AF94(param0->unk_36EC); + int v1 = WiFiList_GetValidFriendsCount(param0->unk_36EC); int v2 = 5; param0->unk_36D4 = StringList_New(v1 + 1, HEAP_ID_26); @@ -1886,7 +1886,7 @@ static int ov88_0223D69C(UnkStruct_02095E80 *param0) int v5 = 0; for (v5 = 0; v5 < 32; v5++) { - if (sub_0202AF78(param0->unk_36EC, v5)) { + if (WiFiList_IsValidFriendData(param0->unk_36EC, v5)) { String_CopyChars(v4, sub_0202AEF0(param0->unk_36EC, v5)); StringList_AddFromString(param0->unk_36D4, v4, v5); } @@ -1933,7 +1933,7 @@ static int ov88_0223D7AC(UnkStruct_02095E80 *param0) param0->unk_226C = ov88_0223D854; for (v0 = 0; v0 < 32; v0++) { - if (!sub_0202AF78(param0->unk_36EC, v0)) { + if (!WiFiList_IsValidFriendData(param0->unk_36EC, v0)) { sub_02039298(param0->saveData, param0->unk_36C4, v0, HEAP_ID_26, 0); break; } @@ -2001,7 +2001,7 @@ static int ov88_0223D854(UnkStruct_02095E80 *param0) WiFiList *v2 = SaveData_GetWiFiList(param0->saveData); for (v0 = 0; v0 < 32; v0++) { - if (!sub_0202AF78(v2, v0)) { + if (!WiFiList_IsValidFriendData(v2, v0)) { sub_02039298(param0->saveData, param0->unk_36C4, v0, HEAP_ID_26, 0); break; } diff --git a/src/scrcmd.c b/src/scrcmd.c index 5bc2bbcdc3..134e12a5dd 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -80,8 +80,8 @@ #include "overlay006/pc_animation.h" #include "overlay006/swarm.h" #include "overlay006/trophy_garden_daily_encounters.h" +#include "overlay007/battle_regulation_menu.h" #include "overlay007/communication_club.h" -#include "overlay007/ov7_0224B4E8.h" #include "overlay007/shop_menu.h" #include "overlay008/ov8_02249960.h" #include "overlay009/ov9_02249960.h" @@ -582,7 +582,7 @@ static BOOL ScrCmd_Dummy1F9(ScriptContext *ctx); static BOOL ScrCmd_GetPreviousMapID(ScriptContext *ctx); static BOOL ScrCmd_GetCurrentMapID(ScriptContext *ctx); static BOOL ScrCmd_StartEndSafariGame(ScriptContext *ctx); -static BOOL ScrCmd_203(ScriptContext *ctx); +static BOOL ScrCmd_WarpToColosseum(ScriptContext *ctx); static BOOL ScrCmd_204(ScriptContext *ctx); static BOOL ScrCmd_205(ScriptContext *ctx); static BOOL ScrCmd_StartLibraryTV(ScriptContext *ctx); @@ -610,7 +610,7 @@ static BOOL ScrCmd_TurnOnPokedexFormDetection(ScriptContext *ctx); static BOOL ScrCmd_GetSetNationalDexEnabled(ScriptContext *ctx); static BOOL ScrCmd_GetPartyMonEVTotal(ScriptContext *ctx); static BOOL ScrCmd_GetDayOfWeek(ScriptContext *ctx); -static BOOL ScrCmd_239(ScriptContext *ctx); +static BOOL ScrCmd_OpenBattleRegulationMenu(ScriptContext *ctx); static BOOL ScrCmd_GetPartyMonFootprintType(ScriptContext *ctx); static BOOL ScrCmd_PlayPokecenterHealingAnimation(ScriptContext *ctx); static BOOL ScrCmd_PlayElevatorAnimation(ScriptContext *ctx); @@ -679,8 +679,8 @@ static BOOL ScrCmd_GetUndergroundTalkCounter(ScriptContext *ctx); static BOOL ScrCmd_29F(ScriptContext *ctx); static BOOL ScrCmd_Unused_2A1(ScriptContext *ctx); static BOOL ScrCmd_TrySetUnusedCollectedOrbFlag(ScriptContext *ctx); -static BOOL ScrCmd_2A3(ScriptContext *ctx); -static BOOL ScrCmd_2A4(ScriptContext *ctx); +static BOOL ScrCmd_CheckHasWiFiListValidLogin(ScriptContext *ctx); +static BOOL ScrCmd_GetWiFListValidFriendsCount(ScriptContext *ctx); static BOOL ScrCmd_CheckItemIsPlate(ScriptContext *ctx); static BOOL ScrCmd_CheckIsMysteryGiftPhrase(ScriptContext *ctx); static BOOL ScrCmd_CountUniqueSealsInSealCase(ScriptContext *ctx); @@ -733,7 +733,7 @@ static BOOL ScrCmd_SetSpeciesSeen(ScriptContext *ctx); static BOOL ScrCmd_DoDWWarp(ScriptContext *ctx); static BOOL ScrCmd_StartDistortionWorldGiratinaShadowEvent(ScriptContext *ctx); static BOOL ScrCmd_FinishDistortionWorldGiratinaShadowEvent(ScriptContext *ctx); -static BOOL ScrCmd_323(ScriptContext *ctx); +static BOOL ScrCmd_CheckNoWiFiPlazaCooldown(ScriptContext *ctx); static BOOL ScrCmd_SetPartyGiratinaForm(ScriptContext *ctx); static BOOL ScrCmd_CheckPartyHasFatefulEncounterRegigigas(ScriptContext *ctx); static BOOL ScriptContext_WaitForMovement(ScriptContext *ctx); @@ -3577,18 +3577,18 @@ static BOOL ScrCmd_Warp(ScriptContext *ctx) return TRUE; } -static BOOL ScrCmd_203(ScriptContext *ctx) +static BOOL ScrCmd_WarpToColosseum(ScriptContext *ctx) { FieldSystem *fieldSystem = ctx->fieldSystem; - u16 v0 = ScriptContext_ReadHalfWord(ctx); - s16 v4 = ScriptContext_ReadHalfWord(ctx); - u16 v1 = ScriptContext_GetVar(ctx); - u16 v2 = ScriptContext_GetVar(ctx); - u16 v3 = ScriptContext_ReadHalfWord(ctx); - v4 = -1; + u16 mapID = ScriptContext_ReadHalfWord(ctx); + s16 warpID = ScriptContext_ReadHalfWord(ctx); + u16 x = ScriptContext_GetVar(ctx); + u16 z = ScriptContext_GetVar(ctx); + u16 dir = ScriptContext_ReadHalfWord(ctx); + warpID = -1; - FieldTask_StartChangeMapColosseum(ctx->fieldSystem->task, v0, v4, v1, v2, v3); + FieldTask_StartChangeMapColosseum(ctx->fieldSystem->task, mapID, warpID, x, z, dir); return TRUE; } @@ -5514,11 +5514,11 @@ static BOOL ScrCmd_GetDayOfWeek(ScriptContext *ctx) return FALSE; } -static BOOL ScrCmd_239(ScriptContext *ctx) +static BOOL ScrCmd_OpenBattleRegulationMenu(ScriptContext *ctx) { - u16 v0 = ScriptContext_ReadHalfWord(ctx); + u16 destVar = ScriptContext_ReadHalfWord(ctx); - ov7_0224BE7C(ctx->task, FieldSystem_GetVarPointer(ctx->fieldSystem, v0)); + OpenBattleRegulationMenu(ctx->task, FieldSystem_GetVarPointer(ctx->fieldSystem, destVar)); return TRUE; } @@ -6390,19 +6390,19 @@ static BOOL ScrCmd_29F(ScriptContext *ctx) return TRUE; } -static BOOL ScrCmd_2A3(ScriptContext *ctx) +static BOOL ScrCmd_CheckHasWiFiListValidLogin(ScriptContext *ctx) { - u16 *v0 = ScriptContext_GetVarPointer(ctx); + u16 *destVar = ScriptContext_GetVarPointer(ctx); - *v0 = WiFiList_HasValidLogin(ctx->fieldSystem->saveData); + *destVar = WiFiList_HasValidLogin(ctx->fieldSystem->saveData); return FALSE; } -static BOOL ScrCmd_2A4(ScriptContext *ctx) +static BOOL ScrCmd_GetWiFListValidFriendsCount(ScriptContext *ctx) { - u16 *v0 = ScriptContext_GetVarPointer(ctx); + u16 *destVar = ScriptContext_GetVarPointer(ctx); - *v0 = sub_0202AF94(SaveData_GetWiFiList(ctx->fieldSystem->saveData)); + *destVar = WiFiList_GetValidFriendsCount(SaveData_GetWiFiList(ctx->fieldSystem->saveData)); return FALSE; } @@ -7079,18 +7079,18 @@ static BOOL ScrCmd_FinishDistortionWorldGiratinaShadowEvent(ScriptContext *ctx) return FALSE; } -static BOOL ScrCmd_323(ScriptContext *ctx) +static BOOL ScrCmd_CheckNoWiFiPlazaCooldown(ScriptContext *ctx) { FieldSystem *fieldSystem = ctx->fieldSystem; - u16 *v1 = ScriptContext_GetVarPointer(ctx); + u16 *destVar = ScriptContext_GetVarPointer(ctx); - s64 v2 = GetTimestamp(); - s64 v3 = v2 - fieldSystem->unk_C4.unk_00; + s64 timestamp = GetTimestamp(); + s64 v3 = timestamp - fieldSystem->unk_C4.unk_00; if (v3 >= 120) { - *v1 = 1; + *destVar = TRUE; } else { - *v1 = 0; + *destVar = FALSE; } return FALSE; diff --git a/src/script_manager.c b/src/script_manager.c index ddf3c4e9d5..742250d7e2 100644 --- a/src/script_manager.c +++ b/src/script_manager.c @@ -46,9 +46,9 @@ Entry(SCRIPT_ID_OFFSET_DAY_CARE_COMMON, scripts_day_care_common, TEXT_BANK_DAY_CARE_COMMON) \ Entry(SCRIPT_ID_OFFSET_POFFIN_COMMON, scripts_poffin_common, TEXT_BANK_POFFIN_COMMON) \ Entry(SCRIPT_ID_OFFSET_GROUP_CONNECTION, scripts_group_connection, TEXT_BANK_GROUP_CONNECTION) \ - Entry(SCRIPT_ID_OFFSET_POKEMON_CENTER_B1F_ATTENDANTS, scripts_pokemon_center_b1f_attendants, TEXT_BANK_POKEMON_CENTER_B1F_ATTENDANTS) \ + Entry(SCRIPT_ID_OFFSET_POKEMON_CENTER_B1F_COMMON, scripts_pokemon_center_b1f_common, TEXT_BANK_POKEMON_CENTER_B1F_COMMON) \ Entry(SCRIPT_ID_OFFSET_COMMUNICATION_CLUB, scripts_communication_club, TEXT_BANK_COMMUNICATION_CLUB) \ - Entry(SCRIPT_ID_OFFSET_POKEMON_CENTER_2F_ATTENDANTS, scripts_pokemon_center_2f_attendants, TEXT_BANK_POKEMON_CENTER_2F_ATTENDANTS) \ + Entry(SCRIPT_ID_OFFSET_POKEMON_CENTER_2F_COMMON, scripts_pokemon_center_2f_common, TEXT_BANK_POKEMON_CENTER_2F_COMMON) \ Entry(SCRIPT_ID_OFFSET_POKE_RADAR, scripts_poke_radar, TEXT_BANK_BAG) \ Entry(SCRIPT_ID_OFFSET_VS_SEEKER, scripts_vs_seeker, TEXT_BANK_VS_SEEKER) \ Entry(SCRIPT_ID_OFFSET_RECORD_CHATOT_CRY, scripts_record_chatot_cry, TEXT_BANK_RECORD_CHATOT_CRY) \ diff --git a/src/unk_02038FFC.c b/src/unk_02038FFC.c index 3b2502b102..7c9dc4ba43 100644 --- a/src/unk_02038FFC.c +++ b/src/unk_02038FFC.c @@ -51,9 +51,5 @@ BOOL WiFiList_HasValidLogin(SaveData *saveData) WiFiList *wiFiList = SaveData_GetWiFiList(saveData); DWCUserData *userData = WiFiList_GetUserData(wiFiList); - if (DWC_CheckHasProfile(userData) && DWC_CheckValidConsole(userData)) { - return TRUE; - } - - return FALSE; + return DWC_CheckHasProfile(userData) && DWC_CheckValidConsole(userData); } diff --git a/src/wifi_list.c b/src/wifi_list.c index 70bcbc8e97..b8c34db7c1 100644 --- a/src/wifi_list.c +++ b/src/wifi_list.c @@ -156,23 +156,23 @@ void sub_0202AF50(WiFiList *wiFiList, int param1, String *param2) String_ToChars(param2, wiFiList->unk_1C0[param1].unk_00, sizeof(wiFiList->unk_1C0[param1].unk_00)); } -BOOL sub_0202AF78(WiFiList *wiFiList, int param1) +BOOL WiFiList_IsValidFriendData(WiFiList *wiFiList, int param1) { GF_ASSERT(param1 < 32); return DWC_IsValidFriendData(&wiFiList->friendData[param1]); } -int sub_0202AF94(WiFiList *wiFiList) +int WiFiList_GetValidFriendsCount(WiFiList *wiFiList) { - int v0, v1 = 0; + int i, validFriendsCount = 0; - for (v0 = 0; v0 < 32; v0++) { - if (sub_0202AF78(wiFiList, v0)) { - v1++; + for (i = 0; i < 32; i++) { + if (WiFiList_IsValidFriendData(wiFiList, i)) { + validFriendsCount++; } } - return v1; + return validFriendsCount; } int sub_0202AFB4(WiFiList *wiFiList) @@ -180,7 +180,7 @@ int sub_0202AFB4(WiFiList *wiFiList) int v0, v1 = 0; for (v0 = 0; v0 < 32; v0++) { - if (sub_0202AF78(wiFiList, v0)) { + if (WiFiList_IsValidFriendData(wiFiList, v0)) { v1 = v0 + 1; } } @@ -226,7 +226,7 @@ void sub_0202B0F8(WiFiList *wiFiList) int i, v1 = -1; for (i = 0; i < 32; i++) { - if (sub_0202AF78(wiFiList, i)) { + if (WiFiList_IsValidFriendData(wiFiList, i)) { if (v1 != -1) { sub_0202B088(wiFiList, v1, i);