Skip to content

Commit

Permalink
Merge pull request #369 from kichithewolf/stats-reset-quickball-movet…
Browse files Browse the repository at this point in the history
…able

stats reset: turn 1 quickball, move table options
  • Loading branch information
Mysticial authored Sep 26, 2023
2 parents 3b6f3b3 + 4d3aae2 commit 8b2943e
Show file tree
Hide file tree
Showing 5 changed files with 318 additions and 36 deletions.
2 changes: 2 additions & 0 deletions SerialPrograms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1351,6 +1351,8 @@ file(GLOB MAIN_SOURCES
Source/PokemonSV/Options/PokemonSV_AuctionItemTable.cpp
Source/PokemonSV/Options/PokemonSV_AuctionItemTable.h
Source/PokemonSV/Options/PokemonSV_AutoHostOptions.h
Source/PokemonSV/Options/PokemonSV_BattleMoveTable.cpp
Source/PokemonSV/Options/PokemonSV_BattleMoveTable.h
Source/PokemonSV/Options/PokemonSV_EggPowerSandwichOption.cpp
Source/PokemonSV/Options/PokemonSV_EggPowerSandwichOption.h
Source/PokemonSV/Options/PokemonSV_EncounterActionsTable.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/* Battle Move Table
*
* From: https://github.com/PokemonAutomation/Arduino-Source
*
*/

#include "PokemonSV_BattleMoveTable.h"

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonSV{

const EnumDatabase<BattleMoveType>& Battle_move_enum_database(){
static EnumDatabase<BattleMoveType> database{
{BattleMoveType::Move1, "move1", "Move 1"},
{BattleMoveType::Move2, "move2", "Move 2"},
{BattleMoveType::Move3, "move3", "Move 3"},
{BattleMoveType::Move4, "move4", "Move 4"},
//{BattleMoveType::tera, "tera", "Tera"},
};
return database;
}

BattleMoveTableRow::BattleMoveTableRow()
: type(Battle_move_enum_database(), LockWhileRunning::UNLOCKED, BattleMoveType::Move1)
, notes(false, LockWhileRunning::UNLOCKED, "", "(e.g. False Swipe, Thunder Wave)")
{
PA_ADD_OPTION(type);
PA_ADD_OPTION(notes);
}
std::unique_ptr<EditableTableRow> BattleMoveTableRow::clone() const{
std::unique_ptr<BattleMoveTableRow> ret(new BattleMoveTableRow());
ret->type.set(type);
ret->notes.set(notes);
return ret;
}

BattleMoveTable::BattleMoveTable()
: EditableTableOption_t<BattleMoveTableRow>(
"<b>Move Table:</b><br>"
"Run this sequence of moves for your lead Pokemon only. "
"If your lead faints or the end of the table is reached, the program will switch to throwing the selected ball. ",
LockWhileRunning::LOCKED,
make_defaults()
)
{}

std::vector<std::string> BattleMoveTable::make_header() const{
return {
"Move",
"Notes",
};
}
std::vector<std::unique_ptr<EditableTableRow>> BattleMoveTable::make_defaults(){
std::vector<std::unique_ptr<EditableTableRow>> ret;
ret.emplace_back(new BattleMoveTableRow());
return ret;
}


}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/* Battle Move Table
*
* From: https://github.com/PokemonAutomation/Arduino-Source
*
*/

#ifndef PokemonAutomation_PokemonSV_BattleMoveTable_H
#define PokemonAutomation_PokemonSV_BattleMoveTable_H

#include "Common/Cpp/Options/SimpleIntegerOption.h"
#include "Common/Cpp/Options/StringOption.h"
#include "Common/Cpp/Options/EnumDropdownOption.h"
#include "Common/Cpp/Options/EditableTableOption.h"

namespace PokemonAutomation{
namespace NintendoSwitch{
namespace PokemonSV{


enum class BattleMoveType{
Move1,
Move2,
Move3,
Move4,
};
const EnumDatabase<BattleMoveType>& Battle_move_enum_database();

class BattleMoveTableRow : public EditableTableRow{
public:
BattleMoveTableRow();
virtual std::unique_ptr<EditableTableRow> clone() const override;

public:
EnumDropdownCell<BattleMoveType> type;
StringCell notes;
};

class BattleMoveTable : public EditableTableOption_t<BattleMoveTableRow>{
public:
BattleMoveTable();

virtual std::vector<std::string> make_header() const;
static std::vector<std::unique_ptr<EditableTableRow>> make_defaults();
};


}
}
}
#endif
Loading

0 comments on commit 8b2943e

Please sign in to comment.