Skip to content

Commit

Permalink
Replaced didMegaEvo with a shiny new species flag
Browse files Browse the repository at this point in the history
  • Loading branch information
LOuroboros committed Oct 7, 2022
1 parent 02c6bc6 commit 50ca188
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion include/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,6 @@ struct MegaEvolutionData
bool8 playerSelect;
u8 triggerSpriteId;
bool8 isWishMegaEvo;
bool32 didMegaEvo[PARTY_SIZE][2]; // For each party member and side.
};

struct Illusion
Expand Down
1 change: 0 additions & 1 deletion src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -8840,7 +8840,6 @@ static void Cmd_various(void)

gBattleMons[gActiveBattler].species = megaSpecies;
PREPARE_SPECIES_BUFFER(gBattleTextBuff1, gBattleMons[gActiveBattler].species);
gBattleStruct->mega.didMegaEvo[gActiveBattler][GetBattlerSide(gActiveBattler)] = TRUE;

BtlController_EmitSetMonData(BUFFER_A, REQUEST_SPECIES_BATTLE, gBitTable[gBattlerPartyIndexes[gActiveBattler]], sizeof(gBattleMons[gActiveBattler].species), &gBattleMons[gActiveBattler].species);
MarkBattlerForControllerExec(gActiveBattler);
Expand Down
3 changes: 2 additions & 1 deletion src/battle_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -2110,10 +2110,11 @@ u32 GetBattlerFriendshipScore(u8 battlerId)
struct MegaEvolutionData *mega = &(((struct ChooseMoveStruct *)(&gBattleResources->bufferA[battlerId][4]))->mega);
u8 side = GetBattlerSide(battlerId);
struct Pokemon *party = (side == B_SIDE_PLAYER) ? gPlayerParty : gEnemyParty;
u16 species = GetMonData(&party[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES);

if (side != B_SIDE_PLAYER)
return FRIENDSHIP_NONE;
else if (gBattleStruct->mega.didMegaEvo[battlerId][side]
else if (gBaseStats[species].flags & SPECIES_FLAG_MEGA_EVOLUTION
|| (gBattleTypeFlags & (BATTLE_TYPE_EREADER_TRAINER
| BATTLE_TYPE_FRONTIER
| BATTLE_TYPE_LINK
Expand Down

0 comments on commit 50ca188

Please sign in to comment.