Skip to content

Commit 1226ea1

Browse files
committed
Don't force the Encored move if it's cured with Mental Herb.
1 parent d21b67a commit 1226ea1

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

engine/battle/move_effects/attract.asm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@ CheckMentalHerb:
167167
ld hl, CuredDisableWithItem
168168
call nz, .print
169169

170-
jmp ConsumeUserItem
170+
call ConsumeUserItem
171+
xor a
172+
ret
171173

172174
.print
173175
push bc

engine/battle/move_effects/encore_disable.asm

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,24 +78,26 @@ DoEncoreDisable:
7878
jr z, .got_text_and_duration
7979
ld hl, GotAnEncoreText
8080
dec a
81+
call .got_text_and_duration
82+
ret z
8183

8284
; Force opponent to use encored move in case it moves second
83-
push hl
84-
push af
8585
ld a, BATTLE_VARS_MOVE_OPP
8686
call GetBattleVarAddr
8787
ld a, BATTLE_VARS_LAST_COUNTER_MOVE_OPP
8888
call GetBattleVar
8989
ld [hl], a
90-
pop af
91-
pop hl
90+
ret
91+
9292
.got_text_and_duration
9393
inc c
9494
swap c
9595
or c
9696
ld [de], a
9797
call AnimateCurrentMove
9898
call StdBattleTextbox
99+
100+
; Returns z if we had a mental herb.
99101
jmp CheckOpponentMentalHerb
100102

101103
.failed

0 commit comments

Comments
 (0)