remove extra macro and shorten names

This commit is contained in:
garak 2018-11-13 16:19:52 -05:00
parent 269aebaca7
commit c6833c903c
6 changed files with 2976 additions and 2986 deletions

View File

@ -10,20 +10,10 @@
.2byte \param0
.endm
.macro createsprite template, priority, argv:vararg
.macro createsprite template, anim_battler, subpriority_offset, argv:vararg
.byte 0x02
.4byte \template
.byte \priority
.byte (.Lsprite_\@_2 - .Lsprite_\@_1) / 2
.Lsprite_\@_1:
.2byte \argv
.Lsprite_\@_2:
.endm
.macro createsprite2 template, anim_battler, subpriority_offset, argv:vararg
.byte 0x02
.4byte \template
.if \anim_battler == ANIM_BATTLER_TARGET
.if \anim_battler == ANIM_TARGET
.byte 0x80 | (\subpriority_offset & 0x7F)
.else
.byte (\subpriority_offset & 0x7F)

File diff suppressed because it is too large Load Diff

View File

@ -298,10 +298,10 @@
#define ANIM_TAG_BLUE_RING_2 (ANIM_SPRITES_START + 288)
// battlers
#define ANIM_BATTLER_ATTACKER 0
#define ANIM_BATTLER_TARGET 1
#define ANIM_BATTLER_ATK_PARTNER 2
#define ANIM_BATTLER_DEF_PARTNER 3
#define ANIM_ATTACKER 0
#define ANIM_TARGET 1
#define ANIM_ATK_PARTNER 2
#define ANIM_DEF_PARTNER 3
// stereo panning constants [0-255]
//

View File

