summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGriffinR <griffin.g.richards@gmail.com>2020-04-24 15:23:48 -0400
committerGriffinR <griffin.g.richards@gmail.com>2020-04-24 15:23:48 -0400
commitfaf8130585a19ec0394295dc26dcc8dd2a9f7bbd (patch)
treed91dff9bc29ac4bd7c91db1d259e75853695432e
parent21b8fb4fbd85796df30c7211b98a2c557c35a69e (diff)
Sync shared_secret_base.inc
-rw-r--r--data-de/event_scripts.s265
-rw-r--r--data/event_scripts.s265
-rw-r--r--data/maps/LittlerootTown_BrendansHouse_2F/scripts.inc8
-rw-r--r--data/maps/LittlerootTown_MaysHouse_2F/scripts.inc8
-rw-r--r--data/maps/SecretBase_BlueCave1/map.json1
-rw-r--r--data/maps/SecretBase_BlueCave1/scripts.inc1
-rw-r--r--data/maps/SecretBase_BlueCave2/map.json1
-rw-r--r--data/maps/SecretBase_BlueCave2/scripts.inc1
-rw-r--r--data/maps/SecretBase_BlueCave3/map.json1
-rw-r--r--data/maps/SecretBase_BlueCave3/scripts.inc1
-rw-r--r--data/maps/SecretBase_BlueCave4/map.json1
-rw-r--r--data/maps/SecretBase_BlueCave4/scripts.inc1
-rw-r--r--data/maps/SecretBase_BrownCave1/map.json1
-rw-r--r--data/maps/SecretBase_BrownCave1/scripts.inc1
-rw-r--r--data/maps/SecretBase_BrownCave2/map.json1
-rw-r--r--data/maps/SecretBase_BrownCave2/scripts.inc1
-rw-r--r--data/maps/SecretBase_BrownCave3/map.json1
-rw-r--r--data/maps/SecretBase_BrownCave3/scripts.inc1
-rw-r--r--data/maps/SecretBase_BrownCave4/map.json1
-rw-r--r--data/maps/SecretBase_BrownCave4/scripts.inc1
-rw-r--r--data/maps/SecretBase_RedCave1/map.json1
-rw-r--r--data/maps/SecretBase_RedCave1/scripts.inc1
-rw-r--r--data/maps/SecretBase_RedCave2/map.json1
-rw-r--r--data/maps/SecretBase_RedCave2/scripts.inc1
-rw-r--r--data/maps/SecretBase_RedCave3/map.json1
-rw-r--r--data/maps/SecretBase_RedCave3/scripts.inc1
-rw-r--r--data/maps/SecretBase_RedCave4/map.json1
-rw-r--r--data/maps/SecretBase_RedCave4/scripts.inc1
-rw-r--r--data/maps/SecretBase_Shrub1/map.json1
-rw-r--r--data/maps/SecretBase_Shrub1/scripts.inc1
-rw-r--r--data/maps/SecretBase_Shrub2/map.json1
-rw-r--r--data/maps/SecretBase_Shrub2/scripts.inc1
-rw-r--r--data/maps/SecretBase_Shrub3/map.json1
-rw-r--r--data/maps/SecretBase_Shrub3/scripts.inc1
-rw-r--r--data/maps/SecretBase_Shrub4/map.json1
-rw-r--r--data/maps/SecretBase_Shrub4/scripts.inc1
-rw-r--r--data/maps/SecretBase_Tree1/map.json1
-rw-r--r--data/maps/SecretBase_Tree1/scripts.inc1
-rw-r--r--data/maps/SecretBase_Tree2/map.json1
-rw-r--r--data/maps/SecretBase_Tree2/scripts.inc1
-rw-r--r--data/maps/SecretBase_Tree3/map.json1
-rw-r--r--data/maps/SecretBase_Tree3/scripts.inc1
-rw-r--r--data/maps/SecretBase_Tree4/map.json1
-rw-r--r--data/maps/SecretBase_Tree4/scripts.inc1
-rw-r--r--data/maps/SecretBase_YellowCave1/map.json1
-rw-r--r--data/maps/SecretBase_YellowCave1/scripts.inc1
-rw-r--r--data/maps/SecretBase_YellowCave2/map.json1
-rw-r--r--data/maps/SecretBase_YellowCave2/scripts.inc1
-rw-r--r--data/maps/SecretBase_YellowCave3/map.json1
-rw-r--r--data/maps/SecretBase_YellowCave3/scripts.inc1
-rw-r--r--data/maps/SecretBase_YellowCave4/map.json1
-rw-r--r--data/maps/SecretBase_YellowCave4/scripts.inc23
-rw-r--r--data/scripts/shared_secret_base.inc190
-rw-r--r--data/specials.inc8
-rw-r--r--include/constants/flags.h2
-rw-r--r--include/constants/vars.h4
-rw-r--r--include/secret_base.h1
-rw-r--r--src/debug/tomomichi_debug_menu.c2
-rw-r--r--src/decoration.c4
-rw-r--r--src/field_control_avatar.c22
-rw-r--r--src/secret_base.c46
61 files changed, 341 insertions, 554 deletions
diff --git a/data-de/event_scripts.s b/data-de/event_scripts.s
index 925e50b82..a4bf3a744 100644
--- a/data-de/event_scripts.s
+++ b/data-de/event_scripts.s
@@ -51,11 +51,11 @@ gSpecialVars::
gStdScripts::
.4byte Std_ObtainItem
.4byte Std_FindItem
- .4byte Std_2
- .4byte Std_3
- .4byte Std_4
- .4byte Std_5
- .4byte Std_6
+ .4byte Std_MsgboxNPC
+ .4byte Std_MsgboxSign
+ .4byte Std_MsgboxDefault
+ .4byte Std_MsgboxYesNo
+ .4byte Std_MsgboxAutoclose
.4byte Std_ObtainDecoration
gStdScripts_End::
@@ -375,198 +375,7 @@ gStdScripts_End::
.include "data/maps/ShoalCave_LowTideIceRoom/scripts.inc"
.include "data/maps/SkyPillar_5F/scripts.inc"
.include "data/maps/SkyPillar_Top/scripts.inc"
- .include "data/maps/SecretBase_BlueCave1/scripts.inc"
- .include "data/maps/SecretBase_BlueCave2/scripts.inc"
- .include "data/maps/SecretBase_BlueCave3/scripts.inc"
- .include "data/maps/SecretBase_BlueCave4/scripts.inc"
- .include "data/maps/SecretBase_BrownCave1/scripts.inc"
- .include "data/maps/SecretBase_BrownCave2/scripts.inc"
- .include "data/maps/SecretBase_BrownCave3/scripts.inc"
- .include "data/maps/SecretBase_BrownCave4/scripts.inc"
- .include "data/maps/SecretBase_RedCave1/scripts.inc"
- .include "data/maps/SecretBase_RedCave2/scripts.inc"
- .include "data/maps/SecretBase_RedCave3/scripts.inc"
- .include "data/maps/SecretBase_RedCave4/scripts.inc"
- .include "data/maps/SecretBase_Shrub1/scripts.inc"
- .include "data/maps/SecretBase_Shrub2/scripts.inc"
- .include "data/maps/SecretBase_Shrub3/scripts.inc"
- .include "data/maps/SecretBase_Shrub4/scripts.inc"
- .include "data/maps/SecretBase_Tree1/scripts.inc"
- .include "data/maps/SecretBase_Tree2/scripts.inc"
- .include "data/maps/SecretBase_Tree3/scripts.inc"
- .include "data/maps/SecretBase_Tree4/scripts.inc"
- .include "data/maps/SecretBase_YellowCave1/scripts.inc"
- .include "data/maps/SecretBase_YellowCave2/scripts.inc"
- .include "data/maps/SecretBase_YellowCave3/scripts.inc"
- .include "data/maps/SecretBase_YellowCave4/scripts.inc"
-
-gUnknown_0815F36C:: @ 815F36C
- lockall
- playse SE_PC_LOGON
- message UnknownString_81A3A72
- dofieldeffect FLDEFF_SECRET_BASE_PC_TURN_ON
- waitstate
- waitmessage
- waitbuttonpress
- playse SE_SELECT
- goto EventScript_15F384
- end
-
-EventScript_15F384:
- message UnknownString_81A3A87
- waitmessage
- goto_if_set FLAG_DECORATION_16, EventScript_15F3A0
- goto EventScript_15F3E2
- end
-
-gUnknown_0815F399:: @ 815F399
- lockall
- goto EventScript_15F384
- end
-
-EventScript_15F3A0:
- multichoice 0, 0, 6, 0
- switch VAR_RESULT
- case 0, EventScript_15F432
- case 1, EventScript_15F419
- case 2, EventScript_15F436
- case 3, EventScript_15F51D
- case 127, EventScript_15F51D
- end
-
-EventScript_15F3E2:
- multichoice 0, 0, 5, 0
- switch VAR_RESULT
- case 0, EventScript_15F432
- case 1, EventScript_15F419
- case 2, EventScript_15F51D
- case 127, EventScript_15F51D
- end
-
-EventScript_15F419:
- msgbox UnknownString_81A38FB, MSGBOX_YESNO
- compare VAR_RESULT, NO
- goto_if_eq EventScript_15F384
- closemessage
- special SecretBasePC_PackUp
- releaseall
- end
-
-EventScript_15F432:
- special SecretBasePC_Decoration
- end
-
-EventScript_15F436:
- special SecretBasePC_Registry
- end
-
-gUnknown_0815F43A:: @ 815F43A
- lockall
- message UnknownString_81A3A72
- playse SE_PC_LOGON
- dofieldeffect FLDEFF_SECRET_BASE_PC_TURN_ON
- waitstate
- waitmessage
- waitbuttonpress
- playse SE_SELECT
- goto EventScript_15F452
- end
-
-EventScript_15F452:
- message UnknownString_81A3A87
- waitmessage
- multichoice 0, 0, 7, 0
- switch VAR_RESULT
- case 0, EventScript_15F4A1
- case 1, EventScript_15F436
- case 2, EventScript_15F511
- case 3, EventScript_15F51D
- case 127, EventScript_15F51D
- end
-
-gUnknown_0815F49A:: @ 815F49A
- lockall
- goto EventScript_15F452
- end
-
-EventScript_15F4A1:
- special sub_80BC56C
- compare VAR_RESULT, 1
- goto_if_eq EventScript_15F4E0
- compare VAR_RESULT, 2
- goto_if_eq EventScript_15F503
- special BufferSecretBaseOwnerName
- msgbox UnknownString_81A3958, MSGBOX_YESNO
- compare VAR_RESULT, NO
- goto_if_eq EventScript_15F452
- msgbox UnknownString_81A3A22, MSGBOX_SIGN
- special sub_80BC5BC
- special DoSecretBasePCTurnOffEffect
- releaseall
- end
-
-EventScript_15F4E0:
- msgbox UnknownString_81A3982, MSGBOX_YESNO
- compare VAR_RESULT, NO
- goto_if_eq EventScript_15F452
- msgbox UnknownString_81A3A3A, MSGBOX_SIGN
- special sub_80BC5BC
- special DoSecretBasePCTurnOffEffect
- releaseall
- end
-
-EventScript_15F503:
- msgbox UnknownString_81A39C0, MSGBOX_SIGN
- special DoSecretBasePCTurnOffEffect
- closemessage
- releaseall
- end
-
-EventScript_15F511:
- message UnknownString_81A3AA2
- waitmessage
- goto EventScript_15F452
- end
-
-EventScript_15F51D:
- special DoSecretBasePCTurnOffEffect
- closemessage
- releaseall
- end
-
-gUnknown_0815F523:: @ 815F523
- dofieldeffect FLDEFF_SAND_PILLAR
- waitstate
- end
-
-gUnknown_0815F528:: @ 815F528
- special GetShieldToyTVDecorationInfo
- compare VAR_RESULT, 0
- goto_if_eq EventScript_15F558
- compare VAR_RESULT, 1
- goto_if_eq EventScript_15F561
- compare VAR_RESULT, 2
- goto_if_eq EventScript_15F56A
- compare VAR_RESULT, 3
- goto_if_eq EventScript_15F573
- end
-
-EventScript_15F558:
- msgbox UnknownString_81A3B5B, MSGBOX_SIGN
- end
-
-EventScript_15F561:
- msgbox UnknownString_81A3BA4, MSGBOX_SIGN
- end
-
-EventScript_15F56A:
- msgbox UnknownString_81A3BE8, MSGBOX_SIGN
- end
-
-EventScript_15F573:
- msgbox UnknownString_81A3C31, MSGBOX_SIGN
- end
-
+ .include "data/scripts/shared_secret_base.inc"
.include "data/maps/SingleBattleColosseum/scripts.inc"
.include "data/maps/TradeCenter/scripts.inc"
.include "data/maps/RecordCorner/scripts.inc"
@@ -902,7 +711,7 @@ UnknownString_819C21F: @ 819C21F
.include "data/maps/Route124_DivingTreasureHuntersHouse/text.inc"
-Std_2:
+Std_MsgboxNPC:
lock
faceplayer
message 0x0
@@ -911,7 +720,7 @@ Std_2:
release
return
-Std_3:
+Std_MsgboxSign:
lockall
message 0x0
waitmessage
@@ -919,13 +728,13 @@ Std_3:
releaseall
return
-Std_4:
+Std_MsgboxDefault:
message 0x0
waitmessage
waitbuttonpress
return
-Std_5:
+Std_MsgboxYesNo:
message 0x0
waitmessage
yesnobox 20, 8
@@ -1075,7 +884,7 @@ EventScript_19F934:
EventScript_19F936:
gotobeatenscript
-Std_6::
+Std_MsgboxAutoclose::
message 0x0
waitmessage
waitbuttonpress
@@ -3734,21 +3543,21 @@ EventScript_1A2DAA:
EventScript_1A2DB8:
closemessage
playse SE_KAIDAN
- setvar VAR_0x4097, 0
+ setvar VAR_INIT_SECRET_BASE, 0
setflag FLAG_DECORATION_1
special sub_80BB8CC
special sub_80BBAF0
setvar VAR_0x8004, 0
setvar VAR_0x8005, 0
special sub_80BBDD0
- setvar VAR_0x4089, 1
+ setvar VAR_SECRET_BASE_INITIALIZED, 1
waitstate
end
-SecretBase_RedCave1_EventScript_1A2DDE:: @ 81A2DDE
+SecretBase_EventScript_FirstEntrance:: @ 81A2DDE
applymovement 255, SecretBase_RedCave1_Movement_1A2E11
waitmovement 0
- setvar VAR_0x4097, 1
+ setvar VAR_INIT_SECRET_BASE, 1
msgbox SecretBase_RedCave1_Text_198F89, MSGBOX_YESNO
compare VAR_RESULT, YES
goto_if_eq SecretBase_RedCave1_EventScript_1A2E08
@@ -3771,21 +3580,21 @@ SecretBase_RedCave1_Movement_1A2E11:: @ 81A2E11
gUnknown_081A2E14:: @ 81A2E14
lockall
- setvar VAR_0x4097, 1
+ setvar VAR_INIT_SECRET_BASE, 1
playse SE_KAIDAN
special sub_80BC114
compare VAR_RESULT, 0
goto_if_eq EventScript_1A2E38
clearflag FLAG_DECORATION_1
special sub_80BBAF0
- setvar VAR_0x4089, 0
+ setvar VAR_SECRET_BASE_INITIALIZED, 0
waitstate
end
EventScript_1A2E38:
setflag FLAG_DECORATION_1
special sub_80BBAF0
- setvar VAR_0x4089, 0
+ setvar VAR_SECRET_BASE_INITIALIZED, 0
waitstate
end
@@ -3800,7 +3609,7 @@ AskToMoveSecretBase:
msgbox UnknownString_81A3C71, MSGBOX_YESNO
compare VAR_RESULT, NO
goto_if_eq EventScript_1A2F3A
- msgbox UnknownString_81A38FB, MSGBOX_YESNO
+ msgbox SecretBase_Text_AllDecorationsWillBeReturned, MSGBOX_YESNO
compare VAR_RESULT, NO
goto_if_eq EventScript_1A2F3A
fadescreen 1
@@ -3850,9 +3659,7 @@ EventScript_1A2F3A::
releaseall
end
-LittlerootTown_BrendansHouse_2F_EventScript_1A2F3D:: @ 81A2F3D
-LittlerootTown_MaysHouse_2F_EventScript_1A2F3D:: @ 81A2F3D
-SecretBase_RedCave1_EventScript_1A2F3D:: @ 81A2F3D
+SecretBase_EventScript_SetDecorationFlags:: @ 81A2F3D
setflag FLAG_DECORATION_2
setflag FLAG_DECORATION_3
setflag FLAG_DECORATION_4
@@ -3869,13 +3676,11 @@ SecretBase_RedCave1_EventScript_1A2F3D:: @ 81A2F3D
setflag FLAG_DECORATION_15
return
-LittlerootTown_BrendansHouse_2F_EventScript_1A2F68:: @ 81A2F68
-LittlerootTown_MaysHouse_2F_EventScript_1A2F68:: @ 81A2F68
-SecretBase_RedCave1_EventScript_1A2F68:: @ 81A2F68
+SecretBase_EventScript_InitDecorations:: @ 81A2F68
setvar VAR_0x8004, 0
setvar VAR_0x8005, 0
special sub_80BBDD0
- setvar VAR_0x4089, 1
+ setvar VAR_SECRET_BASE_INITIALIZED, 1
end
gUnknown_081A2F7B:: @ 81A2F7B
@@ -4307,43 +4112,43 @@ SecretBase_RedCave1_EventScript_1A350A:: @ 81A350A
.include "data/text/secret_power_tm.inc"
.include "data/scripts/secret_power_tm.inc"
-UnknownString_81A38FB: @ 81A38FB
+SecretBase_Text_AllDecorationsWillBeReturned: @ 81A38FB
.string "Alle Dekorationsgegenstände und das\n"
.string "Mobiliar aus deiner GEHEIMBASIS werden\l"
.string "auf deinen PC gesendet.\p"
.string "Einverstanden?$"
-UnknownString_81A3958: @ 81A3958
+SecretBase_Text_WantToRegisterSecretBase: @ 81A3958
.string "Möchtest du GEHEIMBASIS von\n"
.string "{STR_VAR_1} eintragen?$"
-UnknownString_81A3982: @ 81A3982
+SecretBase_Text_AlreadyRegisteredDelete: @ 81A3982
.string "Diese Daten wurden bereits\n"
.string "eingetragen. Möchtest du sie löschen?$"
-UnknownString_81A39C0: @ 81A39C0
+SecretBase_Text_TooManyBasesDeleteSome: @ 81A39C0
.string "Bis zu 10 Orte können eingetragen\n"
.string "werden.\p"
.string "Lösche einen Ort, um einen neuen\n"
.string "eintragen zu können.$"
-UnknownString_81A3A22: @ 81A3A22
+SecretBase_Text_RegistrationCompleted: @ 81A3A22
.string "Registrierung abgeschlossen.$"
-UnknownString_81A3A3A: @ 81A3A3A
+SecretBase_Text_DataUnregistered: @ 81A3A3A
.string "Daten wurden aus der Registrierung\n"
.string "genommen.$"
UnknownString_81A3A56: @ 81A3A56
.string "Es sind keine Dekorationen vorhanden.$"
-UnknownString_81A3A72: @ 81A3A72
+SecretBase_Text_BootUpPC: @ 81A3A72
.string "{PLAYER} schaltet den PC ein.$"
-UnknownString_81A3A87: @ 81A3A87
+SecretBase_Text_WhatWouldYouLikeToDo: @ 81A3A87
.string "Was möchtest du tun?$"
-UnknownString_81A3AA2: @ 81A3AA2
+SecretBase_Text_RegistryInfo: @ 81A3AA2
.string "Die eingetragene GEHEIMBASIS bleibt\n"
.string "erhalten, bis der Eigentümer umzieht.\p"
.string "Wird sie aus dem Grundbuch ent-\n"
@@ -4352,22 +4157,22 @@ UnknownString_81A3AA2: @ 81A3AA2
.string "Bis zu 10 Orte können eingetragen\n"
.string "werden.{0xFC}Ì$"
-UnknownString_81A3B5B: @ 81A3B5B
+SecretBase_Text_BattleTowerShield: @ 81A3B5B
.string "Ein Schild aus {STR_VAR_2}, welches zeigt,\n"
.string "dass {STR_VAR_1}-mal hintereinander im\l"
.string "DUELLTURM ein Kampf gewonnen wurde.$"
-UnknownString_81A3BA4: @ 81A3BA4
+SecretBase_Text_ToyTV: @ 81A3BA4
.string "Ein sehr realistischer Spielzeug-\n"
.string "Fernseher. Man könnte ihn glatt mit\l"
.string "einem echten Gerät verwechseln.$"
-UnknownString_81A3BE8: @ 81A3BE8
+SecretBase_Text_SeedotTV: @ 81A3BE8
.string "Ein Spielzeug-Fernseher, der aussieht\n"
.string "wie ein SAMURZEL. Er scheint von\l"
.string "alleine davonrollen zu wollen...$"
-UnknownString_81A3C31: @ 81A3C31
+SecretBase_Text_SkittyTV: @ 81A3C31
.string "Ein Spielzeug-Fernseher, der aussieht\n"
.string "wie ein ENECO. Es scheint, als wolle\l"
.string "er sich langsam davonschleichen ...$"
diff --git a/data/event_scripts.s b/data/event_scripts.s
index 6b904fbd3..bb4b87130 100644
--- a/data/event_scripts.s
+++ b/data/event_scripts.s
@@ -51,11 +51,11 @@ gSpecialVars::
gStdScripts::
.4byte Std_ObtainItem
.4byte Std_FindItem
- .4byte Std_2
- .4byte Std_3
- .4byte Std_4
- .4byte Std_5
- .4byte Std_6
+ .4byte Std_MsgboxNPC
+ .4byte Std_MsgboxSign
+ .4byte Std_MsgboxDefault
+ .4byte Std_MsgboxYesNo
+ .4byte Std_MsgboxAutoclose
.4byte Std_ObtainDecoration
gStdScripts_End::
@@ -375,198 +375,7 @@ gStdScripts_End::
.include "data/maps/ShoalCave_LowTideIceRoom/scripts.inc"
.include "data/maps/SkyPillar_5F/scripts.inc"
.include "data/maps/SkyPillar_Top/scripts.inc"
- .include "data/maps/SecretBase_BlueCave1/scripts.inc"
- .include "data/maps/SecretBase_BlueCave2/scripts.inc"
- .include "data/maps/SecretBase_BlueCave3/scripts.inc"
- .include "data/maps/SecretBase_BlueCave4/scripts.inc"
- .include "data/maps/SecretBase_BrownCave1/scripts.inc"
- .include "data/maps/SecretBase_BrownCave2/scripts.inc"
- .include "data/maps/SecretBase_BrownCave3/scripts.inc"
- .include "data/maps/SecretBase_BrownCave4/scripts.inc"
- .include "data/maps/SecretBase_RedCave1/scripts.inc"
- .include "data/maps/SecretBase_RedCave2/scripts.inc"
- .include "data/maps/SecretBase_RedCave3/scripts.inc"
- .include "data/maps/SecretBase_RedCave4/scripts.inc"
- .include "data/maps/SecretBase_Shrub1/scripts.inc"
- .include "data/maps/SecretBase_Shrub2/scripts.inc"
- .include "data/maps/SecretBase_Shrub3/scripts.inc"
- .include "data/maps/SecretBase_Shrub4/scripts.inc"
- .include "data/maps/SecretBase_Tree1/scripts.inc"
- .include "data/maps/SecretBase_Tree2/scripts.inc"
- .include "data/maps/SecretBase_Tree3/scripts.inc"
- .include "data/maps/SecretBase_Tree4/scripts.inc"
- .include "data/maps/SecretBase_YellowCave1/scripts.inc"
- .include "data/maps/SecretBase_YellowCave2/scripts.inc"
- .include "data/maps/SecretBase_YellowCave3/scripts.inc"
- .include "data/maps/SecretBase_YellowCave4/scripts.inc"
-
-gUnknown_0815F36C:: @ 815F36C
- lockall
- playse SE_PC_LOGON
- message UnknownString_81A3A72
- dofieldeffect FLDEFF_SECRET_BASE_PC_TURN_ON
- waitstate
- waitmessage
- waitbuttonpress
- playse SE_SELECT
- goto EventScript_15F384
- end
-
-EventScript_15F384:
- message UnknownString_81A3A87
- waitmessage
- goto_if_set FLAG_DECORATION_16, EventScript_15F3A0
- goto EventScript_15F3E2
- end
-
-gUnknown_0815F399:: @ 815F399
- lockall
- goto EventScript_15F384
- end
-
-EventScript_15F3A0:
- multichoice 0, 0, 6, 0
- switch VAR_RESULT
- case 0, EventScript_15F432
- case 1, EventScript_15F419
- case 2, EventScript_15F436
- case 3, EventScript_15F51D
- case 127, EventScript_15F51D
- end
-
-EventScript_15F3E2:
- multichoice 0, 0, 5, 0
- switch VAR_RESULT
- case 0, EventScript_15F432
- case 1, EventScript_15F419
- case 2, EventScript_15F51D
- case 127, EventScript_15F51D
- end
-
-EventScript_15F419:
- msgbox UnknownString_81A38FB, MSGBOX_YESNO
- compare VAR_RESULT, NO
- goto_if_eq EventScript_15F384
- closemessage
- special SecretBasePC_PackUp
- releaseall
- end
-
-EventScript_15F432:
- special SecretBasePC_Decoration
- end
-
-EventScript_15F436:
- special SecretBasePC_Registry
- end
-
-gUnknown_0815F43A:: @ 815F43A
- lockall
- message UnknownString_81A3A72
- playse SE_PC_LOGON
- dofieldeffect FLDEFF_SECRET_BASE_PC_TURN_ON
- waitstate
- waitmessage
- waitbuttonpress
- playse SE_SELECT
- goto EventScript_15F452
- end
-
-EventScript_15F452:
- message UnknownString_81A3A87
- waitmessage
- multichoice 0, 0, 7, 0
- switch VAR_RESULT
- case 0, EventScript_15F4A1
- case 1, EventScript_15F436
- case 2, EventScript_15F511
- case 3, EventScript_15F51D
- case 127, EventScript_15F51D
- end
-
-gUnknown_0815F49A:: @ 815F49A
- lockall
- goto EventScript_15F452
- end
-
-EventScript_15F4A1:
- special sub_80BC56C
- compare VAR_RESULT, 1
- goto_if_eq EventScript_15F4E0
- compare VAR_RESULT, 2
- goto_if_eq EventScript_15F503
- special BufferSecretBaseOwnerName
- msgbox UnknownString_81A3958, MSGBOX_YESNO
- compare VAR_RESULT, NO
- goto_if_eq EventScript_15F452
- msgbox UnknownString_81A3A22, MSGBOX_SIGN
- special sub_80BC5BC
- special DoSecretBasePCTurnOffEffect
- releaseall
- end
-
-EventScript_15F4E0:
- msgbox UnknownString_81A3982, MSGBOX_YESNO
- compare VAR_RESULT, NO
- goto_if_eq EventScript_15F452
- msgbox UnknownString_81A3A3A, MSGBOX_SIGN
- special sub_80BC5BC
- special DoSecretBasePCTurnOffEffect
- releaseall
- end
-
-EventScript_15F503:
- msgbox UnknownString_81A39C0, MSGBOX_SIGN
- special DoSecretBasePCTurnOffEffect
- closemessage
- releaseall
- end
-
-EventScript_15F511:
- message UnknownString_81A3AA2
- waitmessage
- goto EventScript_15F452
- end
-
-EventScript_15F51D:
- special DoSecretBasePCTurnOffEffect
- closemessage
- releaseall
- end
-
-gUnknown_0815F523:: @ 815F523
- dofieldeffect FLDEFF_SAND_PILLAR
- waitstate
- end
-
-gUnknown_0815F528:: @ 815F528
- special GetShieldToyTVDecorationInfo
- compare VAR_RESULT, 0
- goto_if_eq EventScript_15F558
- compare VAR_RESULT, 1
- goto_if_eq EventScript_15F561
- compare VAR_RESULT, 2
- goto_if_eq EventScript_15F56A
- compare VAR_RESULT, 3
- goto_if_eq EventScript_15F573
- end
-
-EventScript_15F558:
- msgbox UnknownString_81A3B5B, MSGBOX_SIGN
- end
-
-EventScript_15F561:
- msgbox UnknownString_81A3BA4, MSGBOX_SIGN
- end
-
-EventScript_15F56A:
- msgbox UnknownString_81A3BE8, MSGBOX_SIGN
- end
-
-EventScript_15F573:
- msgbox UnknownString_81A3C31, MSGBOX_SIGN
- end
-
+ .include "data/scripts/shared_secret_base.inc"
.include "data/maps/SingleBattleColosseum/scripts.inc"
.include "data/maps/TradeCenter/scripts.inc"
.include "data/maps/RecordCorner/scripts.inc"
@@ -901,7 +710,7 @@ UnknownString_819C21F: @ 819C21F
.include "data/maps/Route124_DivingTreasureHuntersHouse/text.inc"
-Std_2:
+Std_MsgboxNPC:
lock
faceplayer
message 0x0
@@ -910,7 +719,7 @@ Std_2:
release
return
-Std_3:
+Std_MsgboxSign:
lockall
message 0x0
waitmessage
@@ -918,13 +727,13 @@ Std_3:
releaseall
return
-Std_4:
+Std_MsgboxDefault:
message 0x0
waitmessage
waitbuttonpress
return
-Std_5:
+Std_MsgboxYesNo:
message 0x0
waitmessage
yesnobox 20, 8
@@ -1069,7 +878,7 @@ EventScript_19F934:
EventScript_19F936:
gotobeatenscript
-Std_6::
+Std_MsgboxAutoclose::
message 0x0
waitmessage
waitbuttonpress
@@ -3713,21 +3522,21 @@ EventScript_1A2DAA:
EventScript_1A2DB8:
closemessage
playse SE_KAIDAN
- setvar VAR_0x4097, 0
+ setvar VAR_INIT_SECRET_BASE, 0
setflag FLAG_DECORATION_1
special sub_80BB8CC
special sub_80BBAF0
setvar VAR_0x8004, 0
setvar VAR_0x8005, 0
special sub_80BBDD0
- setvar VAR_0x4089, 1
+ setvar VAR_SECRET_BASE_INITIALIZED, 1
waitstate
end
-SecretBase_RedCave1_EventScript_1A2DDE:: @ 81A2DDE
+SecretBase_EventScript_FirstEntrance:: @ 81A2DDE
applymovement 255, SecretBase_RedCave1_Movement_1A2E11
waitmovement 0
- setvar VAR_0x4097, 1
+ setvar VAR_INIT_SECRET_BASE, 1
msgbox SecretBase_RedCave1_Text_198F89, MSGBOX_YESNO
compare VAR_RESULT, YES
goto_if_eq SecretBase_RedCave1_EventScript_1A2E08
@@ -3750,21 +3559,21 @@ SecretBase_RedCave1_Movement_1A2E11:: @ 81A2E11
gUnknown_081A2E14:: @ 81A2E14
lockall
- setvar VAR_0x4097, 1
+ setvar VAR_INIT_SECRET_BASE, 1
playse SE_KAIDAN
special sub_80BC114
compare VAR_RESULT, 0
goto_if_eq EventScript_1A2E38
clearflag FLAG_DECORATION_1
special sub_80BBAF0
- setvar VAR_0x4089, 0
+ setvar VAR_SECRET_BASE_INITIALIZED, 0
waitstate
end
EventScript_1A2E38:
setflag FLAG_DECORATION_1
special sub_80BBAF0
- setvar VAR_0x4089, 0
+ setvar VAR_SECRET_BASE_INITIALIZED, 0
waitstate
end
@@ -3779,7 +3588,7 @@ AskToMoveSecretBase:
msgbox UnknownString_81A3C71, MSGBOX_YESNO
compare VAR_RESULT, NO
goto_if_eq EventScript_1A2F3A
- msgbox UnknownString_81A38FB, MSGBOX_YESNO
+ msgbox SecretBase_Text_AllDecorationsWillBeReturned, MSGBOX_YESNO
compare VAR_RESULT, NO
goto_if_eq EventScript_1A2F3A
fadescreen 1
@@ -3829,9 +3638,7 @@ EventScript_1A2F3A::
releaseall
end
-LittlerootTown_BrendansHouse_2F_EventScript_1A2F3D:: @ 81A2F3D
-LittlerootTown_MaysHouse_2F_EventScript_1A2F3D:: @ 81A2F3D
-SecretBase_RedCave1_EventScript_1A2F3D:: @ 81A2F3D
+SecretBase_EventScript_SetDecorationFlags:: @ 81A2F3D
setflag FLAG_DECORATION_2
setflag FLAG_DECORATION_3
setflag FLAG_DECORATION_4
@@ -3848,13 +3655,11 @@ SecretBase_RedCave1_EventScript_1A2F3D:: @ 81A2F3D
setflag FLAG_DECORATION_15
return
-LittlerootTown_BrendansHouse_2F_EventScript_1A2F68:: @ 81A2F68
-LittlerootTown_MaysHouse_2F_EventScript_1A2F68:: @ 81A2F68
-SecretBase_RedCave1_EventScript_1A2F68:: @ 81A2F68
+SecretBase_EventScript_InitDecorations:: @ 81A2F68
setvar VAR_0x8004, 0
setvar VAR_0x8005, 0
special sub_80BBDD0
- setvar VAR_0x4089, 1
+ setvar VAR_SECRET_BASE_INITIALIZED, 1
end
gUnknown_081A2F7B:: @ 81A2F7B
@@ -4286,59 +4091,59 @@ SecretBase_RedCave1_EventScript_1A350A:: @ 81A350A
.include "data/text/secret_power_tm.inc"
.include "data/scripts/secret_power_tm.inc"
-UnknownString_81A38FB: @ 81A38FB
+SecretBase_Text_AllDecorationsWillBeReturned: @ 81A38FB
.string "All decorations and furniture in your\n"
.string "SECRET BASE will be returned to your PC.\p"
.string "Is that okay?$"
-UnknownString_81A3958: @ 81A3958
+SecretBase_Text_WantToRegisterSecretBase: @ 81A3958
.string "Do you want to register\n"
.string "{STR_VAR_1}'s SECRET BASE?$"
-UnknownString_81A3982: @ 81A3982
+SecretBase_Text_AlreadyRegisteredDelete: @ 81A3982
.string "This data is already registered.\n"
.string "Would you like to delete it?$"
-UnknownString_81A39C0: @ 81A39C0
+SecretBase_Text_TooManyBasesDeleteSome: @ 81A39C0
.string "Up to 10 locations can be registered.\p"
.string "Delete a location if you want to\n"
.string "register another location.$"
-UnknownString_81A3A22: @ 81A3A22
+SecretBase_Text_RegistrationCompleted: @ 81A3A22
.string "Registration completed.$"
-UnknownString_81A3A3A: @ 81A3A3A
+SecretBase_Text_DataUnregistered: @ 81A3A3A
.string "Data has been unregistered.$"
UnknownString_81A3A56: @ 81A3A56
.string "There are no decorations...$"
-UnknownString_81A3A72: @ 81A3A72
+SecretBase_Text_BootUpPC: @ 81A3A72
.string "{PLAYER} booted up the PC.$"
-UnknownString_81A3A87: @ 81A3A87
+SecretBase_Text_WhatWouldYouLikeToDo: @ 81A3A87
.string "What would you like to do?$"
-UnknownString_81A3AA2: @ 81A3AA2
+SecretBase_Text_RegistryInfo: @ 81A3AA2
.string "The registered SECRET BASE will remain\n"
.string "unless the owner moves away.\p"
.string "If it is removed from the registry,\n"
.string "another SECRET BASE may take its place.\p"
.string "Up to ten locations can be registered.{PAUSE_UNTIL_PRESS}$"
-UnknownString_81A3B5B: @ 81A3B5B
+SecretBase_Text_BattleTowerShield: @ 81A3B5B
.string "A shield of {STR_VAR_2} that marks winning\n"
.string "{STR_VAR_1} times in a row at the BATTLE TOWER.$"
-UnknownString_81A3BA4: @ 81A3BA4
+SecretBase_Text_ToyTV: @ 81A3BA4
.string "A realistic toy TV. It could be easily\n"
.string "mistaken for the real thing.$"
-UnknownString_81A3BE8: @ 81A3BE8
+SecretBase_Text_SeedotTV: @ 81A3BE8
.string "A toy TV shaped like a SEEDOT.\n"
.string "It looks ready to roll away on its own...$"
-UnknownString_81A3C31: @ 81A3C31
+SecretBase_Text_SkittyTV: @ 81A3C31
.string "A toy TV shaped like a SKITTY.\n"
.string "It looks ready to stroll away...$"
diff --git a/data/maps/LittlerootTown_BrendansHouse_2F/scripts.inc b/data/maps/LittlerootTown_BrendansHouse_2F/scripts.inc
index 133163ac5..bac89c25e 100644
--- a/data/maps/LittlerootTown_BrendansHouse_2F/scripts.inc
+++ b/data/maps/LittlerootTown_BrendansHouse_2F/scripts.inc
@@ -7,8 +7,8 @@ LittlerootTown_BrendansHouse_2F_MapScript1_1527AF:: @ 81527AF
call_if_unset FLAG_DEFEATED_RIVAL_ROUTE103, LittlerootTown_BrendansHouse_2F_EventScript_1527CE
compare VAR_LITTLEROOT_INTRO_STATE, 4
call_if_eq LittlerootTown_BrendansHouse_2F_EventScript_1B6950
- call LittlerootTown_BrendansHouse_2F_EventScript_1A2F3D
- setvar VAR_0x4089, 0
+ call SecretBase_EventScript_SetDecorationFlags
+ setvar VAR_SECRET_BASE_INITIALIZED, 0
end
LittlerootTown_BrendansHouse_2F_EventScript_1527CE:: @ 81527CE
@@ -17,13 +17,13 @@ LittlerootTown_BrendansHouse_2F_EventScript_1527CE:: @ 81527CE
return
LittlerootTown_BrendansHouse_2F_MapScript2_1527DA:: @ 81527DA
- map_script_2 VAR_0x4089, 0, LittlerootTown_BrendansHouse_2F_EventScript_1527E4
+ map_script_2 VAR_SECRET_BASE_INITIALIZED, 0, LittlerootTown_BrendansHouse_2F_EventScript_1527E4
.2byte 0
LittlerootTown_BrendansHouse_2F_EventScript_1527E4:: @ 81527E4
checkplayergender
compare VAR_RESULT, 0
- goto_if_eq LittlerootTown_BrendansHouse_2F_EventScript_1A2F68
+ goto_if_eq SecretBase_EventScript_InitDecorations
end
@ 81527F1
diff --git a/data/maps/LittlerootTown_MaysHouse_2F/scripts.inc b/data/maps/LittlerootTown_MaysHouse_2F/scripts.inc
index a71baa3f5..7a176908b 100644
--- a/data/maps/LittlerootTown_MaysHouse_2F/scripts.inc
+++ b/data/maps/LittlerootTown_MaysHouse_2F/scripts.inc
@@ -7,8 +7,8 @@ LittlerootTown_MaysHouse_2F_MapScript1_152A5B:: @ 8152A5B
call_if_unset FLAG_DEFEATED_RIVAL_ROUTE103, LittlerootTown_MaysHouse_2F_EventScript_152A7A
compare VAR_LITTLEROOT_INTRO_STATE, 4
call_if_eq LittlerootTown_MaysHouse_2F_EventScript_1B6950
- call LittlerootTown_MaysHouse_2F_EventScript_1A2F3D
- setvar VAR_0x4089, 0
+ call SecretBase_EventScript_SetDecorationFlags
+ setvar VAR_SECRET_BASE_INITIALIZED, 0
end
LittlerootTown_MaysHouse_2F_EventScript_152A7A:: @ 8152A7A
@@ -17,13 +17,13 @@ LittlerootTown_MaysHouse_2F_EventScript_152A7A:: @ 8152A7A
return
LittlerootTown_MaysHouse_2F_MapScript2_152A86:: @ 8152A86
- map_script_2 VAR_0x4089, 0, LittlerootTown_MaysHouse_2F_EventScript_152A90
+ map_script_2 VAR_SECRET_BASE_INITIALIZED, 0, LittlerootTown_MaysHouse_2F_EventScript_152A90
.2byte 0
LittlerootTown_MaysHouse_2F_EventScript_152A90:: @ 8152A90
checkplayergender
compare VAR_RESULT, 1
- goto_if_eq LittlerootTown_MaysHouse_2F_EventScript_1A2F68
+ goto_if_eq SecretBase_EventScript_InitDecorations
end
LittlerootTown_BrendansHouse_2F_EventScript_152A9D:: @ 8152A9D
diff --git a/data/maps/SecretBase_BlueCave1/map.json b/data/maps/SecretBase_BlueCave1/map.json
index 1100ada56..cafc327b2 100644
--- a/data/maps/SecretBase_BlueCave1/map.json
+++ b/data/maps/SecretBase_BlueCave1/map.json
@@ -1,6 +1,7 @@
{
"id": "MAP_SECRET_BASE_BLUE_CAVE1",
"name": "SecretBase_BlueCave1",
+ "shared_scripts_map": "SecretBase",
"layout": "LAYOUT_SECRET_BASE_BLUE_CAVE1",
"music": "MUS_MACHI_S3",
"region_map_section": "MAPSEC_SECRET_BASE",
diff --git a/data/maps/SecretBase_BlueCave1/scripts.inc b/data/maps/SecretBase_BlueCave1/scripts.inc
deleted file mode 100644
index bca6bee55..000000000
--- a/data/maps/SecretBase_BlueCave1/scripts.inc
+++ /dev/null
@@ -1 +0,0 @@
-SecretBase_BlueCave1_MapScripts:: @ 815F337
diff --git a/data/maps/SecretBase_BlueCave2/map.json b/data/maps/SecretBase_BlueCave2/map.json
index 8b3b35721..f3e9d8062 100644
--- a/data/maps/SecretBase_BlueCave2/map.json
+++ b/data/maps/SecretBase_BlueCave2/map.json
@@ -1,6 +1,7 @@
{
"id": "MAP_SECRET_BASE_BLUE_CAVE2",
"name": "SecretBase_BlueCave2",
+ "shared_scripts_map": "SecretBase",
"layout": "LAYOUT_SECRET_BASE_BLUE_CAVE2",
"music": "MUS_MACHI_S3",
"region_map_section": "MAPSEC_SECRET_BASE",
diff --git a/data/maps/SecretBase_BlueCave2/scripts.inc b/data/maps/SecretBase_BlueCave2/scripts.inc
deleted file mode 100644
index 4fc579fb9..000000000
--- a/data/maps/SecretBase_BlueCave2/scripts.inc
+++ /dev/null
@@ -1 +0,0 @@
-SecretBase_BlueCave2_MapScripts:: @ 815F337
diff --git a/data/maps/SecretBase_BlueCave3/map.json b/data/maps/SecretBase_BlueCave3/map.json
index 11ab94ef5..2304dd2a5 100644
--- a/data/maps/SecretBase_BlueCave3/map.json
+++ b/data/maps/SecretBase_BlueCave3/map.json
@@ -1,6 +1,7 @@
{
"id": "MAP_SECRET_BASE_BLUE_CAVE3",
"name": "SecretBase_BlueCave3",
+ "shared_scripts_map": "SecretBase",
"layout": "LAYOUT_SECRET_BASE_BLUE_CAVE3",
"music": "MUS_MACHI_S3",
"region_map_section": "MAPSEC_SECRET_BASE",
diff --git a/data/maps/SecretBase_BlueCave3/scripts.inc b/data/maps/SecretBase_BlueCave3/scripts.inc
deleted file mode 100644
index 0a8199f19..000000000
--- a/data/maps/SecretBase_BlueCave3/scripts.inc
+++ /dev/null
@@ -1 +0,0 @@
-SecretBase_BlueCave3_MapScripts:: @ 815F337
diff --git a/data/maps/SecretBase_BlueCave4/map.json b/data/maps/SecretBase_BlueCave4/map.json
index ce0338ac4..dedff942d 100644
--- a/data/maps/SecretBase_BlueCave4/map.json
+++ b/data/maps/SecretBase_BlueCave4/map.json
@@ -1,6 +1,7 @@
{
"id": "MAP_SECRET_BASE_BLUE_CAVE4",
"name": "SecretBase_BlueCave4",
+ "shared_scripts_map": "SecretBase",
"layout": "LAYOUT_SECRET_BASE_BLUE_CAVE4",
"music": "MUS_MACHI_S3",
"region_map_section": "MAPSEC_SECRET_BASE",
diff --git a/data/maps/SecretBase_BlueCave4/scripts.inc b/data/maps/SecretBase_BlueCave4/scripts.inc
deleted file mode 100644
index 72c1e9612..000000000
--- a/data/maps/SecretBase_BlueCave4/scripts.inc
+++ /dev/null
@@ -1 +0,0 @@
-SecretBase_BlueCave4_MapScripts:: @ 815F337
diff --git a/data/maps/SecretBase_BrownCave1/map.json b/data/maps/SecretBase_BrownCave1/map.json
index 4df7c9b36..6f6d65d57 100644
--- a/data/maps/SecretBase_BrownCave1/map.json
+++ b/data/maps/SecretBase_BrownCave1/map.json
@@ -1,6 +1,7 @@
{
"id": "MAP_SECRET_BASE_BROWN_CAVE1",
"name": "SecretBase_BrownCave1",
+ "shared_scripts_map": "SecretBase",
"layout": "LAYOUT_SECRET_BASE_BROWN_CAVE1",
"music": "MUS_MACHI_S3",
"region_map_section": "MAPSEC_SECRET_BASE",
diff --git a/data/maps/SecretBase_BrownCave1/scripts.inc b/data/maps/SecretBase_BrownCave1/scripts.inc
deleted file mode 100644
index ddbf182e4..000000000
--- a/data/maps/SecretBase_BrownCave1/scripts.inc
+++ /dev/null
@@ -1 +0,0 @@
-SecretBase_BrownCave1_MapScripts:: @ 815F337
diff --git a/data/maps/SecretBase_BrownCave2/map.json b/data/maps/SecretBase_BrownCave2/map.json
index f96c7ac37..f335e4198 100644
--- a/data/maps/SecretBase_BrownCave2/map.json
+++ b/data/maps/SecretBase_BrownCave2/map.json
@@ -1,6 +1,7 @@
{
"id": "MAP_SECRET_BASE_BROWN_CAVE2",
"name": "SecretBase_BrownCave2",
+ "shared_scripts_map": "SecretBase",
"layout": "LAYOUT_SECRET_BASE_BROWN_CAVE2",
"music": "MUS_MACHI_S3",
"region_map_section": "MAPSEC_SECRET_BASE",
diff --git a/data/maps/SecretBase_BrownCave2/scripts.inc b/data/maps/SecretBase_BrownCave2/scripts.inc
deleted file mode 100644
index 06dcb6335..000000000
--- a/data/maps/SecretBase_BrownCave2/scripts.inc
+++ /dev/null
@@ -1 +0,0 @@
-SecretBase_BrownCave2_MapScripts:: @ 815F337
diff --git a/data/maps/SecretBase_BrownCave3/map.json b/data/maps/SecretBase_BrownCave3/map.json
index b1c136f37..a228d136e 100644
--- a/data/maps/SecretBase_BrownCave3/map.json
+++ b/data/maps/SecretBase_BrownCave3/map.json
@@ -1,6 +1,7 @@
{
"id": "MAP_SECRET_BASE_BROWN_CAVE3",
"name": "SecretBase_BrownCave3",
+ "shared_scripts_map": "SecretBase",
"layout": "LAYOUT_SECRET_BASE_BROWN_CAVE3",
"music": "MUS_MACHI_S3",
"region_map_section": "MAPSEC_SECRET_BASE",
diff --git a/data/maps/SecretBase_BrownCave3/scripts.inc b/data/maps/SecretBase_BrownCave3/scripts.inc
deleted file mode 100644
index a0a85dc11..000000000
--- a/data/maps/SecretBase_BrownCave3/scripts.inc
+++ /dev/null
@@ -1 +0,0 @@
-SecretBase_BrownCave3_MapScripts:: @ 815F337
diff --git a/data/maps/SecretBase_BrownCave4/map.json b/data/maps/SecretBase_BrownCave4/map.json
index 348b19024..740e16515 100644
--- a/data/maps/SecretBase_BrownCave4/map.json
+++ b/data/maps/SecretBase_BrownCave4/map.json
@@ -1,6 +1,7 @@
{
"id": "MAP_SECRET_BASE_BROWN_CAVE4",
"name": "SecretBase_BrownCave4",
+ "shared_scripts_map": "SecretBase",
"layout": "LAYOUT_SECRET_BASE_BROWN_CAVE4",
"music": "MUS_MACHI_S3",
"region_map_section": "MAPSEC_SECRET_BASE",
diff --git a/data/maps/SecretBase_BrownCave4/scripts.inc b/data/maps/SecretBase_BrownCave4/scripts.inc
deleted file mode 100644
index 12d931e9e..000000000
--- a/data/maps/SecretBase_BrownCave4/scripts.inc
+++ /dev/null
@@ -1 +0,0 @@
-SecretBase_BrownCave4_MapScripts:: @ 815F337
diff --git a/data/maps/SecretBase_RedCave1/map.json b/data/maps/SecretBase_RedCave1/map.json
index 8ef1182dc..46ff6b973 100644
--- a/data/maps/SecretBase_RedCave1/map.json
+++ b/data/maps/SecretBase_RedCave1/map.json
@@ -1,6 +1,7 @@
{
"id": "MAP_SECRET_BASE_RED_CAVE1",
"name": "SecretBase_RedCave1",
+ "shared_scripts_map": "SecretBase",
"layout": "LAYOUT_SECRET_BASE_RED_CAVE1",
"music": "MUS_MACHI_S3",
"region_map_section": "MAPSEC_SECRET_BASE",
diff --git a/data/maps/SecretBase_RedCave1/scripts.inc b/data/maps/SecretBase_RedCave1/scripts.inc
deleted file mode 100644
index 77b99daec..000000000
--- a/data/maps/SecretBase_RedCave1/scripts.inc
+++ /dev/null
@@ -1 +0,0 @@
-SecretBase_RedCave1_MapScripts:: @ 815F337
diff --git a/data/maps/SecretBase_RedCave2/map.json b/data/maps/SecretBase_RedCave2/map.json
index 9746434b2..b610dbbb7 100644
--- a/data/maps/SecretBase_RedCave2/map.json
+++ b/data/maps/SecretBase_RedCave2/map.json
@@ -1,6 +1,7 @@
{
"id": "MAP_SECRET_BASE_RED_CAVE2",
"name": "SecretBase_RedCave2",
+ "shared_scripts_map": "SecretBase",
"layout": "LAYOUT_SECRET_BASE_RED_CAVE2",
"music": "MUS_MACHI_S3",
"region_map_section": "MAPSEC_SECRET_BASE",
diff --git a/data/maps/SecretBase_RedCave2/scripts.inc b/data/maps/SecretBase_RedCave2/scripts.inc
deleted file mode 100644
index 735d386fc..000000000
--- a/data/maps/SecretBase_RedCave2/scripts.inc
+++ /dev/null
@@ -1 +0,0 @@
-SecretBase_RedCave2_MapScripts:: @ 815F337
diff --git a/data/maps/SecretBase_RedCave3/map.json b/data/maps/SecretBase_RedCave3/map.json
index 4ea1ae21f..23522278a 100644
--- a/data/maps/SecretBase_RedCave3/map.json
+++ b/data/maps/SecretBase_RedCave3/map.json
@@ -1,6 +1,7 @@
{
"id": "MAP_SECRET_BASE_RED_CAVE3",
"name": "SecretBase_RedCave3",
+ "shared_scripts_map": "SecretBase",
"layout": "LAYOUT_SECRET_BASE_RED_CAVE3",
"music": "MUS_MACHI_S3",
"region_map_section": "MAPSEC_SECRET_BASE",
diff --git a/data/maps/SecretBase_RedCave3/scripts.inc b/data/maps/SecretBase_RedCave3/scripts.inc
deleted file mode 100644
index c9b72ca30..000000000
--- a/data/maps/SecretBase_RedCave3/scripts.inc
+++ /dev/null
@@ -1 +0,0 @@
-SecretBase_RedCave3_MapScripts:: @ 815F337
diff --git a/data/maps/SecretBase_RedCave4/map.json b/data/maps/SecretBase_RedCave4/map.json
index 458d8e469..3f9c09a84 100644
--- a/data/maps/SecretBase_RedCave4/map.json
+++ b/data/maps/SecretBase_RedCave4/map.json
@@ -1,6 +1,7 @@
{
"id": "MAP_SECRET_BASE_RED_CAVE4",
"name": "SecretBase_RedCave4",
+ "shared_scripts_map": "SecretBase",
"layout": "LAYOUT_SECRET_BASE_RED_CAVE4",
"music": "MUS_MACHI_S3",
"region_map_section": "MAPSEC_SECRET_BASE",
diff --git a/data/maps/SecretBase_RedCave4/scripts.inc b/data/maps/SecretBase_RedCave4/scripts.inc
deleted file mode 100644
index 6d2402f03..000000000
--- a/data/maps/SecretBase_RedCave4/scripts.inc
+++ /dev/null
@@ -1 +0,0 @@
-SecretBase_RedCave4_MapScripts:: @ 815F337
diff --git a/data/maps/SecretBase_Shrub1/map.json b/data/maps/SecretBase_Shrub1/map.json
index 4b314b856..3ee8d9072 100644
--- a/data/maps/SecretBase_Shrub1/map.json
+++ b/data/maps/SecretBase_Shrub1/map.json
@@ -1,6 +1,7 @@
{
"id": "MAP_SECRET_BASE_SHRUB1",
"name": "SecretBase_Shrub1",
+ "shared_scripts_map": "SecretBase",
"layout": "LAYOUT_SECRET_BASE_SHRUB1",
"music": "MUS_MACHI_S3",
"region_map_section": "MAPSEC_SECRET_BASE",
diff --git a/data/maps/SecretBase_Shrub1/scripts.inc b/data/maps/SecretBase_Shrub1/scripts.inc
deleted file mode 100644
index 79116a0cf..000000000
--- a/data/maps/SecretBase_Shrub1/scripts.inc
+++ /dev/null
@@ -1 +0,0 @@
-SecretBase_Shrub1_MapScripts:: @ 815F337
diff --git a/data/maps/SecretBase_Shrub2/map.json b/data/maps/SecretBase_Shrub2/map.json
index 10463cf97..bdbdf0407 100644
--- a/data/maps/SecretBase_Shrub2/map.json
+++ b/data/maps/SecretBase_Shrub2/map.json
@@ -1,6 +1,7 @@
{
"id": "MAP_SECRET_BASE_SHRUB2",
"name": "SecretBase_Shrub2",
+ "shared_scripts_map": "SecretBase",
"layout": "LAYOUT_SECRET_BASE_SHRUB2",
"music": "MUS_MACHI_S3",
"region_map_section": "MAPSEC_SECRET_BASE",
diff --git a/data/maps/SecretBase_Shrub2/scripts.inc b/data/maps/SecretBase_Shrub2/scripts.inc
deleted file mode 100644
index 49835f7f3..000000000
--- a/data/maps/SecretBase_Shrub2/scripts.inc
+++ /dev/null
@@ -1 +0,0 @@
-SecretBase_Shrub2_MapScripts:: @ 815F337
diff --git a/data/maps/SecretBase_Shrub3/map.json b/data/maps/SecretBase_Shrub3/map.json
index cbbf64305..0da13143a 100644
--- a/data/maps/SecretBase_Shrub3/map.json
+++ b/data/maps/SecretBase_Shrub3/map.json
@@ -1,6 +1,7 @@
{
"id": "MAP_SECRET_BASE_SHRUB3",
"name": "SecretBase_Shrub3",
+ "shared_scripts_map": "SecretBase",
"layout": "LAYOUT_SECRET_BASE_SHRUB3",
"music": "MUS_MACHI_S3",
"region_map_section": "MAPSEC_SECRET_BASE",
diff --git a/data/maps/SecretBase_Shrub3/scripts.inc b/data/maps/SecretBase_Shrub3/scripts.inc
deleted file mode 100644
index 0aeb7bdf9..000000000
--- a/data/maps/SecretBase_Shrub3/scripts.inc
+++ /dev/null
@@ -1 +0,0 @@
-SecretBase_Shrub3_MapScripts:: @ 815F337
diff --git a/data/maps/SecretBase_Shrub4/map.json b/data/maps/SecretBase_Shrub4/map.json
index 487c0f09f..b2926c167 100644
--- a/data/maps/SecretBase_Shrub4/map.json
+++ b/data/maps/SecretBase_Shrub4/map.json
@@ -1,6 +1,7 @@
{
"id": "MAP_SECRET_BASE_SHRUB4",
"name": "SecretBase_Shrub4",
+ "shared_scripts_map": "SecretBase",
"layout": "LAYOUT_SECRET_BASE_SHRUB4",
"music": "MUS_MACHI_S3",
"region_map_section": "MAPSEC_SECRET_BASE",
diff --git a/data/maps/SecretBase_Shrub4/scripts.inc b/data/maps/SecretBase_Shrub4/scripts.inc
deleted file mode 100644
index f131b308d..000000000
--- a/data/maps/SecretBase_Shrub4/scripts.inc
+++ /dev/null
@@ -1 +0,0 @@
-SecretBase_Shrub4_MapScripts:: @ 815F337
diff --git a/data/maps/SecretBase_Tree1/map.json b/data/maps/SecretBase_Tree1/map.json
index 9fcb78bc3..f7831972b 100644
--- a/data/maps/SecretBase_Tree1/map.json
+++ b/data/maps/SecretBase_Tree1/map.json
@@ -1,6 +1,7 @@
{
"id": "MAP_SECRET_BASE_TREE1",
"name": "SecretBase_Tree1",
+ "shared_scripts_map": "SecretBase",
"layout": "LAYOUT_SECRET_BASE_TREE1",
"music": "MUS_MACHI_S3",
"region_map_section": "MAPSEC_SECRET_BASE",
diff --git a/data/maps/SecretBase_Tree1/scripts.inc b/data/maps/SecretBase_Tree1/scripts.inc
deleted file mode 100644
index 7345c3bbb..000000000
--- a/data/maps/SecretBase_Tree1/scripts.inc
+++ /dev/null
@@ -1 +0,0 @@
-SecretBase_Tree1_MapScripts:: @ 815F337
diff --git a/data/maps/SecretBase_Tree2/map.json b/data/maps/SecretBase_Tree2/map.json
index b7c0da914..5285269d7 100644
--- a/data/maps/SecretBase_Tree2/map.json
+++ b/data/maps/SecretBase_Tree2/map.json
@@ -1,6 +1,7 @@
{
"id": "MAP_SECRET_BASE_TREE2",
"name": "SecretBase_Tree2",
+ "shared_scripts_map": "SecretBase",
"layout": "LAYOUT_SECRET_BASE_TREE2",
"music": "MUS_MACHI_S3",
"region_map_section": "MAPSEC_SECRET_BASE",
diff --git a/data/maps/SecretBase_Tree2/scripts.inc b/data/maps/SecretBase_Tree2/scripts.inc
deleted file mode 100644
index 0f2976a8c..000000000
--- a/data/maps/SecretBase_Tree2/scripts.inc
+++ /dev/null
@@ -1 +0,0 @@
-SecretBase_Tree2_MapScripts:: @ 815F337
diff --git a/data/maps/SecretBase_Tree3/map.json b/data/maps/SecretBase_Tree3/map.json
index 349e340eb..f17d16851 100644
--- a/data/maps/SecretBase_Tree3/map.json
+++ b/data/maps/SecretBase_Tree3/map.json
@@ -1,6 +1,7 @@
{
"id": "MAP_SECRET_BASE_TREE3",
"name": "SecretBase_Tree3",
+ "shared_scripts_map": "SecretBase",
"layout": "LAYOUT_SECRET_BASE_TREE3",
"music": "MUS_MACHI_S3",
"region_map_section": "MAPSEC_SECRET_BASE",
diff --git a/data/maps/SecretBase_Tree3/scripts.inc b/data/maps/SecretBase_Tree3/scripts.inc
deleted file mode 100644
index cb80b0d25..000000000
--- a/data/maps/SecretBase_Tree3/scripts.inc
+++ /dev/null
@@ -1 +0,0 @@
-SecretBase_Tree3_MapScripts:: @ 815F337
diff --git a/data/maps/SecretBase_Tree4/map.json b/data/maps/SecretBase_Tree4/map.json
index c6c0856cf..b907de4da 100644
--- a/data/maps/SecretBase_Tree4/map.json
+++ b/data/maps/SecretBase_Tree4/map.json
@@ -1,6 +1,7 @@
{
"id": "MAP_SECRET_BASE_TREE4",
"name": "SecretBase_Tree4",
+ "shared_scripts_map": "SecretBase",
"layout": "LAYOUT_SECRET_BASE_TREE4",
"music": "MUS_MACHI_S3",
"region_map_section": "MAPSEC_SECRET_BASE",
diff --git a/data/maps/SecretBase_Tree4/scripts.inc b/data/maps/SecretBase_Tree4/scripts.inc
deleted file mode 100644
index 0a6771740..000000000
--- a/data/maps/SecretBase_Tree4/scripts.inc
+++ /dev/null
@@ -1 +0,0 @@
-SecretBase_Tree4_MapScripts:: @ 815F337
diff --git a/data/maps/SecretBase_YellowCave1/map.json b/data/maps/SecretBase_YellowCave1/map.json
index ab18d10de..02a0256ac 100644
--- a/data/maps/SecretBase_YellowCave1/map.json
+++ b/data/maps/SecretBase_YellowCave1/map.json
@@ -1,6 +1,7 @@
{
"id": "MAP_SECRET_BASE_YELLOW_CAVE1",
"name": "SecretBase_YellowCave1",
+ "shared_scripts_map": "SecretBase",
"layout": "LAYOUT_SECRET_BASE_YELLOW_CAVE1",
"music": "MUS_MACHI_S3",
"region_map_section": "MAPSEC_SECRET_BASE",
diff --git a/data/maps/SecretBase_YellowCave1/scripts.inc b/data/maps/SecretBase_YellowCave1/scripts.inc
deleted file mode 100644
index b76a5f44e..000000000
--- a/data/maps/SecretBase_YellowCave1/scripts.inc
+++ /dev/null
@@ -1 +0,0 @@
-SecretBase_YellowCave1_MapScripts:: @ 815F337
diff --git a/data/maps/SecretBase_YellowCave2/map.json b/data/maps/SecretBase_YellowCave2/map.json
index 07481867c..011080f51 100644
--- a/data/maps/SecretBase_YellowCave2/map.json
+++ b/data/maps/SecretBase_YellowCave2/map.json
@@ -1,6 +1,7 @@
{
"id": "MAP_SECRET_BASE_YELLOW_CAVE2",
"name": "SecretBase_YellowCave2",
+ "shared_scripts_map": "SecretBase",
"layout": "LAYOUT_SECRET_BASE_YELLOW_CAVE2",
"music": "MUS_MACHI_S3",
"region_map_section": "MAPSEC_SECRET_BASE",
diff --git a/data/maps/SecretBase_YellowCave2/scripts.inc b/data/maps/SecretBase_YellowCave2/scripts.inc
deleted file mode 100644
index 0bc1fc354..000000000
--- a/data/maps/SecretBase_YellowCave2/scripts.inc
+++ /dev/null
@@ -1 +0,0 @@
-SecretBase_YellowCave2_MapScripts:: @ 815F337
diff --git a/data/maps/SecretBase_YellowCave3/map.json b/data/maps/SecretBase_YellowCave3/map.json
index d1060d26d..5bbb30751 100644
--- a/data/maps/SecretBase_YellowCave3/map.json
+++ b/data/maps/SecretBase_YellowCave3/map.json
@@ -1,6 +1,7 @@
{
"id": "MAP_SECRET_BASE_YELLOW_CAVE3",
"name": "SecretBase_YellowCave3",
+ "shared_scripts_map": "SecretBase",
"layout": "LAYOUT_SECRET_BASE_YELLOW_CAVE3",
"music": "MUS_MACHI_S3",
"region_map_section": "MAPSEC_SECRET_BASE",
diff --git a/data/maps/SecretBase_YellowCave3/scripts.inc b/data/maps/SecretBase_YellowCave3/scripts.inc
deleted file mode 100644
index 137f04316..000000000
--- a/data/maps/SecretBase_YellowCave3/scripts.inc
+++ /dev/null
@@ -1 +0,0 @@
-SecretBase_YellowCave3_MapScripts:: @ 815F337
diff --git a/data/maps/SecretBase_YellowCave4/map.json b/data/maps/SecretBase_YellowCave4/map.json
index f717b2c88..0732d6282 100644
--- a/data/maps/SecretBase_YellowCave4/map.json
+++ b/data/maps/SecretBase_YellowCave4/map.json
@@ -1,6 +1,7 @@
{
"id": "MAP_SECRET_BASE_YELLOW_CAVE4",
"name": "SecretBase_YellowCave4",
+ "shared_scripts_map": "SecretBase",
"layout": "LAYOUT_SECRET_BASE_YELLOW_CAVE4",
"music": "MUS_MACHI_S3",
"region_map_section": "MAPSEC_SECRET_BASE",
diff --git a/data/maps/SecretBase_YellowCave4/scripts.inc b/data/maps/SecretBase_YellowCave4/scripts.inc
deleted file mode 100644
index 4f93a99d7..000000000
--- a/data/maps/SecretBase_YellowCave4/scripts.inc
+++ /dev/null
@@ -1,23 +0,0 @@
-SecretBase_YellowCave4_MapScripts:: @ 815F337
- map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, SecretBase_RedCave1_MapScript2_15F358
- map_script MAP_SCRIPT_ON_TRANSITION, SecretBase_RedCave1_MapScript1_15F34F
- map_script MAP_SCRIPT_ON_FRAME_TABLE, SecretBase_RedCave1_MapScript2_15F362
- map_script MAP_SCRIPT_ON_RESUME, SecretBase_RedCave1_MapScript1_15F34C
- .byte 0
-
-SecretBase_RedCave1_MapScript1_15F34C:: @ 815F34C
- setstepcallback 6
- end
-
-SecretBase_RedCave1_MapScript1_15F34F:: @ 815F34F
- call SecretBase_RedCave1_EventScript_1A2F3D
- special sub_80BBFA4
- end
-
-SecretBase_RedCave1_MapScript2_15F358:: @ 815F358
- map_script_2 0x4089, 0, SecretBase_RedCave1_EventScript_1A2F68
- .2byte 0
-
-SecretBase_RedCave1_MapScript2_15F362:: @ 815F362
- map_script_2 VAR_0x4097, 0, SecretBase_RedCave1_EventScript_1A2DDE
- .2byte 0
diff --git a/data/scripts/shared_secret_base.inc b/data/scripts/shared_secret_base.inc
new file mode 100644
index 000000000..e3b87f1ea
--- /dev/null
+++ b/data/scripts/shared_secret_base.inc
@@ -0,0 +1,190 @@
+SecretBase_MapScripts:: @ 815F337
+ map_script MAP_SCRIPT_ON_WARP_INTO_MAP_TABLE, SecretBase_OnWarp
+ map_script MAP_SCRIPT_ON_TRANSITION, SecretBase_OnTransition
+ map_script MAP_SCRIPT_ON_FRAME_TABLE, SecretBase_OnFrame
+ map_script MAP_SCRIPT_ON_RESUME, SecretBase_OnResume
+ .byte 0
+
+SecretBase_OnResume:: @ 815F34C
+ setstepcallback 6
+ end
+
+SecretBase_OnTransition:: @ 815F34F
+ call SecretBase_EventScript_SetDecorationFlags
+ special SetSecretBaseOwnerGfxId
+ end
+
+SecretBase_OnWarp:: @ 815F358
+ map_script_2 VAR_SECRET_BASE_INITIALIZED, 0, SecretBase_EventScript_InitDecorations
+ .2byte 0
+
+SecretBase_OnFrame:: @ 815F362
+ map_script_2 VAR_INIT_SECRET_BASE, 0, SecretBase_EventScript_FirstEntrance
+ .2byte 0
+
+SecretBase_EventScript_PC:: @ 815F36C
+ lockall
+ playse SE_PC_LOGON
+ message SecretBase_Text_BootUpPC
+ dofieldeffect FLDEFF_SECRET_BASE_PC_TURN_ON
+ waitstate
+ waitmessage
+ waitbuttonpress
+ playse SE_SELECT
+ goto SecretBase_EventScript_PCShowMainMenu
+ end
+
+SecretBase_EventScript_PCShowMainMenu:
+ message SecretBase_Text_WhatWouldYouLikeToDo
+ waitmessage
+ goto_if_set FLAG_SECRET_BASE_REGISTRY_ENABLED, SecretBase_EventScript_PCMainMenuWithRegister
+ goto SecretBase_EventScript_PCMainMenuWithoutRegister
+ end
+
+SecretBase_EventScript_PCCancel:: @ 815F399
+ lockall
+ goto SecretBase_EventScript_PCShowMainMenu
+ end
+
+SecretBase_EventScript_PCMainMenuWithRegister:
+ multichoice 0, 0, 6, 0
+ switch VAR_RESULT
+ case 0, SecretBase_EventScript_PCDecorationMenu
+ case 1, SecretBase_EventScript_PCPackUp
+ case 2, SecretBase_EventScript_PCRegistryMenu
+ case 3, SecretBase_EventScript_PCTurnOff
+ case 127, SecretBase_EventScript_PCTurnOff
+ end
+
+SecretBase_EventScript_PCMainMenuWithoutRegister:
+ multichoice 0, 0, 5, 0
+ switch VAR_RESULT
+ case 0, SecretBase_EventScript_PCDecorationMenu
+ case 1, SecretBase_EventScript_PCPackUp
+ case 2, SecretBase_EventScript_PCTurnOff
+ case 127, SecretBase_EventScript_PCTurnOff
+ end
+
+SecretBase_EventScript_PCPackUp:
+ msgbox SecretBase_Text_AllDecorationsWillBeReturned, MSGBOX_YESNO
+ compare VAR_RESULT, NO
+ goto_if_eq SecretBase_EventScript_PCShowMainMenu
+ closemessage
+ special MoveOutOfSecretBase
+ releaseall
+ end
+
+SecretBase_EventScript_PCDecorationMenu:
+ special SecretBasePC_Decoration
+ end
+
+SecretBase_EventScript_PCRegistryMenu:
+ special SecretBasePC_Registry
+ end
+
+SecretBase_EventScript_RecordMixingPC:: @ 815F43A
+ lockall
+ message SecretBase_Text_BootUpPC
+ playse SE_PC_LOGON
+ dofieldeffect FLDEFF_SECRET_BASE_PC_TURN_ON
+ waitstate
+ waitmessage
+ waitbuttonpress
+ playse SE_SELECT
+ goto SecretBase_EventScript_PCRegisterMenu
+ end
+
+SecretBase_EventScript_PCRegisterMenu:
+ message SecretBase_Text_WhatWouldYouLikeToDo
+ waitmessage
+ multichoice 0, 0, 7, 0
+ switch VAR_RESULT
+ case 0, SecretBase_EventScript_PCRegister
+ case 1, SecretBase_EventScript_PCRegistryMenu
+ case 2, SecretBase_EventScript_PCRegistryInfo
+ case 3, SecretBase_EventScript_PCTurnOff
+ case 127, SecretBase_EventScript_PCTurnOff
+ end
+
+SecretBase_EventScript_ShowRegisterMenu:: @ 815F49A
+ lockall
+ goto SecretBase_EventScript_PCRegisterMenu
+ end
+
+SecretBase_EventScript_PCRegister:
+ special GetCurSecretBaseRegistrationValidity
+ compare VAR_RESULT, 1
+ goto_if_eq SecretBase_EventScript_AlreadyRegistered
+ compare VAR_RESULT, 2
+ goto_if_eq SecretBase_EventScript_CantRegisterTooManyBases
+ special BufferSecretBaseOwnerName
+ msgbox SecretBase_Text_WantToRegisterSecretBase, MSGBOX_YESNO
+ compare VAR_RESULT, NO
+ goto_if_eq SecretBase_EventScript_PCRegisterMenu
+ msgbox SecretBase_Text_RegistrationCompleted, MSGBOX_SIGN
+ special ToggleCurSecretBaseRegistry
+ special DoSecretBasePCTurnOffEffect
+ releaseall
+ end
+
+SecretBase_EventScript_AlreadyRegistered:
+ msgbox SecretBase_Text_AlreadyRegisteredDelete, MSGBOX_YESNO
+ compare VAR_RESULT, NO
+ goto_if_eq SecretBase_EventScript_PCRegisterMenu
+ msgbox SecretBase_Text_DataUnregistered, MSGBOX_SIGN
+ special ToggleCurSecretBaseRegistry
+ special DoSecretBasePCTurnOffEffect
+ releaseall
+ end
+
+SecretBase_EventScript_CantRegisterTooManyBases:
+ msgbox SecretBase_Text_TooManyBasesDeleteSome, MSGBOX_SIGN
+ special DoSecretBasePCTurnOffEffect
+ closemessage
+ releaseall
+ end
+
+SecretBase_EventScript_PCRegistryInfo:
+ message SecretBase_Text_RegistryInfo
+ waitmessage
+ goto SecretBase_EventScript_PCRegisterMenu
+ end
+
+SecretBase_EventScript_PCTurnOff:
+ special DoSecretBasePCTurnOffEffect
+ closemessage
+ releaseall
+ end
+
+SecretBase_EventScript_SandOrnament:: @ 815F523
+ dofieldeffect FLDEFF_SAND_PILLAR
+ waitstate
+ end
+
+SecretBase_EventScript_ShieldOrToyTV:: @ 815F528
+ special GetShieldToyTVDecorationInfo
+ compare VAR_RESULT, 0
+ goto_if_eq SecretBase_EventScript_BattleTowerShield
+ compare VAR_RESULT, 1
+ goto_if_eq SecretBase_EventScript_ToyTV
+ compare VAR_RESULT, 2
+ goto_if_eq SecretBase_EventScript_SeedotTV
+ compare VAR_RESULT, 3
+ goto_if_eq SecretBase_EventScript_SkittyTV
+ end
+
+SecretBase_EventScript_BattleTowerShield:
+ msgbox SecretBase_Text_BattleTowerShield, MSGBOX_SIGN
+ end
+
+SecretBase_EventScript_ToyTV:
+ msgbox SecretBase_Text_ToyTV, MSGBOX_SIGN
+ end
+
+SecretBase_EventScript_SeedotTV:
+ msgbox SecretBase_Text_SeedotTV, MSGBOX_SIGN
+ end
+
+SecretBase_EventScript_SkittyTV:
+ msgbox SecretBase_Text_SkittyTV, MSGBOX_SIGN
+ end
diff --git a/data/specials.inc b/data/specials.inc
index 86e62455c..d3a20bda8 100644
--- a/data/specials.inc
+++ b/data/specials.inc
@@ -18,10 +18,10 @@ gSpecials::
def_special CheckPlayerHasSecretBase
def_special sub_80BBAF0
def_special sub_80BC440
- def_special SecretBasePC_PackUp
+ def_special MoveOutOfSecretBase
def_special sub_80BC114
- def_special sub_80BC56C
- def_special sub_80BC5BC
+ def_special GetCurSecretBaseRegistrationValidity
+ def_special ToggleCurSecretBaseRegistry
def_special SecretBasePC_Decoration
def_special SecretBasePC_Registry
def_special sub_80BCE1C
@@ -30,7 +30,7 @@ gSpecials::
def_special sub_80FF474
def_special sub_8100B20
def_special sub_80BB70C
- def_special sub_80BBFA4
+ def_special SetSecretBaseOwnerGfxId
def_special sub_8100A7C
def_special sub_80BBC78
def_special sub_80BCE4C
diff --git a/include/constants/flags.h b/include/constants/flags.h
index a6fa4c806..fef947fc6 100644
--- a/include/constants/flags.h
+++ b/include/constants/flags.h
@@ -219,7 +219,7 @@
#define FLAG_RECEIVED_TM41 0x109
#define FLAG_RECEIVED_LAVARIDGE_EGG 0x10A
#define FLAG_RECEIVED_FOSSIL_MON 0x10B
-#define FLAG_DECORATION_16 0x10C
+#define FLAG_SECRET_BASE_REGISTRY_ENABLED 0x10C
#define FLAG_RECEIVED_TM46 0x10D
#define FLAG_CONTEST_SKETCH_CREATED 0x10E
#define FLAG_EVIL_TEAM_ESCAPED_STERN_SPOKE 0x10F
diff --git a/include/constants/vars.h b/include/constants/vars.h
index 8f478b794..e7917ee0f 100644
--- a/include/constants/vars.h
+++ b/include/constants/vars.h
@@ -108,7 +108,7 @@
#define VAR_LINK_CONTEST_ROOM_STATE 0x4086
#define VAR_CABLE_CLUB_STATE 0x4087
#define VAR_CONTEST_LOCATION 0x4088
-#define VAR_0x4089 0x4089 // TODO: related to decorations
+#define VAR_SECRET_BASE_INITIALIZED 0x4089
#define VAR_CONTEST_PRIZE_PICKUP 0x408A
#define VAR_LITTLEROOT_HOUSES_STATE_2 0x408C // TODO: needs more investigation
@@ -122,7 +122,7 @@
#define VAR_LILYCOVE_MUSEUM_2F_STATE 0x4094
#define VAR_LILYCOVE_FAN_CLUB_STATE 0x4095
#define VAR_BRINEY_LOCATION 0x4096
-#define VAR_0x4097 0x4097 // TODO: related to creating new secret base
+#define VAR_INIT_SECRET_BASE 0x4097
#define VAR_PETALBURG_WOODS_STATE 0x4098
#define VAR_LILYCOVE_CONTEST_LOBBY_STATE 0x4099
#define VAR_RUSTURF_TUNNEL_STATE 0x409a
diff --git a/include/secret_base.h b/include/secret_base.h
index a9a205bc4..dafbca085 100644
--- a/include/secret_base.h
+++ b/include/secret_base.h
@@ -16,7 +16,6 @@ void sub_80BC038(struct MapPosition *, struct MapEvents *);
u8 sub_80BC050();
u8 *GetSecretBaseMapName(u8 *dest);
void SetPlayerSecretBaseRecordMixingParty();
-u8 sub_80BCCA4(u8 secretBaseIndex);
const u8 *GetSecretBaseTrainerLoseText(void);
void sub_80BCF1C(u8 taskId);
void sub_80BD674(void *playerRecords, u32 size, u8 c);
diff --git a/src/debug/tomomichi_debug_menu.c b/src/debug/tomomichi_debug_menu.c
index c9804c638..a7ec192a9 100644
--- a/src/debug/tomomichi_debug_menu.c
+++ b/src/debug/tomomichi_debug_menu.c
@@ -1561,7 +1561,7 @@ static const u16 sControlWorks_SaveWork_ItemArrays[][9] = {
{VAR_TRICK_HOUSE_ENTRANCE_STATE_2, VAR_TRICK_HOUSE_PRIZE_PICKUP, VAR_TRICK_HOUSE_STATE, VAR_TRICK_HOUSE_ENTRANCE_STATE_3, VAR_TRICK_HOUSE_ENTRANCE_STATE},
{VAR_TRICK_HOUSE_PUZZLE_1_STATE, VAR_TRICK_HOUSE_PUZZLE_2_STATE, VAR_TRICK_HOUSE_PUZZLE_3_STATE, VAR_TRICK_HOUSE_PUZZLE_4_STATE, VAR_TRICK_HOUSE_PUZZLE_5_STATE, VAR_TRICK_HOUSE_PUZZLE_6_STATE, VAR_TRICK_HOUSE_PUZZLE_7_STATE, VAR_TRICK_HOUSE_PUZZLE_8_STATE, VAR_TRICK_HOUSE_PUZZLE_7_STATE_2},
{VAR_BRINEY_HOUSE_STATE, VAR_GLASS_WORKSHOP_STATE},
- {VAR_0x4089, VAR_BOARD_BRINEY_BOAT_ROUTE104_STATE, VAR_BRINEY_LOCATION, VAR_0x4097, VAR_LILYCOVE_CONTEST_LOBBY_STATE, VAR_ELITE_4_STATE, VAR_CABLE_CAR_STATION_STATE, VAR_SAFARI_ZONE_STATE, VAR_CYCLING_CHALLENGE_STATE},
+ {VAR_SECRET_BASE_INITIALIZED, VAR_BOARD_BRINEY_BOAT_ROUTE104_STATE, VAR_BRINEY_LOCATION, VAR_INIT_SECRET_BASE, VAR_LILYCOVE_CONTEST_LOBBY_STATE, VAR_ELITE_4_STATE, VAR_CABLE_CAR_STATION_STATE, VAR_SAFARI_ZONE_STATE, VAR_CYCLING_CHALLENGE_STATE},
{VAR_WEATHER_INSTITUTE_STATE, VAR_SLATEPORT_FAN_CLUB_STATE, 0x40BB, VAR_BRAVO_TRAINER_BATTLE_TOWER_ON, VAR_GAME_CORNER_STATE, VAR_WHICH_FOSSIL_REVIVED}
};
diff --git a/src/decoration.c b/src/decoration.c
index 8dde2834d..4dd7e0f12 100644
--- a/src/decoration.c
+++ b/src/decoration.c
@@ -1430,7 +1430,7 @@ const struct YesNoFuncTable gUnknown_083EC634[] = {
// text
-extern u8 gUnknown_0815F399[];
+extern u8 SecretBase_EventScript_PCCancel[];
void sub_80FE1DC(void)
{
@@ -1524,7 +1524,7 @@ void gpu_pal_decompress_alloc_tag_and_upload(u8 taskId)
FreeSpritePaletteByTag(6);
if (ewram_1f000.isPlayerRoom == 0)
{
- ScriptContext1_SetupScript(gUnknown_0815F399);
+ ScriptContext1_SetupScript(SecretBase_EventScript_PCCancel);
DestroyTask(taskId);
} else
{
diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c
index 7c74debab..b67f11ae2 100644
--- a/src/field_control_avatar.c
+++ b/src/field_control_avatar.c
@@ -49,8 +49,8 @@ u8 gSelectedObjectEvent;
extern u8 gUnknown_081A2C51[];
extern u8 gUnknown_0815281E[];
extern u8 gUnknown_08152C39[];
-extern u8 gUnknown_0815F36C[];
-extern u8 gUnknown_0815F43A[];
+extern u8 SecretBase_EventScript_PC[];
+extern u8 SecretBase_EventScript_RecordMixingPC[];
extern u8 gUnknown_081A0009[];
extern u8 gUnknown_081C6C02[];
extern u8 HiddenItemScript[];
@@ -69,10 +69,8 @@ extern u8 VaseScript[];
extern u8 TrashCanScript[];
extern u8 ShopShelfScript[];
extern u8 BlueprintScript[];
-extern u8 gUnknown_0815F36C[];
-extern u8 gUnknown_0815F43A[];
-extern u8 gUnknown_0815F523[];
-extern u8 gUnknown_0815F528[];
+extern u8 SecretBase_EventScript_SandOrnament[];
+extern u8 SecretBase_EventScript_ShieldOrToyTV[];
extern u8 UseSurfScript[];
extern u8 S_UseWaterfall[];
extern u8 S_CannotUseWaterfall[];
@@ -320,8 +318,8 @@ static bool8 TryStartInteractionScript(struct MapPosition *position, u16 metatil
// Play computer noise for PC-related scripts.
if (script != gUnknown_0815281E
&& script != gUnknown_08152C39
- && script != gUnknown_0815F36C
- && script != gUnknown_0815F43A
+ && script != SecretBase_EventScript_PC
+ && script != SecretBase_EventScript_RecordMixingPC
&& script != gUnknown_081A0009)
PlaySE(5);
@@ -490,13 +488,13 @@ static u8 *GetInteractedMetatileScript(struct MapPosition *position, u8 metatile
if (height == MapGridGetZCoordAt(position->x, position->y))
{
if (MetatileBehavior_IsSecretBasePC(metatileBehavior) == TRUE)
- return gUnknown_0815F36C;
+ return SecretBase_EventScript_PC;
if (MetatileBehavior_IsRecordMixingSecretBasePC(metatileBehavior) == TRUE)
- return gUnknown_0815F43A;
+ return SecretBase_EventScript_RecordMixingPC;
if (MetatileBehavior_IsSecretBaseSandOrnament(metatileBehavior) == TRUE)
- return gUnknown_0815F523;
+ return SecretBase_EventScript_SandOrnament;
if (MetatileBehavior_IsSecretBaseShieldOrToyTV(metatileBehavior) == TRUE)
- return gUnknown_0815F528;
+ return SecretBase_EventScript_ShieldOrToyTV;
}
return NULL;
diff --git a/src/secret_base.c b/src/secret_base.c
index d4a44de54..21dd83dd2 100644
--- a/src/secret_base.c
+++ b/src/secret_base.c
@@ -51,9 +51,10 @@ static void sub_80BCBC0(u8);
static void sub_80BCBF8(u8 taskId);
static void sub_80BCC54(u8 taskId);
static void Task_SecretBasePC_Registry(u8 taskId);
+static u8 GetSecretBaseOwnerType(u8 secretBaseIndex);
-extern u8 gUnknown_0815F399[];
-extern u8 gUnknown_0815F49A[];
+extern u8 SecretBase_EventScript_PCCancel[];
+extern u8 SecretBase_EventScript_ShowRegisterMenu[];
EWRAM_DATA u8 gCurrentSecretBaseId = 0;
const struct
@@ -108,8 +109,19 @@ const struct YesNoFuncTable gUnknown_083D13E4 = {
sub_80BCBC0
};
-const u8 gUnknown_083D13EC[] = {
- 0x23,0x24,0xF,0x1F,0x21,0x2F,0xE,0x14,0x20,0x22,0x0,0x0
+static const u8 sSecretBaseOwnerGfxIds[] = {
+ // Male
+ OBJ_EVENT_GFX_YOUNGSTER,
+ OBJ_EVENT_GFX_BUG_CATCHER,
+ OBJ_EVENT_GFX_BOY_4,
+ OBJ_EVENT_GFX_CAMPER,
+ OBJ_EVENT_GFX_MAN_4,
+ // Female
+ OBJ_EVENT_GFX_LASS,
+ OBJ_EVENT_GFX_GIRL_3,
+ OBJ_EVENT_GFX_WOMAN_3,
+ OBJ_EVENT_GFX_PICNICKER,
+ OBJ_EVENT_GFX_WOMAN_7,
};
extern u8 gUnknown_081A2E14[];
@@ -381,7 +393,7 @@ void sub_80BBAF0(void)
bool8 sub_80BBB24(void)
{
- if (gMapHeader.mapType == MAP_TYPE_SECRET_BASE && VarGet(VAR_0x4097) == 0)
+ if (gMapHeader.mapType == MAP_TYPE_SECRET_BASE && VarGet(VAR_INIT_SECRET_BASE) == 0)
return FALSE;
return TRUE;
}
@@ -463,7 +475,7 @@ void sub_80BBCCC(u8 flagIn)
sub_80BB764(&x, &y, 0x220);
MapGridSetMetatileIdAt(x + 7, y + 7, 0xe21);
}
- else if (flagIn == 1 && VarGet(VAR_0x4089) == 1)
+ else if (flagIn == 1 && VarGet(VAR_SECRET_BASE_INITIALIZED) == 1)
{
sub_80BB764(&x, &y, 0x220);
MapGridSetMetatileIdAt(x + 7, y + 7, 0xe0a);
@@ -528,10 +540,10 @@ void sub_80BBDD0(void)
}
}
-void sub_80BBFA4(void)
+void SetSecretBaseOwnerGfxId(void)
{
int curBase = VarGet(VAR_CURRENT_SECRET_BASE);
- VarSet(VAR_OBJ_GFX_ID_F, gUnknown_083D13EC[sub_80BCCA4(curBase)]);
+ VarSet(VAR_OBJ_GFX_ID_F, sSecretBaseOwnerGfxIds[GetSecretBaseOwnerType(curBase)]);
}
void SetCurrentSecretBaseFromPosition(struct MapPosition *position, struct MapEvents *events)
@@ -705,7 +717,7 @@ void sub_80BC440(void)
sub_80BC0F8();
}
-void SecretBasePC_PackUp(void)
+void MoveOutOfSecretBase(void)
{
IncrementGameStat(GAME_STAT_MOVED_SECRET_BASE);
sub_80BC440();
@@ -766,7 +778,7 @@ u8 sub_80BC538(void)
return retVal;
}
-void sub_80BC56C(void)
+void GetCurSecretBaseRegistrationValidity(void)
{
if (sub_80BC268(sub_80BC14C(gCurrentSecretBaseId)) == TRUE)
gSpecialVar_Result = 1;
@@ -776,10 +788,10 @@ void sub_80BC56C(void)
gSpecialVar_Result = 0;
}
-void sub_80BC5BC(void)
+void ToggleCurSecretBaseRegistry(void)
{
gSaveBlock1.secretBases[sub_80BC14C(gCurrentSecretBaseId)].sbr_field_1_6 ^= 1;
- FlagSet(FLAG_DECORATION_16);
+ FlagSet(FLAG_SECRET_BASE_REGISTRY_ENABLED);
}
void SecretBasePC_Decoration(void)
@@ -1077,14 +1089,14 @@ void sub_80BCC54(u8 taskId)
DestroyVerticalScrollIndicator(BOTTOM_ARROW);
if (curBaseIndex == 0)
- ScriptContext1_SetupScript(gUnknown_0815F399);
+ ScriptContext1_SetupScript(SecretBase_EventScript_PCCancel);
else
- ScriptContext1_SetupScript(gUnknown_0815F49A);
+ ScriptContext1_SetupScript(SecretBase_EventScript_ShowRegisterMenu);
DestroyTask(taskId);
}
-u8 sub_80BCCA4(u8 secretBaseIndex)
+static u8 GetSecretBaseOwnerType(u8 secretBaseIndex)
{
return (gSaveBlock1.secretBases[secretBaseIndex].playerName[OT_NAME_LENGTH] % 5)
+ gSaveBlock1.secretBases[secretBaseIndex].gender * 5;
@@ -1092,7 +1104,7 @@ u8 sub_80BCCA4(u8 secretBaseIndex)
const u8 *GetSecretBaseTrainerLoseText(void)
{
- u8 param = sub_80BCCA4(VarGet(VAR_CURRENT_SECRET_BASE));
+ u8 param = GetSecretBaseOwnerType(VarGet(VAR_CURRENT_SECRET_BASE));
if (param == 0) return UnknownString_81A1BB2;
if (param == 1) return UnknownString_81A1F67;
if (param == 2) return UnknownString_81A2254;
@@ -1148,7 +1160,7 @@ void sub_80BCE90()
FlagSet(FLAG_DAILY_UNKNOWN_8C2);
}
- gSpecialVar_0x8004 = sub_80BCCA4(curBaseIndex);
+ gSpecialVar_0x8004 = GetSecretBaseOwnerType(curBaseIndex);
gSpecialVar_Result = gSaveBlock1.secretBases[curBaseIndex].sbr_field_1_5;
}