Clean up some battle scr cmd data
This commit is contained in:
@@ -864,9 +864,9 @@ u8 DoBattlerEndTurnEffects(void)
|
||||
gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / 16;
|
||||
if (gBattleMoveDamage == 0)
|
||||
gBattleMoveDamage = 1;
|
||||
if ((gBattleMons[gActiveBattler].status1 & 0xF00) != 0xF00) // not 16 turns
|
||||
gBattleMons[gActiveBattler].status1 += 0x100;
|
||||
gBattleMoveDamage *= (gBattleMons[gActiveBattler].status1 & 0xF00) >> 8;
|
||||
if ((gBattleMons[gActiveBattler].status1 & STATUS1_TOXIC_COUNTER) != STATUS1_TOXIC_TURN(15)) // not 16 turns
|
||||
gBattleMons[gActiveBattler].status1 += STATUS1_TOXIC_TURN(1);
|
||||
gBattleMoveDamage *= (gBattleMons[gActiveBattler].status1 & STATUS1_TOXIC_COUNTER) >> 8;
|
||||
BattleScriptExecute(BattleScript_PoisonTurnDmg);
|
||||
effect++;
|
||||
}
|
||||
@@ -917,7 +917,7 @@ u8 DoBattlerEndTurnEffects(void)
|
||||
case ENDTURN_WRAP: // wrap
|
||||
if ((gBattleMons[gActiveBattler].status2 & STATUS2_WRAPPED) && gBattleMons[gActiveBattler].hp != 0)
|
||||
{
|
||||
gBattleMons[gActiveBattler].status2 -= 0x2000;
|
||||
gBattleMons[gActiveBattler].status2 -= STATUS2_WRAPPED_TURN(1);
|
||||
if (gBattleMons[gActiveBattler].status2 & STATUS2_WRAPPED) // damaged by wrap
|
||||
{
|
||||
// This is the only way I could get this array access to match.
|
||||
@@ -973,7 +973,7 @@ u8 DoBattlerEndTurnEffects(void)
|
||||
else
|
||||
{
|
||||
gBattlerAttacker = gActiveBattler;
|
||||
gBattleMons[gActiveBattler].status2 -= 0x10; // uproar timer goes down
|
||||
gBattleMons[gActiveBattler].status2 -= STATUS2_UPROAR_TURN(1);
|
||||
if (WasUnableToUseMove(gActiveBattler))
|
||||
{
|
||||
CancelMultiTurnMoves(gActiveBattler);
|
||||
@@ -999,7 +999,7 @@ u8 DoBattlerEndTurnEffects(void)
|
||||
case ENDTURN_THRASH: // thrash
|
||||
if (gBattleMons[gActiveBattler].status2 & STATUS2_LOCK_CONFUSE)
|
||||
{
|
||||
gBattleMons[gActiveBattler].status2 -= 0x400;
|
||||
gBattleMons[gActiveBattler].status2 -= STATUS2_LOCK_CONFUSE_TURN(1);
|
||||
if (WasUnableToUseMove(gActiveBattler))
|
||||
CancelMultiTurnMoves(gActiveBattler);
|
||||
else if (!(gBattleMons[gActiveBattler].status2 & STATUS2_LOCK_CONFUSE)
|
||||
@@ -1062,7 +1062,7 @@ u8 DoBattlerEndTurnEffects(void)
|
||||
break;
|
||||
case ENDTURN_LOCK_ON: // lock-on decrement
|
||||
if (gStatuses3[gActiveBattler] & STATUS3_ALWAYS_HITS)
|
||||
gStatuses3[gActiveBattler] -= 0x8;
|
||||
gStatuses3[gActiveBattler] -= STATUS3_ALWAYS_HITS_TURN(1);
|
||||
gBattleStruct->turnEffectsTracker++;
|
||||
break;
|
||||
case ENDTURN_CHARGE: // charge
|
||||
@@ -1078,13 +1078,13 @@ u8 DoBattlerEndTurnEffects(void)
|
||||
case ENDTURN_YAWN: // yawn
|
||||
if (gStatuses3[gActiveBattler] & STATUS3_YAWN)
|
||||
{
|
||||
gStatuses3[gActiveBattler] -= 0x800;
|
||||
gStatuses3[gActiveBattler] -= STATUS3_YAWN_TURN(1);
|
||||
if (!(gStatuses3[gActiveBattler] & STATUS3_YAWN) && !(gBattleMons[gActiveBattler].status1 & STATUS1_ANY)
|
||||
&& gBattleMons[gActiveBattler].ability != ABILITY_VITAL_SPIRIT
|
||||
&& gBattleMons[gActiveBattler].ability != ABILITY_INSOMNIA && !UproarWakeUpCheck(gActiveBattler))
|
||||
{
|
||||
CancelMultiTurnMoves(gActiveBattler);
|
||||
gBattleMons[gActiveBattler].status1 |= (Random() & 3) + 2;
|
||||
gBattleMons[gActiveBattler].status1 |= STATUS1_SLEEP_TURN((Random() & 3) + 2); // 2-5 turns of sleep
|
||||
BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
gEffectBattler = gActiveBattler;
|
||||
@@ -1478,7 +1478,7 @@ u8 AtkCanceller_UnableToUseMove(void)
|
||||
case CANCELLER_CONFUSED: // confusion
|
||||
if (gBattleMons[gBattlerAttacker].status2 & STATUS2_CONFUSION)
|
||||
{
|
||||
gBattleMons[gBattlerAttacker].status2--;
|
||||
gBattleMons[gBattlerAttacker].status2 -= STATUS2_CONFUSION_TURN(1);
|
||||
if (gBattleMons[gBattlerAttacker].status2 & STATUS2_CONFUSION)
|
||||
{
|
||||
if (Random() & 1)
|
||||
@@ -1540,7 +1540,7 @@ u8 AtkCanceller_UnableToUseMove(void)
|
||||
case CANCELLER_BIDE: // bide
|
||||
if (gBattleMons[gBattlerAttacker].status2 & STATUS2_BIDE)
|
||||
{
|
||||
gBattleMons[gBattlerAttacker].status2 -= 0x100;
|
||||
gBattleMons[gBattlerAttacker].status2 -= STATUS2_BIDE_TURN(1);
|
||||
if (gBattleMons[gBattlerAttacker].status2 & STATUS2_BIDE)
|
||||
{
|
||||
gBattlescriptCurrInstr = BattleScript_BideStoringEnergy;
|
||||
|
||||
Reference in New Issue
Block a user