pokecrystal/engine/events/sweet_scent.asm

67 lines
1.1 KiB
NASM
Raw Normal View History

2018-06-24 14:09:41 +00:00
SweetScentFromMenu:
2017-10-25 04:14:05 +00:00
ld hl, .SweetScent
2015-11-12 04:38:57 +00:00
call QueueScript
ld a, $1
2015-12-17 22:51:32 +00:00
ld [wFieldMoveSucceeded], a
2015-11-12 04:38:57 +00:00
ret
.SweetScent:
2015-11-12 04:38:57 +00:00
reloadmappart
special UpdateTimePals
callasm GetPartyNickname
writetext UseSweetScentText
2015-11-25 15:16:29 +00:00
waitbutton
2015-11-12 04:38:57 +00:00
callasm SweetScentEncounter
2017-10-25 04:14:05 +00:00
iffalse SweetScentNothing
2015-11-12 04:38:57 +00:00
checkflag ENGINE_BUG_CONTEST_TIMER
2017-10-25 04:14:05 +00:00
iftrue .BugCatchingContest
randomwildmon
2015-11-12 04:38:57 +00:00
startbattle
reloadmapafterbattle
2015-11-12 04:38:57 +00:00
end
.BugCatchingContest:
farsjump BugCatchingContestBattleScript
2015-11-12 04:38:57 +00:00
SweetScentNothing:
writetext SweetScentNothingText
2015-11-25 15:16:29 +00:00
waitbutton
2015-11-12 04:38:57 +00:00
closetext
end
2018-06-24 14:09:41 +00:00
SweetScentEncounter:
2017-12-24 17:47:30 +00:00
farcall CanUseSweetScent
2015-11-12 04:38:57 +00:00
jr nc, .no_battle
ld hl, wStatusFlags2
2018-01-22 20:40:43 +00:00
bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
2015-11-12 04:38:57 +00:00
jr nz, .not_in_bug_contest
2017-12-24 17:47:30 +00:00
farcall GetMapEncounterRate
2015-11-12 04:38:57 +00:00
ld a, b
and a
jr z, .no_battle
2017-12-24 17:47:30 +00:00
farcall ChooseWildEncounter
2015-11-12 04:38:57 +00:00
jr nz, .no_battle
jr .start_battle
.not_in_bug_contest
2017-12-24 17:47:30 +00:00
farcall ChooseWildEncounter_BugContest
2015-11-12 04:38:57 +00:00
.start_battle
ld a, $1
2018-01-23 22:39:09 +00:00
ld [wScriptVar], a
2015-11-12 04:38:57 +00:00
ret
.no_battle
xor a
2018-01-23 22:39:09 +00:00
ld [wScriptVar], a
ld [wBattleType], a
2015-11-12 04:38:57 +00:00
ret
UseSweetScentText:
text_far _UseSweetScentText
text_end
2015-11-12 04:38:57 +00:00
SweetScentNothingText:
text_far _SweetScentNothingText
text_end