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 @@ -68,8 +68,8 @@ RestaurantFarmer::~RestaurantFarmer(){
RestaurantFarmer::RestaurantFarmer()
: m_stop_after_current(false)
, NUM_ROUNDS(
"<b>Number of Battles to Run:</b><br>"
"Zero will run until 'Stop after Current Battle' is pressed or the program is manually stopped.</b>",
"<b>Number of Rounds to Run:</b><br>"
"Zero will run until 'Stop after Current Round' is pressed or the program is manually stopped.</b>",
LockMode::UNLOCK_WHILE_RUNNING,
100,
0
Expand Down Expand Up @@ -112,22 +112,22 @@ RestaurantFarmer::RestaurantFarmer()

RestaurantFarmer::StopButton::StopButton()
: ButtonOption(
"<b>Stop after current battle:",
"Stop after current battle",
"<b>Stop after current round:",
"Stop after current round",
0, 16
)
{}
void RestaurantFarmer::StopButton::set_idle(){
this->set_enabled(false);
this->set_text("Stop after Current Battle");
this->set_text("Stop after Current Round");
}
void RestaurantFarmer::StopButton::set_ready(){
this->set_enabled(true);
this->set_text("Stop after Current Battle");
this->set_text("Stop after Current Round");
}
void RestaurantFarmer::StopButton::set_pressed(){
this->set_enabled(false);
this->set_text("Program will stop after current battle...");
this->set_text("Program will stop after current round...");
}


Expand Down Expand Up @@ -178,7 +178,7 @@ bool RestaurantFarmer::run_lobby(SingleSwitchProgramEnvironment& env, ProControl
case 1:
env.log("Detected selection arrow.");
// This is when the restaurant receptionist is asking whether you want
// to start the battle
// to start the round
pbf_mash_button(context, BUTTON_A, 5000ms);
return false;

Expand Down Expand Up @@ -208,7 +208,7 @@ bool RestaurantFarmer::run_lobby(SingleSwitchProgramEnvironment& env, ProControl
}
}
}
void RestaurantFarmer::run_battle(SingleSwitchProgramEnvironment& env, ProControllerContext& context){
void RestaurantFarmer::run_round(SingleSwitchProgramEnvironment& env, ProControllerContext& context){
RestaurantFarmer_Descriptor::Stats& stats = env.current_stats<RestaurantFarmer_Descriptor::Stats>();

WallClock start = current_time();
Expand Down Expand Up @@ -246,9 +246,7 @@ void RestaurantFarmer::run_battle(SingleSwitchProgramEnvironment& env, ProContro
env.log("Detected selection arrow. (unexpected)", COLOR_RED);
dump_image(env.console.logger(), env.program_info(), env.console.video(), "UnexpectedSelectionArrow");
stats.errors++;
// stats.battles++;
env.update_stats();
// return;
continue;

case 2:
Expand All @@ -268,7 +266,7 @@ void RestaurantFarmer::run_battle(SingleSwitchProgramEnvironment& env, ProContro
env.update_stats();
OperationFailedException::fire(
ErrorReport::SEND_ERROR_REPORT,
"Battle took longer than 30 minutes.",
"Round took longer than 30 minutes.",
env.console
);
}
Expand Down Expand Up @@ -392,7 +390,7 @@ void RestaurantFarmer::program(SingleSwitchProgramEnvironment& env, ProControlle
if (run_lobby(env, context)){
break;
}
run_battle(env, context);
run_round(env, context);
}

send_program_finished_notification(env, NOTIFICATION_PROGRAM_FINISH);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ class RestaurantFarmer : public SingleSwitchProgramInstance, public ButtonListen

// Handle all the logic of talking to the restaurant receptionist.
// Return true when the user clicks the button STOP_AFTER_CURRENT and the player character stops talking to
// the receptionist. Return false when it enters battle.
// the receptionist. Return false when it enters round.
bool run_lobby(SingleSwitchProgramEnvironment& env, ProControllerContext& context);
// Handle all battle logic. Return when it detects the blue dialog box meaning the player character is at
// Handle all round logic. Return when it detects the blue dialog box meaning the player character is at
// the receptionist receiving reward items.
void run_battle(SingleSwitchProgramEnvironment& env, ProControllerContext& context);
void run_round(SingleSwitchProgramEnvironment& env, ProControllerContext& context);

private:
class StopButton : public ButtonOption{
Expand Down