Clean up Shedinja code (#5501)
This commit is contained in:
parent
130d6042e0
commit
d7c5bfee68
1 changed files with 7 additions and 12 deletions
|
@ -545,19 +545,13 @@ static void CB2_TradeEvolutionSceneUpdate(void)
|
|||
static void CreateShedinja(u16 preEvoSpecies, struct Pokemon *mon)
|
||||
{
|
||||
u32 data = 0;
|
||||
#if P_SHEDINJA_BALL >= GEN_4
|
||||
u16 ball = ITEM_POKE_BALL;
|
||||
#endif
|
||||
const struct Evolution *evolutions = GetSpeciesEvolutions(preEvoSpecies);
|
||||
|
||||
if (evolutions == NULL)
|
||||
return;
|
||||
|
||||
if (evolutions[0].method == EVO_LEVEL_NINJASK && gPlayerPartyCount < PARTY_SIZE
|
||||
#if P_SHEDINJA_BALL >= GEN_4
|
||||
&& (CheckBagHasItem(ball, 1))
|
||||
#endif
|
||||
)
|
||||
if (evolutions[0].method == EVO_LEVEL_NINJASK && gPlayerPartyCount < PARTY_SIZE && (P_SHEDINJA_BALL < GEN_4 || CheckBagHasItem(ball, 1)))
|
||||
{
|
||||
s32 i;
|
||||
struct Pokemon *shedinja = &gPlayerParty[gPlayerPartyCount];
|
||||
|
@ -567,10 +561,11 @@ static void CreateShedinja(u16 preEvoSpecies, struct Pokemon *mon)
|
|||
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_NICKNAME, GetSpeciesName(evolutions[1].targetSpecies));
|
||||
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_HELD_ITEM, &data);
|
||||
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_MARKINGS, &data);
|
||||
#if P_SHEDINJA_BALL >= GEN_4
|
||||
if (P_SHEDINJA_BALL >= GEN_4)
|
||||
{
|
||||
SetMonData(&gPlayerParty[gPlayerPartyCount], MON_DATA_POKEBALL, &ball);
|
||||
RemoveBagItem(ball, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
for (i = MON_DATA_COOL_RIBBON; i < MON_DATA_COOL_RIBBON + CONTEST_CATEGORIES_COUNT; i++)
|
||||
SetMonData(&gPlayerParty[gPlayerPartyCount], i, &data);
|
||||
|
|
Loading…
Reference in a new issue