Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reworked TMHM into expandable list format #2233

Merged
merged 10 commits into from
Aug 29, 2022
26 changes: 20 additions & 6 deletions data/maps/BattleFrontier_Lounge7/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -67,51 +67,61 @@ BattleFrontier_Lounge7_EventScript_ChooseNewLeftTutorMove::

BattleFrontier_Lounge7_EventScript_Softboiled::
setvar VAR_0x8008, 16
setvar VAR_0x8005, MOVE_SOFT_BOILED
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end

BattleFrontier_Lounge7_EventScript_SeismicToss::
setvar VAR_0x8008, 24
setvar VAR_0x8005, MOVE_SEISMIC_TOSS
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end

BattleFrontier_Lounge7_EventScript_DreamEater::
setvar VAR_0x8008, 24
setvar VAR_0x8005, MOVE_DREAM_EATER
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end

BattleFrontier_Lounge7_EventScript_MegaPunch::
setvar VAR_0x8008, 24
setvar VAR_0x8005, MOVE_MEGA_PUNCH
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end

BattleFrontier_Lounge7_EventScript_MegaKick::
setvar VAR_0x8008, 48
setvar VAR_0x8005, MOVE_MEGA_KICK
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end

BattleFrontier_Lounge7_EventScript_BodySlam::
setvar VAR_0x8008, 48
setvar VAR_0x8005, MOVE_BODY_SLAM
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end

BattleFrontier_Lounge7_EventScript_RockSlide::
setvar VAR_0x8008, 48
setvar VAR_0x8005, MOVE_ROCK_SLIDE
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end

BattleFrontier_Lounge7_EventScript_Counter::
setvar VAR_0x8008, 48
setvar VAR_0x8005, MOVE_COUNTER
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end

BattleFrontier_Lounge7_EventScript_ThunderWave::
setvar VAR_0x8008, 48
setvar VAR_0x8005, MOVE_THUNDER_WAVE
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end

BattleFrontier_Lounge7_EventScript_SwordsDance::
setvar VAR_0x8008, 48
setvar VAR_0x8005, MOVE_SWORDS_DANCE
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end

Expand All @@ -135,7 +145,6 @@ BattleFrontier_Lounge7_EventScript_ChooseRightTutorMove::
waitmessage
special ShowBattlePointsWindow
setvar VAR_TEMP_E, 1
setvar VAR_0x8004, SCROLL_MULTI_BF_MOVE_TUTOR_2
setvar VAR_0x8006, 0
special ShowScrollableMultichoice
waitstate
Expand All @@ -159,7 +168,6 @@ BattleFrontier_Lounge7_EventScript_ChooseNewRightTutorMove::
message BattleFrontier_Lounge7_Text_TeachWhichMove
waitmessage
setvar VAR_TEMP_E, 1
setvar VAR_0x8004, SCROLL_MULTI_BF_MOVE_TUTOR_2
setvar VAR_0x8006, 1
special ShowScrollableMultichoice
waitstate
Expand All @@ -181,51 +189,61 @@ BattleFrontier_Lounge7_EventScript_ChooseNewRightTutorMove::

BattleFrontier_Lounge7_EventScript_DefenseCurl::
setvar VAR_0x8008, 16
setvar VAR_0x8005, MOVE_DEFENSE_CURL
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end

BattleFrontier_Lounge7_EventScript_Snore::
setvar VAR_0x8008, 24
setvar VAR_0x8005, MOVE_SNORE
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end

BattleFrontier_Lounge7_EventScript_MudSlap::
setvar VAR_0x8008, 24
setvar VAR_0x8005, MOVE_MUD_SLAP
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end

BattleFrontier_Lounge7_EventScript_Swift::
setvar VAR_0x8008, 24
setvar VAR_0x8005, MOVE_SWIFT
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end

BattleFrontier_Lounge7_EventScript_IcyWind::
setvar VAR_0x8008, 24
setvar VAR_0x8005, MOVE_ICY_WIND
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end

BattleFrontier_Lounge7_EventScript_Endure::
setvar VAR_0x8008, 48
setvar VAR_0x8005, MOVE_ENDURE
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end

BattleFrontier_Lounge7_EventScript_PsychUp::
setvar VAR_0x8008, 48
setvar VAR_0x8005, MOVE_PSYCH_UP
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end

BattleFrontier_Lounge7_EventScript_IcePunch::
setvar VAR_0x8008, 48
setvar VAR_0x8005, MOVE_ICE_PUNCH
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end

BattleFrontier_Lounge7_EventScript_ThunderPunch::
setvar VAR_0x8008, 48
setvar VAR_0x8005, MOVE_THUNDER_PUNCH
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end

BattleFrontier_Lounge7_EventScript_FirePunch::
setvar VAR_0x8008, 48
setvar VAR_0x8005, MOVE_FIRE_PUNCH
goto BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection
end

Expand All @@ -246,11 +264,8 @@ BattleFrontier_Lounge7_EventScript_CancelChooseMon::
@ VAR_TEMP_D is the move selection
@ VAR_TEMP_E is which move tutor was spoken to
BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection::
copyvar VAR_0x8004, VAR_TEMP_D
copyvar VAR_0x8005, VAR_TEMP_E
special BufferBattleFrontierTutorMoveName
buffernumberstring STR_VAR_2, VAR_0x8008
copyvar VAR_0x8004, VAR_TEMP_C
msgbox BattleFrontier_Lounge7_Text_MoveWillBeXBattlePoints, MSGBOX_YESNO
goto_if_eq VAR_RESULT, NO, BattleFrontier_Lounge7_EventScript_ChooseNewMove
specialvar VAR_TEMP_1, GetFrontierBattlePoints
Expand All @@ -261,7 +276,6 @@ BattleFrontier_Lounge7_EventScript_ConfirmMoveSelection::

BattleFrontier_Lounge7_EventScript_TeachTutorMove::
msgbox BattleFrontier_Lounge7_Text_TeachMoveToWhichMon, MSGBOX_DEFAULT
special GetBattleFrontierTutorMoveIndex
fadescreen FADE_TO_BLACK
special CloseBattlePointsWindow
special CloseBattleFrontierTutorWindow
Expand Down
20 changes: 10 additions & 10 deletions data/scripts/move_tutors.inc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SlateportCity_PokemonFanClub_EventScript_SwaggerTutor::
call MoveTutor_EventScript_CanOnlyBeLearnedOnce
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_SwaggerDeclined
msgbox MoveTutor_Text_SwaggerWhichMon, MSGBOX_DEFAULT
setvar VAR_0x8005, TUTOR_MOVE_SWAGGER
setvar VAR_0x8005, MOVE_SWAGGER
call MoveTutor_EventScript_OpenPartyMenu
goto_if_eq VAR_RESULT, 0, MoveTutor_EventScript_SwaggerDeclined
setflag FLAG_MOVE_TUTOR_TAUGHT_SWAGGER
Expand All @@ -33,7 +33,7 @@ MauvilleCity_EventScript_RolloutTutor::
call MoveTutor_EventScript_CanOnlyBeLearnedOnce
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_RolloutDeclined
msgbox MoveTutor_Text_RolloutWhichMon, MSGBOX_DEFAULT
setvar VAR_0x8005, TUTOR_MOVE_ROLLOUT
setvar VAR_0x8005, MOVE_ROLLOUT
call MoveTutor_EventScript_OpenPartyMenu
goto_if_eq VAR_RESULT, 0, MoveTutor_EventScript_RolloutDeclined
setflag FLAG_MOVE_TUTOR_TAUGHT_ROLLOUT
Expand All @@ -59,7 +59,7 @@ VerdanturfTown_PokemonCenter_1F_EventScript_FuryCutterTutor::
call MoveTutor_EventScript_CanOnlyBeLearnedOnce
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_FuryCutterDeclined
msgbox MoveTutor_Text_FuryCutterWhichMon, MSGBOX_DEFAULT
setvar VAR_0x8005, TUTOR_MOVE_FURY_CUTTER
setvar VAR_0x8005, MOVE_FURY_CUTTER
call MoveTutor_EventScript_OpenPartyMenu
goto_if_eq VAR_RESULT, 0, MoveTutor_EventScript_FuryCutterDeclined
setflag FLAG_MOVE_TUTOR_TAUGHT_FURY_CUTTER
Expand All @@ -85,7 +85,7 @@ LavaridgeTown_House_EventScript_MimicTutor::
call MoveTutor_EventScript_CanOnlyBeLearnedOnce
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_MimicDeclined
msgbox MoveTutor_Text_MimicWhichMon, MSGBOX_DEFAULT
setvar VAR_0x8005, TUTOR_MOVE_MIMIC
setvar VAR_0x8005, MOVE_MIMIC
call MoveTutor_EventScript_OpenPartyMenu
goto_if_eq VAR_RESULT, 0, MoveTutor_EventScript_MimicDeclined
setflag FLAG_MOVE_TUTOR_TAUGHT_MIMIC
Expand All @@ -111,7 +111,7 @@ FallarborTown_Mart_EventScript_MetronomeTutor::
call MoveTutor_EventScript_CanOnlyBeLearnedOnce
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_MetronomeDeclined
msgbox MoveTutor_Text_MetronomeWhichMon, MSGBOX_DEFAULT
setvar VAR_0x8005, TUTOR_MOVE_METRONOME
setvar VAR_0x8005, MOVE_METRONOME
call MoveTutor_EventScript_OpenPartyMenu
goto_if_eq VAR_RESULT, 0, MoveTutor_EventScript_MetronomeDeclined
setflag FLAG_MOVE_TUTOR_TAUGHT_METRONOME
Expand All @@ -137,7 +137,7 @@ FortreeCity_House2_EventScript_SleepTalkTutor::
call MoveTutor_EventScript_CanOnlyBeLearnedOnce
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_SleepTalkDeclined
msgbox MoveTutor_Text_SleepTalkWhichMon, MSGBOX_DEFAULT
setvar VAR_0x8005, TUTOR_MOVE_SLEEP_TALK
setvar VAR_0x8005, MOVE_SLEEP_TALK
call MoveTutor_EventScript_OpenPartyMenu
goto_if_eq VAR_RESULT, 0, MoveTutor_EventScript_SleepTalkDeclined
setflag FLAG_MOVE_TUTOR_TAUGHT_SLEEP_TALK
Expand All @@ -163,7 +163,7 @@ LilycoveCity_DepartmentStoreRooftop_EventScript_SubstituteTutor::
call MoveTutor_EventScript_CanOnlyBeLearnedOnce
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_SubstituteDeclined
msgbox MoveTutor_Text_SubstituteWhichMon, MSGBOX_DEFAULT
setvar VAR_0x8005, TUTOR_MOVE_SUBSTITUTE
setvar VAR_0x8005, MOVE_SUBSTITUTE
call MoveTutor_EventScript_OpenPartyMenu
goto_if_eq VAR_RESULT, 0, MoveTutor_EventScript_SubstituteDeclined
setflag FLAG_MOVE_TUTOR_TAUGHT_SUBSTITUTE
Expand All @@ -189,7 +189,7 @@ MossdeepCity_EventScript_DynamicPunchTutor::
call MoveTutor_EventScript_CanOnlyBeLearnedOnce
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_DynamicPunchDeclined
msgbox MoveTutor_Text_DynamicPunchWhichMon, MSGBOX_DEFAULT
setvar VAR_0x8005, TUTOR_MOVE_DYNAMIC_PUNCH
setvar VAR_0x8005, MOVE_DYNAMIC_PUNCH
call MoveTutor_EventScript_OpenPartyMenu
goto_if_eq VAR_RESULT, 0, MoveTutor_EventScript_DynamicPunchDeclined
setflag FLAG_MOVE_TUTOR_TAUGHT_DYNAMICPUNCH
Expand All @@ -215,7 +215,7 @@ SootopolisCity_PokemonCenter_1F_EventScript_DoubleEdgeTutor::
call MoveTutor_EventScript_CanOnlyBeLearnedOnce
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_DoubleEdgeDeclined
msgbox MoveTutor_Text_DoubleEdgeWhichMon, MSGBOX_DEFAULT
setvar VAR_0x8005, TUTOR_MOVE_DOUBLE_EDGE
setvar VAR_0x8005, MOVE_DOUBLE_EDGE
call MoveTutor_EventScript_OpenPartyMenu
goto_if_eq VAR_RESULT, 0, MoveTutor_EventScript_DoubleEdgeDeclined
setflag FLAG_MOVE_TUTOR_TAUGHT_DOUBLE_EDGE
Expand All @@ -241,7 +241,7 @@ PacifidlogTown_PokemonCenter_1F_EventScript_ExplosionTutor::
call MoveTutor_EventScript_CanOnlyBeLearnedOnce
goto_if_eq VAR_RESULT, NO, MoveTutor_EventScript_ExplosionDeclined
msgbox MoveTutor_Text_ExplosionWhichMon, MSGBOX_DEFAULT
setvar VAR_0x8005, TUTOR_MOVE_EXPLOSION
setvar VAR_0x8005, MOVE_EXPLOSION
call MoveTutor_EventScript_OpenPartyMenu
goto_if_eq VAR_RESULT, 0, MoveTutor_EventScript_ExplosionDeclined
setflag FLAG_MOVE_TUTOR_TAUGHT_EXPLOSION
Expand Down
1 change: 0 additions & 1 deletion data/specials.inc
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,6 @@ gSpecials::
def_special CloseBattleFrontierTutorWindow
def_special ScrollableMultichoice_RedrawPersistentMenu
def_special ChooseMonForMoveTutor
def_special GetBattleFrontierTutorMoveIndex
def_special ScrollableMultichoice_ClosePersistentMenu
def_special DoDeoxysRockInteraction
def_special SetDeoxysRockPalette
Expand Down
32 changes: 0 additions & 32 deletions include/constants/party_menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,6 @@
#define AILMENT_PKRS 6
#define AILMENT_FNT 7

