mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 11:44:17 +01:00
document party status summary
This commit is contained in:
parent
ab36efdaf4
commit
272b98da6c
@ -525,7 +525,7 @@
|
||||
.byte \bank
|
||||
.endm
|
||||
|
||||
.macro atk62 bank
|
||||
.macro hidepartystatussummary bank
|
||||
.byte 0x62
|
||||
.byte \bank
|
||||
.endm
|
||||
|
@ -12158,7 +12158,7 @@ sub_81B672C: @ 81B672C
|
||||
bl sub_81B1B5C
|
||||
movs r0, 0x2
|
||||
bl schedule_bg_copy_tilemap_to_vram
|
||||
bl sub_805EAE8
|
||||
bl HandleBattleLowHpMusicChange
|
||||
ldr r1, =gTasks
|
||||
lsls r0, r5, 2
|
||||
adds r0, r5
|
||||
|
@ -1116,7 +1116,7 @@ sub_81C4778: @ 81C4778
|
||||
bne _081C47AE
|
||||
adds r0, r1, 0
|
||||
adds r0, 0xC
|
||||
bl ShouldPlayNormalPokeCry
|
||||
bl ShouldPlayNormalMonCry
|
||||
cmp r0, 0x1
|
||||
bne _081C47A4
|
||||
ldrh r0, [r4, 0x2]
|
||||
|
@ -2899,7 +2899,7 @@ BattleScript_FaintedMonTryChooseAnother::
|
||||
switchindataupdate BS_ATTACKER
|
||||
hpthresholds BS_ATTACKER
|
||||
printstring STRINGID_SWITCHINMON
|
||||
atk62 BS_ATTACKER
|
||||
hidepartystatussummary BS_ATTACKER
|
||||
switchinanim BS_ATTACKER, 0x0
|
||||
waitstate
|
||||
switchineffects BS_ATTACKER
|
||||
@ -2910,7 +2910,7 @@ BattleScript_FaintedMonChooseAnother::
|
||||
switchindataupdate BS_FAINTED
|
||||
hpthresholds BS_FAINTED
|
||||
printstring STRINGID_SWITCHINMON
|
||||
atk62 BS_FAINTED
|
||||
hidepartystatussummary BS_FAINTED
|
||||
switchinanim BS_FAINTED, FALSE
|
||||
waitstate
|
||||
various7 BS_ATTACKER
|
||||
@ -2933,7 +2933,7 @@ BattleScript_82DA908::
|
||||
switchindataupdate BS_FAINTED
|
||||
hpthresholds BS_FAINTED
|
||||
printstring STRINGID_SWITCHINMON
|
||||
atk62 BS_FAINTED
|
||||
hidepartystatussummary BS_FAINTED
|
||||
switchinanim BS_FAINTED, FALSE
|
||||
waitstate
|
||||
switchineffects 5
|
||||
@ -3136,7 +3136,7 @@ BattleScript_DoSwitchOut::
|
||||
switchindataupdate BS_ATTACKER
|
||||
hpthresholds BS_ATTACKER
|
||||
printstring STRINGID_SWITCHINMON
|
||||
atk62 BS_ATTACKER
|
||||
hidepartystatussummary BS_ATTACKER
|
||||
switchinanim BS_ATTACKER, FALSE
|
||||
waitstate
|
||||
switchineffects BS_ATTACKER
|
||||
|
@ -44,7 +44,7 @@ gBattlescriptsForSafariActions:: @ 82DBD58
|
||||
.4byte BattleScript_ActionWatchesCarefully
|
||||
.4byte BattleScript_ActionGetNear
|
||||
.4byte BattleScript_ActionThrowPokeblock
|
||||
.4byte BattleScript_82DBEE3
|
||||
.4byte BattleScript_ActionWallyThrow
|
||||
|
||||
BattleScript_BallThrow::
|
||||
jumpifword CMP_COMMON_BITS, gBattleTypeFlags, BATTLE_TYPE_WALLY_TUTORIAL, BattleScript_BallThrowByWally
|
||||
@ -176,17 +176,17 @@ BattleScript_RunByUsingItem::
|
||||
setbyte gBattleOutcome, B_OUTCOME_RAN
|
||||
finishturn
|
||||
|
||||
BattleScript_ActionWatchesCarefully::
|
||||
BattleScript_ActionWatchesCarefully:
|
||||
printstring STRINGID_PKMNWATCHINGCAREFULLY
|
||||
waitmessage 0x40
|
||||
end2
|
||||
|
||||
BattleScript_ActionGetNear::
|
||||
BattleScript_ActionGetNear:
|
||||
printfromtable gSafariGetNearStringIds
|
||||
waitmessage 0x40
|
||||
end2
|
||||
|
||||
BattleScript_ActionThrowPokeblock::
|
||||
BattleScript_ActionThrowPokeblock:
|
||||
printstring STRINGID_THREWPOKEBLOCKATPKMN
|
||||
waitmessage 0x40
|
||||
playanimation BS_ATTACKER, B_ANIM_x4, NULL
|
||||
@ -194,7 +194,7 @@ BattleScript_ActionThrowPokeblock::
|
||||
waitmessage 0x40
|
||||
end2
|
||||
|
||||
BattleScript_82DBEE3::
|
||||
BattleScript_ActionWallyThrow:
|
||||
printstring STRINGID_RETURNMON
|
||||
waitmessage 0x40
|
||||
returnatktoball
|
||||
|
@ -336,20 +336,20 @@ struct BattleResults
|
||||
u8 unk5_0:1; // 0x5
|
||||
u8 usedMasterBall:1; // 0x5
|
||||
u8 caughtMonBall:4; // 0x5
|
||||
u8 unk5_6:1; // 0x5
|
||||
u8 shinyWildMon:1; // 0x5
|
||||
u8 unk5_7:1; // 0x5
|
||||
u16 playerMon1Species; // 0x6
|
||||
u8 playerMon1Name[11]; // 0x8
|
||||
u8 playerMon1Name[POKEMON_NAME_LENGTH + 1]; // 0x8
|
||||
u8 battleTurnCounter; // 0x13
|
||||
u8 playerMon2Name[11]; // 0x14
|
||||
u8 field_1F; // 0x1F
|
||||
u8 playerMon2Name[POKEMON_NAME_LENGTH + 1]; // 0x14
|
||||
u8 pokeblockThrows; // 0x1F
|
||||
u16 lastOpponentSpecies; // 0x20
|
||||
u16 lastUsedMovePlayer; // 0x22
|
||||
u16 lastUsedMoveOpponent; // 0x24
|
||||
u16 playerMon2Species; // 0x26
|
||||
u16 caughtMonSpecies; // 0x28
|
||||
u8 caughtMonNick[10]; // 0x2A
|
||||
u8 filler34[2]; // 0x34
|
||||
u8 caughtMonNick[POKEMON_NAME_LENGTH + 1]; // 0x2A
|
||||
u8 filler35[1]; // 0x35
|
||||
u8 catchAttempts[11]; // 0x36
|
||||
};
|
||||
|
||||
@ -663,7 +663,7 @@ struct BattleAnimationInfo
|
||||
|
||||
struct BattleHealthboxInfo
|
||||
{
|
||||
u8 flag_x1:1;
|
||||
u8 partyStatusSummaryShown:1;
|
||||
u8 healthboxIsBouncing:1;
|
||||
u8 battlerIsBouncing:1;
|
||||
u8 ballAnimActive:1; // 0x8
|
||||
@ -733,7 +733,7 @@ extern u8 gBattlersCount;
|
||||
extern u16 gBattlerPartyIndexes[MAX_BATTLERS_COUNT];
|
||||
extern u8 gBattlerPositions[MAX_BATTLERS_COUNT];
|
||||
extern u8 gActionsByTurnOrder[MAX_BATTLERS_COUNT];
|
||||
extern u8 gBattleTurnOrder[MAX_BATTLERS_COUNT];
|
||||
extern u8 gBattlerByTurnOrder[MAX_BATTLERS_COUNT];
|
||||
extern u8 gCurrentTurnActionNumber;
|
||||
extern u8 gCurrentActionFuncId;
|
||||
extern struct BattlePokemon gBattleMons[MAX_BATTLERS_COUNT];
|
||||
|
@ -160,7 +160,7 @@ enum
|
||||
CONTROLLER_INTROSLIDE,
|
||||
CONTROLLER_INTROTRAINERBALLTHROW,
|
||||
CONTROLLER_DRAWPARTYSTATUSSUMMARY,
|
||||
CONTROLLER_49,
|
||||
CONTROLLER_HIDEPARTYSTATUSSUMMARY,
|
||||
CONTROLLER_ENDBOUNCE,
|
||||
CONTROLLER_SPRITEINVISIBILITY,
|
||||
CONTROLLER_BATTLEANIMATION,
|
||||
@ -230,13 +230,13 @@ void BtlController_EmitFaintingCry(u8 bufferId);
|
||||
void BtlController_EmitIntroSlide(u8 bufferId, u8 terrainId);
|
||||
void BtlController_EmitIntroTrainerBallThrow(u8 bufferId);
|
||||
void BtlController_EmitDrawPartyStatusSummary(u8 bufferId, struct HpAndStatus* hpAndStatus, u8 arg2);
|
||||
void BtlController_EmitCmd49(u8 bufferId);
|
||||
void BtlController_EmitHidePartyStatusSummary(u8 bufferId);
|
||||
void BtlController_EmitEndBounceEffect(u8 bufferId);
|
||||
void BtlController_EmitSpriteInvisibility(u8 bufferId, bool8 isInvisible);
|
||||
void BtlController_EmitBattleAnimation(u8 bufferId, u8 animationId, u16 argument);
|
||||
void BtlController_EmitLinkStandbyMsg(u8 bufferId, u8 arg1, bool32 arg2);
|
||||
void BtlController_EmitResetActionMoveSelection(u8 bufferId, u8 caseId);
|
||||
void BtlController_EmitCmd55(u8 bufferId, u8 arg1);
|
||||
void BtlController_EmitCmd55(u8 bufferId, u8 battleOutcome);
|
||||
|
||||
// player controller
|
||||
void SetControllerToPlayer(void);
|
||||
|
@ -72,7 +72,7 @@ void InitBattlerHealthboxCoords(u8 bank);
|
||||
void UpdateHpTextInHealthbox(u8 healthboxSpriteId, s16 value, u8 maxOrCurrent);
|
||||
void SwapHpBarsWithHpText(void);
|
||||
u8 CreatePartyStatusSummarySprites(u8 bank, struct HpAndStatus *partyInfo, u8 arg2, bool8 isBattleStart);
|
||||
void sub_8073C30(u8 taskId);
|
||||
void Task_HidePartyStatusSummary(u8 taskId);
|
||||
void UpdateHealthboxAttribute(u8 healthboxSpriteId, struct Pokemon *mon, u8 elementId);
|
||||
s32 MoveBattleBar(u8 bank, u8 healthboxSpriteId, u8 whichBar, u8 arg3);
|
||||
u8 GetScaledHPFraction(s16 hp, s16 maxhp, u8 scale);
|
||||
|
@ -89,7 +89,7 @@ static void LinkOpponentHandleFaintingCry(void);
|
||||
static void LinkOpponentHandleIntroSlide(void);
|
||||
static void LinkOpponentHandleIntroTrainerBallThrow(void);
|
||||
static void LinkOpponentHandleDrawPartyStatusSummary(void);
|
||||
static void LinkOpponentHandleCmd49(void);
|
||||
static void LinkOpponentHandleHidePartyStatusSummary(void);
|
||||
static void LinkOpponentHandleEndBounceEffect(void);
|
||||
static void LinkOpponentHandleSpriteInvisibility(void);
|
||||
static void LinkOpponentHandleBattleAnimation(void);
|
||||
@ -161,7 +161,7 @@ static void (*const sLinkOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
|
||||
LinkOpponentHandleIntroSlide,
|
||||
LinkOpponentHandleIntroTrainerBallThrow,
|
||||
LinkOpponentHandleDrawPartyStatusSummary,
|
||||
LinkOpponentHandleCmd49,
|
||||
LinkOpponentHandleHidePartyStatusSummary,
|
||||
LinkOpponentHandleEndBounceEffect,
|
||||
LinkOpponentHandleSpriteInvisibility,
|
||||
LinkOpponentHandleBattleAnimation,
|
||||
@ -1716,8 +1716,8 @@ static void LinkOpponentHandleIntroTrainerBallThrow(void)
|
||||
taskId = CreateTask(sub_8067618, 5);
|
||||
gTasks[taskId].data[0] = gActiveBattler;
|
||||
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = Task_HidePartyStatusSummary;
|
||||
|
||||
gBattleSpritesDataPtr->animationData->field_9_x1 = 1;
|
||||
gBattlerControllerFuncs[gActiveBattler] = nullsub_28;
|
||||
@ -1762,7 +1762,7 @@ static void LinkOpponentHandleDrawPartyStatusSummary(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1 = 1;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown = 1;
|
||||
|
||||
if (gBattleBufferA[gActiveBattler][2] != 0)
|
||||
{
|
||||
@ -1796,10 +1796,10 @@ static void sub_806782C(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void LinkOpponentHandleCmd49(void)
|
||||
static void LinkOpponentHandleHidePartyStatusSummary(void)
|
||||
{
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = Task_HidePartyStatusSummary;
|
||||
LinkOpponentBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,7 @@ static void LinkPartnerHandleFaintingCry(void);
|
||||
static void LinkPartnerHandleIntroSlide(void);
|
||||
static void LinkPartnerHandleIntroTrainerBallThrow(void);
|
||||
static void LinkPartnerHandleDrawPartyStatusSummary(void);
|
||||
static void LinkPartnerHandleCmd49(void);
|
||||
static void LinkPartnerHandleHidePartyStatusSummary(void);
|
||||
static void LinkPartnerHandleEndBounceEffect(void);
|
||||
static void LinkPartnerHandleSpriteInvisibility(void);
|
||||
static void LinkPartnerHandleBattleAnimation(void);
|
||||
@ -158,7 +158,7 @@ static void (*const sLinkPartnerBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
|
||||
LinkPartnerHandleIntroSlide,
|
||||
LinkPartnerHandleIntroTrainerBallThrow,
|
||||
LinkPartnerHandleDrawPartyStatusSummary,
|
||||
LinkPartnerHandleCmd49,
|
||||
LinkPartnerHandleHidePartyStatusSummary,
|
||||
LinkPartnerHandleEndBounceEffect,
|
||||
LinkPartnerHandleSpriteInvisibility,
|
||||
LinkPartnerHandleBattleAnimation,
|
||||
@ -1564,8 +1564,8 @@ static void LinkPartnerHandleIntroTrainerBallThrow(void)
|
||||
taskId = CreateTask(sub_814DCCC, 5);
|
||||
gTasks[taskId].data[0] = gActiveBattler;
|
||||
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = Task_HidePartyStatusSummary;
|
||||
|
||||
gBattleSpritesDataPtr->animationData->field_9_x1 = 1;
|
||||
gBattlerControllerFuncs[gActiveBattler] = nullsub_112;
|
||||
@ -1611,7 +1611,7 @@ static void LinkPartnerHandleDrawPartyStatusSummary(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1 = 1;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown = 1;
|
||||
gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]);
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0;
|
||||
|
||||
@ -1631,10 +1631,10 @@ static void sub_814DE9C(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void LinkPartnerHandleCmd49(void)
|
||||
static void LinkPartnerHandleHidePartyStatusSummary(void)
|
||||
{
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = Task_HidePartyStatusSummary;
|
||||
LinkPartnerBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ static void OpponentHandleFaintingCry(void);
|
||||
static void OpponentHandleIntroSlide(void);
|
||||
static void OpponentHandleIntroTrainerBallThrow(void);
|
||||
static void OpponentHandleDrawPartyStatusSummary(void);
|
||||
static void OpponentHandleCmd49(void);
|
||||
static void OpponentHandleHidePartyStatusSummary(void);
|
||||
static void OpponentHandleEndBounceEffect(void);
|
||||
static void OpponentHandleSpriteInvisibility(void);
|
||||
static void OpponentHandleBattleAnimation(void);
|
||||
@ -166,7 +166,7 @@ static void (*const sOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
|
||||
OpponentHandleIntroSlide,
|
||||
OpponentHandleIntroTrainerBallThrow,
|
||||
OpponentHandleDrawPartyStatusSummary,
|
||||
OpponentHandleCmd49,
|
||||
OpponentHandleHidePartyStatusSummary,
|
||||
OpponentHandleEndBounceEffect,
|
||||
OpponentHandleSpriteInvisibility,
|
||||
OpponentHandleBattleAnimation,
|
||||
@ -1865,8 +1865,8 @@ static void OpponentHandleIntroTrainerBallThrow(void)
|
||||
taskId = CreateTask(sub_8062828, 5);
|
||||
gTasks[taskId].data[0] = gActiveBattler;
|
||||
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = Task_HidePartyStatusSummary;
|
||||
|
||||
gBattleSpritesDataPtr->animationData->field_9_x1 = 1;
|
||||
gBattlerControllerFuncs[gActiveBattler] = nullsub_26;
|
||||
@ -1916,7 +1916,7 @@ static void OpponentHandleDrawPartyStatusSummary(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1 = 1;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown = 1;
|
||||
|
||||
if (gBattleBufferA[gActiveBattler][2] != 0)
|
||||
{
|
||||
@ -1950,10 +1950,10 @@ static void sub_8062A2C(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void OpponentHandleCmd49(void)
|
||||
static void OpponentHandleHidePartyStatusSummary(void)
|
||||
{
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = Task_HidePartyStatusSummary;
|
||||
OpponentBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ static void PlayerHandleFaintingCry(void);
|
||||
static void PlayerHandleIntroSlide(void);
|
||||
static void PlayerHandleIntroTrainerBallThrow(void);
|
||||
static void PlayerHandleDrawPartyStatusSummary(void);
|
||||
static void PlayerHandleCmd49(void);
|
||||
static void PlayerHandleHidePartyStatusSummary(void);
|
||||
static void PlayerHandleEndBounceEffect(void);
|
||||
static void PlayerHandleSpriteInvisibility(void);
|
||||
static void PlayerHandleBattleAnimation(void);
|
||||
@ -187,7 +187,7 @@ static void (*const sPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
|
||||
PlayerHandleIntroSlide,
|
||||
PlayerHandleIntroTrainerBallThrow,
|
||||
PlayerHandleDrawPartyStatusSummary,
|
||||
PlayerHandleCmd49,
|
||||
PlayerHandleHidePartyStatusSummary,
|
||||
PlayerHandleEndBounceEffect,
|
||||
PlayerHandleSpriteInvisibility,
|
||||
PlayerHandleBattleAnimation,
|
||||
@ -253,7 +253,7 @@ static void HandleInputChooseAction(void)
|
||||
DoBounceEffect(gActiveBattler, BOUNCE_HEALTHBOX, 7, 1);
|
||||
DoBounceEffect(gActiveBattler, BOUNCE_MON, 7, 1);
|
||||
|
||||
if (gMain.newAndRepeatedKeys & DPAD_ANY && gSaveBlock2Ptr->optionsButtonMode == 2)
|
||||
if (gMain.newAndRepeatedKeys & DPAD_ANY && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_L_EQUALS_A)
|
||||
gPlayerDpadHoldFrames++;
|
||||
else
|
||||
gPlayerDpadHoldFrames = 0;
|
||||
@ -485,7 +485,7 @@ static void HandleInputChooseMove(void)
|
||||
bool32 canSelectTarget = FALSE;
|
||||
struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleBufferA[gActiveBattler][4]);
|
||||
|
||||
if (gMain.heldKeys & DPAD_ANY && gSaveBlock2Ptr->optionsButtonMode == 2)
|
||||
if (gMain.heldKeys & DPAD_ANY && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_L_EQUALS_A)
|
||||
gPlayerDpadHoldFrames++;
|
||||
else
|
||||
gPlayerDpadHoldFrames = 0;
|
||||
@ -2945,8 +2945,8 @@ static void PlayerHandleIntroTrainerBallThrow(void)
|
||||
taskId = CreateTask(task05_08033660, 5);
|
||||
gTasks[taskId].data[0] = gActiveBattler;
|
||||
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = Task_HidePartyStatusSummary;
|
||||
|
||||
gBattleSpritesDataPtr->animationData->field_9_x1 = 1;
|
||||
gBattlerControllerFuncs[gActiveBattler] = nullsub_21;
|
||||
@ -3003,7 +3003,7 @@ static void PlayerHandleDrawPartyStatusSummary(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1 = 1;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown = 1;
|
||||
gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]);
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0;
|
||||
|
||||
@ -3023,10 +3023,10 @@ static void sub_805CE38(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void PlayerHandleCmd49(void)
|
||||
static void PlayerHandleHidePartyStatusSummary(void)
|
||||
{
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = Task_HidePartyStatusSummary;
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
@ -87,7 +87,7 @@ static void PlayerPartnerHandleFaintingCry(void);
|
||||
static void PlayerPartnerHandleIntroSlide(void);
|
||||
static void PlayerPartnerHandleIntroTrainerBallThrow(void);
|
||||
static void PlayerPartnerHandleDrawPartyStatusSummary(void);
|
||||
static void PlayerPartnerHandleCmd49(void);
|
||||
static void PlayerPartnerHandleHidePartyStatusSummary(void);
|
||||
static void PlayerPartnerHandleEndBounceEffect(void);
|
||||
static void PlayerPartnerHandleSpriteInvisibility(void);
|
||||
static void PlayerPartnerHandleBattleAnimation(void);
|
||||
@ -164,7 +164,7 @@ static void (*const sPlayerPartnerBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
|
||||
PlayerPartnerHandleIntroSlide,
|
||||
PlayerPartnerHandleIntroTrainerBallThrow,
|
||||
PlayerPartnerHandleDrawPartyStatusSummary,
|
||||
PlayerPartnerHandleCmd49,
|
||||
PlayerPartnerHandleHidePartyStatusSummary,
|
||||
PlayerPartnerHandleEndBounceEffect,
|
||||
PlayerPartnerHandleSpriteInvisibility,
|
||||
PlayerPartnerHandleBattleAnimation,
|
||||
@ -1810,8 +1810,8 @@ static void PlayerPartnerHandleIntroTrainerBallThrow(void)
|
||||
taskId = CreateTask(sub_81BE2C8, 5);
|
||||
gTasks[taskId].data[0] = gActiveBattler;
|
||||
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = Task_HidePartyStatusSummary;
|
||||
|
||||
gBattleSpritesDataPtr->animationData->field_9_x1 = 1;
|
||||
gBattlerControllerFuncs[gActiveBattler] = nullsub_77;
|
||||
@ -1857,7 +1857,7 @@ static void PlayerPartnerHandleDrawPartyStatusSummary(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1 = 1;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown = 1;
|
||||
gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]);
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0;
|
||||
|
||||
@ -1877,10 +1877,10 @@ static void sub_81BE498(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void PlayerPartnerHandleCmd49(void)
|
||||
static void PlayerPartnerHandleHidePartyStatusSummary(void)
|
||||
{
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = Task_HidePartyStatusSummary;
|
||||
PlayerPartnerBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ static void RecordedOpponentHandleFaintingCry(void);
|
||||
static void RecordedOpponentHandleIntroSlide(void);
|
||||
static void RecordedOpponentHandleIntroTrainerBallThrow(void);
|
||||
static void RecordedOpponentHandleDrawPartyStatusSummary(void);
|
||||
static void RecordedOpponentHandleCmd49(void);
|
||||
static void RecordedOpponentHandleHidePartyStatusSummary(void);
|
||||
static void RecordedOpponentHandleEndBounceEffect(void);
|
||||
static void RecordedOpponentHandleSpriteInvisibility(void);
|
||||
static void RecordedOpponentHandleBattleAnimation(void);
|
||||
@ -162,7 +162,7 @@ static void (*const sRecordedOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void
|
||||
RecordedOpponentHandleIntroSlide,
|
||||
RecordedOpponentHandleIntroTrainerBallThrow,
|
||||
RecordedOpponentHandleDrawPartyStatusSummary,
|
||||
RecordedOpponentHandleCmd49,
|
||||
RecordedOpponentHandleHidePartyStatusSummary,
|
||||
RecordedOpponentHandleEndBounceEffect,
|
||||
RecordedOpponentHandleSpriteInvisibility,
|
||||
RecordedOpponentHandleBattleAnimation,
|
||||
@ -1658,8 +1658,8 @@ static void RecordedOpponentHandleIntroTrainerBallThrow(void)
|
||||
taskId = CreateTask(sub_8189548, 5);
|
||||
gTasks[taskId].data[0] = gActiveBattler;
|
||||
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = Task_HidePartyStatusSummary;
|
||||
|
||||
gBattleSpritesDataPtr->animationData->field_9_x1 = 1;
|
||||
gBattlerControllerFuncs[gActiveBattler] = nullsub_70;
|
||||
@ -1704,7 +1704,7 @@ static void RecordedOpponentHandleDrawPartyStatusSummary(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1 = 1;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown = 1;
|
||||
|
||||
if (gBattleBufferA[gActiveBattler][2] != 0)
|
||||
{
|
||||
@ -1738,10 +1738,10 @@ static void sub_818975C(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void RecordedOpponentHandleCmd49(void)
|
||||
static void RecordedOpponentHandleHidePartyStatusSummary(void)
|
||||
{
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = Task_HidePartyStatusSummary;
|
||||
RecordedOpponentBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ static void RecordedPlayerHandleFaintingCry(void);
|
||||
static void RecordedPlayerHandleIntroSlide(void);
|
||||
static void RecordedPlayerHandleIntroTrainerBallThrow(void);
|
||||
static void RecordedPlayerHandleDrawPartyStatusSummary(void);
|
||||
static void RecordedPlayerHandleCmd49(void);
|
||||
static void RecordedPlayerHandleHidePartyStatusSummary(void);
|
||||
static void RecordedPlayerHandleEndBounceEffect(void);
|
||||
static void RecordedPlayerHandleSpriteInvisibility(void);
|
||||
static void RecordedPlayerHandleBattleAnimation(void);
|
||||
@ -160,7 +160,7 @@ static void (*const sRecordedPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void)
|
||||
RecordedPlayerHandleIntroSlide,
|
||||
RecordedPlayerHandleIntroTrainerBallThrow,
|
||||
RecordedPlayerHandleDrawPartyStatusSummary,
|
||||
RecordedPlayerHandleCmd49,
|
||||
RecordedPlayerHandleHidePartyStatusSummary,
|
||||
RecordedPlayerHandleEndBounceEffect,
|
||||
RecordedPlayerHandleSpriteInvisibility,
|
||||
RecordedPlayerHandleBattleAnimation,
|
||||
@ -1693,8 +1693,8 @@ static void RecordedPlayerHandleIntroTrainerBallThrow(void)
|
||||
taskId = CreateTask(sub_818CC24, 5);
|
||||
gTasks[taskId].data[0] = gActiveBattler;
|
||||
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = Task_HidePartyStatusSummary;
|
||||
|
||||
gBattleSpritesDataPtr->animationData->field_9_x1 = 1;
|
||||
gBattlerControllerFuncs[gActiveBattler] = nullsub_120;
|
||||
@ -1740,7 +1740,7 @@ static void RecordedPlayerHandleDrawPartyStatusSummary(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1 = 1;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown = 1;
|
||||
gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]);
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_5 = 0;
|
||||
|
||||
@ -1760,10 +1760,10 @@ static void sub_818CDF4(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void RecordedPlayerHandleCmd49(void)
|
||||
static void RecordedPlayerHandleHidePartyStatusSummary(void)
|
||||
{
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = Task_HidePartyStatusSummary;
|
||||
RecordedPlayerBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ static void SafariHandleFaintingCry(void);
|
||||
static void SafariHandleIntroSlide(void);
|
||||
static void SafariHandleIntroTrainerBallThrow(void);
|
||||
static void SafariHandleDrawPartyStatusSummary(void);
|
||||
static void SafariHandleCmd49(void);
|
||||
static void SafariHandleHidePartyStatusSummary(void);
|
||||
static void SafariHandleEndBounceEffect(void);
|
||||
static void SafariHandleSpriteInvisibility(void);
|
||||
static void SafariHandleBattleAnimation(void);
|
||||
@ -144,7 +144,7 @@ static void (*const sSafariBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
|
||||
SafariHandleIntroSlide,
|
||||
SafariHandleIntroTrainerBallThrow,
|
||||
SafariHandleDrawPartyStatusSummary,
|
||||
SafariHandleCmd49,
|
||||
SafariHandleHidePartyStatusSummary,
|
||||
SafariHandleEndBounceEffect,
|
||||
SafariHandleSpriteInvisibility,
|
||||
SafariHandleBattleAnimation,
|
||||
@ -645,7 +645,7 @@ static void SafariHandleDrawPartyStatusSummary(void)
|
||||
SafariBufferExecCompleted();
|
||||
}
|
||||
|
||||
static void SafariHandleCmd49(void)
|
||||
static void SafariHandleHidePartyStatusSummary(void)
|
||||
{
|
||||
SafariBufferExecCompleted();
|
||||
}
|
||||
|
@ -90,7 +90,7 @@ static void WallyHandleFaintingCry(void);
|
||||
static void WallyHandleIntroSlide(void);
|
||||
static void WallyHandleIntroTrainerBallThrow(void);
|
||||
static void WallyHandleDrawPartyStatusSummary(void);
|
||||
static void WallyHandleCmd49(void);
|
||||
static void WallyHandleHidePartyStatusSummary(void);
|
||||
static void WallyHandleEndBounceEffect(void);
|
||||
static void WallyHandleSpriteInvisibility(void);
|
||||
static void WallyHandleBattleAnimation(void);
|
||||
@ -159,7 +159,7 @@ static void (*const sWallyBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
|
||||
WallyHandleIntroSlide,
|
||||
WallyHandleIntroTrainerBallThrow,
|
||||
WallyHandleDrawPartyStatusSummary,
|
||||
WallyHandleCmd49,
|
||||
WallyHandleHidePartyStatusSummary,
|
||||
WallyHandleEndBounceEffect,
|
||||
WallyHandleSpriteInvisibility,
|
||||
WallyHandleBattleAnimation,
|
||||
@ -1450,8 +1450,8 @@ static void WallyHandleIntroTrainerBallThrow(void)
|
||||
taskId = CreateTask(sub_816AC04, 5);
|
||||
gTasks[taskId].data[0] = gActiveBattler;
|
||||
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8073C30;
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = Task_HidePartyStatusSummary;
|
||||
|
||||
gBattleSpritesDataPtr->animationData->field_9_x1 = 1;
|
||||
gBattlerControllerFuncs[gActiveBattler] = nullsub_21;
|
||||
@ -1511,13 +1511,13 @@ static void WallyHandleDrawPartyStatusSummary(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].flag_x1 = 1;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].partyStatusSummaryShown = 1;
|
||||
gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]);
|
||||
WallyBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
|
||||
static void WallyHandleCmd49(void)
|
||||
static void WallyHandleHidePartyStatusSummary(void)
|
||||
{
|
||||
WallyBufferExecCompleted();
|
||||
}
|
||||
|
@ -1449,17 +1449,17 @@ void BtlController_EmitDrawPartyStatusSummary(u8 bufferId, struct HpAndStatus* h
|
||||
sBattleBuffersTransferData[1] = arg2 & 0x7F;
|
||||
sBattleBuffersTransferData[2] = (arg2 & 0x80) >> 7;
|
||||
sBattleBuffersTransferData[3] = CONTROLLER_DRAWPARTYSTATUSSUMMARY;
|
||||
for (i = 0; i < (s32)(sizeof(struct HpAndStatus) * 6); i++)
|
||||
for (i = 0; i < (s32)(sizeof(struct HpAndStatus) * PARTY_SIZE); i++)
|
||||
sBattleBuffersTransferData[4 + i] = *(i + (u8*)(hpAndStatus));
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, sizeof(struct HpAndStatus) * 6 + 4);
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, sizeof(struct HpAndStatus) * PARTY_SIZE + 4);
|
||||
}
|
||||
|
||||
void BtlController_EmitCmd49(u8 bufferId)
|
||||
void BtlController_EmitHidePartyStatusSummary(u8 bufferId)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_49;
|
||||
sBattleBuffersTransferData[1] = CONTROLLER_49;
|
||||
sBattleBuffersTransferData[2] = CONTROLLER_49;
|
||||
sBattleBuffersTransferData[3] = CONTROLLER_49;
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_HIDEPARTYSTATUSSUMMARY;
|
||||
sBattleBuffersTransferData[1] = CONTROLLER_HIDEPARTYSTATUSSUMMARY;
|
||||
sBattleBuffersTransferData[2] = CONTROLLER_HIDEPARTYSTATUSSUMMARY;
|
||||
sBattleBuffersTransferData[3] = CONTROLLER_HIDEPARTYSTATUSSUMMARY;
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
|
||||
}
|
||||
|
||||
@ -1511,10 +1511,10 @@ void BtlController_EmitResetActionMoveSelection(u8 bufferId, u8 caseId)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 2);
|
||||
}
|
||||
|
||||
void BtlController_EmitCmd55(u8 bufferId, u8 arg1)
|
||||
void BtlController_EmitCmd55(u8 bufferId, u8 battleOutcome)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_55;
|
||||
sBattleBuffersTransferData[1] = arg1;
|
||||
sBattleBuffersTransferData[1] = battleOutcome;
|
||||
sBattleBuffersTransferData[2] = gSaveBlock2Ptr->field_CA9_b;
|
||||
sBattleBuffersTransferData[3] = gSaveBlock2Ptr->field_CA9_b;
|
||||
sBattleBuffersTransferData[5] = sBattleBuffersTransferData[4] = sub_81850DC(&sBattleBuffersTransferData[6]);
|
||||
|
@ -1695,7 +1695,7 @@ u8 CreatePartyStatusSummarySprites(u8 battlerId, struct HpAndStatus *partyInfo,
|
||||
return taskId;
|
||||
}
|
||||
|
||||
void sub_8073C30(u8 taskId)
|
||||
void Task_HidePartyStatusSummary(u8 taskId)
|
||||
{
|
||||
u8 ballIconSpriteIds[PARTY_SIZE];
|
||||
bool8 isBattleStart;
|
||||
@ -1707,7 +1707,7 @@ void sub_8073C30(u8 taskId)
|
||||
summaryBarSpriteId = gTasks[taskId].tSummaryBarSpriteId;
|
||||
battlerId = gTasks[taskId].tBattler;
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
for (i = 0; i < PARTY_SIZE; i++)
|
||||
ballIconSpriteIds[i] = gTasks[taskId].tBallIconSpriteId(i);
|
||||
|
||||
SetGpuReg(REG_OFFSET_BLDCNT, 0x3F40);
|
||||
@ -1755,12 +1755,12 @@ static void sub_8073E08(u8 taskId)
|
||||
{
|
||||
if ((gTasks[taskId].data[11]++ % 2) == 0)
|
||||
{
|
||||
if (--gTasks[taskId].data[15] < 0)
|
||||
if (--gTasks[taskId].tData15 < 0)
|
||||
return;
|
||||
|
||||
SetGpuReg(REG_OFFSET_BLDALPHA, (gTasks[taskId].data[15]) | ((16 - gTasks[taskId].data[15]) << 8));
|
||||
}
|
||||
if (gTasks[taskId].data[15] == 0)
|
||||
if (gTasks[taskId].tData15 == 0)
|
||||
gTasks[taskId].func = sub_8073E64;
|
||||
}
|
||||
|
||||
@ -1796,7 +1796,7 @@ static void sub_8073E64(u8 taskId)
|
||||
}
|
||||
else if (gTasks[taskId].tData15 == -3)
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[battlerId].flag_x1 = 0;
|
||||
gBattleSpritesDataPtr->healthBoxesData[battlerId].partyStatusSummaryShown = 0;
|
||||
SetGpuReg(REG_OFFSET_BLDCNT, 0);
|
||||
SetGpuReg(REG_OFFSET_BLDALPHA, 0);
|
||||
DestroyTask(taskId);
|
||||
@ -1828,7 +1828,7 @@ static void sub_8073F98(u8 taskId)
|
||||
}
|
||||
else if (gTasks[taskId].tData15 == -3)
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[battlerId].flag_x1 = 0;
|
||||
gBattleSpritesDataPtr->healthBoxesData[battlerId].partyStatusSummaryShown = 0;
|
||||
SetGpuReg(REG_OFFSET_BLDCNT, 0);
|
||||
SetGpuReg(REG_OFFSET_BLDALPHA, 0);
|
||||
DestroyTask(taskId);
|
||||
|
@ -82,7 +82,7 @@ extern struct MusicPlayerInfo gMPlayInfo_SE1;
|
||||
extern struct MusicPlayerInfo gMPlayInfo_SE2;
|
||||
extern u8 gUnknown_0203CF00[];
|
||||
|
||||
extern const u16 gBattleTextboxPalette[]; // battle textbox palette
|
||||
extern const u16 gBattleTextboxPalette[];
|
||||
extern const struct BgTemplate gBattleBgTemplates[];
|
||||
extern const struct WindowTemplate *const gBattleWindowTemplates[];
|
||||
extern const u8 gUnknown_0831ACE0[];
|
||||
@ -206,7 +206,7 @@ EWRAM_DATA u8 gBattlersCount = 0;
|
||||
EWRAM_DATA u16 gBattlerPartyIndexes[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u8 gBattlerPositions[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u8 gActionsByTurnOrder[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u8 gBattleTurnOrder[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u8 gBattlerByTurnOrder[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA u8 gCurrentTurnActionNumber = 0;
|
||||
EWRAM_DATA u8 gCurrentActionFuncId = 0;
|
||||
EWRAM_DATA struct BattlePokemon gBattleMons[MAX_BATTLERS_COUNT] = {0};
|
||||
@ -3067,7 +3067,7 @@ static void BattleStartClearSetData(void)
|
||||
|
||||
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
|
||||
{
|
||||
*(gBattleStruct->AI_monToSwitchIntoId + i) = 6;
|
||||
*(gBattleStruct->AI_monToSwitchIntoId + i) = PARTY_SIZE;
|
||||
}
|
||||
|
||||
gBattleStruct->field_DF = 0;
|
||||
@ -3079,7 +3079,7 @@ static void BattleStartClearSetData(void)
|
||||
for (i = 0; i < sizeof(struct BattleResults); i++)
|
||||
dataPtr[i] = 0;
|
||||
|
||||
gBattleResults.unk5_6 = IsMonShiny(&gEnemyParty[0]);
|
||||
gBattleResults.shinyWildMon = IsMonShiny(&gEnemyParty[0]);
|
||||
|
||||
gBattleStruct->field_2A0 = 0;
|
||||
gBattleStruct->field_2A1 = 0;
|
||||
@ -3427,7 +3427,7 @@ static void BattleIntroDrawTrainersOrMonsSprites(void)
|
||||
static void BattleIntroDrawPartySummaryScreens(void)
|
||||
{
|
||||
s32 i;
|
||||
struct HpAndStatus hpStatus[6];
|
||||
struct HpAndStatus hpStatus[PARTY_SIZE];
|
||||
|
||||
if (gBattleControllerExecFlags)
|
||||
return;
|
||||
@ -3478,7 +3478,7 @@ static void BattleIntroDrawPartySummaryScreens(void)
|
||||
// wild battles don't show the party summary.
|
||||
// Still, there's no point in having dead code.
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
for (i = 0; i < PARTY_SIZE; i++)
|
||||
{
|
||||
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) == SPECIES_NONE
|
||||
|| GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2) == SPECIES_EGG)
|
||||
@ -3848,12 +3848,12 @@ static void TryDoEventsBeforeFirstTurn(void)
|
||||
if (gBattleStruct->switchInAbilitiesCounter == 0)
|
||||
{
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
gBattleTurnOrder[i] = i;
|
||||
gBattlerByTurnOrder[i] = i;
|
||||
for (i = 0; i < gBattlersCount - 1; i++)
|
||||
{
|
||||
for (j = i + 1; j < gBattlersCount; j++)
|
||||
{
|
||||
if (GetWhoStrikesFirst(gBattleTurnOrder[i], gBattleTurnOrder[j], TRUE) != 0)
|
||||
if (GetWhoStrikesFirst(gBattlerByTurnOrder[i], gBattlerByTurnOrder[j], TRUE) != 0)
|
||||
SwapTurnOrder(i, j);
|
||||
}
|
||||
}
|
||||
@ -3864,10 +3864,10 @@ static void TryDoEventsBeforeFirstTurn(void)
|
||||
gBattleStruct->overworldWeatherDone = TRUE;
|
||||
return;
|
||||
}
|
||||
// check all switch in abilities happening from the fastest mon to slowest
|
||||
// Check all switch in abilities happening from the fastest mon to slowest.
|
||||
while (gBattleStruct->switchInAbilitiesCounter < gBattlersCount)
|
||||
{
|
||||
if (AbilityBattleEffects(ABILITYEFFECT_ON_SWITCHIN, gBattleTurnOrder[gBattleStruct->switchInAbilitiesCounter], 0, 0, 0) != 0)
|
||||
if (AbilityBattleEffects(ABILITYEFFECT_ON_SWITCHIN, gBattlerByTurnOrder[gBattleStruct->switchInAbilitiesCounter], 0, 0, 0) != 0)
|
||||
effect++;
|
||||
|
||||
gBattleStruct->switchInAbilitiesCounter++;
|
||||
@ -3879,10 +3879,10 @@ static void TryDoEventsBeforeFirstTurn(void)
|
||||
return;
|
||||
if (AbilityBattleEffects(ABILITYEFFECT_TRACE, 0, 0, 0, 0) != 0)
|
||||
return;
|
||||
// check all switch in items having effect from the fastest mon to slowest
|
||||
// Check all switch in items having effect from the fastest mon to slowest.
|
||||
while (gBattleStruct->switchInItemsCounter < gBattlersCount)
|
||||
{
|
||||
if (ItemBattleEffects(ITEMEFFECT_ON_SWITCH_IN, gBattleTurnOrder[gBattleStruct->switchInItemsCounter], 0) != 0)
|
||||
if (ItemBattleEffects(ITEMEFFECT_ON_SWITCH_IN, gBattlerByTurnOrder[gBattleStruct->switchInItemsCounter], 0) != 0)
|
||||
effect++;
|
||||
|
||||
gBattleStruct->switchInItemsCounter++;
|
||||
@ -3892,7 +3892,7 @@ static void TryDoEventsBeforeFirstTurn(void)
|
||||
}
|
||||
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
|
||||
{
|
||||
*(gBattleStruct->monToSwitchIntoId + i) = 6;
|
||||
*(gBattleStruct->monToSwitchIntoId + i) = PARTY_SIZE;
|
||||
gChosenActionByBattler[i] = B_ACTION_NONE;
|
||||
gChosenMoveByBattler[i] = MOVE_NONE;
|
||||
}
|
||||
@ -3958,15 +3958,15 @@ void BattleTurnPassed(void)
|
||||
TurnValuesCleanUp(TRUE);
|
||||
if (gBattleOutcome == 0)
|
||||
{
|
||||
if (UpdateTurnCounters() != 0)
|
||||
if (UpdateTurnCounters())
|
||||
return;
|
||||
if (TurnBasedEffects() != 0)
|
||||
if (TurnBasedEffects())
|
||||
return;
|
||||
}
|
||||
if (HandleFaintedMonActions() != 0)
|
||||
if (HandleFaintedMonActions())
|
||||
return;
|
||||
gBattleStruct->faintedActionsState = 0;
|
||||
if (HandleWishPerishSongOnTurnEnd() != 0)
|
||||
if (HandleWishPerishSongOnTurnEnd())
|
||||
return;
|
||||
|
||||
TurnValuesCleanUp(FALSE);
|
||||
@ -4003,7 +4003,7 @@ void BattleTurnPassed(void)
|
||||
}
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
*(gBattleStruct->monToSwitchIntoId + i) = 6;
|
||||
*(gBattleStruct->monToSwitchIntoId + i) = PARTY_SIZE;
|
||||
|
||||
*(&gBattleStruct->field_91) = gAbsentBattlerFlags;
|
||||
BattlePutTextOnWindow(gText_EmptyString3, 0);
|
||||
@ -4141,11 +4141,11 @@ static void HandleTurnActionSelectionState(void)
|
||||
gBattleCommunication[gActiveBattler] = STATE_BEFORE_ACTION_CHOSEN;
|
||||
break;
|
||||
case STATE_BEFORE_ACTION_CHOSEN: // choose an action
|
||||
*(gBattleStruct->monToSwitchIntoId + gActiveBattler) = 6;
|
||||
*(gBattleStruct->monToSwitchIntoId + gActiveBattler) = PARTY_SIZE;
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_MULTI
|
||||
|| !(position & BIT_FLANK)
|
||||
|| (position & BIT_FLANK) == B_FLANK_LEFT
|
||||
|| gBattleStruct->field_91 & gBitTable[GetBattlerAtPosition(BATTLE_PARTNER(position))]
|
||||
|| gBattleCommunication[GetBattlerAtPosition(BATTLE_PARTNER(position))] == 5)
|
||||
|| gBattleCommunication[GetBattlerAtPosition(BATTLE_PARTNER(position))] == STATE_WAIT_ACTION_CONFIRMED)
|
||||
{
|
||||
if (gBattleStruct->field_91 & gBitTable[gActiveBattler])
|
||||
{
|
||||
@ -4415,7 +4415,7 @@ static void HandleTurnActionSelectionState(void)
|
||||
}
|
||||
break;
|
||||
case B_ACTION_SWITCH:
|
||||
if (gBattleBufferB[gActiveBattler][1] == 6)
|
||||
if (gBattleBufferB[gActiveBattler][1] == PARTY_SIZE)
|
||||
{
|
||||
gBattleCommunication[gActiveBattler] = 1;
|
||||
RecordedBattle_ClearBattlerAction(gActiveBattler, 1);
|
||||
@ -4591,9 +4591,9 @@ void SwapTurnOrder(u8 id1, u8 id2)
|
||||
gActionsByTurnOrder[id1] = gActionsByTurnOrder[id2];
|
||||
gActionsByTurnOrder[id2] = temp;
|
||||
|
||||
temp = gBattleTurnOrder[id1];
|
||||
gBattleTurnOrder[id1] = gBattleTurnOrder[id2];
|
||||
gBattleTurnOrder[id2] = temp;
|
||||
temp = gBattlerByTurnOrder[id1];
|
||||
gBattlerByTurnOrder[id1] = gBattlerByTurnOrder[id2];
|
||||
gBattlerByTurnOrder[id2] = temp;
|
||||
}
|
||||
|
||||
u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves)
|
||||
@ -4753,16 +4753,16 @@ u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves)
|
||||
|
||||
static void SetActionsAndBattlersTurnOrder(void)
|
||||
{
|
||||
s32 var = 0;
|
||||
s32 turnOrderId = 0;
|
||||
s32 i, j;
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_SAFARI)
|
||||
{
|
||||
for (gActiveBattler = 0; gActiveBattler < gBattlersCount; gActiveBattler++)
|
||||
{
|
||||
gActionsByTurnOrder[var] = gChosenActionByBattler[gActiveBattler];
|
||||
gBattleTurnOrder[var] = gActiveBattler;
|
||||
var++;
|
||||
gActionsByTurnOrder[turnOrderId] = gChosenActionByBattler[gActiveBattler];
|
||||
gBattlerByTurnOrder[turnOrderId] = gActiveBattler;
|
||||
turnOrderId++;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -4773,7 +4773,7 @@ static void SetActionsAndBattlersTurnOrder(void)
|
||||
{
|
||||
if (gChosenActionByBattler[gActiveBattler] == B_ACTION_RUN)
|
||||
{
|
||||
var = 5;
|
||||
turnOrderId = 5;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -4783,27 +4783,27 @@ static void SetActionsAndBattlersTurnOrder(void)
|
||||
if (gChosenActionByBattler[0] == B_ACTION_RUN)
|
||||
{
|
||||
gActiveBattler = 0;
|
||||
var = 5;
|
||||
turnOrderId = 5;
|
||||
}
|
||||
if (gChosenActionByBattler[2] == B_ACTION_RUN)
|
||||
{
|
||||
gActiveBattler = 2;
|
||||
var = 5;
|
||||
turnOrderId = 5;
|
||||
}
|
||||
}
|
||||
|
||||
if (var == 5)
|
||||
if (turnOrderId == 5) // One of battlers wants to run.
|
||||
{
|
||||
gActionsByTurnOrder[0] = gChosenActionByBattler[gActiveBattler];
|
||||
gBattleTurnOrder[0] = gActiveBattler;
|
||||
var = 1;
|
||||
gBattlerByTurnOrder[0] = gActiveBattler;
|
||||
turnOrderId = 1;
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
{
|
||||
if (i != gActiveBattler)
|
||||
{
|
||||
gActionsByTurnOrder[var] = gChosenActionByBattler[i];
|
||||
gBattleTurnOrder[var] = i;
|
||||
var++;
|
||||
gActionsByTurnOrder[turnOrderId] = gChosenActionByBattler[i];
|
||||
gBattlerByTurnOrder[turnOrderId] = i;
|
||||
turnOrderId++;
|
||||
}
|
||||
}
|
||||
gBattleMainFunc = CheckFocusPunch_ClearVarsBeforeTurnStarts;
|
||||
@ -4816,26 +4816,26 @@ static void SetActionsAndBattlersTurnOrder(void)
|
||||
{
|
||||
if (gChosenActionByBattler[gActiveBattler] == B_ACTION_USE_ITEM || gChosenActionByBattler[gActiveBattler] == B_ACTION_SWITCH)
|
||||
{
|
||||
gActionsByTurnOrder[var] = gChosenActionByBattler[gActiveBattler];
|
||||
gBattleTurnOrder[var] = gActiveBattler;
|
||||
var++;
|
||||
gActionsByTurnOrder[turnOrderId] = gChosenActionByBattler[gActiveBattler];
|
||||
gBattlerByTurnOrder[turnOrderId] = gActiveBattler;
|
||||
turnOrderId++;
|
||||
}
|
||||
}
|
||||
for (gActiveBattler = 0; gActiveBattler < gBattlersCount; gActiveBattler++)
|
||||
{
|
||||
if (gChosenActionByBattler[gActiveBattler] != B_ACTION_USE_ITEM && gChosenActionByBattler[gActiveBattler] != B_ACTION_SWITCH)
|
||||
{
|
||||
gActionsByTurnOrder[var] = gChosenActionByBattler[gActiveBattler];
|
||||
gBattleTurnOrder[var] = gActiveBattler;
|
||||
var++;
|
||||
gActionsByTurnOrder[turnOrderId] = gChosenActionByBattler[gActiveBattler];
|
||||
gBattlerByTurnOrder[turnOrderId] = gActiveBattler;
|
||||
turnOrderId++;
|
||||
}
|
||||
}
|
||||
for (i = 0; i < gBattlersCount - 1; i++)
|
||||
{
|
||||
for (j = i + 1; j < gBattlersCount; j++)
|
||||
{
|
||||
u8 battler1 = gBattleTurnOrder[i];
|
||||
u8 battler2 = gBattleTurnOrder[j];
|
||||
u8 battler1 = gBattlerByTurnOrder[i];
|
||||
u8 battler2 = gBattlerByTurnOrder[j];
|
||||
if (gActionsByTurnOrder[i] != B_ACTION_USE_ITEM
|
||||
&& gActionsByTurnOrder[j] != B_ACTION_USE_ITEM
|
||||
&& gActionsByTurnOrder[i] != B_ACTION_SWITCH
|
||||
@ -5136,7 +5136,7 @@ static void HandleEndTurn_FinishBattle(void)
|
||||
| BATTLE_TYPE_FRONTIER
|
||||
| BATTLE_TYPE_EREADER_TRAINER
|
||||
| BATTLE_TYPE_WALLY_TUTORIAL))
|
||||
&& gBattleResults.unk5_6)
|
||||
&& gBattleResults.shinyWildMon)
|
||||
{
|
||||
sub_80EE184();
|
||||
}
|
||||
@ -5268,7 +5268,7 @@ static void HandleAction_UseMove(void)
|
||||
u8 side;
|
||||
u8 var = 4;
|
||||
|
||||
gBattlerAttacker = gBattleTurnOrder[gCurrentTurnActionNumber];
|
||||
gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber];
|
||||
|
||||
if (*(&gBattleStruct->field_91) & gBitTable[gBattlerAttacker])
|
||||
{
|
||||
@ -5400,7 +5400,7 @@ static void HandleAction_UseMove(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
gActiveBattler = gBattleTurnOrder[var];
|
||||
gActiveBattler = gBattlerByTurnOrder[var];
|
||||
RecordAbilityBattle(gActiveBattler, gBattleMons[gActiveBattler].ability);
|
||||
gSpecialStatuses[gActiveBattler].lightningRodRedirected = 1;
|
||||
gBattlerTarget = gActiveBattler;
|
||||
@ -5482,7 +5482,7 @@ static void HandleAction_UseMove(void)
|
||||
|
||||
static void HandleAction_Switch(void)
|
||||
{
|
||||
gBattlerAttacker = gBattleTurnOrder[gCurrentTurnActionNumber];
|
||||
gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber];
|
||||
gBattle_BG0_X = 0;
|
||||
gBattle_BG0_Y = 0;
|
||||
gActionSelectionCursor[gBattlerAttacker] = 0;
|
||||
@ -5500,7 +5500,7 @@ static void HandleAction_Switch(void)
|
||||
|
||||
static void HandleAction_UseItem(void)
|
||||
{
|
||||
gBattlerAttacker = gBattlerTarget = gBattleTurnOrder[gCurrentTurnActionNumber];
|
||||
gBattlerAttacker = gBattlerTarget = gBattlerByTurnOrder[gCurrentTurnActionNumber];
|
||||
gBattle_BG0_X = 0;
|
||||
gBattle_BG0_Y = 0;
|
||||
ClearFuryCutterDestinyBondGrudge(gBattlerAttacker);
|
||||
@ -5659,7 +5659,7 @@ bool8 TryRunFromBattle(u8 battler)
|
||||
|
||||
static void HandleAction_Run(void)
|
||||
{
|
||||
gBattlerAttacker = gBattleTurnOrder[gCurrentTurnActionNumber];
|
||||
gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber];
|
||||
|
||||
if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000))
|
||||
{
|
||||
@ -5713,7 +5713,7 @@ static void HandleAction_Run(void)
|
||||
|
||||
static void HandleAction_WatchesCarefully(void)
|
||||
{
|
||||
gBattlerAttacker = gBattleTurnOrder[gCurrentTurnActionNumber];
|
||||
gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber];
|
||||
gBattle_BG0_X = 0;
|
||||
gBattle_BG0_Y = 0;
|
||||
gBattlescriptCurrInstr = gBattlescriptsForSafariActions[0];
|
||||
@ -5722,7 +5722,7 @@ static void HandleAction_WatchesCarefully(void)
|
||||
|
||||
static void HandleAction_SafariZoneBallThrow(void)
|
||||
{
|
||||
gBattlerAttacker = gBattleTurnOrder[gCurrentTurnActionNumber];
|
||||
gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber];
|
||||
gBattle_BG0_X = 0;
|
||||
gBattle_BG0_Y = 0;
|
||||
gNumSafariBalls--;
|
||||
@ -5733,14 +5733,14 @@ static void HandleAction_SafariZoneBallThrow(void)
|
||||
|
||||
static void HandleAction_ThrowPokeblock(void)
|
||||
{
|
||||
gBattlerAttacker = gBattleTurnOrder[gCurrentTurnActionNumber];
|
||||
gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber];
|
||||
gBattle_BG0_X = 0;
|
||||
gBattle_BG0_Y = 0;
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = gBattleBufferB[gBattlerAttacker][1] - 1;
|
||||
gLastUsedItem = gBattleBufferB[gBattlerAttacker][2];
|
||||
|
||||
if (gBattleResults.field_1F < 0xFF)
|
||||
gBattleResults.field_1F++;
|
||||
if (gBattleResults.pokeblockThrows < 0xFF)
|
||||
gBattleResults.pokeblockThrows++;
|
||||
if (gBattleStruct->field_7A < 3)
|
||||
gBattleStruct->field_7A++;
|
||||
if (gBattleStruct->field_7B > 1)
|
||||
@ -5757,7 +5757,7 @@ static void HandleAction_ThrowPokeblock(void)
|
||||
|
||||
static void HandleAction_GoNear(void)
|
||||
{
|
||||
gBattlerAttacker = gBattleTurnOrder[gCurrentTurnActionNumber];
|
||||
gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber];
|
||||
gBattle_BG0_X = 0;
|
||||
gBattle_BG0_Y = 0;
|
||||
|
||||
@ -5784,7 +5784,7 @@ static void HandleAction_GoNear(void)
|
||||
|
||||
static void HandleAction_SafriZoneRun(void)
|
||||
{
|
||||
gBattlerAttacker = gBattleTurnOrder[gCurrentTurnActionNumber];
|
||||
gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber];
|
||||
PlaySE(SE_NIGERU);
|
||||
gCurrentTurnActionNumber = gBattlersCount;
|
||||
gBattleOutcome = B_OUTCOME_RAN;
|
||||
@ -5792,7 +5792,7 @@ static void HandleAction_SafriZoneRun(void)
|
||||
|
||||
static void HandleAction_WallyBallThrow(void)
|
||||
{
|
||||
gBattlerAttacker = gBattleTurnOrder[gCurrentTurnActionNumber];
|
||||
gBattlerAttacker = gBattlerByTurnOrder[gCurrentTurnActionNumber];
|
||||
gBattle_BG0_X = 0;
|
||||
gBattle_BG0_Y = 0;
|
||||
|
||||
@ -5825,7 +5825,7 @@ static void HandleAction_NothingIsFainted(void)
|
||||
|
||||
static void HandleAction_ActionFinished(void)
|
||||
{
|
||||
*(gBattleStruct->monToSwitchIntoId + gBattleTurnOrder[gCurrentTurnActionNumber]) = 6;
|
||||
*(gBattleStruct->monToSwitchIntoId + gBattlerByTurnOrder[gCurrentTurnActionNumber]) = 6;
|
||||
gCurrentTurnActionNumber++;
|
||||
gCurrentActionFuncId = gActionsByTurnOrder[gCurrentTurnActionNumber];
|
||||
SpecialStatusesClear();
|
||||
|
@ -188,7 +188,7 @@ static void atk5E(void);
|
||||
static void atk5F(void);
|
||||
static void atk60_incrementgamestat(void);
|
||||
static void atk61_drawpartystatussummary(void);
|
||||
static void atk62(void);
|
||||
static void atk62_hidepartystatussummary(void);
|
||||
static void atk63_jumptorandomattack(void);
|
||||
static void atk64_statusanimation(void);
|
||||
static void atk65_status2animation(void);
|
||||
@ -440,7 +440,7 @@ void (* const gBattleScriptingCommandsTable[])(void) =
|
||||
atk5F,
|
||||
atk60_incrementgamestat,
|
||||
atk61_drawpartystatussummary,
|
||||
atk62,
|
||||
atk62_hidepartystatussummary,
|
||||
atk63_jumptorandomattack,
|
||||
atk64_statusanimation,
|
||||
atk65_status2animation,
|
||||
@ -989,11 +989,11 @@ static void atk00_attackcanceler(void)
|
||||
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
{
|
||||
if ((gProtectStructs[gBattleTurnOrder[i]].stealMove) && gBattleMoves[gCurrentMove].flags & FLAG_SNATCH_AFFECTED)
|
||||
if ((gProtectStructs[gBattlerByTurnOrder[i]].stealMove) && gBattleMoves[gCurrentMove].flags & FLAG_SNATCH_AFFECTED)
|
||||
{
|
||||
PressurePPLose(gBattlerAttacker, gBattleTurnOrder[i], MOVE_SNATCH);
|
||||
gProtectStructs[gBattleTurnOrder[i]].stealMove = 0;
|
||||
gBattleScripting.battler = gBattleTurnOrder[i];
|
||||
PressurePPLose(gBattlerAttacker, gBattlerByTurnOrder[i], MOVE_SNATCH);
|
||||
gProtectStructs[gBattlerByTurnOrder[i]].stealMove = 0;
|
||||
gBattleScripting.battler = gBattlerByTurnOrder[i];
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_SnatchedMove;
|
||||
return;
|
||||
@ -2216,7 +2216,7 @@ u8 GetBattlerTurnOrderNum(u8 battlerId)
|
||||
s32 i;
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
{
|
||||
if (gBattleTurnOrder[i] == battlerId)
|
||||
if (gBattlerByTurnOrder[i] == battlerId)
|
||||
break;
|
||||
}
|
||||
return i;
|
||||
@ -5556,7 +5556,7 @@ static void atk52_switchineffects(void)
|
||||
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
{
|
||||
if (gBattleTurnOrder[i] == gActiveBattler)
|
||||
if (gBattlerByTurnOrder[i] == gActiveBattler)
|
||||
gActionsByTurnOrder[i] = B_ACTION_CANCEL_PARTNER;
|
||||
}
|
||||
|
||||
@ -6021,10 +6021,10 @@ static void atk61_drawpartystatussummary(void)
|
||||
gBattlescriptCurrInstr += 2;
|
||||
}
|
||||
|
||||
static void atk62(void)
|
||||
static void atk62_hidepartystatussummary(void)
|
||||
{
|
||||
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||
BtlController_EmitCmd49(0);
|
||||
BtlController_EmitHidePartyStatusSummary(0);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
|
||||
gBattlescriptCurrInstr += 2;
|
||||
@ -8957,7 +8957,7 @@ static void atkBA_jumpifnopursuitswitchdmg(void)
|
||||
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
{
|
||||
if (gBattleTurnOrder[i] == gBattlerTarget)
|
||||
if (gBattlerByTurnOrder[i] == gBattlerTarget)
|
||||
gActionsByTurnOrder[i] = 11;
|
||||
}
|
||||
|
||||
|
@ -511,14 +511,14 @@ u8 UpdateTurnCounters(void)
|
||||
case 0:
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
{
|
||||
gBattleTurnOrder[i] = i;
|
||||
gBattlerByTurnOrder[i] = i;
|
||||
}
|
||||
for (i = 0; i < gBattlersCount - 1; i++)
|
||||
{
|
||||
s32 j;
|
||||
for (j = i + 1; j < gBattlersCount; j++)
|
||||
{
|
||||
if (GetWhoStrikesFirst(gBattleTurnOrder[i], gBattleTurnOrder[j], 0))
|
||||
if (GetWhoStrikesFirst(gBattlerByTurnOrder[i], gBattlerByTurnOrder[j], 0))
|
||||
SwapTurnOrder(i, j);
|
||||
}
|
||||
}
|
||||
@ -632,7 +632,7 @@ u8 UpdateTurnCounters(void)
|
||||
case 5:
|
||||
while (gBattleStruct->turnSideTracker < gBattlersCount)
|
||||
{
|
||||
gActiveBattler = gBattleTurnOrder[gBattleStruct->turnSideTracker];
|
||||
gActiveBattler = gBattlerByTurnOrder[gBattleStruct->turnSideTracker];
|
||||
if (gWishFutureKnock.wishCounter[gActiveBattler] != 0
|
||||
&& --gWishFutureKnock.wishCounter[gActiveBattler] == 0
|
||||
&& gBattleMons[gActiveBattler].hp != 0)
|
||||
@ -755,7 +755,7 @@ u8 TurnBasedEffects(void)
|
||||
gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_x20);
|
||||
while (gBattleStruct->turnEffectsBattlerId < gBattlersCount && gBattleStruct->turnEffectsTracker <= TURNBASED_MAX_CASE)
|
||||
{
|
||||
gActiveBattler = gBattlerAttacker = gBattleTurnOrder[gBattleStruct->turnEffectsBattlerId];
|
||||
gActiveBattler = gBattlerAttacker = gBattlerByTurnOrder[gBattleStruct->turnEffectsBattlerId];
|
||||
if (gAbsentBattlerFlags & gBitTable[gActiveBattler])
|
||||
{
|
||||
gBattleStruct->turnEffectsBattlerId++;
|
||||
@ -1121,7 +1121,7 @@ bool8 HandleWishPerishSongOnTurnEnd(void)
|
||||
case 1:
|
||||
while (gBattleStruct->wishPerishSongBattlerId < gBattlersCount)
|
||||
{
|
||||
gActiveBattler = gBattlerAttacker = gBattleTurnOrder[gBattleStruct->wishPerishSongBattlerId];
|
||||
gActiveBattler = gBattlerAttacker = gBattlerByTurnOrder[gBattleStruct->wishPerishSongBattlerId];
|
||||
if (gAbsentBattlerFlags & gBitTable[gActiveBattler])
|
||||
{
|
||||
gBattleStruct->wishPerishSongBattlerId++;
|
||||
|
@ -42,7 +42,7 @@ extern void PlayerGetDestCoords(s16* x, s16* y);
|
||||
EWRAM_DATA u8 gNumSafariBalls = 0;
|
||||
EWRAM_DATA static u16 sSafariZoneStepCounter = 0;
|
||||
EWRAM_DATA static u8 sSafariZoneCaughtMons = 0;
|
||||
EWRAM_DATA static u8 sSafariZoneFleedMons = 0;
|
||||
EWRAM_DATA static u8 sSafariZonePkblkUses = 0;
|
||||
EWRAM_DATA static struct PokeblockFeeder sPokeblockFeeders[NUM_POKEBLOCK_FEEDERS] = {0};
|
||||
|
||||
static void ClearAllPokeblockFeeders(void);
|
||||
@ -71,12 +71,12 @@ void EnterSafariMode(void)
|
||||
gNumSafariBalls = 30;
|
||||
sSafariZoneStepCounter = 500;
|
||||
sSafariZoneCaughtMons = 0;
|
||||
sSafariZoneFleedMons = 0;
|
||||
sSafariZonePkblkUses = 0;
|
||||
}
|
||||
|
||||
void ExitSafariMode(void)
|
||||
{
|
||||
sub_80EE44C(sSafariZoneCaughtMons, sSafariZoneFleedMons);
|
||||
sub_80EE44C(sSafariZoneCaughtMons, sSafariZonePkblkUses);
|
||||
ResetSafariZoneFlag();
|
||||
ClearAllPokeblockFeeders();
|
||||
gNumSafariBalls = 0;
|
||||
@ -107,7 +107,7 @@ void SafariZoneRetirePrompt(void)
|
||||
|
||||
void CB2_EndSafariBattle(void)
|
||||
{
|
||||
sSafariZoneFleedMons += gBattleResults.field_1F;
|
||||
sSafariZonePkblkUses += gBattleResults.pokeblockThrows;
|
||||
if (gBattleOutcome == B_OUTCOME_CAUGHT)
|
||||
sSafariZoneCaughtMons++;
|
||||
if (gNumSafariBalls != 0)
|
||||
@ -172,7 +172,7 @@ void GetPokeblockFeederWithinRange(void)
|
||||
{
|
||||
if (gSaveBlock1Ptr->location.mapNum == sPokeblockFeeders[i].mapNum)
|
||||
{
|
||||
//Get absolute value of x and y distance from Pokeblock feeder on current map
|
||||
// Get absolute value of x and y distance from Pokeblock feeder on current map.
|
||||
x -= sPokeblockFeeders[i].x;
|
||||
y -= sPokeblockFeeders[i].y;
|
||||
if (x < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user