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

Set GiveBoxMonIntialMoveset_Fast as default #4470

Merged
merged 2 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions include/pokemon.h
Original file line number Diff line number Diff line change
Expand Up @@ -658,8 +658,8 @@ void SetMonMoveSlot(struct Pokemon *mon, u16 move, u8 slot);
void SetBattleMonMoveSlot(struct BattlePokemon *mon, u16 move, u8 slot);
void GiveMonInitialMoveset(struct Pokemon *mon);
void GiveBoxMonInitialMoveset(struct BoxPokemon *boxMon);
AlexOn1ine marked this conversation as resolved.
Show resolved Hide resolved
void GiveMonInitialMoveset_Fast(struct Pokemon *mon);
void GiveBoxMonInitialMoveset_Fast(struct BoxPokemon *boxMon);
void GiveMonInitialMoveset(struct Pokemon *mon);
void GiveBoxMonInitialMoveset(struct BoxPokemon *boxMon);
u16 MonTryLearningNewMove(struct Pokemon *mon, bool8 firstMove);
void DeleteFirstMoveAndGiveMoveToMon(struct Pokemon *mon, u16 move);
void DeleteFirstMoveAndGiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move);
Expand Down
2 changes: 1 addition & 1 deletion src/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -4102,7 +4102,7 @@ static void DebugAction_PCBag_Fill_PCBoxes_Fast(u8 taskId) //Credit: Sierraffini
StringCopy(speciesName, GetSpeciesName(species));
SetBoxMonData(&boxMon, MON_DATA_NICKNAME, &speciesName);
SetBoxMonData(&boxMon, MON_DATA_SPECIES, &species);
GiveBoxMonInitialMoveset_Fast(&boxMon);
GiveBoxMonInitialMoveset(&boxMon);
gPokemonStoragePtr->boxes[boxId][boxPosition] = boxMon;
}
}
Expand Down
25 changes: 1 addition & 24 deletions src/pokemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1678,30 +1678,7 @@ void GiveMonInitialMoveset(struct Pokemon *mon)
GiveBoxMonInitialMoveset(&mon->box);
}

void GiveBoxMonInitialMoveset(struct BoxPokemon *boxMon)
{
u16 species = GetBoxMonData(boxMon, MON_DATA_SPECIES, NULL);
s32 level = GetLevelFromBoxMonExp(boxMon);
s32 i;
const struct LevelUpMove *learnset = GetSpeciesLevelUpLearnset(species);

for (i = 0; learnset[i].move != LEVEL_UP_MOVE_END; i++)
{
if (learnset[i].level > level)
break;
if (learnset[i].level == 0)
continue;
if (GiveMoveToBoxMon(boxMon, learnset[i].move) == MON_HAS_MAX_MOVES)
DeleteFirstMoveAndGiveMoveToBoxMon(boxMon, learnset[i].move);
}
}

void GiveMonInitialMoveset_Fast(struct Pokemon *mon)
{
GiveBoxMonInitialMoveset_Fast(&mon->box);
}

void GiveBoxMonInitialMoveset_Fast(struct BoxPokemon *boxMon) //Credit: AsparagusEduardo
void GiveBoxMonInitialMoveset(struct BoxPokemon *boxMon) //Credit: AsparagusEduardo
{
u16 species = GetBoxMonData(boxMon, MON_DATA_SPECIES, NULL);
s32 level = GetLevelFromBoxMonExp(boxMon);
Expand Down
Loading