#define TUTOR_MOVE_MEGA_PUNCH 0
#define TUTOR_MOVE_SWORDS_DANCE 1
#define TUTOR_MOVE_MEGA_KICK 2
#define TUTOR_MOVE_BODY_SLAM 3
#define TUTOR_MOVE_DOUBLE_EDGE 4
#define TUTOR_MOVE_COUNTER 5
#define TUTOR_MOVE_SEISMIC_TOSS 6
#define TUTOR_MOVE_MIMIC 7
#define TUTOR_MOVE_METRONOME 8
#define TUTOR_MOVE_SOFT_BOILED 9
#define TUTOR_MOVE_DREAM_EATER 10
#define TUTOR_MOVE_THUNDER_WAVE 11
#define TUTOR_MOVE_EXPLOSION 12
#define TUTOR_MOVE_ROCK_SLIDE 13
#define TUTOR_MOVE_SUBSTITUTE 14
#define TUTOR_MOVE_DYNAMIC_PUNCH 15
#define TUTOR_MOVE_ROLLOUT 16
#define TUTOR_MOVE_PSYCH_UP 17
#define TUTOR_MOVE_SNORE 18
#define TUTOR_MOVE_ICY_WIND 19
#define TUTOR_MOVE_ENDURE 20
#define TUTOR_MOVE_MUD_SLAP 21
#define TUTOR_MOVE_ICE_PUNCH 22
#define TUTOR_MOVE_SWAGGER 23
#define TUTOR_MOVE_SLEEP_TALK 24
#define TUTOR_MOVE_SWIFT 25
#define TUTOR_MOVE_DEFENSE_CURL 26
#define TUTOR_MOVE_THUNDER_PUNCH 27
#define TUTOR_MOVE_FIRE_PUNCH 28
#define TUTOR_MOVE_FURY_CUTTER 29
#define TUTOR_MOVE_COUNT 30

