summaryrefslogtreecommitdiff
path: root/src/egg_hatch.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/egg_hatch.c')
-rw-r--r--src/egg_hatch.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/egg_hatch.c b/src/egg_hatch.c
index ed25a2c68..360dd2466 100644
--- a/src/egg_hatch.c
+++ b/src/egg_hatch.c
@@ -30,6 +30,7 @@
#include "field_weather.h"
#include "international_string_util.h"
#include "naming_screen.h"
+#include "pokemon_storage_system.h"
#include "field_screen_effect.h"
#include "battle.h" // to get rid of later
@@ -60,10 +61,6 @@ extern const u32 gUnknown_08331F60[]; // tilemap gameboy circle
extern const u8 gText_HatchedFromEgg[];
extern const u8 gText_NickHatchPrompt[];
-extern void PlayRainSoundEffect(void);
-extern u16 sub_80D22D0(void);
-extern u8 CountPartyAliveNonEggMonsExcept(u8);
-
static void Task_EggHatch(u8 taskID);
static void CB2_EggHatch_0(void);
static void CB2_EggHatch_1(void);
@@ -442,7 +439,7 @@ static u8 EggHatchCreateMonSprite(u8 a0, u8 switchID, u8 pokeID, u16* speciesLoc
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species],
gMonSpritesGfxPtr->sprites[(a0 * 2) + 1],
species, pid);
- LoadCompressedObjectPalette(GetMonSpritePalStruct(mon));
+ LoadCompressedSpritePalette(GetMonSpritePalStruct(mon));
*speciesLoc = species;
}
break;
@@ -876,7 +873,7 @@ u8 GetEggStepsToSubtract(void)
u8 count, i;
for (count = CalculatePlayerPartyCount(), i = 0; i < count; i++)
{
- if (!GetMonData(&gPlayerParty[i], MON_DATA_SANITY_BIT3))
+ if (!GetMonData(&gPlayerParty[i], MON_DATA_SANITY_IS_EGG))
{
u8 ability = GetMonAbility(&gPlayerParty[i]);
if (ability == ABILITY_MAGMA_ARMOR || ability == ABILITY_FLAME_BODY)
@@ -888,7 +885,7 @@ u8 GetEggStepsToSubtract(void)
u16 sub_80722E0(void)
{
- u16 value = sub_80D22D0();
- value += CountPartyAliveNonEggMonsExcept(6);
- return value;
+ u16 aliveNonEggMonsCount = CountStorageNonEggMons();
+ aliveNonEggMonsCount += CountPartyAliveNonEggMonsExcept(6);
+ return aliveNonEggMonsCount;
}