summaryrefslogtreecommitdiff
path: root/src/battle_script_commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/battle_script_commands.c')
-rw-r--r--src/battle_script_commands.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c
index dfbab5c15..28573a09d 100644
--- a/src/battle_script_commands.c
+++ b/src/battle_script_commands.c
@@ -1040,11 +1040,11 @@ static void atk01_accuracycheck(void)
u16 move = T2_READ_16(gBattlescriptCurrInstr + 5);
if ((gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE
- && !sub_80EB2E0(1)
+ && !BtlCtrl_OakOldMan_TestState2Flag(1)
&& gBattleMoves[move].power != 0
&& GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER)
|| (gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE
- && !sub_80EB2E0(2)
+ && !BtlCtrl_OakOldMan_TestState2Flag(2)
&& gBattleMoves[move].power == 0
&& GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER)
|| (gBattleTypeFlags & BATTLE_TYPE_POKEDUDE))
@@ -1213,7 +1213,7 @@ static void atk04_critcalc(void)
&& !(gStatuses3[gBattlerAttacker] & STATUS3_CANT_SCORE_A_CRIT)
&& !(gBattleTypeFlags & BATTLE_TYPE_OLD_MAN_TUTORIAL)
&& !(Random() % sCriticalHitChance[critChance])
- && (!(gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE) || sub_80EB2E0(1))
+ && (!(gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE) || BtlCtrl_OakOldMan_TestState2Flag(1))
&& !(gBattleTypeFlags & BATTLE_TYPE_POKEDUDE))
gCritMultiplier = 2;
else
@@ -4146,7 +4146,7 @@ static void atk49_moveend(void)
gLastPrintedMoves[gBattlerAttacker] = gChosenMove;
}
if (!(gAbsentBattlerFlags & gBitTable[gBattlerAttacker])
- && !(gBattleStruct->field_91 & gBitTable[gBattlerAttacker])
+ && !(gBattleStruct->absentBattlerFlags & gBitTable[gBattlerAttacker])
&& gBattleMoves[originallyUsedMove].effect != EFFECT_BATON_PASS)
{
if (gHitMarker & HITMARKER_OBEYS)
@@ -4184,7 +4184,7 @@ static void atk49_moveend(void)
break;
case ATK49_MIRROR_MOVE: // mirror move
if (!(gAbsentBattlerFlags & gBitTable[gBattlerAttacker])
- && !(gBattleStruct->field_91 & gBitTable[gBattlerAttacker])
+ && !(gBattleStruct->absentBattlerFlags & gBitTable[gBattlerAttacker])
&& gBattleMoves[originallyUsedMove].flags & FLAG_MIRROR_MOVE_AFFECTED
&& gHitMarker & HITMARKER_OBEYS
&& gBattlerAttacker != gBattlerTarget
@@ -4491,8 +4491,8 @@ static void atk4F_jumpifcantswitch(void)
static void sub_8024398(u8 arg0)
{
- *(gBattleStruct->field_58 + gActiveBattler) = gBattlerPartyIndexes[gActiveBattler];
- BtlController_EmitChoosePokemon(0, PARTY_ACTION_SEND_OUT, arg0, 0, gBattleStruct->field_60[gActiveBattler]);
+ *(gBattleStruct->battlerPartyIndexes + gActiveBattler) = gBattlerPartyIndexes[gActiveBattler];
+ BtlController_EmitChoosePokemon(0, PARTY_ACTION_SEND_OUT, arg0, 0, gBattleStruct->battlerPartyOrders[gActiveBattler]);
MarkBattlerForControllerExec(gActiveBattler);
}
@@ -4745,8 +4745,8 @@ static void atk50_openpartyscreen(void)
else
{
gActiveBattler = battlerId;
- *(gBattleStruct->field_58 + gActiveBattler) = gBattlerPartyIndexes[gActiveBattler];
- BtlController_EmitChoosePokemon(0, hitmarkerFaintBits, *(gBattleStruct->monToSwitchIntoId + (gActiveBattler ^ 2)), 0, gBattleStruct->field_60[gActiveBattler]);
+ *(gBattleStruct->battlerPartyIndexes + gActiveBattler) = gBattlerPartyIndexes[gActiveBattler];
+ BtlController_EmitChoosePokemon(0, hitmarkerFaintBits, *(gBattleStruct->monToSwitchIntoId + (gActiveBattler ^ 2)), 0, gBattleStruct->battlerPartyOrders[gActiveBattler]);
MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr += 6;
if (GetBattlerPosition(gActiveBattler) == B_POSITION_PLAYER_LEFT && gBattleResults.playerSwitchesCounter < 0xFF)
@@ -4799,12 +4799,12 @@ static void atk51_switchhandleorder(void)
if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
{
- *(gActiveBattler * 3 + (u8 *)(gBattleStruct->field_60) + 0) &= 0xF;
- *(gActiveBattler * 3 + (u8 *)(gBattleStruct->field_60) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0);
- *(gActiveBattler * 3 + (u8 *)(gBattleStruct->field_60) + 1) = gBattleBufferB[gActiveBattler][3];
- *((gActiveBattler ^ BIT_FLANK) * 3 + (u8 *)(gBattleStruct->field_60) + 0) &= (0xF0);
- *((gActiveBattler ^ BIT_FLANK) * 3 + (u8 *)(gBattleStruct->field_60) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0) >> 4;
- *((gActiveBattler ^ BIT_FLANK) * 3 + (u8 *)(gBattleStruct->field_60) + 2) = gBattleBufferB[gActiveBattler][3];
+ *(gActiveBattler * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) &= 0xF;
+ *(gActiveBattler * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0);
+ *(gActiveBattler * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 1) = gBattleBufferB[gActiveBattler][3];
+ *((gActiveBattler ^ BIT_FLANK) * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) &= (0xF0);
+ *((gActiveBattler ^ BIT_FLANK) * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0) >> 4;
+ *((gActiveBattler ^ BIT_FLANK) * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 2) = gBattleBufferB[gActiveBattler][3];
}
else
{
@@ -6601,7 +6601,7 @@ static bool8 TryDoForceSwitchOut(void)
{
if (gBattleMons[gBattlerAttacker].level >= gBattleMons[gBattlerTarget].level)
{
- *(gBattleStruct->field_58 + gBattlerTarget) = gBattlerPartyIndexes[gBattlerTarget];
+ *(gBattleStruct->battlerPartyIndexes + gBattlerTarget) = gBattlerPartyIndexes[gBattlerTarget];
}
else
{
@@ -6612,7 +6612,7 @@ static bool8 TryDoForceSwitchOut(void)
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
return FALSE;
}
- *(gBattleStruct->field_58 + gBattlerTarget) = gBattlerPartyIndexes[gBattlerTarget];
+ *(gBattleStruct->battlerPartyIndexes + gBattlerTarget) = gBattlerPartyIndexes[gBattlerTarget];
}
gBattlescriptCurrInstr = BattleScript_SuccessForceOut;
return TRUE;
@@ -8742,7 +8742,7 @@ static void atkE2_switchoutabilities(void)
{
case ABILITY_NATURAL_CURE:
gBattleMons[gActiveBattler].status1 = 0;
- BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, gBitTable[*(gBattleStruct->field_58 + gActiveBattler)], 4, &gBattleMons[gActiveBattler].status1);
+ BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, gBitTable[*(gBattleStruct->battlerPartyIndexes + gActiveBattler)], 4, &gBattleMons[gActiveBattler].status1);
MarkBattlerForControllerExec(gActiveBattler);
break;
}