2019-02-16 17:17:55 +00:00
|
|
|
TRADEANIM_RIGHT_ARROW EQU "▶" ; $ed
|
|
|
|
TRADEANIM_LEFT_ARROW EQU "▼" ; $ee
|
2018-01-11 17:00:01 +00:00
|
|
|
|
|
|
|
; TradeAnim_TubeAnimJumptable.Jumptable indexes
|
|
|
|
const_def
|
|
|
|
const TRADEANIMSTATE_0 ; 0
|
|
|
|
const TRADEANIMSTATE_1 ; 1
|
|
|
|
const TRADEANIMSTATE_2 ; 2
|
|
|
|
const TRADEANIMSTATE_3 ; 3
|
|
|
|
TRADEANIMJUMPTABLE_LENGTH EQU const_value
|
|
|
|
|
2020-07-17 20:43:41 +00:00
|
|
|
add_tradeanim: MACRO
|
|
|
|
\1_TradeCmd:
|
|
|
|
dw \1
|
|
|
|
ENDM
|
|
|
|
|
|
|
|
tradeanim: MACRO
|
|
|
|
db (\1_TradeCmd - DoTradeAnimation.JumpTable) / 2
|
|
|
|
ENDM
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnimation:
|
2015-11-23 05:21:21 +00:00
|
|
|
xor a
|
2020-10-28 17:35:39 +00:00
|
|
|
ld [wUnusedTradeAnimPlayEvolutionMusic], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ld hl, wPlayerTrademonSenderName
|
|
|
|
ld de, wOTTrademonSenderName
|
2016-01-09 21:28:22 +00:00
|
|
|
call LinkTradeAnim_LoadTradePlayerNames
|
2015-11-23 05:21:21 +00:00
|
|
|
ld hl, wPlayerTrademonSpecies
|
|
|
|
ld de, wOTTrademonSpecies
|
2016-01-09 21:28:22 +00:00
|
|
|
call LinkTradeAnim_LoadTradeMonSpecies
|
2016-05-14 03:23:26 +00:00
|
|
|
ld de, .script
|
|
|
|
jr RunTradeAnimScript
|
2015-11-23 05:21:21 +00:00
|
|
|
|
2016-05-14 03:23:26 +00:00
|
|
|
.script
|
2020-07-17 20:43:41 +00:00
|
|
|
tradeanim TradeAnim_SetupGivemonScroll
|
|
|
|
tradeanim TradeAnim_ShowGivemonData
|
|
|
|
tradeanim TradeAnim_DoGivemonScroll
|
|
|
|
tradeanim TradeAnim_Wait80
|
|
|
|
tradeanim TradeAnim_Wait96
|
|
|
|
tradeanim TradeAnim_Poof
|
|
|
|
tradeanim TradeAnim_RockingBall
|
|
|
|
tradeanim TradeAnim_EnterLinkTube1
|
|
|
|
tradeanim TradeAnim_WaitAnim
|
|
|
|
tradeanim TradeAnim_BulgeThroughTube
|
|
|
|
tradeanim TradeAnim_WaitAnim
|
|
|
|
tradeanim TradeAnim_TextboxScrollStart
|
|
|
|
tradeanim TradeAnim_GiveTrademonSFX
|
|
|
|
tradeanim TradeAnim_TubeToOT1
|
|
|
|
tradeanim TradeAnim_SentToOTText
|
|
|
|
tradeanim TradeAnim_ScrollOutRight
|
|
|
|
|
|
|
|
tradeanim TradeAnim_OTSendsText1
|
|
|
|
tradeanim TradeAnim_OTBidsFarewell
|
|
|
|
tradeanim TradeAnim_Wait40
|
|
|
|
tradeanim TradeAnim_ScrollOutRight
|
|
|
|
tradeanim TradeAnim_GetTrademonSFX
|
|
|
|
tradeanim TradeAnim_TubeToPlayer1
|
|
|
|
tradeanim TradeAnim_EnterLinkTube1
|
|
|
|
tradeanim TradeAnim_DropBall
|
|
|
|
tradeanim TradeAnim_ExitLinkTube
|
|
|
|
tradeanim TradeAnim_WaitAnim
|
|
|
|
tradeanim TradeAnim_ShowGetmonData
|
|
|
|
tradeanim TradeAnim_Poof
|
|
|
|
tradeanim TradeAnim_WaitAnim
|
|
|
|
tradeanim TradeAnim_FrontpicScrollStart
|
|
|
|
tradeanim TradeAnim_AnimateFrontpic
|
|
|
|
tradeanim TradeAnim_Wait80IfOTEgg
|
|
|
|
tradeanim TradeAnim_TextboxScrollStart
|
|
|
|
tradeanim TradeAnim_TakeCareOfText
|
|
|
|
tradeanim TradeAnim_ScrollOutRight
|
|
|
|
tradeanim TradeAnim_End
|
2015-11-23 05:21:21 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnimationPlayer2:
|
2015-11-23 05:21:21 +00:00
|
|
|
xor a
|
2020-10-28 17:35:39 +00:00
|
|
|
ld [wUnusedTradeAnimPlayEvolutionMusic], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ld hl, wOTTrademonSenderName
|
|
|
|
ld de, wPlayerTrademonSenderName
|
2016-01-09 21:28:22 +00:00
|
|
|
call LinkTradeAnim_LoadTradePlayerNames
|
2015-11-23 05:21:21 +00:00
|
|
|
ld hl, wOTTrademonSpecies
|
|
|
|
ld de, wPlayerTrademonSpecies
|
2016-01-09 21:28:22 +00:00
|
|
|
call LinkTradeAnim_LoadTradeMonSpecies
|
2016-05-14 03:23:26 +00:00
|
|
|
ld de, .script
|
|
|
|
jr RunTradeAnimScript
|
2015-11-23 05:21:21 +00:00
|
|
|
|
2016-05-14 03:23:26 +00:00
|
|
|
.script
|
2020-07-17 20:43:41 +00:00
|
|
|
tradeanim TradeAnim_OTSendsText2
|
|
|
|
tradeanim TradeAnim_OTBidsFarewell
|
|
|
|
tradeanim TradeAnim_Wait40
|
|
|
|
tradeanim TradeAnim_ScrollOutRight
|
|
|
|
tradeanim TradeAnim_GetTrademonSFX
|
|
|
|
tradeanim TradeAnim_TubeToOT1
|
|
|
|
tradeanim TradeAnim_EnterLinkTube1
|
|
|
|
tradeanim TradeAnim_DropBall
|
|
|
|
tradeanim TradeAnim_ExitLinkTube
|
|
|
|
tradeanim TradeAnim_WaitAnim
|
|
|
|
tradeanim TradeAnim_ShowGetmonData
|
|
|
|
tradeanim TradeAnim_Poof
|
|
|
|
tradeanim TradeAnim_WaitAnim
|
|
|
|
tradeanim TradeAnim_FrontpicScrollStart
|
|
|
|
tradeanim TradeAnim_AnimateFrontpic
|
|
|
|
tradeanim TradeAnim_Wait180IfOTEgg
|
|
|
|
tradeanim TradeAnim_TextboxScrollStart
|
|
|
|
tradeanim TradeAnim_TakeCareOfText
|
|
|
|
tradeanim TradeAnim_ScrollOutRight
|
|
|
|
|
|
|
|
tradeanim TradeAnim_SetupGivemonScroll
|
|
|
|
tradeanim TradeAnim_ShowGivemonData
|
|
|
|
tradeanim TradeAnim_DoGivemonScroll
|
|
|
|
tradeanim TradeAnim_Wait40
|
|
|
|
tradeanim TradeAnim_Poof
|
|
|
|
tradeanim TradeAnim_RockingBall
|
|
|
|
tradeanim TradeAnim_EnterLinkTube1
|
|
|
|
tradeanim TradeAnim_WaitAnim
|
|
|
|
tradeanim TradeAnim_BulgeThroughTube
|
|
|
|
tradeanim TradeAnim_WaitAnim
|
|
|
|
tradeanim TradeAnim_TextboxScrollStart
|
|
|
|
tradeanim TradeAnim_GiveTrademonSFX
|
|
|
|
tradeanim TradeAnim_TubeToPlayer1
|
|
|
|
tradeanim TradeAnim_SentToOTText
|
|
|
|
tradeanim TradeAnim_ScrollOutRight
|
|
|
|
tradeanim TradeAnim_End
|
2015-11-23 05:21:21 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
RunTradeAnimScript:
|
2017-12-09 19:22:58 +00:00
|
|
|
ld hl, wTradeAnimAddress
|
2015-11-23 05:21:21 +00:00
|
|
|
ld [hl], e
|
|
|
|
inc hl
|
|
|
|
ld [hl], d
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hMapAnims]
|
2015-11-23 05:21:21 +00:00
|
|
|
push af
|
|
|
|
xor a
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hMapAnims], a
|
2018-01-23 22:39:09 +00:00
|
|
|
ld hl, wVramState
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [hl]
|
|
|
|
push af
|
|
|
|
res 0, [hl]
|
2018-01-23 22:39:09 +00:00
|
|
|
ld hl, wOptions
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [hl]
|
|
|
|
push af
|
2018-04-05 15:44:02 +00:00
|
|
|
set NO_TEXT_SCROLL, [hl]
|
2016-01-09 21:28:22 +00:00
|
|
|
call .TradeAnimLayout
|
2020-10-28 17:35:39 +00:00
|
|
|
ld a, [wUnusedTradeAnimPlayEvolutionMusic]
|
2015-11-23 05:21:21 +00:00
|
|
|
and a
|
|
|
|
jr nz, .anim_loop
|
|
|
|
ld de, MUSIC_EVOLUTION
|
|
|
|
call PlayMusic2
|
|
|
|
.anim_loop
|
|
|
|
call DoTradeAnimation
|
|
|
|
jr nc, .anim_loop
|
|
|
|
pop af
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wOptions], a
|
2015-11-23 05:21:21 +00:00
|
|
|
pop af
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wVramState], a
|
2015-11-23 05:21:21 +00:00
|
|
|
pop af
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hMapAnims], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.TradeAnimLayout:
|
2015-11-23 05:21:21 +00:00
|
|
|
xor a
|
|
|
|
ld [wJumptableIndex], a
|
|
|
|
call ClearBGPalettes
|
|
|
|
call ClearSprites
|
2020-02-13 17:30:13 +00:00
|
|
|
call ClearTilemap
|
2015-11-23 05:21:21 +00:00
|
|
|
call DisableLCD
|
|
|
|
call LoadFontsBattleExtra
|
2017-12-24 17:47:30 +00:00
|
|
|
callfar ClearSpriteAnims
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hCGB]
|
2015-11-23 05:21:21 +00:00
|
|
|
and a
|
2016-01-09 21:28:22 +00:00
|
|
|
jr z, .NotCGB
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, $1
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [rVBK], a
|
2017-12-28 12:32:33 +00:00
|
|
|
ld hl, vTiles0
|
|
|
|
ld bc, sScratch - vTiles0
|
2015-11-23 05:21:21 +00:00
|
|
|
xor a
|
|
|
|
call ByteFill
|
|
|
|
ld a, $0
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [rVBK], a
|
2015-11-23 05:21:21 +00:00
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
.NotCGB:
|
2015-11-23 05:21:21 +00:00
|
|
|
hlbgcoord 0, 0
|
2017-12-28 12:32:33 +00:00
|
|
|
ld bc, sScratch - vBGMap0
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, " "
|
|
|
|
call ByteFill
|
|
|
|
ld hl, TradeGameBoyLZ
|
2017-12-28 12:32:33 +00:00
|
|
|
ld de, vTiles2 tile $31
|
2015-11-23 05:21:21 +00:00
|
|
|
call Decompress
|
2020-03-01 22:00:57 +00:00
|
|
|
ld hl, TradeArrowRightGFX
|
2018-01-11 17:00:01 +00:00
|
|
|
ld de, vTiles0 tile TRADEANIM_RIGHT_ARROW
|
|
|
|
ld bc, 1 tiles
|
2020-03-01 22:00:57 +00:00
|
|
|
ld a, BANK(TradeArrowRightGFX)
|
2015-11-23 05:21:21 +00:00
|
|
|
call FarCopyBytes
|
2020-03-01 22:00:57 +00:00
|
|
|
ld hl, TradeArrowLeftGFX
|
2018-01-11 17:00:01 +00:00
|
|
|
ld de, vTiles0 tile TRADEANIM_LEFT_ARROW
|
|
|
|
ld bc, 1 tiles
|
2020-03-01 22:00:57 +00:00
|
|
|
ld a, BANK(TradeArrowLeftGFX)
|
2015-11-23 05:21:21 +00:00
|
|
|
call FarCopyBytes
|
|
|
|
xor a
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hSCX], a
|
|
|
|
ldh [hSCY], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, $7
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hWX], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, $90
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hWY], a
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall GetTrademonFrontpic
|
2015-11-23 05:21:21 +00:00
|
|
|
call EnableLCD
|
2016-01-09 21:28:22 +00:00
|
|
|
call LoadTradeBallAndCableGFX
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [wPlayerTrademonSpecies]
|
|
|
|
ld hl, wPlayerTrademonDVs
|
2017-12-28 12:32:33 +00:00
|
|
|
ld de, vTiles0
|
2015-12-17 18:49:26 +00:00
|
|
|
call TradeAnim_GetFrontpic
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [wOTTrademonSpecies]
|
|
|
|
ld hl, wOTTrademonDVs
|
2017-12-28 12:32:33 +00:00
|
|
|
ld de, vTiles0 tile $31
|
2015-12-17 18:49:26 +00:00
|
|
|
call TradeAnim_GetFrontpic
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [wPlayerTrademonSpecies]
|
|
|
|
ld de, wPlayerTrademonSpeciesName
|
2015-12-17 18:49:26 +00:00
|
|
|
call TradeAnim_GetNickname
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [wOTTrademonSpecies]
|
|
|
|
ld de, wOTTrademonSpeciesName
|
2015-12-17 18:49:26 +00:00
|
|
|
call TradeAnim_GetNickname
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_NormalPals
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
DoTradeAnimation:
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [wJumptableIndex]
|
|
|
|
bit 7, a
|
|
|
|
jr nz, .finished
|
|
|
|
call .DoTradeAnimCommand
|
2017-12-24 17:47:30 +00:00
|
|
|
callfar PlaySpriteAnimations
|
2020-10-28 17:35:39 +00:00
|
|
|
ld hl, wFrameCounter2
|
2015-11-23 05:21:21 +00:00
|
|
|
inc [hl]
|
|
|
|
call DelayFrame
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.finished
|
|
|
|
call LoadStandardFont
|
|
|
|
scf
|
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.DoTradeAnimCommand:
|
2020-07-01 17:13:49 +00:00
|
|
|
jumptable .JumpTable, wJumptableIndex
|
2015-11-23 05:21:21 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.JumpTable:
|
2020-07-17 20:43:41 +00:00
|
|
|
add_tradeanim TradeAnim_AdvanceScriptPointer ; 00
|
|
|
|
add_tradeanim TradeAnim_ShowGivemonData ; 01
|
|
|
|
add_tradeanim TradeAnim_ShowGetmonData ; 02
|
|
|
|
add_tradeanim TradeAnim_EnterLinkTube1 ; 03
|
|
|
|
add_tradeanim TradeAnim_EnterLinkTube2 ; 04
|
|
|
|
add_tradeanim TradeAnim_ExitLinkTube ; 05
|
|
|
|
add_tradeanim TradeAnim_TubeToOT1 ; 06
|
|
|
|
add_tradeanim TradeAnim_TubeToOT2 ; 07
|
|
|
|
add_tradeanim TradeAnim_TubeToOT3 ; 08
|
|
|
|
add_tradeanim TradeAnim_TubeToOT4 ; 09
|
|
|
|
add_tradeanim TradeAnim_TubeToOT5 ; 0a
|
|
|
|
add_tradeanim TradeAnim_TubeToOT6 ; 0b
|
|
|
|
add_tradeanim TradeAnim_TubeToOT7 ; 0c
|
|
|
|
add_tradeanim TradeAnim_TubeToOT8 ; 0d
|
|
|
|
add_tradeanim TradeAnim_TubeToPlayer1 ; 0e
|
|
|
|
add_tradeanim TradeAnim_TubeToPlayer2 ; 0f
|
|
|
|
add_tradeanim TradeAnim_TubeToPlayer3 ; 10
|
|
|
|
add_tradeanim TradeAnim_TubeToPlayer4 ; 11
|
|
|
|
add_tradeanim TradeAnim_TubeToPlayer5 ; 12
|
|
|
|
add_tradeanim TradeAnim_TubeToPlayer6 ; 13
|
|
|
|
add_tradeanim TradeAnim_TubeToPlayer7 ; 14
|
|
|
|
add_tradeanim TradeAnim_TubeToPlayer8 ; 15
|
|
|
|
add_tradeanim TradeAnim_SentToOTText ; 16
|
|
|
|
add_tradeanim TradeAnim_OTBidsFarewell ; 17
|
|
|
|
add_tradeanim TradeAnim_TakeCareOfText ; 18
|
|
|
|
add_tradeanim TradeAnim_OTSendsText1 ; 19
|
|
|
|
add_tradeanim TradeAnim_OTSendsText2 ; 1a
|
|
|
|
add_tradeanim TradeAnim_SetupGivemonScroll ; 1b
|
|
|
|
add_tradeanim TradeAnim_DoGivemonScroll ; 1c
|
|
|
|
add_tradeanim TradeAnim_FrontpicScrollStart ; 1d
|
|
|
|
add_tradeanim TradeAnim_TextboxScrollStart ; 1e
|
|
|
|
add_tradeanim TradeAnim_ScrollOutRight ; 1f
|
|
|
|
add_tradeanim TradeAnim_ScrollOutRight2 ; 20
|
2020-10-28 17:35:39 +00:00
|
|
|
add_tradeanim TradeAnim_Wait80 ; 21
|
|
|
|
add_tradeanim TradeAnim_Wait40 ; 22
|
2020-07-17 20:43:41 +00:00
|
|
|
add_tradeanim TradeAnim_RockingBall ; 23
|
|
|
|
add_tradeanim TradeAnim_DropBall ; 24
|
|
|
|
add_tradeanim TradeAnim_WaitAnim ; 25
|
|
|
|
add_tradeanim TradeAnim_WaitAnim2 ; 26
|
|
|
|
add_tradeanim TradeAnim_Poof ; 27
|
|
|
|
add_tradeanim TradeAnim_BulgeThroughTube ; 28
|
|
|
|
add_tradeanim TradeAnim_GiveTrademonSFX ; 29
|
|
|
|
add_tradeanim TradeAnim_GetTrademonSFX ; 2a
|
|
|
|
add_tradeanim TradeAnim_End ; 2b
|
|
|
|
add_tradeanim TradeAnim_AnimateFrontpic ; 2c
|
2020-10-28 17:35:39 +00:00
|
|
|
add_tradeanim TradeAnim_Wait96 ; 2d
|
|
|
|
add_tradeanim TradeAnim_Wait80IfOTEgg ; 2e
|
|
|
|
add_tradeanim TradeAnim_Wait180IfOTEgg ; 2f
|
2015-11-23 05:21:21 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_IncrementJumptableIndex:
|
2015-11-23 05:21:21 +00:00
|
|
|
ld hl, wJumptableIndex
|
|
|
|
inc [hl]
|
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_AdvanceScriptPointer:
|
2017-12-09 19:22:58 +00:00
|
|
|
ld hl, wTradeAnimAddress
|
2015-11-23 05:21:21 +00:00
|
|
|
ld e, [hl]
|
|
|
|
inc hl
|
|
|
|
ld d, [hl]
|
|
|
|
ld a, [de]
|
|
|
|
ld [wJumptableIndex], a
|
|
|
|
inc de
|
|
|
|
ld [hl], d
|
|
|
|
dec hl
|
|
|
|
ld [hl], e
|
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_End:
|
2015-11-23 05:21:21 +00:00
|
|
|
ld hl, wJumptableIndex
|
|
|
|
set 7, [hl]
|
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_TubeToOT1:
|
2018-01-11 17:00:01 +00:00
|
|
|
ld a, TRADEANIM_RIGHT_ARROW
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_PlaceTrademonStatsOnTubeAnim
|
2016-01-09 21:28:22 +00:00
|
|
|
ld a, [wLinkTradeSendmonSpecies]
|
2018-07-28 23:27:34 +00:00
|
|
|
ld [wTempIconSpecies], a
|
2015-11-23 05:21:21 +00:00
|
|
|
xor a
|
|
|
|
depixel 5, 11, 4, 0
|
|
|
|
ld b, $0
|
2016-05-14 02:46:32 +00:00
|
|
|
jr TradeAnim_InitTubeAnim
|
2015-11-23 05:21:21 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_TubeToPlayer1:
|
2018-01-11 17:00:01 +00:00
|
|
|
ld a, TRADEANIM_LEFT_ARROW
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_PlaceTrademonStatsOnTubeAnim
|
2016-01-09 21:28:22 +00:00
|
|
|
ld a, [wLinkTradeGetmonSpecies]
|
2018-07-28 23:27:34 +00:00
|
|
|
ld [wTempIconSpecies], a
|
2018-01-11 17:00:01 +00:00
|
|
|
ld a, TRADEANIMSTATE_2
|
2015-11-23 05:21:21 +00:00
|
|
|
depixel 9, 18, 4, 4
|
|
|
|
ld b, $4
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_InitTubeAnim:
|
2015-11-23 05:21:21 +00:00
|
|
|
push bc
|
|
|
|
push de
|
|
|
|
push bc
|
|
|
|
push de
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2015-11-23 05:21:21 +00:00
|
|
|
push af
|
|
|
|
call DisableLCD
|
2017-12-24 17:47:30 +00:00
|
|
|
callfar ClearSpriteAnims
|
2015-11-23 05:21:21 +00:00
|
|
|
hlbgcoord 20, 3
|
2016-05-14 02:46:32 +00:00
|
|
|
ld bc, 12
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, $60
|
|
|
|
call ByteFill
|
|
|
|
pop af
|
2016-05-14 02:46:32 +00:00
|
|
|
|
|
|
|
call TradeAnim_TubeAnimJumptable
|
|
|
|
|
2015-11-23 05:21:21 +00:00
|
|
|
xor a
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hSCX], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, $7
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hWX], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, $70
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hWY], a
|
2015-11-23 05:21:21 +00:00
|
|
|
call EnableLCD
|
2016-01-09 21:28:22 +00:00
|
|
|
call LoadTradeBubbleGFX
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2015-11-23 05:21:21 +00:00
|
|
|
pop de
|
2016-05-14 02:46:32 +00:00
|
|
|
ld a, SPRITE_ANIM_INDEX_TRADEMON_ICON
|
2020-02-11 12:42:36 +00:00
|
|
|
call InitSpriteAnimStruct
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2016-05-14 05:11:01 +00:00
|
|
|
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
|
2015-11-23 05:21:21 +00:00
|
|
|
add hl, bc
|
|
|
|
pop bc
|
|
|
|
ld [hl], b
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2015-11-23 05:21:21 +00:00
|
|
|
pop de
|
2016-05-14 02:46:32 +00:00
|
|
|
ld a, SPRITE_ANIM_INDEX_TRADEMON_BUBBLE
|
2020-02-11 12:42:36 +00:00
|
|
|
call InitSpriteAnimStruct
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2016-05-14 05:11:01 +00:00
|
|
|
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
|
2015-11-23 05:21:21 +00:00
|
|
|
add hl, bc
|
|
|
|
pop bc
|
|
|
|
ld [hl], b
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2015-11-23 05:21:21 +00:00
|
|
|
call WaitBGMap
|
2016-05-14 02:46:32 +00:00
|
|
|
ld b, SCGB_TRADE_TUBE
|
2015-11-23 05:21:21 +00:00
|
|
|
call GetSGBLayout
|
2015-12-17 18:49:26 +00:00
|
|
|
ld a, %11100100 ; 3,2,1,0
|
2015-11-23 05:21:21 +00:00
|
|
|
call DmgToCgbBGPals
|
2016-05-14 02:46:32 +00:00
|
|
|
ld a, %11010000
|
2015-12-09 16:38:40 +00:00
|
|
|
call DmgToCgbObjPal0
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_IncrementJumptableIndex
|
2018-01-11 20:36:11 +00:00
|
|
|
ld a, 92
|
|
|
|
ld [wFrameCounter], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_TubeToOT2:
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_FlashBGPals
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hSCX]
|
2015-11-23 05:21:21 +00:00
|
|
|
add $2
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hSCX], a
|
2015-11-23 05:21:21 +00:00
|
|
|
cp $50
|
|
|
|
ret nz
|
2018-01-11 17:00:01 +00:00
|
|
|
ld a, TRADEANIMSTATE_1
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_TubeAnimJumptable
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_IncrementJumptableIndex
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_TubeToOT3:
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_FlashBGPals
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hSCX]
|
2015-11-23 05:21:21 +00:00
|
|
|
add $2
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hSCX], a
|
2015-11-23 05:21:21 +00:00
|
|
|
cp $a0
|
|
|
|
ret nz
|
2018-01-11 17:00:01 +00:00
|
|
|
ld a, TRADEANIMSTATE_2
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_TubeAnimJumptable
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_IncrementJumptableIndex
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_TubeToOT4:
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_FlashBGPals
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hSCX]
|
2015-11-23 05:21:21 +00:00
|
|
|
add $2
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hSCX], a
|
2015-11-23 05:21:21 +00:00
|
|
|
and a
|
|
|
|
ret nz
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_IncrementJumptableIndex
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_TubeToPlayer3:
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_FlashBGPals
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hSCX]
|
2015-11-23 05:21:21 +00:00
|
|
|
sub $2
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hSCX], a
|
2015-11-23 05:21:21 +00:00
|
|
|
cp $b0
|
|
|
|
ret nz
|
2018-01-11 17:00:01 +00:00
|
|
|
ld a, TRADEANIMSTATE_1
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_TubeAnimJumptable
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_IncrementJumptableIndex
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_TubeToPlayer4:
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_FlashBGPals
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hSCX]
|
2015-11-23 05:21:21 +00:00
|
|
|
sub $2
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hSCX], a
|
2015-11-23 05:21:21 +00:00
|
|
|
cp $60
|
|
|
|
ret nz
|
2018-01-11 17:00:01 +00:00
|
|
|
xor a ; TRADEANIMSTATE_0
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_TubeAnimJumptable
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_IncrementJumptableIndex
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_TubeToPlayer5:
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_FlashBGPals
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hSCX]
|
2015-11-23 05:21:21 +00:00
|
|
|
sub $2
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hSCX], a
|
2015-11-23 05:21:21 +00:00
|
|
|
and a
|
|
|
|
ret nz
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_IncrementJumptableIndex
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2015-11-23 07:08:08 +00:00
|
|
|
TradeAnim_TubeToOT6:
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_TubeToPlayer6:
|
2018-01-11 20:36:11 +00:00
|
|
|
ld a, 128
|
|
|
|
ld [wFrameCounter], a
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_IncrementJumptableIndex
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2015-11-23 07:08:08 +00:00
|
|
|
TradeAnim_TubeToOT8:
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_TubeToPlayer8:
|
2015-11-23 05:21:21 +00:00
|
|
|
call ClearBGPalettes
|
2020-02-13 17:30:13 +00:00
|
|
|
call ClearTilemap
|
2015-11-23 05:21:21 +00:00
|
|
|
call ClearSprites
|
|
|
|
call DisableLCD
|
2017-12-24 17:47:30 +00:00
|
|
|
callfar ClearSpriteAnims
|
2015-11-23 05:21:21 +00:00
|
|
|
hlbgcoord 0, 0
|
2017-12-28 12:32:33 +00:00
|
|
|
ld bc, sScratch - vBGMap0
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, " "
|
|
|
|
call ByteFill
|
|
|
|
xor a
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hSCX], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, $90
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hWY], a
|
2015-11-23 05:21:21 +00:00
|
|
|
call EnableLCD
|
2016-01-09 21:28:22 +00:00
|
|
|
call LoadTradeBallAndCableGFX
|
2015-11-23 05:21:21 +00:00
|
|
|
call WaitBGMap
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_NormalPals
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2015-11-23 07:08:08 +00:00
|
|
|
TradeAnim_TubeToOT5:
|
|
|
|
TradeAnim_TubeToOT7:
|
|
|
|
TradeAnim_TubeToPlayer2:
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_TubeToPlayer7:
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_FlashBGPals
|
2018-01-11 20:36:11 +00:00
|
|
|
ld hl, wFrameCounter
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
jr z, .done
|
|
|
|
dec [hl]
|
|
|
|
ret
|
|
|
|
|
|
|
|
.done
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_IncrementJumptableIndex
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_GiveTrademonSFX:
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-23 05:21:21 +00:00
|
|
|
ld de, SFX_GIVE_TRADEMON
|
|
|
|
call PlaySFX
|
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_GetTrademonSFX:
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-23 05:21:21 +00:00
|
|
|
ld de, SFX_GET_TRADEMON
|
|
|
|
call PlaySFX
|
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_TubeAnimJumptable:
|
2018-01-16 22:27:50 +00:00
|
|
|
maskbits TRADEANIMJUMPTABLE_LENGTH
|
2015-11-23 05:21:21 +00:00
|
|
|
ld e, a
|
|
|
|
ld d, 0
|
2016-05-14 02:46:32 +00:00
|
|
|
ld hl, .Jumptable
|
2015-11-23 05:21:21 +00:00
|
|
|
add hl, de
|
2016-05-04 15:46:23 +00:00
|
|
|
add hl, de
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2017-06-09 21:01:10 +00:00
|
|
|
jp hl
|
2015-11-23 05:21:21 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.Jumptable:
|
2018-01-11 17:00:01 +00:00
|
|
|
; entries correspond to TRADEANIMSTATE_* constants
|
2016-05-14 02:46:32 +00:00
|
|
|
dw .Zero
|
|
|
|
dw .One
|
|
|
|
dw .Two
|
|
|
|
dw .Three
|
2015-11-23 05:21:21 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.Zero:
|
|
|
|
.Three:
|
2020-02-13 17:30:13 +00:00
|
|
|
call TradeAnim_BlankTilemap
|
2015-11-23 05:21:21 +00:00
|
|
|
hlcoord 9, 3
|
|
|
|
ld [hl], $5b
|
|
|
|
inc hl
|
2015-11-23 07:08:08 +00:00
|
|
|
ld bc, 10
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, $60
|
|
|
|
call ByteFill
|
|
|
|
hlcoord 3, 2
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_CopyTradeGameBoyTilemap
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.One:
|
2020-02-13 17:30:13 +00:00
|
|
|
call TradeAnim_BlankTilemap
|
2015-11-23 05:21:21 +00:00
|
|
|
hlcoord 0, 3
|
|
|
|
ld bc, SCREEN_WIDTH
|
|
|
|
ld a, $60
|
|
|
|
call ByteFill
|
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.Two:
|
2020-02-13 17:30:13 +00:00
|
|
|
call TradeAnim_BlankTilemap
|
2015-11-23 05:21:21 +00:00
|
|
|
hlcoord 0, 3
|
|
|
|
ld bc, $11
|
|
|
|
ld a, $60
|
|
|
|
call ByteFill
|
|
|
|
hlcoord 17, 3
|
|
|
|
ld a, $5d
|
|
|
|
ld [hl], a
|
2015-12-17 18:49:26 +00:00
|
|
|
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, $61
|
|
|
|
ld de, SCREEN_WIDTH
|
|
|
|
ld c, $3
|
2015-11-23 07:08:08 +00:00
|
|
|
.loop
|
2015-11-23 05:21:21 +00:00
|
|
|
add hl, de
|
|
|
|
ld [hl], a
|
|
|
|
dec c
|
2015-11-23 07:08:08 +00:00
|
|
|
jr nz, .loop
|
2015-12-17 18:49:26 +00:00
|
|
|
|
2015-11-23 05:21:21 +00:00
|
|
|
add hl, de
|
|
|
|
ld a, $5f
|
|
|
|
ld [hld], a
|
|
|
|
ld a, $5b
|
|
|
|
ld [hl], a
|
|
|
|
hlcoord 10, 6
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_CopyTradeGameBoyTilemap
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_CopyTradeGameBoyTilemap:
|
2015-11-23 05:21:21 +00:00
|
|
|
ld de, TradeGameBoyTilemap
|
|
|
|
lb bc, 8, 6
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_CopyBoxFromDEtoHL
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_PlaceTrademonStatsOnTubeAnim:
|
2015-11-23 05:21:21 +00:00
|
|
|
push af
|
|
|
|
call ClearBGPalettes
|
|
|
|
call WaitTop
|
2017-12-28 12:32:33 +00:00
|
|
|
ld a, HIGH(vBGMap1)
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hBGMapAddress + 1], a
|
2020-02-13 17:30:13 +00:00
|
|
|
call ClearTilemap
|
2015-11-23 05:21:21 +00:00
|
|
|
hlcoord 0, 0
|
|
|
|
ld bc, SCREEN_WIDTH
|
|
|
|
ld a, "─"
|
|
|
|
call ByteFill
|
|
|
|
hlcoord 0, 1
|
2015-11-23 07:08:08 +00:00
|
|
|
ld de, wLinkPlayer1Name
|
2015-11-23 05:21:21 +00:00
|
|
|
call PlaceString
|
2015-11-23 07:08:08 +00:00
|
|
|
ld hl, wLinkPlayer2Name
|
2015-11-23 05:21:21 +00:00
|
|
|
ld de, 0
|
2015-11-23 07:08:08 +00:00
|
|
|
.find_name_end_loop
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [hli]
|
|
|
|
cp "@"
|
2015-11-23 07:08:08 +00:00
|
|
|
jr z, .done
|
2015-11-23 05:21:21 +00:00
|
|
|
dec de
|
2015-11-23 07:08:08 +00:00
|
|
|
jr .find_name_end_loop
|
2015-11-23 05:21:21 +00:00
|
|
|
|
2015-11-23 07:08:08 +00:00
|
|
|
.done
|
2015-11-23 05:21:21 +00:00
|
|
|
hlcoord 0, 4
|
|
|
|
add hl, de
|
2015-11-23 07:08:08 +00:00
|
|
|
ld de, wLinkPlayer2Name
|
2015-11-23 05:21:21 +00:00
|
|
|
call PlaceString
|
|
|
|
hlcoord 7, 2
|
|
|
|
ld bc, 6
|
|
|
|
pop af
|
|
|
|
call ByteFill
|
|
|
|
call WaitBGMap
|
|
|
|
call WaitTop
|
2017-12-28 12:32:33 +00:00
|
|
|
ld a, HIGH(vBGMap0)
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hBGMapAddress + 1], a
|
2020-02-13 17:30:13 +00:00
|
|
|
call ClearTilemap
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_EnterLinkTube1:
|
2020-02-13 17:30:13 +00:00
|
|
|
call ClearTilemap
|
2015-11-23 05:21:21 +00:00
|
|
|
call WaitTop
|
|
|
|
ld a, $a0
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hSCX], a
|
2015-11-23 05:21:21 +00:00
|
|
|
call DelayFrame
|
|
|
|
hlcoord 8, 2
|
2016-05-14 03:23:26 +00:00
|
|
|
ld de, TradeLinkTubeTilemap
|
2015-11-23 05:21:21 +00:00
|
|
|
lb bc, 3, 12
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_CopyBoxFromDEtoHL
|
2015-11-23 05:21:21 +00:00
|
|
|
call WaitBGMap
|
2016-05-14 02:46:32 +00:00
|
|
|
ld b, SCGB_TRADE_TUBE
|
2015-11-23 05:21:21 +00:00
|
|
|
call GetSGBLayout
|
2015-12-17 18:49:26 +00:00
|
|
|
ld a, %11100100 ; 3,2,1,0
|
2015-11-23 05:21:21 +00:00
|
|
|
call DmgToCgbBGPals
|
2015-12-17 18:49:26 +00:00
|
|
|
lb de, %11100100, %11100100 ; 3,2,1,0, 3,2,1,0
|
2015-11-23 05:21:21 +00:00
|
|
|
call DmgToCgbObjPals
|
|
|
|
ld de, SFX_POTION
|
|
|
|
call PlaySFX
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_IncrementJumptableIndex
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_EnterLinkTube2:
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hSCX]
|
2015-11-23 05:21:21 +00:00
|
|
|
and a
|
|
|
|
jr z, .done
|
|
|
|
add $4
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hSCX], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
|
|
|
|
|
|
|
.done
|
|
|
|
ld c, 80
|
|
|
|
call DelayFrames
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_ExitLinkTube:
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hSCX]
|
2015-11-23 05:21:21 +00:00
|
|
|
cp $a0
|
2016-05-14 03:23:26 +00:00
|
|
|
jr z, .done
|
2015-11-23 05:21:21 +00:00
|
|
|
sub $4
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hSCX], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
|
|
|
|
2016-05-14 03:23:26 +00:00
|
|
|
.done
|
2020-02-13 17:30:13 +00:00
|
|
|
call ClearTilemap
|
2015-11-23 05:21:21 +00:00
|
|
|
xor a
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hSCX], a
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_SetupGivemonScroll:
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, $8f
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hWX], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, $88
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hSCX], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, $50
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hWY], a
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_DoGivemonScroll:
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hWX]
|
2015-11-23 05:21:21 +00:00
|
|
|
cp $7
|
|
|
|
jr z, .done
|
|
|
|
sub $4
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hWX], a
|
|
|
|
ldh a, [hSCX]
|
2015-11-23 05:21:21 +00:00
|
|
|
sub $4
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hSCX], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
|
|
|
|
|
|
|
.done
|
|
|
|
ld a, $7
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hWX], a
|
2015-11-23 05:21:21 +00:00
|
|
|
xor a
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hSCX], a
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_FrontpicScrollStart:
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, $7
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hWX], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, $50
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hWY], a
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_TextboxScrollStart:
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, $7
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hWX], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, $90
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hWY], a
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_ScrollOutRight:
|
2015-11-23 05:21:21 +00:00
|
|
|
call WaitTop
|
2017-12-28 12:32:33 +00:00
|
|
|
ld a, HIGH(vBGMap1)
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hBGMapAddress + 1], a
|
2015-11-23 05:21:21 +00:00
|
|
|
call WaitBGMap
|
|
|
|
ld a, $7
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hWX], a
|
2015-11-23 05:21:21 +00:00
|
|
|
xor a
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hWY], a
|
2015-11-23 05:21:21 +00:00
|
|
|
call DelayFrame
|
|
|
|
call WaitTop
|
2017-12-28 12:32:33 +00:00
|
|
|
ld a, HIGH(vBGMap0)
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hBGMapAddress + 1], a
|
2020-02-13 17:30:13 +00:00
|
|
|
call ClearTilemap
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_IncrementJumptableIndex
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_ScrollOutRight2:
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hWX]
|
2015-11-23 05:21:21 +00:00
|
|
|
cp $a1
|
2015-11-23 07:08:08 +00:00
|
|
|
jr nc, .done
|
2015-11-23 05:21:21 +00:00
|
|
|
add $4
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hWX], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
|
|
|
|
2015-11-23 07:08:08 +00:00
|
|
|
.done
|
2017-12-28 12:32:33 +00:00
|
|
|
ld a, HIGH(vBGMap1)
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hBGMapAddress + 1], a
|
2015-11-23 05:21:21 +00:00
|
|
|
call WaitBGMap
|
|
|
|
ld a, $7
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hWX], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, $90
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hWY], a
|
2017-12-28 12:32:33 +00:00
|
|
|
ld a, HIGH(vBGMap0)
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hBGMapAddress + 1], a
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_ShowGivemonData:
|
2016-05-14 02:46:32 +00:00
|
|
|
call ShowPlayerTrademonStats
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [wPlayerTrademonSpecies]
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wCurPartySpecies], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [wPlayerTrademonDVs]
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wTempMonDVs], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [wPlayerTrademonDVs + 1]
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wTempMonDVs + 1], a
|
2016-05-14 02:46:32 +00:00
|
|
|
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
|
2015-11-23 05:21:21 +00:00
|
|
|
call GetSGBLayout
|
2015-12-17 18:49:26 +00:00
|
|
|
ld a, %11100100 ; 3,2,1,0
|
2015-11-23 05:21:21 +00:00
|
|
|
call DmgToCgbBGPals
|
2015-12-17 18:49:26 +00:00
|
|
|
call TradeAnim_ShowGivemonFrontpic
|
2015-11-23 05:21:21 +00:00
|
|
|
|
|
|
|
ld a, [wPlayerTrademonSpecies]
|
|
|
|
call GetCryIndex
|
|
|
|
jr c, .skip_cry
|
|
|
|
ld e, c
|
|
|
|
ld d, b
|
2018-01-17 04:47:45 +00:00
|
|
|
call PlayCry
|
2015-11-23 05:21:21 +00:00
|
|
|
.skip_cry
|
|
|
|
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_ShowGetmonData:
|
2016-05-14 02:46:32 +00:00
|
|
|
call ShowOTTrademonStats
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [wOTTrademonSpecies]
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wCurPartySpecies], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [wOTTrademonDVs]
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wTempMonDVs], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [wOTTrademonDVs + 1]
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wTempMonDVs + 1], a
|
2016-05-14 02:46:32 +00:00
|
|
|
ld b, SCGB_PLAYER_OR_MON_FRONTPIC_PALS
|
2015-11-23 05:21:21 +00:00
|
|
|
call GetSGBLayout
|
2015-12-17 18:49:26 +00:00
|
|
|
ld a, %11100100 ; 3,2,1,0
|
2015-11-23 05:21:21 +00:00
|
|
|
call DmgToCgbBGPals
|
2015-12-17 18:49:26 +00:00
|
|
|
call TradeAnim_ShowGetmonFrontpic
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_AnimateFrontpic:
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall AnimateTrademonFrontpic
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_GetFrontpic:
|
2015-11-23 05:21:21 +00:00
|
|
|
push de
|
|
|
|
push af
|
2018-01-16 19:30:10 +00:00
|
|
|
predef GetUnownLetter
|
2015-11-23 05:21:21 +00:00
|
|
|
pop af
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wCurPartySpecies], a
|
|
|
|
ld [wCurSpecies], a
|
2015-11-23 05:21:21 +00:00
|
|
|
call GetBaseData
|
|
|
|
pop de
|
2018-01-16 19:30:10 +00:00
|
|
|
predef GetMonFrontpic
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_GetNickname:
|
2015-11-23 05:21:21 +00:00
|
|
|
push de
|
2018-07-28 23:27:34 +00:00
|
|
|
ld [wNamedObjectIndexBuffer], a
|
2015-11-23 05:21:21 +00:00
|
|
|
call GetPokemonName
|
2018-01-23 22:39:09 +00:00
|
|
|
ld hl, wStringBuffer1
|
2015-11-23 05:21:21 +00:00
|
|
|
pop de
|
|
|
|
ld bc, NAME_LENGTH
|
|
|
|
call CopyBytes
|
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_ShowGivemonFrontpic:
|
2017-12-28 12:32:33 +00:00
|
|
|
ld de, vTiles0
|
2015-12-17 18:49:26 +00:00
|
|
|
jr TradeAnim_ShowFrontpic
|
2015-11-23 05:21:21 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_ShowGetmonFrontpic:
|
2017-12-28 12:32:33 +00:00
|
|
|
ld de, vTiles0 tile $31
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_ShowFrontpic:
|
2015-11-23 05:21:21 +00:00
|
|
|
call DelayFrame
|
2017-12-28 12:32:33 +00:00
|
|
|
ld hl, vTiles2
|
2015-11-23 05:21:21 +00:00
|
|
|
lb bc, 10, $31
|
|
|
|
call Request2bpp
|
|
|
|
call WaitTop
|
2020-02-13 17:30:13 +00:00
|
|
|
call TradeAnim_BlankTilemap
|
2015-11-23 05:21:21 +00:00
|
|
|
hlcoord 7, 2
|
|
|
|
xor a
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hGraphicStartTile], a
|
2015-11-23 05:21:21 +00:00
|
|
|
lb bc, 7, 7
|
2018-01-16 19:30:10 +00:00
|
|
|
predef PlaceGraphic
|
2015-11-23 05:21:21 +00:00
|
|
|
call WaitBGMap
|
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2020-07-17 20:43:41 +00:00
|
|
|
TradeAnim_Wait80:
|
2015-11-23 05:21:21 +00:00
|
|
|
ld c, 80
|
|
|
|
call DelayFrames
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2020-07-17 20:43:41 +00:00
|
|
|
TradeAnim_Wait40:
|
2015-11-23 05:21:21 +00:00
|
|
|
ld c, 40
|
|
|
|
call DelayFrames
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2020-07-17 20:43:41 +00:00
|
|
|
TradeAnim_Wait96:
|
2015-11-23 05:21:21 +00:00
|
|
|
ld c, 96
|
|
|
|
call DelayFrames
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2020-07-17 20:43:41 +00:00
|
|
|
TradeAnim_Wait80IfOTEgg:
|
2015-11-23 07:08:08 +00:00
|
|
|
call IsOTTrademonEgg
|
2015-11-23 05:21:21 +00:00
|
|
|
ret nz
|
|
|
|
ld c, 80
|
|
|
|
call DelayFrames
|
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2020-07-17 20:43:41 +00:00
|
|
|
TradeAnim_Wait180IfOTEgg:
|
2015-11-23 07:08:08 +00:00
|
|
|
call IsOTTrademonEgg
|
2015-11-23 05:21:21 +00:00
|
|
|
ret nz
|
|
|
|
ld c, 180
|
|
|
|
call DelayFrames
|
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
IsOTTrademonEgg:
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [wOTTrademonSpecies]
|
2015-11-23 07:08:08 +00:00
|
|
|
cp EGG
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
ShowPlayerTrademonStats:
|
2015-11-23 05:21:21 +00:00
|
|
|
ld de, wPlayerTrademonSpecies
|
|
|
|
ld a, [de]
|
2015-11-23 07:08:08 +00:00
|
|
|
cp EGG
|
2016-05-14 02:46:32 +00:00
|
|
|
jr z, TrademonStats_Egg
|
|
|
|
call TrademonStats_MonTemplate
|
2015-11-23 05:21:21 +00:00
|
|
|
ld de, wPlayerTrademonSpecies
|
2016-05-14 02:46:32 +00:00
|
|
|
call TrademonStats_PrintSpeciesNumber
|
2015-11-23 05:21:21 +00:00
|
|
|
ld de, wPlayerTrademonSpeciesName
|
2016-05-14 02:46:32 +00:00
|
|
|
call TrademonStats_PrintSpeciesName
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [wPlayerTrademonCaughtData]
|
|
|
|
ld de, wPlayerTrademonOTName
|
2016-05-14 02:46:32 +00:00
|
|
|
call TrademonStats_PrintOTName
|
|
|
|
ld de, wPlayerTrademonID
|
|
|
|
call TrademonStats_PrintTrademonID
|
|
|
|
call TrademonStats_WaitBGMap
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
ShowOTTrademonStats:
|
2015-11-23 05:21:21 +00:00
|
|
|
ld de, wOTTrademonSpecies
|
|
|
|
ld a, [de]
|
2015-11-23 07:08:08 +00:00
|
|
|
cp EGG
|
2016-05-14 02:46:32 +00:00
|
|
|
jr z, TrademonStats_Egg
|
|
|
|
call TrademonStats_MonTemplate
|
2015-11-23 05:21:21 +00:00
|
|
|
ld de, wOTTrademonSpecies
|
2016-05-14 02:46:32 +00:00
|
|
|
call TrademonStats_PrintSpeciesNumber
|
2015-11-23 05:21:21 +00:00
|
|
|
ld de, wOTTrademonSpeciesName
|
2016-05-14 02:46:32 +00:00
|
|
|
call TrademonStats_PrintSpeciesName
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [wOTTrademonCaughtData]
|
|
|
|
ld de, wOTTrademonOTName
|
2016-05-14 02:46:32 +00:00
|
|
|
call TrademonStats_PrintOTName
|
2015-11-23 05:21:21 +00:00
|
|
|
ld de, wOTTrademonID
|
2016-05-14 02:46:32 +00:00
|
|
|
call TrademonStats_PrintTrademonID
|
|
|
|
call TrademonStats_WaitBGMap
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TrademonStats_MonTemplate:
|
2015-11-23 05:21:21 +00:00
|
|
|
call WaitTop
|
2020-02-13 17:30:13 +00:00
|
|
|
call TradeAnim_BlankTilemap
|
2017-12-28 12:32:33 +00:00
|
|
|
ld a, HIGH(vBGMap1)
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hBGMapAddress + 1], a
|
2015-11-23 05:21:21 +00:00
|
|
|
hlcoord 3, 0
|
|
|
|
ld b, $6
|
|
|
|
ld c, $d
|
2019-04-08 12:15:10 +00:00
|
|
|
call Textbox
|
2015-11-23 05:21:21 +00:00
|
|
|
hlcoord 4, 0
|
2016-05-14 02:46:32 +00:00
|
|
|
ld de, .OTMonData
|
2015-11-23 05:21:21 +00:00
|
|
|
call PlaceString
|
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.OTMonData:
|
2015-11-23 05:21:21 +00:00
|
|
|
db "─── №."
|
|
|
|
next ""
|
|
|
|
next "OT/"
|
2015-11-23 07:08:08 +00:00
|
|
|
next "<ID>№.@"
|
2015-11-23 05:21:21 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TrademonStats_Egg:
|
2015-11-23 05:21:21 +00:00
|
|
|
call WaitTop
|
2020-02-13 17:30:13 +00:00
|
|
|
call TradeAnim_BlankTilemap
|
2017-12-28 12:32:33 +00:00
|
|
|
ld a, HIGH(vBGMap1)
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hBGMapAddress + 1], a
|
2015-11-23 05:21:21 +00:00
|
|
|
hlcoord 3, 0
|
2016-05-14 02:46:32 +00:00
|
|
|
ld b, 6
|
|
|
|
ld c, 13
|
2019-04-08 12:15:10 +00:00
|
|
|
call Textbox
|
2015-11-23 05:21:21 +00:00
|
|
|
hlcoord 4, 2
|
2016-05-14 02:46:32 +00:00
|
|
|
ld de, .EggData
|
2015-11-23 05:21:21 +00:00
|
|
|
call PlaceString
|
2016-05-14 02:46:32 +00:00
|
|
|
call TrademonStats_WaitBGMap
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.EggData:
|
2015-11-23 05:21:21 +00:00
|
|
|
db "EGG"
|
|
|
|
next "OT/?????"
|
|
|
|
next "<ID>№.?????@"
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TrademonStats_WaitBGMap:
|
2015-11-23 05:21:21 +00:00
|
|
|
call WaitBGMap
|
|
|
|
call WaitTop
|
2017-12-28 12:32:33 +00:00
|
|
|
ld a, HIGH(vBGMap0)
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hBGMapAddress + 1], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TrademonStats_PrintSpeciesNumber:
|
2015-11-23 05:21:21 +00:00
|
|
|
hlcoord 10, 0
|
|
|
|
lb bc, PRINTNUM_LEADINGZEROS | 1, 3
|
|
|
|
call PrintNum
|
|
|
|
ld [hl], " "
|
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TrademonStats_PrintSpeciesName:
|
2015-11-23 05:21:21 +00:00
|
|
|
hlcoord 4, 2
|
|
|
|
call PlaceString
|
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TrademonStats_PrintOTName:
|
2015-11-23 05:21:21 +00:00
|
|
|
cp 3
|
2016-05-14 02:46:32 +00:00
|
|
|
jr c, .caught_gender_okay
|
2015-11-23 05:21:21 +00:00
|
|
|
xor a
|
2016-05-14 02:46:32 +00:00
|
|
|
.caught_gender_okay
|
2015-11-23 05:21:21 +00:00
|
|
|
push af
|
|
|
|
hlcoord 7, 4
|
|
|
|
call PlaceString
|
|
|
|
inc bc
|
|
|
|
pop af
|
2016-05-14 02:46:32 +00:00
|
|
|
ld hl, .Gender
|
2015-11-23 05:21:21 +00:00
|
|
|
ld d, 0
|
|
|
|
ld e, a
|
|
|
|
add hl, de
|
|
|
|
ld a, [hl]
|
|
|
|
ld [bc], a
|
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.Gender:
|
2015-11-23 05:21:21 +00:00
|
|
|
db " ", "♂", "♀"
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TrademonStats_PrintTrademonID:
|
2015-11-23 05:21:21 +00:00
|
|
|
hlcoord 7, 6
|
|
|
|
lb bc, PRINTNUM_LEADINGZEROS | 2, 5
|
|
|
|
call PrintNum
|
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_RockingBall:
|
2015-11-23 05:21:21 +00:00
|
|
|
depixel 10, 11, 4, 0
|
2017-12-09 05:50:59 +00:00
|
|
|
ld a, SPRITE_ANIM_INDEX_TRADE_POKE_BALL
|
2020-02-11 12:42:36 +00:00
|
|
|
call InitSpriteAnimStruct
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2018-01-11 20:36:11 +00:00
|
|
|
ld a, 32
|
|
|
|
ld [wFrameCounter], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_DropBall:
|
2015-11-23 05:21:21 +00:00
|
|
|
depixel 10, 11, 4, 0
|
2017-12-09 05:50:59 +00:00
|
|
|
ld a, SPRITE_ANIM_INDEX_TRADE_POKE_BALL
|
2020-02-11 12:42:36 +00:00
|
|
|
call InitSpriteAnimStruct
|
2016-05-14 05:11:01 +00:00
|
|
|
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
|
2015-11-23 05:21:21 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $1
|
2016-05-14 02:46:32 +00:00
|
|
|
ld hl, SPRITEANIMSTRUCT_YOFFSET
|
2015-11-23 05:21:21 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $dc
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2018-01-11 20:36:11 +00:00
|
|
|
ld a, 56
|
|
|
|
ld [wFrameCounter], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_Poof:
|
2015-11-23 05:21:21 +00:00
|
|
|
depixel 10, 11, 4, 0
|
2017-12-09 05:50:59 +00:00
|
|
|
ld a, SPRITE_ANIM_INDEX_TRADE_POOF
|
2020-02-11 12:42:36 +00:00
|
|
|
call InitSpriteAnimStruct
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2018-01-11 20:36:11 +00:00
|
|
|
ld a, 16
|
|
|
|
ld [wFrameCounter], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ld de, SFX_BALL_POOF
|
|
|
|
call PlaySFX
|
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_BulgeThroughTube:
|
2015-12-17 18:49:26 +00:00
|
|
|
ld a, %11100100 ; 3,2,1,0
|
2015-12-09 16:38:40 +00:00
|
|
|
call DmgToCgbObjPal0
|
2015-11-23 05:21:21 +00:00
|
|
|
depixel 5, 11
|
2017-12-09 05:50:59 +00:00
|
|
|
ld a, SPRITE_ANIM_INDEX_TRADE_TUBE_BULGE
|
2020-02-11 12:42:36 +00:00
|
|
|
call InitSpriteAnimStruct
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2018-01-11 20:36:11 +00:00
|
|
|
ld a, 64
|
|
|
|
ld [wFrameCounter], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_AnimateTrademonInTube:
|
2016-05-14 05:11:01 +00:00
|
|
|
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
|
2015-11-23 05:21:21 +00:00
|
|
|
add hl, bc
|
|
|
|
ld e, [hl]
|
|
|
|
ld d, 0
|
2016-05-14 02:46:32 +00:00
|
|
|
ld hl, .Jumptable
|
2015-11-23 05:21:21 +00:00
|
|
|
add hl, de
|
2016-05-04 15:46:23 +00:00
|
|
|
add hl, de
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2017-06-09 21:01:10 +00:00
|
|
|
jp hl
|
2015-11-23 05:21:21 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.Jumptable:
|
2016-05-14 02:46:32 +00:00
|
|
|
dw .InitTimer
|
|
|
|
dw .WaitTimer1
|
|
|
|
dw .MoveRight
|
|
|
|
dw .MoveDown
|
|
|
|
dw .MoveUp
|
|
|
|
dw .MoveLeft
|
|
|
|
dw .WaitTimer2
|
2015-11-23 05:21:21 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.JumptableNext:
|
2016-05-14 05:11:01 +00:00
|
|
|
ld hl, SPRITEANIMSTRUCT_JUMPTABLE_INDEX
|
2015-11-23 05:21:21 +00:00
|
|
|
add hl, bc
|
|
|
|
inc [hl]
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.InitTimer:
|
2016-05-14 02:46:32 +00:00
|
|
|
call .JumptableNext
|
2020-08-22 14:22:37 +00:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR1
|
2015-11-23 05:21:21 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $80
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.WaitTimer1:
|
2020-08-22 14:22:37 +00:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR1
|
2015-11-23 05:21:21 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
dec [hl]
|
|
|
|
and a
|
|
|
|
ret nz
|
2016-05-14 02:46:32 +00:00
|
|
|
call .JumptableNext
|
2015-11-23 05:21:21 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.MoveRight:
|
2016-05-14 02:46:32 +00:00
|
|
|
ld hl, SPRITEANIMSTRUCT_XCOORD
|
2015-11-23 05:21:21 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp $94
|
2016-05-14 02:46:32 +00:00
|
|
|
jr nc, .done_move_right
|
2015-11-23 05:21:21 +00:00
|
|
|
inc [hl]
|
|
|
|
ret
|
|
|
|
|
2016-05-14 02:46:32 +00:00
|
|
|
.done_move_right
|
|
|
|
call .JumptableNext
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.MoveDown:
|
2016-05-14 02:46:32 +00:00
|
|
|
ld hl, SPRITEANIMSTRUCT_YCOORD
|
2015-11-23 05:21:21 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp $4c
|
2016-05-14 02:46:32 +00:00
|
|
|
jr nc, .done_move_down
|
2015-11-23 05:21:21 +00:00
|
|
|
inc [hl]
|
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
|
|
|
.done_move_down
|
|
|
|
ld hl, SPRITEANIMSTRUCT_INDEX
|
2015-11-23 05:21:21 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.MoveUp:
|
2016-05-14 02:46:32 +00:00
|
|
|
ld hl, SPRITEANIMSTRUCT_YCOORD
|
2015-11-23 05:21:21 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp $2c
|
2016-05-14 02:46:32 +00:00
|
|
|
jr z, .done_move_up
|
2015-11-23 05:21:21 +00:00
|
|
|
dec [hl]
|
|
|
|
ret
|
|
|
|
|
2016-05-14 02:46:32 +00:00
|
|
|
.done_move_up
|
|
|
|
call .JumptableNext
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.MoveLeft:
|
2016-05-14 02:46:32 +00:00
|
|
|
ld hl, SPRITEANIMSTRUCT_XCOORD
|
2015-11-23 05:21:21 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
cp $58
|
2016-05-14 02:46:32 +00:00
|
|
|
jr z, .done_move_left
|
2015-11-23 05:21:21 +00:00
|
|
|
dec [hl]
|
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
|
|
|
.done_move_left
|
|
|
|
call .JumptableNext
|
2020-08-22 14:22:37 +00:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR1
|
2015-11-23 05:21:21 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $80
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.WaitTimer2:
|
2020-08-22 14:22:37 +00:00
|
|
|
ld hl, SPRITEANIMSTRUCT_VAR1
|
2015-11-23 05:21:21 +00:00
|
|
|
add hl, bc
|
|
|
|
ld a, [hl]
|
|
|
|
dec [hl]
|
|
|
|
and a
|
|
|
|
ret nz
|
2016-05-14 02:46:32 +00:00
|
|
|
ld hl, SPRITEANIMSTRUCT_INDEX
|
2015-11-23 05:21:21 +00:00
|
|
|
add hl, bc
|
|
|
|
ld [hl], $0
|
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_SentToOTText:
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [wLinkMode]
|
|
|
|
cp LINK_TIMECAPSULE
|
|
|
|
jr z, .time_capsule
|
2019-10-20 22:24:17 +00:00
|
|
|
ld hl, .MonNameSentToText
|
2015-11-23 05:21:21 +00:00
|
|
|
call PrintText
|
|
|
|
ld c, 189
|
|
|
|
call DelayFrames
|
2019-10-20 22:24:17 +00:00
|
|
|
ld hl, .MonWasSentToText
|
2015-11-23 05:21:21 +00:00
|
|
|
call PrintText
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_Wait80Frames
|
2015-11-23 05:21:21 +00:00
|
|
|
ld c, 128
|
|
|
|
call DelayFrames
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
|
|
|
|
|
|
|
.time_capsule
|
2019-10-20 22:24:17 +00:00
|
|
|
ld hl, .MonWasSentToText
|
2015-11-23 05:21:21 +00:00
|
|
|
call PrintText
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_Wait80Frames
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2019-10-20 22:24:17 +00:00
|
|
|
.MonWasSentToText:
|
|
|
|
text_far _MonWasSentToText
|
2018-11-17 18:33:03 +00:00
|
|
|
text_end
|
2015-11-23 05:21:21 +00:00
|
|
|
|
2019-10-20 22:24:17 +00:00
|
|
|
.MonNameSentToText:
|
|
|
|
text_far _MonNameSentToText
|
2018-11-17 18:33:03 +00:00
|
|
|
text_end
|
2015-11-23 05:21:21 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_OTBidsFarewell:
|
2019-10-20 22:24:17 +00:00
|
|
|
ld hl, .BidsFarewellToMonText
|
2015-11-23 05:21:21 +00:00
|
|
|
call PrintText
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_Wait80Frames
|
2019-10-20 22:24:17 +00:00
|
|
|
ld hl, .MonNameBidsFarewellText
|
2015-11-23 05:21:21 +00:00
|
|
|
call PrintText
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_Wait80Frames
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2019-10-20 22:24:17 +00:00
|
|
|
.BidsFarewellToMonText:
|
|
|
|
text_far _BidsFarewellToMonText
|
2018-11-17 18:33:03 +00:00
|
|
|
text_end
|
2015-11-23 05:21:21 +00:00
|
|
|
|
2019-10-20 22:24:17 +00:00
|
|
|
.MonNameBidsFarewellText:
|
|
|
|
text_far _MonNameBidsFarewellText
|
2018-11-17 18:33:03 +00:00
|
|
|
text_end
|
2015-11-23 05:21:21 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_TakeCareOfText:
|
2015-11-23 05:21:21 +00:00
|
|
|
call WaitTop
|
|
|
|
hlcoord 0, 10
|
|
|
|
ld bc, 8 * SCREEN_WIDTH
|
|
|
|
ld a, " "
|
|
|
|
call ByteFill
|
|
|
|
call WaitBGMap
|
2019-10-20 22:24:17 +00:00
|
|
|
ld hl, .TakeGoodCareOfMonText
|
2015-11-23 05:21:21 +00:00
|
|
|
call PrintText
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_Wait80Frames
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2019-10-20 22:24:17 +00:00
|
|
|
.TakeGoodCareOfMonText:
|
|
|
|
text_far _TakeGoodCareOfMonText
|
2018-11-17 18:33:03 +00:00
|
|
|
text_end
|
2015-11-23 05:21:21 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_OTSendsText1:
|
2019-10-20 22:24:17 +00:00
|
|
|
ld hl, .ForYourMonSendsText
|
2015-11-23 05:21:21 +00:00
|
|
|
call PrintText
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_Wait80Frames
|
2019-10-20 22:24:17 +00:00
|
|
|
ld hl, .OTSendsText
|
2015-11-23 05:21:21 +00:00
|
|
|
call PrintText
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_Wait80Frames
|
2015-11-23 05:21:21 +00:00
|
|
|
ld c, 14
|
|
|
|
call DelayFrames
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2019-10-20 22:24:17 +00:00
|
|
|
.ForYourMonSendsText:
|
|
|
|
text_far _ForYourMonSendsText
|
2018-11-17 18:33:03 +00:00
|
|
|
text_end
|
2015-11-23 05:21:21 +00:00
|
|
|
|
2019-10-20 22:24:17 +00:00
|
|
|
.OTSendsText:
|
|
|
|
text_far _OTSendsText
|
2018-11-17 18:33:03 +00:00
|
|
|
text_end
|
2015-11-23 05:21:21 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_OTSendsText2:
|
2019-10-20 22:24:17 +00:00
|
|
|
ld hl, .WillTradeText
|
2015-11-23 05:21:21 +00:00
|
|
|
call PrintText
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_Wait80Frames
|
2019-10-20 22:24:17 +00:00
|
|
|
ld hl, .ForYourMonWillTradeText
|
2015-11-23 05:21:21 +00:00
|
|
|
call PrintText
|
2016-05-14 02:46:32 +00:00
|
|
|
call TradeAnim_Wait80Frames
|
2015-11-23 05:21:21 +00:00
|
|
|
ld c, 14
|
|
|
|
call DelayFrames
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2019-10-20 22:24:17 +00:00
|
|
|
.WillTradeText:
|
|
|
|
text_far _WillTradeText
|
2018-11-17 18:33:03 +00:00
|
|
|
text_end
|
2015-11-23 05:21:21 +00:00
|
|
|
|
2019-10-20 22:24:17 +00:00
|
|
|
.ForYourMonWillTradeText:
|
|
|
|
text_far _ForYourMonWillTradeText
|
2018-11-17 18:33:03 +00:00
|
|
|
text_end
|
2015-11-23 05:21:21 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_Wait80Frames:
|
2015-11-23 05:21:21 +00:00
|
|
|
ld c, 80
|
|
|
|
call DelayFrames
|
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2020-02-13 17:30:13 +00:00
|
|
|
TradeAnim_BlankTilemap:
|
2015-11-23 05:21:21 +00:00
|
|
|
hlcoord 0, 0
|
|
|
|
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
|
|
|
|
ld a, " "
|
|
|
|
call ByteFill
|
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_CopyBoxFromDEtoHL:
|
2016-05-14 02:46:32 +00:00
|
|
|
.row
|
2015-11-23 05:21:21 +00:00
|
|
|
push bc
|
|
|
|
push hl
|
2016-05-14 02:46:32 +00:00
|
|
|
.col
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [de]
|
|
|
|
inc de
|
|
|
|
ld [hli], a
|
|
|
|
dec c
|
2016-05-14 02:46:32 +00:00
|
|
|
jr nz, .col
|
2015-11-23 05:21:21 +00:00
|
|
|
pop hl
|
|
|
|
ld bc, SCREEN_WIDTH
|
|
|
|
add hl, bc
|
|
|
|
pop bc
|
|
|
|
dec b
|
2016-05-14 02:46:32 +00:00
|
|
|
jr nz, .row
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_NormalPals:
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hSGB]
|
2015-11-23 05:21:21 +00:00
|
|
|
and a
|
2015-12-17 18:49:26 +00:00
|
|
|
ld a, %11100100 ; 3,2,1,0
|
2016-01-09 21:28:22 +00:00
|
|
|
jr z, .not_sgb
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, $f0
|
|
|
|
|
2016-01-09 21:28:22 +00:00
|
|
|
.not_sgb
|
2015-12-09 16:38:40 +00:00
|
|
|
call DmgToCgbObjPal0
|
2015-12-17 18:49:26 +00:00
|
|
|
ld a, %11100100 ; 3,2,1,0
|
2015-11-23 05:21:21 +00:00
|
|
|
call DmgToCgbBGPals
|
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
LinkTradeAnim_LoadTradePlayerNames:
|
2015-11-23 05:21:21 +00:00
|
|
|
push de
|
2015-11-23 07:08:08 +00:00
|
|
|
ld de, wLinkPlayer1Name
|
2015-11-23 05:21:21 +00:00
|
|
|
ld bc, NAME_LENGTH
|
|
|
|
call CopyBytes
|
|
|
|
pop hl
|
2015-11-23 07:08:08 +00:00
|
|
|
ld de, wLinkPlayer2Name
|
2015-11-23 05:21:21 +00:00
|
|
|
ld bc, NAME_LENGTH
|
|
|
|
call CopyBytes
|
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
LinkTradeAnim_LoadTradeMonSpecies:
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [hl]
|
2016-01-09 21:28:22 +00:00
|
|
|
ld [wLinkTradeSendmonSpecies], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [de]
|
2016-01-09 21:28:22 +00:00
|
|
|
ld [wLinkTradeGetmonSpecies], a
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_FlashBGPals:
|
2020-10-28 17:35:39 +00:00
|
|
|
ld a, [wFrameCounter2]
|
2015-11-23 05:21:21 +00:00
|
|
|
and $7
|
|
|
|
ret nz
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [rBGP]
|
2016-05-14 02:46:32 +00:00
|
|
|
xor %00111100
|
2015-11-23 05:21:21 +00:00
|
|
|
call DmgToCgbBGPals
|
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
LoadTradeBallAndCableGFX:
|
2015-11-23 05:21:21 +00:00
|
|
|
call DelayFrame
|
|
|
|
ld de, TradeBallGFX
|
2017-12-28 12:32:33 +00:00
|
|
|
ld hl, vTiles0 tile $62
|
2018-01-15 00:43:35 +00:00
|
|
|
lb bc, BANK(TradeBallGFX), 6
|
2015-11-23 05:21:21 +00:00
|
|
|
call Request2bpp
|
|
|
|
ld de, TradePoofGFX
|
2017-12-28 12:32:33 +00:00
|
|
|
ld hl, vTiles0 tile $68
|
2018-01-15 00:43:35 +00:00
|
|
|
lb bc, BANK(TradePoofGFX), 12
|
2015-11-23 05:21:21 +00:00
|
|
|
call Request2bpp
|
|
|
|
ld de, TradeCableGFX
|
2017-12-28 12:32:33 +00:00
|
|
|
ld hl, vTiles0 tile $74
|
2018-01-15 00:43:35 +00:00
|
|
|
lb bc, BANK(TradeCableGFX), 4
|
2015-11-23 05:21:21 +00:00
|
|
|
call Request2bpp
|
2020-10-30 19:39:08 +00:00
|
|
|
xor a ; SPRITE_ANIM_DICT_DEFAULT
|
2016-01-09 21:28:22 +00:00
|
|
|
ld hl, wSpriteAnimDict
|
2015-11-23 05:21:21 +00:00
|
|
|
ld [hli], a
|
|
|
|
ld [hl], $62
|
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
LoadTradeBubbleGFX:
|
2015-11-23 05:21:21 +00:00
|
|
|
call DelayFrame
|
2018-07-28 23:27:34 +00:00
|
|
|
ld e, MONICON_TRADE
|
2017-12-24 17:47:30 +00:00
|
|
|
callfar LoadMenuMonIcon
|
2015-11-23 05:21:21 +00:00
|
|
|
ld de, TradeBubbleGFX
|
2017-12-28 12:32:33 +00:00
|
|
|
ld hl, vTiles0 tile $72
|
2018-01-15 00:43:35 +00:00
|
|
|
lb bc, BANK(TradeBubbleGFX), 4
|
2015-11-23 05:21:21 +00:00
|
|
|
call Request2bpp
|
2020-10-30 19:39:08 +00:00
|
|
|
xor a ; SPRITE_ANIM_DICT_DEFAULT
|
2016-01-09 21:28:22 +00:00
|
|
|
ld hl, wSpriteAnimDict
|
2015-11-23 05:21:21 +00:00
|
|
|
ld [hli], a
|
|
|
|
ld [hl], $62
|
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_WaitAnim:
|
2018-01-11 20:36:11 +00:00
|
|
|
ld hl, wFrameCounter
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [hl]
|
|
|
|
and a
|
|
|
|
jr z, .done
|
|
|
|
dec [hl]
|
|
|
|
ret
|
|
|
|
|
|
|
|
.done
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
TradeAnim_WaitAnim2:
|
2018-01-11 20:36:11 +00:00
|
|
|
ld hl, wFrameCounter
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [hl]
|
|
|
|
and a
|
2015-11-23 07:08:08 +00:00
|
|
|
jr z, .done
|
2015-11-23 05:21:21 +00:00
|
|
|
dec [hl]
|
|
|
|
ret
|
|
|
|
|
2015-11-23 07:08:08 +00:00
|
|
|
.done
|
2016-05-14 03:23:26 +00:00
|
|
|
call TradeAnim_AdvanceScriptPointer
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2020-06-21 20:27:43 +00:00
|
|
|
DebugTrade: ; unreferenced
|
|
|
|
; This function was meant for use in Japanese versions, so the
|
2015-11-23 05:21:21 +00:00
|
|
|
; constant used for copy length was changed by accident.
|
|
|
|
|
2016-05-14 02:46:32 +00:00
|
|
|
ld hl, .DebugTradeData
|
2015-11-23 05:21:21 +00:00
|
|
|
|
|
|
|
ld a, [hli]
|
|
|
|
ld [wPlayerTrademonSpecies], a
|
|
|
|
ld de, wPlayerTrademonSenderName
|
2018-01-19 01:40:32 +00:00
|
|
|
ld c, NAME_LENGTH + 2 ; JP: NAME_LENGTH_JAPANESE + 2
|
2015-11-23 07:08:08 +00:00
|
|
|
.loop1
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [hli]
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
dec c
|
2015-11-23 07:08:08 +00:00
|
|
|
jr nz, .loop1
|
2015-11-23 05:21:21 +00:00
|
|
|
|
|
|
|
ld a, [hli]
|
|
|
|
ld [wOTTrademonSpecies], a
|
|
|
|
ld de, wOTTrademonSenderName
|
2018-01-19 01:40:32 +00:00
|
|
|
ld c, NAME_LENGTH + 2 ; JP: NAME_LENGTH_JAPANESE + 2
|
2015-11-23 07:08:08 +00:00
|
|
|
.loop2
|
2015-11-23 05:21:21 +00:00
|
|
|
ld a, [hli]
|
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
dec c
|
2015-11-23 07:08:08 +00:00
|
|
|
jr nz, .loop2
|
2015-11-23 05:21:21 +00:00
|
|
|
ret
|
2016-05-14 02:46:32 +00:00
|
|
|
|
2018-01-19 01:40:32 +00:00
|
|
|
debugtrade: MACRO
|
2020-07-17 20:43:41 +00:00
|
|
|
; species, ot name, ot id
|
2018-01-19 01:40:32 +00:00
|
|
|
db \1, \2
|
|
|
|
dw \3
|
|
|
|
ENDM
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.DebugTradeData:
|
2020-07-17 20:43:41 +00:00
|
|
|
debugtrade VENUSAUR, "ゲーフり@@", $0123 ; GAME FREAK
|
2018-01-19 01:40:32 +00:00
|
|
|
debugtrade CHARIZARD, "クりーチャ@", $0456 ; Creatures Inc.
|
2015-11-23 05:21:21 +00:00
|
|
|
|
2020-07-17 20:43:41 +00:00
|
|
|
TradeGameBoyTilemap: INCBIN "gfx/trade/game_boy.tilemap" ; 6x8
|
|
|
|
TradeLinkTubeTilemap: INCBIN "gfx/trade/link_cable.tilemap" ; 12x3
|
|
|
|
|
|
|
|
TradeArrowRightGFX: INCBIN "gfx/trade/arrow_right.2bpp"
|
|
|
|
TradeArrowLeftGFX: INCBIN "gfx/trade/arrow_left.2bpp"
|
|
|
|
TradeCableGFX: INCBIN "gfx/trade/cable.2bpp"
|
|
|
|
TradeBubbleGFX: INCBIN "gfx/trade/bubble.2bpp"
|
|
|
|
TradeGameBoyLZ: INCBIN "gfx/trade/game_boy_cable.2bpp.lz"
|
|
|
|
TradeBallGFX: INCBIN "gfx/trade/ball.2bpp"
|
|
|
|
TradePoofGFX: INCBIN "gfx/trade/poof.2bpp"
|