Skip to content

Commit

Permalink
Starters have a high chance of being shiny
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinvanrijn committed Jan 7, 2025
1 parent 07fda36 commit de23851
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/battle_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,7 @@ static void CB2_GiveStarter(void)
u8 ivs[NUM_STATS] = {MAX_PER_STAT_IVS + 1, MAX_PER_STAT_IVS + 1, MAX_PER_STAT_IVS + 1, // We pass "MAX_PER_STAT_IVS + 1" here to ensure that
MAX_PER_STAT_IVS + 1, MAX_PER_STAT_IVS + 1, MAX_PER_STAT_IVS + 1}; // ScriptGiveMonParameterized won't touch the stats' IV.
u16 moves[MAX_MON_MOVES] = {MOVE_NONE, MOVE_NONE, MOVE_NONE, MOVE_NONE};
bool8 isShiny;

*GetVarPointer(VAR_STARTER_MON) = gSpecialVar_Result;
starterMon = GetStarterPokemon(gSpecialVar_Result);
Expand All @@ -999,7 +1000,14 @@ static void CB2_GiveStarter(void)
else {
gender = MON_FEMALE;
}
ScriptGiveMonParameterized(0, PARTY_SIZE, starterMon, 5, ITEM_NONE, ITEM_POKE_BALL, NUM_NATURES, 2, gender, evs, ivs, moves, FALSE, FALSE, NUMBER_OF_MON_TYPES);
// isShiny
if (Random() % 128 == 0) {
isShiny = TRUE;
}
else {
isShiny = FALSE;
}
ScriptGiveMonParameterized(0, PARTY_SIZE, starterMon, 5, ITEM_NONE, ITEM_POKE_BALL, NUM_NATURES, 2, gender, evs, ivs, moves, isShiny, FALSE, NUMBER_OF_MON_TYPES);
ResetTasks();
PlayBattleBGM();
SetMainCallback2(CB2_StartFirstBattle);
Expand Down

0 comments on commit de23851

Please sign in to comment.