Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed compile when setting everything to GEN_1 #3723

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions include/constants/moves.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
48 changes: 23 additions & 25 deletions src/daycare.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}

Expand All @@ -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);
Expand Down Expand Up @@ -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);

Expand Down
14 changes: 7 additions & 7 deletions src/pokemon_storage_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -3696,7 +3697,6 @@ static void Task_OnBPressed(u8 taskId)
{
SetPokeStorageTask(Task_PokeStorageMain);
}
#endif
}
else if (IsMovingItem())
{
Expand Down
Loading