quash pr clean up

This commit is contained in:
DizzyEggg 2022-08-24 23:39:34 +02:00
parent 06b4548603
commit 91b76e2e4f
3 changed files with 72 additions and 73 deletions

View file

@ -147,9 +147,9 @@ struct ProtectStruct
u16 pranksterElevated:1; u16 pranksterElevated:1;
u16 quickDraw:1; u16 quickDraw:1;
u16 beakBlastCharge:1; u16 beakBlastCharge:1;
u16 quash:1;
u32 physicalDmg; u32 physicalDmg;
u32 specialDmg; u32 specialDmg;
u8 quash : 1;
u8 physicalBattlerId; u8 physicalBattlerId;
u8 specialBattlerId; u8 specialBattlerId;
}; };

View file

@ -4515,10 +4515,9 @@ s8 GetMovePriority(u32 battlerId, u16 move)
break; break;
} }
} }
if (gProtectStructs[battlerId].quash == 1)
{ if (gProtectStructs[battlerId].quash)
priority = -8; priority = -8;
}
return priority; return priority;
} }

View file

@ -8454,13 +8454,13 @@ static void Cmd_various(void)
} }
return; return;
case VARIOUS_TRY_QUASH: case VARIOUS_TRY_QUASH:
if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget)) // is true if foe is faster, has a bigger priority, or switches if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget)) // It's true if foe is faster, has a bigger priority, or switches
{ {
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); // This replaces the current battlescript with the "fail" script, if the condition gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); // This replaces the current battlescript with the "fail" script.
} // we checked is true }
else // If the condition is not true, it means we are faster than the foe, so we can set the quash bit else // If the condition is not true, it means we are faster than the foe, so we can set the quash bit
{ {
gProtectStructs[gBattlerTarget].quash = 1; gProtectStructs[gBattlerTarget].quash = TRUE;
gBattlescriptCurrInstr += 7; // and then we proceed with the rest of our battlescript gBattlescriptCurrInstr += 7; // and then we proceed with the rest of our battlescript
} }
return; return;