Fix Powder config not checking for Powder status (#6113)
This commit is contained in:
parent
4158f9251f
commit
6b23a02e7d
@ -3138,6 +3138,8 @@ static inline bool32 TryFormChangeBeforeMove(void)
|
||||
static inline bool32 TryActivatePowderStatus(u32 move)
|
||||
{
|
||||
u32 partnerMove = gBattleMons[BATTLE_PARTNER(gBattlerAttacker)].moves[gBattleStruct->chosenMovePositions[BATTLE_PARTNER(gBattlerAttacker)]];
|
||||
if (!(gBattleMons[gBattlerAttacker].status2 & STATUS2_POWDER))
|
||||
return FALSE;
|
||||
if (GetBattleMoveType(move) == TYPE_FIRE && !gBattleStruct->pledgeMove)
|
||||
return TRUE;
|
||||
if (move == MOVE_FIRE_PLEDGE && partnerMove == MOVE_GRASS_PLEDGE)
|
||||
@ -3616,20 +3618,17 @@ static void CancellerPowderMove(u32 *effect)
|
||||
|
||||
static void CancellerPowderStatus(u32 *effect)
|
||||
{
|
||||
if (gBattleMons[gBattlerAttacker].status2 & STATUS2_POWDER)
|
||||
if (TryActivatePowderStatus(gCurrentMove))
|
||||
{
|
||||
if (TryActivatePowderStatus(gCurrentMove))
|
||||
{
|
||||
gProtectStructs[gBattlerAttacker].powderSelfDmg = TRUE;
|
||||
if (GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD)
|
||||
gBattleStruct->moveDamage[gBattlerAttacker] = GetNonDynamaxMaxHP(gBattlerAttacker) / 4;
|
||||
gProtectStructs[gBattlerAttacker].powderSelfDmg = TRUE;
|
||||
if (GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD)
|
||||
gBattleStruct->moveDamage[gBattlerAttacker] = GetNonDynamaxMaxHP(gBattlerAttacker) / 4;
|
||||
|
||||
if (GetActiveGimmick(gBattlerAttacker) != GIMMICK_Z_MOVE
|
||||
|| HasTrainerUsedGimmick(gBattlerAttacker, GIMMICK_Z_MOVE))
|
||||
gBattlescriptCurrInstr = BattleScript_MoveUsedPowder;
|
||||
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
|
||||
*effect = 1;
|
||||
}
|
||||
if (GetActiveGimmick(gBattlerAttacker) != GIMMICK_Z_MOVE
|
||||
|| HasTrainerUsedGimmick(gBattlerAttacker, GIMMICK_Z_MOVE))
|
||||
gBattlescriptCurrInstr = BattleScript_MoveUsedPowder;
|
||||
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
|
||||
*effect = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user