mirror of https://github.com/pret/pokeemerald.git
No message if all mons were out
parent
64f9faefcf
commit
d23766ac9d
|
@ -29,7 +29,12 @@ index f73cae167..45995acdb 100644
|
||||||
|
|
||||||
for (viaSentIn = 0, i = 0; i < PARTY_SIZE; i++)
|
for (viaSentIn = 0, i = 0; i < PARTY_SIZE; i++)
|
||||||
{
|
{
|
||||||
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES) == SPECIES_NONE || GetMonData(&gPlayerParty[i], MON_DATA_HP) == 0)
|
- if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES) == SPECIES_NONE || GetMonData(&gPlayerParty[i], MON_DATA_HP) == 0)
|
||||||
|
+ if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES) == SPECIES_NONE || GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG)
|
||||||
|
+ || GetMonData(&gPlayerParty[i], MON_DATA_HP) == 0)
|
||||||
|
continue;
|
||||||
|
if (gBitTable[i] & sentIn)
|
||||||
|
viaSentIn++;
|
||||||
@@ -3299,11 +3299,8 @@ static void Cmd_getexp(void)
|
@@ -3299,11 +3299,8 @@ static void Cmd_getexp(void)
|
||||||
if (item == ITEM_ENIGMA_BERRY)
|
if (item == ITEM_ENIGMA_BERRY)
|
||||||
holdEffect = gSaveBlock1Ptr->enigmaBerry.holdEffect;
|
holdEffect = gSaveBlock1Ptr->enigmaBerry.holdEffect;
|
||||||
|
@ -94,7 +99,16 @@ index f73cae167..45995acdb 100644
|
||||||
gBattleScripting.getexpState = 5;
|
gBattleScripting.getexpState = 5;
|
||||||
gBattleMoveDamage = 0; // used for exp
|
gBattleMoveDamage = 0; // used for exp
|
||||||
}
|
}
|
||||||
|
+ else if (GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_SPECIES) == SPECIES_NONE
|
||||||
|
+ || GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_IS_EGG))
|
||||||
|
+ {
|
||||||
|
+ gBattleScripting.getexpState = 5;
|
||||||
|
+ gBattleMoveDamage = 0; // used for exp
|
||||||
|
+ }
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
// music change in wild battle after fainting a poke
|
||||||
|
if (!(gBattleTypeFlags & BATTLE_TYPE_TRAINER) && gBattleMons[0].hp && !gBattleStruct->wildVictorySong)
|
||||||
@@ -3383,17 +3368,17 @@ static void Cmd_getexp(void)
|
@@ -3383,17 +3368,17 @@ static void Cmd_getexp(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,15 +151,31 @@ index f73cae167..45995acdb 100644
|
||||||
gBattleStruct->expGetterMonId++;
|
gBattleStruct->expGetterMonId++;
|
||||||
if (gBattleStruct->expGetterMonId < PARTY_SIZE)
|
if (gBattleStruct->expGetterMonId < PARTY_SIZE)
|
||||||
gBattleScripting.getexpState = 2; // loop again
|
gBattleScripting.getexpState = 2; // loop again
|
||||||
+ else if (!gExpShareCheck && FlagGet(FLAG_EXP_SHARE)){
|
- else
|
||||||
+ gExpShareCheck = TRUE;
|
- gBattleScripting.getexpState = 6; // we're done
|
||||||
+ gBattleStruct->expGetterMonId = 0;
|
+ else{
|
||||||
+ PREPARE_WORD_NUMBER_BUFFER(gBattleTextBuff3, 5, gExpShareExp);
|
+ s32 totalMon = 0;
|
||||||
+ PrepareStringBattle(STRINGID_PKMNGAINEDEXPALL, gBattleStruct->expGetterBattlerId);
|
+ s32 viaSentIn = 0;
|
||||||
+ gBattleScripting.getexpState = 2; // loop again
|
+ sentIn = gSentPokesToOpponent[(gBattlerFainted & 2) >> 1];
|
||||||
|
+ for (viaSentIn = 0, i = 0; i < PARTY_SIZE; i++) // To see if every mon has seen battle
|
||||||
|
+ {
|
||||||
|
+ if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES) == SPECIES_NONE || GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG)
|
||||||
|
+ || GetMonData(&gPlayerParty[i], MON_DATA_HP) == 0)
|
||||||
|
+ continue;
|
||||||
|
+ totalMon++;
|
||||||
|
+ if (gBitTable[i] & sentIn)
|
||||||
|
+ viaSentIn++;
|
||||||
|
+ }
|
||||||
|
+ if (!gExpShareCheck && FlagGet(FLAG_EXP_SHARE) && totalMon>viaSentIn){
|
||||||
|
+ gExpShareCheck = TRUE;
|
||||||
|
+ gBattleStruct->expGetterMonId = 0;
|
||||||
|
+ PREPARE_WORD_NUMBER_BUFFER(gBattleTextBuff3, 5, gExpShareExp);
|
||||||
|
+ PrepareStringBattle(STRINGID_PKMNGAINEDEXPALL, gBattleStruct->expGetterBattlerId);
|
||||||
|
+ gBattleScripting.getexpState = 2; // loop again
|
||||||
|
+ }
|
||||||
|
+ else
|
||||||
|
+ gBattleScripting.getexpState = 6; // we're done
|
||||||
+ }
|
+ }
|
||||||
else
|
|
||||||
gBattleScripting.getexpState = 6; // we're done
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue