Skip to content

FRLG Prize Corner: Redeem multiple prizes per reset#1147

Open
kichithewolf wants to merge 4 commits intoPokemonAutomation:mainfrom
kichithewolf:frlg-prize-count
Open

FRLG Prize Corner: Redeem multiple prizes per reset#1147
kichithewolf wants to merge 4 commits intoPokemonAutomation:mainfrom
kichithewolf:frlg-prize-count

Conversation

@kichithewolf
Copy link
Copy Markdown
Collaborator

New option added for multiple redemptions per reset. Requires that the user has enough coins and that there is enough room in their party.

I made an attempt to block invalid combinations of selected prize + redemptions (can't do more than one Porygon at a time), but the coin cost varies between versions, so there's one case where the block won't work: FR Scyther/LG Dratini.

The Scyther in FR costs 5500 coins while the LG Dratini costs 4600 coins, so at maximum coin count of 9999 a player on FR can only redeem Scyther once per reset, whereas the LG player can redeem Dratini twice.

Also adjusted the box values for PrizeSelectDetector to use the same positions as WhiteDialogDetector.

void PrizeCornerReset::on_config_value_changed(void* object){
std::string error;

error = check_amount_redeemed((uint16_t)SLOT.current_value(), NUM_REDEEM);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can declare the string right here. This is usually recommended in C++ so that the variable can be const and is never uninitialized

if (slot_num == 4 && redeem_num != 1) { //Only 1 Porygon in both FR and LG
return "Error: Cannot redeem more than 1 Porygon per reset due to coin case limit.";
} else if (slot_num == 3 && redeem_num > 2) { //2 Dratini LG or 1 Scyther FR
return "Error: Maximum redemption of 2 Dratini per reset due to coin case limit.";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 Dratini or 1 Scyther ? Not sure if this would be more misleading or not

WARNING.set_visibility(ConfigOptionState::HIDDEN);
}

void PrizeCornerReset::on_config_value_changed(void* object){
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do this early and not rely on the exteption being thrown when program start ?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly trying to really make sure people have their setup right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants