Fixed battle frontier tutors (for real this time)

This commit is contained in:
crater-git 2022-08-27 22:45:10 -04:00
parent f8fb4e8cf2
commit 9f16d1dd12
3 changed files with 41 additions and 69 deletions

View File

@ -66,52 +66,62 @@ BattleFrontier_Lounge7_EventScript_ChooseNewLeftTutorMove::
end end
BattleFrontier_Lounge7_EventScript_Softboiled:: BattleFrontier_Lounge7_EventScript_Softboiled::
setvar VAR_0x8008, MOVE_SOFT_BOILED setvar VAR_0x8008, 16
setvar VAR_0x8005, MOVE_SOFT_BOILED
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end end
BattleFrontier_Lounge7_EventScript_SeismicToss:: BattleFrontier_Lounge7_EventScript_SeismicToss::
setvar VAR_0x8008, MOVE_SEISMIC_TOSS setvar VAR_0x8008, 24
setvar VAR_0x8005, MOVE_SEISMIC_TOSS
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end end
BattleFrontier_Lounge7_EventScript_DreamEater:: BattleFrontier_Lounge7_EventScript_DreamEater::
setvar VAR_0x8008, MOVE_DREAM_EATER setvar VAR_0x8008, 24
setvar VAR_0x8005, MOVE_DREAM_EATER
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end end
BattleFrontier_Lounge7_EventScript_MegaPunch:: BattleFrontier_Lounge7_EventScript_MegaPunch::
setvar VAR_0x8008, MOVE_MEGA_PUNCH setvar VAR_0x8008, 24
setvar VAR_0x8005, MOVE_MEGA_PUNCH
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end end
BattleFrontier_Lounge7_EventScript_MegaKick:: BattleFrontier_Lounge7_EventScript_MegaKick::
setvar VAR_0x8008, MOVE_MEGA_KICK setvar VAR_0x8008, 48
setvar VAR_0x8005, MOVE_MEGA_KICK
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end end
BattleFrontier_Lounge7_EventScript_BodySlam:: BattleFrontier_Lounge7_EventScript_BodySlam::
setvar VAR_0x8008, MOVE_BODY_SLAM setvar VAR_0x8008, 48
setvar VAR_0x8005, MOVE_BODY_SLAM
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end end
BattleFrontier_Lounge7_EventScript_RockSlide:: BattleFrontier_Lounge7_EventScript_RockSlide::
setvar VAR_0x8008, MOVE_ROCK_SLIDE setvar VAR_0x8008, 48
setvar VAR_0x8005, MOVE_ROCK_SLIDE
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end end
BattleFrontier_Lounge7_EventScript_Counter:: BattleFrontier_Lounge7_EventScript_Counter::
setvar VAR_0x8008, MOVE_COUNTER setvar VAR_0x8008, 48
setvar VAR_0x8005, MOVE_COUNTER
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end end
BattleFrontier_Lounge7_EventScript_ThunderWave:: BattleFrontier_Lounge7_EventScript_ThunderWave::
setvar VAR_0x8008, MOVE_THUNDER_WAVE setvar VAR_0x8008, 48
setvar VAR_0x8005, MOVE_THUNDER_WAVE
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end end
BattleFrontier_Lounge7_EventScript_SwordsDance:: BattleFrontier_Lounge7_EventScript_SwordsDance::
setvar VAR_0x8008, MOVE_SWORDS_DANCE setvar VAR_0x8008, 48
setvar VAR_0x8005, MOVE_SWORDS_DANCE
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end end
@ -135,7 +145,6 @@ BattleFrontier_Lounge7_EventScript_ChooseRightTutorMove::
waitmessage waitmessage
special ShowBattlePointsWindow special ShowBattlePointsWindow
setvar VAR_TEMP_E, 1 setvar VAR_TEMP_E, 1
setvar VAR_0x8004, SCROLL_MULTI_BF_MOVE_TUTOR_2
setvar VAR_0x8006, 0 setvar VAR_0x8006, 0
special ShowScrollableMultichoice special ShowScrollableMultichoice
waitstate waitstate
@ -159,7 +168,6 @@ BattleFrontier_Lounge7_EventScript_ChooseNewRightTutorMove::
message BattleFrontier_Lounge7_Text_TeachWhichMove message BattleFrontier_Lounge7_Text_TeachWhichMove
waitmessage waitmessage
setvar VAR_TEMP_E, 1 setvar VAR_TEMP_E, 1
setvar VAR_0x8004, SCROLL_MULTI_BF_MOVE_TUTOR_2
setvar VAR_0x8006, 1 setvar VAR_0x8006, 1
special ShowScrollableMultichoice special ShowScrollableMultichoice
waitstate waitstate
@ -180,52 +188,62 @@ BattleFrontier_Lounge7_EventScript_ChooseNewRightTutorMove::
end end
BattleFrontier_Lounge7_EventScript_DefenseCurl:: BattleFrontier_Lounge7_EventScript_DefenseCurl::
setvar VAR_0x8008, MOVE_DEFENSE_CURL setvar VAR_0x8008, 16
setvar VAR_0x8005, MOVE_DEFENSE_CURL
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end end
BattleFrontier_Lounge7_EventScript_Snore:: BattleFrontier_Lounge7_EventScript_Snore::
setvar VAR_0x8008, MOVE_SNORE setvar VAR_0x8008, 24
setvar VAR_0x8005, MOVE_SNORE
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end end
BattleFrontier_Lounge7_EventScript_MudSlap:: BattleFrontier_Lounge7_EventScript_MudSlap::
setvar VAR_0x8008, MOVE_MUD_SLAP setvar VAR_0x8008, 24
setvar VAR_0x8005, MOVE_MUD_SLAP
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end end
BattleFrontier_Lounge7_EventScript_Swift:: BattleFrontier_Lounge7_EventScript_Swift::
setvar VAR_0x8008, MOVE_SWIFT setvar VAR_0x8008, 24
setvar VAR_0x8005, MOVE_SWIFT
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end end
BattleFrontier_Lounge7_EventScript_IcyWind:: BattleFrontier_Lounge7_EventScript_IcyWind::
setvar VAR_0x8008, MOVE_ICY_WIND setvar VAR_0x8008, 24
setvar VAR_0x8005, MOVE_ICY_WIND
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end end
BattleFrontier_Lounge7_EventScript_Endure:: BattleFrontier_Lounge7_EventScript_Endure::
setvar VAR_0x8008, MOVE_ENDURE setvar VAR_0x8008, 48
setvar VAR_0x8005, MOVE_ENDURE
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end end
BattleFrontier_Lounge7_EventScript_PsychUp:: BattleFrontier_Lounge7_EventScript_PsychUp::
setvar VAR_0x8008, MOVE_PSYCH_UP setvar VAR_0x8008, 48
setvar VAR_0x8005, MOVE_PSYCH_UP
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end end
BattleFrontier_Lounge7_EventScript_IcePunch:: BattleFrontier_Lounge7_EventScript_IcePunch::
setvar VAR_0x8008, MOVE_ICE_PUNCH setvar VAR_0x8008, 48
setvar VAR_0x8005, MOVE_ICE_PUNCH
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end end
BattleFrontier_Lounge7_EventScript_ThunderPunch:: BattleFrontier_Lounge7_EventScript_ThunderPunch::
setvar VAR_0x8008, MOVE_THUNDER_PUNCH setvar VAR_0x8008, 48
setvar VAR_0x8005, MOVE_THUNDER_PUNCH
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end end
BattleFrontier_Lounge7_EventScript_FirePunch:: BattleFrontier_Lounge7_EventScript_FirePunch::
setvar VAR_0x8008, MOVE_FIRE_PUNCH setvar VAR_0x8008, 48
setvar VAR_0x8005, MOVE_FIRE_PUNCH
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end end
@ -246,11 +264,8 @@ BattleFrontier_Lounge7_EventScript_CancelChooseMon::
@ VAR_TEMP_D is the move selection @ VAR_TEMP_D is the move selection
@ VAR_TEMP_E is which move tutor was spoken to @ VAR_TEMP_E is which move tutor was spoken to
BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection:: BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection::
copyvar VAR_0x8004, VAR_TEMP_D
copyvar VAR_0x8005, VAR_TEMP_E
special BufferBattleFrontierTutorMoveName special BufferBattleFrontierTutorMoveName
buffernumberstring STR_VAR_2, VAR_0x8008 buffernumberstring STR_VAR_2, VAR_0x8008
copyvar VAR_0x8004, VAR_TEMP_C
msgbox BattleFrontier_Lounge7_Text_MoveWillBeXBattlePoints, MSGBOX_YESNO msgbox BattleFrontier_Lounge7_Text_MoveWillBeXBattlePoints, MSGBOX_YESNO
goto_if_eq VAR_RESULT, NO, BattleFrontier_Lounge7_EventScript_ChooseNewMove goto_if_eq VAR_RESULT, NO, BattleFrontier_Lounge7_EventScript_ChooseNewMove
specialvar VAR_TEMP_1, GetFrontierBattlePoints specialvar VAR_TEMP_1, GetFrontierBattlePoints
@ -261,7 +276,6 @@ BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection::
BattleFrontier_Lounge7_EventScript_TeachTutorMove:: BattleFrontier_Lounge7_EventScript_TeachTutorMove::
msgbox BattleFrontier_Lounge7_Text_TeachMoveToWhichMon, MSGBOX_DEFAULT msgbox BattleFrontier_Lounge7_Text_TeachMoveToWhichMon, MSGBOX_DEFAULT
special GetBattleFrontierTutorMoveIndex
fadescreen FADE_TO_BLACK fadescreen FADE_TO_BLACK
special CloseBattlePointsWindow special CloseBattlePointsWindow
special CloseBattleFrontierTutorWindow special CloseBattleFrontierTutorWindow

