summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGudf <28691694+Gudf@users.noreply.github.com>2019-07-11 20:16:39 +0200
committerGudf <28691694+Gudf@users.noreply.github.com>2019-07-11 20:16:39 +0200
commit75f165ed746cbc33cf9d0b9181abd9e861264f56 (patch)
tree20c3092902b871c9ed5bf00a7be97e9529ea2f69 /src
parentae01afdd30cc24eb2ff9a13789c108a418f8d7f4 (diff)
Use a constant instead of integer literals when checking for shinyness
Diffstat (limited to 'src')
-rwxr-xr-xsrc/battle_anim_special.c2
-rw-r--r--src/pokemon.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/battle_anim_special.c b/src/battle_anim_special.c
index 740340d14..6780f0a32 100755
--- a/src/battle_anim_special.c
+++ b/src/battle_anim_special.c
@@ -2029,7 +2029,7 @@ void sub_8172EF0(u8 battler, struct Pokemon *mon)
if (IsBattlerSpriteVisible(battler))
{
shinyValue = HIHALF(otId) ^ LOHALF(otId) ^ HIHALF(personality) ^ LOHALF(personality);
- if (shinyValue < 8)
+ if (shinyValue < SHINY_ODDS)
isShiny = TRUE;
if (isShiny)
diff --git a/src/pokemon.c b/src/pokemon.c
index c54e8ad2c..6ad47d346 100644
--- a/src/pokemon.c
+++ b/src/pokemon.c
@@ -2183,7 +2183,7 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV,
{
value = Random32();
shinyValue = HIHALF(value) ^ LOHALF(value) ^ HIHALF(personality) ^ LOHALF(personality);
- } while (shinyValue < 8);
+ } while (shinyValue < SHINY_ODDS);
}
else if (otIdType == OT_ID_PRESET) //Pokemon has a preset OT ID
{
@@ -6332,7 +6332,7 @@ const u32 *GetFrontSpritePalFromSpeciesAndPersonality(u16 species, u32 otId, u32
return gMonPaletteTable[0].data;
shinyValue = HIHALF(otId) ^ LOHALF(otId) ^ HIHALF(personality) ^ LOHALF(personality);
- if (shinyValue < 8)
+ if (shinyValue < SHINY_ODDS)
return gMonShinyPaletteTable[species].data;
else
return gMonPaletteTable[species].data;
@@ -6351,7 +6351,7 @@ const struct CompressedSpritePalette *GetMonSpritePalStructFromOtIdPersonality(u
u32 shinyValue;
shinyValue = HIHALF(otId) ^ LOHALF(otId) ^ HIHALF(personality) ^ LOHALF(personality);
- if (shinyValue < 8)
+ if (shinyValue < SHINY_ODDS)
return &gMonShinyPaletteTable[species];
else
return &gMonPaletteTable[species];
@@ -6525,7 +6525,7 @@ bool8 IsShinyOtIdPersonality(u32 otId, u32 personality)
{
bool8 retVal = FALSE;
u32 shinyValue = HIHALF(otId) ^ LOHALF(otId) ^ HIHALF(personality) ^ LOHALF(personality);
- if (shinyValue < 8)
+ if (shinyValue < SHINY_ODDS)
retVal = TRUE;
return retVal;
}