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

Better swordless handling with temp B #11

Merged

Conversation

Archez
Copy link

@Archez Archez commented Oct 14, 2023

This PR aims to improve swordless state handling during minigames/epona by hijacking tempB with a "marker" value to allow us to restore the B button as empty without "disabling" the B button in the HUD. This should resolve all remaining issues with the HUD.
This also resolves child not having slingshot on B during child archery when swordless.

Additionally, an old swordless hack for child fishing can be removed in favor of the new handling, which should remove any possible cases that a kokiri sword is accidentally given to the player. This required preventing auto save in the fishing pond to avoid the fishing rod on B being saved to file.

A similar auto save restriction for bombchu bowling was needed. Shooting gallery did not have issues with auto save though.

The following scenarios have been tested:

  • Riding Epona without a sword or bow
  • Riding Epona with a sword but no bow
  • Riding Epona without a sword but with a bow
  • Pausing while on Epona
  • Saving while on Epona
  • Fishing as child or adult without a sword
  • Pausing while fishing
  • Saving while fishing
  • Game over while fishing
  • Playing shooting gallery as child or adult without a sword
  • Game over during shooting gallery
  • Playing bombchu bowling without a sword
  • Game over during bomchu bowling

Behind the scenes, rather than storing ITEM_NONE which is the same as BTN_DISABLED (255), I've elected to store ITEM_NONE_FE (254) so that we have a marker to know that we were swordless before and it doesn't dim/disabled the B button like (255) does.

Build Artifacts

@stratomaster64 stratomaster64 merged commit f23f39d into stratomaster64:mister-sword Oct 14, 2023
7 checks passed
@Archez Archez deleted the better-swordless-tempB branch October 14, 2023 18:00
stratomaster64 added a commit that referenced this pull request Oct 26, 2023
* The mother of all commits

* Removed `GI_SWORD_MASTER`;
"Master Sword" Items now actually give MS

* Removed dupe MS entries in item pool;
updated GIMESSAGE (should stop crashing on non-Windows);
re-added MS in item list

* Give Adult Link a freebie with shuffle MS on;
cihld -> adult no longer gives MS;
ToT Master Sword now gives correct item

* add master sword GI draw func based on ToT MS object

* Force `MasterSword` logic var to only update upon getting MS

* Dorf funny line now activates with LA and MS in inv

* Apply suggestions

* Updated RAND_INF;
Check Tracker changes;
Gave RAND_INF and ice trap logic to ToT MS check;
Fixed swordless behavior for HBA/fishing

* ToT MS Check now works in check tracker;
Visual bug where box hovers over non-existent MS gone;
Fixed RAND_INF check with ToT MS pedestal;
Ganon no longer gives free MS

* adult equips no longer reset in MS shuffle

* Apply (most) locacc review suggestions

Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com>

* Reorganized swordless check for interface to fit edge cases;
getting master sword no longer highlights box

* Edge case for BGS but no bow

* Fix implicit declaration error for GI hooks (#9)

* Adjusted `CanAdultAttack/Damage`; applied logic suggestions

* Fixed build errors (hopefully)

* Cleanup merge

* get shit working again

* Tidied up remaining uses of DD flag as rando indicator

* make master sword invisible and fix ms flag (#10)

* Add text to sheik if go mode is obtained but barrier is still up

* overhaul swordless behavior in `func_80083108`

* reworked ToT MS Check to have an actual GI

* suggestions

* Apply suggestions

* Better swordless handling with temp B (#11)

* better swordless handling with temp B

* prevent auto save in fishing pond

* prevent auto save during bombchu bowling

* enum fix

---------

Co-authored-by: Adam Bird <archez39@me.com>
Co-authored-by: inspectredc <78732756+inspectredc@users.noreply.github.com>
Co-authored-by: RaelCappra <rael.cappra@gmail.com>
Co-authored-by: Adam Bird <Archez@users.noreply.github.com>
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