View File

@ -486,7 +486,6 @@ gSpecials::
def_special CloseBattleFrontierTutorWindow def_special CloseBattleFrontierTutorWindow
def_special ScrollableMultichoice_RedrawPersistentMenu def_special ScrollableMultichoice_RedrawPersistentMenu
def_special ChooseMonForMoveTutor def_special ChooseMonForMoveTutor
def_special GetBattleFrontierTutorMoveIndex
def_special ScrollableMultichoice_ClosePersistentMenu def_special ScrollableMultichoice_ClosePersistentMenu
def_special DoDeoxysRockInteraction def_special DoDeoxysRockInteraction
def_special SetDeoxysRockPalette def_special SetDeoxysRockPalette

View File

@ -2988,10 +2988,7 @@ static void HideFrontierExchangeCornerItemIcon(u16 menu, u16 unused)
void BufferBattleFrontierTutorMoveName(void) void BufferBattleFrontierTutorMoveName(void)
{ {
if (gSpecialVar_0x8005 != 0) StringCopy(gStringVar1, gMoveNames[gSpecialVar_0x8005]);
StringCopy(gStringVar1, gMoveNames[gSpecialVar_0x8004]);
else
StringCopy(gStringVar1, gMoveNames[gSpecialVar_0x8004]);
} }
static void ShowBattleFrontierTutorWindow(u8 menu, u16 selection) static void ShowBattleFrontierTutorWindow(u8 menu, u16 selection)
@ -3087,44 +3084,6 @@ void ScrollableMultichoice_RedrawPersistentMenu(void)
} }
} }
void GetBattleFrontierTutorMoveIndex(void)
{
u8 i;
u16 moveTutor = 0;
u16 moveIndex = 0;
gSpecialVar_0x8005 = 0;
moveTutor = VarGet(VAR_TEMP_E);
moveIndex = VarGet(VAR_TEMP_D);
if (moveTutor != 0)
{
i = 0;
do
{
if (i == moveIndex)
{
gSpecialVar_0x8005 = i;
break;
}
i++;
} while (i < MOVES_COUNT);
}
else
{
i = 0;
do
{
if (i == moveIndex)
{
gSpecialVar_0x8005 = i;
break;
}
i++;
} while (i < MOVES_COUNT);
}
}
// Never called // Never called
// Close a scrollable multichoice that stays open after selection // Close a scrollable multichoice that stays open after selection
void ScrollableMultichoice_ClosePersistentMenu(void) void ScrollableMultichoice_ClosePersistentMenu(void)