clean battle structs
This commit is contained in:
@@ -1229,7 +1229,7 @@ static void atk03_ppreduce(void)
|
||||
if (gBattleControllerExecFlags)
|
||||
return;
|
||||
|
||||
if (!gSpecialStatuses[gBattlerAttacker].flag20)
|
||||
if (!gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure)
|
||||
{
|
||||
switch (gBattleMoves[gCurrentMove].target)
|
||||
{
|
||||
@@ -2730,7 +2730,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
break;
|
||||
case MOVE_EFFECT_RECHARGE:
|
||||
gBattleMons[gEffectBattler].status2 |= STATUS2_RECHARGE;
|
||||
gDisableStructs[gEffectBattler].rechargeCounter = 2;
|
||||
gDisableStructs[gEffectBattler].rechargeTimer = 2;
|
||||
gLockedMoves[gEffectBattler] = gCurrentMove;
|
||||
gBattlescriptCurrInstr++;
|
||||
break;
|
||||
@@ -4752,16 +4752,16 @@ static void atk49_moveend(void)
|
||||
{
|
||||
u8 target, attacker;
|
||||
|
||||
*(gBattleStruct->mirrorMoves + gBattlerTarget * 2 + 0) = gChosenMove;
|
||||
*(gBattleStruct->mirrorMoves + gBattlerTarget * 2 + 1) = gChosenMove >> 8;
|
||||
*(gBattleStruct->lastTakenMove + gBattlerTarget * 2 + 0) = gChosenMove;
|
||||
*(gBattleStruct->lastTakenMove + gBattlerTarget * 2 + 1) = gChosenMove >> 8;
|
||||
|
||||
target = gBattlerTarget;
|
||||
attacker = gBattlerAttacker;
|
||||
*(attacker * 2 + target * 8 + (u8*)(gBattleStruct->mirrorMoveArrays) + 0) = gChosenMove;
|
||||
*(attacker * 2 + target * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = gChosenMove;
|
||||
|
||||
target = gBattlerTarget;
|
||||
attacker = gBattlerAttacker;
|
||||
*(attacker * 2 + target * 8 + (u8*)(gBattleStruct->mirrorMoveArrays) + 1) = gChosenMove >> 8;
|
||||
*(attacker * 2 + target * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = gChosenMove >> 8;
|
||||
}
|
||||
gBattleScripting.atk49_state++;
|
||||
break;
|
||||
@@ -6937,8 +6937,8 @@ static void atk7C_trymirrormove(void)
|
||||
{
|
||||
if (i != gBattlerAttacker)
|
||||
{
|
||||
move = *(i * 2 + gBattlerAttacker * 8 + (u8*)(gBattleStruct->mirrorMoveArrays) + 0)
|
||||
| (*(i * 2 + gBattlerAttacker * 8 + (u8*)(gBattleStruct->mirrorMoveArrays) + 1) << 8);
|
||||
move = *(i * 2 + gBattlerAttacker * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0)
|
||||
| (*(i * 2 + gBattlerAttacker * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) << 8);
|
||||
|
||||
if (move != 0 && move != 0xFFFF)
|
||||
{
|
||||
@@ -6948,8 +6948,8 @@ static void atk7C_trymirrormove(void)
|
||||
}
|
||||
}
|
||||
|
||||
move = *(gBattleStruct->mirrorMoves + gBattlerAttacker * 2 + 0)
|
||||
| (*(gBattleStruct->mirrorMoves + gBattlerAttacker * 2 + 1) << 8);
|
||||
move = *(gBattleStruct->lastTakenMove + gBattlerAttacker * 2 + 0)
|
||||
| (*(gBattleStruct->lastTakenMove + gBattlerAttacker * 2 + 1) << 8);
|
||||
|
||||
if (move != 0 && move != 0xFFFF)
|
||||
{
|
||||
@@ -6968,7 +6968,7 @@ static void atk7C_trymirrormove(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
gSpecialStatuses[gBattlerAttacker].flag20 = 1;
|
||||
gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1;
|
||||
gBattlescriptCurrInstr++;
|
||||
}
|
||||
}
|
||||
@@ -8033,7 +8033,7 @@ static void atk9B_transformdataexecution(void)
|
||||
|
||||
gBattleMons[gBattlerAttacker].status2 |= STATUS2_TRANSFORMED;
|
||||
gDisableStructs[gBattlerAttacker].disabledMove = 0;
|
||||
gDisableStructs[gBattlerAttacker].disableTimer1 = 0;
|
||||
gDisableStructs[gBattlerAttacker].disableTimer = 0;
|
||||
gDisableStructs[gBattlerAttacker].transformedMonPersonality = gBattleMons[gBattlerTarget].personality;
|
||||
gDisableStructs[gBattlerAttacker].unk18_b = 0;
|
||||
|
||||
@@ -8207,7 +8207,7 @@ static void atkA1_counterdamagecalculator(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
gSpecialStatuses[gBattlerAttacker].flag20 = 1;
|
||||
gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1;
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
}
|
||||
}
|
||||
@@ -8230,7 +8230,7 @@ static void atkA2_mirrorcoatdamagecalculator(void) // a copy of atkA1 with the p
|
||||
}
|
||||
else
|
||||
{
|
||||
gSpecialStatuses[gBattlerAttacker].flag20 = 1;
|
||||
gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1;
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
}
|
||||
}
|
||||
@@ -8250,8 +8250,8 @@ static void atkA3_disablelastusedattack(void)
|
||||
PREPARE_MOVE_BUFFER(gBattleTextBuff1, gBattleMons[gBattlerTarget].moves[i])
|
||||
|
||||
gDisableStructs[gBattlerTarget].disabledMove = gBattleMons[gBattlerTarget].moves[i];
|
||||
gDisableStructs[gBattlerTarget].disableTimer1 = (Random() & 3) + 2;
|
||||
gDisableStructs[gBattlerTarget].disableTimer2 = gDisableStructs[gBattlerTarget].disableTimer1; // used to save the random amount of turns?
|
||||
gDisableStructs[gBattlerTarget].disableTimer = (Random() & 3) + 2;
|
||||
gDisableStructs[gBattlerTarget].disableTimerStartValue = gDisableStructs[gBattlerTarget].disableTimer; // used to save the random amount of turns?
|
||||
gBattlescriptCurrInstr += 5;
|
||||
}
|
||||
else
|
||||
@@ -8282,8 +8282,8 @@ static void atkA4_trysetencore(void)
|
||||
{
|
||||
gDisableStructs[gBattlerTarget].encoredMove = gBattleMons[gBattlerTarget].moves[i];
|
||||
gDisableStructs[gBattlerTarget].encoredMovePos = i;
|
||||
gDisableStructs[gBattlerTarget].encoreTimer1 = (Random() & 3) + 3;
|
||||
gDisableStructs[gBattlerTarget].encoreTimer2 = gDisableStructs[gBattlerTarget].encoreTimer1;
|
||||
gDisableStructs[gBattlerTarget].encoreTimer = (Random() & 3) + 3;
|
||||
gDisableStructs[gBattlerTarget].encoreTimerStartValue = gDisableStructs[gBattlerTarget].encoreTimer;
|
||||
gBattlescriptCurrInstr += 5;
|
||||
}
|
||||
else
|
||||
@@ -8727,7 +8727,7 @@ static void atkB0_trysetspikes(void)
|
||||
|
||||
if (gSideTimers[targetSide].spikesAmount == 3)
|
||||
{
|
||||
gSpecialStatuses[gBattlerAttacker].flag20 = 1;
|
||||
gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1;
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
}
|
||||
else
|
||||
@@ -8759,8 +8759,8 @@ static void atkB2_trysetperishsong(void)
|
||||
else
|
||||
{
|
||||
gStatuses3[i] |= STATUS3_PERISH_SONG;
|
||||
gDisableStructs[i].perishSongTimer1 = 3;
|
||||
gDisableStructs[i].perishSongTimer2 = 3;
|
||||
gDisableStructs[i].perishSongTimer = 3;
|
||||
gDisableStructs[i].perishSongTimerStartValue = 3;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8785,19 +8785,19 @@ static void atkB3_rolloutdamagecalculation(void)
|
||||
|
||||
if (!(gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS)) // first hit
|
||||
{
|
||||
gDisableStructs[gBattlerAttacker].rolloutCounter1 = 5;
|
||||
gDisableStructs[gBattlerAttacker].rolloutCounter2 = 5;
|
||||
gDisableStructs[gBattlerAttacker].rolloutTimer = 5;
|
||||
gDisableStructs[gBattlerAttacker].rolloutTimerStartValue = 5;
|
||||
gBattleMons[gBattlerAttacker].status2 |= STATUS2_MULTIPLETURNS;
|
||||
gLockedMoves[gBattlerAttacker] = gCurrentMove;
|
||||
}
|
||||
if (--gDisableStructs[gBattlerAttacker].rolloutCounter1 == 0) // last hit
|
||||
if (--gDisableStructs[gBattlerAttacker].rolloutTimer == 0) // last hit
|
||||
{
|
||||
gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_MULTIPLETURNS);
|
||||
}
|
||||
|
||||
gDynamicBasePower = gBattleMoves[gCurrentMove].power;
|
||||
|
||||
for (i = 1; i < (5 - gDisableStructs[gBattlerAttacker].rolloutCounter1); i++)
|
||||
for (i = 1; i < (5 - gDisableStructs[gBattlerAttacker].rolloutTimer); i++)
|
||||
gDynamicBasePower *= 2;
|
||||
|
||||
if (gBattleMons[gBattlerAttacker].status2 & STATUS2_DEFENSE_CURL)
|
||||
@@ -9320,7 +9320,7 @@ static void atkCA_setforcedtarget(void) // follow me
|
||||
static void atkCB_setcharge(void)
|
||||
{
|
||||
gStatuses3[gBattlerAttacker] |= STATUS3_CHARGED_UP;
|
||||
gDisableStructs[gBattlerAttacker].chargeTimer1 = 2;
|
||||
gDisableStructs[gBattlerAttacker].chargeTimer = 2;
|
||||
gDisableStructs[gBattlerAttacker].chargeTimer2 = 2;
|
||||
gBattlescriptCurrInstr++;
|
||||
}
|
||||
@@ -9373,9 +9373,9 @@ static void atkCF_jumpifnodamage(void)
|
||||
|
||||
static void atkD0_settaunt(void)
|
||||
{
|
||||
if (gDisableStructs[gBattlerTarget].tauntTimer1 == 0)
|
||||
if (gDisableStructs[gBattlerTarget].tauntTimer == 0)
|
||||
{
|
||||
gDisableStructs[gBattlerTarget].tauntTimer1 = 2;
|
||||
gDisableStructs[gBattlerTarget].tauntTimer = 2;
|
||||
gDisableStructs[gBattlerTarget].tauntTimer2 = 2;
|
||||
gBattlescriptCurrInstr += 5;
|
||||
}
|
||||
@@ -9751,7 +9751,7 @@ static void atkDE_asistattackselect(void)
|
||||
static void atkDF_trysetmagiccoat(void)
|
||||
{
|
||||
gBattlerTarget = gBattlerAttacker;
|
||||
gSpecialStatuses[gBattlerAttacker].flag20 = 1;
|
||||
gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1;
|
||||
if (gCurrentTurnActionNumber == gBattlersCount - 1) // moves last turn
|
||||
{
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
@@ -9765,7 +9765,7 @@ static void atkDF_trysetmagiccoat(void)
|
||||
|
||||
static void atkE0_trysetsnatch(void) // snatch
|
||||
{
|
||||
gSpecialStatuses[gBattlerAttacker].flag20 = 1;
|
||||
gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1;
|
||||
if (gCurrentTurnActionNumber == gBattlersCount - 1) // moves last turn
|
||||
{
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
|
||||
Reference in New Issue
Block a user