Merge pull request #1934 from BuffelSaft/fix-burmy
Fix Burmy form change
This commit is contained in:
commit
6d17156f74
4 changed files with 11 additions and 3 deletions
|
@ -605,6 +605,7 @@ struct BattleStruct
|
|||
u8 blunderPolicy:1; // should blunder policy activate
|
||||
u8 ballSpriteIds[2]; // item gfx, window gfx
|
||||
u8 stickyWebUser;
|
||||
u8 appearedInBattle; // Bitfield to track which Pokemon appeared in battle. Used for Burmy's form change
|
||||
};
|
||||
|
||||
#define F_DYNAMIC_TYPE_1 (1 << 6)
|
||||
|
|
|
@ -2991,6 +2991,7 @@ static void BattleStartClearSetData(void)
|
|||
gBattleStruct->mega.triggerSpriteId = 0xFF;
|
||||
|
||||
gBattleStruct->stickyWebUser = 0xFF;
|
||||
gBattleStruct->appearedInBattle = 0;
|
||||
|
||||
for (i = 0; i < PARTY_SIZE; i++)
|
||||
{
|
||||
|
@ -3631,6 +3632,9 @@ static void TryDoEventsBeforeFirstTurn(void)
|
|||
*(gBattleStruct->monToSwitchIntoId + i) = PARTY_SIZE;
|
||||
gChosenActionByBattler[i] = B_ACTION_NONE;
|
||||
gChosenMoveByBattler[i] = MOVE_NONE;
|
||||
// Record party slots of player's mons that appeared in battle
|
||||
if (!IsBattlerAIControlled(i))
|
||||
gBattleStruct->appearedInBattle |= gBitTable[gBattlerPartyIndexes[i]];
|
||||
}
|
||||
TurnValuesCleanUp(FALSE);
|
||||
SpecialStatusesClear();
|
||||
|
|
|
@ -6187,6 +6187,9 @@ static void Cmd_switchineffects(void)
|
|||
gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler);
|
||||
gSpecialStatuses[gActiveBattler].faintedHasReplacement = FALSE;
|
||||
|
||||
if (!IsBattlerAIControlled(gActiveBattler))
|
||||
gBattleStruct->appearedInBattle |= gBitTable[gBattlerPartyIndexes[gActiveBattler]];
|
||||
|
||||
// Neutralizing Gas announces itself before hazards
|
||||
if (gBattleMons[gActiveBattler].ability == ABILITY_NEUTRALIZING_GAS && gSpecialStatuses[gActiveBattler].announceNeutralizingGas == 0)
|
||||
{
|
||||
|
|
|
@ -9782,13 +9782,13 @@ bool32 TryRoomService(u8 battlerId)
|
|||
void DoBurmyFormChange(u32 monId)
|
||||
{
|
||||
u16 newSpecies, currSpecies;
|
||||
s32 sentIn;
|
||||
struct Pokemon *party = gPlayerParty;
|
||||
|
||||
sentIn = gSentPokesToOpponent[(gBattlerFainted & 2) >> 1];
|
||||
currSpecies = GetMonData(&party[monId], MON_DATA_SPECIES, NULL);
|
||||
|
||||
if ((GET_BASE_SPECIES_ID(currSpecies) == SPECIES_BURMY) && (gBitTable[monId] & sentIn))
|
||||
if ((GET_BASE_SPECIES_ID(currSpecies) == SPECIES_BURMY)
|
||||
&& (gBattleStruct->appearedInBattle & gBitTable[monId]) // Burmy appeared in battle
|
||||
&& GetMonData(&party[monId], MON_DATA_HP, NULL) != 0) // Burmy isn't fainted
|
||||
{
|
||||
switch (gBattleTerrain)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue