Move touchedProtectLike to protect structs

This makes more sense than putting it in DisableStruct.
This commit is contained in:
BuffelSaft 2021-09-01 21:34:47 +12:00
parent eb0f0b7ce8
commit 3371773e5c
2 changed files with 6 additions and 6 deletions

View file

@ -100,7 +100,6 @@ struct DisableStruct
u8 truantCounter:1; u8 truantCounter:1;
u8 truantSwitchInHack:1; u8 truantSwitchInHack:1;
u8 mimickedMoves:4; u8 mimickedMoves:4;
u8 touchedProtectLike: 1;
u8 rechargeTimer; u8 rechargeTimer;
u8 autotomizeCount; u8 autotomizeCount;
u8 slowStartTimer; u8 slowStartTimer;
@ -145,6 +144,7 @@ struct ProtectStruct
u32 usedThroatChopPreventedMove:1; u32 usedThroatChopPreventedMove:1;
u32 micle:1; u32 micle:1;
u32 custap:1; // also quick claw u32 custap:1; // also quick claw
u32 touchedProtectLike:1;
u32 physicalDmg; u32 physicalDmg;
u32 specialDmg; u32 specialDmg;
u8 physicalBattlerId; u8 physicalBattlerId;

View file

@ -1456,7 +1456,7 @@ static void Cmd_attackcanceler(void)
&& gBattleMoves[gCurrentMove].effect != EFFECT_SUCKER_PUNCH) && gBattleMoves[gCurrentMove].effect != EFFECT_SUCKER_PUNCH)
{ {
if (gBattleMoves[gCurrentMove].flags & FLAG_MAKES_CONTACT) if (gBattleMoves[gCurrentMove].flags & FLAG_MAKES_CONTACT)
gDisableStructs[gBattlerAttacker].touchedProtectLike = 1; gProtectStructs[gBattlerAttacker].touchedProtectLike = 1;
CancelMultiTurnMoves(gBattlerAttacker); CancelMultiTurnMoves(gBattlerAttacker);
gMoveResultFlags |= MOVE_RESULT_MISSED; gMoveResultFlags |= MOVE_RESULT_MISSED;
gLastLandedMoves[gBattlerTarget] = 0; gLastLandedMoves[gBattlerTarget] = 0;
@ -4779,11 +4779,11 @@ static void Cmd_moveend(void)
switch (gBattleScripting.moveendState) switch (gBattleScripting.moveendState)
{ {
case MOVEEND_PROTECT_LIKE_EFFECT: case MOVEEND_PROTECT_LIKE_EFFECT:
if (gDisableStructs[gBattlerAttacker].touchedProtectLike) if (gProtectStructs[gBattlerAttacker].touchedProtectLike)
{ {
if (gProtectStructs[gBattlerTarget].spikyShielded && GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD) if (gProtectStructs[gBattlerTarget].spikyShielded && GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD)
{ {
gDisableStructs[gBattlerAttacker].touchedProtectLike = 0; gProtectStructs[gBattlerAttacker].touchedProtectLike = 0;
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 8; gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 8;
if (gBattleMoveDamage == 0) if (gBattleMoveDamage == 0)
gBattleMoveDamage = 1; gBattleMoveDamage = 1;
@ -4794,7 +4794,7 @@ static void Cmd_moveend(void)
} }
else if (gProtectStructs[gBattlerTarget].kingsShielded) else if (gProtectStructs[gBattlerTarget].kingsShielded)
{ {
gDisableStructs[gBattlerAttacker].touchedProtectLike = 0; gProtectStructs[gBattlerAttacker].touchedProtectLike = 0;
i = gBattlerAttacker; i = gBattlerAttacker;
gBattlerAttacker = gBattlerTarget; gBattlerAttacker = gBattlerTarget;
gBattlerTarget = i; // gBattlerTarget and gBattlerAttacker are swapped in order to activate Defiant, if applicable gBattlerTarget = i; // gBattlerTarget and gBattlerAttacker are swapped in order to activate Defiant, if applicable
@ -4805,7 +4805,7 @@ static void Cmd_moveend(void)
} }
else if (gProtectStructs[gBattlerTarget].banefulBunkered) else if (gProtectStructs[gBattlerTarget].banefulBunkered)
{ {
gDisableStructs[gBattlerAttacker].touchedProtectLike = 0; gProtectStructs[gBattlerAttacker].touchedProtectLike = 0;
gBattleScripting.moveEffect = MOVE_EFFECT_POISON | MOVE_EFFECT_AFFECTS_USER; gBattleScripting.moveEffect = MOVE_EFFECT_POISON | MOVE_EFFECT_AFFECTS_USER;
PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_BANEFUL_BUNKER); PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_BANEFUL_BUNKER);
BattleScriptPushCursor(); BattleScriptPushCursor();