mirror of
https://github.com/pret/pokeruby.git
synced 2026-03-21 17:54:19 -05:00
Port Wally Controller documentation from pokeemerald (#891)
Some checks failed
CI / build (push) Has been cancelled
Some checks failed
CI / build (push) Has been cancelled
This commit is contained in:
parent
7e4a1a3923
commit
f6e2a5901e
|
|
@ -385,10 +385,10 @@ struct BattleStruct /* 0x2000000 */
|
|||
/*0x160A5*/ u8 animArg2;
|
||||
/*0x160A6*/ u8 unk160A6; // related to gAbsentBattlerFlags, possibly absent flags turn ago?
|
||||
/*0x160A7*/ u8 unk160A7;
|
||||
/*0x160A8*/ u8 unk160A8;
|
||||
/*0x160A9*/ u8 unk160A9;
|
||||
/*0x160AA*/ u8 unk160AA;
|
||||
/*0x160AB*/ u8 unk160AB;
|
||||
/*0x160A8*/ u8 wallyBattleState;
|
||||
/*0x160A9*/ u8 wallyMovesState;
|
||||
/*0x160AA*/ u8 wallyWaitFrames;
|
||||
/*0x160AB*/ u8 wallyMoveFrames;
|
||||
/*0x160AC*/ u16 lastTakenMove[2 * 2 * 2];
|
||||
/*0x160BC*/ u16 HP_OnSwitchout[2];
|
||||
/*0x160C0*/ u8 abilityPreventingSwitchout;
|
||||
|
|
@ -443,27 +443,27 @@ struct BattleSpriteInfo
|
|||
{
|
||||
u8 invisible:1;
|
||||
u8 lowHpSong:1;
|
||||
u8 substituteSprite:1;
|
||||
u8 behindSubstitute:1;
|
||||
u8 flag_x8:1;
|
||||
u8 hpNumbersNoBars:1;
|
||||
u16 transformedSpecies;
|
||||
u16 transformSpecies;
|
||||
};
|
||||
|
||||
struct Struct2017810
|
||||
struct BattleHealthboxInfo
|
||||
{
|
||||
/*0x00*/ u8 unk0_0:1;
|
||||
/*0x00*/ u8 partyStatusSummaryShown:1;
|
||||
/*0x00*/ u8 unk0_1:1;
|
||||
/*0x00*/ u8 unk0_2:1;
|
||||
/*0x00*/ u8 unk0_3:1;
|
||||
/*0x00*/ u8 unk0_4:1;
|
||||
/*0x00*/ u8 unk0_5:1;
|
||||
/*0x00*/ u8 unk0_6:1;
|
||||
/*0x00*/ u8 unk0_7:1;
|
||||
/*0x01*/ u8 unk1_0:1;
|
||||
/*0x00*/ u8 ballAnimActive:1;
|
||||
/*0x00*/ u8 statusAnimActive:1;
|
||||
/*0x00*/ u8 animFromTableActive:1;
|
||||
/*0x00*/ u8 specialAnimActive:1;
|
||||
/*0x00*/ u8 triedShinyMonAnim:1;
|
||||
/*0x01*/ u8 finishedShinyMonAnim:1;
|
||||
/*0x01*/ u8 unk1_1:5;
|
||||
/*0x02*/ u8 unk2;
|
||||
/*0x03*/ u8 unk3;
|
||||
/*0x04*/ u8 unk4;
|
||||
/*0x04*/ u8 animationState;
|
||||
/*0x05*/ u8 unk5;
|
||||
/*0x06*/ u8 unk6;
|
||||
/*0x07*/ u8 unk7;
|
||||
|
|
@ -685,20 +685,20 @@ u8 TypeCalc(u16 move, u8 bank_atk, u8 bank_def);
|
|||
u8 GetBattlerTurnOrderNum(u8 bank);
|
||||
|
||||
// asm/battle_5.o
|
||||
void nullsub_91(void);
|
||||
void BattleControllerDummy(void);
|
||||
void SetBankFuncToPlayerBufferRunCommand(void);
|
||||
void sub_802C098();
|
||||
void c3_0802FDF4(u8);
|
||||
void Task_PlayerController_RestoreBgmAfterCry(u8);
|
||||
void sub_802E3E4(u8, int);
|
||||
void nullsub_8(u8);
|
||||
void sub_802E414(void);
|
||||
void sub_802E424(void);
|
||||
|
||||
// asm/battle_7.o
|
||||
void move_anim_start_t4(u8 a, u8 b, u8 c, u8 d);
|
||||
void InitAndLaunchSpecialAnimation(u8 a, u8 b, u8 c, u8 d);
|
||||
void nullsub_9(u16);
|
||||
void nullsub_10(int);
|
||||
void load_gfxc_health_bar(u8);
|
||||
void LoadBattleBarGfx(u8);
|
||||
u8 battle_load_something();
|
||||
void sub_8031F88(u8);
|
||||
void HandleLowHpMusicChange(struct Pokemon *, u8);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#ifndef GUARD_BATTLE_ANIM_8137220_H
|
||||
#define GUARD_BATTLE_ANIM_8137220_H
|
||||
|
||||
void SetBankFuncToWallyBufferRunCommand(void);
|
||||
void SetControllerToWally(void);
|
||||
|
||||
#endif // GUARD_BATTLE_ANIM_8137220_H
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef GUARD_BATTLE_ANIM_813F0F4_H
|
||||
#define GUARD_BATTLE_ANIM_813F0F4_H
|
||||
|
||||
void sub_8141828(u8, struct Pokemon *);
|
||||
void TryShinyAnimation(u8, struct Pokemon *);
|
||||
u8 ball_number_to_ball_processing_index(u16);
|
||||
u8 AnimateBallOpenParticles(u8, u8, u8, u8, u8);
|
||||
u8 sub_8141314(u8, u8, u32, u8);
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
#ifndef GUARD_BATTLE_CONTROLLERS_H
|
||||
#define GUARD_BATTLE_CONTROLLERS_H
|
||||
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
REQUEST_ALL_BATTLE,
|
||||
REQUEST_SPECIES_BATTLE,
|
||||
REQUEST_HELDITEM_BATTLE,
|
||||
|
|
@ -65,6 +64,38 @@ enum
|
|||
REQUEST_TOUGH_RIBBON_BATTLE,
|
||||
};
|
||||
|
||||
enum {
|
||||
// For commands sent from the core battle engine to a controller.
|
||||
B_COMM_TO_CONTROLLER, // gBattleBufferA
|
||||
|
||||
// For replies sent from a controller to the core battle engine.
|
||||
B_COMM_TO_ENGINE, // gBattleBufferB
|
||||
|
||||
// During local play, a controller must directly mark itself as
|
||||
// inactive when it's done processing, whether or not it sends
|
||||
// a reply. During multiplayer, it must NOT directly mark itself
|
||||
// as inactive, but instead send one of these, with the player's
|
||||
// multiplayer ID as data.
|
||||
B_COMM_CONTROLLER_IS_DONE
|
||||
};
|
||||
|
||||
enum {
|
||||
BALL_NO_SHAKES,
|
||||
BALL_1_SHAKE,
|
||||
BALL_2_SHAKES,
|
||||
BALL_3_SHAKES_FAIL,
|
||||
BALL_3_SHAKES_SUCCESS,
|
||||
BALL_TRAINER_BLOCK,
|
||||
};
|
||||
|
||||
#define INSTANT_HP_BAR_DROP 0x7FFF
|
||||
|
||||
struct HpAndStatus
|
||||
{
|
||||
u16 hp;
|
||||
u32 status;
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CONTROLLER_GETMONDATA,
|
||||
|
|
@ -86,7 +117,7 @@ enum
|
|||
CONTROLLER_PRINTSTRING,
|
||||
CONTROLLER_PRINTSTRINGPLAYERONLY,
|
||||
CONTROLLER_CHOOSEACTION,
|
||||
CONTROLLER_UNKNOWNYESNOBOX,
|
||||
CONTROLLER_YESNOBOX,
|
||||
CONTROLLER_CHOOSEMOVE,
|
||||
CONTROLLER_OPENBAG,
|
||||
CONTROLLER_CHOOSEPOKEMON,
|
||||
|
|
@ -98,19 +129,19 @@ enum
|
|||
CONTROLLER_STATUSXOR,
|
||||
CONTROLLER_DATATRANSFER,
|
||||
CONTROLLER_DMA3TRANSFER,
|
||||
CONTROLLER_31,
|
||||
CONTROLLER_PLAYBGM,
|
||||
CONTROLLER_32,
|
||||
CONTROLLER_TWORETURNVALUES,
|
||||
CONTROLLER_CHOSENMONRETURNVALUE,
|
||||
CONTROLLER_ONERETURNVALUE,
|
||||
CONTROLLER_ONERETURNVALUE_DUPLICATE,
|
||||
CONTROLLER_37,
|
||||
CONTROLLER_38,
|
||||
CONTROLLER_39,
|
||||
CONTROLLER_40,
|
||||
CONTROLLER_CLEARUNKVAR,
|
||||
CONTROLLER_SETUNKVAR,
|
||||
CONTROLLER_CLEARUNKFLAG,
|
||||
CONTROLLER_TOGGLEUNKFLAG,
|
||||
CONTROLLER_HITANIMATION,
|
||||
CONTROLLER_42,
|
||||
CONTROLLER_EFFECTIVENESSSOUND,
|
||||
CONTROLLER_CANTSWITCH,
|
||||
CONTROLLER_PLAYSE,
|
||||
CONTROLLER_PLAYFANFAREORBGM,
|
||||
CONTROLLER_FAINTINGCRY,
|
||||
CONTROLLER_INTROSLIDE,
|
||||
|
|
@ -122,18 +153,12 @@ enum
|
|||
CONTROLLER_BATTLEANIMATION,
|
||||
CONTROLLER_LINKSTANDBYMSG,
|
||||
CONTROLLER_RESETACTIONMOVESELECTION,
|
||||
CONTROLLER_55,
|
||||
CONTROLLER_ENDLINKBATTLE,
|
||||
/*new controllers should go here*/
|
||||
CONTROLLER_TERMINATOR_NOP,
|
||||
CONTROLLER_CMDS_COUNT
|
||||
};
|
||||
|
||||
struct HpAndStatus
|
||||
{
|
||||
u16 hp;
|
||||
u32 status;
|
||||
};
|
||||
|
||||
struct DisableStruct;
|
||||
|
||||
// emitters
|
||||
|
|
|
|||
|
|
@ -12,22 +12,50 @@ struct BattleInterfaceStruct1
|
|||
u32 unk10;
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
HP_CURRENT,
|
||||
HP_MAX
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
HEALTH_BAR,
|
||||
EXP_BAR
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
HEALTHBOX_ALL,
|
||||
HEALTHBOX_CURRENT_HP,
|
||||
HEALTHBOX_MAX_HP,
|
||||
HEALTHBOX_LEVEL,
|
||||
HEALTHBOX_NICK,
|
||||
HEALTHBOX_HEALTH_BAR,
|
||||
HEALTHBOX_EXP_BAR,
|
||||
HEALTHBOX_UNUSED_7,
|
||||
HEALTHBOX_UNUSED_8,
|
||||
HEALTHBOX_STATUS_ICON,
|
||||
HEALTHBOX_SAFARI_ALL_TEXT,
|
||||
HEALTHBOX_SAFARI_BALLS_TEXT
|
||||
};
|
||||
|
||||
u8 battle_make_oam_normal_battle(u8);
|
||||
u8 battle_make_oam_safari_battle(void);
|
||||
void sub_8043D84(u8, u8, u32, u32, u32);
|
||||
void sub_8043DB0(u8);
|
||||
void sub_8043DFC(u8);
|
||||
void SetBattleBarStruct(u8, u8, u32, u32, u32);
|
||||
void SetHealthboxSpriteInvisible(u8);
|
||||
void SetHealthboxSpriteVisible(u8);
|
||||
void nullsub_11();
|
||||
void UpdateOamPriorityInAllHealthboxes(u8);
|
||||
void sub_8043F44(u8);
|
||||
void sub_804454C(void);
|
||||
u8 CreatePartyStatusSummarySprites(u8, const struct HpAndStatus *, u8, u8);
|
||||
void sub_8044CA0(u8);
|
||||
void sub_8045A5C(u8, struct Pokemon *, u8);
|
||||
s32 sub_8045C78(u8, u8, u8, u8);
|
||||
void UpdateHealthboxAttribute(u8, struct Pokemon *, u8);
|
||||
s32 MoveBattleBar(u8, u8, u8, u8);
|
||||
s16 sub_80460C8(struct BattleInterfaceStruct1 *, int *, u16 *, int);
|
||||
u8 GetScaledHPFraction(s16, s16, u8);
|
||||
u8 GetHPBarLevel(s16, s16);
|
||||
void sub_80440EC(u8 a, s16 b, u8 c);
|
||||
void UpdateHpTextInHealthbox(u8 a, s16 b, u8 c);
|
||||
|
||||
#endif // GUARD_BATTLE_INTERFACE_H
|
||||
|
|
|
|||
|
|
@ -289,6 +289,10 @@
|
|||
#define BATTLE_ENVIRONMENT_BUILDING 8
|
||||
#define BATTLE_ENVIRONMENT_PLAIN 9
|
||||
|
||||
#define B_WAIT_TIME_LONG 64
|
||||
#define B_WAIT_TIME_MED 48
|
||||
#define B_WAIT_TIME_SHORT 32
|
||||
|
||||
#define TARGET_SELECTED_POKEMON 0
|
||||
#define TARGET_SPECIAL (1 << 0)
|
||||
#define TARGET_UNK2 (1 << 1)
|
||||
|
|
@ -385,15 +389,6 @@
|
|||
#define B_ANIM_INGRAIN_HEAL 0x15
|
||||
#define B_ANIM_WISH_HEAL 0x16
|
||||
|
||||
// special animation table
|
||||
#define B_ANIM_LVL_UP 0x0
|
||||
#define B_ANIM_SWITCH_OUT_PLAYER_MON 0x1
|
||||
#define B_ANIM_SWITCH_OUT_OPPONENT_MON 0x2
|
||||
#define B_ANIM_BALL_THROW 0x3
|
||||
#define B_ANIM_SAFARI_BALL_THROW 0x4
|
||||
#define B_ANIM_SUBSTITUTE_TO_MON 0x5
|
||||
#define B_ANIM_MON_TO_SUBSTITUTE 0x6
|
||||
|
||||
// AI switch items
|
||||
#define AI_ITEM_FULL_RESTORE 1
|
||||
#define AI_ITEM_HEAL_HP 2
|
||||
|
|
|
|||
|
|
@ -380,7 +380,7 @@
|
|||
#define B_ANIM_SWITCH_OUT_PLAYER_MON 0x1
|
||||
#define B_ANIM_SWITCH_OUT_OPPONENT_MON 0x2
|
||||
#define B_ANIM_BALL_THROW 0x3
|
||||
#define B_ANIM_SAFARI_BALL_THROW 0x4
|
||||
#define B_ANIM_BALL_THROW_WITH_TRAINER 0x4
|
||||
#define B_ANIM_SUBSTITUTE_TO_MON 0x5
|
||||
#define B_ANIM_MON_TO_SUBSTITUTE 0x6
|
||||
|
||||
|
|
|
|||
|
|
@ -190,6 +190,12 @@ enum {
|
|||
TRAINER_PIC_DRAKE,
|
||||
};
|
||||
|
||||
enum {
|
||||
TRAINER_BACK_PIC_BRENDAN,
|
||||
TRAINER_BACK_PIC_MAY,
|
||||
TRAINER_BACK_PIC_WALLY,
|
||||
};
|
||||
|
||||
enum {
|
||||
TRAINER_CLASS_POKEMON_TRAINER_1,
|
||||
TRAINER_CLASS_POKEMON_TRAINER_2,
|
||||
|
|
@ -35,18 +35,18 @@ extern u8 gSharedMem[];
|
|||
#define ewram16400 (gSharedMem + 0x16400)
|
||||
|
||||
// gBattleResources
|
||||
#define AI_THINKING_STRUCT ((struct AI_ThinkingStruct *)(gSharedMem + 0x16800))
|
||||
#define AI_BATTLE_HISTORY ((struct BattleHistory *) (gSharedMem + 0x16A00))
|
||||
#define AI_STACK ((struct AI_Stack *) (gSharedMem + 0x16C00))
|
||||
#define eSecretBaseRecord ((struct SecretBaseRecord *)(gSharedMem + 0x17000))
|
||||
#define eBattleFlagsArr (*(struct ResourceFlags *)(gSharedMem + 0x17100))
|
||||
#define B_BATTLESCRIPTS_STACK ((struct BattleScriptsStack *) (gSharedMem + 0x17110))
|
||||
#define B_FUNCTION_STACK ((struct BattleCallbacksStack *) (gSharedMem + 0x17140))
|
||||
#define AI_THINKING_STRUCT ((struct AI_ThinkingStruct *)(gSharedMem + 0x16800))
|
||||
#define AI_BATTLE_HISTORY ((struct BattleHistory *) (gSharedMem + 0x16A00))
|
||||
#define AI_STACK ((struct AI_Stack *) (gSharedMem + 0x16C00))
|
||||
#define eSecretBaseRecord ((struct SecretBaseRecord *)(gSharedMem + 0x17000))
|
||||
#define eBattleFlagsArr (*(struct ResourceFlags *)(gSharedMem + 0x17100))
|
||||
#define B_BATTLESCRIPTS_STACK ((struct BattleScriptsStack *) (gSharedMem + 0x17110))
|
||||
#define B_FUNCTION_STACK ((struct BattleCallbacksStack *) (gSharedMem + 0x17140))
|
||||
#define gBattleResources_statsBeforeLvlUp ((struct StatsArray *)(gSharedMem + 0x17180))
|
||||
#define gBattleSpriteInfo ((struct BattleSpriteInfo *) (gSharedMem + 0x17800))
|
||||
#define ewram17810 ((struct Struct2017810 *) (gSharedMem + 0x17810))
|
||||
#define ewram17840 (*(struct Struct2017840 *) (gSharedMem + 0x17840))
|
||||
#define eBattleBars ((struct BattleBar *)(gSharedMem + 0x17850))
|
||||
#define gBattleSpriteInfo ((struct BattleSpriteInfo *) (gSharedMem + 0x17800))
|
||||
#define gBattleHealthBoxInfo ((struct BattleHealthboxInfo *) (gSharedMem + 0x17810))
|
||||
#define ewram17840 (*(struct Struct2017840 *) (gSharedMem + 0x17840))
|
||||
#define eBattleBars ((struct BattleBar *)(gSharedMem + 0x17850))
|
||||
|
||||
#define eBattleAnimPalBackup_Battle ((u16 *)(gSharedMem + 0x18000)) // also: shop.c, battle_anim.c
|
||||
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@
|
|||
|
||||
#define POKEMON_SLOTS_NUMBER 412
|
||||
#define POKEMON_NAME_LENGTH 10
|
||||
#define POKEMON_NAME_BUFFER_SIZE max(20, POKEMON_NAME_LENGTH + 1) // Frequently used buffer size. Larger than necessary
|
||||
#define OT_NAME_LENGTH 7
|
||||
|
||||
#define min(a, b) ((a) < (b) ? (a) : (b))
|
||||
|
|
|
|||
|
|
@ -3,8 +3,11 @@
|
|||
|
||||
extern const struct SpriteTemplate gBallSpriteTemplates[];
|
||||
|
||||
#define POKEBALL_PLAYER_SENDOUT 0xFF
|
||||
#define POKEBALL_OPPONENT_SENDOUT 0xFE
|
||||
|
||||
void CreatePokeballSprite(u8 r0, u8 r1, u8 r2, u8 r3, u8 s1, u8 s2, u8 s3, u32 s4);
|
||||
void sub_804777C(u8);
|
||||
void StartHealthboxSlideIn(u8);
|
||||
void LoadBallGraphics(u8);
|
||||
void FreeBallGraphics(u8);
|
||||
u8 sub_8047580(u8, u8, u8, u8, u8, u8, u8, u32);
|
||||
|
|
|
|||
|
|
@ -435,8 +435,8 @@ u8 sub_803C434(u8 a1);
|
|||
u8 GetMonGender(struct Pokemon *mon);
|
||||
u8 GetBoxMonGender(struct BoxPokemon *boxMon);
|
||||
u8 GetGenderFromSpeciesAndPersonality(u16 species, u32 personality);
|
||||
void GetMonSpriteTemplate_803C56C(u16 species, u8 a2);
|
||||
void GetMonSpriteTemplate_803C5A0(u16 species, u8 a2);
|
||||
void SetMultiuseSpriteTemplateToPokemon(u16 species, u8 a2);
|
||||
void SetMultiuseSpriteTemplateToTrainerBack(u16 species, u8 a2);
|
||||
void EncryptBoxMon(struct BoxPokemon *boxMon);
|
||||
void DecryptBoxMon(struct BoxPokemon *boxMon);
|
||||
union PokemonSubstruct *GetSubstruct(struct BoxPokemon *boxMon, u32 personality, u8 substructType);
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ void *sub_8079BFC(s16 bottom, s16 top);
|
|||
void sub_8079C08(struct Task *task, u8 a2, s16 a3, s16 a4, s16 a5, s16 a6, u16 a7);
|
||||
u8 sub_8079C74(struct Task *task);
|
||||
void UpdateBattlerSpritePriorities();
|
||||
u8 GetBattlerSubpriority(u8 bank);
|
||||
u8 GetBattlerSpriteSubpriority(u8 bank);
|
||||
u8 GetBattlerPosition_permutated(u8 slot);
|
||||
void sub_807A784(u8 taskId);
|
||||
void sub_807A850(struct Task *task, u8 taskId);
|
||||
|
|
@ -107,7 +107,7 @@ u8 sub_8077FC0(u8 slot);
|
|||
void DestroySpriteAndMatrix(struct Sprite *sprite);
|
||||
bool8 TranslateAnimArc(struct Sprite *sprite);
|
||||
bool8 sub_8078CE8(struct Sprite *sprite);
|
||||
void oamt_add_pos2_onto_pos1(struct Sprite *sprite);
|
||||
void SetSpritePrimaryCoordsFromSecondaryCoords(struct Sprite *sprite);
|
||||
void sub_8078BD4(struct Sprite *sprite);
|
||||
void TranslateAnimSpriteToTargetMonLocation(struct Sprite *sprite);
|
||||
void sub_80789D4(bool8 a1);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ bool8 IsBGMPausedOrStopped(void);
|
|||
void FadeInBGM(u8 speed);
|
||||
void FadeOutBGM(u8 speed);
|
||||
bool8 IsBGMStopped(void);
|
||||
void PlayCry1(u16 species, s8 pan);
|
||||
void PlayCry_Normal(u16 species, s8 pan);
|
||||
void PlayCry2(u16 species, s8 pan, s8 volume, u8 priority);
|
||||
void PlayCry3(u16 species, s8 pan, u8 mode);
|
||||
void PlayCry4(u16 species, s8 pan, u8 mode);
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ static const TaskFunc sBattleIntroTaskFuncs[] =
|
|||
#define tBgXOffset data[2]
|
||||
#define tFramesUntilBg1Slide data[3]
|
||||
|
||||
void StartBattleIntroAnim(u8 a)
|
||||
void HandleIntroSlide(u8 a)
|
||||
{
|
||||
u8 taskId;
|
||||
|
||||
|
|
|
|||
|
|
@ -1086,7 +1086,7 @@ void sub_80D759C(u8 taskId)
|
|||
}
|
||||
|
||||
task->data[13] = GetBattlerSpriteCoord(gBattleAnimTarget, 2);
|
||||
task->data[12] = GetBattlerSubpriority(gBattleAnimTarget) - 2;
|
||||
task->data[12] = GetBattlerSpriteSubpriority(gBattleAnimTarget) - 2;
|
||||
task->data[0]++;
|
||||
break;
|
||||
case 1:
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ void sub_80D2ABC(struct Sprite *sprite)
|
|||
sprite->x += gBattleAnimArgs[0];
|
||||
sprite->y += gBattleAnimArgs[1];
|
||||
StartSpriteAnim(sprite, 0);
|
||||
sprite->subpriority = GetBattlerSubpriority(gBattleAnimTarget) - 1;
|
||||
sprite->subpriority = GetBattlerSpriteSubpriority(gBattleAnimTarget) - 1;
|
||||
sprite->data[2] = 1;
|
||||
}
|
||||
sprite->data[0] += sprite->data[2];
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ void sub_80D3698(struct Sprite *sprite)
|
|||
sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1);
|
||||
sprite->y2 = -10;
|
||||
|
||||
subpriority = GetBattlerSubpriority(gBattleAnimAttacker);
|
||||
subpriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker);
|
||||
|
||||
if (!IsContest())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ void sub_80CBDF4(u8 taskId)
|
|||
{
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
task->data[4] = GetBattlerSubpriority(gBattleAnimTarget) - 1;
|
||||
task->data[4] = GetBattlerSpriteSubpriority(gBattleAnimTarget) - 1;
|
||||
task->data[6] = GetBattlerSpriteCoord(gBattleAnimTarget, 2);
|
||||
task->data[7] = GetBattlerSpriteCoord(gBattleAnimTarget, 3);
|
||||
task->data[10] = GetBattlerSpriteCoordAttr(gBattleAnimTarget, 1);
|
||||
|
|
|
|||
|
|
@ -1177,7 +1177,7 @@ void sub_80DF1A4(u8 taskId)
|
|||
task->data[11] = (GetBattlerSpriteCoordAttr(gBattleAnimAttacker, 1) / 2) + 8;
|
||||
task->data[7] = 0;
|
||||
task->data[5] = GetBattlerSpriteBGPriority(gBattleAnimAttacker);
|
||||
task->data[6] = GetBattlerSubpriority(gBattleAnimAttacker) - 2;
|
||||
task->data[6] = GetBattlerSpriteSubpriority(gBattleAnimAttacker) - 2;
|
||||
task->data[3] = 0;
|
||||
task->data[4] = 16;
|
||||
REG_BLDCNT = 0x3F40;
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ void AnimOrbitFast(struct Sprite* sprite)
|
|||
sprite->affineAnimPaused = 1;
|
||||
sprite->data[0] = gBattleAnimArgs[0];
|
||||
sprite->data[1] = gBattleAnimArgs[1];
|
||||
sprite->data[7] = GetBattlerSubpriority(gBattleAnimAttacker);
|
||||
sprite->data[7] = GetBattlerSpriteSubpriority(gBattleAnimAttacker);
|
||||
sprite->callback = AnimOrbitFastStep;
|
||||
sprite->callback(sprite);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ void sub_80D2EC8(struct Sprite *sprite)
|
|||
sprite->callback = sub_80D2F80;
|
||||
|
||||
sprite->data[0] = 0;
|
||||
oamt_add_pos2_onto_pos1(sprite);
|
||||
SetSpritePrimaryCoordsFromSecondaryCoords(sprite);
|
||||
sprite->data[2] = 5;
|
||||
sprite->data[4] = 0;
|
||||
sprite->data[3] = 0;
|
||||
|
|
|
|||
|
|
@ -172,11 +172,11 @@ static void sub_80CADA8(struct Sprite* sprite)
|
|||
sprite->y2 += Cos(sprite->data[5], -5);
|
||||
if ((u16)(sprite->data[5] - 0x40) < 0x80)
|
||||
{
|
||||
sprite->subpriority = GetBattlerSubpriority(gBattleAnimAttacker) - 1;
|
||||
sprite->subpriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker) - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->subpriority = GetBattlerSubpriority(gBattleAnimAttacker) + 1;
|
||||
sprite->subpriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker) + 1;
|
||||
}
|
||||
|
||||
sprite->data[5] = (sprite->data[5] + 5) & 0xFF;
|
||||
|
|
|
|||
|
|
@ -235,11 +235,11 @@ static void sub_80CA8B4(struct Sprite* sprite)
|
|||
{
|
||||
if (sprite->data[5] > 0x7F)
|
||||
{
|
||||
sprite->subpriority = GetBattlerSubpriority(gBattleAnimTarget) + 1;
|
||||
sprite->subpriority = GetBattlerSpriteSubpriority(gBattleAnimTarget) + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->subpriority = GetBattlerSubpriority(gBattleAnimTarget) + 6;
|
||||
sprite->subpriority = GetBattlerSpriteSubpriority(gBattleAnimTarget) + 6;
|
||||
}
|
||||
sprite->x2 += Sin(sprite->data[5], 5);
|
||||
sprite->y2 += Cos(sprite->data[5], 14);
|
||||
|
|
@ -258,7 +258,7 @@ void sub_80CA928(u8 taskId)
|
|||
gBattleAnimArgs[1] = 0;
|
||||
gBattleAnimArgs[2] = 80;
|
||||
gBattleAnimArgs[3] = 0;
|
||||
CreateSpriteAndAnimate(&gSpriteTemplate_83D631C, 0, 0, GetBattlerSubpriority(gBattleAnimTarget) + 1);
|
||||
CreateSpriteAndAnimate(&gSpriteTemplate_83D631C, 0, 0, GetBattlerSpriteSubpriority(gBattleAnimTarget) + 1);
|
||||
}
|
||||
|
||||
if (gTasks[taskId].data[1] == 15)
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ void sub_812B18C(u8 taskId)
|
|||
{
|
||||
s16 mode = gBattleAnimArgs[1];
|
||||
if (mode == 0xFF)
|
||||
PlayCry1(species, pan);
|
||||
PlayCry_Normal(species, pan);
|
||||
else
|
||||
PlayCry3(species, pan, mode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ void AnimTask_Minimize(u8 taskId)
|
|||
task->data[4] = 0x100;
|
||||
task->data[5] = 0;
|
||||
task->data[6] = 0;
|
||||
task->data[7] = GetBattlerSubpriority(gBattleAnimAttacker);
|
||||
task->data[7] = GetBattlerSpriteSubpriority(gBattleAnimAttacker);
|
||||
task->func = AnimTask_Minimize_Step;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -347,12 +347,12 @@ void sub_80CFB04(u8 taskId)
|
|||
gBattleAnimArgs[4] ^= 0x80;
|
||||
if (gBattleAnimArgs[4] >= 64)
|
||||
{
|
||||
u16 var = GetBattlerSubpriority(gBattleAnimTarget) + (gBattleAnimArgs[4] - 64);
|
||||
u16 var = GetBattlerSpriteSubpriority(gBattleAnimTarget) + (gBattleAnimArgs[4] - 64);
|
||||
gTasks[taskId].data[2] = var;
|
||||
}
|
||||
else
|
||||
{
|
||||
u16 var = GetBattlerSubpriority(gBattleAnimTarget) - gBattleAnimArgs[4];
|
||||
u16 var = GetBattlerSpriteSubpriority(gBattleAnimTarget) - gBattleAnimArgs[4];
|
||||
gTasks[taskId].data[2] = var;
|
||||
}
|
||||
}
|
||||
|
|
@ -360,12 +360,12 @@ void sub_80CFB04(u8 taskId)
|
|||
{
|
||||
if (gBattleAnimArgs[4] >= 64)
|
||||
{
|
||||
u16 var = GetBattlerSubpriority(gBattleAnimTarget) + (gBattleAnimArgs[4] - 64);
|
||||
u16 var = GetBattlerSpriteSubpriority(gBattleAnimTarget) + (gBattleAnimArgs[4] - 64);
|
||||
gTasks[taskId].data[2] = var;
|
||||
}
|
||||
else
|
||||
{
|
||||
u16 var = GetBattlerSubpriority(gBattleAnimTarget) - gBattleAnimArgs[4];
|
||||
u16 var = GetBattlerSpriteSubpriority(gBattleAnimTarget) - gBattleAnimArgs[4];
|
||||
gTasks[taskId].data[2] = var;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -198,10 +198,10 @@ void unref_sub_80CE260(u8 taskId)
|
|||
for (i = 0; i < gBattlersCount; i++)
|
||||
{
|
||||
if (gBattleAnimArgs[0] == 1 && GetBattlerSide(i) == 0)
|
||||
sub_8043DB0(gHealthboxSpriteIds[i]);
|
||||
SetHealthboxSpriteInvisible(gHealthboxSpriteIds[i]);
|
||||
|
||||
if (gBattleAnimArgs[1] == 1 && GetBattlerSide(i) == 1)
|
||||
sub_8043DB0(gHealthboxSpriteIds[i]);
|
||||
SetHealthboxSpriteInvisible(gHealthboxSpriteIds[i]);
|
||||
}
|
||||
|
||||
DestroyAnimVisualTask(taskId);
|
||||
|
|
@ -212,7 +212,7 @@ void unref_sub_80CE2D4(u8 taskId)
|
|||
u8 i;
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
{
|
||||
sub_8043DFC(gHealthboxSpriteIds[i]);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[i]);
|
||||
}
|
||||
|
||||
DestroyAnimVisualTask(taskId);
|
||||
|
|
|
|||
|
|
@ -661,7 +661,7 @@ void sub_80D4418(struct Task *task, u8 taskId)
|
|||
s16 attackerCoordX = GetBattlerSpriteCoord(gBattleAnimAttacker, 2);
|
||||
s16 attackerCoordY = GetBattlerSpriteCoord(gBattleAnimAttacker, 3);
|
||||
s16 trigIndex = 172;
|
||||
u8 subpriority = GetBattlerSubpriority(gBattleAnimAttacker) - 1;
|
||||
u8 subpriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker) - 1;
|
||||
s16 increment = 4 - task->data[1];
|
||||
u8 spriteId;
|
||||
|
||||
|
|
@ -1060,7 +1060,7 @@ void sub_80D4D64(struct Sprite *sprite, s32 xDiff, s32 yDiff)
|
|||
spriteId = CreateSprite(&gSpriteTemplate_83D9420, combinedX, combinedY + something, 130);
|
||||
gSprites[spriteId].data[0] = 20;
|
||||
gSprites[spriteId].data[1] = randomSomethingY;
|
||||
gSprites[spriteId].subpriority = GetBattlerSubpriority(gBattleAnimAttacker) - 1;
|
||||
gSprites[spriteId].subpriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker) - 1;
|
||||
if (randomSomethingX < 0)
|
||||
gSprites[spriteId].data[2] = -randomSomethingX;
|
||||
else
|
||||
|
|
@ -1071,7 +1071,7 @@ void sub_80D4D64(struct Sprite *sprite, s32 xDiff, s32 yDiff)
|
|||
spriteId = CreateSprite(&gSpriteTemplate_83D9420, combinedX, combinedY - something, 130);
|
||||
gSprites[spriteId].data[0] = 20;
|
||||
gSprites[spriteId].data[1] = randomSomethingY;
|
||||
gSprites[spriteId].subpriority = GetBattlerSubpriority(gBattleAnimAttacker) - 1;
|
||||
gSprites[spriteId].subpriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker) - 1;
|
||||
if (randomSomethingX > 0)
|
||||
gSprites[spriteId].data[2] = -randomSomethingX;
|
||||
else
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@
|
|||
#include "data2.h"
|
||||
#include "battle_setup.h"
|
||||
#include "battle.h"
|
||||
#include "trainer.h"
|
||||
#include "graphics.h"
|
||||
#include "gba/types.h"
|
||||
#include "constants/species.h"
|
||||
#include "constants/moves.h"
|
||||
#include "constants/items.h"
|
||||
#include "constants/opponents.h"
|
||||
#include "constants/trainers.h"
|
||||
|
||||
const struct MonCoords gTrainerBackPicCoords[] = {
|
||||
{8, 4},
|
||||
|
|
|
|||
|
|
@ -1660,7 +1660,7 @@ static void ScriptCmd_createsprite(void)
|
|||
else
|
||||
argVar *= -1;
|
||||
|
||||
subpriority = GetBattlerSubpriority(gBattleAnimTarget) + (s8)(argVar);
|
||||
subpriority = GetBattlerSpriteSubpriority(gBattleAnimTarget) + (s8)(argVar);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1669,7 +1669,7 @@ static void ScriptCmd_createsprite(void)
|
|||
else
|
||||
argVar *= -1;
|
||||
|
||||
subpriority = GetBattlerSubpriority(gBattleAnimAttacker) + (s8)(argVar);
|
||||
subpriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker) + (s8)(argVar);
|
||||
}
|
||||
|
||||
if (subpriority < 3)
|
||||
|
|
@ -2526,7 +2526,7 @@ static void ScriptCmd_changebg(void)
|
|||
|
||||
s8 BattleAnimAdjustPanning(s8 pan)
|
||||
{
|
||||
if (!IsContest() && ewram17810[gBattleAnimAttacker].unk0_4)
|
||||
if (!IsContest() && gBattleHealthBoxInfo[gBattleAnimAttacker].statusAnimActive)
|
||||
{
|
||||
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
|
||||
pan = SOUND_PAN_TARGET;
|
||||
|
|
@ -2568,7 +2568,7 @@ s8 BattleAnimAdjustPanning(s8 pan)
|
|||
|
||||
s8 BattleAnimAdjustPanning2(s8 pan)
|
||||
{
|
||||
if (!IsContest() && ewram17810[gBattleAnimAttacker].unk0_4)
|
||||
if (!IsContest() && gBattleHealthBoxInfo[gBattleAnimAttacker].statusAnimActive)
|
||||
{
|
||||
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
|
||||
pan = SOUND_PAN_TARGET;
|
||||
|
|
|
|||
|
|
@ -2360,7 +2360,7 @@ void sub_812D7E8(u8 taskId)
|
|||
if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_OPPONENT)
|
||||
{
|
||||
if (gTasks[taskId].data[10] == 0)
|
||||
sub_8032984(gBattleAnimAttacker, gBattleSpriteInfo[gBattleAnimAttacker].transformedSpecies);
|
||||
sub_8032984(gBattleAnimAttacker, gBattleSpriteInfo[gBattleAnimAttacker].transformSpecies);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3146,9 +3146,9 @@ static void sub_812EEEC(struct Sprite *sprite)
|
|||
sprite->data[1] = (sprite->data[1] + 9) & 0xFF;
|
||||
|
||||
if ((u16)sprite->data[1] < 64 || sprite->data[1] > 195)
|
||||
sprite->subpriority = GetBattlerSubpriority(gBattleAnimAttacker) - 1;
|
||||
sprite->subpriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker) - 1;
|
||||
else
|
||||
sprite->subpriority = GetBattlerSubpriority(gBattleAnimAttacker) + 1;
|
||||
sprite->subpriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker) + 1;
|
||||
|
||||
if (sprite->data[5] == 0)
|
||||
{
|
||||
|
|
@ -3200,7 +3200,7 @@ void AnimTask_RolePlaySilhouette(u8 taskId)
|
|||
isBackPic = 0;
|
||||
personality = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gBattleAnimTarget]], MON_DATA_PERSONALITY);
|
||||
otId = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gBattleAnimTarget]], MON_DATA_OT_ID);
|
||||
if (gBattleSpriteInfo[gBattleAnimTarget].transformedSpecies == SPECIES_NONE)
|
||||
if (gBattleSpriteInfo[gBattleAnimTarget].transformSpecies == SPECIES_NONE)
|
||||
{
|
||||
if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER)
|
||||
species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gBattleAnimTarget]], MON_DATA_SPECIES);
|
||||
|
|
@ -3209,7 +3209,7 @@ void AnimTask_RolePlaySilhouette(u8 taskId)
|
|||
}
|
||||
else
|
||||
{
|
||||
species = gBattleSpriteInfo[gBattleAnimTarget].transformedSpecies;
|
||||
species = gBattleSpriteInfo[gBattleAnimTarget].transformSpecies;
|
||||
}
|
||||
|
||||
xOffset = 20;
|
||||
|
|
@ -3220,7 +3220,7 @@ void AnimTask_RolePlaySilhouette(u8 taskId)
|
|||
isBackPic = 1;
|
||||
personality = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattleAnimTarget]], MON_DATA_PERSONALITY);
|
||||
otId = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattleAnimTarget]], MON_DATA_OT_ID);
|
||||
if (gBattleSpriteInfo[gBattleAnimTarget].transformedSpecies == SPECIES_NONE)
|
||||
if (gBattleSpriteInfo[gBattleAnimTarget].transformSpecies == SPECIES_NONE)
|
||||
{
|
||||
if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER)
|
||||
species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gBattleAnimTarget]], MON_DATA_SPECIES);
|
||||
|
|
@ -3229,7 +3229,7 @@ void AnimTask_RolePlaySilhouette(u8 taskId)
|
|||
}
|
||||
else
|
||||
{
|
||||
species = gBattleSpriteInfo[gBattleAnimTarget].transformedSpecies;
|
||||
species = gBattleSpriteInfo[gBattleAnimTarget].transformSpecies;
|
||||
}
|
||||
|
||||
xOffset = -20;
|
||||
|
|
@ -3716,7 +3716,7 @@ void sub_812FD7C(u8 taskId)
|
|||
|
||||
task->data[4] = GetBattlerSpriteCoord(battler, 0);
|
||||
task->data[5] = GetBattlerSpriteCoord(battler, 1);
|
||||
task->data[6] = GetBattlerSubpriority(battler);
|
||||
task->data[6] = GetBattlerSpriteSubpriority(battler);
|
||||
task->data[15] = GetAnimBattlerSpriteId(gBattleAnimArgs[0]);
|
||||
PrepareAffineAnimInTaskData(task, task->data[15], &gUnknown_084028AC);
|
||||
task->func = sub_812FE20;
|
||||
|
|
@ -4045,7 +4045,7 @@ void sub_8130554(u8 taskId)
|
|||
task->data[12] = GetBattlerSpriteCoord(gBattleAnimAttacker, 3);
|
||||
task->data[13] = GetBattlerSpriteCoord(gBattleAnimTarget, 2);
|
||||
task->data[14] = GetBattlerSpriteCoord(gBattleAnimTarget, 3) + GetBattlerSpriteCoordAttr(gBattleAnimTarget, 0) / 4;
|
||||
task->data[15] = CreateSprite(&gSpriteTemplate_84029AC, task->data[11], task->data[12], GetBattlerSubpriority(gBattleAnimTarget) - 5);
|
||||
task->data[15] = CreateSprite(&gSpriteTemplate_84029AC, task->data[11], task->data[12], GetBattlerSpriteSubpriority(gBattleAnimTarget) - 5);
|
||||
if (task->data[15] != MAX_SPRITES)
|
||||
{
|
||||
gSprites[task->data[15]].data[0] = 16;
|
||||
|
|
@ -4737,12 +4737,12 @@ static void sub_8131564(struct Sprite *sprite)
|
|||
|
||||
if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER)
|
||||
{
|
||||
sprite->subpriority = GetBattlerSubpriority(gBattleAnimTarget) - 2;
|
||||
sprite->subpriority = GetBattlerSpriteSubpriority(gBattleAnimTarget) - 2;
|
||||
y2 = -144;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->subpriority = GetBattlerSubpriority(gBattleAnimTarget) + 2;
|
||||
sprite->subpriority = GetBattlerSpriteSubpriority(gBattleAnimTarget) + 2;
|
||||
y2 = -96;
|
||||
}
|
||||
|
||||
|
|
@ -4951,7 +4951,7 @@ void AnimTask_SnatchOpposingMonMove(u8 taskId)
|
|||
personality = gContestResources__moveAnim.personality;
|
||||
otId = gContestResources__moveAnim.otId;
|
||||
species = gContestResources__moveAnim.targetSpecies;
|
||||
subpriority = GetBattlerSubpriority(gBattleAnimAttacker);
|
||||
subpriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker);
|
||||
isBackPic = 0;
|
||||
x = -32;
|
||||
}
|
||||
|
|
@ -4961,10 +4961,10 @@ void AnimTask_SnatchOpposingMonMove(u8 taskId)
|
|||
{
|
||||
personality = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gBattleAnimAttacker]], MON_DATA_PERSONALITY);
|
||||
otId = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gBattleAnimAttacker]], MON_DATA_OT_ID);
|
||||
if (gBattleSpriteInfo[gBattleAnimTarget].transformedSpecies == SPECIES_NONE)
|
||||
if (gBattleSpriteInfo[gBattleAnimTarget].transformSpecies == SPECIES_NONE)
|
||||
species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gBattleAnimAttacker]], MON_DATA_SPECIES);
|
||||
else
|
||||
species = gBattleSpriteInfo[gBattleAnimTarget].transformedSpecies;
|
||||
species = gBattleSpriteInfo[gBattleAnimTarget].transformSpecies;
|
||||
|
||||
subpriority = gSprites[GetAnimBattlerSpriteId(ANIM_BATTLER_TARGET)].subpriority + 1;
|
||||
isBackPic = 0;
|
||||
|
|
@ -4974,10 +4974,10 @@ void AnimTask_SnatchOpposingMonMove(u8 taskId)
|
|||
{
|
||||
personality = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattleAnimAttacker]], MON_DATA_PERSONALITY);
|
||||
otId = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattleAnimAttacker]], MON_DATA_OT_ID);
|
||||
if (gBattleSpriteInfo[gBattleAnimTarget].transformedSpecies == SPECIES_NONE)
|
||||
if (gBattleSpriteInfo[gBattleAnimTarget].transformSpecies == SPECIES_NONE)
|
||||
species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattleAnimAttacker]], MON_DATA_SPECIES);
|
||||
else
|
||||
species = gBattleSpriteInfo[gBattleAnimTarget].transformedSpecies;
|
||||
species = gBattleSpriteInfo[gBattleAnimTarget].transformSpecies;
|
||||
|
||||
subpriority = gSprites[GetAnimBattlerSpriteId(ANIM_BATTLER_TARGET)].subpriority - 1;
|
||||
isBackPic = 1;
|
||||
|
|
@ -4986,7 +4986,7 @@ void AnimTask_SnatchOpposingMonMove(u8 taskId)
|
|||
}
|
||||
|
||||
spriteId2 = sub_8079F44(species, isBackPic, 0, x, GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y), subpriority, personality, otId);
|
||||
if (gBattleSpriteInfo[gBattleAnimTarget].transformedSpecies != SPECIES_NONE)
|
||||
if (gBattleSpriteInfo[gBattleAnimTarget].transformSpecies != SPECIES_NONE)
|
||||
BlendPalette((gSprites[spriteId2].oam.paletteNum * 16) | 0x100, 16, 6, RGB_WHITE);
|
||||
|
||||
gTasks[taskId].data[15] = spriteId2;
|
||||
|
|
@ -5201,7 +5201,7 @@ _08131A44:\n\
|
|||
ldrh r5, [r0]\n\
|
||||
ldr r0, _08131A70 @ =gBattleAnimAttacker\n\
|
||||
ldrb r0, [r0]\n\
|
||||
bl GetBattlerSubpriority\n\
|
||||
bl GetBattlerSpriteSubpriority\n\
|
||||
lsls r0, 24\n\
|
||||
lsrs r4, r0, 24\n\
|
||||
movs r7, 0\n\
|
||||
|
|
|
|||
|
|
@ -721,7 +721,7 @@ void sub_813FBB8(u8 taskId)
|
|||
}
|
||||
|
||||
ballIndex = ball_number_to_ball_processing_index(gLastUsedItem);
|
||||
subpriority = GetBattlerSubpriority(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT)) + 1;
|
||||
subpriority = GetBattlerSpriteSubpriority(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT)) + 1;
|
||||
spriteId = CreateSprite(&gBallSpriteTemplates[ballIndex], x + 32, y | 80, subpriority);
|
||||
gSprites[spriteId].data[0] = 34;
|
||||
gSprites[spriteId].data[1] = GetBattlerSpriteCoord(gBattleAnimTarget, 0);
|
||||
|
|
@ -1843,7 +1843,7 @@ void sub_81416C4(u8 taskId)
|
|||
|
||||
void sub_81417D8(u8 taskId)
|
||||
{
|
||||
gBattleAnimArgs[7] = gBattleSpriteInfo[gBattleAnimAttacker].substituteSprite;
|
||||
gBattleAnimArgs[7] = gBattleSpriteInfo[gBattleAnimAttacker].behindSubstitute;
|
||||
DestroyAnimVisualTask(taskId);
|
||||
}
|
||||
|
||||
|
|
@ -1853,7 +1853,7 @@ void sub_8141808(u8 taskId)
|
|||
DestroyAnimVisualTask(taskId);
|
||||
}
|
||||
|
||||
void sub_8141828(u8 battler, struct Pokemon *mon)
|
||||
void TryShinyAnimation(u8 battler, struct Pokemon *mon)
|
||||
{
|
||||
int isShiny;
|
||||
u32 otId, personality;
|
||||
|
|
@ -1861,7 +1861,7 @@ void sub_8141828(u8 battler, struct Pokemon *mon)
|
|||
u8 taskId1, taskId2;
|
||||
|
||||
isShiny = 0;
|
||||
ewram17810[battler].unk0_7 = 1;
|
||||
gBattleHealthBoxInfo[battler].triedShinyMonAnim = TRUE;
|
||||
otId = GetMonData(mon, MON_DATA_OT_ID);
|
||||
personality = GetMonData(mon, MON_DATA_PERSONALITY);
|
||||
|
||||
|
|
@ -1889,7 +1889,7 @@ void sub_8141828(u8 battler, struct Pokemon *mon)
|
|||
}
|
||||
}
|
||||
|
||||
ewram17810[battler].unk1_0 = 1;
|
||||
gBattleHealthBoxInfo[battler].finishedShinyMonAnim = TRUE;
|
||||
}
|
||||
|
||||
static void sub_814191C(u8 taskId)
|
||||
|
|
@ -1970,7 +1970,7 @@ static void sub_8141AD8(u8 taskId)
|
|||
if (gTasks[taskId].data[1] == 1)
|
||||
{
|
||||
battler = gTasks[taskId].data[0];
|
||||
ewram17810[battler].unk1_0 = 1;
|
||||
gBattleHealthBoxInfo[battler].finishedShinyMonAnim = TRUE;
|
||||
}
|
||||
|
||||
DestroyTask(taskId);
|
||||
|
|
|
|||
|
|
@ -348,7 +348,7 @@ static void sub_807BDAC(u8 taskId)
|
|||
gAnimScriptCallback();
|
||||
if (!gAnimScriptActive)
|
||||
{
|
||||
ewram17810[gTasks[taskId].data[0]].unk0_4 = 0;
|
||||
gBattleHealthBoxInfo[gTasks[taskId].data[0]].statusAnimActive = 0;
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,12 +9,11 @@
|
|||
#include "task.h"
|
||||
#include "text.h"
|
||||
#include "text_window.h"
|
||||
#include "trainer.h"
|
||||
#include "trig.h"
|
||||
#include "sound.h"
|
||||
#include "constants/map_types.h"
|
||||
#include "constants/songs.h"
|
||||
|
||||
#include "constants/trainers.h"
|
||||
|
||||
extern u16 gBattleTypeFlags;
|
||||
extern u8 gBattleOutcome;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
#include "m4a.h"
|
||||
#include "main.h"
|
||||
#include "palette.h"
|
||||
#include "pokeball.h"
|
||||
#include "rom_8077ABC.h"
|
||||
#include "constants/songs.h"
|
||||
#include "sound.h"
|
||||
|
|
@ -45,30 +46,30 @@ extern u8 gDisplayedStringBattle[];
|
|||
extern bool8 gDoingBattleAnim;
|
||||
extern u8 gBattleOutcome;
|
||||
extern u16 gIntroSlideFlags;
|
||||
extern u8 gUnknown_02024E68[];
|
||||
extern u8 gBattlerStatusSummaryTaskId[];
|
||||
extern struct SpriteTemplate gCreatingSpriteTemplate;
|
||||
extern u8 gAnimMoveTurn;
|
||||
extern struct Window gWindowTemplate_Contest_MoveDescription;
|
||||
extern u8 gUnknown_0300434C[];
|
||||
extern u8 gBattleControllerData[];
|
||||
extern u32 gBattleControllerExecFlags;
|
||||
extern MainCallback gPreBattleCallback1;
|
||||
extern struct MusicPlayerInfo gMPlayInfo_BGM;
|
||||
|
||||
extern u8 sub_8077F68();
|
||||
extern u8 GetBattlerSpriteDefault_Y();
|
||||
extern u8 GetBattlerPosition(u8);
|
||||
extern void BattleLoadOpponentMonSprite(struct Pokemon *, u8);
|
||||
extern void sub_8037A74(void);
|
||||
extern void sub_8032984(u8, u16);
|
||||
extern void sub_8037E30(void);
|
||||
extern void sub_80312F0(struct Sprite *);
|
||||
extern u8 StartSendOutMonAnimation();
|
||||
extern void SpriteCB_WaitForBattlerBallReleaseAnim(struct Sprite *);
|
||||
extern u8 DoPokeballSendOutAnimation();
|
||||
extern void sub_8032A08();
|
||||
extern void sub_8037BBC(void);
|
||||
extern s32 sub_803FC34(u16);
|
||||
extern void sub_8031A6C(u16, u8);
|
||||
extern void sub_80313A0(struct Sprite *);
|
||||
extern void SpriteCB_TrainerSlideIn(struct Sprite *);
|
||||
extern void sub_803757C(void);
|
||||
extern void oamt_add_pos2_onto_pos1();
|
||||
extern void SetSpritePrimaryCoordsFromSecondaryCoords();
|
||||
extern void StoreSpriteCallbackInData();
|
||||
extern void StartAnimLinearTranslation(struct Sprite *);
|
||||
extern void sub_80375B4(void);
|
||||
|
|
@ -76,29 +77,28 @@ extern void sub_8010384(struct Sprite *);
|
|||
extern void sub_8037B78(void);
|
||||
extern u8 IsMoveWithoutAnimation();
|
||||
extern bool8 mplay_80342A4(u8);
|
||||
extern void sub_80326EC();
|
||||
extern void sub_8031F24(void);
|
||||
extern void sub_80324BC();
|
||||
extern void SetBattlerSpriteAffineMode();
|
||||
extern void CopyAllBattleSpritesInvisibilities(void);
|
||||
extern void TrySetBehindSubstituteSpriteBit();
|
||||
extern void BufferStringBattle();
|
||||
extern void sub_8037C2C(void);
|
||||
extern void sub_8037B24(void);
|
||||
extern void sub_8037FAC(void);
|
||||
extern void move_anim_start_t2_for_situation();
|
||||
extern void dp01t_0F_4_move_anim(void);
|
||||
extern void sub_8047858();
|
||||
extern void DoHitAnimHealthboxEffect();
|
||||
extern u8 GetBattlerSide(u8);
|
||||
extern void StartBattleIntroAnim();
|
||||
extern void HandleIntroSlide();
|
||||
extern void sub_803A3A8(struct Sprite *);
|
||||
extern void sub_8044CA0(u8);
|
||||
extern void nullsub_47(void);
|
||||
extern bool8 IsDoubleBattle(void);
|
||||
extern void sub_8037840(void);
|
||||
extern void sub_8031B74();
|
||||
extern u8 move_anim_start_t3();
|
||||
extern u8 TryHandleLaunchBattleTableAnimation();
|
||||
extern void sub_8037FD8(void);
|
||||
extern void sub_8037F34(void);
|
||||
extern void LinkOpponentBufferExecCompleted(void);
|
||||
extern void sub_804777C();
|
||||
|
||||
// this file's functions
|
||||
|
||||
|
|
@ -276,9 +276,9 @@ void sub_80375B4(void)
|
|||
|
||||
void sub_8037644(void)
|
||||
{
|
||||
if ((--ewram17810[gActiveBattler].unk9) == 0xFF)
|
||||
if ((--gBattleHealthBoxInfo[gActiveBattler].unk9) == 0xFF)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk9 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].unk9 = 0;
|
||||
LinkOpponentBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
|
|
@ -305,12 +305,12 @@ void sub_8037680(void)
|
|||
{
|
||||
if (GetBattlerPosition(gActiveBattler) == 1)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk1_0 || !ewram17810[gActiveBattler ^ 2].unk1_0)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].finishedShinyMonAnim || !gBattleHealthBoxInfo[gActiveBattler ^ 2].finishedShinyMonAnim)
|
||||
return;
|
||||
ewram17810[gActiveBattler].unk0_7 = 0;
|
||||
ewram17810[gActiveBattler].unk1_0 = 0;
|
||||
ewram17810[gActiveBattler ^ 2].unk0_7 = 0;
|
||||
ewram17810[gActiveBattler ^ 2].unk1_0 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].triedShinyMonAnim = FALSE;
|
||||
gBattleHealthBoxInfo[gActiveBattler].finishedShinyMonAnim = FALSE;
|
||||
gBattleHealthBoxInfo[gActiveBattler ^ 2].triedShinyMonAnim = FALSE;
|
||||
gBattleHealthBoxInfo[gActiveBattler ^ 2].finishedShinyMonAnim = FALSE;
|
||||
FreeSpriteTilesByTag(0x27F9);
|
||||
FreeSpritePaletteByTag(0x27F9);
|
||||
}
|
||||
|
|
@ -323,45 +323,45 @@ void sub_8037680(void)
|
|||
{
|
||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 256);
|
||||
}
|
||||
ewram17810[gActiveBattler].unk9 = 3;
|
||||
gBattleHealthBoxInfo[gActiveBattler].unk9 = 3;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_8037644;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8037840(void)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_3 && !ewram17810[gActiveBattler].unk0_7)
|
||||
sub_8141828(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]);
|
||||
if (!ewram17810[gActiveBattler ^ 2].unk0_3 && !ewram17810[gActiveBattler ^ 2].unk0_7)
|
||||
sub_8141828(gActiveBattler ^ 2, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler ^ 2]]);
|
||||
if (!ewram17810[gActiveBattler].unk0_3 && !ewram17810[gActiveBattler ^ 2].unk0_3)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].ballAnimActive && !gBattleHealthBoxInfo[gActiveBattler].triedShinyMonAnim)
|
||||
TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]);
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler ^ 2].ballAnimActive && !gBattleHealthBoxInfo[gActiveBattler ^ 2].triedShinyMonAnim)
|
||||
TryShinyAnimation(gActiveBattler ^ 2, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler ^ 2]]);
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].ballAnimActive && !gBattleHealthBoxInfo[gActiveBattler ^ 2].ballAnimActive)
|
||||
{
|
||||
if ((gBattleTypeFlags & BATTLE_TYPE_MULTI) && GetBattlerPosition(gActiveBattler) == 3)
|
||||
{
|
||||
if (++ewram17810[gActiveBattler].unk9 == 1)
|
||||
if (++gBattleHealthBoxInfo[gActiveBattler].unk9 == 1)
|
||||
return;
|
||||
ewram17810[gActiveBattler].unk9 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].unk9 = 0;
|
||||
}
|
||||
if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI))
|
||||
{
|
||||
DestroySprite(&gSprites[gUnknown_0300434C[gActiveBattler ^ 2]]);
|
||||
sub_8045A5C(
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler ^ 2]]);
|
||||
UpdateHealthboxAttribute(
|
||||
gHealthboxSpriteIds[gActiveBattler ^ 2],
|
||||
&gEnemyParty[gBattlerPartyIndexes[gActiveBattler ^ 2]],
|
||||
0);
|
||||
sub_804777C(gActiveBattler ^ 2);
|
||||
sub_8043DFC(gHealthboxSpriteIds[gActiveBattler ^ 2]);
|
||||
StartHealthboxSlideIn(gActiveBattler ^ 2);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler ^ 2]);
|
||||
sub_8032984(
|
||||
gActiveBattler ^ 2,
|
||||
GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler ^ 2]], MON_DATA_SPECIES));
|
||||
}
|
||||
DestroySprite(&gSprites[gUnknown_0300434C[gActiveBattler]]);
|
||||
sub_8045A5C(
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]);
|
||||
UpdateHealthboxAttribute(
|
||||
gHealthboxSpriteIds[gActiveBattler],
|
||||
&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]],
|
||||
0);
|
||||
sub_804777C(gActiveBattler);
|
||||
sub_8043DFC(gHealthboxSpriteIds[gActiveBattler]);
|
||||
StartHealthboxSlideIn(gActiveBattler);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
sub_8032984(
|
||||
gActiveBattler,
|
||||
GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES));
|
||||
|
|
@ -376,15 +376,15 @@ void sub_8037A74(void)
|
|||
if (gSprites[gBattlerSpriteIds[gActiveBattler]].animEnded == TRUE
|
||||
&& gSprites[gBattlerSpriteIds[gActiveBattler]].x2 == 0)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_7)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].triedShinyMonAnim)
|
||||
{
|
||||
sub_8141828(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]);
|
||||
TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]);
|
||||
return;
|
||||
}
|
||||
if (ewram17810[gActiveBattler].unk1_0)
|
||||
if (gBattleHealthBoxInfo[gActiveBattler].finishedShinyMonAnim)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk0_7 = 0;
|
||||
ewram17810[gActiveBattler].unk1_0 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].triedShinyMonAnim = FALSE;
|
||||
gBattleHealthBoxInfo[gActiveBattler].finishedShinyMonAnim = FALSE;
|
||||
FreeSpriteTilesByTag(0x27F9);
|
||||
FreeSpritePaletteByTag(0x27F9);
|
||||
LinkOpponentBufferExecCompleted();
|
||||
|
|
@ -395,11 +395,11 @@ void sub_8037A74(void)
|
|||
|
||||
void sub_8037B24(void)
|
||||
{
|
||||
s16 r4 = sub_8045C78(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], 0, 0);
|
||||
s16 r4 = MoveBattleBar(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], 0, 0);
|
||||
|
||||
sub_8043DFC(gHealthboxSpriteIds[gActiveBattler]);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
if (r4 != -1)
|
||||
sub_80440EC(gHealthboxSpriteIds[gActiveBattler], r4, 0);
|
||||
UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], r4, 0);
|
||||
else
|
||||
LinkOpponentBufferExecCompleted();
|
||||
}
|
||||
|
|
@ -408,19 +408,19 @@ void sub_8037B78(void)
|
|||
{
|
||||
if (!gSprites[gBattlerSpriteIds[gActiveBattler]].inUse)
|
||||
{
|
||||
sub_8043DB0(gHealthboxSpriteIds[gActiveBattler]);
|
||||
SetHealthboxSpriteInvisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
LinkOpponentBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8037BBC(void)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_6)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].specialAnimActive)
|
||||
{
|
||||
FreeSpriteOamMatrix(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
DestroySprite(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
sub_8032A08(gActiveBattler);
|
||||
sub_8043DB0(gHealthboxSpriteIds[gActiveBattler]);
|
||||
SetHealthboxSpriteInvisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
LinkOpponentBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
|
|
@ -454,36 +454,36 @@ void sub_8037CC0(void)
|
|||
{
|
||||
if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy)
|
||||
{
|
||||
if (gBattleSpriteInfo[gActiveBattler].substituteSprite)
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, gActiveBattler, 6);
|
||||
if (gBattleSpriteInfo[gActiveBattler].behindSubstitute)
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, 6);
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_8037D2C;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8037D2C(void)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_6)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].specialAnimActive)
|
||||
{
|
||||
CreateTask(c3_0802FDF4, 10);
|
||||
CreateTask(Task_PlayerController_RestoreBgmAfterCry, 10);
|
||||
LinkOpponentBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8037D64(void)
|
||||
{
|
||||
if (ewram17810[gActiveBattler].unk1_0)
|
||||
if (gBattleHealthBoxInfo[gActiveBattler].finishedShinyMonAnim)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk0_7 = 0;
|
||||
ewram17810[gActiveBattler].unk1_0 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].triedShinyMonAnim = FALSE;
|
||||
gBattleHealthBoxInfo[gActiveBattler].finishedShinyMonAnim = FALSE;
|
||||
FreeSpriteTilesByTag(0x27F9);
|
||||
FreeSpritePaletteByTag(0x27F9);
|
||||
StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0);
|
||||
sub_8045A5C(
|
||||
UpdateHealthboxAttribute(
|
||||
gHealthboxSpriteIds[gActiveBattler],
|
||||
&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]],
|
||||
0);
|
||||
sub_804777C(gActiveBattler);
|
||||
sub_8043DFC(gHealthboxSpriteIds[gActiveBattler]);
|
||||
StartHealthboxSlideIn(gActiveBattler);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
sub_8031F88(gActiveBattler);
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_8037CC0;
|
||||
}
|
||||
|
|
@ -491,12 +491,12 @@ void sub_8037D64(void)
|
|||
|
||||
void sub_8037E30(void)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_3 && !ewram17810[gActiveBattler].unk0_7)
|
||||
sub_8141828(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]);
|
||||
if (gSprites[gUnknown_0300434C[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& !ewram17810[gActiveBattler].unk0_3)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].ballAnimActive && !gBattleHealthBoxInfo[gActiveBattler].triedShinyMonAnim)
|
||||
TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]);
|
||||
if (gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& !gBattleHealthBoxInfo[gActiveBattler].ballAnimActive)
|
||||
{
|
||||
DestroySprite(&gSprites[gUnknown_0300434C[gActiveBattler]]);
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]);
|
||||
sub_8032984(gActiveBattler, GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES));
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_8037D64;
|
||||
}
|
||||
|
|
@ -534,13 +534,13 @@ void sub_8037F34(void)
|
|||
|
||||
void sub_8037FAC(void)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_4)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].statusAnimActive)
|
||||
LinkOpponentBufferExecCompleted();
|
||||
}
|
||||
|
||||
void sub_8037FD8(void)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_5)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].animFromTableActive)
|
||||
LinkOpponentBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
|
@ -1146,12 +1146,12 @@ void LinkOpponentHandleLoadPokeSprite(void)
|
|||
u16 species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES);
|
||||
|
||||
BattleLoadOpponentMonSprite(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler);
|
||||
GetMonSpriteTemplate_803C56C(species, GetBattlerPosition(gActiveBattler));
|
||||
SetMultiuseSpriteTemplateToPokemon(species, GetBattlerPosition(gActiveBattler));
|
||||
gBattlerSpriteIds[gActiveBattler] = CreateSprite(
|
||||
&gCreatingSpriteTemplate,
|
||||
GetBattlerSpriteCoord(gActiveBattler, 2),
|
||||
sub_8077F68(gActiveBattler),
|
||||
GetBattlerSubpriority(gActiveBattler));
|
||||
GetBattlerSpriteDefault_Y(gActiveBattler),
|
||||
GetBattlerSpriteSubpriority(gActiveBattler));
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = -240;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler;
|
||||
|
|
@ -1174,29 +1174,29 @@ void sub_8039430(u8 a, u8 b)
|
|||
sub_8032AA8(a, b);
|
||||
gBattlerPartyIndexes[a] = gBattleBufferA[a][1];
|
||||
species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[a]], MON_DATA_SPECIES);
|
||||
gUnknown_0300434C[a] = CreateInvisibleSpriteWithCallback(sub_80312F0);
|
||||
gBattleControllerData[a] = CreateInvisibleSpriteWithCallback(SpriteCB_WaitForBattlerBallReleaseAnim);
|
||||
BattleLoadOpponentMonSprite(&gEnemyParty[gBattlerPartyIndexes[a]], a);
|
||||
GetMonSpriteTemplate_803C56C(species, GetBattlerPosition(a));
|
||||
SetMultiuseSpriteTemplateToPokemon(species, GetBattlerPosition(a));
|
||||
gBattlerSpriteIds[a] = CreateSprite(
|
||||
&gCreatingSpriteTemplate,
|
||||
GetBattlerSpriteCoord(a, 2),
|
||||
sub_8077F68(a),
|
||||
GetBattlerSubpriority(a));
|
||||
gSprites[gUnknown_0300434C[a]].data[1] = gBattlerSpriteIds[a];
|
||||
GetBattlerSpriteDefault_Y(a),
|
||||
GetBattlerSpriteSubpriority(a));
|
||||
gSprites[gBattleControllerData[a]].data[1] = gBattlerSpriteIds[a];
|
||||
gSprites[gBattlerSpriteIds[a]].data[0] = a;
|
||||
gSprites[gBattlerSpriteIds[a]].data[2] = species;
|
||||
gSprites[gBattlerSpriteIds[a]].oam.paletteNum = a;
|
||||
StartSpriteAnim(&gSprites[gBattlerSpriteIds[a]], gBattleMonForms[a]);
|
||||
gSprites[gBattlerSpriteIds[a]].invisible = TRUE;
|
||||
gSprites[gBattlerSpriteIds[a]].callback = SpriteCallbackDummy;
|
||||
gSprites[gUnknown_0300434C[a]].data[0] = StartSendOutMonAnimation(0, 0xFE);
|
||||
gSprites[gBattleControllerData[a]].data[0] = DoPokeballSendOutAnimation(0, 0xFE);
|
||||
}
|
||||
|
||||
void LinkOpponentHandleReturnPokeToBall(void)
|
||||
{
|
||||
if (gBattleBufferA[gActiveBattler][1] == 0)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk4 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 0;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_8039648;
|
||||
}
|
||||
else
|
||||
|
|
@ -1204,25 +1204,25 @@ void LinkOpponentHandleReturnPokeToBall(void)
|
|||
FreeSpriteOamMatrix(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
DestroySprite(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
sub_8032A08(gActiveBattler);
|
||||
sub_8043DB0(gHealthboxSpriteIds[gActiveBattler]);
|
||||
SetHealthboxSpriteInvisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
LinkOpponentBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8039648(void)
|
||||
{
|
||||
switch (ewram17810[gActiveBattler].unk4)
|
||||
switch (gBattleHealthBoxInfo[gActiveBattler].animationState)
|
||||
{
|
||||
case 0:
|
||||
if (gBattleSpriteInfo[gActiveBattler].substituteSprite)
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, gActiveBattler, 5);
|
||||
ewram17810[gActiveBattler].unk4 = 1;
|
||||
if (gBattleSpriteInfo[gActiveBattler].behindSubstitute)
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, 5);
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 1;
|
||||
break;
|
||||
case 1:
|
||||
if (!ewram17810[gActiveBattler].unk0_6)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].specialAnimActive)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk4 = 0;
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, gActiveBattler, 2);
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 0;
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, 2);
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_8037BBC;
|
||||
}
|
||||
break;
|
||||
|
|
@ -1248,18 +1248,18 @@ void LinkOpponentHandleTrainerThrow(void)
|
|||
gender = gLinkPlayers[GetMultiplayerId() ^ 1].gender;
|
||||
}
|
||||
sub_8031A6C(gender, gActiveBattler);
|
||||
GetMonSpriteTemplate_803C5A0(gender, GetBattlerPosition(gActiveBattler));
|
||||
SetMultiuseSpriteTemplateToTrainerBack(gender, GetBattlerPosition(gActiveBattler));
|
||||
gBattlerSpriteIds[gActiveBattler] = CreateSprite(
|
||||
&gCreatingSpriteTemplate,
|
||||
176 + xOffset, 40 + 4 * (8 - gTrainerFrontPicCoords[gender].coords),
|
||||
GetBattlerSubpriority(gActiveBattler));
|
||||
GetBattlerSpriteSubpriority(gActiveBattler));
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = -240;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 2;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[gender].tag);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[5] = gSprites[gBattlerSpriteIds[gActiveBattler]].oam.tileNum;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.tileNum = GetSpriteTileStartByTag(gTrainerFrontPicTable[gender].tag);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.affineParam = gender;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_80313A0;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_TrainerSlideIn;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_803757C;
|
||||
}
|
||||
|
||||
|
|
@ -1270,7 +1270,7 @@ void LinkOpponentHandleTrainerSlide(void)
|
|||
|
||||
void LinkOpponentHandleTrainerSlideBack(void)
|
||||
{
|
||||
oamt_add_pos2_onto_pos1(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
SetSpritePrimaryCoordsFromSecondaryCoords(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 35;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = 280;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].y;
|
||||
|
|
@ -1281,15 +1281,15 @@ void LinkOpponentHandleTrainerSlideBack(void)
|
|||
|
||||
void LinkOpponentHandlecmd10(void)
|
||||
{
|
||||
if (ewram17810[gActiveBattler].unk4 == 0)
|
||||
if (gBattleHealthBoxInfo[gActiveBattler].animationState == 0)
|
||||
{
|
||||
if (gBattleSpriteInfo[gActiveBattler].substituteSprite)
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, gActiveBattler, 5);
|
||||
ewram17810[gActiveBattler].unk4++;
|
||||
if (gBattleSpriteInfo[gActiveBattler].behindSubstitute)
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, 5);
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState++;
|
||||
}
|
||||
else if (!ewram17810[gActiveBattler].unk0_6)
|
||||
else if (!gBattleHealthBoxInfo[gActiveBattler].specialAnimActive)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk4 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 0;
|
||||
PlaySE12WithPanning(SE_FAINT, 63);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_8010384;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_8037B78;
|
||||
|
|
@ -1343,7 +1343,7 @@ void LinkOpponentHandleMoveAnimation(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
ewram17810[gActiveBattler].unk4 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 0;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_8039B64;
|
||||
}
|
||||
}
|
||||
|
|
@ -1355,45 +1355,45 @@ void sub_8039B64(void)
|
|||
| (gBattleBufferA[gActiveBattler][2] << 8);
|
||||
u8 r7 = gBattleBufferA[gActiveBattler][11];
|
||||
|
||||
switch (ewram17810[gActiveBattler].unk4)
|
||||
switch (gBattleHealthBoxInfo[gActiveBattler].animationState)
|
||||
{
|
||||
case 0:
|
||||
if (gBattleSpriteInfo[gActiveBattler].substituteSprite && !gBattleSpriteInfo[gActiveBattler].flag_x8)
|
||||
if (gBattleSpriteInfo[gActiveBattler].behindSubstitute && !gBattleSpriteInfo[gActiveBattler].flag_x8)
|
||||
{
|
||||
gBattleSpriteInfo[gActiveBattler].flag_x8 = 1;
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, gActiveBattler, 5);
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, 5);
|
||||
}
|
||||
ewram17810[gActiveBattler].unk4 = 1;
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 1;
|
||||
break;
|
||||
case 1:
|
||||
if (!ewram17810[gActiveBattler].unk0_6)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].specialAnimActive)
|
||||
{
|
||||
sub_80326EC(0);
|
||||
SetBattlerSpriteAffineMode(0);
|
||||
DoMoveAnim(r4);
|
||||
ewram17810[gActiveBattler].unk4 = 2;
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 2;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
gAnimScriptCallback();
|
||||
if (!gAnimScriptActive)
|
||||
{
|
||||
sub_80326EC(1);
|
||||
if ((gBattleSpriteInfo[gActiveBattler].substituteSprite) && r7 <= 1)
|
||||
SetBattlerSpriteAffineMode(1);
|
||||
if ((gBattleSpriteInfo[gActiveBattler].behindSubstitute) && r7 <= 1)
|
||||
{
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, gActiveBattler, 6);
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, 6);
|
||||
gBattleSpriteInfo[gActiveBattler].flag_x8 = 0;
|
||||
}
|
||||
ewram17810[gActiveBattler].unk4 = 3;
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 3;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (!ewram17810[gActiveBattler].unk0_6)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].specialAnimActive)
|
||||
{
|
||||
sub_8031F24();
|
||||
sub_80324BC(
|
||||
CopyAllBattleSpritesInvisibilities();
|
||||
TrySetBehindSubstituteSpriteBit(
|
||||
gActiveBattler,
|
||||
gBattleBufferA[gActiveBattler][1] | (gBattleBufferA[gActiveBattler][2] << 8));
|
||||
ewram17810[gActiveBattler].unk4 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 0;
|
||||
LinkOpponentBufferExecCompleted();
|
||||
}
|
||||
break;
|
||||
|
|
@ -1448,20 +1448,20 @@ void LinkOpponentHandleHealthBarUpdate(void)
|
|||
{
|
||||
s16 r7;
|
||||
|
||||
load_gfxc_health_bar(0);
|
||||
LoadBattleBarGfx(0);
|
||||
r7 = gBattleBufferA[gActiveBattler][2] | (gBattleBufferA[gActiveBattler][3] << 8);
|
||||
if (r7 != 0x7FFF)
|
||||
{
|
||||
u32 maxHP = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MAX_HP);
|
||||
u32 hp = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_HP);
|
||||
|
||||
sub_8043D84(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, hp, r7);
|
||||
SetBattleBarStruct(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, hp, r7);
|
||||
}
|
||||
else
|
||||
{
|
||||
u32 maxHP = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MAX_HP);
|
||||
|
||||
sub_8043D84(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, 0, r7);
|
||||
SetBattleBarStruct(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, 0, r7);
|
||||
}
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_8037B24;
|
||||
}
|
||||
|
|
@ -1475,8 +1475,8 @@ void LinkOpponentHandleStatusIconUpdate(void)
|
|||
{
|
||||
if (mplay_80342A4(gActiveBattler) == 0)
|
||||
{
|
||||
sub_8045A5C(gHealthboxSpriteIds[gActiveBattler], &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], 9);
|
||||
ewram17810[gActiveBattler].unk0_4 = 0;
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], 9);
|
||||
gBattleHealthBoxInfo[gActiveBattler].statusAnimActive = 0;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_8037FAC;
|
||||
}
|
||||
}
|
||||
|
|
@ -1574,7 +1574,7 @@ void LinkOpponentHandleHitAnimation(void)
|
|||
{
|
||||
gDoingBattleAnim = TRUE;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[1] = 0;
|
||||
sub_8047858(gActiveBattler);
|
||||
DoHitAnimHealthboxEffect(gActiveBattler);
|
||||
gBattlerControllerFuncs[gActiveBattler] = dp01t_0F_4_move_anim;
|
||||
}
|
||||
}
|
||||
|
|
@ -1612,7 +1612,7 @@ void LinkOpponentHandleFaintingCry(void)
|
|||
|
||||
void LinkOpponentHandleIntroSlide(void)
|
||||
{
|
||||
StartBattleIntroAnim(gBattleBufferA[gActiveBattler][1]);
|
||||
HandleIntroSlide(gBattleBufferA[gActiveBattler][1]);
|
||||
gIntroSlideFlags |= 1;
|
||||
LinkOpponentBufferExecCompleted();
|
||||
}
|
||||
|
|
@ -1621,7 +1621,7 @@ void LinkOpponentHandleTrainerBallThrow(void)
|
|||
{
|
||||
u8 taskId;
|
||||
|
||||
oamt_add_pos2_onto_pos1(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
SetSpritePrimaryCoordsFromSecondaryCoords(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 35;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = 280;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].y;
|
||||
|
|
@ -1629,8 +1629,8 @@ void LinkOpponentHandleTrainerBallThrow(void)
|
|||
StoreSpriteCallbackInData(&gSprites[gBattlerSpriteIds[gActiveBattler]], sub_803A3A8);
|
||||
taskId = CreateTask(sub_803A2C4, 5);
|
||||
gTasks[taskId].data[0] = gActiveBattler;
|
||||
if (ewram17810[gActiveBattler].unk0_0)
|
||||
gTasks[gUnknown_02024E68[gActiveBattler]].func = sub_8044CA0;
|
||||
if (gBattleHealthBoxInfo[gActiveBattler].partyStatusSummaryShown)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8044CA0;
|
||||
ewram17840.unk9_0 = 1;
|
||||
gBattlerControllerFuncs[gActiveBattler] = nullsub_47;
|
||||
}
|
||||
|
|
@ -1676,43 +1676,43 @@ void LinkOpponentHandlecmd48(void)
|
|||
return;
|
||||
}
|
||||
|
||||
ewram17810[gActiveBattler].unk0_0 = 1;
|
||||
gBattleHealthBoxInfo[gActiveBattler].partyStatusSummaryShown = 1;
|
||||
if (gBattleBufferA[gActiveBattler][2] != 0)
|
||||
{
|
||||
if (ewram17810[gActiveBattler].unk1_1 < 2)
|
||||
if (gBattleHealthBoxInfo[gActiveBattler].unk1_1 < 2)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk1_1++;
|
||||
gBattleHealthBoxInfo[gActiveBattler].unk1_1++;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
ewram17810[gActiveBattler].unk1_1 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].unk1_1 = 0;
|
||||
}
|
||||
}
|
||||
gUnknown_02024E68[gActiveBattler] = CreatePartyStatusSummarySprites(
|
||||
gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(
|
||||
gActiveBattler,
|
||||
(struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4],
|
||||
gBattleBufferA[gActiveBattler][1],
|
||||
gBattleBufferA[gActiveBattler][2]);
|
||||
ewram17810[gActiveBattler].unk5 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].unk5 = 0;
|
||||
if (gBattleBufferA[gActiveBattler][2] != 0)
|
||||
ewram17810[gActiveBattler].unk5 = 0x5D;
|
||||
gBattleHealthBoxInfo[gActiveBattler].unk5 = 0x5D;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_803A4E0;
|
||||
}
|
||||
|
||||
void sub_803A4E0(void)
|
||||
{
|
||||
if (ewram17810[gActiveBattler].unk5++ >= 93)
|
||||
if (gBattleHealthBoxInfo[gActiveBattler].unk5++ >= 93)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk5 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].unk5 = 0;
|
||||
LinkOpponentBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
|
||||
void LinkOpponentHandlecmd49(void)
|
||||
{
|
||||
if (ewram17810[gActiveBattler].unk0_0)
|
||||
gTasks[gUnknown_02024E68[gActiveBattler]].func = sub_8044CA0;
|
||||
if (gBattleHealthBoxInfo[gActiveBattler].partyStatusSummaryShown)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8044CA0;
|
||||
LinkOpponentBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
|
@ -1738,7 +1738,7 @@ void LinkOpponentHandleBattleAnimation(void)
|
|||
u8 r3 = gBattleBufferA[gActiveBattler][1];
|
||||
u16 r4 = gBattleBufferA[gActiveBattler][2] | (gBattleBufferA[gActiveBattler][3] << 8);
|
||||
|
||||
if (move_anim_start_t3(gActiveBattler, gActiveBattler, gActiveBattler, r3, r4) != 0)
|
||||
if (TryHandleLaunchBattleTableAnimation(gActiveBattler, gActiveBattler, gActiveBattler, r3, r4) != 0)
|
||||
LinkOpponentBufferExecCompleted();
|
||||
else
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_8037FD8;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ extern u16 gBattlerPartyIndexes[];
|
|||
extern u8 gBattlerSpriteIds[];
|
||||
extern u8 gBattleOutcome;
|
||||
extern u16 gIntroSlideFlags;
|
||||
extern u8 gUnknown_02024E68[];
|
||||
extern u8 gBattlerStatusSummaryTaskId[];
|
||||
extern u8 gDoingBattleAnim;
|
||||
extern u32 gTransformedPersonalities[];
|
||||
extern struct SpriteTemplate gCreatingSpriteTemplate;
|
||||
|
|
@ -52,38 +52,38 @@ extern struct Window gWindowTemplate_Contest_MoveDescription;
|
|||
extern MainCallback gPreBattleCallback1;
|
||||
extern void (*gBattlerControllerFuncs[])(void);
|
||||
extern u8 gHealthboxSpriteIds[];
|
||||
extern u8 gUnknown_0300434C[];
|
||||
extern u8 gBattleControllerData[];
|
||||
extern u8 gBattleMonForms[];
|
||||
extern u8 gAnimScriptActive;
|
||||
extern void (*gAnimScriptCallback)(void);
|
||||
|
||||
extern u8 move_anim_start_t3();
|
||||
extern u8 TryHandleLaunchBattleTableAnimation();
|
||||
extern void sub_8044CA0(u8);
|
||||
extern void sub_8030E38(struct Sprite *);
|
||||
extern void StartBattleIntroAnim();
|
||||
extern void sub_8047858();
|
||||
extern void SpriteCB_FreePlayerSpriteLoadMonSprite(struct Sprite *);
|
||||
extern void HandleIntroSlide();
|
||||
extern void DoHitAnimHealthboxEffect();
|
||||
extern void move_anim_start_t2_for_situation();
|
||||
extern void BufferStringBattle();
|
||||
extern void sub_8031F24(void);
|
||||
extern void sub_80326EC();
|
||||
extern void sub_80324BC();
|
||||
extern void CopyAllBattleSpritesInvisibilities(void);
|
||||
extern void SetBattlerSpriteAffineMode();
|
||||
extern void TrySetBehindSubstituteSpriteBit();
|
||||
extern u8 IsMoveWithoutAnimation();
|
||||
extern u8 mplay_80342A4();
|
||||
extern void oamt_add_pos2_onto_pos1();
|
||||
extern void SetSpritePrimaryCoordsFromSecondaryCoords();
|
||||
extern void StoreSpriteCallbackInData();
|
||||
extern void StartAnimLinearTranslation(struct Sprite *);
|
||||
extern void sub_80105EC(struct Sprite *);
|
||||
extern s32 sub_803FC34(u16);
|
||||
extern void LoadPlayerTrainerBankSprite();
|
||||
extern void sub_80313A0(struct Sprite *);
|
||||
extern u8 StartSendOutMonAnimation();
|
||||
extern void sub_80312F0(struct Sprite *);
|
||||
extern void DecompressTrainerBackPic();
|
||||
extern void SpriteCB_TrainerSlideIn(struct Sprite *);
|
||||
extern u8 DoPokeballSendOutAnimation();
|
||||
extern void SpriteCB_WaitForBattlerBallReleaseAnim(struct Sprite *);
|
||||
extern u8 CreateInvisibleSpriteWithCallback();
|
||||
extern void BattleLoadPlayerMonSprite();
|
||||
extern u8 sub_8077F68();
|
||||
extern u8 GetBattlerSpriteDefault_Y();
|
||||
extern void nullsub_10();
|
||||
extern void nullsub_9(u16);
|
||||
extern void c3_0802FDF4(u8);
|
||||
extern void Task_PlayerController_RestoreBgmAfterCry(u8);
|
||||
extern void c2_8011A1C(void);
|
||||
|
||||
// this file's functions
|
||||
|
|
@ -260,9 +260,9 @@ void sub_811DB1C(void)
|
|||
|
||||
void sub_811DB84(void)
|
||||
{
|
||||
if ((--ewram17810[gActiveBattler].unk9) == 0xFF)
|
||||
if ((--gBattleHealthBoxInfo[gActiveBattler].unk9) == 0xFF)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk9 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].unk9 = 0;
|
||||
LinkPartnerBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
|
|
@ -286,7 +286,7 @@ void sub_811DBC0(void)
|
|||
r6 = FALSE;
|
||||
if (r6)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk9 = 3;
|
||||
gBattleHealthBoxInfo[gActiveBattler].unk9 = 3;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_811DB84;
|
||||
}
|
||||
}
|
||||
|
|
@ -295,25 +295,25 @@ void sub_811DCA0(void)
|
|||
{
|
||||
u8 r2;
|
||||
|
||||
if (!ewram17810[gActiveBattler].unk0_3)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].ballAnimActive)
|
||||
{
|
||||
// I couldn't get it to work as a bitfield here
|
||||
r2 = *((u8 *)&ewram17810[gActiveBattler ^ 2]) & 8;
|
||||
if (!r2 && (++ewram17810[gActiveBattler].unk9) != 1)
|
||||
r2 = *((u8 *)&gBattleHealthBoxInfo[gActiveBattler ^ 2]) & 8;
|
||||
if (!r2 && (++gBattleHealthBoxInfo[gActiveBattler].unk9) != 1)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk9 = r2;
|
||||
gBattleHealthBoxInfo[gActiveBattler].unk9 = r2;
|
||||
if (IsDoubleBattle() && !(gBattleTypeFlags & 0x40))
|
||||
{
|
||||
DestroySprite(&gSprites[gUnknown_0300434C[gActiveBattler ^ 2]]);
|
||||
sub_8045A5C(gHealthboxSpriteIds[gActiveBattler ^ 2], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ 2]], 0);
|
||||
sub_804777C(gActiveBattler ^ 2);
|
||||
sub_8043DFC(gHealthboxSpriteIds[gActiveBattler ^ 2]);
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler ^ 2]]);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler ^ 2], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ 2]], 0);
|
||||
StartHealthboxSlideIn(gActiveBattler ^ 2);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler ^ 2]);
|
||||
}
|
||||
DestroySprite(&gSprites[gUnknown_0300434C[gActiveBattler]]);
|
||||
sub_8045A5C(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], 0);
|
||||
sub_804777C(gActiveBattler);
|
||||
sub_8043DFC(gHealthboxSpriteIds[gActiveBattler]);
|
||||
ewram17810[4].unk9 = (s8)ewram17810[4].unk9 & ~1;
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], 0);
|
||||
StartHealthboxSlideIn(gActiveBattler);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
gBattleHealthBoxInfo[4].unk9 = (s8)gBattleHealthBoxInfo[4].unk9 & ~1;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_811DBC0;
|
||||
}
|
||||
}
|
||||
|
|
@ -330,11 +330,11 @@ void bx_t3_healthbar_update(void)
|
|||
{
|
||||
s16 r4;
|
||||
|
||||
r4 = sub_8045C78(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], 0, 0);
|
||||
sub_8043DFC(gHealthboxSpriteIds[gActiveBattler]);
|
||||
r4 = MoveBattleBar(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], 0, 0);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
if (r4 != -1)
|
||||
{
|
||||
sub_80440EC(gHealthboxSpriteIds[gActiveBattler], r4, 0);
|
||||
UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], r4, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -350,18 +350,18 @@ void sub_811DE98(void)
|
|||
nullsub_9(GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES));
|
||||
FreeOamMatrix(gSprites[gBattlerSpriteIds[gActiveBattler]].oam.matrixNum);
|
||||
DestroySprite(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
sub_8043DB0(gHealthboxSpriteIds[gActiveBattler]);
|
||||
SetHealthboxSpriteInvisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
LinkPartnerBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
|
||||
void sub_811DF34(void)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_6)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].specialAnimActive)
|
||||
{
|
||||
FreeSpriteOamMatrix(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
DestroySprite(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
sub_8043DB0(gHealthboxSpriteIds[gActiveBattler]);
|
||||
SetHealthboxSpriteInvisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
LinkPartnerBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
|
|
@ -396,32 +396,32 @@ void sub_811E034(void)
|
|||
{
|
||||
if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy)
|
||||
{
|
||||
if (gBattleSpriteInfo[gActiveBattler].substituteSprite)
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, gActiveBattler, 6);
|
||||
if (gBattleSpriteInfo[gActiveBattler].behindSubstitute)
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, 6);
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_811E0A0;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_811E0A0(void)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_6)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].specialAnimActive)
|
||||
LinkPartnerBufferExecCompleted();
|
||||
}
|
||||
|
||||
void sub_811E0CC(void)
|
||||
{
|
||||
if (ewram17810[gActiveBattler].unk1_0)
|
||||
if (gBattleHealthBoxInfo[gActiveBattler].finishedShinyMonAnim)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk0_7 = 0;
|
||||
ewram17810[gActiveBattler].unk1_0 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].triedShinyMonAnim = FALSE;
|
||||
gBattleHealthBoxInfo[gActiveBattler].finishedShinyMonAnim = FALSE;
|
||||
FreeSpriteTilesByTag(0x27F9);
|
||||
FreeSpritePaletteByTag(0x27F9);
|
||||
CreateTask(c3_0802FDF4, 10);
|
||||
CreateTask(Task_PlayerController_RestoreBgmAfterCry, 10);
|
||||
HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler);
|
||||
StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0);
|
||||
sub_8045A5C(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], 0);
|
||||
sub_804777C(gActiveBattler);
|
||||
sub_8043DFC(gHealthboxSpriteIds[gActiveBattler]);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], 0);
|
||||
StartHealthboxSlideIn(gActiveBattler);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
sub_8031F88(gActiveBattler);
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_811E034;
|
||||
}
|
||||
|
|
@ -429,12 +429,12 @@ void sub_811E0CC(void)
|
|||
|
||||
void sub_811E1BC(void)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_3 && !ewram17810[gActiveBattler].unk0_7)
|
||||
sub_8141828(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]);
|
||||
if (gSprites[gUnknown_0300434C[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& !ewram17810[gActiveBattler].unk0_3)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].ballAnimActive && !gBattleHealthBoxInfo[gActiveBattler].triedShinyMonAnim)
|
||||
TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]);
|
||||
if (gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& !gBattleHealthBoxInfo[gActiveBattler].ballAnimActive)
|
||||
{
|
||||
DestroySprite(&gSprites[gUnknown_0300434C[gActiveBattler]]);
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]);
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_811E0CC;
|
||||
}
|
||||
}
|
||||
|
|
@ -488,13 +488,13 @@ void LinkPartnerBufferExecCompleted(void)
|
|||
|
||||
void sub_811E38C(void)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_4)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].statusAnimActive)
|
||||
LinkPartnerBufferExecCompleted();
|
||||
}
|
||||
|
||||
void sub_811E3B8(void)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_5)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].animFromTableActive)
|
||||
LinkPartnerBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
|
@ -1084,14 +1084,14 @@ void LinkPartnerHandlecmd3(void)
|
|||
void LinkPartnerHandleLoadPokeSprite(void)
|
||||
{
|
||||
BattleLoadPlayerMonSprite(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler);
|
||||
GetMonSpriteTemplate_803C56C(
|
||||
SetMultiuseSpriteTemplateToPokemon(
|
||||
GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES),
|
||||
GetBattlerPosition(gActiveBattler));
|
||||
gBattlerSpriteIds[gActiveBattler] = CreateSprite(
|
||||
&gCreatingSpriteTemplate,
|
||||
GetBattlerSpriteCoord(gActiveBattler, 2),
|
||||
sub_8077F68(gActiveBattler),
|
||||
GetBattlerSubpriority(gActiveBattler));
|
||||
GetBattlerSpriteDefault_Y(gActiveBattler),
|
||||
GetBattlerSpriteSubpriority(gActiveBattler));
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = -240;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler;
|
||||
|
|
@ -1115,53 +1115,53 @@ void sub_811F864(u8 a, u8 b)
|
|||
sub_8032AA8(a, b);
|
||||
gBattlerPartyIndexes[a] = gBattleBufferA[a][1];
|
||||
species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[a]], MON_DATA_SPECIES);
|
||||
gUnknown_0300434C[a] = CreateInvisibleSpriteWithCallback(sub_80312F0);
|
||||
GetMonSpriteTemplate_803C56C(species, GetBattlerPosition(a));
|
||||
gBattleControllerData[a] = CreateInvisibleSpriteWithCallback(SpriteCB_WaitForBattlerBallReleaseAnim);
|
||||
SetMultiuseSpriteTemplateToPokemon(species, GetBattlerPosition(a));
|
||||
gBattlerSpriteIds[a] = CreateSprite(
|
||||
&gCreatingSpriteTemplate,
|
||||
GetBattlerSpriteCoord(a, 2),
|
||||
sub_8077F68(a),
|
||||
GetBattlerSubpriority(a));
|
||||
gSprites[gUnknown_0300434C[a]].data[1] = gBattlerSpriteIds[a];
|
||||
GetBattlerSpriteDefault_Y(a),
|
||||
GetBattlerSpriteSubpriority(a));
|
||||
gSprites[gBattleControllerData[a]].data[1] = gBattlerSpriteIds[a];
|
||||
gSprites[gBattlerSpriteIds[a]].data[0] = a;
|
||||
gSprites[gBattlerSpriteIds[a]].data[2] = species;
|
||||
gSprites[gBattlerSpriteIds[a]].oam.paletteNum = a;
|
||||
StartSpriteAnim(&gSprites[gBattlerSpriteIds[a]], gBattleMonForms[a]);
|
||||
gSprites[gBattlerSpriteIds[a]].invisible = TRUE;
|
||||
gSprites[gBattlerSpriteIds[a]].callback = SpriteCallbackDummy;
|
||||
gSprites[gUnknown_0300434C[a]].data[0] = StartSendOutMonAnimation(0, 0xFF);
|
||||
gSprites[gBattleControllerData[a]].data[0] = DoPokeballSendOutAnimation(0, 0xFF);
|
||||
}
|
||||
|
||||
void LinkPartnerHandleReturnPokeToBall(void)
|
||||
{
|
||||
if (gBattleBufferA[gActiveBattler][1] == 0)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk4 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 0;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_811FA5C;
|
||||
}
|
||||
else
|
||||
{
|
||||
FreeSpriteOamMatrix(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
DestroySprite(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
sub_8043DB0(gHealthboxSpriteIds[gActiveBattler]);
|
||||
SetHealthboxSpriteInvisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
LinkPartnerBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
|
||||
void sub_811FA5C(void)
|
||||
{
|
||||
switch (ewram17810[gActiveBattler].unk4)
|
||||
switch (gBattleHealthBoxInfo[gActiveBattler].animationState)
|
||||
{
|
||||
case 0:
|
||||
if (gBattleSpriteInfo[gActiveBattler].substituteSprite)
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, gActiveBattler, 5);
|
||||
ewram17810[gActiveBattler].unk4 = 1;
|
||||
if (gBattleSpriteInfo[gActiveBattler].behindSubstitute)
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, 5);
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 1;
|
||||
break;
|
||||
case 1:
|
||||
if (!ewram17810[gActiveBattler].unk0_6)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].specialAnimActive)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk4 = 0;
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, gActiveBattler, 1);
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 0;
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, 1);
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_811DF34;
|
||||
}
|
||||
break;
|
||||
|
|
@ -1186,16 +1186,16 @@ void LinkPartnerHandleTrainerThrow(void)
|
|||
xOffset = 0;
|
||||
gender = gLinkPlayers[GetMultiplayerId() ^ 1].gender;
|
||||
}
|
||||
LoadPlayerTrainerBankSprite(gender, gActiveBattler);
|
||||
GetMonSpriteTemplate_803C5A0(gender, GetBattlerPosition(gActiveBattler));
|
||||
DecompressTrainerBackPic(gender, gActiveBattler);
|
||||
SetMultiuseSpriteTemplateToTrainerBack(gender, GetBattlerPosition(gActiveBattler));
|
||||
gBattlerSpriteIds[gActiveBattler] = CreateSprite(
|
||||
&gCreatingSpriteTemplate,
|
||||
80 + xOffset, 80 + 4 * (8 - gTrainerBackPicCoords[gender].coords),
|
||||
GetBattlerSubpriority(gActiveBattler));
|
||||
GetBattlerSpriteSubpriority(gActiveBattler));
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = 240;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = -2;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_80313A0;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_TrainerSlideIn;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_811DAE4;
|
||||
}
|
||||
|
||||
|
|
@ -1206,7 +1206,7 @@ void LinkPartnerHandleTrainerSlide(void)
|
|||
|
||||
void LinkPartnerHandleTrainerSlideBack(void)
|
||||
{
|
||||
oamt_add_pos2_onto_pos1(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
SetSpritePrimaryCoordsFromSecondaryCoords(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 35;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = -40;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].y;
|
||||
|
|
@ -1217,15 +1217,15 @@ void LinkPartnerHandleTrainerSlideBack(void)
|
|||
|
||||
void LinkPartnerHandlecmd10(void)
|
||||
{
|
||||
if (ewram17810[gActiveBattler].unk4 == 0)
|
||||
if (gBattleHealthBoxInfo[gActiveBattler].animationState == 0)
|
||||
{
|
||||
if (gBattleSpriteInfo[gActiveBattler].substituteSprite)
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, gActiveBattler, 5);
|
||||
ewram17810[gActiveBattler].unk4++;
|
||||
if (gBattleSpriteInfo[gActiveBattler].behindSubstitute)
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, 5);
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState++;
|
||||
}
|
||||
else if (!ewram17810[gActiveBattler].unk0_6)
|
||||
else if (!gBattleHealthBoxInfo[gActiveBattler].specialAnimActive)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk4 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 0;
|
||||
HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler);
|
||||
PlaySE12WithPanning(SE_FAINT, -64);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[1] = 0;
|
||||
|
|
@ -1279,7 +1279,7 @@ void LinkPartnerHandleMoveAnimation(void)
|
|||
LinkPartnerBufferExecCompleted();
|
||||
else
|
||||
{
|
||||
ewram17810[gActiveBattler].unk4 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 0;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_811FF30;
|
||||
}
|
||||
}
|
||||
|
|
@ -1291,45 +1291,45 @@ void sub_811FF30(void)
|
|||
| (gBattleBufferA[gActiveBattler][2] << 8);
|
||||
u8 r7 = gBattleBufferA[gActiveBattler][11];
|
||||
|
||||
switch (ewram17810[gActiveBattler].unk4)
|
||||
switch (gBattleHealthBoxInfo[gActiveBattler].animationState)
|
||||
{
|
||||
case 0:
|
||||
if (gBattleSpriteInfo[gActiveBattler].substituteSprite && !gBattleSpriteInfo[gActiveBattler].flag_x8)
|
||||
if (gBattleSpriteInfo[gActiveBattler].behindSubstitute && !gBattleSpriteInfo[gActiveBattler].flag_x8)
|
||||
{
|
||||
gBattleSpriteInfo[gActiveBattler].flag_x8 = 1;
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, gActiveBattler, 5);
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, 5);
|
||||
}
|
||||
ewram17810[gActiveBattler].unk4 = 1;
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 1;
|
||||
break;
|
||||
case 1:
|
||||
if (!ewram17810[gActiveBattler].unk0_6)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].specialAnimActive)
|
||||
{
|
||||
sub_80326EC(0);
|
||||
SetBattlerSpriteAffineMode(0);
|
||||
DoMoveAnim(r4);
|
||||
ewram17810[gActiveBattler].unk4 = 2;
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 2;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
gAnimScriptCallback();
|
||||
if (!gAnimScriptActive)
|
||||
{
|
||||
sub_80326EC(1);
|
||||
if ((gBattleSpriteInfo[gActiveBattler].substituteSprite) && r7 <= 1)
|
||||
SetBattlerSpriteAffineMode(1);
|
||||
if ((gBattleSpriteInfo[gActiveBattler].behindSubstitute) && r7 <= 1)
|
||||
{
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, gActiveBattler, 6);
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, 6);
|
||||
gBattleSpriteInfo[gActiveBattler].flag_x8 = 0;
|
||||
}
|
||||
ewram17810[gActiveBattler].unk4 = 3;
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 3;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (!ewram17810[gActiveBattler].unk0_6)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].specialAnimActive)
|
||||
{
|
||||
sub_8031F24();
|
||||
sub_80324BC(
|
||||
CopyAllBattleSpritesInvisibilities();
|
||||
TrySetBehindSubstituteSpriteBit(
|
||||
gActiveBattler,
|
||||
gBattleBufferA[gActiveBattler][1] | (gBattleBufferA[gActiveBattler][2] << 8));
|
||||
ewram17810[gActiveBattler].unk4 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 0;
|
||||
LinkPartnerBufferExecCompleted();
|
||||
}
|
||||
break;
|
||||
|
|
@ -1384,20 +1384,20 @@ void LinkPartnerHandleHealthBarUpdate(void)
|
|||
{
|
||||
s16 r7;
|
||||
|
||||
load_gfxc_health_bar(0);
|
||||
LoadBattleBarGfx(0);
|
||||
r7 = gBattleBufferA[gActiveBattler][2] | (gBattleBufferA[gActiveBattler][3] << 8);
|
||||
if (r7 != 0x7FFF)
|
||||
{
|
||||
u32 maxHP = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MAX_HP);
|
||||
u32 hp = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_HP);
|
||||
|
||||
sub_8043D84(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, hp, r7);
|
||||
SetBattleBarStruct(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, hp, r7);
|
||||
}
|
||||
else
|
||||
{
|
||||
u32 maxHP = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MAX_HP);
|
||||
|
||||
sub_8043D84(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, 0, r7);
|
||||
SetBattleBarStruct(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, 0, r7);
|
||||
}
|
||||
gBattlerControllerFuncs[gActiveBattler] = bx_t3_healthbar_update;
|
||||
}
|
||||
|
|
@ -1411,8 +1411,8 @@ void LinkPartnerHandleStatusIconUpdate(void)
|
|||
{
|
||||
if (mplay_80342A4(gActiveBattler) == 0)
|
||||
{
|
||||
sub_8045A5C(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], 9);
|
||||
ewram17810[gActiveBattler].unk0_4 = 0;
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], 9);
|
||||
gBattleHealthBoxInfo[gActiveBattler].statusAnimActive = 0;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_811E38C;
|
||||
}
|
||||
}
|
||||
|
|
@ -1510,7 +1510,7 @@ void LinkPartnerHandleHitAnimation(void)
|
|||
{
|
||||
gDoingBattleAnim = TRUE;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[1] = 0;
|
||||
sub_8047858(gActiveBattler);
|
||||
DoHitAnimHealthboxEffect(gActiveBattler);
|
||||
gBattlerControllerFuncs[gActiveBattler] = bx_blink_t3;
|
||||
}
|
||||
}
|
||||
|
|
@ -1548,7 +1548,7 @@ void LinkPartnerHandleFaintingCry(void)
|
|||
|
||||
void LinkPartnerHandleIntroSlide(void)
|
||||
{
|
||||
StartBattleIntroAnim(gBattleBufferA[gActiveBattler][1]);
|
||||
HandleIntroSlide(gBattleBufferA[gActiveBattler][1]);
|
||||
gIntroSlideFlags |= 1;
|
||||
LinkPartnerBufferExecCompleted();
|
||||
}
|
||||
|
|
@ -1558,13 +1558,13 @@ void LinkPartnerHandleTrainerBallThrow(void)
|
|||
u8 r4;
|
||||
u8 taskId;
|
||||
|
||||
oamt_add_pos2_onto_pos1(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
SetSpritePrimaryCoordsFromSecondaryCoords(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 50;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = -40;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].y;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[5] = gActiveBattler;
|
||||
StoreSpriteCallbackInData(&gSprites[gBattlerSpriteIds[gActiveBattler]], sub_8030E38);
|
||||
StoreSpriteCallbackInData(&gSprites[gBattlerSpriteIds[gActiveBattler]], SpriteCB_FreePlayerSpriteLoadMonSprite);
|
||||
StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 1);
|
||||
r4 = AllocSpritePalette(0xD6F9);
|
||||
LoadCompressedPalette(
|
||||
|
|
@ -1573,8 +1573,8 @@ void LinkPartnerHandleTrainerBallThrow(void)
|
|||
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = r4;
|
||||
taskId = CreateTask(sub_812071C, 5);
|
||||
gTasks[taskId].data[0] = gActiveBattler;
|
||||
if (ewram17810[gActiveBattler].unk0_0)
|
||||
gTasks[gUnknown_02024E68[gActiveBattler]].func = sub_8044CA0;
|
||||
if (gBattleHealthBoxInfo[gActiveBattler].partyStatusSummaryShown)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8044CA0;
|
||||
ewram17840.unk9_0 = 1;
|
||||
gBattlerControllerFuncs[gActiveBattler] = nullsub_74;
|
||||
}
|
||||
|
|
@ -1619,31 +1619,31 @@ void LinkPartnerHandlecmd48(void)
|
|||
return;
|
||||
}
|
||||
|
||||
ewram17810[gActiveBattler].unk0_0 = 1;
|
||||
gUnknown_02024E68[gActiveBattler] = CreatePartyStatusSummarySprites(
|
||||
gBattleHealthBoxInfo[gActiveBattler].partyStatusSummaryShown = 1;
|
||||
gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(
|
||||
gActiveBattler,
|
||||
(struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4],
|
||||
gBattleBufferA[gActiveBattler][1],
|
||||
gBattleBufferA[gActiveBattler][2]);
|
||||
ewram17810[gActiveBattler].unk5 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].unk5 = 0;
|
||||
if (gBattleBufferA[gActiveBattler][2] != 0)
|
||||
ewram17810[gActiveBattler].unk5 = 0x5D;
|
||||
gBattleHealthBoxInfo[gActiveBattler].unk5 = 0x5D;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_81208E0;
|
||||
}
|
||||
|
||||
void sub_81208E0(void)
|
||||
{
|
||||
if (ewram17810[gActiveBattler].unk5++ >= 93)
|
||||
if (gBattleHealthBoxInfo[gActiveBattler].unk5++ >= 93)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk5 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].unk5 = 0;
|
||||
LinkPartnerBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
|
||||
void LinkPartnerHandlecmd49(void)
|
||||
{
|
||||
if (ewram17810[gActiveBattler].unk0_0)
|
||||
gTasks[gUnknown_02024E68[gActiveBattler]].func = sub_8044CA0;
|
||||
if (gBattleHealthBoxInfo[gActiveBattler].partyStatusSummaryShown)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8044CA0;
|
||||
LinkPartnerBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
|
@ -1669,7 +1669,7 @@ void LinkPartnerHandleBattleAnimation(void)
|
|||
u8 r3 = gBattleBufferA[gActiveBattler][1];
|
||||
u16 r4 = gBattleBufferA[gActiveBattler][2] | (gBattleBufferA[gActiveBattler][3] << 8);
|
||||
|
||||
if (move_anim_start_t3(gActiveBattler, gActiveBattler, gActiveBattler, r3, r4) != 0)
|
||||
if (TryHandleLaunchBattleTableAnimation(gActiveBattler, gActiveBattler, gActiveBattler, r3, r4) != 0)
|
||||
LinkPartnerBufferExecCompleted();
|
||||
else
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_811E3B8;
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ extern u8 gBattlerSpriteIds[];
|
|||
extern u8 gBattleMonForms[];
|
||||
extern struct SpriteTemplate gCreatingSpriteTemplate;
|
||||
extern void (*gBattlerControllerFuncs[])(void);
|
||||
extern u8 gUnknown_0300434C[];
|
||||
extern u8 gBattleControllerData[];
|
||||
extern u8 gHealthboxSpriteIds[];
|
||||
extern u16 gBattleTypeFlags;
|
||||
extern u16 gTrainerBattleOpponent;
|
||||
|
|
@ -60,39 +60,39 @@ extern u8 gBattlerTarget;
|
|||
extern u8 gAbsentBattlerFlags;
|
||||
extern bool8 gDoingBattleAnim;
|
||||
extern u16 gIntroSlideFlags;
|
||||
extern u8 gUnknown_02024E68[];
|
||||
extern u8 gBattlerStatusSummaryTaskId[];
|
||||
extern MainCallback gPreBattleCallback1;
|
||||
extern struct MusicPlayerInfo gMPlayInfo_SE1;
|
||||
extern struct MusicPlayerInfo gMPlayInfo_SE2;
|
||||
extern struct MusicPlayerInfo gMPlayInfo_BGM;
|
||||
extern u32 gBattleControllerExecFlags;
|
||||
|
||||
extern u8 sub_8077F68();
|
||||
extern u8 GetBattlerSpriteDefault_Y();
|
||||
extern void sub_8033018(void);
|
||||
extern void BattleLoadOpponentMonSprite();
|
||||
extern u8 GetBattlerPosition(u8);
|
||||
extern void sub_8032984(u8, u16);
|
||||
extern void sub_80333D4(void);
|
||||
extern void sub_80312F0(struct Sprite *);
|
||||
extern u8 StartSendOutMonAnimation();
|
||||
extern void SpriteCB_WaitForBattlerBallReleaseAnim(struct Sprite *);
|
||||
extern u8 DoPokeballSendOutAnimation();
|
||||
extern void sub_8032A08();
|
||||
extern void sub_8033160(void);
|
||||
extern u8 get_trainer_class_pic_index(void);
|
||||
extern void sub_80313A0(struct Sprite *);
|
||||
extern void SpriteCB_TrainerSlideIn(struct Sprite *);
|
||||
extern void sub_8032B4C(void);
|
||||
extern void sub_8031A6C(u16, u8);
|
||||
extern void sub_8032B84(void);
|
||||
extern void StartAnimLinearTranslation(struct Sprite *);
|
||||
extern void sub_8032BBC(void);
|
||||
extern void oamt_add_pos2_onto_pos1();
|
||||
extern void SetSpritePrimaryCoordsFromSecondaryCoords();
|
||||
extern void StoreSpriteCallbackInData();
|
||||
extern void sub_803311C(void);
|
||||
extern void sub_8010384(struct Sprite *);
|
||||
extern bool8 mplay_80342A4(u8);
|
||||
extern u8 IsMoveWithoutAnimation();
|
||||
extern void sub_80326EC();
|
||||
extern void sub_8031F24(void);
|
||||
extern void sub_80324BC();
|
||||
extern void SetBattlerSpriteAffineMode();
|
||||
extern void CopyAllBattleSpritesInvisibilities(void);
|
||||
extern void TrySetBehindSubstituteSpriteBit();
|
||||
extern void BufferStringBattle();
|
||||
extern void sub_80331D0(void);
|
||||
extern void AI_TrySwitchOrUseItem(void);
|
||||
|
|
@ -101,15 +101,15 @@ extern void sub_80330C8(void);
|
|||
void sub_8033494(void);
|
||||
extern void move_anim_start_t2_for_situation();
|
||||
extern void bx_blink_t7(void);
|
||||
extern void sub_8047858();
|
||||
extern void DoHitAnimHealthboxEffect();
|
||||
extern u8 GetBattlerSide(u8);
|
||||
extern void StartBattleIntroAnim();
|
||||
extern void HandleIntroSlide();
|
||||
extern void sub_8044CA0(u8);
|
||||
extern void nullsub_45(void);
|
||||
extern void sub_8031B74();
|
||||
extern bool8 IsDoubleBattle(void);
|
||||
extern void sub_8032E2C(void);
|
||||
extern u8 move_anim_start_t3();
|
||||
extern u8 TryHandleLaunchBattleTableAnimation();
|
||||
extern void sub_80334C0(void);
|
||||
|
||||
// this file's functions
|
||||
|
|
@ -298,9 +298,9 @@ void sub_8032BBC(void)
|
|||
|
||||
void sub_8032C4C(void)
|
||||
{
|
||||
if ((--ewram17810[gActiveBattler].unk9) == 0xFF)
|
||||
if ((--gBattleHealthBoxInfo[gActiveBattler].unk9) == 0xFF)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk9 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].unk9 = 0;
|
||||
OpponentBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
|
|
@ -323,51 +323,51 @@ void sub_8032C88(void)
|
|||
if (IsCryPlayingOrClearCrySongs())
|
||||
r6 = FALSE;
|
||||
|
||||
if (r6 && ewram17810[gActiveBattler].unk1_0 && ewram17810[gActiveBattler ^ 2].unk1_0)
|
||||
if (r6 && gBattleHealthBoxInfo[gActiveBattler].finishedShinyMonAnim && gBattleHealthBoxInfo[gActiveBattler ^ 2].finishedShinyMonAnim)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk0_7 = 0;
|
||||
ewram17810[gActiveBattler].unk1_0 = 0;
|
||||
ewram17810[gActiveBattler ^ 2].unk0_7 = 0;
|
||||
ewram17810[gActiveBattler ^ 2].unk1_0 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].triedShinyMonAnim = FALSE;
|
||||
gBattleHealthBoxInfo[gActiveBattler].finishedShinyMonAnim = FALSE;
|
||||
gBattleHealthBoxInfo[gActiveBattler ^ 2].triedShinyMonAnim = FALSE;
|
||||
gBattleHealthBoxInfo[gActiveBattler ^ 2].finishedShinyMonAnim = FALSE;
|
||||
FreeSpriteTilesByTag(0x27F9);
|
||||
FreeSpritePaletteByTag(0x27F9);
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
|
||||
m4aMPlayContinue(&gMPlayInfo_BGM);
|
||||
else
|
||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 256);
|
||||
ewram17810[gActiveBattler].unk9 = 3;
|
||||
gBattleHealthBoxInfo[gActiveBattler].unk9 = 3;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_8032C4C;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8032E2C(void)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_3 && !ewram17810[gActiveBattler].unk0_7)
|
||||
sub_8141828(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]);
|
||||
if (!ewram17810[gActiveBattler ^ 2].unk0_3 && !ewram17810[gActiveBattler ^ 2].unk0_7)
|
||||
sub_8141828(gActiveBattler ^ 2, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler ^ 2]]);
|
||||
if (!ewram17810[gActiveBattler].unk0_3 && !ewram17810[gActiveBattler ^ 2].unk0_3)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].ballAnimActive && !gBattleHealthBoxInfo[gActiveBattler].triedShinyMonAnim)
|
||||
TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]);
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler ^ 2].ballAnimActive && !gBattleHealthBoxInfo[gActiveBattler ^ 2].triedShinyMonAnim)
|
||||
TryShinyAnimation(gActiveBattler ^ 2, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler ^ 2]]);
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].ballAnimActive && !gBattleHealthBoxInfo[gActiveBattler ^ 2].ballAnimActive)
|
||||
{
|
||||
if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI))
|
||||
{
|
||||
DestroySprite(&gSprites[gUnknown_0300434C[gActiveBattler ^ 2]]);
|
||||
sub_8045A5C(
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler ^ 2]]);
|
||||
UpdateHealthboxAttribute(
|
||||
gHealthboxSpriteIds[gActiveBattler ^ 2],
|
||||
&gEnemyParty[gBattlerPartyIndexes[gActiveBattler ^ 2]],
|
||||
0);
|
||||
sub_804777C(gActiveBattler ^ 2);
|
||||
sub_8043DFC(gHealthboxSpriteIds[gActiveBattler ^ 2]);
|
||||
StartHealthboxSlideIn(gActiveBattler ^ 2);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler ^ 2]);
|
||||
sub_8032984(
|
||||
gActiveBattler ^ 2,
|
||||
GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler ^ 2]], MON_DATA_SPECIES));
|
||||
}
|
||||
DestroySprite(&gSprites[gUnknown_0300434C[gActiveBattler]]);
|
||||
sub_8045A5C(
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]);
|
||||
UpdateHealthboxAttribute(
|
||||
gHealthboxSpriteIds[gActiveBattler],
|
||||
&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]],
|
||||
0);
|
||||
sub_804777C(gActiveBattler);
|
||||
sub_8043DFC(gHealthboxSpriteIds[gActiveBattler]);
|
||||
StartHealthboxSlideIn(gActiveBattler);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
sub_8032984(
|
||||
gActiveBattler,
|
||||
GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES));
|
||||
|
|
@ -382,15 +382,15 @@ void sub_8033018(void)
|
|||
if (gSprites[gBattlerSpriteIds[gActiveBattler]].animEnded == TRUE
|
||||
&& gSprites[gBattlerSpriteIds[gActiveBattler]].x2 == 0)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_7)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].triedShinyMonAnim)
|
||||
{
|
||||
sub_8141828(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]);
|
||||
TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]);
|
||||
return;
|
||||
}
|
||||
if (ewram17810[gActiveBattler].unk1_0)
|
||||
if (gBattleHealthBoxInfo[gActiveBattler].finishedShinyMonAnim)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk0_7 = 0;
|
||||
ewram17810[gActiveBattler].unk1_0 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].triedShinyMonAnim = FALSE;
|
||||
gBattleHealthBoxInfo[gActiveBattler].finishedShinyMonAnim = FALSE;
|
||||
FreeSpriteTilesByTag(0x27F9);
|
||||
FreeSpritePaletteByTag(0x27F9);
|
||||
OpponentBufferExecCompleted();
|
||||
|
|
@ -401,11 +401,11 @@ void sub_8033018(void)
|
|||
|
||||
void sub_80330C8(void)
|
||||
{
|
||||
s16 r4 = sub_8045C78(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], 0, 0);
|
||||
s16 r4 = MoveBattleBar(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], 0, 0);
|
||||
|
||||
sub_8043DFC(gHealthboxSpriteIds[gActiveBattler]);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
if (r4 != -1)
|
||||
sub_80440EC(gHealthboxSpriteIds[gActiveBattler], r4, 0);
|
||||
UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], r4, 0);
|
||||
else
|
||||
OpponentBufferExecCompleted();
|
||||
}
|
||||
|
|
@ -414,19 +414,19 @@ void sub_803311C(void)
|
|||
{
|
||||
if (!gSprites[gBattlerSpriteIds[gActiveBattler]].inUse)
|
||||
{
|
||||
sub_8043DB0(gHealthboxSpriteIds[gActiveBattler]);
|
||||
SetHealthboxSpriteInvisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
OpponentBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8033160(void)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_6)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].specialAnimActive)
|
||||
{
|
||||
FreeSpriteOamMatrix(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
DestroySprite(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
sub_8032A08(gActiveBattler);
|
||||
sub_8043DB0(gHealthboxSpriteIds[gActiveBattler]);
|
||||
SetHealthboxSpriteInvisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
OpponentBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
|
|
@ -460,36 +460,36 @@ void sub_8033264(void)
|
|||
{
|
||||
if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy)
|
||||
{
|
||||
if (gBattleSpriteInfo[gActiveBattler].substituteSprite)
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, gActiveBattler, 6);
|
||||
if (gBattleSpriteInfo[gActiveBattler].behindSubstitute)
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, 6);
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_80332D0;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80332D0(void)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_6)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].specialAnimActive)
|
||||
{
|
||||
CreateTask(c3_0802FDF4, 10);
|
||||
CreateTask(Task_PlayerController_RestoreBgmAfterCry, 10);
|
||||
OpponentBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8033308(void)
|
||||
{
|
||||
if (ewram17810[gActiveBattler].unk1_0)
|
||||
if (gBattleHealthBoxInfo[gActiveBattler].finishedShinyMonAnim)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk0_7 = 0;
|
||||
ewram17810[gActiveBattler].unk1_0 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].triedShinyMonAnim = FALSE;
|
||||
gBattleHealthBoxInfo[gActiveBattler].finishedShinyMonAnim = FALSE;
|
||||
FreeSpriteTilesByTag(0x27F9);
|
||||
FreeSpritePaletteByTag(0x27F9);
|
||||
StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 0);
|
||||
sub_8045A5C(
|
||||
UpdateHealthboxAttribute(
|
||||
gHealthboxSpriteIds[gActiveBattler],
|
||||
&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]],
|
||||
0);
|
||||
sub_804777C(gActiveBattler);
|
||||
sub_8043DFC(gHealthboxSpriteIds[gActiveBattler]);
|
||||
StartHealthboxSlideIn(gActiveBattler);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
sub_8031F88(gActiveBattler);
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_8033264;
|
||||
}
|
||||
|
|
@ -497,12 +497,12 @@ void sub_8033308(void)
|
|||
|
||||
void sub_80333D4(void)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_3 && !ewram17810[gActiveBattler].unk0_7)
|
||||
sub_8141828(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]);
|
||||
if (gSprites[gUnknown_0300434C[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& !ewram17810[gActiveBattler].unk0_3)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].ballAnimActive && !gBattleHealthBoxInfo[gActiveBattler].triedShinyMonAnim)
|
||||
TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]);
|
||||
if (gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& !gBattleHealthBoxInfo[gActiveBattler].ballAnimActive)
|
||||
{
|
||||
DestroySprite(&gSprites[gUnknown_0300434C[gActiveBattler]]);
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]);
|
||||
sub_8032984(gActiveBattler, GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES));
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_8033308;
|
||||
}
|
||||
|
|
@ -510,13 +510,13 @@ void sub_80333D4(void)
|
|||
|
||||
void sub_8033494(void)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_4)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].statusAnimActive)
|
||||
OpponentBufferExecCompleted();
|
||||
}
|
||||
|
||||
void sub_80334C0(void)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_5)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].animFromTableActive)
|
||||
OpponentBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
|
@ -1118,12 +1118,12 @@ void OpponentHandleLoadPokeSprite(void)
|
|||
u16 species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES);
|
||||
|
||||
BattleLoadOpponentMonSprite(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler);
|
||||
GetMonSpriteTemplate_803C56C(species, GetBattlerPosition(gActiveBattler));
|
||||
SetMultiuseSpriteTemplateToPokemon(species, GetBattlerPosition(gActiveBattler));
|
||||
gBattlerSpriteIds[gActiveBattler] = CreateSprite(
|
||||
&gCreatingSpriteTemplate,
|
||||
GetBattlerSpriteCoord(gActiveBattler, 2),
|
||||
sub_8077F68(gActiveBattler),
|
||||
GetBattlerSubpriority(gActiveBattler));
|
||||
GetBattlerSpriteDefault_Y(gActiveBattler),
|
||||
GetBattlerSpriteSubpriority(gActiveBattler));
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = -240;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = gActiveBattler;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = species;
|
||||
|
|
@ -1148,29 +1148,29 @@ void sub_803495C(u8 a, u8 b)
|
|||
sub_8032AA8(a, b);
|
||||
gBattlerPartyIndexes[a] = gBattleBufferA[a][1];
|
||||
species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[a]], MON_DATA_SPECIES);
|
||||
gUnknown_0300434C[a] = CreateInvisibleSpriteWithCallback(sub_80312F0);
|
||||
gBattleControllerData[a] = CreateInvisibleSpriteWithCallback(SpriteCB_WaitForBattlerBallReleaseAnim);
|
||||
BattleLoadOpponentMonSprite(&gEnemyParty[gBattlerPartyIndexes[a]], a);
|
||||
GetMonSpriteTemplate_803C56C(species, GetBattlerPosition(a));
|
||||
SetMultiuseSpriteTemplateToPokemon(species, GetBattlerPosition(a));
|
||||
gBattlerSpriteIds[a] = CreateSprite(
|
||||
&gCreatingSpriteTemplate,
|
||||
GetBattlerSpriteCoord(a, 2),
|
||||
sub_8077F68(a),
|
||||
GetBattlerSubpriority(a));
|
||||
GetBattlerSpriteDefault_Y(a),
|
||||
GetBattlerSpriteSubpriority(a));
|
||||
gSprites[gBattlerSpriteIds[a]].data[0] = a;
|
||||
gSprites[gBattlerSpriteIds[a]].data[2] = species;
|
||||
gSprites[gUnknown_0300434C[a]].data[1] = gBattlerSpriteIds[a];
|
||||
gSprites[gBattleControllerData[a]].data[1] = gBattlerSpriteIds[a];
|
||||
gSprites[gBattlerSpriteIds[a]].oam.paletteNum = a;
|
||||
StartSpriteAnim(&gSprites[gBattlerSpriteIds[a]], gBattleMonForms[a]);
|
||||
gSprites[gBattlerSpriteIds[a]].invisible = TRUE;
|
||||
gSprites[gBattlerSpriteIds[a]].callback = SpriteCallbackDummy;
|
||||
gSprites[gUnknown_0300434C[a]].data[0] = StartSendOutMonAnimation(0, 0xFE);
|
||||
gSprites[gBattleControllerData[a]].data[0] = DoPokeballSendOutAnimation(0, 0xFE);
|
||||
}
|
||||
|
||||
void OpponentHandleReturnPokeToBall(void)
|
||||
{
|
||||
if (gBattleBufferA[gActiveBattler][1] == 0)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk4 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 0;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_8034B74;
|
||||
}
|
||||
else
|
||||
|
|
@ -1178,25 +1178,25 @@ void OpponentHandleReturnPokeToBall(void)
|
|||
FreeSpriteOamMatrix(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
DestroySprite(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
sub_8032A08(gActiveBattler);
|
||||
sub_8043DB0(gHealthboxSpriteIds[gActiveBattler]);
|
||||
SetHealthboxSpriteInvisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
OpponentBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8034B74(void)
|
||||
{
|
||||
switch (ewram17810[gActiveBattler].unk4)
|
||||
switch (gBattleHealthBoxInfo[gActiveBattler].animationState)
|
||||
{
|
||||
case 0:
|
||||
if (gBattleSpriteInfo[gActiveBattler].substituteSprite)
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, gActiveBattler, 5);
|
||||
ewram17810[gActiveBattler].unk4 = 1;
|
||||
if (gBattleSpriteInfo[gActiveBattler].behindSubstitute)
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, 5);
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 1;
|
||||
break;
|
||||
case 1:
|
||||
if (!ewram17810[gActiveBattler].unk0_6)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].specialAnimActive)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk4 = 0;
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, gActiveBattler, 2);
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 0;
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, 2);
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_8033160;
|
||||
}
|
||||
break;
|
||||
|
|
@ -1226,19 +1226,19 @@ void OpponentHandleTrainerThrow(void)
|
|||
}
|
||||
|
||||
sub_8031A6C(trainerPicIndex, gActiveBattler);
|
||||
GetMonSpriteTemplate_803C5A0(trainerPicIndex, GetBattlerPosition(gActiveBattler));
|
||||
SetMultiuseSpriteTemplateToTrainerBack(trainerPicIndex, GetBattlerPosition(gActiveBattler));
|
||||
gBattlerSpriteIds[gActiveBattler] = CreateSprite(
|
||||
&gCreatingSpriteTemplate,
|
||||
0xB0,
|
||||
40 + 4 * (8 - gTrainerFrontPicCoords[trainerPicIndex].coords),
|
||||
GetBattlerSubpriority(gActiveBattler));
|
||||
GetBattlerSpriteSubpriority(gActiveBattler));
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = -240;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 2;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = IndexOfSpritePaletteTag(gTrainerFrontPicPaletteTable[trainerPicIndex].tag);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[5] = gSprites[gBattlerSpriteIds[gActiveBattler]].oam.tileNum;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.tileNum = GetSpriteTileStartByTag(gTrainerFrontPicTable[trainerPicIndex].tag);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.affineParam = trainerPicIndex;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_80313A0;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_TrainerSlideIn;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_8032B4C;
|
||||
}
|
||||
|
||||
|
|
@ -1256,7 +1256,7 @@ void OpponentHandleTrainerSlide(void)
|
|||
trainerPicIndex = gTrainers[gTrainerBattleOpponent].trainerPic;
|
||||
|
||||
sub_8031A6C(trainerPicIndex, gActiveBattler);
|
||||
GetMonSpriteTemplate_803C5A0(trainerPicIndex, GetBattlerPosition(gActiveBattler));
|
||||
SetMultiuseSpriteTemplateToTrainerBack(trainerPicIndex, GetBattlerPosition(gActiveBattler));
|
||||
gBattlerSpriteIds[gActiveBattler] = CreateSprite(
|
||||
&gCreatingSpriteTemplate,
|
||||
0xB0,
|
||||
|
|
@ -1269,13 +1269,13 @@ void OpponentHandleTrainerSlide(void)
|
|||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[5] = gSprites[gBattlerSpriteIds[gActiveBattler]].oam.tileNum;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.tileNum = GetSpriteTileStartByTag(gTrainerFrontPicTable[trainerPicIndex].tag);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.affineParam = trainerPicIndex;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_80313A0;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_TrainerSlideIn;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_8032B84;
|
||||
}
|
||||
|
||||
void OpponentHandleTrainerSlideBack(void)
|
||||
{
|
||||
oamt_add_pos2_onto_pos1(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
SetSpritePrimaryCoordsFromSecondaryCoords(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 35;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = 280;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].y;
|
||||
|
|
@ -1286,15 +1286,15 @@ void OpponentHandleTrainerSlideBack(void)
|
|||
|
||||
void OpponentHandlecmd10(void)
|
||||
{
|
||||
if (ewram17810[gActiveBattler].unk4 == 0)
|
||||
if (gBattleHealthBoxInfo[gActiveBattler].animationState == 0)
|
||||
{
|
||||
if (gBattleSpriteInfo[gActiveBattler].substituteSprite)
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, gActiveBattler, 5);
|
||||
ewram17810[gActiveBattler].unk4++;
|
||||
if (gBattleSpriteInfo[gActiveBattler].behindSubstitute)
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, 5);
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState++;
|
||||
}
|
||||
else if (!ewram17810[gActiveBattler].unk0_6)
|
||||
else if (!gBattleHealthBoxInfo[gActiveBattler].specialAnimActive)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk4 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 0;
|
||||
PlaySE12WithPanning(SE_FAINT, 63);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_8010384;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_803311C;
|
||||
|
|
@ -1348,7 +1348,7 @@ void OpponentHandleMoveAnimation(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
ewram17810[gActiveBattler].unk4 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 0;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_8035238;
|
||||
}
|
||||
}
|
||||
|
|
@ -1360,45 +1360,45 @@ void sub_8035238(void)
|
|||
| (gBattleBufferA[gActiveBattler][2] << 8);
|
||||
u8 r7 = gBattleBufferA[gActiveBattler][11];
|
||||
|
||||
switch (ewram17810[gActiveBattler].unk4)
|
||||
switch (gBattleHealthBoxInfo[gActiveBattler].animationState)
|
||||
{
|
||||
case 0:
|
||||
if (gBattleSpriteInfo[gActiveBattler].substituteSprite && !gBattleSpriteInfo[gActiveBattler].flag_x8)
|
||||
if (gBattleSpriteInfo[gActiveBattler].behindSubstitute && !gBattleSpriteInfo[gActiveBattler].flag_x8)
|
||||
{
|
||||
gBattleSpriteInfo[gActiveBattler].flag_x8 = 1;
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, gActiveBattler, 5);
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, 5);
|
||||
}
|
||||
ewram17810[gActiveBattler].unk4 = 1;
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 1;
|
||||
break;
|
||||
case 1:
|
||||
if (!ewram17810[gActiveBattler].unk0_6)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].specialAnimActive)
|
||||
{
|
||||
sub_80326EC(0);
|
||||
SetBattlerSpriteAffineMode(0);
|
||||
DoMoveAnim(r4);
|
||||
ewram17810[gActiveBattler].unk4 = 2;
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 2;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
gAnimScriptCallback();
|
||||
if (!gAnimScriptActive)
|
||||
{
|
||||
sub_80326EC(1);
|
||||
if ((gBattleSpriteInfo[gActiveBattler].substituteSprite) && r7 <= 1)
|
||||
SetBattlerSpriteAffineMode(1);
|
||||
if ((gBattleSpriteInfo[gActiveBattler].behindSubstitute) && r7 <= 1)
|
||||
{
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, gActiveBattler, 6);
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, 6);
|
||||
gBattleSpriteInfo[gActiveBattler].flag_x8 = 0;
|
||||
}
|
||||
ewram17810[gActiveBattler].unk4 = 3;
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 3;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (!ewram17810[gActiveBattler].unk0_6)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].specialAnimActive)
|
||||
{
|
||||
sub_8031F24();
|
||||
sub_80324BC(
|
||||
CopyAllBattleSpritesInvisibilities();
|
||||
TrySetBehindSubstituteSpriteBit(
|
||||
gActiveBattler,
|
||||
gBattleBufferA[gActiveBattler][1] | (gBattleBufferA[gActiveBattler][2] << 8));
|
||||
ewram17810[gActiveBattler].unk4 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 0;
|
||||
OpponentBufferExecCompleted();
|
||||
}
|
||||
break;
|
||||
|
|
@ -1597,20 +1597,20 @@ void OpponentHandleHealthBarUpdate(void)
|
|||
{
|
||||
s16 r7;
|
||||
|
||||
load_gfxc_health_bar(0);
|
||||
LoadBattleBarGfx(0);
|
||||
r7 = (gBattleBufferA[gActiveBattler][3] << 8) | gBattleBufferA[gActiveBattler][2];
|
||||
if (r7 != 0x7FFF)
|
||||
{
|
||||
u32 maxHP = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MAX_HP);
|
||||
u32 hp = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_HP);
|
||||
|
||||
sub_8043D84(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, hp, r7);
|
||||
SetBattleBarStruct(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, hp, r7);
|
||||
}
|
||||
else
|
||||
{
|
||||
u32 maxHP = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MAX_HP);
|
||||
|
||||
sub_8043D84(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, 0, r7);
|
||||
SetBattleBarStruct(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, 0, r7);
|
||||
}
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_80330C8;
|
||||
}
|
||||
|
|
@ -1624,8 +1624,8 @@ void OpponentHandleStatusIconUpdate(void)
|
|||
{
|
||||
if (mplay_80342A4(gActiveBattler) == 0)
|
||||
{
|
||||
sub_8045A5C(gHealthboxSpriteIds[gActiveBattler], &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], 9);
|
||||
ewram17810[gActiveBattler].unk0_4 = 0;
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], 9);
|
||||
gBattleHealthBoxInfo[gActiveBattler].statusAnimActive = 0;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_8033494;
|
||||
}
|
||||
}
|
||||
|
|
@ -1723,7 +1723,7 @@ void OpponentHandleHitAnimation(void)
|
|||
{
|
||||
gDoingBattleAnim = TRUE;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[1] = 0;
|
||||
sub_8047858(gActiveBattler);
|
||||
DoHitAnimHealthboxEffect(gActiveBattler);
|
||||
gBattlerControllerFuncs[gActiveBattler] = bx_blink_t7;
|
||||
}
|
||||
}
|
||||
|
|
@ -1761,7 +1761,7 @@ void OpponentHandleFaintingCry(void)
|
|||
|
||||
void OpponentHandleIntroSlide(void)
|
||||
{
|
||||
StartBattleIntroAnim(gBattleBufferA[gActiveBattler][1]);
|
||||
HandleIntroSlide(gBattleBufferA[gActiveBattler][1]);
|
||||
gIntroSlideFlags |= 1;
|
||||
OpponentBufferExecCompleted();
|
||||
}
|
||||
|
|
@ -1770,7 +1770,7 @@ void OpponentHandleTrainerBallThrow(void)
|
|||
{
|
||||
u8 taskId;
|
||||
|
||||
oamt_add_pos2_onto_pos1(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
SetSpritePrimaryCoordsFromSecondaryCoords(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 35;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = 280;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].y;
|
||||
|
|
@ -1778,8 +1778,8 @@ void OpponentHandleTrainerBallThrow(void)
|
|||
StoreSpriteCallbackInData(&gSprites[gBattlerSpriteIds[gActiveBattler]], sub_8035C10);
|
||||
taskId = CreateTask(sub_8035C44, 5);
|
||||
gTasks[taskId].data[0] = gActiveBattler;
|
||||
if (ewram17810[gActiveBattler].unk0_0)
|
||||
gTasks[gUnknown_02024E68[gActiveBattler]].func = sub_8044CA0;
|
||||
if (gBattleHealthBoxInfo[gActiveBattler].partyStatusSummaryShown)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8044CA0;
|
||||
ewram17840.unk9_0 = 1;
|
||||
gBattlerControllerFuncs[gActiveBattler] = nullsub_45;
|
||||
}
|
||||
|
|
@ -1825,43 +1825,43 @@ void OpponentHandlecmd48(void)
|
|||
return;
|
||||
}
|
||||
|
||||
ewram17810[gActiveBattler].unk0_0 = 1;
|
||||
gBattleHealthBoxInfo[gActiveBattler].partyStatusSummaryShown = 1;
|
||||
if (gBattleBufferA[gActiveBattler][2] != 0)
|
||||
{
|
||||
if (ewram17810[gActiveBattler].unk1_1 < 2)
|
||||
if (gBattleHealthBoxInfo[gActiveBattler].unk1_1 < 2)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk1_1++;
|
||||
gBattleHealthBoxInfo[gActiveBattler].unk1_1++;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
ewram17810[gActiveBattler].unk1_1 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].unk1_1 = 0;
|
||||
}
|
||||
}
|
||||
gUnknown_02024E68[gActiveBattler] = CreatePartyStatusSummarySprites(
|
||||
gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(
|
||||
gActiveBattler,
|
||||
(struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4],
|
||||
gBattleBufferA[gActiveBattler][1],
|
||||
gBattleBufferA[gActiveBattler][2]);
|
||||
ewram17810[gActiveBattler].unk5 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].unk5 = 0;
|
||||
if (gBattleBufferA[gActiveBattler][2] != 0)
|
||||
ewram17810[gActiveBattler].unk5 = 0x5D;
|
||||
gBattleHealthBoxInfo[gActiveBattler].unk5 = 0x5D;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_8035E2C;
|
||||
}
|
||||
|
||||
void sub_8035E2C(void)
|
||||
{
|
||||
if (ewram17810[gActiveBattler].unk5++ >= 93)
|
||||
if (gBattleHealthBoxInfo[gActiveBattler].unk5++ >= 93)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk5 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].unk5 = 0;
|
||||
OpponentBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
|
||||
void OpponentHandlecmd49(void)
|
||||
{
|
||||
if (ewram17810[gActiveBattler].unk0_0)
|
||||
gTasks[gUnknown_02024E68[gActiveBattler]].func = sub_8044CA0;
|
||||
if (gBattleHealthBoxInfo[gActiveBattler].partyStatusSummaryShown)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8044CA0;
|
||||
OpponentBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
|
@ -1887,7 +1887,7 @@ void OpponentHandleBattleAnimation(void)
|
|||
u8 r3 = gBattleBufferA[gActiveBattler][1];
|
||||
u16 r4 = gBattleBufferA[gActiveBattler][2] | (gBattleBufferA[gActiveBattler][3] << 8);
|
||||
|
||||
if (move_anim_start_t3(gActiveBattler, gActiveBattler, gActiveBattler, r3, r4) != 0)
|
||||
if (TryHandleLaunchBattleTableAnimation(gActiveBattler, gActiveBattler, gActiveBattler, r3, r4) != 0)
|
||||
OpponentBufferExecCompleted();
|
||||
else
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_80334C0;
|
||||
|
|
|
|||
|
|
@ -1,27 +1,28 @@
|
|||
#include "global.h"
|
||||
#include "data2.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "battle_anim_special.h"
|
||||
#include "battle_anim.h"
|
||||
#include "battle_controllers.h"
|
||||
#include "battle_interface.h"
|
||||
#include "battle_message.h"
|
||||
#include "battle.h"
|
||||
#include "data2.h"
|
||||
#include "ewram.h"
|
||||
#include "item.h"
|
||||
#include "constants/items.h"
|
||||
#include "link.h"
|
||||
#include "m4a.h"
|
||||
#include "main.h"
|
||||
#include "menu_cursor.h"
|
||||
#include "constants/moves.h"
|
||||
#include "palette.h"
|
||||
#include "pokeball.h"
|
||||
#include "pokemon.h"
|
||||
#include "constants/songs.h"
|
||||
#include "sound.h"
|
||||
#include "string_util.h"
|
||||
#include "task.h"
|
||||
#include "text.h"
|
||||
#include "util.h"
|
||||
#include "ewram.h"
|
||||
#include "constants/items.h"
|
||||
#include "constants/moves.h"
|
||||
#include "constants/songs.h"
|
||||
|
||||
struct MovePpInfo
|
||||
{
|
||||
|
|
@ -49,7 +50,7 @@ extern u8 gActionSelectionCursor[];
|
|||
extern u8 gDisplayedStringBattle[];
|
||||
extern u8 gMoveSelectionCursor[];
|
||||
extern u8 gBattleBufferA[][0x200];
|
||||
extern u8 gBankInMenu;
|
||||
extern u8 gBattlerInMenuId;
|
||||
extern u16 gBattlerPartyIndexes[];
|
||||
extern u8 gHealthboxSpriteIds[];
|
||||
extern u8 gDoingBattleAnim;
|
||||
|
|
@ -65,12 +66,12 @@ extern u16 gWeatherMoveAnim;
|
|||
extern u32 gTransformedPersonalities[];
|
||||
extern u8 gBattleMonForms[];
|
||||
extern u16 gIntroSlideFlags;
|
||||
extern u8 gUnknown_02024E68[];
|
||||
extern u8 gBattlerStatusSummaryTaskId[];
|
||||
extern struct SpriteTemplate gCreatingSpriteTemplate;
|
||||
extern u8 gAnimMoveTurn;
|
||||
extern u8 gBattlePartyCurrentOrder[];
|
||||
extern u8 gUnknown_03004344;
|
||||
extern u8 gUnknown_0300434C[];
|
||||
extern u8 gBattleControllerData[];
|
||||
|
||||
extern const u8 BattleText_OtherMenu[];
|
||||
extern const u8 BattleText_MenuOptions[];
|
||||
|
|
@ -84,30 +85,30 @@ extern void sub_802DF30(void);
|
|||
extern void BattleStopLowHpSound(void);
|
||||
extern void PlayerBufferExecCompleted(void);
|
||||
extern void bx_t1_healthbar_update(void);
|
||||
extern void nullsub_91(void);
|
||||
extern void BattleControllerDummy(void);
|
||||
extern void sub_802D924(u8);
|
||||
extern void sub_802E434(void);
|
||||
extern bool8 mplay_80342A4(u8);
|
||||
extern void move_anim_start_t2_for_situation();
|
||||
extern void bx_blink_t1(void);
|
||||
extern void sub_8047858();
|
||||
extern void DoHitAnimHealthboxEffect();
|
||||
extern u8 GetBattlerSide(u8);
|
||||
extern void StartBattleIntroAnim();
|
||||
extern void oamt_add_pos2_onto_pos1();
|
||||
extern void HandleIntroSlide();
|
||||
extern void SetSpritePrimaryCoordsFromSecondaryCoords();
|
||||
extern void StartAnimLinearTranslation(struct Sprite *);
|
||||
extern void StoreSpriteCallbackInData();
|
||||
extern void BattleLoadPlayerMonSprite();
|
||||
extern bool8 IsDoubleBattle(void);
|
||||
extern void sub_802D500(void);
|
||||
extern bool8 IsBankSpritePresent(u8);
|
||||
extern bool8 move_anim_start_t3();
|
||||
extern bool8 TryHandleLaunchBattleTableAnimation();
|
||||
extern void sub_802E460(void);
|
||||
extern void b_link_standby_message(void);
|
||||
extern void sub_802D18C(void);
|
||||
extern void sub_802DF18(void);
|
||||
extern void sub_80326EC();
|
||||
extern void sub_8031F24(void);
|
||||
extern void sub_80324BC();
|
||||
extern void SetBattlerSpriteAffineMode();
|
||||
extern void CopyAllBattleSpritesInvisibilities(void);
|
||||
extern void TrySetBehindSubstituteSpriteBit();
|
||||
extern u8 IsMoveWithoutAnimation();
|
||||
extern void bx_wait_t1(void);
|
||||
extern u8 GetBattlerAtPosition(u8);
|
||||
|
|
@ -116,15 +117,15 @@ extern void sub_80105EC(struct Sprite *);
|
|||
extern void sub_802D274(void);
|
||||
extern void sub_802D23C(void);
|
||||
extern u8 GetBattlerPosition(u8);
|
||||
extern void LoadPlayerTrainerBankSprite();
|
||||
extern void sub_80313A0(struct Sprite *);
|
||||
extern void DecompressTrainerBackPic();
|
||||
extern void SpriteCB_TrainerSlideIn(struct Sprite *);
|
||||
extern void sub_802D204(void);
|
||||
extern u8 GetBattlerSubpriority();
|
||||
extern u8 GetBattlerSpriteSubpriority();
|
||||
extern void sub_802DEAC(void);
|
||||
extern void sub_80312F0(struct Sprite *);
|
||||
extern void SpriteCB_WaitForBattlerBallReleaseAnim(struct Sprite *);
|
||||
extern u8 GetBattlerSpriteCoord();
|
||||
extern u8 sub_8077F68();
|
||||
extern u8 StartSendOutMonAnimation();
|
||||
extern u8 GetBattlerSpriteDefault_Y();
|
||||
extern u8 DoPokeballSendOutAnimation();
|
||||
extern void sub_802D798(void);
|
||||
extern void bx_0802E404(void);
|
||||
extern u8 gActiveBattler;
|
||||
|
|
@ -147,7 +148,7 @@ extern struct BattlePokemon gBattleMons[];
|
|||
extern MainCallback gPreBattleCallback1;
|
||||
extern u8 gHealthboxSpriteIds[];
|
||||
extern struct MusicPlayerInfo gMPlayInfo_BGM;
|
||||
extern u8 gUnknown_0300434C[];
|
||||
extern u8 gBattleControllerData[];
|
||||
extern u8 gUnknown_0202E8F4;
|
||||
extern u8 gUnknown_0202E8F5;
|
||||
extern u8 gBattlePartyCurrentOrder[];
|
||||
|
|
@ -162,14 +163,13 @@ extern void dp11b_obj_free(u8, u8);
|
|||
extern void sub_8010520(struct Sprite *);
|
||||
extern void sub_8010574(struct Sprite *);
|
||||
extern bool8 IsDoubleBattle();
|
||||
extern void sub_804777C();
|
||||
extern void sub_8094E20(u8);
|
||||
extern void nullsub_14(void);
|
||||
extern void ReshowBattleScreenDummy(void);
|
||||
extern void sub_80A6DCC(void);
|
||||
extern void ReshowBattleScreenAfterMenu(void);
|
||||
|
||||
void PlayerHandleGetAttributes(void);
|
||||
void PlayerHandlecmd1(void);
|
||||
void PlayerHandleGetRawMonData(void);
|
||||
void PlayerHandleSetAttributes(void);
|
||||
void PlayerHandlecmd3(void);
|
||||
void PlayerHandleLoadPokeSprite(void);
|
||||
|
|
@ -231,7 +231,7 @@ const u8 gString_TurnJP[] = _("ターン");
|
|||
void (*const gPlayerBufferCommands[])(void) =
|
||||
{
|
||||
PlayerHandleGetAttributes,
|
||||
PlayerHandlecmd1,
|
||||
PlayerHandleGetRawMonData,
|
||||
PlayerHandleSetAttributes,
|
||||
PlayerHandlecmd3,
|
||||
PlayerHandleLoadPokeSprite,
|
||||
|
|
@ -314,11 +314,11 @@ void sub_802F934(u8, u8);
|
|||
void sub_802FB2C(void);
|
||||
void sub_8030190(void);
|
||||
void sub_80304A8(void);
|
||||
void sub_8030E38(struct Sprite *);
|
||||
void SpriteCB_FreePlayerSpriteLoadMonSprite(struct Sprite *);
|
||||
void task05_08033660(u8);
|
||||
void sub_8031064(void);
|
||||
|
||||
void nullsub_91(void)
|
||||
void BattleControllerDummy(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -1002,7 +1002,7 @@ void debug_sub_8030C24(void)
|
|||
gBattlerTarget = GetBattlerAtPosition(3);
|
||||
else
|
||||
gBattlerTarget = GetBattlerAtPosition(1);
|
||||
sub_80326EC(0);
|
||||
SetBattlerSpriteAffineMode(0);
|
||||
DoMoveAnim(move);
|
||||
gBattlerControllerFuncs[gActiveBattler] = debug_sub_803107C;
|
||||
break;
|
||||
|
|
@ -1016,7 +1016,7 @@ void debug_sub_8030C24(void)
|
|||
gBattlerAttacker = GetBattlerAtPosition(3);
|
||||
else
|
||||
gBattlerAttacker = GetBattlerAtPosition(1);
|
||||
sub_80326EC(0);
|
||||
SetBattlerSpriteAffineMode(0);
|
||||
DoMoveAnim(move);
|
||||
gBattlerControllerFuncs[gActiveBattler] = debug_sub_803107C;
|
||||
break;
|
||||
|
|
@ -1027,7 +1027,7 @@ void debug_sub_8030C24(void)
|
|||
dp11b_obj_free(gActiveBattler, 0);
|
||||
gBattlerAttacker = GetBattlerAtPosition(3);
|
||||
gBattlerTarget = GetBattlerAtPosition(1);
|
||||
sub_80326EC(0);
|
||||
SetBattlerSpriteAffineMode(0);
|
||||
DoMoveAnim(move);
|
||||
gBattlerControllerFuncs[gActiveBattler] = debug_sub_803107C;
|
||||
}
|
||||
|
|
@ -1052,7 +1052,7 @@ void debug_sub_8030C24(void)
|
|||
dp11b_obj_free(gActiveBattler, 0);
|
||||
gBattlerAttacker = GetBattlerAtPosition(1);
|
||||
gBattlerTarget = GetBattlerAtPosition(3);
|
||||
sub_80326EC(0);
|
||||
SetBattlerSpriteAffineMode(0);
|
||||
DoMoveAnim(move);
|
||||
gBattlerControllerFuncs[gActiveBattler] = debug_sub_803107C;
|
||||
}
|
||||
|
|
@ -1112,7 +1112,7 @@ void debug_sub_803107C(void)
|
|||
{
|
||||
s32 i;
|
||||
|
||||
sub_80326EC(1);
|
||||
SetBattlerSpriteAffineMode(1);
|
||||
dp11b_obj_instanciate(gActiveBattler, 1, 7, 1);
|
||||
dp11b_obj_instanciate(gActiveBattler, 0, 7, 1);
|
||||
|
||||
|
|
@ -1168,9 +1168,9 @@ void sub_802D274(void)
|
|||
|
||||
void sub_802D2E0(void)
|
||||
{
|
||||
if (--ewram17810[gActiveBattler].unk9 == 0xFF)
|
||||
if (--gBattleHealthBoxInfo[gActiveBattler].unk9 == 0xFF)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk9 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].unk9 = 0;
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
|
|
@ -1193,12 +1193,12 @@ void sub_802D31C(void)
|
|||
if (IsCryPlayingOrClearCrySongs())
|
||||
r6 = FALSE;
|
||||
|
||||
if (r6 && ewram17810[gActiveBattler].unk1_0 && ewram17810[gActiveBattler ^ 2].unk1_0)
|
||||
if (r6 && gBattleHealthBoxInfo[gActiveBattler].finishedShinyMonAnim && gBattleHealthBoxInfo[gActiveBattler ^ 2].finishedShinyMonAnim)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk0_7 = 0;
|
||||
ewram17810[gActiveBattler].unk1_0 = 0;
|
||||
ewram17810[gActiveBattler ^ 2].unk0_7 = 0;
|
||||
ewram17810[gActiveBattler ^ 2].unk1_0 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].triedShinyMonAnim = FALSE;
|
||||
gBattleHealthBoxInfo[gActiveBattler].finishedShinyMonAnim = FALSE;
|
||||
gBattleHealthBoxInfo[gActiveBattler ^ 2].triedShinyMonAnim = FALSE;
|
||||
gBattleHealthBoxInfo[gActiveBattler ^ 2].finishedShinyMonAnim = FALSE;
|
||||
FreeSpriteTilesByTag(0x27F9);
|
||||
FreeSpritePaletteByTag(0x27F9);
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
|
||||
|
|
@ -1208,36 +1208,36 @@ void sub_802D31C(void)
|
|||
HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler);
|
||||
if (IsDoubleBattle())
|
||||
HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ 2]], gActiveBattler ^ 2);
|
||||
ewram17810[gActiveBattler].unk9 = 3;
|
||||
gBattleHealthBoxInfo[gActiveBattler].unk9 = 3;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_802D2E0;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_802D500(void)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_3 && !ewram17810[gActiveBattler].unk0_7)
|
||||
sub_8141828(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]);
|
||||
if (!ewram17810[gActiveBattler ^ 2].unk0_3 && !ewram17810[gActiveBattler ^ 2].unk0_7)
|
||||
sub_8141828(gActiveBattler ^ 2, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ 2]]);
|
||||
if (!ewram17810[gActiveBattler].unk0_3 && !ewram17810[gActiveBattler ^ 2].unk0_3)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].ballAnimActive && !gBattleHealthBoxInfo[gActiveBattler].triedShinyMonAnim)
|
||||
TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]);
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler ^ 2].ballAnimActive && !gBattleHealthBoxInfo[gActiveBattler ^ 2].triedShinyMonAnim)
|
||||
TryShinyAnimation(gActiveBattler ^ 2, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ 2]]);
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].ballAnimActive && !gBattleHealthBoxInfo[gActiveBattler ^ 2].ballAnimActive)
|
||||
{
|
||||
if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI))
|
||||
{
|
||||
DestroySprite(&gSprites[gUnknown_0300434C[gActiveBattler ^ 2]]);
|
||||
sub_8045A5C(
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler ^ 2]]);
|
||||
UpdateHealthboxAttribute(
|
||||
gHealthboxSpriteIds[gActiveBattler ^ 2],
|
||||
&gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ 2]],
|
||||
0);
|
||||
sub_804777C(gActiveBattler ^ 2);
|
||||
sub_8043DFC(gHealthboxSpriteIds[gActiveBattler ^ 2]);
|
||||
StartHealthboxSlideIn(gActiveBattler ^ 2);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler ^ 2]);
|
||||
}
|
||||
DestroySprite(&gSprites[gUnknown_0300434C[gActiveBattler]]);
|
||||
sub_8045A5C(
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]);
|
||||
UpdateHealthboxAttribute(
|
||||
gHealthboxSpriteIds[gActiveBattler],
|
||||
&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]],
|
||||
0);
|
||||
sub_804777C(gActiveBattler);
|
||||
sub_8043DFC(gHealthboxSpriteIds[gActiveBattler]);
|
||||
StartHealthboxSlideIn(gActiveBattler);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
ewram17840.unk9_0 = 0;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_802D31C;
|
||||
}
|
||||
|
|
@ -1246,21 +1246,21 @@ void sub_802D500(void)
|
|||
void sub_802D680(void)
|
||||
{
|
||||
if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& ewram17810[gActiveBattler].unk1_0)
|
||||
&& gBattleHealthBoxInfo[gActiveBattler].finishedShinyMonAnim)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk0_7 = 0;
|
||||
ewram17810[gActiveBattler].unk1_0 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].triedShinyMonAnim = FALSE;
|
||||
gBattleHealthBoxInfo[gActiveBattler].finishedShinyMonAnim = FALSE;
|
||||
FreeSpriteTilesByTag(0x27F9);
|
||||
FreeSpritePaletteByTag(0x27F9);
|
||||
if (gBattleSpriteInfo[gActiveBattler].substituteSprite)
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, gActiveBattler, 6);
|
||||
if (gBattleSpriteInfo[gActiveBattler].behindSubstitute)
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, 6);
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_802D730;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_802D730(void)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_6 && !IsCryPlayingOrClearCrySongs())
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].specialAnimActive && !IsCryPlayingOrClearCrySongs())
|
||||
{
|
||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
|
||||
HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler);
|
||||
|
|
@ -1270,21 +1270,21 @@ void sub_802D730(void)
|
|||
|
||||
void sub_802D798(void)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_3 && !ewram17810[gActiveBattler].unk0_7)
|
||||
sub_8141828(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]);
|
||||
if (gSprites[gUnknown_0300434C[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& !ewram17810[gActiveBattler].unk0_3)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].ballAnimActive && !gBattleHealthBoxInfo[gActiveBattler].triedShinyMonAnim)
|
||||
TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]);
|
||||
if (gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& !gBattleHealthBoxInfo[gActiveBattler].ballAnimActive)
|
||||
{
|
||||
DestroySprite(&gSprites[gUnknown_0300434C[gActiveBattler]]);
|
||||
sub_8045A5C(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], 0);
|
||||
sub_804777C(gActiveBattler);
|
||||
sub_8043DFC(gHealthboxSpriteIds[gActiveBattler]);
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], 0);
|
||||
StartHealthboxSlideIn(gActiveBattler);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
sub_8031F88(gActiveBattler);
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_802D680;
|
||||
}
|
||||
}
|
||||
|
||||
void c3_0802FDF4(u8 taskId)
|
||||
void Task_PlayerController_RestoreBgmAfterCry(u8 taskId)
|
||||
{
|
||||
if (!IsCryPlayingOrClearCrySongs())
|
||||
{
|
||||
|
|
@ -1295,12 +1295,12 @@ void c3_0802FDF4(u8 taskId)
|
|||
|
||||
void bx_t1_healthbar_update(void)
|
||||
{
|
||||
s16 r4 = sub_8045C78(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], 0, 0);
|
||||
s16 r4 = MoveBattleBar(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], 0, 0);
|
||||
|
||||
sub_8043DFC(gHealthboxSpriteIds[gActiveBattler]);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
if (r4 != -1)
|
||||
{
|
||||
sub_80440EC(gHealthboxSpriteIds[gActiveBattler], r4, 0);
|
||||
UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], r4, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1376,7 +1376,7 @@ void sub_802DA9C(u8 taskId)
|
|||
|
||||
exp -= currLvlExp;
|
||||
expToNextLvl = gExperienceTables[gBaseStats[species].growthRate][level + 1] - currLvlExp;
|
||||
sub_8043D84(bank, gHealthboxSpriteIds[bank], expToNextLvl, exp, -r9);
|
||||
SetBattleBarStruct(bank, gHealthboxSpriteIds[bank], expToNextLvl, exp, -r9);
|
||||
PlaySE(SE_EXP);
|
||||
gTasks[taskId].func = sub_802DB6C;
|
||||
}
|
||||
|
|
@ -1394,8 +1394,8 @@ void sub_802DB6C(u8 taskId)
|
|||
u8 battlerId = gTasks[taskId].data[2];
|
||||
s16 newExpPoints;
|
||||
|
||||
newExpPoints = sub_8045C78(battlerId, gHealthboxSpriteIds[battlerId], 1, 0);
|
||||
sub_8043DFC(gHealthboxSpriteIds[battlerId]);
|
||||
newExpPoints = MoveBattleBar(battlerId, gHealthboxSpriteIds[battlerId], 1, 0);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[battlerId]);
|
||||
if (newExpPoints == -1)
|
||||
{
|
||||
u8 level;
|
||||
|
|
@ -1440,7 +1440,7 @@ void sub_802DCB0(u8 taskId)
|
|||
|
||||
if (IsDoubleBattle() == TRUE && pkmnIndex == gBattlerPartyIndexes[bank ^ 2])
|
||||
bank ^= 2;
|
||||
move_anim_start_t4(bank, bank, bank, 0);
|
||||
InitAndLaunchSpecialAnimation(bank, bank, bank, 0);
|
||||
gTasks[taskId].func = sub_802DD10;
|
||||
}
|
||||
|
||||
|
|
@ -1448,15 +1448,15 @@ void sub_802DD10(u8 taskId)
|
|||
{
|
||||
u8 bank = gTasks[taskId].data[2];
|
||||
|
||||
if (!ewram17810[bank].unk0_6)
|
||||
if (!gBattleHealthBoxInfo[bank].specialAnimActive)
|
||||
{
|
||||
u8 pkmnIndex = gTasks[taskId].data[0];
|
||||
|
||||
GetMonData(&gPlayerParty[pkmnIndex], MON_DATA_LEVEL); // Unused return value
|
||||
if (IsDoubleBattle() == TRUE && pkmnIndex == gBattlerPartyIndexes[bank ^ 2])
|
||||
sub_8045A5C(gHealthboxSpriteIds[bank ^ 2], &gPlayerParty[pkmnIndex], 0);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[bank ^ 2], &gPlayerParty[pkmnIndex], 0);
|
||||
else
|
||||
sub_8045A5C(gHealthboxSpriteIds[bank], &gPlayerParty[pkmnIndex], 0);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[bank], &gPlayerParty[pkmnIndex], 0);
|
||||
gTasks[taskId].func = sub_802DDC4;
|
||||
}
|
||||
}
|
||||
|
|
@ -1482,18 +1482,18 @@ void sub_802DE10(void)
|
|||
nullsub_9(species);
|
||||
FreeOamMatrix(gSprites[gBattlerSpriteIds[gActiveBattler]].oam.matrixNum);
|
||||
DestroySprite(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
sub_8043DB0(gHealthboxSpriteIds[gActiveBattler]);
|
||||
SetHealthboxSpriteInvisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
|
||||
void sub_802DEAC(void)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_6)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].specialAnimActive)
|
||||
{
|
||||
FreeSpriteOamMatrix(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
DestroySprite(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
sub_8043DB0(gHealthboxSpriteIds[gActiveBattler]);
|
||||
SetHealthboxSpriteInvisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
|
|
@ -1512,8 +1512,8 @@ void sub_802DF30(void)
|
|||
u8 r4;
|
||||
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_802DF88;
|
||||
r4 = gTasks[gUnknown_0300434C[gActiveBattler]].data[0];
|
||||
DestroyTask(gUnknown_0300434C[gActiveBattler]);
|
||||
r4 = gTasks[gBattleControllerData[gActiveBattler]].data[0];
|
||||
DestroyTask(gBattleControllerData[gActiveBattler]);
|
||||
sub_8094E20(r4);
|
||||
}
|
||||
}
|
||||
|
|
@ -1537,7 +1537,7 @@ void sub_802E004(void)
|
|||
if (!gPaletteFade.active)
|
||||
{
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_802E03C;
|
||||
nullsub_14();
|
||||
ReshowBattleScreenDummy();
|
||||
sub_80A6DCC();
|
||||
}
|
||||
}
|
||||
|
|
@ -1553,7 +1553,7 @@ void sub_802E03C(void)
|
|||
|
||||
void bx_wait_t1(void)
|
||||
{
|
||||
if (!gDoingBattleAnim || !ewram17810[gActiveBattler].unk0_6)
|
||||
if (!gDoingBattleAnim || !gBattleHealthBoxInfo[gActiveBattler].specialAnimActive)
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
|
@ -1706,13 +1706,13 @@ void sub_802E424(void)
|
|||
|
||||
void sub_802E434(void)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_4)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].statusAnimActive)
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
|
||||
void sub_802E460(void)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_5)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].animFromTableActive)
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
|
@ -2053,7 +2053,7 @@ u32 dp01_getattr_by_ch1_for_player_pokemon_(u8 a, u8 *buffer)
|
|||
return size;
|
||||
}
|
||||
|
||||
void PlayerHandlecmd1(void)
|
||||
void PlayerHandleGetRawMonData(void)
|
||||
{
|
||||
struct BattlePokemon battleMon;
|
||||
u8 i;
|
||||
|
|
@ -2341,53 +2341,53 @@ void sub_802F934(u8 bank, u8 b)
|
|||
sub_8032AA8(bank, b);
|
||||
gBattlerPartyIndexes[bank] = gBattleBufferA[bank][1];
|
||||
species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[bank]], MON_DATA_SPECIES);
|
||||
gUnknown_0300434C[bank] = CreateInvisibleSpriteWithCallback(sub_80312F0);
|
||||
GetMonSpriteTemplate_803C56C(species, GetBattlerPosition(bank));
|
||||
gBattleControllerData[bank] = CreateInvisibleSpriteWithCallback(SpriteCB_WaitForBattlerBallReleaseAnim);
|
||||
SetMultiuseSpriteTemplateToPokemon(species, GetBattlerPosition(bank));
|
||||
gBattlerSpriteIds[bank] = CreateSprite(
|
||||
&gCreatingSpriteTemplate,
|
||||
GetBattlerSpriteCoord(bank, 2),
|
||||
sub_8077F68(bank),
|
||||
GetBattlerSubpriority(bank));
|
||||
gSprites[gUnknown_0300434C[bank]].data[1] = gBattlerSpriteIds[bank];
|
||||
GetBattlerSpriteDefault_Y(bank),
|
||||
GetBattlerSpriteSubpriority(bank));
|
||||
gSprites[gBattleControllerData[bank]].data[1] = gBattlerSpriteIds[bank];
|
||||
gSprites[gBattlerSpriteIds[bank]].data[0] = bank;
|
||||
gSprites[gBattlerSpriteIds[bank]].data[2] = species;
|
||||
gSprites[gBattlerSpriteIds[bank]].oam.paletteNum = bank;
|
||||
StartSpriteAnim(&gSprites[gBattlerSpriteIds[bank]], gBattleMonForms[bank]);
|
||||
gSprites[gBattlerSpriteIds[bank]].invisible = TRUE;
|
||||
gSprites[gBattlerSpriteIds[bank]].callback = SpriteCallbackDummy;
|
||||
gSprites[gUnknown_0300434C[bank]].data[0] = StartSendOutMonAnimation(0, 0xFF);
|
||||
gSprites[gBattleControllerData[bank]].data[0] = DoPokeballSendOutAnimation(0, 0xFF);
|
||||
}
|
||||
|
||||
void PlayerHandleReturnPokeToBall(void)
|
||||
{
|
||||
if (gBattleBufferA[gActiveBattler][1] == 0)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk4 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 0;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_802FB2C;
|
||||
}
|
||||
else
|
||||
{
|
||||
FreeSpriteOamMatrix(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
DestroySprite(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
sub_8043DB0(gHealthboxSpriteIds[gActiveBattler]);
|
||||
SetHealthboxSpriteInvisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
|
||||
void sub_802FB2C(void)
|
||||
{
|
||||
switch (ewram17810[gActiveBattler].unk4)
|
||||
switch (gBattleHealthBoxInfo[gActiveBattler].animationState)
|
||||
{
|
||||
case 0:
|
||||
if (gBattleSpriteInfo[gActiveBattler].substituteSprite)
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, gActiveBattler, 5);
|
||||
ewram17810[gActiveBattler].unk4 = 1;
|
||||
if (gBattleSpriteInfo[gActiveBattler].behindSubstitute)
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, 5);
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 1;
|
||||
break;
|
||||
case 1:
|
||||
if (!ewram17810[gActiveBattler].unk0_6)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].specialAnimActive)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk4 = 0;
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, gActiveBattler, 1);
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 0;
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, 1);
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_802DEAC;
|
||||
}
|
||||
}
|
||||
|
|
@ -2408,24 +2408,24 @@ void PlayerHandleTrainerThrow(void)
|
|||
{
|
||||
r7 = 0;
|
||||
}
|
||||
LoadPlayerTrainerBankSprite(gSaveBlock2.playerGender, gActiveBattler);
|
||||
GetMonSpriteTemplate_803C5A0(gSaveBlock2.playerGender, GetBattlerPosition(gActiveBattler));
|
||||
DecompressTrainerBackPic(gSaveBlock2.playerGender, gActiveBattler);
|
||||
SetMultiuseSpriteTemplateToTrainerBack(gSaveBlock2.playerGender, GetBattlerPosition(gActiveBattler));
|
||||
gBattlerSpriteIds[gActiveBattler] = CreateSprite(
|
||||
&gCreatingSpriteTemplate,
|
||||
r7 + 80,
|
||||
(8 - gTrainerBackPicCoords[gSaveBlock2.playerGender].coords) * 4 + 80,
|
||||
GetBattlerSubpriority(gActiveBattler));
|
||||
GetBattlerSpriteSubpriority(gActiveBattler));
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = 240;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = -2;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_80313A0;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_TrainerSlideIn;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_802D204;
|
||||
}
|
||||
|
||||
void PlayerHandleTrainerSlide(void)
|
||||
{
|
||||
LoadPlayerTrainerBankSprite(gSaveBlock2.playerGender, gActiveBattler);
|
||||
GetMonSpriteTemplate_803C5A0(gSaveBlock2.playerGender, GetBattlerPosition(gActiveBattler));
|
||||
DecompressTrainerBackPic(gSaveBlock2.playerGender, gActiveBattler);
|
||||
SetMultiuseSpriteTemplateToTrainerBack(gSaveBlock2.playerGender, GetBattlerPosition(gActiveBattler));
|
||||
gBattlerSpriteIds[gActiveBattler] = CreateSprite(
|
||||
&gCreatingSpriteTemplate,
|
||||
80,
|
||||
|
|
@ -2434,13 +2434,13 @@ void PlayerHandleTrainerSlide(void)
|
|||
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = -96;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 2;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_80313A0;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_TrainerSlideIn;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_802D23C;
|
||||
}
|
||||
|
||||
void PlayerHandleTrainerSlideBack(void)
|
||||
{
|
||||
oamt_add_pos2_onto_pos1(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
SetSpritePrimaryCoordsFromSecondaryCoords(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 50;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = -40;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].y;
|
||||
|
|
@ -2452,17 +2452,17 @@ void PlayerHandleTrainerSlideBack(void)
|
|||
|
||||
void PlayerHandlecmd10(void)
|
||||
{
|
||||
if (ewram17810[gActiveBattler].unk4 == 0)
|
||||
if (gBattleHealthBoxInfo[gActiveBattler].animationState == 0)
|
||||
{
|
||||
if (gBattleSpriteInfo[gActiveBattler].substituteSprite)
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, gActiveBattler, 5);
|
||||
ewram17810[gActiveBattler].unk4++;
|
||||
if (gBattleSpriteInfo[gActiveBattler].behindSubstitute)
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, 5);
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ewram17810[gActiveBattler].unk0_6 == 0)
|
||||
if (gBattleHealthBoxInfo[gActiveBattler].specialAnimActive == 0)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk4 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 0;
|
||||
HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler);
|
||||
PlaySE12WithPanning(SE_FAINT, -64);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[1] = 0;
|
||||
|
|
@ -2483,7 +2483,7 @@ void PlayerHandlecmd12(void)
|
|||
{
|
||||
ewram17840.unk8 = 4;
|
||||
gDoingBattleAnim = 1;
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, GetBattlerAtPosition(1), 3);
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, GetBattlerAtPosition(1), 3);
|
||||
gBattlerControllerFuncs[gActiveBattler] = bx_wait_t1;
|
||||
}
|
||||
|
||||
|
|
@ -2493,7 +2493,7 @@ void PlayerHandleBallThrow(void)
|
|||
|
||||
ewram17840.unk8 = var;
|
||||
gDoingBattleAnim = 1;
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, GetBattlerAtPosition(1), 3);
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, GetBattlerAtPosition(1), 3);
|
||||
gBattlerControllerFuncs[gActiveBattler] = bx_wait_t1;
|
||||
}
|
||||
|
||||
|
|
@ -2528,7 +2528,7 @@ void PlayerHandleMoveAnimation(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
ewram17810[gActiveBattler].unk4 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 0;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_8030190;
|
||||
}
|
||||
}
|
||||
|
|
@ -2539,44 +2539,44 @@ void sub_8030190(void)
|
|||
u16 r4 = gBattleBufferA[gActiveBattler][1] | (gBattleBufferA[gActiveBattler][2] << 8);
|
||||
u8 r7 = gBattleBufferA[gActiveBattler][11];
|
||||
|
||||
switch (ewram17810[gActiveBattler].unk4)
|
||||
switch (gBattleHealthBoxInfo[gActiveBattler].animationState)
|
||||
{
|
||||
case 0:
|
||||
if (gBattleSpriteInfo[gActiveBattler].substituteSprite == 1 &&
|
||||
if (gBattleSpriteInfo[gActiveBattler].behindSubstitute == 1 &&
|
||||
gBattleSpriteInfo[gActiveBattler].flag_x8 == 0)
|
||||
{
|
||||
gBattleSpriteInfo[gActiveBattler].flag_x8 = 1;
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, gActiveBattler, 5);
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, 5);
|
||||
}
|
||||
ewram17810[gActiveBattler].unk4 = 1;
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 1;
|
||||
break;
|
||||
case 1:
|
||||
if (ewram17810[gActiveBattler].unk0_6 == 0)
|
||||
if (gBattleHealthBoxInfo[gActiveBattler].specialAnimActive == 0)
|
||||
{
|
||||
sub_80326EC(0);
|
||||
SetBattlerSpriteAffineMode(0);
|
||||
DoMoveAnim(r4);
|
||||
ewram17810[gActiveBattler].unk4 = 2;
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 2;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
gAnimScriptCallback();
|
||||
if (!gAnimScriptActive)
|
||||
{
|
||||
sub_80326EC(1);
|
||||
if (gBattleSpriteInfo[gActiveBattler].substituteSprite == 1 && r7 < 2)
|
||||
SetBattlerSpriteAffineMode(1);
|
||||
if (gBattleSpriteInfo[gActiveBattler].behindSubstitute == 1 && r7 < 2)
|
||||
{
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, gActiveBattler, 6);
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, gActiveBattler, 6);
|
||||
gBattleSpriteInfo[gActiveBattler].flag_x8 = 0;
|
||||
}
|
||||
ewram17810[gActiveBattler].unk4 = 3;
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 3;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (ewram17810[gActiveBattler].unk0_6 == 0)
|
||||
if (gBattleHealthBoxInfo[gActiveBattler].specialAnimActive == 0)
|
||||
{
|
||||
sub_8031F24();
|
||||
sub_80324BC(gActiveBattler, gBattleBufferA[gActiveBattler][1] | (gBattleBufferA[gActiveBattler][2] << 8));
|
||||
ewram17810[gActiveBattler].unk4 = 0;
|
||||
CopyAllBattleSpritesInvisibilities();
|
||||
TrySetBehindSubstituteSpriteBit(gActiveBattler, gBattleBufferA[gActiveBattler][1] | (gBattleBufferA[gActiveBattler][2] << 8));
|
||||
gBattleHealthBoxInfo[gActiveBattler].animationState = 0;
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
break;
|
||||
|
|
@ -2658,7 +2658,7 @@ void PlayerHandleOpenBag(void)
|
|||
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB(0, 0, 0));
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_802E004;
|
||||
gBankInMenu = gActiveBattler;
|
||||
gBattlerInMenuId = gActiveBattler;
|
||||
for (i = 0; i < 3; i++)
|
||||
gBattlePartyCurrentOrder[i] = gBattleBufferA[gActiveBattler][1 + i];
|
||||
}
|
||||
|
|
@ -2667,8 +2667,8 @@ void PlayerHandlecmd22(void)
|
|||
{
|
||||
s32 i;
|
||||
|
||||
gUnknown_0300434C[gActiveBattler] = CreateTask(TaskDummy, 0xFF);
|
||||
gTasks[gUnknown_0300434C[gActiveBattler]].data[0] = gBattleBufferA[gActiveBattler][1] & 0xF;
|
||||
gBattleControllerData[gActiveBattler] = CreateTask(TaskDummy, 0xFF);
|
||||
gTasks[gBattleControllerData[gActiveBattler]].data[0] = gBattleBufferA[gActiveBattler][1] & 0xF;
|
||||
gBattleStruct->battlerPreventingSwitchout = gBattleBufferA[gActiveBattler][1] >> 4;
|
||||
gBattleStruct->unk1609D = gBattleBufferA[gActiveBattler][2];
|
||||
gBattleStruct->abilityPreventingSwitchout = gBattleBufferA[gActiveBattler][3];
|
||||
|
|
@ -2676,7 +2676,7 @@ void PlayerHandlecmd22(void)
|
|||
gBattlePartyCurrentOrder[i] = gBattleBufferA[gActiveBattler][4 + i];
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB(0, 0, 0));
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_802DF30;
|
||||
gBankInMenu = gActiveBattler;
|
||||
gBattlerInMenuId = gActiveBattler;
|
||||
}
|
||||
|
||||
void PlayerHandlecmd23(void)
|
||||
|
|
@ -2690,21 +2690,21 @@ void PlayerHandleHealthBarUpdate(void)
|
|||
{
|
||||
s16 r7;
|
||||
|
||||
load_gfxc_health_bar(0);
|
||||
LoadBattleBarGfx(0);
|
||||
r7 = gBattleBufferA[gActiveBattler][2] | (gBattleBufferA[gActiveBattler][3] << 8);
|
||||
if (r7 != 0x7FFF)
|
||||
{
|
||||
u32 maxHP = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MAX_HP);
|
||||
u32 curHP = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_HP);
|
||||
|
||||
sub_8043D84(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, curHP, r7);
|
||||
SetBattleBarStruct(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, curHP, r7);
|
||||
}
|
||||
else
|
||||
{
|
||||
u32 maxHP = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_MAX_HP);
|
||||
|
||||
sub_8043D84(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, 0, r7);
|
||||
sub_80440EC(gHealthboxSpriteIds[gActiveBattler], 0, 0);
|
||||
SetBattleBarStruct(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], maxHP, 0, r7);
|
||||
UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], 0, 0);
|
||||
}
|
||||
gBattlerControllerFuncs[gActiveBattler] = bx_t1_healthbar_update;
|
||||
}
|
||||
|
|
@ -2722,14 +2722,14 @@ void PlayerHandleExpBarUpdate(void)
|
|||
u16 r4;
|
||||
u8 taskId;
|
||||
|
||||
load_gfxc_health_bar(1);
|
||||
LoadBattleBarGfx(1);
|
||||
GetMonData(&gPlayerParty[r7], MON_DATA_SPECIES); // unused return value
|
||||
r4 = gBattleBufferA[gActiveBattler][2] | (gBattleBufferA[gActiveBattler][3] << 8);
|
||||
taskId = CreateTask(sub_802D924, 10);
|
||||
gTasks[taskId].data[0] = r7;
|
||||
gTasks[taskId].data[1] = r4;
|
||||
gTasks[taskId].data[2] = gActiveBattler;
|
||||
gBattlerControllerFuncs[gActiveBattler] = nullsub_91;
|
||||
gBattlerControllerFuncs[gActiveBattler] = BattleControllerDummy;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2737,8 +2737,8 @@ void PlayerHandleStatusIconUpdate(void)
|
|||
{
|
||||
if (!mplay_80342A4(gActiveBattler))
|
||||
{
|
||||
sub_8045A5C(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], 9);
|
||||
ewram17810[gActiveBattler].unk0_4 = 0;
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], 9);
|
||||
gBattleHealthBoxInfo[gActiveBattler].statusAnimActive = 0;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_802E434;
|
||||
}
|
||||
}
|
||||
|
|
@ -2848,7 +2848,7 @@ void PlayerHandleHitAnimation(void)
|
|||
{
|
||||
gDoingBattleAnim = 1;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[1] = 0;
|
||||
sub_8047858(gActiveBattler);
|
||||
DoHitAnimHealthboxEffect(gActiveBattler);
|
||||
gBattlerControllerFuncs[gActiveBattler] = bx_blink_t1;
|
||||
}
|
||||
}
|
||||
|
|
@ -2886,7 +2886,7 @@ void PlayerHandleFaintingCry(void)
|
|||
|
||||
void PlayerHandleIntroSlide(void)
|
||||
{
|
||||
StartBattleIntroAnim(gBattleBufferA[gActiveBattler][1]);
|
||||
HandleIntroSlide(gBattleBufferA[gActiveBattler][1]);
|
||||
gIntroSlideFlags |= 1;
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
|
|
@ -2896,26 +2896,26 @@ void PlayerHandleTrainerBallThrow(void)
|
|||
u8 paletteNum;
|
||||
u8 taskId;
|
||||
|
||||
oamt_add_pos2_onto_pos1(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
SetSpritePrimaryCoordsFromSecondaryCoords(&gSprites[gBattlerSpriteIds[gActiveBattler]]);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = 50;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[2] = -40;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[4] = gSprites[gBattlerSpriteIds[gActiveBattler]].y;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = StartAnimLinearTranslation;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[5] = gActiveBattler;
|
||||
StoreSpriteCallbackInData(&gSprites[gBattlerSpriteIds[gActiveBattler]], sub_8030E38);
|
||||
StoreSpriteCallbackInData(&gSprites[gBattlerSpriteIds[gActiveBattler]], SpriteCB_FreePlayerSpriteLoadMonSprite);
|
||||
StartSpriteAnim(&gSprites[gBattlerSpriteIds[gActiveBattler]], 1);
|
||||
paletteNum = AllocSpritePalette(0xD6F8);
|
||||
LoadCompressedPalette(gTrainerBackPicPaletteTable[gSaveBlock2.playerGender].data, 0x100 + paletteNum * 16, 32);
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = paletteNum;
|
||||
taskId = CreateTask(task05_08033660, 5);
|
||||
gTasks[taskId].data[0] = gActiveBattler;
|
||||
if (ewram17810[gActiveBattler].unk0_0)
|
||||
gTasks[gUnknown_02024E68[gActiveBattler]].func = sub_8044CA0;
|
||||
ewram17810[4].unk9 |= 1;
|
||||
gBattlerControllerFuncs[gActiveBattler] = nullsub_91;
|
||||
if (gBattleHealthBoxInfo[gActiveBattler].partyStatusSummaryShown)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8044CA0;
|
||||
gBattleHealthBoxInfo[4].unk9 |= 1;
|
||||
gBattlerControllerFuncs[gActiveBattler] = BattleControllerDummy;
|
||||
}
|
||||
|
||||
void sub_8030E38(struct Sprite *sprite)
|
||||
void SpriteCB_FreePlayerSpriteLoadMonSprite(struct Sprite *sprite)
|
||||
{
|
||||
u8 r4 = sprite->data[5];
|
||||
|
||||
|
|
@ -2966,28 +2966,28 @@ void PlayerHandlecmd48(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
ewram17810[gActiveBattler].unk0_0 = 1;
|
||||
gUnknown_02024E68[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]);
|
||||
ewram17810[gActiveBattler].unk5 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].partyStatusSummaryShown = 1;
|
||||
gBattlerStatusSummaryTaskId[gActiveBattler] = CreatePartyStatusSummarySprites(gActiveBattler, (struct HpAndStatus *)&gBattleBufferA[gActiveBattler][4], gBattleBufferA[gActiveBattler][1], gBattleBufferA[gActiveBattler][2]);
|
||||
gBattleHealthBoxInfo[gActiveBattler].unk5 = 0;
|
||||
if (gBattleBufferA[gActiveBattler][2] != 0)
|
||||
ewram17810[gActiveBattler].unk5 = 0x5D;
|
||||
gBattleHealthBoxInfo[gActiveBattler].unk5 = 0x5D;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_8031064;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8031064(void)
|
||||
{
|
||||
if (ewram17810[gActiveBattler].unk5++ > 0x5C)
|
||||
if (gBattleHealthBoxInfo[gActiveBattler].unk5++ > 0x5C)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk5 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].unk5 = 0;
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
|
||||
void PlayerHandlecmd49(void)
|
||||
{
|
||||
if (ewram17810[gActiveBattler].unk0_0)
|
||||
gTasks[gUnknown_02024E68[gActiveBattler]].func = sub_8044CA0;
|
||||
if (gBattleHealthBoxInfo[gActiveBattler].partyStatusSummaryShown)
|
||||
gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = sub_8044CA0;
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
|
@ -3015,7 +3015,7 @@ void PlayerHandleBattleAnimation(void)
|
|||
u8 val2 = gBattleBufferA[gActiveBattler][1];
|
||||
u16 val = gBattleBufferA[gActiveBattler][2] | (gBattleBufferA[gActiveBattler][3] << 8);
|
||||
|
||||
if (move_anim_start_t3(gActiveBattler, gActiveBattler, gActiveBattler, val2, val))
|
||||
if (TryHandleLaunchBattleTableAnimation(gActiveBattler, gActiveBattler, gActiveBattler, val2, val))
|
||||
PlayerBufferExecCompleted();
|
||||
else
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_802E460;
|
||||
|
|
|
|||
|
|
@ -1,19 +1,20 @@
|
|||
#include "global.h"
|
||||
#include "battle_anim_81258BC.h"
|
||||
#include "battle.h"
|
||||
#include "battle_controllers.h"
|
||||
#include "battle_interface.h"
|
||||
#include "battle_message.h"
|
||||
#include "battle.h"
|
||||
#include "data2.h"
|
||||
#include "ewram.h"
|
||||
#include "link.h"
|
||||
#include "main.h"
|
||||
#include "menu_cursor.h"
|
||||
#include "palette.h"
|
||||
#include "constants/songs.h"
|
||||
#include "pokeball.h"
|
||||
#include "sound.h"
|
||||
#include "text.h"
|
||||
#include "util.h"
|
||||
#include "ewram.h"
|
||||
#include "constants/songs.h"
|
||||
|
||||
extern struct Window gWindowTemplate_Contest_MoveDescription;
|
||||
extern u8 gDisplayedStringBattle[];
|
||||
|
|
@ -32,7 +33,7 @@ extern u16 gBattleTypeFlags;
|
|||
extern u32 gBattleControllerExecFlags;
|
||||
extern u16 gSpecialVar_ItemId;
|
||||
extern MainCallback gPreBattleCallback1;
|
||||
extern u8 gBankInMenu;
|
||||
extern u8 gBattlerInMenuId;
|
||||
extern u8 gHealthboxSpriteIds[];
|
||||
extern u16 gBattlerPartyIndexes[];
|
||||
extern u16 gIntroSlideFlags;
|
||||
|
|
@ -41,13 +42,12 @@ extern u8 gBattleOutcome;
|
|||
extern u8 GetBattlerSide(u8);
|
||||
extern u8 GetBattlerAtPosition(u8);
|
||||
extern u8 GetBattlerPosition(u8);
|
||||
extern void LoadPlayerTrainerBankSprite();
|
||||
extern u8 GetBattlerSubpriority();
|
||||
extern void sub_80313A0(struct Sprite *);
|
||||
extern void DecompressTrainerBackPic();
|
||||
extern u8 GetBattlerSpriteSubpriority();
|
||||
extern void SpriteCB_TrainerSlideIn(struct Sprite *);
|
||||
extern void sub_810BADC(void);
|
||||
extern void StartBattleIntroAnim();
|
||||
extern void sub_804777C();
|
||||
extern bool8 move_anim_start_t3();
|
||||
extern void HandleIntroSlide();
|
||||
extern bool8 TryHandleLaunchBattleTableAnimation();
|
||||
|
||||
#if ENGLISH
|
||||
#define SUB_812BB10_TILE_DATA_OFFSET 440
|
||||
|
|
@ -272,8 +272,8 @@ void bx_battle_menu_t6_2(void)
|
|||
#if DEBUG
|
||||
else if (JOY_NEW(R_BUTTON))
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_5)
|
||||
move_anim_start_t3(gActiveBattler, gActiveBattler, gActiveBattler, 4, 0);
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].animFromTableActive)
|
||||
TryHandleLaunchBattleTableAnimation(gActiveBattler, gActiveBattler, gActiveBattler, 4, 0);
|
||||
}
|
||||
else if (JOY_NEW(START_BUTTON))
|
||||
{
|
||||
|
|
@ -306,7 +306,7 @@ void sub_812B6AC(void)
|
|||
|
||||
void bx_wait_t6(void)
|
||||
{
|
||||
if (!gDoingBattleAnim || !ewram17810[gActiveBattler].unk0_6)
|
||||
if (!gDoingBattleAnim || !gBattleHealthBoxInfo[gActiveBattler].specialAnimActive)
|
||||
SafariBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
|
@ -330,7 +330,7 @@ void sub_812B758(void)
|
|||
|
||||
void sub_812B794(void)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_5)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].animFromTableActive)
|
||||
SafariBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
|
@ -352,7 +352,7 @@ void SafariBufferExecCompleted(void)
|
|||
|
||||
void unref_sub_812B838(void)
|
||||
{
|
||||
if (!ewram17810[gActiveBattler].unk0_4)
|
||||
if (!gBattleHealthBoxInfo[gActiveBattler].statusAnimActive)
|
||||
SafariBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
|
@ -393,8 +393,8 @@ void SafariHandleReturnPokeToBall(void)
|
|||
|
||||
void SafariHandleTrainerThrow(void)
|
||||
{
|
||||
LoadPlayerTrainerBankSprite(gSaveBlock2.playerGender, gActiveBattler);
|
||||
GetMonSpriteTemplate_803C5A0(gSaveBlock2.playerGender, GetBattlerPosition(gActiveBattler));
|
||||
DecompressTrainerBackPic(gSaveBlock2.playerGender, gActiveBattler);
|
||||
SetMultiuseSpriteTemplateToTrainerBack(gSaveBlock2.playerGender, GetBattlerPosition(gActiveBattler));
|
||||
gBattlerSpriteIds[gActiveBattler] = CreateSprite(
|
||||
&gCreatingSpriteTemplate,
|
||||
80,
|
||||
|
|
@ -403,7 +403,7 @@ void SafariHandleTrainerThrow(void)
|
|||
gSprites[gBattlerSpriteIds[gActiveBattler]].oam.paletteNum = gActiveBattler;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].x2 = 240;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].data[0] = -2;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = sub_80313A0;
|
||||
gSprites[gBattlerSpriteIds[gActiveBattler]].callback = SpriteCB_TrainerSlideIn;
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_812B65C;
|
||||
}
|
||||
|
||||
|
|
@ -431,7 +431,7 @@ void SafariHandlecmd12(void)
|
|||
{
|
||||
ewram17840.unk8 = 4;
|
||||
gDoingBattleAnim = 1;
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, GetBattlerAtPosition(1), 4);
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, GetBattlerAtPosition(1), 4);
|
||||
gBattlerControllerFuncs[gActiveBattler] = bx_wait_t6;
|
||||
}
|
||||
|
||||
|
|
@ -441,7 +441,7 @@ void SafariHandleBallThrow(void)
|
|||
|
||||
ewram17840.unk8 = var;
|
||||
gDoingBattleAnim = 1;
|
||||
move_anim_start_t4(gActiveBattler, gActiveBattler, GetBattlerAtPosition(1), 4);
|
||||
InitAndLaunchSpecialAnimation(gActiveBattler, gActiveBattler, GetBattlerAtPosition(1), 4);
|
||||
gBattlerControllerFuncs[gActiveBattler] = bx_wait_t6;
|
||||
}
|
||||
|
||||
|
|
@ -512,7 +512,7 @@ void SafariHandleOpenBag(void)
|
|||
{
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB(0, 0, 0));
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_812B724;
|
||||
gBankInMenu = gActiveBattler;
|
||||
gBattlerInMenuId = gActiveBattler;
|
||||
}
|
||||
|
||||
void SafariHandlecmd22(void)
|
||||
|
|
@ -537,7 +537,7 @@ void SafariHandleExpBarUpdate(void)
|
|||
|
||||
void SafariHandleStatusIconUpdate(void)
|
||||
{
|
||||
sub_8045A5C(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], 11);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], 11);
|
||||
SafariBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
|
@ -643,22 +643,22 @@ void SafariHandleFaintingCry(void)
|
|||
{
|
||||
u16 species = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES);
|
||||
|
||||
PlayCry1(species, 25);
|
||||
PlayCry_Normal(species, 25);
|
||||
SafariBufferExecCompleted();
|
||||
}
|
||||
|
||||
void SafariHandleIntroSlide(void)
|
||||
{
|
||||
StartBattleIntroAnim(gBattleBufferA[gActiveBattler][1]);
|
||||
HandleIntroSlide(gBattleBufferA[gActiveBattler][1]);
|
||||
gIntroSlideFlags |= 1;
|
||||
SafariBufferExecCompleted();
|
||||
}
|
||||
|
||||
void SafariHandleTrainerBallThrow(void)
|
||||
{
|
||||
sub_8045A5C(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], 10);
|
||||
sub_804777C(gActiveBattler);
|
||||
sub_8043DFC(gHealthboxSpriteIds[gActiveBattler]);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], 10);
|
||||
StartHealthboxSlideIn(gActiveBattler);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
SafariBufferExecCompleted();
|
||||
}
|
||||
|
||||
|
|
@ -687,7 +687,7 @@ void SafariHandleBattleAnimation(void)
|
|||
u8 r3 = gBattleBufferA[gActiveBattler][1];
|
||||
u16 r4 = gBattleBufferA[gActiveBattler][2] | (gBattleBufferA[gActiveBattler][3] << 8);
|
||||
|
||||
if (move_anim_start_t3(gActiveBattler, gActiveBattler, gActiveBattler, r3, r4) != 0)
|
||||
if (TryHandleLaunchBattleTableAnimation(gActiveBattler, gActiveBattler, gActiveBattler, r3, r4) != 0)
|
||||
SafariBufferExecCompleted();
|
||||
else
|
||||
gBattlerControllerFuncs[gActiveBattler] = sub_812B794;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -87,7 +87,7 @@ void SetUpBattleVarsAndBirchPoochyena(void)
|
|||
|
||||
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
|
||||
{
|
||||
gBattlerControllerFuncs[i] = nullsub_91;
|
||||
gBattlerControllerFuncs[i] = BattleControllerDummy;
|
||||
gBattlerPositions[i] = 0xFF;
|
||||
gActionSelectionCursor[i] = 0;
|
||||
gMoveSelectionCursor[i] = 0;
|
||||
|
|
@ -145,7 +145,7 @@ static void InitSinglePlayerBtlControllers(void)
|
|||
if (gBattleTypeFlags & BATTLE_TYPE_SAFARI)
|
||||
gBattlerControllerFuncs[0] = SetBankFuncToSafariBufferRunCommand;
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_WALLY_TUTORIAL)
|
||||
gBattlerControllerFuncs[0] = SetBankFuncToWallyBufferRunCommand;
|
||||
gBattlerControllerFuncs[0] = SetControllerToWally;
|
||||
else
|
||||
gBattlerControllerFuncs[0] = SetBankFuncToPlayerBufferRunCommand;
|
||||
gBattlerPositions[0] = 0;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ extern u32 gTransformedPersonalities[];
|
|||
extern struct Window gWindowTemplate_Contest_MoveDescription;
|
||||
extern void (*gBattlerControllerFuncs[])(void);
|
||||
extern u8 gHealthboxSpriteIds[];
|
||||
extern u8 gUnknown_0300434C[];
|
||||
extern u8 gBattleControllerData[];
|
||||
extern struct MusicPlayerInfo gMPlayInfo_SE1;
|
||||
extern struct MusicPlayerInfo gMPlayInfo_SE2;
|
||||
extern struct MusicPlayerInfo gMPlayInfo_BGM;
|
||||
|
|
@ -93,10 +93,9 @@ const struct SpritePalette gUnknown_0820A4D4[] =
|
|||
{ gUnknown_08D1214C, 0xD704 },
|
||||
};
|
||||
|
||||
extern void c3_0802FDF4(u8);
|
||||
extern void sub_804777C();
|
||||
extern void Task_PlayerController_RestoreBgmAfterCry(u8);
|
||||
extern u8 IsBankSpritePresent(u8);
|
||||
extern u8 sub_8077F68(u8);
|
||||
extern u8 GetBattlerSpriteDefault_Y(u8);
|
||||
extern u8 sub_8077F7C(u8);
|
||||
extern void sub_8094958(void);
|
||||
extern void sub_80105DC(struct Sprite *);
|
||||
|
|
@ -112,7 +111,7 @@ void sub_80327CC(void);
|
|||
void sub_8032978(struct Sprite *);
|
||||
void sub_80328A4(struct Sprite *);
|
||||
|
||||
void sub_80312F0(struct Sprite *sprite)
|
||||
void SpriteCB_WaitForBattlerBallReleaseAnim(struct Sprite *sprite)
|
||||
{
|
||||
u8 spriteId = sprite->data[1];
|
||||
|
||||
|
|
@ -140,7 +139,7 @@ void unref_sub_8031364(struct Sprite *sprite, bool8 stupid)
|
|||
AnimateSprite(sprite);
|
||||
}
|
||||
|
||||
void sub_80313A0(struct Sprite *sprite)
|
||||
void SpriteCB_TrainerSlideIn(struct Sprite *sprite)
|
||||
{
|
||||
if (!(gIntroSlideFlags & 1))
|
||||
{
|
||||
|
|
@ -152,7 +151,7 @@ void sub_80313A0(struct Sprite *sprite)
|
|||
|
||||
void move_anim_start_t2_for_situation(u8 a, u32 b)
|
||||
{
|
||||
ewram17810[gActiveBattler].unk0_4 = 1;
|
||||
gBattleHealthBoxInfo[gActiveBattler].statusAnimActive = 1;
|
||||
if (a == 0)
|
||||
{
|
||||
if (b == 0x20)
|
||||
|
|
@ -166,7 +165,7 @@ void move_anim_start_t2_for_situation(u8 a, u32 b)
|
|||
else if (b == 0x40)
|
||||
move_anim_start_t2(gActiveBattler, 5);
|
||||
else
|
||||
ewram17810[gActiveBattler].unk0_4 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].statusAnimActive = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -181,11 +180,11 @@ void move_anim_start_t2_for_situation(u8 a, u32 b)
|
|||
else if (b & 0x0000E000)
|
||||
move_anim_start_t2(gActiveBattler, 9);
|
||||
else
|
||||
ewram17810[gActiveBattler].unk0_4 = 0;
|
||||
gBattleHealthBoxInfo[gActiveBattler].statusAnimActive = 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool8 move_anim_start_t3(u8 a, u8 b, u8 c, u8 d, u16 e)
|
||||
bool8 TryHandleLaunchBattleTableAnimation(u8 a, u8 b, u8 c, u8 d, u16 e)
|
||||
{
|
||||
u8 taskId;
|
||||
|
||||
|
|
@ -194,9 +193,9 @@ bool8 move_anim_start_t3(u8 a, u8 b, u8 c, u8 d, u16 e)
|
|||
gBattleMonForms[a] = e & 0x7F;
|
||||
return TRUE;
|
||||
}
|
||||
if (gBattleSpriteInfo[a].substituteSprite && sub_803163C(d) == 0)
|
||||
if (gBattleSpriteInfo[a].behindSubstitute && sub_803163C(d) == 0)
|
||||
return TRUE;
|
||||
if (gBattleSpriteInfo[a].substituteSprite && d == 2 && gSprites[gBattlerSpriteIds[a]].invisible)
|
||||
if (gBattleSpriteInfo[a].behindSubstitute && d == 2 && gSprites[gBattlerSpriteIds[a]].invisible)
|
||||
{
|
||||
refresh_graphics_maybe(a, 1, gBattlerSpriteIds[a]);
|
||||
sub_80324E0(a);
|
||||
|
|
@ -208,7 +207,7 @@ bool8 move_anim_start_t3(u8 a, u8 b, u8 c, u8 d, u16 e)
|
|||
LaunchBattleAnimation(gBattleAnims_General, d, 0);
|
||||
taskId = CreateTask(sub_80315E8, 10);
|
||||
gTasks[taskId].data[0] = a;
|
||||
ewram17810[gTasks[taskId].data[0]].unk0_5 = 1;
|
||||
gBattleHealthBoxInfo[gTasks[taskId].data[0]].animFromTableActive = 1;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -217,7 +216,7 @@ void sub_80315E8(u8 taskId)
|
|||
gAnimScriptCallback();
|
||||
if (!gAnimScriptActive)
|
||||
{
|
||||
ewram17810[gTasks[taskId].data[0]].unk0_5 = 0;
|
||||
gBattleHealthBoxInfo[gTasks[taskId].data[0]].animFromTableActive = 0;
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
}
|
||||
|
|
@ -238,7 +237,7 @@ u8 sub_803163C(u8 a)
|
|||
}
|
||||
}
|
||||
|
||||
void move_anim_start_t4(u8 a, u8 b, u8 c, u8 d)
|
||||
void InitAndLaunchSpecialAnimation(u8 a, u8 b, u8 c, u8 d)
|
||||
{
|
||||
u8 taskId;
|
||||
|
||||
|
|
@ -247,7 +246,7 @@ void move_anim_start_t4(u8 a, u8 b, u8 c, u8 d)
|
|||
LaunchBattleAnimation(gBattleAnims_Special, d, 0);
|
||||
taskId = CreateTask(sub_80316CC, 10);
|
||||
gTasks[taskId].data[0] = a;
|
||||
ewram17810[gTasks[taskId].data[0]].unk0_6 = 1;
|
||||
gBattleHealthBoxInfo[gTasks[taskId].data[0]].specialAnimActive = 1;
|
||||
}
|
||||
|
||||
void sub_80316CC(u8 taskId)
|
||||
|
|
@ -255,7 +254,7 @@ void sub_80316CC(u8 taskId)
|
|||
gAnimScriptCallback();
|
||||
if (!gAnimScriptActive)
|
||||
{
|
||||
ewram17810[gTasks[taskId].data[0]].unk0_6 = 0;
|
||||
gBattleHealthBoxInfo[gTasks[taskId].data[0]].specialAnimActive = 0;
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
}
|
||||
|
|
@ -271,15 +270,15 @@ bool8 mplay_80342A4(u8 a)
|
|||
|
||||
if (IsSEPlaying())
|
||||
{
|
||||
ewram17810[a].unk8++;
|
||||
if (ewram17810[gActiveBattler].unk8 < 30)
|
||||
gBattleHealthBoxInfo[a].unk8++;
|
||||
if (gBattleHealthBoxInfo[gActiveBattler].unk8 < 30)
|
||||
return TRUE;
|
||||
m4aMPlayStop(&gMPlayInfo_SE1);
|
||||
m4aMPlayStop(&gMPlayInfo_SE2);
|
||||
}
|
||||
if (zero == 0)
|
||||
{
|
||||
ewram17810[a].unk8 = 0;
|
||||
gBattleHealthBoxInfo[a].unk8 = 0;
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
|
|
@ -296,14 +295,14 @@ void BattleLoadOpponentMonSprite(struct Pokemon *pkmn, u8 b)
|
|||
const u8 *lzPaletteData;
|
||||
|
||||
personalityValue = GetMonData(pkmn, MON_DATA_PERSONALITY);
|
||||
if (gBattleSpriteInfo[b].transformedSpecies == 0)
|
||||
if (gBattleSpriteInfo[b].transformSpecies == 0)
|
||||
{
|
||||
species = GetMonData(pkmn, MON_DATA_SPECIES);
|
||||
r7 = personalityValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
species = gBattleSpriteInfo[b].transformedSpecies;
|
||||
species = gBattleSpriteInfo[b].transformSpecies;
|
||||
r7 = gTransformedPersonalities[b];
|
||||
}
|
||||
otId = GetMonData(pkmn, MON_DATA_OT_ID);
|
||||
|
|
@ -317,7 +316,7 @@ void BattleLoadOpponentMonSprite(struct Pokemon *pkmn, u8 b)
|
|||
species,
|
||||
r7);
|
||||
paletteOffset = 0x100 + b * 16;
|
||||
if (gBattleSpriteInfo[b].transformedSpecies == 0)
|
||||
if (gBattleSpriteInfo[b].transformSpecies == 0)
|
||||
lzPaletteData = GetMonSpritePal(pkmn);
|
||||
else
|
||||
lzPaletteData = GetMonSpritePalFromOtIdPersonality(species, otId, personalityValue);
|
||||
|
|
@ -330,7 +329,7 @@ void BattleLoadOpponentMonSprite(struct Pokemon *pkmn, u8 b)
|
|||
LZDecompressWram(lzPaletteData, ewram16400);
|
||||
LoadPalette(ewram16400 + gBattleMonForms[b] * 32, paletteOffset, 0x20);
|
||||
}
|
||||
if (gBattleSpriteInfo[b].transformedSpecies != 0)
|
||||
if (gBattleSpriteInfo[b].transformSpecies != 0)
|
||||
{
|
||||
BlendPalette(paletteOffset, 16, 6, RGB(31, 31, 31));
|
||||
CpuCopy32(gPlttBufferFaded + paletteOffset, gPlttBufferUnfaded + paletteOffset, 32);
|
||||
|
|
@ -348,14 +347,14 @@ void BattleLoadPlayerMonSprite(struct Pokemon *pkmn, u8 b)
|
|||
const u8 *lzPaletteData;
|
||||
|
||||
personalityValue = GetMonData(pkmn, MON_DATA_PERSONALITY);
|
||||
if (gBattleSpriteInfo[b].transformedSpecies == 0)
|
||||
if (gBattleSpriteInfo[b].transformSpecies == 0)
|
||||
{
|
||||
species = GetMonData(pkmn, MON_DATA_SPECIES);
|
||||
r7 = personalityValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
species = gBattleSpriteInfo[b].transformedSpecies;
|
||||
species = gBattleSpriteInfo[b].transformSpecies;
|
||||
r7 = gTransformedPersonalities[b];
|
||||
}
|
||||
otId = GetMonData(pkmn, MON_DATA_OT_ID);
|
||||
|
|
@ -369,7 +368,7 @@ void BattleLoadPlayerMonSprite(struct Pokemon *pkmn, u8 b)
|
|||
species,
|
||||
r7);
|
||||
paletteOffset = 0x100 + b * 16;
|
||||
if (gBattleSpriteInfo[b].transformedSpecies == 0)
|
||||
if (gBattleSpriteInfo[b].transformSpecies == 0)
|
||||
lzPaletteData = GetMonSpritePal(pkmn);
|
||||
else
|
||||
lzPaletteData = GetMonSpritePalFromOtIdPersonality(species, otId, personalityValue);
|
||||
|
|
@ -382,7 +381,7 @@ void BattleLoadPlayerMonSprite(struct Pokemon *pkmn, u8 b)
|
|||
LZDecompressWram(lzPaletteData, ewram16400);
|
||||
LoadPalette(ewram16400 + gBattleMonForms[b] * 32, paletteOffset, 0x20);
|
||||
}
|
||||
if (gBattleSpriteInfo[b].transformedSpecies != 0)
|
||||
if (gBattleSpriteInfo[b].transformSpecies != 0)
|
||||
{
|
||||
BlendPalette(paletteOffset, 16, 6, RGB(31, 31, 31));
|
||||
CpuCopy32(gPlttBufferFaded + paletteOffset, gPlttBufferUnfaded + paletteOffset, 32);
|
||||
|
|
@ -417,7 +416,7 @@ void sub_8031A6C(u16 a, u8 b)
|
|||
LoadCompressedObjectPalette(&gTrainerFrontPicPaletteTable[a]);
|
||||
}
|
||||
|
||||
void LoadPlayerTrainerBankSprite(u16 a, u8 b)
|
||||
void DecompressTrainerBackPic(u16 a, u8 b)
|
||||
{
|
||||
u8 status;
|
||||
|
||||
|
|
@ -521,7 +520,7 @@ bool8 sub_8031C30(u8 a)
|
|||
return retVal;
|
||||
}
|
||||
|
||||
void load_gfxc_health_bar(u8 a)
|
||||
void LoadBattleBarGfx(u8 a)
|
||||
{
|
||||
LZDecompressWram(gUnknown_08D09C48, eBattleInterfaceGfxBuffer);
|
||||
}
|
||||
|
|
@ -579,13 +578,13 @@ u8 battle_load_something(u8 *pState, u8 *b)
|
|||
if (GetBattlerSide(*b) == 0)
|
||||
{
|
||||
if (!(gBattleTypeFlags & 0x80))
|
||||
sub_8045A5C(gHealthboxSpriteIds[*b], &gPlayerParty[gBattlerPartyIndexes[*b]], 0);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[*b], &gPlayerParty[gBattlerPartyIndexes[*b]], 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
sub_8045A5C(gHealthboxSpriteIds[*b], &gEnemyParty[gBattlerPartyIndexes[*b]], 0);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[*b], &gEnemyParty[gBattlerPartyIndexes[*b]], 0);
|
||||
}
|
||||
sub_8043DB0(gHealthboxSpriteIds[*b]);
|
||||
SetHealthboxSpriteInvisible(gHealthboxSpriteIds[*b]);
|
||||
(*b)++;
|
||||
if (*b == gBattlersCount)
|
||||
{
|
||||
|
|
@ -604,7 +603,7 @@ u8 battle_load_something(u8 *pState, u8 *b)
|
|||
|
||||
void sub_8031EE8(void)
|
||||
{
|
||||
memset(ewram17810, 0, 0x30);
|
||||
memset(gBattleHealthBoxInfo, 0, 0x30);
|
||||
memset(&ewram17840, 0, 0x10);
|
||||
}
|
||||
|
||||
|
|
@ -614,7 +613,7 @@ void sub_8031F0C(void)
|
|||
memset(gBattleSpriteInfo, 0, 0x10);
|
||||
}
|
||||
|
||||
void sub_8031F24(void)
|
||||
void CopyAllBattleSpritesInvisibilities(void)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
|
|
@ -642,12 +641,12 @@ void sub_8031FC4(u8 a, u8 b, bool8 c)
|
|||
paletteOffset = 0x100 + a * 16;
|
||||
LoadPalette(ewram16400 + ewram17840.unk0 * 32, paletteOffset, 32);
|
||||
gBattleMonForms[a] = ewram17840.unk0;
|
||||
if (gBattleSpriteInfo[a].transformedSpecies != 0)
|
||||
if (gBattleSpriteInfo[a].transformSpecies != 0)
|
||||
{
|
||||
BlendPalette(paletteOffset, 16, 6, RGB(31, 31, 31));
|
||||
CpuCopy32(gPlttBufferFaded + paletteOffset, gPlttBufferUnfaded + paletteOffset, 32);
|
||||
}
|
||||
gSprites[gBattlerSpriteIds[a]].y = sub_8077F68(a);
|
||||
gSprites[gBattlerSpriteIds[a]].y = GetBattlerSpriteDefault_Y(a);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -716,10 +715,10 @@ void sub_8031FC4(u8 a, u8 b, bool8 c)
|
|||
CpuCopy32(gPlttBufferFaded + paletteOffset, gPlttBufferUnfaded + paletteOffset, 32);
|
||||
if (!IsContest())
|
||||
{
|
||||
gBattleSpriteInfo[a].transformedSpecies = species;
|
||||
gBattleSpriteInfo[a].transformSpecies = species;
|
||||
gBattleMonForms[a] = gBattleMonForms[b];
|
||||
}
|
||||
gSprites[gBattlerSpriteIds[a]].y = sub_8077F68(a);
|
||||
gSprites[gBattlerSpriteIds[a]].y = GetBattlerSpriteDefault_Y(a);
|
||||
StartSpriteAnim(&gSprites[gBattlerSpriteIds[a]], gBattleMonForms[a]);
|
||||
}
|
||||
}
|
||||
|
|
@ -771,18 +770,18 @@ void refresh_graphics_maybe(u8 a, u8 b, u8 spriteId)
|
|||
if (b == 0)
|
||||
gSprites[spriteId].y = sub_8077F7C(a);
|
||||
else
|
||||
gSprites[spriteId].y = sub_8077F68(a);
|
||||
gSprites[spriteId].y = GetBattlerSpriteDefault_Y(a);
|
||||
}
|
||||
|
||||
void sub_80324BC(u8 a, u16 b)
|
||||
void TrySetBehindSubstituteSpriteBit(u8 a, u16 b)
|
||||
{
|
||||
if (b == 0xA4)
|
||||
gBattleSpriteInfo[a].substituteSprite = 1;
|
||||
gBattleSpriteInfo[a].behindSubstitute = 1;
|
||||
}
|
||||
|
||||
void sub_80324E0(u8 a)
|
||||
{
|
||||
gBattleSpriteInfo[a].substituteSprite = 0;
|
||||
gBattleSpriteInfo[a].behindSubstitute = 0;
|
||||
}
|
||||
|
||||
void HandleLowHpMusicChange(struct Pokemon *pkmn, u8 b)
|
||||
|
|
@ -852,7 +851,7 @@ void sub_8032638(void)
|
|||
}
|
||||
}
|
||||
|
||||
void sub_80326EC(u8 a)
|
||||
void SetBattlerSpriteAffineMode(u8 a)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
|
|
@ -863,12 +862,12 @@ void sub_80326EC(u8 a)
|
|||
gSprites[gBattlerSpriteIds[i]].oam.affineMode = a;
|
||||
if (a == 0)
|
||||
{
|
||||
ewram17810[i].unk6 = gSprites[gBattlerSpriteIds[i]].oam.matrixNum;
|
||||
gBattleHealthBoxInfo[i].unk6 = gSprites[gBattlerSpriteIds[i]].oam.matrixNum;
|
||||
gSprites[gBattlerSpriteIds[i]].oam.matrixNum = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
gSprites[gBattlerSpriteIds[i]].oam.matrixNum = ewram17810[i].unk6;
|
||||
gSprites[gBattlerSpriteIds[i]].oam.matrixNum = gBattleHealthBoxInfo[i].unk6;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -880,13 +879,13 @@ void sub_80327CC(void)
|
|||
|
||||
LoadCompressedObjectPic(&gUnknown_081FAF24);
|
||||
r5 = GetBattlerAtPosition(1);
|
||||
ewram17810[r5].unk7 = CreateSprite(&gSpriteTemplate_81FAF34, GetBattlerSpriteCoord(r5, 0), GetBattlerSpriteCoord(r5, 1) + 32, 0xC8);
|
||||
gSprites[ewram17810[r5].unk7].data[0] = r5;
|
||||
gBattleHealthBoxInfo[r5].unk7 = CreateSprite(&gSpriteTemplate_81FAF34, GetBattlerSpriteCoord(r5, 0), GetBattlerSpriteCoord(r5, 1) + 32, 0xC8);
|
||||
gSprites[gBattleHealthBoxInfo[r5].unk7].data[0] = r5;
|
||||
if (IsDoubleBattle())
|
||||
{
|
||||
r5 = GetBattlerAtPosition(3);
|
||||
ewram17810[r5].unk7 = CreateSprite(&gSpriteTemplate_81FAF34, GetBattlerSpriteCoord(r5, 0), GetBattlerSpriteCoord(r5, 1) + 32, 0xC8);
|
||||
gSprites[ewram17810[r5].unk7].data[0] = r5;
|
||||
gBattleHealthBoxInfo[r5].unk7 = CreateSprite(&gSpriteTemplate_81FAF34, GetBattlerSpriteCoord(r5, 0), GetBattlerSpriteCoord(r5, 1) + 32, 0xC8);
|
||||
gSprites[gBattleHealthBoxInfo[r5].unk7].data[0] = r5;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -903,9 +902,9 @@ void sub_80328A4(struct Sprite *sprite)
|
|||
}
|
||||
if (gAnimScriptActive || r7->invisible)
|
||||
invisible = TRUE;
|
||||
else if (gBattleSpriteInfo[r4].transformedSpecies != 0 && gEnemyMonElevation[gBattleSpriteInfo[r4].transformedSpecies] == 0)
|
||||
else if (gBattleSpriteInfo[r4].transformSpecies != 0 && gEnemyMonElevation[gBattleSpriteInfo[r4].transformSpecies] == 0)
|
||||
invisible = TRUE;
|
||||
if (gBattleSpriteInfo[r4].substituteSprite)
|
||||
if (gBattleSpriteInfo[r4].behindSubstitute)
|
||||
invisible = TRUE;
|
||||
sprite->x = r7->x;
|
||||
sprite->x2 = r7->x2;
|
||||
|
|
@ -921,18 +920,18 @@ void sub_8032984(u8 a, u16 b)
|
|||
{
|
||||
if (GetBattlerSide(a) != 0)
|
||||
{
|
||||
if (gBattleSpriteInfo[a].transformedSpecies != 0)
|
||||
b = gBattleSpriteInfo[a].transformedSpecies;
|
||||
if (gBattleSpriteInfo[a].transformSpecies != 0)
|
||||
b = gBattleSpriteInfo[a].transformSpecies;
|
||||
if (gEnemyMonElevation[b] != 0)
|
||||
gSprites[ewram17810[a].unk7].callback = sub_80328A4;
|
||||
gSprites[gBattleHealthBoxInfo[a].unk7].callback = sub_80328A4;
|
||||
else
|
||||
gSprites[ewram17810[a].unk7].callback = sub_8032978;
|
||||
gSprites[gBattleHealthBoxInfo[a].unk7].callback = sub_8032978;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8032A08(u8 a)
|
||||
{
|
||||
gSprites[ewram17810[a].unk7].callback = sub_8032978;
|
||||
gSprites[gBattleHealthBoxInfo[a].unk7].callback = sub_8032978;
|
||||
}
|
||||
|
||||
void sub_8032A38(void)
|
||||
|
|
@ -960,7 +959,7 @@ void sub_8032A38(void)
|
|||
|
||||
void sub_8032AA8(u8 a, u8 b)
|
||||
{
|
||||
gBattleSpriteInfo[a].transformedSpecies = 0;
|
||||
gBattleSpriteInfo[a].transformSpecies = 0;
|
||||
gBattleMonForms[a] = 0;
|
||||
if (b == 0)
|
||||
sub_80324E0(a);
|
||||
|
|
|
|||
|
|
@ -436,7 +436,7 @@ extern const u16 gBattleInterfaceStatusIcons_DynPal[];
|
|||
|
||||
static void sub_8043D5C(struct Sprite *);
|
||||
static const void *GetHealthboxElementGfxPtr(u8);
|
||||
/*static*/ void sub_8044210(u8, s16, u8);
|
||||
static void sub_8044210(u8, s16, u8);
|
||||
/*static*/ void draw_status_ailment_maybe(u8);
|
||||
extern void sub_8045180(struct Sprite *);
|
||||
static void sub_8045110(struct Sprite *);
|
||||
|
|
@ -669,7 +669,7 @@ static void sub_8043D5C(struct Sprite *sprite)
|
|||
sprite->y2 = gSprites[data5].y2;
|
||||
}
|
||||
|
||||
void sub_8043D84(u8 a, u8 b, u32 c, u32 d, u32 e)
|
||||
void SetBattleBarStruct(u8 a, u8 b, u32 c, u32 d, u32 e)
|
||||
{
|
||||
eBattleBars[a].healthboxSpriteId = b;
|
||||
eBattleBars[a].maxValue = c;
|
||||
|
|
@ -678,18 +678,18 @@ void sub_8043D84(u8 a, u8 b, u32 c, u32 d, u32 e)
|
|||
eBattleBars[a].currValue = -0x8000;
|
||||
}
|
||||
|
||||
void sub_8043DB0(u8 a)
|
||||
void SetHealthboxSpriteInvisible(u8 healthboxSpriteId)
|
||||
{
|
||||
gSprites[a].invisible = TRUE;
|
||||
gSprites[gSprites[a].data[5]].invisible = TRUE;
|
||||
gSprites[gSprites[a].oam.affineParam].invisible = TRUE;
|
||||
gSprites[healthboxSpriteId].invisible = TRUE;
|
||||
gSprites[gSprites[healthboxSpriteId].data[5]].invisible = TRUE;
|
||||
gSprites[gSprites[healthboxSpriteId].oam.affineParam].invisible = TRUE;
|
||||
}
|
||||
|
||||
void sub_8043DFC(u8 a)
|
||||
void SetHealthboxSpriteVisible(u8 healthboxSpriteId)
|
||||
{
|
||||
gSprites[a].invisible = FALSE;
|
||||
gSprites[gSprites[a].data[5]].invisible = FALSE;
|
||||
gSprites[gSprites[a].oam.affineParam].invisible = FALSE;
|
||||
gSprites[healthboxSpriteId].invisible = FALSE;
|
||||
gSprites[gSprites[healthboxSpriteId].data[5]].invisible = FALSE;
|
||||
gSprites[gSprites[healthboxSpriteId].oam.affineParam].invisible = FALSE;
|
||||
}
|
||||
|
||||
static void sub_8043E50(u8 spriteId, s16 x, s16 y)
|
||||
|
|
@ -833,7 +833,7 @@ void sub_8043F44(u8 a)
|
|||
CpuCopy32(&eBattleInterfaceGfxBuffer[i * 64 + 32], r7[i] + gSprites[a].oam.tileNum * TILE_SIZE_4BPP, TILE_SIZE_4BPP);
|
||||
}
|
||||
|
||||
void sub_80440EC(u8 a, s16 b, u8 c)
|
||||
void UpdateHpTextInHealthbox(u8 healthboxSpriteId, s16 value, u8 maxOrCurrent)
|
||||
{
|
||||
u8 str[0x14];
|
||||
u8 *ptr;
|
||||
|
|
@ -844,36 +844,36 @@ void sub_80440EC(u8 a, s16 b, u8 c)
|
|||
|
||||
// TODO: make this a local variable
|
||||
memcpy(str, sEmptyWhiteText_GrayHighlight, sizeof(str));
|
||||
foo = gSprites[a].data[6];
|
||||
foo = gSprites[healthboxSpriteId].data[6];
|
||||
|
||||
if (IsDoubleBattle() == TRUE || GetBattlerSide(foo) == 1)
|
||||
{
|
||||
//_08044136
|
||||
sub_8044210(a, b, c);
|
||||
sub_8044210(healthboxSpriteId, value, maxOrCurrent);
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
ptr = str + 6;
|
||||
if (c == 0)
|
||||
if (maxOrCurrent == 0)
|
||||
{
|
||||
if (GetBattlerSide(gSprites[a].data[6]) == 0)
|
||||
if (GetBattlerSide(gSprites[healthboxSpriteId].data[6]) == 0)
|
||||
r4 = gUnknown_0820A83C;
|
||||
else
|
||||
r4 = gUnknown_0820A848;
|
||||
r8 = 3;
|
||||
ptr = sub_8003504(ptr, b, 19, 1);
|
||||
ptr = sub_8003504(ptr, value, 19, 1);
|
||||
*(ptr++) = CHAR_SLASH;
|
||||
*(ptr++) = EOS;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GetBattlerSide(gSprites[a].data[6]) == 0)
|
||||
if (GetBattlerSide(gSprites[healthboxSpriteId].data[6]) == 0)
|
||||
r4 = gUnknown_0820A854;
|
||||
else
|
||||
r4 = gUnknown_0820A85C;
|
||||
r8 = 2;
|
||||
ptr = sub_8003504(ptr, b, 15, 1);
|
||||
ptr = sub_8003504(ptr, value, 15, 1);
|
||||
}
|
||||
RenderTextHandleBold(eBattleInterfaceGfxBuffer, str);
|
||||
//asm(""::"r"(a));
|
||||
|
|
@ -882,14 +882,14 @@ void sub_80440EC(u8 a, s16 b, u8 c)
|
|||
{
|
||||
CpuCopy32(
|
||||
&eBattleInterfaceGfxBuffer[i * 64 + 32],
|
||||
r4[i] + gSprites[a].oam.tileNum * 32,
|
||||
r4[i] + gSprites[healthboxSpriteId].oam.tileNum * 32,
|
||||
0x20
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*static*/ void sub_8044210(u8 a, s16 b, u8 c)
|
||||
static void sub_8044210(u8 a, s16 b, u8 c)
|
||||
{
|
||||
u8 str[0x14];
|
||||
u8 *ptr;
|
||||
|
|
@ -1039,7 +1039,7 @@ void sub_804454C(void)
|
|||
else
|
||||
{
|
||||
draw_status_ailment_maybe(gHealthboxSpriteIds[i]);
|
||||
sub_8045A5C(gHealthboxSpriteIds[i], &gPlayerParty[gBattlerPartyIndexes[i]], 5);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[i], &gPlayerParty[gBattlerPartyIndexes[i]], 5);
|
||||
CpuCopy32(GetHealthboxElementGfxPtr(0x75), OBJ_VRAM0 + 0x680 + gSprites[gHealthboxSpriteIds[i]].oam.tileNum * 32, 32);
|
||||
}
|
||||
}
|
||||
|
|
@ -1063,9 +1063,9 @@ void sub_804454C(void)
|
|||
else
|
||||
{
|
||||
draw_status_ailment_maybe(gHealthboxSpriteIds[i]);
|
||||
sub_8045A5C(gHealthboxSpriteIds[i], &gEnemyParty[gBattlerPartyIndexes[i]], 5);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[i], &gEnemyParty[gBattlerPartyIndexes[i]], 5);
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_SAFARI)
|
||||
sub_8045A5C(gHealthboxSpriteIds[i], &gEnemyParty[gBattlerPartyIndexes[i]], 4);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[i], &gEnemyParty[gBattlerPartyIndexes[i]], 4);
|
||||
}
|
||||
}
|
||||
gSprites[gHealthboxSpriteIds[i]].data[7] ^= 1;
|
||||
|
|
@ -1830,7 +1830,7 @@ static u8 sub_80457E8(u8 a, u8 b)
|
|||
}
|
||||
}
|
||||
|
||||
void sub_8045A5C(u8 a, struct Pokemon *pkmn, u8 c)
|
||||
void UpdateHealthboxAttribute(u8 a, struct Pokemon *pkmn, u8 c)
|
||||
{
|
||||
u8 r10;
|
||||
u32 maxhp;
|
||||
|
|
@ -1842,16 +1842,16 @@ void sub_8045A5C(u8 a, struct Pokemon *pkmn, u8 c)
|
|||
if (c == 3 || c == 0)
|
||||
sub_8043FC0(a, GetMonData(pkmn, MON_DATA_LEVEL));
|
||||
if (c == 1 || c == 0)
|
||||
sub_80440EC(a, GetMonData(pkmn, MON_DATA_HP), 0);
|
||||
UpdateHpTextInHealthbox(a, GetMonData(pkmn, MON_DATA_HP), 0);
|
||||
if (c == 2 || c == 0)
|
||||
sub_80440EC(a, GetMonData(pkmn, MON_DATA_MAX_HP), 1);
|
||||
UpdateHpTextInHealthbox(a, GetMonData(pkmn, MON_DATA_MAX_HP), 1);
|
||||
if (c == 5 || c == 0)
|
||||
{
|
||||
load_gfxc_health_bar(0);
|
||||
LoadBattleBarGfx(0);
|
||||
maxhp = GetMonData(pkmn, MON_DATA_MAX_HP);
|
||||
currhp = GetMonData(pkmn, MON_DATA_HP);
|
||||
sub_8043D84(r10, a, maxhp, currhp, 0);
|
||||
sub_8045C78(r10, a, 0, 0);
|
||||
SetBattleBarStruct(r10, a, maxhp, currhp, 0);
|
||||
MoveBattleBar(r10, a, 0, 0);
|
||||
}
|
||||
if (!IsDoubleBattle() && (c == 6 || c == 0))
|
||||
{
|
||||
|
|
@ -1862,15 +1862,15 @@ void sub_8045A5C(u8 a, struct Pokemon *pkmn, u8 c)
|
|||
u32 var2;
|
||||
u32 currLevelExp;
|
||||
|
||||
load_gfxc_health_bar(3);
|
||||
LoadBattleBarGfx(3);
|
||||
species = GetMonData(pkmn, MON_DATA_SPECIES);
|
||||
level = GetMonData(pkmn, MON_DATA_LEVEL);
|
||||
exp = GetMonData(pkmn, MON_DATA_EXP);
|
||||
currLevelExp = gExperienceTables[gBaseStats[species].growthRate][level];
|
||||
var1 = exp - currLevelExp;
|
||||
var2 = gExperienceTables[gBaseStats[species].growthRate][level + 1] - currLevelExp;
|
||||
sub_8043D84(r10, a, var2, var1, 0);
|
||||
sub_8045C78(r10, a, 1, 0);
|
||||
SetBattleBarStruct(r10, a, var2, var1, 0);
|
||||
MoveBattleBar(r10, a, 1, 0);
|
||||
}
|
||||
if (c == 4 || c == 0)
|
||||
sub_80451A0(a, pkmn);
|
||||
|
|
@ -1889,18 +1889,18 @@ void sub_8045A5C(u8 a, struct Pokemon *pkmn, u8 c)
|
|||
if (gUnknown_020297ED == 1)
|
||||
{
|
||||
if (c == 1 || c == 0)
|
||||
sub_80440EC(a, GetMonData(pkmn, MON_DATA_HP), 0);
|
||||
UpdateHpTextInHealthbox(a, GetMonData(pkmn, MON_DATA_HP), 0);
|
||||
if (c == 2 || c == 0)
|
||||
sub_80440EC(a, GetMonData(pkmn, MON_DATA_MAX_HP), 1);
|
||||
UpdateHpTextInHealthbox(a, GetMonData(pkmn, MON_DATA_MAX_HP), 1);
|
||||
}
|
||||
#endif
|
||||
if (c == 5 || c == 0)
|
||||
{
|
||||
load_gfxc_health_bar(0);
|
||||
LoadBattleBarGfx(0);
|
||||
maxhp = GetMonData(pkmn, MON_DATA_MAX_HP);
|
||||
currhp = GetMonData(pkmn, MON_DATA_HP);
|
||||
sub_8043D84(r10, a, maxhp, currhp, 0);
|
||||
sub_8045C78(r10, a, 0, 0);
|
||||
SetBattleBarStruct(r10, a, maxhp, currhp, 0);
|
||||
MoveBattleBar(r10, a, 0, 0);
|
||||
}
|
||||
if (c == 4 || c == 0)
|
||||
sub_80451A0(a, pkmn);
|
||||
|
|
@ -1909,30 +1909,30 @@ void sub_8045A5C(u8 a, struct Pokemon *pkmn, u8 c)
|
|||
}
|
||||
}
|
||||
|
||||
s32 sub_8045C78(u8 a, u8 unused1, u8 c, u8 unused2)
|
||||
s32 MoveBattleBar(u8 battler, u8 unused1, u8 whichBar, u8 unused2)
|
||||
{
|
||||
s32 r6;
|
||||
|
||||
if (c == 0)
|
||||
if (whichBar == 0)
|
||||
{
|
||||
r6 = sub_8045F58(eBattleBars[a].maxValue, eBattleBars[a].oldValue, eBattleBars[a].receivedValue, &eBattleBars[a].currValue, 6, 1);
|
||||
r6 = sub_8045F58(eBattleBars[battler].maxValue, eBattleBars[battler].oldValue, eBattleBars[battler].receivedValue, &eBattleBars[battler].currValue, 6, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
u16 r5;
|
||||
u16 expFraction;
|
||||
s32 r8;
|
||||
|
||||
r5 = GetScaledExpFraction(eBattleBars[a].oldValue, eBattleBars[a].receivedValue, eBattleBars[a].maxValue, 8);
|
||||
if (r5 == 0)
|
||||
r5 = 1;
|
||||
r8 = eBattleBars[a].receivedValue;
|
||||
r5 = ABS(r8 / r5);
|
||||
r6 = sub_8045F58(eBattleBars[a].maxValue, eBattleBars[a].oldValue, r8, &eBattleBars[a].currValue, 8, r5);
|
||||
expFraction = GetScaledExpFraction(eBattleBars[battler].oldValue, eBattleBars[battler].receivedValue, eBattleBars[battler].maxValue, 8);
|
||||
if (expFraction == 0)
|
||||
expFraction = 1;
|
||||
r8 = eBattleBars[battler].receivedValue;
|
||||
expFraction = ABS(r8 / expFraction);
|
||||
r6 = sub_8045F58(eBattleBars[battler].maxValue, eBattleBars[battler].oldValue, r8, &eBattleBars[battler].currValue, 8, expFraction);
|
||||
}
|
||||
if (c == 1 || (c == 0 && (!gBattleSpriteInfo[a].hpNumbersNoBars)))
|
||||
sub_8045D58(a, c);
|
||||
if (whichBar == 1 || (whichBar == 0 && (!gBattleSpriteInfo[battler].hpNumbersNoBars)))
|
||||
sub_8045D58(battler, whichBar);
|
||||
if (r6 == -1)
|
||||
eBattleBars[a].currValue = 0;
|
||||
eBattleBars[battler].currValue = 0;
|
||||
return r6;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -41,13 +41,13 @@
|
|||
#include "string_util.h"
|
||||
#include "task.h"
|
||||
#include "text.h"
|
||||
#include "trainer.h"
|
||||
#include "trig.h"
|
||||
#include "tv.h"
|
||||
#include "scanline_effect.h"
|
||||
#include "util.h"
|
||||
#include "ewram.h"
|
||||
#include "battle_string_ids.h"
|
||||
#include "constants/trainers.h"
|
||||
|
||||
struct UnknownStruct7
|
||||
{
|
||||
|
|
@ -121,7 +121,7 @@ extern void (*gBattleMainFunc)(void);
|
|||
u8 gLeveledUpInBattle;
|
||||
void (*gBattlerControllerFuncs[MAX_BATTLERS_COUNT])(void);
|
||||
u8 gHealthboxSpriteIds[MAX_BATTLERS_COUNT];
|
||||
u8 gUnknown_0300434C[MAX_BATTLERS_COUNT];
|
||||
u8 gBattleControllerData[MAX_BATTLERS_COUNT];
|
||||
extern u16 gBattleTypeFlags;
|
||||
extern u8 gReservedSpritePaletteCount;
|
||||
extern u16 gTrainerBattleOpponent;
|
||||
|
|
@ -2627,7 +2627,7 @@ void debug_sub_8012688(void)
|
|||
gMonSpriteGfx_Sprite_ptr[1],
|
||||
gCurrentMove);
|
||||
LoadCompressedPalette(gMonPaletteTable[gCurrentMove].data, 272, 32);
|
||||
GetMonSpriteTemplate_803C56C(gCurrentMove, 1);
|
||||
SetMultiuseSpriteTemplateToPokemon(gCurrentMove, 1);
|
||||
spriteId = CreateSprite(&gCreatingSpriteTemplate, 176, 40 + gMonFrontPicCoords[gCurrentMove].y_offset, 40);
|
||||
gSprites[spriteId].callback = nullsub_37;
|
||||
gSprites[spriteId].oam.paletteNum = 1;
|
||||
|
|
@ -3072,7 +3072,7 @@ void sub_8010278(struct Sprite *sprite)
|
|||
if (sprite->x2 == 0)
|
||||
{
|
||||
sprite->callback = sub_80102AC;
|
||||
PlayCry1(sprite->data[2], 25);
|
||||
PlayCry_Normal(sprite->data[2], 25);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3081,8 +3081,8 @@ void sub_80102AC(struct Sprite *sprite)
|
|||
{
|
||||
if (sprite->animEnded)
|
||||
{
|
||||
sub_804777C(sprite->data[0]);
|
||||
sub_8043DFC(gHealthboxSpriteIds[sprite->data[0]]);
|
||||
StartHealthboxSlideIn(sprite->data[0]);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[sprite->data[0]]);
|
||||
sprite->callback = nullsub_37;
|
||||
StartSpriteAnimIfDifferent(sprite, 0);
|
||||
BeginNormalPaletteFade(0x00020000, 0, 10, 0, RGB(15, 15, 15));
|
||||
|
|
@ -3123,8 +3123,8 @@ void sub_8010384(struct Sprite *sprite)
|
|||
u16 species;
|
||||
u8 yOffset;
|
||||
|
||||
if (gBattleSpriteInfo[r6].transformedSpecies != 0)
|
||||
species = gBattleSpriteInfo[r6].transformedSpecies;
|
||||
if (gBattleSpriteInfo[r6].transformSpecies != 0)
|
||||
species = gBattleSpriteInfo[r6].transformSpecies;
|
||||
else
|
||||
species = sprite->data[2];
|
||||
|
||||
|
|
@ -3255,12 +3255,12 @@ void dp11b_obj_instanciate(u8 bank, u8 b, s8 c, s8 d)
|
|||
|
||||
if (b)
|
||||
{
|
||||
if (ewram17810[bank].unk0_1)
|
||||
if (gBattleHealthBoxInfo[bank].unk0_1)
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ewram17810[bank].unk0_2)
|
||||
if (gBattleHealthBoxInfo[bank].unk0_2)
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -3268,15 +3268,15 @@ void dp11b_obj_instanciate(u8 bank, u8 b, s8 c, s8 d)
|
|||
if (b == TRUE)
|
||||
{
|
||||
objectID = gHealthboxSpriteIds[bank];
|
||||
ewram17810[bank].unk2 = spriteId;
|
||||
ewram17810[bank].unk0_1 = 1;
|
||||
gBattleHealthBoxInfo[bank].unk2 = spriteId;
|
||||
gBattleHealthBoxInfo[bank].unk0_1 = 1;
|
||||
gSprites[spriteId].data[0] = 0x80;
|
||||
}
|
||||
else
|
||||
{
|
||||
objectID = gBattlerSpriteIds[bank];
|
||||
ewram17810[bank].unk3 = spriteId;
|
||||
ewram17810[bank].unk0_2 = 1;
|
||||
gBattleHealthBoxInfo[bank].unk3 = spriteId;
|
||||
gBattleHealthBoxInfo[bank].unk0_2 = 1;
|
||||
gSprites[spriteId].data[0] = 0xC0;
|
||||
}
|
||||
gSprites[spriteId].data[1] = c;
|
||||
|
|
@ -3293,19 +3293,19 @@ void dp11b_obj_free(u8 a, u8 b)
|
|||
|
||||
if (b == TRUE)
|
||||
{
|
||||
if (!ewram17810[a].unk0_1)
|
||||
if (!gBattleHealthBoxInfo[a].unk0_1)
|
||||
return;
|
||||
r4 = gSprites[ewram17810[a].unk2].data[3];
|
||||
DestroySprite(&gSprites[ewram17810[a].unk2]);
|
||||
ewram17810[a].unk0_1 = 0;
|
||||
r4 = gSprites[gBattleHealthBoxInfo[a].unk2].data[3];
|
||||
DestroySprite(&gSprites[gBattleHealthBoxInfo[a].unk2]);
|
||||
gBattleHealthBoxInfo[a].unk0_1 = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!ewram17810[a].unk0_2)
|
||||
if (!gBattleHealthBoxInfo[a].unk0_2)
|
||||
return;
|
||||
r4 = gSprites[ewram17810[a].unk3].data[3];
|
||||
DestroySprite(&gSprites[ewram17810[a].unk3]);
|
||||
ewram17810[a].unk0_2 = 0;
|
||||
r4 = gSprites[gBattleHealthBoxInfo[a].unk3].data[3];
|
||||
DestroySprite(&gSprites[gBattleHealthBoxInfo[a].unk3]);
|
||||
gBattleHealthBoxInfo[a].unk0_2 = 0;
|
||||
}
|
||||
gSprites[r4].x2 = 0;
|
||||
gSprites[r4].y2 = 0;
|
||||
|
|
|
|||
|
|
@ -30,20 +30,20 @@ extern void sub_802E414(void);
|
|||
extern void sub_80A6DCC(void);
|
||||
extern u8 *sub_8040D08();
|
||||
extern void SetMonPreventsSwitchingString(void);
|
||||
extern void nullsub_14();
|
||||
extern void ReshowBattleScreenDummy();
|
||||
extern u8 sub_803FBBC(void);
|
||||
|
||||
extern u8 gPlayerPartyCount;
|
||||
extern u8 gBattlersCount;
|
||||
extern u16 gBattlerPartyIndexes[];
|
||||
extern u8 gBankInMenu;
|
||||
extern u8 gBattlerInMenuId;
|
||||
extern u8 gUnknown_0202E8F4;
|
||||
extern u8 gUnknown_0202E8F5;
|
||||
extern u8 gPartyMenuMessage_IsPrinting;
|
||||
extern u8 gUnknown_020384F0;
|
||||
extern void (*gPokemonItemUseCallback)(); //don't know types yet
|
||||
extern struct PokemonStorage gPokemonStorage;
|
||||
extern void nullsub_14();
|
||||
extern void ReshowBattleScreenDummy();
|
||||
|
||||
void sub_8094C98(u8, u8);
|
||||
u8 pokemon_order_func(u8);
|
||||
|
|
@ -334,7 +334,7 @@ void sub_8094E20(u8 a)
|
|||
{
|
||||
gPaletteFade.bufferTransferDisabled = TRUE;
|
||||
gUnknown_02038473 = a;
|
||||
nullsub_14();
|
||||
ReshowBattleScreenDummy();
|
||||
pokemon_change_order();
|
||||
OpenPartyMenu(PARTY_MENU_TYPE_BATTLE, 0xFF);
|
||||
}
|
||||
|
|
@ -707,7 +707,7 @@ static void Task_BattlePartyMenuShift(u8 taskId)
|
|||
if (gUnknown_02038473 == 2)
|
||||
{
|
||||
u8 r0;
|
||||
u8 r4 = gBankInMenu;
|
||||
u8 r4 = gBattlerInMenuId;
|
||||
|
||||
PartyMenuEraseMsgBoxAndFrame();
|
||||
r0 = pokemon_order_func(gBattlerPartyIndexes[r4]);
|
||||
|
|
@ -719,7 +719,7 @@ static void Task_BattlePartyMenuShift(u8 taskId)
|
|||
}
|
||||
gUnknown_0202E8F5 = sub_8094C20(partySelection);
|
||||
gUnknown_0202E8F4 = 1;
|
||||
r4 = pokemon_order_func(gBattlerPartyIndexes[gBankInMenu]);
|
||||
r4 = pokemon_order_func(gBattlerPartyIndexes[gBattlerInMenuId]);
|
||||
sub_8094C98(r4, partySelection);
|
||||
SwapPokemon(&gPlayerParty[r4], &gPlayerParty[partySelection]);
|
||||
gTasks[taskId].func = Task_809527C;
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ extern const struct TrainerReward gTrainerMoney[];
|
|||
extern u16 gRandomMove;
|
||||
extern u8* gBattleScriptsForMoveEffects[];
|
||||
extern u16 gChosenMove; //last used move in battle
|
||||
extern u8 gBankInMenu;
|
||||
extern u8 gBattlerInMenuId;
|
||||
extern u8 gActionForBanks[4];
|
||||
extern u16 gLastPrintedMoves[4]; //last used moves 2, used by sketch
|
||||
extern u16 gLastResultingMoves[4]; //last used moves by banks, another one
|
||||
|
|
@ -6013,7 +6013,7 @@ static void atk74_hpthresholds2(void)
|
|||
|
||||
static void atk75_useitemonopponent(void)
|
||||
{
|
||||
gBankInMenu = gBattlerAttacker;
|
||||
gBattlerInMenuId = gBattlerAttacker;
|
||||
PokemonUseItemEffects(&gEnemyParty[gBattlerPartyIndexes[gBattlerAttacker]], gLastUsedItem, gBattlerPartyIndexes[gBattlerAttacker], 0, 1);
|
||||
gBattlescriptCurrInstr += 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
#include "strings.h"
|
||||
#include "task.h"
|
||||
#include "text.h"
|
||||
#include "trainer.h"
|
||||
#include "constants/trainers.h"
|
||||
|
||||
extern u16 gSpecialVar_Result;
|
||||
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@
|
|||
#include "string_util.h"
|
||||
#include "task.h"
|
||||
#include "text.h"
|
||||
#include "trainer.h"
|
||||
#include "tv.h"
|
||||
#include "constants/trainers.h"
|
||||
|
||||
#if ENGLISH
|
||||
#include "data/battle_tower/trainers.h"
|
||||
|
|
|
|||
|
|
@ -10,12 +10,12 @@
|
|||
#include "random.h"
|
||||
#include "sprite.h"
|
||||
#include "sound.h"
|
||||
#include "trainer.h"
|
||||
#include "field_camera.h"
|
||||
#include "ewram.h"
|
||||
#include "scanline_effect.h"
|
||||
#include "constants/songs.h"
|
||||
#include "constants/field_effects.h"
|
||||
#include "constants/trainers.h"
|
||||
|
||||
void ScanlineEffect_Clear(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -1018,7 +1018,7 @@ u8 unref_sub_80AE908(void)
|
|||
gMonSpriteGfx_Sprite_ptr[1],
|
||||
species);
|
||||
LoadCompressedPalette(gMonPaletteTable[species].data, 0x110, 32);
|
||||
GetMonSpriteTemplate_803C56C(gContestMons[gContestPlayerMonIndex].species, 1);
|
||||
SetMultiuseSpriteTemplateToPokemon(gContestMons[gContestPlayerMonIndex].species, 1);
|
||||
spriteId = CreateSprite(
|
||||
&gCreatingSpriteTemplate,
|
||||
112, 80 + (8 - gMonFrontPicCoords[gContestMons[gContestPlayerMonIndex].species].coords) * 4,
|
||||
|
|
@ -1046,11 +1046,11 @@ u8 CreateContestantSprite(u16 species, u32 otId, u32 personality)
|
|||
personality);
|
||||
lzPaletteData = GetMonSpritePalFromOtIdPersonality(species, otId, personality);
|
||||
LoadCompressedPalette(lzPaletteData, 0x120, 32);
|
||||
GetMonSpriteTemplate_803C56C(species, 0);
|
||||
SetMultiuseSpriteTemplateToPokemon(species, 0);
|
||||
spriteId = CreateSprite(&gCreatingSpriteTemplate, 112, GetBattlerSpriteFinal_Y(2, species, 0), 30);
|
||||
gSprites[spriteId].oam.paletteNum = 2;
|
||||
gSprites[spriteId].oam.priority = 2;
|
||||
gSprites[spriteId].subpriority = GetBattlerSubpriority(2);
|
||||
gSprites[spriteId].subpriority = GetBattlerSpriteSubpriority(2);
|
||||
gSprites[spriteId].callback = SpriteCallbackDummy;
|
||||
gSprites[spriteId].data[0] = gSprites[spriteId].oam.paletteNum;
|
||||
gSprites[spriteId].data[2] = species;
|
||||
|
|
|
|||
|
|
@ -613,7 +613,7 @@ static void sub_80C2A8C(u8 taskId)
|
|||
HandleLoadSpecialPokePic(gMonFrontPicTable + species, gMonFrontPicCoords[species].coords, gMonFrontPicCoords[species].y_offset, (void *)gSharedMem, gMonSpriteGfx_Sprite_ptr[1], species, personality);
|
||||
monPal = GetMonSpritePalStructFromOtIdPersonality(species, otId, personality);
|
||||
LoadCompressedObjectPalette(monPal);
|
||||
GetMonSpriteTemplate_803C56C(species, 1);
|
||||
SetMultiuseSpriteTemplateToPokemon(species, 1);
|
||||
gCreatingSpriteTemplate.paletteTag = monPal->tag;
|
||||
spriteId = CreateSprite(&gCreatingSpriteTemplate, 0x110, 0x50, 10);
|
||||
gSprites[spriteId].data[1] = species;
|
||||
|
|
@ -1996,7 +1996,7 @@ void sub_80C3C44(struct Sprite *sprite)
|
|||
{
|
||||
if (++sprite->data[0] == 10)
|
||||
{
|
||||
PlayCry1(sprite->data[1], 0);
|
||||
PlayCry_Normal(sprite->data[1], 0);
|
||||
sprite->data[1] = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -301,7 +301,7 @@ void ShowContestEntryMonPic(void)
|
|||
var1);
|
||||
palette = GetMonSpritePalStructFromOtIdPersonality(species, var2, var1);
|
||||
LoadCompressedObjectPalette(palette);
|
||||
GetMonSpriteTemplate_803C56C(species, 1);
|
||||
SetMultiuseSpriteTemplateToPokemon(species, 1);
|
||||
gCreatingSpriteTemplate.paletteTag = palette->tag;
|
||||
spriteId = CreateSprite(&gCreatingSpriteTemplate, 0x78, 0x40, 0);
|
||||
gTasks[taskId].data[2] = spriteId;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
#include "battle.h"
|
||||
#include "battle_tower.h"
|
||||
#include "ewram.h"
|
||||
#include "trainer.h"
|
||||
#include "constants/trainers.h"
|
||||
|
||||
#if GERMAN
|
||||
|
||||
|
|
|
|||
|
|
@ -2672,14 +2672,14 @@ void debug_80C6CB8(u8 taskId)
|
|||
{
|
||||
DecompressPicFromTable_2(gMonFrontPicTable + gUnknown_Debug_2038A20->totalPoints, gMonFrontPicCoords[gUnknown_Debug_2038A20->totalPoints].coords, gMonFrontPicCoords[gUnknown_Debug_2038A20->totalPoints].y_offset, gMonSpriteGfx_Sprite_ptr[0], gMonSpriteGfx_Sprite_ptr[1], gUnknown_Debug_2038A20->totalPoints);
|
||||
LoadCompressedObjectPalette(gMonPaletteTable + gUnknown_Debug_2038A20->totalPoints);
|
||||
GetMonSpriteTemplate_803C56C(gUnknown_Debug_2038A20->totalPoints, 1);
|
||||
SetMultiuseSpriteTemplateToPokemon(gUnknown_Debug_2038A20->totalPoints, 1);
|
||||
gUnknown_Debug_2038A20->excitementAppealBonus = CreateSprite(&gCreatingSpriteTemplate, 0x28, 0x28, 0);
|
||||
gSprites[gUnknown_Debug_2038A20->excitementAppealBonus].callback = debug_69;
|
||||
gSprites[gUnknown_Debug_2038A20->excitementAppealBonus].oam.priority = 0;
|
||||
|
||||
DecompressPicFromTable_2(gMonBackPicTable + gUnknown_Debug_2038A20->totalPoints, gMonBackPicCoords[gUnknown_Debug_2038A20->totalPoints].coords, gMonBackPicCoords[gUnknown_Debug_2038A20->totalPoints].y_offset, gMonSpriteGfx_Sprite_ptr[0], gMonSpriteGfx_Sprite_ptr[2], gUnknown_Debug_2038A20->totalPoints);
|
||||
LoadCompressedObjectPalette(gMonPaletteTable + gUnknown_Debug_2038A20->totalPoints);
|
||||
GetMonSpriteTemplate_803C56C(gUnknown_Debug_2038A20->totalPoints, 2);
|
||||
SetMultiuseSpriteTemplateToPokemon(gUnknown_Debug_2038A20->totalPoints, 2);
|
||||
gUnknown_Debug_2038A20->unk3 = CreateSprite(&gCreatingSpriteTemplate, 0x28, 0x78, 0);
|
||||
gSprites[gUnknown_Debug_2038A20->unk3].callback = debug_69;
|
||||
gSprites[gUnknown_Debug_2038A20->unk3].oam.priority = 0;
|
||||
|
|
@ -2704,7 +2704,7 @@ void debug_80C6CB8(u8 taskId)
|
|||
|
||||
gUnknown_Debug_2038A20->unk9 = 0;
|
||||
StopCryAndClearCrySongs();
|
||||
PlayCry1(gUnknown_Debug_2038A20->totalPoints, 0);
|
||||
PlayCry_Normal(gUnknown_Debug_2038A20->totalPoints, 0);
|
||||
}
|
||||
|
||||
void debug_80C6EE8(u8 taskId)
|
||||
|
|
@ -2779,7 +2779,7 @@ void debug_80C6FA8(u8 taskId)
|
|||
if (JOY_NEW(SELECT_BUTTON))
|
||||
{
|
||||
StopCryAndClearCrySongs();
|
||||
PlayCry1(gUnknown_Debug_2038A20->totalPoints, 0);
|
||||
PlayCry_Normal(gUnknown_Debug_2038A20->totalPoints, 0);
|
||||
}
|
||||
gUnknown_Debug_2038A20->random += 4;
|
||||
gUnknown_Debug_2038A20->random &= 0x1f;
|
||||
|
|
@ -3049,7 +3049,7 @@ NAKED void debug_80C6FA8(u8 taskId)
|
|||
"\tldr\tr0, [r0]\n"
|
||||
"\tldrh\tr0, [r0]\n"
|
||||
"\tmov\tr1, #0x0\n"
|
||||
"\tbl\tPlayCry1\n"
|
||||
"\tbl\tPlayCry_Normal\n"
|
||||
"._706:\n"
|
||||
"\tldr\tr2, ._707 @ gUnknown_Debug_2038A20\n"
|
||||
"\tldr\tr1, [r2]\n"
|
||||
|
|
@ -3299,7 +3299,7 @@ void debug_80C7934(u8 taskId)
|
|||
{
|
||||
DecompressPicFromTable_2(gTrainerFrontPicTable + gUnknown_Debug_2038A20->totalPoints, gTrainerFrontPicCoords[gUnknown_Debug_2038A20->totalPoints].coords, gTrainerFrontPicCoords[gUnknown_Debug_2038A20->totalPoints].y_offset, gMonSpriteGfx_Sprite_ptr[0], gMonSpriteGfx_Sprite_ptr[1], gUnknown_Debug_2038A20->totalPoints);
|
||||
LoadCompressedObjectPalette(gTrainerFrontPicPaletteTable + gUnknown_Debug_2038A20->totalPoints);
|
||||
GetMonSpriteTemplate_803C5A0(gUnknown_Debug_2038A20->totalPoints, 1);
|
||||
SetMultiuseSpriteTemplateToTrainerBack(gUnknown_Debug_2038A20->totalPoints, 1);
|
||||
gUnknown_Debug_2038A20->excitementAppealBonus = CreateSprite(&gCreatingSpriteTemplate, 0x28, 0x28, 0);
|
||||
gSprites[gUnknown_Debug_2038A20->excitementAppealBonus].callback = debug_69;
|
||||
gSprites[gUnknown_Debug_2038A20->excitementAppealBonus].oam.priority = 0;
|
||||
|
|
|
|||
|
|
@ -361,7 +361,7 @@ static u8 EggHatchCreateMonSprite(u8 a0, u8 switchID, u8 pokeID)
|
|||
}
|
||||
break;
|
||||
case 1:
|
||||
GetMonSpriteTemplate_803C56C(GetMonSpritePalStruct(mon)->tag, r5);
|
||||
SetMultiuseSpriteTemplateToPokemon(GetMonSpritePalStruct(mon)->tag, r5);
|
||||
spriteID = CreateSprite(&gCreatingSpriteTemplate, 120, 70, 6);
|
||||
gSprites[spriteID].invisible = TRUE;
|
||||
gSprites[spriteID].callback = SpriteCallbackDummy;
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ void EvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, bool8 canStopEvo,
|
|||
pokePal = (void*) GetMonSpritePalStructFromOtIdPersonality(currSpecies, TiD, PiD);
|
||||
LoadCompressedPalette(*pokePal, 0x110, 0x20);
|
||||
|
||||
GetMonSpriteTemplate_803C56C(currSpecies, 1);
|
||||
SetMultiuseSpriteTemplateToPokemon(currSpecies, 1);
|
||||
gCreatingSpriteTemplate.affineAnims = gDummySpriteAffineAnimTable;
|
||||
sEvoInfo.preEvoSpriteID = ID = CreateSprite(&gCreatingSpriteTemplate, 120, 64, 30);
|
||||
|
||||
|
|
@ -249,7 +249,7 @@ void EvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, bool8 canStopEvo,
|
|||
pokePal = (void*) GetMonSpritePalStructFromOtIdPersonality(speciesToEvolve, TiD, PiD);
|
||||
LoadCompressedPalette(*pokePal, 0x120, 0x20);
|
||||
|
||||
GetMonSpriteTemplate_803C56C(speciesToEvolve, 3);
|
||||
SetMultiuseSpriteTemplateToPokemon(speciesToEvolve, 3);
|
||||
gCreatingSpriteTemplate.affineAnims = gDummySpriteAffineAnimTable;
|
||||
sEvoInfo.postEvoSpriteID = ID = CreateSprite(&gCreatingSpriteTemplate, 120, 64, 30);
|
||||
gSprites[ID].callback = nullsub_37;
|
||||
|
|
@ -329,7 +329,7 @@ static void CB2_EvolutionSceneLoadGraphics(void)
|
|||
pokePal = (void*) GetMonSpritePalStructFromOtIdPersonality(postEvoSpecies, TiD, PiD);
|
||||
LoadCompressedPalette(*pokePal, 0x120, 0x20);
|
||||
|
||||
GetMonSpriteTemplate_803C56C(postEvoSpecies, 3);
|
||||
SetMultiuseSpriteTemplateToPokemon(postEvoSpecies, 3);
|
||||
gCreatingSpriteTemplate.affineAnims = gDummySpriteAffineAnimTable;
|
||||
sEvoInfo.postEvoSpriteID = ID = CreateSprite(&gCreatingSpriteTemplate, 120, 64, 30);
|
||||
|
||||
|
|
@ -405,7 +405,7 @@ static void CB2_TradeEvolutionSceneLoadGraphics(void)
|
|||
{
|
||||
u8 ID;
|
||||
|
||||
GetMonSpriteTemplate_803C56C(postEvoSpecies, 3);
|
||||
SetMultiuseSpriteTemplateToPokemon(postEvoSpecies, 3);
|
||||
gCreatingSpriteTemplate.affineAnims = gDummySpriteAffineAnimTable;
|
||||
sEvoInfo.postEvoSpriteID = ID = CreateSprite(&gCreatingSpriteTemplate, 120, 64, 30);
|
||||
|
||||
|
|
@ -449,7 +449,7 @@ void TradeEvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, u8 preEvoSpri
|
|||
pokePal = (void*) GetMonSpritePalStructFromOtIdPersonality(speciesToEvolve, TiD, PiD);
|
||||
LoadCompressedPalette(*pokePal, 0x120, 0x20);
|
||||
|
||||
GetMonSpriteTemplate_803C56C(speciesToEvolve, 1);
|
||||
SetMultiuseSpriteTemplateToPokemon(speciesToEvolve, 1);
|
||||
gCreatingSpriteTemplate.affineAnims = gDummySpriteAffineAnimTable;
|
||||
sEvoInfo.postEvoSpriteID = ID = CreateSprite(&gCreatingSpriteTemplate, 120, 64, 30);
|
||||
|
||||
|
|
@ -556,7 +556,7 @@ static void Task_EvolutionScene(u8 taskID)
|
|||
case 2: // wait for string, play cry
|
||||
if (gWindowTemplate_Contest_MoveDescription.state == 0)
|
||||
{
|
||||
PlayCry1(gTasks[taskID].tPreEvoSpecies, 0);
|
||||
PlayCry_Normal(gTasks[taskID].tPreEvoSpecies, 0);
|
||||
gTasks[taskID].tState++;
|
||||
}
|
||||
break;
|
||||
|
|
@ -627,7 +627,7 @@ static void Task_EvolutionScene(u8 taskID)
|
|||
if (IsSEPlaying())
|
||||
{
|
||||
m4aMPlayAllStop();
|
||||
PlayCry1(gTasks[taskID].tPostEvoSpecies, 0);
|
||||
PlayCry_Normal(gTasks[taskID].tPostEvoSpecies, 0);
|
||||
memcpy(&gPlttBufferUnfaded[0x20], (void *)(EWRAM + 0x9000), 0x60);
|
||||
BeginNormalPaletteFade(0x1C, 0, 16, 0, RGB(0, 0, 0));
|
||||
gTasks[taskID].tState++;
|
||||
|
|
@ -698,7 +698,7 @@ static void Task_EvolutionScene(u8 taskID)
|
|||
case 17: // play cry of the pokemon trying to evolve again, evolution has been stopped
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
PlayCry1(gTasks[taskID].tPreEvoSpecies, 0);
|
||||
PlayCry_Normal(gTasks[taskID].tPreEvoSpecies, 0);
|
||||
gTasks[taskID].tState++;
|
||||
}
|
||||
break;
|
||||
|
|
@ -909,7 +909,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
|
|||
case 1:
|
||||
if (gUnknown_03004828->window.state == 0)
|
||||
{
|
||||
PlayCry1(gTasks[taskID].tPreEvoSpecies, 0);
|
||||
PlayCry_Normal(gTasks[taskID].tPreEvoSpecies, 0);
|
||||
gTasks[taskID].tState++;
|
||||
}
|
||||
break;
|
||||
|
|
@ -981,7 +981,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
|
|||
case 11:
|
||||
if (IsSEPlaying())
|
||||
{
|
||||
PlayCry1(gTasks[taskID].tPostEvoSpecies, 0);
|
||||
PlayCry_Normal(gTasks[taskID].tPostEvoSpecies, 0);
|
||||
memcpy(&gPlttBufferUnfaded[0x20], (void *)(EWRAM + 0x9000), 0x60);
|
||||
BeginNormalPaletteFade(0x1, 0, 16, 0, RGB(0, 0, 0));
|
||||
gTasks[taskID].tState++;
|
||||
|
|
|
|||
|
|
@ -545,7 +545,7 @@ u8 CreateMonSprite_PicBox(u16 species, s16 x, s16 y, u8 subpriority)
|
|||
{
|
||||
DecompressPicFromTable_2(&gMonFrontPicTable[species], gMonFrontPicCoords[species].coords, gMonFrontPicCoords[species].y_offset, gMonSpriteGfx_Sprite_ptr[3], gMonSpriteGfx_Sprite_ptr[3], species);
|
||||
LoadCompressedObjectPalette(&gMonPaletteTable[species]);
|
||||
GetMonSpriteTemplate_803C56C(species, 3);
|
||||
SetMultiuseSpriteTemplateToPokemon(species, 3);
|
||||
gCreatingSpriteTemplate.paletteTag = gMonPaletteTable[0].tag;
|
||||
PreservePaletteInWeather(IndexOfSpritePaletteTag(gMonPaletteTable[0].tag) + 0x10);
|
||||
return CreateSprite(&gCreatingSpriteTemplate, x, y, subpriority);
|
||||
|
|
@ -558,7 +558,7 @@ u8 CreateMonSprite_FieldMove(u16 species, u32 d, u32 g, s16 x, s16 y, u8 subprio
|
|||
HandleLoadSpecialPokePic(&gMonFrontPicTable[species], gMonFrontPicCoords[species].coords, gMonFrontPicCoords[species].y_offset, gMonSpriteGfx_Sprite_ptr[3] /* this is actually u8* or something, pointing to ewram */, gMonSpriteGfx_Sprite_ptr[3], species, g);
|
||||
spritePalette = GetMonSpritePalStructFromOtIdPersonality(species, d, g);
|
||||
LoadCompressedObjectPalette(spritePalette);
|
||||
GetMonSpriteTemplate_803C56C(species, 3);
|
||||
SetMultiuseSpriteTemplateToPokemon(species, 3);
|
||||
gCreatingSpriteTemplate.paletteTag = spritePalette->tag;
|
||||
PreservePaletteInWeather(IndexOfSpritePaletteTag(spritePalette->tag) + 0x10);
|
||||
return CreateSprite(&gCreatingSpriteTemplate, x, y, subpriority);
|
||||
|
|
@ -2547,7 +2547,7 @@ void sub_8088890(struct Sprite *sprite)
|
|||
PlayCry2(sprite->data[0], 0, 0x7d, 0xa);
|
||||
} else
|
||||
{
|
||||
PlayCry1(sprite->data[0], 0);
|
||||
PlayCry_Normal(sprite->data[0], 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -624,7 +624,7 @@ static void sub_8142404(u8 taskID)
|
|||
if (gSprites[gTasks[taskID].tMonSpriteID(currPokeID)].data[0] != 0)
|
||||
{
|
||||
if (currMon->species != SPECIES_EGG)
|
||||
PlayCry1(currMon->species, 0);
|
||||
PlayCry_Normal(currMon->species, 0);
|
||||
HallOfFame_PrintMonInfo(currMon, 0, 14);
|
||||
gTasks[taskID].tFrameCount = 120;
|
||||
gTasks[taskID].func = sub_8142484;
|
||||
|
|
@ -950,7 +950,7 @@ static void sub_8142CC8(u8 taskID)
|
|||
if (currMon->species != SPECIES_EGG)
|
||||
{
|
||||
StopCryAndClearCrySongs();
|
||||
PlayCry1(currMon->species, 0);
|
||||
PlayCry_Normal(currMon->species, 0);
|
||||
}
|
||||
HallOfFame_PrintMonInfo(currMon, 0, 14);
|
||||
|
||||
|
|
|
|||
|
|
@ -2909,7 +2909,7 @@ static void sub_80A7150(void)
|
|||
}
|
||||
}
|
||||
|
||||
void PrepareBagForWallyTutorial(void)
|
||||
void DoWallyTutorialBagMenu(void)
|
||||
{
|
||||
u8 i;
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ extern void (*gPokemonItemUseCallback)(u8, u16, TaskFunc);
|
|||
|
||||
extern u8 gPokemonItemUseType;
|
||||
extern u8 gLastFieldPokeMenuOpened;
|
||||
extern u8 gBankInMenu;
|
||||
extern u8 gBattlerInMenuId;
|
||||
|
||||
extern u8 S_PlantBerryTreeFromBag[];
|
||||
extern u8 S_WaterBerryTreeFromBag[];
|
||||
|
|
@ -905,7 +905,7 @@ void sub_80CA2BC(u8 taskId)
|
|||
|
||||
void ItemUseInBattle_StatIncrease(u8 taskId)
|
||||
{
|
||||
u16 partyId = gBattlerPartyIndexes[gBankInMenu];
|
||||
u16 partyId = gBattlerPartyIndexes[gBattlerInMenuId];
|
||||
|
||||
Menu_EraseWindowRect(0, 13, 13, 20);
|
||||
|
||||
|
|
|
|||
|
|
@ -857,7 +857,7 @@ static void Task_NewGameSpeech7(u8 taskId)
|
|||
gTasks[taskId].tFrameCounter++;
|
||||
//Play Azurill cry at frame 32
|
||||
if (gTasks[taskId].tFrameCounter == 32)
|
||||
PlayCry1(SPECIES_AZURILL, 0);
|
||||
PlayCry_Normal(SPECIES_AZURILL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1428,7 +1428,7 @@ u8 CreateAzurillSprite(u8 x, u8 y)
|
|||
gMonSpriteGfx_Sprite_ptr[1],
|
||||
SPECIES_AZURILL);
|
||||
LoadCompressedObjectPalette(&gMonPaletteTable[SPECIES_AZURILL]);
|
||||
GetMonSpriteTemplate_803C56C(SPECIES_AZURILL, 1);
|
||||
SetMultiuseSpriteTemplateToPokemon(SPECIES_AZURILL, 1);
|
||||
return CreateSprite(&gCreatingSpriteTemplate, x, y, 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -326,12 +326,12 @@ static void sub_8047830(struct Sprite *);
|
|||
static void oamc_804BEB4(struct Sprite *);
|
||||
static u16 GetBattlerBall(u8);
|
||||
|
||||
u8 StartSendOutMonAnimation(u16 a, u8 side)
|
||||
u8 DoPokeballSendOutAnimation(u16 a, u8 side)
|
||||
{
|
||||
u8 taskId;
|
||||
|
||||
gDoingBattleAnim = 1;
|
||||
ewram17810[gActiveBattler].unk0_3 = 1;
|
||||
gBattleHealthBoxInfo[gActiveBattler].ballAnimActive = 1;
|
||||
taskId = CreateTask(SendOutMonAnimation, 5);
|
||||
gTasks[taskId].data[1] = a;
|
||||
gTasks[taskId].data[2] = side;
|
||||
|
|
@ -647,7 +647,7 @@ static void sub_8046AD0(u8 taskId)
|
|||
gTasks[taskId].data[15] = r6 + 1;
|
||||
break;
|
||||
case 1:
|
||||
PlayCry1(species, r3);
|
||||
PlayCry_Normal(species, r3);
|
||||
DestroyTask(taskId);
|
||||
break;
|
||||
case 2:
|
||||
|
|
@ -793,12 +793,12 @@ static void sub_8046E9C(struct Sprite *sprite)
|
|||
|
||||
gSprites[gBattlerSpriteIds[r4]].y2 = 0;
|
||||
gDoingBattleAnim = 0;
|
||||
ewram17810[r4].unk0_3 = 0;
|
||||
gBattleHealthBoxInfo[r4].ballAnimActive = 0;
|
||||
FreeSpriteOamMatrix(sprite);
|
||||
DestroySprite(sprite);
|
||||
for (r3 = 0, i = 0; i < 4; i++)
|
||||
{
|
||||
if (ewram17810[i].unk0_3 == 0)
|
||||
if (gBattleHealthBoxInfo[i].ballAnimActive == 0)
|
||||
r3++;
|
||||
}
|
||||
if (r3 == 4)
|
||||
|
|
@ -830,7 +830,7 @@ static void sub_8046FBC(struct Sprite *sprite)
|
|||
DestroySprite(&gSprites[gBattlerSpriteIds[sprite->data[6]]]);
|
||||
DestroySpriteAndFreeResources(sprite);
|
||||
if (gMain.inBattle)
|
||||
ewram17810[r7].unk0_3 = 0;
|
||||
gBattleHealthBoxInfo[r7].ballAnimActive = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1101,7 +1101,7 @@ void obj_delete_and_free_associated_resources_(struct Sprite *sprite)
|
|||
DestroySpriteAndFreeResources(sprite);
|
||||
}
|
||||
|
||||
void sub_804777C(u8 a)
|
||||
void StartHealthboxSlideIn(u8 a)
|
||||
{
|
||||
struct Sprite *sprite = &gSprites[gHealthboxSpriteIds[a]];
|
||||
|
||||
|
|
@ -1140,7 +1140,7 @@ static void sub_8047830(struct Sprite *sprite)
|
|||
sprite->callback = SpriteCallbackDummy;
|
||||
}
|
||||
|
||||
void sub_8047858(u8 a)
|
||||
void DoHitAnimHealthboxEffect(u8 a)
|
||||
{
|
||||
u8 spriteId;
|
||||
|
||||
|
|
|
|||
|
|
@ -628,7 +628,7 @@ static bool8 sub_8147B20(struct Pokemon* mon)
|
|||
TiD = GetMonData(mon, MON_DATA_OT_ID);
|
||||
palette = GetMonSpritePalStructFromOtIdPersonality(species, TiD, PiD);
|
||||
LoadCompressedObjectPalette(palette);
|
||||
GetMonSpriteTemplate_803C56C(palette->tag, 1);
|
||||
SetMultiuseSpriteTemplateToPokemon(palette->tag, 1);
|
||||
ePokeblockGfxState++;
|
||||
}
|
||||
break;
|
||||
|
|
@ -791,7 +791,7 @@ static void sub_8148078(struct Sprite* sprite)
|
|||
sprite->y += sprite->data[0];
|
||||
sprite->data[0] += sprite->data[1];
|
||||
if (sprite->data[0] == 0)
|
||||
PlayCry1(sprite->data[2], 0);
|
||||
PlayCry_Normal(sprite->data[2], 0);
|
||||
if (sprite->data[0] == 9)
|
||||
sprite->callback = SpriteCallbackDummy;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3858,7 +3858,7 @@ static void sub_8090750(u8 taskId)
|
|||
case 6:
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
PlayCry1(NationalPokedexNumToSpecies(dexNum), 0);
|
||||
PlayCry_Normal(NationalPokedexNumToSpecies(dexNum), 0);
|
||||
gTasks[taskId].data[2] = 0;
|
||||
gTasks[taskId].data[4] = 0;
|
||||
gTasks[taskId].func = sub_8090A3C;
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@
|
|||
#include "overworld.h"
|
||||
#include "sprite.h"
|
||||
#include "string_util.h"
|
||||
#include "trainer.h"
|
||||
#include "text.h"
|
||||
#include "ewram.h"
|
||||
#include "util.h"
|
||||
#include "constants/trainers.h"
|
||||
|
||||
extern u16 gMoveToLearn;
|
||||
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@
|
|||
#include "string_util.h"
|
||||
#include "strings2.h"
|
||||
#include "text.h"
|
||||
#include "trainer.h"
|
||||
#include "util.h"
|
||||
#include "ewram.h"
|
||||
#include "constants/trainers.h"
|
||||
|
||||
extern u8 gPlayerPartyCount;
|
||||
extern u8 gEnemyPartyCount;
|
||||
|
|
@ -159,14 +159,14 @@ const struct SpriteTemplate gSpriteTemplate_8208288[] =
|
|||
gAffineAnims_BattleSpriteOpponentSide, oac_poke_opponent},
|
||||
};
|
||||
|
||||
void GetMonSpriteTemplate_803C56C(u16 species, u8 a2)
|
||||
void SetMultiuseSpriteTemplateToPokemon(u16 species, u8 a2)
|
||||
{
|
||||
gCreatingSpriteTemplate = gSpriteTemplate_8208288[a2];
|
||||
gCreatingSpriteTemplate.paletteTag = species;
|
||||
gCreatingSpriteTemplate.anims = (const union AnimCmd *const *)gSpriteAnimTable_81E7C64; //Why do I have to cast this?
|
||||
}
|
||||
|
||||
void GetMonSpriteTemplate_803C5A0(u16 species, u8 a2)
|
||||
void SetMultiuseSpriteTemplateToTrainerBack(u16 species, u8 a2)
|
||||
{
|
||||
gCreatingSpriteTemplate = gSpriteTemplate_8208288[a2];
|
||||
gCreatingSpriteTemplate.paletteTag = species;
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@
|
|||
#include "sprite.h"
|
||||
#include "string_util.h"
|
||||
#include "text.h"
|
||||
#include "trainer.h"
|
||||
#include "util.h"
|
||||
#include "ewram.h"
|
||||
#include "constants/trainers.h"
|
||||
|
||||
extern u8 gPlayerPartyCount;
|
||||
extern u8 gEnemyPartyCount;
|
||||
|
|
@ -43,7 +43,7 @@ extern u8 gDisplayedStringBattle[];
|
|||
extern u8 gBattlerAttacker;
|
||||
extern u8 gBattlerTarget;
|
||||
extern u8 gPotentialItemEffectBattler;
|
||||
extern u8 gBankInMenu;
|
||||
extern u8 gBattlerInMenuId;
|
||||
extern struct SpindaSpot gSpindaSpotGraphics[];
|
||||
extern s8 gNatureStatTable[][5];
|
||||
extern u16 gTrainerBattleOpponent;
|
||||
|
|
@ -197,7 +197,7 @@ const u8 gUnknown_082082F8[] = {1, 1, 3, 2, 4, 6};
|
|||
|
||||
void sub_803F324(int stat)
|
||||
{
|
||||
gBattlerTarget = gBankInMenu;
|
||||
gBattlerTarget = gBattlerInMenuId;
|
||||
StringCopy(gBattleTextBuff1, gUnknown_08400F58[gUnknown_082082F8[stat]]);
|
||||
StringCopy(gBattleTextBuff2, BattleText_Rose);
|
||||
BattleStringExpandPlaceholdersToDisplayedString(BattleText_UnknownString3);
|
||||
|
|
@ -212,7 +212,7 @@ u8 *sub_803F378(u16 itemId)
|
|||
{
|
||||
if (gMain.inBattle)
|
||||
{
|
||||
itemEffect = gEnigmaBerries[gBankInMenu].itemEffect;
|
||||
itemEffect = gEnigmaBerries[gBattlerInMenuId].itemEffect;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -224,7 +224,7 @@ u8 *sub_803F378(u16 itemId)
|
|||
itemEffect = gItemEffectTable[itemId - 13];
|
||||
}
|
||||
|
||||
gPotentialItemEffectBattler = gBankInMenu;
|
||||
gPotentialItemEffectBattler = gBattlerInMenuId;
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
|
|
@ -238,7 +238,7 @@ u8 *sub_803F378(u16 itemId)
|
|||
}
|
||||
else
|
||||
{
|
||||
gBattlerAttacker = gBankInMenu;
|
||||
gBattlerAttacker = gBattlerInMenuId;
|
||||
BattleStringExpandPlaceholdersToDisplayedString(BattleText_GetPumped);
|
||||
}
|
||||
}
|
||||
|
|
@ -246,7 +246,7 @@ u8 *sub_803F378(u16 itemId)
|
|||
|
||||
if (itemEffect[3] & 0x80)
|
||||
{
|
||||
gBattlerAttacker = gBankInMenu;
|
||||
gBattlerAttacker = gBattlerInMenuId;
|
||||
BattleStringExpandPlaceholdersToDisplayedString(BattleText_MistShroud);
|
||||
}
|
||||
|
||||
|
|
@ -1311,8 +1311,8 @@ void SetMonPreventsSwitchingString(void)
|
|||
gBattleTextBuff1[3] = gBattlerPartyIndexes[gBattleStruct->battlerPreventingSwitchout];
|
||||
gBattleTextBuff2[0] = B_BUFF_PLACEHOLDER_BEGIN;
|
||||
gBattleTextBuff2[1] = B_BUFF_MON_NICK_WITH_PREFIX;
|
||||
gBattleTextBuff2[2] = gBankInMenu;
|
||||
gBattleTextBuff2[3] = pokemon_order_func(gBattlerPartyIndexes[gBankInMenu]);
|
||||
gBattleTextBuff2[2] = gBattlerInMenuId;
|
||||
gBattleTextBuff2[3] = pokemon_order_func(gBattlerPartyIndexes[gBattlerInMenuId]);
|
||||
gBattleTextBuff2[4] = B_BUFF_EOS;
|
||||
BattleStringExpandPlaceholders(BattleText_PreventedSwitch, gStringVar4);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
extern s32 gBattleMoveDamage;
|
||||
extern u8 gAbsentBattlerFlags;
|
||||
extern u8 gBankInMenu;
|
||||
extern u8 gBattlerInMenuId;
|
||||
extern u8 gBattlersCount;
|
||||
extern u16 gBattlerPartyIndexes[];
|
||||
extern u8 gActiveBattler;
|
||||
|
|
@ -67,7 +67,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *pkmn, u16 item, u8 partyIndex, u8 mo
|
|||
if (heldItem == ITEM_ENIGMA_BERRY)
|
||||
{
|
||||
if (gMain.inBattle)
|
||||
holdEffect = gEnigmaBerries[gBankInMenu].holdEffect;
|
||||
holdEffect = gEnigmaBerries[gBattlerInMenuId].holdEffect;
|
||||
else
|
||||
holdEffect = gSaveBlock1.enigmaBerry.holdEffect;
|
||||
}
|
||||
|
|
@ -76,10 +76,10 @@ bool8 PokemonUseItemEffects(struct Pokemon *pkmn, u16 item, u8 partyIndex, u8 mo
|
|||
holdEffect = ItemId_GetHoldEffect(heldItem);
|
||||
}
|
||||
|
||||
gPotentialItemEffectBattler = gBankInMenu;
|
||||
gPotentialItemEffectBattler = gBattlerInMenuId;
|
||||
if (gMain.inBattle)
|
||||
{
|
||||
gActiveBattler = gBankInMenu;
|
||||
gActiveBattler = gBattlerInMenuId;
|
||||
cmdIndex = (GetBattlerSide(gActiveBattler) != 0);
|
||||
while (cmdIndex < gBattlersCount)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1852,7 +1852,7 @@ static u8 SummaryScreen_LoadPokemonSprite(struct Pokemon *mon, u8 *state)
|
|||
|
||||
palette = GetMonSpritePalStructFromOtIdPersonality(species, otId, personality);
|
||||
LoadCompressedObjectPalette(palette);
|
||||
GetMonSpriteTemplate_803C56C(palette->tag, 1);
|
||||
SetMultiuseSpriteTemplateToPokemon(palette->tag, 1);
|
||||
*state += 1;
|
||||
return 0xFF;
|
||||
}
|
||||
|
|
@ -3744,7 +3744,7 @@ static void SummaryScreen_SpritePlayCry(struct Sprite *sprite)
|
|||
sprite->callback = SpriteCallbackDummy;
|
||||
|
||||
if (!GetMonData(&pssData.loadedMon, MON_DATA_IS_EGG))
|
||||
PlayCry1(sprite->data[0], 0);
|
||||
PlayCry_Normal(sprite->data[0], 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,12 +8,13 @@
|
|||
#include "rom_8077ABC.h"
|
||||
#include "data2.h"
|
||||
#include "ewram.h"
|
||||
#include "constants/trainers.h"
|
||||
|
||||
extern struct SpriteTemplate gCreatingSpriteTemplate;
|
||||
extern struct Window gWindowTemplate_Contest_MoveDescription;
|
||||
extern u8 gReservedSpritePaletteCount;
|
||||
extern u8 gActionSelectionCursor[4];
|
||||
extern u8 gBankInMenu;
|
||||
extern u8 gBattlerInMenuId;
|
||||
extern u16 gBattlerPartyIndexes[4];
|
||||
extern u8 gBattlersCount;
|
||||
extern u16 gBattleTypeFlags;
|
||||
|
|
@ -30,16 +31,16 @@ void sub_800FCD4(void);
|
|||
void BattleLoadOpponentMonSprite(struct Pokemon *, u8 bank);
|
||||
void BattleLoadPlayerMonSprite(struct Pokemon *, u8 bank);
|
||||
void BattleLoadSubstituteSprite(u8 bank, u8 b);
|
||||
void LoadPlayerTrainerBankSprite(u16 a0, u8 bank);
|
||||
void DecompressTrainerBackPic(u16 a0, u8 bank);
|
||||
u8 sub_8077F7C(u8 bank);
|
||||
u8 sub_8077F68(u8 bank);
|
||||
u8 GetBattlerSpriteDefault_Y(u8 bank);
|
||||
void nullsub_11(u8 healthboxID, u8 a1);
|
||||
void sub_8043DB0(u8 bank);
|
||||
void SetHealthboxSpriteInvisible(u8 bank);
|
||||
u8 battle_make_oam_normal_battle(u8 bank);
|
||||
u8 battle_make_oam_safari_battle(void);
|
||||
void sub_8045A5C(u8 healthboxID, struct Pokemon*, u8);
|
||||
void UpdateHealthboxAttribute(u8 healthboxID, struct Pokemon*, u8);
|
||||
void sub_8043F44(u8 bank);
|
||||
void sub_8043DFC(u8 healthboxID);
|
||||
void SetHealthboxSpriteVisible(u8 healthboxID);
|
||||
|
||||
// this file's functions
|
||||
static void CB2_ReshowBattleScreenAfterMenu(void);
|
||||
|
|
@ -48,7 +49,7 @@ static void sub_807B184(u8 bank);
|
|||
static void sub_807B508(u8 bank);
|
||||
static void sub_807B06C(void);
|
||||
|
||||
void nullsub_14(void)
|
||||
void ReshowBattleScreenDummy(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -173,7 +174,7 @@ static void CB2_ReshowBattleScreenAfterMenu(void)
|
|||
species = GetMonData(&gEnemyParty[gBattlerPartyIndexes[opponentBank]], MON_DATA_SPECIES);
|
||||
sub_8032984(opponentBank, species);
|
||||
}
|
||||
sub_802E3E4(gActionSelectionCursor[gBankInMenu], 0);
|
||||
sub_802E3E4(gActionSelectionCursor[gBattlerInMenuId], 0);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
@ -201,16 +202,16 @@ static bool8 LoadAppropiateBankSprite(u8 bank)
|
|||
{
|
||||
if (GetBattlerSide(bank))
|
||||
{
|
||||
if (!gBattleSpriteInfo[bank].substituteSprite)
|
||||
if (!gBattleSpriteInfo[bank].behindSubstitute)
|
||||
BattleLoadOpponentMonSprite(&gEnemyParty[gBattlerPartyIndexes[bank]], bank);
|
||||
else
|
||||
BattleLoadSubstituteSprite(bank, 0);
|
||||
}
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_SAFARI && bank == 0)
|
||||
LoadPlayerTrainerBankSprite(gSaveBlock2.playerGender, 0);
|
||||
DecompressTrainerBackPic(gSaveBlock2.playerGender, 0);
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_WALLY_TUTORIAL && bank == 0)
|
||||
LoadPlayerTrainerBankSprite(2, 0);
|
||||
else if (!gBattleSpriteInfo[bank].substituteSprite)
|
||||
DecompressTrainerBackPic(TRAINER_BACK_PIC_WALLY, 0);
|
||||
else if (!gBattleSpriteInfo[bank].behindSubstitute)
|
||||
BattleLoadPlayerMonSprite(&gPlayerParty[gBattlerPartyIndexes[bank]], bank);
|
||||
else
|
||||
BattleLoadSubstituteSprite(bank, 0);
|
||||
|
|
@ -226,16 +227,16 @@ static void sub_807B184(u8 bank)
|
|||
{
|
||||
u8 posY;
|
||||
|
||||
if (gBattleSpriteInfo[bank].substituteSprite)
|
||||
if (gBattleSpriteInfo[bank].behindSubstitute)
|
||||
posY = sub_8077F7C(bank);
|
||||
else
|
||||
posY = sub_8077F68(bank);
|
||||
posY = GetBattlerSpriteDefault_Y(bank);
|
||||
if (GetBattlerSide(bank))
|
||||
{
|
||||
if (GetMonData(&gEnemyParty[gBattlerPartyIndexes[bank]], MON_DATA_HP) == 0)
|
||||
return;
|
||||
GetMonSpriteTemplate_803C56C(GetMonData(&gEnemyParty[gBattlerPartyIndexes[bank]], MON_DATA_SPECIES), GetBattlerPosition(bank));
|
||||
gBattlerSpriteIds[bank] = CreateSprite(&gCreatingSpriteTemplate, GetBattlerSpriteCoord(bank, 2), posY, GetBattlerSubpriority(bank));
|
||||
SetMultiuseSpriteTemplateToPokemon(GetMonData(&gEnemyParty[gBattlerPartyIndexes[bank]], MON_DATA_SPECIES), GetBattlerPosition(bank));
|
||||
gBattlerSpriteIds[bank] = CreateSprite(&gCreatingSpriteTemplate, GetBattlerSpriteCoord(bank, 2), posY, GetBattlerSpriteSubpriority(bank));
|
||||
gSprites[gBattlerSpriteIds[bank]].oam.paletteNum = bank;
|
||||
gSprites[gBattlerSpriteIds[bank]].callback = SpriteCallbackDummy;
|
||||
gSprites[gBattlerSpriteIds[bank]].data[0] = bank;
|
||||
|
|
@ -244,20 +245,20 @@ static void sub_807B184(u8 bank)
|
|||
}
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_SAFARI && bank == 0)
|
||||
{
|
||||
GetMonSpriteTemplate_803C5A0(gSaveBlock2.playerGender, GetBattlerPosition(0));
|
||||
SetMultiuseSpriteTemplateToTrainerBack(gSaveBlock2.playerGender, GetBattlerPosition(0));
|
||||
gBattlerSpriteIds[bank] = CreateSprite(&gCreatingSpriteTemplate, 0x50,
|
||||
(8 - gTrainerBackPicCoords[gSaveBlock2.playerGender].coords) * 4 + 80,
|
||||
GetBattlerSubpriority(0));
|
||||
GetBattlerSpriteSubpriority(0));
|
||||
gSprites[gBattlerSpriteIds[bank]].oam.paletteNum = bank;
|
||||
gSprites[gBattlerSpriteIds[bank]].callback = SpriteCallbackDummy;
|
||||
gSprites[gBattlerSpriteIds[bank]].data[0] = bank;
|
||||
}
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_WALLY_TUTORIAL && bank == 0)
|
||||
{
|
||||
GetMonSpriteTemplate_803C5A0(2, GetBattlerPosition(0));
|
||||
SetMultiuseSpriteTemplateToTrainerBack(TRAINER_BACK_PIC_WALLY, GetBattlerPosition(0));
|
||||
gBattlerSpriteIds[bank] = CreateSprite(&gCreatingSpriteTemplate, 0x50,
|
||||
(8 - gTrainerBackPicCoords[2].coords) * 4 + 80,
|
||||
GetBattlerSubpriority(0));
|
||||
GetBattlerSpriteSubpriority(0));
|
||||
gSprites[gBattlerSpriteIds[bank]].oam.paletteNum = bank;
|
||||
gSprites[gBattlerSpriteIds[bank]].callback = SpriteCallbackDummy;
|
||||
gSprites[gBattlerSpriteIds[bank]].data[0] = bank;
|
||||
|
|
@ -266,8 +267,8 @@ static void sub_807B184(u8 bank)
|
|||
{
|
||||
if (GetMonData(&gPlayerParty[gBattlerPartyIndexes[bank]], MON_DATA_HP) == 0)
|
||||
return;
|
||||
GetMonSpriteTemplate_803C56C(GetMonData(&gPlayerParty[gBattlerPartyIndexes[bank]], MON_DATA_SPECIES), GetBattlerPosition(bank));
|
||||
gBattlerSpriteIds[bank] = CreateSprite(&gCreatingSpriteTemplate, GetBattlerSpriteCoord(bank, 2), posY, GetBattlerSubpriority(bank));
|
||||
SetMultiuseSpriteTemplateToPokemon(GetMonData(&gPlayerParty[gBattlerPartyIndexes[bank]], MON_DATA_SPECIES), GetBattlerPosition(bank));
|
||||
gBattlerSpriteIds[bank] = CreateSprite(&gCreatingSpriteTemplate, GetBattlerSpriteCoord(bank, 2), posY, GetBattlerSpriteSubpriority(bank));
|
||||
gSprites[gBattlerSpriteIds[bank]].oam.paletteNum = bank;
|
||||
gSprites[gBattlerSpriteIds[bank]].callback = SpriteCallbackDummy;
|
||||
gSprites[gBattlerSpriteIds[bank]].data[0] = bank;
|
||||
|
|
@ -291,13 +292,13 @@ static void sub_807B508(u8 bank)
|
|||
healthboxID = battle_make_oam_normal_battle(bank);
|
||||
gHealthboxSpriteIds[bank] = healthboxID;
|
||||
sub_8043F44(bank);
|
||||
sub_8043DFC(healthboxID);
|
||||
SetHealthboxSpriteVisible(healthboxID);
|
||||
if (GetBattlerSide(bank))
|
||||
sub_8045A5C(gHealthboxSpriteIds[bank], &gEnemyParty[gBattlerPartyIndexes[bank]], 0);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[bank], &gEnemyParty[gBattlerPartyIndexes[bank]], 0);
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_SAFARI)
|
||||
sub_8045A5C(gHealthboxSpriteIds[bank], &gPlayerParty[gBattlerPartyIndexes[bank]], 10);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[bank], &gPlayerParty[gBattlerPartyIndexes[bank]], 10);
|
||||
else
|
||||
sub_8045A5C(gHealthboxSpriteIds[bank], &gPlayerParty[gBattlerPartyIndexes[bank]], 0);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[bank], &gPlayerParty[gBattlerPartyIndexes[bank]], 0);
|
||||
if (GetBattlerPosition(bank) == 3 || GetBattlerPosition(bank) == 2)
|
||||
nullsub_11(gHealthboxSpriteIds[bank], 1);
|
||||
else
|
||||
|
|
@ -305,12 +306,12 @@ static void sub_807B508(u8 bank)
|
|||
if (GetBattlerSide(bank))
|
||||
{
|
||||
if (GetMonData(&gEnemyParty[gBattlerPartyIndexes[bank]], MON_DATA_HP) == 0)
|
||||
sub_8043DB0(healthboxID);
|
||||
SetHealthboxSpriteInvisible(healthboxID);
|
||||
}
|
||||
else if (!(gBattleTypeFlags & BATTLE_TYPE_SAFARI))
|
||||
{
|
||||
if (GetMonData(&gPlayerParty[gBattlerPartyIndexes[bank]], MON_DATA_HP) == 0)
|
||||
sub_8043DB0(healthboxID);
|
||||
SetHealthboxSpriteInvisible(healthboxID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -182,18 +182,18 @@ u8 GetBattlerSpriteCoord(u8 slot, u8 a2)
|
|||
if (GetBattlerSide(slot))
|
||||
{
|
||||
transform = &gBattleSpriteInfo[slot];
|
||||
if (!transform->transformedSpecies)
|
||||
if (!transform->transformSpecies)
|
||||
species = GetMonData(&gEnemyParty[gBattleMonPartyPositions[slot]], MON_DATA_SPECIES);
|
||||
else
|
||||
species = transform->transformedSpecies;
|
||||
species = transform->transformSpecies;
|
||||
}
|
||||
else
|
||||
{
|
||||
transform = &gBattleSpriteInfo[slot];
|
||||
if (!transform->transformedSpecies)
|
||||
if (!transform->transformSpecies)
|
||||
species = GetMonData(&gPlayerParty[gBattleMonPartyPositions[slot]], MON_DATA_SPECIES);
|
||||
else
|
||||
species = transform->transformedSpecies;
|
||||
species = transform->transformSpecies;
|
||||
}
|
||||
}
|
||||
if (a2 == 3)
|
||||
|
|
@ -227,7 +227,7 @@ u8 sub_8077BFC(u8 slot, u16 species)
|
|||
else
|
||||
{
|
||||
transform = &gBattleSpriteInfo[slot];
|
||||
if (!transform->transformedSpecies)
|
||||
if (!transform->transformSpecies)
|
||||
personality = GetMonData(&gPlayerParty[gBattleMonPartyPositions[slot]], MON_DATA_PERSONALITY);
|
||||
else
|
||||
personality = gTransformPersonalities[slot];
|
||||
|
|
@ -257,7 +257,7 @@ u8 sub_8077BFC(u8 slot, u16 species)
|
|||
if (species == SPECIES_UNOWN)
|
||||
{
|
||||
transform = &gBattleSpriteInfo[slot];
|
||||
if (!transform->transformedSpecies)
|
||||
if (!transform->transformSpecies)
|
||||
personality = GetMonData(&gEnemyParty[gBattleMonPartyPositions[slot]], MON_DATA_PERSONALITY);
|
||||
else
|
||||
personality = gTransformPersonalities[slot];
|
||||
|
|
@ -343,10 +343,10 @@ u8 sub_8077EE4(u8 slot, u8 a2)
|
|||
else
|
||||
{
|
||||
transform = &gBattleSpriteInfo[slot];
|
||||
if (!transform->transformedSpecies)
|
||||
if (!transform->transformSpecies)
|
||||
species = gAnimSpeciesByBanks[slot];
|
||||
else
|
||||
species = transform->transformedSpecies;
|
||||
species = transform->transformSpecies;
|
||||
}
|
||||
if (a2 == 3)
|
||||
return GetBattlerSpriteFinal_Y(slot, species, 1);
|
||||
|
|
@ -359,7 +359,7 @@ u8 sub_8077EE4(u8 slot, u8 a2)
|
|||
}
|
||||
}
|
||||
|
||||
u8 sub_8077F68(u8 slot)
|
||||
u8 GetBattlerSpriteDefault_Y(u8 slot)
|
||||
{
|
||||
return GetBattlerSpriteCoord(slot, 4);
|
||||
}
|
||||
|
|
@ -386,19 +386,19 @@ u8 sub_8077FC0(u8 slot)
|
|||
if (GetBattlerSide(slot) != 0)
|
||||
{
|
||||
transform = &gBattleSpriteInfo[slot];
|
||||
if (!transform->transformedSpecies) {
|
||||
if (!transform->transformSpecies) {
|
||||
var = GetMonData(&gEnemyParty[gBattleMonPartyPositions[slot]], MON_DATA_SPECIES);
|
||||
} else {
|
||||
var = transform->transformedSpecies;
|
||||
var = transform->transformSpecies;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
transform = &gBattleSpriteInfo[slot];
|
||||
if (!transform->transformedSpecies)
|
||||
if (!transform->transformSpecies)
|
||||
var = GetMonData(&gPlayerParty[gBattleMonPartyPositions[slot]], MON_DATA_SPECIES);
|
||||
else
|
||||
var = transform->transformedSpecies;
|
||||
var = transform->transformSpecies;
|
||||
}
|
||||
if (GetBattlerSide(slot) != 0)
|
||||
r6 -= sub_8077DD8(slot, var);
|
||||
|
|
@ -778,7 +778,7 @@ bool8 TranslateAnimArc(struct Sprite *sprite)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
void oamt_add_pos2_onto_pos1(struct Sprite *sprite)
|
||||
void SetSpritePrimaryCoordsFromSecondaryCoords(struct Sprite *sprite)
|
||||
{
|
||||
sprite->x += sprite->x2;
|
||||
sprite->y += sprite->y2;
|
||||
|
|
@ -1168,7 +1168,7 @@ void PrepareBattlerSpriteForRotScale(u8 sprite, u8 objMode)
|
|||
gSprites[sprite].oam.objMode = objMode;
|
||||
gSprites[sprite].affineAnimPaused = TRUE;
|
||||
if (!IsContest() && !gSprites[sprite].oam.affineMode)
|
||||
gSprites[sprite].oam.matrixNum = ewram17810[r7].unk6;
|
||||
gSprites[sprite].oam.matrixNum = gBattleHealthBoxInfo[r7].unk6;
|
||||
gSprites[sprite].oam.affineMode = 3;
|
||||
CalcCenterToCornerVec(&gSprites[sprite], gSprites[sprite].oam.shape, gSprites[sprite].oam.size, gSprites[sprite].oam.affineMode);
|
||||
}
|
||||
|
|
@ -1764,19 +1764,19 @@ u16 sub_8079B10(u8 sprite)
|
|||
if (!GetBattlerSide(i))
|
||||
{
|
||||
transform = &gBattleSpriteInfo[slot];
|
||||
if (!transform->transformedSpecies)
|
||||
if (!transform->transformSpecies)
|
||||
species = GetMonData(&gPlayerParty[gBattleMonPartyPositions[i]], MON_DATA_SPECIES);
|
||||
else
|
||||
species = transform->transformedSpecies;
|
||||
species = transform->transformSpecies;
|
||||
return gMonBackPicCoords[species].y_offset;
|
||||
}
|
||||
else
|
||||
{
|
||||
transform = &gBattleSpriteInfo[slot];
|
||||
if (!transform->transformedSpecies)
|
||||
if (!transform->transformSpecies)
|
||||
species = GetMonData(&gEnemyParty[gBattleMonPartyPositions[i]], MON_DATA_SPECIES);
|
||||
else
|
||||
species = transform->transformedSpecies;
|
||||
species = transform->transformSpecies;
|
||||
return gMonFrontPicCoords[species].y_offset;
|
||||
}
|
||||
}
|
||||
|
|
@ -1870,13 +1870,13 @@ void UpdateBattlerSpritePriorities()
|
|||
{
|
||||
if (IsAnimBankSpriteVisible(i))
|
||||
{
|
||||
gSprites[gBattleMonSprites[i]].subpriority = GetBattlerSubpriority(i);
|
||||
gSprites[gBattleMonSprites[i]].subpriority = GetBattlerSpriteSubpriority(i);
|
||||
gSprites[gBattleMonSprites[i]].oam.priority = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
u8 GetBattlerSubpriority(u8 bank)
|
||||
u8 GetBattlerSpriteSubpriority(u8 bank)
|
||||
{
|
||||
u8 identity;
|
||||
u8 ret;
|
||||
|
|
@ -2034,14 +2034,14 @@ s16 GetBattlerSpriteCoordAttr(u8 slot, u8 a2)
|
|||
if (!GetBattlerSide(slot))
|
||||
{
|
||||
transform = &gBattleSpriteInfo[slot];
|
||||
if (!transform->transformedSpecies)
|
||||
if (!transform->transformSpecies)
|
||||
{
|
||||
species = GetMonData(&gPlayerParty[gBattleMonPartyPositions[slot]], MON_DATA_SPECIES);
|
||||
personality = GetMonData(&gPlayerParty[gBattleMonPartyPositions[slot]], MON_DATA_PERSONALITY);
|
||||
}
|
||||
else
|
||||
{
|
||||
species = transform->transformedSpecies;
|
||||
species = transform->transformSpecies;
|
||||
personality = gTransformPersonalities[slot];
|
||||
}
|
||||
if (species == SPECIES_UNOWN)
|
||||
|
|
@ -2065,14 +2065,14 @@ s16 GetBattlerSpriteCoordAttr(u8 slot, u8 a2)
|
|||
else
|
||||
{
|
||||
transform = &gBattleSpriteInfo[slot];
|
||||
if (!transform->transformedSpecies)
|
||||
if (!transform->transformSpecies)
|
||||
{
|
||||
species = GetMonData(&gEnemyParty[gBattleMonPartyPositions[slot]], MON_DATA_SPECIES);
|
||||
personality = GetMonData(&gEnemyParty[gBattleMonPartyPositions[slot]], MON_DATA_PERSONALITY);
|
||||
}
|
||||
else
|
||||
{
|
||||
species = transform->transformedSpecies;
|
||||
species = transform->transformSpecies;
|
||||
personality = gTransformPersonalities[slot];
|
||||
}
|
||||
if (species == SPECIES_UNOWN)
|
||||
|
|
@ -2241,7 +2241,7 @@ void sub_807A69C(u8 taskId)
|
|||
|
||||
dest = (task->data[4] + 0x10) * 0x10;
|
||||
src = (gSprites[task->data[0]].oam.paletteNum + 0x10) * 0x10;
|
||||
task->data[6] = GetBattlerSubpriority(gBattleAnimAttacker);
|
||||
task->data[6] = GetBattlerSpriteSubpriority(gBattleAnimAttacker);
|
||||
if (task->data[6] == 20 || task->data[6] == 40)
|
||||
task->data[6] = 2;
|
||||
else
|
||||
|
|
|
|||
|
|
@ -1667,13 +1667,13 @@ void sub_811952C(struct Sprite *sprite)
|
|||
if (eRoulette->var03_0)
|
||||
{
|
||||
if (sprite->data[0])
|
||||
PlayCry1(SPECIES_TAILLOW, -63);
|
||||
PlayCry_Normal(SPECIES_TAILLOW, -63);
|
||||
else
|
||||
PlayCry1(SPECIES_TAILLOW, 63);
|
||||
PlayCry_Normal(SPECIES_TAILLOW, 63);
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayCry1(SPECIES_SHROOMISH, -63);
|
||||
PlayCry_Normal(SPECIES_SHROOMISH, -63);
|
||||
}
|
||||
|
||||
val = 2;
|
||||
|
|
@ -1931,9 +1931,9 @@ void sub_8119BCC(struct Sprite *sprite)
|
|||
{
|
||||
m4aSongNumStartOrChange(SE_TAILLOW_WING_FLAP);
|
||||
if (eRoulette->var38->data[0] == 0)
|
||||
PlayCry1(SPECIES_TAILLOW, 63);
|
||||
PlayCry_Normal(SPECIES_TAILLOW, 63);
|
||||
else
|
||||
PlayCry1(SPECIES_TAILLOW, -63);
|
||||
PlayCry_Normal(SPECIES_TAILLOW, -63);
|
||||
StartSpriteAnim(sprite, eRoulette->var38->data[0] + 2);
|
||||
sprite->data[1] = 45;
|
||||
sprite->callback = sub_8119B24;
|
||||
|
|
|
|||
|
|
@ -294,7 +294,7 @@ bool8 IsBGMStopped(void)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
void PlayCry1(u16 species, s8 pan)
|
||||
void PlayCry_Normal(u16 species, s8 pan)
|
||||
{
|
||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 85);
|
||||
PlayCryInternal(species, pan, 125, 10, 0);
|
||||
|
|
|
|||
|
|
@ -423,7 +423,7 @@ static void Task_StarterChoose3(u8 taskId)
|
|||
|
||||
static void Task_StarterChoose4(u8 taskId)
|
||||
{
|
||||
PlayCry1(GetStarterPokemon(gTasks[taskId].tStarterSelection), 0);
|
||||
PlayCry_Normal(GetStarterPokemon(gTasks[taskId].tStarterSelection), 0);
|
||||
Menu_DrawStdWindowFrame(2, 14, 27, 19);
|
||||
//"Do you choose this POKEMON?"
|
||||
Menu_PrintText(gOtherText_DoYouChoosePoke, 3, 15);
|
||||
|
|
@ -575,7 +575,7 @@ static u8 CreatePokemonFrontSprite(u16 species, u8 x, u8 y)
|
|||
gMonSpriteGfx_Sprite_ptr[0], gMonSpriteGfx_Sprite_ptr[1],
|
||||
species);
|
||||
LoadCompressedObjectPalette(&gMonPaletteTable[species]);
|
||||
GetMonSpriteTemplate_803C56C(species, 1);
|
||||
SetMultiuseSpriteTemplateToPokemon(species, 1);
|
||||
spriteId = CreateSprite(&gCreatingSpriteTemplate, x, y, 0);
|
||||
gSprites[spriteId].callback = nullsub_72;
|
||||
gSprites[spriteId].oam.priority = 0;
|
||||
|
|
|
|||
|
|
@ -3527,7 +3527,7 @@ static void sub_804B2D0(u8 whichParty, u8 a1)
|
|||
gUnknown_03004828->tradeSpecies[whichParty] = species;
|
||||
break;
|
||||
case 1:
|
||||
GetMonSpriteTemplate_803C56C(GetMonSpritePalStruct(pokemon)->tag, v0);
|
||||
SetMultiuseSpriteTemplateToPokemon(GetMonSpritePalStruct(pokemon)->tag, v0);
|
||||
gUnknown_03004828->pokePicSpriteIdxs[whichParty] = CreateSprite(&gCreatingSpriteTemplate, 0x78, 0x3c, 0x6);
|
||||
gSprites[gUnknown_03004828->pokePicSpriteIdxs[whichParty]].invisible = TRUE;
|
||||
gSprites[gUnknown_03004828->pokePicSpriteIdxs[whichParty]].callback = SpriteCallbackDummy;
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ SYMBOL(gBattlerControllerFuncs, 16)
|
|||
SYMBOL(gHealthboxSpriteIds, 4)
|
||||
SYMBOL(gUnknown_03004344, 4)
|
||||
SYMBOL(gUnknown_03004348, 4)
|
||||
SYMBOL(gUnknown_0300434C, 4)
|
||||
SYMBOL(gBattleControllerData, 4)
|
||||
|
||||
// pokemon_1.c
|
||||
SYMBOL(gPlayerPartyCount, 4)
|
||||
|
|
|
|||
|
|
@ -261,10 +261,10 @@ gActionSelectionCursor = .; /* 2024E60 */
|
|||
gMoveSelectionCursor = .; /* 2024E64 */
|
||||
. += 0x4;
|
||||
|
||||
gUnknown_02024E68 = .; /* 2024E68 */
|
||||
gBattlerStatusSummaryTaskId = .; /* 2024E68 */
|
||||
. += 0x4;
|
||||
|
||||
gBankInMenu = .; /* 2024E6C */
|
||||
gBattlerInMenuId = .; /* 2024E6C */
|
||||
. += 0x1;
|
||||
|
||||
gDoingBattleAnim = .; /* 2024E6D */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user