Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pret
GitHub Repository: pret/pokered
Path: blob/master/engine/events/oaks_aide.asm
1271 views
1
OaksAideScript:
2
ld hl, OaksAideHiText
3
call PrintText
4
call YesNoChoice
5
ld a, [wCurrentMenuItem]
6
and a
7
jr nz, .choseNo
8
ld hl, wPokedexOwned
9
ld b, wPokedexOwnedEnd - wPokedexOwned
10
call CountSetBits
11
ld a, [wNumSetBits]
12
ldh [hOaksAideNumMonsOwned], a
13
ld b, a
14
ldh a, [hOaksAideRequirement]
15
cp b
16
jr z, .giveItem
17
jr nc, .notEnoughOwnedMons
18
.giveItem
19
ld hl, OaksAideHereYouGoText
20
call PrintText
21
ldh a, [hOaksAideRewardItem]
22
ld b, a
23
ld c, 1
24
call GiveItem
25
jr nc, .bagFull
26
ld hl, OaksAideGotItemText
27
call PrintText
28
ld a, OAKS_AIDE_GOT_ITEM
29
jr .done
30
.bagFull
31
ld hl, OaksAideNoRoomText
32
call PrintText
33
xor a ; OAKS_AIDE_BAG_FULL
34
jr .done
35
.notEnoughOwnedMons
36
ld hl, OaksAideUhOhText
37
call PrintText
38
ld a, OAKS_AIDE_NOT_ENOUGH_MONS
39
jr .done
40
.choseNo
41
ld hl, OaksAideComeBackText
42
call PrintText
43
ld a, OAKS_AIDE_REFUSED
44
.done
45
ldh [hOaksAideResult], a
46
ret
47
48
OaksAideHiText:
49
text_far _OaksAideHiText
50
text_end
51
52
OaksAideUhOhText:
53
text_far _OaksAideUhOhText
54
text_end
55
56
OaksAideComeBackText:
57
text_far _OaksAideComeBackText
58
text_end
59
60
OaksAideHereYouGoText:
61
text_far _OaksAideHereYouGoText
62
text_end
63
64
OaksAideGotItemText:
65
text_far _OaksAideGotItemText
66
sound_get_item_1
67
text_end
68
69
OaksAideNoRoomText:
70
text_far _OaksAideNoRoomText
71
text_end
72
73