Skip to content

Commit 4c0c80e

Browse files
committed
tick precise not required, take video, audio warn
1 parent 99baf65 commit 4c0c80e

8 files changed

Lines changed: 50 additions & 5 deletions

SerialPrograms/Source/PokemonFRLG/Programs/ShinyHunting/PokemonFRLG_GiftReset.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ GiftReset_Descriptor::GiftReset_Descriptor()
3030
Pokemon::STRING_POKEMON + " FRLG", "Gift Reset",
3131
"Programs/PokemonFRLG/GiftReset.html",
3232
"Soft reset for a shiny gift Pokemon.",
33-
ProgramControllerClass::StandardController_RequiresPrecision,
33+
ProgramControllerClass::StandardController_NoRestrictions,
3434
FeedbackType::REQUIRED,
3535
AllowCommandsWhenRunning::DISABLE_COMMANDS
3636
)
@@ -67,6 +67,7 @@ GiftReset::GiftReset()
6767
LockMode::LOCK_WHILE_RUNNING,
6868
Target::starters
6969
)
70+
, TAKE_VIDEO("<b>Take Video:</b><br>Record a video when the shiny is found.", LockMode::UNLOCK_WHILE_RUNNING, true)
7071
, GO_HOME_WHEN_DONE(true)
7172
, NOTIFICATION_SHINY(
7273
"Shiny found",
@@ -81,6 +82,7 @@ GiftReset::GiftReset()
8182
})
8283
{
8384
PA_ADD_OPTION(TARGET);
85+
PA_ADD_OPTION(TAKE_VIDEO);
8486
PA_ADD_OPTION(GO_HOME_WHEN_DONE);
8587
PA_ADD_OPTION(NOTIFICATIONS);
8688
}
@@ -373,6 +375,9 @@ void GiftReset::program(SingleSwitchProgramEnvironment& env, ProControllerContex
373375
screen,
374376
true
375377
);
378+
if (TAKE_VIDEO){
379+
pbf_press_button(context, BUTTON_CAPTURE, 2000ms, 0ms);
380+
}
376381
break;
377382
}else{
378383
env.log("Pokemon is not shiny.");

SerialPrograms/Source/PokemonFRLG/Programs/ShinyHunting/PokemonFRLG_GiftReset.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#ifndef PokemonAutomation_PokemonFRLG_GiftReset_H
88
#define PokemonAutomation_PokemonFRLG_GiftReset_H
99

10+
#include "Common/Cpp/Options/BooleanCheckBoxOption.h"
1011
#include "CommonFramework/Notifications/EventNotificationsTable.h"
1112
#include "NintendoSwitch/NintendoSwitch_SingleSwitchProgram.h"
1213
#include "NintendoSwitch/Options/NintendoSwitch_GoHomeWhenDoneOption.h"
@@ -47,6 +48,8 @@ class GiftReset : public SingleSwitchProgramInstance{
4748
};
4849
EnumDropdownOption<Target> TARGET;
4950

51+
BooleanCheckBoxOption TAKE_VIDEO;
52+
5053
GoHomeWhenDoneOption GO_HOME_WHEN_DONE;
5154

5255
EventNotificationOption NOTIFICATION_SHINY;

SerialPrograms/Source/PokemonFRLG/Programs/ShinyHunting/PokemonFRLG_LegendaryReset.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ LegendaryReset_Descriptor::LegendaryReset_Descriptor()
2929
Pokemon::STRING_POKEMON + " FRLG", "Legendary Reset",
3030
"Programs/PokemonFRLG/LegendaryReset.html",
3131
"Shiny hunt legendary Pokemon using soft resets.",
32-
ProgramControllerClass::StandardController_RequiresPrecision,
32+
ProgramControllerClass::StandardController_NoRestrictions,
3333
FeedbackType::REQUIRED,
3434
AllowCommandsWhenRunning::DISABLE_COMMANDS
3535
)
@@ -59,6 +59,7 @@ LegendaryReset::LegendaryReset()
5959
LockMode::LOCK_WHILE_RUNNING,
6060
false
6161
)
62+
, TAKE_VIDEO("<b>Take Video:</b><br>Record a video when the shiny is found.", LockMode::UNLOCK_WHILE_RUNNING, true)
6263
, GO_HOME_WHEN_DONE(true)
6364
, NOTIFICATION_SHINY(
6465
"Shiny found",
@@ -72,7 +73,9 @@ LegendaryReset::LegendaryReset()
7273
&NOTIFICATION_PROGRAM_FINISH,
7374
})
7475
{
76+
PA_ADD_STATIC(SHINY_REQUIRES_AUDIO);
7577
PA_ADD_OPTION(WALK_UP);
78+
PA_ADD_OPTION(TAKE_VIDEO);
7679
PA_ADD_OPTION(GO_HOME_WHEN_DONE);
7780
PA_ADD_OPTION(NOTIFICATIONS);
7881
}
@@ -140,6 +143,9 @@ void LegendaryReset::program(SingleSwitchProgramEnvironment& env, ProControllerC
140143
env.console.video().snapshot(),
141144
true
142145
);
146+
if (TAKE_VIDEO){
147+
pbf_press_button(context, BUTTON_CAPTURE, 2000ms, 0ms);
148+
}
143149
break;
144150
}
145151

