Skip to content

Commit

Permalink
Starters hold their Battle-gimmick items
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinvanrijn authored and ElGHT committed Sep 8, 2024
1 parent 7473261 commit 1877952
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/battle_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -984,14 +984,21 @@ void ChooseStarter(void)
static void CB2_GiveStarter(void)
{
u16 starterMon;
u16 item;
u8 evs[NUM_STATS] = {0, 0, 0, 0, 0, 0};
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};

*GetVarPointer(VAR_STARTER_MON) = gSpecialVar_Result;
starterMon = GetStarterPokemon(gSpecialVar_Result);
ScriptGiveMonParameterized(0, PARTY_SIZE, starterMon, 5, ITEM_NONE, ITEM_POKE_BALL, NUM_NATURES, 2, MON_GENDERLESS, evs, ivs, moves, FALSE, FALSE, NUMBER_OF_MON_TYPES);
if (gSpecialVar_Result == 0) // Grookey
item = ITEM_GRASSIUM_Z; // gimmicks are Terrain and type Z-Crystal
else if (gSpecialVar_Result == 1) // Litten
item = ITEM_INCINIUM_Z; // gimmicks are stat changes and move Z-Crystal
else // Mudkip
item = ITEM_SWAMPERTITE; // gimmicks are Mega Evolution and single type weakness
ScriptGiveMonParameterized(0, PARTY_SIZE, starterMon, 5, item, ITEM_POKE_BALL, NUM_NATURES, 2, MON_GENDERLESS, evs, ivs, moves, FALSE, FALSE, NUMBER_OF_MON_TYPES);
ResetTasks();
PlayBattleBGM();
SetMainCallback2(CB2_StartFirstBattle);
Expand Down

0 comments on commit 1877952

Please sign in to comment.