mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 11:37:40 +01:00
Merge pull request #2566 from AsparagusEduardo/RHH/pr/feature/breedBalls
Config for ball inheritence when breeding
This commit is contained in:
commit
c72274ee98
@ -11,6 +11,7 @@
|
|||||||
#define P_NIDORAN_M_DITTO_BREED GEN_LATEST // Since Gen 5, when Nidoran♂ breeds with Ditto it can produce Nidoran♀ offspring. Before, it would only yield male offspring. This change also applies to Volbeat.
|
#define P_NIDORAN_M_DITTO_BREED GEN_LATEST // Since Gen 5, when Nidoran♂ breeds with Ditto it can produce Nidoran♀ offspring. Before, it would only yield male offspring. This change also applies to Volbeat.
|
||||||
#define P_INCENSE_BREEDING GEN_LATEST // Since Gen 9, cross-generation Baby Pokémon don't require Incense being held by the parents to be obtained via breeding.
|
#define P_INCENSE_BREEDING GEN_LATEST // Since Gen 9, cross-generation Baby Pokémon don't require Incense being held by the parents to be obtained via breeding.
|
||||||
#define P_EGG_HATCH_LEVEL GEN_LATEST // Since Gen 4, Pokémon will hatch from eggs at level 1 instead of 5.
|
#define P_EGG_HATCH_LEVEL GEN_LATEST // Since Gen 4, Pokémon will hatch from eggs at level 1 instead of 5.
|
||||||
|
#define P_BALL_INHERITING GEN_LATEST // Since Gen 6, Eggs from the Daycare will inherit the Poké Ball from their mother. From Gen7 onwards, the father can pass it down as well, as long as it's of the same species as the mother.
|
||||||
|
|
||||||
// Other settings
|
// Other settings
|
||||||
#define P_SHEDINJA_BALL GEN_LATEST // Since Gen 4, Shedinja requires a Poké Ball for its evolution. In Gen 3, Shedinja inherits Nincada's Ball.
|
#define P_SHEDINJA_BALL GEN_LATEST // Since Gen 4, Shedinja requires a Poké Ball for its evolution. In Gen 3, Shedinja inherits Nincada's Ball.
|
||||||
|
@ -609,6 +609,33 @@ static void InheritIVs(struct Pokemon *egg, struct DayCare *daycare)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void InheritPokeball(struct Pokemon *egg, struct BoxPokemon *father, struct BoxPokemon *mother)
|
||||||
|
{
|
||||||
|
u16 inheritBall = ITEM_POKE_BALL;
|
||||||
|
u16 fatherBall = GetBoxMonData(father, MON_DATA_POKEBALL);
|
||||||
|
u16 motherBall = GetBoxMonData(mother, MON_DATA_POKEBALL);
|
||||||
|
u16 fatherSpecies = GetBoxMonData(father, MON_DATA_SPECIES);
|
||||||
|
u16 motherSpecies = GetBoxMonData(mother, MON_DATA_SPECIES);
|
||||||
|
|
||||||
|
if (fatherBall == ITEM_MASTER_BALL || fatherBall == ITEM_CHERISH_BALL)
|
||||||
|
fatherBall = ITEM_POKE_BALL;
|
||||||
|
|
||||||
|
if (motherBall == ITEM_MASTER_BALL || motherBall == ITEM_CHERISH_BALL)
|
||||||
|
motherBall = ITEM_POKE_BALL;
|
||||||
|
|
||||||
|
#if P_BALL_INHERITING >= GEN_7
|
||||||
|
if (fatherSpecies == motherSpecies)
|
||||||
|
inheritBall = (Random() % 2 == 0 ? motherBall : fatherBall);
|
||||||
|
else if (motherSpecies != SPECIES_DITTO)
|
||||||
|
inheritBall = motherBall;
|
||||||
|
else
|
||||||
|
inheritBall = fatherBall;
|
||||||
|
#elif P_BALL_INHERITING == GEN_6
|
||||||
|
inheritBall = motherBall;
|
||||||
|
#endif
|
||||||
|
SetMonData(egg, MON_DATA_POKEBALL, &inheritBall);
|
||||||
|
}
|
||||||
|
|
||||||
// Counts the number of egg moves a pokemon learns and stores the moves in
|
// Counts the number of egg moves a pokemon learns and stores the moves in
|
||||||
// the given array.
|
// the given array.
|
||||||
static u8 GetEggMoves(struct Pokemon *pokemon, u16 *eggMoves)
|
static u8 GetEggMoves(struct Pokemon *pokemon, u16 *eggMoves)
|
||||||
@ -872,6 +899,7 @@ static void _GiveEggFromDaycare(struct DayCare *daycare)
|
|||||||
#endif
|
#endif
|
||||||
SetInitialEggData(&egg, species, daycare);
|
SetInitialEggData(&egg, species, daycare);
|
||||||
InheritIVs(&egg, daycare);
|
InheritIVs(&egg, daycare);
|
||||||
|
InheritPokeball(&egg, &daycare->mons[parentSlots[1]].mon, &daycare->mons[parentSlots[0]].mon);
|
||||||
BuildEggMoveset(&egg, &daycare->mons[parentSlots[1]].mon, &daycare->mons[parentSlots[0]].mon);
|
BuildEggMoveset(&egg, &daycare->mons[parentSlots[1]].mon, &daycare->mons[parentSlots[0]].mon);
|
||||||
|
|
||||||
GiveMoveIfItem(&egg, daycare);
|
GiveMoveIfItem(&egg, daycare);
|
||||||
|
Loading…
Reference in New Issue
Block a user