2018-06-24 07:09:41 -07:00
|
|
|
SweetScentFromMenu:
|
2017-10-24 21:14:05 -07:00
|
|
|
ld hl, .SweetScent
|
2015-11-11 20:38:57 -08:00
|
|
|
call QueueScript
|
|
|
|
ld a, $1
|
2015-12-17 14:51:32 -08:00
|
|
|
ld [wFieldMoveSucceeded], a
|
2015-11-11 20:38:57 -08:00
|
|
|
ret
|
|
|
|
|
2018-06-24 17:10:37 -07:00
|
|
|
.SweetScent:
|
2015-11-11 20:38:57 -08:00
|
|
|
reloadmappart
|
|
|
|
special UpdateTimePals
|
2021-03-17 13:16:02 -07:00
|
|
|
callasm GetPartyNickname
|
2019-10-20 15:24:17 -07:00
|
|
|
writetext UseSweetScentText
|
2015-11-25 07:16:29 -08:00
|
|
|
waitbutton
|
2015-11-11 20:38:57 -08:00
|
|
|
callasm SweetScentEncounter
|
2017-10-24 21:14:05 -07:00
|
|
|
iffalse SweetScentNothing
|
2015-11-11 20:38:57 -08:00
|
|
|
checkflag ENGINE_BUG_CONTEST_TIMER
|
2017-10-24 21:14:05 -07:00
|
|
|
iftrue .BugCatchingContest
|
2015-12-01 18:54:11 -08:00
|
|
|
randomwildmon
|
2015-11-11 20:38:57 -08:00
|
|
|
startbattle
|
2015-12-26 15:11:55 -08:00
|
|
|
reloadmapafterbattle
|
2015-11-11 20:38:57 -08:00
|
|
|
end
|
|
|
|
|
2018-06-24 17:10:37 -07:00
|
|
|
.BugCatchingContest:
|
2019-03-10 13:39:31 -07:00
|
|
|
farsjump BugCatchingContestBattleScript
|
2015-11-11 20:38:57 -08:00
|
|
|
|
2018-06-24 17:10:37 -07:00
|
|
|
SweetScentNothing:
|
2019-10-20 15:24:17 -07:00
|
|
|
writetext SweetScentNothingText
|
2015-11-25 07:16:29 -08:00
|
|
|
waitbutton
|
2015-11-11 20:38:57 -08:00
|
|
|
closetext
|
|
|
|
end
|
|
|
|
|
2018-06-24 07:09:41 -07:00
|
|
|
SweetScentEncounter:
|
2023-08-04 09:45:50 -07:00
|
|
|
farcall CanEncounterWildMonInThisTile
|
2015-11-11 20:38:57 -08:00
|
|
|
jr nc, .no_battle
|
2017-12-28 04:15:46 -08:00
|
|
|
ld hl, wStatusFlags2
|
2018-01-22 12:40:43 -08:00
|
|
|
bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
|
2015-11-11 20:38:57 -08:00
|
|
|
jr nz, .not_in_bug_contest
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall GetMapEncounterRate
|
2015-11-11 20:38:57 -08:00
|
|
|
ld a, b
|
|
|
|
and a
|
|
|
|
jr z, .no_battle
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall ChooseWildEncounter
|
2015-11-11 20:38:57 -08:00
|
|
|
jr nz, .no_battle
|
|
|
|
jr .start_battle
|
|
|
|
|
|
|
|
.not_in_bug_contest
|
2017-12-24 09:47:30 -08:00
|
|
|
farcall ChooseWildEncounter_BugContest
|
2015-11-11 20:38:57 -08:00
|
|
|
|
|
|
|
.start_battle
|
|
|
|
ld a, $1
|
2023-09-30 10:12:57 -07:00
|
|
|
ldh [hScriptVar], a
|
2015-11-11 20:38:57 -08:00
|
|
|
ret
|
|
|
|
|
|
|
|
.no_battle
|
|
|
|
xor a
|
2023-09-30 10:12:57 -07:00
|
|
|
ldh [hScriptVar], a
|
2018-01-23 14:39:09 -08:00
|
|
|
ld [wBattleType], a
|
2015-11-11 20:38:57 -08:00
|
|
|
ret
|
|
|
|
|
2019-10-20 15:24:17 -07:00
|
|
|
UseSweetScentText:
|
|
|
|
text_far _UseSweetScentText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|
2015-11-11 20:38:57 -08:00
|
|
|
|
2019-10-20 15:24:17 -07:00
|
|
|
SweetScentNothingText:
|
|
|
|
text_far _SweetScentNothingText
|
2018-11-17 10:33:03 -08:00
|
|
|
text_end
|