shithub: pokecrystal

Download patch

ref: ce004be92c54459cb0fc772e296d07256666fe58
parent: 1222ea7def97c6d78abef09f25787ef555e5c1cd
author: Rangi <[email protected]>
date: Wed Oct 12 17:41:08 EDT 2022

Revise constants in CheckShininess

--- a/engine/gfx/color.asm
+++ b/engine/gfx/color.asm
@@ -1,9 +1,9 @@
 INCLUDE "engine/gfx/sgb_layouts.asm"
 
-DEF SHINY_ATK_BIT EQU 5
-DEF SHINY_DEF_VAL EQU 10
-DEF SHINY_SPD_VAL EQU 10
-DEF SHINY_SPC_VAL EQU 10
+DEF SHINY_ATK_MASK EQU %0010
+DEF SHINY_DEF_DV EQU 10
+DEF SHINY_SPD_DV EQU 10
+DEF SHINY_SPC_DV EQU 10
 
 CheckShininess:
 ; Check if a mon is shiny by DVs at bc.
@@ -14,25 +14,25 @@
 
 ; Attack
 	ld a, [hl]
-	and 1 << SHINY_ATK_BIT
+	and SHINY_ATK_MASK << 4
 	jr z, .not_shiny
 
 ; Defense
 	ld a, [hli]
-	and $f
-	cp  SHINY_DEF_VAL
+	and %1111
+	cp SHINY_DEF_DV
 	jr nz, .not_shiny
 
 ; Speed
 	ld a, [hl]
-	and $f0
-	cp  SHINY_SPD_VAL << 4
+	and %1111 << 4
+	cp SHINY_SPD_DV << 4
 	jr nz, .not_shiny
 
 ; Special
 	ld a, [hl]
-	and $f
-	cp  SHINY_SPC_VAL
+	and %1111
+	cp SHINY_SPC_DV
 	jr nz, .not_shiny
 
 ; shiny
@@ -53,7 +53,7 @@
 
 ; Defense
 	ld a, [hli]
-	and $f
+	and %1111
 	cp 10
 	jr c, .not_shiny
 
@@ -64,7 +64,7 @@
 
 ; Special
 	ld a, [hl]
-	and $f
+	and %1111
 	cp 10
 	jr c, .not_shiny