2015-02-11 23:09:35 +00:00
|
|
|
Special:: ; c01b
|
|
|
|
; Run script special de.
|
|
|
|
ld hl, SpecialsPointers
|
2017-12-09 05:50:59 +00:00
|
|
|
add hl, de
|
|
|
|
add hl, de
|
|
|
|
add hl, de
|
2015-02-11 23:09:35 +00:00
|
|
|
ld b, [hl]
|
|
|
|
inc hl
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
ld a, b
|
|
|
|
rst FarCall
|
|
|
|
ret
|
|
|
|
; c029
|
|
|
|
|
2018-01-15 19:11:11 +00:00
|
|
|
INCLUDE "data/special_pointers.asm"
|
2015-02-11 23:09:35 +00:00
|
|
|
|
2018-01-05 10:05:01 +00:00
|
|
|
DummySpecial_c224: ; c224
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
; c225
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
SetPlayerPalette: ; c225
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wScriptVar]
|
2015-02-11 23:09:35 +00:00
|
|
|
ld d, a
|
2018-01-24 16:12:02 +00:00
|
|
|
farcall _SetPlayerPalette
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
; c230
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
GameCornerPrizeMonCheckDex: ; c230
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wScriptVar]
|
2015-02-11 23:09:35 +00:00
|
|
|
dec a
|
|
|
|
call CheckCaughtMon
|
|
|
|
ret nz
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wScriptVar]
|
2015-02-11 23:09:35 +00:00
|
|
|
dec a
|
|
|
|
call SetSeenAndCaughtMon
|
|
|
|
call FadeToMenu
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wScriptVar]
|
2015-02-11 23:09:35 +00:00
|
|
|
ld [wd265], a
|
2018-01-16 19:30:10 +00:00
|
|
|
farcall NewPokedexEntry
|
2015-11-17 22:56:49 +00:00
|
|
|
call ExitAllMenus
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
; c252
|
|
|
|
|
2018-01-24 16:20:41 +00:00
|
|
|
UnusedSetSeenMon: ; c252
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wScriptVar]
|
2015-02-11 23:09:35 +00:00
|
|
|
dec a
|
|
|
|
call SetSeenMon
|
|
|
|
ret
|
|
|
|
; c25a
|
|
|
|
|
2018-02-26 00:23:01 +00:00
|
|
|
FindPartyMonAboveLevel: ; c25a
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wScriptVar]
|
2015-02-11 23:09:35 +00:00
|
|
|
ld b, a
|
2018-02-26 00:23:01 +00:00
|
|
|
farcall _FindPartyMonAboveLevel
|
2015-10-01 20:55:24 +00:00
|
|
|
jr z, FoundNone
|
|
|
|
jr FoundOne
|
2015-02-11 23:09:35 +00:00
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
FindPartyMonAtLeastThatHappy: ; c268
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wScriptVar]
|
2015-02-11 23:09:35 +00:00
|
|
|
ld b, a
|
2018-01-24 16:12:02 +00:00
|
|
|
farcall _FindPartyMonAtLeastThatHappy
|
2015-10-01 20:55:24 +00:00
|
|
|
jr z, FoundNone
|
|
|
|
jr FoundOne
|
2015-02-11 23:09:35 +00:00
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
FindPartyMonThatSpecies: ; c276
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wScriptVar]
|
2015-02-11 23:09:35 +00:00
|
|
|
ld b, a
|
2018-01-24 16:12:02 +00:00
|
|
|
farcall _FindPartyMonThatSpecies
|
2015-10-01 20:55:24 +00:00
|
|
|
jr z, FoundNone
|
|
|
|
jr FoundOne
|
2015-02-11 23:09:35 +00:00
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
FindPartyMonThatSpeciesYourTrainerID: ; c284
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wScriptVar]
|
2015-02-11 23:09:35 +00:00
|
|
|
ld b, a
|
2018-01-24 16:12:02 +00:00
|
|
|
farcall _FindPartyMonThatSpeciesYourTrainerID
|
2015-10-01 20:55:24 +00:00
|
|
|
jr z, FoundNone
|
|
|
|
jr FoundOne
|
2015-02-11 23:09:35 +00:00
|
|
|
|
2015-10-01 20:55:24 +00:00
|
|
|
FoundOne: ; c292
|
2015-12-11 16:50:49 +00:00
|
|
|
ld a, TRUE
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wScriptVar], a
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
|
2015-10-01 20:55:24 +00:00
|
|
|
FoundNone: ; c298
|
2015-02-11 23:09:35 +00:00
|
|
|
xor a
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wScriptVar], a
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
; c29d
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
NameRival: ; 0xc29d
|
2015-02-11 23:09:35 +00:00
|
|
|
ld b, $2 ; rival
|
2018-01-23 22:39:09 +00:00
|
|
|
ld de, wRivalName
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall _NamingScreen
|
2015-02-11 23:09:35 +00:00
|
|
|
; default to "SILVER"
|
2018-01-23 22:39:09 +00:00
|
|
|
ld hl, wRivalName
|
2018-06-01 07:04:36 +00:00
|
|
|
ld de, .default
|
2015-02-11 23:09:35 +00:00
|
|
|
call InitName
|
|
|
|
ret
|
|
|
|
|
2018-06-01 07:04:36 +00:00
|
|
|
.default
|
2015-02-11 23:09:35 +00:00
|
|
|
db "SILVER@"
|
2018-06-01 07:04:36 +00:00
|
|
|
; 0xc2b9
|
2015-02-11 23:09:35 +00:00
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
NameRater: ; c2b9
|
2018-01-24 16:12:02 +00:00
|
|
|
farcall _NameRater
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
; c2c0
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
OverworldTownMap: ; c2c0
|
2015-02-11 23:09:35 +00:00
|
|
|
call FadeToMenu
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall _TownMap
|
2015-11-17 22:56:49 +00:00
|
|
|
call ExitAllMenus
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
; c2cd
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
UnownPrinter: ; c2cd
|
2015-02-11 23:09:35 +00:00
|
|
|
call FadeToMenu
|
2018-01-24 16:12:02 +00:00
|
|
|
farcall _UnownPrinter
|
2015-11-17 22:56:49 +00:00
|
|
|
call ExitAllMenus
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
; c2da
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
DisplayLinkRecord: ; c2da
|
2015-02-11 23:09:35 +00:00
|
|
|
call FadeToMenu
|
2018-01-24 16:12:02 +00:00
|
|
|
farcall _DisplayLinkRecord
|
2015-11-17 22:56:49 +00:00
|
|
|
call ExitAllMenus
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
; c2e7
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
PlayersHousePC: ; c2e7
|
2015-02-11 23:09:35 +00:00
|
|
|
xor a
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wScriptVar], a
|
2018-01-23 00:10:09 +00:00
|
|
|
farcall _PlayersHousePC
|
2015-02-11 23:09:35 +00:00
|
|
|
ld a, c
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wScriptVar], a
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
; c2f6
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
CheckMysteryGift: ; c2f6
|
2015-10-04 18:14:51 +00:00
|
|
|
ld a, BANK(sMysteryGiftItem)
|
2015-02-11 23:09:35 +00:00
|
|
|
call GetSRAMBank
|
2015-10-04 18:14:51 +00:00
|
|
|
ld a, [sMysteryGiftItem]
|
2015-02-11 23:09:35 +00:00
|
|
|
and a
|
2015-07-16 22:10:10 +00:00
|
|
|
jr z, .no
|
2015-02-11 23:09:35 +00:00
|
|
|
inc a
|
|
|
|
|
2015-07-16 22:10:10 +00:00
|
|
|
.no
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wScriptVar], a
|
2015-02-11 23:09:35 +00:00
|
|
|
call CloseSRAM
|
|
|
|
ret
|
|
|
|
; c309
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
GetMysteryGiftItem: ; c309
|
2015-10-04 18:14:51 +00:00
|
|
|
ld a, BANK(sMysteryGiftItem)
|
2015-02-11 23:09:35 +00:00
|
|
|
call GetSRAMBank
|
2015-10-04 18:14:51 +00:00
|
|
|
ld a, [sMysteryGiftItem]
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wCurItem], a
|
2015-12-11 16:50:49 +00:00
|
|
|
ld a, 1
|
2015-11-01 23:13:31 +00:00
|
|
|
ld [wItemQuantityChangeBuffer], a
|
2018-01-23 22:39:09 +00:00
|
|
|
ld hl, wNumItems
|
2015-02-11 23:09:35 +00:00
|
|
|
call ReceiveItem
|
2015-12-11 16:50:49 +00:00
|
|
|
jr nc, .no_room
|
2015-02-11 23:09:35 +00:00
|
|
|
xor a
|
2015-10-04 18:14:51 +00:00
|
|
|
ld [sMysteryGiftItem], a
|
2015-02-11 23:09:35 +00:00
|
|
|
call CloseSRAM
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wCurItem]
|
2015-02-11 23:09:35 +00:00
|
|
|
ld [wd265], a
|
|
|
|
call GetItemName
|
2015-10-04 18:14:51 +00:00
|
|
|
ld hl, .ReceiveItemText
|
2015-02-11 23:09:35 +00:00
|
|
|
call PrintText
|
2015-12-11 16:50:49 +00:00
|
|
|
ld a, TRUE
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wScriptVar], a
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-11 16:50:49 +00:00
|
|
|
.no_room
|
2015-02-11 23:09:35 +00:00
|
|
|
call CloseSRAM
|
|
|
|
xor a
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wScriptVar], a
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
; c345
|
|
|
|
|
2015-10-04 18:14:51 +00:00
|
|
|
.ReceiveItemText: ; 0xc345
|
2015-02-11 23:09:35 +00:00
|
|
|
; received item
|
|
|
|
text_jump UnknownText_0x1bd3be
|
|
|
|
db "@"
|
|
|
|
; 0xc34a
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
BugContestJudging: ; c34a
|
2018-01-15 15:55:44 +00:00
|
|
|
farcall _BugContestJudging
|
2015-02-11 23:09:35 +00:00
|
|
|
ld a, b
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wScriptVar], a
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
; c355
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
MapRadio: ; c355
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wScriptVar]
|
2015-02-11 23:09:35 +00:00
|
|
|
ld e, a
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall PlayRadio
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
; c360
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
UnownPuzzle: ; c360
|
2015-02-11 23:09:35 +00:00
|
|
|
call FadeToMenu
|
2018-01-24 16:12:02 +00:00
|
|
|
farcall _UnownPuzzle
|
2015-12-11 16:33:14 +00:00
|
|
|
ld a, [wSolvedUnownPuzzle]
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wScriptVar], a
|
2015-11-17 22:56:49 +00:00
|
|
|
call ExitAllMenus
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
; c373
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
SlotMachine: ; c373
|
|
|
|
call CheckCoinsAndCoinCase
|
2015-02-11 23:09:35 +00:00
|
|
|
ret c
|
2015-07-20 22:59:26 +00:00
|
|
|
ld a, BANK(_SlotMachine)
|
|
|
|
ld hl, _SlotMachine
|
2018-01-24 16:17:05 +00:00
|
|
|
call StartGameCornerGame
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
; c380
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
CardFlip: ; c380
|
|
|
|
call CheckCoinsAndCoinCase
|
2015-02-11 23:09:35 +00:00
|
|
|
ret c
|
2015-07-20 22:59:26 +00:00
|
|
|
ld a, BANK(_CardFlip)
|
|
|
|
ld hl, _CardFlip
|
2018-01-24 16:17:05 +00:00
|
|
|
call StartGameCornerGame
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
; c38d
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
DummyNonfunctionalGameCornerGame: ; c38d
|
|
|
|
call CheckCoinsAndCoinCase
|
2015-02-11 23:09:35 +00:00
|
|
|
ret c
|
2015-07-20 22:59:26 +00:00
|
|
|
ld a, BANK(_DummyGame)
|
|
|
|
ld hl, _DummyGame
|
2018-01-24 16:17:05 +00:00
|
|
|
call StartGameCornerGame
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
; c39a
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
StartGameCornerGame: ; c39a
|
2015-11-01 17:44:30 +00:00
|
|
|
call FarQueueScript
|
2015-02-11 23:09:35 +00:00
|
|
|
call FadeToMenu
|
2015-11-01 17:44:30 +00:00
|
|
|
ld hl, wQueuedScriptBank
|
2015-02-11 23:09:35 +00:00
|
|
|
ld a, [hli]
|
|
|
|
push af
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
pop af
|
|
|
|
rst FarCall
|
2015-11-17 22:56:49 +00:00
|
|
|
call ExitAllMenus
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
; c3ae
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
CheckCoinsAndCoinCase: ; c3ae
|
2018-01-23 21:45:34 +00:00
|
|
|
ld hl, wCoins
|
2015-02-11 23:09:35 +00:00
|
|
|
ld a, [hli]
|
|
|
|
or [hl]
|
2015-12-11 16:50:49 +00:00
|
|
|
jr z, .no_coins
|
2015-02-11 23:09:35 +00:00
|
|
|
ld a, COIN_CASE
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wCurItem], a
|
|
|
|
ld hl, wNumItems
|
2015-02-11 23:09:35 +00:00
|
|
|
call CheckItem
|
2015-12-11 16:50:49 +00:00
|
|
|
jr nc, .no_coin_case
|
2015-02-11 23:09:35 +00:00
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
2015-12-11 16:50:49 +00:00
|
|
|
.no_coins
|
|
|
|
ld hl, .NoCoinsText
|
|
|
|
jr .print
|
2015-02-11 23:09:35 +00:00
|
|
|
|
2015-12-11 16:50:49 +00:00
|
|
|
.no_coin_case
|
|
|
|
ld hl, .NoCoinCaseText
|
2015-02-11 23:09:35 +00:00
|
|
|
|
2015-12-11 16:50:49 +00:00
|
|
|
.print
|
2015-02-11 23:09:35 +00:00
|
|
|
call PrintText
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
; c3d1
|
|
|
|
|
2015-12-11 16:50:49 +00:00
|
|
|
.NoCoinsText: ; 0xc3d1
|
2015-02-11 23:09:35 +00:00
|
|
|
; You have no coins.
|
|
|
|
text_jump UnknownText_0x1bd3d7
|
|
|
|
db "@"
|
|
|
|
; 0xc3d6
|
|
|
|
|
2015-12-11 16:50:49 +00:00
|
|
|
.NoCoinCaseText: ; 0xc3d6
|
2015-02-11 23:09:35 +00:00
|
|
|
; You don't have a COIN CASE.
|
|
|
|
text_jump UnknownText_0x1bd3eb
|
|
|
|
db "@"
|
|
|
|
; 0xc3db
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
ClearBGPalettesBufferScreen: ; c3db
|
2015-11-12 04:38:57 +00:00
|
|
|
call ClearBGPalettes
|
2015-07-15 19:48:44 +00:00
|
|
|
call BufferScreen
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
; c3e2
|
|
|
|
|
|
|
|
ScriptReturnCarry: ; c3e2
|
|
|
|
jr c, .carry
|
|
|
|
xor a
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wScriptVar], a
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
.carry
|
|
|
|
ld a, 1
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wScriptVar], a
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
; c3ef
|
|
|
|
|
2018-01-24 16:20:41 +00:00
|
|
|
UnusedCheckUnusedTwoDayTimer: ; c3ef
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall CheckUnusedTwoDayTimer
|
2015-10-24 14:34:19 +00:00
|
|
|
ld a, [wUnusedTwoDayTimer]
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wScriptVar], a
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
; c3fc
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
ActivateFishingSwarm: ; c3fc
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wScriptVar]
|
2015-10-16 17:35:43 +00:00
|
|
|
ld [wFishingSwarmFlag], a
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
; c403
|
|
|
|
|
|
|
|
|
2015-12-09 16:38:40 +00:00
|
|
|
StoreSwarmMapIndices:: ; c403
|
2015-02-11 23:09:35 +00:00
|
|
|
ld a, c
|
|
|
|
and a
|
2015-12-09 16:38:40 +00:00
|
|
|
jr nz, .yanma
|
2015-07-15 19:48:44 +00:00
|
|
|
; swarm dark cave violet entrance
|
2015-02-11 23:09:35 +00:00
|
|
|
ld a, d
|
2015-12-09 16:38:40 +00:00
|
|
|
ld [wDunsparceMapGroup], a
|
2015-02-11 23:09:35 +00:00
|
|
|
ld a, e
|
2015-12-09 16:38:40 +00:00
|
|
|
ld [wDunsparceMapNumber], a
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
|
2015-12-09 16:38:40 +00:00
|
|
|
.yanma
|
2015-02-11 23:09:35 +00:00
|
|
|
ld a, d
|
2015-12-09 16:38:40 +00:00
|
|
|
ld [wYanmaMapGroup], a
|
2015-02-11 23:09:35 +00:00
|
|
|
ld a, e
|
2015-12-09 16:38:40 +00:00
|
|
|
ld [wYanmaMapNumber], a
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
; c419
|
|
|
|
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
CheckPokerus: ; c419
|
2015-02-11 23:09:35 +00:00
|
|
|
; Check if a monster in your party has Pokerus
|
2018-01-24 16:12:02 +00:00
|
|
|
farcall _CheckPokerus
|
2015-02-11 23:09:35 +00:00
|
|
|
jp ScriptReturnCarry
|
|
|
|
; c422
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
ResetLuckyNumberShowFlag: ; c422
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall RestartLuckyNumberCountdown
|
2015-10-10 21:03:04 +00:00
|
|
|
ld hl, wLuckyNumberShowFlag
|
2018-01-22 19:34:55 +00:00
|
|
|
res LUCKYNUMBERSHOW_GAME_OVER_F, [hl]
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall LoadOrRegenerateLuckyIDNumber
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
; c434
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
CheckLuckyNumberShowFlag: ; c434
|
2018-01-24 16:12:02 +00:00
|
|
|
farcall _CheckLuckyNumberShowFlag
|
2015-02-11 23:09:35 +00:00
|
|
|
jp ScriptReturnCarry
|
|
|
|
; c43d
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
SnorlaxAwake: ; 0xc43d
|
2015-02-11 23:09:35 +00:00
|
|
|
; Check if the Poké Flute channel is playing, and if the player is standing
|
|
|
|
; next to Snorlax.
|
|
|
|
|
|
|
|
; outputs:
|
2018-01-23 22:39:09 +00:00
|
|
|
; wScriptVar is 1 if the conditions are met, otherwise 0.
|
2015-02-11 23:09:35 +00:00
|
|
|
|
|
|
|
; check background music
|
|
|
|
ld a, [wMapMusic]
|
|
|
|
cp MUSIC_POKE_FLUTE_CHANNEL
|
|
|
|
jr nz, .nope
|
|
|
|
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wXCoord]
|
2015-02-11 23:09:35 +00:00
|
|
|
ld b, a
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wYCoord]
|
2015-02-11 23:09:35 +00:00
|
|
|
ld c, a
|
|
|
|
|
|
|
|
ld hl, .ProximityCoords
|
|
|
|
.loop
|
|
|
|
ld a, [hli]
|
2015-12-11 16:50:49 +00:00
|
|
|
cp -1
|
2015-02-11 23:09:35 +00:00
|
|
|
jr z, .nope
|
|
|
|
cp b
|
|
|
|
jr nz, .nextcoord
|
|
|
|
ld a, [hli]
|
|
|
|
cp c
|
|
|
|
jr nz, .loop
|
|
|
|
|
2015-12-11 16:50:49 +00:00
|
|
|
ld a, TRUE
|
2015-02-11 23:09:35 +00:00
|
|
|
jr .done
|
|
|
|
|
|
|
|
.nextcoord
|
|
|
|
inc hl
|
|
|
|
jr .loop
|
|
|
|
|
|
|
|
.nope
|
|
|
|
xor a
|
|
|
|
.done
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wScriptVar], a
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
.ProximityCoords:
|
2015-02-11 23:09:35 +00:00
|
|
|
; x, y
|
|
|
|
db 33, 8 ; left
|
|
|
|
db 34, 10 ; below
|
|
|
|
db 35, 10 ; below
|
|
|
|
db 36, 8 ; right
|
|
|
|
db 36, 9 ; right
|
2015-12-11 16:50:49 +00:00
|
|
|
db -1
|
2015-02-11 23:09:35 +00:00
|
|
|
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
PlayCurMonCry: ; c472
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wCurPartySpecies]
|
2018-01-17 04:47:45 +00:00
|
|
|
jp PlayMonCry
|
2015-02-11 23:09:35 +00:00
|
|
|
; c478
|
|
|
|
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
GameboyCheck: ; c478
|
2015-02-11 23:09:35 +00:00
|
|
|
ld a, [hCGB]
|
|
|
|
and a
|
|
|
|
jr nz, .cgb
|
|
|
|
|
|
|
|
ld a, [hSGB]
|
|
|
|
and a
|
|
|
|
jr nz, .sgb
|
|
|
|
|
|
|
|
.gb
|
2018-01-12 06:40:20 +00:00
|
|
|
xor a ; GBCHECK_GB
|
2015-02-11 23:09:35 +00:00
|
|
|
jr .done
|
|
|
|
.sgb
|
2018-01-12 06:40:20 +00:00
|
|
|
ld a, GBCHECK_SGB
|
2015-02-11 23:09:35 +00:00
|
|
|
jr .done
|
|
|
|
.cgb
|
2018-01-12 06:40:20 +00:00
|
|
|
ld a, GBCHECK_CGB
|
2015-02-11 23:09:35 +00:00
|
|
|
.done
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wScriptVar], a
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
FadeOutMusic: ; c48f
|
2017-12-25 18:40:10 +00:00
|
|
|
ld a, LOW(MUSIC_NONE)
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wMusicFadeID], a
|
2017-12-25 18:40:10 +00:00
|
|
|
ld a, HIGH(MUSIC_NONE)
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wMusicFadeID + 1], a
|
2015-02-11 23:09:35 +00:00
|
|
|
ld a, $2
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wMusicFade], a
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
; c49f
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
Diploma: ; c49f
|
2015-02-11 23:09:35 +00:00
|
|
|
call FadeToMenu
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall _Diploma
|
2015-11-17 22:56:49 +00:00
|
|
|
call ExitAllMenus
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
; c4ac
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
PrintDiploma: ; c4ac
|
2015-02-11 23:09:35 +00:00
|
|
|
call FadeToMenu
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall _PrintDiploma
|
2015-11-17 22:56:49 +00:00
|
|
|
call ExitAllMenus
|
2015-02-11 23:09:35 +00:00
|
|
|
ret
|
|
|
|
; c4b9
|
|
|
|
|
2018-01-24 16:17:05 +00:00
|
|
|
TrainerHouse: ; 0xc4b9
|
2015-10-04 18:14:51 +00:00
|
|
|
ld a, BANK(sMysteryGiftTrainerHouseFlag)
|
2015-02-11 23:09:35 +00:00
|
|
|
call GetSRAMBank
|
2015-10-04 18:14:51 +00:00
|
|
|
ld a, [sMysteryGiftTrainerHouseFlag]
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wScriptVar], a
|
2015-02-11 23:09:35 +00:00
|
|
|
jp CloseSRAM
|