summaryrefslogtreecommitdiff
path: root/src/daycare.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daycare.c')
-rw-r--r--src/daycare.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/src/daycare.c b/src/daycare.c
index 511fa0551..14053217d 100644
--- a/src/daycare.c
+++ b/src/daycare.c
@@ -23,8 +23,10 @@
#include "constants/moves.h"
#include "constants/region_map_sections.h"
+extern struct Evolution gEvolutionTable[][EVOS_PER_MON];
+
// this file's functions
-static void ClearDaycareMonMail(struct DayCareMail *mail);
+static void ClearDaycareMonMail(struct DaycareMail *mail);
static void SetInitialEggData(struct Pokemon *mon, u16 species, struct DayCare *daycare);
static u8 GetDaycareCompatibilityScore(struct DayCare *daycare);
static void DaycarePrintMonInfo(u8 windowId, s32 daycareSlotId, u8 y);
@@ -120,7 +122,7 @@ u8 CountPokemonInDaycare(struct DayCare *daycare)
return count;
}
-void InitDaycareMailRecordMixing(struct DayCare *daycare, struct RecordMixingDayCareMail *daycareMail)
+void InitDaycareMailRecordMixing(struct DayCare *daycare, struct RecordMixingDaycareMail *daycareMail)
{
u8 i;
u8 numDaycareMons = 0;
@@ -131,13 +133,9 @@ void InitDaycareMailRecordMixing(struct DayCare *daycare, struct RecordMixingDay
{
numDaycareMons++;
if (GetBoxMonData(&daycare->mons[i].mon, MON_DATA_HELD_ITEM) == ITEM_NONE)
- {
daycareMail->holdsItem[i] = FALSE;
- }
else
- {
daycareMail->holdsItem[i] = TRUE;
- }
}
else
{
@@ -154,7 +152,7 @@ static s8 Daycare_FindEmptySpot(struct DayCare *daycare)
for (i = 0; i < DAYCARE_MON_COUNT; i++)
{
- if (GetBoxMonData(&daycare->mons[i].mon, MON_DATA_SPECIES) == 0)
+ if (GetBoxMonData(&daycare->mons[i].mon, MON_DATA_SPECIES) == SPECIES_NONE)
return i;
}
@@ -170,7 +168,7 @@ static void StorePokemonInDaycare(struct Pokemon *mon, struct DaycareMon *daycar
StringCopy(daycareMon->mail.OT_name, gSaveBlock2Ptr->playerName);
GetMonNickname2(mon, daycareMon->mail.monName);
StripExtCtrlCodes(daycareMon->mail.monName);
- daycareMon->mail.gameLanguage = LANGUAGE_ENGLISH;
+ daycareMon->mail.gameLanguage = GAME_LANGUAGE;
daycareMon->mail.monLanguage = GetMonData(mon, MON_DATA_LANGUAGE);
mailId = GetMonData(mon, MON_DATA_MAIL);
daycareMon->mail.message = gSaveBlock1Ptr->mail[mailId];
@@ -349,7 +347,7 @@ u8 GetNumLevelsGainedFromDaycare(void)
return 0;
}
-static void ClearDaycareMonMail(struct DayCareMail *mail)
+static void ClearDaycareMonMail(struct DaycareMail *mail)
{
s32 i;
@@ -838,7 +836,7 @@ void CreateEgg(struct Pokemon *mon, u16 species, bool8 setHotSpringsLocation)
u8 metLocation;
u8 isEgg;
- CreateMon(mon, species, EGG_HATCH_LEVEL, 32, FALSE, 0, OT_ID_PLAYER_ID, 0);
+ CreateMon(mon, species, EGG_HATCH_LEVEL, USE_RANDOM_IVS, FALSE, 0, OT_ID_PLAYER_ID, 0);
metLevel = 0;
ball = ITEM_POKE_BALL;
language = LANGUAGE_JAPANESE;
@@ -865,7 +863,7 @@ static void SetInitialEggData(struct Pokemon *mon, u16 species, struct DayCare *
u8 language;
personality = daycare->offspringPersonality;
- CreateMon(mon, species, EGG_HATCH_LEVEL, 32, TRUE, personality, OT_ID_PLAYER_ID, 0);
+ CreateMon(mon, species, EGG_HATCH_LEVEL, USE_RANDOM_IVS, TRUE, personality, OT_ID_PLAYER_ID, 0);
metLevel = 0;
ball = ITEM_POKE_BALL;
language = LANGUAGE_JAPANESE;
@@ -894,8 +892,8 @@ static bool8 TryProduceOrHatchEgg(struct DayCare *daycare)
// Check if an egg should be produced
if (daycare->offspringPersonality == 0 && validEggs == DAYCARE_MON_COUNT && (daycare->mons[1].steps & 0xFF) == 0xFF)
{
- u8 compatability = GetDaycareCompatibilityScore(daycare);
- if (compatability > (Random() * 100u) / USHRT_MAX)
+ u8 compatibility = GetDaycareCompatibilityScore(daycare);
+ if (compatibility > (Random() * 100u) / USHRT_MAX)
TriggerPendingDaycareEgg();
}
@@ -1050,7 +1048,7 @@ static u8 GetDaycareCompatibilityScore(struct DayCare *daycare)
if (trainerIds[0] == trainerIds[1])
return PARENTS_LOW_COMPATIBILITY;
- return PARENTS_MED_COMPATABILITY;
+ return PARENTS_MED_COMPATIBILITY;
}
// neither parent is Ditto
else
@@ -1065,14 +1063,14 @@ static u8 GetDaycareCompatibilityScore(struct DayCare *daycare)
if (species[0] == species[1])
{
if (trainerIds[0] == trainerIds[1])
- return PARENTS_MED_COMPATABILITY; // same species, same trainer
+ return PARENTS_MED_COMPATIBILITY; // same species, same trainer
- return PARENTS_MAX_COMPATABILITY; // same species, different trainers
+ return PARENTS_MAX_COMPATIBILITY; // same species, different trainers
}
else
{
if (trainerIds[0] != trainerIds[1])
- return PARENTS_MED_COMPATABILITY; // different species, different trainers
+ return PARENTS_MED_COMPATIBILITY; // different species, different trainers
return PARENTS_LOW_COMPATIBILITY; // different species, same trainer
}
@@ -1095,9 +1093,9 @@ void SetDaycareCompatibilityString(void)
whichString = 3;
if (relationshipScore == PARENTS_LOW_COMPATIBILITY)
whichString = 2;
- if (relationshipScore == PARENTS_MED_COMPATABILITY)
+ if (relationshipScore == PARENTS_MED_COMPATIBILITY)
whichString = 1;
- if (relationshipScore == PARENTS_MAX_COMPATABILITY)
+ if (relationshipScore == PARENTS_MAX_COMPATIBILITY)
whichString = 0;
StringCopy(gStringVar4, sCompatibilityMessages[whichString]);