Ability to gain EVs at Level Cap and fix for Battle Victory Music for Level Capped Pokemon

This commit is contained in:
resetes12
2025-10-03 08:45:48 +02:00
parent 5b20aed26e
commit 8d017e87aa

View File

@@ -3923,6 +3923,31 @@ static void Cmd_getexp(void)
case 2: // set exp value to the poke in expgetter_id and print message
if (gBattleControllerExecFlags == 0)
{
// music change in wild battle after fainting a poke
// Moved out of else statement to allow level 100 and level capped pokemon wins to play wild pokemon victory music
// Fix by Exclsior
if (!(gBattleTypeFlags & BATTLE_TYPE_TRAINER) && gBattleMons[0].hp != 0 && !gBattleStruct->wildVictorySong)
{
BattleStopLowHpSound();
if ((gSaveBlock2Ptr->optionsWildBattleMusic == 0) || (gSaveBlock2Ptr->optionsWildBattleMusic == 1))
PlayBGM(MUS_VICTORY_WILD);
else if (gSaveBlock2Ptr->optionsWildBattleMusic == 2)
PlayBGM(MUS_DP_VICTORY_WILD);
else if((gSaveBlock2Ptr->optionsWildBattleMusic == 3) || (gSaveBlock2Ptr->optionsWildBattleMusic == 4))
PlayBGM(MUS_HG_VICTORY_WILD);
else if (gSaveBlock2Ptr->optionsWildBattleMusic == 5)
{
if((Random() % 3) == 1)
PlayBGM(MUS_DP_VICTORY_WILD);
if((Random() % 3) == 2)
PlayBGM(MUS_HG_VICTORY_WILD);
else
PlayBGM(MUS_VICTORY_WILD);
}
gBattleStruct->wildVictorySong++;
}
item = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_HELD_ITEM);
if (item == ITEM_ENIGMA_BERRY)
@@ -3946,6 +3971,10 @@ static void Cmd_getexp(void)
*(&gBattleStruct->sentInPokes) >>= 1;
gBattleScripting.getexpState = 5;
gBattleMoveDamage = 0; // used for exp
// Added ability to gain EVs for Level 100 or Level Capped Pokemon
// By Exclsior
MonGainEVs(&gPlayerParty[gBattleStruct->expGetterMonId], gBattleMons[gBattlerFainted].species);
}
else if (((FlagGet(FLAG_EXP_SHARE) == TRUE) && (GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_SPECIES)) == SPECIES_NONE)
|| ((FlagGet(FLAG_EXP_SHARE) == TRUE) && GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_IS_EGG)))
@@ -3955,28 +3984,6 @@ static void Cmd_getexp(void)
}
else
{
// music change in wild battle after fainting a poke
if (!(gBattleTypeFlags & BATTLE_TYPE_TRAINER) && gBattleMons[0].hp != 0 && !gBattleStruct->wildVictorySong)
{
BattleStopLowHpSound();
if ((gSaveBlock2Ptr->optionsWildBattleMusic == 0) || (gSaveBlock2Ptr->optionsWildBattleMusic == 1))
PlayBGM(MUS_VICTORY_WILD);
else if (gSaveBlock2Ptr->optionsWildBattleMusic == 2)
PlayBGM(MUS_DP_VICTORY_WILD);
else if((gSaveBlock2Ptr->optionsWildBattleMusic == 3) || (gSaveBlock2Ptr->optionsWildBattleMusic == 4))
PlayBGM(MUS_HG_VICTORY_WILD);
else if (gSaveBlock2Ptr->optionsWildBattleMusic == 5)
{
if((Random() % 3) == 1)
PlayBGM(MUS_DP_VICTORY_WILD);
if((Random() % 3) == 2)
PlayBGM(MUS_HG_VICTORY_WILD);
else
PlayBGM(MUS_VICTORY_WILD);
}
gBattleStruct->wildVictorySong++;
}
if (GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_HP) && !GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_IS_EGG))
{
if (FlagGet(FLAG_EXP_SHARE) == TRUE)