SerialPrograms/Source/PokemonFRLG/Programs/ShinyHunting/PokemonFRLG_LegendaryReset.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
#include "NintendoSwitch/Options/NintendoSwitch_GoHomeWhenDoneOption.h"
1313
#include "Common/Cpp/Options/EnumDropdownOption.h"
1414
#include "Common/Cpp/Options/SimpleIntegerOption.h"
15+
#include "Common/Cpp/Options/BooleanCheckBoxOption.h"
16+
#include "PokemonLA/Options/PokemonLA_ShinyDetectedAction.h"
1517

1618
namespace PokemonAutomation{
1719
namespace NintendoSwitch{
@@ -35,7 +37,10 @@ class LegendaryReset : public SingleSwitchProgramInstance{
3537
) override{}
3638

3739
private:
40+
PokemonLA::ShinyRequiresAudioText SHINY_REQUIRES_AUDIO;
41+
3842
BooleanCheckBoxOption WALK_UP;
43+
BooleanCheckBoxOption TAKE_VIDEO;
3944

4045
GoHomeWhenDoneOption GO_HOME_WHEN_DONE;
4146

SerialPrograms/Source/PokemonFRLG/Programs/ShinyHunting/PokemonFRLG_LegendaryRunAway.cpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ LegendaryRunAway_Descriptor::LegendaryRunAway_Descriptor()
3030
Pokemon::STRING_POKEMON + " FRLG", "Legendary Run Away",
3131
"Programs/PokemonFRLG/LegendaryRunAway.html",
3232
"Shiny hunt legendary Pokemon using the run away method.",
33-
ProgramControllerClass::StandardController_RequiresPrecision,
33+
ProgramControllerClass::StandardController_NoRestrictions,
3434
FeedbackType::REQUIRED,
3535
AllowCommandsWhenRunning::DISABLE_COMMANDS
3636
)
@@ -64,6 +64,7 @@ LegendaryRunAway::LegendaryRunAway()
6464
LockMode::LOCK_WHILE_RUNNING,
6565
Target::hooh
6666
)
67+
, TAKE_VIDEO("<b>Take Video:</b><br>Record a video when the shiny is found.", LockMode::UNLOCK_WHILE_RUNNING, true)
6768
, GO_HOME_WHEN_DONE(true)
6869
, NOTIFICATION_SHINY(
6970
"Shiny found",
@@ -100,7 +101,9 @@ LegendaryRunAway::LegendaryRunAway()
100101
"550 ms"
101102
)
102103
{
104+
PA_ADD_STATIC(SHINY_REQUIRES_AUDIO);
103105
PA_ADD_OPTION(TARGET);
106+
PA_ADD_OPTION(TAKE_VIDEO);
104107
PA_ADD_OPTION(GO_HOME_WHEN_DONE);
105108
PA_ADD_OPTION(NOTIFICATIONS);
106109
PA_ADD_STATIC(m_advanced_options);
@@ -266,7 +269,17 @@ void LegendaryRunAway::program(SingleSwitchProgramEnvironment& env, ProControlle
266269
if (legendary_shiny){
267270
stats.shinies++;
268271
env.update_stats();
269-
send_program_notification(env, NOTIFICATION_SHINY, COLOR_YELLOW, "Shiny found!", {}, "", env.console.video().snapshot(), true);
272+
send_program_notification(env,
273+
NOTIFICATION_SHINY,
274+
COLOR_YELLOW,
275+
"Shiny found!",
276+
{}, "",
277+
env.console.video().snapshot(),
278+
true
279+
);
280+
if (TAKE_VIDEO){
281+
pbf_press_button(context, BUTTON_CAPTURE, 2000ms, 0ms);
282+
}
270283
break;
271284
}
272285
env.log("No shiny found.");

SerialPrograms/Source/PokemonFRLG/Programs/ShinyHunting/PokemonFRLG_LegendaryRunAway.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
#include "Common/Cpp/Options/EnumDropdownOption.h"
1515
#include "Common/Cpp/Options/SimpleIntegerOption.h"
1616
#include "Common/Cpp/Options/TimeDurationOption.h"
17+
#include "Common/Cpp/Options/BooleanCheckBoxOption.h"
18+
#include "PokemonLA/Options/PokemonLA_ShinyDetectedAction.h"
1719

1820
namespace PokemonAutomation{
1921
namespace NintendoSwitch{
@@ -46,6 +48,9 @@ class LegendaryRunAway : public SingleSwitchProgramInstance{
4648
void reset_hooh(SingleSwitchProgramEnvironment& env, ProControllerContext& context);
4749
void reset_lugia(SingleSwitchProgramEnvironment& env, ProControllerContext& context);
4850

51+
PokemonLA::ShinyRequiresAudioText SHINY_REQUIRES_AUDIO;
52+
BooleanCheckBoxOption TAKE_VIDEO;
53+
4954
GoHomeWhenDoneOption GO_HOME_WHEN_DONE;
5055

5156
EventNotificationOption NOTIFICATION_SHINY;

SerialPrograms/Source/PokemonFRLG/Programs/ShinyHunting/PokemonFRLG_PrizeCornerReset.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ PrizeCornerReset_Descriptor::PrizeCornerReset_Descriptor()
3131
Pokemon::STRING_POKEMON + " FRLG", "Prize Corner Reset",
3232
"Programs/PokemonFRLG/PrizeCornerReset.html",
3333
"Redeem and soft reset for a shiny Game Corner prize.",
34-
ProgramControllerClass::StandardController_RequiresPrecision,
34+
ProgramControllerClass::StandardController_NoRestrictions,
3535
FeedbackType::REQUIRED,
3636
AllowCommandsWhenRunning::DISABLE_COMMANDS
3737
)
@@ -68,6 +68,7 @@ PrizeCornerReset::PrizeCornerReset()
6868
LockMode::LOCK_WHILE_RUNNING,
6969
0
7070
)
71+
, TAKE_VIDEO("<b>Take Video:</b><br>Record a video when the shiny is found.", LockMode::UNLOCK_WHILE_RUNNING, true)
7172
, GO_HOME_WHEN_DONE(true)
7273
, NOTIFICATION_SHINY(
7374
"Shiny found",
@@ -82,6 +83,7 @@ PrizeCornerReset::PrizeCornerReset()
8283
})
8384
{
8485
PA_ADD_OPTION(SLOT);
86+
PA_ADD_OPTION(TAKE_VIDEO);
8587
PA_ADD_OPTION(GO_HOME_WHEN_DONE);
8688
PA_ADD_OPTION(NOTIFICATIONS);
8789
}
@@ -167,6 +169,9 @@ void PrizeCornerReset::program(SingleSwitchProgramEnvironment& env, ProControlle
167169
screen,
168170
true
169171
);
172+
if (TAKE_VIDEO){
173+
pbf_press_button(context, BUTTON_CAPTURE, 2000ms, 0ms);
174+
}
170175
break;
171176
}else{
172177
env.log("Prize is not shiny.");

SerialPrograms/Source/PokemonFRLG/Programs/ShinyHunting/PokemonFRLG_PrizeCornerReset.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "NintendoSwitch/Options/NintendoSwitch_GoHomeWhenDoneOption.h"
1313
#include "Common/Cpp/Options/EnumDropdownOption.h"
1414
#include "Common/Cpp/Options/SimpleIntegerOption.h"
15+
#include "Common/Cpp/Options/BooleanCheckBoxOption.h"
1516

1617
namespace PokemonAutomation{
1718
namespace NintendoSwitch{
@@ -39,6 +40,8 @@ class PrizeCornerReset : public SingleSwitchProgramInstance{
3940

4041
IntegerEnumDropdownOption SLOT;
4142

43+
BooleanCheckBoxOption TAKE_VIDEO;
44+
4245
GoHomeWhenDoneOption GO_HOME_WHEN_DONE;
4346

4447
EventNotificationOption NOTIFICATION_SHINY;

0 commit comments

Comments
 (0)