Skip to content

Commit 8935547

Browse files
committed
quest exclusion table for BBQFarmer
1 parent a559722 commit 8935547

File tree

4 files changed

+145
-18
lines changed

4 files changed

+145
-18
lines changed

SerialPrograms/Source/PokemonSV/Options/PokemonSV_BBQOption.cpp

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,108 @@ namespace PokemonAutomation{
1212
namespace NintendoSwitch{
1313
namespace PokemonSV{
1414

15+
//Does not include multiplayer quests
16+
const EnumDropdownDatabase<BBQuests>& BBQuests_database(){
17+
static EnumDropdownDatabase<BBQuests> database{
18+
{BBQuests::auto_10, "auto-10", "Defeat 10 wild Pokemon using Auto Battle!"},
19+
{BBQuests::make_tm, "make-tm", "Make yourself a TM!"},
20+
{BBQuests::pickup_10, "pickup-10", "Pick up items on the ground 10 times!"},
21+
{BBQuests::sneak_up, "sneak-up", "Successfully sneak up on 1 Pokemon and surprise them with a battle!"},
22+
{BBQuests::photo_fly, "photo-fly", "Take a photo of a wild Pokemon in flight!"},
23+
{BBQuests::photo_swim, "photo-swim", "Take a photo of a wild Pokemon that is swimming!"},
24+
{BBQuests::photo_canyon, "photo-canyon", "Take a photo of a wild Pokemon in the Canyon Biome!"},
25+
{BBQuests::photo_coastal, "photo-coastal", "Take a photo of a wild Pokemon in the Coastal Biome!"},
26+
{BBQuests::photo_polar, "photo-polar", "Take a photo of a wild Pokemon in the Polar Biome!"},
27+
{BBQuests::photo_savanna, "photo-savanna", "Take a photo of a wild Pokemon in the Savanna Biome!"},
28+
{BBQuests::tera_self_defeat,"tera-self-defeat", "Terastallize your Pokemon to defeat a wild Pokemon!"},
29+
{BBQuests::travel_500, "travel-500", "Travel over 500 yards!"},
30+
{BBQuests::catch_any, "catch-any", "Catch 1 Pokemon!"},
31+
{BBQuests::catch_normal, "catch-normal", "Catch 1 Normal-type Pokemon!"},
32+
{BBQuests::catch_fighting, "catch-fighting", "Catch 1 Fighting-type Pokemon!"},
33+
{BBQuests::catch_flying, "catch-flying", "Catch 1 Flying-type Pokemon!"},
34+
{BBQuests::catch_poison, "catch-poison", "Catch 1 Poison-type Pokemon!"},
35+
{BBQuests::catch_ground, "catch-ground", "Catch 1 Ground-type Pokemon!"},
36+
{BBQuests::catch_rock, "catch-rock", "Catch 1 Rock-type Pokemon!"},
37+
{BBQuests::catch_bug, "catch-bug", "Catch 1 Bug-type Pokemon!"},
38+
{BBQuests::catch_ghost, "catch-ghost", "Catch 1 Ghost-type Pokemon!"},
39+
{BBQuests::catch_steel, "catch-steel", "Catch 1 Steel-type Pokemon!"},
40+
{BBQuests::catch_fire, "catch-fire", "Catch 1 Fire-type Pokemon!"},
41+
{BBQuests::catch_water, "catch-water", "Catch 1 Water-type Pokemon!"},
42+
{BBQuests::catch_grass, "catch-grass", "Catch 1 Grass-type Pokemon!"},
43+
{BBQuests::catch_electric, "catch-electric", "Catch 1 Electric-type Pokemon!"},
44+
{BBQuests::catch_psychic, "catch-psychic", "Catch 1 Psychic-type Pokemon!"},
45+
{BBQuests::catch_ice, "catch-ice", "Catch 1 Ice-type Pokemon!"},
46+
{BBQuests::catch_dragon, "catch-dragon", "Catch 1 Dragon-type Pokemon!"},
47+
{BBQuests::catch_dark, "catch-dark", "Catch 1 Dark-type Pokemon!"},
48+
{BBQuests::catch_fairy, "catch-fairy", "Catch 1 Fairy-type Pokemon!"},
49+
{BBQuests::wash_pokemon, "wash-pokemon", "Give your Pokemon a nice washing!"},
50+
{BBQuests::wild_tera, "wild-tera", "Battle a wild Tera Pokemon!"},
51+
{BBQuests::auto_30, "auto-30", "Defeat 30 wild Pokemon using Auto Battle!"},
52+
{BBQuests::tera_raid, "tera-raid", "Claim victory in a Tera Raid Battle!"},
53+
{BBQuests::sandwich_three, "sandwich-three", "Make a sandwich that uses at least 3 ingredients!"},
54+
{BBQuests::bitter_sandwich, "bitter-sandwich", "Make a bitter sandwich!"},
55+
{BBQuests::sweet_sandwich, "sweet-sandwich", "Make a sweet sandwich!"},
56+
{BBQuests::salty_sandwich, "salty-sandwich", "Make a salty sandwich!"},
57+
{BBQuests::sour_sandwich, "sour-sandwich", "Make a sour sandwich!"},
58+
{BBQuests::spicy_sandwich, "spicy-sandwich", "Make a spicy sandwich!"},
59+
//{BBQuests::hatch_egg, "hatch-egg", "Hatch a Pokemon Egg!"},
60+
{BBQuests::photo_normal, "photo-normal", "Take a photo of a wild Normal-type Pokemon!"},
61+
{BBQuests::photo_fighting, "photo-fighting", "Take a photo of a wild Fighting-type Pokemon!"},
62+
{BBQuests::photo_flying, "photo-flying", "Take a photo of a wild Flying-type Pokemon!"},
63+
{BBQuests::photo_poison, "photo-poison", "Take a photo of a wild Poison-type Pokemon!"},
64+
{BBQuests::photo_ground, "photo-ground", "Take a photo of a wild Ground-type Pokemon!"},
65+
{BBQuests::photo_rock, "photo-rock", "Take a photo of a wild Rock-type Pokemon!"},
66+
{BBQuests::photo_bug, "photo-bug", "Take a photo of a wild Bug-type Pokemon!"},
67+
{BBQuests::photo_ghost, "photo-ghost", "Take a photo of a wild Ghost-type Pokemon!"},
68+
{BBQuests::photo_steel, "photo-steel", "Take a photo of a wild Steel-type Pokemon!"},
69+
{BBQuests::photo_fire, "photo-fire", "Take a photo of a wild Fire-type Pokemon!"},
70+
{BBQuests::photo_water, "photo-water", "Take a photo of a wild Water-type Pokemon!"},
71+
{BBQuests::photo_grass, "photo-grass", "Take a photo of a wild Grass-type Pokemon!"},
72+
{BBQuests::photo_electric, "photo-electric", "Take a photo of a wild Electric-type Pokemon!"},
73+
{BBQuests::photo_psychic, "photo-psychic", "Take a photo of a wild Psychic-type Pokemon!"},
74+
{BBQuests::photo_ice, "photo-ice", "Take a photo of a wild Ice-type Pokemon!"},
75+
{BBQuests::photo_dragon, "photo-dragon", "Take a photo of a wild Dragon-type Pokemon!"},
76+
{BBQuests::photo_dark, "photo-dark", "Take a photo of a wild Dark-type Pokemon!"},
77+
{BBQuests::photo_fairy, "photo-fairy", "Take a photo of a wild Fairy-type Pokemon!"},
78+
};
79+
return database;
80+
}
81+
82+
BBQuestTableRow::BBQuestTableRow(EditableTableOption& parent_table)
83+
: EditableTableRow(parent_table)
84+
, quest(BBQuests_database(), LockMode::UNLOCK_WHILE_RUNNING, BBQuests::auto_10)
85+
{
86+
PA_ADD_OPTION(quest);
87+
}
88+
std::unique_ptr<EditableTableRow> BBQuestTableRow::clone() const{
89+
std::unique_ptr<BBQuestTableRow> ret(new BBQuestTableRow(parent()));
90+
ret->quest.set(quest);
91+
return ret;
92+
}
93+
94+
BBQuestTable::BBQuestTable()
95+
: EditableTableOption_t<BBQuestTableRow>(
96+
"<b>Quest Exclusions:</b><br>"
97+
"Exclude the quests in the table. "
98+
"If you are experiencing an issue or want to skip a quest, select it below. "
99+
"Does not include egg hatching quest, as that is handled in another option. ",
100+
LockMode::LOCK_WHILE_RUNNING,
101+
make_defaults()
102+
)
103+
{}
104+
105+
std::vector<std::string> BBQuestTable::make_header() const{
106+
return {
107+
"Quest",
108+
};
109+
}
110+
std::vector<std::unique_ptr<EditableTableRow>> BBQuestTable::make_defaults(){
111+
std::vector<std::unique_ptr<EditableTableRow>> ret;
112+
ret.emplace_back(new BBQuestTableRow(*this));
113+
return ret;
114+
}
115+
116+
15117
BBQOption::BBQOption(OCR::LanguageOCROption* language_option)
16118
: GroupOption("Blueberry Quests", LockMode::UNLOCK_WHILE_RUNNING)
17119
, m_language_owner(language_option == nullptr
@@ -81,6 +183,7 @@ BBQOption::BBQOption(OCR::LanguageOCROption* language_option)
81183
}
82184
PA_ADD_OPTION(NUM_QUESTS);
83185
PA_ADD_OPTION(SAVE_NUM_QUESTS);
186+
PA_ADD_OPTION(QUEST_EXCLUSIONS);
84187
PA_ADD_OPTION(INVERTED_FLIGHT);
85188
PA_ADD_OPTION(QUICKBALL);
86189
PA_ADD_OPTION(BALL_SELECT);

SerialPrograms/Source/PokemonSV/Options/PokemonSV_BBQOption.h

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include "Common/Cpp/Options/GroupOption.h"
1111
#include "Common/Cpp/Options/EnumDropdownOption.h"
12+
#include "Common/Cpp/Options/EditableTableOption.h"
1213
#include "Common/Cpp/Options/SimpleIntegerOption.h"
1314
#include "Common/Cpp/Options/BooleanCheckBoxOption.h"
1415
#include "CommonTools/Options/LanguageOCROption.h"
@@ -20,6 +21,40 @@ namespace PokemonAutomation{
2021
namespace NintendoSwitch{
2122
namespace PokemonSV{
2223

24+
enum class BBQuests{
25+
auto_10, make_tm, pickup_10, sneak_up, photo_fly, photo_swim, photo_canyon, photo_coastal, photo_polar, photo_savanna, tera_self_defeat,
26+
travel_500, catch_any, catch_normal, catch_fighting, catch_flying, catch_poison, catch_ground, catch_rock, catch_bug, catch_ghost, catch_steel,
27+
catch_fire, catch_water, catch_grass, catch_electric, catch_psychic, catch_ice, catch_dragon, catch_dark, catch_fairy,
28+
wash_pokemon, wild_tera, auto_30, tera_raid, sandwich_three, bitter_sandwich, sweet_sandwich, salty_sandwich, sour_sandwich, spicy_sandwich, hatch_egg,
29+
photo_normal, photo_fighting, photo_flying, photo_poison, photo_ground, photo_rock, photo_bug, photo_ghost, photo_steel, photo_fire, photo_water,
30+
photo_grass, photo_electric, photo_psychic, photo_ice, photo_dragon, photo_dark, photo_fairy,
31+
ditto_central, ditto_canyon, ditto_coastal, ditto_polar, ditto_savanna, group_canyon, group_coastal, group_polar, group_savanna, group_eyewear, group_nonuniform,
32+
group_masks, sandwich_four, catch_hint, catch_hint2,
33+
UnableToDetect
34+
};
35+
36+
//Quest exclusion table
37+
const EnumDropdownDatabase<BBQuests>& BBQuests_database();
38+
39+
class BBQuestTableRow : public EditableTableRow{
40+
public:
41+
BBQuestTableRow(EditableTableOption& parent_table);
42+
virtual std::unique_ptr<EditableTableRow> clone() const override;
43+
44+
public:
45+
EnumDropdownCell<BBQuests> quest;
46+
};
47+
48+
class BBQuestTable : public EditableTableOption_t<BBQuestTableRow>{
49+
public:
50+
BBQuestTable();
51+
52+
virtual std::vector<std::string> make_header() const;
53+
std::vector<std::unique_ptr<EditableTableRow>> make_defaults();
54+
};
55+
56+
57+
//BBQ Options
2358
class BBQOption : public GroupOption{
2459

2560
public:
@@ -48,6 +83,8 @@ class BBQOption : public GroupOption{
4883
SimpleIntegerOption<uint64_t> NUM_QUESTS;
4984
SimpleIntegerOption<uint64_t> SAVE_NUM_QUESTS;
5085

86+
BBQuestTable QUEST_EXCLUSIONS;
87+
5188
BooleanCheckBoxOption INVERTED_FLIGHT;
5289

5390
//For catching pokemon quests

SerialPrograms/Source/PokemonSV/Programs/Farming/PokemonSV_BlueberryQuests.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -285,20 +285,19 @@ std::vector<BBQuests> process_quest_list(
285285
break;
286286
}
287287
}else{
288+
//TODO
289+
290+
288291
stream.log("Quest possible");
289292
quests_to_do.push_back(n);
290293
}
291294
}
292295
}
293-
294-
/*
295-
Old logic that assumes most quests are not possible. Written when first starting on the program.
296-
Should not be necessary anymore. Keeping around in case anyone wants to try making a multiplayer version.
297296

298297
//Check that quests_to_do is not empty (after completing all quests on the list, be sure to erase it.
299298
//Lag might be a problem in multi - look into making slots like menu-left navigation
300299
if (quests_to_do.size() == 0){
301-
console.log("No possible quests! Rerolling all quests.");
300+
stream.log("No possible quests! Rerolling all quests.");
302301

303302
//Open quest panel - see above
304303
//Reroll all.
@@ -313,7 +312,7 @@ std::vector<BBQuests> process_quest_list(
313312
context.wait_for_all_requests();
314313
}
315314
//Close quest panel - mash b
316-
}*/
315+
}
317316

318317
if (quests_to_do.size() == 0){
319318
OperationFailedException::fire(

SerialPrograms/Source/PokemonSV/Programs/Farming/PokemonSV_BlueberryQuests.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,6 @@ namespace PokemonAutomation{
1717
namespace NintendoSwitch{
1818
namespace PokemonSV{
1919

20-
enum class BBQuests{
21-
auto_10, make_tm, pickup_10, sneak_up, photo_fly, photo_swim, photo_canyon, photo_coastal, photo_polar, photo_savanna, tera_self_defeat,
22-
travel_500, catch_any, catch_normal, catch_fighting, catch_flying, catch_poison, catch_ground, catch_rock, catch_bug, catch_ghost, catch_steel,
23-
catch_fire, catch_water, catch_grass, catch_electric, catch_psychic, catch_ice, catch_dragon, catch_dark, catch_fairy,
24-
wash_pokemon, wild_tera, auto_30, tera_raid, sandwich_three, bitter_sandwich, sweet_sandwich, salty_sandwich, sour_sandwich, spicy_sandwich, hatch_egg,
25-
photo_normal, photo_fighting, photo_flying, photo_poison, photo_ground, photo_rock, photo_bug, photo_ghost, photo_steel, photo_fire, photo_water,
26-
photo_grass, photo_electric, photo_psychic, photo_ice, photo_dragon, photo_dark, photo_fairy,
27-
ditto_central, ditto_canyon, ditto_coastal, ditto_polar, ditto_savanna, group_canyon, group_coastal, group_polar, group_savanna, group_eyewear, group_nonuniform,
28-
group_masks, sandwich_four, catch_hint, catch_hint2,
29-
UnableToDetect
30-
};
31-
3220
BBQuests BBQuests_string_to_enum(const std::string& token);
3321

3422
enum class CameraAngle{

0 commit comments

Comments
 (0)