From defa142490b4bb8d89f655dce3149cc25adaedd2 Mon Sep 17 00:00:00 2001 From: Ash Ketchum Date: Wed, 15 Jul 2026 02:18:41 +0200 Subject: menu: add NOWILD toggle + REPEL (and repurpose wc5d8 as the flag) NOWILD toggles wild encounters off (hooked in TryDoWildEncounter, a banked file) with an ON indicator drawn on its menu row; the flag lives in the unused wc5d8 WRAM0 byte (renamed wSlopNoWild, always-accessible, defaults 0). REPEL refills repel steps to 255. (A NOCLIP toggle was prototyped but its hook lands in the full home bank - deferred until I free ROM0 budget.) SL0P MENU now: WARP HEAL MONEY BADGES DEX MAXTEAM ITEMS NOWILD REPEL. --- engine/battle/wild_encounters.asm | 3 +++ engine/slop_menu.asm | 33 +++++++++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) (limited to 'engine') diff --git a/engine/battle/wild_encounters.asm b/engine/battle/wild_encounters.asm index 9fe0c96c..6e29dd4c 100644 --- a/engine/battle/wild_encounters.asm +++ b/engine/battle/wild_encounters.asm @@ -1,6 +1,9 @@ ; try to initiate a wild pokemon encounter ; returns success in Z TryDoWildEncounter: + ld a, [wSlopNoWild] ; SL0P no-wild-encounters toggle + and a + jr nz, .CantEncounter ld a, [wNPCMovementScriptPointerTableNum] and a ret nz diff --git a/engine/slop_menu.asm b/engine/slop_menu.asm index 140dc04b..36773423 100644 --- a/engine/slop_menu.asm +++ b/engine/slop_menu.asm @@ -8,7 +8,7 @@ ; To add an entry: add a "NAME" line to SlopMenuText, a `dw Handler` to ; SlopMenuHandlers, and bump SLOP_MENU_COUNT. -DEF SLOP_MENU_COUNT EQU 7 +DEF SLOP_MENU_COUNT EQU 9 SECTION "Slop Menu", ROMX @@ -32,6 +32,14 @@ SlopMenu:: hlcoord 6, 3 ld de, SlopMenuText call PlaceString +; ON marker for the NOWILD toggle (item 7 -> row 10) + ld a, [wSlopNoWild] + and a + jr z, .nowildOff + hlcoord 13, 10 + ld de, SlopOnText + call PlaceString +.nowildOff call SlopMenuShow xor a ld [wCurrentMenuItem], a @@ -102,7 +110,11 @@ SlopMenuText: next "BADGES" next "DEX" next "MAXTEAM" - next "ITEMS@" + next "ITEMS" + next "NOWILD" + next "REPEL@" +SlopOnText: + db "ON@" SlopMenuHandlers: dw WarpSubmenu dw SlopHealParty @@ -111,6 +123,8 @@ SlopMenuHandlers: dw SlopDex dw SlopMaxTeam dw GiveItemSubmenu + dw SlopToggleNoWild + dw SlopRepel ; =========================================================================== @@ -298,6 +312,21 @@ SlopMaxCash: and a ret +; NOWILD toggle: no wild encounters (hooked in TryDoWildEncounter) +SlopToggleNoWild: + ld a, [wSlopNoWild] + xor $01 + ld [wSlopNoWild], a + and a + ret + +; REPEL: refill repel steps +SlopRepel: + ld a, 255 + ld [wRepelRemainingSteps], a + and a + ret + ; BADGES: all 8 SlopAllBadges: ld a, $ff -- cgit v1.3.1-sl0p