Merge branch 'master' of https://github.com/pret/pokeemerald into entry_json
This commit is contained in:
@@ -49,7 +49,7 @@ u32 rfu_LMAN_REQBN_softReset_and_checkID(void)
|
||||
return id;
|
||||
}
|
||||
|
||||
void rfu_LMAN_REQ_sendData(u8 clockChangeFlag)
|
||||
void rfu_LMAN_REQ_sendData(bool8 clockChangeFlag)
|
||||
{
|
||||
if (gRfuLinkStatus->parentChild == MODE_CHILD)
|
||||
{
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
static const char AgbLibFlashVersion[] = "FLASH1M_V103";
|
||||
|
||||
const struct FlashSetupInfo * const sSetupInfos[] =
|
||||
static const struct FlashSetupInfo * const sSetupInfos[] =
|
||||
{
|
||||
&MX29L010,
|
||||
&LE26FV10N1TS,
|
||||
|
||||
+10
-10
@@ -132,9 +132,9 @@ void BufferApprenticeChallengeText(u8 saveApprenticeId)
|
||||
StringExpandPlaceholders(gStringVar4, challengeText);
|
||||
}
|
||||
|
||||
void Apprentice_EnableBothScriptContexts(void)
|
||||
void Apprentice_ScriptContext_Enable(void)
|
||||
{
|
||||
EnableBothScriptContexts();
|
||||
ScriptContext_Enable();
|
||||
}
|
||||
|
||||
void ResetApprenticeStruct(struct Apprentice *apprentice)
|
||||
@@ -638,7 +638,7 @@ static void CreateApprenticeMenu(u8 menu)
|
||||
width = ConvertPixelWidthToTileWidth(pixelWidth);
|
||||
left = ScriptMenu_AdjustLeftCoordFromWidth(left, width);
|
||||
windowId = CreateAndShowWindow(left, top, width, count * 2);
|
||||
SetStandardWindowBorderStyle(windowId, 0);
|
||||
SetStandardWindowBorderStyle(windowId, FALSE);
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
AddTextPrinterParameterized(windowId, FONT_NORMAL, strings[i], 8, (i * 16) + 1, TEXT_SKIP_DRAW, NULL);
|
||||
@@ -679,7 +679,7 @@ static void Task_ChooseAnswer(u8 taskId)
|
||||
|
||||
RemoveAndHideWindow(tWindowId);
|
||||
DestroyTask(taskId);
|
||||
EnableBothScriptContexts();
|
||||
ScriptContext_Enable();
|
||||
}
|
||||
|
||||
static u8 CreateAndShowWindow(u8 left, u8 top, u8 width, u8 height)
|
||||
@@ -815,9 +815,9 @@ static void Task_WaitForPrintingMessage(u8 taskId)
|
||||
{
|
||||
DestroyTask(taskId);
|
||||
if (gSpecialVar_0x8005)
|
||||
ExecuteFuncAfterButtonPress(EnableBothScriptContexts);
|
||||
ExecuteFuncAfterButtonPress(ScriptContext_Enable);
|
||||
else
|
||||
EnableBothScriptContexts();
|
||||
ScriptContext_Enable();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -895,7 +895,7 @@ static void PrintApprenticeMessage(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
EnableBothScriptContexts();
|
||||
ScriptContext_Enable();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -906,11 +906,11 @@ static void PrintApprenticeMessage(void)
|
||||
|
||||
static void Script_PrintApprenticeMessage(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
FreezeObjectEvents();
|
||||
PlayerFreeze();
|
||||
StopPlayerAvatar();
|
||||
DrawDialogueFrame(0, 1);
|
||||
DrawDialogueFrame(0, TRUE);
|
||||
PrintApprenticeMessage();
|
||||
}
|
||||
|
||||
@@ -1289,7 +1289,7 @@ static void Task_ExecuteFuncAfterButtonPress(u8 taskId)
|
||||
{
|
||||
if (JOY_NEW(A_BUTTON) || JOY_NEW(B_BUTTON))
|
||||
{
|
||||
gApprenticeFunc = (void*)(u32)(((u16)gTasks[taskId].data[0] | (gTasks[taskId].data[1] << 16)));
|
||||
gApprenticeFunc = (void *)(u32)(((u16)gTasks[taskId].data[0] | (gTasks[taskId].data[1] << 16)));
|
||||
gApprenticeFunc();
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
|
||||
+2
-2
@@ -7,9 +7,9 @@
|
||||
#include "data/bard_music/default_sound.h"
|
||||
#include "data/bard_music/length_table.h"
|
||||
|
||||
static s16 CalcWordPitch(int arg0, int songPos)
|
||||
static s16 CalcWordPitch(int pitchIdx, int songPos)
|
||||
{
|
||||
return sBardSoundPitchTables[arg0][songPos];
|
||||
return sBardSoundPitchTables[pitchIdx][songPos];
|
||||
}
|
||||
|
||||
const struct BardSound *GetWordSounds(u16 word)
|
||||
|
||||
@@ -351,14 +351,14 @@ void BattleAI_SetupAIData(u8 defaultScoreMoves)
|
||||
// Decide a random target battlerId in doubles.
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
||||
{
|
||||
gBattlerTarget = (Random() & BIT_FLANK) + (GetBattlerSide(gActiveBattler) ^ BIT_SIDE);
|
||||
gBattlerTarget = (Random() & BIT_FLANK) + BATTLE_OPPOSITE(GetBattlerSide(gActiveBattler));
|
||||
if (gAbsentBattlerFlags & gBitTable[gBattlerTarget])
|
||||
gBattlerTarget ^= BIT_FLANK;
|
||||
}
|
||||
// There's only one choice in single battles.
|
||||
else
|
||||
{
|
||||
gBattlerTarget = sBattler_AI ^ BIT_SIDE;
|
||||
gBattlerTarget = BATTLE_OPPOSITE(sBattler_AI);
|
||||
}
|
||||
|
||||
// Choose proper trainer ai scripts.
|
||||
@@ -541,7 +541,7 @@ static u8 ChooseMoveOrAction_Doubles(void)
|
||||
bestMovePointsForTarget[i] = mostViableMovesScores[0];
|
||||
|
||||
// Don't use a move against ally if it has less than 100 points.
|
||||
if (i == (sBattler_AI ^ BIT_FLANK) && bestMovePointsForTarget[i] < 100)
|
||||
if (i == BATTLE_PARTNER(sBattler_AI) && bestMovePointsForTarget[i] < 100)
|
||||
{
|
||||
bestMovePointsForTarget[i] = -1;
|
||||
mostViableMovesScores[0] = mostViableMovesScores[0]; // Needed to match.
|
||||
@@ -1151,9 +1151,9 @@ static u8 BattleAI_GetWantedBattler(u8 wantedBattler)
|
||||
default:
|
||||
return gBattlerTarget;
|
||||
case AI_USER_PARTNER:
|
||||
return sBattler_AI ^ BIT_FLANK;
|
||||
return BATTLE_PARTNER(sBattler_AI);
|
||||
case AI_TARGET_PARTNER:
|
||||
return gBattlerTarget ^ BIT_FLANK;
|
||||
return BATTLE_PARTNER(gBattlerTarget);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1316,7 +1316,7 @@ static void Cmd_count_usable_party_mons(void)
|
||||
{
|
||||
u32 position;
|
||||
battlerOnField1 = gBattlerPartyIndexes[battlerId];
|
||||
position = GetBattlerPosition(battlerId) ^ BIT_FLANK;
|
||||
position = BATTLE_PARTNER(GetBattlerPosition(battlerId));
|
||||
battlerOnField2 = gBattlerPartyIndexes[GetBattlerAtPosition(position)];
|
||||
}
|
||||
else // In singles there's only one battlerId by side.
|
||||
@@ -1799,7 +1799,7 @@ static void Cmd_if_has_move(void)
|
||||
gAIScriptPtr = T1_READ_PTR(gAIScriptPtr + 4);
|
||||
break;
|
||||
case AI_USER_PARTNER:
|
||||
if (gBattleMons[sBattler_AI ^ BIT_FLANK].hp == 0)
|
||||
if (gBattleMons[BATTLE_PARTNER(sBattler_AI)].hp == 0)
|
||||
{
|
||||
gAIScriptPtr += 8;
|
||||
break;
|
||||
@@ -1808,7 +1808,7 @@ static void Cmd_if_has_move(void)
|
||||
{
|
||||
for (i = 0; i < MAX_MON_MOVES; i++)
|
||||
{
|
||||
if (gBattleMons[sBattler_AI ^ BIT_FLANK].moves[i] == *movePtr)
|
||||
if (gBattleMons[BATTLE_PARTNER(sBattler_AI)].moves[i] == *movePtr)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "battle_controllers.h"
|
||||
#include "battle_main.h"
|
||||
#include "data.h"
|
||||
#include "pokemon.h"
|
||||
#include "random.h"
|
||||
@@ -66,13 +67,13 @@ static bool8 ShouldSwitchIfWonderGuard(void)
|
||||
if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TOWER_LINK_MULTI))
|
||||
{
|
||||
if ((gActiveBattler & BIT_FLANK) == B_FLANK_LEFT)
|
||||
firstId = 0, lastId = 3;
|
||||
firstId = 0, lastId = PARTY_SIZE / 2;
|
||||
else
|
||||
firstId = 3, lastId = 6;
|
||||
firstId = PARTY_SIZE / 2, lastId = PARTY_SIZE;
|
||||
}
|
||||
else
|
||||
{
|
||||
firstId = 0, lastId = 6;
|
||||
firstId = 0, lastId = PARTY_SIZE;
|
||||
}
|
||||
|
||||
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
||||
@@ -126,9 +127,9 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void)
|
||||
|
||||
if (HasSuperEffectiveMoveAgainstOpponents(TRUE) && Random() % 3 != 0)
|
||||
return FALSE;
|
||||
if (gLastLandedMoves[gActiveBattler] == 0)
|
||||
if (gLastLandedMoves[gActiveBattler] == MOVE_NONE)
|
||||
return FALSE;
|
||||
if (gLastLandedMoves[gActiveBattler] == 0xFFFF)
|
||||
if (gLastLandedMoves[gActiveBattler] == MOVE_UNAVAILABLE)
|
||||
return FALSE;
|
||||
if (gBattleMoves[gLastLandedMoves[gActiveBattler]].power == 0)
|
||||
return FALSE;
|
||||
@@ -162,13 +163,13 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void)
|
||||
if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TOWER_LINK_MULTI))
|
||||
{
|
||||
if ((gActiveBattler & BIT_FLANK) == B_FLANK_LEFT)
|
||||
firstId = 0, lastId = 3;
|
||||
firstId = 0, lastId = PARTY_SIZE / 2;
|
||||
else
|
||||
firstId = 3, lastId = 6;
|
||||
firstId = PARTY_SIZE / 2, lastId = PARTY_SIZE;
|
||||
}
|
||||
else
|
||||
{
|
||||
firstId = 0, lastId = 6;
|
||||
firstId = 0, lastId = PARTY_SIZE;
|
||||
}
|
||||
|
||||
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
||||
@@ -223,13 +224,16 @@ static bool8 ShouldSwitchIfNaturalCure(void)
|
||||
if (gBattleMons[gActiveBattler].hp < gBattleMons[gActiveBattler].maxHP / 2)
|
||||
return FALSE;
|
||||
|
||||
if ((gLastLandedMoves[gActiveBattler] == 0 || gLastLandedMoves[gActiveBattler] == 0xFFFF) && Random() & 1)
|
||||
if ((gLastLandedMoves[gActiveBattler] == MOVE_NONE
|
||||
|| gLastLandedMoves[gActiveBattler] == MOVE_UNAVAILABLE)
|
||||
&& Random() & 1)
|
||||
{
|
||||
*(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE;
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SWITCH, 0);
|
||||
return TRUE;
|
||||
}
|
||||
else if (gBattleMoves[gLastLandedMoves[gActiveBattler]].power == 0 && Random() & 1)
|
||||
else if (gBattleMoves[gLastLandedMoves[gActiveBattler]].power == 0
|
||||
&& Random() & 1)
|
||||
{
|
||||
*(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE;
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SWITCH, 0);
|
||||
@@ -331,9 +335,9 @@ static bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent)
|
||||
u16 move;
|
||||
u8 moveFlags;
|
||||
|
||||
if (gLastLandedMoves[gActiveBattler] == 0)
|
||||
if (gLastLandedMoves[gActiveBattler] == MOVE_NONE)
|
||||
return FALSE;
|
||||
if (gLastLandedMoves[gActiveBattler] == 0xFFFF)
|
||||
if (gLastLandedMoves[gActiveBattler] == MOVE_UNAVAILABLE)
|
||||
return FALSE;
|
||||
if (gLastHitBy[gActiveBattler] == 0xFF)
|
||||
return FALSE;
|
||||
@@ -357,13 +361,13 @@ static bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent)
|
||||
if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TOWER_LINK_MULTI))
|
||||
{
|
||||
if ((gActiveBattler & BIT_FLANK) == 0)
|
||||
firstId = 0, lastId = 3;
|
||||
firstId = 0, lastId = PARTY_SIZE / 2;
|
||||
else
|
||||
firstId = 3, lastId = 6;
|
||||
firstId = PARTY_SIZE / 2, lastId = PARTY_SIZE;
|
||||
}
|
||||
else
|
||||
{
|
||||
firstId = 0, lastId = 6;
|
||||
firstId = 0, lastId = PARTY_SIZE;
|
||||
}
|
||||
|
||||
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
||||
@@ -442,9 +446,7 @@ static bool8 ShouldSwitch(void)
|
||||
return FALSE;
|
||||
if (ABILITY_ON_FIELD2(ABILITY_MAGNET_PULL))
|
||||
{
|
||||
if (gBattleMons[gActiveBattler].type1 == TYPE_STEEL)
|
||||
return FALSE;
|
||||
if (gBattleMons[gActiveBattler].type2 == TYPE_STEEL)
|
||||
if (IS_BATTLER_OF_TYPE(gActiveBattler, TYPE_STEEL))
|
||||
return FALSE;
|
||||
}
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_ARENA)
|
||||
@@ -454,10 +456,10 @@ static bool8 ShouldSwitch(void)
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
||||
{
|
||||
battlerIn1 = *activeBattlerPtr;
|
||||
if (gAbsentBattlerFlags & gBitTable[GetBattlerAtPosition(GetBattlerPosition(*activeBattlerPtr) ^ BIT_FLANK)])
|
||||
if (gAbsentBattlerFlags & gBitTable[GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(*activeBattlerPtr)))])
|
||||
battlerIn2 = *activeBattlerPtr;
|
||||
else
|
||||
battlerIn2 = GetBattlerAtPosition(GetBattlerPosition(*activeBattlerPtr) ^ BIT_FLANK);
|
||||
battlerIn2 = GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(*activeBattlerPtr)));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -468,13 +470,13 @@ static bool8 ShouldSwitch(void)
|
||||
if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TOWER_LINK_MULTI))
|
||||
{
|
||||
if ((gActiveBattler & BIT_FLANK) == B_FLANK_LEFT)
|
||||
firstId = 0, lastId = 3;
|
||||
firstId = 0, lastId = PARTY_SIZE / 2;
|
||||
else
|
||||
firstId = 3, lastId = 6;
|
||||
firstId = PARTY_SIZE / 2, lastId = PARTY_SIZE;
|
||||
}
|
||||
else
|
||||
{
|
||||
firstId = 0, lastId = 6;
|
||||
firstId = 0, lastId = PARTY_SIZE;
|
||||
}
|
||||
|
||||
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
||||
@@ -553,19 +555,19 @@ void AI_TrySwitchOrUseItem(void)
|
||||
else
|
||||
{
|
||||
battlerIn1 = GetBattlerAtPosition(battlerIdentity);
|
||||
battlerIn2 = GetBattlerAtPosition(battlerIdentity ^ BIT_FLANK);
|
||||
battlerIn2 = GetBattlerAtPosition(BATTLE_PARTNER(battlerIdentity));
|
||||
}
|
||||
|
||||
if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TOWER_LINK_MULTI))
|
||||
{
|
||||
if ((gActiveBattler & BIT_FLANK) == B_FLANK_LEFT)
|
||||
firstId = 0, lastId = 3;
|
||||
firstId = 0, lastId = PARTY_SIZE / 2;
|
||||
else
|
||||
firstId = 3, lastId = 6;
|
||||
firstId = PARTY_SIZE / 2, lastId = PARTY_SIZE;
|
||||
}
|
||||
else
|
||||
{
|
||||
firstId = 0, lastId = 6;
|
||||
firstId = 0, lastId = PARTY_SIZE;
|
||||
}
|
||||
|
||||
for (monToSwitchId = firstId; monToSwitchId < lastId; monToSwitchId++)
|
||||
@@ -597,7 +599,7 @@ void AI_TrySwitchOrUseItem(void)
|
||||
}
|
||||
}
|
||||
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_USE_MOVE, (gActiveBattler ^ BIT_SIDE) << 8);
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_USE_MOVE, BATTLE_OPPOSITE(gActiveBattler) << 8);
|
||||
}
|
||||
|
||||
static void ModulateByTypeEffectiveness(u8 atkType, u8 defType1, u8 defType2, u8 *var)
|
||||
@@ -615,10 +617,10 @@ static void ModulateByTypeEffectiveness(u8 atkType, u8 defType1, u8 defType2, u8
|
||||
{
|
||||
// Check type1.
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == defType1)
|
||||
*var = (*var * TYPE_EFFECT_MULTIPLIER(i)) / 10;
|
||||
*var = (*var * TYPE_EFFECT_MULTIPLIER(i)) / TYPE_MUL_NORMAL;
|
||||
// Check type2.
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == defType2 && defType1 != defType2)
|
||||
*var = (*var * TYPE_EFFECT_MULTIPLIER(i)) / 10;
|
||||
*var = (*var * TYPE_EFFECT_MULTIPLIER(i)) / TYPE_MUL_NORMAL;
|
||||
}
|
||||
i += 3;
|
||||
}
|
||||
@@ -627,7 +629,11 @@ static void ModulateByTypeEffectiveness(u8 atkType, u8 defType1, u8 defType2, u8
|
||||
u8 GetMostSuitableMonToSwitchInto(void)
|
||||
{
|
||||
u8 opposingBattler;
|
||||
u8 bestDmg; // Note : should be changed to u32 for obvious reasons.
|
||||
#ifdef BUGFIX
|
||||
s32 bestDmg;
|
||||
#else
|
||||
u8 bestDmg; // Note: should be changed to s32 since it is also used for the actual damage done later
|
||||
#endif
|
||||
u8 bestMonId;
|
||||
u8 battlerIn1, battlerIn2;
|
||||
s32 firstId;
|
||||
@@ -645,10 +651,10 @@ u8 GetMostSuitableMonToSwitchInto(void)
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
||||
{
|
||||
battlerIn1 = gActiveBattler;
|
||||
if (gAbsentBattlerFlags & gBitTable[GetBattlerAtPosition(GetBattlerPosition(gActiveBattler) ^ BIT_FLANK)])
|
||||
if (gAbsentBattlerFlags & gBitTable[GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gActiveBattler)))])
|
||||
battlerIn2 = gActiveBattler;
|
||||
else
|
||||
battlerIn2 = GetBattlerAtPosition(GetBattlerPosition(gActiveBattler) ^ BIT_FLANK);
|
||||
battlerIn2 = GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gActiveBattler)));
|
||||
|
||||
// UB: It considers the opponent only player's side even though it can battle alongside player.
|
||||
opposingBattler = Random() & BIT_FLANK;
|
||||
@@ -657,7 +663,7 @@ u8 GetMostSuitableMonToSwitchInto(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
opposingBattler = GetBattlerAtPosition(GetBattlerPosition(gActiveBattler) ^ BIT_SIDE);
|
||||
opposingBattler = GetBattlerAtPosition(BATTLE_OPPOSITE(GetBattlerPosition(gActiveBattler)));
|
||||
battlerIn1 = gActiveBattler;
|
||||
battlerIn2 = gActiveBattler;
|
||||
}
|
||||
@@ -665,13 +671,13 @@ u8 GetMostSuitableMonToSwitchInto(void)
|
||||
if (gBattleTypeFlags & (BATTLE_TYPE_TWO_OPPONENTS | BATTLE_TYPE_TOWER_LINK_MULTI))
|
||||
{
|
||||
if ((gActiveBattler & BIT_FLANK) == B_FLANK_LEFT)
|
||||
firstId = 0, lastId = 3;
|
||||
firstId = 0, lastId = PARTY_SIZE / 2;
|
||||
else
|
||||
firstId = 3, lastId = 6;
|
||||
firstId = PARTY_SIZE / 2, lastId = PARTY_SIZE;
|
||||
}
|
||||
else
|
||||
{
|
||||
firstId = 0, lastId = 6;
|
||||
firstId = 0, lastId = PARTY_SIZE;
|
||||
}
|
||||
|
||||
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
||||
@@ -683,8 +689,8 @@ u8 GetMostSuitableMonToSwitchInto(void)
|
||||
|
||||
while (invalidMons != 0x3F) // All mons are invalid.
|
||||
{
|
||||
bestDmg = 0;
|
||||
bestMonId = 6;
|
||||
bestDmg = TYPE_MUL_NO_EFFECT;
|
||||
bestMonId = PARTY_SIZE;
|
||||
// Find the mon whose type is the most suitable offensively.
|
||||
for (i = firstId; i < lastId; i++)
|
||||
{
|
||||
@@ -699,9 +705,13 @@ u8 GetMostSuitableMonToSwitchInto(void)
|
||||
{
|
||||
u8 type1 = gBaseStats[species].type1;
|
||||
u8 type2 = gBaseStats[species].type2;
|
||||
u8 typeDmg = 10;
|
||||
u8 typeDmg = TYPE_MUL_NORMAL;
|
||||
ModulateByTypeEffectiveness(gBattleMons[opposingBattler].type1, type1, type2, &typeDmg);
|
||||
ModulateByTypeEffectiveness(gBattleMons[opposingBattler].type2, type1, type2, &typeDmg);
|
||||
|
||||
/* Possible bug: this comparison gives the type that takes the most damage, when
|
||||
a "good" AI would want to select the type that takes the least damage. Unknown if this
|
||||
is a legitimate mistake or if it's an intentional, if weird, design choice */
|
||||
if (bestDmg < typeDmg)
|
||||
{
|
||||
bestDmg = typeDmg;
|
||||
|
||||
+13
-13
@@ -676,13 +676,13 @@ void MoveBattlerSpriteToBG(u8 battlerId, bool8 toBG_2, bool8 setSpriteInvisible)
|
||||
|
||||
if (IsContest() == TRUE)
|
||||
{
|
||||
RequestDma3Fill(0, (void*)(BG_SCREEN_ADDR(16)), 0x2000, 1);
|
||||
RequestDma3Fill(0xFF, (void*)(BG_SCREEN_ADDR(30)), 0x1000, 0);
|
||||
RequestDma3Fill(0, (void *)(BG_SCREEN_ADDR(16)), 0x2000, 1);
|
||||
RequestDma3Fill(0xFF, (void *)(BG_SCREEN_ADDR(30)), 0x1000, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
RequestDma3Fill(0, (void*)(BG_SCREEN_ADDR(8)), 0x2000, 1);
|
||||
RequestDma3Fill(0xFF, (void*)(BG_SCREEN_ADDR(28)), 0x1000, 0);
|
||||
RequestDma3Fill(0, (void *)(BG_SCREEN_ADDR(8)), 0x2000, 1);
|
||||
RequestDma3Fill(0xFF, (void *)(BG_SCREEN_ADDR(28)), 0x1000, 0);
|
||||
}
|
||||
|
||||
GetBattleAnimBg1Data(&animBg);
|
||||
@@ -707,7 +707,7 @@ void MoveBattlerSpriteToBG(u8 battlerId, bool8 toBG_2, bool8 setSpriteInvisible)
|
||||
SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y);
|
||||
|
||||
LoadPalette(&gPlttBufferUnfaded[0x100 + battlerId * 16], animBg.paletteId * 16, 0x20);
|
||||
CpuCopy32(&gPlttBufferUnfaded[0x100 + battlerId * 16], (void*)(BG_PLTT + animBg.paletteId * 32), 0x20);
|
||||
CpuCopy32(&gPlttBufferUnfaded[0x100 + battlerId * 16], (void *)(BG_PLTT + animBg.paletteId * 32), 0x20);
|
||||
|
||||
if (IsContest())
|
||||
battlerPosition = 0;
|
||||
@@ -721,8 +721,8 @@ void MoveBattlerSpriteToBG(u8 battlerId, bool8 toBG_2, bool8 setSpriteInvisible)
|
||||
}
|
||||
else
|
||||
{
|
||||
RequestDma3Fill(0, (void*)(BG_SCREEN_ADDR(12)), 0x2000, 1);
|
||||
RequestDma3Fill(0, (void*)(BG_SCREEN_ADDR(30)), 0x1000, 1);
|
||||
RequestDma3Fill(0, (void *)(BG_SCREEN_ADDR(12)), 0x2000, 1);
|
||||
RequestDma3Fill(0, (void *)(BG_SCREEN_ADDR(30)), 0x1000, 1);
|
||||
GetBattleAnimBgData(&animBg, 2);
|
||||
CpuFill16(0, animBg.bgTiles + 0x1000, 0x1000);
|
||||
CpuFill16(0, animBg.bgTilemap + 0x400, 0x800);
|
||||
@@ -742,7 +742,7 @@ void MoveBattlerSpriteToBG(u8 battlerId, bool8 toBG_2, bool8 setSpriteInvisible)
|
||||
SetGpuReg(REG_OFFSET_BG2VOFS, gBattle_BG2_Y);
|
||||
|
||||
LoadPalette(&gPlttBufferUnfaded[0x100 + battlerId * 16], 0x90, 0x20);
|
||||
CpuCopy32(&gPlttBufferUnfaded[0x100 + battlerId * 16], (void*)(BG_PLTT + 0x120), 0x20);
|
||||
CpuCopy32(&gPlttBufferUnfaded[0x100 + battlerId * 16], (void *)(BG_PLTT + 0x120), 0x20);
|
||||
|
||||
DrawBattlerOnBg(2, 0, 0, GetBattlerPosition(battlerId), animBg.paletteId, animBg.bgTiles + 0x1000, animBg.bgTilemap + 0x400, animBg.tilesOffset);
|
||||
}
|
||||
@@ -883,7 +883,7 @@ static void Cmd_clearmonbg(void)
|
||||
if (sMonAnimTaskIdArray[0] != TASK_NONE)
|
||||
gSprites[gBattlerSpriteIds[battlerId]].invisible = FALSE;
|
||||
if (animBattlerId > 1 && sMonAnimTaskIdArray[1] != TASK_NONE)
|
||||
gSprites[gBattlerSpriteIds[battlerId ^ BIT_FLANK]].invisible = FALSE;
|
||||
gSprites[gBattlerSpriteIds[BATTLE_PARTNER(battlerId)]].invisible = FALSE;
|
||||
else
|
||||
animBattlerId = 0;
|
||||
|
||||
@@ -990,8 +990,8 @@ static void Cmd_clearmonbg_static(void)
|
||||
|
||||
if (IsBattlerSpriteVisible(battlerId))
|
||||
gSprites[gBattlerSpriteIds[battlerId]].invisible = FALSE;
|
||||
if (animBattlerId > 1 && IsBattlerSpriteVisible(battlerId ^ BIT_FLANK))
|
||||
gSprites[gBattlerSpriteIds[battlerId ^ BIT_FLANK]].invisible = FALSE;
|
||||
if (animBattlerId > 1 && IsBattlerSpriteVisible(BATTLE_PARTNER(battlerId)))
|
||||
gSprites[gBattlerSpriteIds[BATTLE_PARTNER(battlerId)]].invisible = FALSE;
|
||||
else
|
||||
animBattlerId = 0;
|
||||
|
||||
@@ -1017,7 +1017,7 @@ static void Task_ClearMonBgStatic(u8 taskId)
|
||||
|
||||
if (IsBattlerSpriteVisible(battlerId))
|
||||
ResetBattleAnimBg(toBG_2);
|
||||
if (gTasks[taskId].data[0] > 1 && IsBattlerSpriteVisible(battlerId ^ BIT_FLANK))
|
||||
if (gTasks[taskId].data[0] > 1 && IsBattlerSpriteVisible(BATTLE_PARTNER(battlerId)))
|
||||
ResetBattleAnimBg(toBG_2 ^ 1);
|
||||
|
||||
DestroyTask(taskId);
|
||||
@@ -1203,7 +1203,7 @@ static void LoadMoveBg(u16 bgId)
|
||||
void *dmaDest;
|
||||
|
||||
LZDecompressWram(tilemap, gDecompressionBuffer);
|
||||
RelocateBattleBgPal(GetBattleBgPaletteNum(), (void*)gDecompressionBuffer, 0x100, FALSE);
|
||||
RelocateBattleBgPal(GetBattleBgPaletteNum(), (void *)gDecompressionBuffer, 0x100, FALSE);
|
||||
dmaSrc = gDecompressionBuffer;
|
||||
dmaDest = (void *)BG_SCREEN_ADDR(26);
|
||||
DmaCopy32(3, dmaSrc, dmaDest, 0x800);
|
||||
|
||||
@@ -203,7 +203,7 @@ static void AnimMegahornHorn(struct Sprite *sprite)
|
||||
gBattleAnimArgs[2] = -gBattleAnimArgs[2];
|
||||
gBattleAnimArgs[0] = -gBattleAnimArgs[0];
|
||||
}
|
||||
else if (!GetBattlerSide(gBattleAnimTarget))
|
||||
else if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER)
|
||||
{
|
||||
StartSpriteAffineAnim(sprite, 1);
|
||||
gBattleAnimArgs[1] = -gBattleAnimArgs[1];
|
||||
@@ -230,7 +230,7 @@ static void AnimLeechLifeNeedle(struct Sprite *sprite)
|
||||
gBattleAnimArgs[0] = -gBattleAnimArgs[0];
|
||||
StartSpriteAffineAnim(sprite, 2);
|
||||
}
|
||||
else if (!GetBattlerSide(gBattleAnimTarget))
|
||||
else if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER)
|
||||
{
|
||||
gBattleAnimArgs[1] = -gBattleAnimArgs[1];
|
||||
gBattleAnimArgs[0] = -gBattleAnimArgs[0];
|
||||
@@ -271,7 +271,7 @@ static void AnimTranslateWebThread(struct Sprite *sprite)
|
||||
}
|
||||
else
|
||||
{
|
||||
SetAverageBattlerPositions(gBattleAnimTarget, 1, &sprite->data[2], &sprite->data[4]);
|
||||
SetAverageBattlerPositions(gBattleAnimTarget, TRUE, &sprite->data[2], &sprite->data[4]);
|
||||
}
|
||||
|
||||
InitAnimLinearTranslationWithSpeed(sprite);
|
||||
@@ -294,14 +294,14 @@ static void AnimTranslateWebThread_Step(struct Sprite *sprite)
|
||||
// Second stage of String Shot
|
||||
static void AnimStringWrap(struct Sprite *sprite)
|
||||
{
|
||||
SetAverageBattlerPositions(gBattleAnimTarget, 0, &sprite->x, &sprite->y);
|
||||
SetAverageBattlerPositions(gBattleAnimTarget, FALSE, &sprite->x, &sprite->y);
|
||||
if (GetBattlerSide(gBattleAnimAttacker))
|
||||
sprite->x -= gBattleAnimArgs[0];
|
||||
else
|
||||
sprite->x += gBattleAnimArgs[0];
|
||||
|
||||
sprite->y += gBattleAnimArgs[1];
|
||||
if (!GetBattlerSide(gBattleAnimTarget))
|
||||
if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER)
|
||||
sprite->y += 8;
|
||||
|
||||
sprite->callback = AnimStringWrap_Step;
|
||||
@@ -392,7 +392,7 @@ static void AnimTranslateStinger(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
InitSpritePosToAnimAttacker(sprite, 1);
|
||||
InitSpritePosToAnimAttacker(sprite, TRUE);
|
||||
|
||||
lVarX = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + gBattleAnimArgs[2];
|
||||
lVarY = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + gBattleAnimArgs[3];
|
||||
@@ -417,7 +417,7 @@ static void AnimTranslateStinger(struct Sprite *sprite)
|
||||
// arg 5: wave amplitude
|
||||
static void AnimMissileArc(struct Sprite *sprite)
|
||||
{
|
||||
InitSpritePosToAnimAttacker(sprite, 1);
|
||||
InitSpritePosToAnimAttacker(sprite, TRUE);
|
||||
|
||||
if (GetBattlerSide(gBattleAnimAttacker))
|
||||
gBattleAnimArgs[2] = -gBattleAnimArgs[2];
|
||||
|
||||
@@ -426,7 +426,7 @@ void AnimTask_MoveAttackerMementoShadow(u8 taskId)
|
||||
GetBattleAnimBg1Data(&animBg);
|
||||
task->data[10] = gBattle_BG1_Y;
|
||||
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG1);
|
||||
FillPalette(0, animBg.paletteId * 16, 32);
|
||||
FillPalette(RGB_BLACK, animBg.paletteId * 16, 32);
|
||||
scanlineParams.dmaDest = ®_BG1VOFS;
|
||||
var0 = WINOUT_WIN01_BG1;
|
||||
if (!IsContest())
|
||||
@@ -436,7 +436,7 @@ void AnimTask_MoveAttackerMementoShadow(u8 taskId)
|
||||
{
|
||||
task->data[10] = gBattle_BG2_Y;
|
||||
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG2);
|
||||
FillPalette(0, 144, 32);
|
||||
FillPalette(RGB_BLACK, 144, 32);
|
||||
scanlineParams.dmaDest = ®_BG2VOFS;
|
||||
var0 = WINOUT_WIN01_BG2;
|
||||
if (!IsContest())
|
||||
@@ -566,12 +566,12 @@ void AnimTask_MoveTargetMementoShadow(u8 taskId)
|
||||
{
|
||||
GetBattleAnimBg1Data(&animBg);
|
||||
task->data[10] = gBattle_BG1_Y;
|
||||
FillPalette(0, animBg.paletteId * 16, 32);
|
||||
FillPalette(RGB_BLACK, animBg.paletteId * 16, 32);
|
||||
}
|
||||
else
|
||||
{
|
||||
task->data[10] = gBattle_BG2_Y;
|
||||
FillPalette(0, 9 * 16, 32);
|
||||
FillPalette(RGB_BLACK, 9 * 16, 32);
|
||||
}
|
||||
|
||||
SetAllBattlersSpritePriority(3);
|
||||
@@ -777,8 +777,8 @@ void AnimTask_InitMementoShadow(u8 taskId)
|
||||
|
||||
if (IsBattlerSpriteVisible(BATTLE_PARTNER(gBattleAnimAttacker)))
|
||||
{
|
||||
MoveBattlerSpriteToBG(gBattleAnimAttacker ^ 2, toBG2 ^ 1, TRUE);
|
||||
gSprites[gBattlerSpriteIds[gBattleAnimAttacker ^ 2]].invisible = FALSE;
|
||||
MoveBattlerSpriteToBG(BATTLE_PARTNER(gBattleAnimAttacker), toBG2 ^ 1, TRUE);
|
||||
gSprites[gBattlerSpriteIds[BATTLE_PARTNER(gBattleAnimAttacker)]].invisible = FALSE;
|
||||
}
|
||||
|
||||
DestroyAnimVisualTask(taskId);
|
||||
@@ -786,7 +786,7 @@ void AnimTask_InitMementoShadow(u8 taskId)
|
||||
|
||||
void AnimTask_MementoHandleBg(u8 taskId)
|
||||
{
|
||||
u8 toBG2 = GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) ^ 1 ? 1 : 0;
|
||||
bool8 toBG2 = GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) ^ 1 ? TRUE : FALSE;
|
||||
ResetBattleAnimBg(toBG2);
|
||||
|
||||
if (IsBattlerSpriteVisible(BATTLE_PARTNER(gBattleAnimAttacker)))
|
||||
|
||||
@@ -15,7 +15,7 @@ static void AnimOverheatFlame_Step(struct Sprite *);
|
||||
static void AnimTask_DragonDanceWaver_Step(u8);
|
||||
static void UpdateDragonDanceScanlineEffect(struct Task *);
|
||||
|
||||
EWRAM_DATA static u16 gUnusedOverheatData[7] = {0};
|
||||
EWRAM_DATA static u16 sUnusedOverheatData[7] = {0};
|
||||
|
||||
static const union AnimCmd sAnim_OutrageOverheatFire_0[] =
|
||||
{
|
||||
@@ -426,7 +426,7 @@ static void AnimOverheatFlame(struct Sprite *sprite)
|
||||
sprite->data[3] = gBattleAnimArgs[3];
|
||||
sprite->callback = AnimOverheatFlame_Step;
|
||||
for (i = 0; i < 7; i++)
|
||||
gUnusedOverheatData[i] = sprite->data[i];
|
||||
sUnusedOverheatData[i] = sprite->data[i];
|
||||
}
|
||||
|
||||
static void AnimOverheatFlame_Step(struct Sprite *sprite)
|
||||
|
||||
+197
-189
File diff suppressed because it is too large
Load Diff
+34
-37
@@ -1534,7 +1534,7 @@ static void AnimAirWaveProjectile_Step2(struct Sprite *sprite)
|
||||
|
||||
static void AnimAirWaveProjectile_Step1(struct Sprite *sprite)
|
||||
{
|
||||
struct Task* task = &gTasks[sprite->data[7]];
|
||||
struct Task *task = &gTasks[sprite->data[7]];
|
||||
if (sprite->data[0] > task->data[5])
|
||||
{
|
||||
sprite->data[5] += sprite->data[3];
|
||||
@@ -1571,7 +1571,7 @@ static void AnimAirWaveProjectile(struct Sprite *sprite)
|
||||
s16 b;
|
||||
s16 c;
|
||||
|
||||
struct Task* task = &gTasks[sprite->data[7]];
|
||||
struct Task *task = &gTasks[sprite->data[7]];
|
||||
sprite->data[1] += (-2 & task->data[7]);
|
||||
sprite->data[2] += (-2 & task->data[8]);
|
||||
if (1 & task->data[7])
|
||||
@@ -1642,7 +1642,7 @@ static void AirCutterProjectileStep1(u8 taskId)
|
||||
gTasks[taskId].data[gTasks[taskId].data[1] + 13] = spriteId;
|
||||
gTasks[taskId].data[0] = gTasks[taskId].data[3];
|
||||
gTasks[taskId].data[1]++;
|
||||
PlaySE12WithPanning(SE_M_BLIZZARD2, BattleAnimAdjustPanning(-63));
|
||||
PlaySE12WithPanning(SE_M_BLIZZARD2, BattleAnimAdjustPanning(SOUND_PAN_ATTACKER + 1));
|
||||
if (gTasks[taskId].data[1] > 2)
|
||||
gTasks[taskId].func = AirCutterProjectileStep2;
|
||||
}
|
||||
@@ -1667,7 +1667,7 @@ void AnimTask_AirCutterProjectile(u8 taskId)
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((gBattlerPositions[gBattleAnimTarget] & BIT_SIDE) == B_SIDE_PLAYER)
|
||||
if (GET_BATTLER_SIDE2(gBattleAnimTarget) == B_SIDE_PLAYER)
|
||||
{
|
||||
gTasks[taskId].data[4] = 1;
|
||||
gBattleAnimArgs[0] = -gBattleAnimArgs[0];
|
||||
@@ -1684,7 +1684,7 @@ void AnimTask_AirCutterProjectile(u8 taskId)
|
||||
if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
||||
&& IsBattlerSpriteVisible(BATTLE_PARTNER(gBattleAnimTarget)))
|
||||
{
|
||||
SetAverageBattlerPositions(gBattleAnimTarget, 0, &targetX, &targetY);
|
||||
SetAverageBattlerPositions(gBattleAnimTarget, FALSE, &targetX, &targetY);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1838,8 +1838,8 @@ static void AnimBulletSeed_Step1(struct Sprite *sprite)
|
||||
{
|
||||
int i;
|
||||
u16 rand;
|
||||
s16* ptr;
|
||||
PlaySE12WithPanning(SE_M_HORN_ATTACK, BattleAnimAdjustPanning(63));
|
||||
s16 *ptr;
|
||||
PlaySE12WithPanning(SE_M_HORN_ATTACK, BattleAnimAdjustPanning(SOUND_PAN_TARGET));
|
||||
sprite->x += sprite->x2;
|
||||
sprite->y += sprite->y2;
|
||||
sprite->y2 = 0;
|
||||
@@ -2035,7 +2035,7 @@ static void AnimTask_GrowAndGrayscale_Step(u8 taskId)
|
||||
// No args.
|
||||
void AnimTask_Minimize(u8 taskId)
|
||||
{
|
||||
struct Task* task = &gTasks[taskId];
|
||||
struct Task *task = &gTasks[taskId];
|
||||
u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
|
||||
task->data[0] = spriteId;
|
||||
PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_NORMAL);
|
||||
@@ -2051,7 +2051,7 @@ void AnimTask_Minimize(u8 taskId)
|
||||
|
||||
static void AnimTask_Minimize_Step(u8 taskId)
|
||||
{
|
||||
struct Task* task = &gTasks[taskId];
|
||||
struct Task *task = &gTasks[taskId];
|
||||
switch (task->data[1])
|
||||
{
|
||||
case 0:
|
||||
@@ -2115,7 +2115,7 @@ static void AnimTask_Minimize_Step(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
static void CreateMinimizeSprite(struct Task* task, u8 taskId)
|
||||
static void CreateMinimizeSprite(struct Task *task, u8 taskId)
|
||||
{
|
||||
u16 matrixNum;
|
||||
s16 spriteId = CloneBattlerSpriteWithBlend(ANIM_ATTACKER);
|
||||
@@ -2160,7 +2160,7 @@ static void ClonedMinizeSprite_Step(struct Sprite *sprite)
|
||||
// arg 1: num hops
|
||||
void AnimTask_Splash(u8 taskId)
|
||||
{
|
||||
struct Task* task = &gTasks[taskId];
|
||||
struct Task *task = &gTasks[taskId];
|
||||
if (gBattleAnimArgs[1] == 0)
|
||||
{
|
||||
DestroyAnimVisualTask(taskId);
|
||||
@@ -2180,7 +2180,7 @@ void AnimTask_Splash(u8 taskId)
|
||||
|
||||
static void AnimTask_Splash_Step(u8 taskId)
|
||||
{
|
||||
struct Task* task = &gTasks[taskId];
|
||||
struct Task *task = &gTasks[taskId];
|
||||
switch (task->data[1])
|
||||
{
|
||||
case 0:
|
||||
@@ -2234,7 +2234,7 @@ static void AnimTask_Splash_Step(u8 taskId)
|
||||
// No args.
|
||||
void AnimTask_GrowAndShrink(u8 taskId)
|
||||
{
|
||||
struct Task* task = &gTasks[taskId];
|
||||
struct Task *task = &gTasks[taskId];
|
||||
u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
|
||||
PrepareAffineAnimInTaskData(task, spriteId, gGrowAndShrinkAffineAnimCmds);
|
||||
task->func = AnimTask_GrowAndShrink_Step;
|
||||
@@ -2242,7 +2242,7 @@ void AnimTask_GrowAndShrink(u8 taskId)
|
||||
|
||||
static void AnimTask_GrowAndShrink_Step(u8 taskId)
|
||||
{
|
||||
struct Task* task = &gTasks[taskId];
|
||||
struct Task *task = &gTasks[taskId];
|
||||
if (!RunAffineAnimFromTaskData(task))
|
||||
DestroyAnimVisualTask(taskId);
|
||||
}
|
||||
@@ -2301,7 +2301,7 @@ static void AnimAngerMark(struct Sprite *sprite)
|
||||
// left/right movements
|
||||
void AnimTask_ThrashMoveMonHorizontal(u8 taskId)
|
||||
{
|
||||
struct Task* task = &gTasks[taskId];
|
||||
struct Task *task = &gTasks[taskId];
|
||||
u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
|
||||
task->data[0] = spriteId;
|
||||
task->data[1] = 0;
|
||||
@@ -2311,7 +2311,7 @@ void AnimTask_ThrashMoveMonHorizontal(u8 taskId)
|
||||
|
||||
static void AnimTask_ThrashMoveMonHorizontal_Step(u8 taskId)
|
||||
{
|
||||
struct Task* task = &gTasks[taskId];
|
||||
struct Task *task = &gTasks[taskId];
|
||||
if (!RunAffineAnimFromTaskData(task))
|
||||
DestroyAnimVisualTask(taskId);
|
||||
}
|
||||
@@ -2319,7 +2319,7 @@ static void AnimTask_ThrashMoveMonHorizontal_Step(u8 taskId)
|
||||
// up/down movements
|
||||
void AnimTask_ThrashMoveMonVertical(u8 taskId)
|
||||
{
|
||||
struct Task* task = &gTasks[taskId];
|
||||
struct Task *task = &gTasks[taskId];
|
||||
task->data[0] = GetAnimBattlerSpriteId(ANIM_ATTACKER);
|
||||
task->data[1] = 0;
|
||||
task->data[2] = 4;
|
||||
@@ -2338,7 +2338,7 @@ void AnimTask_ThrashMoveMonVertical(u8 taskId)
|
||||
|
||||
static void AnimTask_ThrashMoveMonVertical_Step(u8 taskId)
|
||||
{
|
||||
struct Task* task = &gTasks[taskId];
|
||||
struct Task *task = &gTasks[taskId];
|
||||
if (++task->data[7] > 2)
|
||||
{
|
||||
task->data[7] = 0;
|
||||
@@ -2389,7 +2389,7 @@ static void AnimTask_ThrashMoveMonVertical_Step(u8 taskId)
|
||||
|
||||
void AnimTask_SketchDrawMon(u8 taskId)
|
||||
{
|
||||
struct Task* task = &gTasks[taskId];
|
||||
struct Task *task = &gTasks[taskId];
|
||||
struct ScanlineEffectParams params;
|
||||
|
||||
s16 i;
|
||||
@@ -2430,7 +2430,7 @@ void AnimTask_SketchDrawMon(u8 taskId)
|
||||
|
||||
static void AnimTask_SketchDrawMon_Step(u8 taskId)
|
||||
{
|
||||
struct Task* task = &gTasks[taskId];
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
switch (task->data[4])
|
||||
{
|
||||
@@ -2485,7 +2485,7 @@ static void AnimPencil(struct Sprite *sprite)
|
||||
sprite->data[3] = 16;
|
||||
sprite->data[4] = 0;
|
||||
sprite->data[5] = GetBattlerSpriteCoordAttr(gBattleAnimTarget, BATTLER_COORD_ATTR_HEIGHT) + 2;
|
||||
sprite->data[6] = BattleAnimAdjustPanning(63);
|
||||
sprite->data[6] = BattleAnimAdjustPanning(SOUND_PAN_TARGET);
|
||||
sprite->callback = AnimPencil_Step;
|
||||
}
|
||||
|
||||
@@ -2791,7 +2791,7 @@ static void AnimSoftBoiledEgg_Step4_Callback(struct Sprite *sprite)
|
||||
// Used by Extremespeed
|
||||
void AnimTask_AttackerStretchAndDisappear(u8 taskId)
|
||||
{
|
||||
struct Task* task = &gTasks[taskId];
|
||||
struct Task *task = &gTasks[taskId];
|
||||
u8 spriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
|
||||
task->data[0] = spriteId;
|
||||
PrepareAffineAnimInTaskData(task, spriteId, gStretchAttackerAffineAnimCmds);
|
||||
@@ -2800,7 +2800,7 @@ void AnimTask_AttackerStretchAndDisappear(u8 taskId)
|
||||
|
||||
static void AnimTask_AttackerStretchAndDisappear_Step(u8 taskId)
|
||||
{
|
||||
struct Task* task = &gTasks[taskId];
|
||||
struct Task *task = &gTasks[taskId];
|
||||
if (!RunAffineAnimFromTaskData(task))
|
||||
{
|
||||
gSprites[task->data[0]].y2 = 0;
|
||||
@@ -2811,7 +2811,7 @@ static void AnimTask_AttackerStretchAndDisappear_Step(u8 taskId)
|
||||
|
||||
void AnimTask_ExtremeSpeedImpact(u8 taskId)
|
||||
{
|
||||
struct Task* task = &gTasks[taskId];
|
||||
struct Task *task = &gTasks[taskId];
|
||||
task->data[0] = 0;
|
||||
task->data[1] = 0;
|
||||
task->data[2] = 0;
|
||||
@@ -2834,7 +2834,7 @@ void AnimTask_ExtremeSpeedImpact(u8 taskId)
|
||||
|
||||
static void AnimTask_ExtremeSpeedImpact_Step(u8 taskId)
|
||||
{
|
||||
struct Task* task = &gTasks[taskId];
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
switch (task->data[0])
|
||||
{
|
||||
@@ -2880,7 +2880,7 @@ static void AnimTask_ExtremeSpeedImpact_Step(u8 taskId)
|
||||
|
||||
void AnimTask_ExtremeSpeedMonReappear(u8 taskId)
|
||||
{
|
||||
struct Task* task = &gTasks[taskId];
|
||||
struct Task *task = &gTasks[taskId];
|
||||
task->data[0] = 0;
|
||||
task->data[1] = 0;
|
||||
task->data[2] = 0;
|
||||
@@ -2894,7 +2894,7 @@ void AnimTask_ExtremeSpeedMonReappear(u8 taskId)
|
||||
|
||||
static void AnimTask_ExtremeSpeedMonReappear_Step(u8 taskId)
|
||||
{
|
||||
struct Task* task = &gTasks[taskId];
|
||||
struct Task *task = &gTasks[taskId];
|
||||
if (task->data[0] == 0 && ++task->data[1] > task->data[4])
|
||||
{
|
||||
task->data[1] = 0;
|
||||
@@ -2922,7 +2922,7 @@ static void AnimTask_ExtremeSpeedMonReappear_Step(u8 taskId)
|
||||
|
||||
void AnimTask_SpeedDust(u8 taskId)
|
||||
{
|
||||
struct Task* task = &gTasks[taskId];
|
||||
struct Task *task = &gTasks[taskId];
|
||||
task->data[0] = 0;
|
||||
task->data[1] = 4;
|
||||
task->data[2] = 0;
|
||||
@@ -2940,7 +2940,7 @@ void AnimTask_SpeedDust(u8 taskId)
|
||||
|
||||
static void AnimTask_SpeedDust_Step(u8 taskId)
|
||||
{
|
||||
struct Task* task = &gTasks[taskId];
|
||||
struct Task *task = &gTasks[taskId];
|
||||
switch (task->data[8])
|
||||
{
|
||||
case 0:
|
||||
@@ -3043,9 +3043,7 @@ void AnimTask_FreeMusicNotesPals(u8 taskId)
|
||||
|
||||
static void SetMusicNotePalette(struct Sprite *sprite, u8 a, u8 b)
|
||||
{
|
||||
u8 tile;
|
||||
tile = (b & 1);
|
||||
tile = ((-tile | tile) >> 31) & 32;
|
||||
u8 tile = (b & 1) ? 32 : 0;
|
||||
sprite->oam.tileNum += tile + (a << 2);
|
||||
sprite->oam.paletteNum = IndexOfSpritePaletteTag(sMusicNotePaletteTagsTable[b >> 1]);
|
||||
}
|
||||
@@ -3116,7 +3114,7 @@ static void AnimTask_FakeOut_Step2(u8 taskId)
|
||||
{
|
||||
gTasks[taskId].data[11] = 0x88;
|
||||
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG3 | BLDCNT_EFFECT_LIGHTEN);
|
||||
BlendPalettes(GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0), 16, RGB(31, 31, 31));
|
||||
BlendPalettes(GetBattlePalettesMask(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE), 16, RGB(31, 31, 31));
|
||||
}
|
||||
else if (gTasks[taskId].data[10] > 4)
|
||||
{
|
||||
@@ -3720,7 +3718,7 @@ static void AnimPerishSongMusicNote2(struct Sprite *sprite)
|
||||
}
|
||||
|
||||
if (++sprite->data[0] == sprite->data[1])
|
||||
SetGrayscaleOrOriginalPalette(sprite->oam.paletteNum + 16, 0);
|
||||
SetGrayscaleOrOriginalPalette(sprite->oam.paletteNum + 16, FALSE);
|
||||
|
||||
if (sprite->data[0] == sprite->data[1] + 80)
|
||||
DestroyAnimSprite(sprite);
|
||||
@@ -3792,8 +3790,7 @@ static void AnimPerishSongMusicNote_Step2(struct Sprite *sprite)
|
||||
|
||||
if (sprite->data[4] > 3)
|
||||
{
|
||||
int var1 = sprite->data[2];
|
||||
sprite->invisible = var1 - (((s32)(var1 + ((u32)var1 >> 31)) >> 1) << 1);
|
||||
sprite->invisible = sprite->data[2] % 2;
|
||||
DestroyAnimSprite(sprite);
|
||||
}
|
||||
|
||||
@@ -3807,7 +3804,7 @@ static void AnimGuardRing(struct Sprite *sprite)
|
||||
{
|
||||
if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && IsBattlerSpriteVisible(BATTLE_PARTNER(gBattleAnimAttacker)))
|
||||
{
|
||||
SetAverageBattlerPositions(gBattleAnimAttacker, 0, &sprite->x, &sprite->y);
|
||||
SetAverageBattlerPositions(gBattleAnimAttacker, FALSE, &sprite->x, &sprite->y);
|
||||
sprite->y += 40;
|
||||
|
||||
StartSpriteAffineAnim(sprite, 1);
|
||||
|
||||
+181
-104
@@ -1213,7 +1213,7 @@ void AnimTask_SmokescreenImpact(u8 taskId)
|
||||
SmokescreenImpact(
|
||||
GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2) + 8,
|
||||
GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET) + 8,
|
||||
0);
|
||||
FALSE);
|
||||
DestroyAnimVisualTask(taskId);
|
||||
}
|
||||
|
||||
@@ -1646,7 +1646,7 @@ static void AnimClappingHand_Step(struct Sprite *sprite)
|
||||
sprite->data[2]++;
|
||||
if (sprite->data[3] == 0)
|
||||
{
|
||||
PlaySE1WithPanning(SE_M_ENCORE, BattleAnimAdjustPanning(-64));
|
||||
PlaySE1WithPanning(SE_M_ENCORE, BattleAnimAdjustPanning(SOUND_PAN_ATTACKER));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1930,7 +1930,7 @@ static void TormentAttacker_Step(u8 taskId)
|
||||
|
||||
y = task->data[3] + task->data[5];
|
||||
spriteId = CreateSprite(&gThoughtBubbleSpriteTemplate, x, y, 6 - task->data[1]);
|
||||
PlaySE12WithPanning(SE_M_METRONOME, BattleAnimAdjustPanning(-64));
|
||||
PlaySE12WithPanning(SE_M_METRONOME, BattleAnimAdjustPanning(SOUND_PAN_ATTACKER));
|
||||
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
@@ -2107,7 +2107,7 @@ static void AnimWishStar(struct Sprite *sprite)
|
||||
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
|
||||
sprite->x = -16;
|
||||
else
|
||||
sprite->x = 256;
|
||||
sprite->x = DISPLAY_WIDTH + 16;
|
||||
|
||||
sprite->y = 0;
|
||||
sprite->callback = AnimWishStar_Step;
|
||||
@@ -2136,7 +2136,7 @@ static void AnimWishStar_Step(struct Sprite *sprite)
|
||||
}
|
||||
|
||||
newX = sprite->x + sprite->x2 + 32;
|
||||
if (newX > 304)
|
||||
if (newX > DISPLAY_WIDTH + 64)
|
||||
DestroyAnimSprite(sprite);
|
||||
}
|
||||
|
||||
@@ -2411,7 +2411,7 @@ void AnimTask_MorningSunLightBeam(u8 taskId)
|
||||
gTasks[taskId].data[11] = gBattle_BG1_Y;
|
||||
|
||||
gTasks[taskId].data[0]++;
|
||||
PlaySE12WithPanning(SE_M_MORNING_SUN, BattleAnimAdjustPanning(-64));
|
||||
PlaySE12WithPanning(SE_M_MORNING_SUN, BattleAnimAdjustPanning(SOUND_PAN_ATTACKER));
|
||||
break;
|
||||
case 1:
|
||||
if (gTasks[taskId].data[4]++ > 0)
|
||||
@@ -2446,7 +2446,7 @@ void AnimTask_MorningSunLightBeam(u8 taskId)
|
||||
{
|
||||
gTasks[taskId].data[3] = 0;
|
||||
gTasks[taskId].data[0] = 1;
|
||||
PlaySE12WithPanning(SE_M_MORNING_SUN, BattleAnimAdjustPanning(-64));
|
||||
PlaySE12WithPanning(SE_M_MORNING_SUN, BattleAnimAdjustPanning(SOUND_PAN_ATTACKER));
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
@@ -2677,7 +2677,7 @@ static void AnimWeakFrustrationAngerMark(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->data[0] == 0)
|
||||
{
|
||||
InitSpritePosToAnimAttacker(sprite, 0);
|
||||
InitSpritePosToAnimAttacker(sprite, FALSE);
|
||||
sprite->data[0]++;
|
||||
}
|
||||
else if (sprite->data[0]++ > 20)
|
||||
@@ -3183,7 +3183,7 @@ static void AnimReversalOrb_Step(struct Sprite *sprite)
|
||||
// Copies the target mon's sprite, and makes a white silhouette that shrinks away.
|
||||
void AnimTask_RolePlaySilhouette(u8 taskId)
|
||||
{
|
||||
u8 isBackPic;
|
||||
bool8 isBackPic;
|
||||
u32 personality;
|
||||
u32 otId;
|
||||
u16 species;
|
||||
@@ -3206,7 +3206,7 @@ void AnimTask_RolePlaySilhouette(u8 taskId)
|
||||
{
|
||||
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
|
||||
{
|
||||
isBackPic = 0;
|
||||
isBackPic = FALSE;
|
||||
personality = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gBattleAnimTarget]], MON_DATA_PERSONALITY);
|
||||
otId = GetMonData(&gPlayerParty[gBattlerPartyIndexes[gBattleAnimTarget]], MON_DATA_OT_ID);
|
||||
if (gBattleSpritesDataPtr->battlerData[gBattleAnimTarget].transformSpecies == SPECIES_NONE)
|
||||
@@ -3226,7 +3226,7 @@ void AnimTask_RolePlaySilhouette(u8 taskId)
|
||||
}
|
||||
else
|
||||
{
|
||||
isBackPic = 1;
|
||||
isBackPic = TRUE;
|
||||
personality = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattleAnimTarget]], MON_DATA_PERSONALITY);
|
||||
otId = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gBattleAnimTarget]], MON_DATA_OT_ID);
|
||||
if (gBattleSpritesDataPtr->battlerData[gBattleAnimTarget].transformSpecies == SPECIES_NONE)
|
||||
@@ -3717,6 +3717,26 @@ void AnimTask_SlideMonForFocusBand(u8 taskId)
|
||||
gTasks[taskId].func = AnimTask_SlideMonForFocusBand_Step1;
|
||||
}
|
||||
|
||||
#define IDX_ACTIVE_SPRITES 2 // Used by the sprite callback to modify the number of active sprites
|
||||
|
||||
// Task data for AnimTask_SquishAndSweatDroplets
|
||||
#define tState data[0]
|
||||
#define tTimer data[1]
|
||||
#define tActiveSprites data[IDX_ACTIVE_SPRITES]
|
||||
#define tNumSquishes data[3]
|
||||
#define tBaseX data[4]
|
||||
#define tBaseY data[5]
|
||||
#define tSubpriority data[6]
|
||||
// data[7]-data[15] used by PrepareAffineAnimInTaskData
|
||||
#define tBattlerSpriteId data[15]
|
||||
|
||||
// Sprite data for AnimFacadeSweatDrop
|
||||
#define sTimer data[0]
|
||||
#define sVelocX data[1]
|
||||
#define sVelocY data[2]
|
||||
#define sTaskId data[3]
|
||||
#define sActiveSpritesIdx data[4]
|
||||
|
||||
// Squishes the mon vertically and emits sweat droplets a few times.
|
||||
// arg 0: battler
|
||||
// arg 1: num squishes
|
||||
@@ -3728,20 +3748,20 @@ void AnimTask_SquishAndSweatDroplets(u8 taskId)
|
||||
if (!gBattleAnimArgs[1])
|
||||
DestroyAnimVisualTask(taskId);
|
||||
|
||||
task->data[0] = 0;
|
||||
task->data[1] = 0;
|
||||
task->data[2] = 0;
|
||||
task->data[3] = gBattleAnimArgs[1];
|
||||
task->tState = 0;
|
||||
task->tTimer = 0;
|
||||
task->tActiveSprites = 0;
|
||||
task->tNumSquishes = gBattleAnimArgs[1];
|
||||
if (gBattleAnimArgs[0] == ANIM_ATTACKER)
|
||||
battler = gBattleAnimAttacker;
|
||||
else
|
||||
battler = gBattleAnimTarget;
|
||||
|
||||
task->data[4] = GetBattlerSpriteCoord(battler, BATTLER_COORD_X);
|
||||
task->data[5] = GetBattlerSpriteCoord(battler, BATTLER_COORD_Y);
|
||||
task->data[6] = GetBattlerSpriteSubpriority(battler);
|
||||
task->data[15] = GetAnimBattlerSpriteId(gBattleAnimArgs[0]);
|
||||
PrepareAffineAnimInTaskData(task, task->data[15], gFacadeSquishAffineAnimCmds);
|
||||
task->tBaseX = GetBattlerSpriteCoord(battler, BATTLER_COORD_X);
|
||||
task->tBaseY = GetBattlerSpriteCoord(battler, BATTLER_COORD_Y);
|
||||
task->tSubpriority = GetBattlerSpriteSubpriority(battler);
|
||||
task->tBattlerSpriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]);
|
||||
PrepareAffineAnimInTaskData(task, task->tBattlerSpriteId, gFacadeSquishAffineAnimCmds);
|
||||
task->func = AnimTask_SquishAndSweatDroplets_Step;
|
||||
}
|
||||
|
||||
@@ -3749,37 +3769,40 @@ static void AnimTask_SquishAndSweatDroplets_Step(u8 taskId)
|
||||
{
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
switch (task->data[0])
|
||||
switch (task->tState)
|
||||
{
|
||||
case 0:
|
||||
task->data[1]++;
|
||||
if (task->data[1] == 6)
|
||||
task->tTimer++;
|
||||
if (task->tTimer == 6)
|
||||
CreateSweatDroplets(taskId, TRUE);
|
||||
|
||||
if (task->data[1] == 18)
|
||||
if (task->tTimer == 18)
|
||||
CreateSweatDroplets(taskId, FALSE);
|
||||
|
||||
if (!RunAffineAnimFromTaskData(task))
|
||||
{
|
||||
if (--task->data[3] == 0)
|
||||
if (--task->tNumSquishes == 0)
|
||||
{
|
||||
task->data[0]++;
|
||||
// Animation is finished
|
||||
task->tState++;
|
||||
}
|
||||
else
|
||||
{
|
||||
task->data[1] = 0;
|
||||
PrepareAffineAnimInTaskData(task, task->data[15], gFacadeSquishAffineAnimCmds);
|
||||
// Animation continues, more droplet sprites to create
|
||||
task->tTimer = 0;
|
||||
PrepareAffineAnimInTaskData(task, task->tBattlerSpriteId, gFacadeSquishAffineAnimCmds);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (task->data[2] == 0)
|
||||
// Wait for sprites to be destroyed before ending task
|
||||
if (task->tActiveSprites == 0)
|
||||
DestroyAnimVisualTask(taskId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void CreateSweatDroplets(u8 taskId, bool8 arg1)
|
||||
static void CreateSweatDroplets(u8 taskId, bool8 lowerDroplets)
|
||||
{
|
||||
u8 i;
|
||||
s8 xOffset, yOffset;
|
||||
@@ -3788,7 +3811,7 @@ static void CreateSweatDroplets(u8 taskId, bool8 arg1)
|
||||
s16 yCoords[2];
|
||||
|
||||
task = &gTasks[taskId];
|
||||
if (!arg1)
|
||||
if (!lowerDroplets)
|
||||
{
|
||||
xOffset = 18;
|
||||
yOffset = -20;
|
||||
@@ -3799,39 +3822,54 @@ static void CreateSweatDroplets(u8 taskId, bool8 arg1)
|
||||
yOffset = 20;
|
||||
}
|
||||
|
||||
xCoords[0] = task->data[4] - xOffset;
|
||||
xCoords[1] = task->data[4] - xOffset - 4;
|
||||
xCoords[2] = task->data[4] + xOffset;
|
||||
xCoords[3] = task->data[4] + xOffset + 4;
|
||||
yCoords[0] = task->data[5] + yOffset;
|
||||
yCoords[1] = task->data[5] + yOffset + 6;
|
||||
xCoords[0] = task->tBaseX - xOffset;
|
||||
xCoords[1] = task->tBaseX - xOffset - 4;
|
||||
xCoords[2] = task->tBaseX + xOffset;
|
||||
xCoords[3] = task->tBaseX + xOffset + 4;
|
||||
yCoords[0] = task->tBaseY + yOffset;
|
||||
yCoords[1] = task->tBaseY + yOffset + 6;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
u8 spriteId = CreateSprite(&gFacadeSweatDropSpriteTemplate, xCoords[i], yCoords[i & 1], task->data[6] - 5);
|
||||
u8 spriteId = CreateSprite(&gFacadeSweatDropSpriteTemplate, xCoords[i], yCoords[i & 1], task->tSubpriority - 5);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
gSprites[spriteId].data[0] = 0;
|
||||
gSprites[spriteId].data[1] = i < 2 ? -2 : 2;
|
||||
gSprites[spriteId].data[2] = -1;
|
||||
gSprites[spriteId].data[3] = taskId;
|
||||
gSprites[spriteId].data[4] = 2;
|
||||
task->data[2]++;
|
||||
gSprites[spriteId].sTimer = 0;
|
||||
gSprites[spriteId].sVelocX = i < 2 ? -2 : 2; // First two travel left, remaining travel right
|
||||
gSprites[spriteId].sVelocY = -1;
|
||||
gSprites[spriteId].sTaskId = taskId;
|
||||
gSprites[spriteId].sActiveSpritesIdx = IDX_ACTIVE_SPRITES;
|
||||
task->tActiveSprites++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void AnimFacadeSweatDrop(struct Sprite *sprite)
|
||||
{
|
||||
sprite->x += sprite->data[1];
|
||||
sprite->y += sprite->data[2];
|
||||
if (++sprite->data[0] > 6)
|
||||
sprite->x += sprite->sVelocX;
|
||||
sprite->y += sprite->sVelocY;
|
||||
if (++sprite->sTimer > 6)
|
||||
{
|
||||
gTasks[sprite->data[3]].data[sprite->data[4]]--;
|
||||
gTasks[sprite->sTaskId].data[sprite->sActiveSpritesIdx]--;
|
||||
DestroySprite(sprite);
|
||||
}
|
||||
}
|
||||
|
||||
#undef IDX_ACTIVE_SPRITES
|
||||
#undef tState
|
||||
#undef tTimer
|
||||
#undef tActiveSprites
|
||||
#undef tNumSquishes
|
||||
#undef tBaseX
|
||||
#undef tBaseY
|
||||
#undef tSubpriority
|
||||
#undef tBattlerSpriteId
|
||||
#undef sTimer
|
||||
#undef sVelocX
|
||||
#undef sVelocY
|
||||
#undef sTaskId
|
||||
#undef sActiveSpritesIdx
|
||||
|
||||
// Blends the mon sprite's color with a rotating set of colors.
|
||||
// arg 0: battler
|
||||
// arg 1: duration
|
||||
@@ -3927,6 +3965,26 @@ static void AnimRoarNoiseLine_Step(struct Sprite *sprite)
|
||||
DestroyAnimSprite(sprite);
|
||||
}
|
||||
|
||||
#define IDX_ACTIVE_SPRITES 10 // Used by the sprite callback to modify the number of active sprites
|
||||
|
||||
// Task data for AnimTask_GlareEyeDots
|
||||
#define tState data[0]
|
||||
#define tTimer data[1]
|
||||
#define tPairNum data[2]
|
||||
#define tPairMax data[5]
|
||||
#define tDotOffset data[6]
|
||||
#define tIsContest data[7]
|
||||
#define tActiveSprites data[IDX_ACTIVE_SPRITES]
|
||||
#define tStartX data[11]
|
||||
#define tStartY data[12]
|
||||
#define tEndX data[13]
|
||||
#define tEndY data[14]
|
||||
|
||||
// Sprite data for AnimGlareEyeDot
|
||||
#define sTimer data[0]
|
||||
#define sTaskId data[1]
|
||||
#define sActiveSpritesIdx data[2]
|
||||
|
||||
// Makes a series of dots in a trail from the attacker to the target.
|
||||
// arg 0: unused
|
||||
void AnimTask_GlareEyeDots(u8 taskId)
|
||||
@@ -3935,25 +3993,25 @@ void AnimTask_GlareEyeDots(u8 taskId)
|
||||
|
||||
if (IsContest())
|
||||
{
|
||||
task->data[5] = 8;
|
||||
task->data[6] = 3;
|
||||
task->data[7] = 1;
|
||||
task->tPairMax = 8;
|
||||
task->tDotOffset = 3;
|
||||
task->tIsContest = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
task->data[5] = 12;
|
||||
task->data[6] = 3;
|
||||
task->data[7] = 0;
|
||||
task->tPairMax = 12;
|
||||
task->tDotOffset = 3;
|
||||
task->tIsContest = FALSE;
|
||||
}
|
||||
|
||||
if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER)
|
||||
task->data[11] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) + GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_HEIGHT) / 4;
|
||||
task->tStartX = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) + GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_HEIGHT) / 4;
|
||||
else
|
||||
task->data[11] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) - GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_HEIGHT) / 4;
|
||||
task->tStartX = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) - GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_HEIGHT) / 4;
|
||||
|
||||
task->data[12] = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET) - GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_HEIGHT) / 4;
|
||||
task->data[13] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2);
|
||||
task->data[14] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET);
|
||||
task->tStartY = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET) - GetBattlerSpriteCoordAttr(gBattleAnimAttacker, BATTLER_COORD_ATTR_HEIGHT) / 4;
|
||||
task->tEndX = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2);
|
||||
task->tEndY = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET);
|
||||
task->func = AnimTask_GlareEyeDots_Step;
|
||||
}
|
||||
|
||||
@@ -3963,103 +4021,122 @@ static void AnimTask_GlareEyeDots_Step(u8 taskId)
|
||||
s16 x, y;
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
switch (task->data[0])
|
||||
switch (task->tState)
|
||||
{
|
||||
case 0:
|
||||
if (++task->data[1] > 3)
|
||||
// Wait to create next pair of dots
|
||||
if (++task->tTimer > 3)
|
||||
{
|
||||
task->data[1] = 0;
|
||||
task->tTimer = 0;
|
||||
GetGlareEyeDotCoords(
|
||||
task->data[11],
|
||||
task->data[12],
|
||||
task->data[13],
|
||||
task->data[14],
|
||||
task->data[5],
|
||||
task->data[2],
|
||||
task->tStartX,
|
||||
task->tStartY,
|
||||
task->tEndX,
|
||||
task->tEndY,
|
||||
task->tPairMax,
|
||||
task->tPairNum,
|
||||
&x,
|
||||
&y);
|
||||
|
||||
// Create dot pair
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
u8 spriteId = CreateSprite(&gGlareEyeDotSpriteTemplate, x, y, 35);
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
if (task->data[7] == 0)
|
||||
if (!task->tIsContest)
|
||||
{
|
||||
if (i == 0)
|
||||
gSprites[spriteId].x2 = gSprites[spriteId].y2 = -task->data[6];
|
||||
gSprites[spriteId].x2 = gSprites[spriteId].y2 = -task->tDotOffset;
|
||||
else
|
||||
gSprites[spriteId].x2 = gSprites[spriteId].y2 = task->data[6];
|
||||
gSprites[spriteId].x2 = gSprites[spriteId].y2 = task->tDotOffset;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (i == 0)
|
||||
{
|
||||
gSprites[spriteId].x2 = -task->data[6];
|
||||
gSprites[spriteId].y2 = task->data[6];
|
||||
gSprites[spriteId].x2 = -task->tDotOffset;
|
||||
gSprites[spriteId].y2 = task->tDotOffset;
|
||||
}
|
||||
else
|
||||
{
|
||||
gSprites[spriteId].x2 = task->data[6];
|
||||
gSprites[spriteId].y2 = -task->data[6];
|
||||
gSprites[spriteId].x2 = task->tDotOffset;
|
||||
gSprites[spriteId].y2 = -task->tDotOffset;
|
||||
}
|
||||
}
|
||||
|
||||
gSprites[spriteId].data[0] = 0;
|
||||
gSprites[spriteId].data[1] = taskId;
|
||||
gSprites[spriteId].data[2] = 10;
|
||||
task->data[10]++;
|
||||
gSprites[spriteId].sTimer = 0;
|
||||
gSprites[spriteId].sTaskId = taskId;
|
||||
gSprites[spriteId].sActiveSpritesIdx = IDX_ACTIVE_SPRITES;
|
||||
task->tActiveSprites++;
|
||||
}
|
||||
}
|
||||
|
||||
if (task->data[2] == task->data[5])
|
||||
task->data[0]++;
|
||||
if (task->tPairNum == task->tPairMax)
|
||||
task->tState++;
|
||||
|
||||
task->data[2]++;
|
||||
task->tPairNum++;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (task->data[10] == 0)
|
||||
// Wait for sprites to be destroyed before ending task
|
||||
if (task->tActiveSprites == 0)
|
||||
DestroyAnimVisualTask(taskId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void GetGlareEyeDotCoords(s16 arg0, s16 arg1, s16 arg2, s16 arg3, u8 arg4, u8 arg5, s16 *x, s16 *y)
|
||||
static void GetGlareEyeDotCoords(s16 startX, s16 startY, s16 endX, s16 endY, u8 pairMax, u8 pairNum, s16 *x, s16 *y)
|
||||
{
|
||||
int x2;
|
||||
int y2;
|
||||
|
||||
if (arg5 == 0)
|
||||
if (pairNum == 0)
|
||||
{
|
||||
*x = arg0;
|
||||
*y = arg1;
|
||||
*x = startX;
|
||||
*y = startY;
|
||||
return;
|
||||
}
|
||||
|
||||
if (arg5 >= arg4)
|
||||
if (pairNum >= pairMax)
|
||||
{
|
||||
*x = arg2;
|
||||
*y = arg3;
|
||||
*x = endX;
|
||||
*y = endY;
|
||||
return;
|
||||
}
|
||||
|
||||
arg4--;
|
||||
x2 = (arg0 << 8) + arg5 * (((arg2 - arg0) << 8) / arg4);
|
||||
y2 = (arg1 << 8) + arg5 * (((arg3 - arg1) << 8) / arg4);
|
||||
pairMax--;
|
||||
x2 = (startX << 8) + pairNum * (((endX - startX) << 8) / pairMax);
|
||||
y2 = (startY << 8) + pairNum * (((endY - startY) << 8) / pairMax);
|
||||
*x = x2 >> 8;
|
||||
*y = y2 >> 8;
|
||||
}
|
||||
|
||||
static void AnimGlareEyeDot(struct Sprite *sprite)
|
||||
{
|
||||
if (++sprite->data[0] > 36)
|
||||
if (++sprite->sTimer > 36)
|
||||
{
|
||||
gTasks[sprite->data[1]].data[sprite->data[2]]--;
|
||||
gTasks[sprite->sTaskId].data[sprite->sActiveSpritesIdx]--;
|
||||
DestroySprite(sprite);
|
||||
}
|
||||
}
|
||||
|
||||
#undef IDX_ACTIVE_SPRITES
|
||||
#undef tState
|
||||
#undef tTimer
|
||||
#undef tPairNum
|
||||
#undef tPairMax
|
||||
#undef tDotOffset
|
||||
#undef tIsContest
|
||||
#undef tActiveSprites
|
||||
#undef tStartX
|
||||
#undef tStartY
|
||||
#undef tEndX
|
||||
#undef tEndY
|
||||
#undef sTimer
|
||||
#undef sTaskId
|
||||
#undef sActiveSpritesIdx
|
||||
|
||||
// Moves a pawprint in a straight line.
|
||||
// arg 0: initial x position
|
||||
// arg 1: initial y position
|
||||
@@ -4730,7 +4807,7 @@ void AnimTask_MonToSubstitute(u8 taskId)
|
||||
}
|
||||
else
|
||||
{
|
||||
LoadBattleMonGfxAndAnimate(gBattleAnimAttacker, 0, spriteId);
|
||||
LoadBattleMonGfxAndAnimate(gBattleAnimAttacker, FALSE, spriteId);
|
||||
if (IsContest())
|
||||
{
|
||||
gSprites[gBattlerSpriteIds[gBattleAnimAttacker]].affineAnims = gAffineAnims_BattleSpriteContest;
|
||||
@@ -4768,7 +4845,7 @@ static void AnimTask_MonToSubstituteDoll(u8 taskId)
|
||||
|
||||
if (gSprites[spriteId].y2 == 0)
|
||||
{
|
||||
PlaySE12WithPanning(SE_M_BUBBLE2, BattleAnimAdjustPanning(-64));
|
||||
PlaySE12WithPanning(SE_M_BUBBLE2, BattleAnimAdjustPanning(SOUND_PAN_ATTACKER));
|
||||
gTasks[taskId].data[10] -= 0x800;
|
||||
gTasks[taskId].data[0]++;
|
||||
}
|
||||
@@ -4790,7 +4867,7 @@ static void AnimTask_MonToSubstituteDoll(u8 taskId)
|
||||
|
||||
if (gSprites[spriteId].y2 == 0)
|
||||
{
|
||||
PlaySE12WithPanning(SE_M_BUBBLE2, BattleAnimAdjustPanning(-64));
|
||||
PlaySE12WithPanning(SE_M_BUBBLE2, BattleAnimAdjustPanning(SOUND_PAN_ATTACKER));
|
||||
DestroyAnimVisualTask(taskId);
|
||||
}
|
||||
break;
|
||||
@@ -4827,7 +4904,7 @@ static void AnimBlockX_Step(struct Sprite *sprite)
|
||||
sprite->y2 += 10;
|
||||
if (sprite->y2 >= 0)
|
||||
{
|
||||
PlaySE12WithPanning(SE_M_SKETCH, BattleAnimAdjustPanning(63));
|
||||
PlaySE12WithPanning(SE_M_SKETCH, BattleAnimAdjustPanning(SOUND_PAN_TARGET));
|
||||
sprite->y2 = 0;
|
||||
sprite->data[0]++;
|
||||
}
|
||||
@@ -4837,7 +4914,7 @@ static void AnimBlockX_Step(struct Sprite *sprite)
|
||||
sprite->y2 = -(gSineTable[sprite->data[1]] >> 3);
|
||||
if (sprite->data[1] > 0x7F)
|
||||
{
|
||||
PlaySE12WithPanning(SE_M_SKETCH, BattleAnimAdjustPanning(63));
|
||||
PlaySE12WithPanning(SE_M_SKETCH, BattleAnimAdjustPanning(SOUND_PAN_TARGET));
|
||||
sprite->data[1] = 0;
|
||||
sprite->y2 = 0;
|
||||
sprite->data[0]++;
|
||||
@@ -4856,7 +4933,7 @@ static void AnimBlockX_Step(struct Sprite *sprite)
|
||||
case 3:
|
||||
if (++sprite->data[1] > 8)
|
||||
{
|
||||
PlaySE12WithPanning(SE_M_LEER, BattleAnimAdjustPanning(63));
|
||||
PlaySE12WithPanning(SE_M_LEER, BattleAnimAdjustPanning(SOUND_PAN_TARGET));
|
||||
sprite->data[1] = 0;
|
||||
sprite->data[0]++;
|
||||
}
|
||||
@@ -5020,7 +5097,7 @@ void AnimTask_SnatchOpposingMonMove(u8 taskId)
|
||||
|
||||
gTasks[taskId].data[1] &= 0xFF;
|
||||
x = gSprites[spriteId].x + gSprites[spriteId].x2;
|
||||
if ((u16)(x + 32) > 304)
|
||||
if (x < -32 || x > DISPLAY_WIDTH + 32)
|
||||
{
|
||||
gTasks[taskId].data[1] = 0;
|
||||
gTasks[taskId].data[0]++;
|
||||
@@ -5103,7 +5180,7 @@ void AnimTask_SnatchOpposingMonMove(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
if ((u16)(x + 32) > 304)
|
||||
if (x < -32 || x > DISPLAY_WIDTH + 32)
|
||||
{
|
||||
gTasks[taskId].data[1] = 0;
|
||||
gTasks[taskId].data[0]++;
|
||||
@@ -5150,7 +5227,7 @@ static void AnimUnusedItemBagSteal(struct Sprite *sprite)
|
||||
case 0:
|
||||
if (gBattleAnimArgs[7] == -1)
|
||||
{
|
||||
PlaySE12WithPanning(SE_M_VITAL_THROW, BattleAnimAdjustPanning(63));
|
||||
PlaySE12WithPanning(SE_M_VITAL_THROW, BattleAnimAdjustPanning(SOUND_PAN_TARGET));
|
||||
sprite->y = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_Y) + 16;
|
||||
sprite->data[0] = -32;
|
||||
sprite->data[7]++;
|
||||
|
||||
@@ -571,7 +571,7 @@ static void AnimSparkElectricity(struct Sprite *sprite)
|
||||
|
||||
static void AnimZapCannonSpark(struct Sprite *sprite)
|
||||
{
|
||||
InitSpritePosToAnimAttacker(sprite, 1);
|
||||
InitSpritePosToAnimAttacker(sprite, TRUE);
|
||||
sprite->data[0] = gBattleAnimArgs[3];
|
||||
sprite->data[1] = sprite->x;
|
||||
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2);
|
||||
@@ -583,7 +583,7 @@ static void AnimZapCannonSpark(struct Sprite *sprite)
|
||||
sprite->data[7] = gBattleAnimArgs[4];
|
||||
sprite->oam.tileNum += gBattleAnimArgs[6] * 4;
|
||||
sprite->callback = AnimZapCannonSpark_Step;
|
||||
AnimZapCannonSpark_Step(sprite);
|
||||
sprite->callback(sprite);
|
||||
}
|
||||
|
||||
static void AnimZapCannonSpark_Step(struct Sprite *sprite)
|
||||
@@ -1159,7 +1159,7 @@ void AnimTask_ShockWaveProgressingBolt(u8 taskId)
|
||||
task->data[4] = 7;
|
||||
task->data[5] = -1;
|
||||
task->data[11] = 12;
|
||||
task->data[12] = BattleAnimAdjustPanning(task->data[11] - 76);
|
||||
task->data[12] = BattleAnimAdjustPanning(SOUND_PAN_ATTACKER);
|
||||
task->data[13] = BattleAnimAdjustPanning(SOUND_PAN_TARGET);
|
||||
task->data[14] = task->data[12];
|
||||
task->data[15] = (task->data[13] - task->data[12]) / 3;
|
||||
|
||||
@@ -454,7 +454,7 @@ static void AnimBasicFistOrFoot(struct Sprite *sprite)
|
||||
StartSpriteAnim(sprite, gBattleAnimArgs[4]);
|
||||
|
||||
if (gBattleAnimArgs[3] == 0)
|
||||
InitSpritePosToAnimAttacker(sprite, 1);
|
||||
InitSpritePosToAnimAttacker(sprite, TRUE);
|
||||
else
|
||||
InitSpritePosToAnimTarget(sprite, TRUE);
|
||||
|
||||
@@ -492,7 +492,7 @@ static void AnimFistOrFootRandomPos(struct Sprite *sprite)
|
||||
if (Random2() & 1)
|
||||
y *= -1;
|
||||
|
||||
if ((gBattlerPositions[battler] & BIT_SIDE) == B_SIDE_PLAYER)
|
||||
if (GET_BATTLER_SIDE2(battler) == B_SIDE_PLAYER)
|
||||
y += 0xFFF0;
|
||||
|
||||
sprite->x += x;
|
||||
@@ -500,7 +500,7 @@ static void AnimFistOrFootRandomPos(struct Sprite *sprite)
|
||||
|
||||
sprite->data[0] = gBattleAnimArgs[1];
|
||||
sprite->data[7] = CreateSprite(&gBasicHitSplatSpriteTemplate, sprite->x, sprite->y, sprite->subpriority + 1);
|
||||
if (sprite->data[7] != 64)
|
||||
if (sprite->data[7] != MAX_SPRITES)
|
||||
{
|
||||
StartSpriteAffineAnim(&gSprites[sprite->data[7]], 0);
|
||||
gSprites[sprite->data[7]].callback = SpriteCallbackDummy;
|
||||
@@ -513,7 +513,7 @@ static void AnimFistOrFootRandomPos_Step(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->data[0] == 0)
|
||||
{
|
||||
if (sprite->data[7] != 64)
|
||||
if (sprite->data[7] != MAX_SPRITES)
|
||||
{
|
||||
FreeOamMatrix(gSprites[sprite->data[7]].oam.matrixNum);
|
||||
DestroySprite(&gSprites[sprite->data[7]]);
|
||||
@@ -964,7 +964,7 @@ static void AnimArmThrustHit(struct Sprite *sprite)
|
||||
static void AnimRevengeScratch(struct Sprite *sprite)
|
||||
{
|
||||
if (gBattleAnimArgs[2] == ANIM_ATTACKER)
|
||||
InitSpritePosToAnimAttacker(sprite, 0);
|
||||
InitSpritePosToAnimAttacker(sprite, FALSE);
|
||||
else
|
||||
InitSpritePosToAnimTarget(sprite, FALSE);
|
||||
|
||||
|
||||
+168
-118
@@ -26,18 +26,18 @@ static void AnimFireCross(struct Sprite *);
|
||||
static void AnimFireSpiralOutward(struct Sprite *);
|
||||
static void AnimFireSpiralOutward_Step1(struct Sprite *);
|
||||
static void AnimFireSpiralOutward_Step2(struct Sprite *);
|
||||
static void AnimTask_EruptionLaunchRocks_Step(u8 taskId);
|
||||
static void CreateEruptionLaunchRocks(u8 spriteId, u8 taskId, u8 a3);
|
||||
static void AnimTask_EruptionLaunchRocks_Step(u8);
|
||||
static void CreateEruptionLaunchRocks(u8, u8, u8);
|
||||
static void AnimEruptionLaunchRock(struct Sprite *);
|
||||
static u16 GetEruptionLaunchRockInitialYPos(u8 spriteId);
|
||||
static void InitEruptionLaunchRockCoordData(struct Sprite *sprite, s16 x, s16 y);
|
||||
static u16 GetEruptionLaunchRockInitialYPos(u8);
|
||||
static void InitEruptionLaunchRockCoordData(struct Sprite *, s16, s16);
|
||||
static void UpdateEruptionLaunchRockPos(struct Sprite *);
|
||||
static void AnimEruptionFallingRock(struct Sprite *);
|
||||
static void AnimEruptionFallingRock_Step(struct Sprite *);
|
||||
static void AnimWillOWispOrb(struct Sprite *);
|
||||
static void AnimWillOWispOrb_Step(struct Sprite *);
|
||||
static void AnimWillOWispFire(struct Sprite *);
|
||||
static void AnimTask_MoveHeatWaveTargets_Step(u8 taskId);
|
||||
static void AnimTask_MoveHeatWaveTargets_Step(u8);
|
||||
|
||||
static const union AnimCmd sAnim_FireSpiralSpread_0[] =
|
||||
{
|
||||
@@ -355,7 +355,7 @@ const struct SpriteTemplate gEruptionLaunchRockSpriteTemplate =
|
||||
.callback = AnimEruptionLaunchRock,
|
||||
};
|
||||
|
||||
static const s16 sEruptionLaunchRockCoords[][2] =
|
||||
static const s16 sEruptionLaunchRockSpeeds[][2] =
|
||||
{
|
||||
{-2, -5},
|
||||
{-1, -1},
|
||||
@@ -649,7 +649,7 @@ static void AnimBurnFlame(struct Sprite *sprite)
|
||||
//void AnimFireRing(struct Sprite *sprite)
|
||||
void AnimFireRing(struct Sprite *sprite)
|
||||
{
|
||||
InitSpritePosToAnimAttacker(sprite, 1);
|
||||
InitSpritePosToAnimAttacker(sprite, TRUE);
|
||||
|
||||
sprite->data[7] = gBattleAnimArgs[2];
|
||||
sprite->data[0] = 0;
|
||||
@@ -736,7 +736,7 @@ static void AnimFireCross(struct Sprite *sprite)
|
||||
|
||||
static void AnimFireSpiralOutward(struct Sprite *sprite)
|
||||
{
|
||||
InitSpritePosToAnimAttacker(sprite, 1);
|
||||
InitSpritePosToAnimAttacker(sprite, TRUE);
|
||||
|
||||
sprite->data[1] = gBattleAnimArgs[2];
|
||||
sprite->data[0] = gBattleAnimArgs[3];
|
||||
@@ -770,22 +770,43 @@ static void AnimFireSpiralOutward_Step2(struct Sprite *sprite)
|
||||
DestroyAnimSprite(sprite);
|
||||
}
|
||||
|
||||
#define IDX_ACTIVE_SPRITES 6 // Used by the sprite callback to modify the number of active sprites
|
||||
|
||||
#define tState data[0]
|
||||
#define tTimer1 data[1]
|
||||
#define tTimer2 data[2]
|
||||
#define tTimer3 data[3]
|
||||
#define tAttackerY data[4]
|
||||
#define tAttackerSide data[5]
|
||||
#define tActiveSprites data[IDX_ACTIVE_SPRITES]
|
||||
// data[8]-data[15] used by PrepareEruptAnimTaskData / UpdateEruptAnimTask
|
||||
#define tAttackerSpriteId data[15]
|
||||
|
||||
#define sSpeedDelay data[0]
|
||||
#define sLaunchStage data[1]
|
||||
#define sX data[2]
|
||||
#define sY data[3]
|
||||
#define sSpeedX data[4]
|
||||
#define sSpeedY data[5]
|
||||
#define sTaskId data[6]
|
||||
#define sActiveSpritesIdx data[7]
|
||||
|
||||
// Animates first stage of Eruption where the attacker squishes and launches rocks away from themself
|
||||
void AnimTask_EruptionLaunchRocks(u8 taskId)
|
||||
{
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
task->data[15] = GetAnimBattlerSpriteId(ANIM_ATTACKER);
|
||||
task->tAttackerSpriteId = GetAnimBattlerSpriteId(ANIM_ATTACKER);
|
||||
|
||||
task->data[0] = 0;
|
||||
task->data[1] = 0;
|
||||
task->data[2] = 0;
|
||||
task->data[3] = 0;
|
||||
task->data[4] = gSprites[task->data[15]].y;
|
||||
task->data[5] = GetBattlerSide(gBattleAnimAttacker);
|
||||
task->data[6] = 0;
|
||||
task->tState = 0;
|
||||
task->tTimer1 = 0;
|
||||
task->tTimer2 = 0;
|
||||
task->tTimer3 = 0;
|
||||
task->tAttackerY = gSprites[task->tAttackerSpriteId].y;
|
||||
task->tAttackerSide = GetBattlerSide(gBattleAnimAttacker);
|
||||
task->tActiveSprites = 0;
|
||||
|
||||
PrepareBattlerSpriteForRotScale(task->data[15], ST_OAM_OBJ_NORMAL);
|
||||
PrepareBattlerSpriteForRotScale(task->tAttackerSpriteId, ST_OAM_OBJ_NORMAL);
|
||||
|
||||
task->func = AnimTask_EruptionLaunchRocks_Step;
|
||||
}
|
||||
@@ -794,102 +815,102 @@ static void AnimTask_EruptionLaunchRocks_Step(u8 taskId)
|
||||
{
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
switch (task->data[0])
|
||||
switch (task->tState)
|
||||
{
|
||||
case 0:
|
||||
PrepareEruptAnimTaskData(task, task->data[15], 0x100, 0x100, 0xE0, 0x200, 32);
|
||||
task->data[0]++;
|
||||
PrepareEruptAnimTaskData(task, task->tAttackerSpriteId, 0x100, 0x100, 0xE0, 0x200, 32);
|
||||
task->tState++;
|
||||
case 1:
|
||||
if (++task->data[1] > 1)
|
||||
if (++task->tTimer1 > 1)
|
||||
{
|
||||
task->data[1] = 0;
|
||||
task->tTimer1 = 0;
|
||||
|
||||
if (++task->data[2] & 0x1)
|
||||
gSprites[task->data[15]].x2 = 3;
|
||||
if (++task->tTimer2 & 1)
|
||||
gSprites[task->tAttackerSpriteId].x2 = 3;
|
||||
else
|
||||
gSprites[task->data[15]].x2 = -3;
|
||||
gSprites[task->tAttackerSpriteId].x2 = -3;
|
||||
}
|
||||
|
||||
if (task->data[5] != B_SIDE_PLAYER)
|
||||
if (task->tAttackerSide != B_SIDE_PLAYER)
|
||||
{
|
||||
if (++task->data[3] > 4)
|
||||
if (++task->tTimer3 > 4)
|
||||
{
|
||||
task->data[3] = 0;
|
||||
gSprites[task->data[15]].y++;
|
||||
task->tTimer3 = 0;
|
||||
gSprites[task->tAttackerSpriteId].y++;
|
||||
}
|
||||
}
|
||||
|
||||
if(!UpdateEruptAnimTask(task))
|
||||
{
|
||||
SetBattlerSpriteYOffsetFromYScale(task->data[15]);
|
||||
gSprites[task->data[15]].x2 = 0;
|
||||
SetBattlerSpriteYOffsetFromYScale(task->tAttackerSpriteId);
|
||||
gSprites[task->tAttackerSpriteId].x2 = 0;
|
||||
|
||||
task->data[1] = 0;
|
||||
task->data[2] = 0;
|
||||
task->data[3] = 0;
|
||||
task->data[0]++;
|
||||
task->tTimer1 = 0;
|
||||
task->tTimer2 = 0;
|
||||
task->tTimer3 = 0;
|
||||
task->tState++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (++task->data[1] > 4)
|
||||
if (++task->tTimer1 > 4)
|
||||
{
|
||||
if (task->data[5] != B_SIDE_PLAYER)
|
||||
PrepareEruptAnimTaskData(task, task->data[15], 0xE0, 0x200, 0x180, 0xF0, 6);
|
||||
if (task->tAttackerSide != B_SIDE_PLAYER)
|
||||
PrepareEruptAnimTaskData(task, task->tAttackerSpriteId, 0xE0, 0x200, 0x180, 0xF0, 6);
|
||||
else
|
||||
PrepareEruptAnimTaskData(task, task->data[15], 0xE0, 0x200, 0x180, 0xC0, 6);
|
||||
PrepareEruptAnimTaskData(task, task->tAttackerSpriteId, 0xE0, 0x200, 0x180, 0xC0, 6);
|
||||
|
||||
task->data[1] = 0;
|
||||
task->data[0]++;
|
||||
task->tTimer1 = 0;
|
||||
task->tState++;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (!UpdateEruptAnimTask(task))
|
||||
{
|
||||
CreateEruptionLaunchRocks(task->data[15], taskId, 6);
|
||||
task->data[0]++;
|
||||
CreateEruptionLaunchRocks(task->tAttackerSpriteId, taskId, IDX_ACTIVE_SPRITES);
|
||||
task->tState++;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (++task->data[1] > 1)
|
||||
if (++task->tTimer1 > 1)
|
||||
{
|
||||
task->data[1] = 0;
|
||||
task->tTimer1 = 0;
|
||||
|
||||
if (++task->data[2] & 1)
|
||||
gSprites[task->data[15]].y2 += 3;
|
||||
if (++task->tTimer2 & 1)
|
||||
gSprites[task->tAttackerSpriteId].y2 += 3;
|
||||
else
|
||||
gSprites[task->data[15]].y2 -= 3;
|
||||
gSprites[task->tAttackerSpriteId].y2 -= 3;
|
||||
}
|
||||
|
||||
if (++task->data[3] > 0x18)
|
||||
if (++task->tTimer3 > 24)
|
||||
{
|
||||
if (task->data[5] != B_SIDE_PLAYER)
|
||||
PrepareEruptAnimTaskData(task, task->data[15], 0x180, 0xF0, 0x100, 0x100, 8);
|
||||
if (task->tAttackerSide != B_SIDE_PLAYER)
|
||||
PrepareEruptAnimTaskData(task, task->tAttackerSpriteId, 0x180, 0xF0, 0x100, 0x100, 8);
|
||||
else
|
||||
PrepareEruptAnimTaskData(task, task->data[15], 0x180, 0xC0, 0x100, 0x100, 8);
|
||||
PrepareEruptAnimTaskData(task, task->tAttackerSpriteId, 0x180, 0xC0, 0x100, 0x100, 8);
|
||||
|
||||
if (task->data[2] & 1)
|
||||
gSprites[task->data[15]].y2 -= 3;
|
||||
if (task->tTimer2 & 1)
|
||||
gSprites[task->tAttackerSpriteId].y2 -= 3;
|
||||
|
||||
task->data[1] = 0;
|
||||
task->data[2] = 0;
|
||||
task->data[3] = 0;
|
||||
task->data[0]++;
|
||||
task->tTimer1 = 0;
|
||||
task->tTimer2 = 0;
|
||||
task->tTimer3 = 0;
|
||||
task->tState++;
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (task->data[5] != B_SIDE_PLAYER)
|
||||
gSprites[task->data[15]].y--;
|
||||
if (task->tAttackerSide != B_SIDE_PLAYER)
|
||||
gSprites[task->tAttackerSpriteId].y--;
|
||||
|
||||
if (!UpdateEruptAnimTask(task))
|
||||
{
|
||||
gSprites[task->data[15]].y = task->data[4];
|
||||
ResetSpriteRotScale(task->data[15]);
|
||||
task->data[2] = 0;
|
||||
task->data[0]++;
|
||||
gSprites[task->tAttackerSpriteId].y = task->tAttackerY;
|
||||
ResetSpriteRotScale(task->tAttackerSpriteId);
|
||||
task->tTimer2 = 0;
|
||||
task->tState++;
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
if (!task->data[6])
|
||||
if (task->tActiveSprites == 0)
|
||||
DestroyAnimVisualTask(taskId);
|
||||
break;
|
||||
default:
|
||||
@@ -897,7 +918,7 @@ static void AnimTask_EruptionLaunchRocks_Step(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
static void CreateEruptionLaunchRocks(u8 spriteId, u8 taskId, u8 a3)
|
||||
static void CreateEruptionLaunchRocks(u8 spriteId, u8 taskId, u8 activeSpritesIdx)
|
||||
{
|
||||
u16 i, j;
|
||||
s8 sign;
|
||||
@@ -905,14 +926,14 @@ static void CreateEruptionLaunchRocks(u8 spriteId, u8 taskId, u8 a3)
|
||||
u16 y = GetEruptionLaunchRockInitialYPos(spriteId);
|
||||
u16 x = gSprites[spriteId].x;
|
||||
|
||||
if(!GetBattlerSide(gBattleAnimAttacker))
|
||||
if(GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER)
|
||||
{
|
||||
x -= 0xC;
|
||||
x -= 12;
|
||||
sign = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
x += 0x10;
|
||||
x += 16;
|
||||
sign = -1;
|
||||
}
|
||||
|
||||
@@ -920,18 +941,18 @@ static void CreateEruptionLaunchRocks(u8 spriteId, u8 taskId, u8 a3)
|
||||
{
|
||||
u8 spriteId = CreateSprite(&gEruptionLaunchRockSpriteTemplate, x, y, 2);
|
||||
|
||||
if (spriteId != 0x40)
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
gSprites[spriteId].oam.tileNum += j * 4 + 0x40;
|
||||
|
||||
if (++j >= 5)
|
||||
j = 0;
|
||||
|
||||
InitEruptionLaunchRockCoordData(&gSprites[spriteId], sEruptionLaunchRockCoords[i][0] * sign, sEruptionLaunchRockCoords[i][1]);
|
||||
gSprites[spriteId].data[6] = taskId;
|
||||
gSprites[spriteId].data[7] = a3;
|
||||
InitEruptionLaunchRockCoordData(&gSprites[spriteId], sEruptionLaunchRockSpeeds[i][0] * sign, sEruptionLaunchRockSpeeds[i][1]);
|
||||
gSprites[spriteId].sTaskId = taskId;
|
||||
gSprites[spriteId].sActiveSpritesIdx = activeSpritesIdx;
|
||||
|
||||
gTasks[taskId].data[a3]++;
|
||||
gTasks[taskId].data[activeSpritesIdx]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -942,7 +963,7 @@ static void AnimEruptionLaunchRock(struct Sprite *sprite)
|
||||
|
||||
if (sprite->invisible)
|
||||
{
|
||||
gTasks[sprite->data[6]].data[sprite->data[7]]--;
|
||||
gTasks[sprite->sTaskId].data[sprite->sActiveSpritesIdx]--;
|
||||
DestroySprite(sprite);
|
||||
}
|
||||
}
|
||||
@@ -959,46 +980,71 @@ static u16 GetEruptionLaunchRockInitialYPos(u8 spriteId)
|
||||
return y;
|
||||
}
|
||||
|
||||
static void InitEruptionLaunchRockCoordData(struct Sprite *sprite, s16 x, s16 y)
|
||||
static void InitEruptionLaunchRockCoordData(struct Sprite *sprite, s16 speedX, s16 speedY)
|
||||
{
|
||||
sprite->data[0] = 0;
|
||||
sprite->data[1] = 0;
|
||||
sprite->data[2] = (u16)sprite->x * 8;
|
||||
sprite->data[3] = (u16)sprite->y * 8;
|
||||
sprite->data[4] = x * 8;
|
||||
sprite->data[5] = y * 8;
|
||||
sprite->sSpeedDelay = 0;
|
||||
sprite->sLaunchStage = 0;
|
||||
sprite->sX = (u16)sprite->x * 8;
|
||||
sprite->sY = (u16)sprite->y * 8;
|
||||
sprite->sSpeedX = speedX * 8;
|
||||
sprite->sSpeedY = speedY * 8;
|
||||
}
|
||||
|
||||
static void UpdateEruptionLaunchRockPos(struct Sprite *sprite)
|
||||
{
|
||||
int var1;
|
||||
if (++sprite->data[0] > 2)
|
||||
int extraLaunchSpeed;
|
||||
if (++sprite->sSpeedDelay > 2)
|
||||
{
|
||||
sprite->data[0] = 0;
|
||||
++sprite->data[1];
|
||||
var1 = (u16)sprite->data[1] * (u16)sprite->data[1];
|
||||
sprite->data[3] += var1;
|
||||
sprite->sSpeedDelay = 0;
|
||||
++sprite->sLaunchStage;
|
||||
extraLaunchSpeed = (u16)sprite->sLaunchStage * (u16)sprite->sLaunchStage;
|
||||
sprite->sY += extraLaunchSpeed;
|
||||
}
|
||||
|
||||
sprite->data[2] += sprite->data[4];
|
||||
sprite->x = sprite->data[2] >> 3;
|
||||
sprite->data[3] += sprite->data[5];
|
||||
sprite->y = sprite->data[3] >> 3;
|
||||
sprite->sX += sprite->sSpeedX;
|
||||
sprite->x = sprite->sX >> 3;
|
||||
sprite->sY += sprite->sSpeedY;
|
||||
sprite->y = sprite->sY >> 3;
|
||||
|
||||
if (sprite->x < -8 || sprite->x > 0xf8 || sprite->y < -8 || sprite->y > 120)
|
||||
if (sprite->x < -8 || sprite->x > DISPLAY_WIDTH + 8 || sprite->y < -8 || sprite->y > 120)
|
||||
sprite->invisible = TRUE;
|
||||
}
|
||||
|
||||
#undef IDX_ACTIVE_SPRITES
|
||||
#undef tState
|
||||
#undef tTimer1
|
||||
#undef tTimer2
|
||||
#undef tTimer3
|
||||
#undef tAttackerY
|
||||
#undef tAttackerSide
|
||||
#undef tActiveSprites
|
||||
#undef tAttackerSpriteId
|
||||
#undef sSpeedDelay
|
||||
#undef sLaunchStage
|
||||
#undef sX
|
||||
#undef sY
|
||||
#undef sSpeedX
|
||||
#undef sSpeedY
|
||||
#undef sTaskId
|
||||
#undef sActiveSpritesIdx
|
||||
|
||||
#define sState data[0]
|
||||
#define sBounceTimer data[1]
|
||||
#define sBounceDir data[2]
|
||||
#define sEndTimer data[3]
|
||||
#define sFallDelay data[6]
|
||||
#define sTargetY data[7]
|
||||
|
||||
static void AnimEruptionFallingRock(struct Sprite *sprite)
|
||||
{
|
||||
sprite->x = gBattleAnimArgs[0];
|
||||
sprite->y = gBattleAnimArgs[1];
|
||||
|
||||
sprite->data[0] = 0;
|
||||
sprite->data[1] = 0;
|
||||
sprite->data[2] = 0;
|
||||
sprite->data[6] = gBattleAnimArgs[2];
|
||||
sprite->data[7] = gBattleAnimArgs[3];
|
||||
sprite->sState = 0;
|
||||
sprite->sBounceTimer = 0;
|
||||
sprite->sBounceDir = 0;
|
||||
sprite->sFallDelay = gBattleAnimArgs[2];
|
||||
sprite->sTargetY = gBattleAnimArgs[3];
|
||||
|
||||
sprite->oam.tileNum += gBattleAnimArgs[4] * 16;
|
||||
sprite->callback = AnimEruptionFallingRock_Step;
|
||||
@@ -1006,53 +1052,57 @@ static void AnimEruptionFallingRock(struct Sprite *sprite)
|
||||
|
||||
static void AnimEruptionFallingRock_Step(struct Sprite *sprite)
|
||||
{
|
||||
switch (sprite->data[0])
|
||||
switch (sprite->sState)
|
||||
{
|
||||
case 0:
|
||||
if (sprite->data[6] != 0)
|
||||
// Wait to begin falling
|
||||
if (sprite->sFallDelay != 0)
|
||||
{
|
||||
sprite->data[6]--;
|
||||
sprite->sFallDelay--;
|
||||
return;
|
||||
}
|
||||
|
||||
sprite->data[0]++;
|
||||
sprite->sState++;
|
||||
// fall through
|
||||
case 1:
|
||||
// Rock is falling
|
||||
sprite->y += 8;
|
||||
if (sprite->y >= sprite->data[7])
|
||||
if (sprite->y >= sprite->sTargetY)
|
||||
{
|
||||
sprite->y = sprite->data[7];
|
||||
sprite->data[0]++;
|
||||
sprite->y = sprite->sTargetY;
|
||||
sprite->sState++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (++sprite->data[1] > 1)
|
||||
// Bounce up and down on landing spot
|
||||
if (++sprite->sBounceTimer > 1)
|
||||
{
|
||||
sprite->data[1] = 0;
|
||||
if ((++sprite->data[2] & 1) != 0)
|
||||
{
|
||||
sprite->sBounceTimer = 0;
|
||||
if ((++sprite->sBounceDir & 1) != 0)
|
||||
sprite->y2 = -3;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprite->y2 = 3;
|
||||
}
|
||||
}
|
||||
|
||||
if (++sprite->data[3] > 16)
|
||||
{
|
||||
if (++sprite->sEndTimer > 16)
|
||||
DestroyAnimSprite(sprite);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#undef sState
|
||||
#undef sBounceTimer
|
||||
#undef sBounceDir
|
||||
#undef sEndTimer
|
||||
#undef sFallDelay
|
||||
#undef sTargetY
|
||||
|
||||
static void AnimWillOWispOrb(struct Sprite *sprite)
|
||||
{
|
||||
switch (sprite->data[0])
|
||||
{
|
||||
case 0:
|
||||
InitSpritePosToAnimAttacker(sprite, 0);
|
||||
InitSpritePosToAnimAttacker(sprite, FALSE);
|
||||
StartSpriteAnim(sprite, gBattleAnimArgs[2]);
|
||||
sprite->data[7] = gBattleAnimArgs[2];
|
||||
|
||||
@@ -1177,8 +1227,8 @@ void AnimTask_MoveHeatWaveTargets(u8 taskId)
|
||||
{
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
task->data[12] = !GetBattlerSide(gBattleAnimAttacker) ? 1 : -1;
|
||||
task->data[13] = IsBattlerSpriteVisible(gBattleAnimTarget ^ 2) + 1;
|
||||
task->data[12] = GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER ? 1 : -1;
|
||||
task->data[13] = IsBattlerSpriteVisible(BATTLE_PARTNER(gBattleAnimTarget)) + 1;
|
||||
task->data[14] = GetAnimBattlerSpriteId(ANIM_TARGET);
|
||||
task->data[15] = GetAnimBattlerSpriteId(ANIM_DEF_PARTNER);
|
||||
|
||||
|
||||
+14
-14
@@ -456,7 +456,7 @@ static void AnimAirWaveCrescent(struct Sprite *sprite)
|
||||
}
|
||||
else
|
||||
{
|
||||
SetAverageBattlerPositions(gBattleAnimTarget, 1, &sprite->data[2], &sprite->data[4]);
|
||||
SetAverageBattlerPositions(gBattleAnimTarget, TRUE, &sprite->data[2], &sprite->data[4]);
|
||||
}
|
||||
|
||||
sprite->data[2] = sprite->data[2] + gBattleAnimArgs[2];
|
||||
@@ -528,8 +528,8 @@ static void AnimFlyBallAttack_Step(struct Sprite *sprite)
|
||||
}
|
||||
|
||||
if (sprite->x + sprite->x2 < -32
|
||||
|| sprite->x + sprite->x2 > DISPLAY_WIDTH + 32
|
||||
|| sprite->y + sprite->y2 > DISPLAY_HEIGHT)
|
||||
|| sprite->x + sprite->x2 > DISPLAY_WIDTH + 32
|
||||
|| sprite->y + sprite->y2 > DISPLAY_HEIGHT)
|
||||
{
|
||||
gSprites[GetAnimBattlerSpriteId(ANIM_ATTACKER)].invisible = FALSE;
|
||||
DestroyAnimSprite(sprite);
|
||||
@@ -595,7 +595,7 @@ static void AnimFallingFeather(struct Sprite *sprite)
|
||||
data->unkA = (gBattleAnimArgs[2] >> 8) & 0xFF;
|
||||
data->unk4 = gBattleAnimArgs[3];
|
||||
data->unk6 = gBattleAnimArgs[4];
|
||||
*(u16*)(data->unkC) = gBattleAnimArgs[5];
|
||||
*(u16 *)(data->unkC) = gBattleAnimArgs[5];
|
||||
|
||||
if (data->unk2 >= 64 && data->unk2 <= 191)
|
||||
{
|
||||
@@ -906,12 +906,12 @@ static void AnimWhirlwindLine(struct Sprite * sprite)
|
||||
u8 mult;
|
||||
|
||||
if (gBattleAnimArgs[2] == ANIM_ATTACKER)
|
||||
InitSpritePosToAnimAttacker(sprite, 0);
|
||||
InitSpritePosToAnimAttacker(sprite, FALSE);
|
||||
else
|
||||
InitSpritePosToAnimTarget(sprite, FALSE);
|
||||
|
||||
if ((gBattleAnimArgs[2] == ANIM_ATTACKER && !GetBattlerSide(gBattleAnimAttacker))
|
||||
|| (gBattleAnimArgs[2] == ANIM_TARGET && !GetBattlerSide(gBattleAnimTarget)))
|
||||
if ((gBattleAnimArgs[2] == ANIM_ATTACKER && GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER)
|
||||
|| (gBattleAnimArgs[2] == ANIM_TARGET && GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER))
|
||||
{
|
||||
sprite->x += 8;
|
||||
}
|
||||
@@ -971,7 +971,7 @@ static void AnimBounceBallShrink(struct Sprite *sprite)
|
||||
switch (sprite->data[0])
|
||||
{
|
||||
case 0:
|
||||
InitSpritePosToAnimAttacker(sprite, 1);
|
||||
InitSpritePosToAnimAttacker(sprite, TRUE);
|
||||
gSprites[GetAnimBattlerSpriteId(ANIM_ATTACKER)].invisible = TRUE;
|
||||
++sprite->data[0];
|
||||
break;
|
||||
@@ -1009,7 +1009,7 @@ static void AnimBounceBallLand(struct Sprite *sprite)
|
||||
|
||||
static void AnimDiveBall(struct Sprite *sprite)
|
||||
{
|
||||
InitSpritePosToAnimAttacker(sprite, 1);
|
||||
InitSpritePosToAnimAttacker(sprite, TRUE);
|
||||
sprite->data[0] = gBattleAnimArgs[2];
|
||||
sprite->data[1] = gBattleAnimArgs[3];
|
||||
sprite->callback = AnimDiveBall_Step1;
|
||||
@@ -1067,7 +1067,7 @@ static void AnimDiveWaterSplash(struct Sprite *sprite)
|
||||
|
||||
sprite->data[1] = 0x200;
|
||||
|
||||
TrySetSpriteRotScale(sprite, 0, 0x100, sprite->data[1], 0);
|
||||
TrySetSpriteRotScale(sprite, FALSE, 0x100, sprite->data[1], 0);
|
||||
sprite->data[0]++;
|
||||
break;
|
||||
case 1:
|
||||
@@ -1078,7 +1078,7 @@ static void AnimDiveWaterSplash(struct Sprite *sprite)
|
||||
|
||||
sprite->data[2]++;
|
||||
|
||||
TrySetSpriteRotScale(sprite, 0, 0x100, sprite->data[1], 0);
|
||||
TrySetSpriteRotScale(sprite, FALSE, 0x100, sprite->data[1], 0);
|
||||
|
||||
matrixNum = sprite->oam.matrixNum;
|
||||
|
||||
@@ -1202,7 +1202,7 @@ static void AnimSkyAttackBird(struct Sprite *sprite)
|
||||
rotation = ArcTan2Neg(posx - sprite->x, posy - sprite->y);
|
||||
rotation -= 16384;
|
||||
|
||||
TrySetSpriteRotScale(sprite, 1, 0x100, 0x100, rotation);
|
||||
TrySetSpriteRotScale(sprite, TRUE, 0x100, 0x100, rotation);
|
||||
|
||||
sprite->callback = AnimSkyAttackBird_Step;
|
||||
}
|
||||
@@ -1215,8 +1215,8 @@ void AnimSkyAttackBird_Step(struct Sprite *sprite)
|
||||
sprite->x = sprite->data[4] >> 4;
|
||||
sprite->y = sprite->data[5] >> 4;
|
||||
|
||||
if (sprite->x > 285 || sprite->x < -45
|
||||
|| sprite->y > 157 || sprite->y < -45)
|
||||
if (sprite->x > DISPLAY_WIDTH + 45 || sprite->x < -45
|
||||
|| sprite->y > 157 || sprite->y < -45)
|
||||
DestroySpriteAndMatrix(sprite);
|
||||
}
|
||||
|
||||
|
||||
@@ -653,9 +653,9 @@ static void AnimTask_SpiteTargetShadow_Step1(u8 taskId)
|
||||
startLine = 0;
|
||||
|
||||
if (position == 1)
|
||||
task->data[10] = ScanlineEffect_InitWave(startLine, startLine + 64, 2, 6, 0, SCANLINE_EFFECT_REG_BG1HOFS, 1);
|
||||
task->data[10] = ScanlineEffect_InitWave(startLine, startLine + 64, 2, 6, 0, SCANLINE_EFFECT_REG_BG1HOFS, TRUE);
|
||||
else
|
||||
task->data[10] = ScanlineEffect_InitWave(startLine, startLine + 64, 2, 6, 0, SCANLINE_EFFECT_REG_BG2HOFS, 1);
|
||||
task->data[10] = ScanlineEffect_InitWave(startLine, startLine + 64, 2, 6, 0, SCANLINE_EFFECT_REG_BG2HOFS, TRUE);
|
||||
|
||||
task->data[15]++;
|
||||
break;
|
||||
@@ -814,7 +814,7 @@ void AnimTask_DestinyBondWhiteShadow(u8 taskId)
|
||||
for (battler = 0; battler < MAX_BATTLERS_COUNT; battler++)
|
||||
{
|
||||
if (battler != gBattleAnimAttacker
|
||||
&& battler != (gBattleAnimAttacker ^ 2)
|
||||
&& battler != BATTLE_PARTNER(gBattleAnimAttacker)
|
||||
&& IsBattlerSpriteVisible(battler))
|
||||
{
|
||||
spriteId = CreateSprite(&gDestinyBondWhiteShadowSpriteTemplate, baseX, baseY, 55);
|
||||
@@ -1004,7 +1004,7 @@ static void AnimTask_CurseStretchingBlackBg_Step1(u8 taskId)
|
||||
right = DISPLAY_WIDTH;
|
||||
top = 0;
|
||||
bottom = 112;
|
||||
selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0);
|
||||
selectedPalettes = GetBattlePalettesMask(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
|
||||
BeginNormalPaletteFade(selectedPalettes, 0, 16, 16, RGB(0, 0, 0));
|
||||
gTasks[taskId].func = AnimTask_CurseStretchingBlackBg_Step2;
|
||||
}
|
||||
@@ -1034,7 +1034,7 @@ static void AnimCurseNail(struct Sprite *sprite)
|
||||
s16 xDelta;
|
||||
s16 xDelta2;
|
||||
|
||||
InitSpritePosToAnimAttacker(sprite, 1);
|
||||
InitSpritePosToAnimAttacker(sprite, TRUE);
|
||||
if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER)
|
||||
{
|
||||
xDelta = 24;
|
||||
|
||||
@@ -205,7 +205,7 @@ static void AnimDirtScatter(struct Sprite *sprite)
|
||||
u8 targetXPos, targetYPos;
|
||||
s16 xOffset, yOffset;
|
||||
|
||||
InitSpritePosToAnimAttacker(sprite, 1);
|
||||
InitSpritePosToAnimAttacker(sprite, TRUE);
|
||||
|
||||
targetXPos = GetBattlerSpriteCoord2(gBattleAnimTarget, BATTLER_COORD_X_2);
|
||||
targetYPos = GetBattlerSpriteCoord2(gBattleAnimTarget, BATTLER_COORD_Y_PIC_OFFSET);
|
||||
|
||||
+28
-24
@@ -45,7 +45,7 @@ static void AnimThrowIceBall(struct Sprite *);
|
||||
static void InitIceBallParticle(struct Sprite *);
|
||||
static void AnimIceBallParticle(struct Sprite *);
|
||||
static void AnimTask_HazeScrollingFog_Step(u8);
|
||||
static void AnimTask_LoadMistTiles_Step(u8);
|
||||
static void AnimTask_MistBallFog_Step(u8);
|
||||
static void AnimTask_Hail2(u8);
|
||||
static bool8 GenerateHailParticle(u8 hailStructId, u8 affineAnimNum, u8 taskId, u8 c);
|
||||
|
||||
@@ -353,7 +353,7 @@ const struct SpriteTemplate gMistBallSpriteTemplate =
|
||||
.callback = AnimThrowMistBall,
|
||||
};
|
||||
|
||||
static const u8 wMistBlendAmounts[] =
|
||||
static const u8 sMistBlendAmounts[] =
|
||||
{
|
||||
0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5,
|
||||
};
|
||||
@@ -631,7 +631,7 @@ static void AnimIceEffectParticle(struct Sprite *sprite)
|
||||
}
|
||||
else
|
||||
{
|
||||
SetAverageBattlerPositions(gBattleAnimTarget, 1, &sprite->x, &sprite->y);
|
||||
SetAverageBattlerPositions(gBattleAnimTarget, TRUE, &sprite->x, &sprite->y);
|
||||
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
|
||||
gBattleAnimArgs[0] = -gBattleAnimArgs[0];
|
||||
|
||||
@@ -676,7 +676,7 @@ static void AnimSwirlingSnowball(struct Sprite *sprite)
|
||||
}
|
||||
else
|
||||
{
|
||||
SetAverageBattlerPositions(gBattleAnimTarget, 1, &sprite->data[2], &sprite->data[4]);
|
||||
SetAverageBattlerPositions(gBattleAnimTarget, TRUE, &sprite->data[2], &sprite->data[4]);
|
||||
}
|
||||
|
||||
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
|
||||
@@ -696,7 +696,8 @@ static void AnimSwirlingSnowball(struct Sprite *sprite)
|
||||
sprite->data[0] = 1;
|
||||
AnimFastTranslateLinear(sprite);
|
||||
|
||||
if ((u32)(sprite->x + sprite->x2 + 16) > DISPLAY_WIDTH + 32
|
||||
if (sprite->x + sprite->x2 > DISPLAY_WIDTH + 16
|
||||
|| sprite->x + sprite->x2 < -16
|
||||
|| sprite->y + sprite->y2 > DISPLAY_HEIGHT
|
||||
|| sprite->y + sprite->y2 < -16)
|
||||
break;
|
||||
@@ -762,7 +763,8 @@ static void AnimSwirlingSnowball_End(struct Sprite *sprite)
|
||||
sprite->data[0] = 1;
|
||||
AnimFastTranslateLinear(sprite);
|
||||
|
||||
if ((u32)(sprite->x + sprite->x2 + 16) > DISPLAY_WIDTH + 32
|
||||
if (sprite->x + sprite->x2 > 256
|
||||
|| sprite->x + sprite->x2 < -16
|
||||
|| sprite->y + sprite->y2 > 256
|
||||
|| sprite->y + sprite->y2 < -16)
|
||||
DestroyAnimSprite(sprite);
|
||||
@@ -796,7 +798,7 @@ static void AnimMoveParticleBeyondTarget(struct Sprite *sprite)
|
||||
}
|
||||
else
|
||||
{
|
||||
SetAverageBattlerPositions(gBattleAnimTarget, 1, &sprite->data[2], &sprite->data[4]);
|
||||
SetAverageBattlerPositions(gBattleAnimTarget, TRUE, &sprite->data[2], &sprite->data[4]);
|
||||
}
|
||||
|
||||
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
|
||||
@@ -816,7 +818,8 @@ static void AnimMoveParticleBeyondTarget(struct Sprite *sprite)
|
||||
{
|
||||
sprite->data[0] = 1;
|
||||
AnimFastTranslateLinear(sprite);
|
||||
if ((u32)(sprite->x + sprite->x2 + 16) > DISPLAY_WIDTH + 32
|
||||
if (sprite->x + sprite->x2 > DISPLAY_WIDTH + 16
|
||||
|| sprite->x + sprite->x2 < -16
|
||||
|| sprite->y + sprite->y2 > DISPLAY_HEIGHT
|
||||
|| sprite->y + sprite->y2 < -16)
|
||||
break;
|
||||
@@ -846,7 +849,8 @@ static void AnimWiggleParticleTowardsTarget(struct Sprite *sprite)
|
||||
sprite->data[7] = (sprite->data[7] + sprite->data[6]) & 0xFF;
|
||||
if (sprite->data[0] == 1)
|
||||
{
|
||||
if ((u32)(sprite->x + sprite->x2 + 16) > DISPLAY_WIDTH + 32
|
||||
if (sprite->x + sprite->x2 > DISPLAY_WIDTH + 16
|
||||
|| sprite->x + sprite->x2 < -16
|
||||
|| sprite->y + sprite->y2 > DISPLAY_HEIGHT
|
||||
|| sprite->y + sprite->y2 < -16)
|
||||
DestroyAnimSprite(sprite);
|
||||
@@ -867,7 +871,7 @@ static void AnimWaveFromCenterOfTarget(struct Sprite *sprite)
|
||||
}
|
||||
else
|
||||
{
|
||||
SetAverageBattlerPositions(gBattleAnimTarget, 0, &sprite->x, &sprite->y);
|
||||
SetAverageBattlerPositions(gBattleAnimTarget, FALSE, &sprite->x, &sprite->y);
|
||||
|
||||
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
|
||||
gBattleAnimArgs[0] = -gBattleAnimArgs[0];
|
||||
@@ -905,7 +909,7 @@ static void InitSwirlingFogAnim(struct Sprite *sprite)
|
||||
}
|
||||
else
|
||||
{
|
||||
SetAverageBattlerPositions(gBattleAnimAttacker, 0, &sprite->x, &sprite->y);
|
||||
SetAverageBattlerPositions(gBattleAnimAttacker, FALSE, &sprite->x, &sprite->y);
|
||||
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
|
||||
sprite->x -= gBattleAnimArgs[0];
|
||||
else
|
||||
@@ -924,7 +928,7 @@ static void InitSwirlingFogAnim(struct Sprite *sprite)
|
||||
}
|
||||
else
|
||||
{
|
||||
SetAverageBattlerPositions(gBattleAnimTarget, 0, &sprite->x, &sprite->y);
|
||||
SetAverageBattlerPositions(gBattleAnimTarget, FALSE, &sprite->x, &sprite->y);
|
||||
if (GetBattlerSide(gBattleAnimTarget) != B_SIDE_PLAYER)
|
||||
sprite->x -= gBattleAnimArgs[0];
|
||||
else
|
||||
@@ -1086,7 +1090,7 @@ static void AnimThrowMistBall(struct Sprite *sprite)
|
||||
}
|
||||
|
||||
// Displays misty background in Mist Ball.
|
||||
void AnimTask_LoadMistTiles(u8 taskId)
|
||||
void AnimTask_MistBallFog(u8 taskId)
|
||||
{
|
||||
struct BattleAnimBgData animBg;
|
||||
|
||||
@@ -1109,10 +1113,10 @@ void AnimTask_LoadMistTiles(u8 taskId)
|
||||
LoadPalette(&gFogPalette, animBg.paletteId * 16, 32);
|
||||
|
||||
gTasks[taskId].data[15] = -1;
|
||||
gTasks[taskId].func = AnimTask_LoadMistTiles_Step;
|
||||
gTasks[taskId].func = AnimTask_MistBallFog_Step;
|
||||
}
|
||||
|
||||
static void AnimTask_LoadMistTiles_Step(u8 taskId)
|
||||
static void AnimTask_MistBallFog_Step(u8 taskId)
|
||||
{
|
||||
struct BattleAnimBgData animBg;
|
||||
|
||||
@@ -1123,7 +1127,7 @@ static void AnimTask_LoadMistTiles_Step(u8 taskId)
|
||||
{
|
||||
case 0:
|
||||
gTasks[taskId].data[9] += 1;
|
||||
gTasks[taskId].data[11] = wMistBlendAmounts[gTasks[taskId].data[9]];
|
||||
gTasks[taskId].data[11] = sMistBlendAmounts[gTasks[taskId].data[9]];
|
||||
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[11], 17 - gTasks[taskId].data[11]));
|
||||
if (gTasks[taskId].data[11] == 5)
|
||||
{
|
||||
@@ -1189,12 +1193,12 @@ static void InitPoisonGasCloudAnim(struct Sprite *sprite)
|
||||
if (GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2) < GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2))
|
||||
sprite->data[7] = 0x8000;
|
||||
|
||||
if ((gBattlerPositions[gBattleAnimTarget] & BIT_SIDE) == B_SIDE_PLAYER)
|
||||
if (GET_BATTLER_SIDE2(gBattleAnimTarget) == B_SIDE_PLAYER)
|
||||
{
|
||||
gBattleAnimArgs[1] = -gBattleAnimArgs[1];
|
||||
gBattleAnimArgs[3] = -gBattleAnimArgs[3];
|
||||
|
||||
if ((sprite->data[7] & 0x8000) && (gBattlerPositions[gBattleAnimAttacker] & BIT_SIDE) == B_SIDE_PLAYER)
|
||||
if ((sprite->data[7] & 0x8000) && GET_BATTLER_SIDE2(gBattleAnimAttacker) == B_SIDE_PLAYER)
|
||||
sprite->subpriority = gSprites[GetAnimBattlerSpriteId(ANIM_TARGET)].subpriority + 1;
|
||||
|
||||
sprite->data[6] = 1;
|
||||
@@ -1410,14 +1414,14 @@ static bool8 GenerateHailParticle(u8 hailStructId, u8 affineAnimNum, u8 taskId,
|
||||
}
|
||||
else
|
||||
{
|
||||
battlerX = (sHailCoordData[hailStructId].x);
|
||||
battlerY = (sHailCoordData[hailStructId].y);
|
||||
battlerX = sHailCoordData[hailStructId].x;
|
||||
battlerY = sHailCoordData[hailStructId].y;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
battlerX = (sHailCoordData[hailStructId].x);
|
||||
battlerY = (sHailCoordData[hailStructId].y);
|
||||
battlerX = sHailCoordData[hailStructId].x;
|
||||
battlerY = sHailCoordData[hailStructId].y;
|
||||
}
|
||||
spriteX = battlerX - ((battlerY + 8) / 2);
|
||||
id = CreateSprite(&gHailParticleSpriteTemplate, spriteX, -8, 18);
|
||||
@@ -1454,7 +1458,7 @@ static void AnimHailBegin(struct Sprite *sprite)
|
||||
sprite->data[3], sprite->data[4], sprite->subpriority);
|
||||
|
||||
sprite->data[0] = spriteId;
|
||||
if (spriteId != 64)
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
gSprites[sprite->data[0]].callback = AnimHailContinue;
|
||||
gSprites[sprite->data[0]].data[6] = sprite->data[6];
|
||||
@@ -1497,7 +1501,7 @@ static void InitIceBallAnim(struct Sprite *sprite)
|
||||
animNum = 4;
|
||||
|
||||
StartSpriteAffineAnim(sprite, animNum);
|
||||
InitSpritePosToAnimAttacker(sprite, 1);
|
||||
InitSpritePosToAnimAttacker(sprite, TRUE);
|
||||
|
||||
sprite->data[0] = gBattleAnimArgs[4];
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include "task.h"
|
||||
#include "trig.h"
|
||||
|
||||
// This file's functions.
|
||||
static void AnimTask_ShakeMon_Step(u8 taskId);
|
||||
static void AnimTask_ShakeMon2_Step(u8 taskId);
|
||||
static void AnimTask_ShakeMonInPlace_Step(u8 taskId);
|
||||
@@ -14,7 +13,7 @@ static void AnimTask_TranslateMonElliptical_Step(u8 taskId);
|
||||
static void DoHorizontalLunge(struct Sprite *sprite);
|
||||
static void ReverseHorizontalLungeDirection(struct Sprite *sprite);
|
||||
static void DoVerticalDip(struct Sprite *sprite);
|
||||
static void ReverseVerticalDipDirection(struct Sprite* sprite);
|
||||
static void ReverseVerticalDipDirection(struct Sprite *sprite);
|
||||
static void SlideMonToOriginalPos(struct Sprite *sprite);
|
||||
static void SlideMonToOriginalPos_Step(struct Sprite *sprite);
|
||||
static void SlideMonToOffset(struct Sprite *sprite);
|
||||
@@ -108,7 +107,7 @@ void AnimTask_ShakeMon(u8 taskId)
|
||||
gTasks[taskId].data[4] = gBattleAnimArgs[1];
|
||||
gTasks[taskId].data[5] = gBattleAnimArgs[2];
|
||||
gTasks[taskId].func = AnimTask_ShakeMon_Step;
|
||||
AnimTask_ShakeMon_Step(taskId);
|
||||
gTasks[taskId].func(taskId);
|
||||
}
|
||||
|
||||
static void AnimTask_ShakeMon_Step(u8 taskId)
|
||||
@@ -156,17 +155,14 @@ static void AnimTask_ShakeMon_Step(u8 taskId)
|
||||
void AnimTask_ShakeMon2(u8 taskId)
|
||||
{
|
||||
u8 spriteId;
|
||||
bool8 destroy = FALSE;
|
||||
bool8 abort = FALSE;
|
||||
u8 battlerId;
|
||||
|
||||
if (gBattleAnimArgs[0] < MAX_BATTLERS_COUNT)
|
||||
{
|
||||
spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]);
|
||||
if (spriteId == SPRITE_NONE)
|
||||
{
|
||||
DestroyAnimVisualTask(taskId);
|
||||
return;
|
||||
}
|
||||
abort = TRUE;
|
||||
}
|
||||
else if (gBattleAnimArgs[0] != 8)
|
||||
{
|
||||
@@ -188,7 +184,7 @@ void AnimTask_ShakeMon2(u8 taskId)
|
||||
}
|
||||
|
||||
if (IsBattlerSpriteVisible(battlerId) == FALSE)
|
||||
destroy = TRUE;
|
||||
abort = TRUE;
|
||||
|
||||
spriteId = gBattlerSpriteIds[battlerId];
|
||||
}
|
||||
@@ -197,7 +193,7 @@ void AnimTask_ShakeMon2(u8 taskId)
|
||||
spriteId = gBattlerSpriteIds[gBattleAnimAttacker];
|
||||
}
|
||||
|
||||
if (destroy)
|
||||
if (abort)
|
||||
{
|
||||
DestroyAnimVisualTask(taskId);
|
||||
return;
|
||||
@@ -332,10 +328,8 @@ void AnimTask_ShakeAndSinkMon(u8 taskId)
|
||||
|
||||
static void AnimTask_ShakeAndSinkMon_Step(u8 taskId)
|
||||
{
|
||||
s16 x;
|
||||
u8 spriteId;
|
||||
spriteId = gTasks[taskId].data[0];
|
||||
x = gTasks[taskId].data[1];
|
||||
u8 spriteId = gTasks[taskId].data[0];
|
||||
s16 x = gTasks[taskId].data[1];
|
||||
if (gTasks[taskId].data[2] == gTasks[taskId].data[8]++)
|
||||
{
|
||||
gTasks[taskId].data[8] = 0;
|
||||
@@ -365,11 +359,8 @@ static void AnimTask_ShakeAndSinkMon_Step(u8 taskId)
|
||||
void AnimTask_TranslateMonElliptical(u8 taskId)
|
||||
{
|
||||
u8 i;
|
||||
u8 spriteId;
|
||||
u8 wavePeriod;
|
||||
|
||||
wavePeriod = 1;
|
||||
spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]);
|
||||
u8 wavePeriod = 1;
|
||||
u8 spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[0]);
|
||||
if (gBattleAnimArgs[4] > 5)
|
||||
gBattleAnimArgs[4] = 5;
|
||||
|
||||
@@ -742,7 +733,7 @@ static void AnimTask_SlideOffScreen_Step(u8 taskId)
|
||||
{
|
||||
u8 spriteId = gTasks[taskId].data[0];
|
||||
gSprites[spriteId].x2 += gTasks[taskId].data[1];
|
||||
if (gSprites[spriteId].x2 + gSprites[spriteId].x + 0x20 > 0x130u)
|
||||
if (gSprites[spriteId].x2 + gSprites[spriteId].x < -32 || gSprites[spriteId].x2 + gSprites[spriteId].x > DISPLAY_WIDTH + 32)
|
||||
{
|
||||
DestroyAnimVisualTask(taskId);
|
||||
return;
|
||||
@@ -831,8 +822,7 @@ static void AnimTask_SwayMonStep(u8 taskId)
|
||||
// arg 4: sprite object mode
|
||||
void AnimTask_ScaleMonAndRestore(u8 taskId)
|
||||
{
|
||||
u8 spriteId;
|
||||
spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[3]);
|
||||
u8 spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[3]);
|
||||
PrepareBattlerSpriteForRotScale(spriteId, gBattleAnimArgs[4]);
|
||||
gTasks[taskId].data[0] = gBattleAnimArgs[0];
|
||||
gTasks[taskId].data[1] = gBattleAnimArgs[1];
|
||||
@@ -893,13 +883,13 @@ void AnimTask_RotateMonSpriteToSide(u8 taskId)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gBattleAnimArgs[2] == 0)
|
||||
if (gBattleAnimArgs[2] == ANIM_ATTACKER)
|
||||
{
|
||||
gTasks[taskId].data[7] = !GetBattlerSide(gBattleAnimAttacker);
|
||||
gTasks[taskId].data[7] = GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER;
|
||||
}
|
||||
else
|
||||
{
|
||||
gTasks[taskId].data[7] = !GetBattlerSide(gBattleAnimTarget);
|
||||
gTasks[taskId].data[7] = GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER;
|
||||
}
|
||||
}
|
||||
if (gTasks[taskId].data[7])
|
||||
@@ -916,8 +906,7 @@ void AnimTask_RotateMonSpriteToSide(u8 taskId)
|
||||
// Rotates mon to side and back to original position. For Peck and when a held item activates
|
||||
void AnimTask_RotateMonToSideAndRestore(u8 taskId)
|
||||
{
|
||||
u8 spriteId;
|
||||
spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[2]);
|
||||
u8 spriteId = GetAnimBattlerSpriteId(gBattleAnimArgs[2]);
|
||||
PrepareBattlerSpriteForRotScale(spriteId, ST_OAM_OBJ_NORMAL);
|
||||
gTasks[taskId].data[1] = 0;
|
||||
gTasks[taskId].data[2] = gBattleAnimArgs[0];
|
||||
|
||||
+44
-40
@@ -81,7 +81,7 @@ static const u8 sCastformBackSpriteYCoords[NUM_CASTFORM_FORMS] =
|
||||
#define TAG_MOVE_EFFECT_MON_1 55125
|
||||
#define TAG_MOVE_EFFECT_MON_2 55126
|
||||
|
||||
static const struct SpriteTemplate sSpriteTemplate_MoveEffectMons[] =
|
||||
static const struct SpriteTemplate sSpriteTemplates_MoveEffectMons[] =
|
||||
{
|
||||
{
|
||||
.tileTag = TAG_MOVE_EFFECT_MON_1,
|
||||
@@ -103,7 +103,7 @@ static const struct SpriteTemplate sSpriteTemplate_MoveEffectMons[] =
|
||||
}
|
||||
};
|
||||
|
||||
static const struct SpriteSheet sSpriteSheet_MoveEffectMons[] =
|
||||
static const struct SpriteSheet sSpriteSheets_MoveEffectMons[] =
|
||||
{
|
||||
{ gMiscBlank_Gfx, MON_PIC_SIZE, TAG_MOVE_EFFECT_MON_1, },
|
||||
{ gMiscBlank_Gfx, MON_PIC_SIZE, TAG_MOVE_EFFECT_MON_2, },
|
||||
@@ -414,7 +414,7 @@ u8 GetAnimBattlerSpriteId(u8 animBattler)
|
||||
}
|
||||
}
|
||||
|
||||
void StoreSpriteCallbackInData6(struct Sprite *sprite, void (*callback)(struct Sprite*))
|
||||
void StoreSpriteCallbackInData6(struct Sprite *sprite, void (*callback)(struct Sprite *))
|
||||
{
|
||||
sprite->data[6] = (u32)(callback) & 0xffff;
|
||||
sprite->data[7] = (u32)(callback) >> 16;
|
||||
@@ -440,7 +440,7 @@ void SetCallbackToStoredInData6(struct Sprite *sprite)
|
||||
#define sAmplitudeX sAmplitude
|
||||
#define sAmplitudeY data[4]
|
||||
|
||||
// TranslateSpriteInWavePattern
|
||||
// TranslateSpriteInLissajousCurve
|
||||
#define sCirclePosX sCirclePos
|
||||
#define sCircleSpeedX sCircleSpeed
|
||||
#define sCirclePosY data[4]
|
||||
@@ -487,7 +487,7 @@ void TranslateSpriteInGrowingCircle(struct Sprite *sprite)
|
||||
|
||||
// Unused
|
||||
// Exact shape depends on arguments. Can move in a figure-8-like pattern, or circular, etc.
|
||||
static void TranslateSpriteInWavePattern(struct Sprite *sprite)
|
||||
static void TranslateSpriteInLissajousCurve(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->sDuration)
|
||||
{
|
||||
@@ -495,7 +495,7 @@ static void TranslateSpriteInWavePattern(struct Sprite *sprite)
|
||||
sprite->y2 = Cos(sprite->sCirclePosY, sprite->sAmplitude);
|
||||
sprite->sCirclePosX += sprite->sCircleSpeedX;
|
||||
sprite->sCirclePosY += sprite->sCircleSpeedY;
|
||||
|
||||
|
||||
if (sprite->sCirclePosX >= 0x100)
|
||||
sprite->sCirclePosX -= 0x100;
|
||||
else if (sprite->sCirclePosX < 0)
|
||||
@@ -857,7 +857,7 @@ u8 GetBattlerSide(u8 battlerId)
|
||||
|
||||
u8 GetBattlerPosition(u8 battlerId)
|
||||
{
|
||||
return GET_BATTLER_POSITION(battlerId);
|
||||
return gBattlerPositions[battlerId];
|
||||
}
|
||||
|
||||
u8 GetBattlerAtPosition(u8 position)
|
||||
@@ -908,13 +908,17 @@ bool8 IsDoubleBattle(void)
|
||||
return IS_DOUBLE_BATTLE();
|
||||
}
|
||||
|
||||
#define BG_ANIM_PAL_1 8
|
||||
#define BG_ANIM_PAL_2 9
|
||||
#define BG_ANIM_PAL_CONTEST 14
|
||||
|
||||
void GetBattleAnimBg1Data(struct BattleAnimBgData *out)
|
||||
{
|
||||
if (IsContest())
|
||||
{
|
||||
out->bgTiles = gBattleAnimBgTileBuffer;
|
||||
out->bgTilemap = (u16 *)gBattleAnimBgTilemapBuffer;
|
||||
out->paletteId = 14;
|
||||
out->paletteId = BG_ANIM_PAL_CONTEST;
|
||||
out->bgId = 1;
|
||||
out->tilesOffset = 0;
|
||||
out->unused = 0;
|
||||
@@ -923,7 +927,7 @@ void GetBattleAnimBg1Data(struct BattleAnimBgData *out)
|
||||
{
|
||||
out->bgTiles = gBattleAnimBgTileBuffer;
|
||||
out->bgTilemap = (u16 *)gBattleAnimBgTilemapBuffer;
|
||||
out->paletteId = 8;
|
||||
out->paletteId = BG_ANIM_PAL_1;
|
||||
out->bgId = 1;
|
||||
out->tilesOffset = 0x200;
|
||||
out->unused = 0;
|
||||
@@ -936,7 +940,7 @@ void GetBattleAnimBgData(struct BattleAnimBgData *out, u32 bgId)
|
||||
{
|
||||
out->bgTiles = gBattleAnimBgTileBuffer;
|
||||
out->bgTilemap = (u16 *)gBattleAnimBgTilemapBuffer;
|
||||
out->paletteId = 14;
|
||||
out->paletteId = BG_ANIM_PAL_CONTEST;
|
||||
out->bgId = 1;
|
||||
out->tilesOffset = 0;
|
||||
out->unused = 0;
|
||||
@@ -949,7 +953,7 @@ void GetBattleAnimBgData(struct BattleAnimBgData *out, u32 bgId)
|
||||
{
|
||||
out->bgTiles = gBattleAnimBgTileBuffer;
|
||||
out->bgTilemap = (u16 *)gBattleAnimBgTilemapBuffer;
|
||||
out->paletteId = 9;
|
||||
out->paletteId = BG_ANIM_PAL_2;
|
||||
out->bgId = 2;
|
||||
out->tilesOffset = 0x300;
|
||||
out->unused = 0;
|
||||
@@ -962,21 +966,21 @@ void GetBgDataForTransform(struct BattleAnimBgData *out, u8 battlerId)
|
||||
out->bgTilemap = (u16 *)gBattleAnimBgTilemapBuffer;
|
||||
if (IsContest())
|
||||
{
|
||||
out->paletteId = 14;
|
||||
out->paletteId = BG_ANIM_PAL_CONTEST;
|
||||
out->bgId = 1;
|
||||
out->tilesOffset = 0;
|
||||
out->unused = 0;
|
||||
}
|
||||
else if (GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) == 1)
|
||||
{
|
||||
out->paletteId = 8;
|
||||
out->paletteId = BG_ANIM_PAL_1;
|
||||
out->bgId = 1;
|
||||
out->tilesOffset = 0x200;
|
||||
out->unused = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
out->paletteId = 9;
|
||||
out->paletteId = BG_ANIM_PAL_2;
|
||||
out->bgId = 2;
|
||||
out->tilesOffset = 0x300;
|
||||
out->unused = 0;
|
||||
@@ -1361,14 +1365,14 @@ void ResetSpriteRotScale_PreserveAffine(struct Sprite *sprite)
|
||||
CalcCenterToCornerVec(sprite, sprite->oam.shape, sprite->oam.size, sprite->oam.affineMode);
|
||||
}
|
||||
|
||||
static u16 ArcTan2_(s16 a, s16 b)
|
||||
static u16 ArcTan2_(s16 x, s16 y)
|
||||
{
|
||||
return ArcTan2(a, b);
|
||||
return ArcTan2(x, y);
|
||||
}
|
||||
|
||||
u16 ArcTan2Neg(s16 a, s16 b)
|
||||
u16 ArcTan2Neg(s16 x, s16 y)
|
||||
{
|
||||
u16 var = ArcTan2_(a, b);
|
||||
u16 var = ArcTan2_(x, y);
|
||||
return -var;
|
||||
}
|
||||
|
||||
@@ -1401,7 +1405,7 @@ void SetGrayscaleOrOriginalPalette(u16 paletteNum, bool8 restoreOriginalColor)
|
||||
}
|
||||
}
|
||||
|
||||
u32 GetBattleBgPalettesMask(u8 battleBackground, u8 attacker, u8 target, u8 attackerPartner, u8 targetPartner, u8 a6, u8 a7)
|
||||
u32 GetBattlePalettesMask(bool8 battleBackground, bool8 attacker, bool8 target, bool8 attackerPartner, bool8 targetPartner, bool8 anim1, bool8 anim2)
|
||||
{
|
||||
u32 selectedPalettes = 0;
|
||||
u32 shift;
|
||||
@@ -1409,7 +1413,7 @@ u32 GetBattleBgPalettesMask(u8 battleBackground, u8 attacker, u8 target, u8 atta
|
||||
if (battleBackground)
|
||||
{
|
||||
if (!IsContest())
|
||||
selectedPalettes = 0xe;
|
||||
selectedPalettes = 0xe; // Palettes 1, 2, and 3
|
||||
else
|
||||
selectedPalettes = 1 << GetBattleBgPaletteNum();
|
||||
}
|
||||
@@ -1439,17 +1443,17 @@ u32 GetBattleBgPalettesMask(u8 battleBackground, u8 attacker, u8 target, u8 atta
|
||||
selectedPalettes |= 1 << shift;
|
||||
}
|
||||
}
|
||||
if (a6)
|
||||
if (anim1)
|
||||
{
|
||||
if (!IsContest())
|
||||
selectedPalettes |= 0x100;
|
||||
selectedPalettes |= 1 << BG_ANIM_PAL_1;
|
||||
else
|
||||
selectedPalettes |= 0x4000;
|
||||
selectedPalettes |= 1 << BG_ANIM_PAL_CONTEST;
|
||||
}
|
||||
if (a7)
|
||||
if (anim2)
|
||||
{
|
||||
if (!IsContest())
|
||||
selectedPalettes |= 0x200;
|
||||
selectedPalettes |= 1 << BG_ANIM_PAL_2;
|
||||
}
|
||||
return selectedPalettes;
|
||||
}
|
||||
@@ -1504,13 +1508,13 @@ u32 GetBattleMonSpritePalettesMask(u8 playerLeft, u8 playerRight, u8 opponentLef
|
||||
return selectedPalettes;
|
||||
}
|
||||
|
||||
// Presumably something commented here, just returns arg
|
||||
u8 AnimDummyReturnArg(u8 battler)
|
||||
u8 GetSpritePalIdxByBattler(u8 battler)
|
||||
{
|
||||
return battler;
|
||||
}
|
||||
|
||||
static u8 GetBattlerAtPosition_(u8 position)
|
||||
// Unused
|
||||
static u8 GetSpritePalIdxByPosition(u8 position)
|
||||
{
|
||||
return GetBattlerAtPosition(position);
|
||||
}
|
||||
@@ -1548,20 +1552,20 @@ void AnimSpriteOnMonPos(struct Sprite *sprite)
|
||||
// arg 5: lower 8 bits = location on attacking mon, upper 8 bits = location on target mon pick to target
|
||||
void TranslateAnimSpriteToTargetMonLocation(struct Sprite *sprite)
|
||||
{
|
||||
bool8 v1;
|
||||
bool8 respectMonPicOffsets;
|
||||
u8 coordType;
|
||||
|
||||
if (!(gBattleAnimArgs[5] & 0xff00))
|
||||
v1 = TRUE;
|
||||
respectMonPicOffsets = TRUE;
|
||||
else
|
||||
v1 = FALSE;
|
||||
respectMonPicOffsets = FALSE;
|
||||
|
||||
if (!(gBattleAnimArgs[5] & 0xff))
|
||||
coordType = BATTLER_COORD_Y_PIC_OFFSET;
|
||||
else
|
||||
coordType = BATTLER_COORD_Y;
|
||||
|
||||
InitSpritePosToAnimAttacker(sprite, v1);
|
||||
InitSpritePosToAnimAttacker(sprite, respectMonPicOffsets);
|
||||
if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER)
|
||||
gBattleAnimArgs[2] = -gBattleAnimArgs[2];
|
||||
|
||||
@@ -1574,7 +1578,7 @@ void TranslateAnimSpriteToTargetMonLocation(struct Sprite *sprite)
|
||||
|
||||
void AnimThrowProjectile(struct Sprite *sprite)
|
||||
{
|
||||
InitSpritePosToAnimAttacker(sprite, 1);
|
||||
InitSpritePosToAnimAttacker(sprite, TRUE);
|
||||
if (GetBattlerSide(gBattleAnimAttacker))
|
||||
gBattleAnimArgs[2] = -gBattleAnimArgs[2];
|
||||
sprite->data[0] = gBattleAnimArgs[4];
|
||||
@@ -2093,8 +2097,8 @@ u8 GetBattlerSpriteBGPriorityRank(u8 battlerId)
|
||||
u8 CreateAdditionalMonSpriteForMoveAnim(u16 species, bool8 isBackpic, u8 id, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId, bool32 ignoreDeoxysForm)
|
||||
{
|
||||
u8 spriteId;
|
||||
u16 sheet = LoadSpriteSheet(&sSpriteSheet_MoveEffectMons[id]);
|
||||
u16 palette = AllocSpritePalette(sSpriteTemplate_MoveEffectMons[id].paletteTag);
|
||||
u16 sheet = LoadSpriteSheet(&sSpriteSheets_MoveEffectMons[id]);
|
||||
u16 palette = AllocSpritePalette(sSpriteTemplates_MoveEffectMons[id].paletteTag);
|
||||
|
||||
if (gMonSpritesGfxPtr != NULL && gMonSpritesGfxPtr->buffer == NULL)
|
||||
gMonSpritesGfxPtr->buffer = AllocZeroed(0x2000);
|
||||
@@ -2135,9 +2139,9 @@ u8 CreateAdditionalMonSpriteForMoveAnim(u16 species, bool8 isBackpic, u8 id, s16
|
||||
FREE_AND_SET_NULL(gMonSpritesGfxPtr->buffer);
|
||||
|
||||
if (!isBackpic)
|
||||
spriteId = CreateSprite(&sSpriteTemplate_MoveEffectMons[id], x, y + gMonFrontPicCoords[species].y_offset, subpriority);
|
||||
spriteId = CreateSprite(&sSpriteTemplates_MoveEffectMons[id], x, y + gMonFrontPicCoords[species].y_offset, subpriority);
|
||||
else
|
||||
spriteId = CreateSprite(&sSpriteTemplate_MoveEffectMons[id], x, y + gMonBackPicCoords[species].y_offset, subpriority);
|
||||
spriteId = CreateSprite(&sSpriteTemplates_MoveEffectMons[id], x, y + gMonBackPicCoords[species].y_offset, subpriority);
|
||||
|
||||
if (IsContest())
|
||||
{
|
||||
@@ -2425,7 +2429,7 @@ void AnimTask_AttackerPunchWithTrace(u8 taskId)
|
||||
|
||||
dest = (task->tPaletteNum + 16) * 16;
|
||||
src = (gSprites[task->tBattlerSpriteId].oam.paletteNum + 0x10) * 0x10;
|
||||
|
||||
|
||||
// Set trace's priority based on battler's subpriority
|
||||
task->tPriority = GetBattlerSpriteSubpriority(gBattleAnimAttacker);
|
||||
if (task->tPriority == 20 || task->tPriority == 40)
|
||||
@@ -2515,7 +2519,7 @@ void AnimWeatherBallUp(struct Sprite *sprite)
|
||||
{
|
||||
sprite->x = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_X_2);
|
||||
sprite->y = GetBattlerSpriteCoord(gBattleAnimAttacker, BATTLER_COORD_Y_PIC_OFFSET);
|
||||
if (!GetBattlerSide(gBattleAnimAttacker))
|
||||
if (GetBattlerSide(gBattleAnimAttacker) == B_SIDE_PLAYER)
|
||||
sprite->data[0] = 5;
|
||||
else
|
||||
sprite->data[0] = -10;
|
||||
@@ -2541,7 +2545,7 @@ void AnimWeatherBallDown(struct Sprite *sprite)
|
||||
sprite->data[0] = gBattleAnimArgs[2];
|
||||
sprite->data[2] = sprite->x + gBattleAnimArgs[4];
|
||||
sprite->data[4] = sprite->y + gBattleAnimArgs[5];
|
||||
if (!GetBattlerSide(gBattleAnimTarget))
|
||||
if (GetBattlerSide(gBattleAnimTarget) == B_SIDE_PLAYER)
|
||||
{
|
||||
x = (u16)gBattleAnimArgs[4] + 30;
|
||||
sprite->x += x;
|
||||
|
||||
+27
-27
@@ -304,7 +304,7 @@ static void AnimConfusionDuck_Step(struct Sprite *sprite)
|
||||
// arg 4: blend color
|
||||
static void AnimSimplePaletteBlend(struct Sprite *sprite)
|
||||
{
|
||||
u32 selectedPalettes = UnpackSelectedBattleBgPalettes(gBattleAnimArgs[0]);
|
||||
u32 selectedPalettes = UnpackSelectedBattlePalettes(gBattleAnimArgs[0]);
|
||||
BeginNormalPaletteFade(selectedPalettes, gBattleAnimArgs[1], gBattleAnimArgs[2], gBattleAnimArgs[3], gBattleAnimArgs[4]);
|
||||
sprite->invisible = TRUE;
|
||||
sprite->callback = AnimSimplePaletteBlend_Step;
|
||||
@@ -312,23 +312,23 @@ static void AnimSimplePaletteBlend(struct Sprite *sprite)
|
||||
|
||||
// Unpacks a bitfield and returns a bitmask of its selected palettes.
|
||||
// Bits 0-6 of the selector parameter result in the following palettes being selected:
|
||||
// 0: battle background palettes (BG palettes 1, 2, and 3)
|
||||
// 1: gBattleAnimAttacker OBJ palette
|
||||
// 2: gBattleAnimTarget OBJ palette
|
||||
// 3: gBattleAnimAttacker partner OBJ palette
|
||||
// 4: gBattleAnimTarget partner OBJ palette
|
||||
// 5: BG palette 4
|
||||
// 6: BG palette 5
|
||||
u32 UnpackSelectedBattleBgPalettes(s16 selector)
|
||||
// 0: F_PAL_BG, battle background palettes (BG palettes 1, 2, and 3)
|
||||
// 1: F_PAL_ATTACKER, gBattleAnimAttacker OBJ palette
|
||||
// 2: F_PAL_TARGET, gBattleAnimTarget OBJ palette
|
||||
// 3: F_PAL_ATK_PARTNER, gBattleAnimAttacker partner OBJ palette
|
||||
// 4: F_PAL_DEF_PARTNER, gBattleAnimTarget partner OBJ palette
|
||||
// 5: F_PAL_ANIM_1, BG palette 8 (or 14, if in Contest)
|
||||
// 6: F_PAL_ANIM_2, BG palette 9
|
||||
u32 UnpackSelectedBattlePalettes(s16 selector)
|
||||
{
|
||||
u8 battleBackground = selector & 1;
|
||||
u8 attacker = (selector >> 1) & 1;
|
||||
u8 target = (selector >> 2) & 1;
|
||||
u8 attackerPartner = (selector >> 3) & 1;
|
||||
u8 targetPartner = (selector >> 4) & 1;
|
||||
u8 arg5 = (selector >> 5) & 1;
|
||||
u8 arg6 = (selector >> 6) & 1;
|
||||
return GetBattleBgPalettesMask(battleBackground, attacker, target, attackerPartner, targetPartner, arg5, arg6);
|
||||
bool8 battleBackground = selector & 1;
|
||||
bool8 attacker = (selector >> 1) & 1;
|
||||
bool8 target = (selector >> 2) & 1;
|
||||
bool8 attackerPartner = (selector >> 3) & 1;
|
||||
bool8 targetPartner = (selector >> 4) & 1;
|
||||
bool8 anim1 = (selector >> 5) & 1;
|
||||
bool8 anim2 = (selector >> 6) & 1;
|
||||
return GetBattlePalettesMask(battleBackground, attacker, target, attackerPartner, targetPartner, anim1, anim2);
|
||||
}
|
||||
|
||||
static void AnimSimplePaletteBlend_Step(struct Sprite *sprite)
|
||||
@@ -350,7 +350,7 @@ static void AnimComplexPaletteBlend(struct Sprite *sprite)
|
||||
sprite->data[6] = gBattleAnimArgs[6];
|
||||
sprite->data[7] = gBattleAnimArgs[0];
|
||||
|
||||
selectedPalettes = UnpackSelectedBattleBgPalettes(sprite->data[7]);
|
||||
selectedPalettes = UnpackSelectedBattlePalettes(sprite->data[7]);
|
||||
BlendPalettes(selectedPalettes, gBattleAnimArgs[4], gBattleAnimArgs[3]);
|
||||
sprite->invisible = TRUE;
|
||||
sprite->callback = AnimComplexPaletteBlend_Step1;
|
||||
@@ -375,7 +375,7 @@ static void AnimComplexPaletteBlend_Step1(struct Sprite *sprite)
|
||||
return;
|
||||
}
|
||||
|
||||
selectedPalettes = UnpackSelectedBattleBgPalettes(sprite->data[7]);
|
||||
selectedPalettes = UnpackSelectedBattlePalettes(sprite->data[7]);
|
||||
if (sprite->data[1] & 0x100)
|
||||
BlendPalettes(selectedPalettes, sprite->data[4], sprite->data[3]);
|
||||
else
|
||||
@@ -392,7 +392,7 @@ static void AnimComplexPaletteBlend_Step2(struct Sprite *sprite)
|
||||
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
selectedPalettes = UnpackSelectedBattleBgPalettes(sprite->data[7]);
|
||||
selectedPalettes = UnpackSelectedBattlePalettes(sprite->data[7]);
|
||||
BlendPalettes(selectedPalettes, 0, 0);
|
||||
DestroyAnimSprite(sprite);
|
||||
}
|
||||
@@ -442,7 +442,7 @@ void AnimTask_BlendColorCycle(u8 taskId)
|
||||
|
||||
static void BlendColorCycle(u8 taskId, u8 startBlendAmount, u8 targetBlendAmount)
|
||||
{
|
||||
u32 selectedPalettes = UnpackSelectedBattleBgPalettes(gTasks[taskId].tPalSelector);
|
||||
u32 selectedPalettes = UnpackSelectedBattlePalettes(gTasks[taskId].tPalSelector);
|
||||
BeginNormalPaletteFade(
|
||||
selectedPalettes,
|
||||
gTasks[taskId].tDelay,
|
||||
@@ -721,7 +721,7 @@ void AnimTask_InvertScreenColor(u8 taskId)
|
||||
u8 targetBattler = gBattleAnimTarget;
|
||||
|
||||
if (gBattleAnimArgs[0] & 0x100)
|
||||
selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0);
|
||||
selectedPalettes = GetBattlePalettesMask(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
|
||||
|
||||
if (gBattleAnimArgs[1] & 0x100)
|
||||
selectedPalettes |= (0x10000 << attackerBattler);
|
||||
@@ -945,7 +945,7 @@ static void AnimHitSplatBasic(struct Sprite *sprite)
|
||||
{
|
||||
StartSpriteAffineAnim(sprite, gBattleAnimArgs[3]);
|
||||
if (gBattleAnimArgs[2] == ANIM_ATTACKER)
|
||||
InitSpritePosToAnimAttacker(sprite, 1);
|
||||
InitSpritePosToAnimAttacker(sprite, TRUE);
|
||||
else
|
||||
InitSpritePosToAnimTarget(sprite, TRUE);
|
||||
|
||||
@@ -958,7 +958,7 @@ static void AnimHitSplatPersistent(struct Sprite *sprite)
|
||||
{
|
||||
StartSpriteAffineAnim(sprite, gBattleAnimArgs[3]);
|
||||
if (gBattleAnimArgs[2] == ANIM_ATTACKER)
|
||||
InitSpritePosToAnimAttacker(sprite, 1);
|
||||
InitSpritePosToAnimAttacker(sprite, TRUE);
|
||||
else
|
||||
InitSpritePosToAnimTarget(sprite, TRUE);
|
||||
|
||||
@@ -984,7 +984,7 @@ static void AnimHitSplatRandom(struct Sprite *sprite)
|
||||
|
||||
StartSpriteAffineAnim(sprite, gBattleAnimArgs[1]);
|
||||
if (gBattleAnimArgs[0] == ANIM_ATTACKER)
|
||||
InitSpritePosToAnimAttacker(sprite, 0);
|
||||
InitSpritePosToAnimAttacker(sprite, FALSE);
|
||||
else
|
||||
InitSpritePosToAnimTarget(sprite, FALSE);
|
||||
|
||||
@@ -1010,7 +1010,7 @@ static void AnimHitSplatOnMonEdge(struct Sprite *sprite)
|
||||
static void AnimCrossImpact(struct Sprite *sprite)
|
||||
{
|
||||
if (gBattleAnimArgs[2] == ANIM_ATTACKER)
|
||||
InitSpritePosToAnimAttacker(sprite, 1);
|
||||
InitSpritePosToAnimAttacker(sprite, TRUE);
|
||||
else
|
||||
InitSpritePosToAnimTarget(sprite, TRUE);
|
||||
|
||||
@@ -1023,7 +1023,7 @@ static void AnimFlashingHitSplat(struct Sprite *sprite)
|
||||
{
|
||||
StartSpriteAffineAnim(sprite, gBattleAnimArgs[3]);
|
||||
if (gBattleAnimArgs[2] == ANIM_ATTACKER)
|
||||
InitSpritePosToAnimAttacker(sprite, 1);
|
||||
InitSpritePosToAnimAttacker(sprite, TRUE);
|
||||
else
|
||||
InitSpritePosToAnimTarget(sprite, TRUE);
|
||||
|
||||
|
||||
@@ -190,7 +190,7 @@ static void AnimSludgeProjectile(struct Sprite *sprite)
|
||||
if (!gBattleAnimArgs[3])
|
||||
StartSpriteAnim(sprite, 2);
|
||||
|
||||
InitSpritePosToAnimAttacker(sprite, 1);
|
||||
InitSpritePosToAnimAttacker(sprite, TRUE);
|
||||
|
||||
sprite->data[0] = gBattleAnimArgs[2];
|
||||
sprite->data[2] = GetBattlerSpriteCoord(gBattleAnimTarget, BATTLER_COORD_X_2);
|
||||
@@ -214,8 +214,8 @@ static void AnimAcidPoisonBubble(struct Sprite *sprite)
|
||||
if (!gBattleAnimArgs[3])
|
||||
StartSpriteAnim(sprite, 2);
|
||||
|
||||
InitSpritePosToAnimAttacker(sprite, 1);
|
||||
SetAverageBattlerPositions(gBattleAnimTarget, 1, &l1, &l2);
|
||||
InitSpritePosToAnimAttacker(sprite, TRUE);
|
||||
SetAverageBattlerPositions(gBattleAnimTarget, TRUE, &l1, &l2);
|
||||
|
||||
if (GetBattlerSide(gBattleAnimAttacker))
|
||||
gBattleAnimArgs[4] = -gBattleAnimArgs[4];
|
||||
|
||||
@@ -570,7 +570,7 @@ static void AnimDefensiveWall_Step5(struct Sprite *sprite)
|
||||
if (IsBattlerSpriteVisible(battler))
|
||||
ResetBattleAnimBg(toBG2);
|
||||
|
||||
battler = battlerCopy ^ 2;
|
||||
battler = BATTLE_PARTNER(battlerCopy);
|
||||
if (IsBattlerSpriteVisible(battler))
|
||||
ResetBattleAnimBg(toBG2 ^ var0);
|
||||
}
|
||||
@@ -583,9 +583,9 @@ static void AnimWallSparkle(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->data[0] == 0)
|
||||
{
|
||||
int arg3 = gBattleAnimArgs[3];
|
||||
bool32 ignoreOffsets = gBattleAnimArgs[3];
|
||||
bool8 respectMonPicOffsets = FALSE;
|
||||
if (arg3 == 0)
|
||||
if (!ignoreOffsets)
|
||||
respectMonPicOffsets = TRUE;
|
||||
|
||||
if (!IsContest() && IsDoubleBattle())
|
||||
@@ -818,7 +818,7 @@ static void AnimTask_ImprisonOrbs_Step(u8 taskId)
|
||||
{
|
||||
for (i = 8; i < 13; i++)
|
||||
{
|
||||
if (task->data[i] != 64)
|
||||
if (task->data[i] != MAX_SPRITES)
|
||||
DestroySprite(&gSprites[task->data[i]]);
|
||||
}
|
||||
|
||||
@@ -918,7 +918,7 @@ static void AnimTask_SkillSwap_Step(u8 taskId)
|
||||
{
|
||||
task->data[1] = 0;
|
||||
spriteId = CreateSprite(&gSkillSwapOrbSpriteTemplate, task->data[11], task->data[12], 0);
|
||||
if (spriteId != 64)
|
||||
if (spriteId != MAX_SPRITES)
|
||||
{
|
||||
gSprites[spriteId].data[0] = 16;
|
||||
gSprites[spriteId].data[2] = task->data[13];
|
||||
@@ -997,12 +997,10 @@ void AnimTask_ExtrasensoryDistortion(u8 taskId)
|
||||
scanlineParams.dmaDest = ®_BG2HOFS;
|
||||
}
|
||||
|
||||
i = task->data[14];
|
||||
while (i <= task->data[14] + 64)
|
||||
for (i = task->data[14]; i <= task->data[14] + 64; i++)
|
||||
{
|
||||
gScanlineEffectRegBuffers[0][i] = task->data[10];
|
||||
gScanlineEffectRegBuffers[1][i] = task->data[10];
|
||||
i++;
|
||||
}
|
||||
|
||||
scanlineParams.dmaControl = SCANLINE_EFFECT_DMACNT_16BIT;
|
||||
@@ -1137,7 +1135,7 @@ static void AnimPsychoBoost(struct Sprite *sprite)
|
||||
case 1:
|
||||
if (sprite->affineAnimEnded)
|
||||
{
|
||||
PlaySE12WithPanning(SE_M_TELEPORT, BattleAnimAdjustPanning(-64));
|
||||
PlaySE12WithPanning(SE_M_TELEPORT, BattleAnimAdjustPanning(SOUND_PAN_ATTACKER));
|
||||
ChangeSpriteAffineAnim(sprite, 1);
|
||||
sprite->data[0]++;
|
||||
}
|
||||
|
||||
@@ -297,7 +297,7 @@ const struct SpriteTemplate gWeatherBallRockDownSpriteTemplate =
|
||||
static void AnimFallingRock(struct Sprite *sprite)
|
||||
{
|
||||
if (gBattleAnimArgs[3] != 0)
|
||||
SetAverageBattlerPositions(gBattleAnimTarget, 0, &sprite->x, &sprite->y);
|
||||
SetAverageBattlerPositions(gBattleAnimTarget, FALSE, &sprite->x, &sprite->y);
|
||||
|
||||
sprite->x += gBattleAnimArgs[0];
|
||||
sprite->y += 14;
|
||||
@@ -363,7 +363,7 @@ static void AnimRockFragment(struct Sprite *sprite)
|
||||
static void AnimParticleInVortex(struct Sprite *sprite)
|
||||
{
|
||||
if (gBattleAnimArgs[6] == ANIM_ATTACKER)
|
||||
InitSpritePosToAnimAttacker(sprite, 0);
|
||||
InitSpritePosToAnimAttacker(sprite, FALSE);
|
||||
else
|
||||
InitSpritePosToAnimTarget(sprite, FALSE);
|
||||
|
||||
@@ -544,7 +544,7 @@ static void AnimFlyingSandCrescent(struct Sprite *sprite)
|
||||
static void AnimRaiseSprite(struct Sprite *sprite)
|
||||
{
|
||||
StartSpriteAnim(sprite, gBattleAnimArgs[4]);
|
||||
InitSpritePosToAnimAttacker(sprite, 0);
|
||||
InitSpritePosToAnimAttacker(sprite, FALSE);
|
||||
|
||||
sprite->data[0] = gBattleAnimArgs[3];
|
||||
sprite->data[2] = sprite->x;
|
||||
@@ -596,8 +596,8 @@ void AnimTask_Rollout(u8 taskId)
|
||||
task->data[6] = 0;
|
||||
task->data[7] = 0;
|
||||
|
||||
pan1 = BattleAnimAdjustPanning(-64);
|
||||
pan2 = BattleAnimAdjustPanning(63);
|
||||
pan1 = BattleAnimAdjustPanning(SOUND_PAN_ATTACKER);
|
||||
pan2 = BattleAnimAdjustPanning(SOUND_PAN_TARGET);
|
||||
|
||||
task->data[13] = pan1;
|
||||
task->data[14] = (pan2 - pan1) / task->data[8];
|
||||
|
||||
@@ -7,8 +7,13 @@
|
||||
#include "util.h"
|
||||
#include "constants/battle_palace.h"
|
||||
|
||||
static void SmokescreenImpact_Callback(struct Sprite *);
|
||||
static void SpriteCB_DestroySprite(struct Sprite *sprite);
|
||||
#define TAG_SMOKESCREEN 55019
|
||||
|
||||
#define PALTAG_SHADOW 55039
|
||||
#define GFXTAG_SHADOW 55129
|
||||
|
||||
static void SpriteCB_SmokescreenImpactMain(struct Sprite *);
|
||||
static void SpriteCB_SmokescreenImpact(struct Sprite *);
|
||||
|
||||
// The below data for smokescreen starts and ends with some data that belongs to battle_gfx_sfx_util.c
|
||||
|
||||
@@ -43,12 +48,12 @@ const u8 gBattlePalaceNatureToMoveTarget[NUM_NATURES] =
|
||||
|
||||
static const struct CompressedSpriteSheet sSmokescreenImpactSpriteSheet =
|
||||
{
|
||||
.data = gSmokescreenImpactTiles, .size = 0x180, .tag = 55019
|
||||
.data = gSmokescreenImpactTiles, .size = 0x180, .tag = TAG_SMOKESCREEN
|
||||
};
|
||||
|
||||
static const struct CompressedSpritePalette sSmokescreenImpactSpritePalette =
|
||||
{
|
||||
.data = gSmokescreenImpactPalette, .tag = 55019
|
||||
.data = gSmokescreenImpactPalette, .tag = TAG_SMOKESCREEN
|
||||
};
|
||||
|
||||
static const struct OamData sOamData_SmokescreenImpact =
|
||||
@@ -56,7 +61,7 @@ static const struct OamData sOamData_SmokescreenImpact =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(16x16),
|
||||
.x = 0,
|
||||
@@ -110,18 +115,18 @@ static const union AnimCmd *const sAnims_SmokescreenImpact[] =
|
||||
|
||||
static const struct SpriteTemplate sSmokescreenImpactSpriteTemplate =
|
||||
{
|
||||
.tileTag = 55019,
|
||||
.paletteTag = 55019,
|
||||
.tileTag = TAG_SMOKESCREEN,
|
||||
.paletteTag = TAG_SMOKESCREEN,
|
||||
.oam = &sOamData_SmokescreenImpact,
|
||||
.anims = sAnims_SmokescreenImpact,
|
||||
.images = NULL,
|
||||
.affineAnims = gDummySpriteAffineAnimTable,
|
||||
.callback = SpriteCB_DestroySprite
|
||||
.callback = SpriteCB_SmokescreenImpact
|
||||
};
|
||||
|
||||
const struct CompressedSpriteSheet gSpriteSheet_EnemyShadow =
|
||||
{
|
||||
.data = gEnemyMonShadow_Gfx, .size = 0x80, .tag = 55129
|
||||
.data = gEnemyMonShadow_Gfx, .size = 0x80, .tag = GFXTAG_SHADOW
|
||||
};
|
||||
|
||||
static const struct OamData sOamData_EnemyShadow =
|
||||
@@ -129,7 +134,7 @@ static const struct OamData sOamData_EnemyShadow =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(32x8),
|
||||
.x = 0,
|
||||
@@ -143,8 +148,8 @@ static const struct OamData sOamData_EnemyShadow =
|
||||
|
||||
const struct SpriteTemplate gSpriteTemplate_EnemyShadow =
|
||||
{
|
||||
.tileTag = 55129,
|
||||
.paletteTag = 55039,
|
||||
.tileTag = GFXTAG_SHADOW,
|
||||
.paletteTag = PALTAG_SHADOW,
|
||||
.oam = &sOamData_EnemyShadow,
|
||||
.anims = gDummySpriteAnimTable,
|
||||
.images = NULL,
|
||||
@@ -152,7 +157,12 @@ const struct SpriteTemplate gSpriteTemplate_EnemyShadow =
|
||||
.callback = SpriteCB_SetInvisible
|
||||
};
|
||||
|
||||
u8 SmokescreenImpact(s16 x, s16 y, u8 a3)
|
||||
#define sActiveSprites data[0]
|
||||
#define sPersist data[1]
|
||||
|
||||
#define sMainSpriteId data[0]
|
||||
|
||||
u8 SmokescreenImpact(s16 x, s16 y, bool8 persist)
|
||||
{
|
||||
u8 mainSpriteId;
|
||||
u8 spriteId1, spriteId2, spriteId3, spriteId4;
|
||||
@@ -164,54 +174,58 @@ u8 SmokescreenImpact(s16 x, s16 y, u8 a3)
|
||||
LoadCompressedSpritePaletteUsingHeap(&sSmokescreenImpactSpritePalette);
|
||||
}
|
||||
|
||||
mainSpriteId = CreateInvisibleSpriteWithCallback(SmokescreenImpact_Callback);
|
||||
mainSpriteId = CreateInvisibleSpriteWithCallback(SpriteCB_SmokescreenImpactMain);
|
||||
mainSprite = &gSprites[mainSpriteId];
|
||||
mainSprite->data[1] = a3;
|
||||
mainSprite->sPersist = persist;
|
||||
|
||||
// Top left sprite
|
||||
spriteId1 = CreateSprite(&sSmokescreenImpactSpriteTemplate, x - 16, y - 16, 2);
|
||||
gSprites[spriteId1].data[0] = mainSpriteId;
|
||||
mainSprite->data[0]++;
|
||||
gSprites[spriteId1].sMainSpriteId = mainSpriteId;
|
||||
mainSprite->sActiveSprites++;
|
||||
AnimateSprite(&gSprites[spriteId1]);
|
||||
|
||||
// Top right sprite
|
||||
spriteId2 = CreateSprite(&sSmokescreenImpactSpriteTemplate, x, y - 16, 2);
|
||||
gSprites[spriteId2].data[0] = mainSpriteId;
|
||||
mainSprite->data[0]++;
|
||||
gSprites[spriteId2].sMainSpriteId = mainSpriteId;
|
||||
mainSprite->sActiveSprites++;
|
||||
StartSpriteAnim(&gSprites[spriteId2], 1);
|
||||
AnimateSprite(&gSprites[spriteId2]);
|
||||
|
||||
// Bottom left sprite
|
||||
spriteId3 = CreateSprite(&sSmokescreenImpactSpriteTemplate, x - 16, y, 2);
|
||||
gSprites[spriteId3].data[0] = mainSpriteId;
|
||||
mainSprite->data[0]++;
|
||||
gSprites[spriteId3].sMainSpriteId = mainSpriteId;
|
||||
mainSprite->sActiveSprites++;
|
||||
StartSpriteAnim(&gSprites[spriteId3], 2);
|
||||
AnimateSprite(&gSprites[spriteId3]);
|
||||
|
||||
// Bottom right sprite
|
||||
spriteId4 = CreateSprite(&sSmokescreenImpactSpriteTemplate, x, y, 2);
|
||||
gSprites[spriteId4].data[0] = mainSpriteId;
|
||||
mainSprite->data[0]++;
|
||||
gSprites[spriteId4].sMainSpriteId = mainSpriteId;
|
||||
mainSprite->sActiveSprites++;
|
||||
StartSpriteAnim(&gSprites[spriteId4], 3);
|
||||
AnimateSprite(&gSprites[spriteId4]);
|
||||
|
||||
return mainSpriteId;
|
||||
}
|
||||
|
||||
static void SmokescreenImpact_Callback(struct Sprite *sprite)
|
||||
static void SpriteCB_SmokescreenImpactMain(struct Sprite *sprite)
|
||||
{
|
||||
if (!sprite->data[0])
|
||||
if (sprite->sActiveSprites == 0)
|
||||
{
|
||||
FreeSpriteTilesByTag(sSmokescreenImpactSpriteSheet.tag);
|
||||
FreeSpritePaletteByTag(sSmokescreenImpactSpritePalette.tag);
|
||||
if (!sprite->data[1])
|
||||
if (!sprite->sPersist)
|
||||
DestroySprite(sprite);
|
||||
else
|
||||
sprite->callback = SpriteCallbackDummy;
|
||||
}
|
||||
}
|
||||
|
||||
static void SpriteCB_DestroySprite(struct Sprite *sprite)
|
||||
static void SpriteCB_SmokescreenImpact(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->animEnded)
|
||||
{
|
||||
gSprites[sprite->data[0]].data[0]--;
|
||||
gSprites[sprite->sMainSpriteId].sActiveSprites--;
|
||||
DestroySprite(sprite);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ void SoundTask_LoopSEAdjustPanning(u8 taskId)
|
||||
gTasks[taskId].data[12] = r9;
|
||||
|
||||
gTasks[taskId].func = SoundTask_LoopSEAdjustPanning_Step;
|
||||
SoundTask_LoopSEAdjustPanning_Step(taskId);
|
||||
gTasks[taskId].func(taskId);
|
||||
}
|
||||
|
||||
static void SoundTask_LoopSEAdjustPanning_Step(u8 taskId)
|
||||
@@ -135,10 +135,12 @@ void SoundTask_PlayCryHighPitch(u8 taskId)
|
||||
{
|
||||
if (gBattleAnimArgs[0] == ANIM_ATTACKER)
|
||||
species = gContestResources->moveAnim->species;
|
||||
#ifndef UBFIX
|
||||
// Destroying the task twice (here and at end of function)
|
||||
// results in an incorrect value for gAnimVisualTaskCount
|
||||
#ifndef BUGFIX
|
||||
else
|
||||
DestroyAnimVisualTask(taskId); // UB: task gets destroyed twice.
|
||||
#endif
|
||||
DestroyAnimVisualTask(taskId);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -181,10 +183,12 @@ void SoundTask_PlayDoubleCry(u8 taskId)
|
||||
{
|
||||
if (gBattleAnimArgs[0] == ANIM_ATTACKER)
|
||||
species = gContestResources->moveAnim->species;
|
||||
#ifndef UBFIX
|
||||
// Destroying the task twice (here and at end of function)
|
||||
// results in an incorrect value for gAnimVisualTaskCount
|
||||
#ifndef BUGFIX
|
||||
else
|
||||
DestroyAnimVisualTask(taskId); // UB: task gets destroyed twice.
|
||||
#endif
|
||||
DestroyAnimVisualTask(taskId);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -381,7 +385,7 @@ void SoundTask_AdjustPanningVar(u8 taskId)
|
||||
gTasks[taskId].data[11] = sourcePan;
|
||||
|
||||
gTasks[taskId].func = SoundTask_AdjustPanningVar_Step;
|
||||
SoundTask_AdjustPanningVar_Step(taskId);
|
||||
gTasks[taskId].func(taskId);
|
||||
}
|
||||
|
||||
static void SoundTask_AdjustPanningVar_Step(u8 taskId)
|
||||
|
||||
@@ -248,7 +248,7 @@ static const struct SubspriteTable sFrozenIceCubeSubspriteTable[] =
|
||||
{ARRAY_COUNT(sFrozenIceCubeSubsprites), sFrozenIceCubeSubsprites},
|
||||
};
|
||||
|
||||
static const struct SpriteTemplate gFrozenIceCubeSpriteTemplate =
|
||||
static const struct SpriteTemplate sFrozenIceCubeSpriteTemplate =
|
||||
{
|
||||
.tileTag = ANIM_TAG_ICE_CUBE,
|
||||
.paletteTag = ANIM_TAG_ICE_CUBE,
|
||||
@@ -389,7 +389,7 @@ void AnimTask_FrozenIceCube(u8 taskId)
|
||||
x -= 6;
|
||||
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL);
|
||||
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16));
|
||||
spriteId = CreateSprite(&gFrozenIceCubeSpriteTemplate, x, y, 4);
|
||||
spriteId = CreateSprite(&sFrozenIceCubeSpriteTemplate, x, y, 4);
|
||||
if (GetSpriteTileStartByTag(ANIM_TAG_ICE_CUBE) == 0xFFFF)
|
||||
gSprites[spriteId].invisible = TRUE;
|
||||
SetSubspriteTables(&gSprites[spriteId], sFrozenIceCubeSubspriteTable);
|
||||
@@ -549,7 +549,7 @@ void LaunchStatusAnimation(u8 battlerId, u8 statusAnimId)
|
||||
|
||||
gBattleAnimAttacker = battlerId;
|
||||
gBattleAnimTarget = battlerId;
|
||||
LaunchBattleAnimation(gBattleAnims_StatusConditions, statusAnimId, 0);
|
||||
LaunchBattleAnimation(gBattleAnims_StatusConditions, statusAnimId, FALSE);
|
||||
taskId = CreateTask(Task_DoStatusAnimation, 10);
|
||||
gTasks[taskId].data[0] = battlerId;
|
||||
}
|
||||
|
||||
+14
-14
@@ -515,7 +515,7 @@ static void AnimTask_UnusedLevelUpHealthBox_Step(u8 taskId)
|
||||
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[12], 16 - gTasks[taskId].data[12]));
|
||||
if (gTasks[taskId].data[12] == 0)
|
||||
{
|
||||
ResetBattleAnimBg(0);
|
||||
ResetBattleAnimBg(FALSE);
|
||||
gBattle_WIN0H = 0;
|
||||
gBattle_WIN0V = 0;
|
||||
SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR);
|
||||
@@ -550,8 +550,8 @@ static void LoadHealthboxPalsForLevelUp(u8 *paletteId1, u8 *paletteId2, u8 battl
|
||||
healthBoxSpriteId = gHealthboxSpriteIds[battler];
|
||||
spriteId1 = gSprites[healthBoxSpriteId].oam.affineParam;
|
||||
spriteId2 = gSprites[healthBoxSpriteId].data[5];
|
||||
*paletteId1 = AllocSpritePalette(0xD709);
|
||||
*paletteId2 = AllocSpritePalette(0xD70A);
|
||||
*paletteId1 = AllocSpritePalette(TAG_HEALTHBOX_PALS_1);
|
||||
*paletteId2 = AllocSpritePalette(TAG_HEALTHBOX_PALS_2);
|
||||
|
||||
offset1 = (gSprites[healthBoxSpriteId].oam.paletteNum * 16) + 0x100;
|
||||
offset2 = (gSprites[spriteId2].oam.paletteNum * 16) + 0x100;
|
||||
@@ -580,10 +580,10 @@ static void FreeHealthboxPalsForLevelUp(u8 battler)
|
||||
spriteId1 = gSprites[healthBoxSpriteId].oam.affineParam;
|
||||
spriteId2 = gSprites[healthBoxSpriteId].data[5];
|
||||
|
||||
FreeSpritePaletteByTag(0xD709);
|
||||
FreeSpritePaletteByTag(0xD70A);
|
||||
paletteId1 = IndexOfSpritePaletteTag(0xD6FF);
|
||||
paletteId2 = IndexOfSpritePaletteTag(0xD704);
|
||||
FreeSpritePaletteByTag(TAG_HEALTHBOX_PALS_1);
|
||||
FreeSpritePaletteByTag(TAG_HEALTHBOX_PALS_2);
|
||||
paletteId1 = IndexOfSpritePaletteTag(TAG_HEALTHBOX_PAL);
|
||||
paletteId2 = IndexOfSpritePaletteTag(TAG_HEALTHBAR_PAL);
|
||||
gSprites[healthBoxSpriteId].oam.paletteNum = paletteId1;
|
||||
gSprites[spriteId1].oam.paletteNum = paletteId1;
|
||||
gSprites[spriteId2].oam.paletteNum = paletteId2;
|
||||
@@ -611,7 +611,7 @@ static void AnimTask_FlashHealthboxOnLevelUp_Step(u8 taskId)
|
||||
if (gTasks[taskId].data[0]++ >= gTasks[taskId].data[11])
|
||||
{
|
||||
gTasks[taskId].data[0] = 0;
|
||||
paletteNum = IndexOfSpritePaletteTag(0xD709);
|
||||
paletteNum = IndexOfSpritePaletteTag(TAG_HEALTHBOX_PALS_1);
|
||||
colorOffset = gTasks[taskId].data[10] == 0 ? 6 : 2;
|
||||
switch (gTasks[taskId].data[1])
|
||||
{
|
||||
@@ -690,7 +690,7 @@ void AnimTask_SwitchOutBallEffect(u8 taskId)
|
||||
priority = gSprites[spriteId].oam.priority;
|
||||
subpriority = gSprites[spriteId].subpriority;
|
||||
gTasks[taskId].data[10] = AnimateBallOpenParticles(x, y + 32, priority, subpriority, ballId);
|
||||
selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0);
|
||||
selectedPalettes = GetBattlePalettesMask(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
|
||||
gTasks[taskId].data[11] = LaunchBallFadeMonTask(FALSE, gBattleAnimAttacker, selectedPalettes, ballId);
|
||||
gTasks[taskId].data[0]++;
|
||||
break;
|
||||
@@ -2018,24 +2018,24 @@ static void DestroyBallOpenAnimationParticle(struct Sprite *sprite)
|
||||
#define tPaletteHi data[11]
|
||||
#define tBallId data[15]
|
||||
|
||||
u8 LaunchBallFadeMonTask(bool8 unfadeLater, u8 battler, u32 selectedPalettes, u8 ballId)
|
||||
u8 LaunchBallFadeMonTask(bool8 unfadeLater, u8 spritePalNum, u32 selectedPalettes, u8 ballId)
|
||||
{
|
||||
u8 taskId;
|
||||
|
||||
taskId = CreateTask(Task_FadeMon_ToBallColor, 5);
|
||||
gTasks[taskId].tBallId = ballId;
|
||||
gTasks[taskId].tPalOffset = battler;
|
||||
gTasks[taskId].tPalOffset = spritePalNum;
|
||||
gTasks[taskId].tPaletteLo = selectedPalettes;
|
||||
gTasks[taskId].tPaletteHi = selectedPalettes >> 16;
|
||||
|
||||
if (!unfadeLater)
|
||||
{
|
||||
BlendPalette(battler * 16 + 0x100, 16, 0, gBallOpenFadeColors[ballId]);
|
||||
BlendPalette(spritePalNum * 16 + 0x100, 16, 0, gBallOpenFadeColors[ballId]);
|
||||
gTasks[taskId].tdCoeff = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
BlendPalette(battler * 16 + 0x100, 16, 16, gBallOpenFadeColors[ballId]);
|
||||
BlendPalette(spritePalNum * 16 + 0x100, 16, 16, gBallOpenFadeColors[ballId]);
|
||||
gTasks[taskId].tCoeff = 16;
|
||||
gTasks[taskId].tdCoeff = -1;
|
||||
gTasks[taskId].func = Task_FadeMon_ToNormal;
|
||||
@@ -2408,7 +2408,7 @@ void AnimTask_FreePokeblockGfx(u8 taskId)
|
||||
|
||||
static void SpriteCB_PokeBlock_Throw(struct Sprite *sprite)
|
||||
{
|
||||
InitSpritePosToAnimAttacker(sprite, 0);
|
||||
InitSpritePosToAnimAttacker(sprite, FALSE);
|
||||
sprite->sDuration = 30;
|
||||
sprite->sTargetX = GetBattlerSpriteCoord(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT), BATTLER_COORD_X) + gBattleAnimArgs[2];
|
||||
sprite->sTargetY = GetBattlerSpriteCoord(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT), BATTLER_COORD_Y) + gBattleAnimArgs[3];
|
||||
|
||||
@@ -27,7 +27,7 @@ static void StartBlendAnimSpriteColor(u8, u32);
|
||||
static void AnimTask_BlendSpriteColor_Step2(u8);
|
||||
static void AnimTask_HardwarePaletteFade_Step(u8);
|
||||
static void AnimTask_TraceMonBlended_Step(u8);
|
||||
static void AnimMonTrace(struct Sprite*);
|
||||
static void AnimMonTrace(struct Sprite *);
|
||||
static void AnimTask_DrawFallingWhiteLinesOnAttacker_Step(u8);
|
||||
static void StatsChangeAnimation_Step1(u8);
|
||||
static void StatsChangeAnimation_Step2(u8);
|
||||
@@ -47,7 +47,7 @@ const u8 gBattleAnimBgCntGet[] = {REG_OFFSET_BG0CNT, REG_OFFSET_BG1CNT, REG_OFFS
|
||||
|
||||
void AnimTask_BlendBattleAnimPal(u8 taskId)
|
||||
{
|
||||
u32 selectedPalettes = UnpackSelectedBattleBgPalettes(gBattleAnimArgs[0]);
|
||||
u32 selectedPalettes = UnpackSelectedBattlePalettes(gBattleAnimArgs[0]);
|
||||
selectedPalettes |= GetBattleMonSpritePalettesMask((gBattleAnimArgs[0] >> 7) & 1,
|
||||
(gBattleAnimArgs[0] >> 8) & 1,
|
||||
(gBattleAnimArgs[0] >> 9) & 1,
|
||||
@@ -62,7 +62,7 @@ void AnimTask_BlendBattleAnimPalExclude(u8 taskId)
|
||||
u8 animBattlers[2];
|
||||
|
||||
animBattlers[1] = 0xFF;
|
||||
selectedPalettes = UnpackSelectedBattleBgPalettes(1);
|
||||
selectedPalettes = UnpackSelectedBattlePalettes(F_PAL_BG);
|
||||
switch (gBattleAnimArgs[0])
|
||||
{
|
||||
case 2:
|
||||
@@ -97,7 +97,7 @@ void AnimTask_BlendBattleAnimPalExclude(u8 taskId)
|
||||
for (battler = 0; battler < MAX_BATTLERS_COUNT; battler++)
|
||||
{
|
||||
if (battler != animBattlers[0] && battler != animBattlers[1] && IsBattlerSpriteVisible(battler))
|
||||
selectedPalettes |= 0x10000 << AnimDummyReturnArg(battler);
|
||||
selectedPalettes |= 0x10000 << GetSpritePalIdxByBattler(battler);
|
||||
}
|
||||
|
||||
StartBlendAnimSpriteColor(taskId, selectedPalettes);
|
||||
@@ -105,7 +105,7 @@ void AnimTask_BlendBattleAnimPalExclude(u8 taskId)
|
||||
|
||||
void AnimTask_SetCamouflageBlend(u8 taskId)
|
||||
{
|
||||
u32 selectedPalettes = UnpackSelectedBattleBgPalettes(gBattleAnimArgs[0]);
|
||||
u32 selectedPalettes = UnpackSelectedBattlePalettes(gBattleAnimArgs[0]);
|
||||
switch (gBattleTerrain)
|
||||
{
|
||||
case BATTLE_TERRAIN_GRASS:
|
||||
@@ -356,7 +356,7 @@ static void AnimTask_DrawFallingWhiteLinesOnAttacker_Step(u8 taskId)
|
||||
gBattle_BG1_Y += 64;
|
||||
if (++gTasks[taskId].data[11] == 4)
|
||||
{
|
||||
ResetBattleAnimBg(0);
|
||||
ResetBattleAnimBg(FALSE);
|
||||
gBattle_WIN0H = 0;
|
||||
gBattle_WIN0V = 0;
|
||||
SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR
|
||||
@@ -535,9 +535,9 @@ static void StatsChangeAnimation_Step2(u8 taskId)
|
||||
gTasks[taskId].func = StatsChangeAnimation_Step3;
|
||||
|
||||
if (sAnimStatsChangeData->data[0] == 0)
|
||||
PlaySE12WithPanning(SE_M_STAT_INCREASE, BattleAnimAdjustPanning2(-64));
|
||||
PlaySE12WithPanning(SE_M_STAT_INCREASE, BattleAnimAdjustPanning2(SOUND_PAN_ATTACKER));
|
||||
else
|
||||
PlaySE12WithPanning(SE_M_STAT_DECREASE, BattleAnimAdjustPanning2(-64));
|
||||
PlaySE12WithPanning(SE_M_STAT_DECREASE, BattleAnimAdjustPanning2(SOUND_PAN_ATTACKER));
|
||||
}
|
||||
|
||||
static void StatsChangeAnimation_Step3(u8 taskId)
|
||||
@@ -568,7 +568,7 @@ static void StatsChangeAnimation_Step3(u8 taskId)
|
||||
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[12], 16 - gTasks[taskId].data[12]));
|
||||
if (gTasks[taskId].data[12] == 0)
|
||||
{
|
||||
ResetBattleAnimBg(0);
|
||||
ResetBattleAnimBg(FALSE);
|
||||
gTasks[taskId].data[15]++;
|
||||
}
|
||||
}
|
||||
@@ -594,8 +594,7 @@ static void StatsChangeAnimation_Step3(u8 taskId)
|
||||
if (gTasks[taskId].data[6] == 1)
|
||||
gSprites[gTasks[taskId].data[7]].oam.priority++;
|
||||
|
||||
Free(sAnimStatsChangeData);
|
||||
sAnimStatsChangeData = NULL;
|
||||
FREE_AND_SET_NULL(sAnimStatsChangeData);
|
||||
DestroyAnimVisualTask(taskId);
|
||||
break;
|
||||
}
|
||||
@@ -607,7 +606,7 @@ void AnimTask_Flash(u8 taskId)
|
||||
SetPalettesToColor(selectedPalettes, RGB_BLACK);
|
||||
gTasks[taskId].data[14] = selectedPalettes >> 16;
|
||||
|
||||
selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0) & 0xFFFF;
|
||||
selectedPalettes = GetBattlePalettesMask(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) & 0xFFFF;
|
||||
SetPalettesToColor(selectedPalettes, RGB_WHITEALPHA);
|
||||
gTasks[taskId].data[15] = selectedPalettes;
|
||||
|
||||
@@ -870,7 +869,7 @@ static void UpdateMonScrollingBgMask(u8 taskId)
|
||||
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[12], 16 - gTasks[taskId].data[12]));
|
||||
if (gTasks[taskId].data[12] == 0)
|
||||
{
|
||||
ResetBattleAnimBg(0);
|
||||
ResetBattleAnimBg(FALSE);
|
||||
gBattle_WIN0H = 0;
|
||||
gBattle_WIN0V = 0;
|
||||
SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR
|
||||
@@ -923,7 +922,7 @@ void AnimTask_CopyPalUnfadedToBackup(u8 taskId)
|
||||
|
||||
if (gBattleAnimArgs[0] == 0)
|
||||
{
|
||||
selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0);
|
||||
selectedPalettes = GetBattlePalettesMask(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
|
||||
while ((selectedPalettes & 1) == 0)
|
||||
{
|
||||
selectedPalettes >>= 1;
|
||||
@@ -950,7 +949,7 @@ void AnimTask_CopyPalUnfadedFromBackup(u8 taskId)
|
||||
|
||||
if (gBattleAnimArgs[0] == 0)
|
||||
{
|
||||
selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0);
|
||||
selectedPalettes = GetBattlePalettesMask(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
|
||||
while ((selectedPalettes & 1) == 0)
|
||||
{
|
||||
selectedPalettes >>= 1;
|
||||
@@ -977,7 +976,7 @@ void AnimTask_CopyPalFadedToUnfaded(u8 taskId)
|
||||
|
||||
if (gBattleAnimArgs[0] == 0)
|
||||
{
|
||||
selectedPalettes = GetBattleBgPalettesMask(1, 0, 0, 0, 0, 0, 0);
|
||||
selectedPalettes = GetBattlePalettesMask(TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE);
|
||||
while ((selectedPalettes & 1) == 0)
|
||||
{
|
||||
selectedPalettes >>= 1;
|
||||
|
||||
@@ -48,11 +48,11 @@ static void AnimTask_SurfWaveScanlineEffect(u8);
|
||||
static void AnimTask_WaterSpoutLaunch_Step(u8);
|
||||
static void AnimTask_WaterSpoutRain_Step(u8);
|
||||
static u8 GetWaterSpoutPowerForAnim(void);
|
||||
static void CreateWaterSpoutLaunchDroplets(struct Task*, u8);
|
||||
static void CreateWaterSpoutRainDroplet(struct Task*, u8);
|
||||
static void CreateWaterSpoutLaunchDroplets(struct Task *, u8);
|
||||
static void CreateWaterSpoutRainDroplet(struct Task *, u8);
|
||||
static void AnimTask_WaterSport_Step(u8);
|
||||
static void CreateWaterSportDroplet(struct Task*);
|
||||
static void CreateWaterPulseRingBubbles(struct Sprite*, int, int);
|
||||
static void CreateWaterSportDroplet(struct Task *);
|
||||
static void CreateWaterPulseRingBubbles(struct Sprite *, int, int);
|
||||
|
||||
static const u8 sUnusedWater_Gfx[] = INCBIN_U8("graphics/battle_anims/unused/water_gfx.4bpp");
|
||||
static const u8 sUnusedWater[] = INCBIN_U8("graphics/battle_anims/unused/water.bin");
|
||||
|
||||
+77
-197
@@ -35,12 +35,28 @@ static void SaveArenaChallenge(void);
|
||||
static void SetArenaPrize(void);
|
||||
static void GiveArenaPrize(void);
|
||||
static void BufferArenaOpponentName(void);
|
||||
static void SpriteCb_JudgmentIcon(struct Sprite *sprite);
|
||||
static void SpriteCB_JudgmentIcon(struct Sprite *sprite);
|
||||
static void ShowJudgmentSprite(u8 x, u8 y, u8 category, u8 battler);
|
||||
|
||||
static const s8 sMindRatings[] =
|
||||
#define JUDGMENT_STATE_FINISHED 8
|
||||
|
||||
#define TAG_JUDGMENT_ICON 1000
|
||||
|
||||
enum {
|
||||
ANIM_ICON_X, // Player lost
|
||||
ANIM_ICON_TRIANGLE, // Tie
|
||||
ANIM_ICON_CIRCLE, // Player won
|
||||
ANIM_ICON_LINE, // Line segment for separating the score total at the bottom
|
||||
};
|
||||
|
||||
// This table holds the number of points to add to the 'mind' score for each move.
|
||||
// All moves with power != 0 give 1 point, with the following exceptions:
|
||||
// - Counter, Mirror Coat, and Bide give 0 points
|
||||
// - Fake Out subtracts 1 point
|
||||
// All moves with power == 0 give 0 points, with the following exceptions:
|
||||
// - Protect, Detect, and Endure subtract 1 point
|
||||
static const s8 sMindRatings[MOVES_COUNT] =
|
||||
{
|
||||
[MOVE_NONE] = 0,
|
||||
[MOVE_POUND] = 1,
|
||||
[MOVE_KARATE_CHOP] = 1,
|
||||
[MOVE_DOUBLE_SLAP] = 1,
|
||||
@@ -54,11 +70,9 @@ static const s8 sMindRatings[] =
|
||||
[MOVE_VICE_GRIP] = 1,
|
||||
[MOVE_GUILLOTINE] = 1,
|
||||
[MOVE_RAZOR_WIND] = 1,
|
||||
[MOVE_SWORDS_DANCE] = 0,
|
||||
[MOVE_CUT] = 1,
|
||||
[MOVE_GUST] = 1,
|
||||
[MOVE_WING_ATTACK] = 1,
|
||||
[MOVE_WHIRLWIND] = 0,
|
||||
[MOVE_FLY] = 1,
|
||||
[MOVE_BIND] = 1,
|
||||
[MOVE_SLAM] = 1,
|
||||
@@ -68,7 +82,6 @@ static const s8 sMindRatings[] =
|
||||
[MOVE_MEGA_KICK] = 1,
|
||||
[MOVE_JUMP_KICK] = 1,
|
||||
[MOVE_ROLLING_KICK] = 1,
|
||||
[MOVE_SAND_ATTACK] = 0,
|
||||
[MOVE_HEADBUTT] = 1,
|
||||
[MOVE_HORN_ATTACK] = 1,
|
||||
[MOVE_FURY_ATTACK] = 1,
|
||||
@@ -79,22 +92,14 @@ static const s8 sMindRatings[] =
|
||||
[MOVE_TAKE_DOWN] = 1,
|
||||
[MOVE_THRASH] = 1,
|
||||
[MOVE_DOUBLE_EDGE] = 1,
|
||||
[MOVE_TAIL_WHIP] = 0,
|
||||
[MOVE_POISON_STING] = 1,
|
||||
[MOVE_TWINEEDLE] = 1,
|
||||
[MOVE_PIN_MISSILE] = 1,
|
||||
[MOVE_LEER] = 0,
|
||||
[MOVE_BITE] = 1,
|
||||
[MOVE_GROWL] = 0,
|
||||
[MOVE_ROAR] = 0,
|
||||
[MOVE_SING] = 0,
|
||||
[MOVE_SUPERSONIC] = 0,
|
||||
[MOVE_SONIC_BOOM] = 1,
|
||||
[MOVE_DISABLE] = 0,
|
||||
[MOVE_ACID] = 1,
|
||||
[MOVE_EMBER] = 1,
|
||||
[MOVE_FLAMETHROWER] = 1,
|
||||
[MOVE_MIST] = 0,
|
||||
[MOVE_WATER_GUN] = 1,
|
||||
[MOVE_HYDRO_PUMP] = 1,
|
||||
[MOVE_SURF] = 1,
|
||||
@@ -108,58 +113,27 @@ static const s8 sMindRatings[] =
|
||||
[MOVE_DRILL_PECK] = 1,
|
||||
[MOVE_SUBMISSION] = 1,
|
||||
[MOVE_LOW_KICK] = 1,
|
||||
[MOVE_COUNTER] = 0,
|
||||
[MOVE_SEISMIC_TOSS] = 1,
|
||||
[MOVE_STRENGTH] = 1,
|
||||
[MOVE_ABSORB] = 1,
|
||||
[MOVE_MEGA_DRAIN] = 1,
|
||||
[MOVE_LEECH_SEED] = 0,
|
||||
[MOVE_GROWTH] = 0,
|
||||
[MOVE_RAZOR_LEAF] = 1,
|
||||
[MOVE_SOLAR_BEAM] = 1,
|
||||
[MOVE_POISON_POWDER] = 0,
|
||||
[MOVE_STUN_SPORE] = 0,
|
||||
[MOVE_SLEEP_POWDER] = 0,
|
||||
[MOVE_PETAL_DANCE] = 1,
|
||||
[MOVE_STRING_SHOT] = 0,
|
||||
[MOVE_DRAGON_RAGE] = 1,
|
||||
[MOVE_FIRE_SPIN] = 1,
|
||||
[MOVE_THUNDER_SHOCK] = 1,
|
||||
[MOVE_THUNDERBOLT] = 1,
|
||||
[MOVE_THUNDER_WAVE] = 0,
|
||||
[MOVE_THUNDER] = 1,
|
||||
[MOVE_ROCK_THROW] = 1,
|
||||
[MOVE_EARTHQUAKE] = 1,
|
||||
[MOVE_FISSURE] = 1,
|
||||
[MOVE_DIG] = 1,
|
||||
[MOVE_TOXIC] = 0,
|
||||
[MOVE_CONFUSION] = 1,
|
||||
[MOVE_PSYCHIC] = 1,
|
||||
[MOVE_HYPNOSIS] = 0,
|
||||
[MOVE_MEDITATE] = 0,
|
||||
[MOVE_AGILITY] = 0,
|
||||
[MOVE_QUICK_ATTACK] = 1,
|
||||
[MOVE_RAGE] = 1,
|
||||
[MOVE_TELEPORT] = 0,
|
||||
[MOVE_NIGHT_SHADE] = 1,
|
||||
[MOVE_MIMIC] = 0,
|
||||
[MOVE_SCREECH] = 0,
|
||||
[MOVE_DOUBLE_TEAM] = 0,
|
||||
[MOVE_RECOVER] = 0,
|
||||
[MOVE_HARDEN] = 0,
|
||||
[MOVE_MINIMIZE] = 0,
|
||||
[MOVE_SMOKESCREEN] = 0,
|
||||
[MOVE_CONFUSE_RAY] = 0,
|
||||
[MOVE_WITHDRAW] = 0,
|
||||
[MOVE_DEFENSE_CURL] = 0,
|
||||
[MOVE_BARRIER] = 0,
|
||||
[MOVE_LIGHT_SCREEN] = 0,
|
||||
[MOVE_HAZE] = 0,
|
||||
[MOVE_REFLECT] = 0,
|
||||
[MOVE_FOCUS_ENERGY] = 0,
|
||||
[MOVE_BIDE] = 0,
|
||||
[MOVE_METRONOME] = 0,
|
||||
[MOVE_MIRROR_MOVE] = 0,
|
||||
[MOVE_SELF_DESTRUCT] = 1,
|
||||
[MOVE_EGG_BOMB] = 1,
|
||||
[MOVE_LICK] = 1,
|
||||
@@ -173,118 +147,67 @@ static const s8 sMindRatings[] =
|
||||
[MOVE_SKULL_BASH] = 1,
|
||||
[MOVE_SPIKE_CANNON] = 1,
|
||||
[MOVE_CONSTRICT] = 1,
|
||||
[MOVE_AMNESIA] = 0,
|
||||
[MOVE_KINESIS] = 0,
|
||||
[MOVE_SOFT_BOILED] = 0,
|
||||
[MOVE_HI_JUMP_KICK] = 1,
|
||||
[MOVE_GLARE] = 0,
|
||||
[MOVE_DREAM_EATER] = 1,
|
||||
[MOVE_POISON_GAS] = 0,
|
||||
[MOVE_BARRAGE] = 1,
|
||||
[MOVE_LEECH_LIFE] = 1,
|
||||
[MOVE_LOVELY_KISS] = 0,
|
||||
[MOVE_SKY_ATTACK] = 1,
|
||||
[MOVE_TRANSFORM] = 0,
|
||||
[MOVE_BUBBLE] = 1,
|
||||
[MOVE_DIZZY_PUNCH] = 1,
|
||||
[MOVE_SPORE] = 0,
|
||||
[MOVE_FLASH] = 0,
|
||||
[MOVE_PSYWAVE] = 1,
|
||||
[MOVE_SPLASH] = 0,
|
||||
[MOVE_ACID_ARMOR] = 0,
|
||||
[MOVE_CRABHAMMER] = 1,
|
||||
[MOVE_EXPLOSION] = 1,
|
||||
[MOVE_FURY_SWIPES] = 1,
|
||||
[MOVE_BONEMERANG] = 1,
|
||||
[MOVE_REST] = 0,
|
||||
[MOVE_ROCK_SLIDE] = 1,
|
||||
[MOVE_HYPER_FANG] = 1,
|
||||
[MOVE_SHARPEN] = 0,
|
||||
[MOVE_CONVERSION] = 0,
|
||||
[MOVE_TRI_ATTACK] = 1,
|
||||
[MOVE_SUPER_FANG] = 1,
|
||||
[MOVE_SLASH] = 1,
|
||||
[MOVE_SUBSTITUTE] = 0,
|
||||
[MOVE_STRUGGLE] = 1,
|
||||
[MOVE_SKETCH] = 0,
|
||||
[MOVE_TRIPLE_KICK] = 1,
|
||||
[MOVE_THIEF] = 1,
|
||||
[MOVE_SPIDER_WEB] = 0,
|
||||
[MOVE_MIND_READER] = 0,
|
||||
[MOVE_NIGHTMARE] = 0,
|
||||
[MOVE_FLAME_WHEEL] = 1,
|
||||
[MOVE_SNORE] = 1,
|
||||
[MOVE_CURSE] = 0,
|
||||
[MOVE_FLAIL] = 1,
|
||||
[MOVE_CONVERSION_2] = 0,
|
||||
[MOVE_AEROBLAST] = 1,
|
||||
[MOVE_COTTON_SPORE] = 0,
|
||||
[MOVE_REVERSAL] = 1,
|
||||
[MOVE_SPITE] = 0,
|
||||
[MOVE_POWDER_SNOW] = 1,
|
||||
[MOVE_PROTECT] = -1,
|
||||
[MOVE_MACH_PUNCH] = 1,
|
||||
[MOVE_SCARY_FACE] = 0,
|
||||
[MOVE_FAINT_ATTACK] = 1,
|
||||
[MOVE_SWEET_KISS] = 0,
|
||||
[MOVE_BELLY_DRUM] = 0,
|
||||
[MOVE_SLUDGE_BOMB] = 1,
|
||||
[MOVE_MUD_SLAP] = 1,
|
||||
[MOVE_OCTAZOOKA] = 1,
|
||||
[MOVE_SPIKES] = 0,
|
||||
[MOVE_ZAP_CANNON] = 1,
|
||||
[MOVE_FORESIGHT] = 0,
|
||||
[MOVE_DESTINY_BOND] = 0,
|
||||
[MOVE_PERISH_SONG] = 0,
|
||||
[MOVE_ICY_WIND] = 1,
|
||||
[MOVE_DETECT] = -1,
|
||||
[MOVE_BONE_RUSH] = 1,
|
||||
[MOVE_LOCK_ON] = 0,
|
||||
[MOVE_OUTRAGE] = 1,
|
||||
[MOVE_SANDSTORM] = 0,
|
||||
[MOVE_GIGA_DRAIN] = 1,
|
||||
[MOVE_ENDURE] = -1,
|
||||
[MOVE_CHARM] = 0,
|
||||
[MOVE_ROLLOUT] = 1,
|
||||
[MOVE_FALSE_SWIPE] = 1,
|
||||
[MOVE_SWAGGER] = 0,
|
||||
[MOVE_MILK_DRINK] = 0,
|
||||
[MOVE_SPARK] = 1,
|
||||
[MOVE_FURY_CUTTER] = 1,
|
||||
[MOVE_STEEL_WING] = 1,
|
||||
[MOVE_MEAN_LOOK] = 0,
|
||||
[MOVE_ATTRACT] = 0,
|
||||
[MOVE_SLEEP_TALK] = 0,
|
||||
[MOVE_HEAL_BELL] = 0,
|
||||
[MOVE_RETURN] = 1,
|
||||
[MOVE_PRESENT] = 1,
|
||||
[MOVE_FRUSTRATION] = 1,
|
||||
[MOVE_SAFEGUARD] = 0,
|
||||
[MOVE_PAIN_SPLIT] = 0,
|
||||
[MOVE_SACRED_FIRE] = 1,
|
||||
[MOVE_MAGNITUDE] = 1,
|
||||
[MOVE_DYNAMIC_PUNCH] = 1,
|
||||
[MOVE_MEGAHORN] = 1,
|
||||
[MOVE_DRAGON_BREATH] = 1,
|
||||
[MOVE_BATON_PASS] = 0,
|
||||
[MOVE_ENCORE] = 0,
|
||||
[MOVE_PURSUIT] = 1,
|
||||
[MOVE_RAPID_SPIN] = 1,
|
||||
[MOVE_SWEET_SCENT] = 0,
|
||||
[MOVE_IRON_TAIL] = 1,
|
||||
[MOVE_METAL_CLAW] = 1,
|
||||
[MOVE_VITAL_THROW] = 1,
|
||||
[MOVE_MORNING_SUN] = 0,
|
||||
[MOVE_SYNTHESIS] = 0,
|
||||
[MOVE_MOONLIGHT] = 0,
|
||||
[MOVE_HIDDEN_POWER] = 1,
|
||||
[MOVE_CROSS_CHOP] = 1,
|
||||
[MOVE_TWISTER] = 1,
|
||||
[MOVE_RAIN_DANCE] = 0,
|
||||
[MOVE_SUNNY_DAY] = 0,
|
||||
[MOVE_CRUNCH] = 1,
|
||||
[MOVE_MIRROR_COAT] = 0,
|
||||
[MOVE_PSYCH_UP] = 0,
|
||||
[MOVE_EXTREME_SPEED] = 1,
|
||||
[MOVE_ANCIENT_POWER] = 1,
|
||||
[MOVE_SHADOW_BALL] = 1,
|
||||
@@ -294,56 +217,25 @@ static const s8 sMindRatings[] =
|
||||
[MOVE_BEAT_UP] = 1,
|
||||
[MOVE_FAKE_OUT] = -1,
|
||||
[MOVE_UPROAR] = 1,
|
||||
[MOVE_STOCKPILE] = 0,
|
||||
[MOVE_SPIT_UP] = 1,
|
||||
[MOVE_SWALLOW] = 0,
|
||||
[MOVE_HEAT_WAVE] = 1,
|
||||
[MOVE_HAIL] = 0,
|
||||
[MOVE_TORMENT] = 0,
|
||||
[MOVE_FLATTER] = 0,
|
||||
[MOVE_WILL_O_WISP] = 0,
|
||||
[MOVE_MEMENTO] = 0,
|
||||
[MOVE_FACADE] = 1,
|
||||
[MOVE_FOCUS_PUNCH] = 1,
|
||||
[MOVE_SMELLING_SALT] = 1,
|
||||
[MOVE_FOLLOW_ME] = 0,
|
||||
[MOVE_NATURE_POWER] = 0,
|
||||
[MOVE_CHARGE] = 0,
|
||||
[MOVE_TAUNT] = 0,
|
||||
[MOVE_HELPING_HAND] = 0,
|
||||
[MOVE_TRICK] = 0,
|
||||
[MOVE_ROLE_PLAY] = 0,
|
||||
[MOVE_WISH] = 0,
|
||||
[MOVE_ASSIST] = 0,
|
||||
[MOVE_INGRAIN] = 0,
|
||||
[MOVE_SUPERPOWER] = 1,
|
||||
[MOVE_MAGIC_COAT] = 0,
|
||||
[MOVE_RECYCLE] = 0,
|
||||
[MOVE_REVENGE] = 1,
|
||||
[MOVE_BRICK_BREAK] = 1,
|
||||
[MOVE_YAWN] = 0,
|
||||
[MOVE_KNOCK_OFF] = 1,
|
||||
[MOVE_ENDEAVOR] = 1,
|
||||
[MOVE_ERUPTION] = 1,
|
||||
[MOVE_SKILL_SWAP] = 0,
|
||||
[MOVE_IMPRISON] = 0,
|
||||
[MOVE_REFRESH] = 0,
|
||||
[MOVE_GRUDGE] = 0,
|
||||
[MOVE_SNATCH] = 0,
|
||||
[MOVE_SECRET_POWER] = 1,
|
||||
[MOVE_DIVE] = 1,
|
||||
[MOVE_ARM_THRUST] = 1,
|
||||
[MOVE_CAMOUFLAGE] = 0,
|
||||
[MOVE_TAIL_GLOW] = 0,
|
||||
[MOVE_LUSTER_PURGE] = 1,
|
||||
[MOVE_MIST_BALL] = 1,
|
||||
[MOVE_FEATHER_DANCE] = 0,
|
||||
[MOVE_TEETER_DANCE] = 0,
|
||||
[MOVE_BLAZE_KICK] = 1,
|
||||
[MOVE_MUD_SPORT] = 0,
|
||||
[MOVE_ICE_BALL] = 1,
|
||||
[MOVE_NEEDLE_ARM] = 1,
|
||||
[MOVE_SLACK_OFF] = 0,
|
||||
[MOVE_HYPER_VOICE] = 1,
|
||||
[MOVE_POISON_FANG] = 1,
|
||||
[MOVE_CRUSH_CLAW] = 1,
|
||||
@@ -352,17 +244,10 @@ static const s8 sMindRatings[] =
|
||||
[MOVE_METEOR_MASH] = 1,
|
||||
[MOVE_ASTONISH] = 1,
|
||||
[MOVE_WEATHER_BALL] = 1,
|
||||
[MOVE_AROMATHERAPY] = 0,
|
||||
[MOVE_FAKE_TEARS] = 0,
|
||||
[MOVE_AIR_CUTTER] = 1,
|
||||
[MOVE_OVERHEAT] = 1,
|
||||
[MOVE_ODOR_SLEUTH] = 0,
|
||||
[MOVE_ROCK_TOMB] = 1,
|
||||
[MOVE_SILVER_WIND] = 1,
|
||||
[MOVE_METAL_SOUND] = 0,
|
||||
[MOVE_GRASS_WHISTLE] = 0,
|
||||
[MOVE_TICKLE] = 0,
|
||||
[MOVE_COSMIC_POWER] = 0,
|
||||
[MOVE_WATER_SPOUT] = 1,
|
||||
[MOVE_SIGNAL_BEAM] = 1,
|
||||
[MOVE_SHADOW_PUNCH] = 1,
|
||||
@@ -374,22 +259,15 @@ static const s8 sMindRatings[] =
|
||||
[MOVE_BULLET_SEED] = 1,
|
||||
[MOVE_AERIAL_ACE] = 1,
|
||||
[MOVE_ICICLE_SPEAR] = 1,
|
||||
[MOVE_IRON_DEFENSE] = 0,
|
||||
[MOVE_BLOCK] = 0,
|
||||
[MOVE_HOWL] = 0,
|
||||
[MOVE_DRAGON_CLAW] = 1,
|
||||
[MOVE_FRENZY_PLANT] = 1,
|
||||
[MOVE_BULK_UP] = 0,
|
||||
[MOVE_BOUNCE] = 1,
|
||||
[MOVE_MUD_SHOT] = 1,
|
||||
[MOVE_POISON_TAIL] = 1,
|
||||
[MOVE_COVET] = 1,
|
||||
[MOVE_VOLT_TACKLE] = 1,
|
||||
[MOVE_MAGICAL_LEAF] = 1,
|
||||
[MOVE_WATER_SPORT] = 0,
|
||||
[MOVE_CALM_MIND] = 0,
|
||||
[MOVE_LEAF_BLADE] = 1,
|
||||
[MOVE_DRAGON_DANCE] = 0,
|
||||
[MOVE_ROCK_BLAST] = 1,
|
||||
[MOVE_SHOCK_WAVE] = 1,
|
||||
[MOVE_WATER_PULSE] = 1,
|
||||
@@ -397,14 +275,12 @@ static const s8 sMindRatings[] =
|
||||
[MOVE_PSYCHO_BOOST] = 1,
|
||||
};
|
||||
|
||||
#define TAG_JUDGEMENT_ICON 1000
|
||||
|
||||
static const struct OamData sJudgementIconOamData =
|
||||
static const struct OamData sOam_JudgmentIcon =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(16x16),
|
||||
.x = 0,
|
||||
@@ -416,52 +292,52 @@ static const struct OamData sJudgementIconOamData =
|
||||
.affineParam = 0
|
||||
};
|
||||
|
||||
static const union AnimCmd sJudgementIconAnimCmd0[] =
|
||||
static const union AnimCmd sAnim_JudgmentIcon_X[] =
|
||||
{
|
||||
ANIMCMD_FRAME(0, 1),
|
||||
ANIMCMD_END
|
||||
};
|
||||
|
||||
static const union AnimCmd sJudgementIconAnimCmd1[] =
|
||||
static const union AnimCmd sAnim_JudgmentIcon_Triangle[] =
|
||||
{
|
||||
ANIMCMD_FRAME(4, 1),
|
||||
ANIMCMD_END
|
||||
};
|
||||
|
||||
static const union AnimCmd sJudgementIconAnimCmd2[] =
|
||||
static const union AnimCmd sAnim_JudgmentIcon_Circle[] =
|
||||
{
|
||||
ANIMCMD_FRAME(8, 1),
|
||||
ANIMCMD_END
|
||||
};
|
||||
|
||||
static const union AnimCmd sJudgementIconAnimCmd3[] =
|
||||
static const union AnimCmd sAnim_JudgmentIcon_Line[] =
|
||||
{
|
||||
ANIMCMD_FRAME(12, 1),
|
||||
ANIMCMD_END
|
||||
};
|
||||
|
||||
static const union AnimCmd *const sJudgementIconAnimCmds[] =
|
||||
static const union AnimCmd *const sAnims_JudgmentIcon[] =
|
||||
{
|
||||
sJudgementIconAnimCmd0,
|
||||
sJudgementIconAnimCmd1,
|
||||
sJudgementIconAnimCmd2,
|
||||
sJudgementIconAnimCmd3
|
||||
[ANIM_ICON_X] = sAnim_JudgmentIcon_X,
|
||||
[ANIM_ICON_TRIANGLE] = sAnim_JudgmentIcon_Triangle,
|
||||
[ANIM_ICON_CIRCLE] = sAnim_JudgmentIcon_Circle,
|
||||
[ANIM_ICON_LINE] = sAnim_JudgmentIcon_Line,
|
||||
};
|
||||
|
||||
static const struct SpriteTemplate sSpriteTemplate_JudgmentIcon =
|
||||
{
|
||||
.tileTag = TAG_JUDGEMENT_ICON,
|
||||
.tileTag = TAG_JUDGMENT_ICON,
|
||||
.paletteTag = TAG_NONE,
|
||||
.oam = &sJudgementIconOamData,
|
||||
.anims = sJudgementIconAnimCmds,
|
||||
.oam = &sOam_JudgmentIcon,
|
||||
.anims = sAnims_JudgmentIcon,
|
||||
.images = NULL,
|
||||
.affineAnims = gDummySpriteAffineAnimTable,
|
||||
.callback = SpriteCb_JudgmentIcon,
|
||||
.callback = SpriteCB_JudgmentIcon,
|
||||
};
|
||||
|
||||
static const struct CompressedSpriteSheet sBattleArenaJudgementSymbolsSpriteSheet[] =
|
||||
static const struct CompressedSpriteSheet sBattleArenaJudgmentSymbolsSpriteSheet[] =
|
||||
{
|
||||
{gBattleArenaJudgementSymbolsGfx, 0x200, TAG_JUDGEMENT_ICON},
|
||||
{gBattleArenaJudgmentSymbolsGfx, 0x200, TAG_JUDGMENT_ICON},
|
||||
{0}
|
||||
};
|
||||
|
||||
@@ -507,14 +383,14 @@ void CallBattleArenaFunction(void)
|
||||
u8 BattleArena_ShowJudgmentWindow(u8 *state)
|
||||
{
|
||||
int i;
|
||||
u8 ret = 0;
|
||||
u8 result = ARENA_RESULT_RUNNING;
|
||||
switch (*state)
|
||||
{
|
||||
case 0:
|
||||
BeginNormalPaletteFade(0x7FFFFF1C, 4, 0, 8, RGB_BLACK);
|
||||
SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG1 | WININ_WIN0_BG2 | WININ_WIN0_BG3 | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR);
|
||||
LoadCompressedSpriteSheet(sBattleArenaJudgementSymbolsSpriteSheet);
|
||||
LoadCompressedPalette(gBattleArenaJudgementSymbolsPalette, 0x1F0, 0x20);
|
||||
SetGpuReg(REG_OFFSET_WININ, (WININ_WIN0_ALL & ~WININ_WIN0_BG0) | WININ_WIN1_ALL);
|
||||
LoadCompressedSpriteSheet(sBattleArenaJudgmentSymbolsSpriteSheet);
|
||||
LoadCompressedPalette(gBattleArenaJudgmentSymbolsPalette, 0x1F0, 0x20);
|
||||
gBattle_WIN0H = 0xFF;
|
||||
gBattle_WIN0V = 0x70;
|
||||
(*state)++;
|
||||
@@ -541,21 +417,23 @@ u8 BattleArena_ShowJudgmentWindow(u8 *state)
|
||||
BattlePutTextOnWindow(gText_Mind, ARENA_WIN_MIND);
|
||||
BattlePutTextOnWindow(gText_Skill, ARENA_WIN_SKILL);
|
||||
BattlePutTextOnWindow(gText_Body, ARENA_WIN_BODY);
|
||||
BattleStringExpandPlaceholdersToDisplayedString(gText_Judgement);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, ARENA_WIN_JUDGEMENT_TITLE);
|
||||
BattleStringExpandPlaceholdersToDisplayedString(gText_Judgment);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, ARENA_WIN_JUDGMENT_TITLE);
|
||||
(*state)++;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (!IsDma3ManagerBusyWithBgCopy())
|
||||
{
|
||||
SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR);
|
||||
SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_ALL | WININ_WIN1_ALL);
|
||||
|
||||
// Create dividing line for the the score totals at the bottom
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
u8 spriteId = CreateSprite(&sSpriteTemplate_JudgmentIcon, 64 + i * 16, 84, 0);
|
||||
StartSpriteAnim(&gSprites[spriteId], 3);
|
||||
StartSpriteAnim(&gSprites[spriteId], ANIM_ICON_LINE);
|
||||
}
|
||||
ret = 1;
|
||||
result = ARENA_RESULT_STEP_DONE;
|
||||
(*state)++;
|
||||
}
|
||||
break;
|
||||
@@ -563,70 +441,71 @@ u8 BattleArena_ShowJudgmentWindow(u8 *state)
|
||||
PlaySE(SE_ARENA_TIMEUP1);
|
||||
ShowJudgmentSprite(80, 40, ARENA_CATEGORY_MIND, B_POSITION_PLAYER_LEFT);
|
||||
ShowJudgmentSprite(160, 40, ARENA_CATEGORY_MIND, B_POSITION_OPPONENT_LEFT);
|
||||
BattleStringExpandPlaceholdersToDisplayedString(gText_Judgement);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, ARENA_WIN_JUDGEMENT_TITLE);
|
||||
BattleStringExpandPlaceholdersToDisplayedString(gText_Judgment);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, ARENA_WIN_JUDGMENT_TITLE);
|
||||
(*state)++;
|
||||
ret = 1;
|
||||
result = ARENA_RESULT_STEP_DONE;
|
||||
break;
|
||||
case 5:
|
||||
PlaySE(SE_ARENA_TIMEUP1);
|
||||
ShowJudgmentSprite(80, 56, ARENA_CATEGORY_SKILL, B_POSITION_PLAYER_LEFT);
|
||||
ShowJudgmentSprite(160, 56, ARENA_CATEGORY_SKILL, B_POSITION_OPPONENT_LEFT);
|
||||
BattleStringExpandPlaceholdersToDisplayedString(gText_Judgement);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, ARENA_WIN_JUDGEMENT_TITLE);
|
||||
BattleStringExpandPlaceholdersToDisplayedString(gText_Judgment);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, ARENA_WIN_JUDGMENT_TITLE);
|
||||
(*state)++;
|
||||
ret = 1;
|
||||
result = ARENA_RESULT_STEP_DONE;
|
||||
break;
|
||||
case 6:
|
||||
PlaySE(SE_ARENA_TIMEUP1);
|
||||
ShowJudgmentSprite(80, 72, ARENA_CATEGORY_BODY, B_POSITION_PLAYER_LEFT);
|
||||
ShowJudgmentSprite(160, 72, ARENA_CATEGORY_BODY, B_POSITION_OPPONENT_LEFT);
|
||||
BattleStringExpandPlaceholdersToDisplayedString(gText_Judgement);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, ARENA_WIN_JUDGEMENT_TITLE);
|
||||
BattleStringExpandPlaceholdersToDisplayedString(gText_Judgment);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, ARENA_WIN_JUDGMENT_TITLE);
|
||||
(*state)++;
|
||||
ret = 1;
|
||||
result = ARENA_RESULT_STEP_DONE;
|
||||
break;
|
||||
case 7:
|
||||
PlaySE(SE_ARENA_TIMEUP2);
|
||||
if (gBattleTextBuff1[0] > gBattleTextBuff2[0])
|
||||
{
|
||||
ret = 2;
|
||||
result = ARENA_RESULT_PLAYER_WON;
|
||||
gBattleScripting.battler = 0;
|
||||
}
|
||||
else if (gBattleTextBuff1[0] < gBattleTextBuff2[0])
|
||||
{
|
||||
ret = 3;
|
||||
result = ARENA_RESULT_PLAYER_LOST;
|
||||
gBattleScripting.battler = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = 4;
|
||||
result = ARENA_RESULT_TIE;
|
||||
}
|
||||
(*state)++;
|
||||
break;
|
||||
case 8:
|
||||
case JUDGMENT_STATE_FINISHED:
|
||||
// Finishing this state is the indicator to SpriteCB_JudgmentIcon that its safe to destroy the judgment icon sprites
|
||||
(*state)++;
|
||||
break;
|
||||
case 9:
|
||||
SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG1 | WININ_WIN0_BG2 | WININ_WIN0_BG3 | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR);
|
||||
case JUDGMENT_STATE_FINISHED + 1:
|
||||
SetGpuReg(REG_OFFSET_WININ, (WININ_WIN0_ALL & ~WININ_WIN0_BG0) | WININ_WIN1_ALL);
|
||||
HandleBattleWindow(5, 0, 24, 13, WINDOW_CLEAR);
|
||||
CopyBgTilemapBufferToVram(0);
|
||||
m4aMPlayVolumeControl(&gMPlayInfo_BGM, TRACKS_ALL, 256);
|
||||
BeginNormalPaletteFade(0x7FFFFF1C, 4, 8, 0, RGB_BLACK);
|
||||
(*state)++;
|
||||
break;
|
||||
case 10:
|
||||
case JUDGMENT_STATE_FINISHED + 2:
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR | WININ_WIN1_BG_ALL | WININ_WIN1_OBJ | WININ_WIN1_CLR);
|
||||
FreeSpriteTilesByTag(TAG_JUDGEMENT_ICON);
|
||||
ret = 1;
|
||||
SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_ALL | WININ_WIN1_ALL);
|
||||
FreeSpriteTilesByTag(TAG_JUDGMENT_ICON);
|
||||
result = ARENA_RESULT_STEP_DONE;
|
||||
(*state)++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
return result;
|
||||
}
|
||||
|
||||
static void ShowJudgmentSprite(u8 x, u8 y, u8 category, u8 battler)
|
||||
@@ -656,7 +535,8 @@ static void ShowJudgmentSprite(u8 x, u8 y, u8 category, u8 battler)
|
||||
|
||||
if (pointsPlayer > pointsOpponent)
|
||||
{
|
||||
animNum = 2;
|
||||
animNum = ANIM_ICON_CIRCLE;
|
||||
// +2 to score total for winning
|
||||
if (battler != 0)
|
||||
gBattleTextBuff2[0] += 2;
|
||||
else
|
||||
@@ -664,7 +544,8 @@ static void ShowJudgmentSprite(u8 x, u8 y, u8 category, u8 battler)
|
||||
}
|
||||
else if (pointsPlayer == pointsOpponent)
|
||||
{
|
||||
animNum = 1;
|
||||
animNum = ANIM_ICON_TRIANGLE;
|
||||
// +1 to score total for a tie
|
||||
if (battler != 0)
|
||||
gBattleTextBuff2[0] += 1;
|
||||
else
|
||||
@@ -672,16 +553,16 @@ static void ShowJudgmentSprite(u8 x, u8 y, u8 category, u8 battler)
|
||||
}
|
||||
else
|
||||
{
|
||||
animNum = 0;
|
||||
animNum = ANIM_ICON_X;
|
||||
}
|
||||
|
||||
pointsPlayer = CreateSprite(&sSpriteTemplate_JudgmentIcon, x, y, 0);
|
||||
StartSpriteAnim(&gSprites[pointsPlayer], animNum);
|
||||
}
|
||||
|
||||
static void SpriteCb_JudgmentIcon(struct Sprite *sprite)
|
||||
static void SpriteCB_JudgmentIcon(struct Sprite *sprite)
|
||||
{
|
||||
if (gBattleCommunication[0] > 8)
|
||||
if (gBattleCommunication[0] > JUDGMENT_STATE_FINISHED)
|
||||
DestroySprite(sprite);
|
||||
}
|
||||
|
||||
@@ -701,8 +582,7 @@ void BattleArena_InitPoints(void)
|
||||
|
||||
void BattleArena_AddMindPoints(u8 battler)
|
||||
{
|
||||
s8 *mindPoints = gBattleStruct->arenaMindPoints;
|
||||
mindPoints[battler] += sMindRatings[gCurrentMove];
|
||||
gBattleStruct->arenaMindPoints[battler] += sMindRatings[gCurrentMove];
|
||||
}
|
||||
|
||||
void BattleArena_AddSkillPoints(u8 battler)
|
||||
@@ -719,7 +599,7 @@ void BattleArena_AddSkillPoints(u8 battler)
|
||||
}
|
||||
else if (gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
|
||||
{
|
||||
if (!(gMoveResultFlags & MOVE_RESULT_MISSED) || gBattleCommunication[6] != 1)
|
||||
if (!(gMoveResultFlags & MOVE_RESULT_MISSED) || gBattleCommunication[MISS_TYPE] != B_MSG_PROTECTED)
|
||||
skillPoints[battler] -= 2;
|
||||
}
|
||||
else if ((gMoveResultFlags & MOVE_RESULT_SUPER_EFFECTIVE) && (gMoveResultFlags & MOVE_RESULT_NOT_VERY_EFFECTIVE))
|
||||
|
||||
+85
-85
@@ -41,7 +41,7 @@ static const struct OamData sVsLetter_V_OamData =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_DOUBLE,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(64x64),
|
||||
.x = 0,
|
||||
@@ -58,7 +58,7 @@ static const struct OamData sVsLetter_S_OamData =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_DOUBLE,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(64x64),
|
||||
.x = 0,
|
||||
@@ -159,7 +159,7 @@ const struct BgTemplate gBattleBgTemplates[] =
|
||||
},
|
||||
};
|
||||
|
||||
static const struct WindowTemplate gStandardBattleWindowTemplates[] =
|
||||
static const struct WindowTemplate sStandardBattleWindowTemplates[] =
|
||||
{
|
||||
[B_WIN_MSG] = {
|
||||
.bg = 0,
|
||||
@@ -380,7 +380,7 @@ static const struct WindowTemplate gStandardBattleWindowTemplates[] =
|
||||
DUMMY_WIN_TEMPLATE
|
||||
};
|
||||
|
||||
static const struct WindowTemplate gBattleArenaWindowTemplates[] =
|
||||
static const struct WindowTemplate sBattleArenaWindowTemplates[] =
|
||||
{
|
||||
[B_WIN_MSG] = {
|
||||
.bg = 0,
|
||||
@@ -571,7 +571,7 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] =
|
||||
.paletteNum = 5,
|
||||
.baseBlock = 0x013c,
|
||||
},
|
||||
[ARENA_WIN_JUDGEMENT_TITLE] = {
|
||||
[ARENA_WIN_JUDGMENT_TITLE] = {
|
||||
.bg = 0,
|
||||
.tilemapLeft = 8,
|
||||
.tilemapTop = 11,
|
||||
@@ -580,7 +580,7 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] =
|
||||
.paletteNum = 5,
|
||||
.baseBlock = 0x0148,
|
||||
},
|
||||
[ARENA_WIN_JUDGEMENT_TEXT] = {
|
||||
[ARENA_WIN_JUDGMENT_TEXT] = {
|
||||
.bg = 0,
|
||||
.tilemapLeft = 2,
|
||||
.tilemapTop = 15,
|
||||
@@ -594,8 +594,8 @@ static const struct WindowTemplate gBattleArenaWindowTemplates[] =
|
||||
|
||||
const struct WindowTemplate * const gBattleWindowTemplates[] =
|
||||
{
|
||||
[B_WIN_TYPE_NORMAL] = gStandardBattleWindowTemplates,
|
||||
[B_WIN_TYPE_ARENA] = gBattleArenaWindowTemplates,
|
||||
[B_WIN_TYPE_NORMAL] = sStandardBattleWindowTemplates,
|
||||
[B_WIN_TYPE_ARENA] = sBattleArenaWindowTemplates,
|
||||
};
|
||||
|
||||
static const struct BattleBackground sBattleTerrainTable[] =
|
||||
@@ -760,26 +760,26 @@ void DrawMainBattleBackground(void)
|
||||
{
|
||||
if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_FRONTIER | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_RECORDED_LINK))
|
||||
{
|
||||
LZDecompressVram(gBattleTerrainTiles_Building, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Building, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(gBattleTerrainTiles_Building, (void *)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(BG_SCREEN_ADDR(26)));
|
||||
LoadCompressedPalette(gBattleTerrainPalette_Frontier, 0x20, 0x60);
|
||||
}
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_GROUDON)
|
||||
{
|
||||
LZDecompressVram(gBattleTerrainTiles_Cave, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Cave, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(gBattleTerrainTiles_Cave, (void *)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Cave, (void *)(BG_SCREEN_ADDR(26)));
|
||||
LoadCompressedPalette(gBattleTerrainPalette_Groudon, 0x20, 0x60);
|
||||
}
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_KYOGRE)
|
||||
{
|
||||
LZDecompressVram(gBattleTerrainTiles_Water, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Water, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(gBattleTerrainTiles_Water, (void *)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Water, (void *)(BG_SCREEN_ADDR(26)));
|
||||
LoadCompressedPalette(gBattleTerrainPalette_Kyogre, 0x20, 0x60);
|
||||
}
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_RAYQUAZA)
|
||||
{
|
||||
LZDecompressVram(gBattleTerrainTiles_Rayquaza, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Rayquaza, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(gBattleTerrainTiles_Rayquaza, (void *)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Rayquaza, (void *)(BG_SCREEN_ADDR(26)));
|
||||
LoadCompressedPalette(gBattleTerrainPalette_Rayquaza, 0x20, 0x60);
|
||||
}
|
||||
else
|
||||
@@ -789,15 +789,15 @@ void DrawMainBattleBackground(void)
|
||||
u8 trainerClass = gTrainers[gTrainerBattleOpponent_A].trainerClass;
|
||||
if (trainerClass == TRAINER_CLASS_LEADER)
|
||||
{
|
||||
LZDecompressVram(gBattleTerrainTiles_Building, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Building, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(gBattleTerrainTiles_Building, (void *)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(BG_SCREEN_ADDR(26)));
|
||||
LoadCompressedPalette(gBattleTerrainPalette_BuildingLeader, 0x20, 0x60);
|
||||
return;
|
||||
}
|
||||
else if (trainerClass == TRAINER_CLASS_CHAMPION)
|
||||
{
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26)));
|
||||
LoadCompressedPalette(gBattleTerrainPalette_StadiumWallace, 0x20, 0x60);
|
||||
return;
|
||||
}
|
||||
@@ -807,48 +807,48 @@ void DrawMainBattleBackground(void)
|
||||
{
|
||||
default:
|
||||
case MAP_BATTLE_SCENE_NORMAL:
|
||||
LZDecompressVram(sBattleTerrainTable[gBattleTerrain].tileset, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(sBattleTerrainTable[gBattleTerrain].tilemap, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(sBattleTerrainTable[gBattleTerrain].tileset, (void *)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(sBattleTerrainTable[gBattleTerrain].tilemap, (void *)(BG_SCREEN_ADDR(26)));
|
||||
LoadCompressedPalette(sBattleTerrainTable[gBattleTerrain].palette, 0x20, 0x60);
|
||||
break;
|
||||
case MAP_BATTLE_SCENE_GYM:
|
||||
LZDecompressVram(gBattleTerrainTiles_Building, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Building, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(gBattleTerrainTiles_Building, (void *)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(BG_SCREEN_ADDR(26)));
|
||||
LoadCompressedPalette(gBattleTerrainPalette_BuildingGym, 0x20, 0x60);
|
||||
break;
|
||||
case MAP_BATTLE_SCENE_MAGMA:
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26)));
|
||||
LoadCompressedPalette(gBattleTerrainPalette_StadiumMagma, 0x20, 0x60);
|
||||
break;
|
||||
case MAP_BATTLE_SCENE_AQUA:
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26)));
|
||||
LoadCompressedPalette(gBattleTerrainPalette_StadiumAqua, 0x20, 0x60);
|
||||
break;
|
||||
case MAP_BATTLE_SCENE_SIDNEY:
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26)));
|
||||
LoadCompressedPalette(gBattleTerrainPalette_StadiumSidney, 0x20, 0x60);
|
||||
break;
|
||||
case MAP_BATTLE_SCENE_PHOEBE:
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26)));
|
||||
LoadCompressedPalette(gBattleTerrainPalette_StadiumPhoebe, 0x20, 0x60);
|
||||
break;
|
||||
case MAP_BATTLE_SCENE_GLACIA:
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26)));
|
||||
LoadCompressedPalette(gBattleTerrainPalette_StadiumGlacia, 0x20, 0x60);
|
||||
break;
|
||||
case MAP_BATTLE_SCENE_DRAKE:
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26)));
|
||||
LoadCompressedPalette(gBattleTerrainPalette_StadiumDrake, 0x20, 0x60);
|
||||
break;
|
||||
case MAP_BATTLE_SCENE_FRONTIER:
|
||||
LZDecompressVram(gBattleTerrainTiles_Building, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Building, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(gBattleTerrainTiles_Building, (void *)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(BG_SCREEN_ADDR(26)));
|
||||
LoadCompressedPalette(gBattleTerrainPalette_Frontier, 0x20, 0x60);
|
||||
break;
|
||||
}
|
||||
@@ -857,7 +857,7 @@ void DrawMainBattleBackground(void)
|
||||
|
||||
void LoadBattleTextboxAndBackground(void)
|
||||
{
|
||||
LZDecompressVram(gBattleTextboxTiles, (void*)(BG_CHAR_ADDR(0)));
|
||||
LZDecompressVram(gBattleTextboxTiles, (void *)(BG_CHAR_ADDR(0)));
|
||||
CopyToBgTilemapBuffer(0, gBattleTextboxTilemap, 0, 0);
|
||||
CopyBgTilemapBufferToVram(0);
|
||||
LoadCompressedPalette(gBattleTextboxPalette, 0, 0x40);
|
||||
@@ -1124,8 +1124,8 @@ void DrawBattleEntryBackground(void)
|
||||
{
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_LINK)
|
||||
{
|
||||
LZDecompressVram(gBattleVSFrame_Gfx, (void*)(BG_CHAR_ADDR(1)));
|
||||
LZDecompressVram(gVsLettersGfx, (void*)OBJ_VRAM0);
|
||||
LZDecompressVram(gBattleVSFrame_Gfx, (void *)(BG_CHAR_ADDR(1)));
|
||||
LZDecompressVram(gVsLettersGfx, (void *)OBJ_VRAM0);
|
||||
LoadCompressedPalette(gBattleVSFrame_Pal, 0x60, 0x20);
|
||||
SetBgAttribute(1, BG_ATTR_SCREENSIZE, 1);
|
||||
SetGpuReg(REG_OFFSET_BG1CNT, 0x5C04);
|
||||
@@ -1143,8 +1143,8 @@ void DrawBattleEntryBackground(void)
|
||||
{
|
||||
if (!(gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER) || gPartnerTrainerId == TRAINER_STEVEN_PARTNER)
|
||||
{
|
||||
LZDecompressVram(gBattleTerrainAnimTiles_Building, (void*)(BG_CHAR_ADDR(1)));
|
||||
LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void*)(BG_SCREEN_ADDR(28)));
|
||||
LZDecompressVram(gBattleTerrainAnimTiles_Building, (void *)(BG_CHAR_ADDR(1)));
|
||||
LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void *)(BG_SCREEN_ADDR(28)));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1160,18 +1160,18 @@ void DrawBattleEntryBackground(void)
|
||||
}
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_GROUDON)
|
||||
{
|
||||
LZDecompressVram(gBattleTerrainAnimTiles_Cave, (void*)(BG_CHAR_ADDR(1)));
|
||||
LZDecompressVram(gBattleTerrainAnimTilemap_Cave, (void*)(BG_SCREEN_ADDR(28)));
|
||||
LZDecompressVram(gBattleTerrainAnimTiles_Cave, (void *)(BG_CHAR_ADDR(1)));
|
||||
LZDecompressVram(gBattleTerrainAnimTilemap_Cave, (void *)(BG_SCREEN_ADDR(28)));
|
||||
}
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_KYOGRE)
|
||||
{
|
||||
LZDecompressVram(gBattleTerrainAnimTiles_Underwater, (void*)(BG_CHAR_ADDR(1)));
|
||||
LZDecompressVram(gBattleTerrainAnimTilemap_Underwater, (void*)(BG_SCREEN_ADDR(28)));
|
||||
LZDecompressVram(gBattleTerrainAnimTiles_Underwater, (void *)(BG_CHAR_ADDR(1)));
|
||||
LZDecompressVram(gBattleTerrainAnimTilemap_Underwater, (void *)(BG_SCREEN_ADDR(28)));
|
||||
}
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_RAYQUAZA)
|
||||
{
|
||||
LZDecompressVram(gBattleTerrainAnimTiles_Rayquaza, (void*)(BG_CHAR_ADDR(1)));
|
||||
LZDecompressVram(gBattleTerrainAnimTilemap_Rayquaza, (void*)(BG_SCREEN_ADDR(28)));
|
||||
LZDecompressVram(gBattleTerrainAnimTiles_Rayquaza, (void *)(BG_CHAR_ADDR(1)));
|
||||
LZDecompressVram(gBattleTerrainAnimTilemap_Rayquaza, (void *)(BG_SCREEN_ADDR(28)));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1180,27 +1180,27 @@ void DrawBattleEntryBackground(void)
|
||||
u8 trainerClass = gTrainers[gTrainerBattleOpponent_A].trainerClass;
|
||||
if (trainerClass == TRAINER_CLASS_LEADER)
|
||||
{
|
||||
LZDecompressVram(gBattleTerrainAnimTiles_Building, (void*)(BG_CHAR_ADDR(1)));
|
||||
LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void*)(BG_SCREEN_ADDR(28)));
|
||||
LZDecompressVram(gBattleTerrainAnimTiles_Building, (void *)(BG_CHAR_ADDR(1)));
|
||||
LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void *)(BG_SCREEN_ADDR(28)));
|
||||
return;
|
||||
}
|
||||
else if (trainerClass == TRAINER_CLASS_CHAMPION)
|
||||
{
|
||||
LZDecompressVram(gBattleTerrainAnimTiles_Building, (void*)(BG_CHAR_ADDR(1)));
|
||||
LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void*)(BG_SCREEN_ADDR(28)));
|
||||
LZDecompressVram(gBattleTerrainAnimTiles_Building, (void *)(BG_CHAR_ADDR(1)));
|
||||
LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void *)(BG_SCREEN_ADDR(28)));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (GetCurrentMapBattleScene() == MAP_BATTLE_SCENE_NORMAL)
|
||||
{
|
||||
LZDecompressVram(sBattleTerrainTable[gBattleTerrain].entryTileset, (void*)(BG_CHAR_ADDR(1)));
|
||||
LZDecompressVram(sBattleTerrainTable[gBattleTerrain].entryTilemap, (void*)(BG_SCREEN_ADDR(28)));
|
||||
LZDecompressVram(sBattleTerrainTable[gBattleTerrain].entryTileset, (void *)(BG_CHAR_ADDR(1)));
|
||||
LZDecompressVram(sBattleTerrainTable[gBattleTerrain].entryTilemap, (void *)(BG_SCREEN_ADDR(28)));
|
||||
}
|
||||
else
|
||||
{
|
||||
LZDecompressVram(gBattleTerrainAnimTiles_Building, (void*)(BG_CHAR_ADDR(1)));
|
||||
LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void*)(BG_SCREEN_ADDR(28)));
|
||||
LZDecompressVram(gBattleTerrainAnimTiles_Building, (void *)(BG_CHAR_ADDR(1)));
|
||||
LZDecompressVram(gBattleTerrainAnimTilemap_Building, (void *)(BG_SCREEN_ADDR(28)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1212,7 +1212,7 @@ bool8 LoadChosenBattleElement(u8 caseId)
|
||||
switch (caseId)
|
||||
{
|
||||
case 0:
|
||||
LZDecompressVram(gBattleTextboxTiles, (void*)(BG_CHAR_ADDR(0)));
|
||||
LZDecompressVram(gBattleTextboxTiles, (void *)(BG_CHAR_ADDR(0)));
|
||||
break;
|
||||
case 1:
|
||||
CopyToBgTilemapBuffer(0, gBattleTextboxTilemap, 0, 0);
|
||||
@@ -1224,11 +1224,11 @@ bool8 LoadChosenBattleElement(u8 caseId)
|
||||
case 3:
|
||||
if (gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_EREADER_TRAINER))
|
||||
{
|
||||
LZDecompressVram(gBattleTerrainTiles_Building, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTiles_Building, (void *)(BG_CHAR_ADDR(2)));
|
||||
}
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_GROUDON)
|
||||
{
|
||||
LZDecompressVram(gBattleTerrainTiles_Cave, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTiles_Cave, (void *)(BG_CHAR_ADDR(2)));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1237,12 +1237,12 @@ bool8 LoadChosenBattleElement(u8 caseId)
|
||||
u8 trainerClass = gTrainers[gTrainerBattleOpponent_A].trainerClass;
|
||||
if (trainerClass == TRAINER_CLASS_LEADER)
|
||||
{
|
||||
LZDecompressVram(gBattleTerrainTiles_Building, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTiles_Building, (void *)(BG_CHAR_ADDR(2)));
|
||||
break;
|
||||
}
|
||||
else if (trainerClass == TRAINER_CLASS_CHAMPION)
|
||||
{
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1251,31 +1251,31 @@ bool8 LoadChosenBattleElement(u8 caseId)
|
||||
{
|
||||
default:
|
||||
case MAP_BATTLE_SCENE_NORMAL:
|
||||
LZDecompressVram(sBattleTerrainTable[gBattleTerrain].tileset, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(sBattleTerrainTable[gBattleTerrain].tileset, (void *)(BG_CHAR_ADDR(2)));
|
||||
break;
|
||||
case MAP_BATTLE_SCENE_GYM:
|
||||
LZDecompressVram(gBattleTerrainTiles_Building, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTiles_Building, (void *)(BG_CHAR_ADDR(2)));
|
||||
break;
|
||||
case MAP_BATTLE_SCENE_MAGMA:
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2)));
|
||||
break;
|
||||
case MAP_BATTLE_SCENE_AQUA:
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2)));
|
||||
break;
|
||||
case MAP_BATTLE_SCENE_SIDNEY:
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2)));
|
||||
break;
|
||||
case MAP_BATTLE_SCENE_PHOEBE:
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2)));
|
||||
break;
|
||||
case MAP_BATTLE_SCENE_GLACIA:
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2)));
|
||||
break;
|
||||
case MAP_BATTLE_SCENE_DRAKE:
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTiles_Stadium, (void *)(BG_CHAR_ADDR(2)));
|
||||
break;
|
||||
case MAP_BATTLE_SCENE_FRONTIER:
|
||||
LZDecompressVram(gBattleTerrainTiles_Building, (void*)(BG_CHAR_ADDR(2)));
|
||||
LZDecompressVram(gBattleTerrainTiles_Building, (void *)(BG_CHAR_ADDR(2)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1283,14 +1283,14 @@ bool8 LoadChosenBattleElement(u8 caseId)
|
||||
case 4:
|
||||
if (gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_EREADER_TRAINER))
|
||||
{
|
||||
LZDecompressVram(gBattleTerrainTilemap_Building, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(BG_SCREEN_ADDR(26)));
|
||||
}
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_KYOGRE_GROUDON)
|
||||
{
|
||||
if (gGameVersion == VERSION_RUBY)
|
||||
LZDecompressVram(gBattleTerrainTilemap_Cave, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Cave, (void *)(BG_SCREEN_ADDR(26)));
|
||||
else
|
||||
LZDecompressVram(gBattleTerrainTilemap_Water, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Water, (void *)(BG_SCREEN_ADDR(26)));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1299,12 +1299,12 @@ bool8 LoadChosenBattleElement(u8 caseId)
|
||||
u8 trainerClass = gTrainers[gTrainerBattleOpponent_A].trainerClass;
|
||||
if (trainerClass == TRAINER_CLASS_LEADER)
|
||||
{
|
||||
LZDecompressVram(gBattleTerrainTilemap_Building, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(BG_SCREEN_ADDR(26)));
|
||||
break;
|
||||
}
|
||||
else if (trainerClass == TRAINER_CLASS_CHAMPION)
|
||||
{
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1313,31 +1313,31 @@ bool8 LoadChosenBattleElement(u8 caseId)
|
||||
{
|
||||
default:
|
||||
case MAP_BATTLE_SCENE_NORMAL:
|
||||
LZDecompressVram(sBattleTerrainTable[gBattleTerrain].tilemap, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(sBattleTerrainTable[gBattleTerrain].tilemap, (void *)(BG_SCREEN_ADDR(26)));
|
||||
break;
|
||||
case MAP_BATTLE_SCENE_GYM:
|
||||
LZDecompressVram(gBattleTerrainTilemap_Building, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(BG_SCREEN_ADDR(26)));
|
||||
break;
|
||||
case MAP_BATTLE_SCENE_MAGMA:
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26)));
|
||||
break;
|
||||
case MAP_BATTLE_SCENE_AQUA:
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26)));
|
||||
break;
|
||||
case MAP_BATTLE_SCENE_SIDNEY:
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26)));
|
||||
break;
|
||||
case MAP_BATTLE_SCENE_PHOEBE:
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26)));
|
||||
break;
|
||||
case MAP_BATTLE_SCENE_GLACIA:
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26)));
|
||||
break;
|
||||
case MAP_BATTLE_SCENE_DRAKE:
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Stadium, (void *)(BG_SCREEN_ADDR(26)));
|
||||
break;
|
||||
case MAP_BATTLE_SCENE_FRONTIER:
|
||||
LZDecompressVram(gBattleTerrainTilemap_Building, (void*)(BG_SCREEN_ADDR(26)));
|
||||
LZDecompressVram(gBattleTerrainTilemap_Building, (void *)(BG_SCREEN_ADDR(26)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -368,16 +368,13 @@ static void TryShinyAnimAfterMonAnim(void)
|
||||
{
|
||||
TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]);
|
||||
}
|
||||
else
|
||||
else if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim)
|
||||
{
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim)
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE;
|
||||
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
|
||||
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
|
||||
LinkOpponentBufferExecCompleted();
|
||||
}
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE;
|
||||
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
|
||||
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
|
||||
LinkOpponentBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -389,13 +386,9 @@ static void CompleteOnHealthbarDone(void)
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
|
||||
if (hpValue != -1)
|
||||
{
|
||||
UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], hpValue, HP_CURRENT);
|
||||
}
|
||||
else
|
||||
{
|
||||
LinkOpponentBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
|
||||
static void HideHealthboxAfterMonFaint(void)
|
||||
@@ -627,7 +620,7 @@ static u32 CopyLinkOpponentMonData(u8 monId, u8 *dst)
|
||||
moveData.pp[size] = GetMonData(&gEnemyParty[monId], MON_DATA_PP1 + size);
|
||||
}
|
||||
moveData.ppBonuses = GetMonData(&gEnemyParty[monId], MON_DATA_PP_BONUSES);
|
||||
src = (u8*)(&moveData);
|
||||
src = (u8 *)(&moveData);
|
||||
for (size = 0; size < sizeof(moveData); size++)
|
||||
dst[size] = src[size];
|
||||
break;
|
||||
@@ -1466,7 +1459,7 @@ static void LinkOpponentHandlePrintString(void)
|
||||
|
||||
gBattle_BG0_X = 0;
|
||||
gBattle_BG0_Y = 0;
|
||||
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
|
||||
stringId = (u16 *)(&gBattleBufferA[gActiveBattler][2]);
|
||||
BufferStringBattle(*stringId);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
|
||||
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter;
|
||||
@@ -1758,14 +1751,14 @@ static void LinkOpponentHandleDrawPartyStatusSummary(void)
|
||||
|
||||
if (gBattleBufferA[gActiveBattler][2] != 0)
|
||||
{
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1E < 2)
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].opponentDrawPartyStatusSummaryDelay < 2)
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1E++;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].opponentDrawPartyStatusSummaryDelay++;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1E = 0;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].opponentDrawPartyStatusSummaryDelay = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -217,7 +217,7 @@ static void Intro_WaitForHealthbox(void)
|
||||
else
|
||||
{
|
||||
if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& gSprites[gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy)
|
||||
&& gSprites[gHealthboxSpriteIds[BATTLE_PARTNER(gActiveBattler)]].callback == SpriteCallbackDummy)
|
||||
{
|
||||
finished = TRUE;
|
||||
}
|
||||
@@ -236,7 +236,7 @@ static void Intro_WaitForHealthbox(void)
|
||||
static void Intro_ShowHealthbox(void)
|
||||
{
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].ballAnimActive
|
||||
&& gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& ++gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay != 1)
|
||||
@@ -245,10 +245,10 @@ static void Intro_ShowHealthbox(void)
|
||||
|
||||
if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI))
|
||||
{
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler ^ BIT_FLANK]]);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]], HEALTHBOX_ALL);
|
||||
StartHealthboxSlideIn(gActiveBattler ^ BIT_FLANK);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]);
|
||||
DestroySprite(&gSprites[gBattleControllerData[BATTLE_PARTNER(gActiveBattler)]]);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[BATTLE_PARTNER(gActiveBattler)], &gPlayerParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]], HEALTHBOX_ALL);
|
||||
StartHealthboxSlideIn(BATTLE_PARTNER(gActiveBattler));
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[BATTLE_PARTNER(gActiveBattler)]);
|
||||
}
|
||||
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]);
|
||||
@@ -514,7 +514,7 @@ static u32 CopyLinkPartnerMonData(u8 monId, u8 *dst)
|
||||
moveData.pp[size] = GetMonData(&gPlayerParty[monId], MON_DATA_PP1 + size);
|
||||
}
|
||||
moveData.ppBonuses = GetMonData(&gPlayerParty[monId], MON_DATA_PP_BONUSES);
|
||||
src = (u8*)(&moveData);
|
||||
src = (u8 *)(&moveData);
|
||||
for (size = 0; size < sizeof(moveData); size++)
|
||||
dst[size] = src[size];
|
||||
break;
|
||||
@@ -1298,7 +1298,7 @@ static void LinkPartnerHandlePrintString(void)
|
||||
|
||||
gBattle_BG0_X = 0;
|
||||
gBattle_BG0_Y = 0;
|
||||
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
|
||||
stringId = (u16 *)(&gBattleBufferA[gActiveBattler][2]);
|
||||
BufferStringBattle(*stringId);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
|
||||
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter;
|
||||
|
||||
@@ -234,25 +234,25 @@ static void Intro_WaitForShinyAnimAndHealthbox(void)
|
||||
else
|
||||
{
|
||||
if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& gSprites[gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy)
|
||||
&& gSprites[gHealthboxSpriteIds[BATTLE_PARTNER(gActiveBattler)]].callback == SpriteCallbackDummy)
|
||||
healthboxAnimDone = TRUE;
|
||||
twoMons = TRUE;
|
||||
}
|
||||
|
||||
gBattleControllerOpponentHealthboxData = &gBattleSpritesDataPtr->healthBoxesData[gActiveBattler];
|
||||
gBattleControllerOpponentFlankHealthboxData = &gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK];
|
||||
gBattleControllerOpponentFlankHealthboxData = &gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)];
|
||||
|
||||
if (healthboxAnimDone)
|
||||
{
|
||||
if (twoMons == TRUE)
|
||||
{
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim
|
||||
&& gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim)
|
||||
&& gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].finishedShinyMonAnim)
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = FALSE;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = FALSE;
|
||||
gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].triedShinyMonAnim = FALSE;
|
||||
gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].finishedShinyMonAnim = FALSE;
|
||||
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
|
||||
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
|
||||
}
|
||||
@@ -263,8 +263,8 @@ static void Intro_WaitForShinyAnimAndHealthbox(void)
|
||||
{
|
||||
if (GetBattlerPosition(gActiveBattler) == 3)
|
||||
{
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim)
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].triedShinyMonAnim
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].finishedShinyMonAnim)
|
||||
{
|
||||
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
|
||||
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
|
||||
@@ -296,20 +296,20 @@ static void Intro_TryShinyAnimShowHealthbox(void)
|
||||
if (!(gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS)
|
||||
&& !(gBattleTypeFlags & BATTLE_TYPE_MULTI)
|
||||
&& IsDoubleBattle()
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim)
|
||||
TryShinyAnimation(gActiveBattler ^ BIT_FLANK, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]]);
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].triedShinyMonAnim
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].ballAnimActive
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].finishedShinyMonAnim)
|
||||
TryShinyAnimation(BATTLE_PARTNER(gActiveBattler), &gEnemyParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]]);
|
||||
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive)
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].ballAnimActive)
|
||||
{
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted)
|
||||
{
|
||||
if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI))
|
||||
{
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK], &gEnemyParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]], HEALTHBOX_ALL);
|
||||
StartHealthboxSlideIn(gActiveBattler ^ BIT_FLANK);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[BATTLE_PARTNER(gActiveBattler)], &gEnemyParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]], HEALTHBOX_ALL);
|
||||
StartHealthboxSlideIn(BATTLE_PARTNER(gActiveBattler));
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[BATTLE_PARTNER(gActiveBattler)]);
|
||||
}
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], HEALTHBOX_ALL);
|
||||
StartHealthboxSlideIn(gActiveBattler);
|
||||
@@ -320,7 +320,7 @@ static void Intro_TryShinyAnimShowHealthbox(void)
|
||||
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].waitForCry
|
||||
&& gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].waitForCry
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].waitForCry
|
||||
&& !IsCryPlayingOrClearCrySongs())
|
||||
{
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].bgmRestored)
|
||||
@@ -349,8 +349,8 @@ static void Intro_TryShinyAnimShowHealthbox(void)
|
||||
{
|
||||
if (gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& gSprites[gBattleControllerData[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy
|
||||
&& gSprites[gBattlerSpriteIds[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy)
|
||||
&& gSprites[gBattleControllerData[BATTLE_PARTNER(gActiveBattler)]].callback == SpriteCallbackDummy
|
||||
&& gSprites[gBattlerSpriteIds[BATTLE_PARTNER(gActiveBattler)]].callback == SpriteCallbackDummy)
|
||||
{
|
||||
battlerAnimsDone = TRUE;
|
||||
}
|
||||
@@ -360,8 +360,8 @@ static void Intro_TryShinyAnimShowHealthbox(void)
|
||||
{
|
||||
if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI))
|
||||
{
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler ^ BIT_FLANK]]);
|
||||
SetBattlerShadowSpriteCallback(gActiveBattler ^ BIT_FLANK, GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]], MON_DATA_SPECIES));
|
||||
DestroySprite(&gSprites[gBattleControllerData[BATTLE_PARTNER(gActiveBattler)]]);
|
||||
SetBattlerShadowSpriteCallback(BATTLE_PARTNER(gActiveBattler), GetMonData(&gEnemyParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]], MON_DATA_SPECIES));
|
||||
}
|
||||
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]);
|
||||
@@ -397,9 +397,7 @@ static void CompleteOnHealthbarDone(void)
|
||||
s16 hpValue = MoveBattleBar(gActiveBattler, gHealthboxSpriteIds[gActiveBattler], HEALTH_BAR, 0);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
if (hpValue != -1)
|
||||
{
|
||||
UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], hpValue, HP_CURRENT);
|
||||
}
|
||||
else
|
||||
OpponentBufferExecCompleted();
|
||||
}
|
||||
@@ -627,7 +625,7 @@ static u32 GetOpponentMonData(u8 monId, u8 *dst)
|
||||
moveData.pp[size] = GetMonData(&gEnemyParty[monId], MON_DATA_PP1 + size);
|
||||
}
|
||||
moveData.ppBonuses = GetMonData(&gEnemyParty[monId], MON_DATA_PP_BONUSES);
|
||||
src = (u8*)(&moveData);
|
||||
src = (u8 *)(&moveData);
|
||||
for (size = 0; size < sizeof(moveData); size++)
|
||||
dst[size] = src[size];
|
||||
break;
|
||||
@@ -1519,7 +1517,7 @@ static void OpponentHandlePrintString(void)
|
||||
|
||||
gBattle_BG0_X = 0;
|
||||
gBattle_BG0_Y = 0;
|
||||
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
|
||||
stringId = (u16 *)(&gBattleBufferA[gActiveBattler][2]);
|
||||
BufferStringBattle(*stringId);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
|
||||
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter;
|
||||
@@ -1552,7 +1550,7 @@ static void OpponentHandleChooseMove(void)
|
||||
else
|
||||
{
|
||||
u8 chosenMoveId;
|
||||
struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleBufferA[gActiveBattler][4]);
|
||||
struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct *)(&gBattleBufferA[gActiveBattler][4]);
|
||||
|
||||
if (gBattleTypeFlags & (BATTLE_TYPE_TRAINER | BATTLE_TYPE_FIRST_BATTLE | BATTLE_TYPE_SAFARI | BATTLE_TYPE_ROAMER))
|
||||
{
|
||||
@@ -1929,14 +1927,14 @@ static void OpponentHandleDrawPartyStatusSummary(void)
|
||||
|
||||
if (gBattleBufferA[gActiveBattler][2] != 0)
|
||||
{
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1E < 2)
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].opponentDrawPartyStatusSummaryDelay < 2)
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1E++;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].opponentDrawPartyStatusSummaryDelay++;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1E = 0;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].opponentDrawPartyStatusSummaryDelay = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -96,8 +96,8 @@ static void PlayerCmdEnd(void);
|
||||
static void PlayerBufferRunCommand(void);
|
||||
static void HandleInputChooseTarget(void);
|
||||
static void HandleInputChooseMove(void);
|
||||
static void MoveSelectionCreateCursorAt(u8 cursorPos, u8 arg1);
|
||||
static void MoveSelectionDestroyCursorAt(u8 cursorPos);
|
||||
static void MoveSelectionCreateCursorAt(u8, u8);
|
||||
static void MoveSelectionDestroyCursorAt(u8);
|
||||
static void MoveSelectionDisplayPpNumber(void);
|
||||
static void MoveSelectionDisplayPpString(void);
|
||||
static void MoveSelectionDisplayMoveType(void);
|
||||
@@ -106,18 +106,18 @@ static void HandleMoveSwitching(void);
|
||||
static void SwitchIn_HandleSoundAndEnd(void);
|
||||
static void WaitForMonSelection(void);
|
||||
static void CompleteWhenChoseItem(void);
|
||||
static void Task_LaunchLvlUpAnim(u8 taskId);
|
||||
static void Task_PrepareToGiveExpWithExpBar(u8 taskId);
|
||||
static void DestroyExpTaskAndCompleteOnInactiveTextPrinter(u8 taskId);
|
||||
static void Task_GiveExpWithExpBar(u8 taskId);
|
||||
static void Task_UpdateLvlInHealthbox(u8 taskId);
|
||||
static void Task_LaunchLvlUpAnim(u8);
|
||||
static void Task_PrepareToGiveExpWithExpBar(u8);
|
||||
static void DestroyExpTaskAndCompleteOnInactiveTextPrinter(u8);
|
||||
static void Task_GiveExpWithExpBar(u8);
|
||||
static void Task_UpdateLvlInHealthbox(u8);
|
||||
static void PrintLinkStandbyMsg(void);
|
||||
static u32 CopyPlayerMonData(u8 monId, u8 *dst);
|
||||
static void SetPlayerMonData(u8 monId);
|
||||
static void StartSendOutAnim(u8 battlerId, bool8 dontClearSubstituteBit);
|
||||
static u32 CopyPlayerMonData(u8, u8 *);
|
||||
static void SetPlayerMonData(u8);
|
||||
static void StartSendOutAnim(u8, bool8);
|
||||
static void DoSwitchOutAnimation(void);
|
||||
static void PlayerDoMoveAnimation(void);
|
||||
static void Task_StartSendOutAnim(u8 taskId);
|
||||
static void Task_StartSendOutAnim(u8);
|
||||
static void EndDrawPartyStatusSummary(void);
|
||||
|
||||
static void (*const sPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void) =
|
||||
@@ -364,7 +364,7 @@ static void HandleInputChooseTarget(void)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget;
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_HideAsMoveTarget;
|
||||
BtlController_EmitTwoReturnValues(BUFFER_B, 10, gMoveSelectionCursor[gActiveBattler] | (gMultiUsePlayerCursor << 8));
|
||||
EndBounceEffect(gMultiUsePlayerCursor, BOUNCE_HEALTHBOX);
|
||||
PlayerBufferExecCompleted();
|
||||
@@ -372,7 +372,7 @@ static void HandleInputChooseTarget(void)
|
||||
else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59)
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget;
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_HideAsMoveTarget;
|
||||
gBattlerControllerFuncs[gActiveBattler] = HandleInputChooseMove;
|
||||
DoBounceEffect(gActiveBattler, BOUNCE_HEALTHBOX, 7, 1);
|
||||
DoBounceEffect(gActiveBattler, BOUNCE_MON, 7, 1);
|
||||
@@ -381,7 +381,7 @@ static void HandleInputChooseTarget(void)
|
||||
else if (JOY_NEW(DPAD_LEFT | DPAD_UP))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget;
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_HideAsMoveTarget;
|
||||
|
||||
do
|
||||
{
|
||||
@@ -422,12 +422,12 @@ static void HandleInputChooseTarget(void)
|
||||
if (gAbsentBattlerFlags & gBitTable[gMultiUsePlayerCursor])
|
||||
i = 0;
|
||||
} while (i == 0);
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_ShowAsMoveTarget;
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_ShowAsMoveTarget;
|
||||
}
|
||||
else if (JOY_NEW(DPAD_RIGHT | DPAD_DOWN))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_HideAsMoveTarget;
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_HideAsMoveTarget;
|
||||
|
||||
do
|
||||
{
|
||||
@@ -464,14 +464,14 @@ static void HandleInputChooseTarget(void)
|
||||
if (gAbsentBattlerFlags & gBitTable[gMultiUsePlayerCursor])
|
||||
i = 0;
|
||||
} while (i == 0);
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_ShowAsMoveTarget;
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_ShowAsMoveTarget;
|
||||
}
|
||||
}
|
||||
|
||||
static void HandleInputChooseMove(void)
|
||||
{
|
||||
bool32 canSelectTarget = FALSE;
|
||||
struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleBufferA[gActiveBattler][4]);
|
||||
struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct *)(&gBattleBufferA[gActiveBattler][4]);
|
||||
|
||||
if (JOY_HELD(DPAD_ANY) && gSaveBlock2Ptr->optionsButtonMode == OPTIONS_BUTTON_MODE_L_EQUALS_A)
|
||||
gPlayerDpadHoldFrames++;
|
||||
@@ -498,7 +498,7 @@ static void HandleInputChooseMove(void)
|
||||
if (moveTarget & MOVE_TARGET_USER)
|
||||
gMultiUsePlayerCursor = gActiveBattler;
|
||||
else
|
||||
gMultiUsePlayerCursor = GetBattlerAtPosition((GetBattlerPosition(gActiveBattler) & BIT_SIDE) ^ BIT_SIDE);
|
||||
gMultiUsePlayerCursor = GetBattlerAtPosition(BATTLE_OPPOSITE(GET_BATTLER_SIDE(gActiveBattler)));
|
||||
|
||||
if (!gBattleBufferA[gActiveBattler][1]) // not a double battle
|
||||
{
|
||||
@@ -537,7 +537,7 @@ static void HandleInputChooseMove(void)
|
||||
else
|
||||
gMultiUsePlayerCursor = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT);
|
||||
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCb_ShowAsMoveTarget;
|
||||
gSprites[gBattlerSpriteIds[gMultiUsePlayerCursor]].callback = SpriteCB_ShowAsMoveTarget;
|
||||
}
|
||||
}
|
||||
else if (JOY_NEW(B_BUTTON) || gPlayerDpadHoldFrames > 59)
|
||||
@@ -676,7 +676,7 @@ static void HandleMoveSwitching(void)
|
||||
|
||||
if (gMoveSelectionCursor[gActiveBattler] != gMultiUsePlayerCursor)
|
||||
{
|
||||
struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleBufferA[gActiveBattler][4]);
|
||||
struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct *)(&gBattleBufferA[gActiveBattler][4]);
|
||||
s32 i;
|
||||
|
||||
// swap moves and pp
|
||||
@@ -950,26 +950,26 @@ static void Intro_WaitForShinyAnimAndHealthbox(void)
|
||||
else
|
||||
{
|
||||
if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& gSprites[gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy)
|
||||
&& gSprites[gHealthboxSpriteIds[BATTLE_PARTNER(gActiveBattler)]].callback == SpriteCallbackDummy)
|
||||
healthboxAnimDone = TRUE;
|
||||
}
|
||||
|
||||
// If healthbox and shiny anim are done
|
||||
if (healthboxAnimDone && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim
|
||||
&& gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim)
|
||||
&& gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].finishedShinyMonAnim)
|
||||
{
|
||||
// Reset shiny anim (even if it didn't occur)
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = FALSE;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = FALSE;
|
||||
gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].triedShinyMonAnim = FALSE;
|
||||
gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].finishedShinyMonAnim = FALSE;
|
||||
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
|
||||
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
|
||||
|
||||
HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler);
|
||||
|
||||
if (IsDoubleBattle())
|
||||
HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]], gActiveBattler ^ BIT_FLANK);
|
||||
HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]], BATTLE_PARTNER(gActiveBattler));
|
||||
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay = 3;
|
||||
gBattlerControllerFuncs[gActiveBattler] = Intro_DelayAndEnd;
|
||||
@@ -987,21 +987,21 @@ static void Intro_TryShinyAnimShowHealthbox(void)
|
||||
TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]);
|
||||
|
||||
// Start shiny animation if applicable for 2nd pokemon
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive)
|
||||
TryShinyAnimation(gActiveBattler ^ BIT_FLANK, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]]);
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].triedShinyMonAnim
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].ballAnimActive)
|
||||
TryShinyAnimation(BATTLE_PARTNER(gActiveBattler), &gPlayerParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]]);
|
||||
|
||||
// Show healthbox after ball anim
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive)
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].ballAnimActive)
|
||||
{
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted)
|
||||
{
|
||||
if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI))
|
||||
{
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]], HEALTHBOX_ALL);
|
||||
StartHealthboxSlideIn(gActiveBattler ^ BIT_FLANK);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[BATTLE_PARTNER(gActiveBattler)], &gPlayerParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]], HEALTHBOX_ALL);
|
||||
StartHealthboxSlideIn(BATTLE_PARTNER(gActiveBattler));
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[BATTLE_PARTNER(gActiveBattler)]);
|
||||
}
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], HEALTHBOX_ALL);
|
||||
StartHealthboxSlideIn(gActiveBattler);
|
||||
@@ -1013,7 +1013,7 @@ static void Intro_TryShinyAnimShowHealthbox(void)
|
||||
// Restore bgm after cry has played and healthbox anim is started
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].waitForCry
|
||||
&& gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].waitForCry
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].waitForCry
|
||||
&& !IsCryPlayingOrClearCrySongs())
|
||||
{
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].bgmRestored)
|
||||
@@ -1040,8 +1040,8 @@ static void Intro_TryShinyAnimShowHealthbox(void)
|
||||
{
|
||||
if (gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& gSprites[gBattleControllerData[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy
|
||||
&& gSprites[gBattlerSpriteIds[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy)
|
||||
&& gSprites[gBattleControllerData[BATTLE_PARTNER(gActiveBattler)]].callback == SpriteCallbackDummy
|
||||
&& gSprites[gBattlerSpriteIds[BATTLE_PARTNER(gActiveBattler)]].callback == SpriteCallbackDummy)
|
||||
{
|
||||
battlerAnimsDone = TRUE;
|
||||
}
|
||||
@@ -1051,7 +1051,7 @@ static void Intro_TryShinyAnimShowHealthbox(void)
|
||||
if (bgmRestored && battlerAnimsDone)
|
||||
{
|
||||
if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI))
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler ^ BIT_FLANK]]);
|
||||
DestroySprite(&gSprites[gBattleControllerData[BATTLE_PARTNER(gActiveBattler)]]);
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]);
|
||||
|
||||
gBattleSpritesDataPtr->animationData->introAnimActive = FALSE;
|
||||
@@ -1178,7 +1178,7 @@ static void Task_GiveExpToMon(u8 taskId)
|
||||
gActiveBattler = savedActiveBattler;
|
||||
|
||||
if (IsDoubleBattle() == TRUE
|
||||
&& ((u16)(monId) == gBattlerPartyIndexes[battlerId] || (u16)(monId) == gBattlerPartyIndexes[battlerId ^ BIT_FLANK]))
|
||||
&& ((u16)(monId) == gBattlerPartyIndexes[battlerId] || (u16)(monId) == gBattlerPartyIndexes[BATTLE_PARTNER(battlerId)]))
|
||||
gTasks[taskId].func = Task_LaunchLvlUpAnim;
|
||||
else
|
||||
gTasks[taskId].func = DestroyExpTaskAndCompleteOnInactiveTextPrinter;
|
||||
@@ -1273,7 +1273,7 @@ static void Task_LaunchLvlUpAnim(u8 taskId)
|
||||
u8 battlerId = gTasks[taskId].tExpTask_battler;
|
||||
u8 monIndex = gTasks[taskId].tExpTask_monId;
|
||||
|
||||
if (IsDoubleBattle() == TRUE && monIndex == gBattlerPartyIndexes[battlerId ^ BIT_FLANK])
|
||||
if (IsDoubleBattle() == TRUE && monIndex == gBattlerPartyIndexes[BATTLE_PARTNER(battlerId)])
|
||||
battlerId ^= BIT_FLANK;
|
||||
|
||||
InitAndLaunchSpecialAnimation(battlerId, battlerId, battlerId, B_ANIM_LVL_UP);
|
||||
@@ -1290,8 +1290,8 @@ static void Task_UpdateLvlInHealthbox(u8 taskId)
|
||||
|
||||
GetMonData(&gPlayerParty[monIndex], MON_DATA_LEVEL); // Unused return value.
|
||||
|
||||
if (IsDoubleBattle() == TRUE && monIndex == gBattlerPartyIndexes[battlerId ^ BIT_FLANK])
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[battlerId ^ BIT_FLANK], &gPlayerParty[monIndex], HEALTHBOX_ALL);
|
||||
if (IsDoubleBattle() == TRUE && monIndex == gBattlerPartyIndexes[BATTLE_PARTNER(battlerId)])
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[BATTLE_PARTNER(battlerId)], &gPlayerParty[monIndex], HEALTHBOX_ALL);
|
||||
else
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[battlerId], &gPlayerParty[monIndex], HEALTHBOX_ALL);
|
||||
|
||||
@@ -1435,7 +1435,7 @@ static void PlayerHandleYesNoInput(void)
|
||||
}
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
HandleBattleWindow(0x18, 8, 0x1D, 0xD, WINDOW_CLEAR);
|
||||
HandleBattleWindow(YESNOBOX_X_Y, WINDOW_CLEAR);
|
||||
PlaySE(SE_SELECT);
|
||||
|
||||
if (gMultiUsePlayerCursor != 0)
|
||||
@@ -1447,7 +1447,7 @@ static void PlayerHandleYesNoInput(void)
|
||||
}
|
||||
if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
HandleBattleWindow(0x18, 8, 0x1D, 0xD, WINDOW_CLEAR);
|
||||
HandleBattleWindow(YESNOBOX_X_Y, WINDOW_CLEAR);
|
||||
PlaySE(SE_SELECT);
|
||||
PlayerBufferExecCompleted();
|
||||
}
|
||||
@@ -1456,7 +1456,7 @@ static void PlayerHandleYesNoInput(void)
|
||||
static void MoveSelectionDisplayMoveNames(void)
|
||||
{
|
||||
s32 i;
|
||||
struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleBufferA[gActiveBattler][4]);
|
||||
struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct *)(&gBattleBufferA[gActiveBattler][4]);
|
||||
gNumberOfMovesToChoose = 0;
|
||||
|
||||
for (i = 0; i < MAX_MON_MOVES; i++)
|
||||
@@ -1485,7 +1485,7 @@ static void MoveSelectionDisplayPpNumber(void)
|
||||
return;
|
||||
|
||||
SetPpNumbersPaletteInMoveSelection();
|
||||
moveInfo = (struct ChooseMoveStruct*)(&gBattleBufferA[gActiveBattler][4]);
|
||||
moveInfo = (struct ChooseMoveStruct *)(&gBattleBufferA[gActiveBattler][4]);
|
||||
txtPtr = ConvertIntToDecimalStringN(gDisplayedStringBattle, moveInfo->currentPp[gMoveSelectionCursor[gActiveBattler]], STR_CONV_MODE_RIGHT_ALIGN, 2);
|
||||
*(txtPtr)++ = CHAR_SLASH;
|
||||
ConvertIntToDecimalStringN(txtPtr, moveInfo->maxPp[gMoveSelectionCursor[gActiveBattler]], STR_CONV_MODE_RIGHT_ALIGN, 2);
|
||||
@@ -1496,22 +1496,22 @@ static void MoveSelectionDisplayPpNumber(void)
|
||||
static void MoveSelectionDisplayMoveType(void)
|
||||
{
|
||||
u8 *txtPtr;
|
||||
struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleBufferA[gActiveBattler][4]);
|
||||
struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct *)(&gBattleBufferA[gActiveBattler][4]);
|
||||
|
||||
txtPtr = StringCopy(gDisplayedStringBattle, gText_MoveInterfaceType);
|
||||
*(txtPtr)++ = EXT_CTRL_CODE_BEGIN;
|
||||
*(txtPtr)++ = EXT_CTRL_CODE_FONT;
|
||||
*(txtPtr)++ = 1;
|
||||
*(txtPtr)++ = FONT_NORMAL;
|
||||
|
||||
StringCopy(txtPtr, gTypeNames[gBattleMoves[moveInfo->moves[gMoveSelectionCursor[gActiveBattler]]].type]);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MOVE_TYPE);
|
||||
}
|
||||
|
||||
static void MoveSelectionCreateCursorAt(u8 cursorPosition, u8 arg1)
|
||||
static void MoveSelectionCreateCursorAt(u8 cursorPosition, u8 baseTileNum)
|
||||
{
|
||||
u16 src[2];
|
||||
src[0] = arg1 + 1;
|
||||
src[1] = arg1 + 2;
|
||||
src[0] = baseTileNum + 1;
|
||||
src[1] = baseTileNum + 2;
|
||||
|
||||
CopyToBgTilemapBufferRect_ChangePalette(0, src, 9 * (cursorPosition & 1) + 1, 55 + (cursorPosition & 2), 1, 2, 0x11);
|
||||
CopyBgTilemapBufferToVram(0);
|
||||
@@ -1527,7 +1527,7 @@ static void MoveSelectionDestroyCursorAt(u8 cursorPosition)
|
||||
CopyBgTilemapBufferToVram(0);
|
||||
}
|
||||
|
||||
void ActionSelectionCreateCursorAt(u8 cursorPosition, u8 arg1)
|
||||
void ActionSelectionCreateCursorAt(u8 cursorPosition, u8 baseTileNum)
|
||||
{
|
||||
u16 src[2];
|
||||
src[0] = 1;
|
||||
@@ -1672,7 +1672,7 @@ static u32 CopyPlayerMonData(u8 monId, u8 *dst)
|
||||
moveData.pp[size] = GetMonData(&gPlayerParty[monId], MON_DATA_PP1 + size);
|
||||
}
|
||||
moveData.ppBonuses = GetMonData(&gPlayerParty[monId], MON_DATA_PP_BONUSES);
|
||||
src = (u8*)(&moveData);
|
||||
src = (u8 *)(&moveData);
|
||||
for (size = 0; size < sizeof(moveData); size++)
|
||||
dst[size] = src[size];
|
||||
break;
|
||||
@@ -2546,7 +2546,7 @@ static void PlayerHandlePrintString(void)
|
||||
|
||||
gBattle_BG0_X = 0;
|
||||
gBattle_BG0_Y = 0;
|
||||
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
|
||||
stringId = (u16 *)(&gBattleBufferA[gActiveBattler][2]);
|
||||
BufferStringBattle(*stringId);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
|
||||
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter2;
|
||||
@@ -2592,7 +2592,7 @@ static void PlayerHandleYesNoBox(void)
|
||||
{
|
||||
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
||||
{
|
||||
HandleBattleWindow(0x18, 8, 0x1D, 0xD, 0);
|
||||
HandleBattleWindow(YESNOBOX_X_Y, 0);
|
||||
BattlePutTextOnWindow(gText_BattleYesNoChoice, B_WIN_YESNO);
|
||||
gMultiUsePlayerCursor = 1;
|
||||
BattleCreateYesNoCursorAt(1);
|
||||
@@ -2797,7 +2797,7 @@ static void PlayerHandleDMA3Transfer(void)
|
||||
u16 sizeArg = gBattleBufferA[gActiveBattler][5] | (gBattleBufferA[gActiveBattler][6] << 8);
|
||||
|
||||
const u8 *src = &gBattleBufferA[gActiveBattler][7];
|
||||
u8 *dst = (u8*)(dstArg);
|
||||
u8 *dst = (u8 *)(dstArg);
|
||||
u32 size = sizeArg;
|
||||
|
||||
while (1)
|
||||
|
||||
@@ -229,7 +229,7 @@ static void Intro_WaitForHealthbox(void)
|
||||
else
|
||||
{
|
||||
if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& gSprites[gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy)
|
||||
&& gSprites[gHealthboxSpriteIds[BATTLE_PARTNER(gActiveBattler)]].callback == SpriteCallbackDummy)
|
||||
{
|
||||
finished = TRUE;
|
||||
}
|
||||
@@ -248,7 +248,7 @@ static void Intro_WaitForHealthbox(void)
|
||||
static void Intro_ShowHealthbox(void)
|
||||
{
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].ballAnimActive
|
||||
&& gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& ++gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay != 1)
|
||||
@@ -257,10 +257,10 @@ static void Intro_ShowHealthbox(void)
|
||||
|
||||
if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI))
|
||||
{
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler ^ BIT_FLANK]]);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]], HEALTHBOX_ALL);
|
||||
StartHealthboxSlideIn(gActiveBattler ^ BIT_FLANK);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]);
|
||||
DestroySprite(&gSprites[gBattleControllerData[BATTLE_PARTNER(gActiveBattler)]]);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[BATTLE_PARTNER(gActiveBattler)], &gPlayerParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]], HEALTHBOX_ALL);
|
||||
StartHealthboxSlideIn(BATTLE_PARTNER(gActiveBattler));
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[BATTLE_PARTNER(gActiveBattler)]);
|
||||
}
|
||||
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]);
|
||||
@@ -336,7 +336,7 @@ static void Task_GiveExpToMon(u8 taskId)
|
||||
gActiveBattler = savedActiveBank;
|
||||
|
||||
if (IsDoubleBattle() == TRUE
|
||||
&& ((u16)(monId) == gBattlerPartyIndexes[battlerId] || (u16)(monId) == gBattlerPartyIndexes[battlerId ^ BIT_FLANK]))
|
||||
&& ((u16)(monId) == gBattlerPartyIndexes[battlerId] || (u16)(monId) == gBattlerPartyIndexes[BATTLE_PARTNER(battlerId)]))
|
||||
gTasks[taskId].func = Task_LaunchLvlUpAnim;
|
||||
else
|
||||
gTasks[taskId].func = DestroyExpTaskAndCompleteOnInactiveTextPrinter;
|
||||
@@ -431,7 +431,7 @@ static void Task_LaunchLvlUpAnim(u8 taskId)
|
||||
u8 battlerId = gTasks[taskId].tExpTask_bank;
|
||||
u8 monIndex = gTasks[taskId].tExpTask_monId;
|
||||
|
||||
if (IsDoubleBattle() == TRUE && monIndex == gBattlerPartyIndexes[battlerId ^ BIT_FLANK])
|
||||
if (IsDoubleBattle() == TRUE && monIndex == gBattlerPartyIndexes[BATTLE_PARTNER(battlerId)])
|
||||
battlerId ^= BIT_FLANK;
|
||||
|
||||
InitAndLaunchSpecialAnimation(battlerId, battlerId, battlerId, B_ANIM_LVL_UP);
|
||||
@@ -448,8 +448,8 @@ static void Task_UpdateLvlInHealthbox(u8 taskId)
|
||||
|
||||
GetMonData(&gPlayerParty[monIndex], MON_DATA_LEVEL); // Unused return value
|
||||
|
||||
if (IsDoubleBattle() == TRUE && monIndex == gBattlerPartyIndexes[battlerId ^ BIT_FLANK])
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[battlerId ^ BIT_FLANK], &gPlayerParty[monIndex], HEALTHBOX_ALL);
|
||||
if (IsDoubleBattle() == TRUE && monIndex == gBattlerPartyIndexes[BATTLE_PARTNER(battlerId)])
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[BATTLE_PARTNER(battlerId)], &gPlayerParty[monIndex], HEALTHBOX_ALL);
|
||||
else
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[battlerId], &gPlayerParty[monIndex], HEALTHBOX_ALL);
|
||||
|
||||
@@ -698,7 +698,7 @@ static u32 CopyPlayerPartnerMonData(u8 monId, u8 *dst)
|
||||
moveData.pp[size] = GetMonData(&gPlayerParty[monId], MON_DATA_PP1 + size);
|
||||
}
|
||||
moveData.ppBonuses = GetMonData(&gPlayerParty[monId], MON_DATA_PP_BONUSES);
|
||||
src = (u8*)(&moveData);
|
||||
src = (u8 *)(&moveData);
|
||||
for (size = 0; size < sizeof(moveData); size++)
|
||||
dst[size] = src[size];
|
||||
break;
|
||||
@@ -1488,7 +1488,7 @@ static void PlayerPartnerHandlePrintString(void)
|
||||
|
||||
gBattle_BG0_X = 0;
|
||||
gBattle_BG0_Y = 0;
|
||||
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
|
||||
stringId = (u16 *)(&gBattleBufferA[gActiveBattler][2]);
|
||||
BufferStringBattle(*stringId);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
|
||||
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter2;
|
||||
@@ -1513,7 +1513,7 @@ static void PlayerPartnerHandleYesNoBox(void)
|
||||
static void PlayerPartnerHandleChooseMove(void)
|
||||
{
|
||||
u8 chosenMoveId;
|
||||
struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleBufferA[gActiveBattler][4]);
|
||||
struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct *)(&gBattleBufferA[gActiveBattler][4]);
|
||||
|
||||
BattleAI_SetupAIData(0xF);
|
||||
chosenMoveId = BattleAI_ChooseMoveOrAction();
|
||||
|
||||
@@ -226,9 +226,9 @@ static void Intro_WaitForShinyAnimAndHealthbox(void)
|
||||
else
|
||||
{
|
||||
if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& gSprites[gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy
|
||||
&& gSprites[gHealthboxSpriteIds[BATTLE_PARTNER(gActiveBattler)]].callback == SpriteCallbackDummy
|
||||
&& gSprites[gBattlerSpriteIds[gActiveBattler]].animEnded
|
||||
&& gSprites[gBattlerSpriteIds[gActiveBattler ^ BIT_FLANK]].animEnded)
|
||||
&& gSprites[gBattlerSpriteIds[BATTLE_PARTNER(gActiveBattler)]].animEnded)
|
||||
healthboxAnimDone = TRUE;
|
||||
}
|
||||
|
||||
@@ -238,13 +238,13 @@ static void Intro_WaitForShinyAnimAndHealthbox(void)
|
||||
{
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim)
|
||||
return;
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim)
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].finishedShinyMonAnim)
|
||||
return;
|
||||
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = FALSE;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = FALSE;
|
||||
gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].triedShinyMonAnim = FALSE;
|
||||
gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].finishedShinyMonAnim = FALSE;
|
||||
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
|
||||
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
|
||||
}
|
||||
@@ -263,19 +263,19 @@ static void Intro_TryShinyAnimShowHealthbox(void)
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive)
|
||||
TryShinyAnimation(gActiveBattler, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]]);
|
||||
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive)
|
||||
TryShinyAnimation(gActiveBattler ^ BIT_FLANK, &gEnemyParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]]);
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].triedShinyMonAnim
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].ballAnimActive)
|
||||
TryShinyAnimation(BATTLE_PARTNER(gActiveBattler), &gEnemyParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]]);
|
||||
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive)
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive && !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].ballAnimActive)
|
||||
{
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted)
|
||||
{
|
||||
if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI))
|
||||
{
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK], &gEnemyParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]], HEALTHBOX_ALL);
|
||||
StartHealthboxSlideIn(gActiveBattler ^ BIT_FLANK);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[BATTLE_PARTNER(gActiveBattler)], &gEnemyParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]], HEALTHBOX_ALL);
|
||||
StartHealthboxSlideIn(BATTLE_PARTNER(gActiveBattler));
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[BATTLE_PARTNER(gActiveBattler)]);
|
||||
}
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], HEALTHBOX_ALL);
|
||||
StartHealthboxSlideIn(gActiveBattler);
|
||||
@@ -286,7 +286,7 @@ static void Intro_TryShinyAnimShowHealthbox(void)
|
||||
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].waitForCry
|
||||
&& gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].waitForCry
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].waitForCry
|
||||
&& !IsCryPlayingOrClearCrySongs())
|
||||
{
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].bgmRestored)
|
||||
@@ -317,8 +317,8 @@ static void Intro_TryShinyAnimShowHealthbox(void)
|
||||
{
|
||||
if (gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& gSprites[gBattleControllerData[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy
|
||||
&& gSprites[gBattlerSpriteIds[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy)
|
||||
&& gSprites[gBattleControllerData[BATTLE_PARTNER(gActiveBattler)]].callback == SpriteCallbackDummy
|
||||
&& gSprites[gBattlerSpriteIds[BATTLE_PARTNER(gActiveBattler)]].callback == SpriteCallbackDummy)
|
||||
{
|
||||
battlerAnimsDone = TRUE;
|
||||
}
|
||||
@@ -328,8 +328,8 @@ static void Intro_TryShinyAnimShowHealthbox(void)
|
||||
{
|
||||
if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI))
|
||||
{
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler ^ BIT_FLANK]]);
|
||||
SetBattlerShadowSpriteCallback(gActiveBattler ^ BIT_FLANK, GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]], MON_DATA_SPECIES));
|
||||
DestroySprite(&gSprites[gBattleControllerData[BATTLE_PARTNER(gActiveBattler)]]);
|
||||
SetBattlerShadowSpriteCallback(BATTLE_PARTNER(gActiveBattler), GetMonData(&gEnemyParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]], MON_DATA_SPECIES));
|
||||
}
|
||||
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]);
|
||||
@@ -373,13 +373,9 @@ static void CompleteOnHealthbarDone(void)
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler]);
|
||||
|
||||
if (hpValue != -1)
|
||||
{
|
||||
UpdateHpTextInHealthbox(gHealthboxSpriteIds[gActiveBattler], hpValue, HP_CURRENT);
|
||||
}
|
||||
else
|
||||
{
|
||||
RecordedOpponentBufferExecCompleted();
|
||||
}
|
||||
}
|
||||
|
||||
static void HideHealthboxAfterMonFaint(void)
|
||||
@@ -610,7 +606,7 @@ static u32 CopyRecordedOpponentMonData(u8 monId, u8 *dst)
|
||||
moveData.pp[size] = GetMonData(&gEnemyParty[monId], MON_DATA_PP1 + size);
|
||||
}
|
||||
moveData.ppBonuses = GetMonData(&gEnemyParty[monId], MON_DATA_PP_BONUSES);
|
||||
src = (u8*)(&moveData);
|
||||
src = (u8 *)(&moveData);
|
||||
for (size = 0; size < sizeof(moveData); size++)
|
||||
dst[size] = src[size];
|
||||
break;
|
||||
@@ -1393,7 +1389,7 @@ static void RecordedOpponentHandlePrintString(void)
|
||||
|
||||
gBattle_BG0_X = 0;
|
||||
gBattle_BG0_Y = 0;
|
||||
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
|
||||
stringId = (u16 *)(&gBattleBufferA[gActiveBattler][2]);
|
||||
BufferStringBattle(*stringId);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
|
||||
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter;
|
||||
@@ -1698,14 +1694,14 @@ static void RecordedOpponentHandleDrawPartyStatusSummary(void)
|
||||
|
||||
if (gBattleBufferA[gActiveBattler][2] != 0)
|
||||
{
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1E < 2)
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].opponentDrawPartyStatusSummaryDelay < 2)
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1E++;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].opponentDrawPartyStatusSummaryDelay++;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].field_1_x1E = 0;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].opponentDrawPartyStatusSummaryDelay = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -215,27 +215,27 @@ static void Intro_WaitForShinyAnimAndHealthbox(void)
|
||||
else
|
||||
{
|
||||
if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& gSprites[gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy)
|
||||
&& gSprites[gHealthboxSpriteIds[BATTLE_PARTNER(gActiveBattler)]].callback == SpriteCallbackDummy)
|
||||
{
|
||||
healthboxAnimDone = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (healthboxAnimDone && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim
|
||||
&& gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim)
|
||||
&& gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].finishedShinyMonAnim)
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE;
|
||||
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = FALSE;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = FALSE;
|
||||
gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].triedShinyMonAnim = FALSE;
|
||||
gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].finishedShinyMonAnim = FALSE;
|
||||
|
||||
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
|
||||
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
|
||||
|
||||
HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], gActiveBattler);
|
||||
if (IsDoubleBattle())
|
||||
HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]], gActiveBattler ^ BIT_FLANK);
|
||||
HandleLowHpMusicChange(&gPlayerParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]], BATTLE_PARTNER(gActiveBattler));
|
||||
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].introEndDelay = 3;
|
||||
gBattlerControllerFuncs[gActiveBattler] = Intro_DelayAndEnd;
|
||||
@@ -251,7 +251,7 @@ static void Intro_WaitForShinyAnimAndHealthbox(void)
|
||||
else
|
||||
{
|
||||
if (gSprites[gHealthboxSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& gSprites[gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]].callback == SpriteCallbackDummy)
|
||||
&& gSprites[gHealthboxSpriteIds[BATTLE_PARTNER(gActiveBattler)]].callback == SpriteCallbackDummy)
|
||||
{
|
||||
healthboxAnimDone = TRUE;
|
||||
}
|
||||
@@ -278,21 +278,21 @@ static void Intro_TryShinyAnimShowHealthbox(void)
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive)
|
||||
TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]);
|
||||
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive)
|
||||
TryShinyAnimation(gActiveBattler ^ BIT_FLANK, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]]);
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].triedShinyMonAnim
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].ballAnimActive)
|
||||
TryShinyAnimation(BATTLE_PARTNER(gActiveBattler), &gPlayerParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]]);
|
||||
}
|
||||
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive)
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].ballAnimActive)
|
||||
{
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted)
|
||||
{
|
||||
if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI))
|
||||
{
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]], HEALTHBOX_ALL);
|
||||
StartHealthboxSlideIn(gActiveBattler ^ BIT_FLANK);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[BATTLE_PARTNER(gActiveBattler)], &gPlayerParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]], HEALTHBOX_ALL);
|
||||
StartHealthboxSlideIn(BATTLE_PARTNER(gActiveBattler));
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[BATTLE_PARTNER(gActiveBattler)]);
|
||||
}
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], HEALTHBOX_ALL);
|
||||
StartHealthboxSlideIn(gActiveBattler);
|
||||
@@ -303,7 +303,7 @@ static void Intro_TryShinyAnimShowHealthbox(void)
|
||||
|
||||
if (gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].healthboxSlideInStarted
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].waitForCry
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].waitForCry
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].waitForCry
|
||||
&& !IsCryPlayingOrClearCrySongs())
|
||||
{
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].bgmRestored)
|
||||
@@ -327,7 +327,7 @@ static void Intro_TryShinyAnimShowHealthbox(void)
|
||||
&& gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy)
|
||||
{
|
||||
if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI))
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler ^ BIT_FLANK]]);
|
||||
DestroySprite(&gSprites[gBattleControllerData[BATTLE_PARTNER(gActiveBattler)]]);
|
||||
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]);
|
||||
gBattleSpritesDataPtr->animationData->introAnimActive = FALSE;
|
||||
@@ -589,7 +589,7 @@ static u32 CopyRecordedPlayerMonData(u8 monId, u8 *dst)
|
||||
moveData.pp[size] = GetMonData(&gPlayerParty[monId], MON_DATA_PP1 + size);
|
||||
}
|
||||
moveData.ppBonuses = GetMonData(&gPlayerParty[monId], MON_DATA_PP_BONUSES);
|
||||
src = (u8*)(&moveData);
|
||||
src = (u8 *)(&moveData);
|
||||
for (size = 0; size < sizeof(moveData); size++)
|
||||
dst[size] = src[size];
|
||||
break;
|
||||
@@ -1399,7 +1399,7 @@ static void RecordedPlayerHandlePrintString(void)
|
||||
|
||||
gBattle_BG0_X = 0;
|
||||
gBattle_BG0_Y = 0;
|
||||
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
|
||||
stringId = (u16 *)(&gBattleBufferA[gActiveBattler][2]);
|
||||
BufferStringBattle(*stringId);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
|
||||
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter;
|
||||
|
||||
@@ -422,7 +422,7 @@ static void SafariHandlePrintString(void)
|
||||
|
||||
gBattle_BG0_X = 0;
|
||||
gBattle_BG0_Y = 0;
|
||||
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
|
||||
stringId = (u16 *)(&gBattleBufferA[gActiveBattler][2]);
|
||||
BufferStringBattle(*stringId);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
|
||||
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter;
|
||||
|
||||
@@ -289,21 +289,21 @@ static void Intro_TryShinyAnimShowHealthbox(void)
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive)
|
||||
TryShinyAnimation(gActiveBattler, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]]);
|
||||
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive)
|
||||
TryShinyAnimation(gActiveBattler ^ BIT_FLANK, &gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]]);
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].triedShinyMonAnim
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].ballAnimActive)
|
||||
TryShinyAnimation(BATTLE_PARTNER(gActiveBattler), &gPlayerParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]]);
|
||||
|
||||
if (!gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].ballAnimActive
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].ballAnimActive
|
||||
&& !gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].ballAnimActive
|
||||
&& gSprites[gBattleControllerData[gActiveBattler]].callback == SpriteCallbackDummy
|
||||
&& gSprites[gBattlerSpriteIds[gActiveBattler]].callback == SpriteCallbackDummy)
|
||||
{
|
||||
if (IsDoubleBattle() && !(gBattleTypeFlags & BATTLE_TYPE_MULTI))
|
||||
{
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler ^ BIT_FLANK]]);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler ^ BIT_FLANK]], HEALTHBOX_ALL);
|
||||
StartHealthboxSlideIn(gActiveBattler ^ BIT_FLANK);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[gActiveBattler ^ BIT_FLANK]);
|
||||
DestroySprite(&gSprites[gBattleControllerData[BATTLE_PARTNER(gActiveBattler)]]);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[BATTLE_PARTNER(gActiveBattler)], &gPlayerParty[gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)]], HEALTHBOX_ALL);
|
||||
StartHealthboxSlideIn(BATTLE_PARTNER(gActiveBattler));
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[BATTLE_PARTNER(gActiveBattler)]);
|
||||
}
|
||||
DestroySprite(&gSprites[gBattleControllerData[gActiveBattler]]);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[gActiveBattler], &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]], HEALTHBOX_ALL);
|
||||
@@ -324,13 +324,13 @@ static void Intro_WaitForShinyAnimAndHealthbox(void)
|
||||
healthboxAnimDone = TRUE;
|
||||
|
||||
if (healthboxAnimDone && gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim
|
||||
&& gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim)
|
||||
&& gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].finishedShinyMonAnim)
|
||||
{
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].triedShinyMonAnim = FALSE;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler].finishedShinyMonAnim = FALSE;
|
||||
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].triedShinyMonAnim = FALSE;
|
||||
gBattleSpritesDataPtr->healthBoxesData[gActiveBattler ^ BIT_FLANK].finishedShinyMonAnim = FALSE;
|
||||
gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].triedShinyMonAnim = FALSE;
|
||||
gBattleSpritesDataPtr->healthBoxesData[BATTLE_PARTNER(gActiveBattler)].finishedShinyMonAnim = FALSE;
|
||||
|
||||
FreeSpriteTilesByTag(ANIM_TAG_GOLD_STARS);
|
||||
FreeSpritePaletteByTag(ANIM_TAG_GOLD_STARS);
|
||||
@@ -516,7 +516,7 @@ static u32 CopyWallyMonData(u8 monId, u8 *dst)
|
||||
moveData.pp[size] = GetMonData(&gPlayerParty[monId], MON_DATA_PP1 + size);
|
||||
}
|
||||
moveData.ppBonuses = GetMonData(&gPlayerParty[monId], MON_DATA_PP_BONUSES);
|
||||
src = (u8*)(&moveData);
|
||||
src = (u8 *)(&moveData);
|
||||
for (size = 0; size < sizeof(moveData); size++)
|
||||
dst[size] = src[size];
|
||||
break;
|
||||
@@ -1176,7 +1176,7 @@ static void WallyHandlePrintString(void)
|
||||
|
||||
gBattle_BG0_X = 0;
|
||||
gBattle_BG0_Y = 0;
|
||||
stringId = (u16*)(&gBattleBufferA[gActiveBattler][2]);
|
||||
stringId = (u16 *)(&gBattleBufferA[gActiveBattler][2]);
|
||||
BufferStringBattle(*stringId);
|
||||
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_MSG);
|
||||
gBattlerControllerFuncs[gActiveBattler] = CompleteOnInactiveTextPrinter;
|
||||
|
||||
+64
-59
@@ -8,7 +8,6 @@
|
||||
#include "link.h"
|
||||
#include "link_rfu.h"
|
||||
#include "party_menu.h"
|
||||
#include "pokemon.h"
|
||||
#include "recorded_battle.h"
|
||||
#include "task.h"
|
||||
#include "util.h"
|
||||
@@ -99,10 +98,10 @@ void InitBattleControllers(void)
|
||||
}
|
||||
|
||||
for (i = 0; i < sizeof(gBattleStruct->tvMovePoints); i++)
|
||||
*((u8*)(&gBattleStruct->tvMovePoints) + i) = 0;
|
||||
*((u8 *)(&gBattleStruct->tvMovePoints) + i) = 0;
|
||||
|
||||
for (i = 0; i < sizeof(gBattleStruct->tv); i++)
|
||||
*((u8*)(&gBattleStruct->tv) + i) = 0;
|
||||
*((u8 *)(&gBattleStruct->tv) + i) = 0;
|
||||
}
|
||||
|
||||
static void InitSinglePlayerBtlControllers(void)
|
||||
@@ -595,7 +594,7 @@ static void SetBattlePartyIds(void)
|
||||
if (GetMonData(&gPlayerParty[j], MON_DATA_HP) != 0
|
||||
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES2) != SPECIES_NONE
|
||||
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES2) != SPECIES_EGG
|
||||
&& GetMonData(&gPlayerParty[j], MON_DATA_IS_EGG) == 0)
|
||||
&& !GetMonData(&gPlayerParty[j], MON_DATA_IS_EGG))
|
||||
{
|
||||
gBattlerPartyIndexes[i] = j;
|
||||
break;
|
||||
@@ -606,7 +605,7 @@ static void SetBattlePartyIds(void)
|
||||
if (GetMonData(&gEnemyParty[j], MON_DATA_HP) != 0
|
||||
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES2) != SPECIES_NONE
|
||||
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES2) != SPECIES_EGG
|
||||
&& GetMonData(&gEnemyParty[j], MON_DATA_IS_EGG) == 0)
|
||||
&& !GetMonData(&gEnemyParty[j], MON_DATA_IS_EGG))
|
||||
{
|
||||
gBattlerPartyIndexes[i] = j;
|
||||
break;
|
||||
@@ -620,7 +619,7 @@ static void SetBattlePartyIds(void)
|
||||
if (GetMonData(&gPlayerParty[j], MON_DATA_HP) != 0
|
||||
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES) != SPECIES_NONE // Probably a typo by Game Freak. The rest use SPECIES2.
|
||||
&& GetMonData(&gPlayerParty[j], MON_DATA_SPECIES2) != SPECIES_EGG
|
||||
&& GetMonData(&gPlayerParty[j], MON_DATA_IS_EGG) == 0
|
||||
&& !GetMonData(&gPlayerParty[j], MON_DATA_IS_EGG)
|
||||
&& gBattlerPartyIndexes[i - 2] != j)
|
||||
{
|
||||
gBattlerPartyIndexes[i] = j;
|
||||
@@ -632,7 +631,7 @@ static void SetBattlePartyIds(void)
|
||||
if (GetMonData(&gEnemyParty[j], MON_DATA_HP) != 0
|
||||
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES2) != SPECIES_NONE
|
||||
&& GetMonData(&gEnemyParty[j], MON_DATA_SPECIES2) != SPECIES_EGG
|
||||
&& GetMonData(&gEnemyParty[j], MON_DATA_IS_EGG) == 0
|
||||
&& !GetMonData(&gEnemyParty[j], MON_DATA_IS_EGG)
|
||||
&& gBattlerPartyIndexes[i - 2] != j)
|
||||
{
|
||||
gBattlerPartyIndexes[i] = j;
|
||||
@@ -661,18 +660,12 @@ static void PrepareBufferDataTransfer(u8 bufferId, u8 *data, u16 size)
|
||||
switch (bufferId)
|
||||
{
|
||||
case BUFFER_A:
|
||||
for (i = 0; i < size; i++)
|
||||
{
|
||||
for (i = 0; i < size; data++, i++)
|
||||
gBattleBufferA[gActiveBattler][i] = *data;
|
||||
data++;
|
||||
}
|
||||
break;
|
||||
case BUFFER_B:
|
||||
for (i = 0; i < size; i++)
|
||||
{
|
||||
for (i = 0; i < size; data++, i++)
|
||||
gBattleBufferB[gActiveBattler][i] = *data;
|
||||
data++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -809,8 +802,7 @@ static void Task_HandleSendLinkBuffersData(u8 taskId)
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
gTasks[taskId].data[13]--;
|
||||
if (gTasks[taskId].data[13] == 0)
|
||||
if (--gTasks[taskId].data[13] == 0)
|
||||
{
|
||||
gTasks[taskId].data[13] = 1;
|
||||
gTasks[taskId].data[11] = 3;
|
||||
@@ -825,7 +817,7 @@ void TryReceiveLinkBattleData(void)
|
||||
s32 j;
|
||||
u8 *recvBuffer;
|
||||
|
||||
if (gReceivedRemoteLinkPlayers != 0 && (gBattleTypeFlags & BATTLE_TYPE_LINK_IN_BATTLE))
|
||||
if (gReceivedRemoteLinkPlayers && (gBattleTypeFlags & BATTLE_TYPE_LINK_IN_BATTLE))
|
||||
{
|
||||
DestroyTask_RfuIdle();
|
||||
for (i = 0; i < GetLinkPlayerCount(); i++)
|
||||
@@ -913,7 +905,8 @@ void BtlController_EmitGetMonData(u8 bufferId, u8 requestId, u8 monToCheck)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
|
||||
}
|
||||
|
||||
void BtlController_EmitGetRawMonData(u8 bufferId, u8 monId, u8 bytes)
|
||||
// Unused
|
||||
static void BtlController_EmitGetRawMonData(u8 bufferId, u8 monId, u8 bytes)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_GETRAWMONDATA;
|
||||
sBattleBuffersTransferData[1] = monId;
|
||||
@@ -930,11 +923,12 @@ void BtlController_EmitSetMonData(u8 bufferId, u8 requestId, u8 monToCheck, u8 b
|
||||
sBattleBuffersTransferData[1] = requestId;
|
||||
sBattleBuffersTransferData[2] = monToCheck;
|
||||
for (i = 0; i < bytes; i++)
|
||||
sBattleBuffersTransferData[3 + i] = *(u8*)(data++);
|
||||
sBattleBuffersTransferData[3 + i] = *(u8 *)(data++);
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 3 + bytes);
|
||||
}
|
||||
|
||||
void BtlController_EmitSetRawMonData(u8 bufferId, u8 monId, u8 bytes, void *data)
|
||||
// Unused
|
||||
static void BtlController_EmitSetRawMonData(u8 bufferId, u8 monId, u8 bytes, void *data)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
@@ -942,7 +936,7 @@ void BtlController_EmitSetRawMonData(u8 bufferId, u8 monId, u8 bytes, void *data
|
||||
sBattleBuffersTransferData[1] = monId;
|
||||
sBattleBuffersTransferData[2] = bytes;
|
||||
for (i = 0; i < bytes; i++)
|
||||
sBattleBuffersTransferData[3 + i] = *(u8*)(data++);
|
||||
sBattleBuffersTransferData[3 + i] = *(u8 *)(data++);
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, bytes + 3);
|
||||
}
|
||||
|
||||
@@ -1007,7 +1001,8 @@ void BtlController_EmitFaintAnimation(u8 bufferId)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
|
||||
}
|
||||
|
||||
void BtlController_EmitPaletteFade(u8 bufferId)
|
||||
// Unused
|
||||
static void BtlController_EmitPaletteFade(u8 bufferId)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_PALETTEFADE;
|
||||
sBattleBuffersTransferData[1] = CONTROLLER_PALETTEFADE;
|
||||
@@ -1016,7 +1011,8 @@ void BtlController_EmitPaletteFade(u8 bufferId)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
|
||||
}
|
||||
|
||||
void BtlController_EmitSuccessBallThrowAnim(u8 bufferId)
|
||||
// Unused
|
||||
static void BtlController_EmitSuccessBallThrowAnim(u8 bufferId)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_SUCCESSBALLTHROWANIM;
|
||||
sBattleBuffersTransferData[1] = CONTROLLER_SUCCESSBALLTHROWANIM;
|
||||
@@ -1032,14 +1028,15 @@ void BtlController_EmitBallThrowAnim(u8 bufferId, u8 caseId)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 2);
|
||||
}
|
||||
|
||||
void BtlController_EmitPause(u8 bufferId, u8 toWait, void *data)
|
||||
// Unused
|
||||
static void BtlController_EmitPause(u8 bufferId, u8 toWait, void *data)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_PAUSE;
|
||||
sBattleBuffersTransferData[1] = toWait;
|
||||
for (i = 0; i < toWait * 3; i++)
|
||||
sBattleBuffersTransferData[2 + i] = *(u8*)(data++);
|
||||
sBattleBuffersTransferData[2 + i] = *(u8 *)(data++);
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, toWait * 3 + 2);
|
||||
}
|
||||
|
||||
@@ -1076,20 +1073,20 @@ void BtlController_EmitMoveAnimation(u8 bufferId, u16 move, u8 turnOfMove, u16 m
|
||||
void BtlController_EmitPrintString(u8 bufferId, u16 stringID)
|
||||
{
|
||||
s32 i;
|
||||
struct BattleMsgData* stringInfo;
|
||||
struct BattleMsgData *stringInfo;
|
||||
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_PRINTSTRING;
|
||||
sBattleBuffersTransferData[1] = gBattleOutcome;
|
||||
sBattleBuffersTransferData[2] = stringID;
|
||||
sBattleBuffersTransferData[3] = (stringID & 0xFF00) >> 8;
|
||||
|
||||
stringInfo = (struct BattleMsgData*)(&sBattleBuffersTransferData[4]);
|
||||
stringInfo = (struct BattleMsgData *)(&sBattleBuffersTransferData[4]);
|
||||
stringInfo->currentMove = gCurrentMove;
|
||||
stringInfo->originallyUsedMove = gChosenMove;
|
||||
stringInfo->lastItem = gLastUsedItem;
|
||||
stringInfo->lastAbility = gLastUsedAbility;
|
||||
stringInfo->scrActive = gBattleScripting.battler;
|
||||
stringInfo->unk1605E = gBattleStruct->field_52;
|
||||
stringInfo->bakScriptPartyIdx = gBattleStruct->scriptPartyIdx;
|
||||
stringInfo->hpScale = gBattleStruct->hpScale;
|
||||
stringInfo->itemEffectBattler = gPotentialItemEffectBattler;
|
||||
stringInfo->moveType = gBattleMoves[gCurrentMove].type;
|
||||
@@ -1115,13 +1112,13 @@ void BtlController_EmitPrintSelectionString(u8 bufferId, u16 stringID)
|
||||
sBattleBuffersTransferData[2] = stringID;
|
||||
sBattleBuffersTransferData[3] = (stringID & 0xFF00) >> 8;
|
||||
|
||||
stringInfo = (struct BattleMsgData*)(&sBattleBuffersTransferData[4]);
|
||||
stringInfo = (struct BattleMsgData *)(&sBattleBuffersTransferData[4]);
|
||||
stringInfo->currentMove = gCurrentMove;
|
||||
stringInfo->originallyUsedMove = gChosenMove;
|
||||
stringInfo->lastItem = gLastUsedItem;
|
||||
stringInfo->lastAbility = gLastUsedAbility;
|
||||
stringInfo->scrActive = gBattleScripting.battler;
|
||||
stringInfo->unk1605E = gBattleStruct->field_52;
|
||||
stringInfo->bakScriptPartyIdx = gBattleStruct->scriptPartyIdx;
|
||||
|
||||
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
|
||||
stringInfo->abilities[i] = gBattleMons[i].ability;
|
||||
@@ -1164,17 +1161,17 @@ void BtlController_EmitChooseMove(u8 bufferId, bool8 isDoubleBattle, bool8 NoPpN
|
||||
sBattleBuffersTransferData[2] = NoPpNumber;
|
||||
sBattleBuffersTransferData[3] = 0;
|
||||
for (i = 0; i < sizeof(*movePpData); i++)
|
||||
sBattleBuffersTransferData[4 + i] = *((u8*)(movePpData) + i);
|
||||
sBattleBuffersTransferData[4 + i] = *((u8 *)(movePpData) + i);
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, sizeof(*movePpData) + 4);
|
||||
}
|
||||
|
||||
void BtlController_EmitChooseItem(u8 bufferId, u8 *arg1)
|
||||
void BtlController_EmitChooseItem(u8 bufferId, u8 *battlePartyOrder)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_OPENBAG;
|
||||
for (i = 0; i < 3; i++)
|
||||
sBattleBuffersTransferData[1 + i] = arg1[i];
|
||||
for (i = 0; i < PARTY_SIZE / 2; i++)
|
||||
sBattleBuffersTransferData[1 + i] = battlePartyOrder[i];
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
|
||||
}
|
||||
|
||||
@@ -1191,7 +1188,8 @@ void BtlController_EmitChoosePokemon(u8 bufferId, u8 caseId, u8 slotId, u8 abili
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 8); // Only 7 bytes were written.
|
||||
}
|
||||
|
||||
void BtlController_EmitCmd23(u8 bufferId)
|
||||
// Unused
|
||||
static void BtlController_EmitCmd23(u8 bufferId)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_23;
|
||||
sBattleBuffersTransferData[1] = CONTROLLER_23;
|
||||
@@ -1245,7 +1243,8 @@ void BtlController_EmitStatusAnimation(u8 bufferId, bool8 status2, u32 status)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 6);
|
||||
}
|
||||
|
||||
void BtlController_EmitStatusXor(u8 bufferId, u8 b)
|
||||
// Unused
|
||||
static void BtlController_EmitStatusXor(u8 bufferId, u8 b)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_STATUSXOR;
|
||||
sBattleBuffersTransferData[1] = b;
|
||||
@@ -1261,11 +1260,12 @@ void BtlController_EmitDataTransfer(u8 bufferId, u16 size, void *data)
|
||||
sBattleBuffersTransferData[2] = size;
|
||||
sBattleBuffersTransferData[3] = (size & 0xFF00) >> 8;
|
||||
for (i = 0; i < size; i++)
|
||||
sBattleBuffersTransferData[4 + i] = *(u8*)(data++);
|
||||
sBattleBuffersTransferData[4 + i] = *(u8 *)(data++);
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, size + 4);
|
||||
}
|
||||
|
||||
void BtlController_EmitDMA3Transfer(u8 bufferId, void *dst, u16 size, void *data)
|
||||
// Unused
|
||||
static void BtlController_EmitDMA3Transfer(u8 bufferId, void *dst, u16 size, void *data)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
@@ -1277,12 +1277,12 @@ void BtlController_EmitDMA3Transfer(u8 bufferId, void *dst, u16 size, void *data
|
||||
sBattleBuffersTransferData[5] = size;
|
||||
sBattleBuffersTransferData[6] = (size & 0xFF00) >> 8;
|
||||
for (i = 0; i < size; i++)
|
||||
sBattleBuffersTransferData[7 + i] = *(u8*)(data++);
|
||||
sBattleBuffersTransferData[7 + i] = *(u8 *)(data++);
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, size + 7);
|
||||
}
|
||||
|
||||
// Unused
|
||||
void BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *data)
|
||||
static void BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *data)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
@@ -1293,11 +1293,12 @@ void BtlController_EmitPlayBGM(u8 bufferId, u16 songId, void *data)
|
||||
// Nonsense loop using songId as a size
|
||||
// Would go out of bounds for any song id after SE_RG_BAG_POCKET (253)
|
||||
for (i = 0; i < songId; i++)
|
||||
sBattleBuffersTransferData[3 + i] = *(u8*)(data++);
|
||||
sBattleBuffersTransferData[3 + i] = *(u8 *)(data++);
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, songId + 3);
|
||||
}
|
||||
|
||||
void BtlController_EmitCmd32(u8 bufferId, u16 size, void *data)
|
||||
// Unused
|
||||
static void BtlController_EmitCmd32(u8 bufferId, u16 size, void *data)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
@@ -1305,16 +1306,16 @@ void BtlController_EmitCmd32(u8 bufferId, u16 size, void *data)
|
||||
sBattleBuffersTransferData[1] = size;
|
||||
sBattleBuffersTransferData[2] = (size & 0xFF00) >> 8;
|
||||
for (i = 0; i < size; i++)
|
||||
sBattleBuffersTransferData[3 + i] = *(u8*)(data++);
|
||||
sBattleBuffersTransferData[3 + i] = *(u8 *)(data++);
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, size + 3);
|
||||
}
|
||||
|
||||
void BtlController_EmitTwoReturnValues(u8 bufferId, u8 arg1, u16 arg2)
|
||||
void BtlController_EmitTwoReturnValues(u8 bufferId, u8 ret8, u16 ret16)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_TWORETURNVALUES;
|
||||
sBattleBuffersTransferData[1] = arg1;
|
||||
sBattleBuffersTransferData[2] = arg2;
|
||||
sBattleBuffersTransferData[3] = (arg2 & 0xFF00) >> 8;
|
||||
sBattleBuffersTransferData[1] = ret8;
|
||||
sBattleBuffersTransferData[2] = ret16;
|
||||
sBattleBuffersTransferData[3] = (ret16 & 0xFF00) >> 8;
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
|
||||
}
|
||||
|
||||
@@ -1329,25 +1330,26 @@ void BtlController_EmitChosenMonReturnValue(u8 bufferId, u8 partyId, u8 *battleP
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 5);
|
||||
}
|
||||
|
||||
void BtlController_EmitOneReturnValue(u8 bufferId, u16 arg1)
|
||||
void BtlController_EmitOneReturnValue(u8 bufferId, u16 ret)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_ONERETURNVALUE;
|
||||
sBattleBuffersTransferData[1] = arg1;
|
||||
sBattleBuffersTransferData[2] = (arg1 & 0xFF00) >> 8;
|
||||
sBattleBuffersTransferData[1] = ret;
|
||||
sBattleBuffersTransferData[2] = (ret & 0xFF00) >> 8;
|
||||
sBattleBuffersTransferData[3] = 0;
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
|
||||
}
|
||||
|
||||
void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 b)
|
||||
void BtlController_EmitOneReturnValue_Duplicate(u8 bufferId, u16 ret)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_ONERETURNVALUE_DUPLICATE;
|
||||
sBattleBuffersTransferData[1] = b;
|
||||
sBattleBuffersTransferData[2] = (b & 0xFF00) >> 8;
|
||||
sBattleBuffersTransferData[1] = ret;
|
||||
sBattleBuffersTransferData[2] = (ret & 0xFF00) >> 8;
|
||||
sBattleBuffersTransferData[3] = 0;
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
|
||||
}
|
||||
|
||||
void BtlController_EmitClearUnkVar(u8 bufferId)
|
||||
// Unused
|
||||
static void BtlController_EmitClearUnkVar(u8 bufferId)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_CLEARUNKVAR;
|
||||
sBattleBuffersTransferData[1] = CONTROLLER_CLEARUNKVAR;
|
||||
@@ -1356,14 +1358,16 @@ void BtlController_EmitClearUnkVar(u8 bufferId)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
|
||||
}
|
||||
|
||||
void BtlController_EmitSetUnkVar(u8 bufferId, u8 b)
|
||||
// Unused
|
||||
static void BtlController_EmitSetUnkVar(u8 bufferId, u8 b)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_SETUNKVAR;
|
||||
sBattleBuffersTransferData[1] = b;
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 2);
|
||||
}
|
||||
|
||||
void BtlController_EmitClearUnkFlag(u8 bufferId)
|
||||
// Unused
|
||||
static void BtlController_EmitClearUnkFlag(u8 bufferId)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_CLEARUNKFLAG;
|
||||
sBattleBuffersTransferData[1] = CONTROLLER_CLEARUNKFLAG;
|
||||
@@ -1372,7 +1376,8 @@ void BtlController_EmitClearUnkFlag(u8 bufferId)
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4);
|
||||
}
|
||||
|
||||
void BtlController_EmitToggleUnkFlag(u8 bufferId)
|
||||
// Unused
|
||||
static void BtlController_EmitToggleUnkFlag(u8 bufferId)
|
||||
{
|
||||
sBattleBuffersTransferData[0] = CONTROLLER_TOGGLEUNKFLAG;
|
||||
sBattleBuffersTransferData[1] = CONTROLLER_TOGGLEUNKFLAG;
|
||||
@@ -1451,7 +1456,7 @@ void BtlController_EmitDrawPartyStatusSummary(u8 bufferId, struct HpAndStatus* h
|
||||
sBattleBuffersTransferData[2] = (flags & PARTY_SUMM_SKIP_DRAW_DELAY) >> 7; // If true, skip delay after drawing. True during intro
|
||||
sBattleBuffersTransferData[3] = CONTROLLER_DRAWPARTYSTATUSSUMMARY;
|
||||
for (i = 0; i < (s32)(sizeof(struct HpAndStatus) * PARTY_SIZE); i++)
|
||||
sBattleBuffersTransferData[4 + i] = *(i + (u8*)(hpAndStatus));
|
||||
sBattleBuffersTransferData[4 + i] = *(i + (u8 *)(hpAndStatus));
|
||||
PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, sizeof(struct HpAndStatus) * PARTY_SIZE + 4);
|
||||
}
|
||||
|
||||
|
||||
+137
-121
@@ -73,40 +73,43 @@ struct TourneyTreeLineSection
|
||||
#define tMode data[2]
|
||||
#define tPrevTaskId data[3]
|
||||
|
||||
// This file's functions.
|
||||
static u8 GetDomeTrainerMonIvs(u16 trainerId);
|
||||
static void SwapDomeTrainers(int id1, int id2, u16 *statsArray);
|
||||
static void CalcDomeMonStats(u16 species, int level, int ivs, u8 evBits, u8 nature, int *stats);
|
||||
static void CreateDomeOpponentMons(u16 tournamentTrainerId);
|
||||
static int SelectOpponentMonsUsingPersonality(u16 tournamentTrainerId, bool8 arg1);
|
||||
static int SelectOpponentMonsUsingOtId(u16 tournamentTrainerId, bool8 arg1);
|
||||
static int GetTypeEffectivenessPoints(int move, int species, int arg2);
|
||||
static int SelectOpponentMonsFromParty(int *arr, bool8 arg1);
|
||||
static void Task_ShowTourneyInfoCard(u8 taskId);
|
||||
static void Task_HandleInfoCardInput(u8 taskId);
|
||||
static u8 Task_GetInfoCardInput(u8 taskId);
|
||||
#define EFFECTIVENESS_MODE_GOOD 0
|
||||
#define EFFECTIVENESS_MODE_BAD 1
|
||||
#define EFFECTIVENESS_MODE_AI_VS_AI 2
|
||||
|
||||
static u8 GetDomeTrainerMonIvs(u16);
|
||||
static void SwapDomeTrainers(int, int, u16 *);
|
||||
static void CalcDomeMonStats(u16, int, int, u8, u8, int *);
|
||||
static void CreateDomeOpponentMons(u16);
|
||||
static int SelectOpponentMons_Good(u16, bool8);
|
||||
static int SelectOpponentMons_Bad(u16, bool8);
|
||||
static int GetTypeEffectivenessPoints(int, int, int);
|
||||
static int SelectOpponentMonsFromParty(int *, bool8);
|
||||
static void Task_ShowTourneyInfoCard(u8);
|
||||
static void Task_HandleInfoCardInput(u8);
|
||||
static u8 Task_GetInfoCardInput(u8);
|
||||
static void SetFacilityTrainerAndMonPtrs(void);
|
||||
static int TrainerIdToTournamentId(u16 trainerId);
|
||||
static int TrainerIdToTournamentId(u16);
|
||||
static u16 TrainerIdOfPlayerOpponent(void);
|
||||
static void Task_ShowTourneyTree(u8 taskId);
|
||||
static void Task_HandleStaticTourneyTreeInput(u8 taskId);
|
||||
static void Task_ShowTourneyTree(u8);
|
||||
static void Task_HandleStaticTourneyTreeInput(u8);
|
||||
static void CB2_TourneyTree(void);
|
||||
static void VblankCb_TourneyInfoCard(void);
|
||||
static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo);
|
||||
static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId);
|
||||
static int BufferDomeWinString(u8, u8*);
|
||||
static void DisplayMatchInfoOnCard(u8, u8);
|
||||
static void DisplayTrainerInfoOnCard(u8, u8);
|
||||
static int BufferDomeWinString(u8, u8 *);
|
||||
static u8 GetDomeBrainTrainerPicId(void);
|
||||
static u8 GetDomeBrainTrainerClass(void);
|
||||
static void CopyDomeBrainTrainerName(u8 *str);
|
||||
static void CopyDomeTrainerName(u8 *str, u16 trainerId);
|
||||
static void CopyDomeBrainTrainerName(u8 *);
|
||||
static void CopyDomeTrainerName(u8 *, u16);
|
||||
static void HblankCb_TourneyTree(void);
|
||||
static void VblankCb_TourneyTree(void);
|
||||
static u8 UpdateTourneyTreeCursor(u8 taskId);
|
||||
static void DecideRoundWinners(u8 roundId);
|
||||
static u8 GetOpposingNPCTournamentIdByRound(u8 tournamentId, u8);
|
||||
static u8 UpdateTourneyTreeCursor(u8);
|
||||
static void DecideRoundWinners(u8);
|
||||
static u8 GetOpposingNPCTournamentIdByRound(u8, u8);
|
||||
static void DrawTourneyAdvancementLine(u8, u8);
|
||||
static void SpriteCb_HorizontalScrollArrow(struct Sprite *sprite);
|
||||
static void SpriteCb_VerticalScrollArrow(struct Sprite *sprite);
|
||||
static void SpriteCB_HorizontalScrollArrow(struct Sprite *);
|
||||
static void SpriteCB_VerticalScrollArrow(struct Sprite *);
|
||||
static void InitDomeChallenge(void);
|
||||
static void GetDomeData(void);
|
||||
static void SetDomeData(void);
|
||||
@@ -130,7 +133,6 @@ static void BufferLastDomeWinnerName(void);
|
||||
static void InitRandomTourneyTreeResults(void);
|
||||
static void InitDomeTrainers(void);
|
||||
|
||||
// EWRAM variables.
|
||||
EWRAM_DATA u32 gPlayerPartyLostHP = 0; // never read
|
||||
static EWRAM_DATA u32 sPlayerPartyMaxHP = 0; // never read
|
||||
static EWRAM_DATA struct TourneyTreeInfoCard *sInfoCard = {0};
|
||||
@@ -892,7 +894,7 @@ static const struct OamData sOamData_TourneyTreePokeball =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(16x16),
|
||||
.x = 0,
|
||||
@@ -910,7 +912,7 @@ static const struct OamData sOamData_TourneyTreeCloseButton =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(32x16),
|
||||
.x = 0,
|
||||
@@ -927,7 +929,7 @@ static const struct OamData sOamData_VerticalScrollArrow =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(16x8),
|
||||
.x = 0,
|
||||
@@ -944,7 +946,7 @@ static const struct OamData sOamData_HorizontalScrollArrow =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(8x16),
|
||||
.x = 0,
|
||||
@@ -1087,7 +1089,7 @@ static const struct SpriteTemplate sHorizontalScrollArrowSpriteTemplate =
|
||||
.anims = sSpriteAnimTable_HorizontalScrollArrow,
|
||||
.images = NULL,
|
||||
.affineAnims = gDummySpriteAffineAnimTable,
|
||||
.callback = SpriteCb_HorizontalScrollArrow
|
||||
.callback = SpriteCB_HorizontalScrollArrow
|
||||
};
|
||||
|
||||
static const struct SpriteTemplate sVerticalScrollArrowSpriteTemplate =
|
||||
@@ -1098,7 +1100,7 @@ static const struct SpriteTemplate sVerticalScrollArrowSpriteTemplate =
|
||||
.anims = sSpriteAnimTable_VerticalScrollArrow,
|
||||
.images = NULL,
|
||||
.affineAnims = gDummySpriteAffineAnimTable,
|
||||
.callback = SpriteCb_VerticalScrollArrow
|
||||
.callback = SpriteCB_VerticalScrollArrow
|
||||
};
|
||||
|
||||
// Organized by seed starting position, i.e. seed 0 battles seed 8 first
|
||||
@@ -2080,7 +2082,6 @@ static const u8 sTourneyTreeLineSectionArrayCounts[DOME_TOURNAMENT_TRAINERS_COUN
|
||||
{ARRAY_COUNT(sLineSectionTrainer16Round1), ARRAY_COUNT(sLineSectionTrainer16Round2), ARRAY_COUNT(sLineSectionTrainer16Semifinal), ARRAY_COUNT(sLineSectionTrainer16Final)},
|
||||
};
|
||||
|
||||
// code
|
||||
void CallBattleDomeFunction(void)
|
||||
{
|
||||
sBattleDomeFunctions[gSpecialVar_0x8004]();
|
||||
@@ -2592,28 +2593,33 @@ static void CreateDomeOpponentMons(u16 tournamentTrainerId)
|
||||
}
|
||||
}
|
||||
|
||||
// Returns a bitmask representing which 2 of the trainer's 3 pokemon to select.
|
||||
// The choice is calculated solely depending on the type effectiveness of their
|
||||
// movesets against the player's pokemon.
|
||||
// There is a 50% chance of either a "good" or "bad" selection mode being used.
|
||||
// In the good mode movesets are preferred which are more effective against the
|
||||
// player, and in the bad mode the opposite is true. If all 3 pokemon tie, the
|
||||
// other mode will be tried. If they tie again, the pokemon selection is random.
|
||||
int GetDomeTrainerSelectedMons(u16 tournamentTrainerId)
|
||||
{
|
||||
int selectedMonBits;
|
||||
if (Random() & 1)
|
||||
{
|
||||
selectedMonBits = SelectOpponentMonsUsingPersonality(tournamentTrainerId, FALSE);
|
||||
selectedMonBits = SelectOpponentMons_Good(tournamentTrainerId, FALSE);
|
||||
if (selectedMonBits == 0)
|
||||
selectedMonBits = SelectOpponentMonsUsingOtId(tournamentTrainerId, TRUE);
|
||||
selectedMonBits = SelectOpponentMons_Bad(tournamentTrainerId, TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
selectedMonBits = SelectOpponentMonsUsingOtId(tournamentTrainerId, FALSE);
|
||||
selectedMonBits = SelectOpponentMons_Bad(tournamentTrainerId, FALSE);
|
||||
if (selectedMonBits == 0)
|
||||
selectedMonBits = SelectOpponentMonsUsingPersonality(tournamentTrainerId, TRUE);
|
||||
selectedMonBits = SelectOpponentMons_Good(tournamentTrainerId, TRUE);
|
||||
}
|
||||
|
||||
return selectedMonBits;
|
||||
}
|
||||
|
||||
// Could probably use a better name once GetTypeEffectivenessPoints is clarified
|
||||
// Personality seems to be used to select a different weighting system for type effectiveness points
|
||||
static int SelectOpponentMonsUsingPersonality(u16 tournamentTrainerId, bool8 allowRandom)
|
||||
static int SelectOpponentMons_Good(u16 tournamentTrainerId, bool8 allowRandom)
|
||||
{
|
||||
int i, moveId, playerMonId;
|
||||
int partyMovePoints[FRONTIER_PARTY_SIZE];
|
||||
@@ -2628,12 +2634,12 @@ static int SelectOpponentMonsUsingPersonality(u16 tournamentTrainerId, bool8 all
|
||||
if (DOME_TRAINERS[tournamentTrainerId].trainerId == TRAINER_FRONTIER_BRAIN)
|
||||
{
|
||||
partyMovePoints[i] += GetTypeEffectivenessPoints(GetFrontierBrainMonMove(i, moveId),
|
||||
GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), MON_DATA_PERSONALITY);
|
||||
GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), EFFECTIVENESS_MODE_GOOD);
|
||||
}
|
||||
else
|
||||
{
|
||||
partyMovePoints[i] += GetTypeEffectivenessPoints(gFacilityTrainerMons[DOME_MONS[tournamentTrainerId][i]].moves[moveId],
|
||||
GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), MON_DATA_PERSONALITY);
|
||||
GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), EFFECTIVENESS_MODE_GOOD);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2641,8 +2647,8 @@ static int SelectOpponentMonsUsingPersonality(u16 tournamentTrainerId, bool8 all
|
||||
return SelectOpponentMonsFromParty(partyMovePoints, allowRandom);
|
||||
}
|
||||
|
||||
// See above function, identical but uses MON_DATA_OT_ID
|
||||
static int SelectOpponentMonsUsingOtId(u16 tournamentTrainerId, bool8 allowRandom)
|
||||
// Identical to function above, but uses EFFECTIVENESS_MODE_BAD
|
||||
static int SelectOpponentMons_Bad(u16 tournamentTrainerId, bool8 allowRandom)
|
||||
{
|
||||
int i, moveId, playerMonId;
|
||||
int partyMovePoints[FRONTIER_PARTY_SIZE];
|
||||
@@ -2657,12 +2663,12 @@ static int SelectOpponentMonsUsingOtId(u16 tournamentTrainerId, bool8 allowRando
|
||||
if (DOME_TRAINERS[tournamentTrainerId].trainerId == TRAINER_FRONTIER_BRAIN)
|
||||
{
|
||||
partyMovePoints[i] += GetTypeEffectivenessPoints(GetFrontierBrainMonMove(i, moveId),
|
||||
GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), MON_DATA_OT_ID);
|
||||
GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), EFFECTIVENESS_MODE_BAD);
|
||||
}
|
||||
else
|
||||
{
|
||||
partyMovePoints[i] += GetTypeEffectivenessPoints(gFacilityTrainerMons[DOME_MONS[tournamentTrainerId][i]].moves[moveId],
|
||||
GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), MON_DATA_OT_ID);
|
||||
GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), EFFECTIVENESS_MODE_BAD);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2735,13 +2741,13 @@ static int SelectOpponentMonsFromParty(int *partyMovePoints, bool8 allowRandom)
|
||||
#define TYPE_x2 40
|
||||
#define TYPE_x4 80
|
||||
|
||||
static int GetTypeEffectivenessPoints(int move, int targetSpecies, int arg2)
|
||||
static int GetTypeEffectivenessPoints(int move, int targetSpecies, int mode)
|
||||
{
|
||||
int defType1, defType2, defAbility, moveType;
|
||||
int i = 0;
|
||||
int typePower = TYPE_x1;
|
||||
|
||||
if (move == MOVE_NONE || move == 0xFFFF || gBattleMoves[move].power == 0)
|
||||
if (move == MOVE_NONE || move == MOVE_UNAVAILABLE || gBattleMoves[move].power == 0)
|
||||
return 0;
|
||||
|
||||
defType1 = gBaseStats[targetSpecies].type1;
|
||||
@@ -2751,11 +2757,20 @@ static int GetTypeEffectivenessPoints(int move, int targetSpecies, int arg2)
|
||||
|
||||
if (defAbility == ABILITY_LEVITATE && moveType == TYPE_GROUND)
|
||||
{
|
||||
if (arg2 == 1)
|
||||
// They likely meant to return here, as 8 is the number of points normally used in this mode for moves with no effect.
|
||||
// Because there's no return the value instead gets interpreted by the switch, and the number of points becomes 0.
|
||||
if (mode == EFFECTIVENESS_MODE_BAD)
|
||||
{
|
||||
typePower = 8;
|
||||
#ifdef BUGFIX
|
||||
return typePower;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Calculate a "type power" value to determine the benefit of using this type move against the target.
|
||||
// This value will then be used to get the number of points to assign to the move.
|
||||
while (TYPE_EFFECT_ATK_TYPE(i) != TYPE_ENDTABLE)
|
||||
{
|
||||
if (TYPE_EFFECT_ATK_TYPE(i) == TYPE_FORESIGHT)
|
||||
@@ -2767,33 +2782,30 @@ static int GetTypeEffectivenessPoints(int move, int targetSpecies, int arg2)
|
||||
{
|
||||
// BUG: the value of TYPE_x2 does not exist in gTypeEffectiveness, so if defAbility is ABILITY_WONDER_GUARD, the conditional always fails
|
||||
#ifndef BUGFIX
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == defType1)
|
||||
if ((defAbility == ABILITY_WONDER_GUARD && TYPE_EFFECT_MULTIPLIER(i) == TYPE_x2) || defAbility != ABILITY_WONDER_GUARD)
|
||||
typePower = (typePower * TYPE_EFFECT_MULTIPLIER(i)) / 10;
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == defType2 && defType1 != defType2)
|
||||
if ((defAbility == ABILITY_WONDER_GUARD && TYPE_EFFECT_MULTIPLIER(i) == TYPE_x2) || defAbility != ABILITY_WONDER_GUARD)
|
||||
typePower = (typePower * TYPE_EFFECT_MULTIPLIER(i)) / 10;
|
||||
#define WONDER_GUARD_EFFECTIVENESS TYPE_x2
|
||||
#else
|
||||
#define WONDER_GUARD_EFFECTIVENESS TYPE_MUL_SUPER_EFFECTIVE
|
||||
#endif
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == defType1)
|
||||
if ((defAbility == ABILITY_WONDER_GUARD && TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_SUPER_EFFECTIVE) || defAbility != ABILITY_WONDER_GUARD)
|
||||
if ((defAbility == ABILITY_WONDER_GUARD && TYPE_EFFECT_MULTIPLIER(i) == WONDER_GUARD_EFFECTIVENESS) || defAbility != ABILITY_WONDER_GUARD)
|
||||
typePower = (typePower * TYPE_EFFECT_MULTIPLIER(i)) / 10;
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == defType2 && defType1 != defType2)
|
||||
if ((defAbility == ABILITY_WONDER_GUARD && TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_SUPER_EFFECTIVE) || defAbility != ABILITY_WONDER_GUARD)
|
||||
if ((defAbility == ABILITY_WONDER_GUARD && TYPE_EFFECT_MULTIPLIER(i) == WONDER_GUARD_EFFECTIVENESS) || defAbility != ABILITY_WONDER_GUARD)
|
||||
typePower = (typePower * TYPE_EFFECT_MULTIPLIER(i)) / 10;
|
||||
#endif
|
||||
}
|
||||
i += 3;
|
||||
}
|
||||
}
|
||||
|
||||
switch (arg2)
|
||||
switch (mode)
|
||||
{
|
||||
case 0:
|
||||
case EFFECTIVENESS_MODE_GOOD:
|
||||
// Weights moves that more effective.
|
||||
switch (typePower)
|
||||
{
|
||||
case TYPE_x0_50:
|
||||
case TYPE_x0_25:
|
||||
case TYPE_x0:
|
||||
case TYPE_x0_25:
|
||||
case TYPE_x0_50:
|
||||
default:
|
||||
typePower = 0;
|
||||
break;
|
||||
@@ -2808,22 +2820,24 @@ static int GetTypeEffectivenessPoints(int move, int targetSpecies, int arg2)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
case EFFECTIVENESS_MODE_BAD:
|
||||
// Weights moves that are less effective.
|
||||
// Odd that there's no limit on this being used, even the Frontier Brain could end up using this.
|
||||
switch (typePower)
|
||||
{
|
||||
default:
|
||||
case TYPE_x1:
|
||||
typePower = 0;
|
||||
case TYPE_x0:
|
||||
typePower = 8;
|
||||
break;
|
||||
case TYPE_x0_25:
|
||||
typePower = 4;
|
||||
break;
|
||||
case TYPE_x0:
|
||||
typePower = 8;
|
||||
break;
|
||||
case TYPE_x0_50:
|
||||
typePower = 2;
|
||||
break;
|
||||
default:
|
||||
case TYPE_x1:
|
||||
typePower = 0;
|
||||
break;
|
||||
case TYPE_x2:
|
||||
typePower = -2;
|
||||
break;
|
||||
@@ -2832,7 +2846,9 @@ static int GetTypeEffectivenessPoints(int move, int targetSpecies, int arg2)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
case EFFECTIVENESS_MODE_AI_VS_AI:
|
||||
// Used as part of calculating the winner in a battle between two AIs.
|
||||
// Weights moves that are more effective much more strongly in both directions.
|
||||
switch (typePower)
|
||||
{
|
||||
case TYPE_x0:
|
||||
@@ -3099,7 +3115,7 @@ static void Task_ShowTourneyInfoCard(u8 taskId)
|
||||
// Note: Card scrolling up means the current card goes down and another one appears from top.
|
||||
// The same is true for scrolling left.
|
||||
// That means that the sprite needs to move with the moving card in the opposite scrolling direction.
|
||||
static void SpriteCb_TrainerIconCardScrollUp(struct Sprite *sprite)
|
||||
static void SpriteCB_TrainerIconCardScrollUp(struct Sprite *sprite)
|
||||
{
|
||||
sprite->y += 4;
|
||||
if (sprite->data[0] != 0)
|
||||
@@ -3119,7 +3135,7 @@ static void SpriteCb_TrainerIconCardScrollUp(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
static void SpriteCb_TrainerIconCardScrollDown(struct Sprite *sprite)
|
||||
static void SpriteCB_TrainerIconCardScrollDown(struct Sprite *sprite)
|
||||
{
|
||||
sprite->y -= 4;
|
||||
if (sprite->data[0] != 0)
|
||||
@@ -3139,7 +3155,7 @@ static void SpriteCb_TrainerIconCardScrollDown(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
static void SpriteCb_TrainerIconCardScrollLeft(struct Sprite *sprite)
|
||||
static void SpriteCB_TrainerIconCardScrollLeft(struct Sprite *sprite)
|
||||
{
|
||||
sprite->x += 4;
|
||||
if (sprite->data[0] != 0)
|
||||
@@ -3159,7 +3175,7 @@ static void SpriteCb_TrainerIconCardScrollLeft(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
static void SpriteCb_TrainerIconCardScrollRight(struct Sprite *sprite)
|
||||
static void SpriteCB_TrainerIconCardScrollRight(struct Sprite *sprite)
|
||||
{
|
||||
sprite->x -= 4;
|
||||
if (sprite->data[0] != 0)
|
||||
@@ -3181,13 +3197,13 @@ static void SpriteCb_TrainerIconCardScrollRight(struct Sprite *sprite)
|
||||
|
||||
#define sMonIconStill data[3]
|
||||
|
||||
static void SpriteCb_MonIcon(struct Sprite *sprite)
|
||||
static void SpriteCB_MonIconDomeInfo(struct Sprite *sprite)
|
||||
{
|
||||
if (!sprite->sMonIconStill)
|
||||
UpdateMonIconFrame(sprite);
|
||||
}
|
||||
|
||||
static void SpriteCb_MonIconCardScrollUp(struct Sprite *sprite)
|
||||
static void SpriteCB_MonIconCardScrollUp(struct Sprite *sprite)
|
||||
{
|
||||
if (!sprite->sMonIconStill)
|
||||
UpdateMonIconFrame(sprite);
|
||||
@@ -3197,7 +3213,7 @@ static void SpriteCb_MonIconCardScrollUp(struct Sprite *sprite)
|
||||
if (sprite->y >= -16)
|
||||
sprite->invisible = FALSE;
|
||||
if (++sprite->data[1] == 40)
|
||||
sprite->callback = SpriteCb_MonIcon;
|
||||
sprite->callback = SpriteCB_MonIconDomeInfo;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3209,7 +3225,7 @@ static void SpriteCb_MonIconCardScrollUp(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
static void SpriteCb_MonIconCardScrollDown(struct Sprite *sprite)
|
||||
static void SpriteCB_MonIconCardScrollDown(struct Sprite *sprite)
|
||||
{
|
||||
if (!sprite->sMonIconStill)
|
||||
UpdateMonIconFrame(sprite);
|
||||
@@ -3219,7 +3235,7 @@ static void SpriteCb_MonIconCardScrollDown(struct Sprite *sprite)
|
||||
if (sprite->y <= 176)
|
||||
sprite->invisible = FALSE;
|
||||
if (++sprite->data[1] == 40)
|
||||
sprite->callback = SpriteCb_MonIcon;
|
||||
sprite->callback = SpriteCB_MonIconDomeInfo;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3231,7 +3247,7 @@ static void SpriteCb_MonIconCardScrollDown(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
static void SpriteCb_MonIconCardScrollLeft(struct Sprite *sprite)
|
||||
static void SpriteCB_MonIconCardScrollLeft(struct Sprite *sprite)
|
||||
{
|
||||
if (!sprite->sMonIconStill)
|
||||
UpdateMonIconFrame(sprite);
|
||||
@@ -3241,7 +3257,7 @@ static void SpriteCb_MonIconCardScrollLeft(struct Sprite *sprite)
|
||||
if (sprite->x >= -16)
|
||||
sprite->invisible = FALSE;
|
||||
if (++sprite->data[1] == 64)
|
||||
sprite->callback = SpriteCb_MonIcon;
|
||||
sprite->callback = SpriteCB_MonIconDomeInfo;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3253,7 +3269,7 @@ static void SpriteCb_MonIconCardScrollLeft(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
static void SpriteCb_MonIconCardScrollRight(struct Sprite *sprite)
|
||||
static void SpriteCB_MonIconCardScrollRight(struct Sprite *sprite)
|
||||
{
|
||||
if (!sprite->sMonIconStill)
|
||||
UpdateMonIconFrame(sprite);
|
||||
@@ -3263,7 +3279,7 @@ static void SpriteCb_MonIconCardScrollRight(struct Sprite *sprite)
|
||||
if (sprite->x <= DISPLAY_WIDTH + 16)
|
||||
sprite->invisible = FALSE;
|
||||
if (++sprite->data[1] == 64)
|
||||
sprite->callback = SpriteCb_MonIcon;
|
||||
sprite->callback = SpriteCB_MonIconDomeInfo;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3275,7 +3291,7 @@ static void SpriteCb_MonIconCardScrollRight(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
static void SpriteCb_HorizontalScrollArrow(struct Sprite *sprite)
|
||||
static void SpriteCB_HorizontalScrollArrow(struct Sprite *sprite)
|
||||
{
|
||||
int taskId1 = sprite->data[0];
|
||||
int arrId = gTasks[gTasks[taskId1].data[4]].data[1];
|
||||
@@ -3344,7 +3360,7 @@ static void SpriteCb_HorizontalScrollArrow(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
static void SpriteCb_VerticalScrollArrow(struct Sprite *sprite)
|
||||
static void SpriteCB_VerticalScrollArrow(struct Sprite *sprite)
|
||||
{
|
||||
int taskId1 = sprite->data[0];
|
||||
|
||||
@@ -3510,7 +3526,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollUp;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollUp;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@@ -3521,7 +3537,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollUp;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollUp;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@@ -3534,7 +3550,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollUp;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollUp;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@@ -3545,7 +3561,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollUp;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollUp;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@@ -3626,7 +3642,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollDown;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollDown;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@@ -3637,7 +3653,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollDown;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollDown;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@@ -3650,7 +3666,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollDown;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollDown;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@@ -3661,7 +3677,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollDown;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollDown;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@@ -3709,7 +3725,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@@ -3720,7 +3736,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@@ -3733,7 +3749,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@@ -3744,7 +3760,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@@ -3792,7 +3808,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@@ -3803,7 +3819,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@@ -3816,7 +3832,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@@ -3827,7 +3843,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollLeft;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@@ -3873,7 +3889,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@@ -3884,7 +3900,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@@ -3897,7 +3913,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@@ -3908,7 +3924,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@@ -3956,7 +3972,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@@ -3967,7 +3983,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot ^ 1;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@@ -3980,7 +3996,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_TrainerIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_TrainerIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@@ -3991,7 +4007,7 @@ static void Task_HandleInfoCardInput(u8 taskId)
|
||||
{
|
||||
if (sInfoCard->spriteIds[i] != SPRITE_NONE)
|
||||
{
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCb_MonIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].callback = SpriteCB_MonIconCardScrollRight;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[0] = gTasks[taskId].tUsingAlternateSlot;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[1] = 0;
|
||||
gSprites[sInfoCard->spriteIds[i]].data[2] = i;
|
||||
@@ -4281,7 +4297,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
|
||||
if (trainerId == TRAINER_PLAYER)
|
||||
{
|
||||
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(DOME_MONS[trainerTourneyId][i],
|
||||
SpriteCb_MonIcon,
|
||||
SpriteCB_MonIconDomeInfo,
|
||||
x | sInfoTrainerMonX[i],
|
||||
y + sInfoTrainerMonY[i],
|
||||
0, 0, TRUE);
|
||||
@@ -4290,7 +4306,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
|
||||
else if (trainerId == TRAINER_FRONTIER_BRAIN)
|
||||
{
|
||||
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(DOME_MONS[trainerTourneyId][i],
|
||||
SpriteCb_MonIcon,
|
||||
SpriteCB_MonIconDomeInfo,
|
||||
x | sInfoTrainerMonX[i],
|
||||
y + sInfoTrainerMonY[i],
|
||||
0, 0, TRUE);
|
||||
@@ -4299,7 +4315,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId)
|
||||
else
|
||||
{
|
||||
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(gFacilityTrainerMons[DOME_MONS[trainerTourneyId][i]].species,
|
||||
SpriteCb_MonIcon,
|
||||
SpriteCB_MonIconDomeInfo,
|
||||
x | sInfoTrainerMonX[i],
|
||||
y + sInfoTrainerMonY[i],
|
||||
0, 0, TRUE);
|
||||
@@ -4770,7 +4786,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
||||
if (trainerIds[0] == TRAINER_PLAYER)
|
||||
{
|
||||
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(DOME_MONS[tournamentIds[0]][i],
|
||||
SpriteCb_MonIcon,
|
||||
SpriteCB_MonIconDomeInfo,
|
||||
x | sLeftTrainerMonX[i],
|
||||
y + sLeftTrainerMonY[i],
|
||||
0, 0, TRUE);
|
||||
@@ -4779,7 +4795,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
||||
else if (trainerIds[0] == TRAINER_FRONTIER_BRAIN)
|
||||
{
|
||||
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(DOME_MONS[tournamentIds[0]][i],
|
||||
SpriteCb_MonIcon,
|
||||
SpriteCB_MonIconDomeInfo,
|
||||
x | sLeftTrainerMonX[i],
|
||||
y + sLeftTrainerMonY[i],
|
||||
0, 0, TRUE);
|
||||
@@ -4788,7 +4804,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
||||
else
|
||||
{
|
||||
sInfoCard->spriteIds[2 + i + arrId] = CreateMonIcon(gFacilityTrainerMons[DOME_MONS[tournamentIds[0]][i]].species,
|
||||
SpriteCb_MonIcon,
|
||||
SpriteCB_MonIconDomeInfo,
|
||||
x | sLeftTrainerMonX[i],
|
||||
y + sLeftTrainerMonY[i],
|
||||
0, 0, TRUE);
|
||||
@@ -4810,7 +4826,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
||||
if (trainerIds[1] == TRAINER_PLAYER)
|
||||
{
|
||||
sInfoCard->spriteIds[5 + i + arrId] = CreateMonIcon(DOME_MONS[tournamentIds[1]][i],
|
||||
SpriteCb_MonIcon,
|
||||
SpriteCB_MonIconDomeInfo,
|
||||
x | sRightTrainerMonX[i],
|
||||
y + sRightTrainerMonY[i],
|
||||
0, 0, TRUE);
|
||||
@@ -4819,7 +4835,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
||||
else if (trainerIds[1] == TRAINER_FRONTIER_BRAIN)
|
||||
{
|
||||
sInfoCard->spriteIds[5 + i + arrId] = CreateMonIcon(DOME_MONS[tournamentIds[1]][i],
|
||||
SpriteCb_MonIcon,
|
||||
SpriteCB_MonIconDomeInfo,
|
||||
x | sRightTrainerMonX[i],
|
||||
y + sRightTrainerMonY[i],
|
||||
0, 0, TRUE);
|
||||
@@ -4828,7 +4844,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
||||
else
|
||||
{
|
||||
sInfoCard->spriteIds[5 + i + arrId] = CreateMonIcon(gFacilityTrainerMons[DOME_MONS[tournamentIds[1]][i]].species,
|
||||
SpriteCb_MonIcon,
|
||||
SpriteCB_MonIconDomeInfo,
|
||||
x | sRightTrainerMonX[i],
|
||||
y + sRightTrainerMonY[i],
|
||||
0, 0, TRUE);
|
||||
@@ -5847,7 +5863,7 @@ static void InitRandomTourneyTreeResults(void)
|
||||
DOME_TRAINERS[i].forfeited = FALSE;
|
||||
}
|
||||
|
||||
monLevel = 50;
|
||||
monLevel = FRONTIER_MAX_LEVEL_50;
|
||||
for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT; i++)
|
||||
{
|
||||
monTypesBits = 0;
|
||||
@@ -5990,7 +6006,7 @@ static void DecideRoundWinners(u8 roundId)
|
||||
for (monId2 = 0; monId2 < FRONTIER_PARTY_SIZE; monId2++)
|
||||
{
|
||||
points1 += GetTypeEffectivenessPoints(gFacilityTrainerMons[DOME_MONS[tournamentId1][monId1]].moves[moveSlot],
|
||||
gFacilityTrainerMons[DOME_MONS[tournamentId2][monId2]].species, 2);
|
||||
gFacilityTrainerMons[DOME_MONS[tournamentId2][monId2]].species, EFFECTIVENESS_MODE_AI_VS_AI);
|
||||
}
|
||||
}
|
||||
species = gFacilityTrainerMons[DOME_MONS[tournamentId1][monId1]].species;
|
||||
@@ -6013,7 +6029,7 @@ static void DecideRoundWinners(u8 roundId)
|
||||
for (monId2 = 0; monId2 < FRONTIER_PARTY_SIZE; monId2++)
|
||||
{
|
||||
points2 += GetTypeEffectivenessPoints(gFacilityTrainerMons[DOME_MONS[tournamentId2][monId1]].moves[moveSlot],
|
||||
gFacilityTrainerMons[DOME_MONS[tournamentId1][monId2]].species, 2);
|
||||
gFacilityTrainerMons[DOME_MONS[tournamentId1][monId2]].species, EFFECTIVENESS_MODE_AI_VS_AI);
|
||||
}
|
||||
}
|
||||
species = gFacilityTrainerMons[DOME_MONS[tournamentId2][monId1]].species;
|
||||
|
||||
+42
-26
@@ -12,15 +12,15 @@
|
||||
#include "constants/battle_factory.h"
|
||||
#include "constants/battle_frontier.h"
|
||||
#include "constants/battle_frontier_mons.h"
|
||||
#include "constants/battle_tent.h"
|
||||
#include "constants/frontier_util.h"
|
||||
#include "constants/layouts.h"
|
||||
#include "constants/trainers.h"
|
||||
#include "constants/moves.h"
|
||||
#include "constants/items.h"
|
||||
|
||||
// IWRAM bss
|
||||
static bool8 sPerformedRentalSwap;
|
||||
|
||||
// This file's functions.
|
||||
static void InitFactoryChallenge(void);
|
||||
static void GetBattleFactoryData(void);
|
||||
static void SetBattleFactoryData(void);
|
||||
@@ -212,7 +212,7 @@ static void InitFactoryChallenge(void)
|
||||
}
|
||||
|
||||
sPerformedRentalSwap = FALSE;
|
||||
for (i = 0; i < 6; i++)
|
||||
for (i = 0; i < ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons); i++)
|
||||
gSaveBlock2Ptr->frontier.rentalMons[i].monId = 0xFFFF;
|
||||
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
|
||||
gFrontierTempParty[i] = 0xFFFF;
|
||||
@@ -310,11 +310,12 @@ static void GenerateOpponentMons(void)
|
||||
u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
|
||||
u32 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
|
||||
u32 winStreak = gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode];
|
||||
u32 challengeNum = winStreak / 7;
|
||||
u32 challengeNum = winStreak / FRONTIER_STAGES_PER_CHALLENGE;
|
||||
gFacilityTrainers = gBattleFrontierTrainers;
|
||||
|
||||
do
|
||||
{
|
||||
// Choose a random trainer, ensuring no repeats in this challenge
|
||||
trainerId = GetRandomScaledFrontierTrainerId(challengeNum, gSaveBlock2Ptr->frontier.curChallengeBattleNum);
|
||||
for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum; i++)
|
||||
{
|
||||
@@ -324,27 +325,32 @@ static void GenerateOpponentMons(void)
|
||||
} while (i != gSaveBlock2Ptr->frontier.curChallengeBattleNum);
|
||||
|
||||
gTrainerBattleOpponent_A = trainerId;
|
||||
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < 6)
|
||||
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < FRONTIER_STAGES_PER_CHALLENGE - 1)
|
||||
gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum] = trainerId;
|
||||
|
||||
i = 0;
|
||||
while (i != FRONTIER_PARTY_SIZE)
|
||||
{
|
||||
u16 monId = GetFactoryMonId(lvlMode, challengeNum, FALSE);
|
||||
|
||||
// Unown (FRONTIER_MON_UNOWN) is forbidden on opponent Factory teams.
|
||||
if (gFacilityTrainerMons[monId].species == SPECIES_UNOWN)
|
||||
continue;
|
||||
|
||||
for (j = 0; j < 6; j++)
|
||||
// Ensure none of the opponent's pokemon are the same as the potential rental pokemon for the player
|
||||
for (j = 0; j < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons); j++)
|
||||
{
|
||||
if (gFacilityTrainerMons[monId].species == gFacilityTrainerMons[gSaveBlock2Ptr->frontier.rentalMons[j].monId].species)
|
||||
break;
|
||||
}
|
||||
if (j != 6)
|
||||
if (j != (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons))
|
||||
continue;
|
||||
|
||||
// "High tier" pokemon are only allowed on open level mode
|
||||
if (lvlMode == FRONTIER_LVL_50 && monId > FRONTIER_MONS_HIGH_TIER)
|
||||
continue;
|
||||
|
||||
// Ensure this species hasn't already been chosen for the opponent
|
||||
for (k = firstMonId; k < firstMonId + i; k++)
|
||||
{
|
||||
if (species[k] == gFacilityTrainerMons[monId].species)
|
||||
@@ -353,14 +359,16 @@ static void GenerateOpponentMons(void)
|
||||
if (k != firstMonId + i)
|
||||
continue;
|
||||
|
||||
// Ensure held items don't repeat on the opponent's team
|
||||
for (k = firstMonId; k < firstMonId + i; k++)
|
||||
{
|
||||
if (heldItems[k] != 0 && heldItems[k] == gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId])
|
||||
if (heldItems[k] != ITEM_NONE && heldItems[k] == gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId])
|
||||
break;
|
||||
}
|
||||
if (k != firstMonId + i)
|
||||
continue;
|
||||
|
||||
// Successful selection
|
||||
species[i] = gFacilityTrainerMons[monId].species;
|
||||
heldItems[i] = gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId];
|
||||
gFrontierTempParty[i] = monId;
|
||||
@@ -406,15 +414,15 @@ static void SetPlayerAndOpponentParties(void)
|
||||
if (gSaveBlock2Ptr->frontier.lvlMode == FRONTIER_LVL_TENT)
|
||||
{
|
||||
gFacilityTrainerMons = gSlateportBattleTentMons;
|
||||
monLevel = 30;
|
||||
monLevel = TENT_MIN_LEVEL;
|
||||
}
|
||||
else
|
||||
{
|
||||
gFacilityTrainerMons = gBattleFrontierMons;
|
||||
if (gSaveBlock2Ptr->frontier.lvlMode != FRONTIER_LVL_50)
|
||||
monLevel = 100;
|
||||
monLevel = FRONTIER_MAX_LEVEL_OPEN;
|
||||
else
|
||||
monLevel = 50;
|
||||
monLevel = FRONTIER_MAX_LEVEL_50;
|
||||
}
|
||||
|
||||
if (gSpecialVar_0x8005 < 2)
|
||||
@@ -618,9 +626,9 @@ static void GetOpponentMostCommonMonType(void)
|
||||
// Determine which are the two most-common types.
|
||||
// The second most-common type is only updated if
|
||||
// its count is equal to the most-common type.
|
||||
mostCommonTypes[0] = TYPE_NORMAL;
|
||||
mostCommonTypes[1] = TYPE_NORMAL;
|
||||
for (i = TYPE_FIGHTING; i < NUMBER_OF_MON_TYPES; i++)
|
||||
mostCommonTypes[0] = 0;
|
||||
mostCommonTypes[1] = 0;
|
||||
for (i = 1; i < NUMBER_OF_MON_TYPES; i++)
|
||||
{
|
||||
if (typeCounts[mostCommonTypes[0]] < typeCounts[i])
|
||||
mostCommonTypes[0] = i;
|
||||
@@ -720,17 +728,25 @@ static void RestorePlayerPartyHeldItems(void)
|
||||
}
|
||||
}
|
||||
|
||||
u8 GetFactoryMonFixedIV(u8 arg0, u8 arg1)
|
||||
// Get the IV to use for the opponent's pokémon.
|
||||
// The IVs get higher for each subsequent challenge and for
|
||||
// the last trainer in each challenge. Noland is an exception
|
||||
// to this, as he uses the IVs that would be used by the regular
|
||||
// trainers 2 challenges ahead of the current one.
|
||||
// Due to a mistake in FillFactoryFrontierTrainerParty, the
|
||||
// challenge number used to determine the IVs for regular trainers
|
||||
// is Battle Tower's instead of Battle Factory's.
|
||||
u8 GetFactoryMonFixedIV(u8 challengeNum, bool8 isLastBattle)
|
||||
{
|
||||
u8 a1;
|
||||
u8 a2 = (arg1 != 0) ? 1 : 0;
|
||||
u8 ivSet;
|
||||
bool8 useHigherIV = isLastBattle ? TRUE : FALSE;
|
||||
|
||||
if (arg0 > 8)
|
||||
a1 = 7;
|
||||
if (challengeNum > 8)
|
||||
ivSet = 7;
|
||||
else
|
||||
a1 = arg0;
|
||||
ivSet = challengeNum;
|
||||
|
||||
return sFixedIVTable[a1][a2];
|
||||
return sFixedIVTable[ivSet][useHigherIV];
|
||||
}
|
||||
|
||||
void FillFactoryBrainParty(void)
|
||||
@@ -746,7 +762,7 @@ void FillFactoryBrainParty(void)
|
||||
u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
|
||||
u8 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
|
||||
u8 challengeNum = gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode] / 7;
|
||||
fixedIV = GetFactoryMonFixedIV(challengeNum + 2, 0);
|
||||
fixedIV = GetFactoryMonFixedIV(challengeNum + 2, FALSE);
|
||||
monLevel = SetFacilityPtrsGetLevel();
|
||||
i = 0;
|
||||
otId = T1_READ_32(gSaveBlock2Ptr->playerTrainerId);
|
||||
@@ -757,15 +773,15 @@ void FillFactoryBrainParty(void)
|
||||
|
||||
if (gFacilityTrainerMons[monId].species == SPECIES_UNOWN)
|
||||
continue;
|
||||
if (monLevel == 50 && monId > FRONTIER_MONS_HIGH_TIER)
|
||||
if (monLevel == FRONTIER_MAX_LEVEL_50 && monId > FRONTIER_MONS_HIGH_TIER)
|
||||
continue;
|
||||
|
||||
for (j = 0; j < 6; j++)
|
||||
for (j = 0; j < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons); j++)
|
||||
{
|
||||
if (monId == gSaveBlock2Ptr->frontier.rentalMons[j].monId)
|
||||
break;
|
||||
}
|
||||
if (j != 6)
|
||||
if (j != (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons))
|
||||
continue;
|
||||
|
||||
for (k = 0; k < i; k++)
|
||||
@@ -778,7 +794,7 @@ void FillFactoryBrainParty(void)
|
||||
|
||||
for (k = 0; k < i; k++)
|
||||
{
|
||||
if (heldItems[k] != 0 && heldItems[k] == gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId])
|
||||
if (heldItems[k] != ITEM_NONE && heldItems[k] == gBattleFrontierHeldItems[gFacilityTrainerMons[monId].itemTableId])
|
||||
break;
|
||||
}
|
||||
if (k != i)
|
||||
|
||||
+15
-21
@@ -410,7 +410,7 @@ static const struct OamData sOam_Select_Pokeball =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(32x32),
|
||||
.x = 0,
|
||||
@@ -427,7 +427,7 @@ static const struct OamData sOam_Select_Arrow =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(16x16),
|
||||
.x = 0,
|
||||
@@ -444,7 +444,7 @@ static const struct OamData sOam_Select_MenuHighlight =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(32x16),
|
||||
.x = 0,
|
||||
@@ -461,7 +461,7 @@ static const struct OamData sOam_Select_MonPicBgAnim =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_DOUBLE,
|
||||
.objMode = ST_OAM_OBJ_BLEND,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(64x64),
|
||||
.x = 0,
|
||||
@@ -661,7 +661,7 @@ static const struct OamData sOam_Swap_Pokeball =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(32x32),
|
||||
.x = 0,
|
||||
@@ -678,7 +678,7 @@ static const struct OamData sOam_Swap_Arrow =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(16x16),
|
||||
.x = 0,
|
||||
@@ -695,7 +695,7 @@ static const struct OamData sOam_Swap_MenuHighlight =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(32x16),
|
||||
.x = 0,
|
||||
@@ -712,7 +712,7 @@ static const struct OamData sOam_Swap_MonPicBgAnim =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_DOUBLE,
|
||||
.objMode = ST_OAM_OBJ_BLEND,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(64x64),
|
||||
.x = 0,
|
||||
@@ -1131,8 +1131,7 @@ static void CB2_InitSelectScreen(void)
|
||||
switch (gMain.state)
|
||||
{
|
||||
case 0:
|
||||
if (sFactorySelectMons != NULL)
|
||||
FREE_AND_SET_NULL(sFactorySelectMons);
|
||||
TRY_FREE_AND_SET_NULL(sFactorySelectMons);
|
||||
SetHBlankCallback(NULL);
|
||||
SetVBlankCallback(NULL);
|
||||
CpuFill32(0, (void *)VRAM, VRAM_SIZE);
|
||||
@@ -1748,9 +1747,9 @@ static void CreateFrontierFactorySelectableMons(u8 firstMonId)
|
||||
u16 monId = gSaveBlock2Ptr->frontier.rentalMons[i].monId;
|
||||
sFactorySelectScreen->mons[i + firstMonId].monId = monId;
|
||||
if (i < rentalRank)
|
||||
ivs = GetFactoryMonFixedIV(challengeNum + 1, 0);
|
||||
ivs = GetFactoryMonFixedIV(challengeNum + 1, FALSE);
|
||||
else
|
||||
ivs = GetFactoryMonFixedIV(challengeNum, 0);
|
||||
ivs = GetFactoryMonFixedIV(challengeNum, FALSE);
|
||||
CreateMonWithEVSpreadNatureOTID(&sFactorySelectScreen->mons[i + firstMonId].monData,
|
||||
gFacilityTrainerMons[monId].species,
|
||||
level,
|
||||
@@ -2474,7 +2473,7 @@ static void Swap_Task_HandleYesNo(u8 taskId)
|
||||
gTasks[taskId].tSaidYes = TRUE;
|
||||
hiPtr = gTasks[taskId].tFollowUpTaskPtrHi;
|
||||
loPtr = gTasks[taskId].tFollowUpTaskPtrLo;
|
||||
gTasks[taskId].func = (void*)((hiPtr << 16) | loPtr);
|
||||
gTasks[taskId].func = (void *)((hiPtr << 16) | loPtr);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2483,7 +2482,7 @@ static void Swap_Task_HandleYesNo(u8 taskId)
|
||||
Swap_ErasePopupMenu(SWAP_WIN_YES_NO);
|
||||
hiPtr = gTasks[taskId].tFollowUpTaskPtrHi;
|
||||
loPtr = gTasks[taskId].tFollowUpTaskPtrLo;
|
||||
gTasks[taskId].func = (void*)((hiPtr << 16) | loPtr);
|
||||
gTasks[taskId].func = (void *)((hiPtr << 16) | loPtr);
|
||||
}
|
||||
}
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
@@ -2493,7 +2492,7 @@ static void Swap_Task_HandleYesNo(u8 taskId)
|
||||
Swap_ErasePopupMenu(SWAP_WIN_YES_NO);
|
||||
hiPtr = gTasks[taskId].tFollowUpTaskPtrHi;
|
||||
loPtr = gTasks[taskId].tFollowUpTaskPtrLo;
|
||||
gTasks[taskId].func = (void*)((hiPtr << 16) | loPtr);
|
||||
gTasks[taskId].func = (void *)((hiPtr << 16) | loPtr);
|
||||
}
|
||||
else if (JOY_REPEAT(DPAD_UP))
|
||||
{
|
||||
@@ -4221,17 +4220,12 @@ static void Task_OpenMonPic(u8 taskId)
|
||||
return;
|
||||
break;
|
||||
default:
|
||||
#ifndef UBFIX
|
||||
DestroyTask(taskId);
|
||||
#endif
|
||||
// UB: Should not use the task after it has been deleted.
|
||||
// Accessing data of destroyed task. Task data isn't reset until a new task needs that task id.
|
||||
if (gTasks[taskId].tIsSwapScreen == TRUE)
|
||||
Swap_CreateMonSprite();
|
||||
else
|
||||
Select_CreateMonSprite();
|
||||
#ifdef UBFIX
|
||||
DestroyTask(taskId);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
task->tState++;
|
||||
|
||||
+15
-15
@@ -110,7 +110,7 @@ u16 ChooseMoveAndTargetInBattlePalace(void)
|
||||
{
|
||||
s32 i, var1, var2;
|
||||
s32 chosenMoveId = -1;
|
||||
struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct*)(&gBattleBufferA[gActiveBattler][4]);
|
||||
struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct *)(&gBattleBufferA[gActiveBattler][4]);
|
||||
u8 unusableMovesBits = CheckMoveLimitations(gActiveBattler, 0, MOVE_LIMITATIONS_ALL);
|
||||
s32 percent = Random() % 100;
|
||||
|
||||
@@ -254,7 +254,7 @@ u16 ChooseMoveAndTargetInBattlePalace(void)
|
||||
else if (moveTarget == MOVE_TARGET_SELECTED)
|
||||
chosenMoveId |= GetBattlePalaceTarget();
|
||||
else
|
||||
chosenMoveId |= (GetBattlerAtPosition((GetBattlerPosition(gActiveBattler) & BIT_SIDE) ^ BIT_SIDE) << 8);
|
||||
chosenMoveId |= (GetBattlerAtPosition(BATTLE_OPPOSITE(GET_BATTLER_SIDE(gActiveBattler))) << 8);
|
||||
|
||||
return chosenMoveId;
|
||||
}
|
||||
@@ -310,7 +310,7 @@ static u16 GetBattlePalaceTarget(void)
|
||||
}
|
||||
|
||||
if (gBattleMons[opposing1].hp == gBattleMons[opposing2].hp)
|
||||
return (((gActiveBattler & BIT_SIDE) ^ BIT_SIDE) + (Random() & 2)) << 8;
|
||||
return (BATTLE_OPPOSITE(gActiveBattler & BIT_SIDE) + (Random() & 2)) << 8;
|
||||
|
||||
switch (gBattlePalaceNatureToMoveTarget[GetNatureFromPersonality(gBattleMons[gActiveBattler].personality)])
|
||||
{
|
||||
@@ -325,11 +325,11 @@ static u16 GetBattlePalaceTarget(void)
|
||||
else
|
||||
return opposing2 << 8;
|
||||
case PALACE_TARGET_RANDOM:
|
||||
return (((gActiveBattler & BIT_SIDE) ^ BIT_SIDE) + (Random() & 2)) << 8;
|
||||
return (BATTLE_OPPOSITE(gActiveBattler & BIT_SIDE) + (Random() & 2)) << 8;
|
||||
}
|
||||
}
|
||||
|
||||
return (gActiveBattler ^ BIT_SIDE) << 8;
|
||||
return BATTLE_OPPOSITE(gActiveBattler) << 8;
|
||||
}
|
||||
|
||||
// Wait for the pokemon to finish appearing out from the pokeball on send out
|
||||
@@ -353,12 +353,12 @@ void SpriteCB_WaitForBattlerBallReleaseAnim(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
static void UnusedDoBattleSpriteAffineAnim(struct Sprite *sprite, bool8 arg1)
|
||||
static void UnusedDoBattleSpriteAffineAnim(struct Sprite *sprite, bool8 pointless)
|
||||
{
|
||||
sprite->animPaused = TRUE;
|
||||
sprite->callback = SpriteCallbackDummy;
|
||||
|
||||
if (!arg1)
|
||||
if (!pointless)
|
||||
StartSpriteAffineAnim(sprite, 1);
|
||||
else
|
||||
StartSpriteAffineAnim(sprite, 1);
|
||||
@@ -590,7 +590,7 @@ void BattleLoadOpponentMonSpriteGfx(struct Pokemon *mon, u8 battlerId)
|
||||
if (species == SPECIES_CASTFORM)
|
||||
{
|
||||
paletteOffset = 0x100 + battlerId * 16;
|
||||
LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette[CASTFORM_NORMAL]);
|
||||
LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette);
|
||||
LoadPalette(gBattleStruct->castformPalette[gBattleMonForms[battlerId]], paletteOffset, 0x20);
|
||||
}
|
||||
|
||||
@@ -653,7 +653,7 @@ void BattleLoadPlayerMonSpriteGfx(struct Pokemon *mon, u8 battlerId)
|
||||
if (species == SPECIES_CASTFORM)
|
||||
{
|
||||
paletteOffset = 0x100 + battlerId * 16;
|
||||
LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette[CASTFORM_NORMAL]);
|
||||
LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette);
|
||||
LoadPalette(gBattleStruct->castformPalette[gBattleMonForms[battlerId]], paletteOffset, 0x20);
|
||||
}
|
||||
|
||||
@@ -783,7 +783,7 @@ bool8 BattleLoadAllHealthBoxesGfx(u8 state)
|
||||
return retVal;
|
||||
}
|
||||
|
||||
void LoadBattleBarGfx(u8 arg0)
|
||||
void LoadBattleBarGfx(u8 unused)
|
||||
{
|
||||
LZDecompressWram(gBattleInterfaceGfx_BattleBar, gMonSpritesGfxPtr->barFontGfx);
|
||||
}
|
||||
@@ -973,7 +973,7 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 castform)
|
||||
if (targetSpecies == SPECIES_CASTFORM)
|
||||
{
|
||||
gSprites[gBattlerSpriteIds[battlerAtk]].anims = gMonFrontAnimsPtrTable[targetSpecies];
|
||||
LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette[CASTFORM_NORMAL]);
|
||||
LZDecompressWram(lzPaletteData, gBattleStruct->castformPalette);
|
||||
LoadPalette(gBattleStruct->castformPalette[gBattleMonForms[battlerDef]], paletteOffset, 32);
|
||||
}
|
||||
|
||||
@@ -1060,7 +1060,7 @@ void HandleLowHpMusicChange(struct Pokemon *mon, u8 battlerId)
|
||||
{
|
||||
if (!gBattleSpritesDataPtr->battlerData[battlerId].lowHpSong)
|
||||
{
|
||||
if (!gBattleSpritesDataPtr->battlerData[battlerId ^ BIT_FLANK].lowHpSong)
|
||||
if (!gBattleSpritesDataPtr->battlerData[BATTLE_PARTNER(battlerId)].lowHpSong)
|
||||
PlaySE(SE_LOW_HEALTH);
|
||||
gBattleSpritesDataPtr->battlerData[battlerId].lowHpSong = 1;
|
||||
}
|
||||
@@ -1073,7 +1073,7 @@ void HandleLowHpMusicChange(struct Pokemon *mon, u8 battlerId)
|
||||
m4aSongNumStop(SE_LOW_HEALTH);
|
||||
return;
|
||||
}
|
||||
if (IsDoubleBattle() && !gBattleSpritesDataPtr->battlerData[battlerId ^ BIT_FLANK].lowHpSong)
|
||||
if (IsDoubleBattle() && !gBattleSpritesDataPtr->battlerData[BATTLE_PARTNER(battlerId)].lowHpSong)
|
||||
{
|
||||
m4aSongNumStop(SE_LOW_HEALTH);
|
||||
return;
|
||||
@@ -1087,7 +1087,7 @@ void BattleStopLowHpSound(void)
|
||||
|
||||
gBattleSpritesDataPtr->battlerData[playerBattler].lowHpSong = 0;
|
||||
if (IsDoubleBattle())
|
||||
gBattleSpritesDataPtr->battlerData[playerBattler ^ BIT_FLANK].lowHpSong = 0;
|
||||
gBattleSpritesDataPtr->battlerData[BATTLE_PARTNER(playerBattler)].lowHpSong = 0;
|
||||
|
||||
m4aSongNumStop(SE_LOW_HEALTH);
|
||||
}
|
||||
@@ -1219,7 +1219,7 @@ void HideBattlerShadowSprite(u8 battlerId)
|
||||
// Color the background tiles surrounding the action selection and move windows
|
||||
void FillAroundBattleWindows(void)
|
||||
{
|
||||
u16 *vramPtr = (u16*)(VRAM + 0x240);
|
||||
u16 *vramPtr = (u16 *)(VRAM + 0x240);
|
||||
s32 i;
|
||||
s32 j;
|
||||
|
||||
|
||||
+93
-93
@@ -158,43 +158,43 @@ enum
|
||||
HEALTHBOX_GFX_FRAME_END_BAR,
|
||||
};
|
||||
|
||||
static const u8 *GetHealthboxElementGfxPtr(u8 elementId);
|
||||
static u8* AddTextPrinterAndCreateWindowOnHealthbox(const u8 *str, u32 x, u32 y, u32 bgColor, u32 *windowId);
|
||||
static const u8 *GetHealthboxElementGfxPtr(u8);
|
||||
static u8 *AddTextPrinterAndCreateWindowOnHealthbox(const u8 *, u32, u32, u32, u32 *);
|
||||
|
||||
static void RemoveWindowOnHealthbox(u32 windowId);
|
||||
static void UpdateHpTextInHealthboxInDoubles(u8 healthboxSpriteId, s16 value, u8 maxOrCurrent);
|
||||
static void UpdateStatusIconInHealthbox(u8 healthboxSpriteId);
|
||||
static void UpdateHpTextInHealthboxInDoubles(u8, s16, u8);
|
||||
static void UpdateStatusIconInHealthbox(u8);
|
||||
|
||||
static void TextIntoHealthboxObject(void *dest, u8 *windowTileData, s32 windowWidth);
|
||||
static void SafariTextIntoHealthboxObject(void *dest, u8 *windowTileData, u32 windowWidth);
|
||||
static void HpTextIntoHealthboxObject(void *dest, u8 *windowTileData, u32 windowWidth);
|
||||
static void FillHealthboxObject(void *dest, u32 arg1, u32 arg2);
|
||||
static void TextIntoHealthboxObject(void *, u8 *, s32);
|
||||
static void SafariTextIntoHealthboxObject(void *, u8 *, u32);
|
||||
static void HpTextIntoHealthboxObject(void *, u8 *, u32);
|
||||
static void FillHealthboxObject(void *, u32, u32);
|
||||
|
||||
static void Task_HidePartyStatusSummary_BattleStart_1(u8 taskId);
|
||||
static void Task_HidePartyStatusSummary_BattleStart_2(u8 taskId);
|
||||
static void Task_HidePartyStatusSummary_DuringBattle(u8 taskId);
|
||||
static void Task_HidePartyStatusSummary_BattleStart_1(u8);
|
||||
static void Task_HidePartyStatusSummary_BattleStart_2(u8);
|
||||
static void Task_HidePartyStatusSummary_DuringBattle(u8);
|
||||
|
||||
static void SpriteCB_HealthBoxOther(struct Sprite *sprite);
|
||||
static void SpriteCB_HealthBar(struct Sprite *sprite);
|
||||
static void SpriteCB_StatusSummaryBar_Enter(struct Sprite *sprite);
|
||||
static void SpriteCB_StatusSummaryBar_Exit(struct Sprite *sprite);
|
||||
static void SpriteCB_StatusSummaryBalls_Enter(struct Sprite *sprite);
|
||||
static void SpriteCB_StatusSummaryBalls_Exit(struct Sprite *sprite);
|
||||
static void SpriteCB_StatusSummaryBalls_OnSwitchout(struct Sprite *sprite);
|
||||
static void SpriteCB_HealthBoxOther(struct Sprite *);
|
||||
static void SpriteCB_HealthBar(struct Sprite *);
|
||||
static void SpriteCB_StatusSummaryBar_Enter(struct Sprite *);
|
||||
static void SpriteCB_StatusSummaryBar_Exit(struct Sprite *);
|
||||
static void SpriteCB_StatusSummaryBalls_Enter(struct Sprite *);
|
||||
static void SpriteCB_StatusSummaryBalls_Exit(struct Sprite *);
|
||||
static void SpriteCB_StatusSummaryBalls_OnSwitchout(struct Sprite *);
|
||||
|
||||
static u8 GetStatusIconForBattlerId(u8 statusElementId, u8 battlerId);
|
||||
static s32 CalcNewBarValue(s32 maxValue, s32 currValue, s32 receivedValue, s32 *arg3, u8 arg4, u16 arg5);
|
||||
static u8 GetScaledExpFraction(s32 currValue, s32 receivedValue, s32 maxValue, u8 scale);
|
||||
static void MoveBattleBarGraphically(u8 battlerId, u8 whichBar);
|
||||
static u8 CalcBarFilledPixels(s32 maxValue, s32 oldValue, s32 receivedValue, s32 *currValue, u8 *arg4, u8 scale);
|
||||
static void Debug_TestHealthBar_Helper(struct TestingBar *barInfo, s32 *arg1, u16 *arg2);
|
||||
static u8 GetStatusIconForBattlerId(u8, u8);
|
||||
static s32 CalcNewBarValue(s32, s32, s32, s32 *, u8, u16);
|
||||
static u8 GetScaledExpFraction(s32, s32, s32, u8);
|
||||
static void MoveBattleBarGraphically(u8, u8);
|
||||
static u8 CalcBarFilledPixels(s32, s32, s32, s32 *, u8 *, u8);
|
||||
static void Debug_TestHealthBar_Helper(struct TestingBar *, s32 *, u16 *);
|
||||
|
||||
static const struct OamData sOamData_64x32 =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(64x32),
|
||||
.x = 0,
|
||||
@@ -266,7 +266,7 @@ static const struct OamData sOamData_Healthbar =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(32x8),
|
||||
.x = 0,
|
||||
@@ -635,7 +635,7 @@ static const struct OamData sOamData_Unused64x32 =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(64x32),
|
||||
.x = 0,
|
||||
@@ -652,7 +652,7 @@ static const struct OamData sOamData_StatusSummaryBalls =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(8x8),
|
||||
.x = 0,
|
||||
@@ -814,11 +814,11 @@ static void Debug_DrawNumber(s16 number, u16 *dest, bool8 unk)
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void Debug_DrawNumberPair(s16 number1, s16 number2, u16 *arg2)
|
||||
static void Debug_DrawNumberPair(s16 number1, s16 number2, u16 *dest)
|
||||
{
|
||||
arg2[4] = 0x1E;
|
||||
Debug_DrawNumber(number2, arg2, 0);
|
||||
Debug_DrawNumber(number1, arg2 + 5, 1);
|
||||
dest[4] = 0x1E;
|
||||
Debug_DrawNumber(number2, dest, FALSE);
|
||||
Debug_DrawNumber(number1, dest + 5, TRUE);
|
||||
}
|
||||
|
||||
// Because the healthbox is too large to fit into one sprite, it is divided into two sprites.
|
||||
@@ -908,7 +908,7 @@ u8 CreateBattlerHealthboxSprites(u8 battlerId)
|
||||
healthBarSpritePtr->subspriteMode = SUBSPRITES_IGNORE_PRIORITY;
|
||||
healthBarSpritePtr->oam.priority = 1;
|
||||
|
||||
CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_1), (void*)(OBJ_VRAM0 + healthBarSpritePtr->oam.tileNum * TILE_SIZE_4BPP), 64);
|
||||
CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_1), (void *)(OBJ_VRAM0 + healthBarSpritePtr->oam.tileNum * TILE_SIZE_4BPP), 64);
|
||||
|
||||
gSprites[healthboxLeftSpriteId].hMain_HealthBarSpriteId = healthbarSpriteId;
|
||||
gSprites[healthboxLeftSpriteId].hMain_Battler = battlerId;
|
||||
@@ -1094,7 +1094,7 @@ static void UpdateLvlInHealthbox(u8 healthboxSpriteId, u8 lvl)
|
||||
|
||||
if (GetBattlerSide(gSprites[healthboxSpriteId].hMain_Battler) == B_SIDE_PLAYER)
|
||||
{
|
||||
objVram = (void*)(OBJ_VRAM0);
|
||||
objVram = (void *)(OBJ_VRAM0);
|
||||
if (!IsDoubleBattle())
|
||||
objVram += spriteTileNum + 0x820;
|
||||
else
|
||||
@@ -1102,7 +1102,7 @@ static void UpdateLvlInHealthbox(u8 healthboxSpriteId, u8 lvl)
|
||||
}
|
||||
else
|
||||
{
|
||||
objVram = (void*)(OBJ_VRAM0);
|
||||
objVram = (void *)(OBJ_VRAM0);
|
||||
objVram += spriteTileNum + 0x400;
|
||||
}
|
||||
TextIntoHealthboxObject(objVram, windowTileData, 3);
|
||||
@@ -1123,7 +1123,7 @@ void UpdateHpTextInHealthbox(u8 healthboxSpriteId, s16 value, u8 maxOrCurrent)
|
||||
{
|
||||
ConvertIntToDecimalStringN(text, value, STR_CONV_MODE_RIGHT_ALIGN, 3);
|
||||
windowTileData = AddTextPrinterAndCreateWindowOnHealthbox(text, 0, 5, 2, &windowId);
|
||||
objVram = (void*)(OBJ_VRAM0);
|
||||
objVram = (void *)(OBJ_VRAM0);
|
||||
objVram += spriteTileNum + 0xB40;
|
||||
HpTextIntoHealthboxObject(objVram, windowTileData, 2);
|
||||
RemoveWindowOnHealthbox(windowId);
|
||||
@@ -1134,10 +1134,10 @@ void UpdateHpTextInHealthbox(u8 healthboxSpriteId, s16 value, u8 maxOrCurrent)
|
||||
text[3] = CHAR_SLASH;
|
||||
text[4] = EOS;
|
||||
windowTileData = AddTextPrinterAndCreateWindowOnHealthbox(text, 4, 5, 2, &windowId);
|
||||
objVram = (void*)(OBJ_VRAM0);
|
||||
objVram = (void *)(OBJ_VRAM0);
|
||||
objVram += spriteTileNum + 0x3E0;
|
||||
HpTextIntoHealthboxObject(objVram, windowTileData, 1);
|
||||
objVram = (void*)(OBJ_VRAM0);
|
||||
objVram = (void *)(OBJ_VRAM0);
|
||||
objVram += spriteTileNum + 0xB00;
|
||||
HpTextIntoHealthboxObject(objVram, windowTileData + 0x20, 2);
|
||||
RemoveWindowOnHealthbox(windowId);
|
||||
@@ -1179,7 +1179,7 @@ void UpdateHpTextInHealthbox(u8 healthboxSpriteId, s16 value, u8 maxOrCurrent)
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
CpuCopy32(&gMonSpritesGfxPtr->barFontGfx[i * 64 + 32],
|
||||
(void*)((OBJ_VRAM0) + TILE_SIZE_4BPP * (gSprites[healthboxSpriteId].oam.tileNum + var + i)),
|
||||
(void *)((OBJ_VRAM0) + TILE_SIZE_4BPP * (gSprites[healthboxSpriteId].oam.tileNum + var + i)),
|
||||
0x20);
|
||||
}
|
||||
}
|
||||
@@ -1198,16 +1198,16 @@ static void UpdateHpTextInHealthboxInDoubles(u8 healthboxSpriteId, s16 value, u8
|
||||
if (gBattleSpritesDataPtr->battlerData[gSprites[healthboxSpriteId].data[6]].hpNumbersNoBars) // don't print text if only bars are visible
|
||||
{
|
||||
spriteTileNum = gSprites[gSprites[healthboxSpriteId].data[5]].oam.tileNum * TILE_SIZE_4BPP;
|
||||
objVram = (void*)(OBJ_VRAM0) + spriteTileNum;
|
||||
objVram = (void *)(OBJ_VRAM0) + spriteTileNum;
|
||||
|
||||
if (maxOrCurrent != HP_CURRENT) // doubles, max hp
|
||||
{
|
||||
ConvertIntToDecimalStringN(text, value, STR_CONV_MODE_RIGHT_ALIGN, 3);
|
||||
windowTileData = AddTextPrinterAndCreateWindowOnHealthbox(text, 0, 5, 0, &windowId);
|
||||
HpTextIntoHealthboxObject((void*)(OBJ_VRAM0) + spriteTileNum + 0xC0, windowTileData, 2);
|
||||
HpTextIntoHealthboxObject((void *)(OBJ_VRAM0) + spriteTileNum + 0xC0, windowTileData, 2);
|
||||
RemoveWindowOnHealthbox(windowId);
|
||||
CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_FRAME_END),
|
||||
(void*)(OBJ_VRAM0 + 0x680) + (gSprites[healthboxSpriteId].oam.tileNum * TILE_SIZE_4BPP),
|
||||
(void *)(OBJ_VRAM0 + 0x680) + (gSprites[healthboxSpriteId].oam.tileNum * TILE_SIZE_4BPP),
|
||||
0x20);
|
||||
}
|
||||
else
|
||||
@@ -1217,7 +1217,7 @@ static void UpdateHpTextInHealthboxInDoubles(u8 healthboxSpriteId, s16 value, u8
|
||||
text[4] = EOS;
|
||||
windowTileData = AddTextPrinterAndCreateWindowOnHealthbox(text, 4, 5, 0, &windowId);
|
||||
FillHealthboxObject(objVram, 0, 3); // Erases HP bar leftover.
|
||||
HpTextIntoHealthboxObject((void*)(OBJ_VRAM0 + 0x60) + spriteTileNum, windowTileData, 3);
|
||||
HpTextIntoHealthboxObject((void *)(OBJ_VRAM0 + 0x60) + spriteTileNum, windowTileData, 3);
|
||||
RemoveWindowOnHealthbox(windowId);
|
||||
}
|
||||
}
|
||||
@@ -1250,13 +1250,13 @@ static void UpdateHpTextInHealthboxInDoubles(u8 healthboxSpriteId, s16 value, u8
|
||||
if (i < 3)
|
||||
{
|
||||
CpuCopy32(&gMonSpritesGfxPtr->barFontGfx[((i - var) * 64) + 32],
|
||||
(void*)((OBJ_VRAM0) + 32 * (1 + gSprites[r7].oam.tileNum + i)),
|
||||
(void *)((OBJ_VRAM0) + 32 * (1 + gSprites[r7].oam.tileNum + i)),
|
||||
0x20);
|
||||
}
|
||||
else
|
||||
{
|
||||
CpuCopy32(&gMonSpritesGfxPtr->barFontGfx[((i - var) * 64) + 32],
|
||||
(void*)((OBJ_VRAM0 + 0x20) + 32 * (i + gSprites[r7].oam.tileNum)),
|
||||
(void *)((OBJ_VRAM0 + 0x20) + 32 * (i + gSprites[r7].oam.tileNum)),
|
||||
0x20);
|
||||
}
|
||||
}
|
||||
@@ -1264,16 +1264,16 @@ static void UpdateHpTextInHealthboxInDoubles(u8 healthboxSpriteId, s16 value, u8
|
||||
if (maxOrCurrent == HP_CURRENT)
|
||||
{
|
||||
CpuCopy32(&gMonSpritesGfxPtr->barFontGfx[224],
|
||||
(void*)((OBJ_VRAM0) + ((gSprites[r7].oam.tileNum + 4) * TILE_SIZE_4BPP)),
|
||||
(void *)((OBJ_VRAM0) + ((gSprites[r7].oam.tileNum + 4) * TILE_SIZE_4BPP)),
|
||||
0x20);
|
||||
CpuFill32(0, (void*)((OBJ_VRAM0) + (gSprites[r7].oam.tileNum * TILE_SIZE_4BPP)), 0x20);
|
||||
CpuFill32(0, (void *)((OBJ_VRAM0) + (gSprites[r7].oam.tileNum * TILE_SIZE_4BPP)), 0x20);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GetBattlerSide(battlerId) == B_SIDE_PLAYER) // Impossible to reach part, because the battlerId is from the opponent's side.
|
||||
{
|
||||
CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_FRAME_END),
|
||||
(void*)(OBJ_VRAM0) + ((gSprites[healthboxSpriteId].oam.tileNum + 52) * TILE_SIZE_4BPP),
|
||||
(void *)(OBJ_VRAM0) + ((gSprites[healthboxSpriteId].oam.tileNum + 52) * TILE_SIZE_4BPP),
|
||||
0x20);
|
||||
}
|
||||
}
|
||||
@@ -1313,11 +1313,11 @@ static void PrintSafariMonInfo(u8 healthboxSpriteId, struct Pokemon *mon)
|
||||
for (j = 1; j < var + 1; j++)
|
||||
{
|
||||
spriteTileNum = (gSprites[healthboxSpriteId].oam.tileNum + (j - (j / 8 * 8)) + (j / 8 * 64)) * TILE_SIZE_4BPP;
|
||||
CpuCopy32(barFontGfx, (void*)(OBJ_VRAM0) + (spriteTileNum), 0x20);
|
||||
CpuCopy32(barFontGfx, (void *)(OBJ_VRAM0) + (spriteTileNum), 0x20);
|
||||
barFontGfx += 0x20;
|
||||
|
||||
spriteTileNum = (8 + gSprites[healthboxSpriteId].oam.tileNum + (j - (j / 8 * 8)) + (j / 8 * 64)) * TILE_SIZE_4BPP;
|
||||
CpuCopy32(barFontGfx, (void*)(OBJ_VRAM0) + (spriteTileNum), 0x20);
|
||||
CpuCopy32(barFontGfx, (void *)(OBJ_VRAM0) + (spriteTileNum), 0x20);
|
||||
barFontGfx += 0x20;
|
||||
}
|
||||
|
||||
@@ -1334,13 +1334,13 @@ static void PrintSafariMonInfo(u8 healthboxSpriteId, struct Pokemon *mon)
|
||||
if (j <= 1)
|
||||
{
|
||||
CpuCopy32(&gMonSpritesGfxPtr->barFontGfx[0x40 * j + 0x20],
|
||||
(void*)(OBJ_VRAM0) + (gSprites[healthBarSpriteId].oam.tileNum + 2 + j) * TILE_SIZE_4BPP,
|
||||
(void *)(OBJ_VRAM0) + (gSprites[healthBarSpriteId].oam.tileNum + 2 + j) * TILE_SIZE_4BPP,
|
||||
32);
|
||||
}
|
||||
else
|
||||
{
|
||||
CpuCopy32(&gMonSpritesGfxPtr->barFontGfx[0x40 * j + 0x20],
|
||||
(void*)(OBJ_VRAM0 + 0xC0) + (j + gSprites[healthBarSpriteId].oam.tileNum) * TILE_SIZE_4BPP,
|
||||
(void *)(OBJ_VRAM0 + 0xC0) + (j + gSprites[healthBarSpriteId].oam.tileNum) * TILE_SIZE_4BPP,
|
||||
32);
|
||||
}
|
||||
}
|
||||
@@ -1372,7 +1372,7 @@ void SwapHpBarsWithHpText(void)
|
||||
{
|
||||
healthBarSpriteId = gSprites[gHealthboxSpriteIds[i]].hMain_HealthBarSpriteId;
|
||||
|
||||
CpuFill32(0, (void*)(OBJ_VRAM0 + gSprites[healthBarSpriteId].oam.tileNum * TILE_SIZE_4BPP), 0x100);
|
||||
CpuFill32(0, (void *)(OBJ_VRAM0 + gSprites[healthBarSpriteId].oam.tileNum * TILE_SIZE_4BPP), 0x100);
|
||||
UpdateHpTextInHealthboxInDoubles(gHealthboxSpriteIds[i], GetMonData(&gPlayerParty[gBattlerPartyIndexes[i]], MON_DATA_HP), HP_CURRENT);
|
||||
UpdateHpTextInHealthboxInDoubles(gHealthboxSpriteIds[i], GetMonData(&gPlayerParty[gBattlerPartyIndexes[i]], MON_DATA_MAX_HP), HP_MAX);
|
||||
}
|
||||
@@ -1380,7 +1380,7 @@ void SwapHpBarsWithHpText(void)
|
||||
{
|
||||
UpdateStatusIconInHealthbox(gHealthboxSpriteIds[i]);
|
||||
UpdateHealthboxAttribute(gHealthboxSpriteIds[i], &gPlayerParty[gBattlerPartyIndexes[i]], HEALTHBOX_HEALTH_BAR);
|
||||
CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_FRAME_END_BAR), (void*)(OBJ_VRAM0 + 0x680 + gSprites[gHealthboxSpriteIds[i]].oam.tileNum * TILE_SIZE_4BPP), 32);
|
||||
CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_FRAME_END_BAR), (void *)(OBJ_VRAM0 + 0x680 + gSprites[gHealthboxSpriteIds[i]].oam.tileNum * TILE_SIZE_4BPP), 32);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1420,7 +1420,7 @@ void SwapHpBarsWithHpText(void)
|
||||
#define tIsBattleStart data[10]
|
||||
#define tBlend data[15]
|
||||
|
||||
u8 CreatePartyStatusSummarySprites(u8 battlerId, struct HpAndStatus *partyInfo, u8 arg2, bool8 isBattleStart)
|
||||
u8 CreatePartyStatusSummarySprites(u8 battlerId, struct HpAndStatus *partyInfo, bool8 skipPlayer, bool8 isBattleStart)
|
||||
{
|
||||
bool8 isOpponent;
|
||||
s16 bar_X, bar_Y, bar_pos2_X, bar_data0;
|
||||
@@ -1429,7 +1429,7 @@ u8 CreatePartyStatusSummarySprites(u8 battlerId, struct HpAndStatus *partyInfo,
|
||||
u8 ballIconSpritesIds[PARTY_SIZE];
|
||||
u8 taskId;
|
||||
|
||||
if (!arg2 || GetBattlerPosition(battlerId) != B_POSITION_OPPONENT_RIGHT)
|
||||
if (!skipPlayer || GetBattlerPosition(battlerId) != B_POSITION_OPPONENT_RIGHT)
|
||||
{
|
||||
if (GetBattlerSide(battlerId) == B_SIDE_PLAYER)
|
||||
{
|
||||
@@ -1442,7 +1442,7 @@ u8 CreatePartyStatusSummarySprites(u8 battlerId, struct HpAndStatus *partyInfo,
|
||||
{
|
||||
isOpponent = TRUE;
|
||||
|
||||
if (!arg2 || !IsDoubleBattle())
|
||||
if (!skipPlayer || !IsDoubleBattle())
|
||||
bar_X = 104, bar_Y = 40;
|
||||
else
|
||||
bar_X = 104, bar_Y = 16;
|
||||
@@ -1924,8 +1924,8 @@ static void UpdateNickInHealthbox(u8 healthboxSpriteId, struct Pokemon *mon)
|
||||
|
||||
if (GetBattlerSide(gSprites[healthboxSpriteId].data[6]) == B_SIDE_PLAYER)
|
||||
{
|
||||
TextIntoHealthboxObject((void*)(OBJ_VRAM0 + 0x40 + spriteTileNum), windowTileData, 6);
|
||||
ptr = (void*)(OBJ_VRAM0);
|
||||
TextIntoHealthboxObject((void *)(OBJ_VRAM0 + 0x40 + spriteTileNum), windowTileData, 6);
|
||||
ptr = (void *)(OBJ_VRAM0);
|
||||
if (!IsDoubleBattle())
|
||||
ptr += spriteTileNum + 0x800;
|
||||
else
|
||||
@@ -1934,7 +1934,7 @@ static void UpdateNickInHealthbox(u8 healthboxSpriteId, struct Pokemon *mon)
|
||||
}
|
||||
else
|
||||
{
|
||||
TextIntoHealthboxObject((void*)(OBJ_VRAM0 + 0x20 + spriteTileNum), windowTileData, 7);
|
||||
TextIntoHealthboxObject((void *)(OBJ_VRAM0 + 0x20 + spriteTileNum), windowTileData, 7);
|
||||
}
|
||||
|
||||
RemoveWindowOnHealthbox(windowId);
|
||||
@@ -1958,9 +1958,9 @@ static void TryAddPokeballIconToHealthbox(u8 healthboxSpriteId, bool8 noStatus)
|
||||
healthBarSpriteId = gSprites[healthboxSpriteId].hMain_HealthBarSpriteId;
|
||||
|
||||
if (noStatus)
|
||||
CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_STATUS_BALL_CAUGHT), (void*)(OBJ_VRAM0 + (gSprites[healthBarSpriteId].oam.tileNum + 8) * TILE_SIZE_4BPP), 32);
|
||||
CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_STATUS_BALL_CAUGHT), (void *)(OBJ_VRAM0 + (gSprites[healthBarSpriteId].oam.tileNum + 8) * TILE_SIZE_4BPP), 32);
|
||||
else
|
||||
CpuFill32(0, (void*)(OBJ_VRAM0 + (gSprites[healthBarSpriteId].oam.tileNum + 8) * TILE_SIZE_4BPP), 32);
|
||||
CpuFill32(0, (void *)(OBJ_VRAM0 + (gSprites[healthBarSpriteId].oam.tileNum + 8) * TILE_SIZE_4BPP), 32);
|
||||
}
|
||||
|
||||
static void UpdateStatusIconInHealthbox(u8 healthboxSpriteId)
|
||||
@@ -2018,7 +2018,7 @@ static void UpdateStatusIconInHealthbox(u8 healthboxSpriteId)
|
||||
statusGfxPtr = GetHealthboxElementGfxPtr(HEALTHBOX_GFX_39);
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
CpuCopy32(statusGfxPtr, (void*)(OBJ_VRAM0 + (gSprites[healthboxSpriteId].oam.tileNum + tileNumAdder + i) * TILE_SIZE_4BPP), 32);
|
||||
CpuCopy32(statusGfxPtr, (void *)(OBJ_VRAM0 + (gSprites[healthboxSpriteId].oam.tileNum + tileNumAdder + i) * TILE_SIZE_4BPP), 32);
|
||||
|
||||
if (!gBattleSpritesDataPtr->battlerData[battlerId].hpNumbersNoBars)
|
||||
CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_1), (void *)(OBJ_VRAM0 + gSprites[healthBarSpriteId].oam.tileNum * TILE_SIZE_4BPP), 64);
|
||||
@@ -2031,14 +2031,14 @@ static void UpdateStatusIconInHealthbox(u8 healthboxSpriteId)
|
||||
pltAdder += battlerId + 12;
|
||||
|
||||
FillPalette(sStatusIconColors[statusPalId], pltAdder + 0x100, 2);
|
||||
CpuCopy16(gPlttBufferUnfaded + 0x100 + pltAdder, (void*)(OBJ_PLTT + pltAdder * 2), 2);
|
||||
CpuCopy32(statusGfxPtr, (void*)(OBJ_VRAM0 + (gSprites[healthboxSpriteId].oam.tileNum + tileNumAdder) * TILE_SIZE_4BPP), 96);
|
||||
CpuCopy16(gPlttBufferUnfaded + 0x100 + pltAdder, (void *)(OBJ_PLTT + pltAdder * 2), 2);
|
||||
CpuCopy32(statusGfxPtr, (void *)(OBJ_VRAM0 + (gSprites[healthboxSpriteId].oam.tileNum + tileNumAdder) * TILE_SIZE_4BPP), 96);
|
||||
if (IsDoubleBattle() == TRUE || GetBattlerSide(battlerId) == B_SIDE_OPPONENT)
|
||||
{
|
||||
if (!gBattleSpritesDataPtr->battlerData[battlerId].hpNumbersNoBars)
|
||||
{
|
||||
CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_0), (void*)(OBJ_VRAM0 + gSprites[healthBarSpriteId].oam.tileNum * TILE_SIZE_4BPP), 32);
|
||||
CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_65), (void*)(OBJ_VRAM0 + (gSprites[healthBarSpriteId].oam.tileNum + 1) * TILE_SIZE_4BPP), 32);
|
||||
CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_0), (void *)(OBJ_VRAM0 + gSprites[healthBarSpriteId].oam.tileNum * TILE_SIZE_4BPP), 32);
|
||||
CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_65), (void *)(OBJ_VRAM0 + (gSprites[healthBarSpriteId].oam.tileNum + 1) * TILE_SIZE_4BPP), 32);
|
||||
}
|
||||
}
|
||||
TryAddPokeballIconToHealthbox(healthboxSpriteId, FALSE);
|
||||
@@ -2111,8 +2111,8 @@ static void UpdateSafariBallsTextOnHealthbox(u8 healthboxSpriteId)
|
||||
|
||||
windowTileData = AddTextPrinterAndCreateWindowOnHealthbox(gText_SafariBalls, 0, 3, 2, &windowId);
|
||||
spriteTileNum = gSprites[healthboxSpriteId].oam.tileNum * TILE_SIZE_4BPP;
|
||||
TextIntoHealthboxObject((void*)(OBJ_VRAM0 + 0x40) + spriteTileNum, windowTileData, 6);
|
||||
TextIntoHealthboxObject((void*)(OBJ_VRAM0 + 0x800) + spriteTileNum, windowTileData + 0xC0, 2);
|
||||
TextIntoHealthboxObject((void *)(OBJ_VRAM0 + 0x40) + spriteTileNum, windowTileData, 6);
|
||||
TextIntoHealthboxObject((void *)(OBJ_VRAM0 + 0x800) + spriteTileNum, windowTileData + 0xC0, 2);
|
||||
RemoveWindowOnHealthbox(windowId);
|
||||
}
|
||||
|
||||
@@ -2128,8 +2128,8 @@ static void UpdateLeftNoOfBallsTextOnHealthbox(u8 healthboxSpriteId)
|
||||
|
||||
windowTileData = AddTextPrinterAndCreateWindowOnHealthbox(text, GetStringRightAlignXOffset(FONT_SMALL, text, 0x2F), 3, 2, &windowId);
|
||||
spriteTileNum = gSprites[healthboxSpriteId].oam.tileNum * TILE_SIZE_4BPP;
|
||||
SafariTextIntoHealthboxObject((void*)(OBJ_VRAM0 + 0x2C0) + spriteTileNum, windowTileData, 2);
|
||||
SafariTextIntoHealthboxObject((void*)(OBJ_VRAM0 + 0xA00) + spriteTileNum, windowTileData + 0x40, 4);
|
||||
SafariTextIntoHealthboxObject((void *)(OBJ_VRAM0 + 0x2C0) + spriteTileNum, windowTileData, 2);
|
||||
SafariTextIntoHealthboxObject((void *)(OBJ_VRAM0 + 0xA00) + spriteTileNum, windowTileData + 0x40, 4);
|
||||
RemoveWindowOnHealthbox(windowId);
|
||||
}
|
||||
|
||||
@@ -2273,10 +2273,10 @@ static void MoveBattleBarGraphically(u8 battlerId, u8 whichBar)
|
||||
u8 healthbarSpriteId = gSprites[gBattleSpritesDataPtr->battleBars[battlerId].healthboxSpriteId].hMain_HealthBarSpriteId;
|
||||
if (i < 2)
|
||||
CpuCopy32(GetHealthboxElementGfxPtr(barElementId) + array[i] * 32,
|
||||
(void*)(OBJ_VRAM0 + (gSprites[healthbarSpriteId].oam.tileNum + 2 + i) * TILE_SIZE_4BPP), 32);
|
||||
(void *)(OBJ_VRAM0 + (gSprites[healthbarSpriteId].oam.tileNum + 2 + i) * TILE_SIZE_4BPP), 32);
|
||||
else
|
||||
CpuCopy32(GetHealthboxElementGfxPtr(barElementId) + array[i] * 32,
|
||||
(void*)(OBJ_VRAM0 + 64 + (i + gSprites[healthbarSpriteId].oam.tileNum) * TILE_SIZE_4BPP), 32);
|
||||
(void *)(OBJ_VRAM0 + 64 + (i + gSprites[healthbarSpriteId].oam.tileNum) * TILE_SIZE_4BPP), 32);
|
||||
}
|
||||
break;
|
||||
case EXP_BAR:
|
||||
@@ -2295,10 +2295,10 @@ static void MoveBattleBarGraphically(u8 battlerId, u8 whichBar)
|
||||
{
|
||||
if (i < 4)
|
||||
CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_12) + array[i] * 32,
|
||||
(void*)(OBJ_VRAM0 + (gSprites[gBattleSpritesDataPtr->battleBars[battlerId].healthboxSpriteId].oam.tileNum + 0x24 + i) * TILE_SIZE_4BPP), 32);
|
||||
(void *)(OBJ_VRAM0 + (gSprites[gBattleSpritesDataPtr->battleBars[battlerId].healthboxSpriteId].oam.tileNum + 0x24 + i) * TILE_SIZE_4BPP), 32);
|
||||
else
|
||||
CpuCopy32(GetHealthboxElementGfxPtr(HEALTHBOX_GFX_12) + array[i] * 32,
|
||||
(void*)(OBJ_VRAM0 + 0xB80 + (i + gSprites[gBattleSpritesDataPtr->battleBars[battlerId].healthboxSpriteId].oam.tileNum) * TILE_SIZE_4BPP), 32);
|
||||
(void *)(OBJ_VRAM0 + 0xB80 + (i + gSprites[gBattleSpritesDataPtr->battleBars[battlerId].healthboxSpriteId].oam.tileNum) * TILE_SIZE_4BPP), 32);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2383,7 +2383,7 @@ static s32 CalcNewBarValue(s32 maxValue, s32 oldValue, s32 receivedValue, s32 *c
|
||||
return ret;
|
||||
}
|
||||
|
||||
static u8 CalcBarFilledPixels(s32 maxValue, s32 oldValue, s32 receivedValue, s32 *currValue, u8 *arg4, u8 scale)
|
||||
static u8 CalcBarFilledPixels(s32 maxValue, s32 oldValue, s32 receivedValue, s32 *currValue, u8 *pixelsArray, u8 scale)
|
||||
{
|
||||
u8 pixels, filledPixels, totalPixels;
|
||||
u8 i;
|
||||
@@ -2397,7 +2397,7 @@ static u8 CalcBarFilledPixels(s32 maxValue, s32 oldValue, s32 receivedValue, s32
|
||||
totalPixels = scale * 8;
|
||||
|
||||
for (i = 0; i < scale; i++)
|
||||
arg4[i] = 0;
|
||||
pixelsArray[i] = 0;
|
||||
|
||||
if (maxValue < totalPixels)
|
||||
pixels = (*currValue * totalPixels / maxValue) >> 8;
|
||||
@@ -2408,7 +2408,7 @@ static u8 CalcBarFilledPixels(s32 maxValue, s32 oldValue, s32 receivedValue, s32
|
||||
|
||||
if (filledPixels == 0 && newValue > 0)
|
||||
{
|
||||
arg4[0] = 1;
|
||||
pixelsArray[0] = 1;
|
||||
filledPixels = 1;
|
||||
}
|
||||
else
|
||||
@@ -2417,11 +2417,11 @@ static u8 CalcBarFilledPixels(s32 maxValue, s32 oldValue, s32 receivedValue, s32
|
||||
{
|
||||
if (pixels >= 8)
|
||||
{
|
||||
arg4[i] = 8;
|
||||
pixelsArray[i] = 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
arg4[i] = pixels;
|
||||
pixelsArray[i] = pixels;
|
||||
break;
|
||||
}
|
||||
pixels -= 8;
|
||||
@@ -2433,7 +2433,7 @@ static u8 CalcBarFilledPixels(s32 maxValue, s32 oldValue, s32 receivedValue, s32
|
||||
|
||||
// Unused
|
||||
// These two functions seem as if they were made for testing the health bar.
|
||||
static s16 Debug_TestHealthBar(struct TestingBar *barInfo, s32 *currValue, u16 *arg2, s32 arg3)
|
||||
static s16 Debug_TestHealthBar(struct TestingBar *barInfo, s32 *currValue, u16 *dest, s32 unused)
|
||||
{
|
||||
s16 ret, var;
|
||||
|
||||
@@ -2441,31 +2441,31 @@ static s16 Debug_TestHealthBar(struct TestingBar *barInfo, s32 *currValue, u16 *
|
||||
barInfo->oldValue,
|
||||
barInfo->receivedValue,
|
||||
currValue, B_HEALTHBAR_PIXELS / 8, 1);
|
||||
Debug_TestHealthBar_Helper(barInfo, currValue, arg2);
|
||||
Debug_TestHealthBar_Helper(barInfo, currValue, dest);
|
||||
|
||||
if (barInfo->maxValue < B_HEALTHBAR_PIXELS)
|
||||
var = *currValue >> 8;
|
||||
else
|
||||
var = *currValue;
|
||||
|
||||
DummiedOutFunction(barInfo->maxValue, var, arg3);
|
||||
DummiedOutFunction(barInfo->maxValue, var, unused);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void Debug_TestHealthBar_Helper(struct TestingBar *barInfo, s32 *currValue, u16 *arg2)
|
||||
static void Debug_TestHealthBar_Helper(struct TestingBar *barInfo, s32 *currValue, u16 *dest)
|
||||
{
|
||||
u8 sp8[6];
|
||||
u16 sp10[6];
|
||||
u8 pixels[6];
|
||||
u16 src[6];
|
||||
u8 i;
|
||||
|
||||
CalcBarFilledPixels(barInfo->maxValue, barInfo->oldValue,
|
||||
barInfo->receivedValue, currValue, sp8, B_HEALTHBAR_PIXELS / 8);
|
||||
barInfo->receivedValue, currValue, pixels, B_HEALTHBAR_PIXELS / 8);
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
sp10[i] = (barInfo->unkC_0 << 12) | (barInfo->unk10 + sp8[i]);
|
||||
src[i] = (barInfo->unkC_0 << 12) | (barInfo->unk10 + pixels[i]);
|
||||
|
||||
CpuCopy16(sp10, arg2, sizeof(sp10));
|
||||
CpuCopy16(src, dest, sizeof(src));
|
||||
}
|
||||
|
||||
static u8 GetScaledExpFraction(s32 oldValue, s32 receivedValue, s32 maxValue, u8 scale)
|
||||
@@ -2522,7 +2522,7 @@ u8 GetHPBarLevel(s16 hp, s16 maxhp)
|
||||
return result;
|
||||
}
|
||||
|
||||
static u8* AddTextPrinterAndCreateWindowOnHealthbox(const u8 *str, u32 x, u32 y, u32 bgColor, u32 *windowId)
|
||||
static u8 *AddTextPrinterAndCreateWindowOnHealthbox(const u8 *str, u32 x, u32 y, u32 bgColor, u32 *windowId)
|
||||
{
|
||||
u16 winId;
|
||||
u8 color[3];
|
||||
@@ -2538,7 +2538,7 @@ static u8* AddTextPrinterAndCreateWindowOnHealthbox(const u8 *str, u32 x, u32 y,
|
||||
AddTextPrinterParameterized4(winId, FONT_SMALL, x, y, 0, 0, color, TEXT_SKIP_DRAW, str);
|
||||
|
||||
*windowId = winId;
|
||||
return (u8*)(GetWindowAttribute(winId, WINDOW_TILE_DATA));
|
||||
return (u8 *)(GetWindowAttribute(winId, WINDOW_TILE_DATA));
|
||||
}
|
||||
|
||||
static void RemoveWindowOnHealthbox(u32 windowId)
|
||||
@@ -2546,9 +2546,9 @@ static void RemoveWindowOnHealthbox(u32 windowId)
|
||||
RemoveWindow(windowId);
|
||||
}
|
||||
|
||||
static void FillHealthboxObject(void *dest, u32 arg1, u32 arg2)
|
||||
static void FillHealthboxObject(void *dest, u32 valMult, u32 numTiles)
|
||||
{
|
||||
CpuFill32(0x11111111 * arg1, dest, arg2 * TILE_SIZE_4BPP);
|
||||
CpuFill32(0x11111111 * valMult, dest, numTiles * TILE_SIZE_4BPP);
|
||||
}
|
||||
|
||||
static void HpTextIntoHealthboxObject(void *dest, u8 *windowTileData, u32 windowWidth)
|
||||
|
||||
+144
-149
@@ -78,12 +78,12 @@ static void EndLinkBattleInSteps(void);
|
||||
static void CB2_InitAskRecordBattle(void);
|
||||
static void CB2_AskRecordBattle(void);
|
||||
static void AskRecordBattle(void);
|
||||
static void SpriteCb_MoveWildMonToRight(struct Sprite *sprite);
|
||||
static void SpriteCb_WildMonShowHealthbox(struct Sprite *sprite);
|
||||
static void SpriteCb_WildMonAnimate(struct Sprite *sprite);
|
||||
static void SpriteCB_MoveWildMonToRight(struct Sprite *sprite);
|
||||
static void SpriteCB_WildMonShowHealthbox(struct Sprite *sprite);
|
||||
static void SpriteCB_WildMonAnimate(struct Sprite *sprite);
|
||||
static void SpriteCB_Flicker(struct Sprite *sprite);
|
||||
static void SpriteCB_AnimFaintOpponent(struct Sprite *sprite);
|
||||
static void SpriteCb_BlinkVisible(struct Sprite *sprite);
|
||||
static void SpriteCB_BlinkVisible(struct Sprite *sprite);
|
||||
static void SpriteCB_Idle(struct Sprite *sprite);
|
||||
static void SpriteCB_BattleSpriteSlideLeft(struct Sprite *sprite);
|
||||
static void TurnValuesCleanUp(bool8 var0);
|
||||
@@ -118,7 +118,7 @@ static void HandleEndTurn_BattleLost(void);
|
||||
static void HandleEndTurn_RanFromBattle(void);
|
||||
static void HandleEndTurn_MonFled(void);
|
||||
static void HandleEndTurn_FinishBattle(void);
|
||||
static void SpriteCB_UnusedBattleInit(struct Sprite* sprite);
|
||||
static void SpriteCB_UnusedBattleInit(struct Sprite *sprite);
|
||||
static void SpriteCB_UnusedBattleInit_Main(struct Sprite *sprite);
|
||||
|
||||
EWRAM_DATA u16 gBattle_BG0_X = 0;
|
||||
@@ -606,7 +606,7 @@ static void CB2_InitBattleInternal(void)
|
||||
SetHBlankCallback(NULL);
|
||||
SetVBlankCallback(NULL);
|
||||
|
||||
CpuFill32(0, (void*)(VRAM), VRAM_SIZE);
|
||||
CpuFill32(0, (void *)(VRAM), VRAM_SIZE);
|
||||
|
||||
SetGpuReg(REG_OFFSET_MOSAIC, 0);
|
||||
SetGpuReg(REG_OFFSET_WIN0H, DISPLAY_WIDTH);
|
||||
@@ -665,7 +665,7 @@ static void CB2_InitBattleInternal(void)
|
||||
ResetTasks();
|
||||
DrawBattleEntryBackground();
|
||||
FreeAllSpritePalettes();
|
||||
gReservedSpritePaletteCount = 4;
|
||||
gReservedSpritePaletteCount = MAX_BATTLERS_COUNT;
|
||||
SetVBlankCallback(VBlankCB_Battle);
|
||||
SetUpBattleVarsAndBirchZigzagoon();
|
||||
|
||||
@@ -772,8 +772,7 @@ static void SetPlayerBerryDataInBattleStruct(void)
|
||||
|
||||
static void SetAllPlayersBerryData(void)
|
||||
{
|
||||
s32 i;
|
||||
s32 j;
|
||||
s32 i, j;
|
||||
|
||||
if (!(gBattleTypeFlags & BATTLE_TYPE_LINK))
|
||||
{
|
||||
@@ -816,8 +815,8 @@ static void SetAllPlayersBerryData(void)
|
||||
gEnigmaBerries[2].itemEffect[i] = 0;
|
||||
}
|
||||
|
||||
gEnigmaBerries[0].holdEffect = 0;
|
||||
gEnigmaBerries[2].holdEffect = 0;
|
||||
gEnigmaBerries[0].holdEffect = HOLD_EFFECT_NONE;
|
||||
gEnigmaBerries[2].holdEffect = HOLD_EFFECT_NONE;
|
||||
gEnigmaBerries[0].holdEffectParam = 0;
|
||||
gEnigmaBerries[2].holdEffectParam = 0;
|
||||
}
|
||||
@@ -968,7 +967,7 @@ static void CB2_HandleStartBattle(void)
|
||||
case 1:
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_LINK)
|
||||
{
|
||||
if (gReceivedRemoteLinkPlayers != 0)
|
||||
if (gReceivedRemoteLinkPlayers)
|
||||
{
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
@@ -1068,7 +1067,7 @@ static void CB2_HandleStartBattle(void)
|
||||
// Recv Pokémon 5-6
|
||||
ResetBlockReceivedFlags();
|
||||
memcpy(&gEnemyParty[4], gBlockRecvBuffer[enemyMultiplayerId], sizeof(struct Pokemon) * 2);
|
||||
|
||||
|
||||
TryCorrectShedinjaLanguage(&gEnemyParty[0]);
|
||||
TryCorrectShedinjaLanguage(&gEnemyParty[1]);
|
||||
TryCorrectShedinjaLanguage(&gEnemyParty[2]);
|
||||
@@ -1176,7 +1175,7 @@ static void CB2_HandleStartMultiPartnerBattle(void)
|
||||
case 1:
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_LINK)
|
||||
{
|
||||
if (gReceivedRemoteLinkPlayers != 0)
|
||||
if (gReceivedRemoteLinkPlayers)
|
||||
{
|
||||
u8 language;
|
||||
|
||||
@@ -1443,7 +1442,7 @@ static void CB2_PreInitMultiBattle(void)
|
||||
switch (gBattleCommunication[MULTIUSE_STATE])
|
||||
{
|
||||
case 0:
|
||||
if (gReceivedRemoteLinkPlayers != 0 && IsLinkTaskFinished())
|
||||
if (gReceivedRemoteLinkPlayers && IsLinkTaskFinished())
|
||||
{
|
||||
sMultiPartnerPartyBuffer = Alloc(sizeof(gMultiPartnerParty));
|
||||
SetMultiPartnerMenuParty(0);
|
||||
@@ -1498,8 +1497,7 @@ static void CB2_PreInitMultiBattle(void)
|
||||
gBattleTypeFlags = *savedBattleTypeFlags;
|
||||
gMain.savedCallback = *savedCallback;
|
||||
SetMainCallback2(CB2_InitBattleInternal);
|
||||
Free(sMultiPartnerPartyBuffer);
|
||||
sMultiPartnerPartyBuffer = NULL;
|
||||
FREE_AND_SET_NULL(sMultiPartnerPartyBuffer);
|
||||
}
|
||||
}
|
||||
else if (gReceivedRemoteLinkPlayers == 0)
|
||||
@@ -1507,8 +1505,7 @@ static void CB2_PreInitMultiBattle(void)
|
||||
gBattleTypeFlags = *savedBattleTypeFlags;
|
||||
gMain.savedCallback = *savedCallback;
|
||||
SetMainCallback2(CB2_InitBattleInternal);
|
||||
Free(sMultiPartnerPartyBuffer);
|
||||
sMultiPartnerPartyBuffer = NULL;
|
||||
FREE_AND_SET_NULL(sMultiPartnerPartyBuffer);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1544,8 +1541,7 @@ static void CB2_PreInitIngamePlayerPartnerBattle(void)
|
||||
gBattleTypeFlags = *savedBattleTypeFlags;
|
||||
gMain.savedCallback = *savedCallback;
|
||||
SetMainCallback2(CB2_InitBattleInternal);
|
||||
Free(sMultiPartnerPartyBuffer);
|
||||
sMultiPartnerPartyBuffer = NULL;
|
||||
FREE_AND_SET_NULL(sMultiPartnerPartyBuffer);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1582,7 +1578,7 @@ static void CB2_HandleStartMultiBattle(void)
|
||||
case 1:
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_LINK)
|
||||
{
|
||||
if (gReceivedRemoteLinkPlayers != 0)
|
||||
if (gReceivedRemoteLinkPlayers)
|
||||
{
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
@@ -1808,7 +1804,7 @@ static void CB2_HandleStartMultiBattle(void)
|
||||
case 8:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
u32* ptr = gBattleStruct->multiBuffer.battleVideo;
|
||||
u32 *ptr = gBattleStruct->multiBuffer.battleVideo;
|
||||
ptr[0] = gBattleTypeFlags;
|
||||
ptr[1] = gRecordedBattleRngSeed; // UB: overwrites berry data
|
||||
SendBlock(BitmaskAllOtherLinkPlayers(), ptr, sizeof(gBattleStruct->multiBuffer.battleVideo));
|
||||
@@ -1894,7 +1890,7 @@ void CB2_QuitRecordedBattle(void)
|
||||
#define sState data[0]
|
||||
#define sDelay data[4]
|
||||
|
||||
static void SpriteCB_UnusedBattleInit(struct Sprite* sprite)
|
||||
static void SpriteCB_UnusedBattleInit(struct Sprite *sprite)
|
||||
{
|
||||
sprite->sState = 0;
|
||||
sprite->callback = SpriteCB_UnusedBattleInit_Main;
|
||||
@@ -1902,7 +1898,7 @@ static void SpriteCB_UnusedBattleInit(struct Sprite* sprite)
|
||||
|
||||
static void SpriteCB_UnusedBattleInit_Main(struct Sprite *sprite)
|
||||
{
|
||||
u16 *arr = (u16*)gDecompressionBuffer;
|
||||
u16 *arr = (u16 *)gDecompressionBuffer;
|
||||
|
||||
switch (sprite->sState)
|
||||
{
|
||||
@@ -2181,7 +2177,7 @@ void CB2_InitEndLinkBattle(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
CpuFill32(0, (void*)(VRAM), VRAM_SIZE);
|
||||
CpuFill32(0, (void *)(VRAM), VRAM_SIZE);
|
||||
SetGpuReg(REG_OFFSET_MOSAIC, 0);
|
||||
SetGpuReg(REG_OFFSET_WIN0H, DISPLAY_WIDTH);
|
||||
SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(DISPLAY_HEIGHT / 2, DISPLAY_HEIGHT / 2 + 1));
|
||||
@@ -2225,7 +2221,7 @@ void CB2_InitEndLinkBattle(void)
|
||||
DrawBattleEntryBackground();
|
||||
SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG0 | WINOUT_WIN01_BG1 | WINOUT_WIN01_BG2 | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR);
|
||||
FreeAllSpritePalettes();
|
||||
gReservedSpritePaletteCount = 4;
|
||||
gReservedSpritePaletteCount = MAX_BATTLERS_COUNT;
|
||||
SetVBlankCallback(VBlankCB_Battle);
|
||||
|
||||
// Show end Vs screen with battle results
|
||||
@@ -2322,7 +2318,7 @@ static void EndLinkBattleInSteps(void)
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
CpuFill32(0, (void*)VRAM, VRAM_SIZE);
|
||||
CpuFill32(0, (void *)VRAM, VRAM_SIZE);
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
LoadChosenBattleElement(i);
|
||||
@@ -2409,7 +2405,7 @@ static void CB2_InitAskRecordBattle(void)
|
||||
|
||||
SetHBlankCallback(NULL);
|
||||
SetVBlankCallback(NULL);
|
||||
CpuFill32(0, (void*)(VRAM), VRAM_SIZE);
|
||||
CpuFill32(0, (void *)(VRAM), VRAM_SIZE);
|
||||
ResetPaletteFade();
|
||||
gBattle_BG0_X = 0;
|
||||
gBattle_BG0_Y = 0;
|
||||
@@ -2429,7 +2425,7 @@ static void CB2_InitAskRecordBattle(void)
|
||||
ResetSpriteData();
|
||||
ResetTasks();
|
||||
FreeAllSpritePalettes();
|
||||
gReservedSpritePaletteCount = 4;
|
||||
gReservedSpritePaletteCount = MAX_BATTLERS_COUNT;
|
||||
SetVBlankCallback(VBlankCB_Battle);
|
||||
SetMainCallback2(CB2_AskRecordBattle);
|
||||
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK);
|
||||
@@ -2492,7 +2488,7 @@ static void AskRecordBattle(void)
|
||||
case STATE_PRINT_YES_NO:
|
||||
if (!IsTextPrinterActive(B_WIN_MSG))
|
||||
{
|
||||
HandleBattleWindow(0x18, 8, 0x1D, 0xD, 0);
|
||||
HandleBattleWindow(YESNOBOX_X_Y, 0);
|
||||
BattlePutTextOnWindow(gText_BattleYesNoChoice, B_WIN_YESNO);
|
||||
gBattleCommunication[CURSOR_POSITION] = 1;
|
||||
BattleCreateYesNoCursorAt(1);
|
||||
@@ -2528,7 +2524,7 @@ static void AskRecordBattle(void)
|
||||
if (gBattleCommunication[CURSOR_POSITION] == 0)
|
||||
{
|
||||
// Selected Yes
|
||||
HandleBattleWindow(0x18, 8, 0x1D, 0xD, WINDOW_CLEAR);
|
||||
HandleBattleWindow(YESNOBOX_X_Y, WINDOW_CLEAR);
|
||||
gBattleCommunication[1] = MoveRecordedBattleToSaveData();
|
||||
gBattleCommunication[MULTIUSE_STATE] = STATE_RECORD_YES;
|
||||
}
|
||||
@@ -2547,7 +2543,7 @@ static void AskRecordBattle(void)
|
||||
case STATE_RECORD_NO:
|
||||
if (IsLinkTaskFinished() == TRUE)
|
||||
{
|
||||
HandleBattleWindow(0x18, 8, 0x1D, 0xD, WINDOW_CLEAR);
|
||||
HandleBattleWindow(YESNOBOX_X_Y, WINDOW_CLEAR);
|
||||
if (gMain.anyLinkBattlerHasFrontierPass)
|
||||
{
|
||||
// Other battlers may be recording, wait for them
|
||||
@@ -2653,38 +2649,38 @@ u32 GetBattleWindowTemplatePixelWidth(u32 windowsType, u32 tableId)
|
||||
#define sBattler data[0]
|
||||
#define sSpeciesId data[2]
|
||||
|
||||
void SpriteCb_WildMon(struct Sprite *sprite)
|
||||
void SpriteCB_WildMon(struct Sprite *sprite)
|
||||
{
|
||||
sprite->callback = SpriteCb_MoveWildMonToRight;
|
||||
sprite->callback = SpriteCB_MoveWildMonToRight;
|
||||
StartSpriteAnimIfDifferent(sprite, 0);
|
||||
BeginNormalPaletteFade(0x20000, 0, 10, 10, RGB(8, 8, 8));
|
||||
}
|
||||
|
||||
static void SpriteCb_MoveWildMonToRight(struct Sprite *sprite)
|
||||
static void SpriteCB_MoveWildMonToRight(struct Sprite *sprite)
|
||||
{
|
||||
if ((gIntroSlideFlags & 1) == 0)
|
||||
{
|
||||
sprite->x2 += 2;
|
||||
if (sprite->x2 == 0)
|
||||
{
|
||||
sprite->callback = SpriteCb_WildMonShowHealthbox;
|
||||
sprite->callback = SpriteCB_WildMonShowHealthbox;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void SpriteCb_WildMonShowHealthbox(struct Sprite *sprite)
|
||||
static void SpriteCB_WildMonShowHealthbox(struct Sprite *sprite)
|
||||
{
|
||||
if (sprite->animEnded)
|
||||
{
|
||||
StartHealthboxSlideIn(sprite->sBattler);
|
||||
SetHealthboxSpriteVisible(gHealthboxSpriteIds[sprite->sBattler]);
|
||||
sprite->callback = SpriteCb_WildMonAnimate;
|
||||
sprite->callback = SpriteCB_WildMonAnimate;
|
||||
StartSpriteAnimIfDifferent(sprite, 0);
|
||||
BeginNormalPaletteFade(0x20000, 0, 10, 0, RGB(8, 8, 8));
|
||||
}
|
||||
}
|
||||
|
||||
static void SpriteCb_WildMonAnimate(struct Sprite *sprite)
|
||||
static void SpriteCB_WildMonAnimate(struct Sprite *sprite)
|
||||
{
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
@@ -2790,7 +2786,7 @@ static void SpriteCB_AnimFaintOpponent(struct Sprite *sprite)
|
||||
}
|
||||
else // Erase bottom part of the sprite to create a smooth illusion of mon falling down.
|
||||
{
|
||||
u8* dst = gMonSpritesGfxPtr->sprites.byte[GetBattlerPosition(sprite->sBattler)] + (gBattleMonForms[sprite->sBattler] << 11) + (sprite->data[3] << 8);
|
||||
u8 *dst = gMonSpritesGfxPtr->sprites.byte[GetBattlerPosition(sprite->sBattler)] + (gBattleMonForms[sprite->sBattler] << 11) + (sprite->data[3] << 8);
|
||||
|
||||
for (i = 0; i < 0x100; i++)
|
||||
*(dst++) = 0;
|
||||
@@ -2801,14 +2797,14 @@ static void SpriteCB_AnimFaintOpponent(struct Sprite *sprite)
|
||||
}
|
||||
|
||||
// Used when selecting a move, which can hit multiple targets, in double battles.
|
||||
void SpriteCb_ShowAsMoveTarget(struct Sprite *sprite)
|
||||
void SpriteCB_ShowAsMoveTarget(struct Sprite *sprite)
|
||||
{
|
||||
sprite->data[3] = 8;
|
||||
sprite->data[4] = sprite->invisible;
|
||||
sprite->callback = SpriteCb_BlinkVisible;
|
||||
sprite->callback = SpriteCB_BlinkVisible;
|
||||
}
|
||||
|
||||
static void SpriteCb_BlinkVisible(struct Sprite *sprite)
|
||||
static void SpriteCB_BlinkVisible(struct Sprite *sprite)
|
||||
{
|
||||
if (--sprite->data[3] == 0)
|
||||
{
|
||||
@@ -2817,7 +2813,7 @@ static void SpriteCb_BlinkVisible(struct Sprite *sprite)
|
||||
}
|
||||
}
|
||||
|
||||
void SpriteCb_HideAsMoveTarget(struct Sprite *sprite)
|
||||
void SpriteCB_HideAsMoveTarget(struct Sprite *sprite)
|
||||
{
|
||||
sprite->invisible = sprite->data[4];
|
||||
sprite->data[4] = FALSE;
|
||||
@@ -2988,7 +2984,7 @@ static void SpriteCB_TrainerThrowObject_Main(struct Sprite *sprite)
|
||||
sprite->callback = SpriteCB_Idle;
|
||||
}
|
||||
|
||||
// Sprite callback for a trainer back pic to throw an object
|
||||
// Sprite callback for a trainer back pic to throw an object
|
||||
// (Wally throwing a ball, throwing Pokéblocks/balls in the Safari Zone)
|
||||
void SpriteCB_TrainerThrowObject(struct Sprite *sprite)
|
||||
{
|
||||
@@ -3041,13 +3037,13 @@ static void BattleStartClearSetData(void)
|
||||
|
||||
gDisableStructs[i].isFirstTurn = 2;
|
||||
sUnusedBattlersArray[i] = 0;
|
||||
gLastMoves[i] = 0;
|
||||
gLastLandedMoves[i] = 0;
|
||||
gLastMoves[i] = MOVE_NONE;
|
||||
gLastLandedMoves[i] = MOVE_NONE;
|
||||
gLastHitByType[i] = 0;
|
||||
gLastResultingMoves[i] = 0;
|
||||
gLastResultingMoves[i] = MOVE_NONE;
|
||||
gLastHitBy[i] = 0xFF;
|
||||
gLockedMoves[i] = 0;
|
||||
gLastPrintedMoves[i] = 0;
|
||||
gLockedMoves[i] = MOVE_NONE;
|
||||
gLastPrintedMoves[i] = MOVE_NONE;
|
||||
gBattleResources->flags->flags[i] = 0;
|
||||
gPalaceSelectionBattleScripts[i] = 0;
|
||||
}
|
||||
@@ -3108,14 +3104,14 @@ static void BattleStartClearSetData(void)
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
*((u8 *)gBattleStruct->lastTakenMove + i) = 0;
|
||||
*((u8 *)gBattleStruct->usedHeldItems + i) = 0;
|
||||
*((u8 *)gBattleStruct->choicedMove + i) = 0;
|
||||
*((u8 *)gBattleStruct->changedItems + i) = 0;
|
||||
*(i + 0 * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i + 1 * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i + 2 * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i + 3 * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*((u8 *)gBattleStruct->lastTakenMove + i) = MOVE_NONE;
|
||||
*((u8 *)gBattleStruct->usedHeldItems + i) = ITEM_NONE;
|
||||
*((u8 *)gBattleStruct->choicedMove + i) = MOVE_NONE;
|
||||
*((u8 *)gBattleStruct->changedItems + i) = ITEM_NONE;
|
||||
*(i + 0 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i + 1 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i + 2 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i + 3 * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
}
|
||||
|
||||
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
|
||||
@@ -3208,23 +3204,23 @@ void SwitchInClearSetData(void)
|
||||
gMoveResultFlags = 0;
|
||||
gDisableStructs[gActiveBattler].isFirstTurn = 2;
|
||||
gDisableStructs[gActiveBattler].truantSwitchInHack = disableStructCopy.truantSwitchInHack;
|
||||
gLastMoves[gActiveBattler] = 0;
|
||||
gLastLandedMoves[gActiveBattler] = 0;
|
||||
gLastMoves[gActiveBattler] = MOVE_NONE;
|
||||
gLastLandedMoves[gActiveBattler] = MOVE_NONE;
|
||||
gLastHitByType[gActiveBattler] = 0;
|
||||
gLastResultingMoves[gActiveBattler] = 0;
|
||||
gLastPrintedMoves[gActiveBattler] = 0;
|
||||
gLastResultingMoves[gActiveBattler] = MOVE_NONE;
|
||||
gLastPrintedMoves[gActiveBattler] = MOVE_NONE;
|
||||
gLastHitBy[gActiveBattler] = 0xFF;
|
||||
|
||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 0) = 0;
|
||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 1) = 0;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(1 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(1 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(2 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(2 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(3 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(3 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 0) = MOVE_NONE;
|
||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 1) = MOVE_NONE;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(1 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(1 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(2 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(2 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(3 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(3 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
|
||||
gBattleStruct->palaceFlags &= ~(gBitTable[gActiveBattler]);
|
||||
|
||||
@@ -3232,18 +3228,18 @@ void SwitchInClearSetData(void)
|
||||
{
|
||||
if (i != gActiveBattler && GetBattlerSide(i) != GetBattlerSide(gActiveBattler))
|
||||
{
|
||||
*(gBattleStruct->lastTakenMove + i * 2 + 0) = 0;
|
||||
*(gBattleStruct->lastTakenMove + i * 2 + 1) = 0;
|
||||
*(gBattleStruct->lastTakenMove + i * 2 + 0) = MOVE_NONE;
|
||||
*(gBattleStruct->lastTakenMove + i * 2 + 1) = MOVE_NONE;
|
||||
}
|
||||
*(i * 8 + gActiveBattler * 2 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i * 8 + gActiveBattler * 2 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
}
|
||||
|
||||
*(u8*)((u8*)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = 0;
|
||||
*(u8*)((u8*)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = 0;
|
||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = MOVE_NONE;
|
||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = MOVE_NONE;
|
||||
|
||||
gBattleResources->flags->flags[gActiveBattler] = 0;
|
||||
gCurrentMove = 0;
|
||||
gCurrentMove = MOVE_NONE;
|
||||
gBattleStruct->arenaTurnCounter = 0xFF;
|
||||
|
||||
ClearBattlerMoveHistory(gActiveBattler);
|
||||
@@ -3278,48 +3274,48 @@ void FaintClearSetData(void)
|
||||
for (i = 0; i < sizeof(struct DisableStruct); i++)
|
||||
ptr[i] = 0;
|
||||
|
||||
gProtectStructs[gActiveBattler].protected = 0;
|
||||
gProtectStructs[gActiveBattler].endured = 0;
|
||||
gProtectStructs[gActiveBattler].noValidMoves = 0;
|
||||
gProtectStructs[gActiveBattler].helpingHand = 0;
|
||||
gProtectStructs[gActiveBattler].bounceMove = 0;
|
||||
gProtectStructs[gActiveBattler].stealMove = 0;
|
||||
gProtectStructs[gActiveBattler].flag0Unknown = 0;
|
||||
gProtectStructs[gActiveBattler].prlzImmobility = 0;
|
||||
gProtectStructs[gActiveBattler].confusionSelfDmg = 0;
|
||||
gProtectStructs[gActiveBattler].targetNotAffected = 0;
|
||||
gProtectStructs[gActiveBattler].chargingTurn = 0;
|
||||
gProtectStructs[gActiveBattler].protected = FALSE;
|
||||
gProtectStructs[gActiveBattler].endured = FALSE;
|
||||
gProtectStructs[gActiveBattler].noValidMoves = FALSE;
|
||||
gProtectStructs[gActiveBattler].helpingHand = FALSE;
|
||||
gProtectStructs[gActiveBattler].bounceMove = FALSE;
|
||||
gProtectStructs[gActiveBattler].stealMove = FALSE;
|
||||
gProtectStructs[gActiveBattler].flag0Unknown = FALSE;
|
||||
gProtectStructs[gActiveBattler].prlzImmobility = FALSE;
|
||||
gProtectStructs[gActiveBattler].confusionSelfDmg = FALSE;
|
||||
gProtectStructs[gActiveBattler].targetNotAffected = FALSE;
|
||||
gProtectStructs[gActiveBattler].chargingTurn = FALSE;
|
||||
gProtectStructs[gActiveBattler].fleeType = 0;
|
||||
gProtectStructs[gActiveBattler].usedImprisonedMove = 0;
|
||||
gProtectStructs[gActiveBattler].loveImmobility = 0;
|
||||
gProtectStructs[gActiveBattler].usedDisabledMove = 0;
|
||||
gProtectStructs[gActiveBattler].usedTauntedMove = 0;
|
||||
gProtectStructs[gActiveBattler].flag2Unknown = 0;
|
||||
gProtectStructs[gActiveBattler].flinchImmobility = 0;
|
||||
gProtectStructs[gActiveBattler].notFirstStrike = 0;
|
||||
gProtectStructs[gActiveBattler].usedImprisonedMove = FALSE;
|
||||
gProtectStructs[gActiveBattler].loveImmobility = FALSE;
|
||||
gProtectStructs[gActiveBattler].usedDisabledMove = FALSE;
|
||||
gProtectStructs[gActiveBattler].usedTauntedMove = FALSE;
|
||||
gProtectStructs[gActiveBattler].flag2Unknown = FALSE;
|
||||
gProtectStructs[gActiveBattler].flinchImmobility = FALSE;
|
||||
gProtectStructs[gActiveBattler].notFirstStrike = FALSE;
|
||||
|
||||
gDisableStructs[gActiveBattler].isFirstTurn = 2;
|
||||
|
||||
gLastMoves[gActiveBattler] = 0;
|
||||
gLastLandedMoves[gActiveBattler] = 0;
|
||||
gLastMoves[gActiveBattler] = MOVE_NONE;
|
||||
gLastLandedMoves[gActiveBattler] = MOVE_NONE;
|
||||
gLastHitByType[gActiveBattler] = 0;
|
||||
gLastResultingMoves[gActiveBattler] = 0;
|
||||
gLastPrintedMoves[gActiveBattler] = 0;
|
||||
gLastResultingMoves[gActiveBattler] = MOVE_NONE;
|
||||
gLastPrintedMoves[gActiveBattler] = MOVE_NONE;
|
||||
gLastHitBy[gActiveBattler] = 0xFF;
|
||||
|
||||
*(u8*)((u8*)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = 0;
|
||||
*(u8*)((u8*)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = 0;
|
||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 0) = MOVE_NONE;
|
||||
*(u8 *)((u8 *)(&gBattleStruct->choicedMove[gActiveBattler]) + 1) = MOVE_NONE;
|
||||
|
||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 0) = 0;
|
||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 1) = 0;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(1 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(1 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(2 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(2 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(3 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(3 * 2 + gActiveBattler * 8 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 0) = MOVE_NONE;
|
||||
*(gBattleStruct->lastTakenMove + gActiveBattler * 2 + 1) = MOVE_NONE;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(0 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(1 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(1 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(2 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(2 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(3 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(3 * 2 + gActiveBattler * 8 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
|
||||
gBattleStruct->palaceFlags &= ~(gBitTable[gActiveBattler]);
|
||||
|
||||
@@ -3327,11 +3323,11 @@ void FaintClearSetData(void)
|
||||
{
|
||||
if (i != gActiveBattler && GetBattlerSide(i) != GetBattlerSide(gActiveBattler))
|
||||
{
|
||||
*(gBattleStruct->lastTakenMove + i * 2 + 0) = 0;
|
||||
*(gBattleStruct->lastTakenMove + i * 2 + 1) = 0;
|
||||
*(gBattleStruct->lastTakenMove + i * 2 + 0) = MOVE_NONE;
|
||||
*(gBattleStruct->lastTakenMove + i * 2 + 1) = MOVE_NONE;
|
||||
}
|
||||
*(i * 8 + gActiveBattler * 2 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i * 8 + gActiveBattler * 2 + (u8*)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
*(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 0) = 0;
|
||||
*(i * 8 + gActiveBattler * 2 + (u8 *)(gBattleStruct->lastTakenMoveFrom) + 1) = 0;
|
||||
}
|
||||
|
||||
gBattleResources->flags->flags[gActiveBattler] = 0;
|
||||
@@ -3374,8 +3370,8 @@ static void BattleIntroPrepareBackgroundSlide(void)
|
||||
BtlController_EmitIntroSlide(BUFFER_A, gBattleTerrain);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
gBattleMainFunc = BattleIntroDrawTrainersOrMonsSprites;
|
||||
gBattleCommunication[0] = 0;
|
||||
gBattleCommunication[1] = 0;
|
||||
gBattleCommunication[MULTIUSE_STATE] = 0;
|
||||
gBattleCommunication[SPRITES_INIT_STATE1] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3390,7 +3386,7 @@ static void BattleIntroDrawTrainersOrMonsSprites(void)
|
||||
for (gActiveBattler = 0; gActiveBattler < gBattlersCount; gActiveBattler++)
|
||||
{
|
||||
if ((gBattleTypeFlags & BATTLE_TYPE_SAFARI)
|
||||
&& GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
||||
&& GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
||||
{
|
||||
ptr = (u8 *)&gBattleMons[gActiveBattler];
|
||||
for (i = 0; i < sizeof(struct BattlePokemon); i++)
|
||||
@@ -3398,7 +3394,7 @@ static void BattleIntroDrawTrainersOrMonsSprites(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
u16* hpOnSwitchout;
|
||||
u16 *hpOnSwitchout;
|
||||
|
||||
ptr = (u8 *)&gBattleMons[gActiveBattler];
|
||||
for (i = 0; i < sizeof(struct BattlePokemon); i++)
|
||||
@@ -3548,7 +3544,6 @@ static void BattleIntroDrawPartySummaryScreens(void)
|
||||
|
||||
gBattleMainFunc = BattleIntroPrintWildMonAttacked;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void BattleIntroPrintTrainerWantsToBattle(void)
|
||||
@@ -3842,7 +3837,7 @@ static void TryDoEventsBeforeFirstTurn(void)
|
||||
|
||||
gBattleStruct->switchInAbilitiesCounter++;
|
||||
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
return;
|
||||
}
|
||||
if (AbilityBattleEffects(ABILITYEFFECT_INTIMIDATE1, 0, 0, 0, 0) != 0)
|
||||
@@ -3857,7 +3852,7 @@ static void TryDoEventsBeforeFirstTurn(void)
|
||||
|
||||
gBattleStruct->switchInItemsCounter++;
|
||||
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
return;
|
||||
}
|
||||
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
|
||||
@@ -4000,11 +3995,11 @@ u8 IsRunningFromBattleImpossible(void)
|
||||
gPotentialItemEffectBattler = gActiveBattler;
|
||||
|
||||
if (holdEffect == HOLD_EFFECT_CAN_ALWAYS_RUN)
|
||||
return 0;
|
||||
return BATTLE_RUN_SUCCESS;
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_LINK)
|
||||
return 0;
|
||||
return BATTLE_RUN_SUCCESS;
|
||||
if (gBattleMons[gActiveBattler].ability == ABILITY_RUN_AWAY)
|
||||
return 0;
|
||||
return BATTLE_RUN_SUCCESS;
|
||||
|
||||
side = GetBattlerSide(gActiveBattler);
|
||||
|
||||
@@ -4016,7 +4011,7 @@ u8 IsRunningFromBattleImpossible(void)
|
||||
gBattleScripting.battler = i;
|
||||
gLastUsedAbility = gBattleMons[i].ability;
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PREVENTS_ESCAPE;
|
||||
return 2;
|
||||
return BATTLE_RUN_FAILURE;
|
||||
}
|
||||
if (side != GetBattlerSide(i)
|
||||
&& gBattleMons[gActiveBattler].ability != ABILITY_LEVITATE
|
||||
@@ -4026,7 +4021,7 @@ u8 IsRunningFromBattleImpossible(void)
|
||||
gBattleScripting.battler = i;
|
||||
gLastUsedAbility = gBattleMons[i].ability;
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PREVENTS_ESCAPE;
|
||||
return 2;
|
||||
return BATTLE_RUN_FAILURE;
|
||||
}
|
||||
}
|
||||
i = AbilityBattleEffects(ABILITYEFFECT_CHECK_FIELD_EXCEPT_BATTLER, gActiveBattler, ABILITY_MAGNET_PULL, 0, 0);
|
||||
@@ -4035,20 +4030,20 @@ u8 IsRunningFromBattleImpossible(void)
|
||||
gBattleScripting.battler = i - 1;
|
||||
gLastUsedAbility = gBattleMons[i - 1].ability;
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PREVENTS_ESCAPE;
|
||||
return 2;
|
||||
return BATTLE_RUN_FAILURE;
|
||||
}
|
||||
if ((gBattleMons[gActiveBattler].status2 & (STATUS2_ESCAPE_PREVENTION | STATUS2_WRAPPED))
|
||||
|| (gStatuses3[gActiveBattler] & STATUS3_ROOTED))
|
||||
{
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CANT_ESCAPE;
|
||||
return 1;
|
||||
return BATTLE_RUN_FORBIDDEN;
|
||||
}
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE)
|
||||
{
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_DONT_LEAVE_BIRCH;
|
||||
return 1;
|
||||
return BATTLE_RUN_FORBIDDEN;
|
||||
}
|
||||
return 0;
|
||||
return BATTLE_RUN_SUCCESS;
|
||||
}
|
||||
|
||||
void SwitchPartyOrder(u8 battler)
|
||||
@@ -4058,7 +4053,7 @@ void SwitchPartyOrder(u8 battler)
|
||||
u8 partyId2;
|
||||
|
||||
for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++)
|
||||
gBattlePartyCurrentOrder[i] = *(battler * 3 + i + (u8*)(gBattleStruct->battlerPartyOrders));
|
||||
gBattlePartyCurrentOrder[i] = *(battler * 3 + i + (u8 *)(gBattleStruct->battlerPartyOrders));
|
||||
|
||||
partyId1 = GetPartyIdFromBattlePartyId(gBattlerPartyIndexes[battler]);
|
||||
partyId2 = GetPartyIdFromBattlePartyId(*(gBattleStruct->monToSwitchIntoId + battler));
|
||||
@@ -4068,15 +4063,15 @@ void SwitchPartyOrder(u8 battler)
|
||||
{
|
||||
for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++)
|
||||
{
|
||||
*(battler * 3 + i + (u8*)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i];
|
||||
*(BATTLE_PARTNER(battler) * 3 + i + (u8*)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i];
|
||||
*(battler * 3 + i + (u8 *)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i];
|
||||
*(BATTLE_PARTNER(battler) * 3 + i + (u8 *)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++)
|
||||
{
|
||||
*(battler * 3 + i + (u8*)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i];
|
||||
*(battler * 3 + i + (u8 *)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4304,7 +4299,7 @@ static void HandleTurnActionSelectionState(void)
|
||||
BattleScriptExecute(BattleScript_PrintCantRunFromTrainer);
|
||||
gBattleCommunication[gActiveBattler] = STATE_BEFORE_ACTION_CHOSEN;
|
||||
}
|
||||
else if (IsRunningFromBattleImpossible()
|
||||
else if (IsRunningFromBattleImpossible() != BATTLE_RUN_SUCCESS
|
||||
&& gBattleBufferB[gActiveBattler][1] == B_ACTION_RUN)
|
||||
{
|
||||
gSelectionBattleScripts[gActiveBattler] = BattleScript_PrintCantEscapeFromBattle;
|
||||
@@ -4437,7 +4432,7 @@ static void HandleTurnActionSelectionState(void)
|
||||
|
||||
if (((gBattleTypeFlags & BATTLE_TYPE_MULTI) || !(gBattleTypeFlags & BATTLE_TYPE_DOUBLE))
|
||||
|| (position & BIT_FLANK) != B_FLANK_LEFT
|
||||
|| (*(&gBattleStruct->absentBattlerFlags) & gBitTable[GetBattlerAtPosition(position ^ BIT_FLANK)]))
|
||||
|| (*(&gBattleStruct->absentBattlerFlags) & gBitTable[GetBattlerAtPosition(BATTLE_PARTNER(position))]))
|
||||
{
|
||||
BtlController_EmitLinkStandbyMsg(BUFFER_A, LINK_STANDBY_MSG_STOP_BOUNCE, i);
|
||||
}
|
||||
@@ -4546,13 +4541,13 @@ static void UpdateBattlerPartyOrdersOnSwitch(void)
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_LINK && gBattleTypeFlags & BATTLE_TYPE_MULTI)
|
||||
{
|
||||
*(gActiveBattler * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 0) &= 0xF;
|
||||
*(gActiveBattler * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0);
|
||||
*(gActiveBattler * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 1) = gBattleBufferB[gActiveBattler][3];
|
||||
*(gActiveBattler * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) &= 0xF;
|
||||
*(gActiveBattler * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0);
|
||||
*(gActiveBattler * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 1) = gBattleBufferB[gActiveBattler][3];
|
||||
|
||||
*((gActiveBattler ^ BIT_FLANK) * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 0) &= (0xF0);
|
||||
*((gActiveBattler ^ BIT_FLANK) * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0) >> 4;
|
||||
*((gActiveBattler ^ BIT_FLANK) * 3 + (u8*)(gBattleStruct->battlerPartyOrders) + 2) = gBattleBufferB[gActiveBattler][3];
|
||||
*((BATTLE_PARTNER(gActiveBattler)) * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) &= (0xF0);
|
||||
*((BATTLE_PARTNER(gActiveBattler)) * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 0) |= (gBattleBufferB[gActiveBattler][2] & 0xF0) >> 4;
|
||||
*((BATTLE_PARTNER(gActiveBattler)) * 3 + (u8 *)(gBattleStruct->battlerPartyOrders) + 2) = gBattleBufferB[gActiveBattler][3];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4834,7 +4829,7 @@ static void TurnValuesCleanUp(bool8 var0)
|
||||
}
|
||||
else
|
||||
{
|
||||
dataPtr = (u8*)(&gProtectStructs[gActiveBattler]);
|
||||
dataPtr = (u8 *)(&gProtectStructs[gActiveBattler]);
|
||||
for (i = 0; i < sizeof(struct ProtectStruct); i++)
|
||||
dataPtr[i] = 0;
|
||||
|
||||
@@ -4862,7 +4857,7 @@ void SpecialStatusesClear(void)
|
||||
for (gActiveBattler = 0; gActiveBattler < gBattlersCount; gActiveBattler++)
|
||||
{
|
||||
s32 i;
|
||||
u8 *dataPtr = (u8*)(&gSpecialStatuses[gActiveBattler]);
|
||||
u8 *dataPtr = (u8 *)(&gSpecialStatuses[gActiveBattler]);
|
||||
|
||||
for (i = 0; i < sizeof(struct SpecialStatus); i++)
|
||||
dataPtr[i] = 0;
|
||||
@@ -5188,7 +5183,7 @@ static void ReturnFromBattleToOverworld(void)
|
||||
PartySpreadPokerus(gPlayerParty);
|
||||
}
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_LINK && gReceivedRemoteLinkPlayers != 0)
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_LINK && gReceivedRemoteLinkPlayers)
|
||||
return;
|
||||
|
||||
gSpecialVar_Result = gBattleOutcome;
|
||||
|
||||
+22
-22
@@ -1010,7 +1010,7 @@ const u16 gStatUpStringIds[] =
|
||||
[B_MSG_STAT_WONT_INCREASE] = STRINGID_STATSWONTINCREASE,
|
||||
[B_MSG_STAT_ROSE_EMPTY] = STRINGID_EMPTYSTRING3,
|
||||
[B_MSG_STAT_ROSE_ITEM] = STRINGID_USINGITEMSTATOFPKMNROSE,
|
||||
[B_MSG_USED_DIRE_HIT] = STRINGID_PKMNUSEDXTOGETPUMPED,
|
||||
[B_MSG_USED_DIRE_HIT] = STRINGID_PKMNUSEDXTOGETPUMPED,
|
||||
};
|
||||
|
||||
const u16 gStatDownStringIds[] =
|
||||
@@ -1035,7 +1035,7 @@ const u16 gFirstTurnOfTwoStringIds[] =
|
||||
};
|
||||
|
||||
// Index copied from move's index in gTrappingMoves
|
||||
const u16 gWrappedStringIds[] =
|
||||
const u16 gWrappedStringIds[NUM_TRAPPING_MOVES] =
|
||||
{
|
||||
STRINGID_PKMNSQUEEZEDBYBIND, // MOVE_BIND
|
||||
STRINGID_PKMNWRAPPEDBY, // MOVE_WRAP
|
||||
@@ -1253,7 +1253,7 @@ const u16 gCaughtMonStringIds[] =
|
||||
[B_MSG_LANETTES_BOX_FULL] = STRINGID_PKMNBOXLANETTESPCFULL,
|
||||
};
|
||||
|
||||
const u16 gTrappingMoves[] =
|
||||
const u16 gTrappingMoves[NUM_TRAPPING_MOVES + 1] =
|
||||
{
|
||||
MOVE_BIND,
|
||||
MOVE_WRAP,
|
||||
@@ -1261,7 +1261,7 @@ const u16 gTrappingMoves[] =
|
||||
MOVE_CLAMP,
|
||||
MOVE_WHIRLPOOL,
|
||||
MOVE_SAND_TOMB,
|
||||
0xFFFF
|
||||
0xFFFF // Never read
|
||||
};
|
||||
|
||||
const u8 gText_PkmnIsEvolving[] = _("What?\n{STR_VAR_1} is evolving!");
|
||||
@@ -1371,7 +1371,7 @@ const u8 gText_OpponentMon1Name[] = _("{B_OPPONENT_MON1_NAME}");
|
||||
const u8 gText_Mind[] = _("Mind");
|
||||
const u8 gText_Skill[] = _("Skill");
|
||||
const u8 gText_Body[] = _("Body");
|
||||
const u8 gText_Judgement[] = _("{B_BUFF1}{CLEAR 13}Judgment{CLEAR 13}{B_BUFF2}");
|
||||
const u8 gText_Judgment[] = _("{B_BUFF1}{CLEAR 13}Judgment{CLEAR 13}{B_BUFF2}");
|
||||
static const u8 sText_TwoTrainersSentPkmn[] = _("{B_TRAINER1_CLASS} {B_TRAINER1_NAME} sent\nout {B_OPPONENT_MON1_NAME}!\p{B_TRAINER2_CLASS} {B_TRAINER2_NAME} sent\nout {B_OPPONENT_MON2_NAME}!");
|
||||
static const u8 sText_Trainer2SentOutPkmn[] = _("{B_TRAINER2_CLASS} {B_TRAINER2_NAME} sent\nout {B_BUFF1}!");
|
||||
static const u8 sText_TwoTrainersWantToBattle[] = _("{B_TRAINER1_CLASS} {B_TRAINER1_NAME} and\n{B_TRAINER2_CLASS} {B_TRAINER2_NAME}\lwant to battle!\p");
|
||||
@@ -2020,7 +2020,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] =
|
||||
.bgColor = TEXT_DYNAMIC_COLOR_5,
|
||||
.shadowColor = TEXT_DYNAMIC_COLOR_6,
|
||||
},
|
||||
[ARENA_WIN_JUDGEMENT_TITLE] = {
|
||||
[ARENA_WIN_JUDGMENT_TITLE] = {
|
||||
.fillValue = PIXEL_FILL(0xE),
|
||||
.fontId = FONT_NORMAL,
|
||||
.x = -1,
|
||||
@@ -2032,7 +2032,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] =
|
||||
.bgColor = TEXT_DYNAMIC_COLOR_5,
|
||||
.shadowColor = TEXT_DYNAMIC_COLOR_6,
|
||||
},
|
||||
[ARENA_WIN_JUDGEMENT_TEXT] = {
|
||||
[ARENA_WIN_JUDGMENT_TEXT] = {
|
||||
.fillValue = PIXEL_FILL(0x1),
|
||||
.fontId = FONT_NORMAL,
|
||||
.x = 0,
|
||||
@@ -2059,11 +2059,11 @@ void BufferStringBattle(u16 stringID)
|
||||
s32 i;
|
||||
const u8 *stringPtr = NULL;
|
||||
|
||||
gBattleMsgDataPtr = (struct BattleMsgData*)(&gBattleBufferA[gActiveBattler][4]);
|
||||
gBattleMsgDataPtr = (struct BattleMsgData *)(&gBattleBufferA[gActiveBattler][4]);
|
||||
gLastUsedItem = gBattleMsgDataPtr->lastItem;
|
||||
gLastUsedAbility = gBattleMsgDataPtr->lastAbility;
|
||||
gBattleScripting.battler = gBattleMsgDataPtr->scrActive;
|
||||
*(&gBattleStruct->field_52) = gBattleMsgDataPtr->unk1605E;
|
||||
*(&gBattleStruct->scriptPartyIdx) = gBattleMsgDataPtr->bakScriptPartyIdx;
|
||||
*(&gBattleStruct->hpScale) = gBattleMsgDataPtr->hpScale;
|
||||
gPotentialItemEffectBattler = gBattleMsgDataPtr->itemEffectBattler;
|
||||
*(&gBattleStruct->stringMoveType) = gBattleMsgDataPtr->moveType;
|
||||
@@ -2346,17 +2346,17 @@ void BufferStringBattle(u16 stringID)
|
||||
BattleStringExpandPlaceholdersToDisplayedString(stringPtr);
|
||||
}
|
||||
|
||||
u32 BattleStringExpandPlaceholdersToDisplayedString(const u8* src)
|
||||
u32 BattleStringExpandPlaceholdersToDisplayedString(const u8 *src)
|
||||
{
|
||||
BattleStringExpandPlaceholders(src, gDisplayedStringBattle);
|
||||
}
|
||||
|
||||
static const u8* TryGetStatusString(u8 *src)
|
||||
static const u8 *TryGetStatusString(u8 *src)
|
||||
{
|
||||
u32 i;
|
||||
u8 status[8];
|
||||
u32 chars1, chars2;
|
||||
u8* statusPtr;
|
||||
u8 *statusPtr;
|
||||
|
||||
memcpy(status, sDummyWeirdStatusString, 8);
|
||||
|
||||
@@ -2369,13 +2369,13 @@ static const u8* TryGetStatusString(u8 *src)
|
||||
statusPtr++;
|
||||
}
|
||||
|
||||
chars1 = *(u32*)(&status[0]);
|
||||
chars2 = *(u32*)(&status[4]);
|
||||
chars1 = *(u32 *)(&status[0]);
|
||||
chars2 = *(u32 *)(&status[4]);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(gStatusConditionStringsTable); i++)
|
||||
{
|
||||
if (chars1 == *(u32*)(&gStatusConditionStringsTable[i][0][0])
|
||||
&& chars2 == *(u32*)(&gStatusConditionStringsTable[i][0][4]))
|
||||
if (chars1 == *(u32 *)(&gStatusConditionStringsTable[i][0][0])
|
||||
&& chars2 == *(u32 *)(&gStatusConditionStringsTable[i][0][4]))
|
||||
return gStatusConditionStringsTable[i][1];
|
||||
}
|
||||
return NULL;
|
||||
@@ -2713,7 +2713,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
|
||||
}
|
||||
break;
|
||||
case B_TXT_26: // ?
|
||||
HANDLE_NICKNAME_STRING_CASE(gBattleScripting.battler, *(&gBattleStruct->field_52))
|
||||
HANDLE_NICKNAME_STRING_CASE(gBattleScripting.battler, *(&gBattleStruct->scriptPartyIdx))
|
||||
break;
|
||||
case B_TXT_PC_CREATOR_NAME: // lanette pc
|
||||
if (FlagGet(FLAG_SYS_PC_LANETTE))
|
||||
@@ -2966,7 +2966,7 @@ static void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst)
|
||||
// unused, since the value loaded into the buffer is not read; it loaded one of
|
||||
// two particles (either "は" or "の") which works in tandem with ChooseTypeOfMoveUsedString
|
||||
// below to effect changes in the meaning of the line.
|
||||
static void ChooseMoveUsedParticle(u8* textBuff)
|
||||
static void ChooseMoveUsedParticle(u8 *textBuff)
|
||||
{
|
||||
s32 counter = 0;
|
||||
u32 i = 0;
|
||||
@@ -3006,7 +3006,7 @@ static void ChooseMoveUsedParticle(u8* textBuff)
|
||||
//
|
||||
// sText_ExclamationMark5 was " こうげき!" This resulted in a translation of
|
||||
// "<NAME>'s <ATTACK> attack!".
|
||||
static void ChooseTypeOfMoveUsedString(u8* dst)
|
||||
static void ChooseTypeOfMoveUsedString(u8 *dst)
|
||||
{
|
||||
s32 counter = 0;
|
||||
s32 i = 0;
|
||||
@@ -3081,7 +3081,7 @@ void BattlePutTextOnWindow(const u8 *text, u8 windowId)
|
||||
printerTemplate.x = printerTemplate.currentX = alignX;
|
||||
}
|
||||
|
||||
if (windowId == ARENA_WIN_JUDGEMENT_TEXT)
|
||||
if (windowId == ARENA_WIN_JUDGMENT_TEXT)
|
||||
gTextFlags.useAlternateDownArrow = FALSE;
|
||||
else
|
||||
gTextFlags.useAlternateDownArrow = TRUE;
|
||||
@@ -3091,7 +3091,7 @@ void BattlePutTextOnWindow(const u8 *text, u8 windowId)
|
||||
else
|
||||
gTextFlags.autoScroll = FALSE;
|
||||
|
||||
if (windowId == B_WIN_MSG || windowId == ARENA_WIN_JUDGEMENT_TEXT)
|
||||
if (windowId == B_WIN_MSG || windowId == ARENA_WIN_JUDGMENT_TEXT)
|
||||
{
|
||||
if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_RECORDED_LINK))
|
||||
speed = 1;
|
||||
@@ -3119,7 +3119,7 @@ void BattlePutTextOnWindow(const u8 *text, u8 windowId)
|
||||
|
||||
void SetPpNumbersPaletteInMoveSelection(void)
|
||||
{
|
||||
struct ChooseMoveStruct *chooseMoveStruct = (struct ChooseMoveStruct*)(&gBattleBufferA[gActiveBattler][4]);
|
||||
struct ChooseMoveStruct *chooseMoveStruct = (struct ChooseMoveStruct *)(&gBattleBufferA[gActiveBattler][4]);
|
||||
const u16 *palPtr = gPPTextPalette;
|
||||
u8 var = GetCurrentPpToMaxPpState(chooseMoveStruct->currentPp[gMoveSelectionCursor[gActiveBattler]],
|
||||
chooseMoveStruct->maxPp[gMoveSelectionCursor[gActiveBattler]]);
|
||||
|
||||
+19
-19
@@ -684,7 +684,7 @@ static void SetBattlePikeData(void)
|
||||
|
||||
static void IsNextRoomFinal(void)
|
||||
{
|
||||
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum > 14)
|
||||
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum > NUM_PIKE_ROOMS)
|
||||
gSpecialVar_Result = TRUE;
|
||||
else
|
||||
gSpecialVar_Result = FALSE;
|
||||
@@ -1084,7 +1084,7 @@ static u8 GetNextRoomType(void)
|
||||
}
|
||||
|
||||
nextRoomType = roomCandidates[Random() % numRoomCandidates];
|
||||
free(roomCandidates);
|
||||
Free(roomCandidates);
|
||||
if (nextRoomType == PIKE_ROOM_STATUS)
|
||||
TryInflictRandomStatus();
|
||||
|
||||
@@ -1117,20 +1117,20 @@ bool32 TryGenerateBattlePikeWildMon(bool8 checkKeenEyeIntimidate)
|
||||
if (gSaveBlock2Ptr->frontier.lvlMode != FRONTIER_LVL_50)
|
||||
{
|
||||
monLevel = GetHighestLevelInPlayerParty();
|
||||
if (monLevel < 60)
|
||||
if (monLevel < FRONTIER_MIN_LEVEL_OPEN)
|
||||
{
|
||||
monLevel = 60;
|
||||
monLevel = FRONTIER_MIN_LEVEL_OPEN;
|
||||
}
|
||||
else
|
||||
{
|
||||
monLevel -= wildMons[headerId][pikeMonId].levelDelta;
|
||||
if (monLevel < 60)
|
||||
monLevel = 60;
|
||||
if (monLevel < FRONTIER_MIN_LEVEL_OPEN)
|
||||
monLevel = FRONTIER_MIN_LEVEL_OPEN;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
monLevel = 50 - wildMons[headerId][pikeMonId].levelDelta;
|
||||
monLevel = FRONTIER_MAX_LEVEL_50 - wildMons[headerId][pikeMonId].levelDelta;
|
||||
}
|
||||
|
||||
if (checkKeenEyeIntimidate == TRUE && !CanEncounterWildMon(monLevel))
|
||||
@@ -1158,11 +1158,11 @@ u8 GetBattlePikeWildMonHeaderId(void)
|
||||
u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
|
||||
u16 winStreak = gSaveBlock2Ptr->frontier.pikeWinStreaks[lvlMode];
|
||||
|
||||
if (winStreak <= 280)
|
||||
if (winStreak <= 20 * NUM_PIKE_ROOMS)
|
||||
headerId = 0;
|
||||
else if (winStreak <= 560)
|
||||
else if (winStreak <= 40 * NUM_PIKE_ROOMS)
|
||||
headerId = 1;
|
||||
else if (winStreak <= 840)
|
||||
else if (winStreak <= 60 * NUM_PIKE_ROOMS)
|
||||
headerId = 2;
|
||||
else
|
||||
headerId = 3;
|
||||
@@ -1251,7 +1251,7 @@ static void Task_DoStatusInflictionScreenFlash(u8 taskId)
|
||||
{
|
||||
if (IsStatusInflictionScreenFlashTaskFinished())
|
||||
{
|
||||
EnableBothScriptContexts();
|
||||
ScriptContext_Enable();
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
}
|
||||
@@ -1363,7 +1363,7 @@ static void SetHintedRoom(void)
|
||||
}
|
||||
|
||||
gSaveBlock2Ptr->frontier.pikeHintedRoomType = roomCandidates[Random() % count];
|
||||
free(roomCandidates);
|
||||
Free(roomCandidates);
|
||||
if (gSaveBlock2Ptr->frontier.pikeHintedRoomType == PIKE_ROOM_STATUS && !AtLeastOneHealthyMon())
|
||||
gSaveBlock2Ptr->frontier.pikeHintedRoomType = PIKE_ROOM_NPC;
|
||||
if (gSaveBlock2Ptr->frontier.pikeHintedRoomType == PIKE_ROOM_DOUBLE_BATTLE && !AtLeastTwoAliveMons())
|
||||
@@ -1392,10 +1392,10 @@ static void PrepareOneTrainer(bool8 difficult)
|
||||
if (!difficult)
|
||||
battleNum = 1;
|
||||
else
|
||||
battleNum = 6;
|
||||
battleNum = FRONTIER_STAGES_PER_CHALLENGE - 1;
|
||||
|
||||
lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
|
||||
challengeNum = gSaveBlock2Ptr->frontier.pikeWinStreaks[lvlMode] / 14;
|
||||
challengeNum = gSaveBlock2Ptr->frontier.pikeWinStreaks[lvlMode] / NUM_PIKE_ROOMS;
|
||||
do
|
||||
{
|
||||
trainerId = GetRandomScaledFrontierTrainerId(challengeNum, battleNum);
|
||||
@@ -1409,7 +1409,7 @@ static void PrepareOneTrainer(bool8 difficult)
|
||||
gTrainerBattleOpponent_A = trainerId;
|
||||
gFacilityTrainers = gBattleFrontierTrainers;
|
||||
SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0);
|
||||
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < 14)
|
||||
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < NUM_PIKE_ROOMS)
|
||||
gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum - 1] = gTrainerBattleOpponent_A;
|
||||
}
|
||||
|
||||
@@ -1418,7 +1418,7 @@ static void PrepareTwoTrainers(void)
|
||||
int i;
|
||||
u16 trainerId;
|
||||
u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
|
||||
u16 challengeNum = gSaveBlock2Ptr->frontier.pikeWinStreaks[lvlMode] / 14;
|
||||
u16 challengeNum = gSaveBlock2Ptr->frontier.pikeWinStreaks[lvlMode] / NUM_PIKE_ROOMS;
|
||||
|
||||
gFacilityTrainers = gBattleFrontierTrainers;
|
||||
do
|
||||
@@ -1433,7 +1433,7 @@ static void PrepareTwoTrainers(void)
|
||||
|
||||
gTrainerBattleOpponent_A = trainerId;
|
||||
SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0);
|
||||
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum <= 14)
|
||||
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum <= NUM_PIKE_ROOMS)
|
||||
gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum - 1] = gTrainerBattleOpponent_A;
|
||||
|
||||
do
|
||||
@@ -1448,7 +1448,7 @@ static void PrepareTwoTrainers(void)
|
||||
|
||||
gTrainerBattleOpponent_B = trainerId;
|
||||
SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_B, 1);
|
||||
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < 14)
|
||||
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < NUM_PIKE_ROOMS)
|
||||
gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum - 2] = gTrainerBattleOpponent_B;
|
||||
}
|
||||
|
||||
@@ -1456,7 +1456,7 @@ static void ClearPikeTrainerIds(void)
|
||||
{
|
||||
u8 i;
|
||||
|
||||
for (i = 0; i < 14; i++)
|
||||
for (i = 0; i < NUM_PIKE_ROOMS; i++)
|
||||
gSaveBlock2Ptr->frontier.trainerIds[i] = 0xFFFF;
|
||||
}
|
||||
|
||||
|
||||
+50
-50
@@ -83,18 +83,18 @@ static void ClearPyramidPartyHeldItems(void);
|
||||
static void SetPyramidFloorPalette(void);
|
||||
static void BattlePyramidStartMenu(void);
|
||||
static void RestorePyramidPlayerParty(void);
|
||||
static void InitPyramidBagItems(u8 lvlMode);
|
||||
static void InitPyramidBagItems(u8);
|
||||
static u8 GetPyramidFloorTemplateId(void);
|
||||
static u8 GetPostBattleDirectionHintTextIndex(int *, u8, u8);
|
||||
static void Task_SetPyramidFloorPalette(u8 taskId);
|
||||
static void MarkPyramidTrainerAsBattled(u16 trainerId);
|
||||
static void GetPyramidFloorLayoutOffsets(u8 *layoutOffsets);
|
||||
static void Task_SetPyramidFloorPalette(u8);
|
||||
static void MarkPyramidTrainerAsBattled(u16);
|
||||
static void GetPyramidFloorLayoutOffsets(u8 *);
|
||||
static void GetPyramidEntranceAndExitSquareIds(u8 *, u8 *);
|
||||
static void SetPyramidObjectPositionsUniformly(u8);
|
||||
static bool8 SetPyramidObjectPositionsInAndNearSquare(u8, u8);
|
||||
static bool8 SetPyramidObjectPositionsNearSquare(u8, u8);
|
||||
static bool8 TrySetPyramidObjectEventPositionInSquare(u8 arg0, u8 *floorLayoutOffsets, u8 squareId, u8 objectEventId);
|
||||
static bool8 TrySetPyramidObjectEventPositionAtCoords(bool8 objType, u8 x, u8 y, u8 *floorLayoutOffsets, u8 squareId, u8 objectEventId);
|
||||
static bool8 TrySetPyramidObjectEventPositionInSquare(u8, u8 *, u8, u8);
|
||||
static bool8 TrySetPyramidObjectEventPositionAtCoords(bool8, u8, u8, u8 *, u8, u8);
|
||||
|
||||
// Const rom data.
|
||||
#define ABILITY_RANDOM 2 // For wild mons data.
|
||||
@@ -279,9 +279,9 @@ static const u8 sPyramidFloorTemplateOptions[][2] =
|
||||
{100, 15}
|
||||
};
|
||||
|
||||
static const u8 sFloorTemplateOffsets[] =
|
||||
static const u8 sFloorTemplateOffsets[FRONTIER_STAGES_PER_CHALLENGE] =
|
||||
{
|
||||
0, 4, 9, 14, 19, 24, 29, 0
|
||||
0, 4, 9, 14, 19, 24, 29
|
||||
};
|
||||
|
||||
static const u16 sPickupItemsLvl50[TOTAL_ROUNDS][PICKUP_ITEMS_PER_ROUND] =
|
||||
@@ -406,7 +406,7 @@ static const u8 sPickupItemSlots[][2] =
|
||||
{100, 9},
|
||||
};
|
||||
|
||||
static const u8 sPickupItemOffsets[] = {0, 9, 18, 27, 36, 45, 54};
|
||||
static const u8 sPickupItemOffsets[FRONTIER_STAGES_PER_CHALLENGE] = {0, 9, 18, 27, 36, 45, 54};
|
||||
|
||||
static const struct PyramidTrainerEncounterMusic sTrainerClassEncounterMusic[54] =
|
||||
{
|
||||
@@ -963,7 +963,7 @@ static void SeedPyramidFloor(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
for (i = 0; i < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.pyramidRandoms); i++)
|
||||
gSaveBlock2Ptr->frontier.pyramidRandoms[i] = Random();
|
||||
|
||||
gSaveBlock2Ptr->frontier.pyramidTrainerFlags = 0;
|
||||
@@ -977,7 +977,7 @@ static void SetPickupItem(void)
|
||||
u8 id;
|
||||
u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
|
||||
u32 floor = gSaveBlock2Ptr->frontier.curChallengeBattleNum;
|
||||
u32 round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / 7) % TOTAL_ROUNDS;
|
||||
u32 round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / FRONTIER_STAGES_PER_CHALLENGE) % TOTAL_ROUNDS;
|
||||
|
||||
if (round >= TOTAL_ROUNDS)
|
||||
round = TOTAL_ROUNDS - 1;
|
||||
@@ -1016,8 +1016,8 @@ static void HidePyramidItem(void)
|
||||
{
|
||||
// Rather than using event flags to hide the item object event,
|
||||
// it moves them far off the map bounds.
|
||||
events[i].x = 0x7FFF;
|
||||
events[i].y = 0x7FFF;
|
||||
events[i].x = SHRT_MAX;
|
||||
events[i].y = SHRT_MAX;
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
@@ -1063,7 +1063,7 @@ static void ShowPostBattleHintText(void)
|
||||
case HINT_REMAINING_ITEMS:
|
||||
for (i = 0; i < GetNumBattlePyramidObjectEvents(); i++)
|
||||
{
|
||||
if (events[i].graphicsId == OBJ_EVENT_GFX_ITEM_BALL && events[i].x != 0x7FFF && events[i].y != 0x7FFF)
|
||||
if (events[i].graphicsId == OBJ_EVENT_GFX_ITEM_BALL && events[i].x != SHRT_MAX && events[i].y != SHRT_MAX)
|
||||
textIndex++;
|
||||
}
|
||||
i = 1;
|
||||
@@ -1071,7 +1071,7 @@ static void ShowPostBattleHintText(void)
|
||||
case HINT_REMAINING_TRAINERS:
|
||||
id = GetPyramidFloorTemplateId();
|
||||
textIndex = sPyramidFloorTemplates[id].numTrainers;
|
||||
for (i = 0; i < 8; i++)
|
||||
for (i = 0; i < MAX_PYRAMID_TRAINERS; i++)
|
||||
{
|
||||
if (gBitTable[i] & gSaveBlock2Ptr->frontier.pyramidTrainerFlags)
|
||||
textIndex--;
|
||||
@@ -1326,7 +1326,7 @@ static void MarkPyramidTrainerAsBattled(u16 trainerId)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
for (i = 0; i < MAX_PYRAMID_TRAINERS; i++)
|
||||
{
|
||||
if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId)
|
||||
gSaveBlock2Ptr->frontier.pyramidTrainerFlags |= gBitTable[i];
|
||||
@@ -1345,7 +1345,7 @@ void GenerateBattlePyramidWildMon(void)
|
||||
const struct PyramidWildMon *wildMons;
|
||||
u32 id;
|
||||
u32 lvl = gSaveBlock2Ptr->frontier.lvlMode;
|
||||
u16 round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvl] / 7) % TOTAL_ROUNDS;
|
||||
u16 round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvl] / FRONTIER_STAGES_PER_CHALLENGE) % TOTAL_ROUNDS;
|
||||
|
||||
if (round >= TOTAL_ROUNDS)
|
||||
round = TOTAL_ROUNDS - 1;
|
||||
@@ -1480,7 +1480,7 @@ u8 GetTrainerEncounterMusicIdInBattlePyramid(u16 trainerId)
|
||||
// Unused
|
||||
static void BattlePyramidRetireChallenge(void)
|
||||
{
|
||||
ScriptContext1_SetupScript(BattlePyramid_Retire);
|
||||
ScriptContext_SetupScript(BattlePyramid_Retire);
|
||||
}
|
||||
|
||||
static u16 GetUniqueTrainerId(u8 objectEventId)
|
||||
@@ -1488,13 +1488,13 @@ static u16 GetUniqueTrainerId(u8 objectEventId)
|
||||
int i;
|
||||
u16 trainerId;
|
||||
u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
|
||||
u32 challengeNum = gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / 7;
|
||||
u32 battleNum = gSaveBlock2Ptr->frontier.curChallengeBattleNum;
|
||||
if (battleNum == 7)
|
||||
u32 challengeNum = gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / FRONTIER_STAGES_PER_CHALLENGE;
|
||||
u32 floor = gSaveBlock2Ptr->frontier.curChallengeBattleNum;
|
||||
if (floor == FRONTIER_STAGES_PER_CHALLENGE)
|
||||
{
|
||||
do
|
||||
{
|
||||
trainerId = GetRandomScaledFrontierTrainerId(challengeNum + 1, battleNum);
|
||||
trainerId = GetRandomScaledFrontierTrainerId(challengeNum + 1, floor);
|
||||
for (i = 0; i < objectEventId; i++)
|
||||
{
|
||||
if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId)
|
||||
@@ -1506,7 +1506,7 @@ static u16 GetUniqueTrainerId(u8 objectEventId)
|
||||
{
|
||||
do
|
||||
{
|
||||
trainerId = GetRandomScaledFrontierTrainerId(challengeNum, battleNum);
|
||||
trainerId = GetRandomScaledFrontierTrainerId(challengeNum, floor);
|
||||
for (i = 0; i < objectEventId; i++)
|
||||
{
|
||||
if (gSaveBlock2Ptr->frontier.trainerIds[i] == trainerId)
|
||||
@@ -1523,11 +1523,11 @@ void GenerateBattlePyramidFloorLayout(u16 *backupMapData, bool8 setPlayerPositio
|
||||
int y, x;
|
||||
int i;
|
||||
u8 entranceSquareId, exitSquareId;
|
||||
u8 *floorLayoutOffsets = AllocZeroed(16);
|
||||
u8 *floorLayoutOffsets = AllocZeroed(NUM_PYRAMID_FLOOR_SQUARES);
|
||||
|
||||
GetPyramidFloorLayoutOffsets(floorLayoutOffsets);
|
||||
GetPyramidEntranceAndExitSquareIds(&entranceSquareId, &exitSquareId);
|
||||
for (i = 0; i < 16; i++)
|
||||
for (i = 0; i < NUM_PYRAMID_FLOOR_SQUARES; i++)
|
||||
{
|
||||
u16 *map;
|
||||
int yOffset, xOffset;
|
||||
@@ -1535,11 +1535,11 @@ void GenerateBattlePyramidFloorLayout(u16 *backupMapData, bool8 setPlayerPositio
|
||||
const u16 *layoutMap = mapLayout->map;
|
||||
|
||||
gBackupMapLayout.map = backupMapData;
|
||||
gBackupMapLayout.width = mapLayout->width * 4 + MAP_OFFSET_W;
|
||||
gBackupMapLayout.height = mapLayout->height * 4 + MAP_OFFSET_H;
|
||||
gBackupMapLayout.width = mapLayout->width * PYRAMID_FLOOR_SQUARES_WIDE + MAP_OFFSET_W;
|
||||
gBackupMapLayout.height = mapLayout->height * PYRAMID_FLOOR_SQUARES_HIGH + MAP_OFFSET_H;
|
||||
map = backupMapData;
|
||||
yOffset = ((i / 4 * mapLayout->height) + MAP_OFFSET) * gBackupMapLayout.width;
|
||||
xOffset = (i % 4 * mapLayout->width) + MAP_OFFSET;
|
||||
yOffset = ((i / PYRAMID_FLOOR_SQUARES_WIDE * mapLayout->height) + MAP_OFFSET) * gBackupMapLayout.width;
|
||||
xOffset = (i % PYRAMID_FLOOR_SQUARES_WIDE * mapLayout->width) + MAP_OFFSET;
|
||||
map += yOffset + xOffset;
|
||||
for (y = 0; y < mapLayout->height; y++)
|
||||
{
|
||||
@@ -1553,8 +1553,8 @@ void GenerateBattlePyramidFloorLayout(u16 *backupMapData, bool8 setPlayerPositio
|
||||
{
|
||||
if (i == entranceSquareId && setPlayerPosition == FALSE)
|
||||
{
|
||||
gSaveBlock1Ptr->pos.x = (mapLayout->width * (i % 4)) + x;
|
||||
gSaveBlock1Ptr->pos.y = (mapLayout->height * (i / 4)) + y;
|
||||
gSaveBlock1Ptr->pos.x = (mapLayout->width * (i % PYRAMID_FLOOR_SQUARES_WIDE)) + x;
|
||||
gSaveBlock1Ptr->pos.y = (mapLayout->height * (i / PYRAMID_FLOOR_SQUARES_WIDE)) + y;
|
||||
}
|
||||
map[x] = (layoutMap[x] & (MAPGRID_ELEVATION_MASK | MAPGRID_COLLISION_MASK)) | METATILE_BattlePyramid_Floor;
|
||||
}
|
||||
@@ -1563,12 +1563,12 @@ void GenerateBattlePyramidFloorLayout(u16 *backupMapData, bool8 setPlayerPositio
|
||||
map[x] = layoutMap[x];
|
||||
}
|
||||
}
|
||||
map += MAP_OFFSET_W + (mapLayout->width * 4);
|
||||
map += MAP_OFFSET_W + (mapLayout->width * PYRAMID_FLOOR_SQUARES_WIDE);
|
||||
layoutMap += mapLayout->width;
|
||||
}
|
||||
}
|
||||
RunOnLoadMapScript();
|
||||
free(floorLayoutOffsets);
|
||||
Free(floorLayoutOffsets);
|
||||
}
|
||||
|
||||
void LoadBattlePyramidObjectEventTemplates(void)
|
||||
@@ -1577,7 +1577,7 @@ void LoadBattlePyramidObjectEventTemplates(void)
|
||||
u8 id;
|
||||
u8 entranceSquareId, exitSquareId;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
for (i = 0; i < MAX_PYRAMID_TRAINERS; i++)
|
||||
gSaveBlock2Ptr->frontier.trainerIds[i] = 0xFFFF;
|
||||
|
||||
id = GetPyramidFloorTemplateId();
|
||||
@@ -1633,13 +1633,13 @@ void LoadBattlePyramidFloorObjectEventScripts(void)
|
||||
|
||||
static void GetPyramidEntranceAndExitSquareIds(u8 *entranceSquareId, u8 *exitSquareId)
|
||||
{
|
||||
*entranceSquareId = gSaveBlock2Ptr->frontier.pyramidRandoms[3] % 16;
|
||||
*exitSquareId = gSaveBlock2Ptr->frontier.pyramidRandoms[0] % 16;
|
||||
*entranceSquareId = gSaveBlock2Ptr->frontier.pyramidRandoms[3] % NUM_PYRAMID_FLOOR_SQUARES;
|
||||
*exitSquareId = gSaveBlock2Ptr->frontier.pyramidRandoms[0] % NUM_PYRAMID_FLOOR_SQUARES;
|
||||
|
||||
if (*entranceSquareId == *exitSquareId)
|
||||
{
|
||||
*entranceSquareId = (gSaveBlock2Ptr->frontier.pyramidRandoms[3] + 1 ) % 16;
|
||||
*exitSquareId = (gSaveBlock2Ptr->frontier.pyramidRandoms[0] + 15) % 16;
|
||||
*entranceSquareId = (gSaveBlock2Ptr->frontier.pyramidRandoms[3] + 1 ) % NUM_PYRAMID_FLOOR_SQUARES;
|
||||
*exitSquareId = (gSaveBlock2Ptr->frontier.pyramidRandoms[0] + NUM_PYRAMID_FLOOR_SQUARES - 1) % NUM_PYRAMID_FLOOR_SQUARES;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1651,10 +1651,10 @@ static void SetPyramidObjectPositionsUniformly(u8 objType)
|
||||
int squareId;
|
||||
u32 bits = 0;
|
||||
u8 id = GetPyramidFloorTemplateId();
|
||||
u8 *floorLayoutOffsets = AllocZeroed(16);
|
||||
u8 *floorLayoutOffsets = AllocZeroed(NUM_PYRAMID_FLOOR_SQUARES);
|
||||
|
||||
GetPyramidFloorLayoutOffsets(floorLayoutOffsets);
|
||||
squareId = gSaveBlock2Ptr->frontier.pyramidRandoms[2] % 16;
|
||||
squareId = gSaveBlock2Ptr->frontier.pyramidRandoms[2] % NUM_PYRAMID_FLOOR_SQUARES;
|
||||
if (objType == OBJ_TRAINERS)
|
||||
{
|
||||
numObjects = sPyramidFloorTemplates[id].numTrainers;
|
||||
@@ -1682,10 +1682,10 @@ static void SetPyramidObjectPositionsUniformly(u8 objType)
|
||||
if (gBitTable[squareId] & gSaveBlock2Ptr->frontier.pyramidRandoms[3])
|
||||
bits |= 2;
|
||||
}
|
||||
if (++squareId >= 16)
|
||||
if (++squareId >= NUM_PYRAMID_FLOOR_SQUARES)
|
||||
squareId = 0;
|
||||
|
||||
if (squareId == gSaveBlock2Ptr->frontier.pyramidRandoms[2] % 16)
|
||||
if (squareId == gSaveBlock2Ptr->frontier.pyramidRandoms[2] % NUM_PYRAMID_FLOOR_SQUARES)
|
||||
{
|
||||
if (bits & 1)
|
||||
bits |= 6;
|
||||
@@ -1697,7 +1697,7 @@ static void SetPyramidObjectPositionsUniformly(u8 objType)
|
||||
} while (!(bits & 4) && TrySetPyramidObjectEventPositionInSquare(objType, floorLayoutOffsets, squareId, objectStartIndex + i));
|
||||
bits &= 1;
|
||||
}
|
||||
free(floorLayoutOffsets);
|
||||
Free(floorLayoutOffsets);
|
||||
}
|
||||
|
||||
static bool8 SetPyramidObjectPositionsInAndNearSquare(u8 objType, u8 squareId)
|
||||
@@ -1709,7 +1709,7 @@ static bool8 SetPyramidObjectPositionsInAndNearSquare(u8 objType, u8 squareId)
|
||||
int numPlacedObjects = 0;
|
||||
int numObjects;
|
||||
u8 id = GetPyramidFloorTemplateId();
|
||||
u8 *floorLayoutOffsets = AllocZeroed(16);
|
||||
u8 *floorLayoutOffsets = AllocZeroed(NUM_PYRAMID_FLOOR_SQUARES);
|
||||
|
||||
GetPyramidFloorLayoutOffsets(floorLayoutOffsets);
|
||||
if (objType == OBJ_TRAINERS)
|
||||
@@ -1760,7 +1760,7 @@ static bool8 SetPyramidObjectPositionsInAndNearSquare(u8 objType, u8 squareId)
|
||||
r7 &= 1;
|
||||
}
|
||||
#ifdef BUGFIX
|
||||
free(floorLayoutOffsets);
|
||||
Free(floorLayoutOffsets);
|
||||
#endif
|
||||
|
||||
return (numObjects / 2) > numPlacedObjects;
|
||||
@@ -1775,7 +1775,7 @@ static bool8 SetPyramidObjectPositionsNearSquare(u8 objType, u8 squareId)
|
||||
int r8 = 0;
|
||||
int numObjects;
|
||||
u8 id = GetPyramidFloorTemplateId();
|
||||
u8 *floorLayoutOffsets = AllocZeroed(16);
|
||||
u8 *floorLayoutOffsets = AllocZeroed(NUM_PYRAMID_FLOOR_SQUARES);
|
||||
|
||||
GetPyramidFloorLayoutOffsets(floorLayoutOffsets);
|
||||
if (objType == OBJ_TRAINERS)
|
||||
@@ -1814,7 +1814,7 @@ static bool8 SetPyramidObjectPositionsNearSquare(u8 objType, u8 squareId)
|
||||
break;
|
||||
}
|
||||
#ifdef BUGFIX
|
||||
free(floorLayoutOffsets);
|
||||
Free(floorLayoutOffsets);
|
||||
#endif
|
||||
|
||||
return (numObjects / 2) > numPlacedObjects;
|
||||
@@ -1900,7 +1900,7 @@ static void GetPyramidFloorLayoutOffsets(u8 *layoutOffsets)
|
||||
int rand = (gSaveBlock2Ptr->frontier.pyramidRandoms[0]) | (gSaveBlock2Ptr->frontier.pyramidRandoms[1] << 16);
|
||||
u8 id = GetPyramidFloorTemplateId();
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
for (i = 0; i < NUM_PYRAMID_FLOOR_SQUARES; i++)
|
||||
{
|
||||
layoutOffsets[i] = sPyramidFloorTemplates[id].layoutOffsets[rand & 0x7];
|
||||
rand >>= 3;
|
||||
@@ -1931,7 +1931,7 @@ u8 GetNumBattlePyramidObjectEvents(void)
|
||||
u8 i;
|
||||
struct ObjectEventTemplate *events = gSaveBlock1Ptr->objectEventTemplates;
|
||||
|
||||
for (i = 0; i < 16; i++)
|
||||
for (i = 0; i < OBJECT_EVENTS_COUNT; i++)
|
||||
{
|
||||
if (events[i].localId == 0)
|
||||
break;
|
||||
@@ -1959,7 +1959,7 @@ u16 GetBattlePyramidPickupItemId(void)
|
||||
int rand;
|
||||
u32 i;
|
||||
u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
|
||||
int round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / 7);
|
||||
int round = (gSaveBlock2Ptr->frontier.pyramidWinStreaks[lvlMode] / FRONTIER_STAGES_PER_CHALLENGE);
|
||||
|
||||
if (round >= TOTAL_ROUNDS)
|
||||
round = TOTAL_ROUNDS - 1;
|
||||
|
||||
+13
-15
@@ -309,7 +309,7 @@ static const struct OamData sOamData_PyramidBag =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_NORMAL,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(64x64),
|
||||
.x = 0,
|
||||
@@ -393,7 +393,7 @@ static void OpenBattlePyramidBagInBattle(void)
|
||||
// make room.
|
||||
void ChooseItemsToTossFromPyramidBag(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
FadeScreen(FADE_TO_BLACK, 0);
|
||||
CreateTask(Task_ChooseItemsToTossFromPyramidBag, 10);
|
||||
}
|
||||
@@ -1195,7 +1195,7 @@ static void Task_ChooseHowManyToToss(u8 taskId)
|
||||
{
|
||||
// Toss
|
||||
PlaySE(SE_SELECT);
|
||||
ClearStdWindowAndFrameToTransparent(WIN_TOSS_NUM, 0);
|
||||
ClearStdWindowAndFrameToTransparent(WIN_TOSS_NUM, FALSE);
|
||||
ClearWindowTilemap(WIN_TOSS_NUM);
|
||||
ScheduleBgCopyTilemapToVram(1);
|
||||
AskConfirmToss(taskId);
|
||||
@@ -1204,7 +1204,7 @@ static void Task_ChooseHowManyToToss(u8 taskId)
|
||||
{
|
||||
// Cancel tossing
|
||||
PlaySE(SE_SELECT);
|
||||
ClearStdWindowAndFrameToTransparent(WIN_TOSS_NUM, 0);
|
||||
ClearStdWindowAndFrameToTransparent(WIN_TOSS_NUM, FALSE);
|
||||
ClearWindowTilemap(WIN_TOSS_NUM);
|
||||
ScheduleBgCopyTilemapToVram(1);
|
||||
DontTossItem(taskId);
|
||||
@@ -1404,20 +1404,20 @@ void TryStoreHeldItemsInPyramidBag(void)
|
||||
{
|
||||
u8 i;
|
||||
struct Pokemon *party = gPlayerParty;
|
||||
u16 *newItems = Alloc(PYRAMID_BAG_ITEMS_COUNT * sizeof(u16));
|
||||
u8 *newQuantities = Alloc(PYRAMID_BAG_ITEMS_COUNT * sizeof(u8));
|
||||
u16 *newItems = Alloc(PYRAMID_BAG_ITEMS_COUNT * sizeof(*newItems));
|
||||
u8 *newQuantities = Alloc(PYRAMID_BAG_ITEMS_COUNT * sizeof(*newQuantities));
|
||||
u16 heldItem;
|
||||
|
||||
memcpy(newItems, gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode], PYRAMID_BAG_ITEMS_COUNT * sizeof(u16));
|
||||
memcpy(newQuantities, gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode], PYRAMID_BAG_ITEMS_COUNT * sizeof(u8));
|
||||
for (i = 0; i < 3; i++)
|
||||
memcpy(newItems, gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode], PYRAMID_BAG_ITEMS_COUNT * sizeof(*newItems));
|
||||
memcpy(newQuantities, gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode], PYRAMID_BAG_ITEMS_COUNT * sizeof(*newQuantities));
|
||||
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
|
||||
{
|
||||
heldItem = GetMonData(&party[i], MON_DATA_HELD_ITEM);
|
||||
if (heldItem != ITEM_NONE && !AddBagItem(heldItem, 1))
|
||||
{
|
||||
// Cant store party held items in pyramid bag because bag is full
|
||||
memcpy(gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode], newItems, PYRAMID_BAG_ITEMS_COUNT * sizeof(u16));
|
||||
memcpy(gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode], newQuantities, PYRAMID_BAG_ITEMS_COUNT * sizeof(u8));
|
||||
memcpy(gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode], newItems, PYRAMID_BAG_ITEMS_COUNT * sizeof(*newItems));
|
||||
memcpy(gSaveBlock2Ptr->frontier.pyramidBag.quantity[gSaveBlock2Ptr->frontier.lvlMode], newQuantities, PYRAMID_BAG_ITEMS_COUNT * sizeof(*newQuantities));
|
||||
Free(newItems);
|
||||
Free(newQuantities);
|
||||
gSpecialVar_Result = 1;
|
||||
@@ -1426,10 +1426,8 @@ void TryStoreHeldItemsInPyramidBag(void)
|
||||
}
|
||||
|
||||
heldItem = ITEM_NONE;
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
|
||||
SetMonData(&party[i], MON_DATA_HELD_ITEM, &heldItem);
|
||||
}
|
||||
gSpecialVar_Result = 0;
|
||||
Free(newItems);
|
||||
Free(newQuantities);
|
||||
@@ -1466,7 +1464,7 @@ static void PyramidBagPrint_Quantity(u8 windowId, const u8 *src, u8 x, u8 y, u8
|
||||
|
||||
static void DrawTossNumberWindow(u8 windowId)
|
||||
{
|
||||
DrawStdFrameWithCustomTileAndPalette(windowId, 0, 1, 0xE);
|
||||
DrawStdFrameWithCustomTileAndPalette(windowId, FALSE, 1, 0xE);
|
||||
ScheduleBgCopyTilemapToVram(1);
|
||||
}
|
||||
|
||||
|
||||
@@ -388,7 +388,7 @@ static void RemoveTrainerHillRecordsWindow(u8 windowId)
|
||||
|
||||
static void ClearVramOamPlttRegs(void)
|
||||
{
|
||||
DmaClearLarge16(3, (void*)(VRAM), VRAM_SIZE, 0x1000);
|
||||
DmaClearLarge16(3, (void *)(VRAM), VRAM_SIZE, 0x1000);
|
||||
DmaClear32(3, OAM, OAM_SIZE);
|
||||
DmaClear16(3, PLTT, PLTT_SIZE);
|
||||
|
||||
|
||||
+369
-339
File diff suppressed because it is too large
Load Diff
+35
-34
@@ -400,7 +400,7 @@ void BattleSetup_StartBattlePikeWildBattle(void)
|
||||
|
||||
static void DoStandardWildBattle(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
FreezeObjectEvents();
|
||||
StopPlayerAvatar();
|
||||
gMain.savedCallback = CB2_EndWildBattle;
|
||||
@@ -419,7 +419,7 @@ static void DoStandardWildBattle(void)
|
||||
|
||||
void BattleSetup_StartRoamerBattle(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
FreezeObjectEvents();
|
||||
StopPlayerAvatar();
|
||||
gMain.savedCallback = CB2_EndWildBattle;
|
||||
@@ -433,7 +433,7 @@ void BattleSetup_StartRoamerBattle(void)
|
||||
|
||||
static void DoSafariBattle(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
FreezeObjectEvents();
|
||||
StopPlayerAvatar();
|
||||
gMain.savedCallback = CB2_EndSafariBattle;
|
||||
@@ -443,7 +443,7 @@ static void DoSafariBattle(void)
|
||||
|
||||
static void DoBattlePikeWildBattle(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
FreezeObjectEvents();
|
||||
StopPlayerAvatar();
|
||||
gMain.savedCallback = CB2_EndWildBattle;
|
||||
@@ -479,7 +479,7 @@ static void DoBattlePyramidTrainerHillBattle(void)
|
||||
void StartWallyTutorialBattle(void)
|
||||
{
|
||||
CreateMaleMon(&gEnemyParty[0], SPECIES_RALTS, 5);
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
gMain.savedCallback = CB2_ReturnToFieldContinueScriptPlayMapMusic;
|
||||
gBattleTypeFlags = BATTLE_TYPE_WALLY_TUTORIAL;
|
||||
CreateBattleStartTask(B_TRANSITION_SLICE, 0);
|
||||
@@ -487,7 +487,7 @@ void StartWallyTutorialBattle(void)
|
||||
|
||||
void BattleSetup_StartScriptedWildBattle(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
gMain.savedCallback = CB2_EndScriptedWildBattle;
|
||||
gBattleTypeFlags = 0;
|
||||
CreateBattleStartTask(GetWildBattleTransition(), 0);
|
||||
@@ -499,7 +499,7 @@ void BattleSetup_StartScriptedWildBattle(void)
|
||||
|
||||
void BattleSetup_StartLatiBattle(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
gMain.savedCallback = CB2_EndScriptedWildBattle;
|
||||
gBattleTypeFlags = BATTLE_TYPE_LEGENDARY;
|
||||
CreateBattleStartTask(GetWildBattleTransition(), 0);
|
||||
@@ -511,7 +511,7 @@ void BattleSetup_StartLatiBattle(void)
|
||||
|
||||
void BattleSetup_StartLegendaryBattle(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
gMain.savedCallback = CB2_EndScriptedWildBattle;
|
||||
gBattleTypeFlags = BATTLE_TYPE_LEGENDARY;
|
||||
|
||||
@@ -550,7 +550,7 @@ void BattleSetup_StartLegendaryBattle(void)
|
||||
|
||||
void StartGroudonKyogreBattle(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
gMain.savedCallback = CB2_EndScriptedWildBattle;
|
||||
gBattleTypeFlags = BATTLE_TYPE_LEGENDARY | BATTLE_TYPE_KYOGRE_GROUDON;
|
||||
|
||||
@@ -570,7 +570,7 @@ void StartRegiBattle(void)
|
||||
u8 transitionId;
|
||||
u16 species;
|
||||
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
gMain.savedCallback = CB2_EndScriptedWildBattle;
|
||||
gBattleTypeFlags = BATTLE_TYPE_LEGENDARY | BATTLE_TYPE_REGI;
|
||||
|
||||
@@ -600,7 +600,7 @@ void StartRegiBattle(void)
|
||||
|
||||
static void CB2_EndWildBattle(void)
|
||||
{
|
||||
CpuFill16(0, (void*)(BG_PLTT), BG_PLTT_SIZE);
|
||||
CpuFill16(0, (void *)(BG_PLTT), BG_PLTT_SIZE);
|
||||
ResetOamRange(0, 128);
|
||||
|
||||
if (IsPlayerDefeated(gBattleOutcome) == TRUE && !InBattlePyramid() && !InBattlePike())
|
||||
@@ -616,7 +616,7 @@ static void CB2_EndWildBattle(void)
|
||||
|
||||
static void CB2_EndScriptedWildBattle(void)
|
||||
{
|
||||
CpuFill16(0, (void*)(BG_PLTT), BG_PLTT_SIZE);
|
||||
CpuFill16(0, (void *)(BG_PLTT), BG_PLTT_SIZE);
|
||||
ResetOamRange(0, 128);
|
||||
|
||||
if (IsPlayerDefeated(gBattleOutcome) == TRUE)
|
||||
@@ -699,21 +699,22 @@ static u8 GetBattleTransitionTypeByMap(void)
|
||||
|
||||
PlayerGetDestCoords(&x, &y);
|
||||
tileBehavior = MapGridGetMetatileBehaviorAt(x, y);
|
||||
|
||||
if (GetFlashLevel())
|
||||
return TRANSITION_TYPE_FLASH;
|
||||
if (!MetatileBehavior_IsSurfableWaterOrUnderwater(tileBehavior))
|
||||
|
||||
if (MetatileBehavior_IsSurfableWaterOrUnderwater(tileBehavior))
|
||||
return TRANSITION_TYPE_WATER;
|
||||
|
||||
switch (gMapHeader.mapType)
|
||||
{
|
||||
switch (gMapHeader.mapType)
|
||||
{
|
||||
case MAP_TYPE_UNDERGROUND:
|
||||
return TRANSITION_TYPE_CAVE;
|
||||
case MAP_TYPE_UNDERWATER:
|
||||
return TRANSITION_TYPE_WATER;
|
||||
default:
|
||||
return TRANSITION_TYPE_NORMAL;
|
||||
}
|
||||
case MAP_TYPE_UNDERGROUND:
|
||||
return TRANSITION_TYPE_CAVE;
|
||||
case MAP_TYPE_UNDERWATER:
|
||||
return TRANSITION_TYPE_WATER;
|
||||
default:
|
||||
return TRANSITION_TYPE_NORMAL;
|
||||
}
|
||||
return TRANSITION_TYPE_WATER;
|
||||
}
|
||||
|
||||
static u16 GetSumOfPlayerPartyLevel(u8 numMons)
|
||||
@@ -1036,22 +1037,22 @@ static void InitTrainerBattleVariables(void)
|
||||
|
||||
static inline void SetU8(void *ptr, u8 value)
|
||||
{
|
||||
*(u8*)(ptr) = value;
|
||||
*(u8 *)(ptr) = value;
|
||||
}
|
||||
|
||||
static inline void SetU16(void *ptr, u16 value)
|
||||
{
|
||||
*(u16*)(ptr) = value;
|
||||
*(u16 *)(ptr) = value;
|
||||
}
|
||||
|
||||
static inline void SetU32(void *ptr, u32 value)
|
||||
{
|
||||
*(u32*)(ptr) = value;
|
||||
*(u32 *)(ptr) = value;
|
||||
}
|
||||
|
||||
static inline void SetPtr(const void *ptr, const void* value)
|
||||
static inline void SetPtr(const void *ptr, const void *value)
|
||||
{
|
||||
*(const void**)(ptr) = value;
|
||||
*(const void **)(ptr) = value;
|
||||
}
|
||||
|
||||
static void TrainerBattleLoadArgs(const struct TrainerBattleParameter *specs, const u8 *data)
|
||||
@@ -1193,8 +1194,8 @@ void ConfigureAndSetUpOneTrainerBattle(u8 trainerObjEventId, const u8 *trainerSc
|
||||
gSelectedObjectEvent = trainerObjEventId;
|
||||
gSpecialVar_LastTalked = gObjectEvents[trainerObjEventId].localId;
|
||||
BattleSetup_ConfigureTrainerBattle(trainerScript + 1);
|
||||
ScriptContext1_SetupScript(EventScript_StartTrainerApproach);
|
||||
ScriptContext2_Enable();
|
||||
ScriptContext_SetupScript(EventScript_StartTrainerApproach);
|
||||
LockPlayerFieldControls();
|
||||
}
|
||||
|
||||
void ConfigureTwoTrainersBattle(u8 trainerObjEventId, const u8 *trainerScript)
|
||||
@@ -1206,8 +1207,8 @@ void ConfigureTwoTrainersBattle(u8 trainerObjEventId, const u8 *trainerScript)
|
||||
|
||||
void SetUpTwoTrainersBattle(void)
|
||||
{
|
||||
ScriptContext1_SetupScript(EventScript_StartTrainerApproach);
|
||||
ScriptContext2_Enable();
|
||||
ScriptContext_SetupScript(EventScript_StartTrainerApproach);
|
||||
LockPlayerFieldControls();
|
||||
}
|
||||
|
||||
bool32 GetTrainerFlagFromScriptPointer(const u8 *data)
|
||||
@@ -1319,7 +1320,7 @@ void BattleSetup_StartTrainerBattle(void)
|
||||
else
|
||||
DoTrainerBattle();
|
||||
|
||||
ScriptContext1_Stop();
|
||||
ScriptContext_Stop();
|
||||
}
|
||||
|
||||
static void CB2_EndTrainerBattle(void)
|
||||
@@ -1370,7 +1371,7 @@ void BattleSetup_StartRematchBattle(void)
|
||||
gBattleTypeFlags = BATTLE_TYPE_TRAINER;
|
||||
gMain.savedCallback = CB2_EndRematchBattle;
|
||||
DoTrainerBattle();
|
||||
ScriptContext1_Stop();
|
||||
ScriptContext_Stop();
|
||||
}
|
||||
|
||||
void ShowTrainerIntroSpeech(void)
|
||||
|
||||
+22
-18
@@ -56,10 +56,8 @@ static void GenerateInitialRentalMons(void);
|
||||
*
|
||||
*/
|
||||
|
||||
// IWRAM bss
|
||||
static u16 sRandMonSetId;
|
||||
static u16 sRandMonId;
|
||||
|
||||
// const rom data
|
||||
void static (*const sVerdanturfTentFuncs[])(void) =
|
||||
{
|
||||
[VERDANTURF_TENT_FUNC_INIT] = InitVerdanturfTentChallenge,
|
||||
@@ -357,7 +355,7 @@ static void GenerateOpponentMons(void)
|
||||
const u16 *monSet;
|
||||
u16 species[FRONTIER_PARTY_SIZE];
|
||||
u16 heldItems[FRONTIER_PARTY_SIZE];
|
||||
s32 monId = 0;
|
||||
s32 numMons = 0;
|
||||
|
||||
gFacilityTrainers = gSlateportBattleTentTrainers;
|
||||
gFacilityTrainerMons = gSlateportBattleTentMons;
|
||||
@@ -366,6 +364,7 @@ static void GenerateOpponentMons(void)
|
||||
{
|
||||
do
|
||||
{
|
||||
// Choose a random trainer, ensuring no repeats in this challenge
|
||||
trainerId = Random() % NUM_BATTLE_TENT_TRAINERS;
|
||||
for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum; i++)
|
||||
{
|
||||
@@ -376,48 +375,53 @@ static void GenerateOpponentMons(void)
|
||||
|
||||
gTrainerBattleOpponent_A = trainerId;
|
||||
monSet = gFacilityTrainers[gTrainerBattleOpponent_A].monSet;
|
||||
while (monSet[monId] != 0xFFFF)
|
||||
monId++;
|
||||
if (monId > 8)
|
||||
while (monSet[numMons] != 0xFFFF)
|
||||
numMons++;
|
||||
if (numMons > 8)
|
||||
break;
|
||||
monId = 0;
|
||||
numMons = 0;
|
||||
}
|
||||
|
||||
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < 2)
|
||||
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < TENT_STAGES_PER_CHALLENGE - 1)
|
||||
gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum] = gTrainerBattleOpponent_A;
|
||||
|
||||
monSet = gFacilityTrainers[gTrainerBattleOpponent_A].monSet;
|
||||
i = 0;
|
||||
while (i != FRONTIER_PARTY_SIZE)
|
||||
{
|
||||
sRandMonSetId = monSet[Random() % monId];
|
||||
for (j = 0; j < 6; j++)
|
||||
sRandMonId = monSet[Random() % numMons];
|
||||
|
||||
// Ensure none of the opponent's pokemon are the same as the potential rental pokemon for the player
|
||||
for (j = 0; j < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons); j++)
|
||||
{
|
||||
if (gFacilityTrainerMons[sRandMonSetId].species == gFacilityTrainerMons[gSaveBlock2Ptr->frontier.rentalMons[j].monId].species)
|
||||
if (gFacilityTrainerMons[sRandMonId].species == gFacilityTrainerMons[gSaveBlock2Ptr->frontier.rentalMons[j].monId].species)
|
||||
break;
|
||||
}
|
||||
if (j != 6)
|
||||
if (j != (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.rentalMons))
|
||||
continue;
|
||||
|
||||
// Ensure this species hasn't already been chosen for the opponent
|
||||
for (k = 0; k < i; k++)
|
||||
{
|
||||
if (species[k] == gFacilityTrainerMons[sRandMonSetId].species)
|
||||
if (species[k] == gFacilityTrainerMons[sRandMonId].species)
|
||||
break;
|
||||
}
|
||||
if (k != i)
|
||||
continue;
|
||||
|
||||
// Ensure held items don't repeat on the opponent's team
|
||||
for (k = 0; k < i; k++)
|
||||
{
|
||||
if (heldItems[k] != 0 && heldItems[k] == gBattleFrontierHeldItems[gFacilityTrainerMons[sRandMonSetId].itemTableId])
|
||||
if (heldItems[k] != ITEM_NONE && heldItems[k] == gBattleFrontierHeldItems[gFacilityTrainerMons[sRandMonId].itemTableId])
|
||||
break;
|
||||
}
|
||||
if (k != i)
|
||||
continue;
|
||||
|
||||
species[i] = gFacilityTrainerMons[sRandMonSetId].species;
|
||||
heldItems[i] = gBattleFrontierHeldItems[gFacilityTrainerMons[sRandMonSetId].itemTableId];
|
||||
gFrontierTempParty[i] = sRandMonSetId;
|
||||
// Successful selection
|
||||
species[i] = gFacilityTrainerMons[sRandMonId].species;
|
||||
heldItems[i] = gBattleFrontierHeldItems[gFacilityTrainerMons[sRandMonId].itemTableId];
|
||||
gFrontierTempParty[i] = sRandMonId;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
+68
-57
@@ -27,6 +27,7 @@
|
||||
#include "constants/battle_dome.h"
|
||||
#include "constants/battle_frontier.h"
|
||||
#include "constants/battle_frontier_mons.h"
|
||||
#include "constants/battle_tent.h"
|
||||
#include "constants/battle_tent_mons.h"
|
||||
#include "constants/battle_tent_trainers.h"
|
||||
#include "constants/battle_tower.h"
|
||||
@@ -687,7 +688,7 @@ struct
|
||||
{
|
||||
u32 facilityClass;
|
||||
const u8 *const *strings;
|
||||
} const sPartnerTrainerTextTables[] =
|
||||
} static const sPartnerTrainerTextTables[] =
|
||||
{
|
||||
{FACILITY_CLASS_LASS, sPartnerTextsLass},
|
||||
{FACILITY_CLASS_YOUNGSTER, sPartnerTextsYoungster},
|
||||
@@ -769,7 +770,7 @@ struct
|
||||
u8 nature;
|
||||
u8 evs[NUM_STATS];
|
||||
u16 moves[MAX_MON_MOVES];
|
||||
} const sStevenMons[MULTI_PARTY_SIZE] =
|
||||
} static const sStevenMons[MULTI_PARTY_SIZE] =
|
||||
{
|
||||
{
|
||||
.species = SPECIES_METANG,
|
||||
@@ -995,7 +996,7 @@ static bool8 ChooseSpecialBattleTowerTrainer(void)
|
||||
winStreak = GetCurrentBattleTowerWinStreak(lvlMode, battleMode);
|
||||
for (i = 0; i < BATTLE_TOWER_RECORD_COUNT; i++)
|
||||
{
|
||||
u32 *record = (u32*)(&gSaveBlock2Ptr->frontier.towerRecords[i]);
|
||||
u32 *record = (u32 *)(&gSaveBlock2Ptr->frontier.towerRecords[i]);
|
||||
u32 recordHasData = 0;
|
||||
u32 checksum = 0;
|
||||
for (j = 0; j < (sizeof(struct EmeraldBattleTowerRecord) - 4) / 4; j++) // - 4, because of the last field being the checksum itself.
|
||||
@@ -1060,7 +1061,7 @@ static void SetNextFacilityOpponent(void)
|
||||
u16 id;
|
||||
u32 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
|
||||
u16 winStreak = GetCurrentFacilityWinStreak();
|
||||
u32 challengeNum = winStreak / 7;
|
||||
u32 challengeNum = winStreak / FRONTIER_STAGES_PER_CHALLENGE;
|
||||
SetFacilityPtrsGetLevel();
|
||||
|
||||
if (battleMode == FRONTIER_MODE_MULTIS || battleMode == FRONTIER_MODE_LINK_MULTIS)
|
||||
@@ -1095,7 +1096,7 @@ static void SetNextFacilityOpponent(void)
|
||||
|
||||
gTrainerBattleOpponent_A = id;
|
||||
SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0);
|
||||
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum + 1 < 7)
|
||||
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum + 1 < FRONTIER_STAGES_PER_CHALLENGE)
|
||||
gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum] = gTrainerBattleOpponent_A;
|
||||
}
|
||||
}
|
||||
@@ -1107,7 +1108,7 @@ u16 GetRandomScaledFrontierTrainerId(u8 challengeNum, u8 battleNum)
|
||||
|
||||
if (challengeNum <= 7)
|
||||
{
|
||||
if (battleNum == 6)
|
||||
if (battleNum == FRONTIER_STAGES_PER_CHALLENGE - 1)
|
||||
{
|
||||
// The last battle in each challenge has a jump in difficulty, pulls from a table with higher ranges
|
||||
trainerId = (sFrontierTrainerIdRangesHard[challengeNum][1] - sFrontierTrainerIdRangesHard[challengeNum][0]) + 1;
|
||||
@@ -1136,7 +1137,7 @@ static void GetRandomScaledFrontierTrainerIdRange(u8 challengeNum, u8 battleNum,
|
||||
|
||||
if (challengeNum <= 7)
|
||||
{
|
||||
if (battleNum == 6)
|
||||
if (battleNum == FRONTIER_STAGES_PER_CHALLENGE - 1)
|
||||
{
|
||||
// The last battle in each challenge has a jump in difficulty, pulls from a table with higher ranges
|
||||
range = (sFrontierTrainerIdRangesHard[challengeNum][1] - sFrontierTrainerIdRangesHard[challengeNum][0]) + 1;
|
||||
@@ -1326,19 +1327,19 @@ void PutNewBattleTowerRecord(struct EmeraldBattleTowerRecord *newRecordEm)
|
||||
if (gSaveBlock2Ptr->frontier.towerRecords[i].trainerId[j] != newRecord->trainerId[j])
|
||||
break;
|
||||
}
|
||||
if (j == 4)
|
||||
if (j == TRAINER_ID_LENGTH)
|
||||
{
|
||||
for (k = 0; k < PLAYER_NAME_LENGTH; k++)
|
||||
{
|
||||
#ifdef BUGFIX
|
||||
if (gSaveBlock2Ptr->frontier.towerRecords[i].name[k] != newRecord->name[k])
|
||||
// Incorrect index being used
|
||||
#ifdef BUGFIX
|
||||
#define INDEX k
|
||||
#else
|
||||
#define INDEX j
|
||||
#endif
|
||||
if (gSaveBlock2Ptr->frontier.towerRecords[i].name[INDEX] != newRecord->name[INDEX])
|
||||
break;
|
||||
if (newRecord->name[k] == EOS)
|
||||
#else
|
||||
if (gSaveBlock2Ptr->frontier.towerRecords[i].name[j] != newRecord->name[j])
|
||||
break;
|
||||
if (newRecord->name[j] == EOS)
|
||||
#endif
|
||||
if (newRecord->name[INDEX] == EOS)
|
||||
{
|
||||
k = PLAYER_NAME_LENGTH;
|
||||
break;
|
||||
@@ -1634,7 +1635,7 @@ static void FillTentTrainerParty(u8 monsCount)
|
||||
static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
|
||||
{
|
||||
s32 i, j;
|
||||
u16 chosenMonIndices[4];
|
||||
u16 chosenMonIndices[MAX_FRONTIER_PARTY_SIZE];
|
||||
u8 friendship = MAX_FRIENDSHIP;
|
||||
u8 level = SetFacilityPtrsGetLevel();
|
||||
u8 fixedIV = 0;
|
||||
@@ -1650,7 +1651,7 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
|
||||
}
|
||||
else if (trainerId == TRAINER_EREADER)
|
||||
{
|
||||
for (i = firstMonId; i < firstMonId + 3; i++)
|
||||
for (i = firstMonId; i < firstMonId + FRONTIER_PARTY_SIZE; i++)
|
||||
CreateBattleTowerMon(&gEnemyParty[i], &gSaveBlock2Ptr->frontier.ereaderTrainer.party[i - firstMonId]);
|
||||
return;
|
||||
}
|
||||
@@ -1675,7 +1676,7 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
|
||||
else
|
||||
{
|
||||
// Apprentice.
|
||||
for (i = firstMonId; i < firstMonId + 3; i++)
|
||||
for (i = firstMonId; i < firstMonId + FRONTIER_PARTY_SIZE; i++)
|
||||
CreateApprenticeMon(&gEnemyParty[i], &gSaveBlock2Ptr->apprentices[trainerId - TRAINER_RECORD_MIXING_APPRENTICE], i - firstMonId);
|
||||
return;
|
||||
}
|
||||
@@ -1691,7 +1692,10 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
|
||||
while (i != monCount)
|
||||
{
|
||||
u16 monId = monSet[Random() % bfMonCount];
|
||||
if ((level == 50 || level == 20) && monId > FRONTIER_MONS_HIGH_TIER)
|
||||
|
||||
// "High tier" pokemon are only allowed on open level mode
|
||||
// 20 is not a possible value for level here
|
||||
if ((level == FRONTIER_MAX_LEVEL_50 || level == 20) && monId > FRONTIER_MONS_HIGH_TIER)
|
||||
continue;
|
||||
|
||||
// Ensure this pokemon species isn't a duplicate.
|
||||
@@ -1767,11 +1771,11 @@ static void Unused_CreateApprenticeMons(u16 trainerId, u8 firstMonId)
|
||||
fixedIV = 9;
|
||||
|
||||
if (gSaveBlock2Ptr->frontier.lvlMode != FRONTIER_LVL_50)
|
||||
level = 100;
|
||||
level = FRONTIER_MAX_LEVEL_OPEN;
|
||||
else
|
||||
level = 50;
|
||||
level = FRONTIER_MAX_LEVEL_50;
|
||||
|
||||
for (i = 0; i != 3; i++)
|
||||
for (i = 0; i != FRONTIER_PARTY_SIZE; i++)
|
||||
{
|
||||
CreateMonWithEVSpread(&gEnemyParty[firstMonId + i], apprentice->party[i].species, level, fixedIV, 8);
|
||||
friendship = MAX_FRIENDSHIP;
|
||||
@@ -1802,8 +1806,10 @@ u16 GetRandomFrontierMonFromSet(u16 trainerId)
|
||||
|
||||
do
|
||||
{
|
||||
// "High tier" pokemon are only allowed on open level mode
|
||||
// 20 is not a possible value for level here
|
||||
monId = monSet[Random() % numMons];
|
||||
} while((level == 50 || level == 20) && monId > FRONTIER_MONS_HIGH_TIER);
|
||||
} while((level == FRONTIER_MAX_LEVEL_50 || level == 20) && monId > FRONTIER_MONS_HIGH_TIER);
|
||||
|
||||
return monId;
|
||||
}
|
||||
@@ -1827,17 +1833,22 @@ static void FillFactoryFrontierTrainerParty(u16 trainerId, u8 firstMonId)
|
||||
|
||||
if (trainerId < FRONTIER_TRAINERS_COUNT)
|
||||
{
|
||||
u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; // Unused variable.
|
||||
u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
|
||||
u8 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
|
||||
u8 challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][FRONTIER_LVL_50] / 7;
|
||||
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < 6)
|
||||
fixedIV = GetFactoryMonFixedIV(challengeNum, 0);
|
||||
// By mistake Battle Tower's Level 50 challenge number is used to determine the IVs for Battle Factory.
|
||||
#ifdef BUGFIX
|
||||
u8 challengeNum = gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode] / FRONTIER_STAGES_PER_CHALLENGE;
|
||||
#else
|
||||
u8 challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][FRONTIER_LVL_50] / FRONTIER_STAGES_PER_CHALLENGE;
|
||||
#endif
|
||||
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < FRONTIER_STAGES_PER_CHALLENGE - 1)
|
||||
fixedIV = GetFactoryMonFixedIV(challengeNum, FALSE);
|
||||
else
|
||||
fixedIV = GetFactoryMonFixedIV(challengeNum, 1);
|
||||
fixedIV = GetFactoryMonFixedIV(challengeNum, TRUE); // Last trainer in challenge uses higher IVs
|
||||
}
|
||||
else if (trainerId == TRAINER_EREADER)
|
||||
{
|
||||
for (i = firstMonId; i < firstMonId + 3; i++)
|
||||
for (i = firstMonId; i < firstMonId + FRONTIER_PARTY_SIZE; i++)
|
||||
CreateBattleTowerMon(&gEnemyParty[i], &gSaveBlock2Ptr->frontier.ereaderTrainer.party[i - firstMonId]);
|
||||
return;
|
||||
}
|
||||
@@ -1877,7 +1888,7 @@ static void FillFactoryTentTrainerParty(u16 trainerId, u8 firstMonId)
|
||||
{
|
||||
u8 i, j;
|
||||
u8 friendship;
|
||||
u8 level = 30;
|
||||
u8 level = TENT_MIN_LEVEL;
|
||||
u8 fixedIV = 0;
|
||||
u32 otID = T1_READ_32(gSaveBlock2Ptr->playerTrainerId);
|
||||
|
||||
@@ -2038,7 +2049,7 @@ void DoSpecialTrainerBattle(void)
|
||||
break;
|
||||
case SPECIAL_BATTLE_EREADER:
|
||||
ZeroEnemyPartyMons();
|
||||
for (i = 0; i < 3; i++)
|
||||
for (i = 0; i < (int)ARRAY_COUNT(gSaveBlock2Ptr->frontier.ereaderTrainer.party); i++)
|
||||
CreateBattleTowerMon(&gEnemyParty[i], &gSaveBlock2Ptr->frontier.ereaderTrainer.party[i]);
|
||||
gBattleTypeFlags = BATTLE_TYPE_TRAINER | BATTLE_TYPE_EREADER_TRAINER;
|
||||
gTrainerBattleOpponent_A = 0;
|
||||
@@ -2184,7 +2195,7 @@ static void SaveTowerChallenge(void)
|
||||
{
|
||||
u16 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
|
||||
u16 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
|
||||
s32 challengeNum = (signed)(gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] / 7);
|
||||
s32 challengeNum = (signed)(gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] / FRONTIER_STAGES_PER_CHALLENGE);
|
||||
|
||||
if (gSpecialVar_0x8005 == 0 && (challengeNum > 1 || gSaveBlock2Ptr->frontier.curChallengeBattleNum != 0))
|
||||
SaveBattleTowerRecord();
|
||||
@@ -2274,7 +2285,7 @@ static void LoadMultiPartnerCandidatesData(void)
|
||||
objEventTemplates = gSaveBlock1Ptr->objectEventTemplates;
|
||||
lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
|
||||
battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
|
||||
challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] / 7;
|
||||
challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] / FRONTIER_STAGES_PER_CHALLENGE;
|
||||
species1 = GetMonData(&gPlayerParty[0], MON_DATA_SPECIES, NULL);
|
||||
species2 = GetMonData(&gPlayerParty[1], MON_DATA_SPECIES, NULL);
|
||||
level = SetFacilityPtrsGetLevel();
|
||||
@@ -2333,7 +2344,7 @@ static void LoadMultiPartnerCandidatesData(void)
|
||||
for (i = 0; i < APPRENTICE_COUNT; i++)
|
||||
{
|
||||
if (gSaveBlock2Ptr->apprentices[i].lvlMode != 0
|
||||
&& sApprenticeChallengeThreshold[gSaveBlock2Ptr->apprentices[i].numQuestions] / 7 <= challengeNum
|
||||
&& sApprenticeChallengeThreshold[gSaveBlock2Ptr->apprentices[i].numQuestions] / FRONTIER_STAGES_PER_CHALLENGE <= challengeNum
|
||||
&& gSaveBlock2Ptr->apprentices[i].lvlMode - 1 == lvlMode)
|
||||
{
|
||||
k = 0;
|
||||
@@ -2363,7 +2374,7 @@ static void LoadMultiPartnerCandidatesData(void)
|
||||
r10 = 0;
|
||||
for (i = 0; i < BATTLE_TOWER_RECORD_COUNT; i++)
|
||||
{
|
||||
u32 *record = (u32*)(&gSaveBlock2Ptr->frontier.towerRecords[i]);
|
||||
u32 *record = (u32 *)(&gSaveBlock2Ptr->frontier.towerRecords[i]);
|
||||
u32 recordHasData = 0;
|
||||
u32 checksum = 0;
|
||||
for (j = 0; j < (sizeof(struct EmeraldBattleTowerRecord) - 4) / 4; j++) // - 4, because of the last field being the checksum itself.
|
||||
@@ -2372,7 +2383,7 @@ static void LoadMultiPartnerCandidatesData(void)
|
||||
checksum += record[j];
|
||||
}
|
||||
|
||||
if (gSaveBlock2Ptr->frontier.towerRecords[i].winStreak / 7 <= challengeNum
|
||||
if (gSaveBlock2Ptr->frontier.towerRecords[i].winStreak / FRONTIER_STAGES_PER_CHALLENGE <= challengeNum
|
||||
&& gSaveBlock2Ptr->frontier.towerRecords[i].lvlMode == lvlMode
|
||||
&& recordHasData
|
||||
&& gSaveBlock2Ptr->frontier.towerRecords[i].checksum == checksum)
|
||||
@@ -2453,7 +2464,7 @@ static void ShowPartnerCandidateMessage(void)
|
||||
s32 monId;
|
||||
s32 level = SetFacilityPtrsGetLevel();
|
||||
u16 winStreak = GetCurrentFacilityWinStreak();
|
||||
s32 challengeNum = winStreak / 7;
|
||||
s32 challengeNum = winStreak / FRONTIER_STAGES_PER_CHALLENGE;
|
||||
s32 k = gSpecialVar_LastTalked - 2;
|
||||
s32 trainerId = gSaveBlock2Ptr->frontier.trainerIds[k];
|
||||
|
||||
@@ -2512,7 +2523,7 @@ static void ShowPartnerCandidateMessage(void)
|
||||
gSaveBlock2Ptr->frontier.trainerIds[18] = gFrontierTempParty[0];
|
||||
gSaveBlock2Ptr->frontier.trainerIds[19] = gFrontierTempParty[1];
|
||||
}
|
||||
for (k = 0; k < 14; k++)
|
||||
for (k = 0; k < FRONTIER_STAGES_PER_CHALLENGE * 2; k++)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
@@ -2571,7 +2582,7 @@ static void LoadLinkMultiOpponentsData(void)
|
||||
case 0:
|
||||
if (battleMode == FRONTIER_MODE_LINK_MULTIS)
|
||||
{
|
||||
challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] / 7;
|
||||
challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] / FRONTIER_STAGES_PER_CHALLENGE;
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
SendBlock(BitmaskAllOtherLinkPlayers(), &challengeNum, sizeof(challengeNum));
|
||||
@@ -2591,7 +2602,7 @@ static void LoadLinkMultiOpponentsData(void)
|
||||
challengeNum = gBlockRecvBuffer[0][0];
|
||||
else
|
||||
challengeNum = gBlockRecvBuffer[1][0];
|
||||
for (i = 0; i < 14; i++)
|
||||
for (i = 0; i < FRONTIER_STAGES_PER_CHALLENGE * 2; i++)
|
||||
{
|
||||
do
|
||||
{
|
||||
@@ -2624,7 +2635,7 @@ static void LoadLinkMultiOpponentsData(void)
|
||||
gTrainerBattleOpponent_B = gSaveBlock2Ptr->frontier.trainerIds[battleNum * 2 + 1];
|
||||
SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0);
|
||||
SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_B, 1);
|
||||
if (gReceivedRemoteLinkPlayers != 0 && gWirelessCommType == 0)
|
||||
if (gReceivedRemoteLinkPlayers && gWirelessCommType == 0)
|
||||
gSpecialVar_Result = 4;
|
||||
else
|
||||
gSpecialVar_Result = 6;
|
||||
@@ -2679,7 +2690,7 @@ static void SetTowerInterviewData(void)
|
||||
static void ValidateBattleTowerRecordChecksums(void)
|
||||
{
|
||||
s32 i, j;
|
||||
u32 *record = (u32*)(&gSaveBlock2Ptr->frontier.towerPlayer);
|
||||
u32 *record = (u32 *)(&gSaveBlock2Ptr->frontier.towerPlayer);
|
||||
u32 checksum = 0;
|
||||
|
||||
for (j = 0; j < (sizeof(struct EmeraldBattleTowerRecord) - 4) / 4; j++) // - 4, because of the last field being the checksum itself.
|
||||
@@ -2691,7 +2702,7 @@ static void ValidateBattleTowerRecordChecksums(void)
|
||||
|
||||
for (i = 0; i < BATTLE_TOWER_RECORD_COUNT; i++)
|
||||
{
|
||||
record = (u32*)(&gSaveBlock2Ptr->frontier.towerRecords[i]);
|
||||
record = (u32 *)(&gSaveBlock2Ptr->frontier.towerRecords[i]);
|
||||
checksum = 0;
|
||||
for (j = 0; j < (sizeof(struct EmeraldBattleTowerRecord) - 4) / 4; j++) // - 4, because of the last field being the checksum itself.
|
||||
{
|
||||
@@ -2732,8 +2743,8 @@ u16 GetCurrentBattleTowerWinStreak(u8 lvlMode, u8 battleMode)
|
||||
{
|
||||
u16 winStreak = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode];
|
||||
|
||||
if (winStreak > 9999)
|
||||
return 9999;
|
||||
if (winStreak > MAX_STREAK)
|
||||
return MAX_STREAK;
|
||||
else
|
||||
return winStreak;
|
||||
}
|
||||
@@ -2835,7 +2846,7 @@ static void FillEReaderTrainerWithPlayerData(void)
|
||||
ereaderTrainer->winStreak = 1;
|
||||
|
||||
j = 7;
|
||||
for (i = 0; i < 6; i++)
|
||||
for (i = 0; i < EASY_CHAT_BATTLE_WORDS_COUNT; i++)
|
||||
{
|
||||
ereaderTrainer->greeting[i] = gSaveBlock1Ptr->easyChatBattleStart[i];
|
||||
ereaderTrainer->farewellPlayerLost[i] = j;
|
||||
@@ -2843,7 +2854,7 @@ static void FillEReaderTrainerWithPlayerData(void)
|
||||
j++;
|
||||
}
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
for (i = 0; i < (int)ARRAY_COUNT(ereaderTrainer->party); i++)
|
||||
ConvertPokemonToBattleTowerPokemon(&gPlayerParty[i], &ereaderTrainer->party[i]);
|
||||
|
||||
SetEReaderTrainerChecksum(ereaderTrainer);
|
||||
@@ -3184,7 +3195,7 @@ static void ValidateApprenticesChecksums(void)
|
||||
|
||||
for (i = 0; i < APPRENTICE_COUNT; i++)
|
||||
{
|
||||
u32 *data = (u32*) &gSaveBlock2Ptr->apprentices[i];
|
||||
u32 *data = (u32 *) &gSaveBlock2Ptr->apprentices[i];
|
||||
u32 checksum = 0;
|
||||
for (j = 0; j < (sizeof(struct Apprentice) - 4) / 4; j++)
|
||||
checksum += data[j];
|
||||
@@ -3241,12 +3252,12 @@ u8 GetFrontierEnemyMonLevel(u8 lvlMode)
|
||||
{
|
||||
default:
|
||||
case FRONTIER_LVL_50:
|
||||
level = 50;
|
||||
level = FRONTIER_MAX_LEVEL_50;
|
||||
break;
|
||||
case FRONTIER_LVL_OPEN:
|
||||
level = GetHighestLevelInPlayerParty();
|
||||
if (level < 60)
|
||||
level = 60;
|
||||
if (level < FRONTIER_MIN_LEVEL_OPEN)
|
||||
level = FRONTIER_MIN_LEVEL_OPEN;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3316,7 +3327,7 @@ static u16 GetBattleTentTrainerId(void)
|
||||
|
||||
static u8 SetTentPtrsGetLevel(void)
|
||||
{
|
||||
u8 level = 30;
|
||||
u8 level = TENT_MIN_LEVEL;
|
||||
u32 facility = VarGet(VAR_FRONTIER_FACILITY);
|
||||
|
||||
if (facility == FRONTIER_FACILITY_FACTORY)
|
||||
@@ -3341,8 +3352,8 @@ static u8 SetTentPtrsGetLevel(void)
|
||||
}
|
||||
|
||||
level = GetHighestLevelInPlayerParty();
|
||||
if (level < 30)
|
||||
level = 30;
|
||||
if (level < TENT_MIN_LEVEL)
|
||||
level = TENT_MIN_LEVEL;
|
||||
|
||||
return level;
|
||||
}
|
||||
@@ -3364,7 +3375,7 @@ static void SetNextBattleTentOpponent(void)
|
||||
|
||||
gTrainerBattleOpponent_A = trainerId;
|
||||
SetBattleFacilityTrainerGfxId(gTrainerBattleOpponent_A, 0);
|
||||
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum + 1 < 3)
|
||||
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum + 1 < TENT_STAGES_PER_CHALLENGE)
|
||||
gSaveBlock2Ptr->frontier.trainerIds[gSaveBlock2Ptr->frontier.curChallengeBattleNum] = gTrainerBattleOpponent_A;
|
||||
}
|
||||
|
||||
@@ -3493,7 +3504,7 @@ u8 FacilityClassToGraphicsId(u8 facilityClass)
|
||||
bool32 ValidateBattleTowerRecord(u8 recordId) // unused
|
||||
{
|
||||
s32 i;
|
||||
u32 *record = (u32*)(&gSaveBlock2Ptr->frontier.towerRecords[recordId]);
|
||||
u32 *record = (u32 *)(&gSaveBlock2Ptr->frontier.towerRecords[recordId]);
|
||||
u32 checksum = 0;
|
||||
u32 hasData = 0;
|
||||
for (i = 0; i < (sizeof(struct EmeraldBattleTowerRecord) - 4) / 4; i++) // - 4, because of the last fjeld bejng the checksum jtself.
|
||||
|
||||
+24
-26
@@ -827,7 +827,7 @@ static const struct OamData sOam_UnusedBrendanLass =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(64x64),
|
||||
.x = 0,
|
||||
@@ -2186,7 +2186,7 @@ static bool8 Wave_Init(struct Task *task)
|
||||
static bool8 Wave_Main(struct Task *task)
|
||||
{
|
||||
u8 i, sinIndex;
|
||||
u16* toStore;
|
||||
u16 *toStore;
|
||||
bool8 finished;
|
||||
|
||||
sTransitionData->VBlank_DMA = FALSE;
|
||||
@@ -2347,7 +2347,7 @@ static bool8 Mugshot_SetGfx(struct Task *task)
|
||||
static bool8 Mugshot_ShowBanner(struct Task *task)
|
||||
{
|
||||
u8 i, sinIndex;
|
||||
u16* toStore;
|
||||
u16 *toStore;
|
||||
s16 x;
|
||||
s32 mergedValue;
|
||||
|
||||
@@ -2388,7 +2388,7 @@ static bool8 Mugshot_ShowBanner(struct Task *task)
|
||||
if (task->tBottomBannerX < 0)
|
||||
task->tBottomBannerX = 0;
|
||||
|
||||
mergedValue = *(s32*)(&task->tTopBannerX);
|
||||
mergedValue = *(s32 *)(&task->tTopBannerX);
|
||||
if (mergedValue == DISPLAY_WIDTH)
|
||||
task->tState++;
|
||||
|
||||
@@ -2401,7 +2401,7 @@ static bool8 Mugshot_ShowBanner(struct Task *task)
|
||||
static bool8 Mugshot_StartOpponentSlide(struct Task *task)
|
||||
{
|
||||
u8 i;
|
||||
u16* toStore;
|
||||
u16 *toStore;
|
||||
|
||||
sTransitionData->VBlank_DMA = FALSE;
|
||||
|
||||
@@ -2434,7 +2434,7 @@ static bool8 Mugshot_WaitStartPlayerSlide(struct Task *task)
|
||||
{
|
||||
sTransitionData->BG0HOFS_Lower -= 8;
|
||||
sTransitionData->BG0HOFS_Upper += 8;
|
||||
|
||||
|
||||
// Start player's slide in once the opponent is finished
|
||||
if (IsTrainerPicSlideDone(task->tOpponentSpriteId))
|
||||
{
|
||||
@@ -2770,7 +2770,7 @@ static bool8 Slice_Main(struct Task *task)
|
||||
{
|
||||
u16 *storeLoc1 = &gScanlineEffectRegBuffers[0][i];
|
||||
u16 *storeLoc2 = &gScanlineEffectRegBuffers[0][i + DISPLAY_HEIGHT];
|
||||
|
||||
|
||||
// Alternate rows
|
||||
if (i % 2)
|
||||
{
|
||||
@@ -3251,7 +3251,7 @@ static bool8 RectangularSpiral_Main(struct Task *task)
|
||||
// The line moved to a new position, draw the tile.
|
||||
done = FALSE;
|
||||
position = sRectangularSpiralLines[j].position;
|
||||
|
||||
|
||||
// Invert position for the two lines that start at the bottom.
|
||||
if ((j % 2) == 1)
|
||||
position = 637 - position;
|
||||
@@ -3281,7 +3281,7 @@ static bool8 RectangularSpiral_End(struct Task *task)
|
||||
static bool16 UpdateRectangularSpiralLine(const s16 * const *moveDataTable, struct RectangularSpiralLine *line)
|
||||
{
|
||||
const s16 *moveData = moveDataTable[line->state];
|
||||
|
||||
|
||||
// Has spiral finished?
|
||||
// Note that most move data arrays endsin SPIRAL_END but it is
|
||||
// only ever reached on the final array of spiraling outward.
|
||||
@@ -3294,9 +3294,9 @@ static bool16 UpdateRectangularSpiralLine(const s16 * const *moveDataTable, stru
|
||||
sDebug_RectangularSpiralData = moveData[2];
|
||||
sDebug_RectangularSpiralData = moveData[3];
|
||||
|
||||
// Note that for the two lines originating at the bottom the
|
||||
// Note that for the two lines originating at the bottom the
|
||||
// position is inverted, so the directions are flipped.
|
||||
// i.e. position += 1 is right for the top lines and left
|
||||
// i.e. position += 1 is right for the top lines and left
|
||||
// for their inverted partners on the bottom.
|
||||
switch (moveData[0])
|
||||
{
|
||||
@@ -3716,8 +3716,8 @@ static void SpriteCB_WhiteBarFade(struct Sprite *sprite)
|
||||
else
|
||||
{
|
||||
u16 i;
|
||||
u16* ptr1 = &gScanlineEffectRegBuffers[0][sprite->y];
|
||||
u16* ptr2 = &gScanlineEffectRegBuffers[0][sprite->y + DISPLAY_HEIGHT];
|
||||
u16 *ptr1 = &gScanlineEffectRegBuffers[0][sprite->y];
|
||||
u16 *ptr2 = &gScanlineEffectRegBuffers[0][sprite->y + DISPLAY_HEIGHT];
|
||||
for (i = 0; i < DISPLAY_HEIGHT / NUM_WHITE_BARS; i++)
|
||||
{
|
||||
ptr1[i] = sprite->sFade >> 8;
|
||||
@@ -3783,7 +3783,7 @@ static bool8 GridSquares_Init(struct Task *task)
|
||||
|
||||
static bool8 GridSquares_Main(struct Task *task)
|
||||
{
|
||||
u16* tileset;
|
||||
u16 *tileset;
|
||||
|
||||
if (task->tDelay == 0)
|
||||
{
|
||||
@@ -4061,7 +4061,7 @@ static void GetBg0TilemapDst(u16 **tileset)
|
||||
{
|
||||
u16 charBase = REG_BG0CNT >> 2;
|
||||
charBase <<= 14;
|
||||
*tileset = (u16*)(BG_VRAM + charBase);
|
||||
*tileset = (u16 *)(BG_VRAM + charBase);
|
||||
}
|
||||
|
||||
void GetBg0TilesDst(u16 **tilemap, u16 **tileset)
|
||||
@@ -4072,8 +4072,8 @@ void GetBg0TilesDst(u16 **tilemap, u16 **tileset)
|
||||
screenBase <<= 11;
|
||||
charBase <<= 14;
|
||||
|
||||
*tilemap = (u16*)(BG_VRAM + screenBase);
|
||||
*tileset = (u16*)(BG_VRAM + charBase);
|
||||
*tilemap = (u16 *)(BG_VRAM + screenBase);
|
||||
*tileset = (u16 *)(BG_VRAM + charBase);
|
||||
}
|
||||
|
||||
static void FadeScreenBlack(void)
|
||||
@@ -4170,13 +4170,13 @@ static void InitBlackWipe(s16 *data, s16 startX, s16 startY, s16 endX, s16 endY,
|
||||
static bool8 UpdateBlackWipe(s16 *data, bool8 xExact, bool8 yExact)
|
||||
{
|
||||
u8 numFinished;
|
||||
|
||||
|
||||
if (tWipeXDist > tWipeYDist)
|
||||
{
|
||||
// X has further to move, move it first
|
||||
tWipeCurrX += tWipeXMove;
|
||||
|
||||
// If it has been far enough since Y's
|
||||
// If it has been far enough since Y's
|
||||
// last move then move it too
|
||||
tWipeTemp += tWipeYDist;
|
||||
if (tWipeTemp > tWipeXDist)
|
||||
@@ -4190,7 +4190,7 @@ static bool8 UpdateBlackWipe(s16 *data, bool8 xExact, bool8 yExact)
|
||||
// Y has further to move, move it first
|
||||
tWipeCurrY += tWipeYMove;
|
||||
|
||||
// If it has been far enough since X's
|
||||
// If it has been far enough since X's
|
||||
// last move then move it too
|
||||
tWipeTemp += tWipeXDist;
|
||||
if (tWipeTemp > tWipeYDist)
|
||||
@@ -4201,9 +4201,9 @@ static bool8 UpdateBlackWipe(s16 *data, bool8 xExact, bool8 yExact)
|
||||
}
|
||||
|
||||
numFinished = 0;
|
||||
|
||||
|
||||
// Has X coord reached end?
|
||||
if ((tWipeXMove > 0 && tWipeCurrX >= tWipeEndX)
|
||||
if ((tWipeXMove > 0 && tWipeCurrX >= tWipeEndX)
|
||||
|| (tWipeXMove < 0 && tWipeCurrX <= tWipeEndX))
|
||||
{
|
||||
numFinished++;
|
||||
@@ -4212,7 +4212,7 @@ static bool8 UpdateBlackWipe(s16 *data, bool8 xExact, bool8 yExact)
|
||||
}
|
||||
|
||||
// Has Y coord reached end?
|
||||
if ((tWipeYMove > 0 && tWipeCurrY >= tWipeEndY)
|
||||
if ((tWipeYMove > 0 && tWipeCurrY >= tWipeEndY)
|
||||
|| (tWipeYMove < 0 && tWipeCurrY <= tWipeEndY))
|
||||
{
|
||||
numFinished++;
|
||||
@@ -4762,10 +4762,8 @@ static bool8 FrontierSquaresScroll_End(struct Task *task)
|
||||
BlendPalettes(PALETTES_ALL, 16, RGB_BLACK);
|
||||
|
||||
DestroyTask(FindTaskIdByFunc(task->func));
|
||||
task->tState++; // Changing value of a destroyed task
|
||||
|
||||
#ifndef UBFIX
|
||||
task->tState++; // UB: changing value of a destroyed task
|
||||
#endif
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ static const struct OamData sOamData_LogoCircles =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(64x64),
|
||||
.x = 0,
|
||||
|
||||
+85
-84
@@ -93,7 +93,7 @@ void HandleAction_UseMove(void)
|
||||
gBattleStruct->atkCancellerTracker = 0;
|
||||
gMoveResultFlags = 0;
|
||||
gMultiHitCounter = 0;
|
||||
gBattleCommunication[6] = 0;
|
||||
gBattleCommunication[MISS_TYPE] = 0;
|
||||
gCurrMovePos = gChosenMovePos = *(gBattleStruct->chosenMovePositions + gBattlerAttacker);
|
||||
|
||||
// choose move
|
||||
@@ -146,7 +146,7 @@ void HandleAction_UseMove(void)
|
||||
}
|
||||
|
||||
// choose target
|
||||
side = GetBattlerSide(gBattlerAttacker) ^ BIT_SIDE;
|
||||
side = BATTLE_OPPOSITE(GetBattlerSide(gBattlerAttacker));
|
||||
if (gSideTimers[side].followmeTimer != 0
|
||||
&& gBattleMoves[gCurrentMove].target == MOVE_TARGET_SELECTED
|
||||
&& GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gSideTimers[side].followmeTarget)
|
||||
@@ -200,13 +200,13 @@ void HandleAction_UseMove(void)
|
||||
{
|
||||
if (GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gBattlerTarget))
|
||||
{
|
||||
gBattlerTarget = GetBattlerAtPosition(GetBattlerPosition(gBattlerTarget) ^ BIT_FLANK);
|
||||
gBattlerTarget = GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gBattlerTarget)));
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattlerTarget = GetBattlerAtPosition(GetBattlerPosition(gBattlerAttacker) ^ BIT_SIDE);
|
||||
gBattlerTarget = GetBattlerAtPosition(BATTLE_OPPOSITE(GetBattlerPosition(gBattlerAttacker)));
|
||||
if (gAbsentBattlerFlags & gBitTable[gBattlerTarget])
|
||||
gBattlerTarget = GetBattlerAtPosition(GetBattlerPosition(gBattlerTarget) ^ BIT_FLANK);
|
||||
gBattlerTarget = GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gBattlerTarget)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -239,7 +239,7 @@ void HandleAction_UseMove(void)
|
||||
if (gAbsentBattlerFlags & gBitTable[gBattlerTarget]
|
||||
&& GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gBattlerTarget))
|
||||
{
|
||||
gBattlerTarget = GetBattlerAtPosition(GetBattlerPosition(gBattlerTarget) ^ BIT_FLANK);
|
||||
gBattlerTarget = GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gBattlerTarget)));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -249,13 +249,13 @@ void HandleAction_UseMove(void)
|
||||
{
|
||||
if (GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gBattlerTarget))
|
||||
{
|
||||
gBattlerTarget = GetBattlerAtPosition(GetBattlerPosition(gBattlerTarget) ^ BIT_FLANK);
|
||||
gBattlerTarget = GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gBattlerTarget)));
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattlerTarget = GetBattlerAtPosition(GetBattlerPosition(gBattlerAttacker) ^ BIT_SIDE);
|
||||
gBattlerTarget = GetBattlerAtPosition(BATTLE_OPPOSITE(GetBattlerPosition(gBattlerAttacker)));
|
||||
if (gAbsentBattlerFlags & gBitTable[gBattlerTarget])
|
||||
gBattlerTarget = GetBattlerAtPosition(GetBattlerPosition(gBattlerTarget) ^ BIT_FLANK);
|
||||
gBattlerTarget = GetBattlerAtPosition(BATTLE_PARTNER(GetBattlerPosition(gBattlerTarget)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -471,7 +471,7 @@ bool8 TryRunFromBattle(u8 battler)
|
||||
gBattleStruct->runTries++;
|
||||
}
|
||||
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
{
|
||||
gCurrentTurnActionNumber = gBattlersCount;
|
||||
gBattleOutcome = B_OUTCOME_RAN;
|
||||
@@ -679,10 +679,12 @@ void HandleAction_ActionFinished(void)
|
||||
gBattleResources->battleScriptsStack->size = 0;
|
||||
}
|
||||
|
||||
#define SOUND_MOVES_END 0xFFFF
|
||||
|
||||
static const u16 sSoundMovesTable[] =
|
||||
{
|
||||
MOVE_GROWL, MOVE_ROAR, MOVE_SING, MOVE_SUPERSONIC, MOVE_SCREECH, MOVE_SNORE,
|
||||
MOVE_UPROAR, MOVE_METAL_SOUND, MOVE_GRASS_WHISTLE, MOVE_HYPER_VOICE, 0xFFFF
|
||||
MOVE_UPROAR, MOVE_METAL_SOUND, MOVE_GRASS_WHISTLE, MOVE_HYPER_VOICE, SOUND_MOVES_END
|
||||
};
|
||||
|
||||
u8 GetBattlerForBattleScript(u8 caseId)
|
||||
@@ -821,7 +823,8 @@ void PressurePPLoseOnUsingPerishSong(u8 attacker)
|
||||
}
|
||||
}
|
||||
|
||||
void MarkAllBattlersForControllerExec(void) // unused
|
||||
// Unused
|
||||
static void MarkAllBattlersForControllerExec(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -959,7 +962,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
|
||||
u8 limitations = 0;
|
||||
u16 move = gBattleMons[gActiveBattler].moves[gBattleBufferB[gActiveBattler][2]];
|
||||
u8 holdEffect;
|
||||
u16* choicedMove = &gBattleStruct->choicedMove[gActiveBattler];
|
||||
u16 *choicedMove = &gBattleStruct->choicedMove[gActiveBattler];
|
||||
|
||||
if (gDisableStructs[gActiveBattler].disabledMove == move && move != MOVE_NONE)
|
||||
{
|
||||
@@ -1029,7 +1032,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
|
||||
|
||||
gPotentialItemEffectBattler = gActiveBattler;
|
||||
|
||||
if (holdEffect == HOLD_EFFECT_CHOICE_BAND && *choicedMove != MOVE_NONE && *choicedMove != 0xFFFF && *choicedMove != move)
|
||||
if (holdEffect == HOLD_EFFECT_CHOICE_BAND && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != move)
|
||||
{
|
||||
gCurrentMove = *choicedMove;
|
||||
gLastUsedItem = gBattleMons[gActiveBattler].item;
|
||||
@@ -1097,7 +1100,7 @@ u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check)
|
||||
if (gDisableStructs[battlerId].encoreTimer && gDisableStructs[battlerId].encoredMove != gBattleMons[battlerId].moves[i])
|
||||
unusableMoves |= gBitTable[i];
|
||||
// Choice Band
|
||||
if (holdEffect == HOLD_EFFECT_CHOICE_BAND && *choicedMove != MOVE_NONE && *choicedMove != 0xFFFF && *choicedMove != gBattleMons[battlerId].moves[i])
|
||||
if (holdEffect == HOLD_EFFECT_CHOICE_BAND && *choicedMove != MOVE_NONE && *choicedMove != MOVE_UNAVAILABLE && *choicedMove != gBattleMons[battlerId].moves[i])
|
||||
unusableMoves |= gBitTable[i];
|
||||
}
|
||||
return unusableMoves;
|
||||
@@ -1106,8 +1109,7 @@ u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check)
|
||||
#define ALL_MOVES_MASK ((1 << MAX_MON_MOVES) - 1)
|
||||
bool8 AreAllMovesUnusable(void)
|
||||
{
|
||||
u8 unusable;
|
||||
unusable = CheckMoveLimitations(gActiveBattler, 0, MOVE_LIMITATIONS_ALL);
|
||||
u8 unusable = CheckMoveLimitations(gActiveBattler, 0, MOVE_LIMITATIONS_ALL);
|
||||
|
||||
if (unusable == ALL_MOVES_MASK) // All moves are unusable.
|
||||
{
|
||||
@@ -1190,14 +1192,14 @@ u8 DoFieldEndTurnEffects(void)
|
||||
s32 j;
|
||||
for (j = i + 1; j < gBattlersCount; j++)
|
||||
{
|
||||
if (GetWhoStrikesFirst(gBattlerByTurnOrder[i], gBattlerByTurnOrder[j], 0))
|
||||
if (GetWhoStrikesFirst(gBattlerByTurnOrder[i], gBattlerByTurnOrder[j], FALSE))
|
||||
SwapTurnOrder(i, j);
|
||||
}
|
||||
}
|
||||
|
||||
// It's stupid, but won't match without it
|
||||
{
|
||||
u8* var = &gBattleStruct->turnCountersTracker;
|
||||
u8 *var = &gBattleStruct->turnCountersTracker;
|
||||
(*var)++;
|
||||
gBattleStruct->turnSideTracker = 0;
|
||||
}
|
||||
@@ -1218,10 +1220,10 @@ u8 DoFieldEndTurnEffects(void)
|
||||
}
|
||||
}
|
||||
gBattleStruct->turnSideTracker++;
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
break;
|
||||
}
|
||||
if (!effect)
|
||||
if (effect == 0)
|
||||
{
|
||||
gBattleStruct->turnCountersTracker++;
|
||||
gBattleStruct->turnSideTracker = 0;
|
||||
@@ -1244,10 +1246,10 @@ u8 DoFieldEndTurnEffects(void)
|
||||
}
|
||||
}
|
||||
gBattleStruct->turnSideTracker++;
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
break;
|
||||
}
|
||||
if (!effect)
|
||||
if (effect == 0)
|
||||
{
|
||||
gBattleStruct->turnCountersTracker++;
|
||||
gBattleStruct->turnSideTracker = 0;
|
||||
@@ -1258,8 +1260,7 @@ u8 DoFieldEndTurnEffects(void)
|
||||
{
|
||||
side = gBattleStruct->turnSideTracker;
|
||||
gActiveBattler = gBattlerAttacker = gSideTimers[side].mistBattlerId;
|
||||
if (gSideTimers[side].mistTimer != 0
|
||||
&& --gSideTimers[side].mistTimer == 0)
|
||||
if (gSideTimers[side].mistTimer != 0 && --gSideTimers[side].mistTimer == 0)
|
||||
{
|
||||
gSideStatuses[side] &= ~SIDE_STATUS_MIST;
|
||||
BattleScriptExecute(BattleScript_SideStatusWoreOff);
|
||||
@@ -1268,10 +1269,10 @@ u8 DoFieldEndTurnEffects(void)
|
||||
effect++;
|
||||
}
|
||||
gBattleStruct->turnSideTracker++;
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
break;
|
||||
}
|
||||
if (!effect)
|
||||
if (effect == 0)
|
||||
{
|
||||
gBattleStruct->turnCountersTracker++;
|
||||
gBattleStruct->turnSideTracker = 0;
|
||||
@@ -1292,10 +1293,10 @@ u8 DoFieldEndTurnEffects(void)
|
||||
}
|
||||
}
|
||||
gBattleStruct->turnSideTracker++;
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
break;
|
||||
}
|
||||
if (!effect)
|
||||
if (effect == 0)
|
||||
{
|
||||
gBattleStruct->turnCountersTracker++;
|
||||
gBattleStruct->turnSideTracker = 0;
|
||||
@@ -1314,10 +1315,10 @@ u8 DoFieldEndTurnEffects(void)
|
||||
effect++;
|
||||
}
|
||||
gBattleStruct->turnSideTracker++;
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
break;
|
||||
}
|
||||
if (!effect)
|
||||
if (effect == 0)
|
||||
{
|
||||
gBattleStruct->turnCountersTracker++;
|
||||
}
|
||||
@@ -1685,12 +1686,12 @@ u8 DoBattlerEndTurnEffects(void)
|
||||
}
|
||||
if (i == MAX_MON_MOVES) // pokemon does not have the disabled move anymore
|
||||
{
|
||||
gDisableStructs[gActiveBattler].disabledMove = 0;
|
||||
gDisableStructs[gActiveBattler].disabledMove = MOVE_NONE;
|
||||
gDisableStructs[gActiveBattler].disableTimer = 0;
|
||||
}
|
||||
else if (--gDisableStructs[gActiveBattler].disableTimer == 0) // disable ends
|
||||
{
|
||||
gDisableStructs[gActiveBattler].disabledMove = 0;
|
||||
gDisableStructs[gActiveBattler].disabledMove = MOVE_NONE;
|
||||
BattleScriptExecute(BattleScript_DisabledNoMore);
|
||||
effect++;
|
||||
}
|
||||
@@ -1702,13 +1703,13 @@ u8 DoBattlerEndTurnEffects(void)
|
||||
{
|
||||
if (gBattleMons[gActiveBattler].moves[gDisableStructs[gActiveBattler].encoredMovePos] != gDisableStructs[gActiveBattler].encoredMove) // pokemon does not have the encored move anymore
|
||||
{
|
||||
gDisableStructs[gActiveBattler].encoredMove = 0;
|
||||
gDisableStructs[gActiveBattler].encoredMove = MOVE_NONE;
|
||||
gDisableStructs[gActiveBattler].encoreTimer = 0;
|
||||
}
|
||||
else if (--gDisableStructs[gActiveBattler].encoreTimer == 0
|
||||
|| gBattleMons[gActiveBattler].pp[gDisableStructs[gActiveBattler].encoredMovePos] == 0)
|
||||
{
|
||||
gDisableStructs[gActiveBattler].encoredMove = 0;
|
||||
gDisableStructs[gActiveBattler].encoredMove = MOVE_NONE;
|
||||
gDisableStructs[gActiveBattler].encoreTimer = 0;
|
||||
BattleScriptExecute(BattleScript_EncoredNoMore);
|
||||
effect++;
|
||||
@@ -1798,7 +1799,7 @@ bool8 HandleWishPerishSongOnTurnEnd(void)
|
||||
BattleScriptExecute(BattleScript_MonTookFutureAttack);
|
||||
|
||||
if (gWishFutureKnock.futureSightCounter[gActiveBattler] == 0
|
||||
&& gWishFutureKnock.futureSightCounter[gActiveBattler ^ BIT_FLANK] == 0)
|
||||
&& gWishFutureKnock.futureSightCounter[BATTLE_PARTNER(gActiveBattler)] == 0)
|
||||
{
|
||||
gSideStatuses[GET_BATTLER_SIDE(gBattlerTarget)] &= ~SIDE_STATUS_FUTUREATTACK;
|
||||
}
|
||||
@@ -2101,7 +2102,7 @@ u8 AtkCanceller_UnableToUseMove(void)
|
||||
gBattleStruct->atkCancellerTracker++;
|
||||
break;
|
||||
case CANCELLER_DISABLED: // disabled move
|
||||
if (gDisableStructs[gBattlerAttacker].disabledMove == gCurrentMove && gDisableStructs[gBattlerAttacker].disabledMove != 0)
|
||||
if (gDisableStructs[gBattlerAttacker].disabledMove == gCurrentMove && gDisableStructs[gBattlerAttacker].disabledMove != MOVE_NONE)
|
||||
{
|
||||
gProtectStructs[gBattlerAttacker].usedDisabledMove = 1;
|
||||
gBattleScripting.battler = gBattlerAttacker;
|
||||
@@ -2170,7 +2171,7 @@ u8 AtkCanceller_UnableToUseMove(void)
|
||||
if ((gBattleMons[gBattlerAttacker].status1 & STATUS1_PARALYSIS) && (Random() % 4) == 0)
|
||||
{
|
||||
gProtectStructs[gBattlerAttacker].prlzImmobility = 1;
|
||||
// This is removed in Emerald for some reason
|
||||
// This is removed in FRLG and Emerald for some reason
|
||||
//CancelMultiTurnMoves(gBattlerAttacker);
|
||||
gBattlescriptCurrInstr = BattleScript_MoveUsedIsParalyzed;
|
||||
gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE;
|
||||
@@ -2208,7 +2209,7 @@ u8 AtkCanceller_UnableToUseMove(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
// This is removed in Emerald for some reason
|
||||
// This is removed in FRLG and Emerald for some reason
|
||||
//gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_MULTIPLETURNS;
|
||||
if (gTakenDmg[gBattlerAttacker])
|
||||
{
|
||||
@@ -2259,8 +2260,8 @@ u8 AtkCanceller_UnableToUseMove(void)
|
||||
|
||||
bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2)
|
||||
{
|
||||
u8 playerId, flankId;
|
||||
struct Pokemon *party;
|
||||
u8 id1, id2;
|
||||
s32 i;
|
||||
|
||||
if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE))
|
||||
@@ -2273,15 +2274,15 @@ bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2)
|
||||
else
|
||||
party = gEnemyParty;
|
||||
|
||||
id1 = ((battler & BIT_FLANK) / 2);
|
||||
for (i = id1 * MULTI_PARTY_SIZE; i < id1 * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE; i++)
|
||||
playerId = ((battler & BIT_FLANK) / 2);
|
||||
for (i = playerId * MULTI_PARTY_SIZE; i < playerId * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE; i++)
|
||||
{
|
||||
if (GetMonData(&party[i], MON_DATA_HP) != 0
|
||||
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE
|
||||
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG)
|
||||
break;
|
||||
}
|
||||
return (i == id1 * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE);
|
||||
return (i == playerId * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE);
|
||||
}
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
|
||||
{
|
||||
@@ -2290,76 +2291,76 @@ bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2)
|
||||
if (GetBattlerSide(battler) == B_SIDE_PLAYER)
|
||||
{
|
||||
party = gPlayerParty;
|
||||
id2 = GetBattlerMultiplayerId(battler);
|
||||
id1 = GetLinkTrainerFlankId(id2);
|
||||
flankId = GetBattlerMultiplayerId(battler);
|
||||
playerId = GetLinkTrainerFlankId(flankId);
|
||||
}
|
||||
else
|
||||
{
|
||||
party = gEnemyParty;
|
||||
if (battler == 1)
|
||||
id1 = 0;
|
||||
playerId = 0;
|
||||
else
|
||||
id1 = 1;
|
||||
playerId = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
id2 = GetBattlerMultiplayerId(battler);
|
||||
flankId = GetBattlerMultiplayerId(battler);
|
||||
|
||||
if (GetBattlerSide(battler) == B_SIDE_PLAYER)
|
||||
party = gPlayerParty;
|
||||
else
|
||||
party = gEnemyParty;
|
||||
|
||||
id1 = GetLinkTrainerFlankId(id2);
|
||||
playerId = GetLinkTrainerFlankId(flankId);
|
||||
}
|
||||
|
||||
for (i = id1 * MULTI_PARTY_SIZE; i < id1 * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE; i++)
|
||||
for (i = playerId * MULTI_PARTY_SIZE; i < playerId * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE; i++)
|
||||
{
|
||||
if (GetMonData(&party[i], MON_DATA_HP) != 0
|
||||
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE
|
||||
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG)
|
||||
break;
|
||||
}
|
||||
return (i == id1 * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE);
|
||||
return (i == playerId * MULTI_PARTY_SIZE + MULTI_PARTY_SIZE);
|
||||
}
|
||||
else if ((gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) && GetBattlerSide(battler) == B_SIDE_OPPONENT)
|
||||
{
|
||||
party = gEnemyParty;
|
||||
|
||||
if (battler == 1)
|
||||
id1 = 0;
|
||||
playerId = 0;
|
||||
else
|
||||
id1 = MULTI_PARTY_SIZE;
|
||||
playerId = MULTI_PARTY_SIZE;
|
||||
|
||||
for (i = id1; i < id1 + MULTI_PARTY_SIZE; i++)
|
||||
for (i = playerId; i < playerId + MULTI_PARTY_SIZE; i++)
|
||||
{
|
||||
if (GetMonData(&party[i], MON_DATA_HP) != 0
|
||||
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE
|
||||
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG)
|
||||
break;
|
||||
}
|
||||
return (i == id1 + 3);
|
||||
return (i == playerId + 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GetBattlerSide(battler) == B_SIDE_OPPONENT)
|
||||
{
|
||||
id2 = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT);
|
||||
id1 = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT);
|
||||
flankId = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT);
|
||||
playerId = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT);
|
||||
party = gEnemyParty;
|
||||
}
|
||||
else
|
||||
{
|
||||
id2 = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT);
|
||||
id1 = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT);
|
||||
flankId = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT);
|
||||
playerId = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT);
|
||||
party = gPlayerParty;
|
||||
}
|
||||
|
||||
if (partyIdBattlerOn1 == PARTY_SIZE)
|
||||
partyIdBattlerOn1 = gBattlerPartyIndexes[id2];
|
||||
partyIdBattlerOn1 = gBattlerPartyIndexes[flankId];
|
||||
if (partyIdBattlerOn2 == PARTY_SIZE)
|
||||
partyIdBattlerOn2 = gBattlerPartyIndexes[id1];
|
||||
partyIdBattlerOn2 = gBattlerPartyIndexes[playerId];
|
||||
|
||||
for (i = 0; i < PARTY_SIZE; i++)
|
||||
{
|
||||
@@ -2367,7 +2368,7 @@ bool8 HasNoMonsToSwitch(u8 battler, u8 partyIdBattlerOn1, u8 partyIdBattlerOn2)
|
||||
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE
|
||||
&& GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG
|
||||
&& i != partyIdBattlerOn1 && i != partyIdBattlerOn2
|
||||
&& i != *(gBattleStruct->monToSwitchIntoId + id2) && i != id1[gBattleStruct->monToSwitchIntoId])
|
||||
&& i != *(gBattleStruct->monToSwitchIntoId + flankId) && i != playerId[gBattleStruct->monToSwitchIntoId])
|
||||
break;
|
||||
}
|
||||
return (i == PARTY_SIZE);
|
||||
@@ -2504,7 +2505,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
{
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = GetCurrentWeather();
|
||||
BattleScriptPushCursorAndCallback(BattleScript_OverworldWeatherStarts);
|
||||
@@ -2546,7 +2547,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
break;
|
||||
case ABILITY_FORECAST:
|
||||
effect = CastformDataTypeChange(battler);
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
{
|
||||
BattleScriptPushCursorAndCallback(BattleScript_CastformChange);
|
||||
gBattleScripting.battler = battler;
|
||||
@@ -2567,7 +2568,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
for (target1 = 0; target1 < gBattlersCount; target1++)
|
||||
{
|
||||
effect = CastformDataTypeChange(target1);
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
{
|
||||
BattleScriptPushCursorAndCallback(BattleScript_CastformChange);
|
||||
gBattleScripting.battler = target1;
|
||||
@@ -2640,12 +2641,12 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
case ABILITYEFFECT_MOVES_BLOCK: // 2
|
||||
if (gLastUsedAbility == ABILITY_SOUNDPROOF)
|
||||
{
|
||||
for (i = 0; sSoundMovesTable[i] != 0xFFFF; i++)
|
||||
for (i = 0; sSoundMovesTable[i] != SOUND_MOVES_END; i++)
|
||||
{
|
||||
if (sSoundMovesTable[i] == move)
|
||||
break;
|
||||
}
|
||||
if (sSoundMovesTable[i] != 0xFFFF)
|
||||
if (sSoundMovesTable[i] != SOUND_MOVES_END)
|
||||
{
|
||||
if (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS)
|
||||
gHitMarker |= HITMARKER_NO_PPDEDUCT;
|
||||
@@ -2907,7 +2908,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
{
|
||||
switch (effect)
|
||||
{
|
||||
@@ -2938,7 +2939,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
if (gBattleMons[battler].ability == ABILITY_FORECAST)
|
||||
{
|
||||
effect = CastformDataTypeChange(battler);
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
{
|
||||
BattleScriptPushCursorAndCallback(BattleScript_CastformChange);
|
||||
gBattleScripting.battler = battler;
|
||||
@@ -3000,27 +3001,27 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
if (gBattleMons[i].ability == ABILITY_TRACE && (gStatuses3[i] & STATUS3_TRACE))
|
||||
{
|
||||
u8 target2;
|
||||
side = (GetBattlerPosition(i) ^ BIT_SIDE) & BIT_SIDE; // side of the opposing pokemon
|
||||
side = BATTLE_OPPOSITE(GetBattlerPosition(i)) & BIT_SIDE; // side of the opposing pokemon
|
||||
target1 = GetBattlerAtPosition(side);
|
||||
target2 = GetBattlerAtPosition(side + BIT_FLANK);
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
|
||||
{
|
||||
if (gBattleMons[target1].ability != 0 && gBattleMons[target1].hp != 0
|
||||
&& gBattleMons[target2].ability != 0 && gBattleMons[target2].hp != 0)
|
||||
if (gBattleMons[target1].ability != ABILITY_NONE && gBattleMons[target1].hp != 0
|
||||
&& gBattleMons[target2].ability != ABILITY_NONE && gBattleMons[target2].hp != 0)
|
||||
{
|
||||
gActiveBattler = GetBattlerAtPosition(((Random() & 1) * 2) | side);
|
||||
gBattleMons[i].ability = gBattleMons[gActiveBattler].ability;
|
||||
gLastUsedAbility = gBattleMons[gActiveBattler].ability;
|
||||
effect++;
|
||||
}
|
||||
else if (gBattleMons[target1].ability != 0 && gBattleMons[target1].hp != 0)
|
||||
else if (gBattleMons[target1].ability != ABILITY_NONE && gBattleMons[target1].hp != 0)
|
||||
{
|
||||
gActiveBattler = target1;
|
||||
gBattleMons[i].ability = gBattleMons[gActiveBattler].ability;
|
||||
gLastUsedAbility = gBattleMons[gActiveBattler].ability;
|
||||
effect++;
|
||||
}
|
||||
else if (gBattleMons[target2].ability != 0 && gBattleMons[target2].hp != 0)
|
||||
else if (gBattleMons[target2].ability != ABILITY_NONE && gBattleMons[target2].hp != 0)
|
||||
{
|
||||
gActiveBattler = target2;
|
||||
gBattleMons[i].ability = gBattleMons[gActiveBattler].ability;
|
||||
@@ -3038,7 +3039,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
effect++;
|
||||
}
|
||||
}
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
{
|
||||
BattleScriptPushCursorAndCallback(BattleScript_TraceActivates);
|
||||
gStatuses3[i] &= ~STATUS3_TRACE;
|
||||
@@ -3298,7 +3299,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
effect = ITEM_STATS_CHANGE;
|
||||
}
|
||||
}
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
{
|
||||
gBattleScripting.battler = battlerId;
|
||||
gPotentialItemEffectBattler = battlerId;
|
||||
@@ -3369,7 +3370,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
effect = ITEM_STATS_CHANGE;
|
||||
}
|
||||
}
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
{
|
||||
gBattleScripting.battler = battlerId;
|
||||
gPotentialItemEffectBattler = battlerId;
|
||||
@@ -3581,7 +3582,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
{
|
||||
gBattleScripting.battler = battlerId;
|
||||
gPotentialItemEffectBattler = battlerId;
|
||||
@@ -3725,7 +3726,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
effect = ITEM_STATS_CHANGE;
|
||||
}
|
||||
}
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
{
|
||||
gBattleScripting.battler = battlerId;
|
||||
gPotentialItemEffectBattler = battlerId;
|
||||
@@ -3735,7 +3736,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (effect)
|
||||
if (effect != 0)
|
||||
{
|
||||
gBattleScripting.battler = battlerId;
|
||||
gPotentialItemEffectBattler = battlerId;
|
||||
@@ -3819,7 +3820,7 @@ u8 GetMoveTarget(u16 move, u8 setTarget)
|
||||
switch (moveTarget)
|
||||
{
|
||||
case MOVE_TARGET_SELECTED:
|
||||
side = GetBattlerSide(gBattlerAttacker) ^ BIT_SIDE;
|
||||
side = BATTLE_OPPOSITE(GetBattlerSide(gBattlerAttacker));
|
||||
if (gSideTimers[side].followmeTimer && gBattleMons[gSideTimers[side].followmeTarget].hp)
|
||||
targetBattler = gSideTimers[side].followmeTarget;
|
||||
else
|
||||
@@ -3843,12 +3844,12 @@ u8 GetMoveTarget(u16 move, u8 setTarget)
|
||||
case MOVE_TARGET_BOTH:
|
||||
case MOVE_TARGET_FOES_AND_ALLY:
|
||||
case MOVE_TARGET_OPPONENTS_FIELD:
|
||||
targetBattler = GetBattlerAtPosition((GetBattlerPosition(gBattlerAttacker) & BIT_SIDE) ^ BIT_SIDE);
|
||||
targetBattler = GetBattlerAtPosition(BATTLE_OPPOSITE(GET_BATTLER_SIDE(gBattlerAttacker)));
|
||||
if (gAbsentBattlerFlags & gBitTable[targetBattler])
|
||||
targetBattler ^= BIT_FLANK;
|
||||
break;
|
||||
case MOVE_TARGET_RANDOM:
|
||||
side = GetBattlerSide(gBattlerAttacker) ^ BIT_SIDE;
|
||||
side = BATTLE_OPPOSITE(GetBattlerSide(gBattlerAttacker));
|
||||
if (gSideTimers[side].followmeTimer && gBattleMons[gSideTimers[side].followmeTarget].hp)
|
||||
targetBattler = gSideTimers[side].followmeTarget;
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE && moveTarget & MOVE_TARGET_RANDOM)
|
||||
@@ -3871,7 +3872,7 @@ u8 GetMoveTarget(u16 move, u8 setTarget)
|
||||
targetBattler ^= BIT_FLANK;
|
||||
}
|
||||
else
|
||||
targetBattler = GetBattlerAtPosition((GetBattlerPosition(gBattlerAttacker) & BIT_SIDE) ^ BIT_SIDE);
|
||||
targetBattler = GetBattlerAtPosition(BATTLE_OPPOSITE(GET_BATTLER_SIDE(gBattlerAttacker)));
|
||||
break;
|
||||
case MOVE_TARGET_USER_OR_SELECTED:
|
||||
case MOVE_TARGET_USER:
|
||||
|
||||
+2
-2
@@ -109,12 +109,12 @@ void SwitchPartyOrderInGameMulti(u8 battlerId, u8 arg1)
|
||||
{
|
||||
s32 i;
|
||||
for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++)
|
||||
gBattlePartyCurrentOrder[i] = *(0 * 3 + i + (u8*)(gBattleStruct->battlerPartyOrders));
|
||||
gBattlePartyCurrentOrder[i] = *(0 * 3 + i + (u8 *)(gBattleStruct->battlerPartyOrders));
|
||||
|
||||
SwitchPartyMonSlots(GetPartyIdFromBattlePartyId(gBattlerPartyIndexes[battlerId]), GetPartyIdFromBattlePartyId(arg1));
|
||||
|
||||
for (i = 0; i < (int)ARRAY_COUNT(gBattlePartyCurrentOrder); i++)
|
||||
*(0 * 3 + i + (u8*)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i];
|
||||
*(0 * 3 + i + (u8 *)(gBattleStruct->battlerPartyOrders)) = gBattlePartyCurrentOrder[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -946,7 +946,7 @@ void ClearEnigmaBerries(void)
|
||||
void SetEnigmaBerry(u8 *src)
|
||||
{
|
||||
u32 i;
|
||||
u8 *dest = (u8*)&gSaveBlock1Ptr->enigmaBerry;
|
||||
u8 *dest = (u8 *)&gSaveBlock1Ptr->enigmaBerry;
|
||||
|
||||
for (i = 0; i < sizeof(gSaveBlock1Ptr->enigmaBerry); i++)
|
||||
dest[i] = src[i];
|
||||
@@ -958,7 +958,7 @@ static u32 GetEnigmaBerryChecksum(struct EnigmaBerry *enigmaBerry)
|
||||
u32 checksum;
|
||||
u8 *dest;
|
||||
|
||||
dest = (u8*)enigmaBerry;
|
||||
dest = (u8 *)enigmaBerry;
|
||||
checksum = 0;
|
||||
for (i = 0; i < sizeof(gSaveBlock1Ptr->enigmaBerry) - sizeof(gSaveBlock1Ptr->enigmaBerry.checksum); i++)
|
||||
checksum += dest[i];
|
||||
@@ -980,7 +980,7 @@ bool32 IsEnigmaBerryValid(void)
|
||||
const struct Berry *GetBerryInfo(u8 berry)
|
||||
{
|
||||
if (berry == ITEM_TO_BERRY(ITEM_ENIGMA_BERRY) && IsEnigmaBerryValid())
|
||||
return (struct Berry*)(&gSaveBlock1Ptr->enigmaBerry.berry);
|
||||
return (struct Berry *)(&gSaveBlock1Ptr->enigmaBerry.berry);
|
||||
else
|
||||
{
|
||||
if (berry == BERRY_NONE || berry > ITEM_TO_BERRY(LAST_BERRY_INDEX))
|
||||
@@ -1172,7 +1172,7 @@ void GetBerryNameByBerryType(u8 berry, u8 *string)
|
||||
string[BERRY_NAME_LENGTH] = EOS;
|
||||
}
|
||||
|
||||
void GetBerryCountStringByBerryType(u8 berry, u8* dest, u32 berryCount)
|
||||
void GetBerryCountStringByBerryType(u8 berry, u8 *dest, u32 berryCount)
|
||||
{
|
||||
GetBerryCountString(dest, GetBerryInfo(berry)->name, berryCount);
|
||||
}
|
||||
@@ -1300,7 +1300,7 @@ void ObjectEventInteractionPlantBerryTree(void)
|
||||
{
|
||||
u8 berry = ItemIdToBerryType(gSpecialVar_ItemId);
|
||||
|
||||
PlantBerryTree(GetObjectEventBerryTreeId(gSelectedObjectEvent), berry, 1, TRUE);
|
||||
PlantBerryTree(GetObjectEventBerryTreeId(gSelectedObjectEvent), berry, BERRY_STAGE_PLANTED, TRUE);
|
||||
ObjectEventInteractionGetBerryTreeData();
|
||||
}
|
||||
|
||||
|
||||
+34
-34
@@ -215,7 +215,7 @@ static void SetPlayerBerryData(u8, u16);
|
||||
static void Blender_AddTextPrinter(u8, const u8 *, u8, u8, s32, s32);
|
||||
static void ResetLinkCmds(void);
|
||||
static void CreateParticleSprites(void);
|
||||
static void ShakeBgCoordForHit(s16*, u16);
|
||||
static void ShakeBgCoordForHit(s16 *, u16);
|
||||
static void TryUpdateProgressBar(u16, u16);
|
||||
static void UpdateRPM(u16);
|
||||
static void RestoreBgCoords(void);
|
||||
@@ -265,7 +265,7 @@ static const u8 sText_Master[] = _("MASTER");
|
||||
static const u8 sText_Dude[] = _("DUDE");
|
||||
static const u8 sText_Miss[] = _("MISS");
|
||||
|
||||
static const u8* const sBlenderOpponentsNames[] =
|
||||
static const u8 *const sBlenderOpponentsNames[] =
|
||||
{
|
||||
[BLENDER_MISTER] = sText_Mister,
|
||||
[BLENDER_LADDIE] = sText_Laddie,
|
||||
@@ -456,7 +456,7 @@ static const struct OamData sOam_PlayerArrow =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(32x32),
|
||||
.x = 0,
|
||||
@@ -599,7 +599,7 @@ static const struct OamData sOam_ScoreSymbols =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(16x16),
|
||||
.x = 0,
|
||||
@@ -668,7 +668,7 @@ static const struct OamData sOam_Particles =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(8x8),
|
||||
.x = 0,
|
||||
@@ -755,7 +755,7 @@ static const struct OamData sOam_CountdownNumbers =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(32x32),
|
||||
.x = 0,
|
||||
@@ -813,7 +813,7 @@ static const struct OamData sOam_Start =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(64x32),
|
||||
.x = 0,
|
||||
@@ -1145,7 +1145,7 @@ static void CB2_LoadBerryBlender(void)
|
||||
#define sYDownSpeed data[7]
|
||||
|
||||
// For throwing berries into the machine
|
||||
static void SpriteCB_Berry(struct Sprite* sprite)
|
||||
static void SpriteCB_Berry(struct Sprite *sprite)
|
||||
{
|
||||
sprite->sX += sprite->sXSpeed;
|
||||
sprite->sY -= sprite->sYUpSpeed;
|
||||
@@ -1166,7 +1166,7 @@ static void SpriteCB_Berry(struct Sprite* sprite)
|
||||
sprite->y = sprite->sY;
|
||||
}
|
||||
|
||||
static void SetBerrySpriteData(struct Sprite* sprite, s16 x, s16 y, s16 bounceSpeed, s16 xSpeed, s16 ySpeed)
|
||||
static void SetBerrySpriteData(struct Sprite *sprite, s16 x, s16 y, s16 bounceSpeed, s16 xSpeed, s16 ySpeed)
|
||||
{
|
||||
sprite->sTargetY = y;
|
||||
sprite->sX = x;
|
||||
@@ -1188,9 +1188,9 @@ static void SetBerrySpriteData(struct Sprite* sprite, s16 x, s16 y, s16 bounceSp
|
||||
#undef sXSpeed
|
||||
#undef sYDownSpeed
|
||||
|
||||
static void CreateBerrySprite(u16 a0, u8 playerId)
|
||||
static void CreateBerrySprite(u16 itemId, u8 playerId)
|
||||
{
|
||||
u8 spriteId = CreateSpinningBerrySprite(a0 + FIRST_BERRY_INDEX - 10, 0, 80, playerId & 1);
|
||||
u8 spriteId = CreateSpinningBerrySprite(ITEM_TO_BERRY(itemId) - 1, 0, 80, playerId & 1);
|
||||
SetBerrySpriteData(&gSprites[spriteId],
|
||||
sBerrySpriteData[playerId][0],
|
||||
sBerrySpriteData[playerId][1],
|
||||
@@ -2238,7 +2238,7 @@ static void CB2_PlayBlender(void)
|
||||
UpdatePaletteFade();
|
||||
}
|
||||
|
||||
static void Blender_DummiedOutFunc(s16 a0, s16 a1)
|
||||
static void Blender_DummiedOutFunc(s16 bgX, s16 bgY)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -2260,7 +2260,7 @@ static bool8 AreBlenderBerriesSame(struct BlenderBerry* berries, u8 a, u8 b)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static u32 CalculatePokeblockColor(struct BlenderBerry* berries, s16* _flavors, u8 numPlayers, u8 negativeFlavors)
|
||||
static u32 CalculatePokeblockColor(struct BlenderBerry* berries, s16 *_flavors, u8 numPlayers, u8 negativeFlavors)
|
||||
{
|
||||
s16 flavors[FLAVOR_COUNT + 1];
|
||||
s32 i, j;
|
||||
@@ -2494,7 +2494,7 @@ static void CalculatePokeblock(struct BlenderBerry *berries, struct Pokeblock *p
|
||||
}
|
||||
|
||||
// Unused
|
||||
static void Debug_CalculatePokeblock(struct BlenderBerry* berries, struct Pokeblock* pokeblock, u8 numPlayers, u8* flavors, u16 maxRPM)
|
||||
static void Debug_CalculatePokeblock(struct BlenderBerry* berries, struct Pokeblock* pokeblock, u8 numPlayers, u8 *flavors, u16 maxRPM)
|
||||
{
|
||||
CalculatePokeblock(berries, pokeblock, numPlayers, flavors, maxRPM);
|
||||
}
|
||||
@@ -2628,7 +2628,7 @@ static void CB2_EndBlenderGame(void)
|
||||
|
||||
if (gReceivedRemoteLinkPlayers && gWirelessCommType)
|
||||
{
|
||||
struct BlenderGameBlock *receivedBlock = (struct BlenderGameBlock*)(&gBlockRecvBuffer);
|
||||
struct BlenderGameBlock *receivedBlock = (struct BlenderGameBlock *)(&gBlockRecvBuffer);
|
||||
|
||||
sBerryBlender->maxRPM = receivedBlock->timeRPM.maxRPM;
|
||||
sBerryBlender->gameFrameTime = receivedBlock->timeRPM.time;
|
||||
@@ -2641,7 +2641,7 @@ static void CB2_EndBlenderGame(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
struct TimeAndRPM *receivedBlock = (struct TimeAndRPM*)(&gBlockRecvBuffer);
|
||||
struct TimeAndRPM *receivedBlock = (struct TimeAndRPM *)(&gBlockRecvBuffer);
|
||||
|
||||
sBerryBlender->maxRPM = receivedBlock->maxRPM;
|
||||
sBerryBlender->gameFrameTime = receivedBlock->time;
|
||||
@@ -3159,7 +3159,7 @@ static void SetBgPos(void)
|
||||
SetGpuReg(REG_OFFSET_BG0VOFS, sBerryBlender->bg_Y);
|
||||
}
|
||||
|
||||
static void SpriteCB_Particle(struct Sprite* sprite)
|
||||
static void SpriteCB_Particle(struct Sprite *sprite)
|
||||
{
|
||||
sprite->data[2] += sprite->data[0];
|
||||
sprite->data[3] += sprite->data[1];
|
||||
@@ -3194,7 +3194,7 @@ static void CreateParticleSprites(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void SpriteCB_ScoreSymbol(struct Sprite* sprite)
|
||||
static void SpriteCB_ScoreSymbol(struct Sprite *sprite)
|
||||
{
|
||||
sprite->data[0]++;
|
||||
sprite->y2 = -(sprite->data[0] / 3);
|
||||
@@ -3203,7 +3203,7 @@ static void SpriteCB_ScoreSymbol(struct Sprite* sprite)
|
||||
DestroySprite(sprite);
|
||||
}
|
||||
|
||||
static void SpriteCB_ScoreSymbolBest(struct Sprite* sprite)
|
||||
static void SpriteCB_ScoreSymbolBest(struct Sprite *sprite)
|
||||
{
|
||||
sprite->data[0]++;
|
||||
sprite->y2 = -(sprite->data[0] * 2);
|
||||
@@ -3225,7 +3225,7 @@ static void SetPlayerBerryData(u8 playerId, u16 itemId)
|
||||
#define sDelay data[2]
|
||||
#define sAnimId data[3]
|
||||
|
||||
static void SpriteCB_CountdownNumber(struct Sprite* sprite)
|
||||
static void SpriteCB_CountdownNumber(struct Sprite *sprite)
|
||||
{
|
||||
switch (sprite->sState)
|
||||
{
|
||||
@@ -3272,7 +3272,7 @@ static void SpriteCB_CountdownNumber(struct Sprite* sprite)
|
||||
#undef sDelay
|
||||
#undef sAnimId
|
||||
|
||||
static void SpriteCB_Start(struct Sprite* sprite)
|
||||
static void SpriteCB_Start(struct Sprite *sprite)
|
||||
{
|
||||
switch (sprite->data[0])
|
||||
{
|
||||
@@ -3318,7 +3318,7 @@ static void UpdateProgressBar(u16 value, u16 limit)
|
||||
s32 amountFilled, maxFilledSegment, subSegmentsFilled, i;
|
||||
u16 *vram;
|
||||
|
||||
vram = (u16*)(BG_SCREEN_ADDR(12));
|
||||
vram = (u16 *)(BG_SCREEN_ADDR(12));
|
||||
amountFilled = (value * 64) / limit;
|
||||
maxFilledSegment = amountFilled / 8;
|
||||
|
||||
@@ -3368,22 +3368,22 @@ static void UpdateRPM(u16 speed)
|
||||
digits[i] = currentRPM % 10;
|
||||
currentRPM /= 10;
|
||||
}
|
||||
*((u16*)(BG_SCREEN_ADDR(12) + 0x458)) = digits[4] + RPM_DIGIT;
|
||||
*((u16*)(BG_SCREEN_ADDR(12) + 0x45A)) = digits[3] + RPM_DIGIT;
|
||||
*((u16*)(BG_SCREEN_ADDR(12) + 0x45C)) = digits[2] + RPM_DIGIT;
|
||||
*((u16*)(BG_SCREEN_ADDR(12) + 0x460)) = digits[1] + RPM_DIGIT;
|
||||
*((u16*)(BG_SCREEN_ADDR(12) + 0x462)) = digits[0] + RPM_DIGIT;
|
||||
*((u16 *)(BG_SCREEN_ADDR(12) + 0x458)) = digits[4] + RPM_DIGIT;
|
||||
*((u16 *)(BG_SCREEN_ADDR(12) + 0x45A)) = digits[3] + RPM_DIGIT;
|
||||
*((u16 *)(BG_SCREEN_ADDR(12) + 0x45C)) = digits[2] + RPM_DIGIT;
|
||||
*((u16 *)(BG_SCREEN_ADDR(12) + 0x460)) = digits[1] + RPM_DIGIT;
|
||||
*((u16 *)(BG_SCREEN_ADDR(12) + 0x462)) = digits[0] + RPM_DIGIT;
|
||||
}
|
||||
|
||||
// Passed a pointer to the bg x/y
|
||||
// Used when hitting a Best at high RPM
|
||||
static void ShakeBgCoordForHit(s16* coord, u16 speed)
|
||||
static void ShakeBgCoordForHit(s16 *coord, u16 speed)
|
||||
{
|
||||
if (*coord == 0)
|
||||
*coord = (Random() % speed) - (speed / 2);
|
||||
}
|
||||
|
||||
static void RestoreBgCoord(s16* coord)
|
||||
static void RestoreBgCoord(s16 *coord)
|
||||
{
|
||||
if (*coord < 0)
|
||||
(*coord)++;
|
||||
@@ -3398,7 +3398,7 @@ static void RestoreBgCoords(void)
|
||||
RestoreBgCoord(&sBerryBlender->bg_Y);
|
||||
}
|
||||
|
||||
static void BlenderLandShakeBgCoord(s16* coord, u16 timer)
|
||||
static void BlenderLandShakeBgCoord(s16 *coord, u16 timer)
|
||||
{
|
||||
s32 strength;
|
||||
|
||||
@@ -3443,7 +3443,7 @@ static bool8 UpdateBlenderLandScreenShake(void)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void SpriteCB_PlayerArrow(struct Sprite* sprite)
|
||||
static void SpriteCB_PlayerArrow(struct Sprite *sprite)
|
||||
{
|
||||
sprite->x2 = -(sBerryBlender->bg_X);
|
||||
sprite->y2 = -(sBerryBlender->bg_Y);
|
||||
@@ -3553,7 +3553,7 @@ static bool8 PrintBlendingResults(void)
|
||||
sBerryBlender->mainState++;
|
||||
break;
|
||||
case 5:
|
||||
ClearStdWindowAndFrameToTransparent(5, 1);
|
||||
ClearStdWindowAndFrameToTransparent(5, TRUE);
|
||||
|
||||
for (i = 0; i < BLENDER_MAX_PLAYERS; i++)
|
||||
{
|
||||
@@ -3692,7 +3692,7 @@ static bool8 PrintBlendingRanking(void)
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
DrawStdFrameWithCustomTileAndPalette(5, 0, 1, 0xD);
|
||||
DrawStdFrameWithCustomTileAndPalette(5, FALSE, 1, 0xD);
|
||||
xPos = GetStringCenterAlignXOffset(FONT_NORMAL, sText_Ranking, 168);
|
||||
Blender_AddTextPrinter(5, sText_Ranking, xPos, 1, TEXT_SKIP_DRAW, 0);
|
||||
|
||||
@@ -3764,7 +3764,7 @@ void ShowBerryBlenderRecordWindow(void)
|
||||
|
||||
winTemplate = sBlenderRecordWindowTemplate;
|
||||
gRecordsWindowId = AddWindow(&winTemplate);
|
||||
DrawStdWindowFrame(gRecordsWindowId, 0);
|
||||
DrawStdWindowFrame(gRecordsWindowId, FALSE);
|
||||
FillWindowPixelBuffer(gRecordsWindowId, PIXEL_FILL(1));
|
||||
|
||||
xPos = GetStringCenterAlignXOffset(FONT_NORMAL, gText_BlenderMaxSpeedRecord, 144);
|
||||
|
||||
+26
-26
@@ -874,7 +874,7 @@ static const struct DigitObjUtilTemplate sDigitObjTemplates[] =
|
||||
.xDelta = 8,
|
||||
.x = 156,
|
||||
.y = 0,
|
||||
.spriteSheet = (void*) &sSpriteSheets[3],
|
||||
.spriteSheet = (void *) &sSpriteSheets[3],
|
||||
.spritePal = &sSpritePals[2],
|
||||
},
|
||||
{ // Seconds
|
||||
@@ -886,7 +886,7 @@ static const struct DigitObjUtilTemplate sDigitObjTemplates[] =
|
||||
.xDelta = 8,
|
||||
.x = 180,
|
||||
.y = 0,
|
||||
.spriteSheet = (void*) &sSpriteSheets[3],
|
||||
.spriteSheet = (void *) &sSpriteSheets[3],
|
||||
.spritePal = &sSpritePals[2],
|
||||
},
|
||||
{ // 1/60ths of a second
|
||||
@@ -898,7 +898,7 @@ static const struct DigitObjUtilTemplate sDigitObjTemplates[] =
|
||||
.xDelta = 8,
|
||||
.x = 204,
|
||||
.y = 0,
|
||||
.spriteSheet = (void*) &sSpriteSheets[3],
|
||||
.spriteSheet = (void *) &sSpriteSheets[3],
|
||||
.spritePal = &sSpritePals[2],
|
||||
}
|
||||
};
|
||||
@@ -1752,7 +1752,7 @@ static bool32 OpenResultsWindow(struct BerryCrushGame *game, struct BerryCrushGa
|
||||
break;
|
||||
case 2:
|
||||
LoadUserWindowBorderGfx_(gfx->resultsWindowId, 541, 208);
|
||||
DrawStdFrameWithCustomTileAndPalette(gfx->resultsWindowId, 0, 541, 13);
|
||||
DrawStdFrameWithCustomTileAndPalette(gfx->resultsWindowId, FALSE, 541, 13);
|
||||
break;
|
||||
case 3:
|
||||
playerCountIdx = game->playerCount - 2;
|
||||
@@ -1788,7 +1788,7 @@ static bool32 OpenResultsWindow(struct BerryCrushGame *game, struct BerryCrushGa
|
||||
|
||||
static void CloseResultsWindow(struct BerryCrushGame *game)
|
||||
{
|
||||
ClearStdWindowAndFrameToTransparent(game->gfx.resultsWindowId, 1);
|
||||
ClearStdWindowAndFrameToTransparent(game->gfx.resultsWindowId, TRUE);
|
||||
RemoveWindow(game->gfx.resultsWindowId);
|
||||
DrawPlayerNameWindows(game);
|
||||
}
|
||||
@@ -1810,7 +1810,7 @@ static void Task_ShowRankings(u8 taskId)
|
||||
PutWindowTilemap(tWindowId);
|
||||
FillWindowPixelBuffer(tWindowId, PIXEL_FILL(0));
|
||||
LoadUserWindowBorderGfx_(tWindowId, 541, 208);
|
||||
DrawStdFrameWithCustomTileAndPalette(tWindowId, 0, 541, 13);
|
||||
DrawStdFrameWithCustomTileAndPalette(tWindowId, FALSE, 541, 13);
|
||||
break;
|
||||
case 1:
|
||||
// Print header text
|
||||
@@ -1849,12 +1849,12 @@ static void Task_ShowRankings(u8 taskId)
|
||||
else
|
||||
return;
|
||||
case 3:
|
||||
ClearStdWindowAndFrameToTransparent(tWindowId, 1);
|
||||
ClearStdWindowAndFrameToTransparent(tWindowId, TRUE);
|
||||
ClearWindowTilemap(tWindowId);
|
||||
RemoveWindow(tWindowId);
|
||||
DestroyTask(taskId);
|
||||
EnableBothScriptContexts();
|
||||
ScriptContext2_Disable();
|
||||
ScriptContext_Enable();
|
||||
UnlockPlayerFieldControls();
|
||||
tState = 0;
|
||||
return;
|
||||
}
|
||||
@@ -1865,7 +1865,7 @@ void ShowBerryCrushRankings(void)
|
||||
{
|
||||
u8 taskId;
|
||||
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
taskId = CreateTask(Task_ShowRankings, 0);
|
||||
gTasks[taskId].tPressingSpeeds(0) = gSaveBlock2Ptr->berryCrush.pressingSpeeds[0];
|
||||
gTasks[taskId].tPressingSpeeds(1) = gSaveBlock2Ptr->berryCrush.pressingSpeeds[1];
|
||||
@@ -1885,9 +1885,9 @@ static void HideTimer(struct BerryCrushGame_Gfx *gfx)
|
||||
{
|
||||
gfx->timerSprites[0]->invisible = TRUE;
|
||||
gfx->timerSprites[1]->invisible = TRUE;
|
||||
DigitObjUtil_HideOrShow(2, 1);
|
||||
DigitObjUtil_HideOrShow(1, 1);
|
||||
DigitObjUtil_HideOrShow(0, 1);
|
||||
DigitObjUtil_HideOrShow(2, TRUE);
|
||||
DigitObjUtil_HideOrShow(1, TRUE);
|
||||
DigitObjUtil_HideOrShow(0, TRUE);
|
||||
}
|
||||
|
||||
static void CreatePlayerNameWindows(struct BerryCrushGame *game)
|
||||
@@ -2254,15 +2254,15 @@ static u32 Cmd_PrintMessage(struct BerryCrushGame *game, u8 *args)
|
||||
switch (game->cmdState)
|
||||
{
|
||||
case 0:
|
||||
DrawDialogueFrame(0, 0);
|
||||
DrawDialogueFrame(0, FALSE);
|
||||
if (args[1] & F_MSG_EXPAND)
|
||||
{
|
||||
StringExpandPlaceholders(gStringVar4, sMessages[args[0]]);
|
||||
AddTextPrinterParameterized2(0, FONT_NORMAL, gStringVar4, game->textSpeed, 0, 2, 1, 3);
|
||||
AddTextPrinterParameterized2(0, FONT_NORMAL, gStringVar4, game->textSpeed, 0, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddTextPrinterParameterized2(0, FONT_NORMAL, sMessages[args[0]], game->textSpeed, 0, 2, 1, 3);
|
||||
AddTextPrinterParameterized2(0, FONT_NORMAL, sMessages[args[0]], game->textSpeed, 0, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY);
|
||||
}
|
||||
CopyWindowToVram(0, COPYWIN_FULL);
|
||||
break;
|
||||
@@ -2282,7 +2282,7 @@ static u32 Cmd_PrintMessage(struct BerryCrushGame *game, u8 *args)
|
||||
break;
|
||||
case 3:
|
||||
if (args[1] & F_MSG_CLEAR)
|
||||
ClearDialogWindowAndFrame(0, 1);
|
||||
ClearDialogWindowAndFrame(0, TRUE);
|
||||
RunOrScheduleCommand(game->nextCmd, SCHEDULE_CMD, NULL);
|
||||
game->cmdState = args[4];
|
||||
return 0;
|
||||
@@ -2402,7 +2402,7 @@ static u32 Cmd_WaitForOthersToPickBerries(struct BerryCrushGame *game, u8 *args)
|
||||
game->targetDepth = MathUtil_Div32(Q_24_8(game->targetAPresses), Q_24_8(32));
|
||||
break;
|
||||
case 5:
|
||||
ClearDialogWindowAndFrame(0, 1);
|
||||
ClearDialogWindowAndFrame(0, TRUE);
|
||||
RunOrScheduleCommand(CMD_DROP_BERRIES, SCHEDULE_CMD, NULL);
|
||||
game->gameState = STATE_DROP_BERRIES;
|
||||
game->cmdState = 0;
|
||||
@@ -3241,8 +3241,8 @@ static u32 Cmd_SaveGame(struct BerryCrushGame *game, u8 *args)
|
||||
case 2:
|
||||
if (!IsLinkTaskFinished())
|
||||
return 0;
|
||||
DrawDialogueFrame(0, 0);
|
||||
AddTextPrinterParameterized2(0, FONT_NORMAL, gText_SavingDontTurnOffPower, 0, 0, 2, 1, 3);
|
||||
DrawDialogueFrame(0, FALSE);
|
||||
AddTextPrinterParameterized2(0, FONT_NORMAL, gText_SavingDontTurnOffPower, 0, 0, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY);
|
||||
CopyWindowToVram(0, COPYWIN_FULL);
|
||||
CreateTask(Task_LinkFullSave, 0);
|
||||
break;
|
||||
@@ -3295,7 +3295,7 @@ static u32 Cmd_AskPlayAgain(struct BerryCrushGame *game, u8 *args)
|
||||
}
|
||||
|
||||
// Close Yes/No and start communication
|
||||
ClearDialogWindowAndFrame(0, 1);
|
||||
ClearDialogWindowAndFrame(0, TRUE);
|
||||
SetPrintMessageArgs(args, MSG_COMM_STANDBY, 0, 0, 0);
|
||||
game->nextCmd = CMD_COMM_PLAY_AGAIN;
|
||||
RunOrScheduleCommand(CMD_PRINT_MSG, SCHEDULE_CMD, NULL);
|
||||
@@ -3367,7 +3367,7 @@ static u32 Cmd_PlayAgain(struct BerryCrushGame *game, u8 *args)
|
||||
return 0;
|
||||
break;
|
||||
case 2:
|
||||
ClearDialogWindowAndFrame(0, 1);
|
||||
ClearDialogWindowAndFrame(0, TRUE);
|
||||
ResetCrusherPos(game);
|
||||
BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK);
|
||||
UpdatePaletteFade();
|
||||
@@ -3389,11 +3389,11 @@ static u32 Cmd_StopGame(struct BerryCrushGame *game, u8 *args)
|
||||
switch (game->cmdState)
|
||||
{
|
||||
case 0:
|
||||
DrawDialogueFrame(0, 0);
|
||||
DrawDialogueFrame(0, FALSE);
|
||||
if (game->playAgainState == PLAY_AGAIN_NO_BERRIES)
|
||||
AddTextPrinterParameterized2(0, FONT_NORMAL, sMessages[MSG_NO_BERRIES], game->textSpeed, 0, 2, 1, 3);
|
||||
AddTextPrinterParameterized2(0, FONT_NORMAL, sMessages[MSG_NO_BERRIES], game->textSpeed, 0, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY);
|
||||
else
|
||||
AddTextPrinterParameterized2(0, FONT_NORMAL, sMessages[MSG_DROPPED], game->textSpeed, 0, 2, 1, 3);
|
||||
AddTextPrinterParameterized2(0, FONT_NORMAL, sMessages[MSG_DROPPED], game->textSpeed, 0, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY);
|
||||
CopyWindowToVram(0, COPYWIN_FULL);
|
||||
break;
|
||||
case 1:
|
||||
@@ -3428,7 +3428,7 @@ static u32 Cmd_CloseLink(struct BerryCrushGame *game, u8 *args)
|
||||
SetCloseLinkCallback();
|
||||
break;
|
||||
case 2:
|
||||
if (gReceivedRemoteLinkPlayers != 0)
|
||||
if (gReceivedRemoteLinkPlayers)
|
||||
return 0;
|
||||
game->nextCmd = CMD_QUIT;
|
||||
RunOrScheduleCommand(CMD_HIDE_GAME, SCHEDULE_CMD, NULL);
|
||||
|
||||
@@ -276,7 +276,7 @@ static bool8 InitBerryTagScreen(void)
|
||||
gMain.state++;
|
||||
break;
|
||||
case 14:
|
||||
BlendPalettes(PALETTES_ALL, 0x10, 0);
|
||||
BlendPalettes(PALETTES_ALL, 0x10, RGB_BLACK);
|
||||
gMain.state++;
|
||||
break;
|
||||
case 15:
|
||||
|
||||
@@ -86,7 +86,7 @@ void DoBrailleDigEffect(void)
|
||||
DrawWholeMapView();
|
||||
PlaySE(SE_BANG);
|
||||
FlagSet(FLAG_SYS_BRAILLE_DIG);
|
||||
ScriptContext2_Disable();
|
||||
UnlockPlayerFieldControls();
|
||||
}
|
||||
|
||||
bool8 CheckRelicanthWailord(void)
|
||||
@@ -152,7 +152,7 @@ static void Task_SealedChamberShakingEffect(u8 taskId)
|
||||
if (task->tShakeCounter == task->tNumShakes)
|
||||
{
|
||||
DestroyTask(taskId);
|
||||
EnableBothScriptContexts();
|
||||
ScriptContext_Enable();
|
||||
InstallCameraPanAheadCallback();
|
||||
}
|
||||
}
|
||||
@@ -213,7 +213,7 @@ static void DoBrailleRegirockEffect(void)
|
||||
DrawWholeMapView();
|
||||
PlaySE(SE_BANG);
|
||||
FlagSet(FLAG_SYS_REGIROCK_PUZZLE_COMPLETED);
|
||||
ScriptContext2_Disable();
|
||||
UnlockPlayerFieldControls();
|
||||
}
|
||||
|
||||
bool8 ShouldDoBrailleRegisteelEffect(void)
|
||||
@@ -252,7 +252,7 @@ static void DoBrailleRegisteelEffect(void)
|
||||
DrawWholeMapView();
|
||||
PlaySE(SE_BANG);
|
||||
FlagSet(FLAG_SYS_REGISTEEL_PUZZLE_COMPLETED);
|
||||
ScriptContext2_Disable();
|
||||
UnlockPlayerFieldControls();
|
||||
}
|
||||
|
||||
// theory: another commented out DoBrailleWait and Task_BrailleWait.
|
||||
|
||||
+8
-7
@@ -202,7 +202,7 @@ static const struct OamData sOam_Cable =
|
||||
.paletteNum = 0,
|
||||
};
|
||||
|
||||
static const struct SpriteTemplate sSpriteTemplate_CableCar[] =
|
||||
static const struct SpriteTemplate sSpriteTemplates_CableCar[] =
|
||||
{
|
||||
{
|
||||
.tileTag = TAG_CABLE_CAR,
|
||||
@@ -224,7 +224,8 @@ static const struct SpriteTemplate sSpriteTemplate_CableCar[] =
|
||||
},
|
||||
};
|
||||
|
||||
static const struct SpriteTemplate sSpriteTemplate_Cable = {
|
||||
static const struct SpriteTemplate sSpriteTemplate_Cable =
|
||||
{
|
||||
.tileTag = TAG_CABLE,
|
||||
.paletteTag = TAG_CABLE_CAR,
|
||||
.oam = &sOam_Cable,
|
||||
@@ -245,7 +246,7 @@ static void Task_LoadCableCar(u8 taskId)
|
||||
|
||||
void CableCar(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
CreateTask(Task_LoadCableCar, 1);
|
||||
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB(0, 0, 0));
|
||||
}
|
||||
@@ -836,12 +837,12 @@ static void CreateCableCarSprites(void)
|
||||
gSprites[spriteId].sYPos = 73;
|
||||
}
|
||||
// Create car sprite
|
||||
spriteId = CreateSprite(&sSpriteTemplate_CableCar[0], 176, 43, 0x67);
|
||||
spriteId = CreateSprite(&sSpriteTemplates_CableCar[0], 176, 43, 0x67);
|
||||
gSprites[spriteId].x2 = gSprites[spriteId].y2 = 32;
|
||||
gSprites[spriteId].sXPos = 176;
|
||||
gSprites[spriteId].sYPos = 43;
|
||||
// Create door sprite
|
||||
spriteId = CreateSprite(&sSpriteTemplate_CableCar[1], 200, 99, 0x65);
|
||||
spriteId = CreateSprite(&sSpriteTemplates_CableCar[1], 200, 99, 0x65);
|
||||
gSprites[spriteId].x2 = 8;
|
||||
gSprites[spriteId].y2 = 4;
|
||||
gSprites[spriteId].sXPos = 200;
|
||||
@@ -864,12 +865,12 @@ static void CreateCableCarSprites(void)
|
||||
gSprites[spriteId].sYPos = 39;
|
||||
}
|
||||
// Create car sprite
|
||||
spriteId = CreateSprite(&sSpriteTemplate_CableCar[0], 104, 9, 0x67);
|
||||
spriteId = CreateSprite(&sSpriteTemplates_CableCar[0], 104, 9, 0x67);
|
||||
gSprites[spriteId].x2 = gSprites[spriteId].y2 = 32;
|
||||
gSprites[spriteId].sXPos = 104;
|
||||
gSprites[spriteId].sYPos = 9;
|
||||
// Create door sprite
|
||||
spriteId = CreateSprite(&sSpriteTemplate_CableCar[1], 128, 65, 0x65);
|
||||
spriteId = CreateSprite(&sSpriteTemplates_CableCar[1], 128, 65, 0x65);
|
||||
gSprites[spriteId].x2 = 8;
|
||||
gSprites[spriteId].y2 = 4;
|
||||
gSprites[spriteId].sXPos = 128;
|
||||
|
||||
+18
-18
@@ -97,7 +97,7 @@ static void PrintNumPlayersInLink(u16 windowId, u32 numPlayers)
|
||||
u8 xPos;
|
||||
|
||||
ConvertIntToDecimalStringN(gStringVar1, numPlayers, STR_CONV_MODE_LEFT_ALIGN, 1);
|
||||
SetStandardWindowBorderStyle(windowId, 0);
|
||||
SetStandardWindowBorderStyle(windowId, FALSE);
|
||||
StringExpandPlaceholders(gStringVar4, gText_NumPlayerLink);
|
||||
xPos = GetStringCenterAlignXOffset(FONT_NORMAL, gStringVar4, 88);
|
||||
AddTextPrinterParameterized(windowId, FONT_NORMAL, gStringVar4, xPos, 1, TEXT_SKIP_DRAW, NULL);
|
||||
@@ -486,7 +486,7 @@ static void FinishLinkup(u16 *linkupStatus, u32 taskId)
|
||||
{
|
||||
// Successful battle tower linkup
|
||||
ClearLinkPlayerCountWindow(gTasks[taskId].tWindowId);
|
||||
EnableBothScriptContexts();
|
||||
ScriptContext_Enable();
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
}
|
||||
@@ -494,7 +494,7 @@ static void FinishLinkup(u16 *linkupStatus, u32 taskId)
|
||||
{
|
||||
// Successful linkup
|
||||
ClearLinkPlayerCountWindow(gTasks[taskId].tWindowId);
|
||||
EnableBothScriptContexts();
|
||||
ScriptContext_Enable();
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
}
|
||||
@@ -531,7 +531,7 @@ static void Task_StopLinkup(u8 taskId)
|
||||
if (!gReceivedRemoteLinkPlayers)
|
||||
{
|
||||
ClearLinkPlayerCountWindow(gTasks[taskId].tWindowId);
|
||||
EnableBothScriptContexts();
|
||||
ScriptContext_Enable();
|
||||
RemoveWindow(gTasks[taskId].tWindowId);
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
@@ -543,7 +543,7 @@ static void Task_LinkupFailed(u8 taskId)
|
||||
ClearLinkPlayerCountWindow(gTasks[taskId].tWindowId);
|
||||
StopFieldMessage();
|
||||
RemoveWindow(gTasks[taskId].tWindowId);
|
||||
EnableBothScriptContexts();
|
||||
ScriptContext_Enable();
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
|
||||
@@ -553,7 +553,7 @@ static void Task_LinkupConnectionError(u8 taskId)
|
||||
ClearLinkPlayerCountWindow(gTasks[taskId].tWindowId);
|
||||
RemoveWindow(gTasks[taskId].tWindowId);
|
||||
HideFieldMessageBox();
|
||||
EnableBothScriptContexts();
|
||||
ScriptContext_Enable();
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
|
||||
@@ -688,13 +688,13 @@ static void Task_ValidateMixingGameLanguage(u8 taskId)
|
||||
return;
|
||||
}
|
||||
}
|
||||
EnableBothScriptContexts();
|
||||
ScriptContext_Enable();
|
||||
DestroyTask(taskId);
|
||||
break;
|
||||
case 1:
|
||||
if (!gReceivedRemoteLinkPlayers)
|
||||
{
|
||||
EnableBothScriptContexts();
|
||||
ScriptContext_Enable();
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
break;
|
||||
@@ -833,7 +833,7 @@ static void SetLinkBattleTypeFlags(int linkService)
|
||||
|
||||
static void Task_StartWiredCableClubBattle(u8 taskId)
|
||||
{
|
||||
struct Task* task = &gTasks[taskId];
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
switch (task->tState)
|
||||
{
|
||||
@@ -879,7 +879,7 @@ static void Task_StartWiredCableClubBattle(u8 taskId)
|
||||
static void Task_StartWirelessCableClubBattle(u8 taskId)
|
||||
{
|
||||
int i;
|
||||
s16* data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
switch (tState)
|
||||
{
|
||||
@@ -1042,7 +1042,7 @@ void ExitLinkRoom(void)
|
||||
// Note: gSpecialVar_0x8005 contains the id of the seat the player entered
|
||||
static void Task_EnterCableClubSeat(u8 taskId)
|
||||
{
|
||||
struct Task* task = &gTasks[taskId];
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
switch (task->tState)
|
||||
{
|
||||
@@ -1080,7 +1080,7 @@ static void Task_EnterCableClubSeat(u8 taskId)
|
||||
SetLinkWaitingForScript();
|
||||
EraseFieldMessageBox(TRUE);
|
||||
DestroyTask(taskId);
|
||||
EnableBothScriptContexts();
|
||||
ScriptContext_Enable();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1089,7 +1089,7 @@ void CreateTask_EnterCableClubSeat(TaskFunc followupFunc)
|
||||
{
|
||||
u8 taskId = CreateTask(Task_EnterCableClubSeat, 80);
|
||||
SetTaskFuncWithFollowupFunc(taskId, Task_EnterCableClubSeat, followupFunc);
|
||||
ScriptContext1_Stop();
|
||||
ScriptContext_Stop();
|
||||
}
|
||||
|
||||
static void Task_StartWiredTrade(u8 taskId)
|
||||
@@ -1099,7 +1099,7 @@ static void Task_StartWiredTrade(u8 taskId)
|
||||
switch (task->tState)
|
||||
{
|
||||
case 0:
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
FadeScreen(FADE_TO_BLACK, 0);
|
||||
ClearLinkCallback_2();
|
||||
task->tState++;
|
||||
@@ -1132,7 +1132,7 @@ static void Task_StartWirelessTrade(u8 taskId)
|
||||
switch (tState)
|
||||
{
|
||||
case 0:
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
FadeScreen(FADE_TO_BLACK, 0);
|
||||
ClearLinkRfuCallback();
|
||||
tState++;
|
||||
@@ -1176,7 +1176,7 @@ static void CreateTask_StartWiredTrade(void)
|
||||
void Script_StartWiredTrade(void)
|
||||
{
|
||||
// CreateTask_StartWiredTrade();
|
||||
// ScriptContext1_Stop();
|
||||
// ScriptContext_Stop();
|
||||
}
|
||||
|
||||
void ColosseumPlayerSpotTriggered(void)
|
||||
@@ -1193,7 +1193,7 @@ void ColosseumPlayerSpotTriggered(void)
|
||||
static void CreateTask_EnterCableClubSeatNoFollowup(void)
|
||||
{
|
||||
u8 taskId = CreateTask(Task_EnterCableClubSeat, 80);
|
||||
ScriptContext1_Stop();
|
||||
ScriptContext_Stop();
|
||||
}
|
||||
|
||||
void Script_ShowLinkTrainerCard(void)
|
||||
@@ -1257,7 +1257,7 @@ static void Task_WaitExitToScript(u8 taskId)
|
||||
{
|
||||
if (!gReceivedRemoteLinkPlayers)
|
||||
{
|
||||
EnableBothScriptContexts();
|
||||
ScriptContext_Enable();
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ void CB2_InitClearSaveDataScreen(void)
|
||||
|
||||
static void Task_DoClearSaveDataScreenYesNo(u8 taskId)
|
||||
{
|
||||
DrawStdFrameWithCustomTileAndPalette(0, 0, 2, 14);
|
||||
DrawStdFrameWithCustomTileAndPalette(0, FALSE, 2, 14);
|
||||
AddTextPrinterParameterized(0, FONT_NORMAL, gText_ClearAllSaveData, 0, 1, 0, 0);
|
||||
CreateYesNoMenu(sClearSaveYesNo, 2, 14, 1);
|
||||
gTasks[taskId].func = Task_ClearSaveDataScreenYesNoChoice;
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
#include "international_string_util.h"
|
||||
#include "constants/coins.h"
|
||||
|
||||
EWRAM_DATA u8 sCoinsWindowId = 0;
|
||||
static EWRAM_DATA u8 sCoinsWindowId = 0;
|
||||
|
||||
void PrintCoinsString(u32 coinAmount)
|
||||
{
|
||||
|
||||
+45
-43
@@ -93,7 +93,7 @@ static void Task_ContestReturnToField(u8);
|
||||
static void FieldCB_ContestReturnToField(void);
|
||||
static bool8 IsPlayerLinkLeader(void);
|
||||
static void PrintContestantTrainerName(u8);
|
||||
static void PrintContestantTrainerNameWithColor(u8 a0, u8 a1);
|
||||
static void PrintContestantTrainerNameWithColor(u8, u8);
|
||||
static void PrintContestantMonName(u8);
|
||||
static void PrintContestantMonNameWithColor(u8, u8);
|
||||
static u8 CreateJudgeSprite(void);
|
||||
@@ -352,7 +352,7 @@ EWRAM_DATA u16 gSpecialVar_ContestRank = 0;
|
||||
EWRAM_DATA u8 gNumLinkContestPlayers = 0;
|
||||
EWRAM_DATA u8 gHighestRibbonRank = 0;
|
||||
EWRAM_DATA struct ContestResources *gContestResources = NULL;
|
||||
EWRAM_DATA u8 sContestBgCopyFlags = 0;
|
||||
static EWRAM_DATA u8 sContestBgCopyFlags = 0;
|
||||
EWRAM_DATA struct ContestWinner gCurContestWinner = {0};
|
||||
EWRAM_DATA bool8 gCurContestWinnerIsForArtist = 0;
|
||||
EWRAM_DATA u8 gCurContestWinnerSaveIdx = 0;
|
||||
@@ -388,7 +388,7 @@ static const struct OamData sOam_SliderHeart =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(8x8),
|
||||
.x = 0,
|
||||
@@ -473,7 +473,7 @@ static const struct OamData sOam_NextTurn =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(32x8),
|
||||
.x = 0,
|
||||
@@ -625,7 +625,7 @@ static const struct SpriteTemplate sSpriteTemplate_ApplauseMeter =
|
||||
.callback = SpriteCallbackDummy
|
||||
};
|
||||
|
||||
const struct OamData sOam_Judge =
|
||||
static const struct OamData sOam_Judge =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
@@ -639,7 +639,7 @@ const struct OamData sOam_Judge =
|
||||
.paletteNum = 2,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate sSpriteTemplate_Judge =
|
||||
static const struct SpriteTemplate sSpriteTemplate_Judge =
|
||||
{
|
||||
.tileTag = TAG_JUDGE,
|
||||
.paletteTag = TAG_JUDGE,
|
||||
@@ -650,7 +650,7 @@ const struct SpriteTemplate sSpriteTemplate_Judge =
|
||||
.callback = SpriteCallbackDummy
|
||||
};
|
||||
|
||||
const struct CompressedSpriteSheet sSpriteSheet_Judge =
|
||||
static const struct CompressedSpriteSheet sSpriteSheet_Judge =
|
||||
{
|
||||
.data = gContestJudgeGfx,
|
||||
.size = 0x800,
|
||||
@@ -664,13 +664,13 @@ static const struct CompressedSpriteSheet sSpriteSheet_JudgeSymbols =
|
||||
.tag = TAG_JUDGE_SYMBOLS_GFX
|
||||
};
|
||||
|
||||
const struct CompressedSpritePalette sSpritePalette_JudgeSymbols =
|
||||
static const struct CompressedSpritePalette sSpritePalette_JudgeSymbols =
|
||||
{
|
||||
.data = gContestJudgeSymbolsPal,
|
||||
.tag = TAG_CONTEST_SYMBOLS_PAL
|
||||
};
|
||||
|
||||
const struct SpriteTemplate sSpriteTemplate_JudgeSpeechBubble =
|
||||
static const struct SpriteTemplate sSpriteTemplate_JudgeSpeechBubble =
|
||||
{
|
||||
.tileTag = TAG_JUDGE_SYMBOLS_GFX,
|
||||
.paletteTag = TAG_CONTEST_SYMBOLS_PAL,
|
||||
@@ -859,24 +859,24 @@ static const struct CompressedSpriteSheet sSpriteSheets_ContestantsTurnBlinkEffe
|
||||
static const struct SpritePalette sSpritePalettes_ContestantsTurnBlinkEffect[CONTESTANT_COUNT] =
|
||||
{
|
||||
{
|
||||
.data = (u16*)(gHeap + 0x1A0A4),
|
||||
.data = (u16 *)(gHeap + 0x1A0A4),
|
||||
.tag = TAG_BLINK_EFFECT_CONTESTANT0
|
||||
},
|
||||
{
|
||||
.data = (u16*)(gHeap + 0x1A0C4),
|
||||
.data = (u16 *)(gHeap + 0x1A0C4),
|
||||
.tag = TAG_BLINK_EFFECT_CONTESTANT1
|
||||
},
|
||||
{
|
||||
.data = (u16*)(gHeap + 0x1A0E4),
|
||||
.data = (u16 *)(gHeap + 0x1A0E4),
|
||||
.tag = TAG_BLINK_EFFECT_CONTESTANT2
|
||||
},
|
||||
{
|
||||
.data = (u16*)(gHeap + 0x1A104),
|
||||
.data = (u16 *)(gHeap + 0x1A104),
|
||||
.tag = TAG_BLINK_EFFECT_CONTESTANT3
|
||||
}
|
||||
};
|
||||
|
||||
const struct OamData sOam_ContestantsTurnBlinkEffect =
|
||||
static const struct OamData sOam_ContestantsTurnBlinkEffect =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_DOUBLE,
|
||||
@@ -891,13 +891,13 @@ const struct OamData sOam_ContestantsTurnBlinkEffect =
|
||||
.affineParam = 0,
|
||||
};
|
||||
|
||||
const union AffineAnimCmd sAffineAnim_ContestantsTurnBlinkEffect_0[] =
|
||||
static const union AffineAnimCmd sAffineAnim_ContestantsTurnBlinkEffect_0[] =
|
||||
{
|
||||
AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0),
|
||||
AFFINEANIMCMD_END
|
||||
};
|
||||
|
||||
const union AffineAnimCmd sAffineAnim_ContestantsTurnBlinkEffect_1[] =
|
||||
static const union AffineAnimCmd sAffineAnim_ContestantsTurnBlinkEffect_1[] =
|
||||
{
|
||||
AFFINEANIMCMD_FRAME(3, 3, 0, 15),
|
||||
AFFINEANIMCMD_FRAME(-3, -3, 0, 15),
|
||||
@@ -906,13 +906,13 @@ const union AffineAnimCmd sAffineAnim_ContestantsTurnBlinkEffect_1[] =
|
||||
AFFINEANIMCMD_END
|
||||
};
|
||||
|
||||
const union AffineAnimCmd *const sAffineAnims_ContestantsTurnBlinkEffect[] =
|
||||
static const union AffineAnimCmd *const sAffineAnims_ContestantsTurnBlinkEffect[] =
|
||||
{
|
||||
sAffineAnim_ContestantsTurnBlinkEffect_0,
|
||||
sAffineAnim_ContestantsTurnBlinkEffect_1
|
||||
};
|
||||
|
||||
const struct SpriteTemplate sSpriteTemplates_ContestantsTurnBlinkEffect[CONTESTANT_COUNT] =
|
||||
static const struct SpriteTemplate sSpriteTemplates_ContestantsTurnBlinkEffect[CONTESTANT_COUNT] =
|
||||
{
|
||||
{
|
||||
.tileTag = TAG_BLINK_EFFECT_CONTESTANT0,
|
||||
@@ -952,7 +952,7 @@ const struct SpriteTemplate sSpriteTemplates_ContestantsTurnBlinkEffect[CONTESTA
|
||||
}
|
||||
};
|
||||
|
||||
static const s8 gContestExcitementTable[CONTEST_CATEGORIES_COUNT][CONTEST_CATEGORIES_COUNT] =
|
||||
static const s8 sContestExcitementTable[CONTEST_CATEGORIES_COUNT][CONTEST_CATEGORIES_COUNT] =
|
||||
{
|
||||
[CONTEST_CATEGORY_COOL] = {
|
||||
[CONTEST_CATEGORY_COOL] = +1,
|
||||
@@ -1396,7 +1396,7 @@ static void Task_RaiseCurtainAtStart(u8 taskId)
|
||||
gTasks[taskId].data[0]++;
|
||||
break;
|
||||
case 1:
|
||||
*(s16*)&gBattle_BG1_Y += 7;
|
||||
*(s16 *)&gBattle_BG1_Y += 7;
|
||||
if ((s16)gBattle_BG1_Y <= DISPLAY_HEIGHT)
|
||||
break;
|
||||
gTasks[taskId].data[0]++;
|
||||
@@ -1582,7 +1582,7 @@ static void Task_HandleMoveSelectInput(u8 taskId)
|
||||
StringCopy(gDisplayedStringBattle, gText_AppealNumButItCantParticipate);
|
||||
ContestClearGeneralTextWindow();
|
||||
StringExpandPlaceholders(gStringVar4, gDisplayedStringBattle);
|
||||
Contest_StartTextPrinter(gStringVar4, 0);
|
||||
Contest_StartTextPrinter(gStringVar4, FALSE);
|
||||
gBattle_BG0_Y = 0;
|
||||
gBattle_BG2_Y = 0;
|
||||
gTasks[taskId].func = Task_TryShowMoveSelectScreen;
|
||||
@@ -1814,7 +1814,7 @@ static void Task_DoAppeals(u8 taskId)
|
||||
else
|
||||
StringCopy(gStringVar2, sInvalidContestMoveNames[eContestantStatus[contestant].moveCategory]);
|
||||
StringExpandPlaceholders(gStringVar4, gText_MonAppealedWithMove);
|
||||
Contest_StartTextPrinter(gStringVar4, 1);
|
||||
Contest_StartTextPrinter(gStringVar4, TRUE);
|
||||
gTasks[taskId].tState = APPEALSTATE_WAIT_USED_MOVE_MSG;
|
||||
}
|
||||
return;
|
||||
@@ -2076,7 +2076,7 @@ static void Task_DoAppeals(u8 taskId)
|
||||
ContestClearGeneralTextWindow();
|
||||
StringCopy(gStringVar1, gContestMons[contestant].nickname);
|
||||
StringExpandPlaceholders(gStringVar4, gText_MonCantAppealNextTurn);
|
||||
Contest_StartTextPrinter(gStringVar4, 1);
|
||||
Contest_StartTextPrinter(gStringVar4, TRUE);
|
||||
}
|
||||
gTasks[taskId].tState = APPEALSTATE_WAIT_SKIP_NEXT_TURN_MSG;
|
||||
}
|
||||
@@ -2118,7 +2118,7 @@ static void Task_DoAppeals(u8 taskId)
|
||||
ContestClearGeneralTextWindow();
|
||||
StringCopy(gStringVar1, gContestMons[contestant].nickname);
|
||||
StringExpandPlaceholders(gStringVar4, gText_JudgeLookedAtMonExpectantly);
|
||||
Contest_StartTextPrinter(gStringVar4, 1);
|
||||
Contest_StartTextPrinter(gStringVar4, TRUE);
|
||||
DoJudgeSpeechBubble(JUDGE_SYMBOL_ONE_EXCLAMATION);
|
||||
gTasks[taskId].tCounter = 0;
|
||||
gTasks[taskId].tState = APPEALSTATE_WAIT_JUDGE_COMBO;
|
||||
@@ -2231,7 +2231,7 @@ static void Task_DoAppeals(u8 taskId)
|
||||
StringExpandPlaceholders(gStringVar4, gText_MonsXWentOverGreat);
|
||||
else
|
||||
StringExpandPlaceholders(gStringVar4, gText_MonsXGotTheCrowdGoing);
|
||||
Contest_StartTextPrinter(gStringVar4, 1);
|
||||
Contest_StartTextPrinter(gStringVar4, TRUE);
|
||||
gTasks[taskId].tCounter = 0;
|
||||
gTasks[taskId].data[11] = 0;
|
||||
if (r3 < 0)
|
||||
@@ -2753,8 +2753,8 @@ static void Task_ContestReturnToField(u8 taskId)
|
||||
|
||||
static void FieldCB_ContestReturnToField(void)
|
||||
{
|
||||
ScriptContext2_Disable();
|
||||
EnableBothScriptContexts();
|
||||
UnlockPlayerFieldControls();
|
||||
ScriptContext_Enable();
|
||||
}
|
||||
|
||||
static void TryPutPlayerLast(void)
|
||||
@@ -3186,14 +3186,14 @@ static u16 GetMoveEffectSymbolTileOffset(u16 move, u8 contestant)
|
||||
return offset;
|
||||
}
|
||||
|
||||
static void PrintContestMoveDescription(u16 a)
|
||||
static void PrintContestMoveDescription(u16 move)
|
||||
{
|
||||
u8 category;
|
||||
u16 categoryTile;
|
||||
u8 numHearts;
|
||||
|
||||
// The contest category icon is implemented as a 5x2 group of tiles.
|
||||
category = gContestMoves[a].contestCategory;
|
||||
category = gContestMoves[move].contestCategory;
|
||||
if (category == CONTEST_CATEGORY_COOL)
|
||||
categoryTile = 0x4040;
|
||||
else if (category == CONTEST_CATEGORY_BEAUTY)
|
||||
@@ -3209,27 +3209,27 @@ static void PrintContestMoveDescription(u16 a)
|
||||
ContestBG_FillBoxWithIncrementingTile(0, categoryTile + 0x10, 0x0b, 0x20, 0x05, 0x01, 0x11, 0x01);
|
||||
|
||||
// Appeal hearts
|
||||
if (gContestEffects[gContestMoves[a].effect].appeal == 0xFF)
|
||||
if (gContestEffects[gContestMoves[move].effect].appeal == 0xFF)
|
||||
numHearts = 0;
|
||||
else
|
||||
numHearts = gContestEffects[gContestMoves[a].effect].appeal / 10;
|
||||
numHearts = gContestEffects[gContestMoves[move].effect].appeal / 10;
|
||||
if (numHearts > MAX_CONTEST_MOVE_HEARTS)
|
||||
numHearts = MAX_CONTEST_MOVE_HEARTS;
|
||||
ContestBG_FillBoxWithTile(0, TILE_EMPTY_APPEAL_HEART, 0x15, 0x1f, MAX_CONTEST_MOVE_HEARTS, 0x01, 0x11);
|
||||
ContestBG_FillBoxWithTile(0, TILE_FILLED_APPEAL_HEART, 0x15, 0x1f, numHearts, 0x01, 0x11);
|
||||
|
||||
// Jam hearts
|
||||
if (gContestEffects[gContestMoves[a].effect].jam == 0xFF)
|
||||
if (gContestEffects[gContestMoves[move].effect].jam == 0xFF)
|
||||
numHearts = 0;
|
||||
else
|
||||
numHearts = gContestEffects[gContestMoves[a].effect].jam / 10;
|
||||
numHearts = gContestEffects[gContestMoves[move].effect].jam / 10;
|
||||
if (numHearts > MAX_CONTEST_MOVE_HEARTS)
|
||||
numHearts = MAX_CONTEST_MOVE_HEARTS;
|
||||
ContestBG_FillBoxWithTile(0, TILE_EMPTY_JAM_HEART, 0x15, 0x20, MAX_CONTEST_MOVE_HEARTS, 0x01, 0x11);
|
||||
ContestBG_FillBoxWithTile(0, TILE_FILLED_JAM_HEART, 0x15, 0x20, numHearts, 0x01, 0x11);
|
||||
|
||||
FillWindowPixelBuffer(WIN_MOVE_DESCRIPTION, PIXEL_FILL(0));
|
||||
Contest_PrintTextToBg0WindowStd(WIN_MOVE_DESCRIPTION, gContestEffectDescriptionPointers[gContestMoves[a].effect]);
|
||||
Contest_PrintTextToBg0WindowStd(WIN_MOVE_DESCRIPTION, gContestEffectDescriptionPointers[gContestMoves[move].effect]);
|
||||
Contest_PrintTextToBg0WindowStd(WIN_SLASH, gText_Slash);
|
||||
}
|
||||
|
||||
@@ -3666,7 +3666,7 @@ static void ContestPrintLinkStandby(void)
|
||||
gBattle_BG0_Y = 0;
|
||||
gBattle_BG2_Y = 0;
|
||||
ContestClearGeneralTextWindow();
|
||||
Contest_StartTextPrinter(gText_LinkStandby4, 0);
|
||||
Contest_StartTextPrinter(gText_LinkStandby4, FALSE);
|
||||
}
|
||||
|
||||
static void FillContestantWindowBgs(void)
|
||||
@@ -4537,14 +4537,14 @@ static void CalculateAppealMoveImpact(u8 contestant)
|
||||
eContestantStatus[contestant].contestantAnimTarget = i;
|
||||
}
|
||||
|
||||
void SetContestantEffectStringID(u8 a, u8 b)
|
||||
void SetContestantEffectStringID(u8 contestant, u8 effectStringId)
|
||||
{
|
||||
eContestantStatus[a].effectStringId = b;
|
||||
eContestantStatus[contestant].effectStringId = effectStringId;
|
||||
}
|
||||
|
||||
void SetContestantEffectStringID2(u8 a, u8 b)
|
||||
void SetContestantEffectStringID2(u8 contestant, u8 effectStringId)
|
||||
{
|
||||
eContestantStatus[a].effectStringId2 = b;
|
||||
eContestantStatus[contestant].effectStringId2 = effectStringId;
|
||||
}
|
||||
|
||||
void SetStartledString(u8 contestant, u8 jam)
|
||||
@@ -4577,7 +4577,7 @@ static void PrintAppealMoveResultText(u8 contestant, u8 stringId)
|
||||
StringCopy(gStringVar3, gText_Contest_Fear);
|
||||
StringExpandPlaceholders(gStringVar4, sAppealResultTexts[stringId]);
|
||||
ContestClearGeneralTextWindow();
|
||||
Contest_StartTextPrinter(gStringVar4, 1);
|
||||
Contest_StartTextPrinter(gStringVar4, TRUE);
|
||||
}
|
||||
|
||||
void MakeContestantNervous(u8 p)
|
||||
@@ -4744,7 +4744,7 @@ static void UpdateApplauseMeter(void)
|
||||
|
||||
s8 Contest_GetMoveExcitement(u16 move)
|
||||
{
|
||||
return gContestExcitementTable[gSpecialVar_ContestCategory][gContestMoves[move].contestCategory];
|
||||
return sContestExcitementTable[gSpecialVar_ContestCategory][gContestMoves[move].contestCategory];
|
||||
}
|
||||
|
||||
static u8 StartApplauseOverflowAnimation(void)
|
||||
@@ -5694,6 +5694,8 @@ static void SetContestLiveUpdateFlags(u8 contestant)
|
||||
}
|
||||
}
|
||||
|
||||
#define APPEAL_MOVES_END 0xFFFF
|
||||
|
||||
static void CalculateContestLiveUpdateData(void)
|
||||
{
|
||||
u8 loser;
|
||||
@@ -5758,7 +5760,7 @@ static void CalculateContestLiveUpdateData(void)
|
||||
appealMoves[i] = MOVE_NONE;
|
||||
numMoveUses[i] = 0;
|
||||
}
|
||||
appealMoves[CONTEST_NUM_APPEALS] = 0xFFFF;
|
||||
appealMoves[CONTEST_NUM_APPEALS] = APPEAL_MOVES_END;
|
||||
numMoveUses[CONTEST_NUM_APPEALS] = 0;
|
||||
|
||||
for (i = 0; i < CONTEST_NUM_APPEALS; i++)
|
||||
@@ -5787,7 +5789,7 @@ static void CalculateContestLiveUpdateData(void)
|
||||
moveCandidates[0] = appealMoves[0];
|
||||
mostUses = numMoveUses[0];
|
||||
numMoveCandidates = 0;
|
||||
for (i = 1; appealMoves[i] != 0xFFFF; i++)
|
||||
for (i = 1; appealMoves[i] != APPEAL_MOVES_END; i++)
|
||||
{
|
||||
if (mostUses < numMoveUses[i])
|
||||
{
|
||||
|
||||
+40
-32
@@ -77,7 +77,10 @@ enum {
|
||||
#define TAG_CONFETTI 3017
|
||||
#define TAG_WIRELESS_INDICATOR_WINDOW 22222
|
||||
|
||||
#define MAX_BAR_LENGTH 87
|
||||
// Length of the score bar on the results screen
|
||||
#define NUM_BAR_SEGMENTS 11
|
||||
#define BAR_SEGMENT_LENGTH 8 // Each segment of the results bar is a single tile, so 8 pixels long
|
||||
#define MAX_BAR_LENGTH (NUM_BAR_SEGMENTS * BAR_SEGMENT_LENGTH)
|
||||
|
||||
// Starting x/y for the sliding results screen text box
|
||||
#define TEXT_BOX_X (DISPLAY_WIDTH + 32)
|
||||
@@ -96,7 +99,7 @@ struct ContestResultsInternal
|
||||
u8 winnerMonSpriteId;
|
||||
bool8 destroyConfetti;
|
||||
bool8 pointsFlashing;
|
||||
s16 unkC[CONTESTANT_COUNT];
|
||||
s16 barLength[CONTESTANT_COUNT];
|
||||
u8 numBarsUpdating;
|
||||
};
|
||||
|
||||
@@ -193,7 +196,7 @@ static const struct OamData sOamData_ResultsTextWindow =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(64x32),
|
||||
.x = 0,
|
||||
@@ -239,7 +242,7 @@ static const struct OamData sOamData_Confetti =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(8x8),
|
||||
.x = 0,
|
||||
@@ -362,7 +365,7 @@ static const struct OamData sOamData_WirelessIndicatorWindow =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(16x16),
|
||||
.x = 0,
|
||||
@@ -1193,7 +1196,7 @@ static s32 DrawResultsTextWindow(const u8 *text, u8 spriteId)
|
||||
spriteTilePtrs[0] = (u8 *)(sprite->oam.tileNum * 32 + OBJ_VRAM0);
|
||||
|
||||
for (i = 1; i < (int)ARRAY_COUNT(spriteTilePtrs); i++)
|
||||
spriteTilePtrs[i] = (void*)(gSprites[sprite->data[i - 1]].oam.tileNum * 32 + OBJ_VRAM0);
|
||||
spriteTilePtrs[i] = (void *)(gSprites[sprite->data[i - 1]].oam.tileNum * 32 + OBJ_VRAM0);
|
||||
|
||||
for (i = 0; i < (int)ARRAY_COUNT(spriteTilePtrs); i++)
|
||||
CpuFill32(0, spriteTilePtrs[i], 0x400);
|
||||
@@ -1748,7 +1751,7 @@ static void CalculateContestantsResultData(void)
|
||||
if ((*sContestResults->monResults)[i].lostPoints)
|
||||
barLengthRound2 *= -1;
|
||||
|
||||
if (barLengthPreliminary + barLengthRound2 == MAX_BAR_LENGTH + 1)
|
||||
if (barLengthPreliminary + barLengthRound2 == MAX_BAR_LENGTH)
|
||||
{
|
||||
if (barLengthRound2 > 0)
|
||||
(*sContestResults->monResults)[i].barLengthRound2--;
|
||||
@@ -1841,47 +1844,52 @@ static void Task_UpdateContestResultBar(u8 taskId)
|
||||
s16 target = gTasks[taskId].tTarget;
|
||||
s16 decreasing = gTasks[taskId].tDecreasing;
|
||||
|
||||
// Has the results bar reached the limit?
|
||||
if (decreasing)
|
||||
{
|
||||
if (sContestResults->data->unkC[monId] <= 0)
|
||||
if (sContestResults->data->barLength[monId] <= 0)
|
||||
minMaxReached = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (sContestResults->data->unkC[monId] > MAX_BAR_LENGTH)
|
||||
if (sContestResults->data->barLength[monId] >= MAX_BAR_LENGTH)
|
||||
minMaxReached = TRUE;
|
||||
}
|
||||
|
||||
if (sContestResults->data->unkC[monId] == target)
|
||||
if (sContestResults->data->barLength[monId] == target)
|
||||
targetReached = TRUE;
|
||||
|
||||
if (!targetReached)
|
||||
{
|
||||
// Target length has not been reached, update bar length
|
||||
if (minMaxReached)
|
||||
sContestResults->data->unkC[monId] = target;
|
||||
sContestResults->data->barLength[monId] = target;
|
||||
else if (decreasing)
|
||||
sContestResults->data->unkC[monId] = sContestResults->data->unkC[monId] - 1;
|
||||
sContestResults->data->barLength[monId]--;
|
||||
else
|
||||
sContestResults->data->unkC[monId] = sContestResults->data->unkC[monId] + 1;
|
||||
sContestResults->data->barLength[monId]++;
|
||||
}
|
||||
|
||||
// Update the tiles of the results bar if it's still changing
|
||||
if (!minMaxReached && !targetReached)
|
||||
{
|
||||
u8 var0;
|
||||
u8 tileOffset;
|
||||
u16 tileNum;
|
||||
for (i = 0; i < 11; i++)
|
||||
for (i = 0; i < NUM_BAR_SEGMENTS; i++)
|
||||
{
|
||||
if (sContestResults->data->unkC[monId] >= (i + 1) * 8)
|
||||
var0 = 8;
|
||||
else if (sContestResults->data->unkC[monId] >= i * 8)
|
||||
var0 = sContestResults->data->unkC[monId] % 8;
|
||||
if (sContestResults->data->barLength[monId] >= (i + 1) * BAR_SEGMENT_LENGTH)
|
||||
tileOffset = 8; // Bar segment is full
|
||||
else if (sContestResults->data->barLength[monId] >= i * BAR_SEGMENT_LENGTH)
|
||||
tileOffset = sContestResults->data->barLength[monId] % 8; // Bar segment is between full and empty
|
||||
else
|
||||
var0 = 0;
|
||||
tileOffset = 0; // Bar segment is empty
|
||||
|
||||
if (var0 < 4)
|
||||
tileNum = 0x504C + var0;
|
||||
// The first 4 bar segment tiles are not adjacent in the tileset to the
|
||||
// remaining bar segment tiles; choose the base tile number accordingly.
|
||||
if (tileOffset < 4)
|
||||
tileNum = 0x504C + tileOffset;
|
||||
else
|
||||
tileNum = 0x5057 + var0;
|
||||
tileNum = 0x5057 + tileOffset;
|
||||
|
||||
FillBgTilemapBufferRect_Palette0(2, tileNum, i + 7, monId * 3 + 6, 1, 1);
|
||||
}
|
||||
@@ -2121,7 +2129,7 @@ static void Task_StartContest(u8 taskId)
|
||||
|
||||
void StartContest(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
CreateTask(Task_StartContest, 10);
|
||||
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
|
||||
}
|
||||
@@ -2142,7 +2150,7 @@ static void Task_StartShowContestResults(u8 taskId)
|
||||
|
||||
void ShowContestResults(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
CreateTask(Task_StartShowContestResults, 10);
|
||||
BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB_BLACK);
|
||||
}
|
||||
@@ -2155,7 +2163,7 @@ void GetContestPlayerId(void)
|
||||
void ContestLinkTransfer(u8 category)
|
||||
{
|
||||
u8 newTaskId;
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
newTaskId = CreateTask(Task_LinkContest_Init, 0);
|
||||
SetTaskFuncWithFollowupFunc(newTaskId, Task_LinkContest_Init, Task_StartCommunication);
|
||||
gTasks[newTaskId].data[9] = category;
|
||||
@@ -2257,8 +2265,8 @@ void Task_LinkContest_FinalizeConnection(u8 taskId)
|
||||
|
||||
DestroyTask(taskId);
|
||||
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, WARP_ID_NONE);
|
||||
ScriptContext2_Disable();
|
||||
EnableBothScriptContexts();
|
||||
UnlockPlayerFieldControls();
|
||||
ScriptContext_Enable();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2273,8 +2281,8 @@ static void Task_LinkContest_WaitDisconnect(u8 taskId)
|
||||
if (!gReceivedRemoteLinkPlayers)
|
||||
{
|
||||
DestroyTask(taskId);
|
||||
ScriptContext2_Disable();
|
||||
EnableBothScriptContexts();
|
||||
UnlockPlayerFieldControls();
|
||||
ScriptContext_Enable();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2631,7 +2639,7 @@ static void Task_ShowContestEntryMonPic(u8 taskId)
|
||||
break;
|
||||
case 1:
|
||||
task->data[5] = CreateWindowFromRect(10, 3, 8, 8);
|
||||
SetStandardWindowBorderStyle(task->data[5], 1);
|
||||
SetStandardWindowBorderStyle(task->data[5], TRUE);
|
||||
task->data[0]++;
|
||||
break;
|
||||
case 2:
|
||||
@@ -2718,7 +2726,7 @@ static void Task_LinkContestWaitForConnection(u8 taskId)
|
||||
default:
|
||||
if (IsLinkTaskFinished() == 1)
|
||||
{
|
||||
EnableBothScriptContexts();
|
||||
ScriptContext_Enable();
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
break;
|
||||
|
||||
+4
-4
@@ -286,7 +286,7 @@ static const struct OamData sOamData_MonBg =
|
||||
.y = DISPLAY_HEIGHT,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(64x64),
|
||||
.x = 0,
|
||||
@@ -1285,18 +1285,18 @@ static void ResetCreditsTasks(u8 taskId)
|
||||
gIntroCredits_MovingSceneryState = INTROCRED_SCENERY_DESTROY;
|
||||
}
|
||||
|
||||
static void LoadTheEndScreen(u16 arg0, u16 arg1, u16 palOffset)
|
||||
static void LoadTheEndScreen(u16 tileOffsetLoad, u16 tileOffsetWrite, u16 palOffset)
|
||||
{
|
||||
u16 baseTile;
|
||||
u16 i;
|
||||
|
||||
LZ77UnCompVram(sCreditsCopyrightEnd_Gfx, (void *)(VRAM + arg0));
|
||||
LZ77UnCompVram(sCreditsCopyrightEnd_Gfx, (void *)(VRAM + tileOffsetLoad));
|
||||
LoadPalette(gIntroCopyright_Pal, palOffset, sizeof(gIntroCopyright_Pal));
|
||||
|
||||
baseTile = (palOffset / 16) << 12;
|
||||
|
||||
for (i = 0; i < 32 * 32; i++)
|
||||
((u16 *) (VRAM + arg1))[i] = baseTile + 1;
|
||||
((u16 *) (VRAM + tileOffsetWrite))[i] = baseTile + 1;
|
||||
}
|
||||
|
||||
static u16 GetLetterMapTile(u8 baseTiles)
|
||||
|
||||
+2
-4
@@ -5,8 +5,7 @@
|
||||
.arm
|
||||
|
||||
.align 2, 0
|
||||
.global Init
|
||||
Init:
|
||||
Init::
|
||||
mov r0, #PSR_IRQ_MODE
|
||||
msr cpsr_cf, r0
|
||||
ldr sp, sp_irq
|
||||
@@ -33,8 +32,7 @@ sp_irq: .word IWRAM_END - 0x60
|
||||
|
||||
.arm
|
||||
.align 2, 0
|
||||
.global IntrMain
|
||||
IntrMain:
|
||||
IntrMain::
|
||||
mov r3, #REG_BASE
|
||||
add r3, r3, #OFFSET_REG_IE
|
||||
ldr r2, [r3]
|
||||
|
||||
@@ -1,67 +1,67 @@
|
||||
// Also used by early Pkmn Breeder, Collector, and Beauty trainers
|
||||
#define FRONTIER_MONS_YOUNGSTER_LASS_1 \
|
||||
FRONTIER_MON_SUNKERN, \
|
||||
FRONTIER_MON_AZURILL, \
|
||||
FRONTIER_MON_CATERPIE, \
|
||||
FRONTIER_MON_WEEDLE, \
|
||||
FRONTIER_MON_WURMPLE, \
|
||||
FRONTIER_MON_RALTS, \
|
||||
FRONTIER_MON_MAGIKARP, \
|
||||
FRONTIER_MON_FEEBAS, \
|
||||
FRONTIER_MON_PICHU, \
|
||||
FRONTIER_MON_IGGLYBUFF, \
|
||||
FRONTIER_MON_WOOPER, \
|
||||
FRONTIER_MON_TYROGUE, \
|
||||
FRONTIER_MON_SENTRET, \
|
||||
FRONTIER_MON_CLEFFA, \
|
||||
FRONTIER_MON_SEEDOT, \
|
||||
FRONTIER_MON_LOTAD, \
|
||||
FRONTIER_MON_POOCHYENA, \
|
||||
FRONTIER_MON_SHEDINJA, \
|
||||
FRONTIER_MON_MAKUHITA, \
|
||||
FRONTIER_MON_WHISMUR, \
|
||||
FRONTIER_MON_ZIGZAGOON, \
|
||||
FRONTIER_MON_ZUBAT, \
|
||||
FRONTIER_MON_TOGEPI, \
|
||||
FRONTIER_MON_SPINARAK, \
|
||||
FRONTIER_MON_MARILL, \
|
||||
FRONTIER_MON_HOPPIP, \
|
||||
FRONTIER_MON_SLUGMA, \
|
||||
FRONTIER_MON_SWINUB, \
|
||||
FRONTIER_MON_SMEARGLE, \
|
||||
FRONTIER_MON_PIDGEY, \
|
||||
FRONTIER_MON_RATTATA, \
|
||||
FRONTIER_MON_WYNAUT, \
|
||||
FRONTIER_MON_SKITTY, \
|
||||
FRONTIER_MON_SPEAROW, \
|
||||
FRONTIER_MON_HOOTHOOT, \
|
||||
FRONTIER_MON_DIGLETT, \
|
||||
FRONTIER_MON_LEDYBA, \
|
||||
FRONTIER_MON_NINCADA, \
|
||||
FRONTIER_MON_SURSKIT, \
|
||||
FRONTIER_MON_JIGGLYPUFF, \
|
||||
FRONTIER_MON_TAILLOW, \
|
||||
FRONTIER_MON_WINGULL, \
|
||||
FRONTIER_MON_NIDORAN_M, \
|
||||
FRONTIER_MON_NIDORAN_F, \
|
||||
FRONTIER_MON_KIRLIA, \
|
||||
FRONTIER_MON_MAREEP, \
|
||||
FRONTIER_MON_MEDITITE, \
|
||||
FRONTIER_MON_SLAKOTH, \
|
||||
FRONTIER_MON_PARAS, \
|
||||
FRONTIER_MON_EKANS, \
|
||||
FRONTIER_MON_DITTO, \
|
||||
FRONTIER_MON_BARBOACH, \
|
||||
FRONTIER_MON_MEOWTH, \
|
||||
FRONTIER_MON_PINECO, \
|
||||
FRONTIER_MON_TRAPINCH, \
|
||||
FRONTIER_MON_SPHEAL, \
|
||||
FRONTIER_MON_HORSEA, \
|
||||
FRONTIER_MON_SHROOMISH, \
|
||||
FRONTIER_MON_SHUPPET, \
|
||||
FRONTIER_MON_DUSKULL, \
|
||||
FRONTIER_MON_ELECTRIKE, \
|
||||
FRONTIER_MON_VULPIX, \
|
||||
FRONTIER_MON_SUNKERN, \
|
||||
FRONTIER_MON_AZURILL, \
|
||||
FRONTIER_MON_CATERPIE, \
|
||||
FRONTIER_MON_WEEDLE, \
|
||||
FRONTIER_MON_WURMPLE, \
|
||||
FRONTIER_MON_RALTS, \
|
||||
FRONTIER_MON_MAGIKARP, \
|
||||
FRONTIER_MON_FEEBAS, \
|
||||
FRONTIER_MON_PICHU, \
|
||||
FRONTIER_MON_IGGLYBUFF, \
|
||||
FRONTIER_MON_WOOPER, \
|
||||
FRONTIER_MON_TYROGUE, \
|
||||
FRONTIER_MON_SENTRET, \
|
||||
FRONTIER_MON_CLEFFA, \
|
||||
FRONTIER_MON_SEEDOT, \
|
||||
FRONTIER_MON_LOTAD, \
|
||||
FRONTIER_MON_POOCHYENA, \
|
||||
FRONTIER_MON_SHEDINJA, \
|
||||
FRONTIER_MON_MAKUHITA, \
|
||||
FRONTIER_MON_WHISMUR, \
|
||||
FRONTIER_MON_ZIGZAGOON, \
|
||||
FRONTIER_MON_ZUBAT, \
|
||||
FRONTIER_MON_TOGEPI, \
|
||||
FRONTIER_MON_SPINARAK, \
|
||||
FRONTIER_MON_MARILL, \
|
||||
FRONTIER_MON_HOPPIP, \
|
||||
FRONTIER_MON_SLUGMA, \
|
||||
FRONTIER_MON_SWINUB, \
|
||||
FRONTIER_MON_SMEARGLE, \
|
||||
FRONTIER_MON_PIDGEY, \
|
||||
FRONTIER_MON_RATTATA, \
|
||||
FRONTIER_MON_WYNAUT, \
|
||||
FRONTIER_MON_SKITTY, \
|
||||
FRONTIER_MON_SPEAROW, \
|
||||
FRONTIER_MON_HOOTHOOT, \
|
||||
FRONTIER_MON_DIGLETT, \
|
||||
FRONTIER_MON_LEDYBA, \
|
||||
FRONTIER_MON_NINCADA, \
|
||||
FRONTIER_MON_SURSKIT, \
|
||||
FRONTIER_MON_JIGGLYPUFF, \
|
||||
FRONTIER_MON_TAILLOW, \
|
||||
FRONTIER_MON_WINGULL, \
|
||||
FRONTIER_MON_NIDORAN_M, \
|
||||
FRONTIER_MON_NIDORAN_F, \
|
||||
FRONTIER_MON_KIRLIA, \
|
||||
FRONTIER_MON_MAREEP, \
|
||||
FRONTIER_MON_MEDITITE, \
|
||||
FRONTIER_MON_SLAKOTH, \
|
||||
FRONTIER_MON_PARAS, \
|
||||
FRONTIER_MON_EKANS, \
|
||||
FRONTIER_MON_DITTO, \
|
||||
FRONTIER_MON_BARBOACH, \
|
||||
FRONTIER_MON_MEOWTH, \
|
||||
FRONTIER_MON_PINECO, \
|
||||
FRONTIER_MON_TRAPINCH, \
|
||||
FRONTIER_MON_SPHEAL, \
|
||||
FRONTIER_MON_HORSEA, \
|
||||
FRONTIER_MON_SHROOMISH, \
|
||||
FRONTIER_MON_SHUPPET, \
|
||||
FRONTIER_MON_DUSKULL, \
|
||||
FRONTIER_MON_ELECTRIKE, \
|
||||
FRONTIER_MON_VULPIX, \
|
||||
-1
|
||||
|
||||
// Also used by early Pkmn Breeder, Collector, and Beauty trainers
|
||||
@@ -113,43 +113,43 @@
|
||||
-1
|
||||
|
||||
#define FRONTIER_MONS_RICH_BOY_LADY_1 \
|
||||
FRONTIER_MON_RALTS, \
|
||||
FRONTIER_MON_POOCHYENA, \
|
||||
FRONTIER_MON_SHEDINJA, \
|
||||
FRONTIER_MON_ZUBAT, \
|
||||
FRONTIER_MON_SPINARAK, \
|
||||
FRONTIER_MON_WYNAUT, \
|
||||
FRONTIER_MON_NIDORAN_M, \
|
||||
FRONTIER_MON_NIDORAN_F, \
|
||||
FRONTIER_MON_KIRLIA, \
|
||||
FRONTIER_MON_MEDITITE, \
|
||||
FRONTIER_MON_EKANS, \
|
||||
FRONTIER_MON_SHUPPET, \
|
||||
FRONTIER_MON_DUSKULL, \
|
||||
FRONTIER_MON_BELLSPROUT, \
|
||||
FRONTIER_MON_BALTOY, \
|
||||
FRONTIER_MON_BELDUM, \
|
||||
FRONTIER_MON_GULPIN, \
|
||||
FRONTIER_MON_VENONAT, \
|
||||
FRONTIER_MON_SMOOCHUM, \
|
||||
FRONTIER_MON_ABRA, \
|
||||
FRONTIER_MON_GASTLY, \
|
||||
FRONTIER_MON_SLOWPOKE, \
|
||||
FRONTIER_MON_BULBASAUR, \
|
||||
FRONTIER_MON_ODDISH, \
|
||||
FRONTIER_MON_NATU, \
|
||||
FRONTIER_MON_GRIMER, \
|
||||
FRONTIER_MON_EXEGGCUTE, \
|
||||
FRONTIER_MON_DROWZEE, \
|
||||
FRONTIER_MON_HOUNDOUR, \
|
||||
FRONTIER_MON_SPOINK, \
|
||||
FRONTIER_MON_TENTACOOL, \
|
||||
FRONTIER_MON_KOFFING, \
|
||||
FRONTIER_MON_NIDORINA, \
|
||||
FRONTIER_MON_NIDORINO, \
|
||||
FRONTIER_MON_BEEDRILL, \
|
||||
FRONTIER_MON_DUSTOX, \
|
||||
FRONTIER_MON_ARIADOS, \
|
||||
FRONTIER_MON_RALTS, \
|
||||
FRONTIER_MON_POOCHYENA, \
|
||||
FRONTIER_MON_SHEDINJA, \
|
||||
FRONTIER_MON_ZUBAT, \
|
||||
FRONTIER_MON_SPINARAK, \
|
||||
FRONTIER_MON_WYNAUT, \
|
||||
FRONTIER_MON_NIDORAN_M, \
|
||||
FRONTIER_MON_NIDORAN_F, \
|
||||
FRONTIER_MON_KIRLIA, \
|
||||
FRONTIER_MON_MEDITITE, \
|
||||
FRONTIER_MON_EKANS, \
|
||||
FRONTIER_MON_SHUPPET, \
|
||||
FRONTIER_MON_DUSKULL, \
|
||||
FRONTIER_MON_BELLSPROUT, \
|
||||
FRONTIER_MON_BALTOY, \
|
||||
FRONTIER_MON_BELDUM, \
|
||||
FRONTIER_MON_GULPIN, \
|
||||
FRONTIER_MON_VENONAT, \
|
||||
FRONTIER_MON_SMOOCHUM, \
|
||||
FRONTIER_MON_ABRA, \
|
||||
FRONTIER_MON_GASTLY, \
|
||||
FRONTIER_MON_SLOWPOKE, \
|
||||
FRONTIER_MON_BULBASAUR, \
|
||||
FRONTIER_MON_ODDISH, \
|
||||
FRONTIER_MON_NATU, \
|
||||
FRONTIER_MON_GRIMER, \
|
||||
FRONTIER_MON_EXEGGCUTE, \
|
||||
FRONTIER_MON_DROWZEE, \
|
||||
FRONTIER_MON_HOUNDOUR, \
|
||||
FRONTIER_MON_SPOINK, \
|
||||
FRONTIER_MON_TENTACOOL, \
|
||||
FRONTIER_MON_KOFFING, \
|
||||
FRONTIER_MON_NIDORINA, \
|
||||
FRONTIER_MON_NIDORINO, \
|
||||
FRONTIER_MON_BEEDRILL, \
|
||||
FRONTIER_MON_DUSTOX, \
|
||||
FRONTIER_MON_ARIADOS, \
|
||||
-1
|
||||
|
||||
// Also used by early Pkmn Breeder, Collector, and Beauty trainers
|
||||
|
||||
@@ -1038,7 +1038,7 @@ static const struct PyramidWildMon sOpenLevelWildMons_Round20[] =
|
||||
}
|
||||
};
|
||||
|
||||
static const struct PyramidWildMon *const sOpenLevelWildMonPointers[] =
|
||||
static const struct PyramidWildMon *const sOpenLevelWildMonPointers[TOTAL_ROUNDS] =
|
||||
{
|
||||
sOpenLevelWildMons_Round1,
|
||||
sOpenLevelWildMons_Round2,
|
||||
|
||||
+316
-1073
File diff suppressed because it is too large
Load Diff
@@ -1,253 +1,253 @@
|
||||
const u16 gEasyChatGroup_Pokemon2[] = {
|
||||
SPECIES_ABRA,
|
||||
SPECIES_AERODACTYL,
|
||||
SPECIES_AIPOM,
|
||||
SPECIES_ALAKAZAM,
|
||||
SPECIES_AMPHAROS,
|
||||
SPECIES_ARBOK,
|
||||
SPECIES_ARCANINE,
|
||||
SPECIES_ARIADOS,
|
||||
SPECIES_ARTICUNO,
|
||||
SPECIES_AZUMARILL,
|
||||
SPECIES_BAYLEEF,
|
||||
SPECIES_BEEDRILL,
|
||||
SPECIES_BELLOSSOM,
|
||||
SPECIES_BELLSPROUT,
|
||||
SPECIES_BLASTOISE,
|
||||
SPECIES_BLISSEY,
|
||||
SPECIES_BULBASAUR,
|
||||
SPECIES_BUTTERFREE,
|
||||
SPECIES_CATERPIE,
|
||||
SPECIES_CELEBI,
|
||||
SPECIES_CHANSEY,
|
||||
SPECIES_CHARIZARD,
|
||||
SPECIES_CHARMANDER,
|
||||
SPECIES_CHARMELEON,
|
||||
SPECIES_CHIKORITA,
|
||||
SPECIES_CHINCHOU,
|
||||
SPECIES_CLEFABLE,
|
||||
SPECIES_CLEFAIRY,
|
||||
SPECIES_CLEFFA,
|
||||
SPECIES_CLOYSTER,
|
||||
SPECIES_CORSOLA,
|
||||
SPECIES_CROBAT,
|
||||
SPECIES_CROCONAW,
|
||||
SPECIES_CUBONE,
|
||||
SPECIES_CYNDAQUIL,
|
||||
SPECIES_DELIBIRD,
|
||||
SPECIES_DEWGONG,
|
||||
SPECIES_DIGLETT,
|
||||
SPECIES_DITTO,
|
||||
SPECIES_DODRIO,
|
||||
SPECIES_DODUO,
|
||||
SPECIES_DONPHAN,
|
||||
SPECIES_DRAGONAIR,
|
||||
SPECIES_DRAGONITE,
|
||||
SPECIES_DRATINI,
|
||||
SPECIES_DROWZEE,
|
||||
SPECIES_DUGTRIO,
|
||||
SPECIES_DUNSPARCE,
|
||||
SPECIES_EEVEE,
|
||||
SPECIES_EKANS,
|
||||
SPECIES_ELECTABUZZ,
|
||||
SPECIES_ELECTRODE,
|
||||
SPECIES_ELEKID,
|
||||
SPECIES_ENTEI,
|
||||
SPECIES_ESPEON,
|
||||
SPECIES_EXEGGCUTE,
|
||||
SPECIES_EXEGGUTOR,
|
||||
SPECIES_FARFETCHD,
|
||||
SPECIES_FEAROW,
|
||||
SPECIES_FERALIGATR,
|
||||
SPECIES_FLAAFFY,
|
||||
SPECIES_FLAREON,
|
||||
SPECIES_FORRETRESS,
|
||||
SPECIES_FURRET,
|
||||
SPECIES_GASTLY,
|
||||
SPECIES_GENGAR,
|
||||
SPECIES_GEODUDE,
|
||||
SPECIES_GIRAFARIG,
|
||||
SPECIES_GLIGAR,
|
||||
SPECIES_GLOOM,
|
||||
SPECIES_GOLBAT,
|
||||
SPECIES_GOLDEEN,
|
||||
SPECIES_GOLDUCK,
|
||||
SPECIES_GOLEM,
|
||||
SPECIES_GRANBULL,
|
||||
SPECIES_GRAVELER,
|
||||
SPECIES_GRIMER,
|
||||
SPECIES_GROWLITHE,
|
||||
SPECIES_GYARADOS,
|
||||
SPECIES_HAUNTER,
|
||||
SPECIES_HERACROSS,
|
||||
SPECIES_HITMONCHAN,
|
||||
SPECIES_HITMONLEE,
|
||||
SPECIES_HITMONTOP,
|
||||
SPECIES_HO_OH,
|
||||
SPECIES_HOOTHOOT,
|
||||
SPECIES_HOPPIP,
|
||||
SPECIES_HORSEA,
|
||||
SPECIES_HOUNDOOM,
|
||||
SPECIES_HOUNDOUR,
|
||||
SPECIES_HYPNO,
|
||||
SPECIES_IGGLYBUFF,
|
||||
SPECIES_IVYSAUR,
|
||||
SPECIES_JIGGLYPUFF,
|
||||
SPECIES_JOLTEON,
|
||||
SPECIES_JUMPLUFF,
|
||||
SPECIES_JYNX,
|
||||
SPECIES_KABUTO,
|
||||
SPECIES_KABUTOPS,
|
||||
SPECIES_KADABRA,
|
||||
SPECIES_KAKUNA,
|
||||
SPECIES_KANGASKHAN,
|
||||
SPECIES_KINGDRA,
|
||||
SPECIES_KINGLER,
|
||||
SPECIES_KOFFING,
|
||||
SPECIES_KRABBY,
|
||||
SPECIES_LANTURN,
|
||||
SPECIES_LAPRAS,
|
||||
SPECIES_LARVITAR,
|
||||
SPECIES_LEDIAN,
|
||||
SPECIES_LEDYBA,
|
||||
SPECIES_LICKITUNG,
|
||||
SPECIES_LUGIA,
|
||||
SPECIES_MACHAMP,
|
||||
SPECIES_MACHOKE,
|
||||
SPECIES_MACHOP,
|
||||
SPECIES_MAGBY,
|
||||
SPECIES_MAGCARGO,
|
||||
SPECIES_MAGIKARP,
|
||||
SPECIES_MAGMAR,
|
||||
SPECIES_MAGNEMITE,
|
||||
SPECIES_MAGNETON,
|
||||
SPECIES_MANKEY,
|
||||
SPECIES_MANTINE,
|
||||
SPECIES_MAREEP,
|
||||
SPECIES_MARILL,
|
||||
SPECIES_MAROWAK,
|
||||
SPECIES_MEGANIUM,
|
||||
SPECIES_MEOWTH,
|
||||
SPECIES_METAPOD,
|
||||
SPECIES_MEW,
|
||||
SPECIES_MEWTWO,
|
||||
SPECIES_MILTANK,
|
||||
SPECIES_MISDREAVUS,
|
||||
SPECIES_MOLTRES,
|
||||
SPECIES_MR_MIME,
|
||||
SPECIES_MUK,
|
||||
SPECIES_MURKROW,
|
||||
SPECIES_NATU,
|
||||
SPECIES_NIDOKING,
|
||||
SPECIES_NIDOQUEEN,
|
||||
SPECIES_NIDORAN_F,
|
||||
SPECIES_NIDORAN_M,
|
||||
SPECIES_NIDORINA,
|
||||
SPECIES_NIDORINO,
|
||||
SPECIES_NINETALES,
|
||||
SPECIES_NOCTOWL,
|
||||
SPECIES_OCTILLERY,
|
||||
SPECIES_ODDISH,
|
||||
SPECIES_OMANYTE,
|
||||
SPECIES_OMASTAR,
|
||||
SPECIES_ONIX,
|
||||
SPECIES_PARAS,
|
||||
SPECIES_PARASECT,
|
||||
SPECIES_PERSIAN,
|
||||
SPECIES_PHANPY,
|
||||
SPECIES_PICHU,
|
||||
SPECIES_PIDGEOT,
|
||||
SPECIES_PIDGEOTTO,
|
||||
SPECIES_PIDGEY,
|
||||
SPECIES_PIKACHU,
|
||||
SPECIES_PILOSWINE,
|
||||
SPECIES_PINECO,
|
||||
SPECIES_PINSIR,
|
||||
SPECIES_POLITOED,
|
||||
SPECIES_POLIWAG,
|
||||
SPECIES_POLIWHIRL,
|
||||
SPECIES_POLIWRATH,
|
||||
SPECIES_PONYTA,
|
||||
SPECIES_PORYGON,
|
||||
SPECIES_PORYGON2,
|
||||
SPECIES_PRIMEAPE,
|
||||
SPECIES_PSYDUCK,
|
||||
SPECIES_PUPITAR,
|
||||
SPECIES_QUAGSIRE,
|
||||
SPECIES_QUILAVA,
|
||||
SPECIES_QWILFISH,
|
||||
SPECIES_RAICHU,
|
||||
SPECIES_RAIKOU,
|
||||
SPECIES_RAPIDASH,
|
||||
SPECIES_RATICATE,
|
||||
SPECIES_RATTATA,
|
||||
SPECIES_REMORAID,
|
||||
SPECIES_RHYDON,
|
||||
SPECIES_RHYHORN,
|
||||
SPECIES_SANDSHREW,
|
||||
SPECIES_SANDSLASH,
|
||||
SPECIES_SCIZOR,
|
||||
SPECIES_SCYTHER,
|
||||
SPECIES_SEADRA,
|
||||
SPECIES_SEAKING,
|
||||
SPECIES_SEEL,
|
||||
SPECIES_SENTRET,
|
||||
SPECIES_SHELLDER,
|
||||
SPECIES_SHUCKLE,
|
||||
SPECIES_SKARMORY,
|
||||
SPECIES_SKIPLOOM,
|
||||
SPECIES_SLOWBRO,
|
||||
SPECIES_SLOWKING,
|
||||
SPECIES_SLOWPOKE,
|
||||
SPECIES_SLUGMA,
|
||||
SPECIES_SMEARGLE,
|
||||
SPECIES_SMOOCHUM,
|
||||
SPECIES_SNEASEL,
|
||||
SPECIES_SNORLAX,
|
||||
SPECIES_SNUBBULL,
|
||||
SPECIES_SPEAROW,
|
||||
SPECIES_SPINARAK,
|
||||
SPECIES_SQUIRTLE,
|
||||
SPECIES_STANTLER,
|
||||
SPECIES_STARMIE,
|
||||
SPECIES_STARYU,
|
||||
SPECIES_STEELIX,
|
||||
SPECIES_SUDOWOODO,
|
||||
SPECIES_SUICUNE,
|
||||
SPECIES_SUNFLORA,
|
||||
SPECIES_SUNKERN,
|
||||
SPECIES_SWINUB,
|
||||
SPECIES_TANGELA,
|
||||
SPECIES_TAUROS,
|
||||
SPECIES_TEDDIURSA,
|
||||
SPECIES_TENTACOOL,
|
||||
SPECIES_TENTACRUEL,
|
||||
SPECIES_TOGEPI,
|
||||
SPECIES_TOGETIC,
|
||||
SPECIES_TOTODILE,
|
||||
SPECIES_TYPHLOSION,
|
||||
SPECIES_TYRANITAR,
|
||||
SPECIES_TYROGUE,
|
||||
SPECIES_UMBREON,
|
||||
SPECIES_UNOWN,
|
||||
SPECIES_URSARING,
|
||||
SPECIES_VAPOREON,
|
||||
SPECIES_VENOMOTH,
|
||||
SPECIES_VENONAT,
|
||||
SPECIES_VENUSAUR,
|
||||
SPECIES_VICTREEBEL,
|
||||
SPECIES_VILEPLUME,
|
||||
SPECIES_VOLTORB,
|
||||
SPECIES_VULPIX,
|
||||
SPECIES_WARTORTLE,
|
||||
SPECIES_WEEDLE,
|
||||
SPECIES_WEEPINBELL,
|
||||
SPECIES_WEEZING,
|
||||
SPECIES_WIGGLYTUFF,
|
||||
SPECIES_WOBBUFFET,
|
||||
SPECIES_WOOPER,
|
||||
SPECIES_XATU,
|
||||
SPECIES_YANMA,
|
||||
SPECIES_ZAPDOS,
|
||||
SPECIES_ZUBAT,
|
||||
SPECIES_ABRA,
|
||||
SPECIES_AERODACTYL,
|
||||
SPECIES_AIPOM,
|
||||
SPECIES_ALAKAZAM,
|
||||
SPECIES_AMPHAROS,
|
||||
SPECIES_ARBOK,
|
||||
SPECIES_ARCANINE,
|
||||
SPECIES_ARIADOS,
|
||||
SPECIES_ARTICUNO,
|
||||
SPECIES_AZUMARILL,
|
||||
SPECIES_BAYLEEF,
|
||||
SPECIES_BEEDRILL,
|
||||
SPECIES_BELLOSSOM,
|
||||
SPECIES_BELLSPROUT,
|
||||
SPECIES_BLASTOISE,
|
||||
SPECIES_BLISSEY,
|
||||
SPECIES_BULBASAUR,
|
||||
SPECIES_BUTTERFREE,
|
||||
SPECIES_CATERPIE,
|
||||
SPECIES_CELEBI,
|
||||
SPECIES_CHANSEY,
|
||||
SPECIES_CHARIZARD,
|
||||
SPECIES_CHARMANDER,
|
||||
SPECIES_CHARMELEON,
|
||||
SPECIES_CHIKORITA,
|
||||
SPECIES_CHINCHOU,
|
||||
SPECIES_CLEFABLE,
|
||||
SPECIES_CLEFAIRY,
|
||||
SPECIES_CLEFFA,
|
||||
SPECIES_CLOYSTER,
|
||||
SPECIES_CORSOLA,
|
||||
SPECIES_CROBAT,
|
||||
SPECIES_CROCONAW,
|
||||
SPECIES_CUBONE,
|
||||
SPECIES_CYNDAQUIL,
|
||||
SPECIES_DELIBIRD,
|
||||
SPECIES_DEWGONG,
|
||||
SPECIES_DIGLETT,
|
||||
SPECIES_DITTO,
|
||||
SPECIES_DODRIO,
|
||||
SPECIES_DODUO,
|
||||
SPECIES_DONPHAN,
|
||||
SPECIES_DRAGONAIR,
|
||||
SPECIES_DRAGONITE,
|
||||
SPECIES_DRATINI,
|
||||
SPECIES_DROWZEE,
|
||||
SPECIES_DUGTRIO,
|
||||
SPECIES_DUNSPARCE,
|
||||
SPECIES_EEVEE,
|
||||
SPECIES_EKANS,
|
||||
SPECIES_ELECTABUZZ,
|
||||
SPECIES_ELECTRODE,
|
||||
SPECIES_ELEKID,
|
||||
SPECIES_ENTEI,
|
||||
SPECIES_ESPEON,
|
||||
SPECIES_EXEGGCUTE,
|
||||
SPECIES_EXEGGUTOR,
|
||||
SPECIES_FARFETCHD,
|
||||
SPECIES_FEAROW,
|
||||
SPECIES_FERALIGATR,
|
||||
SPECIES_FLAAFFY,
|
||||
SPECIES_FLAREON,
|
||||
SPECIES_FORRETRESS,
|
||||
SPECIES_FURRET,
|
||||
SPECIES_GASTLY,
|
||||
SPECIES_GENGAR,
|
||||
SPECIES_GEODUDE,
|
||||
SPECIES_GIRAFARIG,
|
||||
SPECIES_GLIGAR,
|
||||
SPECIES_GLOOM,
|
||||
SPECIES_GOLBAT,
|
||||
SPECIES_GOLDEEN,
|
||||
SPECIES_GOLDUCK,
|
||||
SPECIES_GOLEM,
|
||||
SPECIES_GRANBULL,
|
||||
SPECIES_GRAVELER,
|
||||
SPECIES_GRIMER,
|
||||
SPECIES_GROWLITHE,
|
||||
SPECIES_GYARADOS,
|
||||
SPECIES_HAUNTER,
|
||||
SPECIES_HERACROSS,
|
||||
SPECIES_HITMONCHAN,
|
||||
SPECIES_HITMONLEE,
|
||||
SPECIES_HITMONTOP,
|
||||
SPECIES_HO_OH,
|
||||
SPECIES_HOOTHOOT,
|
||||
SPECIES_HOPPIP,
|
||||
SPECIES_HORSEA,
|
||||
SPECIES_HOUNDOOM,
|
||||
SPECIES_HOUNDOUR,
|
||||
SPECIES_HYPNO,
|
||||
SPECIES_IGGLYBUFF,
|
||||
SPECIES_IVYSAUR,
|
||||
SPECIES_JIGGLYPUFF,
|
||||
SPECIES_JOLTEON,
|
||||
SPECIES_JUMPLUFF,
|
||||
SPECIES_JYNX,
|
||||
SPECIES_KABUTO,
|
||||
SPECIES_KABUTOPS,
|
||||
SPECIES_KADABRA,
|
||||
SPECIES_KAKUNA,
|
||||
SPECIES_KANGASKHAN,
|
||||
SPECIES_KINGDRA,
|
||||
SPECIES_KINGLER,
|
||||
SPECIES_KOFFING,
|
||||
SPECIES_KRABBY,
|
||||
SPECIES_LANTURN,
|
||||
SPECIES_LAPRAS,
|
||||
SPECIES_LARVITAR,
|
||||
SPECIES_LEDIAN,
|
||||
SPECIES_LEDYBA,
|
||||
SPECIES_LICKITUNG,
|
||||
SPECIES_LUGIA,
|
||||
SPECIES_MACHAMP,
|
||||
SPECIES_MACHOKE,
|
||||
SPECIES_MACHOP,
|
||||
SPECIES_MAGBY,
|
||||
SPECIES_MAGCARGO,
|
||||
SPECIES_MAGIKARP,
|
||||
SPECIES_MAGMAR,
|
||||
SPECIES_MAGNEMITE,
|
||||
SPECIES_MAGNETON,
|
||||
SPECIES_MANKEY,
|
||||
SPECIES_MANTINE,
|
||||
SPECIES_MAREEP,
|
||||
SPECIES_MARILL,
|
||||
SPECIES_MAROWAK,
|
||||
SPECIES_MEGANIUM,
|
||||
SPECIES_MEOWTH,
|
||||
SPECIES_METAPOD,
|
||||
SPECIES_MEW,
|
||||
SPECIES_MEWTWO,
|
||||
SPECIES_MILTANK,
|
||||
SPECIES_MISDREAVUS,
|
||||
SPECIES_MOLTRES,
|
||||
SPECIES_MR_MIME,
|
||||
SPECIES_MUK,
|
||||
SPECIES_MURKROW,
|
||||
SPECIES_NATU,
|
||||
SPECIES_NIDOKING,
|
||||
SPECIES_NIDOQUEEN,
|
||||
SPECIES_NIDORAN_F,
|
||||
SPECIES_NIDORAN_M,
|
||||
SPECIES_NIDORINA,
|
||||
SPECIES_NIDORINO,
|
||||
SPECIES_NINETALES,
|
||||
SPECIES_NOCTOWL,
|
||||
SPECIES_OCTILLERY,
|
||||
SPECIES_ODDISH,
|
||||
SPECIES_OMANYTE,
|
||||
SPECIES_OMASTAR,
|
||||
SPECIES_ONIX,
|
||||
SPECIES_PARAS,
|
||||
SPECIES_PARASECT,
|
||||
SPECIES_PERSIAN,
|
||||
SPECIES_PHANPY,
|
||||
SPECIES_PICHU,
|
||||
SPECIES_PIDGEOT,
|
||||
SPECIES_PIDGEOTTO,
|
||||
SPECIES_PIDGEY,
|
||||
SPECIES_PIKACHU,
|
||||
SPECIES_PILOSWINE,
|
||||
SPECIES_PINECO,
|
||||
SPECIES_PINSIR,
|
||||
SPECIES_POLITOED,
|
||||
SPECIES_POLIWAG,
|
||||
SPECIES_POLIWHIRL,
|
||||
SPECIES_POLIWRATH,
|
||||
SPECIES_PONYTA,
|
||||
SPECIES_PORYGON,
|
||||
SPECIES_PORYGON2,
|
||||
SPECIES_PRIMEAPE,
|
||||
SPECIES_PSYDUCK,
|
||||
SPECIES_PUPITAR,
|
||||
SPECIES_QUAGSIRE,
|
||||
SPECIES_QUILAVA,
|
||||
SPECIES_QWILFISH,
|
||||
SPECIES_RAICHU,
|
||||
SPECIES_RAIKOU,
|
||||
SPECIES_RAPIDASH,
|
||||
SPECIES_RATICATE,
|
||||
SPECIES_RATTATA,
|
||||
SPECIES_REMORAID,
|
||||
SPECIES_RHYDON,
|
||||
SPECIES_RHYHORN,
|
||||
SPECIES_SANDSHREW,
|
||||
SPECIES_SANDSLASH,
|
||||
SPECIES_SCIZOR,
|
||||
SPECIES_SCYTHER,
|
||||
SPECIES_SEADRA,
|
||||
SPECIES_SEAKING,
|
||||
SPECIES_SEEL,
|
||||
SPECIES_SENTRET,
|
||||
SPECIES_SHELLDER,
|
||||
SPECIES_SHUCKLE,
|
||||
SPECIES_SKARMORY,
|
||||
SPECIES_SKIPLOOM,
|
||||
SPECIES_SLOWBRO,
|
||||
SPECIES_SLOWKING,
|
||||
SPECIES_SLOWPOKE,
|
||||
SPECIES_SLUGMA,
|
||||
SPECIES_SMEARGLE,
|
||||
SPECIES_SMOOCHUM,
|
||||
SPECIES_SNEASEL,
|
||||
SPECIES_SNORLAX,
|
||||
SPECIES_SNUBBULL,
|
||||
SPECIES_SPEAROW,
|
||||
SPECIES_SPINARAK,
|
||||
SPECIES_SQUIRTLE,
|
||||
SPECIES_STANTLER,
|
||||
SPECIES_STARMIE,
|
||||
SPECIES_STARYU,
|
||||
SPECIES_STEELIX,
|
||||
SPECIES_SUDOWOODO,
|
||||
SPECIES_SUICUNE,
|
||||
SPECIES_SUNFLORA,
|
||||
SPECIES_SUNKERN,
|
||||
SPECIES_SWINUB,
|
||||
SPECIES_TANGELA,
|
||||
SPECIES_TAUROS,
|
||||
SPECIES_TEDDIURSA,
|
||||
SPECIES_TENTACOOL,
|
||||
SPECIES_TENTACRUEL,
|
||||
SPECIES_TOGEPI,
|
||||
SPECIES_TOGETIC,
|
||||
SPECIES_TOTODILE,
|
||||
SPECIES_TYPHLOSION,
|
||||
SPECIES_TYRANITAR,
|
||||
SPECIES_TYROGUE,
|
||||
SPECIES_UMBREON,
|
||||
SPECIES_UNOWN,
|
||||
SPECIES_URSARING,
|
||||
SPECIES_VAPOREON,
|
||||
SPECIES_VENOMOTH,
|
||||
SPECIES_VENONAT,
|
||||
SPECIES_VENUSAUR,
|
||||
SPECIES_VICTREEBEL,
|
||||
SPECIES_VILEPLUME,
|
||||
SPECIES_VOLTORB,
|
||||
SPECIES_VULPIX,
|
||||
SPECIES_WARTORTLE,
|
||||
SPECIES_WEEDLE,
|
||||
SPECIES_WEEPINBELL,
|
||||
SPECIES_WEEZING,
|
||||
SPECIES_WIGGLYTUFF,
|
||||
SPECIES_WOBBUFFET,
|
||||
SPECIES_WOOPER,
|
||||
SPECIES_XATU,
|
||||
SPECIES_YANMA,
|
||||
SPECIES_ZAPDOS,
|
||||
SPECIES_ZUBAT,
|
||||
};
|
||||
|
||||
@@ -1,40 +1,40 @@
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowSmall;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowMedium;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowLarge;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowExtraLarge;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_TallGrass;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Ripple;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Ash;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_SurfBlob;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Arrow;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_GroundImpactDust;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_JumpTallGrass;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_SandFootprints;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_JumpBigSplash;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Splash;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_JumpSmallSplash;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_LongGrass;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_JumpLongGrass;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_UnusedGrass;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_UnusedGrass2;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_UnusedSand;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_WaterSurfacing;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_ReflectionDistortion;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Sparkle;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_DeepSandFootprints;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_TreeDisguise;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_MountainDisguise;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Bird;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_BikeTireTracks;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_SandDisguisePlaceholder;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_SandPile;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_ShortGrass;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_HotSpringsWater;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_AshPuff;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_AshLaunch;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Bubbles;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_SmallSparkle;
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_Rayquaza;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowSmall;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowMedium;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowLarge;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_ShadowExtraLarge;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_TallGrass;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_Ripple;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_Ash;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_SurfBlob;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_Arrow;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_GroundImpactDust;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_JumpTallGrass;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_SandFootprints;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_JumpBigSplash;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_Splash;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_JumpSmallSplash;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_LongGrass;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_JumpLongGrass;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_UnusedGrass;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_UnusedGrass2;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_UnusedSand;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_WaterSurfacing;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_ReflectionDistortion;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_Sparkle;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_DeepSandFootprints;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_TreeDisguise;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_MountainDisguise;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_Bird;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_BikeTireTracks;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_SandDisguisePlaceholder;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_SandPile;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_ShortGrass;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_HotSpringsWater;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_AshPuff;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_AshLaunch;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_Bubbles;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_SmallSparkle;
|
||||
extern const struct SpriteTemplate gFieldEffectObjectTemplate_Rayquaza;
|
||||
|
||||
const struct SpriteTemplate *const gFieldEffectObjectTemplatePointers[] = {
|
||||
[FLDEFFOBJ_SHADOW_S] = &gFieldEffectObjectTemplate_ShadowSmall,
|
||||
|
||||
@@ -1147,7 +1147,7 @@ static const union AnimCmd *const sAnimTable_AshPuff[] =
|
||||
sAnim_AshPuff,
|
||||
};
|
||||
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_AshPuff =
|
||||
const struct SpriteTemplate gFieldEffectObjectTemplate_AshPuff =
|
||||
{
|
||||
.tileTag = TAG_NONE,
|
||||
.paletteTag = FLDEFF_PAL_TAG_ASH,
|
||||
@@ -1272,7 +1272,7 @@ static const union AnimCmd *const sAnimTable_RayquazaSpotlightEffect[] = {
|
||||
sAnim_RayquazaSpotlightEffect,
|
||||
};
|
||||
|
||||
const struct SpriteFrameImage sPicTable_RayquazaSpotlightEffect[] = {
|
||||
static const struct SpriteFrameImage sPicTable_RayquazaSpotlightEffect[] = {
|
||||
overworld_frame(gObjectEventPic_Rayquaza, 4, 4, 0),
|
||||
};
|
||||
|
||||
|
||||
+193
-193
@@ -1,290 +1,290 @@
|
||||
const u32 gTrainerFrontPic_Hiker[] = INCBIN_U32("graphics/trainers/front_pics/hiker_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_Hiker[] = INCBIN_U32("graphics/trainers/palettes/hiker.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_Hiker[] = INCBIN_U32("graphics/trainers/front_pics/hiker.4bpp.lz");
|
||||
const u32 gTrainerPalette_Hiker[] = INCBIN_U32("graphics/trainers/front_pics/hiker.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_AquaGruntM[] = INCBIN_U32("graphics/trainers/front_pics/aqua_grunt_m_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_AquaGruntM[] = INCBIN_U32("graphics/trainers/palettes/aqua_grunt_m.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_AquaGruntM[] = INCBIN_U32("graphics/trainers/front_pics/aqua_grunt_m.4bpp.lz");
|
||||
const u32 gTrainerPalette_AquaGruntM[] = INCBIN_U32("graphics/trainers/front_pics/aqua_grunt_m.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_PokemonBreederF[] = INCBIN_U32("graphics/trainers/front_pics/pokemon_breeder_f_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_PokemonBreederF[] = INCBIN_U32("graphics/trainers/palettes/pokemon_breeder_f.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_PokemonBreederF[] = INCBIN_U32("graphics/trainers/front_pics/pokemon_breeder_f.4bpp.lz");
|
||||
const u32 gTrainerPalette_PokemonBreederF[] = INCBIN_U32("graphics/trainers/front_pics/pokemon_breeder_f.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_CoolTrainerM[] = INCBIN_U32("graphics/trainers/front_pics/cooltrainer_m_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_CoolTrainerM[] = INCBIN_U32("graphics/trainers/palettes/cooltrainer_m.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_CoolTrainerM[] = INCBIN_U32("graphics/trainers/front_pics/cooltrainer_m.4bpp.lz");
|
||||
const u32 gTrainerPalette_CoolTrainerM[] = INCBIN_U32("graphics/trainers/front_pics/cooltrainer_m.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_BirdKeeper[] = INCBIN_U32("graphics/trainers/front_pics/bird_keeper_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_BirdKeeper[] = INCBIN_U32("graphics/trainers/palettes/bird_keeper.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_BirdKeeper[] = INCBIN_U32("graphics/trainers/front_pics/bird_keeper.4bpp.lz");
|
||||
const u32 gTrainerPalette_BirdKeeper[] = INCBIN_U32("graphics/trainers/front_pics/bird_keeper.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_Collector[] = INCBIN_U32("graphics/trainers/front_pics/collector_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_Collector[] = INCBIN_U32("graphics/trainers/palettes/collector.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_Collector[] = INCBIN_U32("graphics/trainers/front_pics/collector.4bpp.lz");
|
||||
const u32 gTrainerPalette_Collector[] = INCBIN_U32("graphics/trainers/front_pics/collector.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_AquaGruntF[] = INCBIN_U32("graphics/trainers/front_pics/aqua_grunt_f_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_AquaGruntF[] = INCBIN_U32("graphics/trainers/palettes/aqua_grunt_f.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_AquaGruntF[] = INCBIN_U32("graphics/trainers/front_pics/aqua_grunt_f.4bpp.lz");
|
||||
const u32 gTrainerPalette_AquaGruntF[] = INCBIN_U32("graphics/trainers/front_pics/aqua_grunt_f.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_SwimmerM[] = INCBIN_U32("graphics/trainers/front_pics/swimmer_m_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_SwimmerM[] = INCBIN_U32("graphics/trainers/palettes/swimmer_m.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_SwimmerM[] = INCBIN_U32("graphics/trainers/front_pics/swimmer_m.4bpp.lz");
|
||||
const u32 gTrainerPalette_SwimmerM[] = INCBIN_U32("graphics/trainers/front_pics/swimmer_m.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_MagmaGruntM[] = INCBIN_U32("graphics/trainers/front_pics/magma_grunt_m_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_MagmaGruntM[] = INCBIN_U32("graphics/trainers/palettes/magma_grunt_m.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_MagmaGruntM[] = INCBIN_U32("graphics/trainers/front_pics/magma_grunt_m.4bpp.lz");
|
||||
const u32 gTrainerPalette_MagmaGruntM[] = INCBIN_U32("graphics/trainers/front_pics/magma_grunt_m.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_ExpertM[] = INCBIN_U32("graphics/trainers/front_pics/expert_m_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_ExpertM[] = INCBIN_U32("graphics/trainers/palettes/expert_m.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_ExpertM[] = INCBIN_U32("graphics/trainers/front_pics/expert_m.4bpp.lz");
|
||||
const u32 gTrainerPalette_ExpertM[] = INCBIN_U32("graphics/trainers/front_pics/expert_m.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_AquaAdminM[] = INCBIN_U32("graphics/trainers/front_pics/aqua_admin_m_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_AquaAdminM[] = INCBIN_U32("graphics/trainers/palettes/aqua_admin_m.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_AquaAdminM[] = INCBIN_U32("graphics/trainers/front_pics/aqua_admin_m.4bpp.lz");
|
||||
const u32 gTrainerPalette_AquaAdminM[] = INCBIN_U32("graphics/trainers/front_pics/aqua_admin_m.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_BlackBelt[] = INCBIN_U32("graphics/trainers/front_pics/black_belt_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_BlackBelt[] = INCBIN_U32("graphics/trainers/palettes/black_belt.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_BlackBelt[] = INCBIN_U32("graphics/trainers/front_pics/black_belt.4bpp.lz");
|
||||
const u32 gTrainerPalette_BlackBelt[] = INCBIN_U32("graphics/trainers/front_pics/black_belt.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_AquaAdminF[] = INCBIN_U32("graphics/trainers/front_pics/aqua_admin_f_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_AquaAdminF[] = INCBIN_U32("graphics/trainers/palettes/aqua_admin_f.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_AquaAdminF[] = INCBIN_U32("graphics/trainers/front_pics/aqua_admin_f.4bpp.lz");
|
||||
const u32 gTrainerPalette_AquaAdminF[] = INCBIN_U32("graphics/trainers/front_pics/aqua_admin_f.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_AquaLeaderArchie[] = INCBIN_U32("graphics/trainers/front_pics/aqua_leader_archie_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_AquaLeaderArchie[] = INCBIN_U32("graphics/trainers/palettes/aqua_leader_archie.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_AquaLeaderArchie[] = INCBIN_U32("graphics/trainers/front_pics/aqua_leader_archie.4bpp.lz");
|
||||
const u32 gTrainerPalette_AquaLeaderArchie[] = INCBIN_U32("graphics/trainers/front_pics/aqua_leader_archie.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_HexManiac[] = INCBIN_U32("graphics/trainers/front_pics/hex_maniac_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_HexManiac[] = INCBIN_U32("graphics/trainers/palettes/hex_maniac.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_HexManiac[] = INCBIN_U32("graphics/trainers/front_pics/hex_maniac.4bpp.lz");
|
||||
const u32 gTrainerPalette_HexManiac[] = INCBIN_U32("graphics/trainers/front_pics/hex_maniac.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_AromaLady[] = INCBIN_U32("graphics/trainers/front_pics/aroma_lady_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_AromaLady[] = INCBIN_U32("graphics/trainers/palettes/aroma_lady.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_AromaLady[] = INCBIN_U32("graphics/trainers/front_pics/aroma_lady.4bpp.lz");
|
||||
const u32 gTrainerPalette_AromaLady[] = INCBIN_U32("graphics/trainers/front_pics/aroma_lady.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_RuinManiac[] = INCBIN_U32("graphics/trainers/front_pics/ruin_maniac_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_RuinManiac[] = INCBIN_U32("graphics/trainers/palettes/ruin_maniac.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_RuinManiac[] = INCBIN_U32("graphics/trainers/front_pics/ruin_maniac.4bpp.lz");
|
||||
const u32 gTrainerPalette_RuinManiac[] = INCBIN_U32("graphics/trainers/front_pics/ruin_maniac.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_Interviewer[] = INCBIN_U32("graphics/trainers/front_pics/interviewer_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_Interviewer[] = INCBIN_U32("graphics/trainers/palettes/interviewer.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_Interviewer[] = INCBIN_U32("graphics/trainers/front_pics/interviewer.4bpp.lz");
|
||||
const u32 gTrainerPalette_Interviewer[] = INCBIN_U32("graphics/trainers/front_pics/interviewer.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_TuberF[] = INCBIN_U32("graphics/trainers/front_pics/tuber_f_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_TuberF[] = INCBIN_U32("graphics/trainers/palettes/tuber_f.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_TuberF[] = INCBIN_U32("graphics/trainers/front_pics/tuber_f.4bpp.lz");
|
||||
const u32 gTrainerPalette_TuberF[] = INCBIN_U32("graphics/trainers/front_pics/tuber_f.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_TuberM[] = INCBIN_U32("graphics/trainers/front_pics/tuber_m_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_TuberM[] = INCBIN_U32("graphics/trainers/palettes/tuber_m.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_TuberM[] = INCBIN_U32("graphics/trainers/front_pics/tuber_m.4bpp.lz");
|
||||
const u32 gTrainerPalette_TuberM[] = INCBIN_U32("graphics/trainers/front_pics/tuber_m.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_CoolTrainerF[] = INCBIN_U32("graphics/trainers/front_pics/cooltrainer_f_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_CoolTrainerF[] = INCBIN_U32("graphics/trainers/palettes/cooltrainer_f.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_CoolTrainerF[] = INCBIN_U32("graphics/trainers/front_pics/cooltrainer_f.4bpp.lz");
|
||||
const u32 gTrainerPalette_CoolTrainerF[] = INCBIN_U32("graphics/trainers/front_pics/cooltrainer_f.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_Lady[] = INCBIN_U32("graphics/trainers/front_pics/lady_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_Lady[] = INCBIN_U32("graphics/trainers/palettes/lady.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_Lady[] = INCBIN_U32("graphics/trainers/front_pics/lady.4bpp.lz");
|
||||
const u32 gTrainerPalette_Lady[] = INCBIN_U32("graphics/trainers/front_pics/lady.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_Beauty[] = INCBIN_U32("graphics/trainers/front_pics/beauty_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_Beauty[] = INCBIN_U32("graphics/trainers/palettes/beauty.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_Beauty[] = INCBIN_U32("graphics/trainers/front_pics/beauty.4bpp.lz");
|
||||
const u32 gTrainerPalette_Beauty[] = INCBIN_U32("graphics/trainers/front_pics/beauty.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_RichBoy[] = INCBIN_U32("graphics/trainers/front_pics/rich_boy_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_RichBoy[] = INCBIN_U32("graphics/trainers/palettes/rich_boy.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_RichBoy[] = INCBIN_U32("graphics/trainers/front_pics/rich_boy.4bpp.lz");
|
||||
const u32 gTrainerPalette_RichBoy[] = INCBIN_U32("graphics/trainers/front_pics/rich_boy.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_ExpertF[] = INCBIN_U32("graphics/trainers/front_pics/expert_f_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_ExpertF[] = INCBIN_U32("graphics/trainers/palettes/expert_f.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_ExpertF[] = INCBIN_U32("graphics/trainers/front_pics/expert_f.4bpp.lz");
|
||||
const u32 gTrainerPalette_ExpertF[] = INCBIN_U32("graphics/trainers/front_pics/expert_f.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_Pokemaniac[] = INCBIN_U32("graphics/trainers/front_pics/pokemaniac_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_Pokemaniac[] = INCBIN_U32("graphics/trainers/palettes/pokemaniac.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_Pokemaniac[] = INCBIN_U32("graphics/trainers/front_pics/pokemaniac.4bpp.lz");
|
||||
const u32 gTrainerPalette_Pokemaniac[] = INCBIN_U32("graphics/trainers/front_pics/pokemaniac.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_MagmaGruntF[] = INCBIN_U32("graphics/trainers/front_pics/magma_grunt_f_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_MagmaGruntF[] = INCBIN_U32("graphics/trainers/palettes/magma_grunt_f.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_MagmaGruntF[] = INCBIN_U32("graphics/trainers/front_pics/magma_grunt_f.4bpp.lz");
|
||||
const u32 gTrainerPalette_MagmaGruntF[] = INCBIN_U32("graphics/trainers/front_pics/magma_grunt_f.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_Guitarist[] = INCBIN_U32("graphics/trainers/front_pics/guitarist_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_Guitarist[] = INCBIN_U32("graphics/trainers/palettes/guitarist.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_Guitarist[] = INCBIN_U32("graphics/trainers/front_pics/guitarist.4bpp.lz");
|
||||
const u32 gTrainerPalette_Guitarist[] = INCBIN_U32("graphics/trainers/front_pics/guitarist.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_Kindler[] = INCBIN_U32("graphics/trainers/front_pics/kindler_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_Kindler[] = INCBIN_U32("graphics/trainers/palettes/kindler.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_Kindler[] = INCBIN_U32("graphics/trainers/front_pics/kindler.4bpp.lz");
|
||||
const u32 gTrainerPalette_Kindler[] = INCBIN_U32("graphics/trainers/front_pics/kindler.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_Camper[] = INCBIN_U32("graphics/trainers/front_pics/camper_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_Camper[] = INCBIN_U32("graphics/trainers/palettes/camper.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_Camper[] = INCBIN_U32("graphics/trainers/front_pics/camper.4bpp.lz");
|
||||
const u32 gTrainerPalette_Camper[] = INCBIN_U32("graphics/trainers/front_pics/camper.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_Picnicker[] = INCBIN_U32("graphics/trainers/front_pics/picnicker_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_Picnicker[] = INCBIN_U32("graphics/trainers/palettes/picnicker.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_Picnicker[] = INCBIN_U32("graphics/trainers/front_pics/picnicker.4bpp.lz");
|
||||
const u32 gTrainerPalette_Picnicker[] = INCBIN_U32("graphics/trainers/front_pics/picnicker.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_BugManiac[] = INCBIN_U32("graphics/trainers/front_pics/bug_maniac_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_BugManiac[] = INCBIN_U32("graphics/trainers/palettes/bug_maniac.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_BugManiac[] = INCBIN_U32("graphics/trainers/front_pics/bug_maniac.4bpp.lz");
|
||||
const u32 gTrainerPalette_BugManiac[] = INCBIN_U32("graphics/trainers/front_pics/bug_maniac.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_PokemonBreederM[] = INCBIN_U32("graphics/trainers/front_pics/pokemon_breeder_m_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_PokemonBreederM[] = INCBIN_U32("graphics/trainers/palettes/pokemon_breeder_m.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_PokemonBreederM[] = INCBIN_U32("graphics/trainers/front_pics/pokemon_breeder_m.4bpp.lz");
|
||||
const u32 gTrainerPalette_PokemonBreederM[] = INCBIN_U32("graphics/trainers/front_pics/pokemon_breeder_m.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_PsychicM[] = INCBIN_U32("graphics/trainers/front_pics/psychic_m_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_PsychicM[] = INCBIN_U32("graphics/trainers/palettes/psychic_m.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_PsychicM[] = INCBIN_U32("graphics/trainers/front_pics/psychic_m.4bpp.lz");
|
||||
const u32 gTrainerPalette_PsychicM[] = INCBIN_U32("graphics/trainers/front_pics/psychic_m.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_PsychicF[] = INCBIN_U32("graphics/trainers/front_pics/psychic_f_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_PsychicF[] = INCBIN_U32("graphics/trainers/palettes/psychic_f.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_PsychicF[] = INCBIN_U32("graphics/trainers/front_pics/psychic_f.4bpp.lz");
|
||||
const u32 gTrainerPalette_PsychicF[] = INCBIN_U32("graphics/trainers/front_pics/psychic_f.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_Gentleman[] = INCBIN_U32("graphics/trainers/front_pics/gentleman_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_Gentleman[] = INCBIN_U32("graphics/trainers/palettes/gentleman.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_Gentleman[] = INCBIN_U32("graphics/trainers/front_pics/gentleman.4bpp.lz");
|
||||
const u32 gTrainerPalette_Gentleman[] = INCBIN_U32("graphics/trainers/front_pics/gentleman.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_EliteFourSidney[] = INCBIN_U32("graphics/trainers/front_pics/elite_four_sidney_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_EliteFourSidney[] = INCBIN_U32("graphics/trainers/palettes/elite_four_sidney.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_EliteFourSidney[] = INCBIN_U32("graphics/trainers/front_pics/elite_four_sidney.4bpp.lz");
|
||||
const u32 gTrainerPalette_EliteFourSidney[] = INCBIN_U32("graphics/trainers/front_pics/elite_four_sidney.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_EliteFourPhoebe[] = INCBIN_U32("graphics/trainers/front_pics/elite_four_phoebe_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_EliteFourPhoebe[] = INCBIN_U32("graphics/trainers/palettes/elite_four_phoebe.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_EliteFourPhoebe[] = INCBIN_U32("graphics/trainers/front_pics/elite_four_phoebe.4bpp.lz");
|
||||
const u32 gTrainerPalette_EliteFourPhoebe[] = INCBIN_U32("graphics/trainers/front_pics/elite_four_phoebe.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_EliteFourGlacia[] = INCBIN_U32("graphics/trainers/front_pics/elite_four_glacia_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_EliteFourGlacia[] = INCBIN_U32("graphics/trainers/palettes/elite_four_glacia.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_EliteFourGlacia[] = INCBIN_U32("graphics/trainers/front_pics/elite_four_glacia.4bpp.lz");
|
||||
const u32 gTrainerPalette_EliteFourGlacia[] = INCBIN_U32("graphics/trainers/front_pics/elite_four_glacia.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_EliteFourDrake[] = INCBIN_U32("graphics/trainers/front_pics/elite_four_drake_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_EliteFourDrake[] = INCBIN_U32("graphics/trainers/palettes/elite_four_drake.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_EliteFourDrake[] = INCBIN_U32("graphics/trainers/front_pics/elite_four_drake.4bpp.lz");
|
||||
const u32 gTrainerPalette_EliteFourDrake[] = INCBIN_U32("graphics/trainers/front_pics/elite_four_drake.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_LeaderRoxanne[] = INCBIN_U32("graphics/trainers/front_pics/leader_roxanne_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_LeaderRoxanne[] = INCBIN_U32("graphics/trainers/palettes/leader_roxanne.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_LeaderRoxanne[] = INCBIN_U32("graphics/trainers/front_pics/leader_roxanne.4bpp.lz");
|
||||
const u32 gTrainerPalette_LeaderRoxanne[] = INCBIN_U32("graphics/trainers/front_pics/leader_roxanne.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_LeaderBrawly[] = INCBIN_U32("graphics/trainers/front_pics/leader_brawly_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_LeaderBrawly[] = INCBIN_U32("graphics/trainers/palettes/leader_brawly.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_LeaderBrawly[] = INCBIN_U32("graphics/trainers/front_pics/leader_brawly.4bpp.lz");
|
||||
const u32 gTrainerPalette_LeaderBrawly[] = INCBIN_U32("graphics/trainers/front_pics/leader_brawly.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_LeaderWattson[] = INCBIN_U32("graphics/trainers/front_pics/leader_wattson_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_LeaderWattson[] = INCBIN_U32("graphics/trainers/palettes/leader_wattson.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_LeaderWattson[] = INCBIN_U32("graphics/trainers/front_pics/leader_wattson.4bpp.lz");
|
||||
const u32 gTrainerPalette_LeaderWattson[] = INCBIN_U32("graphics/trainers/front_pics/leader_wattson.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_LeaderFlannery[] = INCBIN_U32("graphics/trainers/front_pics/leader_flannery_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_LeaderFlannery[] = INCBIN_U32("graphics/trainers/palettes/leader_flannery.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_LeaderFlannery[] = INCBIN_U32("graphics/trainers/front_pics/leader_flannery.4bpp.lz");
|
||||
const u32 gTrainerPalette_LeaderFlannery[] = INCBIN_U32("graphics/trainers/front_pics/leader_flannery.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_LeaderNorman[] = INCBIN_U32("graphics/trainers/front_pics/leader_norman_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_LeaderNorman[] = INCBIN_U32("graphics/trainers/palettes/leader_norman.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_LeaderNorman[] = INCBIN_U32("graphics/trainers/front_pics/leader_norman.4bpp.lz");
|
||||
const u32 gTrainerPalette_LeaderNorman[] = INCBIN_U32("graphics/trainers/front_pics/leader_norman.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_LeaderWinona[] = INCBIN_U32("graphics/trainers/front_pics/leader_winona_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_LeaderWinona[] = INCBIN_U32("graphics/trainers/palettes/leader_winona.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_LeaderWinona[] = INCBIN_U32("graphics/trainers/front_pics/leader_winona.4bpp.lz");
|
||||
const u32 gTrainerPalette_LeaderWinona[] = INCBIN_U32("graphics/trainers/front_pics/leader_winona.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_LeaderTateAndLiza[] = INCBIN_U32("graphics/trainers/front_pics/leader_tate_and_liza_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_LeaderTateAndLiza[] = INCBIN_U32("graphics/trainers/palettes/leader_tate_and_liza.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_LeaderTateAndLiza[] = INCBIN_U32("graphics/trainers/front_pics/leader_tate_and_liza.4bpp.lz");
|
||||
const u32 gTrainerPalette_LeaderTateAndLiza[] = INCBIN_U32("graphics/trainers/front_pics/leader_tate_and_liza.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_LeaderJuan[] = INCBIN_U32("graphics/trainers/front_pics/leader_juan_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_LeaderJuan[] = INCBIN_U32("graphics/trainers/palettes/leader_juan.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_LeaderJuan[] = INCBIN_U32("graphics/trainers/front_pics/leader_juan.4bpp.lz");
|
||||
const u32 gTrainerPalette_LeaderJuan[] = INCBIN_U32("graphics/trainers/front_pics/leader_juan.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_SchoolKidM[] = INCBIN_U32("graphics/trainers/front_pics/school_kid_m_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_SchoolKidM[] = INCBIN_U32("graphics/trainers/palettes/school_kid_m.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_SchoolKidM[] = INCBIN_U32("graphics/trainers/front_pics/school_kid_m.4bpp.lz");
|
||||
const u32 gTrainerPalette_SchoolKidM[] = INCBIN_U32("graphics/trainers/front_pics/school_kid_m.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_SchoolKidF[] = INCBIN_U32("graphics/trainers/front_pics/school_kid_f_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_SchoolKidF[] = INCBIN_U32("graphics/trainers/palettes/school_kid_f.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_SchoolKidF[] = INCBIN_U32("graphics/trainers/front_pics/school_kid_f.4bpp.lz");
|
||||
const u32 gTrainerPalette_SchoolKidF[] = INCBIN_U32("graphics/trainers/front_pics/school_kid_f.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_SrAndJr[] = INCBIN_U32("graphics/trainers/front_pics/sr_and_jr_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_SrAndJr[] = INCBIN_U32("graphics/trainers/palettes/sr_and_jr.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_SrAndJr[] = INCBIN_U32("graphics/trainers/front_pics/sr_and_jr.4bpp.lz");
|
||||
const u32 gTrainerPalette_SrAndJr[] = INCBIN_U32("graphics/trainers/front_pics/sr_and_jr.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_PokefanM[] = INCBIN_U32("graphics/trainers/front_pics/pokefan_m_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_PokefanM[] = INCBIN_U32("graphics/trainers/palettes/pokefan_m.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_PokefanM[] = INCBIN_U32("graphics/trainers/front_pics/pokefan_m.4bpp.lz");
|
||||
const u32 gTrainerPalette_PokefanM[] = INCBIN_U32("graphics/trainers/front_pics/pokefan_m.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_PokefanF[] = INCBIN_U32("graphics/trainers/front_pics/pokefan_f_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_PokefanF[] = INCBIN_U32("graphics/trainers/palettes/pokefan_f.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_PokefanF[] = INCBIN_U32("graphics/trainers/front_pics/pokefan_f.4bpp.lz");
|
||||
const u32 gTrainerPalette_PokefanF[] = INCBIN_U32("graphics/trainers/front_pics/pokefan_f.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_Youngster[] = INCBIN_U32("graphics/trainers/front_pics/youngster_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_Youngster[] = INCBIN_U32("graphics/trainers/palettes/youngster.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_Youngster[] = INCBIN_U32("graphics/trainers/front_pics/youngster.4bpp.lz");
|
||||
const u32 gTrainerPalette_Youngster[] = INCBIN_U32("graphics/trainers/front_pics/youngster.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_ChampionWallace[] = INCBIN_U32("graphics/trainers/front_pics/champion_wallace_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_ChampionWallace[] = INCBIN_U32("graphics/trainers/palettes/champion_wallace.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_ChampionWallace[] = INCBIN_U32("graphics/trainers/front_pics/champion_wallace.4bpp.lz");
|
||||
const u32 gTrainerPalette_ChampionWallace[] = INCBIN_U32("graphics/trainers/front_pics/champion_wallace.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_Fisherman[] = INCBIN_U32("graphics/trainers/front_pics/fisherman_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_Fisherman[] = INCBIN_U32("graphics/trainers/palettes/fisherman.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_Fisherman[] = INCBIN_U32("graphics/trainers/front_pics/fisherman.4bpp.lz");
|
||||
const u32 gTrainerPalette_Fisherman[] = INCBIN_U32("graphics/trainers/front_pics/fisherman.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_CyclingTriathleteM[] = INCBIN_U32("graphics/trainers/front_pics/cycling_triathlete_m_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_CyclingTriathleteM[] = INCBIN_U32("graphics/trainers/palettes/cycling_triathlete_m.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_CyclingTriathleteM[] = INCBIN_U32("graphics/trainers/front_pics/cycling_triathlete_m.4bpp.lz");
|
||||
const u32 gTrainerPalette_CyclingTriathleteM[] = INCBIN_U32("graphics/trainers/front_pics/cycling_triathlete_m.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_CyclingTriathleteF[] = INCBIN_U32("graphics/trainers/front_pics/cycling_triathlete_f_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_CyclingTriathleteF[] = INCBIN_U32("graphics/trainers/palettes/cycling_triathlete_f.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_CyclingTriathleteF[] = INCBIN_U32("graphics/trainers/front_pics/cycling_triathlete_f.4bpp.lz");
|
||||
const u32 gTrainerPalette_CyclingTriathleteF[] = INCBIN_U32("graphics/trainers/front_pics/cycling_triathlete_f.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_RunningTriathleteM[] = INCBIN_U32("graphics/trainers/front_pics/running_triathlete_m_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_RunningTriathleteM[] = INCBIN_U32("graphics/trainers/palettes/running_triathlete_m.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_RunningTriathleteM[] = INCBIN_U32("graphics/trainers/front_pics/running_triathlete_m.4bpp.lz");
|
||||
const u32 gTrainerPalette_RunningTriathleteM[] = INCBIN_U32("graphics/trainers/front_pics/running_triathlete_m.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_RunningTriathleteF[] = INCBIN_U32("graphics/trainers/front_pics/running_triathlete_f_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_RunningTriathleteF[] = INCBIN_U32("graphics/trainers/palettes/running_triathlete_f.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_RunningTriathleteF[] = INCBIN_U32("graphics/trainers/front_pics/running_triathlete_f.4bpp.lz");
|
||||
const u32 gTrainerPalette_RunningTriathleteF[] = INCBIN_U32("graphics/trainers/front_pics/running_triathlete_f.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_SwimmingTriathleteM[] = INCBIN_U32("graphics/trainers/front_pics/swimming_triathlete_m_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_SwimmingTriathleteM[] = INCBIN_U32("graphics/trainers/palettes/swimming_triathlete_m.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_SwimmingTriathleteM[] = INCBIN_U32("graphics/trainers/front_pics/swimming_triathlete_m.4bpp.lz");
|
||||
const u32 gTrainerPalette_SwimmingTriathleteM[] = INCBIN_U32("graphics/trainers/front_pics/swimming_triathlete_m.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_SwimmingTriathleteF[] = INCBIN_U32("graphics/trainers/front_pics/swimming_triathlete_f_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_SwimmingTriathleteF[] = INCBIN_U32("graphics/trainers/palettes/swimming_triathlete_f.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_SwimmingTriathleteF[] = INCBIN_U32("graphics/trainers/front_pics/swimming_triathlete_f.4bpp.lz");
|
||||
const u32 gTrainerPalette_SwimmingTriathleteF[] = INCBIN_U32("graphics/trainers/front_pics/swimming_triathlete_f.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_DragonTamer[] = INCBIN_U32("graphics/trainers/front_pics/dragon_tamer_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_DragonTamer[] = INCBIN_U32("graphics/trainers/palettes/dragon_tamer.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_DragonTamer[] = INCBIN_U32("graphics/trainers/front_pics/dragon_tamer.4bpp.lz");
|
||||
const u32 gTrainerPalette_DragonTamer[] = INCBIN_U32("graphics/trainers/front_pics/dragon_tamer.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_NinjaBoy[] = INCBIN_U32("graphics/trainers/front_pics/ninja_boy_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_NinjaBoy[] = INCBIN_U32("graphics/trainers/palettes/ninja_boy.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_NinjaBoy[] = INCBIN_U32("graphics/trainers/front_pics/ninja_boy.4bpp.lz");
|
||||
const u32 gTrainerPalette_NinjaBoy[] = INCBIN_U32("graphics/trainers/front_pics/ninja_boy.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_BattleGirl[] = INCBIN_U32("graphics/trainers/front_pics/battle_girl_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_BattleGirl[] = INCBIN_U32("graphics/trainers/palettes/battle_girl.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_BattleGirl[] = INCBIN_U32("graphics/trainers/front_pics/battle_girl.4bpp.lz");
|
||||
const u32 gTrainerPalette_BattleGirl[] = INCBIN_U32("graphics/trainers/front_pics/battle_girl.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_ParasolLady[] = INCBIN_U32("graphics/trainers/front_pics/parasol_lady_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_ParasolLady[] = INCBIN_U32("graphics/trainers/palettes/parasol_lady.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_ParasolLady[] = INCBIN_U32("graphics/trainers/front_pics/parasol_lady.4bpp.lz");
|
||||
const u32 gTrainerPalette_ParasolLady[] = INCBIN_U32("graphics/trainers/front_pics/parasol_lady.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_SwimmerF[] = INCBIN_U32("graphics/trainers/front_pics/swimmer_f_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_SwimmerF[] = INCBIN_U32("graphics/trainers/palettes/swimmer_f.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_SwimmerF[] = INCBIN_U32("graphics/trainers/front_pics/swimmer_f.4bpp.lz");
|
||||
const u32 gTrainerPalette_SwimmerF[] = INCBIN_U32("graphics/trainers/front_pics/swimmer_f.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_Twins[] = INCBIN_U32("graphics/trainers/front_pics/twins_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_Twins[] = INCBIN_U32("graphics/trainers/palettes/twins.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_Twins[] = INCBIN_U32("graphics/trainers/front_pics/twins.4bpp.lz");
|
||||
const u32 gTrainerPalette_Twins[] = INCBIN_U32("graphics/trainers/front_pics/twins.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_Sailor[] = INCBIN_U32("graphics/trainers/front_pics/sailor_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_Sailor[] = INCBIN_U32("graphics/trainers/palettes/sailor.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_Sailor[] = INCBIN_U32("graphics/trainers/front_pics/sailor.4bpp.lz");
|
||||
const u32 gTrainerPalette_Sailor[] = INCBIN_U32("graphics/trainers/front_pics/sailor.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_MagmaAdmin[] = INCBIN_U32("graphics/trainers/front_pics/magma_admin_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_MagmaAdmin[] = INCBIN_U32("graphics/trainers/palettes/magma_admin.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_MagmaAdmin[] = INCBIN_U32("graphics/trainers/front_pics/magma_admin.4bpp.lz");
|
||||
const u32 gTrainerPalette_MagmaAdmin[] = INCBIN_U32("graphics/trainers/front_pics/magma_admin.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_Wally[] = INCBIN_U32("graphics/trainers/front_pics/wally_front_pic.4bpp.lz");
|
||||
const u32 gTrainerFrontPic_Wally[] = INCBIN_U32("graphics/trainers/front_pics/wally.4bpp.lz");
|
||||
const u32 gTrainerPalette_Wally[] = INCBIN_U32("graphics/trainers/palettes/wally.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_Brendan[] = INCBIN_U32("graphics/trainers/front_pics/brendan_front_pic.4bpp.lz");
|
||||
const u32 gTrainerFrontPic_Brendan[] = INCBIN_U32("graphics/trainers/front_pics/brendan.4bpp.lz");
|
||||
const u32 gTrainerPalette_Brendan[] = INCBIN_U32("graphics/trainers/palettes/brendan.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_May[] = INCBIN_U32("graphics/trainers/front_pics/may_front_pic.4bpp.lz");
|
||||
const u32 gTrainerFrontPic_May[] = INCBIN_U32("graphics/trainers/front_pics/may.4bpp.lz");
|
||||
const u32 gTrainerPalette_May[] = INCBIN_U32("graphics/trainers/palettes/may.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_BugCatcher[] = INCBIN_U32("graphics/trainers/front_pics/bug_catcher_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_BugCatcher[] = INCBIN_U32("graphics/trainers/palettes/bug_catcher.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_BugCatcher[] = INCBIN_U32("graphics/trainers/front_pics/bug_catcher.4bpp.lz");
|
||||
const u32 gTrainerPalette_BugCatcher[] = INCBIN_U32("graphics/trainers/front_pics/bug_catcher.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_PokemonRangerM[] = INCBIN_U32("graphics/trainers/front_pics/pokemon_ranger_m_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_PokemonRangerM[] = INCBIN_U32("graphics/trainers/palettes/pokemon_ranger_m.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_PokemonRangerM[] = INCBIN_U32("graphics/trainers/front_pics/pokemon_ranger_m.4bpp.lz");
|
||||
const u32 gTrainerPalette_PokemonRangerM[] = INCBIN_U32("graphics/trainers/front_pics/pokemon_ranger_m.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_PokemonRangerF[] = INCBIN_U32("graphics/trainers/front_pics/pokemon_ranger_f_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_PokemonRangerF[] = INCBIN_U32("graphics/trainers/palettes/pokemon_ranger_f.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_PokemonRangerF[] = INCBIN_U32("graphics/trainers/front_pics/pokemon_ranger_f.4bpp.lz");
|
||||
const u32 gTrainerPalette_PokemonRangerF[] = INCBIN_U32("graphics/trainers/front_pics/pokemon_ranger_f.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_MagmaLeaderMaxie[] = INCBIN_U32("graphics/trainers/front_pics/magma_leader_maxie_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_MagmaLeaderMaxie[] = INCBIN_U32("graphics/trainers/palettes/magma_leader_maxie.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_MagmaLeaderMaxie[] = INCBIN_U32("graphics/trainers/front_pics/magma_leader_maxie.4bpp.lz");
|
||||
const u32 gTrainerPalette_MagmaLeaderMaxie[] = INCBIN_U32("graphics/trainers/front_pics/magma_leader_maxie.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_Lass[] = INCBIN_U32("graphics/trainers/front_pics/lass_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_Lass[] = INCBIN_U32("graphics/trainers/palettes/lass.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_Lass[] = INCBIN_U32("graphics/trainers/front_pics/lass.4bpp.lz");
|
||||
const u32 gTrainerPalette_Lass[] = INCBIN_U32("graphics/trainers/front_pics/lass.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_YoungCouple[] = INCBIN_U32("graphics/trainers/front_pics/young_couple_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_YoungCouple[] = INCBIN_U32("graphics/trainers/palettes/young_couple.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_YoungCouple[] = INCBIN_U32("graphics/trainers/front_pics/young_couple.4bpp.lz");
|
||||
const u32 gTrainerPalette_YoungCouple[] = INCBIN_U32("graphics/trainers/front_pics/young_couple.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_OldCouple[] = INCBIN_U32("graphics/trainers/front_pics/old_couple_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_OldCouple[] = INCBIN_U32("graphics/trainers/palettes/old_couple.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_OldCouple[] = INCBIN_U32("graphics/trainers/front_pics/old_couple.4bpp.lz");
|
||||
const u32 gTrainerPalette_OldCouple[] = INCBIN_U32("graphics/trainers/front_pics/old_couple.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_SisAndBro[] = INCBIN_U32("graphics/trainers/front_pics/sis_and_bro_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_SisAndBro[] = INCBIN_U32("graphics/trainers/palettes/sis_and_bro.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_SisAndBro[] = INCBIN_U32("graphics/trainers/front_pics/sis_and_bro.4bpp.lz");
|
||||
const u32 gTrainerPalette_SisAndBro[] = INCBIN_U32("graphics/trainers/front_pics/sis_and_bro.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_Steven[] = INCBIN_U32("graphics/trainers/front_pics/steven_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_Steven[] = INCBIN_U32("graphics/trainers/palettes/steven.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_Steven[] = INCBIN_U32("graphics/trainers/front_pics/steven.4bpp.lz");
|
||||
const u32 gTrainerPalette_Steven[] = INCBIN_U32("graphics/trainers/front_pics/steven.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_SalonMaidenAnabel[] = INCBIN_U32("graphics/trainers/front_pics/salon_maiden_anabel_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_SalonMaidenAnabel[] = INCBIN_U32("graphics/trainers/palettes/salon_maiden_anabel.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_SalonMaidenAnabel[] = INCBIN_U32("graphics/trainers/front_pics/salon_maiden_anabel.4bpp.lz");
|
||||
const u32 gTrainerPalette_SalonMaidenAnabel[] = INCBIN_U32("graphics/trainers/front_pics/salon_maiden_anabel.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_DomeAceTucker[] = INCBIN_U32("graphics/trainers/front_pics/dome_ace_tucker_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_DomeAceTucker[] = INCBIN_U32("graphics/trainers/palettes/dome_ace_tucker.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_DomeAceTucker[] = INCBIN_U32("graphics/trainers/front_pics/dome_ace_tucker.4bpp.lz");
|
||||
const u32 gTrainerPalette_DomeAceTucker[] = INCBIN_U32("graphics/trainers/front_pics/dome_ace_tucker.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_PalaceMavenSpenser[] = INCBIN_U32("graphics/trainers/front_pics/palace_maven_spenser_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_PalaceMavenSpenser[] = INCBIN_U32("graphics/trainers/palettes/palace_maven_spenser.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_PalaceMavenSpenser[] = INCBIN_U32("graphics/trainers/front_pics/palace_maven_spenser.4bpp.lz");
|
||||
const u32 gTrainerPalette_PalaceMavenSpenser[] = INCBIN_U32("graphics/trainers/front_pics/palace_maven_spenser.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_ArenaTycoonGreta[] = INCBIN_U32("graphics/trainers/front_pics/arena_tycoon_greta_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_ArenaTycoonGreta[] = INCBIN_U32("graphics/trainers/palettes/arena_tycoon_greta.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_ArenaTycoonGreta[] = INCBIN_U32("graphics/trainers/front_pics/arena_tycoon_greta.4bpp.lz");
|
||||
const u32 gTrainerPalette_ArenaTycoonGreta[] = INCBIN_U32("graphics/trainers/front_pics/arena_tycoon_greta.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_FactoryHeadNoland[] = INCBIN_U32("graphics/trainers/front_pics/factory_head_noland_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_FactoryHeadNoland[] = INCBIN_U32("graphics/trainers/palettes/factory_head_noland.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_FactoryHeadNoland[] = INCBIN_U32("graphics/trainers/front_pics/factory_head_noland.4bpp.lz");
|
||||
const u32 gTrainerPalette_FactoryHeadNoland[] = INCBIN_U32("graphics/trainers/front_pics/factory_head_noland.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_PikeQueenLucy[] = INCBIN_U32("graphics/trainers/front_pics/pike_queen_lucy_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_PikeQueenLucy[] = INCBIN_U32("graphics/trainers/palettes/pike_queen_lucy.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_PikeQueenLucy[] = INCBIN_U32("graphics/trainers/front_pics/pike_queen_lucy.4bpp.lz");
|
||||
const u32 gTrainerPalette_PikeQueenLucy[] = INCBIN_U32("graphics/trainers/front_pics/pike_queen_lucy.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_PyramidKingBrandon[] = INCBIN_U32("graphics/trainers/front_pics/pyramid_king_brandon_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_PyramidKingBrandon[] = INCBIN_U32("graphics/trainers/palettes/pyramid_king_brandon.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_PyramidKingBrandon[] = INCBIN_U32("graphics/trainers/front_pics/pyramid_king_brandon.4bpp.lz");
|
||||
const u32 gTrainerPalette_PyramidKingBrandon[] = INCBIN_U32("graphics/trainers/front_pics/pyramid_king_brandon.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_Red[] = INCBIN_U32("graphics/trainers/front_pics/red_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_Red[] = INCBIN_U32("graphics/trainers/palettes/red.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_Red[] = INCBIN_U32("graphics/trainers/front_pics/red.4bpp.lz");
|
||||
const u32 gTrainerPalette_Red[] = INCBIN_U32("graphics/trainers/front_pics/red.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_Leaf[] = INCBIN_U32("graphics/trainers/front_pics/leaf_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_Leaf[] = INCBIN_U32("graphics/trainers/palettes/leaf.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_Leaf[] = INCBIN_U32("graphics/trainers/front_pics/leaf.4bpp.lz");
|
||||
const u32 gTrainerPalette_Leaf[] = INCBIN_U32("graphics/trainers/front_pics/leaf.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_RubySapphireBrendan[] = INCBIN_U32("graphics/trainers/front_pics/ruby_sapphire_brendan_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_RubySapphireBrendan[] = INCBIN_U32("graphics/trainers/palettes/ruby_sapphire_brendan.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_RubySapphireBrendan[] = INCBIN_U32("graphics/trainers/front_pics/brendan_rs.4bpp.lz");
|
||||
const u32 gTrainerPalette_RubySapphireBrendan[] = INCBIN_U32("graphics/trainers/palettes/brendan_rs.gbapal.lz");
|
||||
|
||||
const u32 gTrainerFrontPic_RubySapphireMay[] = INCBIN_U32("graphics/trainers/front_pics/ruby_sapphire_may_front_pic.4bpp.lz");
|
||||
const u32 gTrainerPalette_RubySapphireMay[] = INCBIN_U32("graphics/trainers/palettes/ruby_sapphire_may.gbapal.lz");
|
||||
const u32 gTrainerFrontPic_RubySapphireMay[] = INCBIN_U32("graphics/trainers/front_pics/may_rs.4bpp.lz");
|
||||
const u32 gTrainerPalette_RubySapphireMay[] = INCBIN_U32("graphics/trainers/palettes/may_rs.gbapal.lz");
|
||||
|
||||
const u8 gTrainerBackPic_Brendan[] = INCBIN_U8("graphics/trainers/back_pics/brendan_back_pic.4bpp");
|
||||
const u8 gTrainerBackPic_May[] = INCBIN_U8("graphics/trainers/back_pics/may_back_pic.4bpp");
|
||||
const u8 gTrainerBackPic_Red[] = INCBIN_U8("graphics/trainers/back_pics/red_back_pic.4bpp");
|
||||
const u8 gTrainerBackPic_Leaf[] = INCBIN_U8("graphics/trainers/back_pics/leaf_back_pic.4bpp");
|
||||
const u8 gTrainerBackPic_RubySapphireBrendan[] = INCBIN_U8("graphics/trainers/back_pics/ruby_sapphire_brendan_back_pic.4bpp");
|
||||
const u8 gTrainerBackPic_RubySapphireMay[] = INCBIN_U8("graphics/trainers/back_pics/ruby_sapphire_may_back_pic.4bpp");
|
||||
const u8 gTrainerBackPic_Wally[] = INCBIN_U8("graphics/trainers/back_pics/wally_back_pic.4bpp");
|
||||
const u8 gTrainerBackPic_Steven[] = INCBIN_U8("graphics/trainers/back_pics/steven_back_pic.4bpp");
|
||||
const u8 gTrainerBackPic_Brendan[] = INCBIN_U8("graphics/trainers/back_pics/brendan.4bpp");
|
||||
const u8 gTrainerBackPic_May[] = INCBIN_U8("graphics/trainers/back_pics/may.4bpp");
|
||||
const u8 gTrainerBackPic_Red[] = INCBIN_U8("graphics/trainers/back_pics/red.4bpp");
|
||||
const u8 gTrainerBackPic_Leaf[] = INCBIN_U8("graphics/trainers/back_pics/leaf.4bpp");
|
||||
const u8 gTrainerBackPic_RubySapphireBrendan[] = INCBIN_U8("graphics/trainers/back_pics/brendan_rs.4bpp");
|
||||
const u8 gTrainerBackPic_RubySapphireMay[] = INCBIN_U8("graphics/trainers/back_pics/may_rs.4bpp");
|
||||
const u8 gTrainerBackPic_Wally[] = INCBIN_U8("graphics/trainers/back_pics/wally.4bpp");
|
||||
const u8 gTrainerBackPic_Steven[] = INCBIN_U8("graphics/trainers/back_pics/steven.4bpp");
|
||||
|
||||
const u32 gTrainerBackPicPalette_Red[] = INCBIN_U32("graphics/trainers/palettes/red_back_pic.gbapal.lz");
|
||||
const u32 gTrainerBackPicPalette_Leaf[] = INCBIN_U32("graphics/trainers/palettes/leaf_back_pic.gbapal.lz");
|
||||
const u32 gTrainerBackPicPalette_Red[] = INCBIN_U32("graphics/trainers/back_pics/red.gbapal.lz");
|
||||
const u32 gTrainerBackPicPalette_Leaf[] = INCBIN_U32("graphics/trainers/back_pics/leaf.gbapal.lz");
|
||||
|
||||
@@ -253,9 +253,9 @@ u8 MovementAction_AcroEndWheelieMoveRight_Step1(struct ObjectEvent *, struct Spr
|
||||
u8 MovementAction_Levitate_Step0(struct ObjectEvent *, struct Sprite *);
|
||||
u8 MovementAction_StopLevitate_Step0(struct ObjectEvent *, struct Sprite *);
|
||||
u8 MovementAction_StopLevitateAtTop_Step0(struct ObjectEvent *, struct Sprite *);
|
||||
u8 MovementAction_StoreAndLockAnim_Step0(struct ObjectEvent *, struct Sprite *);
|
||||
u8 MovementAction_LockAnim_Step0(struct ObjectEvent *, struct Sprite *);
|
||||
u8 MovementAction_Finish(struct ObjectEvent *, struct Sprite *);
|
||||
u8 MovementAction_FreeAndUnlockAnim_Step0(struct ObjectEvent *, struct Sprite *);
|
||||
u8 MovementAction_UnlockAnim_Step0(struct ObjectEvent *, struct Sprite *);
|
||||
u8 MovementAction_FlyUp_Step0(struct ObjectEvent *, struct Sprite *);
|
||||
u8 MovementAction_FlyUp_Step1(struct ObjectEvent *, struct Sprite *);
|
||||
u8 MovementAction_Fly_Finish(struct ObjectEvent *, struct Sprite *);
|
||||
@@ -410,8 +410,8 @@ u8 (*const gMovementActionFuncs_WalkSlowDiagonalUpLeft[])(struct ObjectEvent *,
|
||||
u8 (*const gMovementActionFuncs_WalkSlowDiagonalUpRight[])(struct ObjectEvent *, struct Sprite *);
|
||||
u8 (*const gMovementActionFuncs_WalkSlowDiagonalDownLeft[])(struct ObjectEvent *, struct Sprite *);
|
||||
u8 (*const gMovementActionFuncs_WalkSlowDiagonalDownRight[])(struct ObjectEvent *, struct Sprite *);
|
||||
u8 (*const gMovementActionFuncs_StoreAndLockAnim[])(struct ObjectEvent *, struct Sprite *);
|
||||
u8 (*const gMovementActionFuncs_FreeAndUnlockAnim[])(struct ObjectEvent *, struct Sprite *);
|
||||
u8 (*const gMovementActionFuncs_LockAnim[])(struct ObjectEvent *, struct Sprite *);
|
||||
u8 (*const gMovementActionFuncs_UnlockAnim[])(struct ObjectEvent *, struct Sprite *);
|
||||
u8 (*const gMovementActionFuncs_WalkLeftAffine[])(struct ObjectEvent *, struct Sprite *);
|
||||
u8 (*const gMovementActionFuncs_WalkRightAffine[])(struct ObjectEvent *, struct Sprite *);
|
||||
u8 (*const gMovementActionFuncs_Levitate[])(struct ObjectEvent *, struct Sprite *);
|
||||
@@ -570,8 +570,8 @@ u8 (*const *const gMovementActionFuncs[])(struct ObjectEvent *, struct Sprite *)
|
||||
[MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_UP_RIGHT] = gMovementActionFuncs_WalkSlowDiagonalUpRight,
|
||||
[MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_DOWN_LEFT] = gMovementActionFuncs_WalkSlowDiagonalDownLeft,
|
||||
[MOVEMENT_ACTION_WALK_SLOW_DIAGONAL_DOWN_RIGHT] = gMovementActionFuncs_WalkSlowDiagonalDownRight,
|
||||
[MOVEMENT_ACTION_STORE_AND_LOCK_ANIM] = gMovementActionFuncs_StoreAndLockAnim,
|
||||
[MOVEMENT_ACTION_FREE_AND_UNLOCK_ANIM] = gMovementActionFuncs_FreeAndUnlockAnim,
|
||||
[MOVEMENT_ACTION_LOCK_ANIM] = gMovementActionFuncs_LockAnim,
|
||||
[MOVEMENT_ACTION_UNLOCK_ANIM] = gMovementActionFuncs_UnlockAnim,
|
||||
[MOVEMENT_ACTION_WALK_LEFT_AFFINE] = gMovementActionFuncs_WalkLeftAffine,
|
||||
[MOVEMENT_ACTION_WALK_RIGHT_AFFINE] = gMovementActionFuncs_WalkRightAffine,
|
||||
[MOVEMENT_ACTION_LEVITATE] = gMovementActionFuncs_Levitate,
|
||||
|
||||
@@ -1,249 +1,249 @@
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanNormal;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanMachBike;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanSurfing;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanFieldMove;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_QuintyPlump;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_NinjaBoy;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Twin;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Boy1;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Girl1;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Boy2;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Girl2;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LittleBoy;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LittleGirl;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Boy3;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Girl3;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RichBoy;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman1;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_FatMan;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PokefanF;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man1;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman2;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ExpertM;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ExpertF;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man2;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman3;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PokefanM;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman4;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Cook;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LinkReceptionist;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_OldMan;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_OldWoman;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Camper;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Picnicker;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man3;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman5;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Youngster;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BugCatcher;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PsychicM;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SchoolKidM;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Maniac;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HexManiac;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RayquazaStill;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwimmerM;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwimmerF;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BlackBelt;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Beauty;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Scientist1;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Lass;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Gentleman;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Sailor;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Fisherman;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RunningTriathleteM;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RunningTriathleteF;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TuberF;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TuberM;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Hiker;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyclingTriathleteM;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyclingTriathleteF;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Nurse;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ItemBall;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTree;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTreeEarlyStages;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTreeLateStages;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanAcroBike;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ProfBirch;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man4;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man5;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ReporterM;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ReporterF;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Bard;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Anabel;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Tucker;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Greta;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Spenser;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Noland;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Lucy;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedNatuDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedMagnemiteDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedSquirtleDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedWooperDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedPikachuDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedPorygon2Doll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CuttableTree;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MartEmployee;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RooftopSaleWoman;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Teala;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BreakableRock;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PushableBoulder;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MrBrineysBoat;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayNormal;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayMachBike;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayAcroBike;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MaySurfing;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayFieldMove;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Truck;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_VigorothCarryingBox;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_VigorothFacingAway;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BirchsBag;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_EnemyZigzagoon;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Artist;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanNormal;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanMachBike;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanAcroBike;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanSurfing;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanFieldMove;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayNormal;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayMachBike;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayAcroBike;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMaySurfing;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayFieldMove;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Cameraman;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanUnderwater;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayUnderwater;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MovingBox;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CableCar;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Scientist2;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DevonEmployee;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_AquaMemberM;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_AquaMemberF;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MagmaMemberM;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MagmaMemberF;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Sidney;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Phoebe;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Glacia;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Drake;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Roxanne;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Brawly;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wattson;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Flannery;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Norman;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Winona;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Liza;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Tate;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wallace;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Steven;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wally;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphireLittleBoy;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanFishing;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayFishing;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HotSpringsOldWoman;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SSTidal;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SubmarineShadow;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PichuDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PikachuDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MarillDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TogepiDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyndaquilDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ChikoritaDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TotodileDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_JigglypuffDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MeowthDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ClefairyDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DittoDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SmoochumDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TreeckoDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TorchicDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MudkipDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DuskullDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_WynautDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BaltoyDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KecleonDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_AzurillDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SkittyDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwabluDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GulpinDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LotadDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SeedotDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PikaCushion;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RoundCushion;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KissCushion;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ZigzagCushion;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SpinCushion;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DiamondCushion;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BallCushion;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GrassCushion;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_FireCushion;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_WaterCushion;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigSnorlaxDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRhydonDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigLaprasDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigVenusaurDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigCharizardDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigBlastoiseDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigWailmerDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRegirockDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRegiceDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRegisteelDoll;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Latias;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Latios;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GameboyKid;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ContestJudge;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanWatering;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayWatering;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanDecorating;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayDecorating;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Archie;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Maxie;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KyogreFront;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GroudonFront;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Fossil;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Regirock;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Regice;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Registeel;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Skitty;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kecleon;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KyogreAsleep;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GroudonAsleep;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Rayquaza;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Zigzagoon;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Pikachu;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Azumarill;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wingull;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KecleonBridgeShadow;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TuberMSwimming;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Azurill;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Mom;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LinkBrendan;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LinkMay;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Juan;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Scott;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Poochyena;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KyogreSide;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GroudonSide;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MysteryEventDeliveryman;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Statue;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kirlia;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Dusclops;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnionRoomAttendant;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Sudowoodo;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Mew;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Red;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Leaf;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Deoxys;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BirthIslandStone;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Brandon;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphireBrendan;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphireMay;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Lugia;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HoOh;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Bard;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Hipster;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Trader;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Storyteller;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Giddy;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedMauvilleOldMan1;
|
||||
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedMauvilleOldMan2;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanNormal;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanMachBike;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanSurfing;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanFieldMove;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_QuintyPlump;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_NinjaBoy;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Twin;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Boy1;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Girl1;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Boy2;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Girl2;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LittleBoy;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LittleGirl;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Boy3;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Girl3;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RichBoy;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman1;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_FatMan;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PokefanF;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man1;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman2;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ExpertM;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ExpertF;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man2;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman3;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PokefanM;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman4;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Cook;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LinkReceptionist;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_OldMan;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_OldWoman;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Camper;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Picnicker;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man3;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Woman5;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Youngster;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BugCatcher;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PsychicM;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SchoolKidM;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Maniac;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HexManiac;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RayquazaStill;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwimmerM;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwimmerF;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BlackBelt;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Beauty;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Scientist1;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Lass;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Gentleman;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Sailor;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Fisherman;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RunningTriathleteM;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RunningTriathleteF;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TuberF;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TuberM;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Hiker;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyclingTriathleteM;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyclingTriathleteF;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Nurse;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ItemBall;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTree;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTreeEarlyStages;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTreeLateStages;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanAcroBike;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ProfBirch;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man4;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Man5;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ReporterM;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ReporterF;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Bard;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Anabel;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Tucker;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Greta;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Spenser;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Noland;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Lucy;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedNatuDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedMagnemiteDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedSquirtleDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedWooperDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedPikachuDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedPorygon2Doll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CuttableTree;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MartEmployee;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RooftopSaleWoman;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Teala;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BreakableRock;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PushableBoulder;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MrBrineysBoat;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayNormal;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayMachBike;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayAcroBike;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MaySurfing;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayFieldMove;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Truck;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_VigorothCarryingBox;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_VigorothFacingAway;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BirchsBag;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_EnemyZigzagoon;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Artist;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanNormal;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanMachBike;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanAcroBike;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanSurfing;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalBrendanFieldMove;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayNormal;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayMachBike;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayAcroBike;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMaySurfing;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RivalMayFieldMove;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Cameraman;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanUnderwater;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayUnderwater;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MovingBox;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CableCar;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Scientist2;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DevonEmployee;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_AquaMemberM;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_AquaMemberF;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MagmaMemberM;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MagmaMemberF;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Sidney;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Phoebe;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Glacia;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Drake;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Roxanne;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Brawly;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wattson;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Flannery;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Norman;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Winona;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Liza;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Tate;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wallace;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Steven;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wally;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphireLittleBoy;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanFishing;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayFishing;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HotSpringsOldWoman;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SSTidal;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SubmarineShadow;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PichuDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PikachuDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MarillDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TogepiDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyndaquilDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ChikoritaDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TotodileDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_JigglypuffDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MeowthDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ClefairyDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DittoDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SmoochumDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TreeckoDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TorchicDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MudkipDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DuskullDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_WynautDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BaltoyDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KecleonDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_AzurillDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SkittyDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SwabluDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GulpinDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LotadDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SeedotDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PikaCushion;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RoundCushion;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KissCushion;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ZigzagCushion;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_SpinCushion;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_DiamondCushion;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BallCushion;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GrassCushion;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_FireCushion;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_WaterCushion;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigSnorlaxDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRhydonDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigLaprasDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigVenusaurDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigCharizardDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigBlastoiseDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigWailmerDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRegirockDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRegiceDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BigRegisteelDoll;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Latias;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Latios;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GameboyKid;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ContestJudge;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanWatering;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayWatering;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BrendanDecorating;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MayDecorating;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Archie;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Maxie;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KyogreFront;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GroudonFront;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Fossil;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Regirock;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Regice;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Registeel;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Skitty;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kecleon;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KyogreAsleep;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GroudonAsleep;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Rayquaza;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Zigzagoon;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Pikachu;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Azumarill;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Wingull;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KecleonBridgeShadow;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_TuberMSwimming;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Azurill;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Mom;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LinkBrendan;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_LinkMay;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Juan;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Scott;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Poochyena;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_KyogreSide;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_GroudonSide;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_MysteryEventDeliveryman;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Statue;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Kirlia;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Dusclops;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnionRoomAttendant;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Sudowoodo;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Mew;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Red;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Leaf;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Deoxys;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BirthIslandStone;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Brandon;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphireBrendan;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphireMay;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Lugia;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HoOh;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Bard;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Hipster;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Trader;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Storyteller;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Giddy;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedMauvilleOldMan1;
|
||||
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_UnusedMauvilleOldMan2;
|
||||
|
||||
|
||||
const struct ObjectEventGraphicsInfo *const gObjectEventGraphicsInfoPointers[NUM_OBJ_EVENT_GFX] = {
|
||||
|
||||
+32
-93
@@ -1,9 +1,3 @@
|
||||
enum {
|
||||
TAG_POKEBALL = 1200,
|
||||
TAG_POKEBALL_SMALL,
|
||||
TAG_STATUS_ICONS,
|
||||
};
|
||||
|
||||
static const struct BgTemplate sPartyMenuBgTemplates[] =
|
||||
{
|
||||
{
|
||||
@@ -35,12 +29,6 @@ static const struct BgTemplate sPartyMenuBgTemplates[] =
|
||||
},
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
PARTY_BOX_LEFT_COLUMN,
|
||||
PARTY_BOX_RIGHT_COLUMN
|
||||
};
|
||||
|
||||
static const struct PartyMenuBoxInfoRects sPartyBoxInfoRects[] =
|
||||
{
|
||||
[PARTY_BOX_LEFT_COLUMN] =
|
||||
@@ -663,51 +651,6 @@ static const u16 sUnusedData[] =
|
||||
0x0121, 0x013b, 0x000f, 0x0013, 0x0039, 0x0046, 0x0094, 0x00f9, 0x007f, 0x0123,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
MENU_SUMMARY,
|
||||
MENU_SWITCH,
|
||||
MENU_CANCEL1,
|
||||
MENU_ITEM,
|
||||
MENU_GIVE,
|
||||
MENU_TAKE_ITEM,
|
||||
MENU_MAIL,
|
||||
MENU_TAKE_MAIL,
|
||||
MENU_READ,
|
||||
MENU_CANCEL2,
|
||||
MENU_SHIFT,
|
||||
MENU_SEND_OUT,
|
||||
MENU_ENTER,
|
||||
MENU_NO_ENTRY,
|
||||
MENU_STORE,
|
||||
MENU_REGISTER,
|
||||
MENU_TRADE1,
|
||||
MENU_TRADE2,
|
||||
MENU_TOSS,
|
||||
MENU_FIELD_MOVES,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
FIELD_MOVE_CUT,
|
||||
FIELD_MOVE_FLASH,
|
||||
FIELD_MOVE_ROCK_SMASH,
|
||||
FIELD_MOVE_STRENGTH,
|
||||
FIELD_MOVE_SURF,
|
||||
FIELD_MOVE_FLY,
|
||||
FIELD_MOVE_DIVE,
|
||||
FIELD_MOVE_WATERFALL,
|
||||
FIELD_MOVE_TELEPORT,
|
||||
FIELD_MOVE_DIG,
|
||||
FIELD_MOVE_SECRET_POWER,
|
||||
FIELD_MOVE_MILK_DRINK,
|
||||
FIELD_MOVE_SOFT_BOILED,
|
||||
FIELD_MOVE_SWEET_SCENT,
|
||||
};
|
||||
|
||||
// What a weird choice of table termination;
|
||||
#define FIELD_MOVE_TERMINATOR MOVE_SWORDS_DANCE
|
||||
|
||||
struct
|
||||
{
|
||||
const u8 *text;
|
||||
@@ -763,25 +706,6 @@ static const u8 sPartyMenuAction_TradeSummaryCancel1[] = {MENU_TRADE1, MENU_SUMM
|
||||
static const u8 sPartyMenuAction_TradeSummaryCancel2[] = {MENU_TRADE2, MENU_SUMMARY, MENU_CANCEL1};
|
||||
static const u8 sPartyMenuAction_TakeItemTossCancel[] = {MENU_TAKE_ITEM, MENU_TOSS, MENU_CANCEL1};
|
||||
|
||||
// IDs for the action lists that appear when a party mon is selected
|
||||
enum
|
||||
{
|
||||
ACTIONS_NONE,
|
||||
ACTIONS_SWITCH,
|
||||
ACTIONS_SHIFT,
|
||||
ACTIONS_SEND_OUT,
|
||||
ACTIONS_ENTER,
|
||||
ACTIONS_NO_ENTRY,
|
||||
ACTIONS_STORE,
|
||||
ACTIONS_SUMMARY_ONLY,
|
||||
ACTIONS_ITEM,
|
||||
ACTIONS_MAIL,
|
||||
ACTIONS_REGISTER,
|
||||
ACTIONS_TRADE,
|
||||
ACTIONS_SPIN_TRADE,
|
||||
ACTIONS_TAKEITEM_TOSS
|
||||
};
|
||||
|
||||
static const u8 *const sPartyMenuActions[] =
|
||||
{
|
||||
[ACTIONS_NONE] = NULL,
|
||||
@@ -818,17 +742,32 @@ static const u8 sPartyMenuActionCounts[] =
|
||||
[ACTIONS_TAKEITEM_TOSS] = ARRAY_COUNT(sPartyMenuAction_TakeItemTossCancel)
|
||||
};
|
||||
|
||||
static const u16 sFieldMoves[] =
|
||||
static const u16 sFieldMoves[FIELD_MOVES_COUNT + 1] =
|
||||
{
|
||||
MOVE_CUT, MOVE_FLASH, MOVE_ROCK_SMASH, MOVE_STRENGTH, MOVE_SURF, MOVE_FLY, MOVE_DIVE, MOVE_WATERFALL, MOVE_TELEPORT,
|
||||
MOVE_DIG, MOVE_SECRET_POWER, MOVE_MILK_DRINK, MOVE_SOFT_BOILED, MOVE_SWEET_SCENT, FIELD_MOVE_TERMINATOR
|
||||
[FIELD_MOVE_CUT] = MOVE_CUT,
|
||||
[FIELD_MOVE_FLASH] = MOVE_FLASH,
|
||||
[FIELD_MOVE_ROCK_SMASH] = MOVE_ROCK_SMASH,
|
||||
[FIELD_MOVE_STRENGTH] = MOVE_STRENGTH,
|
||||
[FIELD_MOVE_SURF] = MOVE_SURF,
|
||||
[FIELD_MOVE_FLY] = MOVE_FLY,
|
||||
[FIELD_MOVE_DIVE] = MOVE_DIVE,
|
||||
[FIELD_MOVE_WATERFALL] = MOVE_WATERFALL,
|
||||
[FIELD_MOVE_TELEPORT] = MOVE_TELEPORT,
|
||||
[FIELD_MOVE_DIG] = MOVE_DIG,
|
||||
[FIELD_MOVE_SECRET_POWER] = MOVE_SECRET_POWER,
|
||||
[FIELD_MOVE_MILK_DRINK] = MOVE_MILK_DRINK,
|
||||
[FIELD_MOVE_SOFT_BOILED] = MOVE_SOFT_BOILED,
|
||||
[FIELD_MOVE_SWEET_SCENT] = MOVE_SWEET_SCENT,
|
||||
// NOTE: This value is used as the terminal value for the table. There's no reason to do this, as the size of the table is known.
|
||||
// Whichever move shares this value (MOVE_SWORDS_DANCE by default) if present will be treated as the end of the array rather than a field move.
|
||||
[FIELD_MOVES_COUNT] = FIELD_MOVES_COUNT
|
||||
};
|
||||
|
||||
struct
|
||||
{
|
||||
bool8 (*fieldMoveFunc)(void);
|
||||
u8 msgId;
|
||||
} static const sFieldMoveCursorCallbacks[] =
|
||||
} static const sFieldMoveCursorCallbacks[FIELD_MOVES_COUNT] =
|
||||
{
|
||||
[FIELD_MOVE_CUT] = {SetUpFieldMove_Cut, PARTY_MSG_NOTHING_TO_CUT},
|
||||
[FIELD_MOVE_FLASH] = {SetUpFieldMove_Flash, PARTY_MSG_CANT_USE_HERE},
|
||||
@@ -867,7 +806,7 @@ static const struct OamData sOamData_HeldItem =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(8x8),
|
||||
.x = 0,
|
||||
@@ -899,23 +838,23 @@ static const union AnimCmd *const sSpriteAnimTable_HeldItem[] =
|
||||
|
||||
static const struct SpriteSheet sSpriteSheet_HeldItem =
|
||||
{
|
||||
sHeldItemGfx, sizeof(sHeldItemGfx), 0xd750
|
||||
.data = sHeldItemGfx, .size = sizeof(sHeldItemGfx), .tag = TAG_HELD_ITEM
|
||||
};
|
||||
|
||||
static const struct SpritePalette sSpritePalette_HeldItem =
|
||||
{
|
||||
sHeldItemPalette, 0xd750
|
||||
.data = sHeldItemPalette, .tag = TAG_HELD_ITEM
|
||||
};
|
||||
|
||||
static const struct SpriteTemplate sSpriteTemplate_HeldItem =
|
||||
{
|
||||
0xd750,
|
||||
0xd750,
|
||||
&sOamData_HeldItem,
|
||||
sSpriteAnimTable_HeldItem,
|
||||
NULL,
|
||||
gDummySpriteAffineAnimTable,
|
||||
SpriteCallbackDummy
|
||||
.tileTag = TAG_HELD_ITEM,
|
||||
.paletteTag = TAG_HELD_ITEM,
|
||||
.oam = &sOamData_HeldItem,
|
||||
.anims = sSpriteAnimTable_HeldItem,
|
||||
.images = NULL,
|
||||
.affineAnims = gDummySpriteAffineAnimTable,
|
||||
.callback = SpriteCallbackDummy
|
||||
};
|
||||
|
||||
static const struct OamData sOamData_MenuPokeball =
|
||||
@@ -923,7 +862,7 @@ static const struct OamData sOamData_MenuPokeball =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(32x32),
|
||||
.x = 0,
|
||||
@@ -980,7 +919,7 @@ static const struct OamData sOamData_MenuPokeballSmall =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(16x16),
|
||||
.x = 0,
|
||||
@@ -1061,7 +1000,7 @@ static const struct OamData sOamData_StatusCondition =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(32x8),
|
||||
.x = 0,
|
||||
|
||||
+774
-774
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -794,7 +794,7 @@
|
||||
"height": 1
|
||||
},
|
||||
{
|
||||
"map_section": "MAPSEC_ROUTE_4_FLYDUP",
|
||||
"map_section": "MAPSEC_ROUTE_4_POKECENTER",
|
||||
"name": "ROUTE 4",
|
||||
"name_clone": true,
|
||||
"x": 0,
|
||||
@@ -803,7 +803,7 @@
|
||||
"height": 1
|
||||
},
|
||||
{
|
||||
"map_section": "MAPSEC_ROUTE_10_FLYDUP",
|
||||
"map_section": "MAPSEC_ROUTE_10_POKECENTER",
|
||||
"name": "ROUTE 10",
|
||||
"name_clone": true,
|
||||
"x": 0,
|
||||
|
||||
+3
-3
@@ -174,10 +174,10 @@ static const struct SpriteTemplate sSpriteTemplate_MenuText =
|
||||
.callback = SpriteCallbackDummy,
|
||||
};
|
||||
|
||||
static const u16 TradeScreenTextPalette[] = INCBIN_U16("graphics/trade/text.gbapal");
|
||||
static const struct SpritePalette gSpritePalette_TradeScreenText =
|
||||
static const u16 sTradeScreenTextPalette[] = INCBIN_U16("graphics/trade/text.gbapal");
|
||||
static const struct SpritePalette sSpritePalette_TradeScreenText =
|
||||
{
|
||||
.data = TradeScreenTextPalette,
|
||||
.data = sTradeScreenTextPalette,
|
||||
.tag = PALTAG_MENU_TEXT
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
static const union AnimCmd gAnimCmd_Brendan_1[] =
|
||||
static const union AnimCmd sAnimCmd_Brendan_1[] =
|
||||
{
|
||||
ANIMCMD_FRAME(0, 24),
|
||||
ANIMCMD_FRAME(1, 9),
|
||||
@@ -8,7 +8,7 @@ static const union AnimCmd gAnimCmd_Brendan_1[] =
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
static const union AnimCmd gAnimCmd_May_Steven_1[] =
|
||||
static const union AnimCmd sAnimCmd_May_Steven_1[] =
|
||||
{
|
||||
ANIMCMD_FRAME(0, 24),
|
||||
ANIMCMD_FRAME(1, 9),
|
||||
@@ -18,7 +18,7 @@ static const union AnimCmd gAnimCmd_May_Steven_1[] =
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
static const union AnimCmd gAnimCmd_Wally_1[] =
|
||||
static const union AnimCmd sAnimCmd_Wally_1[] =
|
||||
{
|
||||
ANIMCMD_FRAME(0, 24),
|
||||
ANIMCMD_FRAME(1, 9),
|
||||
@@ -28,7 +28,7 @@ static const union AnimCmd gAnimCmd_Wally_1[] =
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
static const union AnimCmd gAnimCmd_Red_1[] =
|
||||
static const union AnimCmd sAnimCmd_Red_1[] =
|
||||
{
|
||||
ANIMCMD_FRAME(1, 20),
|
||||
ANIMCMD_FRAME(2, 6),
|
||||
@@ -38,7 +38,7 @@ static const union AnimCmd gAnimCmd_Red_1[] =
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
static const union AnimCmd gAnimCmd_Leaf_1[] =
|
||||
static const union AnimCmd sAnimCmd_Leaf_1[] =
|
||||
{
|
||||
ANIMCMD_FRAME(1, 20),
|
||||
ANIMCMD_FRAME(2, 6),
|
||||
@@ -48,7 +48,7 @@ static const union AnimCmd gAnimCmd_Leaf_1[] =
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
static const union AnimCmd gAnimCmd_RubySapphireBrendan_1[] =
|
||||
static const union AnimCmd sAnimCmd_RubySapphireBrendan_1[] =
|
||||
{
|
||||
ANIMCMD_FRAME(0, 24),
|
||||
ANIMCMD_FRAME(1, 9),
|
||||
@@ -58,7 +58,7 @@ static const union AnimCmd gAnimCmd_RubySapphireBrendan_1[] =
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
static const union AnimCmd gAnimCmd_RubySapphireMay_1[] =
|
||||
static const union AnimCmd sAnimCmd_RubySapphireMay_1[] =
|
||||
{
|
||||
ANIMCMD_FRAME(0, 24),
|
||||
ANIMCMD_FRAME(1, 9),
|
||||
@@ -71,49 +71,49 @@ static const union AnimCmd gAnimCmd_RubySapphireMay_1[] =
|
||||
static const union AnimCmd *const sBackAnims_Brendan[] =
|
||||
{
|
||||
sAnim_GeneralFrame3,
|
||||
gAnimCmd_Brendan_1,
|
||||
sAnimCmd_Brendan_1,
|
||||
};
|
||||
|
||||
static const union AnimCmd *const sBackAnims_May[] =
|
||||
{
|
||||
sAnim_GeneralFrame3,
|
||||
gAnimCmd_May_Steven_1,
|
||||
sAnimCmd_May_Steven_1,
|
||||
};
|
||||
|
||||
static const union AnimCmd *const sBackAnims_Red[] =
|
||||
{
|
||||
sAnim_GeneralFrame0,
|
||||
gAnimCmd_Red_1,
|
||||
sAnimCmd_Red_1,
|
||||
};
|
||||
|
||||
static const union AnimCmd *const sBackAnims_Leaf[] =
|
||||
{
|
||||
sAnim_GeneralFrame0,
|
||||
gAnimCmd_Leaf_1,
|
||||
sAnimCmd_Leaf_1,
|
||||
};
|
||||
|
||||
static const union AnimCmd *const sBackAnims_RubySapphireBrendan[] =
|
||||
{
|
||||
sAnim_GeneralFrame3,
|
||||
gAnimCmd_RubySapphireBrendan_1,
|
||||
sAnimCmd_RubySapphireBrendan_1,
|
||||
};
|
||||
|
||||
static const union AnimCmd *const sBackAnims_RubySapphireMay[] =
|
||||
{
|
||||
sAnim_GeneralFrame3,
|
||||
gAnimCmd_RubySapphireMay_1,
|
||||
sAnimCmd_RubySapphireMay_1,
|
||||
};
|
||||
|
||||
static const union AnimCmd *const sBackAnims_Wally[] =
|
||||
{
|
||||
sAnim_GeneralFrame3,
|
||||
gAnimCmd_Wally_1,
|
||||
sAnimCmd_Wally_1,
|
||||
};
|
||||
|
||||
static const union AnimCmd *const sBackAnims_Steven[] =
|
||||
{
|
||||
sAnim_GeneralFrame3,
|
||||
gAnimCmd_May_Steven_1,
|
||||
sAnimCmd_May_Steven_1,
|
||||
};
|
||||
|
||||
const union AnimCmd *const *const gTrainerBackAnimsPtrTable[] =
|
||||
|
||||
+854
-2562
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -1258,7 +1258,7 @@ static void Task_HandleDaycareLevelMenuInput(u8 taskId)
|
||||
ClearStdWindowAndFrame(gTasks[taskId].tWindowId, TRUE);
|
||||
RemoveWindow(gTasks[taskId].tWindowId);
|
||||
DestroyTask(taskId);
|
||||
EnableBothScriptContexts();
|
||||
ScriptContext_Enable();
|
||||
}
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
@@ -1267,7 +1267,7 @@ static void Task_HandleDaycareLevelMenuInput(u8 taskId)
|
||||
ClearStdWindowAndFrame(gTasks[taskId].tWindowId, TRUE);
|
||||
RemoveWindow(gTasks[taskId].tWindowId);
|
||||
DestroyTask(taskId);
|
||||
EnableBothScriptContexts();
|
||||
ScriptContext_Enable();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+12
-12
@@ -46,22 +46,22 @@ void LoadCompressedSpritePalette(const struct CompressedSpritePalette *src)
|
||||
struct SpritePalette dest;
|
||||
|
||||
LZ77UnCompWram(src->data, gDecompressionBuffer);
|
||||
dest.data = (void*) gDecompressionBuffer;
|
||||
dest.data = (void *) gDecompressionBuffer;
|
||||
dest.tag = src->tag;
|
||||
LoadSpritePalette(&dest);
|
||||
}
|
||||
|
||||
void LoadCompressedSpritePaletteOverrideBuffer(const struct CompressedSpritePalette *a, void *buffer)
|
||||
void LoadCompressedSpritePaletteOverrideBuffer(const struct CompressedSpritePalette *src, void *buffer)
|
||||
{
|
||||
struct SpritePalette dest;
|
||||
|
||||
LZ77UnCompWram(a->data, buffer);
|
||||
LZ77UnCompWram(src->data, buffer);
|
||||
dest.data = buffer;
|
||||
dest.tag = a->tag;
|
||||
dest.tag = src->tag;
|
||||
LoadSpritePalette(&dest);
|
||||
}
|
||||
|
||||
void DecompressPicFromTable(const struct CompressedSpriteSheet *src, void* buffer, s32 species)
|
||||
void DecompressPicFromTable(const struct CompressedSpriteSheet *src, void *buffer, s32 species)
|
||||
{
|
||||
if (species > NUM_SPECIES)
|
||||
LZ77UnCompWram(gMonFrontPicTable[0].data, buffer);
|
||||
@@ -263,12 +263,12 @@ u32 GetDecompressedDataSize(const u32 *ptr)
|
||||
return (ptr8[3] << 16) | (ptr8[2] << 8) | (ptr8[1]);
|
||||
}
|
||||
|
||||
bool8 LoadCompressedSpriteSheetUsingHeap(const struct CompressedSpriteSheet* src)
|
||||
bool8 LoadCompressedSpriteSheetUsingHeap(const struct CompressedSpriteSheet *src)
|
||||
{
|
||||
struct SpriteSheet dest;
|
||||
void* buffer;
|
||||
void *buffer;
|
||||
|
||||
buffer = AllocZeroed(*((u32*)(&src->data[0])) >> 8);
|
||||
buffer = AllocZeroed(*((u32 *)(&src->data[0])) >> 8);
|
||||
LZ77UnCompWram(src->data, buffer);
|
||||
|
||||
dest.data = buffer;
|
||||
@@ -283,9 +283,9 @@ bool8 LoadCompressedSpriteSheetUsingHeap(const struct CompressedSpriteSheet* src
|
||||
bool8 LoadCompressedSpritePaletteUsingHeap(const struct CompressedSpritePalette *src)
|
||||
{
|
||||
struct SpritePalette dest;
|
||||
void* buffer;
|
||||
void *buffer;
|
||||
|
||||
buffer = AllocZeroed(*((u32*)(&src->data[0])) >> 8);
|
||||
buffer = AllocZeroed(*((u32 *)(&src->data[0])) >> 8);
|
||||
LZ77UnCompWram(src->data, buffer);
|
||||
dest.data = buffer;
|
||||
dest.tag = src->tag;
|
||||
@@ -295,7 +295,7 @@ bool8 LoadCompressedSpritePaletteUsingHeap(const struct CompressedSpritePalette
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void DecompressPicFromTable_2(const struct CompressedSpriteSheet *src, void* buffer, s32 species) // a copy of DecompressPicFromTable
|
||||
void DecompressPicFromTable_2(const struct CompressedSpriteSheet *src, void *buffer, s32 species) // a copy of DecompressPicFromTable
|
||||
{
|
||||
if (species > NUM_SPECIES)
|
||||
LZ77UnCompWram(gMonFrontPicTable[0].data, buffer);
|
||||
@@ -342,7 +342,7 @@ void HandleLoadSpecialPokePic_2(const struct CompressedSpriteSheet *src, void *d
|
||||
LoadSpecialPokePic_2(src, dest, species, personality, isFrontPic);
|
||||
}
|
||||
|
||||
void DecompressPicFromTable_DontHandleDeoxys(const struct CompressedSpriteSheet *src, void* buffer, s32 species)
|
||||
void DecompressPicFromTable_DontHandleDeoxys(const struct CompressedSpriteSheet *src, void *buffer, s32 species)
|
||||
{
|
||||
if (species > NUM_SPECIES)
|
||||
LZ77UnCompWram(gMonFrontPicTable[0].data, buffer);
|
||||
|
||||
+34
-34
@@ -563,7 +563,7 @@ static void AddDecorationActionsWindow(void)
|
||||
static void InitDecorationActionsWindow(void)
|
||||
{
|
||||
sDecorationActionsCursorPos = 0;
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
AddDecorationActionsWindow();
|
||||
PrintCurMainMenuDescription();
|
||||
}
|
||||
@@ -615,7 +615,7 @@ static void HandleDecorationActionsMenuInput(u8 taskId)
|
||||
static void PrintCurMainMenuDescription(void)
|
||||
{
|
||||
FillWindowPixelBuffer(0, PIXEL_FILL(1));
|
||||
AddTextPrinterParameterized2(0, FONT_NORMAL, sSecretBasePCMenuItemDescriptions[sDecorationActionsCursorPos], 0, 0, 2, 1, 3);
|
||||
AddTextPrinterParameterized2(0, FONT_NORMAL, sSecretBasePCMenuItemDescriptions[sDecorationActionsCursorPos], 0, 0, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY);
|
||||
}
|
||||
|
||||
static void DecorationMenuAction_Decorate(u8 taskId)
|
||||
@@ -643,7 +643,7 @@ static void DecorationMenuAction_PutAway(u8 taskId)
|
||||
else
|
||||
{
|
||||
RemoveDecorationWindow(WINDOW_MAIN_MENU);
|
||||
ClearDialogWindowAndFrame(0, 0);
|
||||
ClearDialogWindowAndFrame(0, FALSE);
|
||||
FadeScreen(FADE_TO_BLACK, 0);
|
||||
gTasks[taskId].tState = 0;
|
||||
gTasks[taskId].func = Task_ContinuePuttingAwayDecorations;
|
||||
@@ -670,7 +670,7 @@ static void DecorationMenuAction_Cancel(u8 taskId)
|
||||
RemoveDecorationWindow(WINDOW_MAIN_MENU);
|
||||
if (!sDecorationContext.isPlayerRoom)
|
||||
{
|
||||
ScriptContext1_SetupScript(SecretBase_EventScript_PCCancel);
|
||||
ScriptContext_SetupScript(SecretBase_EventScript_PCCancel);
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
else
|
||||
@@ -688,7 +688,7 @@ static void ReturnToDecorationActionsAfterInvalidSelection(u8 taskId)
|
||||
static void SecretBasePC_PrepMenuForSelectingStoredDecors(u8 taskId)
|
||||
{
|
||||
LoadPalette(sDecorationMenuPalette, 0xd0, 0x20);
|
||||
ClearDialogWindowAndFrame(0, 0);
|
||||
ClearDialogWindowAndFrame(0, FALSE);
|
||||
RemoveDecorationWindow(WINDOW_MAIN_MENU);
|
||||
InitDecorationCategoriesWindow(taskId);
|
||||
}
|
||||
@@ -810,7 +810,7 @@ static void SelectDecorationCategory(u8 taskId)
|
||||
|
||||
static void ReturnToDecorationCategoriesAfterInvalidSelection(u8 taskId)
|
||||
{
|
||||
ClearDialogWindowAndFrame(0, 0);
|
||||
ClearDialogWindowAndFrame(0, FALSE);
|
||||
InitDecorationCategoriesWindow(taskId);
|
||||
}
|
||||
|
||||
@@ -826,7 +826,7 @@ static void ReturnToActionsMenuFromCategories(u8 taskId)
|
||||
{
|
||||
RemoveDecorationWindow(WINDOW_DECORATION_CATEGORIES);
|
||||
AddDecorationActionsWindow();
|
||||
DrawDialogueFrame(0, 0);
|
||||
DrawDialogueFrame(0, FALSE);
|
||||
PrintCurMainMenuDescription();
|
||||
gTasks[taskId].func = HandleDecorationActionsMenuInput;
|
||||
}
|
||||
@@ -834,7 +834,7 @@ static void ReturnToActionsMenuFromCategories(u8 taskId)
|
||||
void ShowDecorationCategoriesWindow(u8 taskId)
|
||||
{
|
||||
LoadPalette(sDecorationMenuPalette, 0xd0, 0x20);
|
||||
ClearDialogWindowAndFrame(0, 0);
|
||||
ClearDialogWindowAndFrame(0, FALSE);
|
||||
gTasks[taskId].tDecorationMenuCommand = DECOR_MENU_TRADE;
|
||||
sCurDecorationCategory = DECORCAT_DESK;
|
||||
InitDecorationCategoriesWindow(taskId);
|
||||
@@ -1000,7 +1000,7 @@ static void HandleDecorationItemsMenuInput(u8 taskId)
|
||||
DestroyListMenuTask(tMenuTaskId, &sDecorationsScrollOffset, &sDecorationsCursorPos);
|
||||
RemoveDecorationWindow(WINDOW_DECORATION_CATEGORIES);
|
||||
RemoveDecorationItemsOtherWindows();
|
||||
free(sDecorationItemsMenu);
|
||||
Free(sDecorationItemsMenu);
|
||||
sSecretBasePC_SelectedDecorationActions[tDecorationMenuCommand][0](taskId);
|
||||
break;
|
||||
}
|
||||
@@ -1141,7 +1141,7 @@ static void Task_ShowDecorationItemsWindow(u8 taskId)
|
||||
|
||||
static void DontTossDecoration(u8 taskId)
|
||||
{
|
||||
ClearDialogWindowAndFrame(0, 0);
|
||||
ClearDialogWindowAndFrame(0, FALSE);
|
||||
gTasks[taskId].func = Task_ShowDecorationItemsWindow;
|
||||
}
|
||||
|
||||
@@ -1149,7 +1149,7 @@ static void ReturnToDecorationItemsAfterInvalidSelection(u8 taskId)
|
||||
{
|
||||
if (JOY_NEW(A_BUTTON | B_BUTTON))
|
||||
{
|
||||
ClearDialogWindowAndFrame(0, 0);
|
||||
ClearDialogWindowAndFrame(0, FALSE);
|
||||
AddDecorationWindow(WINDOW_DECORATION_CATEGORIES);
|
||||
ShowDecorationItemsWindow(taskId);
|
||||
}
|
||||
@@ -1161,7 +1161,7 @@ static void DecorationItemsMenuAction_Cancel(u8 taskId)
|
||||
RemoveDecorationItemsScrollIndicators();
|
||||
RemoveDecorationItemsOtherWindows();
|
||||
DestroyListMenuTask(tMenuTaskId, NULL, NULL);
|
||||
free(sDecorationItemsMenu);
|
||||
Free(sDecorationItemsMenu);
|
||||
ReinitDecorationCategoriesWindow(taskId);
|
||||
}
|
||||
|
||||
@@ -1211,7 +1211,7 @@ static void ShowDecorationOnMap_(u16 mapX, u16 mapY, u8 decWidth, u8 decHeight,
|
||||
{
|
||||
x = mapX + i;
|
||||
attributes = GetMetatileAttributesById(NUM_TILES_IN_PRIMARY + gDecorations[decoration].tiles[j * decWidth + i]);
|
||||
if (MetatileBehavior_IsSecretBaseImpassable(attributes & METATILE_ATTR_BEHAVIOR_MASK) == TRUE
|
||||
if (MetatileBehavior_IsSecretBaseImpassable(attributes & METATILE_ATTR_BEHAVIOR_MASK) == TRUE
|
||||
|| (gDecorations[decoration].permission != DECORPERM_PASS_FLOOR && (attributes >> METATILE_ATTR_LAYER_SHIFT) != METATILE_LAYER_TYPE_NORMAL))
|
||||
impassableFlag = MAPGRID_COLLISION_MASK;
|
||||
else
|
||||
@@ -1482,7 +1482,7 @@ static bool8 IsSecretBaseTrainerSpot(u8 behaviorAt, u16 layerType)
|
||||
// Can't place decoration where the player was standing when they interacted with the PC
|
||||
static bool8 IsntInitialPosition(u8 taskId, s16 x, s16 y, u16 layerType)
|
||||
{
|
||||
if (x == gTasks[taskId].tInitialX + MAP_OFFSET
|
||||
if (x == gTasks[taskId].tInitialX + MAP_OFFSET
|
||||
&& y == gTasks[taskId].tInitialY + MAP_OFFSET
|
||||
&& layerType != METATILE_LAYER_TYPE_NORMAL)
|
||||
return FALSE;
|
||||
@@ -1640,7 +1640,7 @@ static void PlaceDecorationPrompt(u8 taskId)
|
||||
|
||||
static void PlaceDecoration(u8 taskId)
|
||||
{
|
||||
ClearDialogWindowAndFrame(0, 0);
|
||||
ClearDialogWindowAndFrame(0, FALSE);
|
||||
PlaceDecoration_(taskId);
|
||||
if (gDecorations[gCurDecorationItems[gCurDecorationIndex]].permission != DECORPERM_SPRITE)
|
||||
{
|
||||
@@ -1650,7 +1650,7 @@ static void PlaceDecoration(u8 taskId)
|
||||
{
|
||||
sCurDecorMapX = gTasks[taskId].tCursorX - MAP_OFFSET;
|
||||
sCurDecorMapY = gTasks[taskId].tCursorY - MAP_OFFSET;
|
||||
ScriptContext1_SetupScript(SecretBase_EventScript_SetDecoration);
|
||||
ScriptContext_SetupScript(SecretBase_EventScript_SetDecoration);
|
||||
}
|
||||
|
||||
gSprites[sDecor_CameraSpriteObjectIdx1].y += 2;
|
||||
@@ -1706,7 +1706,7 @@ static void CancelDecoratingPrompt(u8 taskId)
|
||||
|
||||
static void CancelDecorating(u8 taskId)
|
||||
{
|
||||
ClearDialogWindowAndFrame(0, 0);
|
||||
ClearDialogWindowAndFrame(0, FALSE);
|
||||
CancelDecorating_(taskId);
|
||||
}
|
||||
|
||||
@@ -1722,7 +1722,7 @@ static void c1_overworld_prev_quest(u8 taskId)
|
||||
switch (gTasks[taskId].tState)
|
||||
{
|
||||
case 0:
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
WarpToInitialPosition(taskId);
|
||||
@@ -1749,11 +1749,11 @@ static void Task_InitDecorationItemsWindow(u8 taskId)
|
||||
tState++;
|
||||
break;
|
||||
case 1:
|
||||
ScriptContext1_SetupScript(SecretBase_EventScript_InitDecorations);
|
||||
ScriptContext_SetupScript(SecretBase_EventScript_InitDecorations);
|
||||
tState++;
|
||||
break;
|
||||
case 2:
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
tState++;
|
||||
break;
|
||||
case 3:
|
||||
@@ -1767,7 +1767,7 @@ static void FieldCB_InitDecorationItemsWindow(void)
|
||||
{
|
||||
u8 taskId;
|
||||
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
FadeInFromBlack();
|
||||
taskId = CreateTask(Task_InitDecorationItemsWindow, 8);
|
||||
AddDecorationItemsWindow(taskId);
|
||||
@@ -1891,7 +1891,7 @@ static void Task_SelectLocation(u8 taskId)
|
||||
|
||||
static void ContinueDecorating(u8 taskId)
|
||||
{
|
||||
ClearDialogWindowAndFrame(0, 1);
|
||||
ClearDialogWindowAndFrame(0, TRUE);
|
||||
gSprites[sDecor_CameraSpriteObjectIdx1].data[7] = 0;
|
||||
gTasks[taskId].tButton = 0;
|
||||
gTasks[taskId].func = Task_SelectLocation;
|
||||
@@ -1985,7 +1985,7 @@ static void SetDecorSelectionBoxOamAttributes(u8 decorShape)
|
||||
sDecorSelectorOam.y = 0;
|
||||
sDecorSelectorOam.affineMode = ST_OAM_AFFINE_OFF;
|
||||
sDecorSelectorOam.objMode = ST_OAM_OBJ_NORMAL;
|
||||
sDecorSelectorOam.mosaic = 0;
|
||||
sDecorSelectorOam.mosaic = FALSE;
|
||||
sDecorSelectorOam.bpp = ST_OAM_4BPP;
|
||||
sDecorSelectorOam.shape = sDecorationMovementInfo[decorShape].shape;
|
||||
sDecorSelectorOam.x = 0;
|
||||
@@ -2060,13 +2060,13 @@ static u8 AddDecorationIconObjectFromIconTable(u16 tilesTag, u16 paletteTag, u8
|
||||
palette.data = GetDecorationIconPicOrPalette(decor, 1);
|
||||
palette.tag = paletteTag;
|
||||
LoadCompressedSpritePalette(&palette);
|
||||
template = malloc(sizeof(struct SpriteTemplate));
|
||||
template = Alloc(sizeof(struct SpriteTemplate));
|
||||
*template = gItemIconSpriteTemplate;
|
||||
template->tileTag = tilesTag;
|
||||
template->paletteTag = paletteTag;
|
||||
spriteId = CreateSprite(template, 0, 0, 0);
|
||||
FreeItemIconTemporaryBuffers();
|
||||
free(template);
|
||||
Free(template);
|
||||
return spriteId;
|
||||
}
|
||||
|
||||
@@ -2105,7 +2105,7 @@ static u8 AddDecorationIconObjectFromObjectEvent(u16 tilesTag, u16 paletteTag, u
|
||||
template->tileTag = tilesTag;
|
||||
template->paletteTag = paletteTag;
|
||||
spriteId = CreateSprite(template, 0, 0, 0);
|
||||
free(template);
|
||||
Free(template);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2246,13 +2246,13 @@ static void Task_PutAwayDecoration(u8 taskId)
|
||||
case 1:
|
||||
if (!gPaletteFade.active) {
|
||||
DrawWholeMapView();
|
||||
ScriptContext1_SetupScript(SecretBase_EventScript_PutAwayDecoration);
|
||||
ClearDialogWindowAndFrame(0, 1);
|
||||
ScriptContext_SetupScript(SecretBase_EventScript_PutAwayDecoration);
|
||||
ClearDialogWindowAndFrame(0, TRUE);
|
||||
gTasks[taskId].tState = 2;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
IdentifyOwnedDecorationsCurrentlyInUseInternal(taskId);
|
||||
FadeInFromBlack();
|
||||
gTasks[taskId].tState = 3;
|
||||
@@ -2331,7 +2331,7 @@ static void Task_ContinuePuttingAwayDecorations(u8 taskId)
|
||||
|
||||
static void ContinuePuttingAwayDecorations(u8 taskId)
|
||||
{
|
||||
ClearDialogWindowAndFrame(0, 1);
|
||||
ClearDialogWindowAndFrame(0, TRUE);
|
||||
gSprites[sDecor_CameraSpriteObjectIdx1].data[7] = 0;
|
||||
gSprites[sDecor_CameraSpriteObjectIdx1].invisible = FALSE;
|
||||
gSprites[sDecor_CameraSpriteObjectIdx1].callback = InitializeCameraSprite1;
|
||||
@@ -2604,7 +2604,7 @@ static void StopPuttingAwayDecorationsPrompt(u8 taskId)
|
||||
|
||||
static void StopPuttingAwayDecorations(u8 taskId)
|
||||
{
|
||||
ClearDialogWindowAndFrame(0, 0);
|
||||
ClearDialogWindowAndFrame(0, FALSE);
|
||||
StopPuttingAwayDecorations_(taskId);
|
||||
}
|
||||
|
||||
@@ -2645,11 +2645,11 @@ static void Task_ReinitializeDecorationMenuHandler(u8 taskId)
|
||||
tState++;
|
||||
break;
|
||||
case 1:
|
||||
ScriptContext1_SetupScript(SecretBase_EventScript_InitDecorations);
|
||||
ScriptContext_SetupScript(SecretBase_EventScript_InitDecorations);
|
||||
tState++;
|
||||
break;
|
||||
case 2:
|
||||
ScriptContext2_Enable();
|
||||
LockPlayerFieldControls();
|
||||
tState++;
|
||||
break;
|
||||
case 3:
|
||||
@@ -2664,7 +2664,7 @@ static void FieldCB_StopPuttingAwayDecorations(void)
|
||||
u8 taskId;
|
||||
|
||||
FadeInFromBlack();
|
||||
DrawDialogueFrame(0, 1);
|
||||
DrawDialogueFrame(0, TRUE);
|
||||
InitDecorationActionsWindow();
|
||||
taskId = CreateTask(Task_ReinitializeDecorationMenuHandler, 8);
|
||||
gTasks[taskId].tState = 0;
|
||||
|
||||
@@ -138,7 +138,7 @@ bool32 DigitObjUtil_CreatePrinter(u32 id, s32 num, const struct DigitObjUtilTemp
|
||||
{
|
||||
struct CompressedSpriteSheet compSpriteSheet;
|
||||
|
||||
compSpriteSheet = *(struct CompressedSpriteSheet*)(template->spriteSheet);
|
||||
compSpriteSheet = *(struct CompressedSpriteSheet *)(template->spriteSheet);
|
||||
compSpriteSheet.size = GetDecompressedDataSize(template->spriteSheet->data);
|
||||
sOamWork->array[id].tileStart = LoadCompressedSpriteSheet(&compSpriteSheet);
|
||||
}
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ void CB2_ShowDiploma(void)
|
||||
ResetPaletteFade();
|
||||
FreeAllSpritePalettes();
|
||||
LoadPalette(sDiplomaPalettes, 0, 64);
|
||||
sDiplomaTilemapPtr = malloc(0x1000);
|
||||
sDiplomaTilemapPtr = Alloc(0x1000);
|
||||
InitDiplomaBg();
|
||||
InitDiplomaWindow();
|
||||
ResetTempTileDataBuffers();
|
||||
|
||||
+14
-14
@@ -323,7 +323,7 @@ static bool32 TryPickBerry(u8, u8, u8);
|
||||
static void UpdateFallingBerries(void);
|
||||
static void UpdateGame_Leader(void);
|
||||
static void UpdateGame_Member(void);
|
||||
static void GetActiveBerryColumns(u8, u8*, u8*);
|
||||
static void GetActiveBerryColumns(u8, u8 *, u8 *);
|
||||
static bool32 AllPlayersReadyToStart(void);
|
||||
static void ResetReadyToStart(void);
|
||||
static bool32 ReadyToEndGame_Leader(void);
|
||||
@@ -665,7 +665,7 @@ void StartDodrioBerryPicking(u16 partyId, void (*exitCallback)(void))
|
||||
{
|
||||
sExitingGame = FALSE;
|
||||
|
||||
if (gReceivedRemoteLinkPlayers != 0 && (sGame = AllocZeroed(sizeof(*sGame))))
|
||||
if (gReceivedRemoteLinkPlayers && (sGame = AllocZeroed(sizeof(*sGame))))
|
||||
{
|
||||
ResetTasksAndSprites();
|
||||
InitDodrioGame(sGame);
|
||||
@@ -775,7 +775,7 @@ static void Task_StartDodrioGame(u8 taskId)
|
||||
case 3:
|
||||
if (IsLinkTaskFinished())
|
||||
{
|
||||
if (gReceivedRemoteLinkPlayers != 0)
|
||||
if (gReceivedRemoteLinkPlayers)
|
||||
{
|
||||
LoadWirelessStatusIndicatorSpriteGfx();
|
||||
CreateWirelessStatusIndicatorSprite(0, 0);
|
||||
@@ -1795,7 +1795,7 @@ static void VBlankCB_DodrioGame(void)
|
||||
ProcessSpriteCopyRequests();
|
||||
}
|
||||
|
||||
static void InitMonInfo(struct DodrioGame_MonInfo * monInfo, struct Pokemon * mon)
|
||||
static void InitMonInfo(struct DodrioGame_MonInfo * monInfo, struct Pokemon *mon)
|
||||
{
|
||||
monInfo->isShiny = IsMonShiny(mon);
|
||||
}
|
||||
@@ -2879,10 +2879,10 @@ static u8 TryGivePrize(void)
|
||||
return PRIZE_RECEIVED;
|
||||
}
|
||||
|
||||
static u32 IncrementWithLimit(u32 a, u32 max)
|
||||
static u32 IncrementWithLimit(u32 num, u32 max)
|
||||
{
|
||||
if (a < max)
|
||||
return a + 1;
|
||||
if (num < max)
|
||||
return num + 1;
|
||||
else
|
||||
return max;
|
||||
}
|
||||
@@ -2988,7 +2988,7 @@ static void Task_ShowDodrioBerryPickingRecords(u8 taskId)
|
||||
{
|
||||
RemoveWindow(tWindowId);
|
||||
DestroyTask(taskId);
|
||||
EnableBothScriptContexts();
|
||||
ScriptContext_Enable();
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -3608,7 +3608,7 @@ static const struct OamData sOamData_Dodrio =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(64x64),
|
||||
.x = 0,
|
||||
@@ -3626,7 +3626,7 @@ static const struct OamData sOamData_16x16_Priority0 =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(16x16),
|
||||
.x = 0,
|
||||
@@ -3643,7 +3643,7 @@ static const struct OamData sOamData_Berry =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(16x16),
|
||||
.x = 0,
|
||||
@@ -3660,7 +3660,7 @@ static const struct OamData sOamData_Cloud =
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(64x32),
|
||||
.x = 0,
|
||||
@@ -4546,7 +4546,7 @@ struct
|
||||
{
|
||||
u8 id;
|
||||
void (*func)(void);
|
||||
} const sGfxFuncs[] =
|
||||
} static const sGfxFuncs[] =
|
||||
{
|
||||
{GFXFUNC_LOAD, LoadGfx}, // Element not used, LoadGfx is passed directly to SetGfxFunc
|
||||
{GFXFUNC_SHOW_NAMES, ShowNames},
|
||||
@@ -5025,7 +5025,7 @@ static void Msg_SavingDontTurnOff(void)
|
||||
{
|
||||
case 0:
|
||||
DrawDialogueFrame(0, FALSE);
|
||||
AddTextPrinterParameterized2(0, FONT_NORMAL, gText_SavingDontTurnOffPower, 0, NULL, 2, 1, 3);
|
||||
AddTextPrinterParameterized2(0, FONT_NORMAL, gText_SavingDontTurnOffPower, 0, NULL, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_WHITE, TEXT_COLOR_LIGHT_GRAY);
|
||||
sGfx->state++;
|
||||
break;
|
||||
case 1:
|
||||
|
||||
+23
-20
@@ -932,7 +932,7 @@ static const struct OamData sOamData_TriangleCursor = {
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(8x8),
|
||||
.x = 0,
|
||||
@@ -944,7 +944,8 @@ static const struct OamData sOamData_TriangleCursor = {
|
||||
.affineParam = 0,
|
||||
};
|
||||
|
||||
static const struct SpriteTemplate sSpriteTemplate_TriangleCursor = {
|
||||
static const struct SpriteTemplate sSpriteTemplate_TriangleCursor =
|
||||
{
|
||||
.tileTag = PALTAG_TRIANGLE_CURSOR,
|
||||
.paletteTag = GFXTAG_TRIANGLE_CURSOR,
|
||||
.oam = &sOamData_TriangleCursor,
|
||||
@@ -958,7 +959,7 @@ static const struct OamData sOamData_RectangleCursor = {
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(64x32),
|
||||
.x = 0,
|
||||
@@ -1005,7 +1006,8 @@ static const union AnimCmd *const sAnims_RectangleCursor[] = {
|
||||
[RECTCURSOR_ANIM_ON_LETTER] = sAnim_RectangleCursor_OnLetter,
|
||||
};
|
||||
|
||||
static const struct SpriteTemplate sSpriteTemplate_RectangleCursor = {
|
||||
static const struct SpriteTemplate sSpriteTemplate_RectangleCursor =
|
||||
{
|
||||
.tileTag = GFXTAG_RECTANGLE_CURSOR,
|
||||
.paletteTag = PALTAG_RECTANGLE_CURSOR,
|
||||
.oam = &sOamData_RectangleCursor,
|
||||
@@ -1019,7 +1021,7 @@ static const struct OamData sOamData_ModeWindow = {
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(64x32),
|
||||
.x = 0,
|
||||
@@ -1075,7 +1077,8 @@ static const union AnimCmd *const sAnims_ModeWindow[] = {
|
||||
[MODEWINDOW_ANIM_TRANSITION] = sAnim_ModeWindow_Transition,
|
||||
};
|
||||
|
||||
static const struct SpriteTemplate sSpriteTemplate_ModeWindow = {
|
||||
static const struct SpriteTemplate sSpriteTemplate_ModeWindow =
|
||||
{
|
||||
.tileTag = GFXTAG_MODE_WINDOW,
|
||||
.paletteTag = PALTAG_MISC_UI,
|
||||
.oam = &sOamData_ModeWindow,
|
||||
@@ -1089,7 +1092,7 @@ static const struct OamData sOamData_ButtonWindow = {
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(64x64),
|
||||
.x = 0,
|
||||
@@ -1101,7 +1104,8 @@ static const struct OamData sOamData_ButtonWindow = {
|
||||
.affineParam = 0,
|
||||
};
|
||||
|
||||
static const struct SpriteTemplate sSpriteTemplate_ButtonWindow = {
|
||||
static const struct SpriteTemplate sSpriteTemplate_ButtonWindow =
|
||||
{
|
||||
.tileTag = GFXTAG_BUTTON_WINDOW,
|
||||
.paletteTag = PALTAG_MISC_UI,
|
||||
.oam = &sOamData_ButtonWindow,
|
||||
@@ -1115,7 +1119,7 @@ static const struct OamData sOamData_StartSelectButton = {
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(32x8),
|
||||
.x = 0,
|
||||
@@ -1131,7 +1135,7 @@ static const struct OamData sOamData_ScrollIndicator = {
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
.objMode = ST_OAM_OBJ_NORMAL,
|
||||
.mosaic = 0,
|
||||
.mosaic = FALSE,
|
||||
.bpp = ST_OAM_4BPP,
|
||||
.shape = SPRITE_SHAPE(16x16),
|
||||
.x = 0,
|
||||
@@ -1159,7 +1163,8 @@ static const union AnimCmd *const sAnims_TwoFrame[] = {
|
||||
sAnim_Frame1,
|
||||
};
|
||||
|
||||
static const struct SpriteTemplate sSpriteTemplate_StartSelectButton = {
|
||||
static const struct SpriteTemplate sSpriteTemplate_StartSelectButton =
|
||||
{
|
||||
.tileTag = GFXTAG_START_SELECT_BUTTONS,
|
||||
.paletteTag = PALTAG_MISC_UI,
|
||||
.oam = &sOamData_StartSelectButton,
|
||||
@@ -1169,7 +1174,8 @@ static const struct SpriteTemplate sSpriteTemplate_StartSelectButton = {
|
||||
.callback = SpriteCallbackDummy,
|
||||
};
|
||||
|
||||
static const struct SpriteTemplate sSpriteTemplate_ScrollIndicator = {
|
||||
static const struct SpriteTemplate sSpriteTemplate_ScrollIndicator =
|
||||
{
|
||||
.tileTag = GFXTAG_SCROLL_INDICATOR,
|
||||
.paletteTag = PALTAG_MISC_UI,
|
||||
.oam = &sOamData_ScrollIndicator,
|
||||
@@ -1492,7 +1498,7 @@ void ShowEasyChatScreen(void)
|
||||
displayedPersonType = EASY_CHAT_PERSON_REPORTER_MALE;
|
||||
break;
|
||||
case EASY_CHAT_TYPE_BATTLE_TOWER_INTERVIEW:
|
||||
words = gSaveBlock1Ptr->tvShows[gSpecialVar_0x8005].fanclubOpinions.words18;
|
||||
words = gSaveBlock1Ptr->tvShows[gSpecialVar_0x8005].bravoTrainerTower.words;
|
||||
displayedPersonType = EASY_CHAT_PERSON_REPORTER_FEMALE;
|
||||
break;
|
||||
case EASY_CHAT_TYPE_GOOD_SAYING:
|
||||
@@ -1621,7 +1627,7 @@ static bool8 InitEasyChatScreenStruct(u8 type, u16 *words, u8 displayedPersonTyp
|
||||
u8 templateId;
|
||||
int i;
|
||||
|
||||
sEasyChatScreen = malloc(sizeof(*sEasyChatScreen));
|
||||
sEasyChatScreen = Alloc(sizeof(*sEasyChatScreen));
|
||||
if (sEasyChatScreen == NULL)
|
||||
return FALSE;
|
||||
|
||||
@@ -1672,8 +1678,7 @@ static bool8 InitEasyChatScreenStruct(u8 type, u16 *words, u8 displayedPersonTyp
|
||||
|
||||
static void FreeEasyChatScreenStruct(void)
|
||||
{
|
||||
if (sEasyChatScreen != NULL)
|
||||
FREE_AND_SET_NULL(sEasyChatScreen);
|
||||
TRY_FREE_AND_SET_NULL(sEasyChatScreen);
|
||||
}
|
||||
|
||||
// Returns the function ID of the action to take as a result of player's input.
|
||||
@@ -3075,8 +3080,7 @@ static bool8 LoadEasyChatScreen(void)
|
||||
|
||||
static void FreeEasyChatScreenControl(void)
|
||||
{
|
||||
if (sScreenControl)
|
||||
FREE_AND_SET_NULL(sScreenControl);
|
||||
TRY_FREE_AND_SET_NULL(sScreenControl);
|
||||
}
|
||||
|
||||
static void StartEasyChatFunction(u16 funcId)
|
||||
@@ -5573,8 +5577,7 @@ static bool8 InitEasyChatScreenWordData(void)
|
||||
|
||||
static void FreeEasyChatScreenWordData(void)
|
||||
{
|
||||
if (sWordData)
|
||||
FREE_AND_SET_NULL(sWordData);
|
||||
TRY_FREE_AND_SET_NULL(sWordData);
|
||||
}
|
||||
|
||||
static void SetUnlockedEasyChatGroups(void)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user