• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Script] Unused shiny script in Pokecrystal disassembly

31
Posts
3
Years
    • Seen Dec 29, 2023
    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:
    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:
    Back
    Top