Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply some "Bombcus in Logic" checks globally and fix Logic bugs when "Bombchus in Logic" is off #3720

Merged

Conversation

Pepper0ni
Copy link
Contributor

@Pepper0ni Pepper0ni commented Dec 20, 2023

Addresses a few small issues with bombchu logic by doing 3 quick fixes:

  • The Bombchu Shop (and any other right side bombchu checks) will no longer sell out in rando even without "Bombchus in Logic", fixing an issue where shops were considered infinite sources of bombchus when they were not.
  • Buying 10 bombchus from a shop now has a base price of 99 Rupees in rando even when "Bombchus in logic" is off, fixing an issue where logic would not check for a wallet when it should
  • if "Bombchus in logic" is off, Bombchu Drops only count as an in logic source of bombchus when the player has a Bomb Bag, preventing the player from being logically required to use chus to get bomb bag when the setting is on. This clears any potential confusion caused by the setting combo.

Build Artifacts

@garrettjoecox
Copy link
Contributor

What is the percentage of getting a bombchu drop vs getting a bomb drop with "Bombchus in Logic" on?

This type of question, among other similar comments are better fit for our discord. Comments on pull requests should be limited to feedback about the code changes made 👍

@@ -1255,8 +1255,7 @@ void EnGirlA_InitializeItemAction(EnGirlA* this, PlayState* play) {
this->itemGiveFunc = itemEntry->itemGiveFunc;
this->buyEventFunc = itemEntry->buyEventFunc;
// If chus are in logic, make the 10 pack affordable without a wallet upgrade
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// If chus are in logic, make the 10 pack affordable without a wallet upgrade
// randomizer logic expects the 10 pack to be affordable without a wallet upgrade

Comment on lines +539 to 541
FoundBombchus = (BombchuDrop || Bombchus || Bombchus5 || Bombchus10 || Bombchus20) && (BombBag || BombchusInLogic);
CanPlayBowling = (BombchusInLogic && FoundBombchus) || (!BombchusInLogic && BombBag);
HasBombchus = (BuyBombchus10 || BuyBombchus20 || (AmmoDrops.Is(AMMODROPS_BOMBCHU) && FoundBombchus));
Copy link
Contributor

Choose a reason for hiding this comment

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

unless i'm misunderstanding this, it seems this would make it so logic never expects a scenario where someone

  • has chus in logic off, has chu drops on
  • finds chus
  • uses chus

which is definitely possible because without chus in logic chus will drop if someone has chus (even if they don't have bomb bag)

based on

//If bombchus in logic, need to have found chus to buy; if not just need bomb bag
else if (placed == BUY_BOMBCHU_10 || placed == BUY_BOMBCHU_20) {
OtherCondition = (!BombchusInLogic && Bombs) || (BombchusInLogic && FoundBombchus);
}

i'd think we want this to be

Suggested change
FoundBombchus = (BombchuDrop || Bombchus || Bombchus5 || Bombchus10 || Bombchus20) && (BombBag || BombchusInLogic);
CanPlayBowling = (BombchusInLogic && FoundBombchus) || (!BombchusInLogic && BombBag);
HasBombchus = (BuyBombchus10 || BuyBombchus20 || (AmmoDrops.Is(AMMODROPS_BOMBCHU) && FoundBombchus));
FoundBombchus = (BombchuDrop || Bombchus || Bombchus5 || Bombchus10 || Bombchus20);
CanPlayBowling = (BombchusInLogic && FoundBombchus) || (!BombchusInLogic && BombBag);
HasBombchus = (((BuyBombchus10 || BuyBombchus20) && (BombBag || BombchusInLogic)) || (AmmoDrops.Is(AMMODROPS_BOMBCHU) && FoundBombchus));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The suggested line of code does nothing, as BuyBombchus is already accounting for bomb bag properly in the shop logic code.

The purpose of that line is to patch the case where finding a bombchu chest was putting using bombchus in logic without a bomb bag on seeds where bombcus in logic is off, and while this matches the practicallity of what is happeneing in game, it is not in the spirit of disabling bombchus in logic and will create a scenario where HasBombchus is true when HasExplosives is false resulting in inconsistent logic.

Copy link
Contributor

Choose a reason for hiding this comment

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

HasBombchus is true when HasExplosives is false resulting in inconsistent logic

HasExplosives = Bombs || (BombchusInLogic && HasBombchus);

yes, that is intentional. chus in logic means you can be expected to use chus to get checks locked behind having explosives. chus out of logic means you won't be expected to get those checks using chus.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is not intended when "Bombchus in Logic" is off, which is what happens in this case. The full requirements are:

  • "Bombchus in Logic" is off
  • "Bombchu Drops" is on
  • There is no bomb bag in logic
  • There is a bombchu chest in logic
  • The check looks for HasBombchus specifically, not HasExplosives

When these 5 things happen, the logic will see the bombchus as a valid item even when it shouldn't be because settings say bombchus should only be needed after the bomb bag. HasExplosives having that BombchusInLogic check and HasBombchus not having it is what causes the wierdness.

@garrettjoecox garrettjoecox merged commit cb82e77 into HarbourMasters:develop-macready Feb 2, 2024
8 checks passed
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.

3 participants