mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-19 01:44:20 +01:00
More spacing and format fixes
This commit is contained in:
parent
844a0217f7
commit
5d1228fc2e
@ -1609,14 +1609,14 @@ static bool32 AccuracyCalcHelper(u16 move)
|
|||||||
JumpIfMoveFailed(7, move);
|
JumpIfMoveFailed(7, move);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
// If the attacker has the ability No Guard and they aren't targeting a Pokemon involved in a Sky Drop with the move Sky Drop, move hits.
|
// If the attacker has the ability No Guard and they aren't targeting a Pokemon involved in a Sky Drop with the move Sky Drop, move hits.
|
||||||
else if (GetBattlerAbility(gBattlerAttacker) == ABILITY_NO_GUARD && (move != MOVE_SKY_DROP || (gBattlerTarget != gBattleStruct->skyDropTargets[0] && gBattlerTarget != gBattleStruct->skyDropTargets[1] && gBattlerTarget != gBattleStruct->skyDropTargets[2] && gBattlerTarget != gBattleStruct->skyDropTargets[3])))
|
else if (GetBattlerAbility(gBattlerAttacker) == ABILITY_NO_GUARD && (move != MOVE_SKY_DROP || (gBattlerTarget != gBattleStruct->skyDropTargets[0] && gBattlerTarget != gBattleStruct->skyDropTargets[1] && gBattlerTarget != gBattleStruct->skyDropTargets[2] && gBattlerTarget != gBattleStruct->skyDropTargets[3])))
|
||||||
{
|
{
|
||||||
if (!JumpIfMoveFailed(7, move))
|
if (!JumpIfMoveFailed(7, move))
|
||||||
RecordAbilityBattle(gBattlerAttacker, ABILITY_NO_GUARD);
|
RecordAbilityBattle(gBattlerAttacker, ABILITY_NO_GUARD);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
// If the target has the ability No Guard and they aren't involved in a Sky Drop or the current move isn't Sky Drop, move hits.
|
// If the target has the ability No Guard and they aren't involved in a Sky Drop or the current move isn't Sky Drop, move hits.
|
||||||
else if (GetBattlerAbility(gBattlerTarget) == ABILITY_NO_GUARD && (move != MOVE_SKY_DROP || (gBattlerTarget != gBattleStruct->skyDropTargets[0] && gBattlerTarget != gBattleStruct->skyDropTargets[1] && gBattlerTarget != gBattleStruct->skyDropTargets[2] && gBattlerTarget != gBattleStruct->skyDropTargets[3])))
|
else if (GetBattlerAbility(gBattlerTarget) == ABILITY_NO_GUARD && (move != MOVE_SKY_DROP || (gBattlerTarget != gBattleStruct->skyDropTargets[0] && gBattlerTarget != gBattleStruct->skyDropTargets[1] && gBattlerTarget != gBattleStruct->skyDropTargets[2] && gBattlerTarget != gBattleStruct->skyDropTargets[3])))
|
||||||
{
|
{
|
||||||
if (!JumpIfMoveFailed(7, move))
|
if (!JumpIfMoveFailed(7, move))
|
||||||
@ -2931,8 +2931,8 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
|||||||
{
|
{
|
||||||
gBattleMons[gEffectBattler].status2 |= STATUS2_CONFUSION_TURN(((Random()) % 4) + 2); // 2-5 turns
|
gBattleMons[gEffectBattler].status2 |= STATUS2_CONFUSION_TURN(((Random()) % 4) + 2); // 2-5 turns
|
||||||
|
|
||||||
// If the confusion is activating due to being released from Sky Drop, go to "confused due to fatigue" script.
|
// If the confusion is activating due to being released from Sky Drop, go to "confused due to fatigue" script.
|
||||||
// Otherwise, do normal confusion script.
|
// Otherwise, do normal confusion script.
|
||||||
if(gCurrentMove == MOVE_SKY_DROP)
|
if(gCurrentMove == MOVE_SKY_DROP)
|
||||||
{
|
{
|
||||||
gBattleMons[gEffectBattler].status2 &= ~(STATUS2_LOCK_CONFUSE);
|
gBattleMons[gEffectBattler].status2 &= ~(STATUS2_LOCK_CONFUSE);
|
||||||
@ -9061,7 +9061,7 @@ static void Cmd_various(void)
|
|||||||
return;
|
return;
|
||||||
case VARIOUS_SKY_DROP_YAWN: // If the mon that's sleeping due to Yawn was holding a Pokemon in Sky Drop, release the target and clear Sky Drop data.
|
case VARIOUS_SKY_DROP_YAWN: // If the mon that's sleeping due to Yawn was holding a Pokemon in Sky Drop, release the target and clear Sky Drop data.
|
||||||
if (gEffectBattler == gBattleStruct->skyDropTargets[0])
|
if (gEffectBattler == gBattleStruct->skyDropTargets[0])
|
||||||
{
|
{
|
||||||
gEffectBattler = gBattleStruct->skyDropTargets[1];
|
gEffectBattler = gBattleStruct->skyDropTargets[1];
|
||||||
gBattleStruct->skyDropTargets[0] = 0xFF;
|
gBattleStruct->skyDropTargets[0] = 0xFF;
|
||||||
gBattleStruct->skyDropTargets[1] = 0xFF;
|
gBattleStruct->skyDropTargets[1] = 0xFF;
|
||||||
|
@ -1460,20 +1460,18 @@ void CancelMultiTurnMoves(u8 battler)
|
|||||||
|| IsBattlerTerrainAffected(i, STATUS_FIELD_MISTY_TERRAIN)))
|
|| IsBattlerTerrainAffected(i, STATUS_FIELD_MISTY_TERRAIN)))
|
||||||
{
|
{
|
||||||
gBattleMons[i].status2 |= STATUS2_CONFUSION_TURN(((Random()) % 4) + 2);
|
gBattleMons[i].status2 |= STATUS2_CONFUSION_TURN(((Random()) % 4) + 2);
|
||||||
|
|
||||||
// If this CancelMultiTurnMoves is occuring due to attackcanceller or VARIOUS_GRAVITY_ON_AIRBORNE_MONS
|
// If this CancelMultiTurnMoves is occuring due to attackcanceller or VARIOUS_GRAVITY_ON_AIRBORNE_MONS
|
||||||
if (gBattlescriptCurrInstr[0] == 0x0 || (gBattlescriptCurrInstr[0] == 0x76 && gBattlescriptCurrInstr[2] == 76))
|
if (gBattlescriptCurrInstr[0] == 0x0 || (gBattlescriptCurrInstr[0] == 0x76 && gBattlescriptCurrInstr[2] == 76))
|
||||||
{
|
{
|
||||||
gBattleStruct->skyDropTargets[0] = 0xFE - battler;
|
gBattleStruct->skyDropTargets[0] = 0xFE - battler;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If this CancelMultiTurnMoves is occuring due to cancelmultiturnmoves script
|
// If this CancelMultiTurnMoves is occuring due to cancelmultiturnmoves script
|
||||||
else if (gBattlescriptCurrInstr[0] == 0x76 && gBattlescriptCurrInstr[2] == 0)
|
else if (gBattlescriptCurrInstr[0] == 0x76 && gBattlescriptCurrInstr[2] == 0)
|
||||||
{
|
{
|
||||||
gBattlerAttacker = i;
|
gBattlerAttacker = i;
|
||||||
gBattlescriptCurrInstr = BattleScript_ThrashConfuses - 3;
|
gBattlescriptCurrInstr = BattleScript_ThrashConfuses - 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If this CancelMultiTurnMoves is occuring due to receiving Sleep/Freeze status
|
// If this CancelMultiTurnMoves is occuring due to receiving Sleep/Freeze status
|
||||||
else if (gBattleScripting.moveEffect <= PRIMARY_STATUS_MOVE_EFFECT)
|
else if (gBattleScripting.moveEffect <= PRIMARY_STATUS_MOVE_EFFECT)
|
||||||
{
|
{
|
||||||
@ -1482,12 +1480,11 @@ void CancelMultiTurnMoves(u8 battler)
|
|||||||
gBattlescriptCurrInstr = BattleScript_ThrashConfuses - 1;
|
gBattlescriptCurrInstr = BattleScript_ThrashConfuses - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear skyDropTargets data, unless this CancelMultiTurnMoves is caused by Yawn, attackcanceler, or VARIOUS_GRAVITY_ON_AIRBORNE_MONS
|
// Clear skyDropTargets data, unless this CancelMultiTurnMoves is caused by Yawn, attackcanceler, or VARIOUS_GRAVITY_ON_AIRBORNE_MONS
|
||||||
if (!(gBattleMons[gBattleStruct->skyDropTargets[1]].status2 & STATUS2_LOCK_CONFUSE) && gBattleStruct->skyDropTargets[0] < 4)
|
if (!(gBattleMons[gBattleStruct->skyDropTargets[1]].status2 & STATUS2_LOCK_CONFUSE) && gBattleStruct->skyDropTargets[0] < 4)
|
||||||
{
|
{
|
||||||
@ -1502,19 +1499,20 @@ void CancelMultiTurnMoves(u8 battler)
|
|||||||
if (gBattleStruct->skyDropTargets[3] == i)
|
if (gBattleStruct->skyDropTargets[3] == i)
|
||||||
{
|
{
|
||||||
gStatuses3[i] &= ~(STATUS3_SKY_DROPPED | STATUS3_ON_AIR);
|
gStatuses3[i] &= ~(STATUS3_SKY_DROPPED | STATUS3_ON_AIR);
|
||||||
|
|
||||||
gSprites[gBattlerSpriteIds[battler]].invisible = FALSE;
|
gSprites[gBattlerSpriteIds[battler]].invisible = FALSE;
|
||||||
gSprites[gBattlerSpriteIds[i]].invisible = FALSE;
|
gSprites[gBattlerSpriteIds[i]].invisible = FALSE;
|
||||||
|
|
||||||
if (gBattleMons[i].status2 & STATUS2_LOCK_CONFUSE && gBattleStruct->turnEffectsTracker != 24)
|
if (gBattleMons[i].status2 & STATUS2_LOCK_CONFUSE && gBattleStruct->turnEffectsTracker != 24)
|
||||||
{
|
{
|
||||||
gBattleMons[i].status2 &= ~(STATUS2_LOCK_CONFUSE);
|
gBattleMons[i].status2 &= ~(STATUS2_LOCK_CONFUSE);
|
||||||
|
|
||||||
if (!(GetBattlerAbility(i) == ABILITY_OWN_TEMPO
|
if (!(GetBattlerAbility(i) == ABILITY_OWN_TEMPO
|
||||||
|| gBattleMons[i].status2 & STATUS2_CONFUSION
|
|| gBattleMons[i].status2 & STATUS2_CONFUSION
|
||||||
|| IsBattlerTerrainAffected(i, STATUS_FIELD_MISTY_TERRAIN)))
|
|| IsBattlerTerrainAffected(i, STATUS_FIELD_MISTY_TERRAIN)))
|
||||||
{
|
{
|
||||||
gBattleMons[i].status2 |= STATUS2_CONFUSION_TURN(((Random()) % 4) + 2);
|
gBattleMons[i].status2 |= STATUS2_CONFUSION_TURN(((Random()) % 4) + 2);
|
||||||
|
|
||||||
if (gBattlescriptCurrInstr[0] == 0x0 || (gBattlescriptCurrInstr[0] == 0x76 && gBattlescriptCurrInstr[2] == 76))
|
if (gBattlescriptCurrInstr[0] == 0x0 || (gBattlescriptCurrInstr[0] == 0x76 && gBattlescriptCurrInstr[2] == 76))
|
||||||
{
|
{
|
||||||
gBattleStruct->skyDropTargets[2] = 0xFE - battler;
|
gBattleStruct->skyDropTargets[2] = 0xFE - battler;
|
||||||
@ -1535,7 +1533,7 @@ void CancelMultiTurnMoves(u8 battler)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(gBattleMons[gBattleStruct->skyDropTargets[3]].status2 & STATUS2_LOCK_CONFUSE) && gBattleStruct->skyDropTargets[2] < 4)
|
if (!(gBattleMons[gBattleStruct->skyDropTargets[3]].status2 & STATUS2_LOCK_CONFUSE) && gBattleStruct->skyDropTargets[2] < 4)
|
||||||
{
|
{
|
||||||
gBattleStruct->skyDropTargets[2] = 0xFF;
|
gBattleStruct->skyDropTargets[2] = 0xFF;
|
||||||
@ -9260,7 +9258,7 @@ bool32 CanMegaEvolve(u8 battlerId)
|
|||||||
&& (mega->alreadyEvolved[partnerPosition] || (mega->toEvolve & gBitTable[BATTLE_PARTNER(battlerId)])))
|
&& (mega->alreadyEvolved[partnerPosition] || (mega->toEvolve & gBitTable[BATTLE_PARTNER(battlerId)])))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if mon is currently held by Sky Drop
|
// Check if mon is currently held by Sky Drop
|
||||||
if (gStatuses3[battlerId] & STATUS3_SKY_DROPPED)
|
if (gStatuses3[battlerId] & STATUS3_SKY_DROPPED)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user