replace gCurrentMove with move in CalcCritChanceStageArgs (#4687)

AI got the wrong calc when the global was used.
This commit is contained in:
Alex 2024-06-02 15:31:10 +02:00 committed by GitHub
parent 9b10e13336
commit 86b76134e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1923,7 +1923,7 @@ s32 CalcCritChanceStageArgs(u32 battlerAtk, u32 battlerDef, u32 move, bool32 rec
critChance = -1;
}
else if (gStatuses3[battlerAtk] & STATUS3_LASER_FOCUS
|| gMovesInfo[gCurrentMove].alwaysCriticalHit
|| gMovesInfo[move].alwaysCriticalHit
|| (abilityAtk == ABILITY_MERCILESS && gBattleMons[battlerDef].status1 & STATUS1_PSN_ANY))
{
critChance = -2;
@ -1932,7 +1932,7 @@ s32 CalcCritChanceStageArgs(u32 battlerAtk, u32 battlerDef, u32 move, bool32 rec
{
critChance = 2 * ((gBattleMons[battlerAtk].status2 & STATUS2_FOCUS_ENERGY) != 0)
+ 1 * ((gBattleMons[battlerAtk].status2 & STATUS2_DRAGON_CHEER) != 0)
+ gMovesInfo[gCurrentMove].criticalHitStage
+ gMovesInfo[move].criticalHitStage
+ (holdEffectAtk == HOLD_EFFECT_SCOPE_LENS)
+ 2 * (holdEffectAtk == HOLD_EFFECT_LUCKY_PUNCH && gBattleMons[battlerAtk].species == SPECIES_CHANSEY)
+ 2 * BENEFITS_FROM_LEEK(battlerAtk, holdEffectAtk)