From 6068495619364c8e0ccae15ad036a1b5a9eef171 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Fri, 7 Dec 2018 23:50:56 +0100 Subject: [PATCH] Document trainer battle scripts (#430) --- asm/macros/event.inc | 2 +- data/event_scripts.s | 1260 +---------------- .../scripts.inc | 2 +- data/scripts/secret_base.inc | 1115 +++++++++++++++ data/scripts/trainer_battle.inc | 128 ++ data/specials.inc | 4 +- include/battle.h | 4 +- include/battle_setup.h | 2 +- include/constants/battle_setup.h | 2 +- include/event_scripts.h | 6 +- include/trainer_see.h | 2 +- src/battle_main.c | 8 +- src/battle_script_commands.c | 2 +- src/battle_setup.c | 20 +- src/battle_util.c | 4 +- src/daycare.c | 5 +- src/trainer_see.c | 8 +- 17 files changed, 1283 insertions(+), 1291 deletions(-) create mode 100644 data/scripts/secret_base.inc create mode 100644 data/scripts/trainer_battle.inc diff --git a/asm/macros/event.inc b/asm/macros/event.inc index d66992c35..c815f3753 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -668,7 +668,7 @@ .4byte \pointer2 @ text .4byte \pointer3 @ text .4byte \pointer4 @ event script - .elseif \type == TRAINER_BATTLE_9 + .elseif \type == TRAINER_BATTLE_PYRAMID .4byte \pointer1 @ text .4byte \pointer2 @ text .elseif \type == TRAINER_BATTLE_SET_TRAINER_A diff --git a/data/event_scripts.s b/data/event_scripts.s index 7d7d1528e..d90dbf584 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -844,144 +844,12 @@ VerdanturfTown_BattleTentLobby_EventScript_27134F:: @ 827134F waitstate return -EventScript_271354:: @ 8271354 + EventScript_271354:: @ 8271354 cmdD8 cmdD9 - -EventScript_271356:: @ 8271356 - special SetUpTrainerEncounterMusic - special EndTrainerApproach - waitstate - goto EventScript_ShowTrainerIntroMsg - -EventScript_271362:: @ 8271362 - lock - faceplayer - applymovement VAR_LAST_TALKED, Movement_27143A - waitmovement 0 - specialvar VAR_RESULT, GetTrainerFlag - compare VAR_RESULT, 0 - goto_if 5, EventScript_271389 - special SetUpTrainerEncounterMusic - special sub_80B16D8 - goto EventScript_ShowTrainerIntroMsg - -EventScript_271389:: @ 8271389 - gotopostbattlescript - -EventScript_TryDoDoubleTrainerBattle:: @ 827138A - lock - faceplayer - call EventScript_27142F - specialvar VAR_RESULT, GetTrainerFlag - compare VAR_RESULT, 0 - goto_if 5, EventScript_2713C1 - special HasEnoughMonsForDoubleBattle - compare VAR_RESULT, 0 - goto_if 5, EventScript_NotEnoughMonsForDoubleBattle - special SetUpTrainerEncounterMusic - special sub_80B16D8 - goto EventScript_ShowTrainerIntroMsg - -EventScript_NotEnoughMonsForDoubleBattle:: @ 82713BA - special ShowTrainerCantBattleSpeech - waitmessage - waitbuttonpress - release - end - -EventScript_2713C1:: @ 82713C1 - gotopostbattlescript - -EventScript_2713C2:: @ 82713C2 - applymovement VAR_LAST_TALKED, Movement_27143A - waitmovement 0 - special SetUpTrainerEncounterMusic - trainerbattlebegin - gotopostbattlescript - -EventScript_2713D1:: @ 82713D1 - call EventScript_27142F - specialvar VAR_RESULT, IsTrainerReadyForRematch - compare VAR_RESULT, 0 - goto_eq EventScript_2713F7 - special SetUpTrainerEncounterMusic - special sub_80B16D8 - special ShowTrainerIntroSpeech - waitmessage - waitbuttonpress - special BattleSetup_StartRematchBattle - waitstate - releaseall - end - -EventScript_2713F7:: @ 82713F7 - gotopostbattlescript - -EventScript_TryDoDoubleRematchBattle:: @ 82713F8 - specialvar VAR_RESULT, IsTrainerReadyForRematch - compare VAR_RESULT, 0 - goto_eq EventScript_271427 - special HasEnoughMonsForDoubleBattle - compare VAR_RESULT, 0 - goto_if 5, EventScript_NotEnoughMonsForDoubleRematchBattle - special SetUpTrainerEncounterMusic - special sub_80B16D8 - special ShowTrainerIntroSpeech - waitmessage - waitbuttonpress - special BattleSetup_StartRematchBattle - waitstate - releaseall - end - -EventScript_271427:: @ 8271427 - gotopostbattlescript - -EventScript_NotEnoughMonsForDoubleRematchBattle:: @ 8271428 - special ShowTrainerCantBattleSpeech - waitmessage - waitbuttonpress - release - end - -EventScript_27142F:: @ 827142F - applymovement VAR_LAST_TALKED, Movement_27143A - waitmovement 0 - return - -Movement_27143A: @ 827143A - reveal_trainer - step_end - -EventScript_ShowTrainerIntroMsg:: @ 827143C - special ShowTrainerIntroSpeech - waitmessage - waitbuttonpress - special sub_80B45D0 - compare VAR_RESULT, 1 - goto_eq EventScript_271356 - goto EventScript_DoTrainerBattle - -EventScript_DoTrainerBattle:: @ 8271454 - trainerbattlebegin - specialvar VAR_RESULT, GetTrainerBattleMode - compare VAR_RESULT, 0 - goto_eq EventScript_271491 - compare VAR_RESULT, 2 - goto_eq EventScript_271491 - compare VAR_RESULT, 1 - goto_eq EventScript_271491 - compare VAR_RESULT, 6 - goto_eq EventScript_271491 - compare VAR_RESULT, 8 - goto_eq EventScript_271491 - -EventScript_271491:: @ 8271491 - gotobeatenscript - releaseall - end - + + .include "data/scripts/trainer_battle.inc" + Std_MsgboxAutoclose:: @ 8271494 message 0x0 waitmessage @@ -4105,1123 +3973,7 @@ EventScript_GotoTrainerScript:: @ 82742F6 end .include "data/scripts/berry_tree.inc" - -Text_274746: @ 8274746 - .string "If some vines drop down, this tree can\n" - .string "be climbed.$" - -Text_274779: @ 8274779 - .string "If some vines drop down, this tree can\n" - .string "be climbed.\p" - .string "Use the SECRET POWER?$" - -Text_2747C2: @ 82747C2 - .string "A thick vine dropped down!$" - -Text_2747DD: @ 82747DD - .string "If this clump of grass can be moved,\n" - .string "it might be possible to go inside.$" - -Text_274825: @ 8274825 - .string "If this clump of grass can be moved,\n" - .string "it might be possible to go inside.\p" - .string "Use the SECRET POWER?$" - -Text_274883: @ 8274883 - .string "Discovered a small entrance!$" - -SecretBase_RedCave1_Text_2748A0: @ 82748A0 - .string "Have you made a SECRET BASE already?\p" - .string "I went here, there, everywhere before\n" - .string "choosing this place.\p" - .string "Since you're already here, how would\n" - .string "you like to battle?$" - -SecretBase_RedCave1_Text_274939: @ 8274939 - .string "Okay!\n" - .string "Here we come!$" - -SecretBase_RedCave1_Text_27494D: @ 827494D - .string "Hunh?\n" - .string "Oh, you can't now…$" - -SecretBase_RedCave1_Text_274966:: @ 8274966 - .string "Waaargh! You're too strong!\n" - .string "About me losing… Please keep it secret!$" - -SecretBase_RedCave1_Text_2749AA: @ 82749AA - .string "What do you think of my SECRET BASE?\n" - .string "Come visit me again tomorrow.$" - -SecretBase_RedCave1_Text_2749ED: @ 82749ED - .string "Have you made a SECRET BASE already?\p" - .string "I went here, there, everywhere before\n" - .string "choosing this place.\p" - .string "Feel free to hang out!$" - -SecretBase_RedCave1_Text_274A64: @ 8274A64 - .string "There're a lot of places where\n" - .string "you can make a SECRET BASE.\p" - .string "But I like this spot best.\n" - .string "Don't you think it's nice?\p" - .string "Oh, would you like to have a battle?$" - -SecretBase_RedCave1_Text_274AFA: @ 8274AFA - .string "Okay, here goes!$" - -SecretBase_RedCave1_Text_274B0B: @ 8274B0B - .string "Oh…\n" - .string "You can't now, okay.$" - -SecretBase_RedCave1_Text_274B24:: @ 8274B24 - .string "Hmmm… It's our loss…\n" - .string "But don't tell anyone!\l" - .string "It's a confidential secret!$" - -SecretBase_RedCave1_Text_274B6C: @ 8274B6C - .string "If you're in this area again,\n" - .string "I hope you'll visit me.$" - -SecretBase_RedCave1_Text_274BA2: @ 8274BA2 - .string "There're a lot of places where you can\n" - .string "make a SECRET BASE.\p" - .string "But I like this spot best.\n" - .string "Don't you think it's nice?$" - -SecretBase_RedCave1_Text_274C13: @ 8274C13 - .string "This is a popular spot.\n" - .string "It's always taken.\p" - .string "Oh! Were you thinking about\n" - .string "taking this spot, too?\p" - .string "I'll tell you what, you can have this\n" - .string "spot if you can beat me.$" - -SecretBase_RedCave1_Text_274CB0: @ 8274CB0 - .string "Okay!\n" - .string "I'm going to defend my SECRET BASE!$" - -SecretBase_RedCave1_Text_274CDA: @ 8274CDA - .string "Hunh? Is that right?\n" - .string "You're not interested in this spot?$" - -SecretBase_RedCave1_Text_274D13:: @ 8274D13 - .string "I can't keep going!\n" - .string "I surrender!$" - -SecretBase_RedCave1_Text_274D34: @ 8274D34 - .string "Okay, when I move one day,\n" - .string "this place will be yours!$" - -SecretBase_RedCave1_Text_274D69: @ 8274D69 - .string "This is a popular spot.\n" - .string "It's always taken.\p" - .string "I waited a long time for it to open.\n" - .string "I finally got to use it!$" - -SecretBase_RedCave1_Text_274DD2: @ 8274DD2 - .string "Welcome to my POKéMON LAB.\p" - .string "I carry out research on battling in\n" - .string "secrecy.\p" - .string "Would you like to see how strong I am?$" - -SecretBase_RedCave1_Text_274E41: @ 8274E41 - .string "I'm going to go all out!$" - -SecretBase_RedCave1_Text_274E5A: @ 8274E5A - .string "Oh.\n" - .string "Some other time, then!$" - -SecretBase_RedCave1_Text_274E75:: @ 8274E75 - .string "Hmm… I've still got lots to learn.\n" - .string "I have to study some more.$" - -SecretBase_RedCave1_Text_274EB3: @ 8274EB3 - .string "Thanks for battling with me.\n" - .string "Please come back again tomorrow.$" - -SecretBase_RedCave1_Text_274EF1: @ 8274EF1 - .string "Welcome to my POKéMON LAB.\p" - .string "I carry out research on battling in\n" - .string "secrecy.$" - -SecretBase_RedCave1_Text_274F39: @ 8274F39 - .string "A big mansion is nice, but I like this\n" - .string "sort of place more.\p" - .string "I like it because all kinds of people\n" - .string "come visit me.\p" - .string "So, how would you like a battle?$" - -SecretBase_RedCave1_Text_274FCA: @ 8274FCA - .string "That's the way!$" - -SecretBase_RedCave1_Text_274FDA: @ 8274FDA - .string "When you're ready, give me a shout!$" - -SecretBase_RedCave1_Text_274FFE:: @ 8274FFE - .string "Aww! Done in!\n" - .string "But it's still fun to battle!$" - -SecretBase_RedCave1_Text_27502A: @ 827502A - .string "Well, anyway, I should go buy some\n" - .string "decorations and furniture.\p" - .string "I want my SECRET BASE to be a place\n" - .string "other people can enjoy.$" - -SecretBase_RedCave1_Text_2750A4: @ 82750A4 - .string "A big mansion is nice, but I like this\n" - .string "sort of place more.\p" - .string "I like it because all kinds of people\n" - .string "come visit me.$" - -SecretBase_RedCave1_Text_275114: @ 8275114 - .string "I simply adore shopping for decorations\n" - .string "and furniture.\p" - .string "I also love raising POKéMON just\n" - .string "as much.\p" - .string "If you would be so kind, will you battle\n" - .string "with my POKéMON?$" - -SecretBase_RedCave1_Text_2751AF: @ 82751AF - .string "Thank you.\n" - .string "Shall we begin?$" - -SecretBase_RedCave1_Text_2751CA: @ 82751CA - .string "Oh.\n" - .string "How disappointing…$" - -SecretBase_RedCave1_Text_2751E1:: @ 82751E1 - .string "I concede…$" - -SecretBase_RedCave1_Text_2751EC: @ 82751EC - .string "That was all in good fun!\n" - .string "I should go enjoy shopping now.$" - -SecretBase_RedCave1_Text_275226: @ 8275226 - .string "I simply adore shopping for decorations\n" - .string "and furniture.\p" - .string "I also love raising POKéMON just\n" - .string "as much.$" - -SecretBase_RedCave1_Text_275287: @ 8275287 - .string "Some people make their SECRET BASES in\n" - .string "hard-to-find places.\l" - .string "Do they want to just lie low?\p" - .string "But since you found me, how about we\n" - .string "have a battle?$" - -SecretBase_RedCave1_Text_275315: @ 8275315 - .string "I'm not going down easily!$" - -SecretBase_RedCave1_Text_275330: @ 8275330 - .string "Oh… Are you maybe tired from searching\n" - .string "for this place?$" - -SecretBase_RedCave1_Text_275367:: @ 8275367 - .string "I went down…$" - -SecretBase_RedCave1_Text_275374: @ 8275374 - .string "Where's your SECRET BASE?\n" - .string "I should go visit you there.$" - -SecretBase_RedCave1_Text_2753AB: @ 82753AB - .string "Some people make their SECRET BASES in\n" - .string "hard-to-find places.\l" - .string "Do they want to just lie low?$" - -SecretBase_RedCave1_Text_275405: @ 8275405 - .string "People have told me that you can get\n" - .string "decorations in several ways.\p" - .string "We should have a race to see who can\n" - .string "get nicer decorations and furniture!\p" - .string "In the meantime, want to battle?$" - -SecretBase_RedCave1_Text_2754B2: @ 82754B2 - .string "This is my SECRET BASE.\n" - .string "I can't lose!$" - -SecretBase_RedCave1_Text_2754D8: @ 82754D8 - .string "I'll battle with you anytime.$" - -SecretBase_RedCave1_Text_2754F6:: @ 82754F6 - .string "Huh?\n" - .string "Did I just lose?$" - -SecretBase_RedCave1_Text_27550C: @ 827550C - .string "I won't lose at collecting decorations.\n" - .string "Come visit again!$" - -SecretBase_RedCave1_Text_275546: @ 8275546 - .string "People have told me that you can get\n" - .string "decorations in several ways.\p" - .string "We should have a race to see who can\n" - .string "get nicer decorations and furniture!$" - -SecretBase_RedCave1_Text_2755D2: @ 82755D2 - .string "I found a spot I liked, and I did it up\n" - .string "with my favorite decorations.\p" - .string "I raise my favorite POKéMON and grow\n" - .string "stronger with it.\p" - .string "That's what I do.\n" - .string "Want to battle with me?$" - -SecretBase_RedCave1_Text_275679: @ 8275679 - .string "Show me what you're made of!$" - -SecretBase_RedCave1_Text_275696: @ 8275696 - .string "I guess there are times when you're not\n" - .string "into it.$" - -SecretBase_RedCave1_Text_2756C7:: @ 82756C7 - .string "I know exactly what you're made of now.$" - -SecretBase_RedCave1_Text_2756EF: @ 82756EF - .string "We can both become stronger.\n" - .string "Let's keep at it!$" - -SecretBase_RedCave1_Text_27571E: @ 827571E - .string "I found a spot I liked, and I did it up\n" - .string "with my favorite decorations.\p" - .string "I raise my favorite POKéMON and grow\n" - .string "stronger with it.\p" - .string "Every day is a great day.$" - -SecretBase_RedCave1_Text_2757B5: @ 82757B5 - .string "You can learn a lot about the taste\n" - .string "and sense of people by the kinds of\l" - .string "decorations they have, and how they\l" - .string "display them.\p" - .string "What do you think of my taste?\n" - .string "Are you speechless?\p" - .string "Want to see my taste in battling?$" - -SecretBase_RedCave1_Text_275884: @ 8275884 - .string "There's no holding back!$" - -SecretBase_RedCave1_Text_27589D: @ 827589D - .string "I'll be happy to demonstrate my style\n" - .string "anytime.$" - -SecretBase_RedCave1_Text_2758CC:: @ 82758CC - .string "You're supremely talented!\n" - .string "Your power seems to be limitless…$" - -SecretBase_RedCave1_Text_275909: @ 8275909 - .string "What did you think of my style?\n" - .string "I'll keep on polishing it!$" - -SecretBase_RedCave1_Text_275944: @ 8275944 - .string "You can learn a lot about the taste\n" - .string "and sense of people by the kinds of\l" - .string "decorations they have, and how they\l" - .string "display them.\p" - .string "What do you think of my taste?\n" - .string "Are you speechless?$" - -EventScript_2759F1:: @ 82759F1 - special sub_80E8C98 - special sub_80E8BC8 - compare VAR_RESULT, 1 - goto_eq EventScript_275BE8 - checkpartymove MOVE_SECRET_POWER - setfieldeffectargument 0, VAR_RESULT - buffermovename 1, MOVE_SECRET_POWER - compare VAR_0x8007, 1 - goto_eq EventScript_275A50 - compare VAR_0x8007, 2 - goto_eq EventScript_275A50 - compare VAR_0x8007, 3 - goto_eq EventScript_275A50 - compare VAR_0x8007, 4 - goto_eq EventScript_275A50 - compare VAR_0x8007, 5 - goto_eq EventScript_275AA9 - compare VAR_0x8007, 6 - goto_eq EventScript_275B02 - end - -EventScript_275A50:: @ 8275A50 - lockall - compare VAR_RESULT, 6 - goto_eq EventScript_275A91 - bufferpartymonnick 0, VAR_RESULT - msgbox gText_23B704, MSGBOX_YESNO - compare VAR_RESULT, 0 - goto_eq EventScript_275CDE - msgbox Route103_Text_290771, MSGBOX_DEFAULT - closemessage - dofieldeffect FLDEFF_USE_SECRET_POWER_CAVE - waitstate - goto EventScript_275A9B - end - -EventScript_275A86:: @ 8275A86 - lockall - dofieldeffect FLDEFF_USE_SECRET_POWER_CAVE - waitstate - goto EventScript_275A9B - end - -EventScript_275A91:: @ 8275A91 - msgbox gText_23B6E0, MSGBOX_DEFAULT - releaseall - end - -EventScript_275A9B:: @ 8275A9B - msgbox gText_23B73E, MSGBOX_DEFAULT - goto EventScript_275B5B - end - -EventScript_275AA9:: @ 8275AA9 - lockall - compare VAR_RESULT, 6 - goto_eq EventScript_275AEA - bufferpartymonnick 0, VAR_RESULT - msgbox Text_274779, MSGBOX_YESNO - compare VAR_RESULT, 0 - goto_eq EventScript_275CDE - msgbox Route103_Text_290771, MSGBOX_DEFAULT - closemessage - dofieldeffect FLDEFF_USE_SECRET_POWER_TREE - waitstate - goto EventScript_275AF4 - end - -EventScript_275ADF:: @ 8275ADF - lockall - dofieldeffect FLDEFF_USE_SECRET_POWER_TREE - waitstate - goto EventScript_275AF4 - end - -EventScript_275AEA:: @ 8275AEA - msgbox Text_274746, MSGBOX_DEFAULT - releaseall - end - -EventScript_275AF4:: @ 8275AF4 - msgbox Text_2747C2, MSGBOX_DEFAULT - goto EventScript_275B5B - end - -EventScript_275B02:: @ 8275B02 - lockall - compare VAR_RESULT, 6 - goto_eq EventScript_275B43 - bufferpartymonnick 0, VAR_RESULT - msgbox Text_274825, MSGBOX_YESNO - compare VAR_RESULT, 0 - goto_eq EventScript_275CDE - msgbox Route103_Text_290771, MSGBOX_DEFAULT - closemessage - dofieldeffect FLDEFF_USE_SECRET_POWER_SHRUB - waitstate - goto EventScript_275B4D - end - -EventScript_275B38:: @ 8275B38 - lockall - dofieldeffect FLDEFF_USE_SECRET_POWER_SHRUB - waitstate - goto EventScript_275B4D - end - -EventScript_275B43:: @ 8275B43 - msgbox Text_2747DD, MSGBOX_DEFAULT - releaseall - end - -EventScript_275B4D:: @ 8275B4D - msgbox Text_274883, MSGBOX_DEFAULT - goto EventScript_275B5B - end - -EventScript_275B5B:: @ 8275B5B - closemessage - playse SE_KAIDAN - setvar VAR_0x4097, 0 - setflag FLAG_DECORATION_0 - special sub_80E8E18 - special sub_80E9068 - setvar VAR_0x8004, 0 - setvar VAR_0x8005, 0 - special sub_80E933C - setvar VAR_0x4089, 1 - waitstate - end - -SecretBase_RedCave1_EventScript_275B81:: @ 8275B81 - applymovement 255, SecretBase_RedCave1_Movement_275BB4 - waitmovement 0 - setvar VAR_0x4097, 1 - msgbox SecretBase_RedCave1_Text_23B759, MSGBOX_YESNO - compare VAR_RESULT, 1 - goto_eq SecretBase_RedCave1_EventScript_275BAB - closemessage - playse SE_KAIDAN - special sub_80E9A90 - end - -SecretBase_RedCave1_EventScript_275BAB:: @ 8275BAB - closemessage - setflag FLAG_0x060 - special sub_80E91F8 - waitstate - end - -SecretBase_RedCave1_Movement_275BB4: @ 8275BB4 - walk_up - walk_up - step_end - -EventScript_275BB7:: @ 8275BB7 - lockall - setvar VAR_0x4097, 1 - playse SE_KAIDAN - special sub_80E9744 - compare VAR_RESULT, 0 - goto_eq EventScript_275BDB - clearflag FLAG_DECORATION_0 - special sub_80E9068 - setvar VAR_0x4089, 0 - waitstate - end - -EventScript_275BDB:: @ 8275BDB - setflag FLAG_DECORATION_0 - special sub_80E9068 - setvar VAR_0x4089, 0 - waitstate - end - -EventScript_275BE8:: @ 8275BE8 - checkpartymove MOVE_SECRET_POWER - compare VAR_RESULT, 6 - goto_eq EventScript_275C9A - setfieldeffectargument 0, VAR_RESULT - setorcopyvar VAR_0x8004, VAR_RESULT - lockall - special GetSecretBaseNearbyMapName - msgbox Text_276A3D, MSGBOX_YESNO - compare VAR_RESULT, 0 - goto_eq EventScript_275CDE - msgbox Text_2766AA, MSGBOX_YESNO - compare VAR_RESULT, 0 - goto_eq EventScript_275CDE - fadescreenswapbuffers 1 - special sub_80E9B70 - closemessage - fadescreenswapbuffers 0 - msgbox Text_276A95, MSGBOX_YESNO - compare VAR_RESULT, 0 - goto_eq EventScript_275CDE - bufferpartymonnick 0, VAR_0x8004 - buffermovename 1, MOVE_SECRET_POWER - msgbox Route103_Text_290771, MSGBOX_DEFAULT - closemessage - closemessage - compare VAR_0x8007, 1 - goto_eq EventScript_275A86 - compare VAR_0x8007, 2 - goto_eq EventScript_275A86 - compare VAR_0x8007, 3 - goto_eq EventScript_275A86 - compare VAR_0x8007, 4 - goto_eq EventScript_275A86 - compare VAR_0x8007, 5 - goto_eq EventScript_275ADF - compare VAR_0x8007, 6 - goto_eq EventScript_275B38 - releaseall - end - -EventScript_275C9A:: @ 8275C9A - lockall - compare VAR_0x8007, 1 - goto_eq EventScript_275A91 - compare VAR_0x8007, 2 - goto_eq EventScript_275A91 - compare VAR_0x8007, 3 - goto_eq EventScript_275A91 - compare VAR_0x8007, 4 - goto_eq EventScript_275A91 - compare VAR_0x8007, 5 - goto_eq EventScript_275AEA - compare VAR_0x8007, 6 - goto_eq EventScript_275B43 - end - -EventScript_275CDE:: @ 8275CDE - closemessage - releaseall - end - -LittlerootTown_BrendansHouse_2F_EventScript_275CE1:: @ 8275CE1 -LittlerootTown_MaysHouse_2F_EventScript_275CE1:: @ 8275CE1 -SecretBase_RedCave1_EventScript_275CE1:: @ 8275CE1 - setflag FLAG_DECORATION_1 - setflag FLAG_DECORATION_2 - setflag FLAG_DECORATION_3 - setflag FLAG_DECORATION_4 - setflag FLAG_DECORATION_5 - setflag FLAG_DECORATION_6 - setflag FLAG_DECORATION_7 - setflag FLAG_DECORATION_8 - setflag FLAG_DECORATION_9 - setflag FLAG_DECORATION_10 - setflag FLAG_DECORATION_11 - setflag FLAG_DECORATION_12 - setflag FLAG_DECORATION_13 - setflag FLAG_DECORATION_14 - return - -EventScript_275D0C:: @ 8275D0C - setvar VAR_0x8004, 0 - setvar VAR_0x8005, 0 - special sub_80E933C - setvar VAR_0x4089, 1 - end - -EventScript_275D1F:: @ 8275D1F - setvar VAR_0x8005, 0 - goto EventScript_275D2A - end - -EventScript_275D2A:: @ 8275D2A - special sub_8127E18 - end - -EventScript_275D2E:: @ 8275D2E - setvar VAR_0x8004, 0 - goto EventScript_275D39 - end - -EventScript_275D39:: @ 8275D39 - special sub_8129708 - compare VAR_RESULT, 1 - goto_eq EventScript_275D63 - addvar VAR_0x8004, 1 - compare VAR_0x8005, 0 - goto_eq EventScript_275D39 - removeobject VAR_0x8006 - setflag 0x8005 - goto EventScript_275D39 - end - -EventScript_275D63:: @ 8275D63 - end - -SecretBase_BlueCave1_EventScript_275D64:: @ 8275D64 -SecretBase_BlueCave2_EventScript_275D64:: @ 8275D64 -SecretBase_BlueCave3_EventScript_275D64:: @ 8275D64 -SecretBase_BlueCave4_EventScript_275D64:: @ 8275D64 -SecretBase_BrownCave1_EventScript_275D64:: @ 8275D64 -SecretBase_BrownCave2_EventScript_275D64:: @ 8275D64 -SecretBase_BrownCave3_EventScript_275D64:: @ 8275D64 -SecretBase_BrownCave4_EventScript_275D64:: @ 8275D64 -SecretBase_RedCave1_EventScript_275D64:: @ 8275D64 -SecretBase_RedCave2_EventScript_275D64:: @ 8275D64 -SecretBase_RedCave3_EventScript_275D64:: @ 8275D64 -SecretBase_RedCave4_EventScript_275D64:: @ 8275D64 -SecretBase_Shrub1_EventScript_275D64:: @ 8275D64 -SecretBase_Shrub2_EventScript_275D64:: @ 8275D64 -SecretBase_Shrub3_EventScript_275D64:: @ 8275D64 -SecretBase_Shrub4_EventScript_275D64:: @ 8275D64 -SecretBase_Tree1_EventScript_275D64:: @ 8275D64 -SecretBase_Tree2_EventScript_275D64:: @ 8275D64 -SecretBase_Tree3_EventScript_275D64:: @ 8275D64 -SecretBase_Tree4_EventScript_275D64:: @ 8275D64 -SecretBase_YellowCave1_EventScript_275D64:: @ 8275D64 -SecretBase_YellowCave2_EventScript_275D64:: @ 8275D64 -SecretBase_YellowCave3_EventScript_275D64:: @ 8275D64 -SecretBase_YellowCave4_EventScript_275D64:: @ 8275D64 - special sub_80EA354 - compare VAR_0x8004, 0 - goto_eq SecretBase_RedCave1_EventScript_275DD6 - compare VAR_0x8004, 1 - goto_eq SecretBase_RedCave1_EventScript_275E4E - compare VAR_0x8004, 2 - goto_eq SecretBase_RedCave1_EventScript_275EC6 - compare VAR_0x8004, 3 - goto_eq SecretBase_RedCave1_EventScript_275F3E - compare VAR_0x8004, 4 - goto_eq SecretBase_RedCave1_EventScript_275FB6 - compare VAR_0x8004, 5 - goto_eq SecretBase_RedCave1_EventScript_27602E - compare VAR_0x8004, 6 - goto_eq SecretBase_RedCave1_EventScript_2760A6 - compare VAR_0x8004, 7 - goto_eq SecretBase_RedCave1_EventScript_27611E - compare VAR_0x8004, 8 - goto_eq SecretBase_RedCave1_EventScript_276196 - compare VAR_0x8004, 9 - goto_eq SecretBase_RedCave1_EventScript_27620E - end - -SecretBase_RedCave1_EventScript_275DD6:: @ 8275DD6 - lock - faceplayer - checkflag FLAG_SYS_GAME_CLEAR - goto_if 0, SecretBase_RedCave1_EventScript_275E25 - compare VAR_RESULT, 1 - goto_eq SecretBase_RedCave1_EventScript_275E44 - msgbox SecretBase_RedCave1_Text_2748A0, MSGBOX_YESNO - compare VAR_RESULT, 0 - goto_eq SecretBase_RedCave1_EventScript_275E2F - setvar VAR_RESULT, 1 - special sub_80EA30C - call SecretBase_RedCave1_EventScript_27134F - compare VAR_RESULT, 0 - goto_eq SecretBase_RedCave1_EventScript_275E2F - msgbox SecretBase_RedCave1_Text_274939, MSGBOX_DEFAULT - goto SecretBase_RedCave1_EventScript_276286 - end - -SecretBase_RedCave1_EventScript_275E25:: @ 8275E25 - msgbox SecretBase_RedCave1_Text_2749ED, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_275E2F:: @ 8275E2F - special sub_80EB300 - setvar VAR_RESULT, 0 - special sub_80EA30C - msgbox SecretBase_RedCave1_Text_27494D, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_275E44:: @ 8275E44 - msgbox SecretBase_RedCave1_Text_2749AA, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_275E4E:: @ 8275E4E - lock - faceplayer - checkflag FLAG_SYS_GAME_CLEAR - goto_if 0, SecretBase_RedCave1_EventScript_275E9D - compare VAR_RESULT, 1 - goto_eq SecretBase_RedCave1_EventScript_275EBC - msgbox SecretBase_RedCave1_Text_274C13, MSGBOX_YESNO - compare VAR_RESULT, 0 - goto_eq SecretBase_RedCave1_EventScript_275EA7 - setvar VAR_RESULT, 1 - special sub_80EA30C - call SecretBase_RedCave1_EventScript_27134F - compare VAR_RESULT, 0 - goto_eq SecretBase_RedCave1_EventScript_275EA7 - msgbox SecretBase_RedCave1_Text_274CB0, MSGBOX_DEFAULT - goto SecretBase_RedCave1_EventScript_276286 - end - -SecretBase_RedCave1_EventScript_275E9D:: @ 8275E9D - msgbox SecretBase_RedCave1_Text_274D69, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_275EA7:: @ 8275EA7 - special sub_80EB300 - setvar VAR_RESULT, 0 - special sub_80EA30C - msgbox SecretBase_RedCave1_Text_274CDA, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_275EBC:: @ 8275EBC - msgbox SecretBase_RedCave1_Text_274D34, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_275EC6:: @ 8275EC6 - lock - faceplayer - checkflag FLAG_SYS_GAME_CLEAR - goto_if 0, SecretBase_RedCave1_EventScript_275F15 - compare VAR_RESULT, 1 - goto_eq SecretBase_RedCave1_EventScript_275F34 - msgbox SecretBase_RedCave1_Text_274F39, MSGBOX_YESNO - compare VAR_RESULT, 0 - goto_eq SecretBase_RedCave1_EventScript_275F1F - setvar VAR_RESULT, 1 - special sub_80EA30C - call SecretBase_RedCave1_EventScript_27134F - compare VAR_RESULT, 0 - goto_eq SecretBase_RedCave1_EventScript_275F1F - msgbox SecretBase_RedCave1_Text_274FCA, MSGBOX_DEFAULT - goto SecretBase_RedCave1_EventScript_276286 - end - -SecretBase_RedCave1_EventScript_275F15:: @ 8275F15 - msgbox SecretBase_RedCave1_Text_2750A4, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_275F1F:: @ 8275F1F - special sub_80EB300 - setvar VAR_RESULT, 0 - special sub_80EA30C - msgbox SecretBase_RedCave1_Text_274FDA, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_275F34:: @ 8275F34 - msgbox SecretBase_RedCave1_Text_27502A, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_275F3E:: @ 8275F3E - lock - faceplayer - checkflag FLAG_SYS_GAME_CLEAR - goto_if 0, SecretBase_RedCave1_EventScript_275F8D - compare VAR_RESULT, 1 - goto_eq SecretBase_RedCave1_EventScript_275FAC - msgbox SecretBase_RedCave1_Text_275287, MSGBOX_YESNO - compare VAR_RESULT, 0 - goto_eq SecretBase_RedCave1_EventScript_275F97 - setvar VAR_RESULT, 1 - special sub_80EA30C - call SecretBase_RedCave1_EventScript_27134F - compare VAR_RESULT, 0 - goto_eq SecretBase_RedCave1_EventScript_275F97 - msgbox SecretBase_RedCave1_Text_275315, MSGBOX_DEFAULT - goto SecretBase_RedCave1_EventScript_276286 - end - -SecretBase_RedCave1_EventScript_275F8D:: @ 8275F8D - msgbox SecretBase_RedCave1_Text_2753AB, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_275F97:: @ 8275F97 - special sub_80EB300 - setvar VAR_RESULT, 0 - special sub_80EA30C - msgbox SecretBase_RedCave1_Text_275330, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_275FAC:: @ 8275FAC - msgbox SecretBase_RedCave1_Text_275374, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_275FB6:: @ 8275FB6 - lock - faceplayer - checkflag FLAG_SYS_GAME_CLEAR - goto_if 0, SecretBase_RedCave1_EventScript_276005 - compare VAR_RESULT, 1 - goto_eq SecretBase_RedCave1_EventScript_276024 - msgbox SecretBase_RedCave1_Text_2755D2, MSGBOX_YESNO - compare VAR_RESULT, 0 - goto_eq SecretBase_RedCave1_EventScript_27600F - setvar VAR_RESULT, 1 - special sub_80EA30C - call SecretBase_RedCave1_EventScript_27134F - compare VAR_RESULT, 0 - goto_eq SecretBase_RedCave1_EventScript_27600F - msgbox SecretBase_RedCave1_Text_275679, MSGBOX_DEFAULT - goto SecretBase_RedCave1_EventScript_276286 - end - -SecretBase_RedCave1_EventScript_276005:: @ 8276005 - msgbox SecretBase_RedCave1_Text_27571E, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_27600F:: @ 827600F - special sub_80EB300 - setvar VAR_RESULT, 0 - special sub_80EA30C - msgbox SecretBase_RedCave1_Text_275696, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_276024:: @ 8276024 - msgbox SecretBase_RedCave1_Text_2756EF, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_27602E:: @ 827602E - lock - faceplayer - checkflag FLAG_SYS_GAME_CLEAR - goto_if 0, SecretBase_RedCave1_EventScript_27607D - compare VAR_RESULT, 1 - goto_eq SecretBase_RedCave1_EventScript_27609C - msgbox SecretBase_RedCave1_Text_274A64, MSGBOX_YESNO - compare VAR_RESULT, 0 - goto_eq SecretBase_RedCave1_EventScript_276087 - setvar VAR_RESULT, 1 - special sub_80EA30C - call SecretBase_RedCave1_EventScript_27134F - compare VAR_RESULT, 0 - goto_eq SecretBase_RedCave1_EventScript_276087 - msgbox SecretBase_RedCave1_Text_274AFA, MSGBOX_DEFAULT - goto SecretBase_RedCave1_EventScript_276286 - end - -SecretBase_RedCave1_EventScript_27607D:: @ 827607D - msgbox SecretBase_RedCave1_Text_274BA2, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_276087:: @ 8276087 - special sub_80EB300 - setvar VAR_RESULT, 0 - special sub_80EA30C - msgbox SecretBase_RedCave1_Text_274B0B, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_27609C:: @ 827609C - msgbox SecretBase_RedCave1_Text_274B6C, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_2760A6:: @ 82760A6 - lock - faceplayer - checkflag FLAG_SYS_GAME_CLEAR - goto_if 0, SecretBase_RedCave1_EventScript_2760F5 - compare VAR_RESULT, 1 - goto_eq SecretBase_RedCave1_EventScript_276114 - msgbox SecretBase_RedCave1_Text_274DD2, MSGBOX_YESNO - compare VAR_RESULT, 0 - goto_eq SecretBase_RedCave1_EventScript_2760FF - setvar VAR_RESULT, 1 - special sub_80EA30C - call SecretBase_RedCave1_EventScript_27134F - compare VAR_RESULT, 0 - goto_eq SecretBase_RedCave1_EventScript_2760FF - msgbox SecretBase_RedCave1_Text_274E41, MSGBOX_DEFAULT - goto SecretBase_RedCave1_EventScript_276286 - end - -SecretBase_RedCave1_EventScript_2760F5:: @ 82760F5 - msgbox SecretBase_RedCave1_Text_274EF1, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_2760FF:: @ 82760FF - special sub_80EB300 - setvar VAR_RESULT, 0 - special sub_80EA30C - msgbox SecretBase_RedCave1_Text_274E5A, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_276114:: @ 8276114 - msgbox SecretBase_RedCave1_Text_274EB3, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_27611E:: @ 827611E - lock - faceplayer - checkflag FLAG_SYS_GAME_CLEAR - goto_if 0, SecretBase_RedCave1_EventScript_27616D - compare VAR_RESULT, 1 - goto_eq SecretBase_RedCave1_EventScript_27618C - msgbox SecretBase_RedCave1_Text_275114, MSGBOX_YESNO - compare VAR_RESULT, 0 - goto_eq SecretBase_RedCave1_EventScript_276177 - setvar VAR_RESULT, 1 - special sub_80EA30C - call SecretBase_RedCave1_EventScript_27134F - compare VAR_RESULT, 0 - goto_eq SecretBase_RedCave1_EventScript_276177 - msgbox SecretBase_RedCave1_Text_2751AF, MSGBOX_DEFAULT - goto SecretBase_RedCave1_EventScript_276286 - end - -SecretBase_RedCave1_EventScript_27616D:: @ 827616D - msgbox SecretBase_RedCave1_Text_275226, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_276177:: @ 8276177 - special sub_80EB300 - setvar VAR_RESULT, 0 - special sub_80EA30C - msgbox SecretBase_RedCave1_Text_2751CA, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_27618C:: @ 827618C - msgbox SecretBase_RedCave1_Text_2751EC, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_276196:: @ 8276196 - lock - faceplayer - checkflag FLAG_SYS_GAME_CLEAR - goto_if 0, SecretBase_RedCave1_EventScript_2761E5 - compare VAR_RESULT, 1 - goto_eq SecretBase_RedCave1_EventScript_276204 - msgbox SecretBase_RedCave1_Text_275405, MSGBOX_YESNO - compare VAR_RESULT, 0 - goto_eq SecretBase_RedCave1_EventScript_2761EF - setvar VAR_RESULT, 1 - special sub_80EA30C - call SecretBase_RedCave1_EventScript_27134F - compare VAR_RESULT, 0 - goto_eq SecretBase_RedCave1_EventScript_2761EF - msgbox SecretBase_RedCave1_Text_2754B2, MSGBOX_DEFAULT - goto SecretBase_RedCave1_EventScript_276286 - end - -SecretBase_RedCave1_EventScript_2761E5:: @ 82761E5 - msgbox SecretBase_RedCave1_Text_275546, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_2761EF:: @ 82761EF - special sub_80EB300 - setvar VAR_RESULT, 0 - special sub_80EA30C - msgbox SecretBase_RedCave1_Text_2754D8, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_276204:: @ 8276204 - msgbox SecretBase_RedCave1_Text_27550C, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_27620E:: @ 827620E - lock - faceplayer - checkflag FLAG_SYS_GAME_CLEAR - goto_if 0, SecretBase_RedCave1_EventScript_27625D - compare VAR_RESULT, 1 - goto_eq SecretBase_RedCave1_EventScript_27627C - msgbox SecretBase_RedCave1_Text_2757B5, MSGBOX_YESNO - compare VAR_RESULT, 0 - goto_eq SecretBase_RedCave1_EventScript_276267 - setvar VAR_RESULT, 1 - special sub_80EA30C - call SecretBase_RedCave1_EventScript_27134F - compare VAR_RESULT, 0 - goto_eq SecretBase_RedCave1_EventScript_276267 - msgbox SecretBase_RedCave1_Text_275884, MSGBOX_DEFAULT - goto SecretBase_RedCave1_EventScript_276286 - end - -SecretBase_RedCave1_EventScript_27625D:: @ 827625D - msgbox SecretBase_RedCave1_Text_275944, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_276267:: @ 8276267 - special sub_80EB300 - setvar VAR_RESULT, 0 - special sub_80EA30C - msgbox SecretBase_RedCave1_Text_27589D, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_27627C:: @ 827627C - msgbox SecretBase_RedCave1_Text_275909, MSGBOX_DEFAULT - release - end - -SecretBase_RedCave1_EventScript_276286:: @ 8276286 - special sub_80EA2E4 - setvar VAR_0x8004, SPECIAL_BATTLE_SECRET_BASE - setvar VAR_0x8005, 0 - special DoSpecialTrainerBattle - waitstate - compare VAR_RESULT, 3 - call_if 1, SecretBase_RedCave1_EventScript_2762BD - compare VAR_RESULT, 1 - call_if 1, SecretBase_RedCave1_EventScript_2762C1 - compare VAR_RESULT, 2 - call_if 1, SecretBase_RedCave1_EventScript_2762C5 - special HealPlayerParty - release - end - -SecretBase_RedCave1_EventScript_2762BD:: @ 82762BD - special sub_80EB438 - return - -SecretBase_RedCave1_EventScript_2762C1:: @ 82762C1 - special sub_80EB368 - return - -SecretBase_RedCave1_EventScript_2762C5:: @ 82762C5 - special sub_80EB3D0 - return - - .include "data/scripts/secret_power_tm.inc" - -Text_2766AA: @ 82766AA - .string "All decorations and furniture in your\n" - .string "SECRET BASE will be returned to your PC.\p" - .string "Is that okay?$" - -Text_276707: @ 8276707 - .string "Do you want to register\n" - .string "{STR_VAR_1}'s SECRET BASE?$" - -Text_276731: @ 8276731 - .string "This data is already registered.\n" - .string "Would you like to delete it?$" - -Text_27676F: @ 827676F - .string "Up to 10 locations can be registered.\p" - .string "Delete a location if you want to\n" - .string "register another location.$" - -Text_2767D1: @ 82767D1 - .string "Registration completed.$" - -Text_2767E9: @ 82767E9 - .string "Data has been unregistered.$" - -Text_276805: @ 8276805 - .string "{PLAYER} booted up the PC.$" - -Text_27681A: @ 827681A - .string "What would you like to do?$" - -Text_276835: @ 8276835 - .string "Once registered, a SECRET BASE will not\n" - .string "disappear unless the other TRAINER\l" - .string "moves it to a different location.\p" - .string "If a SECRET BASE is deleted from the\n" - .string "registered list, another one may take\l" - .string "its place.\p" - .string "Up to ten SECRET BASE locations\n" - .string "may be registered.$" - -Text_27692B: @ 827692B - .string "A shield of {STR_VAR_2} that marks winning\n" - .string "{STR_VAR_1} times in a row at the BATTLE TOWER.$" - -Text_276974: @ 8276974 - .string "A realistic toy TV. It could be easily\n" - .string "mistaken for the real thing.$" - -Text_2769B8: @ 82769B8 - .string "A toy TV shaped like a SEEDOT.\n" - .string "It looks ready to roll away on its own…$" - -Text_2769FF: @ 82769FF - .string "A toy TV shaped like a SKITTY.\n" - .string "It looks ready to stroll away…$" - -Text_276A3D: @ 8276A3D - .string "You may only make one SECRET BASE.\p" - .string "Would you like to move from the SECRET\n" - .string "BASE near {STR_VAR_1}?$" - -Text_276A95: @ 8276A95 - .string "Moving completed.\p" - .string "Would you like to use the SECRET POWER?$" - + .include "data/scripts/secret_base.inc" .include "data/scripts/cable_club.inc" .include "data/scripts/contest_hall.inc" .include "data/text/contest_strings.inc" @@ -5493,7 +4245,7 @@ gUnknown_0827EE07:: @ 27EE07 gUnknown_0827EE09:: @ 27EE09 .string "8$" - + .include "data/scripts/tv.inc" .include "data/text/tv.inc" diff --git a/data/maps/BattleFrontier_BattlePyramidEmptySquare/scripts.inc b/data/maps/BattleFrontier_BattlePyramidEmptySquare/scripts.inc index cff9197f8..d6d53bc2f 100644 --- a/data/maps/BattleFrontier_BattlePyramidEmptySquare/scripts.inc +++ b/data/maps/BattleFrontier_BattlePyramidEmptySquare/scripts.inc @@ -153,7 +153,7 @@ BattleFrontier_BattlePyramidEmptySquare_EventScript_252C45:: @ 8252C45 end BattleFrontier_BattlePyramidEmptySquare_EventScript_252C4F:: @ 8252C4F - trainerbattle TRAINER_BATTLE_9, TRAINER_PHILLIP, 0, BattleFrontier_BattlePyramidEmptySquare_Text_252C8D, BattleFrontier_BattlePyramidEmptySquare_Text_252C8D + trainerbattle TRAINER_BATTLE_PYRAMID, TRAINER_PHILLIP, 0, BattleFrontier_BattlePyramidEmptySquare_Text_252C8D, BattleFrontier_BattlePyramidEmptySquare_Text_252C8D setvar VAR_0x8004, 10 special CallBattlePyramidFunction waitmessage diff --git a/data/scripts/secret_base.inc b/data/scripts/secret_base.inc new file mode 100644 index 000000000..35a2731a7 --- /dev/null +++ b/data/scripts/secret_base.inc @@ -0,0 +1,1115 @@ +Text_274746: @ 8274746 + .string "If some vines drop down, this tree can\n" + .string "be climbed.$" + +Text_274779: @ 8274779 + .string "If some vines drop down, this tree can\n" + .string "be climbed.\p" + .string "Use the SECRET POWER?$" + +Text_2747C2: @ 82747C2 + .string "A thick vine dropped down!$" + +Text_2747DD: @ 82747DD + .string "If this clump of grass can be moved,\n" + .string "it might be possible to go inside.$" + +Text_274825: @ 8274825 + .string "If this clump of grass can be moved,\n" + .string "it might be possible to go inside.\p" + .string "Use the SECRET POWER?$" + +Text_274883: @ 8274883 + .string "Discovered a small entrance!$" + +SecretBase_RedCave1_Text_2748A0: @ 82748A0 + .string "Have you made a SECRET BASE already?\p" + .string "I went here, there, everywhere before\n" + .string "choosing this place.\p" + .string "Since you're already here, how would\n" + .string "you like to battle?$" + +SecretBase_RedCave1_Text_274939: @ 8274939 + .string "Okay!\n" + .string "Here we come!$" + +SecretBase_RedCave1_Text_27494D: @ 827494D + .string "Hunh?\n" + .string "Oh, you can't now…$" + +SecretBase_RedCave1_Text_274966:: @ 8274966 + .string "Waaargh! You're too strong!\n" + .string "About me losing… Please keep it secret!$" + +SecretBase_RedCave1_Text_2749AA: @ 82749AA + .string "What do you think of my SECRET BASE?\n" + .string "Come visit me again tomorrow.$" + +SecretBase_RedCave1_Text_2749ED: @ 82749ED + .string "Have you made a SECRET BASE already?\p" + .string "I went here, there, everywhere before\n" + .string "choosing this place.\p" + .string "Feel free to hang out!$" + +SecretBase_RedCave1_Text_274A64: @ 8274A64 + .string "There're a lot of places where\n" + .string "you can make a SECRET BASE.\p" + .string "But I like this spot best.\n" + .string "Don't you think it's nice?\p" + .string "Oh, would you like to have a battle?$" + +SecretBase_RedCave1_Text_274AFA: @ 8274AFA + .string "Okay, here goes!$" + +SecretBase_RedCave1_Text_274B0B: @ 8274B0B + .string "Oh…\n" + .string "You can't now, okay.$" + +SecretBase_RedCave1_Text_274B24:: @ 8274B24 + .string "Hmmm… It's our loss…\n" + .string "But don't tell anyone!\l" + .string "It's a confidential secret!$" + +SecretBase_RedCave1_Text_274B6C: @ 8274B6C + .string "If you're in this area again,\n" + .string "I hope you'll visit me.$" + +SecretBase_RedCave1_Text_274BA2: @ 8274BA2 + .string "There're a lot of places where you can\n" + .string "make a SECRET BASE.\p" + .string "But I like this spot best.\n" + .string "Don't you think it's nice?$" + +SecretBase_RedCave1_Text_274C13: @ 8274C13 + .string "This is a popular spot.\n" + .string "It's always taken.\p" + .string "Oh! Were you thinking about\n" + .string "taking this spot, too?\p" + .string "I'll tell you what, you can have this\n" + .string "spot if you can beat me.$" + +SecretBase_RedCave1_Text_274CB0: @ 8274CB0 + .string "Okay!\n" + .string "I'm going to defend my SECRET BASE!$" + +SecretBase_RedCave1_Text_274CDA: @ 8274CDA + .string "Hunh? Is that right?\n" + .string "You're not interested in this spot?$" + +SecretBase_RedCave1_Text_274D13:: @ 8274D13 + .string "I can't keep going!\n" + .string "I surrender!$" + +SecretBase_RedCave1_Text_274D34: @ 8274D34 + .string "Okay, when I move one day,\n" + .string "this place will be yours!$" + +SecretBase_RedCave1_Text_274D69: @ 8274D69 + .string "This is a popular spot.\n" + .string "It's always taken.\p" + .string "I waited a long time for it to open.\n" + .string "I finally got to use it!$" + +SecretBase_RedCave1_Text_274DD2: @ 8274DD2 + .string "Welcome to my POKéMON LAB.\p" + .string "I carry out research on battling in\n" + .string "secrecy.\p" + .string "Would you like to see how strong I am?$" + +SecretBase_RedCave1_Text_274E41: @ 8274E41 + .string "I'm going to go all out!$" + +SecretBase_RedCave1_Text_274E5A: @ 8274E5A + .string "Oh.\n" + .string "Some other time, then!$" + +SecretBase_RedCave1_Text_274E75:: @ 8274E75 + .string "Hmm… I've still got lots to learn.\n" + .string "I have to study some more.$" + +SecretBase_RedCave1_Text_274EB3: @ 8274EB3 + .string "Thanks for battling with me.\n" + .string "Please come back again tomorrow.$" + +SecretBase_RedCave1_Text_274EF1: @ 8274EF1 + .string "Welcome to my POKéMON LAB.\p" + .string "I carry out research on battling in\n" + .string "secrecy.$" + +SecretBase_RedCave1_Text_274F39: @ 8274F39 + .string "A big mansion is nice, but I like this\n" + .string "sort of place more.\p" + .string "I like it because all kinds of people\n" + .string "come visit me.\p" + .string "So, how would you like a battle?$" + +SecretBase_RedCave1_Text_274FCA: @ 8274FCA + .string "That's the way!$" + +SecretBase_RedCave1_Text_274FDA: @ 8274FDA + .string "When you're ready, give me a shout!$" + +SecretBase_RedCave1_Text_274FFE:: @ 8274FFE + .string "Aww! Done in!\n" + .string "But it's still fun to battle!$" + +SecretBase_RedCave1_Text_27502A: @ 827502A + .string "Well, anyway, I should go buy some\n" + .string "decorations and furniture.\p" + .string "I want my SECRET BASE to be a place\n" + .string "other people can enjoy.$" + +SecretBase_RedCave1_Text_2750A4: @ 82750A4 + .string "A big mansion is nice, but I like this\n" + .string "sort of place more.\p" + .string "I like it because all kinds of people\n" + .string "come visit me.$" + +SecretBase_RedCave1_Text_275114: @ 8275114 + .string "I simply adore shopping for decorations\n" + .string "and furniture.\p" + .string "I also love raising POKéMON just\n" + .string "as much.\p" + .string "If you would be so kind, will you battle\n" + .string "with my POKéMON?$" + +SecretBase_RedCave1_Text_2751AF: @ 82751AF + .string "Thank you.\n" + .string "Shall we begin?$" + +SecretBase_RedCave1_Text_2751CA: @ 82751CA + .string "Oh.\n" + .string "How disappointing…$" + +SecretBase_RedCave1_Text_2751E1:: @ 82751E1 + .string "I concede…$" + +SecretBase_RedCave1_Text_2751EC: @ 82751EC + .string "That was all in good fun!\n" + .string "I should go enjoy shopping now.$" + +SecretBase_RedCave1_Text_275226: @ 8275226 + .string "I simply adore shopping for decorations\n" + .string "and furniture.\p" + .string "I also love raising POKéMON just\n" + .string "as much.$" + +SecretBase_RedCave1_Text_275287: @ 8275287 + .string "Some people make their SECRET BASES in\n" + .string "hard-to-find places.\l" + .string "Do they want to just lie low?\p" + .string "But since you found me, how about we\n" + .string "have a battle?$" + +SecretBase_RedCave1_Text_275315: @ 8275315 + .string "I'm not going down easily!$" + +SecretBase_RedCave1_Text_275330: @ 8275330 + .string "Oh… Are you maybe tired from searching\n" + .string "for this place?$" + +SecretBase_RedCave1_Text_275367:: @ 8275367 + .string "I went down…$" + +SecretBase_RedCave1_Text_275374: @ 8275374 + .string "Where's your SECRET BASE?\n" + .string "I should go visit you there.$" + +SecretBase_RedCave1_Text_2753AB: @ 82753AB + .string "Some people make their SECRET BASES in\n" + .string "hard-to-find places.\l" + .string "Do they want to just lie low?$" + +SecretBase_RedCave1_Text_275405: @ 8275405 + .string "People have told me that you can get\n" + .string "decorations in several ways.\p" + .string "We should have a race to see who can\n" + .string "get nicer decorations and furniture!\p" + .string "In the meantime, want to battle?$" + +SecretBase_RedCave1_Text_2754B2: @ 82754B2 + .string "This is my SECRET BASE.\n" + .string "I can't lose!$" + +SecretBase_RedCave1_Text_2754D8: @ 82754D8 + .string "I'll battle with you anytime.$" + +SecretBase_RedCave1_Text_2754F6:: @ 82754F6 + .string "Huh?\n" + .string "Did I just lose?$" + +SecretBase_RedCave1_Text_27550C: @ 827550C + .string "I won't lose at collecting decorations.\n" + .string "Come visit again!$" + +SecretBase_RedCave1_Text_275546: @ 8275546 + .string "People have told me that you can get\n" + .string "decorations in several ways.\p" + .string "We should have a race to see who can\n" + .string "get nicer decorations and furniture!$" + +SecretBase_RedCave1_Text_2755D2: @ 82755D2 + .string "I found a spot I liked, and I did it up\n" + .string "with my favorite decorations.\p" + .string "I raise my favorite POKéMON and grow\n" + .string "stronger with it.\p" + .string "That's what I do.\n" + .string "Want to battle with me?$" + +SecretBase_RedCave1_Text_275679: @ 8275679 + .string "Show me what you're made of!$" + +SecretBase_RedCave1_Text_275696: @ 8275696 + .string "I guess there are times when you're not\n" + .string "into it.$" + +SecretBase_RedCave1_Text_2756C7:: @ 82756C7 + .string "I know exactly what you're made of now.$" + +SecretBase_RedCave1_Text_2756EF: @ 82756EF + .string "We can both become stronger.\n" + .string "Let's keep at it!$" + +SecretBase_RedCave1_Text_27571E: @ 827571E + .string "I found a spot I liked, and I did it up\n" + .string "with my favorite decorations.\p" + .string "I raise my favorite POKéMON and grow\n" + .string "stronger with it.\p" + .string "Every day is a great day.$" + +SecretBase_RedCave1_Text_2757B5: @ 82757B5 + .string "You can learn a lot about the taste\n" + .string "and sense of people by the kinds of\l" + .string "decorations they have, and how they\l" + .string "display them.\p" + .string "What do you think of my taste?\n" + .string "Are you speechless?\p" + .string "Want to see my taste in battling?$" + +SecretBase_RedCave1_Text_275884: @ 8275884 + .string "There's no holding back!$" + +SecretBase_RedCave1_Text_27589D: @ 827589D + .string "I'll be happy to demonstrate my style\n" + .string "anytime.$" + +SecretBase_RedCave1_Text_2758CC:: @ 82758CC + .string "You're supremely talented!\n" + .string "Your power seems to be limitless…$" + +SecretBase_RedCave1_Text_275909: @ 8275909 + .string "What did you think of my style?\n" + .string "I'll keep on polishing it!$" + +SecretBase_RedCave1_Text_275944: @ 8275944 + .string "You can learn a lot about the taste\n" + .string "and sense of people by the kinds of\l" + .string "decorations they have, and how they\l" + .string "display them.\p" + .string "What do you think of my taste?\n" + .string "Are you speechless?$" + +EventScript_2759F1:: @ 82759F1 + special sub_80E8C98 + special sub_80E8BC8 + compare VAR_RESULT, 1 + goto_eq EventScript_275BE8 + checkpartymove MOVE_SECRET_POWER + setfieldeffectargument 0, VAR_RESULT + buffermovename 1, MOVE_SECRET_POWER + compare VAR_0x8007, 1 + goto_eq EventScript_275A50 + compare VAR_0x8007, 2 + goto_eq EventScript_275A50 + compare VAR_0x8007, 3 + goto_eq EventScript_275A50 + compare VAR_0x8007, 4 + goto_eq EventScript_275A50 + compare VAR_0x8007, 5 + goto_eq EventScript_275AA9 + compare VAR_0x8007, 6 + goto_eq EventScript_275B02 + end + +EventScript_275A50:: @ 8275A50 + lockall + compare VAR_RESULT, 6 + goto_eq EventScript_275A91 + bufferpartymonnick 0, VAR_RESULT + msgbox gText_23B704, MSGBOX_YESNO + compare VAR_RESULT, 0 + goto_eq EventScript_275CDE + msgbox Route103_Text_290771, MSGBOX_DEFAULT + closemessage + dofieldeffect FLDEFF_USE_SECRET_POWER_CAVE + waitstate + goto EventScript_275A9B + end + +EventScript_275A86:: @ 8275A86 + lockall + dofieldeffect FLDEFF_USE_SECRET_POWER_CAVE + waitstate + goto EventScript_275A9B + end + +EventScript_275A91:: @ 8275A91 + msgbox gText_23B6E0, MSGBOX_DEFAULT + releaseall + end + +EventScript_275A9B:: @ 8275A9B + msgbox gText_23B73E, MSGBOX_DEFAULT + goto EventScript_275B5B + end + +EventScript_275AA9:: @ 8275AA9 + lockall + compare VAR_RESULT, 6 + goto_eq EventScript_275AEA + bufferpartymonnick 0, VAR_RESULT + msgbox Text_274779, MSGBOX_YESNO + compare VAR_RESULT, 0 + goto_eq EventScript_275CDE + msgbox Route103_Text_290771, MSGBOX_DEFAULT + closemessage + dofieldeffect FLDEFF_USE_SECRET_POWER_TREE + waitstate + goto EventScript_275AF4 + end + +EventScript_275ADF:: @ 8275ADF + lockall + dofieldeffect FLDEFF_USE_SECRET_POWER_TREE + waitstate + goto EventScript_275AF4 + end + +EventScript_275AEA:: @ 8275AEA + msgbox Text_274746, MSGBOX_DEFAULT + releaseall + end + +EventScript_275AF4:: @ 8275AF4 + msgbox Text_2747C2, MSGBOX_DEFAULT + goto EventScript_275B5B + end + +EventScript_275B02:: @ 8275B02 + lockall + compare VAR_RESULT, 6 + goto_eq EventScript_275B43 + bufferpartymonnick 0, VAR_RESULT + msgbox Text_274825, MSGBOX_YESNO + compare VAR_RESULT, 0 + goto_eq EventScript_275CDE + msgbox Route103_Text_290771, MSGBOX_DEFAULT + closemessage + dofieldeffect FLDEFF_USE_SECRET_POWER_SHRUB + waitstate + goto EventScript_275B4D + end + +EventScript_275B38:: @ 8275B38 + lockall + dofieldeffect FLDEFF_USE_SECRET_POWER_SHRUB + waitstate + goto EventScript_275B4D + end + +EventScript_275B43:: @ 8275B43 + msgbox Text_2747DD, MSGBOX_DEFAULT + releaseall + end + +EventScript_275B4D:: @ 8275B4D + msgbox Text_274883, MSGBOX_DEFAULT + goto EventScript_275B5B + end + +EventScript_275B5B:: @ 8275B5B + closemessage + playse SE_KAIDAN + setvar VAR_0x4097, 0 + setflag FLAG_DECORATION_0 + special sub_80E8E18 + special sub_80E9068 + setvar VAR_0x8004, 0 + setvar VAR_0x8005, 0 + special sub_80E933C + setvar VAR_0x4089, 1 + waitstate + end + +SecretBase_RedCave1_EventScript_275B81:: @ 8275B81 + applymovement 255, SecretBase_RedCave1_Movement_275BB4 + waitmovement 0 + setvar VAR_0x4097, 1 + msgbox SecretBase_RedCave1_Text_23B759, MSGBOX_YESNO + compare VAR_RESULT, 1 + goto_eq SecretBase_RedCave1_EventScript_275BAB + closemessage + playse SE_KAIDAN + special sub_80E9A90 + end + +SecretBase_RedCave1_EventScript_275BAB:: @ 8275BAB + closemessage + setflag FLAG_0x060 + special sub_80E91F8 + waitstate + end + +SecretBase_RedCave1_Movement_275BB4: @ 8275BB4 + walk_up + walk_up + step_end + +EventScript_275BB7:: @ 8275BB7 + lockall + setvar VAR_0x4097, 1 + playse SE_KAIDAN + special sub_80E9744 + compare VAR_RESULT, 0 + goto_eq EventScript_275BDB + clearflag FLAG_DECORATION_0 + special sub_80E9068 + setvar VAR_0x4089, 0 + waitstate + end + +EventScript_275BDB:: @ 8275BDB + setflag FLAG_DECORATION_0 + special sub_80E9068 + setvar VAR_0x4089, 0 + waitstate + end + +EventScript_275BE8:: @ 8275BE8 + checkpartymove MOVE_SECRET_POWER + compare VAR_RESULT, 6 + goto_eq EventScript_275C9A + setfieldeffectargument 0, VAR_RESULT + setorcopyvar VAR_0x8004, VAR_RESULT + lockall + special GetSecretBaseNearbyMapName + msgbox Text_276A3D, MSGBOX_YESNO + compare VAR_RESULT, 0 + goto_eq EventScript_275CDE + msgbox Text_2766AA, MSGBOX_YESNO + compare VAR_RESULT, 0 + goto_eq EventScript_275CDE + fadescreenswapbuffers 1 + special sub_80E9B70 + closemessage + fadescreenswapbuffers 0 + msgbox Text_276A95, MSGBOX_YESNO + compare VAR_RESULT, 0 + goto_eq EventScript_275CDE + bufferpartymonnick 0, VAR_0x8004 + buffermovename 1, MOVE_SECRET_POWER + msgbox Route103_Text_290771, MSGBOX_DEFAULT + closemessage + closemessage + compare VAR_0x8007, 1 + goto_eq EventScript_275A86 + compare VAR_0x8007, 2 + goto_eq EventScript_275A86 + compare VAR_0x8007, 3 + goto_eq EventScript_275A86 + compare VAR_0x8007, 4 + goto_eq EventScript_275A86 + compare VAR_0x8007, 5 + goto_eq EventScript_275ADF + compare VAR_0x8007, 6 + goto_eq EventScript_275B38 + releaseall + end + +EventScript_275C9A:: @ 8275C9A + lockall + compare VAR_0x8007, 1 + goto_eq EventScript_275A91 + compare VAR_0x8007, 2 + goto_eq EventScript_275A91 + compare VAR_0x8007, 3 + goto_eq EventScript_275A91 + compare VAR_0x8007, 4 + goto_eq EventScript_275A91 + compare VAR_0x8007, 5 + goto_eq EventScript_275AEA + compare VAR_0x8007, 6 + goto_eq EventScript_275B43 + end + +EventScript_275CDE:: @ 8275CDE + closemessage + releaseall + end + +LittlerootTown_BrendansHouse_2F_EventScript_275CE1:: @ 8275CE1 +LittlerootTown_MaysHouse_2F_EventScript_275CE1:: @ 8275CE1 +SecretBase_RedCave1_EventScript_275CE1:: @ 8275CE1 + setflag FLAG_DECORATION_1 + setflag FLAG_DECORATION_2 + setflag FLAG_DECORATION_3 + setflag FLAG_DECORATION_4 + setflag FLAG_DECORATION_5 + setflag FLAG_DECORATION_6 + setflag FLAG_DECORATION_7 + setflag FLAG_DECORATION_8 + setflag FLAG_DECORATION_9 + setflag FLAG_DECORATION_10 + setflag FLAG_DECORATION_11 + setflag FLAG_DECORATION_12 + setflag FLAG_DECORATION_13 + setflag FLAG_DECORATION_14 + return + +EventScript_275D0C:: @ 8275D0C + setvar VAR_0x8004, 0 + setvar VAR_0x8005, 0 + special sub_80E933C + setvar VAR_0x4089, 1 + end + +EventScript_275D1F:: @ 8275D1F + setvar VAR_0x8005, 0 + goto EventScript_275D2A + end + +EventScript_275D2A:: @ 8275D2A + special sub_8127E18 + end + +EventScript_275D2E:: @ 8275D2E + setvar VAR_0x8004, 0 + goto EventScript_275D39 + end + +EventScript_275D39:: @ 8275D39 + special sub_8129708 + compare VAR_RESULT, 1 + goto_eq EventScript_275D63 + addvar VAR_0x8004, 1 + compare VAR_0x8005, 0 + goto_eq EventScript_275D39 + removeobject VAR_0x8006 + setflag 0x8005 + goto EventScript_275D39 + end + +EventScript_275D63:: @ 8275D63 + end + +SecretBase_BlueCave1_EventScript_275D64:: @ 8275D64 +SecretBase_BlueCave2_EventScript_275D64:: @ 8275D64 +SecretBase_BlueCave3_EventScript_275D64:: @ 8275D64 +SecretBase_BlueCave4_EventScript_275D64:: @ 8275D64 +SecretBase_BrownCave1_EventScript_275D64:: @ 8275D64 +SecretBase_BrownCave2_EventScript_275D64:: @ 8275D64 +SecretBase_BrownCave3_EventScript_275D64:: @ 8275D64 +SecretBase_BrownCave4_EventScript_275D64:: @ 8275D64 +SecretBase_RedCave1_EventScript_275D64:: @ 8275D64 +SecretBase_RedCave2_EventScript_275D64:: @ 8275D64 +SecretBase_RedCave3_EventScript_275D64:: @ 8275D64 +SecretBase_RedCave4_EventScript_275D64:: @ 8275D64 +SecretBase_Shrub1_EventScript_275D64:: @ 8275D64 +SecretBase_Shrub2_EventScript_275D64:: @ 8275D64 +SecretBase_Shrub3_EventScript_275D64:: @ 8275D64 +SecretBase_Shrub4_EventScript_275D64:: @ 8275D64 +SecretBase_Tree1_EventScript_275D64:: @ 8275D64 +SecretBase_Tree2_EventScript_275D64:: @ 8275D64 +SecretBase_Tree3_EventScript_275D64:: @ 8275D64 +SecretBase_Tree4_EventScript_275D64:: @ 8275D64 +SecretBase_YellowCave1_EventScript_275D64:: @ 8275D64 +SecretBase_YellowCave2_EventScript_275D64:: @ 8275D64 +SecretBase_YellowCave3_EventScript_275D64:: @ 8275D64 +SecretBase_YellowCave4_EventScript_275D64:: @ 8275D64 + special sub_80EA354 + compare VAR_0x8004, 0 + goto_eq SecretBase_RedCave1_EventScript_275DD6 + compare VAR_0x8004, 1 + goto_eq SecretBase_RedCave1_EventScript_275E4E + compare VAR_0x8004, 2 + goto_eq SecretBase_RedCave1_EventScript_275EC6 + compare VAR_0x8004, 3 + goto_eq SecretBase_RedCave1_EventScript_275F3E + compare VAR_0x8004, 4 + goto_eq SecretBase_RedCave1_EventScript_275FB6 + compare VAR_0x8004, 5 + goto_eq SecretBase_RedCave1_EventScript_27602E + compare VAR_0x8004, 6 + goto_eq SecretBase_RedCave1_EventScript_2760A6 + compare VAR_0x8004, 7 + goto_eq SecretBase_RedCave1_EventScript_27611E + compare VAR_0x8004, 8 + goto_eq SecretBase_RedCave1_EventScript_276196 + compare VAR_0x8004, 9 + goto_eq SecretBase_RedCave1_EventScript_27620E + end + +SecretBase_RedCave1_EventScript_275DD6:: @ 8275DD6 + lock + faceplayer + checkflag FLAG_SYS_GAME_CLEAR + goto_if 0, SecretBase_RedCave1_EventScript_275E25 + compare VAR_RESULT, 1 + goto_eq SecretBase_RedCave1_EventScript_275E44 + msgbox SecretBase_RedCave1_Text_2748A0, MSGBOX_YESNO + compare VAR_RESULT, 0 + goto_eq SecretBase_RedCave1_EventScript_275E2F + setvar VAR_RESULT, 1 + special sub_80EA30C + call SecretBase_RedCave1_EventScript_27134F + compare VAR_RESULT, 0 + goto_eq SecretBase_RedCave1_EventScript_275E2F + msgbox SecretBase_RedCave1_Text_274939, MSGBOX_DEFAULT + goto SecretBase_RedCave1_EventScript_276286 + end + +SecretBase_RedCave1_EventScript_275E25:: @ 8275E25 + msgbox SecretBase_RedCave1_Text_2749ED, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_275E2F:: @ 8275E2F + special sub_80EB300 + setvar VAR_RESULT, 0 + special sub_80EA30C + msgbox SecretBase_RedCave1_Text_27494D, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_275E44:: @ 8275E44 + msgbox SecretBase_RedCave1_Text_2749AA, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_275E4E:: @ 8275E4E + lock + faceplayer + checkflag FLAG_SYS_GAME_CLEAR + goto_if 0, SecretBase_RedCave1_EventScript_275E9D + compare VAR_RESULT, 1 + goto_eq SecretBase_RedCave1_EventScript_275EBC + msgbox SecretBase_RedCave1_Text_274C13, MSGBOX_YESNO + compare VAR_RESULT, 0 + goto_eq SecretBase_RedCave1_EventScript_275EA7 + setvar VAR_RESULT, 1 + special sub_80EA30C + call SecretBase_RedCave1_EventScript_27134F + compare VAR_RESULT, 0 + goto_eq SecretBase_RedCave1_EventScript_275EA7 + msgbox SecretBase_RedCave1_Text_274CB0, MSGBOX_DEFAULT + goto SecretBase_RedCave1_EventScript_276286 + end + +SecretBase_RedCave1_EventScript_275E9D:: @ 8275E9D + msgbox SecretBase_RedCave1_Text_274D69, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_275EA7:: @ 8275EA7 + special sub_80EB300 + setvar VAR_RESULT, 0 + special sub_80EA30C + msgbox SecretBase_RedCave1_Text_274CDA, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_275EBC:: @ 8275EBC + msgbox SecretBase_RedCave1_Text_274D34, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_275EC6:: @ 8275EC6 + lock + faceplayer + checkflag FLAG_SYS_GAME_CLEAR + goto_if 0, SecretBase_RedCave1_EventScript_275F15 + compare VAR_RESULT, 1 + goto_eq SecretBase_RedCave1_EventScript_275F34 + msgbox SecretBase_RedCave1_Text_274F39, MSGBOX_YESNO + compare VAR_RESULT, 0 + goto_eq SecretBase_RedCave1_EventScript_275F1F + setvar VAR_RESULT, 1 + special sub_80EA30C + call SecretBase_RedCave1_EventScript_27134F + compare VAR_RESULT, 0 + goto_eq SecretBase_RedCave1_EventScript_275F1F + msgbox SecretBase_RedCave1_Text_274FCA, MSGBOX_DEFAULT + goto SecretBase_RedCave1_EventScript_276286 + end + +SecretBase_RedCave1_EventScript_275F15:: @ 8275F15 + msgbox SecretBase_RedCave1_Text_2750A4, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_275F1F:: @ 8275F1F + special sub_80EB300 + setvar VAR_RESULT, 0 + special sub_80EA30C + msgbox SecretBase_RedCave1_Text_274FDA, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_275F34:: @ 8275F34 + msgbox SecretBase_RedCave1_Text_27502A, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_275F3E:: @ 8275F3E + lock + faceplayer + checkflag FLAG_SYS_GAME_CLEAR + goto_if 0, SecretBase_RedCave1_EventScript_275F8D + compare VAR_RESULT, 1 + goto_eq SecretBase_RedCave1_EventScript_275FAC + msgbox SecretBase_RedCave1_Text_275287, MSGBOX_YESNO + compare VAR_RESULT, 0 + goto_eq SecretBase_RedCave1_EventScript_275F97 + setvar VAR_RESULT, 1 + special sub_80EA30C + call SecretBase_RedCave1_EventScript_27134F + compare VAR_RESULT, 0 + goto_eq SecretBase_RedCave1_EventScript_275F97 + msgbox SecretBase_RedCave1_Text_275315, MSGBOX_DEFAULT + goto SecretBase_RedCave1_EventScript_276286 + end + +SecretBase_RedCave1_EventScript_275F8D:: @ 8275F8D + msgbox SecretBase_RedCave1_Text_2753AB, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_275F97:: @ 8275F97 + special sub_80EB300 + setvar VAR_RESULT, 0 + special sub_80EA30C + msgbox SecretBase_RedCave1_Text_275330, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_275FAC:: @ 8275FAC + msgbox SecretBase_RedCave1_Text_275374, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_275FB6:: @ 8275FB6 + lock + faceplayer + checkflag FLAG_SYS_GAME_CLEAR + goto_if 0, SecretBase_RedCave1_EventScript_276005 + compare VAR_RESULT, 1 + goto_eq SecretBase_RedCave1_EventScript_276024 + msgbox SecretBase_RedCave1_Text_2755D2, MSGBOX_YESNO + compare VAR_RESULT, 0 + goto_eq SecretBase_RedCave1_EventScript_27600F + setvar VAR_RESULT, 1 + special sub_80EA30C + call SecretBase_RedCave1_EventScript_27134F + compare VAR_RESULT, 0 + goto_eq SecretBase_RedCave1_EventScript_27600F + msgbox SecretBase_RedCave1_Text_275679, MSGBOX_DEFAULT + goto SecretBase_RedCave1_EventScript_276286 + end + +SecretBase_RedCave1_EventScript_276005:: @ 8276005 + msgbox SecretBase_RedCave1_Text_27571E, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_27600F:: @ 827600F + special sub_80EB300 + setvar VAR_RESULT, 0 + special sub_80EA30C + msgbox SecretBase_RedCave1_Text_275696, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_276024:: @ 8276024 + msgbox SecretBase_RedCave1_Text_2756EF, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_27602E:: @ 827602E + lock + faceplayer + checkflag FLAG_SYS_GAME_CLEAR + goto_if 0, SecretBase_RedCave1_EventScript_27607D + compare VAR_RESULT, 1 + goto_eq SecretBase_RedCave1_EventScript_27609C + msgbox SecretBase_RedCave1_Text_274A64, MSGBOX_YESNO + compare VAR_RESULT, 0 + goto_eq SecretBase_RedCave1_EventScript_276087 + setvar VAR_RESULT, 1 + special sub_80EA30C + call SecretBase_RedCave1_EventScript_27134F + compare VAR_RESULT, 0 + goto_eq SecretBase_RedCave1_EventScript_276087 + msgbox SecretBase_RedCave1_Text_274AFA, MSGBOX_DEFAULT + goto SecretBase_RedCave1_EventScript_276286 + end + +SecretBase_RedCave1_EventScript_27607D:: @ 827607D + msgbox SecretBase_RedCave1_Text_274BA2, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_276087:: @ 8276087 + special sub_80EB300 + setvar VAR_RESULT, 0 + special sub_80EA30C + msgbox SecretBase_RedCave1_Text_274B0B, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_27609C:: @ 827609C + msgbox SecretBase_RedCave1_Text_274B6C, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_2760A6:: @ 82760A6 + lock + faceplayer + checkflag FLAG_SYS_GAME_CLEAR + goto_if 0, SecretBase_RedCave1_EventScript_2760F5 + compare VAR_RESULT, 1 + goto_eq SecretBase_RedCave1_EventScript_276114 + msgbox SecretBase_RedCave1_Text_274DD2, MSGBOX_YESNO + compare VAR_RESULT, 0 + goto_eq SecretBase_RedCave1_EventScript_2760FF + setvar VAR_RESULT, 1 + special sub_80EA30C + call SecretBase_RedCave1_EventScript_27134F + compare VAR_RESULT, 0 + goto_eq SecretBase_RedCave1_EventScript_2760FF + msgbox SecretBase_RedCave1_Text_274E41, MSGBOX_DEFAULT + goto SecretBase_RedCave1_EventScript_276286 + end + +SecretBase_RedCave1_EventScript_2760F5:: @ 82760F5 + msgbox SecretBase_RedCave1_Text_274EF1, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_2760FF:: @ 82760FF + special sub_80EB300 + setvar VAR_RESULT, 0 + special sub_80EA30C + msgbox SecretBase_RedCave1_Text_274E5A, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_276114:: @ 8276114 + msgbox SecretBase_RedCave1_Text_274EB3, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_27611E:: @ 827611E + lock + faceplayer + checkflag FLAG_SYS_GAME_CLEAR + goto_if 0, SecretBase_RedCave1_EventScript_27616D + compare VAR_RESULT, 1 + goto_eq SecretBase_RedCave1_EventScript_27618C + msgbox SecretBase_RedCave1_Text_275114, MSGBOX_YESNO + compare VAR_RESULT, 0 + goto_eq SecretBase_RedCave1_EventScript_276177 + setvar VAR_RESULT, 1 + special sub_80EA30C + call SecretBase_RedCave1_EventScript_27134F + compare VAR_RESULT, 0 + goto_eq SecretBase_RedCave1_EventScript_276177 + msgbox SecretBase_RedCave1_Text_2751AF, MSGBOX_DEFAULT + goto SecretBase_RedCave1_EventScript_276286 + end + +SecretBase_RedCave1_EventScript_27616D:: @ 827616D + msgbox SecretBase_RedCave1_Text_275226, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_276177:: @ 8276177 + special sub_80EB300 + setvar VAR_RESULT, 0 + special sub_80EA30C + msgbox SecretBase_RedCave1_Text_2751CA, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_27618C:: @ 827618C + msgbox SecretBase_RedCave1_Text_2751EC, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_276196:: @ 8276196 + lock + faceplayer + checkflag FLAG_SYS_GAME_CLEAR + goto_if 0, SecretBase_RedCave1_EventScript_2761E5 + compare VAR_RESULT, 1 + goto_eq SecretBase_RedCave1_EventScript_276204 + msgbox SecretBase_RedCave1_Text_275405, MSGBOX_YESNO + compare VAR_RESULT, 0 + goto_eq SecretBase_RedCave1_EventScript_2761EF + setvar VAR_RESULT, 1 + special sub_80EA30C + call SecretBase_RedCave1_EventScript_27134F + compare VAR_RESULT, 0 + goto_eq SecretBase_RedCave1_EventScript_2761EF + msgbox SecretBase_RedCave1_Text_2754B2, MSGBOX_DEFAULT + goto SecretBase_RedCave1_EventScript_276286 + end + +SecretBase_RedCave1_EventScript_2761E5:: @ 82761E5 + msgbox SecretBase_RedCave1_Text_275546, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_2761EF:: @ 82761EF + special sub_80EB300 + setvar VAR_RESULT, 0 + special sub_80EA30C + msgbox SecretBase_RedCave1_Text_2754D8, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_276204:: @ 8276204 + msgbox SecretBase_RedCave1_Text_27550C, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_27620E:: @ 827620E + lock + faceplayer + checkflag FLAG_SYS_GAME_CLEAR + goto_if 0, SecretBase_RedCave1_EventScript_27625D + compare VAR_RESULT, 1 + goto_eq SecretBase_RedCave1_EventScript_27627C + msgbox SecretBase_RedCave1_Text_2757B5, MSGBOX_YESNO + compare VAR_RESULT, 0 + goto_eq SecretBase_RedCave1_EventScript_276267 + setvar VAR_RESULT, 1 + special sub_80EA30C + call SecretBase_RedCave1_EventScript_27134F + compare VAR_RESULT, 0 + goto_eq SecretBase_RedCave1_EventScript_276267 + msgbox SecretBase_RedCave1_Text_275884, MSGBOX_DEFAULT + goto SecretBase_RedCave1_EventScript_276286 + end + +SecretBase_RedCave1_EventScript_27625D:: @ 827625D + msgbox SecretBase_RedCave1_Text_275944, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_276267:: @ 8276267 + special sub_80EB300 + setvar VAR_RESULT, 0 + special sub_80EA30C + msgbox SecretBase_RedCave1_Text_27589D, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_27627C:: @ 827627C + msgbox SecretBase_RedCave1_Text_275909, MSGBOX_DEFAULT + release + end + +SecretBase_RedCave1_EventScript_276286:: @ 8276286 + special sub_80EA2E4 + setvar VAR_0x8004, SPECIAL_BATTLE_SECRET_BASE + setvar VAR_0x8005, 0 + special DoSpecialTrainerBattle + waitstate + compare VAR_RESULT, 3 + call_if 1, SecretBase_RedCave1_EventScript_2762BD + compare VAR_RESULT, 1 + call_if 1, SecretBase_RedCave1_EventScript_2762C1 + compare VAR_RESULT, 2 + call_if 1, SecretBase_RedCave1_EventScript_2762C5 + special HealPlayerParty + release + end + +SecretBase_RedCave1_EventScript_2762BD:: @ 82762BD + special sub_80EB438 + return + +SecretBase_RedCave1_EventScript_2762C1:: @ 82762C1 + special sub_80EB368 + return + +SecretBase_RedCave1_EventScript_2762C5:: @ 82762C5 + special sub_80EB3D0 + return + + .include "data/scripts/secret_power_tm.inc" + +Text_2766AA: @ 82766AA + .string "All decorations and furniture in your\n" + .string "SECRET BASE will be returned to your PC.\p" + .string "Is that okay?$" + +Text_276707: @ 8276707 + .string "Do you want to register\n" + .string "{STR_VAR_1}'s SECRET BASE?$" + +Text_276731: @ 8276731 + .string "This data is already registered.\n" + .string "Would you like to delete it?$" + +Text_27676F: @ 827676F + .string "Up to 10 locations can be registered.\p" + .string "Delete a location if you want to\n" + .string "register another location.$" + +Text_2767D1: @ 82767D1 + .string "Registration completed.$" + +Text_2767E9: @ 82767E9 + .string "Data has been unregistered.$" + +Text_276805: @ 8276805 + .string "{PLAYER} booted up the PC.$" + +Text_27681A: @ 827681A + .string "What would you like to do?$" + +Text_276835: @ 8276835 + .string "Once registered, a SECRET BASE will not\n" + .string "disappear unless the other TRAINER\l" + .string "moves it to a different location.\p" + .string "If a SECRET BASE is deleted from the\n" + .string "registered list, another one may take\l" + .string "its place.\p" + .string "Up to ten SECRET BASE locations\n" + .string "may be registered.$" + +Text_27692B: @ 827692B + .string "A shield of {STR_VAR_2} that marks winning\n" + .string "{STR_VAR_1} times in a row at the BATTLE TOWER.$" + +Text_276974: @ 8276974 + .string "A realistic toy TV. It could be easily\n" + .string "mistaken for the real thing.$" + +Text_2769B8: @ 82769B8 + .string "A toy TV shaped like a SEEDOT.\n" + .string "It looks ready to roll away on its own…$" + +Text_2769FF: @ 82769FF + .string "A toy TV shaped like a SKITTY.\n" + .string "It looks ready to stroll away…$" + +Text_276A3D: @ 8276A3D + .string "You may only make one SECRET BASE.\p" + .string "Would you like to move from the SECRET\n" + .string "BASE near {STR_VAR_1}?$" + +Text_276A95: @ 8276A95 + .string "Moving completed.\p" + .string "Would you like to use the SECRET POWER?$" diff --git a/data/scripts/trainer_battle.inc b/data/scripts/trainer_battle.inc new file mode 100644 index 000000000..61a1afa25 --- /dev/null +++ b/data/scripts/trainer_battle.inc @@ -0,0 +1,128 @@ +EventScript_ShowSecondTrainerIntro:: @ 8271356 + special SetUpTrainerEncounterMusic + special EndTrainerApproach + waitstate + goto EventScript_ShowTrainerIntroMsg + +EventScript_TryDoNormalTrainerBattle:: @ 8271362 + lock + faceplayer + applymovement VAR_LAST_TALKED, Movement_RevealTrainer + waitmovement 0 + specialvar VAR_RESULT, GetTrainerFlag + compare VAR_RESULT, 0 + goto_if 5, EventScript_NoNormalTrainerBattle + special SetUpTrainerEncounterMusic + special SetUpTrainerMovement + goto EventScript_ShowTrainerIntroMsg +EventScript_NoNormalTrainerBattle:: @ 8271389 + gotopostbattlescript + +EventScript_TryDoDoubleTrainerBattle:: @ 827138A + lock + faceplayer + call EventScript_RevealTrainer + specialvar VAR_RESULT, GetTrainerFlag + compare VAR_RESULT, 0 + goto_if 5, EventScript_NoDoubleTrainerBattle + special HasEnoughMonsForDoubleBattle + compare VAR_RESULT, 0 + goto_if 5, EventScript_NotEnoughMonsForDoubleBattle + special SetUpTrainerEncounterMusic + special SetUpTrainerMovement + goto EventScript_ShowTrainerIntroMsg +EventScript_NotEnoughMonsForDoubleBattle:: @ 82713BA + special ShowTrainerCantBattleSpeech + waitmessage + waitbuttonpress + release + end +EventScript_NoDoubleTrainerBattle:: @ 82713C1 + gotopostbattlescript + +EventScript_DoTainerBattle:: @ 82713C2 + applymovement VAR_LAST_TALKED, Movement_RevealTrainer + waitmovement 0 + special SetUpTrainerEncounterMusic + trainerbattlebegin + gotopostbattlescript + +EventScript_TryDoRematchBattle:: @ 82713D1 + call EventScript_RevealTrainer + specialvar VAR_RESULT, IsTrainerReadyForRematch + compare VAR_RESULT, 0 + goto_eq EventScript_NoRematchTrainerBattle + special SetUpTrainerEncounterMusic + special SetUpTrainerMovement + special ShowTrainerIntroSpeech + waitmessage + waitbuttonpress + special BattleSetup_StartRematchBattle + waitstate + releaseall + end +EventScript_NoRematchTrainerBattle:: @ 82713F7 + gotopostbattlescript + +EventScript_TryDoDoubleRematchBattle:: @ 82713F8 + specialvar VAR_RESULT, IsTrainerReadyForRematch + compare VAR_RESULT, 0 + goto_eq EventScript_NoDoubleRematchTrainerBattle + special HasEnoughMonsForDoubleBattle + compare VAR_RESULT, 0 + goto_if 5, EventScript_NotEnoughMonsForDoubleRematchBattle + special SetUpTrainerEncounterMusic + special SetUpTrainerMovement + special ShowTrainerIntroSpeech + waitmessage + waitbuttonpress + special BattleSetup_StartRematchBattle + waitstate + releaseall + end +EventScript_NoDoubleRematchTrainerBattle:: @ 8271427 + gotopostbattlescript +EventScript_NotEnoughMonsForDoubleRematchBattle:: @ 8271428 + special ShowTrainerCantBattleSpeech + waitmessage + waitbuttonpress + release + end + +EventScript_RevealTrainer:: @ 827142F + applymovement VAR_LAST_TALKED, Movement_RevealTrainer + waitmovement 0 + return + +Movement_RevealTrainer: @ 827143A + reveal_trainer + step_end + +EventScript_ShowTrainerIntroMsg:: @ 827143C + special ShowTrainerIntroSpeech + waitmessage + waitbuttonpress + special TryPrepareSecondApproachingTrainer + compare VAR_RESULT, TRUE + goto_eq EventScript_ShowSecondTrainerIntro + goto EventScript_DoTrainerBattle + +EventScript_DoTrainerBattle:: @ 8271454 + trainerbattlebegin + @ Pointless check, possibly used for debugging? + specialvar VAR_RESULT, GetTrainerBattleMode + compare VAR_RESULT, TRAINER_BATTLE_SINGLE + goto_eq EventScript_EndTrainerBattle + compare VAR_RESULT, TRAINER_BATTLE_CONTINUE_SCRIPT + goto_eq EventScript_EndTrainerBattle + compare VAR_RESULT, TRAINER_BATTLE_CONTINUE_SCRIPT_NO_MUSIC + goto_eq EventScript_EndTrainerBattle + compare VAR_RESULT, TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE + goto_eq EventScript_EndTrainerBattle + compare VAR_RESULT, TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE_NO_MUSIC + goto_eq EventScript_EndTrainerBattle + +EventScript_EndTrainerBattle:: @ 8271491 + gotobeatenscript + releaseall + end diff --git a/data/specials.inc b/data/specials.inc index a1d9734ca..080f2c042 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -324,7 +324,7 @@ gSpecials:: @ 81DBA64 def_special StartGroudonKyogreBattle def_special BattleSetup_StartLegendaryBattle def_special StartRegiBattle - def_special sub_80B16D8 + def_special SetUpTrainerMovement def_special DoSealedChamberShakingEffect2 def_special FoundBlackGlasses def_special sub_80AC81C @@ -531,7 +531,7 @@ gSpecials:: @ 81DBA64 def_special sub_813B9A0 def_special sub_81B9918 def_special sub_80722E0 - def_special sub_80B45D0 + def_special TryPrepareSecondApproachingTrainer def_special RemoveRecordsWindow def_special sub_8139C10 def_special sub_80B3BC4 diff --git a/include/battle.h b/include/battle.h index c4a0fe9a5..9e67e8ec5 100644 --- a/include/battle.h +++ b/include/battle.h @@ -479,10 +479,10 @@ struct BattleStruct u16 changedItems[MAX_BATTLERS_COUNT]; u8 intimidateBattler; u8 switchInItemsCounter; - u8 field_DA; + u8 arenaTurnCounter; u8 turnSideTracker; u8 fillerDC[0xDF-0xDC]; - u8 field_DF; + u8 givenExpMons; // Bits for enemy party's pokemon that gave exp to player's party. u8 lastTakenMoveFrom[MAX_BATTLERS_COUNT * MAX_BATTLERS_COUNT * 2]; // a 3-D array [target][attacker][byte] u16 castformPalette[MAX_BATTLERS_COUNT][16]; u8 field_180; diff --git a/include/battle_setup.h b/include/battle_setup.h index 98c366acd..3b327e3f7 100644 --- a/include/battle_setup.h +++ b/include/battle_setup.h @@ -38,7 +38,7 @@ void ConfigureAndSetUpOneTrainerBattle(u8 trainerEventObjId, const u8 *trainerSc void ConfigureTwoTrainersBattle(u8 trainerEventObjId, const u8 *trainerScript); void SetUpTwoTrainersBattle(void); bool32 GetTrainerFlagFromScriptPointer(const u8 *data); -void sub_80B16D8(void); +void SetUpTrainerMovement(void); u8 GetTrainerBattleMode(void); bool8 GetTrainerFlag(void); bool8 HasTrainerBeenFought(u16 trainerId); diff --git a/include/constants/battle_setup.h b/include/constants/battle_setup.h index 329bfa650..d98e1762f 100644 --- a/include/constants/battle_setup.h +++ b/include/constants/battle_setup.h @@ -10,7 +10,7 @@ #define TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE 6 #define TRAINER_BATTLE_REMATCH_DOUBLE 7 #define TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE_NO_MUSIC 8 -#define TRAINER_BATTLE_9 9 +#define TRAINER_BATTLE_PYRAMID 9 #define TRAINER_BATTLE_SET_TRAINER_A 10 #define TRAINER_BATTLE_SET_TRAINER_B 11 #define TRAINER_BATTLE_12 12 diff --git a/include/event_scripts.h b/include/event_scripts.h index 058cec39b..7f69ef3ae 100644 --- a/include/event_scripts.h +++ b/include/event_scripts.h @@ -10,11 +10,11 @@ extern const u8 EventScript_275D0C[]; extern const u8 EventScript_275D1F[]; extern const u8 EventScript_275D2E[]; extern const u8 EventScript_271354[]; -extern const u8 EventScript_2713C2[]; +extern const u8 EventScript_DoTainerBattle[]; extern const u8 EventScript_TryDoDoubleTrainerBattle[]; -extern const u8 EventScript_271362[]; +extern const u8 EventScript_TryDoNormalTrainerBattle[]; extern const u8 EventScript_TryDoDoubleRematchBattle[]; -extern const u8 EventScript_2713D1[]; +extern const u8 EventScript_TryDoRematchBattle[]; extern const u8 EventScript_SecretPower1[]; extern const u8 EventScript_SecretPower2[]; diff --git a/include/trainer_see.h b/include/trainer_see.h index 43f8b82d2..a9b92d71b 100644 --- a/include/trainer_see.h +++ b/include/trainer_see.h @@ -19,7 +19,7 @@ extern u8 gApproachingTrainerId; bool8 CheckForTrainersWantingBattle(void); void sub_80B4578(struct EventObject *var); void EndTrainerApproach(void); -void sub_80B45D0(void); +void TryPrepareSecondApproachingTrainer(void); u8 FldEff_ExclamationMarkIcon(void); u8 FldEff_QuestionMarkIcon(void); u8 FldEff_HeartIcon(void); diff --git a/src/battle_main.c b/src/battle_main.c index de0becd2a..6d9d90356 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3071,7 +3071,7 @@ static void BattleStartClearSetData(void) *(gBattleStruct->AI_monToSwitchIntoId + i) = PARTY_SIZE; } - gBattleStruct->field_DF = 0; + gBattleStruct->givenExpMons = 0; gBattleStruct->field_92 = 0; gRandomTurnNumber = Random(); @@ -3192,7 +3192,7 @@ void SwitchInClearSetData(void) gBattleResources->flags->flags[gActiveBattler] = 0; gCurrentMove = 0; - gBattleStruct->field_DA = 0xFF; + gBattleStruct->arenaTurnCounter = 0xFF; ClearBattlerMoveHistory(gActiveBattler); ClearBattlerAbilityHistory(gActiveBattler); @@ -3994,7 +3994,7 @@ void BattleTurnPassed(void) if (gBattleResults.battleTurnCounter < 0xFF) { gBattleResults.battleTurnCounter++; - gBattleStruct->field_DA++; + gBattleStruct->arenaTurnCounter++; } for (i = 0; i < gBattlersCount; i++) @@ -4013,7 +4013,7 @@ void BattleTurnPassed(void) if (gBattleTypeFlags & BATTLE_TYPE_PALACE) BattleScriptExecute(BattleScript_82DB881); - else if (gBattleTypeFlags & BATTLE_TYPE_ARENA && gBattleStruct->field_DA == 0) + else if (gBattleTypeFlags & BATTLE_TYPE_ARENA && gBattleStruct->arenaTurnCounter == 0) BattleScriptExecute(BattleScript_ArenaTurnBeginning); } diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 6a7ca1725..e627f9d67 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3270,7 +3270,7 @@ static void atk23_getexp(void) else { gBattleScripting.atk23_state++; - gBattleStruct->field_DF |= gBitTable[gBattlerPartyIndexes[gBattlerFainted]]; + gBattleStruct->givenExpMons |= gBitTable[gBattlerPartyIndexes[gBattlerFainted]]; } break; case 1: // calculate experience points to redistribute diff --git a/src/battle_setup.c b/src/battle_setup.c index 4243d2f3f..5377f39b5 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -306,7 +306,7 @@ const struct RematchTrainer gRematchTable[REMATCH_TABLE_ENTRIES] = {{TRAINER_TRENT_1, TRAINER_TRENT_2, TRAINER_TRENT_3, TRAINER_TRENT_4, TRAINER_TRENT_5}, 0x0, 0x1b}, {{TRAINER_SAWYER_1, TRAINER_SAWYER_2, TRAINER_SAWYER_3, TRAINER_SAWYER_4, TRAINER_SAWYER_5}, 0x18, 0xc}, {{TRAINER_KIRA_AND_DAN_1, TRAINER_KIRA_AND_DAN_2, TRAINER_KIRA_AND_DAN_3, TRAINER_KIRA_AND_DAN_4, TRAINER_KIRA_AND_DAN_5}, 0x18, 0x3e}, - {{TRAINER_WALLY_3, 0x292, 0x293, 0x294, 0x294}, 0x18, 0x2b}, + {{TRAINER_WALLY_3, TRAINER_WALLY_4, TRAINER_WALLY_5, TRAINER_WALLY_6, TRAINER_WALLY_6}, 0x18, 0x2b}, {{TRAINER_ROXANNE_1, TRAINER_ROXANNE_2, TRAINER_ROXANNE_3, TRAINER_ROXANNE_4, TRAINER_ROXANNE_5}, 0x0, 0x3}, {{TRAINER_BRAWLY_1, TRAINER_BRAWLY_2, TRAINER_BRAWLY_3, TRAINER_BRAWLY_4, TRAINER_BRAWLY_5}, 0x0, 0xb}, {{TRAINER_WATTSON_1, TRAINER_WATTSON_2, TRAINER_WATTSON_3, TRAINER_WATTSON_4, TRAINER_WATTSON_5}, 0x0, 0x2}, @@ -1088,7 +1088,7 @@ const u8 *BattleSetup_ConfigureTrainerBattle(const u8 *data) { case TRAINER_BATTLE_SINGLE_NO_INTRO_TEXT: TrainerBattleLoadArgs(sOrdinaryNoIntroBattleParams, data); - return EventScript_2713C2; + return EventScript_DoTainerBattle; case TRAINER_BATTLE_DOUBLE: TrainerBattleLoadArgs(sDoubleBattleParams, data); SetMapVarsToTrainer(); @@ -1103,11 +1103,11 @@ const u8 *BattleSetup_ConfigureTrainerBattle(const u8 *data) { TrainerBattleLoadArgs(sTrainerBContinueScriptBattleParams, data); } - return EventScript_271362; + return EventScript_TryDoNormalTrainerBattle; case TRAINER_BATTLE_CONTINUE_SCRIPT_NO_MUSIC: TrainerBattleLoadArgs(sContinueScriptBattleParams, data); SetMapVarsToTrainer(); - return EventScript_271362; + return EventScript_TryDoNormalTrainerBattle; case TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE: case TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE_NO_MUSIC: TrainerBattleLoadArgs(sContinueScriptDoubleBattleParams, data); @@ -1122,8 +1122,8 @@ const u8 *BattleSetup_ConfigureTrainerBattle(const u8 *data) TrainerBattleLoadArgs(sOrdinaryBattleParams, data); SetMapVarsToTrainer(); gTrainerBattleOpponent_A = GetRematchTrainerId(gTrainerBattleOpponent_A); - return EventScript_2713D1; - case TRAINER_BATTLE_9: + return EventScript_TryDoRematchBattle; + case TRAINER_BATTLE_PYRAMID: if (gApproachingTrainerId == 0) { TrainerBattleLoadArgs(sOrdinaryBattleParams, data); @@ -1135,7 +1135,7 @@ const u8 *BattleSetup_ConfigureTrainerBattle(const u8 *data) TrainerBattleLoadArgs(sTrainerBOrdinaryBattleParams, data); gTrainerBattleOpponent_B = LocalIdToPyramidTrainerId(gSpecialVar_LastTalked); } - return EventScript_271362; + return EventScript_TryDoNormalTrainerBattle; case TRAINER_BATTLE_SET_TRAINER_A: TrainerBattleLoadArgs(sOrdinaryBattleParams, data); return NULL; @@ -1154,7 +1154,7 @@ const u8 *BattleSetup_ConfigureTrainerBattle(const u8 *data) TrainerBattleLoadArgs(sTrainerBOrdinaryBattleParams, data); gTrainerBattleOpponent_B = sub_81D6180(gSpecialVar_LastTalked); } - return EventScript_271362; + return EventScript_TryDoNormalTrainerBattle; default: if (gApproachingTrainerId == 0) { @@ -1165,7 +1165,7 @@ const u8 *BattleSetup_ConfigureTrainerBattle(const u8 *data) { TrainerBattleLoadArgs(sTrainerBOrdinaryBattleParams, data); } - return EventScript_271362; + return EventScript_TryDoNormalTrainerBattle; } } @@ -1197,7 +1197,7 @@ bool32 GetTrainerFlagFromScriptPointer(const u8 *data) return FlagGet(FLAG_TRAINER_FLAG_START + flag); } -void sub_80B16D8(void) +void SetUpTrainerMovement(void) { struct EventObject *eventObject = &gEventObjects[gSelectedEventObject]; diff --git a/src/battle_util.c b/src/battle_util.c index 251a545c9..4c9ef75d9 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -1192,7 +1192,7 @@ bool8 HandleWishPerishSongOnTurnEnd(void) // fall through case 2: if ((gBattleTypeFlags & BATTLE_TYPE_ARENA) - && gBattleStruct->field_DA == 2 + && gBattleStruct->arenaTurnCounter == 2 && gBattleMons[0].hp != 0 && gBattleMons[1].hp != 0) { s32 i; @@ -1238,7 +1238,7 @@ bool8 HandleFaintedMonActions(void) { gBattlerFainted = gBattlerTarget = gBattleStruct->faintedActionsBattlerId; if (gBattleMons[gBattleStruct->faintedActionsBattlerId].hp == 0 - && !(gBattleStruct->field_DF & gBitTable[gBattlerPartyIndexes[gBattleStruct->faintedActionsBattlerId]]) + && !(gBattleStruct->givenExpMons & gBitTable[gBattlerPartyIndexes[gBattleStruct->faintedActionsBattlerId]]) && !(gAbsentBattlerFlags & gBitTable[gBattleStruct->faintedActionsBattlerId])) { BattleScriptExecute(BattleScript_GiveExp); diff --git a/src/daycare.c b/src/daycare.c index 2356b36f5..21678adc0 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -19,6 +19,7 @@ #include "task.h" #include "window.h" #include "list_menu.h" +#include "overworld.h" #define EGG_MOVES_ARRAY_COUNT 10 #define EGG_LVL_UP_MOVES_ARRAY_COUNT 50 @@ -39,12 +40,8 @@ extern const u8 gDaycareText_PlayOther[]; extern u8 GetCursorSelectionMonId(void); extern u16 ItemIdToBattleMoveId(u16); -extern s32 ListMenuHandleInputGetItemId(u8); -extern void DestroyListMenuTask(u8, u16*, u16*); extern void sub_819746C(u8, bool8); -extern void NewMenuHelpers_DrawStdWindowFrame(u8, bool8); extern void sub_81B9328(void); -extern void CB2_ReturnToField(void); // this file's functions static void ClearDaycareMonMail(struct DayCareMail *mail); diff --git a/src/trainer_see.c b/src/trainer_see.c index d3d450de4..244a7021c 100644 --- a/src/trainer_see.c +++ b/src/trainer_see.c @@ -630,26 +630,26 @@ static void Task_DestroyTrainerApproachTask(u8 taskId) EnableBothScriptContexts(); } -void sub_80B45D0(void) +void TryPrepareSecondApproachingTrainer(void) { if (gNoOfApproachingTrainers == 2) { if (gApproachingTrainerId == 0) { gApproachingTrainerId++; - gSpecialVar_Result = 1; + gSpecialVar_Result = TRUE; UnfreezeEventObjects(); FreezeEventObjectsExceptOne(gApproachingTrainers[1].eventObjectId); } else { gApproachingTrainerId = 0; - gSpecialVar_Result = 0; + gSpecialVar_Result = FALSE; } } else { - gSpecialVar_Result = 0; + gSpecialVar_Result = FALSE; } }