diff --git a/patches/ips/disableable_etanks.ips b/patches/ips/disableable_etanks.ips index 8e26b3dc6..dfa0f2c29 100644 Binary files a/patches/ips/disableable_etanks.ips and b/patches/ips/disableable_etanks.ips differ diff --git a/patches/rom_map/Bank 83.txt b/patches/rom_map/Bank 83.txt index 378b68a20..6e349082c 100644 --- a/patches/rom_map/Bank 83.txt +++ b/patches/rom_map/Bank 83.txt @@ -4,5 +4,7 @@ B000 - B700: items_disappear.asm B700 - B800: rng_fix.asm B800 - BA00: Mosaic (Area FX.asm) BA00 - BA15: vanilla_bugfixes.asm -BA15 - F000: [free space] +BA15 - BB00: [free] +BB00 - BC40: disableable_etanks.asm +BC40 - F000: [free space] F000 - end: Mosaic (FX data) \ No newline at end of file diff --git a/patches/rom_map/Bank 85.txt b/patches/rom_map/Bank 85.txt index af23d72c2..318025ef4 100644 --- a/patches/rom_map/Bank 85.txt +++ b/patches/rom_map/Bank 85.txt @@ -16,7 +16,7 @@ $AA00 - $AAA0: pause_menu_objectives.asm $AAA0 - $AB00: [FREE] $AB00 - $ACA0: map_area.asm $ACA0 - $AD00: load_flash_suit -$AD00 - $AE20: disable_etanks.asm +$AD00 - $AE20: [FREE] $AE20 - $B000: reserve_backward_fill.asm $B000 - $B600: vanilla_bugfixes.asm $B600 - $BA00: map_area.asm \ No newline at end of file diff --git a/patches/src/disableable_etanks.asm b/patches/src/disableable_etanks.asm index c4cd1de6b..0b7c54814 100644 --- a/patches/src/disableable_etanks.asm +++ b/patches/src/disableable_etanks.asm @@ -4,8 +4,8 @@ !bank_82_free_space_start = $82F830 !bank_82_free_space_end = $82F9E0 -!bank_85_free_space_start = $85AD00 -!bank_85_free_space_end = $85AE13 +!bank_83_free_space_start = $83BB00 +!bank_83_free_space_end = $83BC40 !current_etank_index = $12 !count_full_etanks = $14 @@ -141,6 +141,9 @@ org $8291ED org !bank_82_free_space_start +config_classic: + dw $0000 + hook_unpause_loading: ;jsl $809A79 ; Hard re-initialize the HUD after we've messed with it. ldx #$0012 @@ -270,10 +273,9 @@ etanks_dpad_right: cmp !count_all_etanks ; Don't go right past the total number of E-Tanks bcs .no - lda $0755 - clc - adc #$0100 - sta $0755 + sep #$20 + inc $0756 + rep #$20 sec rts @@ -287,11 +289,16 @@ etanks_dpad_left: cmp #$0002 beq .no + lda config_classic + bne .classic + lda !current_etank_index dec a cmp !count_full_etanks ; Don't go into full e-tanks bcc .no +.classic + sep #$20 dec $0756 rep #$20 @@ -307,24 +314,33 @@ etanks_dpad_down: and #$00F0 bne .no + lda config_classic + bne .classic + ; Don't move down into full e-tanks lda $09C2 cmp #$02BC ; [Current energy] >= 700 means all 7 bottom row tanks are full bcs .no +.classic - lda $0755 - xba - and #$00ff + lda !current_etank_index sec sbc #$0007 - cmp !count_full_etanks + tax + lda config_classic + bne + + cpx !count_full_etanks bcs + - lda !count_full_etanks + ldx !count_full_etanks + - sta $0756 - + sep #$10 + stx $0756 + rep #$10 + +.done sec rts + .no ; Don't go back to hook_equipment_screen_category_etanks lda #$0037 @@ -341,14 +357,14 @@ etanks_dpad_up: lda !current_etank_index clc - adc #$0007 - cmp !count_all_etanks - bcc + - lda !count_all_etanks + adc #$0008 +- dec a + cmp !count_all_etanks + bcs - cmp !current_etank_index beq .no -+ + sep #$20 sta $0756 rep #$20 @@ -423,7 +439,7 @@ hook_equipment_screen_category_etanks: warnpc !bank_82_free_space_end -org !bank_85_free_space_start +org !bank_83_free_space_start etank_do_some_math: php @@ -481,11 +497,21 @@ dpad_enter_hud: pla sta $12 + lda.l config_classic + bne .classic + ; Can we move up here at all. lda !count_all_etanks cmp !count_full_etanks beq .no - + bra .which + +.classic + ; Have we any tanks at all + lda !count_all_etanks + beq .no + +.which ; Are any not-full etanks enabled lda !count_full_etanks cmp !count_enabled_etanks @@ -493,6 +519,7 @@ dpad_enter_hud: ; Select leftmost enabled tank (A button disables all tanks) lda !count_full_etanks + cmp !count_all_etanks xba and #$ff00 ora #$0004 @@ -522,11 +549,14 @@ dpad_enter_hud: disable_tank: ; Sanity check: can we actually disable this tank? + lda.l config_classic + bne .classic lda $09C4 sec sbc #$0064 cmp $09C2 bcc tank_swap_done ; (max health - 100) < current health = bad times +.classic ; Disable 1 e-tank lda $09C4 @@ -540,6 +570,16 @@ disable_tank: lda !current_etank_index cmp !count_enabled_etanks bcc disable_tank ; Repeat until we've disabled all tanks above and including the selected tank + + lda.l config_classic + beq .skipclamp + + lda $09C4 + cmp $09C2 + bcs .skipclamp ; max health < current health = need to clamp + + sta $09C2 +.skipclamp bra tank_swap_good @@ -608,7 +648,7 @@ hook_load_equipment_menu: stx $0330 rtl -warnpc !bank_85_free_space_end +warnpc !bank_83_free_space_end org $B6FE60 tile_modified_map_cursor: diff --git a/rust/data/presets/full-settings/Community Race Season 4.json b/rust/data/presets/full-settings/Community Race Season 4.json index 0497342a2..0899f4f8a 100644 --- a/rust/data/presets/full-settings/Community Race Season 4.json +++ b/rust/data/presets/full-settings/Community Race Season 4.json @@ -4553,7 +4553,7 @@ "remove_climb_lava": true, "etank_refill": "Full", "energy_station_reserves": true, - "disableable_etanks": true, + "disableable_etanks": "Standard", "reserve_backward_transfer": false, "buffed_drops": true, "early_save": true, diff --git a/rust/data/presets/full-settings/Default.json b/rust/data/presets/full-settings/Default.json index 72f84763e..3920a9f1d 100644 --- a/rust/data/presets/full-settings/Default.json +++ b/rust/data/presets/full-settings/Default.json @@ -4553,7 +4553,7 @@ "remove_climb_lava": true, "energy_station_reserves": false, "etank_refill": "Vanilla", - "disableable_etanks": false, + "disableable_etanks": "Off", "reserve_backward_transfer": false, "buffed_drops": true, "early_save": true, diff --git a/rust/data/presets/quality-of-life/Default.json b/rust/data/presets/quality-of-life/Default.json index 644d616df..d5513ad31 100644 --- a/rust/data/presets/quality-of-life/Default.json +++ b/rust/data/presets/quality-of-life/Default.json @@ -35,7 +35,7 @@ "remove_climb_lava": true, "energy_station_reserves": false, "etank_refill": "Vanilla", - "disableable_etanks": false, + "disableable_etanks": "Off", "reserve_backward_transfer": false, "buffed_drops": true, "early_save": true, diff --git a/rust/data/presets/quality-of-life/High.json b/rust/data/presets/quality-of-life/High.json index 3998f745e..fdcd0b9f9 100644 --- a/rust/data/presets/quality-of-life/High.json +++ b/rust/data/presets/quality-of-life/High.json @@ -35,7 +35,7 @@ "remove_climb_lava": true, "energy_station_reserves": true, "etank_refill": "Full", - "disableable_etanks": true, + "disableable_etanks": "Standard", "reserve_backward_transfer": false, "buffed_drops": true, "early_save": true, diff --git a/rust/data/presets/quality-of-life/Low.json b/rust/data/presets/quality-of-life/Low.json index 84f73e7c0..4dcb90268 100644 --- a/rust/data/presets/quality-of-life/Low.json +++ b/rust/data/presets/quality-of-life/Low.json @@ -35,7 +35,7 @@ "remove_climb_lava": false, "energy_station_reserves": false, "etank_refill": "Vanilla", - "disableable_etanks": false, + "disableable_etanks": "Off", "reserve_backward_transfer": false, "buffed_drops": false, "early_save": false, diff --git a/rust/data/presets/quality-of-life/Max.json b/rust/data/presets/quality-of-life/Max.json index a54aa11d1..a1f389638 100644 --- a/rust/data/presets/quality-of-life/Max.json +++ b/rust/data/presets/quality-of-life/Max.json @@ -35,7 +35,7 @@ "remove_climb_lava": true, "energy_station_reserves": true, "etank_refill": "Full", - "disableable_etanks": true, + "disableable_etanks": "Standard", "reserve_backward_transfer": true, "buffed_drops": true, "early_save": true, diff --git a/rust/data/presets/quality-of-life/Off.json b/rust/data/presets/quality-of-life/Off.json index 55b7ee2b9..93d16b12f 100644 --- a/rust/data/presets/quality-of-life/Off.json +++ b/rust/data/presets/quality-of-life/Off.json @@ -35,7 +35,7 @@ "remove_climb_lava": false, "energy_station_reserves": false, "etank_refill": "Vanilla", - "disableable_etanks": false, + "disableable_etanks": "Off", "reserve_backward_transfer": false, "buffed_drops": false, "early_save": false, diff --git a/rust/maprando-web/src/web/randomize/helpers.rs b/rust/maprando-web/src/web/randomize/helpers.rs index b9ec5ec55..a590fb1dd 100644 --- a/rust/maprando-web/src/web/randomize/helpers.rs +++ b/rust/maprando-web/src/web/randomize/helpers.rs @@ -10,8 +10,8 @@ use maprando::{ randomize::{DifficultyConfig, ItemPriorityGroup, Randomization, get_starting_items}, seed_repository::{Seed, SeedFile}, settings::{ - AreaAssignmentBaseOrder, AreaAssignmentPreset, DoorLocksSize, ETankRefill, - FillerItemPriority, ItemCount, RandomizerSettings, SpeedBooster, WallJump, + AreaAssignmentBaseOrder, AreaAssignmentPreset, DisableETankSetting, DoorLocksSize, + ETankRefill, FillerItemPriority, ItemCount, RandomizerSettings, SpeedBooster, WallJump, get_objective_groups, }, spoiler_log::SpoilerLog, @@ -59,6 +59,7 @@ pub struct SeedHeaderTemplate<'a> { momentum_conservation: bool, fanfares: String, etank_refill: String, + disableable_etanks: String, doors: String, start_location_mode: String, map_layout: String, @@ -455,6 +456,16 @@ pub fn render_seed( ETankRefill::Full => "Full", } .to_string(), + disableable_etanks: match seed_data + .settings + .quality_of_life_settings + .disableable_etanks + { + DisableETankSetting::Off => "Off", + DisableETankSetting::Standard => "Standard", + DisableETankSetting::Unrestricted => "Unrestricted", + } + .to_string(), doors: seed_data.doors.clone(), start_location_mode: seed_data.start_location_mode.clone(), map_layout: seed_data.map_layout.clone(), diff --git a/rust/maprando-web/templates/generate/help/quality/disableable_etanks.html b/rust/maprando-web/templates/generate/help/quality/disableable_etanks.html index 9f78803de..685d1fcff 100644 --- a/rust/maprando-web/templates/generate/help/quality/disableable_etanks.html +++ b/rust/maprando-web/templates/generate/help/quality/disableable_etanks.html @@ -6,9 +6,13 @@
If this setting is enabled, the player may disable any unfilled E-Tanks that they have collected, by navigating to the pause equipment screen, and moving the cursor up to the E-Tank area of the HUD.
-Move the cursor to select an empty E-Tank, then press the A button to toggle it as enabled or disabled. Disabling an E-Tank will also disable the tanks "above" it, and enabling an E-Tank enables all the tanks "below" it.
-Only empty E-Tanks can be disabled. To disable a full tank, Samus will have to take damage first in order to empty the tank.
+This option controls the ability to disable E-Tanks during gameplay. When enabled, move the cursor up into the E-Tank area of the HUD, select an E-Tank and press A to toggle it.
+Disabling an E-Tank will also disable the tanks "above" it, and enabling an E-Tank enables all the tanks "below" it.
+