aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--engine/battle/wild_encounters.asm3
-rw-r--r--engine/slop_menu.asm33
-rw-r--r--ram/wram.asm2
3 files changed, 35 insertions, 3 deletions
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
diff --git a/ram/wram.asm b/ram/wram.asm
index 62ef1c44..b753e163 100644
--- a/ram/wram.asm
+++ b/ram/wram.asm
@@ -224,7 +224,7 @@ wc5d2:: db
wSurfingMinigameWaveFunctionNumber:: dw
wc5d5:: db
wSurfingMinigamePikachuHP:: dw ; little-endian BCD
-wc5d8:: db ; unused?
+wSlopNoWild:: db ; SL0P no-wild-encounters toggle (was unused wc5d8)
; number of consecutive tricks
wSurfingMinigameRadnessMeter:: db
wSurfingMinigameRadnessScore:: dw ; little-endian BCD