Allow player partner NPC's to mega evolve

(i.e., Steven at Mossdeep)
This commit is contained in:
NamNguyenUTSA 2020-12-11 08:31:00 -06:00 committed by GitHub
parent 38b61ac5a0
commit ee59fab143
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); 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(); PlayerPartnerBufferExecCompleted();
} }