From 38c89b9d0f0c71a2a8dfe2f38473338530a97ab9 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 1 Sep 2018 18:36:08 +0200 Subject: [PATCH] Bank to battler --- asm/macros/battle_ai_script.inc | 168 +++++++++++++++--------------- asm/macros/battle_anim_script.inc | 40 +++---- include/battle_interface.h | 10 +- include/battle_message.h | 8 +- include/battle_util2.h | 6 +- include/pokeball.h | 6 +- src/berry_blender.c | 12 +-- src/pokemon_animation.c | 6 +- 8 files changed, 128 insertions(+), 128 deletions(-) diff --git a/asm/macros/battle_ai_script.inc b/asm/macros/battle_ai_script.inc index 5e81686bf..28f60be46 100644 --- a/asm/macros/battle_ai_script.inc +++ b/asm/macros/battle_ai_script.inc @@ -27,86 +27,86 @@ .byte \param0 .endm - .macro if_hp_less_than bank, param1, param2 + .macro if_hp_less_than battler, param1, param2 .byte 0x5 - .byte \bank + .byte \battler .byte \param1 .4byte \param2 .endm - .macro if_hp_more_than bank, param1, param2 + .macro if_hp_more_than battler, param1, param2 .byte 0x6 - .byte \bank + .byte \battler .byte \param1 .4byte \param2 .endm - .macro if_hp_equal bank, param1, param2 + .macro if_hp_equal battler, param1, param2 .byte 0x7 - .byte \bank + .byte \battler .byte \param1 .4byte \param2 .endm - .macro if_hp_not_equal bank, param1, param2 + .macro if_hp_not_equal battler, param1, param2 .byte 0x8 - .byte \bank + .byte \battler .byte \param1 .4byte \param2 .endm - .macro if_status bank, status1, param2 + .macro if_status battler, status1, param2 .byte 0x9 - .byte \bank + .byte \battler .4byte \status1 .4byte \param2 .endm - .macro if_not_status bank, status1, param2 + .macro if_not_status battler, status1, param2 .byte 0xa - .byte \bank + .byte \battler .4byte \status1 .4byte \param2 .endm - .macro if_status2 bank, status2, param2 + .macro if_status2 battler, status2, param2 .byte 0xb - .byte \bank + .byte \battler .4byte \status2 .4byte \param2 .endm - .macro if_not_status2 bank, status2, param2 + .macro if_not_status2 battler, status2, param2 .byte 0xc - .byte \bank + .byte \battler .4byte \status2 .4byte \param2 .endm - .macro if_status3 bank, status3, param2 + .macro if_status3 battler, status3, param2 .byte 0xd - .byte \bank + .byte \battler .4byte \status3 .4byte \param2 .endm - .macro if_not_status3 bank, status3, param2 + .macro if_not_status3 battler, status3, param2 .byte 0xe - .byte \bank + .byte \battler .4byte \status3 .4byte \param2 .endm - .macro if_side_affecting bank, sidestatus, param2 + .macro if_side_affecting battler, sidestatus, param2 .byte 0xf - .byte \bank + .byte \battler .4byte \sidestatus .4byte \param2 .endm - .macro if_not_side_affecting bank, sidestatus, param2 + .macro if_not_side_affecting battler, sidestatus, param2 .byte 0x10 - .byte \bank + .byte \battler .4byte \sidestatus .4byte \param2 .endm @@ -222,9 +222,9 @@ .byte 0x24 .endm - .macro get_last_used_bank_move bank + .macro get_last_used_bank_move battler .byte 0x25 - .byte \bank + .byte \battler .endm .macro if_equal_ param0, param1 @@ -259,9 +259,9 @@ .byte 0x2b .endm - .macro count_usable_party_mons bank + .macro count_usable_party_mons battler .byte 0x2c - .byte \bank + .byte \battler .endm .macro get_considered_move @@ -272,9 +272,9 @@ .byte 0x2e .endm - .macro get_ability bank + .macro get_ability battler .byte 0x2f - .byte \bank + .byte \battler .endm .macro get_highest_type_effectiveness @@ -295,16 +295,16 @@ .byte 0x33 .endm - .macro if_status_in_party bank, status1, param2 + .macro if_status_in_party battler, status1, param2 .byte 0x34 - .byte \bank + .byte \battler .4byte \status1 .4byte \param2 .endm - .macro if_status_not_in_party bank, status1, param2 + .macro if_status_not_in_party battler, status1, param2 .byte 0x35 - .byte \bank + .byte \battler .4byte \status1 .4byte \param2 .endm @@ -325,33 +325,33 @@ .4byte \param1 .endm - .macro if_stat_level_less_than bank, stat, param2, param3 + .macro if_stat_level_less_than battler, stat, param2, param3 .byte 0x39 - .byte \bank + .byte \battler .byte \stat .byte \param2 .4byte \param3 .endm - .macro if_stat_level_more_than bank, stat, param2, param3 + .macro if_stat_level_more_than battler, stat, param2, param3 .byte 0x3a - .byte \bank + .byte \battler .byte \stat .byte \param2 .4byte \param3 .endm - .macro if_stat_level_equal bank, stat, param2, param3 + .macro if_stat_level_equal battler, stat, param2, param3 .byte 0x3b - .byte \bank + .byte \battler .byte \stat .byte \param2 .4byte \param3 .endm - .macro if_stat_level_not_equal bank, stat, param2, param3 + .macro if_stat_level_not_equal battler, stat, param2, param3 .byte 0x3c - .byte \bank + .byte \battler .byte \stat .byte \param2 .4byte \param3 @@ -367,37 +367,37 @@ .4byte \param0 .endm - .macro if_has_move bank, param1, param2 + .macro if_has_move battler, param1, param2 .byte 0x3f - .byte \bank + .byte \battler .2byte \param1 .4byte \param2 .endm - .macro if_doesnt_have_move bank, param1, param2 + .macro if_doesnt_have_move battler, param1, param2 .byte 0x40 - .byte \bank + .byte \battler .2byte \param1 .4byte \param2 .endm - .macro if_has_move_with_effect bank, param1, param2 + .macro if_has_move_with_effect battler, param1, param2 .byte 0x41 - .byte \bank + .byte \battler .byte \param1 .4byte \param2 .endm - .macro if_doesnt_have_move_with_effect bank, param1, param2 + .macro if_doesnt_have_move_with_effect battler, param1, param2 .byte 0x42 - .byte \bank + .byte \battler .byte \param1 .4byte \param2 .endm - .macro if_any_move_disabled_or_encored bank, param1, param2 + .macro if_any_move_disabled_or_encored battler, param1, param2 .byte 0x43 - .byte \bank + .byte \battler .byte \param1 .4byte \param2 .endm @@ -421,33 +421,33 @@ .byte 0x47 .endm - .macro get_hold_effect bank + .macro get_hold_effect battler .byte 0x48 - .byte \bank + .byte \battler .endm - .macro get_gender bank + .macro get_gender battler .byte 0x49 - .byte \bank + .byte \battler .endm - .macro is_first_turn_for bank + .macro is_first_turn_for battler .byte 0x4a - .byte \bank + .byte \battler .endm - .macro get_stockpile_count bank + .macro get_stockpile_count battler .byte 0x4b - .byte \bank + .byte \battler .endm .macro is_double_battle .byte 0x4c .endm - .macro get_used_held_item bank + .macro get_used_held_item battler .byte 0x4d - .byte \bank + .byte \battler .endm .macro get_move_type_from_result @@ -462,9 +462,9 @@ .byte 0x50 .endm - .macro get_protect_count bank + .macro get_protect_count battler .byte 0x51 - .byte \bank + .byte \battler .endm .macro nullsub_52 @@ -526,27 +526,27 @@ .4byte \param0 .endm - .macro is_of_type bank, type + .macro is_of_type battler, type .byte 0x5f - .byte \bank + .byte \battler .byte \type .endm - .macro check_ability bank, ability + .macro check_ability battler, ability .byte 0x60 - .byte \bank + .byte \battler .byte \ability .endm - .macro if_flash_fired bank, param1 + .macro if_flash_fired battler, param1 .byte 0x61 - .byte \bank + .byte \battler .4byte \param1 .endm - .macro if_holds_item bank, param1, param2 + .macro if_holds_item battler, param1, param2 .byte 0x62 - .byte \bank + .byte \battler .2byte \param1 .4byte \param2 .endm @@ -572,23 +572,23 @@ get_type AI_TYPE2_TARGET .endm - .macro if_ability bank, ability, ptr - check_ability \bank, \ability + .macro if_ability battler, ability, ptr + check_ability \battler, \ability if_equal 1, \ptr .endm - .macro if_no_ability bank, ability, ptr - check_ability \bank, \ability + .macro if_no_ability battler, ability, ptr + check_ability \battler, \ability if_equal 0, \ptr .endm - .macro if_type bank, type, ptr - is_of_type \bank, \type + .macro if_type battler, type, ptr + is_of_type \battler, \type if_equal 1, \ptr .endm - .macro if_no_type bank, type, ptr - is_of_type \bank, \type + .macro if_no_type battler, type, ptr + is_of_type \battler, \type if_equal 0, \ptr .endm @@ -610,10 +610,10 @@ if_equal 0, \ptr .endm - .macro if_any_move_disabled bank, ptr - if_any_move_disabled_or_encored \bank, 0, \ptr + .macro if_any_move_disabled battler, ptr + if_any_move_disabled_or_encored \battler, 0, \ptr .endm - .macro if_any_move_encored bank, ptr - if_any_move_disabled_or_encored \bank, 1, \ptr + .macro if_any_move_encored battler, ptr + if_any_move_disabled_or_encored \battler, 1, \ptr .endm diff --git a/asm/macros/battle_anim_script.inc b/asm/macros/battle_anim_script.inc index b26d1218d..d1a8f6656 100644 --- a/asm/macros/battle_anim_script.inc +++ b/asm/macros/battle_anim_script.inc @@ -56,14 +56,14 @@ .2byte \param0 .endm - .macro monbg bank + .macro monbg battler .byte 0xa - .byte \bank + .byte \battler .endm - .macro clearmonbg bank + .macro clearmonbg battler .byte 0xb - .byte \bank + .byte \battler .endm .macro setalpha param0 @@ -189,14 +189,14 @@ .4byte \param2 .endm - .macro monbg_22 bank + .macro monbg_22 battler .byte 0x22 - .byte \bank + .byte \battler .endm - .macro clearmonbg_23 bank + .macro clearmonbg_23 battler .byte 0x23 - .byte \bank + .byte \battler .endm .macro jumpifcontest param0 @@ -229,38 +229,38 @@ .byte \param4 .endm - .macro monbgprio_28 bank + .macro monbgprio_28 battler .byte 0x28 - .byte \bank + .byte \battler .endm .macro monbgprio_29 .byte 0x29 .endm - .macro monbgprio_2A bank + .macro monbgprio_2A battler .byte 0x2a - .byte \bank + .byte \battler .endm - .macro invisible bank + .macro invisible battler .byte 0x2b - .byte \bank + .byte \battler .endm - .macro visible bank + .macro visible battler .byte 0x2c - .byte \bank + .byte \battler .endm - .macro doublebattle_2D bank + .macro doublebattle_2D battler .byte 0x2d - .byte \bank + .byte \battler .endm - .macro doublebattle_2E bank + .macro doublebattle_2E battler .byte 0x2e - .byte \bank + .byte \battler .endm .macro stopsound diff --git a/include/battle_interface.h b/include/battle_interface.h index 2d93811f1..3145939d0 100644 --- a/include/battle_interface.h +++ b/include/battle_interface.h @@ -60,21 +60,21 @@ enum HEALTHBOX_SAFARI_BALLS_TEXT }; -u8 CreateBattlerHealthboxSprites(u8 bank); +u8 CreateBattlerHealthboxSprites(u8 battler); u8 CreateSafariPlayerHealthboxSprites(void); -void SetBattleBarStruct(u8 bank, u8 healthboxSpriteId, s32 maxVal, s32 currVal, s32 receivedValue); +void SetBattleBarStruct(u8 battler, u8 healthboxSpriteId, s32 maxVal, s32 currVal, s32 receivedValue); void SetHealthboxSpriteInvisible(u8 healthboxSpriteId); void SetHealthboxSpriteVisible(u8 healthboxSpriteId); void DestoryHealthboxSprite(u8 healthboxSpriteId); void DummyBattleInterfaceFunc(u8 healthboxSpriteId, bool8 isDoubleBattleBankOnly); void UpdateOamPriorityInAllHealthboxes(u8 priority); -void InitBattlerHealthboxCoords(u8 bank); +void InitBattlerHealthboxCoords(u8 battler); void UpdateHpTextInHealthbox(u8 healthboxSpriteId, s16 value, u8 maxOrCurrent); void SwapHpBarsWithHpText(void); -u8 CreatePartyStatusSummarySprites(u8 bank, struct HpAndStatus *partyInfo, u8 arg2, bool8 isBattleStart); +u8 CreatePartyStatusSummarySprites(u8 battler, struct HpAndStatus *partyInfo, u8 arg2, bool8 isBattleStart); void Task_HidePartyStatusSummary(u8 taskId); void UpdateHealthboxAttribute(u8 healthboxSpriteId, struct Pokemon *mon, u8 elementId); -s32 MoveBattleBar(u8 bank, u8 healthboxSpriteId, u8 whichBar, u8 arg3); +s32 MoveBattleBar(u8 battler, u8 healthboxSpriteId, u8 whichBar, u8 arg3); u8 GetScaledHPFraction(s16 hp, s16 maxhp, u8 scale); u8 GetHPBarLevel(s16 hp, s16 maxhp); diff --git a/include/battle_message.h b/include/battle_message.h index c68607246..94f584935 100644 --- a/include/battle_message.h +++ b/include/battle_message.h @@ -177,20 +177,20 @@ textVar[4] = B_BUFF_EOS; \ } -#define PREPARE_MON_NICK_WITH_PREFIX_BUFFER(textVar, bank, partyId) \ +#define PREPARE_MON_NICK_WITH_PREFIX_BUFFER(textVar, battler, partyId) \ { \ textVar[0] = B_BUFF_PLACEHOLDER_BEGIN; \ textVar[1] = B_BUFF_MON_NICK_WITH_PREFIX; \ - textVar[2] = bank; \ + textVar[2] = battler; \ textVar[3] = partyId; \ textVar[4] = B_BUFF_EOS; \ } -#define PREPARE_MON_NICK_BUFFER(textVar, bank, partyId) \ +#define PREPARE_MON_NICK_BUFFER(textVar, battler, partyId) \ { \ textVar[0] = B_BUFF_PLACEHOLDER_BEGIN; \ textVar[1] = B_BUFF_MON_NICK; \ - textVar[2] = bank; \ + textVar[2] = battler; \ textVar[3] = partyId; \ textVar[4] = B_BUFF_EOS; \ } diff --git a/include/battle_util2.h b/include/battle_util2.h index 3954e42dc..336698ea3 100644 --- a/include/battle_util2.h +++ b/include/battle_util2.h @@ -3,8 +3,8 @@ void AllocateBattleResources(void); void FreeBattleResources(void); -void AdjustFriendshipOnBattleFaint(u8 bank); -void sub_80571DC(u8 bank, u8 arg1); -u32 sub_805725C(u8 bank); +void AdjustFriendshipOnBattleFaint(u8 battler); +void sub_80571DC(u8 battler, u8 arg1); +u32 sub_805725C(u8 battler); #endif // GUARD_BATTLE_UTIL_H diff --git a/include/pokeball.h b/include/pokeball.h index 30a1d8b11..8e1d8b8ec 100644 --- a/include/pokeball.h +++ b/include/pokeball.h @@ -24,10 +24,10 @@ extern const struct SpriteTemplate gBallSpriteTemplates[]; #define POKEBALL_OPPONENT_SENDOUT 0xFE u8 DoPokeballSendOutAnimation(s16 pan, u8 kindOfThrow); -void CreatePokeballSpriteToReleaseMon(u8 monSpriteId, u8 bank, u8 x, u8 y, u8 oamPriority, u8 subpriortiy, u8 g, u32 h, u16 species); +void CreatePokeballSpriteToReleaseMon(u8 monSpriteId, u8 battler, u8 x, u8 y, u8 oamPriority, u8 subpriortiy, u8 g, u32 h, u16 species); u8 sub_807671C(u8 a, u8 b, u8 x, u8 y, u8 oamPriority, u8 subPriority, u8 g, u32 h); -void sub_8076918(u8 bank); -void DoHitAnimHealthboxEffect(u8 bank); +void sub_8076918(u8 battler); +void DoHitAnimHealthboxEffect(u8 battler); void LoadBallGfx(u8 ballId); void FreeBallGfx(u8 ballId); diff --git a/src/berry_blender.c b/src/berry_blender.c index 46b0f76ad..1fd6d1cdd 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -188,7 +188,7 @@ static bool8 sub_8083380(void); static void sub_808074C(void); static void Blender_PrintPlayerNames(void); static void sub_8080588(void); -static void Blender_SetBankBerryData(u8 bank, u16 itemId); +static void Blender_SetParticipantBerryData(u8 participantId, u16 itemId); static void Blender_AddTextPrinter(u8 windowId, const u8 *string, u8 x, u8 y, s32 speed, s32 caseId); static void sub_8080DF8(void); static void sub_8082E84(void); @@ -1391,7 +1391,7 @@ static void Blender_SetOpponentsBerryData(u16 playerBerryItemId, u8 playersNum, if (var <= 4) opponentBerryId -= 5; } - Blender_SetBankBerryData(i + 1, opponentBerryId + FIRST_BERRY_INDEX); + Blender_SetParticipantBerryData(i + 1, opponentBerryId + FIRST_BERRY_INDEX); } } @@ -1454,7 +1454,7 @@ static void sub_80808D4(void) case 0: sub_800B4C0(); sub_8080588(); - Blender_SetBankBerryData(0, gSpecialVar_ItemId); + Blender_SetParticipantBerryData(0, gSpecialVar_ItemId); Blender_CopyBerryData(&sBerryBlenderData->blendedBerries[0], gSpecialVar_ItemId); Blender_SetOpponentsBerryData(gSpecialVar_ItemId, sBerryBlenderData->playersNo, &sBerryBlenderData->blendedBerries[0]); @@ -2956,10 +2956,10 @@ static void sub_8082F9C(struct Sprite* sprite) DestroySprite(sprite); } -static void Blender_SetBankBerryData(u8 bank, u16 itemId) +static void Blender_SetParticipantBerryData(u8 participantId, u16 itemId) { - sBerryBlenderData->chosenItemId[bank] = itemId; - Blender_CopyBerryData(&sBerryBlenderData->blendedBerries[bank], itemId); + sBerryBlenderData->chosenItemId[participantId] = itemId; + Blender_CopyBerryData(&sBerryBlenderData->blendedBerries[participantId], itemId); } static void sub_8083010(struct Sprite* sprite) diff --git a/src/pokemon_animation.c b/src/pokemon_animation.c index c50aa4a75..9c307f7f8 100644 --- a/src/pokemon_animation.c +++ b/src/pokemon_animation.c @@ -938,14 +938,14 @@ void StartMonSummaryAnimation(struct Sprite *sprite, u8 frontAnimId) void LaunchAnimationTaskForBackSprite(struct Sprite *sprite, u8 backAnimSet) { - u8 nature, taskId, animId, bank; + u8 nature, taskId, animId, battlerId; taskId = CreateTask(Task_HandleMonAnimation, 128); gTasks[taskId].tPtrLO = (u32)(sprite) >> 0x10; gTasks[taskId].tPtrHI = (u32)(sprite); - bank = sprite->data[0]; - nature = GetNature(&gPlayerParty[gBattlerPartyIndexes[bank]]); + battlerId = sprite->data[0]; + nature = GetNature(&gPlayerParty[gBattlerPartyIndexes[battlerId]]); animId = 3 * backAnimSet + sBackAnimNatureModTable[nature]; gTasks[taskId].tAnimId = sBackAnimationIds[animId];