Refactor chooseboxmon (#8491)

Co-authored-by: Alex <93446519+AlexOn1ine@users.noreply.github.com>
This commit is contained in:
FosterProgramming
2026-01-22 19:54:19 +01:00
committed by GitHub
parent fb4c8ef62c
commit fe2c154b89
45 changed files with 1337 additions and 1691 deletions

View File

@@ -89,8 +89,7 @@ Route117_PokemonDayCare_EventScript_GiveMonToRaise::
specialvar VAR_RESULT, CountPartyAliveNonEggMons
goto_if_eq VAR_RESULT, 2, Route117_PokemonDayCare_EventScript_OnlyTwoAliveMons
msgbox Route117_PokemonDayCare_Text_WhichMonShouldWeRaise, MSGBOX_DEFAULT
fadescreen FADE_TO_BLACK
special ChooseBoxMon
chooseboxmon SELECT_PC_MON_DAYCARE
waitstate
goto_if_eq VAR_0x8004, PARTY_NOTHING_CHOSEN, Route117_PokemonDayCare_EventScript_ComeAgain
specialvar VAR_RESULT, CountPartyAliveNonEggMons_IgnoreVar0x8004Slot

View File

@@ -71,12 +71,13 @@ MoveRelearner_EventScript_TeachMove::
getpartysize
goto_if_eq VAR_RESULT, 0, MoveRelearner_EventScript_NoPkmn
msgbox MoveRelearner_Text_ChoosePkmn, MSGBOX_DEFAULT
special ChooseMonForMoveRelearner
chooseboxmon SELECT_PC_MON_MOVE_RELEARNER
waitstate
call_if_eq VAR_0x8004, PARTY_NOTHING_CHOSEN, MoveRelearner_EventScript_AnythingElse
special IsSelectedMonEgg
call_if_eq VAR_RESULT, YES, MoveRelearner_EventScript_CantTeachMoveToEgg
call_if_eq VAR_0x8005, NO, MoveRelearner_EventScript_CantTeachMoveToPkmn
call_if_eq VAR_RESULT, TRUE, MoveRelearner_EventScript_CantTeachMoveToEgg
special HasMovesToRelearn
call_if_eq VAR_RESULT, FALSE, MoveRelearner_EventScript_CantTeachMoveToPkmn
msgbox MoveRelearner_Text_WhichXmoveShouldTeach, MSGBOX_DEFAULT
special TeachMoveRelearnerMove
waitstate

View File

@@ -1,18 +1,8 @@
SlateportCity_PokemonFanClub_EventScript_SwaggerTutor::
lock
faceplayer
goto_if_set FLAG_MOVE_TUTOR_TAUGHT_SWAGGER, MoveTutor_EventScript_SwaggerTaught
msgbox MoveTutor_Text_SwaggerTeach, MSGBOX_YESNO
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_SwaggerDeclined
call MoveTutor_EventScript_CanOnlyBeLearnedOnce
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_SwaggerDeclined
msgbox MoveTutor_Text_SwaggerWhichMon, MSGBOX_DEFAULT
setvar VAR_ITEM_ID, MOVE_SWAGGER
buffermovename STR_VAR_1, MOVE_SWAGGER
call MoveTutor_EventScript_OpenBox
goto_if_eq VAR_RESULT, 4, MoveTutor_EventScript_SwaggerDeclined
setflag FLAG_MOVE_TUTOR_TAUGHT_SWAGGER
goto MoveTutor_EventScript_SwaggerTaught
move_tutor MOVE_SWAGGER, MoveTutor_Text_SwaggerTeach, MoveTutor_Text_SwaggerWhichMon, MoveTutor_EventScript_SwaggerDeclined, MoveTutor_EventScript_SwaggerTaught, FLAG_MOVE_TUTOR_TAUGHT_SWAGGER
release
end
MoveTutor_EventScript_SwaggerDeclined::
@@ -28,18 +18,8 @@ MoveTutor_EventScript_SwaggerTaught::
MauvilleCity_EventScript_RolloutTutor::
lock
faceplayer
goto_if_set FLAG_MOVE_TUTOR_TAUGHT_ROLLOUT, MoveTutor_EventScript_RolloutTaught
msgbox MoveTutor_Text_RolloutTeach, MSGBOX_YESNO
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_RolloutDeclined
call MoveTutor_EventScript_CanOnlyBeLearnedOnce
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_RolloutDeclined
msgbox MoveTutor_Text_RolloutWhichMon, MSGBOX_DEFAULT
setvar VAR_ITEM_ID, MOVE_ROLLOUT
buffermovename STR_VAR_1, MOVE_ROLLOUT
call MoveTutor_EventScript_OpenBox
goto_if_eq VAR_RESULT, 4, MoveTutor_EventScript_RolloutDeclined
setflag FLAG_MOVE_TUTOR_TAUGHT_ROLLOUT
goto MoveTutor_EventScript_RolloutTaught
move_tutor MOVE_ROLLOUT, MoveTutor_Text_RolloutTeach, MoveTutor_Text_RolloutWhichMon, MoveTutor_EventScript_RolloutDeclined, MoveTutor_EventScript_RolloutTaught, FLAG_MOVE_TUTOR_TAUGHT_ROLLOUT
release
end
MoveTutor_EventScript_RolloutDeclined::
@@ -55,18 +35,7 @@ MoveTutor_EventScript_RolloutTaught::
VerdanturfTown_PokemonCenter_1F_EventScript_FuryCutterTutor::
lock
faceplayer
goto_if_set FLAG_MOVE_TUTOR_TAUGHT_FURY_CUTTER, MoveTutor_EventScript_FuryCutterTaught
msgbox MoveTutor_Text_FuryCutterTeach, MSGBOX_YESNO
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_FuryCutterDeclined
call MoveTutor_EventScript_CanOnlyBeLearnedOnce
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_FuryCutterDeclined
msgbox MoveTutor_Text_FuryCutterWhichMon, MSGBOX_DEFAULT
setvar VAR_ITEM_ID, MOVE_FURY_CUTTER
buffermovename STR_VAR_1, MOVE_FURY_CUTTER
call MoveTutor_EventScript_OpenBox
goto_if_eq VAR_RESULT, 4, MoveTutor_EventScript_FuryCutterDeclined
setflag FLAG_MOVE_TUTOR_TAUGHT_FURY_CUTTER
goto MoveTutor_EventScript_FuryCutterTaught
move_tutor MOVE_FURY_CUTTER, MoveTutor_Text_FuryCutterTeach, MoveTutor_Text_FuryCutterWhichMon, MoveTutor_EventScript_FuryCutterDeclined, MoveTutor_EventScript_FuryCutterTaught, FLAG_MOVE_TUTOR_TAUGHT_FURY_CUTTER
end
MoveTutor_EventScript_FuryCutterDeclined::
@@ -82,18 +51,7 @@ MoveTutor_EventScript_FuryCutterTaught::
LavaridgeTown_House_EventScript_MimicTutor::
lock
faceplayer
goto_if_set FLAG_MOVE_TUTOR_TAUGHT_MIMIC, MoveTutor_EventScript_MimicTaught
msgbox MoveTutor_MimicTeach, MSGBOX_YESNO
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_MimicDeclined
call MoveTutor_EventScript_CanOnlyBeLearnedOnce
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_MimicDeclined
msgbox MoveTutor_Text_MimicWhichMon, MSGBOX_DEFAULT
setvar VAR_ITEM_ID, MOVE_MIMIC
buffermovename STR_VAR_1, MOVE_MIMIC
call MoveTutor_EventScript_OpenBox
goto_if_eq VAR_RESULT, 4, MoveTutor_EventScript_MimicDeclined
setflag FLAG_MOVE_TUTOR_TAUGHT_MIMIC
goto MoveTutor_EventScript_MimicTaught
move_tutor MOVE_MIMIC, MoveTutor_MimicTeach, MoveTutor_Text_MimicWhichMon, MoveTutor_EventScript_MimicDeclined, MoveTutor_EventScript_MimicTaught, FLAG_MOVE_TUTOR_TAUGHT_MIMIC
end
MoveTutor_EventScript_MimicDeclined::
@@ -109,18 +67,7 @@ MoveTutor_EventScript_MimicTaught::
FallarborTown_Mart_EventScript_MetronomeTutor::
lock
faceplayer
goto_if_set FLAG_MOVE_TUTOR_TAUGHT_METRONOME, MoveTutor_EventScript_MetronomeTaught
msgbox MoveTutor_Text_MetronomeTeach, MSGBOX_YESNO
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_MetronomeDeclined
call MoveTutor_EventScript_CanOnlyBeLearnedOnce
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_MetronomeDeclined
msgbox MoveTutor_Text_MetronomeWhichMon, MSGBOX_DEFAULT
setvar VAR_ITEM_ID, MOVE_METRONOME
buffermovename STR_VAR_1, MOVE_METRONOME
call MoveTutor_EventScript_OpenBox
goto_if_eq VAR_RESULT, 4, MoveTutor_EventScript_MetronomeDeclined
setflag FLAG_MOVE_TUTOR_TAUGHT_METRONOME
goto MoveTutor_EventScript_MetronomeTaught
move_tutor MOVE_METRONOME, MoveTutor_Text_MetronomeTeach, MoveTutor_Text_MetronomeWhichMon, MoveTutor_EventScript_MetronomeDeclined, MoveTutor_EventScript_MetronomeTaught, FLAG_MOVE_TUTOR_TAUGHT_METRONOME
end
MoveTutor_EventScript_MetronomeDeclined::
@@ -136,18 +83,7 @@ MoveTutor_EventScript_MetronomeTaught::
FortreeCity_House2_EventScript_SleepTalkTutor::
lock
faceplayer
goto_if_set FLAG_MOVE_TUTOR_TAUGHT_SLEEP_TALK, MoveTutor_EventScript_SleepTalkTaught
msgbox MoveTutor_Text_SleepTalkTeach, MSGBOX_YESNO
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_SleepTalkDeclined
call MoveTutor_EventScript_CanOnlyBeLearnedOnce
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_SleepTalkDeclined
msgbox MoveTutor_Text_SleepTalkWhichMon, MSGBOX_DEFAULT
setvar VAR_ITEM_ID, MOVE_SLEEP_TALK
buffermovename STR_VAR_1, MOVE_SLEEP_TALK
call MoveTutor_EventScript_OpenBox
goto_if_eq VAR_RESULT, 4, MoveTutor_EventScript_SleepTalkDeclined
setflag FLAG_MOVE_TUTOR_TAUGHT_SLEEP_TALK
goto MoveTutor_EventScript_SleepTalkTaught
move_tutor MOVE_SLEEP_TALK, MoveTutor_Text_SleepTalkTeach, MoveTutor_Text_SleepTalkWhichMon, MoveTutor_EventScript_SleepTalkDeclined, MoveTutor_EventScript_SleepTalkTaught, FLAG_MOVE_TUTOR_TAUGHT_SLEEP_TALK
end
MoveTutor_EventScript_SleepTalkDeclined::
@@ -163,18 +99,7 @@ MoveTutor_EventScript_SleepTalkTaught::
LilycoveCity_DepartmentStoreRooftop_EventScript_SubstituteTutor::
lock
faceplayer
goto_if_set FLAG_MOVE_TUTOR_TAUGHT_SUBSTITUTE, MoveTutor_EventScript_SubstituteTaught
msgbox MoveTutor_Text_SubstituteTeach, MSGBOX_YESNO
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_SubstituteDeclined
call MoveTutor_EventScript_CanOnlyBeLearnedOnce
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_SubstituteDeclined
msgbox MoveTutor_Text_SubstituteWhichMon, MSGBOX_DEFAULT
setvar VAR_ITEM_ID, MOVE_SUBSTITUTE
buffermovename STR_VAR_1, MOVE_SUBSTITUTE
call MoveTutor_EventScript_OpenBox
goto_if_eq VAR_RESULT, 4, MoveTutor_EventScript_SubstituteDeclined
setflag FLAG_MOVE_TUTOR_TAUGHT_SUBSTITUTE
goto MoveTutor_EventScript_SubstituteTaught
move_tutor MOVE_SUBSTITUTE, MoveTutor_Text_SubstituteTeach, MoveTutor_Text_SubstituteWhichMon, MoveTutor_EventScript_SubstituteDeclined, MoveTutor_EventScript_SubstituteTaught, FLAG_MOVE_TUTOR_TAUGHT_SUBSTITUTE
end
MoveTutor_EventScript_SubstituteDeclined::
@@ -190,18 +115,7 @@ MoveTutor_EventScript_SubstituteTaught::
MossdeepCity_EventScript_DynamicPunchTutor::
lock
faceplayer
goto_if_set FLAG_MOVE_TUTOR_TAUGHT_DYNAMICPUNCH, MoveTutor_EventScript_DynamicPunchTaught
msgbox MoveTutor_Text_DynamicPunchTeach, MSGBOX_YESNO
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_DynamicPunchDeclined
call MoveTutor_EventScript_CanOnlyBeLearnedOnce
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_DynamicPunchDeclined
msgbox MoveTutor_Text_DynamicPunchWhichMon, MSGBOX_DEFAULT
setvar VAR_ITEM_ID, MOVE_DYNAMIC_PUNCH
buffermovename STR_VAR_1, MOVE_DYNAMIC_PUNCH
call MoveTutor_EventScript_OpenBox
goto_if_eq VAR_RESULT, 4, MoveTutor_EventScript_DynamicPunchDeclined
setflag FLAG_MOVE_TUTOR_TAUGHT_DYNAMICPUNCH
goto MoveTutor_EventScript_DynamicPunchTaught
move_tutor MOVE_DYNAMIC_PUNCH, MoveTutor_Text_DynamicPunchTeach, MoveTutor_Text_DynamicPunchWhichMon, MoveTutor_EventScript_DynamicPunchDeclined, MoveTutor_EventScript_DynamicPunchTaught, FLAG_MOVE_TUTOR_TAUGHT_DYNAMICPUNCH
end
MoveTutor_EventScript_DynamicPunchDeclined::
@@ -217,18 +131,7 @@ MoveTutor_EventScript_DynamicPunchTaught::
SootopolisCity_PokemonCenter_1F_EventScript_DoubleEdgeTutor::
lock
faceplayer
goto_if_set FLAG_MOVE_TUTOR_TAUGHT_DOUBLE_EDGE, MoveTutor_EventScript_DoubleEdgeTaught
msgbox MoveTutor_Text_DoubleEdgeTeach, MSGBOX_YESNO
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_DoubleEdgeDeclined
call MoveTutor_EventScript_CanOnlyBeLearnedOnce
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_DoubleEdgeDeclined
msgbox MoveTutor_Text_DoubleEdgeWhichMon, MSGBOX_DEFAULT
setvar VAR_ITEM_ID, MOVE_DOUBLE_EDGE
buffermovename STR_VAR_1, MOVE_DOUBLE_EDGE
call MoveTutor_EventScript_OpenBox
goto_if_eq VAR_RESULT, 4, MoveTutor_EventScript_DoubleEdgeDeclined
setflag FLAG_MOVE_TUTOR_TAUGHT_DOUBLE_EDGE
goto MoveTutor_EventScript_DoubleEdgeTaught
move_tutor MOVE_DOUBLE_EDGE, MoveTutor_Text_DoubleEdgeTeach, MoveTutor_Text_DoubleEdgeWhichMon, MoveTutor_EventScript_DoubleEdgeDeclined, MoveTutor_EventScript_DoubleEdgeTaught, FLAG_MOVE_TUTOR_TAUGHT_DOUBLE_EDGE
end
MoveTutor_EventScript_DoubleEdgeDeclined::
@@ -244,18 +147,7 @@ MoveTutor_EventScript_DoubleEdgeTaught::
PacifidlogTown_PokemonCenter_1F_EventScript_ExplosionTutor::
lock
faceplayer
goto_if_set FLAG_MOVE_TUTOR_TAUGHT_EXPLOSION, MoveTutor_EventScript_ExplosionTaught
msgbox MoveTutor_Text_ExplosionTeach, MSGBOX_YESNO
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_ExplosionDeclined
call MoveTutor_EventScript_CanOnlyBeLearnedOnce
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_ExplosionDeclined
msgbox MoveTutor_Text_ExplosionWhichMon, MSGBOX_DEFAULT
setvar VAR_ITEM_ID, MOVE_EXPLOSION
buffermovename STR_VAR_1, MOVE_EXPLOSION
call MoveTutor_EventScript_OpenBox
goto_if_eq VAR_RESULT, 4, MoveTutor_EventScript_ExplosionDeclined
setflag FLAG_MOVE_TUTOR_TAUGHT_EXPLOSION
goto MoveTutor_EventScript_ExplosionTaught
move_tutor MOVE_EXPLOSION, MoveTutor_Text_ExplosionTeach, MoveTutor_Text_ExplosionWhichMon, MoveTutor_EventScript_ExplosionDeclined, MoveTutor_EventScript_ExplosionTaught, FLAG_MOVE_TUTOR_TAUGHT_EXPLOSION
end
MoveTutor_EventScript_ExplosionDeclined::
@@ -276,66 +168,18 @@ MoveTutor_EventScript_OpenPartyMenu::
return
MoveTutor_EventScript_OpenBox::
fadescreen FADE_TO_BLACK
special ChooseBoxMon
waitstate
special IsSelectedMonEgg
goto_if_eq VAR_RESULT, TRUE, MoveTutor_EggCantForgetMoves
special CanTeachMoveBoxMon
goto_if_eq VAR_RESULT, 1, MoveTutor_CantLearnMove
goto_if_eq VAR_RESULT, 2, MoveTutor_AlreadyKnowsMove
goto_if_eq VAR_RESULT, 3, MoveTutor_EggCantForgetMoves
waitstate
return
MoveTutor_ForgetMove::
special MoveDeleterChooseMoveToForget
fadescreen FADE_FROM_BLACK
msgbox LilycoveCity_MoveDeletersHouse_Text_MonsMoveShouldBeForgotten, MSGBOX_YESNO
switch VAR_RESULT
case YES, LilycoveCity_MoveDeletersHouse_EventScript_TryForgetMove
case NO, LilycoveCity_MoveDeletersHouse_EventScript_ComeAgain
goto_if_eq VAR_0x8005, MAX_MON_MOVES, LilycoveCity_MoveDeletersHouse_EventScript_ChooseMonAndMoveToForget
special BufferMoveDeleterNicknameAndMove
msgbox LilycoveCity_MoveDeletersHouse_Text_MonsMoveShouldBeForgotten, MSGBOX_YESNO
switch VAR_RESULT
case YES, LilycoveCity_MoveDeletersHouse_EventScript_TryForgetMove
case NO, LilycoveCity_MoveDeletersHouse_EventScript_ComeAgain
MoveTutor_MoveDeletersHouse_EventScript_TryForgetMove::
special MoveDeleterForgetMove
playfanfare MUS_MOVE_DELETED
waitfanfare
msgbox LilycoveCity_MoveDeletersHouse_Text_MonHasForgottenMove, MSGBOX_DEFAULT
chooseboxmon SELECT_PC_MON_MOVE_TUTOR
waitstate
lock
faceplayer
return
MoveTutor_EggCantForgetMoves::
msgbox LilycoveCity_MoveDeletersHouse_Text_EggCantForgetMoves, MSGBOX_DEFAULT
releaseall
end
MoveTutor_CantLearnMove::
msgbox MoveTutor_Text_CantLearnMove, MSGBOX_DEFAULT
releaseall
end
MoveTutor_AlreadyKnowsMove::
msgbox MoveTutor_Text_AlreadyKnowsMove, MSGBOX_DEFAULT
releaseall
end
MoveTutor_Text_CantLearnMove:
.string "But that Pokemon can't learn\n"
.string "{STR_VAR_1}.$"
MoveTutor_Text_AlreadyKnowsMove:
.string "But that Pokemon already knows\n"
.string "{STR_VAR_1}.$"
MoveTutor_EventScript_CanOnlyBeLearnedOnce::
msgbox MoveTutor_Text_ThisMoveCanOnlyBeLearnedOnce, MSGBOX_YESNO
return
MoveTutor_AfterChooseBoxMon::
waitstate
special CanTeachMoveBoxMon
waitstate
return

View File

@@ -7,7 +7,8 @@ Common_EventScript_GetGiftMonPartySlot::
Common_EventScript_NameReceivedBoxMon::
fadescreen FADE_TO_BLACK
special ChangeBoxPokemonNickname
setvar VAR_0x8004, PC_MON_CHOSEN
special ChangePokemonNickname
waitstate
lock
faceplayer