Skip to content

Commit 0d628c1

Browse files
committed
Check for Next Pokemon prompt when battling Nemona at Mesagoza gate
1 parent 3798214 commit 0d628c1

File tree

6 files changed

+14
-13
lines changed

6 files changed

+14
-13
lines changed

SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStoryTools.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ void run_battle_press_A(
6262

6363
std::vector<PeriodicInferenceCallback> callbacks;
6464
// mandatory callbacks: Battle, Overworld, Advance Dialog, Swap menu, Move select
65+
// optional callbacks: ADVANCE_DIALOG, DIALOG_ARROW, NEXT_POKEMON
6566
std::vector<CallbackEnum> enum_all_callbacks{CallbackEnum::BATTLE, CallbackEnum::OVERWORLD, CallbackEnum::ADVANCE_DIALOG, CallbackEnum::SWAP_MENU, CallbackEnum::MOVE_SELECT}; // mandatory callbacks
6667
enum_all_callbacks.insert(enum_all_callbacks.end(), enum_optional_callbacks.begin(), enum_optional_callbacks.end()); // append the mandatory and optional callback vectors together
6768
for (const CallbackEnum& enum_callback : enum_all_callbacks){
@@ -78,10 +79,10 @@ void run_battle_press_A(
7879
case CallbackEnum::BATTLE:
7980
callbacks.emplace_back(battle);
8081
break;
81-
case CallbackEnum::GRADIENT_ARROW:
82+
case CallbackEnum::NEXT_POKEMON: // to detect the "next pokemon" prompt.
8283
callbacks.emplace_back(next_pokemon);
8384
break;
84-
case CallbackEnum::SWAP_MENU:
85+
case CallbackEnum::SWAP_MENU: // detecting Swap Menu implies your lead fainted.
8586
callbacks.emplace_back(fainted);
8687
break;
8788
case CallbackEnum::MOVE_SELECT:
@@ -159,7 +160,7 @@ void run_battle_press_A(
159160
stream.log("run_battle_press_A: Detected dialog arrow.");
160161
pbf_press_button(context, BUTTON_A, 20, 105);
161162
break;
162-
case CallbackEnum::GRADIENT_ARROW:
163+
case CallbackEnum::NEXT_POKEMON:
163164
stream.log("run_battle_press_A: Detected prompt for bringing in next pokemon. Keep current pokemon.");
164165
pbf_mash_button(context, BUTTON_B, 100);
165166
break;

SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStoryTools.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ enum class CallbackEnum{
5858
BATTLE,
5959
TUTORIAL,
6060
BLACK_DIALOG_BOX,
61-
GRADIENT_ARROW,
61+
NEXT_POKEMON,
6262
SWAP_MENU,
6363
MOVE_SELECT,
6464
};
@@ -118,7 +118,7 @@ class AutoStory_Segment {
118118
};
119119

120120
// spam A button to choose the first move
121-
// throw exception if wipeout.
121+
// throw exception if wipeout or if your lead faints.
122122
void run_battle_press_A(
123123
VideoStream& stream,
124124
ProControllerContext& context,

SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_08.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void checkpoint_13(
9393

9494
env.console.log("run_battle_press_A: Battle with Nemona at Mesagoza gate. Stop when detect dialog.");
9595
// story continues even if you lose
96-
run_battle_press_A(env.console, context, BattleStopCondition::STOP_DIALOG);
96+
run_battle_press_A(env.console, context, BattleStopCondition::STOP_DIALOG, {CallbackEnum::NEXT_POKEMON});
9797

9898
env.console.log("clear_dialog: Talk with Nemona within Mesagoza. Stop when detect overworld.");
9999
clear_dialog(env.console, context, ClearDialogMode::STOP_OVERWORLD, 60,
@@ -147,14 +147,14 @@ void checkpoint_14(
147147
clear_dialog(env.console, context, ClearDialogMode::STOP_BATTLE, 60, {CallbackEnum::PROMPT_DIALOG, CallbackEnum::BATTLE, CallbackEnum::DIALOG_ARROW});
148148
// run battle until dialog
149149
env.console.log("run_battle_press_A: Battle with Team Star grunt 1. Stop when detect dialog.");
150-
run_battle_press_A(env.console, context, BattleStopCondition::STOP_DIALOG, {}, true);
150+
run_battle_press_A(env.console, context, BattleStopCondition::STOP_DIALOG, {}, true); // enemy only has 1 Pokemon, so no need to detect "Next Pokemon" prompt
151151
// clear dialog until battle, with prompt, white button, tutorial, battle
152152
env.console.log("clear_dialog: Talk with Team Star and Nemona. Receive Tera orb. Stop when detect battle.");
153153
clear_dialog(env.console, context, ClearDialogMode::STOP_BATTLE, 60,
154154
{CallbackEnum::PROMPT_DIALOG, CallbackEnum::WHITE_A_BUTTON, CallbackEnum::TUTORIAL, CallbackEnum::BATTLE, CallbackEnum::DIALOG_ARROW});
155155
// run battle until dialog
156156
env.console.log("run_battle_press_A: Battle with Team Star grunt 2. Stop when detect dialog.");
157-
run_battle_press_A(env.console, context, BattleStopCondition::STOP_DIALOG, {}, true);
157+
run_battle_press_A(env.console, context, BattleStopCondition::STOP_DIALOG, {}, true); // enemy only has 1 Pokemon, so no need to detect "Next Pokemon" prompt
158158
// clear dialog until overworld
159159
clear_dialog(env.console, context, ClearDialogMode::STOP_OVERWORLD, 60, {CallbackEnum::OVERWORLD});
160160

SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_12.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ void checkpoint_28(
120120
clear_dialog(env.console, context, ClearDialogMode::STOP_BATTLE, 60, {CallbackEnum::BATTLE, CallbackEnum::PROMPT_DIALOG, CallbackEnum::DIALOG_ARROW});
121121

122122
// battle Katy
123-
run_battle_press_A(env.console, context, BattleStopCondition::STOP_DIALOG, {CallbackEnum::GRADIENT_ARROW}, true);
123+
run_battle_press_A(env.console, context, BattleStopCondition::STOP_DIALOG, {CallbackEnum::NEXT_POKEMON}, true);
124124
mash_button_till_overworld(env.console, context, BUTTON_A, 360);
125125

126126
// leave gym building

SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_17.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ void checkpoint_37(
9898
walk_forward_until_dialog(env.program_info(), env.console, context, NavigationMovementMode::DIRECTIONAL_ONLY, 20);
9999

100100
clear_dialog(env.console, context, ClearDialogMode::STOP_BATTLE, 60, {CallbackEnum::BATTLE, CallbackEnum::PROMPT_DIALOG, CallbackEnum::DIALOG_ARROW});
101-
run_battle_press_A(env.console, context, BattleStopCondition::STOP_DIALOG, {CallbackEnum::GRADIENT_ARROW});
101+
run_battle_press_A(env.console, context, BattleStopCondition::STOP_DIALOG, {CallbackEnum::NEXT_POKEMON});
102102
mash_button_till_overworld(env.console, context, BUTTON_A, 360);
103103

104104

@@ -170,7 +170,7 @@ void checkpoint_38(
170170
// talk to reception. Battle Kofu
171171
walk_forward_until_dialog(env.program_info(), env.console, context, NavigationMovementMode::DIRECTIONAL_SPAM_A, 10);
172172
clear_dialog(env.console, context, ClearDialogMode::STOP_BATTLE, 60, {CallbackEnum::BATTLE, CallbackEnum::PROMPT_DIALOG, CallbackEnum::DIALOG_ARROW});
173-
run_battle_press_A(env.console, context, BattleStopCondition::STOP_DIALOG, {CallbackEnum::GRADIENT_ARROW}, true);
173+
run_battle_press_A(env.console, context, BattleStopCondition::STOP_DIALOG, {CallbackEnum::NEXT_POKEMON}, true);
174174
mash_button_till_overworld(env.console, context, BUTTON_A, 360);
175175

176176
break;

SerialPrograms/Source/PokemonSV/Programs/AutoStory/PokemonSV_AutoStory_Segment_20.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ void checkpoint_43(
126126

127127
// enter gym building. talk go Nemona and battle her.
128128
clear_dialog(env.console, context, ClearDialogMode::STOP_BATTLE, 60, {CallbackEnum::BLACK_DIALOG_BOX, CallbackEnum::PROMPT_DIALOG, CallbackEnum::DIALOG_ARROW, CallbackEnum::BATTLE});
129-
run_battle_press_A(env.console, context, BattleStopCondition::STOP_DIALOG, {CallbackEnum::GRADIENT_ARROW});
129+
run_battle_press_A(env.console, context, BattleStopCondition::STOP_DIALOG, {CallbackEnum::NEXT_POKEMON});
130130
mash_button_till_overworld(env.console, context, BUTTON_A);
131131

132132

@@ -536,7 +536,7 @@ void checkpoint_45(
536536
);
537537

538538
clear_dialog(env.console, context, ClearDialogMode::STOP_BATTLE, 60, {CallbackEnum::PROMPT_DIALOG, CallbackEnum::BATTLE, CallbackEnum::DIALOG_ARROW});
539-
run_battle_press_A(env.console, context, BattleStopCondition::STOP_DIALOG, {CallbackEnum::GRADIENT_ARROW});
539+
run_battle_press_A(env.console, context, BattleStopCondition::STOP_DIALOG, {CallbackEnum::NEXT_POKEMON});
540540
mash_button_till_overworld(env.console, context, BUTTON_A);
541541

542542
break;

0 commit comments

Comments
 (0)