Fixed compile when setting everything to GEN_1 (#3723)

This commit is contained in:
Eduardo Quezada D'Ottone 2023-12-13 20:24:31 -03:00 committed by GitHub
parent 63ff8b9f70
commit 996009e8ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 40 additions and 32 deletions

View File

@ -179,6 +179,9 @@
#define MOVE_SLASH 163
#define MOVE_SUBSTITUTE 164
#define MOVE_STRUGGLE 165
#define MOVES_COUNT_GEN1 166
#define MOVE_SKETCH 166
#define MOVE_TRIPLE_KICK 167
#define MOVE_THIEF 168
@ -270,6 +273,9 @@
#define MOVE_ROCK_SMASH 249
#define MOVE_WHIRLPOOL 250
#define MOVE_BEAT_UP 251
#define MOVES_COUNT_GEN2 252
#define MOVE_FAKE_OUT 252
#define MOVE_UPROAR 253
#define MOVE_STOCKPILE 254

View File

@ -12400,6 +12400,10 @@ static void Cmd_metronome(void)
u32 moveCount = MOVES_COUNT_GEN4;
#elif B_METRONOME_MOVES >= GEN_3
u32 moveCount = MOVES_COUNT_GEN3;
#elif B_METRONOME_MOVES >= GEN_2
u32 moveCount = MOVES_COUNT_GEN2;
#else
u32 moveCount = MOVES_COUNT_GEN1;
#endif
gCurrentMove = RandomUniformExcept(RNG_METRONOME, 1, moveCount - 1, InvalidMetronomeMove);

View File

@ -235,9 +235,8 @@ static void StorePokemonInDaycare(struct Pokemon *mon, struct DaycareMon *daycar
CompactPartySlots();
CalculatePlayerPartyCount();
#if P_EGG_MOVE_TRANSFER >= GEN_8
TransferEggMoves();
#endif
if (P_EGG_MOVE_TRANSFER >= GEN_8)
TransferEggMoves();
}
static void StorePokemonInEmptyDaycareSlot(struct Pokemon *mon, struct DayCare *daycare)
@ -698,16 +697,19 @@ static void InheritPokeball(struct Pokemon *egg, struct BoxPokemon *father, stru
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)
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;
}
else if (P_BALL_INHERITING == GEN_6)
{
inheritBall = motherBall;
else
inheritBall = fatherBall;
#elif P_BALL_INHERITING == GEN_6
inheritBall = motherBall;
#endif
}
SetMonData(egg, MON_DATA_POKEBALL, &inheritBall);
}
@ -719,21 +721,18 @@ static void InheritAbility(struct Pokemon *egg, struct BoxPokemon *father, struc
u8 inheritAbility = motherAbility;
if (motherSpecies == SPECIES_DITTO)
#if P_ABILITY_INHERITANCE < GEN_6
return;
#else
inheritAbility = fatherAbility;
#endif
{
if (P_ABILITY_INHERITANCE >= GEN_6)
inheritAbility = fatherAbility;
else
return;
}
if (inheritAbility < 2 && (Random() % 10 < 8))
{
SetMonData(egg, MON_DATA_ABILITY_NUM, &inheritAbility);
}
#if P_ABILITY_INHERITANCE < GEN_6
else if (Random() % 10 < 8)
#else
else if (Random() % 10 < 6)
#endif
else if (Random() % 10 < (P_ABILITY_INHERITANCE >= GEN_6 ? 6 : 8))
{
// Hidden Abilities have a different chance of being passed down
SetMonData(egg, MON_DATA_ABILITY_NUM, &inheritAbility);
@ -1088,9 +1087,8 @@ static void _GiveEggFromDaycare(struct DayCare *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);
#if P_ABILITY_INHERITANCE >= GEN_6
InheritAbility(&egg, &daycare->mons[parentSlots[1]].mon, &daycare->mons[parentSlots[0]].mon);
#endif
if (P_ABILITY_INHERITANCE >= GEN_6)
InheritAbility(&egg, &daycare->mons[parentSlots[1]].mon, &daycare->mons[parentSlots[0]].mon);
GiveMoveIfItem(&egg, daycare);

View File

@ -3682,12 +3682,13 @@ static void Task_OnBPressed(u8 taskId)
case 0:
if (IsMonBeingMoved())
{
#if OW_PC_PRESS_B < GEN_4
PlaySE(SE_FAILURE);
PrintMessage(MSG_HOLDING_POKE);
sStorage->state = 1;
#else
if (CanPlaceMon())
if (OW_PC_PRESS_B < GEN_4)
{
PlaySE(SE_FAILURE);
PrintMessage(MSG_HOLDING_POKE);
sStorage->state = 1;
}
else if (CanPlaceMon())
{
PlaySE(SE_SELECT);
SetPokeStorageTask(Task_PlaceMon);
@ -3696,7 +3697,6 @@ static void Task_OnBPressed(u8 taskId)
{
SetPokeStorageTask(Task_PokeStorageMain);
}
#endif
}
else if (IsMovingItem())
{