#define PARTY_LAYOUT_SINGLE 0
#define PARTY_LAYOUT_DOUBLE 1
#define PARTY_LAYOUT_MULTI 2
Expand Down
2 changes: 0 additions & 2 deletions include/party_menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ extern u8 gBattlePartyCurrentOrder[PARTY_SIZE / 2];

extern void (*gItemUseCB)(u8, TaskFunc);

extern const u16 gTutorMoves[];

void AnimatePartySlot(u8 slot, u8 animNum);
bool8 IsMultiBattle(void);
u8 GetCursorSelectionMonId(void);
Expand Down
4 changes: 2 additions & 2 deletions include/pokemon.h
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ extern const struct BaseStats gBaseStats[];
extern const u8 *const gItemEffectTable[];
extern const u32 gExperienceTables[][MAX_LEVEL + 1];
extern const struct LevelUpMove *const gLevelUpLearnsets[];
extern const u16 *const gTeachableLearnsets[];
extern const u8 gPPUpGetMask[];
extern const u8 gPPUpClearMask[];
extern const u8 gPPUpAddValues[];
Expand Down Expand Up @@ -509,8 +510,7 @@ u8 CheckPartyHasHadPokerus(struct Pokemon *party, u8 selection);
void UpdatePartyPokerusTime(u16 days);
void PartySpreadPokerus(struct Pokemon *party);
bool8 TryIncrementMonLevel(struct Pokemon *mon);
u32 CanMonLearnTMHM(struct Pokemon *mon, u8 tm);
u32 CanSpeciesLearnTMHM(u16 species, u8 tm);
u8 CanLearnTeachableMove(u16 species, u16 move);
u8 GetMoveRelearnerMoves(struct Pokemon *mon, u16 *moves);
u8 GetLevelUpMovesBySpecies(u16 species, u16 *moves);
u8 GetNumberOfRelearnableMoves(struct Pokemon *mon);
Expand Down
2 changes: 1 addition & 1 deletion src/apprentice.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ static u16 GetRandomAlternateMove(u8 monId)
do
{
id = Random() % (NUM_TECHNICAL_MACHINES + NUM_HIDDEN_MACHINES);
shouldUseMove = CanSpeciesLearnTMHM(species, id);
shouldUseMove = CanLearnTeachableMove(species, ItemIdToBattleMoveId(ITEM_TM01 + id));
}
while (!shouldUseMove);

Expand Down
Loading