Merge branch 'master' of https://github.com/pret/pokeemerald into LabelOWsProperly
This commit is contained in:
@@ -2191,7 +2191,7 @@ static void BattleAICmd_if_level_cond(void)
|
||||
|
||||
static void BattleAICmd_if_target_taunted(void)
|
||||
{
|
||||
if (gDisableStructs[gBattlerTarget].tauntTimer1 != 0)
|
||||
if (gDisableStructs[gBattlerTarget].tauntTimer != 0)
|
||||
gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 1);
|
||||
else
|
||||
gAIScriptPtr += 5;
|
||||
@@ -2199,7 +2199,7 @@ static void BattleAICmd_if_target_taunted(void)
|
||||
|
||||
static void BattleAICmd_if_target_not_taunted(void)
|
||||
{
|
||||
if (gDisableStructs[gBattlerTarget].tauntTimer1 == 0)
|
||||
if (gDisableStructs[gBattlerTarget].tauntTimer == 0)
|
||||
gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 1);
|
||||
else
|
||||
gAIScriptPtr += 5;
|
||||
|
||||
@@ -17,7 +17,7 @@ static bool8 ShouldUseItem(void);
|
||||
static bool8 ShouldSwitchIfPerishSong(void)
|
||||
{
|
||||
if (gStatuses3[gActiveBattler] & STATUS3_PERISH_SONG
|
||||
&& gDisableStructs[gActiveBattler].perishSongTimer1 == 0)
|
||||
&& gDisableStructs[gActiveBattler].perishSongTimer == 0)
|
||||
{
|
||||
*(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE;
|
||||
BtlController_EmitTwoReturnValues(1, B_ACTION_SWITCH, 0);
|
||||
|
||||
@@ -3061,14 +3061,14 @@ static void BattleStartClearSetData(void)
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
*((u8 *)gBattleStruct->mirrorMoves + i) = 0;
|
||||
*((u8 *)gBattleStruct->lastTakenMove + i) = 0;
|
||||
*((u8 *)gBattleStruct->usedHeldItems + i) = 0;
|
||||
*((u8 *)gBattleStruct->choicedMove + i) = 0;
|
||||
*((u8 *)gBattleStruct->changedItems + i) = 0;
|
||||
*(i + 0 * 8 + (u8*)(gBattleStruct->mirrorMoveArrays) + 0) = 0;
|
||||
*(i + 1 * 8 + (u8*)(gBattleStruct->mirrorMoveArrays) + 0) = 0;
|
||||
*(i + 2 * 8 + (u8*)(gBattleStruct->mirrorMoveArrays) + 0) = 0;
|
||||
*(i + 3 * 8 + (u8*)(gBattleStruct->mirrorMoveArrays) + 0) = 0;
|
||||
*(i + 0 * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i + 1 * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i + 2 * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i + 3 * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
|
||||
@@ -3153,8 +3153,8 @@ void SwitchInClearSetData(void)
|
||||
{
|
||||
gDisableStructs[gActiveBattler].substituteHP = disableStructCopy.substituteHP;
|
||||
gDisableStructs[gActiveBattler].battlerWithSureHit = disableStructCopy.battlerWithSureHit;
|
||||
gDisableStructs[gActiveBattler].perishSongTimer1 = disableStructCopy.perishSongTimer1;
|
||||
gDisableStructs[gActiveBattler].perishSongTimer2 = disableStructCopy.perishSongTimer2;
|
||||
gDisableStructs[gActiveBattler].perishSongTimer = disableStructCopy.perishSongTimer;
|
||||
gDisableStructs[gActiveBattler].perishSongTimerStartValue = disableStructCopy.perishSongTimerStartValue;
|
||||
gDisableStructs[gActiveBattler].battlerPreventingEscape = disableStructCopy.battlerPreventingEscape;
|
||||
}
|
||||
|
||||
@@ -3168,16 +3168,16 @@ void SwitchInClearSetData(void)
|
||||
gLastPrintedMoves[gActiveBattler] = 0;
|
||||
gLastHitBy[gActiveBattler] = 0xFF;
|
||||
|
||||
*(gBattleStruct->mirrorMoves + gActiveBattler * 2 + 0) = 0;
|
||||
*(gBattleStruct->mirrorMoves + gActiveBattler * 2 + 1) = 0;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->mirrorMoveArrays) + 0) = 0;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->mirrorMoveArrays) + 1) = 0;
|
||||
*(1 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->mirrorMoveArrays) + 0) = 0;
|
||||
*(1 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->mirrorMoveArrays) + 1) = 0;
|
||||
*(2 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->mirrorMoveArrays) + 0) = 0;
|
||||
*(2 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->mirrorMoveArrays) + 1) = 0;
|
||||
*(3 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->mirrorMoveArrays) + 0) = 0;
|
||||
*(3 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->mirrorMoveArrays) + 1) = 0;
|
||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 0) = 0;
|
||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 1) = 0;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(1 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(1 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(2 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(2 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(3 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(3 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
|
||||
gBattleStruct->field_92 &= ~(gBitTable[gActiveBattler]);
|
||||
|
||||
@@ -3185,11 +3185,11 @@ void SwitchInClearSetData(void)
|
||||
{
|
||||
if (i != gActiveBattler && GetBattlerSide(i) != GetBattlerSide(gActiveBattler))
|
||||
{
|
||||
*(gBattleStruct->mirrorMoves + i * 2 + 0) = 0;
|
||||
*(gBattleStruct->mirrorMoves + i * 2 + 1) = 0;
|
||||
*(gBattleStruct->lastTakenMove + i * 2 + 0) = 0;
|
||||
*(gBattleStruct->lastTakenMove + i * 2 + 1) = 0;
|
||||
}
|
||||
*(i * 8 + gActiveBattler * 2 + (u8*)(gBattleStruct->mirrorMoveArrays) + 0) = 0;
|
||||
*(i * 8 + gActiveBattler * 2 + (u8*)(gBattleStruct->mirrorMoveArrays) + 1) = 0;
|
||||
*(i * 8 + gActiveBattler * 2 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i * 8 + gActiveBattler * 2 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
}
|
||||
|
||||
*(u8*)((u8*)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = 0;
|
||||
@@ -3263,16 +3263,16 @@ void FaintClearSetData(void)
|
||||
*(u8*)((u8*)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = 0;
|
||||
*(u8*)((u8*)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = 0;
|
||||
|
||||
*(gBattleStruct->mirrorMoves + gActiveBattler * 2 + 0) = 0;
|
||||
*(gBattleStruct->mirrorMoves + gActiveBattler * 2 + 1) = 0;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->mirrorMoveArrays) + 0) = 0;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->mirrorMoveArrays) + 1) = 0;
|
||||
*(1 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->mirrorMoveArrays) + 0) = 0;
|
||||
*(1 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->mirrorMoveArrays) + 1) = 0;
|
||||
*(2 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->mirrorMoveArrays) + 0) = 0;
|
||||
*(2 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->mirrorMoveArrays) + 1) = 0;
|
||||
*(3 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->mirrorMoveArrays) + 0) = 0;
|
||||
*(3 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->mirrorMoveArrays) + 1) = 0;
|
||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 0) = 0;
|
||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 1) = 0;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(1 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(1 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(2 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(2 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(3 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(3 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
|
||||
gBattleStruct->field_92 &= ~(gBitTable[gActiveBattler]);
|
||||
|
||||
@@ -3280,11 +3280,11 @@ void FaintClearSetData(void)
|
||||
{
|
||||
if (i != gActiveBattler && GetBattlerSide(i) != GetBattlerSide(gActiveBattler))
|
||||
{
|
||||
*(gBattleStruct->mirrorMoves + i * 2 + 0) = 0;
|
||||
*(gBattleStruct->mirrorMoves + i * 2 + 1) = 0;
|
||||
*(gBattleStruct->lastTakenMove + i * 2 + 0) = 0;
|
||||
*(gBattleStruct->lastTakenMove + i * 2 + 1) = 0;
|
||||
}
|
||||
*(i * 8 + gActiveBattler * 2 + (u8*)(gBattleStruct->mirrorMoveArrays) + 0) = 0;
|
||||
*(i * 8 + gActiveBattler * 2 + (u8*)(gBattleStruct->mirrorMoveArrays) + 1) = 0;
|
||||
*(i * 8 + gActiveBattler * 2 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i * 8 + gActiveBattler * 2 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
}
|
||||
|
||||
gBattleResources->flags->flags[gActiveBattler] = 0;
|
||||
@@ -4879,10 +4879,10 @@ static void TurnValuesCleanUp(bool8 var0)
|
||||
if (gDisableStructs[gActiveBattler].isFirstTurn)
|
||||
gDisableStructs[gActiveBattler].isFirstTurn--;
|
||||
|
||||
if (gDisableStructs[gActiveBattler].rechargeCounter)
|
||||
if (gDisableStructs[gActiveBattler].rechargeTimer)
|
||||
{
|
||||
gDisableStructs[gActiveBattler].rechargeCounter--;
|
||||
if (gDisableStructs[gActiveBattler].rechargeCounter == 0)
|
||||
gDisableStructs[gActiveBattler].rechargeTimer--;
|
||||
if (gDisableStructs[gActiveBattler].rechargeTimer == 0)
|
||||
gBattleMons[gActiveBattler].status2 &= ~(STATUS2_RECHARGE);
|
||||
}
|
||||
}
|
||||
@@ -5318,7 +5318,7 @@ static void HandleAction_UseMove(void)
|
||||
gCurrentMove = gChosenMove = gBattleMons[gBattlerAttacker].moves[gCurrMovePos];
|
||||
gDisableStructs[gBattlerAttacker].encoredMove = MOVE_NONE;
|
||||
gDisableStructs[gBattlerAttacker].encoredMovePos = 0;
|
||||
gDisableStructs[gBattlerAttacker].encoreTimer1 = 0;
|
||||
gDisableStructs[gBattlerAttacker].encoreTimer = 0;
|
||||
*(gBattleStruct->moveTarget + gBattlerAttacker) = GetMoveTarget(gCurrentMove, 0);
|
||||
}
|
||||
else if (gBattleMons[gBattlerAttacker].moves[gCurrMovePos] != gChosenMoveByBattler[gBattlerAttacker])
|
||||
|
||||
@@ -1229,7 +1229,7 @@ static void atk03_ppreduce(void)
|
||||
if (gBattleControllerExecFlags)
|
||||
return;
|
||||
|
||||
if (!gSpecialStatuses[gBattlerAttacker].flag20)
|
||||
if (!gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure)
|
||||
{
|
||||
switch (gBattleMoves[gCurrentMove].target)
|
||||
{
|
||||
@@ -1858,7 +1858,7 @@ static void atk0B_healthbarupdate(void)
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
|
||||
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER && gBattleMoveDamage > 0)
|
||||
gBattleResults.unk5_0 = 1;
|
||||
gBattleResults.playerMonWasDamaged = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -2763,7 +2763,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
| BATTLE_TYPE_LINK
|
||||
| BATTLE_TYPE_x2000000
|
||||
| BATTLE_TYPE_SECRET_BASE))
|
||||
&& (gWishFutureKnock.knockedOffPokes[side] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]]))
|
||||
&& (gWishFutureKnock.knockedOffMons[side] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]]))
|
||||
{
|
||||
gBattlescriptCurrInstr++;
|
||||
}
|
||||
@@ -2885,7 +2885,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
|
||||
gLastUsedItem = gBattleMons[gEffectBattler].item;
|
||||
gBattleMons[gEffectBattler].item = 0;
|
||||
gWishFutureKnock.knockedOffPokes[side] |= gBitTable[gBattlerPartyIndexes[gEffectBattler]];
|
||||
gWishFutureKnock.knockedOffMons[side] |= gBitTable[gBattlerPartyIndexes[gEffectBattler]];
|
||||
|
||||
BattleScriptPush(gBattlescriptCurrInstr + 1);
|
||||
gBattlescriptCurrInstr = BattleScript_KnockedOff;
|
||||
@@ -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;
|
||||
@@ -4948,7 +4948,7 @@ static void atk4D_switchindataupdate(void)
|
||||
|
||||
// check knocked off item
|
||||
i = GetBattlerSide(gActiveBattler);
|
||||
if (gWishFutureKnock.knockedOffPokes[i] & gBitTable[gBattlerPartyIndexes[gActiveBattler]])
|
||||
if (gWishFutureKnock.knockedOffMons[i] & gBitTable[gBattlerPartyIndexes[gActiveBattler]])
|
||||
{
|
||||
gBattleMons[gActiveBattler].item = 0;
|
||||
}
|
||||
@@ -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,8 +9320,8 @@ static void atkCA_setforcedtarget(void) // follow me
|
||||
static void atkCB_setcharge(void)
|
||||
{
|
||||
gStatuses3[gBattlerAttacker] |= STATUS3_CHARGED_UP;
|
||||
gDisableStructs[gBattlerAttacker].chargeTimer1 = 2;
|
||||
gDisableStructs[gBattlerAttacker].chargeTimer2 = 2;
|
||||
gDisableStructs[gBattlerAttacker].chargeTimer = 2;
|
||||
gDisableStructs[gBattlerAttacker].chargeTimerStartValue = 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;
|
||||
}
|
||||
@@ -9427,8 +9427,8 @@ static void atkD2_tryswapitems(void) // trick
|
||||
| BATTLE_TYPE_FRONTIER
|
||||
| BATTLE_TYPE_SECRET_BASE
|
||||
| BATTLE_TYPE_x2000000))
|
||||
&& (gWishFutureKnock.knockedOffPokes[sideAttacker] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]]
|
||||
|| gWishFutureKnock.knockedOffPokes[sideTarget] & gBitTable[gBattlerPartyIndexes[gBattlerTarget]]))
|
||||
&& (gWishFutureKnock.knockedOffMons[sideAttacker] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]]
|
||||
|| gWishFutureKnock.knockedOffMons[sideTarget] & gBitTable[gBattlerPartyIndexes[gBattlerTarget]]))
|
||||
{
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
@@ -659,7 +659,7 @@ void BattleTv_SetDataBasedOnMove(u16 move, u16 weatherFlags, struct DisableStruc
|
||||
tvPtr->side[atkSide].usedMoveSlot = moveSlot;
|
||||
AddMovePoints(0, moveSlot, gBattleMoves[move].effect, 0);
|
||||
AddPointsBasedOnWeather(weatherFlags, move, moveSlot);
|
||||
if (disableStructPtr->chargeTimer1 != 0)
|
||||
if (disableStructPtr->chargeTimer != 0)
|
||||
AddMovePoints(7, move, moveSlot, 0);
|
||||
|
||||
if (move == MOVE_WISH)
|
||||
|
||||
@@ -216,7 +216,7 @@ void CancelMultiTurnMoves(u8 battler)
|
||||
|
||||
gStatuses3[battler] &= ~(STATUS3_SEMI_INVULNERABLE);
|
||||
|
||||
gDisableStructs[battler].rolloutCounter1 = 0;
|
||||
gDisableStructs[battler].rolloutTimer = 0;
|
||||
gDisableStructs[battler].furyCutterCounter = 0;
|
||||
}
|
||||
|
||||
@@ -345,7 +345,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (gDisableStructs[gActiveBattler].tauntTimer1 != 0 && gBattleMoves[move].power == 0)
|
||||
if (gDisableStructs[gActiveBattler].tauntTimer != 0 && gBattleMoves[move].power == 0)
|
||||
{
|
||||
gCurrentMove = move;
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
|
||||
@@ -436,11 +436,11 @@ u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check)
|
||||
unusableMoves |= gBitTable[i];
|
||||
if (gBattleMons[battlerId].moves[i] == gLastMoves[battlerId] && check & MOVE_LIMITATION_TORMENTED && gBattleMons[battlerId].status2 & STATUS2_TORMENT)
|
||||
unusableMoves |= gBitTable[i];
|
||||
if (gDisableStructs[battlerId].tauntTimer1 && check & MOVE_LIMITATION_TAUNT && gBattleMoves[gBattleMons[battlerId].moves[i]].power == 0)
|
||||
if (gDisableStructs[battlerId].tauntTimer && check & MOVE_LIMITATION_TAUNT && gBattleMoves[gBattleMons[battlerId].moves[i]].power == 0)
|
||||
unusableMoves |= gBitTable[i];
|
||||
if (GetImprisonedMovesCount(battlerId, gBattleMons[battlerId].moves[i]) && check & MOVE_LIMITATION_IMPRISION)
|
||||
unusableMoves |= gBitTable[i];
|
||||
if (gDisableStructs[battlerId].encoreTimer1 && gDisableStructs[battlerId].encoredMove != gBattleMons[battlerId].moves[i])
|
||||
if (gDisableStructs[battlerId].encoreTimer && gDisableStructs[battlerId].encoredMove != gBattleMons[battlerId].moves[i])
|
||||
unusableMoves |= gBitTable[i];
|
||||
if (holdEffect == HOLD_EFFECT_CHOICE_BAND && *choicedMove != 0 && *choicedMove != 0xFFFF && *choicedMove != gBattleMons[battlerId].moves[i])
|
||||
unusableMoves |= gBitTable[i];
|
||||
@@ -1018,7 +1018,7 @@ u8 DoBattlerEndTurnEffects(void)
|
||||
gBattleStruct->turnEffectsTracker++;
|
||||
break;
|
||||
case ENDTURN_DISABLE: // disable
|
||||
if (gDisableStructs[gActiveBattler].disableTimer1 != 0)
|
||||
if (gDisableStructs[gActiveBattler].disableTimer != 0)
|
||||
{
|
||||
s32 i;
|
||||
for (i = 0; i < 4; i++)
|
||||
@@ -1029,9 +1029,9 @@ u8 DoBattlerEndTurnEffects(void)
|
||||
if (i == 4) // pokemon does not have the disabled move anymore
|
||||
{
|
||||
gDisableStructs[gActiveBattler].disabledMove = 0;
|
||||
gDisableStructs[gActiveBattler].disableTimer1 = 0;
|
||||
gDisableStructs[gActiveBattler].disableTimer = 0;
|
||||
}
|
||||
else if (--gDisableStructs[gActiveBattler].disableTimer1 == 0) // disable ends
|
||||
else if (--gDisableStructs[gActiveBattler].disableTimer == 0) // disable ends
|
||||
{
|
||||
gDisableStructs[gActiveBattler].disabledMove = 0;
|
||||
BattleScriptExecute(BattleScript_DisabledNoMore);
|
||||
@@ -1041,18 +1041,18 @@ u8 DoBattlerEndTurnEffects(void)
|
||||
gBattleStruct->turnEffectsTracker++;
|
||||
break;
|
||||
case ENDTURN_ENCORE: // encore
|
||||
if (gDisableStructs[gActiveBattler].encoreTimer1 != 0)
|
||||
if (gDisableStructs[gActiveBattler].encoreTimer != 0)
|
||||
{
|
||||
if (gBattleMons[gActiveBattler].moves[gDisableStructs[gActiveBattler].encoredMovePos] != gDisableStructs[gActiveBattler].encoredMove) // pokemon does not have the encored move anymore
|
||||
{
|
||||
gDisableStructs[gActiveBattler].encoredMove = 0;
|
||||
gDisableStructs[gActiveBattler].encoreTimer1 = 0;
|
||||
gDisableStructs[gActiveBattler].encoreTimer = 0;
|
||||
}
|
||||
else if (--gDisableStructs[gActiveBattler].encoreTimer1 == 0
|
||||
else if (--gDisableStructs[gActiveBattler].encoreTimer == 0
|
||||
|| gBattleMons[gActiveBattler].pp[gDisableStructs[gActiveBattler].encoredMovePos] == 0)
|
||||
{
|
||||
gDisableStructs[gActiveBattler].encoredMove = 0;
|
||||
gDisableStructs[gActiveBattler].encoreTimer1 = 0;
|
||||
gDisableStructs[gActiveBattler].encoreTimer = 0;
|
||||
BattleScriptExecute(BattleScript_EncoredNoMore);
|
||||
effect++;
|
||||
}
|
||||
@@ -1065,13 +1065,13 @@ u8 DoBattlerEndTurnEffects(void)
|
||||
gBattleStruct->turnEffectsTracker++;
|
||||
break;
|
||||
case ENDTURN_CHARGE: // charge
|
||||
if (gDisableStructs[gActiveBattler].chargeTimer1 && --gDisableStructs[gActiveBattler].chargeTimer1 == 0)
|
||||
if (gDisableStructs[gActiveBattler].chargeTimer && --gDisableStructs[gActiveBattler].chargeTimer == 0)
|
||||
gStatuses3[gActiveBattler] &= ~STATUS3_CHARGED_UP;
|
||||
gBattleStruct->turnEffectsTracker++;
|
||||
break;
|
||||
case ENDTURN_TAUNT: // taunt
|
||||
if (gDisableStructs[gActiveBattler].tauntTimer1)
|
||||
gDisableStructs[gActiveBattler].tauntTimer1--;
|
||||
if (gDisableStructs[gActiveBattler].tauntTimer)
|
||||
gDisableStructs[gActiveBattler].tauntTimer--;
|
||||
gBattleStruct->turnEffectsTracker++;
|
||||
break;
|
||||
case ENDTURN_YAWN: // yawn
|
||||
@@ -1167,8 +1167,8 @@ bool8 HandleWishPerishSongOnTurnEnd(void)
|
||||
gBattleStruct->wishPerishSongBattlerId++;
|
||||
if (gStatuses3[gActiveBattler] & STATUS3_PERISH_SONG)
|
||||
{
|
||||
PREPARE_BYTE_NUMBER_BUFFER(gBattleTextBuff1, 1, gDisableStructs[gActiveBattler].perishSongTimer1);
|
||||
if (gDisableStructs[gActiveBattler].perishSongTimer1 == 0)
|
||||
PREPARE_BYTE_NUMBER_BUFFER(gBattleTextBuff1, 1, gDisableStructs[gActiveBattler].perishSongTimer);
|
||||
if (gDisableStructs[gActiveBattler].perishSongTimer == 0)
|
||||
{
|
||||
gStatuses3[gActiveBattler] &= ~STATUS3_PERISH_SONG;
|
||||
gBattleMoveDamage = gBattleMons[gActiveBattler].hp;
|
||||
@@ -1176,7 +1176,7 @@ bool8 HandleWishPerishSongOnTurnEnd(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
gDisableStructs[gActiveBattler].perishSongTimer1--;
|
||||
gDisableStructs[gActiveBattler].perishSongTimer--;
|
||||
gBattlescriptCurrInstr = BattleScript_PerishSongCountGoesDown;
|
||||
}
|
||||
BattleScriptExecute(gBattlescriptCurrInstr);
|
||||
@@ -1420,7 +1420,7 @@ u8 AtkCanceller_UnableToUseMove(void)
|
||||
if (gBattleMons[gBattlerAttacker].status2 & STATUS2_RECHARGE)
|
||||
{
|
||||
gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_RECHARGE);
|
||||
gDisableStructs[gBattlerAttacker].rechargeCounter = 0;
|
||||
gDisableStructs[gBattlerAttacker].rechargeTimer = 0;
|
||||
CancelMultiTurnMoves(gBattlerAttacker);
|
||||
gBattlescriptCurrInstr = BattleScript_MoveUsedMustRecharge;
|
||||
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
|
||||
@@ -1453,7 +1453,7 @@ u8 AtkCanceller_UnableToUseMove(void)
|
||||
gBattleStruct->atkCancellerTracker++;
|
||||
break;
|
||||
case CANCELLER_TAUNTED: // taunt
|
||||
if (gDisableStructs[gBattlerAttacker].tauntTimer1 && gBattleMoves[gCurrentMove].power == 0)
|
||||
if (gDisableStructs[gBattlerAttacker].tauntTimer && gBattleMoves[gCurrentMove].power == 0)
|
||||
{
|
||||
gProtectStructs[gBattlerAttacker].usedTauntedMove = 1;
|
||||
CancelMultiTurnMoves(gBattlerAttacker);
|
||||
|
||||
2
src/tv.c
2
src/tv.c
@@ -936,7 +936,7 @@ void GabbyAndTyBeforeInterview(void)
|
||||
{
|
||||
gSaveBlock1Ptr->gabbyAndTyData.battleNum ++;
|
||||
}
|
||||
gSaveBlock1Ptr->gabbyAndTyData.battleTookMoreThanOneTurn = gBattleResults.unk5_0;
|
||||
gSaveBlock1Ptr->gabbyAndTyData.battleTookMoreThanOneTurn = gBattleResults.playerMonWasDamaged;
|
||||
if (gBattleResults.playerFaintCounter != 0)
|
||||
{
|
||||
gSaveBlock1Ptr->gabbyAndTyData.playerLostAMon = TRUE;
|
||||
|
||||
Reference in New Issue
Block a user