Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,17 @@ void collect_togepi_egg_after_delay(ProControllerContext& context, const uint64_
context.wait_for_all_requests();
}

void collect_preapproved_togepi_egg_after_delay(ProControllerContext& context, const uint64_t& ingame_delay){
// wait with the start menu open to avoid overworld stuff causing extra advances
pbf_press_button(context, BUTTON_PLUS, 200ms, 300ms);
pbf_wait(context, std::chrono::milliseconds(ingame_delay - 5200)); // 4000ms + 500ms + 500ms + 200ms
pbf_press_button(context, BUTTON_B, 200ms, 300ms);
// accept egg
pbf_press_button(context, BUTTON_A, 200ms, 2800ms);
// exit dialogue
pbf_mash_button(context, BUTTON_B, 2500ms);
}

void trigger_held_daycare_egg_after_delay(ProControllerContext& context, const uint64_t& ingame_delay){
// No dialogue to advance through -- just wait
pbf_wait(context, std::chrono::milliseconds(ingame_delay - 4000));
Expand Down Expand Up @@ -522,11 +533,20 @@ void check_timings(
);
}
return;
case PokemonFRLG_RngTarget::togepifast:
if (timings.ingame_delay < 5500){
OperationFailedException::fire(
ErrorReport::NO_ERROR_REPORT,
"Togepi (pre-approved): the in-game delay cannot be less than 5500ms (500 advances). Check your in-game advances and calibration or pick a new target.",
console
);
}
return;
case PokemonFRLG_RngTarget::eggheld:
if (timings.ingame_delay < 4000) {
OperationFailedException::fire(
ErrorReport::NO_ERROR_REPORT,
"Togepi: the in-game delay cannot be less than 4000ms (350 advances). Check your in-game advances and calibration or pick a new target.",
"Held Frame: the in-game delay cannot be less than 4000ms (350 advances). Check your in-game advances and calibration or pick a new target.",
console
);
}
Expand All @@ -535,7 +555,7 @@ void check_timings(
if (timings.ingame_delay < 12000) {
OperationFailedException::fire(
ErrorReport::NO_ERROR_REPORT,
"Togepi: the in-game delay cannot be less than 12000ms (1440 advances). Check your in-game advances and calibration or pick a new target.",
"Pickup Frame: the in-game delay cannot be less than 12000ms (1440 advances). Check your in-game advances and calibration or pick a new target.",
console
);
}
Expand Down Expand Up @@ -760,6 +780,9 @@ void perform_blind_sequence(
case PokemonFRLG_RngTarget::togepi:
collect_togepi_egg_after_delay(context, timings.ingame_delay);
return;
case PokemonFRLG_RngTarget::togepifast:
collect_preapproved_togepi_egg_after_delay(context, timings.ingame_delay);
return;
case PokemonFRLG_RngTarget::eggheld:
trigger_held_daycare_egg_after_delay(context, timings.ingame_delay);
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ namespace PokemonFRLG{
gamecornerpinsir,
gamecornerporygon,
togepi,
togepifast,
eggheld,
eggpickup,
electrode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ GiftRng::GiftRng()
{PokemonFRLG_RngTarget::gamecornerpinsir, "gamecornerpinsir", "Game Corner Pinsir"},
{PokemonFRLG_RngTarget::gamecornerporygon, "gamecornerporygon", "Game Corner Porygon"},
{PokemonFRLG_RngTarget::togepi, "togepi", "Togepi"},
{PokemonFRLG_RngTarget::togepifast, "togepifast", "Togepi (pre-approved)"}
},
LockMode::LOCK_WHILE_RUNNING,
PokemonFRLG_RngTarget::magikarp
Expand Down Expand Up @@ -313,6 +314,7 @@ void GiftRng::program(SingleSwitchProgramEnvironment& env, ProControllerContext&
GENDER_THRESHOLD = -1;
break;
case PokemonFRLG_RngTarget::togepi:
case PokemonFRLG_RngTarget::togepifast:
BASE_STATS = { 35, 20, 65, 40, 65, 20 };
GENDER_THRESHOLD = 30;
LEVEL = 5;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ RngHelper::RngHelper()
{PokemonFRLG_RngTarget::gamecornerpinsir, "gamecornerpinsir", "Game Corner Pinsir"},
{PokemonFRLG_RngTarget::gamecornerporygon, "gamecornerporygon", "Game Corner Porygon"},
{PokemonFRLG_RngTarget::togepi, "togepi", "Togepi"},
{PokemonFRLG_RngTarget::togepifast, "togepifast", "Togepi (pre-approved)"},
{PokemonFRLG_RngTarget::eggheld, "eggheld", "Daycare Egg Held Frame"},
{PokemonFRLG_RngTarget::eggpickup, "eggpickup", "Daycare Egg Pickup"},
{PokemonFRLG_RngTarget::staticencounter, "staticencounter", "Static Overworld Encounters"},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@ bool check_for_shiny(
case PokemonFRLG_RngTarget::starters:
return shiny_check_summary(console, context, -2, StartMenuContext::NO_DEX);
case PokemonFRLG_RngTarget::togepi:
case PokemonFRLG_RngTarget::togepifast:
hatch_togepi_egg(console, context);
case PokemonFRLG_RngTarget::magikarp:
case PokemonFRLG_RngTarget::hitmonlee:
Expand Down
Loading