- 33
- Posts
- 4
- Years
- Seen Apr 16, 2025
I'm trying out the unused shiny script in the Pokecrystal disassembly and getting strange results. The script is supposed to make it so that about 1 in 50 encounters is shiny. This is the script:
The code as-is does not work, as I ran over 100 encounters and none were shiny.
I replaced all the 10s with 0s, and predictably, every encounter was shiny.
I replaced the 10s with 2s, which is more than half of the encounters. Only a small percentage was shiny, but every encounter played the shiny animation.
What's up?
Code:
Unused_CheckShininess:
; Return carry if the DVs at hl are all 10 or higher.
; Attack
ld a, [hl]
cp 10 << 4
jr c, .NotShiny
; Defense
ld a, [hli]
and $f
cp 10
jr c, .NotShiny
; Speed
ld a, [hl]
cp 10 << 4
jr c, .NotShiny
; Special
ld a, [hl]
and $f
cp 10
jr c, .NotShiny
.Shiny:
scf
ret
.NotShiny:
and a
ret
The code as-is does not work, as I ran over 100 encounters and none were shiny.
I replaced all the 10s with 0s, and predictably, every encounter was shiny.
I replaced the 10s with 2s, which is more than half of the encounters. Only a small percentage was shiny, but every encounter played the shiny animation.
What's up?
Last edited: