Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pret
GitHub Repository: pret/pokered
Path: blob/master/engine/events/pokecenter.asm
1271 views
1
DisplayPokemonCenterDialogue_::
2
call SaveScreenTilesToBuffer1 ; save screen
3
ld hl, PokemonCenterWelcomeText
4
call PrintText
5
ld hl, wStatusFlags4
6
bit BIT_USED_POKECENTER, [hl]
7
set BIT_UNKNOWN_4_1, [hl]
8
set BIT_USED_POKECENTER, [hl]
9
jr nz, .skipShallWeHealYourPokemon
10
ld hl, ShallWeHealYourPokemonText
11
call PrintText
12
.skipShallWeHealYourPokemon
13
call YesNoChoicePokeCenter ; yes/no menu
14
ld a, [wCurrentMenuItem]
15
and a
16
jr nz, .declinedHealing ; if the player chose No
17
call SetLastBlackoutMap
18
call LoadScreenTilesFromBuffer1 ; restore screen
19
ld hl, NeedYourPokemonText
20
call PrintText
21
ld a, $18
22
ld [wSprite01StateData1ImageIndex], a ; make the nurse turn to face the machine
23
call Delay3
24
predef HealParty
25
farcall AnimateHealingMachine ; do the healing machine animation
26
xor a
27
ld [wAudioFadeOutControl], a
28
ld a, [wAudioSavedROMBank]
29
ld [wAudioROMBank], a
30
ld a, [wMapMusicSoundID]
31
ld [wLastMusicSoundID], a
32
ld [wNewSoundID], a
33
call PlaySound
34
ld hl, PokemonFightingFitText
35
call PrintText
36
ld a, $14
37
ld [wSprite01StateData1ImageIndex], a ; make the nurse bow
38
ld c, a
39
call DelayFrames
40
jr .done
41
.declinedHealing
42
call LoadScreenTilesFromBuffer1 ; restore screen
43
.done
44
ld hl, PokemonCenterFarewellText
45
call PrintText
46
jp UpdateSprites
47
48
PokemonCenterWelcomeText:
49
text_far _PokemonCenterWelcomeText
50
text_end
51
52
ShallWeHealYourPokemonText:
53
text_pause
54
text_far _ShallWeHealYourPokemonText
55
text_end
56
57
NeedYourPokemonText:
58
text_far _NeedYourPokemonText
59
text_end
60
61
PokemonFightingFitText:
62
text_far _PokemonFightingFitText
63
text_end
64
65
PokemonCenterFarewellText:
66
text_pause
67
text_far _PokemonCenterFarewellText
68
text_end
69
70