Merge pull request #1281 from NamNguyenUTSA/patch-2

Allow player partner NPC's to mega evolve
This commit is contained in:
ultima-soul 2020-12-18 23:39:15 -08:00 committed by GitHub
commit 1b1b2ff0a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1526,7 +1526,10 @@ static void PlayerPartnerHandleChooseMove(void)
gBattlerTarget = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT);
}
BtlController_EmitTwoReturnValues(1, 10, chosenMoveId | (gBattlerTarget << 8));
if (CanMegaEvolve(gActiveBattler)) // If partner can mega evolve, do it.
BtlController_EmitTwoReturnValues(1, 10, (chosenMoveId) | (RET_MEGA_EVOLUTION) | (gBattlerTarget << 8));
else
BtlController_EmitTwoReturnValues(1, 10, (chosenMoveId) | (gBattlerTarget << 8));
PlayerPartnerBufferExecCompleted();
}