@ -1862,7 +1862,7 @@ static void ScriptCmd_monbg(void)
sBattleAnimScriptPtr++;
animBattler = sBattleAnimScriptPtr[0];
if (animBattler & ANIM_BATTLER_TARGET)
if (animBattler & ANIM_TARGET)
battlerId = gBattleAnimTarget;
else
battlerId = gBattleAnimAttacker;
@ -2119,12 +2119,12 @@ static void ScriptCmd_clearmonbg(void)
sBattleAnimScriptPtr++;
animBattlerId = sBattleAnimScriptPtr[0];
if (animBattlerId == ANIM_BATTLER_ATTACKER)
animBattlerId = ANIM_BATTLER_ATK_PARTNER;
else if (animBattlerId == ANIM_BATTLER_TARGET)
animBattlerId = ANIM_BATTLER_DEF_PARTNER;
if (animBattlerId == ANIM_ATTACKER)
animBattlerId = ANIM_ATK_PARTNER;
else if (animBattlerId == ANIM_TARGET)
animBattlerId = ANIM_DEF_PARTNER;
if (animBattlerId == ANIM_BATTLER_ATTACKER || animBattlerId == ANIM_BATTLER_ATK_PARTNER)
if (animBattlerId == ANIM_ATTACKER || animBattlerId == ANIM_ATK_PARTNER)
battlerId = gBattleAnimAttacker;
else
battlerId = gBattleAnimTarget;
@ -2181,12 +2181,12 @@ static void ScriptCmd_monbg_22(void)
animBattlerId = sBattleAnimScriptPtr[0];
if (animBattlerId == ANIM_BATTLER_ATTACKER)
animBattlerId = ANIM_BATTLER_ATK_PARTNER;
else if (animBattlerId == ANIM_BATTLER_TARGET)
animBattlerId = ANIM_BATTLER_DEF_PARTNER;
if (animBattlerId == ANIM_ATTACKER)
animBattlerId = ANIM_ATK_PARTNER;
else if (animBattlerId == ANIM_TARGET)
animBattlerId = ANIM_DEF_PARTNER;
if (animBattlerId == ANIM_BATTLER_ATTACKER || animBattlerId == ANIM_BATTLER_ATK_PARTNER)
if (animBattlerId == ANIM_ATTACKER || animBattlerId == ANIM_ATK_PARTNER)
battlerId = gBattleAnimAttacker;
else
battlerId = gBattleAnimTarget;
@ -2226,12 +2226,12 @@ static void ScriptCmd_clearmonbg_23(void)
sBattleAnimScriptPtr++;
animBattlerId = sBattleAnimScriptPtr[0];
if (animBattlerId == ANIM_BATTLER_ATTACKER)
animBattlerId = ANIM_BATTLER_ATK_PARTNER;
else if (animBattlerId == ANIM_BATTLER_TARGET)
animBattlerId = ANIM_BATTLER_DEF_PARTNER;
if (animBattlerId == ANIM_ATTACKER)
animBattlerId = ANIM_ATK_PARTNER;
else if (animBattlerId == ANIM_TARGET)
animBattlerId = ANIM_DEF_PARTNER;
if (animBattlerId == ANIM_BATTLER_ATTACKER || animBattlerId == ANIM_BATTLER_ATK_PARTNER)
if (animBattlerId == ANIM_ATTACKER || animBattlerId == ANIM_ATK_PARTNER)
battlerId = gBattleAnimAttacker;
else
battlerId = gBattleAnimTarget;
@ -2956,7 +2956,7 @@ static void ScriptCmd_monbgprio_28(void)
wantedBattler = sBattleAnimScriptPtr[1];
sBattleAnimScriptPtr += 2;
if (wantedBattler != ANIM_BATTLER_ATTACKER)
if (wantedBattler != ANIM_ATTACKER)
battlerId = gBattleAnimTarget;
else
battlerId = gBattleAnimAttacker;
@ -2989,7 +2989,7 @@ static void ScriptCmd_monbgprio_2A(void)
sBattleAnimScriptPtr += 2;
if (GetBattlerSide(gBattleAnimAttacker) != GetBattlerSide(gBattleAnimTarget))
{
if (wantedBattler != ANIM_BATTLER_ATTACKER)
if (wantedBattler != ANIM_ATTACKER)
battlerId = gBattleAnimTarget;
else
battlerId = gBattleAnimAttacker;
@ -3036,15 +3036,15 @@ static void ScriptCmd_doublebattle_2D(void)
if (!IsContest() && IsDoubleBattle()
&& GetBattlerSide(gBattleAnimAttacker) == GetBattlerSide(gBattleAnimTarget))
{
if (wantedBattler == ANIM_BATTLER_ATTACKER)
if (wantedBattler == ANIM_ATTACKER)
{
r4 = sub_80A8364(gBattleAnimAttacker);
spriteId = GetAnimBattlerSpriteId(ANIM_BATTLER_ATTACKER);
spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
}
else
{
r4 = sub_80A8364(gBattleAnimTarget);
spriteId = GetAnimBattlerSpriteId(ANIM_BATTLER_TARGET);
spriteId = GetAnimBattlerSpriteId(ANIM_TARGET);
}
if (spriteId != 0xFF)
{
@ -3071,15 +3071,15 @@ static void ScriptCmd_doublebattle_2E(void)
if (!IsContest() && IsDoubleBattle()
&& GetBattlerSide(gBattleAnimAttacker) == GetBattlerSide(gBattleAnimTarget))
{
if (wantedBattler == ANIM_BATTLER_ATTACKER)
if (wantedBattler == ANIM_ATTACKER)
{
r4 = sub_80A8364(gBattleAnimAttacker);
spriteId = GetAnimBattlerSpriteId(ANIM_BATTLER_ATTACKER);
spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
}
else
{
r4 = sub_80A8364(gBattleAnimTarget);
spriteId = GetAnimBattlerSpriteId(ANIM_BATTLER_TARGET);
spriteId = GetAnimBattlerSpriteId(ANIM_TARGET);
}
if (spriteId != 0xFF && r4 == 2)

View File

@ -395,7 +395,7 @@ u8 GetAnimBattlerSpriteId(u8 which)
{
u8 *sprites;
if (which == ANIM_BATTLER_ATTACKER)
if (which == ANIM_ATTACKER)
{
if (IsBattlerSpritePresent(gBattleAnimAttacker))
{
@ -407,7 +407,7 @@ u8 GetAnimBattlerSpriteId(u8 which)
return 0xff;
}
}
else if (which == ANIM_BATTLER_TARGET)
else if (which == ANIM_TARGET)
{
if (IsBattlerSpritePresent(gBattleAnimTarget))
{
@ -419,7 +419,7 @@ u8 GetAnimBattlerSpriteId(u8 which)
return 0xff;
}
}
else if (which == ANIM_BATTLER_ATK_PARTNER)
else if (which == ANIM_ATK_PARTNER)
{
if (!IsBattlerSpriteVisible(BATTLE_PARTNER(gBattleAnimAttacker)))
return 0xff;
@ -1236,7 +1236,7 @@ bool8 sub_80A7238(void)
{
if (IsContest())
{
if (gSprites[GetAnimBattlerSpriteId(ANIM_BATTLER_ATTACKER)].data[2] == SPECIES_UNOWN)
if (gSprites[GetAnimBattlerSpriteId(ANIM_ATTACKER)].data[2] == SPECIES_UNOWN)
return FALSE;
else
return TRUE;
@ -2334,7 +2334,7 @@ void sub_80A8BC4(u8 taskId)
u16 dest;
struct Task *task = &gTasks[taskId];
task->data[0] = GetAnimBattlerSpriteId(ANIM_BATTLER_ATTACKER);
task->data[0] = GetAnimBattlerSpriteId(ANIM_ATTACKER);
task->data[1] = ((GetBattlerSide(gBattleAnimAttacker)) != B_SIDE_PLAYER) ? -8 : 8;
task->data[2] = 0;
task->data[3] = 0;

View File

@ -130,7 +130,7 @@ void sub_8158D8C(u8 taskId)
s8 pan = BattleAnimAdjustPanning(SOUND_PAN_ATTACKER);
if (IsContest())
{
if (gBattleAnimArgs[0] == ANIM_BATTLER_ATTACKER)
if (gBattleAnimArgs[0] == ANIM_ATTACKER)
species = gContestResources->field_18->unk0;
else
DestroyAnimVisualTask(taskId); // UB: function should return upon destroying task.
@ -140,17 +140,17 @@ void sub_8158D8C(u8 taskId)
u8 battlerId;
// Get wanted battler.
if (gBattleAnimArgs[0] == ANIM_BATTLER_ATTACKER)
if (gBattleAnimArgs[0] == ANIM_ATTACKER)
battlerId = gBattleAnimAttacker;
else if (gBattleAnimArgs[0] == ANIM_BATTLER_TARGET)
else if (gBattleAnimArgs[0] == ANIM_TARGET)
battlerId = gBattleAnimTarget;
else if (gBattleAnimArgs[0] == ANIM_BATTLER_ATK_PARTNER)
else if (gBattleAnimArgs[0] == ANIM_ATK_PARTNER)
battlerId = BATTLE_PARTNER(gBattleAnimAttacker);
else
battlerId = BATTLE_PARTNER(gBattleAnimTarget);
// Check if battler is visible.
if ((gBattleAnimArgs[0] == ANIM_BATTLER_TARGET || gBattleAnimArgs[0] == ANIM_BATTLER_DEF_PARTNER) && !IsBattlerSpriteVisible(battlerId))
if ((gBattleAnimArgs[0] == ANIM_TARGET || gBattleAnimArgs[0] == ANIM_DEF_PARTNER) && !IsBattlerSpriteVisible(battlerId))
{
DestroyAnimVisualTask(taskId);
return;
@ -176,7 +176,7 @@ void sub_8158E9C(u8 taskId)
s8 pan = BattleAnimAdjustPanning(SOUND_PAN_ATTACKER);
if (IsContest())
{
if (gBattleAnimArgs[0] == ANIM_BATTLER_ATTACKER)
if (gBattleAnimArgs[0] == ANIM_ATTACKER)
species = gContestResources->field_18->unk0;
else
DestroyAnimVisualTask(taskId); // UB: function should return upon destroying task.
@ -186,17 +186,17 @@ void sub_8158E9C(u8 taskId)
u8 battlerId;
// Get wanted battler.
if (gBattleAnimArgs[0] == ANIM_BATTLER_ATTACKER)
if (gBattleAnimArgs[0] == ANIM_ATTACKER)
battlerId = gBattleAnimAttacker;
else if (gBattleAnimArgs[0] == ANIM_BATTLER_TARGET)
else if (gBattleAnimArgs[0] == ANIM_TARGET)
battlerId = gBattleAnimTarget;
else if (gBattleAnimArgs[0] == ANIM_BATTLER_ATK_PARTNER)
else if (gBattleAnimArgs[0] == ANIM_ATK_PARTNER)
battlerId = BATTLE_PARTNER(gBattleAnimAttacker);
else
battlerId = BATTLE_PARTNER(gBattleAnimTarget);
// Check if battler is visible.
if ((gBattleAnimArgs[0] == ANIM_BATTLER_TARGET || gBattleAnimArgs[0] == ANIM_BATTLER_DEF_PARTNER) && !IsBattlerSpriteVisible(battlerId))
if ((gBattleAnimArgs[0] == ANIM_TARGET || gBattleAnimArgs[0] == ANIM_DEF_PARTNER) && !IsBattlerSpriteVisible(battlerId))
{
DestroyAnimVisualTask(taskId);
return;