summaryrefslogtreecommitdiff
path: root/src/engine/promotional_card.asm
blob: bb3250ad877bf08af21a2c3fe7e1b567be0617e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
; shows screen with the promotional card and received text
; depending on input a
; if $0 = Legendary Molters, Articuno, Zapdos and Dragonite cards
; otherwise, a card ID
_ShowPromotionalCardScreen:
	push af
	lb de, $38, $9f
	call SetupText
	pop af
	or a
	jr nz, .else
	ld a, MOLTRES2
	call .legendary_card_text
	ld a, ARTICUNO2
	call .legendary_card_text
	ld a, ZAPDOS3
	call .legendary_card_text
	ld a, DRAGONITE1
.legendary_card_text
	ldtx hl, ReceivedLegendaryCardText
	jr .print_text
.else
	ldtx hl, ReceivedCardText
	cp VILEPLUME
	jr z, .print_text
	cp BLASTOISE
	jr z, .print_text
	ldtx hl, ReceivedPromotionalFlyingPikachuText
	cp FLYING_PIKACHU
	jr z, .print_text
	ldtx hl, ReceivedPromotionalSurfingPikachuText
	cp SURFING_PIKACHU1
	jr z, .print_text
	cp SURFING_PIKACHU2
	jr z, .print_text
	ldtx hl, ReceivedPromotionalCardText
.print_text
	push hl
	ld e, a
	ld d, $0
	call LoadCardDataToBuffer1_FromCardID
	call PauseSong
	ld a, MUSIC_MEDAL
	call PlaySong
	ld hl, wLoadedCard1Name
	ld a, [hli]
	ld h, [hl]
	ld l, a
	bank1call LoadTxRam2 ; switch to bank 1, but call a home func
	ld a, PLAYER_TURN
	ldh [hWhoseTurn], a
	pop hl
	bank1call _DisplayCardDetailScreen
.loop
	call AssertSongFinished
	or a
	jr nz, .loop

	call ResumeSong
	bank1call OpenCardPage_FromHand
	ret