diff options
| author | Rangi <35663410+Rangi42@users.noreply.github.com> | 2020-07-03 09:38:52 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-03 09:38:52 -0400 |
| commit | c85050497c1bd062e9cd40bf5b32fa3beca366cc (patch) | |
| tree | 9593ddd3ab820223ab580d5fc0ae133b485b8315 /engine/events/pokedex_rating.asm | |
| parent | Actually run .travis/webhook.sh (diff) | |
| parent | Add engine/movie/oak_speech/ subdirectory (diff) | |
| download | pokeyellow-c85050497c1bd062e9cd40bf5b32fa3beca366cc.tar.gz pokeyellow-c85050497c1bd062e9cd40bf5b32fa3beca366cc.tar.xz pokeyellow-c85050497c1bd062e9cd40bf5b32fa3beca366cc.zip | |
Merge pull request #256 from Rangi42/master
Add subdirectories to engine/ similar to pokecrystal
Diffstat (limited to 'engine/events/pokedex_rating.asm')
| -rwxr-xr-x | engine/events/pokedex_rating.asm | 154 |
1 files changed, 154 insertions, 0 deletions
diff --git a/engine/events/pokedex_rating.asm b/engine/events/pokedex_rating.asm new file mode 100755 index 00000000..f1aaf618 --- /dev/null +++ b/engine/events/pokedex_rating.asm @@ -0,0 +1,154 @@ +DisplayDexRating: + ld hl, wPokedexSeen + ld b, wPokedexSeenEnd - wPokedexSeen + call CountSetBits + ld a, [wNumSetBits] + ld [hDexRatingNumMonsSeen], a + ld hl, wPokedexOwned + ld b, wPokedexOwnedEnd - wPokedexOwned + call CountSetBits + ld a, [wNumSetBits] + ld [hDexRatingNumMonsOwned], a + ld hl, DexRatingsTable +.findRating + ld a, [hli] + ld b, a + ld a, [hDexRatingNumMonsOwned] + cp b + jr c, .foundRating + inc hl + inc hl + jr .findRating +.foundRating + ld a, [hli] + ld h, [hl] + ld l, a ; load text pointer into hl + CheckAndResetEventA EVENT_HALL_OF_FAME_DEX_RATING + jr nz, .hallOfFame + push hl + ld hl, PokedexRatingText_441cc + call PrintText + pop hl + call PrintText + callba PlayPokedexRatingSfx + jp WaitForTextScrollButtonPress +.hallOfFame + ld de, wDexRatingNumMonsSeen + ld a, [hDexRatingNumMonsSeen] + ld [de], a + inc de + ld a, [hDexRatingNumMonsOwned] + ld [de], a + inc de +.copyRatingTextLoop + ld a, [hli] + cp "@" + jr z, .doneCopying + ld [de], a + inc de + jr .copyRatingTextLoop +.doneCopying + ld [de], a + ret + +PokedexRatingText_441cc: + TX_FAR _OaksLabText_441cc + db "@" + +DexRatingsTable: + db 10 + dw PokedexRatingText_44201 + db 20 + dw PokedexRatingText_44206 + db 30 + dw PokedexRatingText_4420b + db 40 + dw PokedexRatingText_44210 + db 50 + dw PokedexRatingText_44215 + db 60 + dw PokedexRatingText_4421a + db 70 + dw PokedexRatingText_4421f + db 80 + dw PokedexRatingText_44224 + db 90 + dw PokedexRatingText_44229 + db 100 + dw PokedexRatingText_4422e + db 110 + dw PokedexRatingText_44233 + db 120 + dw PokedexRatingText_44238 + db 130 + dw PokedexRatingText_4423d + db 140 + dw PokedexRatingText_44242 + db 150 + dw PokedexRatingText_44247 + db NUM_POKEMON + 1 + dw PokedexRatingText_4424c + +PokedexRatingText_44201: + TX_FAR _OaksLabText_44201 + db "@" + +PokedexRatingText_44206: + TX_FAR _OaksLabText_44206 + db "@" + +PokedexRatingText_4420b: + TX_FAR _OaksLabText_4420b + db "@" + +PokedexRatingText_44210: + TX_FAR _OaksLabText_44210 + db "@" + +PokedexRatingText_44215: + TX_FAR _OaksLabText_44215 + db "@" + +PokedexRatingText_4421a: + TX_FAR _OaksLabText_4421a + db "@" + +PokedexRatingText_4421f: + TX_FAR _OaksLabText_4421f + db "@" + +PokedexRatingText_44224: + TX_FAR _OaksLabText_44224 + db "@" + +PokedexRatingText_44229: + TX_FAR _OaksLabText_44229 + db "@" + +PokedexRatingText_4422e: + TX_FAR _OaksLabText_4422e + db "@" + +PokedexRatingText_44233: + TX_FAR _OaksLabText_44233 + db "@" + +PokedexRatingText_44238: + TX_FAR _OaksLabText_44238 + db "@" + +PokedexRatingText_4423d: + TX_FAR _OaksLabText_4423d + db "@" + +PokedexRatingText_44242: + TX_FAR _OaksLabText_44242 + db "@" + +PokedexRatingText_44247: + TX_FAR _OaksLabText_44247 + db "@" + +PokedexRatingText_4424c: + TX_FAR _OaksLabText_4424c + db "@" |
