Document some single-remaining symbols
This commit is contained in:
@@ -784,7 +784,7 @@ void AnimTask_InitMementoShadow(u8 taskId)
|
||||
DestroyAnimVisualTask(taskId);
|
||||
}
|
||||
|
||||
void sub_8114470(u8 taskId)
|
||||
void AnimTask_MementoHandleBg(u8 taskId)
|
||||
{
|
||||
u8 toBG2 = GetBattlerSpriteBGPriorityRank(gBattleAnimAttacker) ^ 1 ? 1 : 0;
|
||||
ResetBattleAnimBg(toBG2);
|
||||
|
||||
@@ -733,50 +733,67 @@ void AnimTask_InvertScreenColor(u8 taskId)
|
||||
DestroyAnimVisualTask(taskId);
|
||||
}
|
||||
|
||||
void UnusedAnimTask_8115F94(u8 taskId)
|
||||
// Unused
|
||||
#define tTimer data[0]
|
||||
#define tLength data[1]
|
||||
#define tFlagsScenery data[2]
|
||||
#define tFlagsAttacker data[3]
|
||||
#define tFlagsTarget data[4]
|
||||
#define tColorR data[5]
|
||||
#define tColorG data[6]
|
||||
#define tColorB data[7]
|
||||
void AnimTask_TintPalettes(u8 taskId)
|
||||
{
|
||||
u8 attackerBattler;
|
||||
u8 targetBattler;
|
||||
u8 paletteIndex;
|
||||
u32 selectedPalettes = 0;
|
||||
|
||||
if (gTasks[taskId].data[0] == 0)
|
||||
if (gTasks[taskId].tTimer == 0)
|
||||
{
|
||||
gTasks[taskId].data[2] = gBattleAnimArgs[0];
|
||||
gTasks[taskId].data[3] = gBattleAnimArgs[1];
|
||||
gTasks[taskId].data[4] = gBattleAnimArgs[2];
|
||||
gTasks[taskId].data[1] = gBattleAnimArgs[3];
|
||||
gTasks[taskId].data[5] = gBattleAnimArgs[4];
|
||||
gTasks[taskId].data[6] = gBattleAnimArgs[5];
|
||||
gTasks[taskId].data[7] = gBattleAnimArgs[6];
|
||||
gTasks[taskId].tFlagsScenery = gBattleAnimArgs[0];
|
||||
gTasks[taskId].tFlagsAttacker = gBattleAnimArgs[1];
|
||||
gTasks[taskId].tFlagsTarget = gBattleAnimArgs[2];
|
||||
gTasks[taskId].tLength = gBattleAnimArgs[3];
|
||||
gTasks[taskId].tColorR = gBattleAnimArgs[4];
|
||||
gTasks[taskId].tColorG = gBattleAnimArgs[5];
|
||||
gTasks[taskId].tColorB = gBattleAnimArgs[6];
|
||||
}
|
||||
|
||||
gTasks[taskId].data[0]++;
|
||||
gTasks[taskId].tTimer++;
|
||||
attackerBattler = gBattleAnimAttacker;
|
||||
targetBattler = gBattleAnimTarget;
|
||||
|
||||
if (gTasks[taskId].data[2] & 0x100)
|
||||
selectedPalettes = 0x0000FFFF;
|
||||
if (gTasks[taskId].tFlagsScenery & (1 << 8))
|
||||
selectedPalettes = PALETTES_BG;
|
||||
|
||||
if (gTasks[taskId].data[2] & 0x1)
|
||||
if (gTasks[taskId].tFlagsScenery & 1)
|
||||
{
|
||||
paletteIndex = IndexOfSpritePaletteTag(gSprites[gHealthboxSpriteIds[attackerBattler]].template->paletteTag);
|
||||
selectedPalettes |= (1 << paletteIndex) << 16;
|
||||
}
|
||||
|
||||
if (gTasks[taskId].data[3] & 0x100)
|
||||
if (gTasks[taskId].tFlagsAttacker & (1 << 8))
|
||||
selectedPalettes |= (1 << attackerBattler) << 16;
|
||||
|
||||
if (gTasks[taskId].data[4] & 0x100)
|
||||
if (gTasks[taskId].tFlagsTarget & (1 << 8))
|
||||
selectedPalettes |= (1 << targetBattler) << 16;
|
||||
|
||||
TintPlttBuffer(selectedPalettes, gTasks[taskId].data[5], gTasks[taskId].data[6], gTasks[taskId].data[7]);
|
||||
if (gTasks[taskId].data[0] == gTasks[taskId].data[1])
|
||||
TintPlttBuffer(selectedPalettes, gTasks[taskId].tColorR, gTasks[taskId].tColorG, gTasks[taskId].tColorB);
|
||||
if (gTasks[taskId].tTimer == gTasks[taskId].tLength)
|
||||
{
|
||||
UnfadePlttBuffer(selectedPalettes);
|
||||
DestroyAnimVisualTask(taskId);
|
||||
}
|
||||
}
|
||||
#undef tTimer
|
||||
#undef tLength
|
||||
#undef tFlagsScenery
|
||||
#undef tFlagsAttacker
|
||||
#undef tFlagsTarget
|
||||
#undef tColorR
|
||||
#undef tColorG
|
||||
#undef tColorB
|
||||
|
||||
static void AnimShakeMonOrBattleTerrain(struct Sprite *sprite)
|
||||
{
|
||||
|
||||
@@ -917,7 +917,7 @@ void DrawArenaRefereeTextBox(void)
|
||||
FillBgTilemapBufferRect(0, 0x836, 29, 19, 1, 1, palNum);
|
||||
}
|
||||
|
||||
void RemoveArenaRefereeTextBox(void)
|
||||
void EraseArenaRefereeTextBox(void)
|
||||
{
|
||||
u8 width;
|
||||
u8 height;
|
||||
|
||||
@@ -1213,7 +1213,8 @@ void HideBattlerShadowSprite(u8 battlerId)
|
||||
gSprites[gBattleSpritesDataPtr->healthBoxesData[battlerId].shadowSpriteId].callback = SpriteCB_SetInvisible;
|
||||
}
|
||||
|
||||
void sub_805EF14(void)
|
||||
// Color the background tiles surrounding the action selection and move windows
|
||||
void FillAroundBattleWindows(void)
|
||||
{
|
||||
u16 *vramPtr = (u16*)(VRAM + 0x240);
|
||||
s32 i;
|
||||
|
||||
@@ -961,7 +961,7 @@ static void CB2_HandleStartBattle(void)
|
||||
ShowBg(1);
|
||||
ShowBg(2);
|
||||
ShowBg(3);
|
||||
sub_805EF14();
|
||||
FillAroundBattleWindows();
|
||||
gBattleCommunication[MULTIUSE_STATE] = 1;
|
||||
}
|
||||
if (gWirelessCommType)
|
||||
@@ -1157,7 +1157,7 @@ static void CB2_HandleStartMultiPartnerBattle(void)
|
||||
ShowBg(1);
|
||||
ShowBg(2);
|
||||
ShowBg(3);
|
||||
sub_805EF14();
|
||||
FillAroundBattleWindows();
|
||||
gBattleCommunication[MULTIUSE_STATE] = 1;
|
||||
}
|
||||
if (gWirelessCommType)
|
||||
@@ -1558,7 +1558,7 @@ static void CB2_HandleStartMultiBattle(void)
|
||||
ShowBg(1);
|
||||
ShowBg(2);
|
||||
ShowBg(3);
|
||||
sub_805EF14();
|
||||
FillAroundBattleWindows();
|
||||
gBattleCommunication[MULTIUSE_STATE] = 1;
|
||||
}
|
||||
if (gWirelessCommType)
|
||||
@@ -2150,7 +2150,7 @@ void CB2_InitEndLinkBattle(void)
|
||||
|
||||
SetHBlankCallback(NULL);
|
||||
SetVBlankCallback(NULL);
|
||||
gBattleTypeFlags &= ~(BATTLE_TYPE_LINK_IN_BATTLE);
|
||||
gBattleTypeFlags &= ~BATTLE_TYPE_LINK_IN_BATTLE;
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
|
||||
{
|
||||
@@ -3116,7 +3116,7 @@ void SwitchInClearSetData(void)
|
||||
&& (gStatuses3[i] & STATUS3_ALWAYS_HITS) != 0
|
||||
&& (gDisableStructs[i].battlerWithSureHit == gActiveBattler))
|
||||
{
|
||||
gStatuses3[i] &= ~(STATUS3_ALWAYS_HITS);
|
||||
gStatuses3[i] &= ~STATUS3_ALWAYS_HITS;
|
||||
gStatuses3[i] |= STATUS3_ALWAYS_HITS_TURN(2);
|
||||
}
|
||||
}
|
||||
@@ -3130,9 +3130,9 @@ void SwitchInClearSetData(void)
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
{
|
||||
if (gBattleMons[i].status2 & STATUS2_INFATUATED_WITH(gActiveBattler))
|
||||
gBattleMons[i].status2 &= ~(STATUS2_INFATUATED_WITH(gActiveBattler));
|
||||
gBattleMons[i].status2 &= ~STATUS2_INFATUATED_WITH(gActiveBattler);
|
||||
if ((gBattleMons[i].status2 & STATUS2_WRAPPED) && *(gBattleStruct->wrappedBy + i) == gActiveBattler)
|
||||
gBattleMons[i].status2 &= ~(STATUS2_WRAPPED);
|
||||
gBattleMons[i].status2 &= ~STATUS2_WRAPPED;
|
||||
}
|
||||
|
||||
gActionSelectionCursor[gActiveBattler] = 0;
|
||||
@@ -3212,9 +3212,9 @@ void FaintClearSetData(void)
|
||||
if ((gBattleMons[i].status2 & STATUS2_ESCAPE_PREVENTION) && gDisableStructs[i].battlerPreventingEscape == gActiveBattler)
|
||||
gBattleMons[i].status2 &= ~STATUS2_ESCAPE_PREVENTION;
|
||||
if (gBattleMons[i].status2 & STATUS2_INFATUATED_WITH(gActiveBattler))
|
||||
gBattleMons[i].status2 &= ~(STATUS2_INFATUATED_WITH(gActiveBattler));
|
||||
gBattleMons[i].status2 &= ~STATUS2_INFATUATED_WITH(gActiveBattler);
|
||||
if ((gBattleMons[i].status2 & STATUS2_WRAPPED) && *(gBattleStruct->wrappedBy + i) == gActiveBattler)
|
||||
gBattleMons[i].status2 &= ~(STATUS2_WRAPPED);
|
||||
gBattleMons[i].status2 &= ~STATUS2_WRAPPED;
|
||||
}
|
||||
|
||||
gActionSelectionCursor[gActiveBattler] = 0;
|
||||
@@ -3821,7 +3821,7 @@ static void TryDoEventsBeforeFirstTurn(void)
|
||||
gBattleCommunication[i] = 0;
|
||||
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
gBattleMons[i].status2 &= ~(STATUS2_FLINCHED);
|
||||
gBattleMons[i].status2 &= ~STATUS2_FLINCHED;
|
||||
|
||||
*(&gBattleStruct->turnEffectsTracker) = 0;
|
||||
*(&gBattleStruct->turnEffectsBattlerId) = 0;
|
||||
@@ -3852,7 +3852,7 @@ static void HandleEndTurn_ContinueBattle(void)
|
||||
gBattleCommunication[i] = 0;
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
{
|
||||
gBattleMons[i].status2 &= ~(STATUS2_FLINCHED);
|
||||
gBattleMons[i].status2 &= ~STATUS2_FLINCHED;
|
||||
if ((gBattleMons[i].status1 & STATUS1_SLEEP) && (gBattleMons[i].status2 & STATUS2_MULTIPLETURNS))
|
||||
CancelMultiTurnMoves(i);
|
||||
}
|
||||
@@ -3884,10 +3884,10 @@ void BattleTurnPassed(void)
|
||||
return;
|
||||
|
||||
TurnValuesCleanUp(FALSE);
|
||||
gHitMarker &= ~(HITMARKER_NO_ATTACKSTRING);
|
||||
gHitMarker &= ~(HITMARKER_UNABLE_TO_USE_MOVE);
|
||||
gHitMarker &= ~(HITMARKER_x400000);
|
||||
gHitMarker &= ~(HITMARKER_x100000);
|
||||
gHitMarker &= ~HITMARKER_NO_ATTACKSTRING;
|
||||
gHitMarker &= ~HITMARKER_UNABLE_TO_USE_MOVE;
|
||||
gHitMarker &= ~HITMARKER_PLAYER_FAINTED;
|
||||
gHitMarker &= ~HITMARKER_PASSIVE_DAMAGE;
|
||||
gBattleScripting.animTurn = 0;
|
||||
gBattleScripting.animTargetsHit = 0;
|
||||
gBattleScripting.moveendState = 0;
|
||||
@@ -4795,12 +4795,12 @@ static void TurnValuesCleanUp(bool8 var0)
|
||||
{
|
||||
gDisableStructs[gActiveBattler].rechargeTimer--;
|
||||
if (gDisableStructs[gActiveBattler].rechargeTimer == 0)
|
||||
gBattleMons[gActiveBattler].status2 &= ~(STATUS2_RECHARGE);
|
||||
gBattleMons[gActiveBattler].status2 &= ~STATUS2_RECHARGE;
|
||||
}
|
||||
}
|
||||
|
||||
if (gDisableStructs[gActiveBattler].substituteHP == 0)
|
||||
gBattleMons[gActiveBattler].status2 &= ~(STATUS2_SUBSTITUTE);
|
||||
gBattleMons[gActiveBattler].status2 &= ~STATUS2_SUBSTITUTE;
|
||||
}
|
||||
|
||||
gSideTimers[0].followmeTimer = 0;
|
||||
@@ -4860,15 +4860,15 @@ static void RunTurnActionsFunctions(void)
|
||||
|
||||
if (gCurrentTurnActionNumber >= gBattlersCount) // everyone did their actions, turn finished
|
||||
{
|
||||
gHitMarker &= ~(HITMARKER_x100000);
|
||||
gHitMarker &= ~HITMARKER_PASSIVE_DAMAGE;
|
||||
gBattleMainFunc = sEndTurnFuncsTable[gBattleOutcome & 0x7F];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gBattleStruct->savedTurnActionNumber != gCurrentTurnActionNumber) // action turn has been done, clear hitmarker bits for another battlerId
|
||||
{
|
||||
gHitMarker &= ~(HITMARKER_NO_ATTACKSTRING);
|
||||
gHitMarker &= ~(HITMARKER_UNABLE_TO_USE_MOVE);
|
||||
gHitMarker &= ~HITMARKER_NO_ATTACKSTRING;
|
||||
gHitMarker &= ~HITMARKER_UNABLE_TO_USE_MOVE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4883,7 +4883,7 @@ static void HandleEndTurn_BattleWon(void)
|
||||
gBattleTextBuff1[0] = gBattleOutcome;
|
||||
gBattlerAttacker = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT);
|
||||
gBattlescriptCurrInstr = BattleScript_LinkBattleWonOrLost;
|
||||
gBattleOutcome &= ~(B_OUTCOME_LINK_BATTLE_RAN);
|
||||
gBattleOutcome &= ~B_OUTCOME_LINK_BATTLE_RAN;
|
||||
}
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER
|
||||
&& gBattleTypeFlags & (BATTLE_TYPE_FRONTIER | BATTLE_TYPE_TRAINER_HILL | BATTLE_TYPE_EREADER_TRAINER))
|
||||
@@ -4942,13 +4942,13 @@ static void HandleEndTurn_BattleLost(void)
|
||||
if (gBattleOutcome & B_OUTCOME_LINK_BATTLE_RAN)
|
||||
{
|
||||
gBattlescriptCurrInstr = BattleScript_PrintPlayerForfeitedLinkBattle;
|
||||
gBattleOutcome &= ~(B_OUTCOME_LINK_BATTLE_RAN);
|
||||
gBattleOutcome &= ~B_OUTCOME_LINK_BATTLE_RAN;
|
||||
gSaveBlock2Ptr->frontier.disableRecordBattle = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattlescriptCurrInstr = BattleScript_FrontierLinkBattleLost;
|
||||
gBattleOutcome &= ~(B_OUTCOME_LINK_BATTLE_RAN);
|
||||
gBattleOutcome &= ~B_OUTCOME_LINK_BATTLE_RAN;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -4956,7 +4956,7 @@ static void HandleEndTurn_BattleLost(void)
|
||||
gBattleTextBuff1[0] = gBattleOutcome;
|
||||
gBattlerAttacker = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT);
|
||||
gBattlescriptCurrInstr = BattleScript_LinkBattleWonOrLost;
|
||||
gBattleOutcome &= ~(B_OUTCOME_LINK_BATTLE_RAN);
|
||||
gBattleOutcome &= ~B_OUTCOME_LINK_BATTLE_RAN;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -924,7 +924,7 @@ static void Cmd_attackcanceler(void)
|
||||
return;
|
||||
if (AbilityBattleEffects(ABILITYEFFECT_MOVES_BLOCK, gBattlerTarget, 0, 0, 0))
|
||||
return;
|
||||
if (!gBattleMons[gBattlerAttacker].pp[gCurrMovePos] && gCurrentMove != MOVE_STRUGGLE && !(gHitMarker & (HITMARKER_x800000 | HITMARKER_NO_ATTACKSTRING))
|
||||
if (!gBattleMons[gBattlerAttacker].pp[gCurrMovePos] && gCurrentMove != MOVE_STRUGGLE && !(gHitMarker & (HITMARKER_ALLOW_NO_PP | HITMARKER_NO_ATTACKSTRING))
|
||||
&& !(gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS))
|
||||
{
|
||||
gBattlescriptCurrInstr = BattleScript_NoPPForMove;
|
||||
@@ -932,7 +932,7 @@ static void Cmd_attackcanceler(void)
|
||||
return;
|
||||
}
|
||||
|
||||
gHitMarker &= ~(HITMARKER_x800000);
|
||||
gHitMarker &= ~HITMARKER_ALLOW_NO_PP;
|
||||
|
||||
if (!(gHitMarker & HITMARKER_OBEYS) && !(gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS))
|
||||
{
|
||||
@@ -1237,7 +1237,7 @@ static void Cmd_ppreduce(void)
|
||||
}
|
||||
}
|
||||
|
||||
gHitMarker &= ~(HITMARKER_NO_PPDEDUCT);
|
||||
gHitMarker &= ~HITMARKER_NO_PPDEDUCT;
|
||||
gBattlescriptCurrInstr++;
|
||||
}
|
||||
|
||||
@@ -1869,7 +1869,7 @@ static void Cmd_datahpupdate(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
gHitMarker &= ~(HITMARKER_IGNORE_SUBSTITUTE);
|
||||
gHitMarker &= ~HITMARKER_IGNORE_SUBSTITUTE;
|
||||
if (gBattleMoveDamage < 0) // hp goes up
|
||||
{
|
||||
gBattleMons[gActiveBattler].hp -= gBattleMoveDamage;
|
||||
@@ -1879,9 +1879,9 @@ static void Cmd_datahpupdate(void)
|
||||
}
|
||||
else // hp goes down
|
||||
{
|
||||
if (gHitMarker & HITMARKER_x20)
|
||||
if (gHitMarker & HITMARKER_SKIP_DMG_TRACK)
|
||||
{
|
||||
gHitMarker &= ~(HITMARKER_x20);
|
||||
gHitMarker &= ~HITMARKER_SKIP_DMG_TRACK;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1903,10 +1903,10 @@ static void Cmd_datahpupdate(void)
|
||||
gBattleMons[gActiveBattler].hp = 0;
|
||||
}
|
||||
|
||||
if (!gSpecialStatuses[gActiveBattler].dmg && !(gHitMarker & HITMARKER_x100000))
|
||||
if (!gSpecialStatuses[gActiveBattler].dmg && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE))
|
||||
gSpecialStatuses[gActiveBattler].dmg = gHpDealt;
|
||||
|
||||
if (IS_TYPE_PHYSICAL(moveType) && !(gHitMarker & HITMARKER_x100000) && gCurrentMove != MOVE_PAIN_SPLIT)
|
||||
if (IS_TYPE_PHYSICAL(moveType) && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE) && gCurrentMove != MOVE_PAIN_SPLIT)
|
||||
{
|
||||
gProtectStructs[gActiveBattler].physicalDmg = gHpDealt;
|
||||
gSpecialStatuses[gActiveBattler].physicalDmg = gHpDealt;
|
||||
@@ -1921,7 +1921,7 @@ static void Cmd_datahpupdate(void)
|
||||
gSpecialStatuses[gActiveBattler].physicalBattlerId = gBattlerTarget;
|
||||
}
|
||||
}
|
||||
else if (!IS_TYPE_PHYSICAL(moveType) && !(gHitMarker & HITMARKER_x100000))
|
||||
else if (!IS_TYPE_PHYSICAL(moveType) && !(gHitMarker & HITMARKER_PASSIVE_DAMAGE))
|
||||
{
|
||||
gProtectStructs[gActiveBattler].specialDmg = gHpDealt;
|
||||
gSpecialStatuses[gActiveBattler].specialDmg = gHpDealt;
|
||||
@@ -1937,7 +1937,7 @@ static void Cmd_datahpupdate(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
gHitMarker &= ~(HITMARKER_x100000);
|
||||
gHitMarker &= ~HITMARKER_PASSIVE_DAMAGE;
|
||||
BtlController_EmitSetMonData(0, REQUEST_HP_BATTLE, 0, 2, &gBattleMons[gActiveBattler].hp);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
}
|
||||
@@ -1972,7 +1972,7 @@ static void Cmd_effectivenesssound(void)
|
||||
gActiveBattler = gBattlerTarget;
|
||||
if (!(gMoveResultFlags & MOVE_RESULT_MISSED))
|
||||
{
|
||||
switch (gMoveResultFlags & (u8)(~(MOVE_RESULT_MISSED)))
|
||||
switch (gMoveResultFlags & (u8)(~MOVE_RESULT_MISSED))
|
||||
{
|
||||
case MOVE_RESULT_SUPER_EFFECTIVE:
|
||||
BtlController_EmitPlaySE(0, SE_SUPER_EFFECTIVE);
|
||||
@@ -2026,7 +2026,7 @@ static void Cmd_resultmessage(void)
|
||||
else
|
||||
{
|
||||
gBattleCommunication[MSG_DISPLAY] = 1;
|
||||
switch (gMoveResultFlags & (u8)(~(MOVE_RESULT_MISSED)))
|
||||
switch (gMoveResultFlags & (u8)(~MOVE_RESULT_MISSED))
|
||||
{
|
||||
case MOVE_RESULT_SUPER_EFFECTIVE:
|
||||
stringId = STRINGID_SUPEREFFECTIVE;
|
||||
@@ -2060,9 +2060,9 @@ static void Cmd_resultmessage(void)
|
||||
}
|
||||
else if (gMoveResultFlags & MOVE_RESULT_ONE_HIT_KO)
|
||||
{
|
||||
gMoveResultFlags &= ~(MOVE_RESULT_ONE_HIT_KO);
|
||||
gMoveResultFlags &= ~(MOVE_RESULT_SUPER_EFFECTIVE);
|
||||
gMoveResultFlags &= ~(MOVE_RESULT_NOT_VERY_EFFECTIVE);
|
||||
gMoveResultFlags &= ~MOVE_RESULT_ONE_HIT_KO;
|
||||
gMoveResultFlags &= ~MOVE_RESULT_SUPER_EFFECTIVE;
|
||||
gMoveResultFlags &= ~MOVE_RESULT_NOT_VERY_EFFECTIVE;
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_OneHitKOMsg;
|
||||
return;
|
||||
@@ -2206,7 +2206,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
if (gBattleCommunication[MOVE_EFFECT_BYTE] & MOVE_EFFECT_AFFECTS_USER)
|
||||
{
|
||||
gEffectBattler = gBattlerAttacker; // battlerId that effects get applied on
|
||||
gBattleCommunication[MOVE_EFFECT_BYTE] &= ~(MOVE_EFFECT_AFFECTS_USER);
|
||||
gBattleCommunication[MOVE_EFFECT_BYTE] &= ~MOVE_EFFECT_AFFECTS_USER;
|
||||
affectsUser = MOVE_EFFECT_AFFECTS_USER;
|
||||
gBattleScripting.battler = gBattlerTarget; // theoretically the attacker
|
||||
}
|
||||
@@ -2273,7 +2273,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
|
||||
{
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
|
||||
gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD);
|
||||
gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2314,7 +2314,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
|
||||
{
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
|
||||
gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD);
|
||||
gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2370,7 +2370,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
|
||||
{
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
|
||||
gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD);
|
||||
gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2398,7 +2398,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
|
||||
{
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_ABILITY_PREVENTS_ABILITY_STATUS;
|
||||
gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD);
|
||||
gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2424,8 +2424,8 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
break;
|
||||
|
||||
// It's redundant, because at this point we know the status1 value is 0.
|
||||
gBattleMons[gEffectBattler].status1 &= ~(STATUS1_TOXIC_POISON);
|
||||
gBattleMons[gEffectBattler].status1 &= ~(STATUS1_POISON);
|
||||
gBattleMons[gEffectBattler].status1 &= ~STATUS1_TOXIC_POISON;
|
||||
gBattleMons[gEffectBattler].status1 &= ~STATUS1_POISON;
|
||||
statusChanged = TRUE;
|
||||
break;
|
||||
}
|
||||
@@ -2453,7 +2453,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
if (gHitMarker & HITMARKER_IGNORE_SAFEGUARD)
|
||||
{
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUSED_BY_ABILITY;
|
||||
gHitMarker &= ~(HITMARKER_IGNORE_SAFEGUARD);
|
||||
gHitMarker &= ~HITMARKER_IGNORE_SAFEGUARD;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2790,7 +2790,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
||||
}
|
||||
else
|
||||
{
|
||||
gBattleMons[gBattlerTarget].status1 &= ~(STATUS1_PARALYSIS);
|
||||
gBattleMons[gBattlerTarget].status1 &= ~STATUS1_PARALYSIS;
|
||||
|
||||
gActiveBattler = gBattlerTarget;
|
||||
BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1);
|
||||
@@ -2881,7 +2881,7 @@ static void Cmd_seteffectwithchance(void)
|
||||
if (gBattleCommunication[MOVE_EFFECT_BYTE] & MOVE_EFFECT_CERTAIN
|
||||
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT))
|
||||
{
|
||||
gBattleCommunication[MOVE_EFFECT_BYTE] &= ~(MOVE_EFFECT_CERTAIN);
|
||||
gBattleCommunication[MOVE_EFFECT_BYTE] &= ~MOVE_EFFECT_CERTAIN;
|
||||
SetMoveEffect(FALSE, MOVE_EFFECT_CERTAIN);
|
||||
}
|
||||
else if (Random() % 100 < percentChance
|
||||
@@ -2939,7 +2939,7 @@ static void Cmd_tryfaintmon(void)
|
||||
|
||||
BattleScriptPop();
|
||||
gBattlescriptCurrInstr = BS_ptr;
|
||||
gSideStatuses[GetBattlerSide(gActiveBattler)] &= ~(SIDE_STATUS_SPIKES_DAMAGED);
|
||||
gSideStatuses[GetBattlerSide(gActiveBattler)] &= ~SIDE_STATUS_SPIKES_DAMAGED;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2970,7 +2970,7 @@ static void Cmd_tryfaintmon(void)
|
||||
gBattlescriptCurrInstr = BS_ptr;
|
||||
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER)
|
||||
{
|
||||
gHitMarker |= HITMARKER_x400000;
|
||||
gHitMarker |= HITMARKER_PLAYER_FAINTED;
|
||||
if (gBattleResults.playerFaintCounter < 0xFF)
|
||||
gBattleResults.playerFaintCounter++;
|
||||
AdjustFriendshipOnBattleFaint(gActiveBattler);
|
||||
@@ -2983,7 +2983,7 @@ static void Cmd_tryfaintmon(void)
|
||||
}
|
||||
if ((gHitMarker & HITMARKER_DESTINYBOND) && gBattleMons[gBattlerAttacker].hp != 0)
|
||||
{
|
||||
gHitMarker &= ~(HITMARKER_DESTINYBOND);
|
||||
gHitMarker &= ~HITMARKER_DESTINYBOND;
|
||||
BattleScriptPush(gBattlescriptCurrInstr);
|
||||
gBattleMoveDamage = gBattleMons[battlerId].hp;
|
||||
gBattlescriptCurrInstr = BattleScript_DestinyBondTakesLife;
|
||||
@@ -3581,8 +3581,8 @@ static void MoveValuesCleanUp(void)
|
||||
gCritMultiplier = 1;
|
||||
gBattleCommunication[MOVE_EFFECT_BYTE] = 0;
|
||||
gBattleCommunication[MISS_TYPE] = 0;
|
||||
gHitMarker &= ~(HITMARKER_DESTINYBOND);
|
||||
gHitMarker &= ~(HITMARKER_SYNCHRONISE_EFFECT);
|
||||
gHitMarker &= ~HITMARKER_DESTINYBOND;
|
||||
gHitMarker &= ~HITMARKER_SYNCHRONISE_EFFECT;
|
||||
}
|
||||
|
||||
static void Cmd_movevaluescleanup(void)
|
||||
@@ -4217,7 +4217,7 @@ static void Cmd_moveend(void)
|
||||
&& gSpecialStatuses[gBattlerTarget].specialDmg
|
||||
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && moveType == TYPE_FIRE)
|
||||
{
|
||||
gBattleMons[gBattlerTarget].status1 &= ~(STATUS1_FREEZE);
|
||||
gBattleMons[gBattlerTarget].status1 &= ~STATUS1_FREEZE;
|
||||
gActiveBattler = gBattlerTarget;
|
||||
BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gBattlerTarget].status1);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
@@ -4313,7 +4313,7 @@ static void Cmd_moveend(void)
|
||||
gActiveBattler = gBattlerAttacker;
|
||||
BtlController_EmitSpriteInvisibility(0, FALSE);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
gStatuses3[gBattlerAttacker] &= ~(STATUS3_SEMI_INVULNERABLE);
|
||||
gStatuses3[gBattlerAttacker] &= ~STATUS3_SEMI_INVULNERABLE;
|
||||
gSpecialStatuses[gBattlerAttacker].restoredBattlerSprite = 1;
|
||||
gBattleScripting.moveendState++;
|
||||
return;
|
||||
@@ -4327,7 +4327,7 @@ static void Cmd_moveend(void)
|
||||
gActiveBattler = gBattlerTarget;
|
||||
BtlController_EmitSpriteInvisibility(0, FALSE);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
gStatuses3[gBattlerTarget] &= ~(STATUS3_SEMI_INVULNERABLE);
|
||||
gStatuses3[gBattlerTarget] &= ~STATUS3_SEMI_INVULNERABLE;
|
||||
gBattleScripting.moveendState++;
|
||||
return;
|
||||
}
|
||||
@@ -4337,7 +4337,7 @@ static void Cmd_moveend(void)
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
{
|
||||
if (gDisableStructs[i].substituteHP == 0)
|
||||
gBattleMons[i].status2 &= ~(STATUS2_SUBSTITUTE);
|
||||
gBattleMons[i].status2 &= ~STATUS2_SUBSTITUTE;
|
||||
}
|
||||
gBattleScripting.moveendState++;
|
||||
break;
|
||||
@@ -4347,7 +4347,7 @@ static void Cmd_moveend(void)
|
||||
gActiveBattler = gBattlerAttacker;
|
||||
gBattlerAttacker = gBattlerTarget;
|
||||
gBattlerTarget = gActiveBattler;
|
||||
gHitMarker &= ~(HITMARKER_SWAP_ATTACKER_TARGET);
|
||||
gHitMarker &= ~HITMARKER_SWAP_ATTACKER_TARGET;
|
||||
}
|
||||
if (gHitMarker & HITMARKER_ATTACKSTRING_PRINTED)
|
||||
{
|
||||
@@ -4657,7 +4657,7 @@ static void Cmd_jumpifcantswitch(void)
|
||||
s32 lastMonId;
|
||||
struct Pokemon *party;
|
||||
|
||||
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1] & ~(SWITCH_IGNORE_ESCAPE_PREVENTION));
|
||||
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1] & ~SWITCH_IGNORE_ESCAPE_PREVENTION);
|
||||
|
||||
if (!(gBattlescriptCurrInstr[1] & SWITCH_IGNORE_ESCAPE_PREVENTION)
|
||||
&& ((gBattleMons[gActiveBattler].status2 & (STATUS2_WRAPPED | STATUS2_ESCAPE_PREVENTION))
|
||||
@@ -4837,7 +4837,7 @@ static void Cmd_openpartyscreen(void)
|
||||
if (HasNoMonsToSwitch(gActiveBattler, PARTY_SIZE, PARTY_SIZE))
|
||||
{
|
||||
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
|
||||
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
|
||||
gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler);
|
||||
BtlController_EmitLinkStandbyMsg(0, 2, FALSE);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
}
|
||||
@@ -4866,7 +4866,7 @@ static void Cmd_openpartyscreen(void)
|
||||
if (HasNoMonsToSwitch(0, PARTY_SIZE, PARTY_SIZE))
|
||||
{
|
||||
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
|
||||
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
|
||||
gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler);
|
||||
BtlController_EmitCantSwitch(0);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
}
|
||||
@@ -4888,7 +4888,7 @@ static void Cmd_openpartyscreen(void)
|
||||
if (HasNoMonsToSwitch(2, PARTY_SIZE, PARTY_SIZE))
|
||||
{
|
||||
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
|
||||
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
|
||||
gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler);
|
||||
BtlController_EmitCantSwitch(0);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
}
|
||||
@@ -4909,7 +4909,7 @@ static void Cmd_openpartyscreen(void)
|
||||
if (HasNoMonsToSwitch(1, PARTY_SIZE, PARTY_SIZE))
|
||||
{
|
||||
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
|
||||
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
|
||||
gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler);
|
||||
BtlController_EmitCantSwitch(0);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
}
|
||||
@@ -4931,7 +4931,7 @@ static void Cmd_openpartyscreen(void)
|
||||
if (HasNoMonsToSwitch(3, PARTY_SIZE, PARTY_SIZE))
|
||||
{
|
||||
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
|
||||
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
|
||||
gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler);
|
||||
BtlController_EmitCantSwitch(0);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
}
|
||||
@@ -4994,7 +4994,7 @@ static void Cmd_openpartyscreen(void)
|
||||
if (HasNoMonsToSwitch(2, gBattleBufferB[0][1], PARTY_SIZE))
|
||||
{
|
||||
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
|
||||
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
|
||||
gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler);
|
||||
BtlController_EmitCantSwitch(0);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
}
|
||||
@@ -5010,7 +5010,7 @@ static void Cmd_openpartyscreen(void)
|
||||
if (HasNoMonsToSwitch(3, gBattleBufferB[1][1], PARTY_SIZE))
|
||||
{
|
||||
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
|
||||
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
|
||||
gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler);
|
||||
BtlController_EmitCantSwitch(0);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
}
|
||||
@@ -5049,7 +5049,7 @@ static void Cmd_openpartyscreen(void)
|
||||
else
|
||||
hitmarkerFaintBits = PARTY_ACTION_SEND_OUT;
|
||||
|
||||
battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1] & ~(PARTY_SCREEN_OPTIONAL));
|
||||
battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1] & ~PARTY_SCREEN_OPTIONAL);
|
||||
if (gSpecialStatuses[battlerId].flag40)
|
||||
{
|
||||
gBattlescriptCurrInstr += 6;
|
||||
@@ -5058,7 +5058,7 @@ static void Cmd_openpartyscreen(void)
|
||||
{
|
||||
gActiveBattler = battlerId;
|
||||
gAbsentBattlerFlags |= gBitTable[gActiveBattler];
|
||||
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
|
||||
gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler);
|
||||
gBattlescriptCurrInstr = jumpPtr;
|
||||
}
|
||||
else
|
||||
@@ -5174,7 +5174,7 @@ static void Cmd_switchineffects(void)
|
||||
gActiveBattler = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||
UpdateSentPokesToOpponentValue(gActiveBattler);
|
||||
|
||||
gHitMarker &= ~(HITMARKER_FAINTED(gActiveBattler));
|
||||
gHitMarker &= ~HITMARKER_FAINTED(gActiveBattler);
|
||||
gSpecialStatuses[gActiveBattler].flag40 = 0;
|
||||
|
||||
if (!(gSideStatuses[GetBattlerSide(gActiveBattler)] & SIDE_STATUS_SPIKES_DAMAGED)
|
||||
@@ -5186,8 +5186,8 @@ static void Cmd_switchineffects(void)
|
||||
|
||||
gSideStatuses[GetBattlerSide(gActiveBattler)] |= SIDE_STATUS_SPIKES_DAMAGED;
|
||||
|
||||
gBattleMons[gActiveBattler].status2 &= ~(STATUS2_DESTINY_BOND);
|
||||
gHitMarker &= ~(HITMARKER_DESTINYBOND);
|
||||
gBattleMons[gActiveBattler].status2 &= ~STATUS2_DESTINY_BOND;
|
||||
gHitMarker &= ~HITMARKER_DESTINYBOND;
|
||||
|
||||
spikesDmg = (5 - gSideTimers[GetBattlerSide(gActiveBattler)].spikesAmount) * 2;
|
||||
gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / (spikesDmg);
|
||||
@@ -5216,7 +5216,7 @@ static void Cmd_switchineffects(void)
|
||||
if (!AbilityBattleEffects(ABILITYEFFECT_ON_SWITCHIN, gActiveBattler, 0, 0, 0)
|
||||
&& !ItemBattleEffects(ITEMEFFECT_ON_SWITCH_IN, gActiveBattler, FALSE))
|
||||
{
|
||||
gSideStatuses[GetBattlerSide(gActiveBattler)] &= ~(SIDE_STATUS_SPIKES_DAMAGED);
|
||||
gSideStatuses[GetBattlerSide(gActiveBattler)] &= ~SIDE_STATUS_SPIKES_DAMAGED;
|
||||
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
{
|
||||
@@ -5632,7 +5632,7 @@ static void Cmd_swapattackerwithtarget(void)
|
||||
gBattlerTarget = gActiveBattler;
|
||||
|
||||
if (gHitMarker & HITMARKER_SWAP_ATTACKER_TARGET)
|
||||
gHitMarker &= ~(HITMARKER_SWAP_ATTACKER_TARGET);
|
||||
gHitMarker &= ~HITMARKER_SWAP_ATTACKER_TARGET;
|
||||
else
|
||||
gHitMarker |= HITMARKER_SWAP_ATTACKER_TARGET;
|
||||
|
||||
@@ -6315,13 +6315,13 @@ static void Cmd_various(void)
|
||||
*choicedMove = 0;
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
case VARIOUS_RESET_PLAYER_FAINTED:
|
||||
if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_DOUBLE))
|
||||
&& gBattleTypeFlags & BATTLE_TYPE_TRAINER
|
||||
&& gBattleMons[0].hp != 0
|
||||
&& gBattleMons[1].hp != 0)
|
||||
{
|
||||
gHitMarker &= ~(HITMARKER_x400000);
|
||||
gHitMarker &= ~HITMARKER_PLAYER_FAINTED;
|
||||
}
|
||||
break;
|
||||
case VARIOUS_PALACE_FLAVOR_TEXT:
|
||||
@@ -6355,7 +6355,7 @@ static void Cmd_various(void)
|
||||
case VARIOUS_ARENA_PLAYER_MON_LOST:
|
||||
gBattleMons[0].hp = 0;
|
||||
gHitMarker |= HITMARKER_FAINTED(0);
|
||||
gHitMarker |= HITMARKER_x400000;
|
||||
gHitMarker |= HITMARKER_PLAYER_FAINTED;
|
||||
gBattleStruct->arenaLostPlayerMons |= gBitTable[gBattlerPartyIndexes[0]];
|
||||
gDisableStructs[0].truantSwitchInHack = 1;
|
||||
break;
|
||||
@@ -6364,7 +6364,7 @@ static void Cmd_various(void)
|
||||
gBattleMons[1].hp = 0;
|
||||
gHitMarker |= HITMARKER_FAINTED(0);
|
||||
gHitMarker |= HITMARKER_FAINTED(1);
|
||||
gHitMarker |= HITMARKER_x400000;
|
||||
gHitMarker |= HITMARKER_PLAYER_FAINTED;
|
||||
gBattleStruct->arenaLostPlayerMons |= gBitTable[gBattlerPartyIndexes[0]];
|
||||
gBattleStruct->arenaLostOpponentMons |= gBitTable[gBattlerPartyIndexes[1]];
|
||||
gDisableStructs[0].truantSwitchInHack = 1;
|
||||
@@ -6374,11 +6374,11 @@ static void Cmd_various(void)
|
||||
BtlController_EmitYesNoBox(0);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
break;
|
||||
case 14:
|
||||
case VARIOUS_DRAW_ARENA_REF_TEXT_BOX:
|
||||
DrawArenaRefereeTextBox();
|
||||
break;
|
||||
case 15:
|
||||
RemoveArenaRefereeTextBox();
|
||||
case VARIOUS_ERASE_ARENA_REF_TEXT_BOX:
|
||||
EraseArenaRefereeTextBox();
|
||||
break;
|
||||
case VARIOUS_ARENA_JUDGMENT_STRING:
|
||||
BattleStringExpandPlaceholdersToDisplayedString(gRefereeStringsTable[gBattlescriptCurrInstr[1]]);
|
||||
@@ -6420,8 +6420,8 @@ static void Cmd_various(void)
|
||||
case VARIOUS_SET_ALREADY_STATUS_MOVE_ATTEMPT:
|
||||
gBattleStruct->alreadyStatusedMoveAttempt |= gBitTable[gActiveBattler];
|
||||
break;
|
||||
case 24:
|
||||
if (sub_805725C(gActiveBattler))
|
||||
case VARIOUS_PALACE_TRY_ESCAPE_STATUS:
|
||||
if (BattlePalace_TryEscapeStatus(gActiveBattler))
|
||||
return;
|
||||
break;
|
||||
case VARIOUS_SET_TELEPORT_OUTCOME:
|
||||
@@ -6595,14 +6595,14 @@ static void Cmd_trymirrormove(void)
|
||||
|
||||
if (move != 0 && move != 0xFFFF)
|
||||
{
|
||||
gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED);
|
||||
gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED;
|
||||
gCurrentMove = move;
|
||||
gBattlerTarget = GetMoveTarget(gCurrentMove, 0);
|
||||
gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect];
|
||||
}
|
||||
else if (validMovesCount)
|
||||
{
|
||||
gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED);
|
||||
gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED;
|
||||
i = Random() % validMovesCount;
|
||||
gCurrentMove = movesArray[i];
|
||||
gBattlerTarget = GetMoveTarget(gCurrentMove, 0);
|
||||
@@ -6882,15 +6882,15 @@ static u8 ChangeStatBuffs(s8 statValue, u8 statId, u8 flags, const u8 *BS_ptr)
|
||||
else
|
||||
gActiveBattler = gBattlerTarget;
|
||||
|
||||
flags &= ~(MOVE_EFFECT_AFFECTS_USER);
|
||||
flags &= ~MOVE_EFFECT_AFFECTS_USER;
|
||||
|
||||
if (flags & MOVE_EFFECT_CERTAIN)
|
||||
certain++;
|
||||
flags &= ~(MOVE_EFFECT_CERTAIN);
|
||||
flags &= ~MOVE_EFFECT_CERTAIN;
|
||||
|
||||
if (flags & STAT_BUFF_NOT_PROTECT_AFFECTED)
|
||||
notProtectAffected++;
|
||||
flags &= ~(STAT_BUFF_NOT_PROTECT_AFFECTED);
|
||||
flags &= ~STAT_BUFF_NOT_PROTECT_AFFECTED;
|
||||
|
||||
PREPARE_STAT_BUFFER(gBattleTextBuff1, statId)
|
||||
|
||||
@@ -7719,7 +7719,7 @@ static void Cmd_setsubstitute(void)
|
||||
gBattleMoveDamage = 1;
|
||||
|
||||
gBattleMons[gBattlerAttacker].status2 |= STATUS2_SUBSTITUTE;
|
||||
gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_WRAPPED);
|
||||
gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_WRAPPED;
|
||||
gDisableStructs[gBattlerAttacker].substituteHP = gBattleMoveDamage;
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SET_SUBSTITUTE;
|
||||
gHitMarker |= HITMARKER_IGNORE_SUBSTITUTE;
|
||||
@@ -7803,7 +7803,7 @@ static void Cmd_metronome(void)
|
||||
|
||||
if (sMovesForbiddenToCopy[i] == METRONOME_FORBIDDEN_END)
|
||||
{
|
||||
gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED);
|
||||
gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED;
|
||||
gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect];
|
||||
gBattlerTarget = GetMoveTarget(gCurrentMove, 0);
|
||||
return;
|
||||
@@ -8019,7 +8019,7 @@ static void Cmd_settypetorandomresistance(void) // conversion 2
|
||||
|
||||
static void Cmd_setalwayshitflag(void)
|
||||
{
|
||||
gStatuses3[gBattlerTarget] &= ~(STATUS3_ALWAYS_HITS);
|
||||
gStatuses3[gBattlerTarget] &= ~STATUS3_ALWAYS_HITS;
|
||||
gStatuses3[gBattlerTarget] |= STATUS3_ALWAYS_HITS_TURN(2);
|
||||
gDisableStructs[gBattlerTarget].battlerWithSureHit = gBattlerAttacker;
|
||||
gBattlescriptCurrInstr++;
|
||||
@@ -8137,7 +8137,7 @@ static void Cmd_trychoosesleeptalkmove(void)
|
||||
|
||||
}
|
||||
|
||||
unusableMovesBits = CheckMoveLimitations(gBattlerAttacker, unusableMovesBits, ~(MOVE_LIMITATION_PP));
|
||||
unusableMovesBits = CheckMoveLimitations(gBattlerAttacker, unusableMovesBits, ~MOVE_LIMITATION_PP);
|
||||
if (unusableMovesBits == 0xF) // all 4 moves cannot be chosen
|
||||
{
|
||||
gBattlescriptCurrInstr += 5;
|
||||
@@ -8153,7 +8153,7 @@ static void Cmd_trychoosesleeptalkmove(void)
|
||||
|
||||
gCalledMove = gBattleMons[gBattlerAttacker].moves[movePosition];
|
||||
gCurrMovePos = movePosition;
|
||||
gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED);
|
||||
gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED;
|
||||
gBattlerTarget = GetMoveTarget(gCalledMove, 0);
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
}
|
||||
@@ -8269,7 +8269,7 @@ static void Cmd_healpartystatus(void)
|
||||
if (gBattleMons[gBattlerAttacker].ability != ABILITY_SOUNDPROOF)
|
||||
{
|
||||
gBattleMons[gBattlerAttacker].status1 = 0;
|
||||
gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_NIGHTMARE);
|
||||
gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_NIGHTMARE;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -8285,7 +8285,7 @@ static void Cmd_healpartystatus(void)
|
||||
if (gBattleMons[gActiveBattler].ability != ABILITY_SOUNDPROOF)
|
||||
{
|
||||
gBattleMons[gActiveBattler].status1 = 0;
|
||||
gBattleMons[gActiveBattler].status2 &= ~(STATUS2_NIGHTMARE);
|
||||
gBattleMons[gActiveBattler].status2 &= ~STATUS2_NIGHTMARE;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -8325,14 +8325,14 @@ static void Cmd_healpartystatus(void)
|
||||
toHeal = 0x3F;
|
||||
|
||||
gBattleMons[gBattlerAttacker].status1 = 0;
|
||||
gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_NIGHTMARE);
|
||||
gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_NIGHTMARE;
|
||||
|
||||
gActiveBattler = GetBattlerAtPosition(GetBattlerPosition(gBattlerAttacker) ^ BIT_FLANK);
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE
|
||||
&& !(gAbsentBattlerFlags & gBitTable[gActiveBattler]))
|
||||
{
|
||||
gBattleMons[gActiveBattler].status1 = 0;
|
||||
gBattleMons[gActiveBattler].status2 &= ~(STATUS2_NIGHTMARE);
|
||||
gBattleMons[gActiveBattler].status2 &= ~STATUS2_NIGHTMARE;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8435,7 +8435,7 @@ static void Cmd_rolloutdamagecalculation(void)
|
||||
}
|
||||
if (--gDisableStructs[gBattlerAttacker].rolloutTimer == 0) // last hit
|
||||
{
|
||||
gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_MULTIPLETURNS);
|
||||
gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_MULTIPLETURNS;
|
||||
}
|
||||
|
||||
gDynamicBasePower = gBattleMoves[gCurrentMove].power;
|
||||
@@ -8515,7 +8515,7 @@ static void Cmd_presentdamagecalculation(void)
|
||||
gBattlescriptCurrInstr = BattleScript_AlreadyAtFullHp;
|
||||
else
|
||||
{
|
||||
gMoveResultFlags &= ~(MOVE_RESULT_DOESNT_AFFECT_FOE);
|
||||
gMoveResultFlags &= ~MOVE_RESULT_DOESNT_AFFECT_FOE;
|
||||
gBattlescriptCurrInstr = BattleScript_PresentHealTarget;
|
||||
}
|
||||
}
|
||||
@@ -8628,7 +8628,7 @@ static void Cmd_jumpifnopursuitswitchdmg(void)
|
||||
gCurrMovePos = gChosenMovePos = *(gBattleStruct->chosenMovePositions + gBattlerTarget);
|
||||
gBattlescriptCurrInstr += 5;
|
||||
gBattleScripting.animTurn = 1;
|
||||
gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED);
|
||||
gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -8693,7 +8693,7 @@ static void Cmd_rapidspinfree(void)
|
||||
if (gBattleMons[gBattlerAttacker].status2 & STATUS2_WRAPPED)
|
||||
{
|
||||
gBattleScripting.battler = gBattlerTarget;
|
||||
gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_WRAPPED);
|
||||
gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_WRAPPED;
|
||||
gBattlerTarget = *(gBattleStruct->wrappedBy + gBattlerAttacker);
|
||||
|
||||
gBattleTextBuff1[0] = B_BUFF_PLACEHOLDER_BEGIN;
|
||||
@@ -8707,14 +8707,14 @@ static void Cmd_rapidspinfree(void)
|
||||
}
|
||||
else if (gStatuses3[gBattlerAttacker] & STATUS3_LEECHSEED)
|
||||
{
|
||||
gStatuses3[gBattlerAttacker] &= ~(STATUS3_LEECHSEED);
|
||||
gStatuses3[gBattlerAttacker] &= ~(STATUS3_LEECHSEED_BATTLER);
|
||||
gStatuses3[gBattlerAttacker] &= ~STATUS3_LEECHSEED;
|
||||
gStatuses3[gBattlerAttacker] &= ~STATUS3_LEECHSEED_BATTLER;
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_LeechSeedFree;
|
||||
}
|
||||
else if (gSideStatuses[GetBattlerSide(gBattlerAttacker)] & SIDE_STATUS_SPIKES)
|
||||
{
|
||||
gSideStatuses[GetBattlerSide(gBattlerAttacker)] &= ~(SIDE_STATUS_SPIKES);
|
||||
gSideStatuses[GetBattlerSide(gBattlerAttacker)] &= ~SIDE_STATUS_SPIKES;
|
||||
gSideTimers[GetBattlerSide(gBattlerAttacker)].spikesAmount = 0;
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_SpikesFree;
|
||||
@@ -8970,7 +8970,7 @@ static void Cmd_setcharge(void)
|
||||
|
||||
static void Cmd_callterrainattack(void) // nature power
|
||||
{
|
||||
gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED);
|
||||
gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED;
|
||||
gCurrentMove = sNaturePowerMoves[gBattleTerrain];
|
||||
gBattlerTarget = GetMoveTarget(gCurrentMove, 0);
|
||||
BattleScriptPush(gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]);
|
||||
@@ -9380,7 +9380,7 @@ static void Cmd_assistattackselect(void)
|
||||
}
|
||||
if (chooseableMovesNo)
|
||||
{
|
||||
gHitMarker &= ~(HITMARKER_ATTACKSTRING_PRINTED);
|
||||
gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED;
|
||||
gCalledMove = movesArray[((Random() & 0xFF) * chooseableMovesNo) >> 8];
|
||||
gBattlerTarget = GetMoveTarget(gCalledMove, 0);
|
||||
gBattlescriptCurrInstr += 5;
|
||||
@@ -9736,8 +9736,8 @@ static void Cmd_removelightscreenreflect(void) // brick break
|
||||
|
||||
if (gSideTimers[opposingSide].reflectTimer || gSideTimers[opposingSide].lightscreenTimer)
|
||||
{
|
||||
gSideStatuses[opposingSide] &= ~(SIDE_STATUS_REFLECT);
|
||||
gSideStatuses[opposingSide] &= ~(SIDE_STATUS_LIGHTSCREEN);
|
||||
gSideStatuses[opposingSide] &= ~SIDE_STATUS_REFLECT;
|
||||
gSideStatuses[opposingSide] &= ~SIDE_STATUS_LIGHTSCREEN;
|
||||
gSideTimers[opposingSide].reflectTimer = 0;
|
||||
gSideTimers[opposingSide].lightscreenTimer = 0;
|
||||
gBattleScripting.animTurn = 1;
|
||||
|
||||
@@ -646,9 +646,9 @@ void HandleAction_NothingIsFainted(void)
|
||||
gCurrentActionFuncId = gActionsByTurnOrder[gCurrentTurnActionNumber];
|
||||
gHitMarker &= ~(HITMARKER_DESTINYBOND | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_ATTACKSTRING_PRINTED
|
||||
| HITMARKER_NO_PPDEDUCT | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_IGNORE_ON_AIR
|
||||
| HITMARKER_IGNORE_UNDERGROUND | HITMARKER_IGNORE_UNDERWATER | HITMARKER_x100000
|
||||
| HITMARKER_OBEYS | HITMARKER_x10 | HITMARKER_SYNCHRONISE_EFFECT
|
||||
| HITMARKER_CHARGING | HITMARKER_x4000000);
|
||||
| HITMARKER_IGNORE_UNDERGROUND | HITMARKER_IGNORE_UNDERWATER | HITMARKER_PASSIVE_DAMAGE
|
||||
| HITMARKER_OBEYS | HITMARKER_WAKE_UP_CLEAR | HITMARKER_SYNCHRONISE_EFFECT
|
||||
| HITMARKER_CHARGING | HITMARKER_NEVER_SET);
|
||||
}
|
||||
|
||||
void HandleAction_ActionFinished(void)
|
||||
@@ -659,9 +659,9 @@ void HandleAction_ActionFinished(void)
|
||||
SpecialStatusesClear();
|
||||
gHitMarker &= ~(HITMARKER_DESTINYBOND | HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_ATTACKSTRING_PRINTED
|
||||
| HITMARKER_NO_PPDEDUCT | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_IGNORE_ON_AIR
|
||||
| HITMARKER_IGNORE_UNDERGROUND | HITMARKER_IGNORE_UNDERWATER | HITMARKER_x100000
|
||||
| HITMARKER_OBEYS | HITMARKER_x10 | HITMARKER_SYNCHRONISE_EFFECT
|
||||
| HITMARKER_CHARGING | HITMARKER_x4000000);
|
||||
| HITMARKER_IGNORE_UNDERGROUND | HITMARKER_IGNORE_UNDERWATER | HITMARKER_PASSIVE_DAMAGE
|
||||
| HITMARKER_OBEYS | HITMARKER_WAKE_UP_CLEAR | HITMARKER_SYNCHRONISE_EFFECT
|
||||
| HITMARKER_CHARGING | HITMARKER_NEVER_SET);
|
||||
|
||||
gCurrentMove = 0;
|
||||
gBattleMoveDamage = 0;
|
||||
@@ -1443,7 +1443,7 @@ u8 DoBattlerEndTurnEffects(void)
|
||||
{
|
||||
u8 effect = 0;
|
||||
|
||||
gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_x20);
|
||||
gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK);
|
||||
while (gBattleStruct->turnEffectsBattlerId < gBattlersCount && gBattleStruct->turnEffectsTracker <= ENDTURN_BATTLER_COUNT)
|
||||
{
|
||||
gActiveBattler = gBattlerAttacker = gBattlerByTurnOrder[gBattleStruct->turnEffectsBattlerId];
|
||||
@@ -1756,13 +1756,13 @@ u8 DoBattlerEndTurnEffects(void)
|
||||
return effect;
|
||||
}
|
||||
}
|
||||
gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_x20);
|
||||
gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK);
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool8 HandleWishPerishSongOnTurnEnd(void)
|
||||
{
|
||||
gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_x20);
|
||||
gHitMarker |= (HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK);
|
||||
|
||||
switch (gBattleStruct->wishPerishSongState)
|
||||
{
|
||||
@@ -1862,7 +1862,7 @@ bool8 HandleWishPerishSongOnTurnEnd(void)
|
||||
break;
|
||||
}
|
||||
|
||||
gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_x20);
|
||||
gHitMarker &= ~(HITMARKER_GRUDGE | HITMARKER_SKIP_DMG_TRACK);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -4067,7 +4067,7 @@ u8 IsMonDisobedient(void)
|
||||
gCalledMove = gBattleMons[gBattlerAttacker].moves[gCurrMovePos];
|
||||
gBattlescriptCurrInstr = BattleScript_IgnoresAndUsesRandomMove;
|
||||
gBattlerTarget = GetMoveTarget(gCalledMove, 0);
|
||||
gHitMarker |= HITMARKER_x200000;
|
||||
gHitMarker |= HITMARKER_DISOBEDIENT_MOVE;
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,9 @@ void SwitchPartyOrderInGameMulti(u8 battlerId, u8 arg1)
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_805725C(u8 battlerId)
|
||||
// Called when a Pokémon is unable to attack during a Battle Palace battle.
|
||||
// Check if it was because they are frozen/asleep, and if so try to cure the status.
|
||||
u32 BattlePalace_TryEscapeStatus(u8 battlerId)
|
||||
{
|
||||
u32 effect = 0;
|
||||
|
||||
@@ -134,6 +136,7 @@ u32 sub_805725C(u8 battlerId)
|
||||
{
|
||||
if (UproarWakeUpCheck(battlerId))
|
||||
{
|
||||
// Wake up from Uproar
|
||||
gBattleMons[battlerId].status1 &= ~(STATUS1_SLEEP);
|
||||
gBattleMons[battlerId].status2 &= ~(STATUS2_NIGHTMARE);
|
||||
BattleScriptPushCursor();
|
||||
@@ -150,6 +153,7 @@ u32 sub_805725C(u8 battlerId)
|
||||
else
|
||||
toSub = 1;
|
||||
|
||||
// Reduce number of sleep turns
|
||||
if ((gBattleMons[battlerId].status1 & STATUS1_SLEEP) < toSub)
|
||||
gBattleMons[battlerId].status1 &= ~(STATUS1_SLEEP);
|
||||
else
|
||||
@@ -157,11 +161,13 @@ u32 sub_805725C(u8 battlerId)
|
||||
|
||||
if (gBattleMons[battlerId].status1 & STATUS1_SLEEP)
|
||||
{
|
||||
// Still asleep
|
||||
gBattlescriptCurrInstr = BattleScript_MoveUsedIsAsleep;
|
||||
effect = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Wake up
|
||||
gBattleMons[battlerId].status2 &= ~(STATUS2_NIGHTMARE);
|
||||
BattleScriptPushCursor();
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_WOKE_UP;
|
||||
@@ -177,10 +183,12 @@ u32 sub_805725C(u8 battlerId)
|
||||
{
|
||||
if (Random() % 5 != 0)
|
||||
{
|
||||
// Still frozen
|
||||
gBattlescriptCurrInstr = BattleScript_MoveUsedIsFrozen;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Unfreeze
|
||||
gBattleMons[battlerId].status1 &= ~(STATUS1_FREEZE);
|
||||
BattleScriptPushCursor();
|
||||
gBattlescriptCurrInstr = BattleScript_MoveUsedUnfroze;
|
||||
@@ -193,7 +201,7 @@ u32 sub_805725C(u8 battlerId)
|
||||
case 2:
|
||||
break;
|
||||
}
|
||||
|
||||
// Loop until reaching the final state, or stop early if Pokémon was Asleep/Frozen
|
||||
} while (gBattleCommunication[MULTIUSE_STATE] != 2 && effect == 0);
|
||||
|
||||
if (effect == 2)
|
||||
|
||||
@@ -75,7 +75,7 @@ static void Task_FinishRoundOfAppeals(u8);
|
||||
static void Task_ReadyUpdateHeartSliders(u8);
|
||||
static void Task_UpdateHeartSliders(u8);
|
||||
static void Task_WaitForHeartSliders(u8);
|
||||
static void sub_80DA348(u8);
|
||||
static void Task_RestorePlttBufferUnfaded(u8);
|
||||
static void Task_WaitPrintRoundResult(u8);
|
||||
static void Task_PrintRoundResultText(u8);
|
||||
static void Task_ReUpdateHeartSliders(u8);
|
||||
@@ -2553,10 +2553,10 @@ static void Task_UpdateHeartSliders(u8 taskId)
|
||||
static void Task_WaitForHeartSliders(u8 taskId)
|
||||
{
|
||||
if (SlidersDoneUpdating())
|
||||
gTasks[taskId].func = sub_80DA348;
|
||||
gTasks[taskId].func = Task_RestorePlttBufferUnfaded;
|
||||
}
|
||||
|
||||
static void sub_80DA348(u8 taskId)
|
||||
static void Task_RestorePlttBufferUnfaded(u8 taskId)
|
||||
{
|
||||
DmaCopy32Defvars(3, eContestTempSave.cachedPlttBufferUnfaded, gPlttBufferUnfaded, PLTT_BUFFER_SIZE * 2);
|
||||
gTasks[taskId].data[0] = 0;
|
||||
|
||||
@@ -978,7 +978,7 @@ static void Task_HofPC_PrintMonInfo(u8 taskId)
|
||||
|
||||
currMonID = gTasks[taskId].tMonSpriteId(gTasks[taskId].tCurrMonId);
|
||||
gSprites[currMonID].oam.priority = 0;
|
||||
sHofFadePalettes = (0x10000 << gSprites[currMonID].oam.paletteNum) ^ 0xFFFF0000;
|
||||
sHofFadePalettes = (0x10000 << gSprites[currMonID].oam.paletteNum) ^ PALETTES_OBJECTS;
|
||||
BlendPalettesUnfaded(sHofFadePalettes, 0xC, RGB(16, 29, 24));
|
||||
|
||||
currMon = &savedTeams->mon[gTasks[taskId].tCurrMonId];
|
||||
|
||||
@@ -562,23 +562,31 @@ void UpdateItemMenuSwapLinePos(u8 y)
|
||||
UpdateSwapLineSpritesPos(&gBagMenu->spriteIds[ITEMMENUSPRITE_SWAP_LINE], ITEMMENU_SWAP_LINE_LENGTH | SWAP_LINE_HAS_MARGIN, 120, (y + 1) * 16);
|
||||
}
|
||||
|
||||
static void sub_80D5018(void *mem0, void *mem1)
|
||||
static void ArrangeBerryGfx(void *src, void *dest)
|
||||
{
|
||||
u8 i, j;
|
||||
|
||||
memset(mem1, 0, 0x800);
|
||||
mem1 += 0x100;
|
||||
memset(dest, 0, 0x800);
|
||||
|
||||
// Create top margin
|
||||
dest += 0x100;
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
mem1 += 0x20;
|
||||
// Create left margin
|
||||
dest += 0x20;
|
||||
|
||||
// Copy one row of berry's icon
|
||||
for (j = 0; j < 6; j++)
|
||||
{
|
||||
memcpy(mem1, mem0, 0x20);
|
||||
mem1 += 0x20;
|
||||
mem0 += 0x20;
|
||||
memcpy(dest, src, 0x20);
|
||||
dest += 0x20;
|
||||
src += 0x20;
|
||||
}
|
||||
|
||||
// Create right margin
|
||||
if (i != 5)
|
||||
mem1 += 0x20;
|
||||
dest += 0x20;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -595,7 +603,7 @@ static void LoadBerryGfx(u8 berryId)
|
||||
pal.tag = TAG_BERRY_PIC_PAL;
|
||||
LoadCompressedSpritePalette(&pal);
|
||||
LZDecompressWram(sBerryPicTable[berryId].tiles, &gDecompressionBuffer[0x1000]);
|
||||
sub_80D5018(&gDecompressionBuffer[0x1000], &gDecompressionBuffer[0]);
|
||||
ArrangeBerryGfx(&gDecompressionBuffer[0x1000], &gDecompressionBuffer[0]);
|
||||
}
|
||||
|
||||
u8 CreateBerryTagSprite(u8 id, s16 x, s16 y)
|
||||
|
||||
@@ -57,7 +57,7 @@ const IntrFunc gIntrTableTemplate[] =
|
||||
|
||||
#define INTR_COUNT ((int)(sizeof(gIntrTableTemplate)/sizeof(IntrFunc)))
|
||||
|
||||
static u16 gUnknown_03000000;
|
||||
static u16 sUnusedVar; // Never read
|
||||
|
||||
u16 gKeyRepeatStartDelay;
|
||||
bool8 gLinkTransferringData;
|
||||
@@ -117,7 +117,7 @@ void AgbMain()
|
||||
SetMainCallback2(NULL);
|
||||
|
||||
gLinkTransferringData = FALSE;
|
||||
gUnknown_03000000 = 0xFC0;
|
||||
sUnusedVar = 0xFC0;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
|
||||
// Static RAM declarations
|
||||
|
||||
static EWRAM_DATA u8 gUnknown_02022D04 = 0;
|
||||
static EWRAM_DATA bool8 sStartedPokeBallTask = 0;
|
||||
static EWRAM_DATA u16 sCurrItemAndOptionMenuCheck = 0;
|
||||
|
||||
static u8 sBirchSpeechMainTaskId;
|
||||
@@ -201,7 +201,7 @@ static void NewGameBirchSpeech_ShowDialogueWindow(u8, u8);
|
||||
static void NewGameBirchSpeech_ClearWindow(u8);
|
||||
static void Task_NewGameBirchSpeech_ThisIsAPokemon(u8);
|
||||
static void Task_NewGameBirchSpeech_MainSpeech(u8);
|
||||
static void NewGameBirchSpeech_ShowPokeBallPrinterCallback(struct TextPrinterTemplate *printer, u16 a);
|
||||
static void NewGameBirchSpeech_WaitForThisIsPokemonText(struct TextPrinterTemplate *printer, u16 a);
|
||||
static void Task_NewGameBirchSpeech_AndYouAre(u8);
|
||||
static void Task_NewGameBirchSpeechSub_WaitForLotad(u8);
|
||||
static void Task_NewGameBirchSpeech_StartBirchLotadPlatformFade(u8);
|
||||
@@ -1348,7 +1348,7 @@ static void Task_NewGameBirchSpeech_ThisIsAPokemon(u8 taskId)
|
||||
{
|
||||
gTasks[taskId].func = Task_NewGameBirchSpeech_MainSpeech;
|
||||
StringExpandPlaceholders(gStringVar4, gText_ThisIsAPokemon);
|
||||
AddTextPrinterWithCallbackForMessage(1, NewGameBirchSpeech_ShowPokeBallPrinterCallback);
|
||||
AddTextPrinterWithCallbackForMessage(1, NewGameBirchSpeech_WaitForThisIsPokemonText);
|
||||
sBirchSpeechMainTaskId = taskId;
|
||||
}
|
||||
}
|
||||
@@ -1411,7 +1411,7 @@ static void Task_NewGameBirchSpeech_AndYouAre(u8 taskId)
|
||||
{
|
||||
if (!RunTextPrintersAndIsPrinter0Active())
|
||||
{
|
||||
gUnknown_02022D04 = 0;
|
||||
sStartedPokeBallTask = FALSE;
|
||||
StringExpandPlaceholders(gStringVar4, gText_Birch_AndYouAre);
|
||||
AddTextPrinterForMessage(1);
|
||||
gTasks[taskId].func = Task_NewGameBirchSpeech_StartBirchLotadPlatformFade;
|
||||
@@ -2250,21 +2250,21 @@ static void NewGameBirchSpeech_ClearWindow(u8 windowId)
|
||||
CopyWindowToVram(windowId, 2);
|
||||
}
|
||||
|
||||
static void NewGameBirchSpeech_ShowPokeBallPrinterCallback(struct TextPrinterTemplate *printer, u16 a)
|
||||
static void NewGameBirchSpeech_WaitForThisIsPokemonText(struct TextPrinterTemplate *printer, u16 a)
|
||||
{
|
||||
if (*(printer->currentChar - 2) == 8 && gUnknown_02022D04 == 0)
|
||||
// Wait for Birch's "This is a Pokémon" text to reach the pause
|
||||
// Then start the PokéBall release (if it hasn't been started already)
|
||||
if (*(printer->currentChar - 2) == EXT_CTRL_CODE_PAUSE && !sStartedPokeBallTask)
|
||||
{
|
||||
gUnknown_02022D04 = 1;
|
||||
sStartedPokeBallTask = TRUE;
|
||||
CreateTask(Task_NewGameBirchSpeechSub_InitPokeBall, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void CreateYesNoMenuParameterized(u8 a, u8 b, u16 c, u16 d, u8 e, u8 f)
|
||||
void CreateYesNoMenuParameterized(u8 x, u8 y, u16 baseTileNum, u16 baseBlock, u8 yesNoPalNum, u8 winPalNum)
|
||||
{
|
||||
struct WindowTemplate sp;
|
||||
|
||||
sp = CreateWindowTemplate(0, a + 1, b + 1, 5, 4, f, d);
|
||||
CreateYesNoMenu(&sp, c, e, 0);
|
||||
struct WindowTemplate template = CreateWindowTemplate(0, x + 1, y + 1, 5, 4, winPalNum, baseBlock);
|
||||
CreateYesNoMenu(&template, baseTileNum, yesNoPalNum, 0);
|
||||
}
|
||||
|
||||
static void NewGameBirchSpeech_ShowDialogueWindow(u8 windowId, u8 copyToVram)
|
||||
|
||||
@@ -1769,9 +1769,7 @@ void ResetTempTileDataBuffers(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < (int)ARRAY_COUNT(sTempTileDataBuffer); i++)
|
||||
{
|
||||
sTempTileDataBuffer[i] = NULL;
|
||||
}
|
||||
sTempTileDataBufferIdx = 0;
|
||||
}
|
||||
|
||||
@@ -1784,9 +1782,7 @@ bool8 FreeTempTileDataBuffersIfPossible(void)
|
||||
if (sTempTileDataBufferIdx)
|
||||
{
|
||||
for (i = 0; i < sTempTileDataBufferIdx; i++)
|
||||
{
|
||||
FREE_AND_SET_NULL(sTempTileDataBuffer[i]);
|
||||
}
|
||||
sTempTileDataBufferIdx = 0;
|
||||
}
|
||||
return FALSE;
|
||||
|
||||
@@ -17,7 +17,7 @@ static const u32 sPokedexAreaMapAffine_Tilemap[] = INCBIN_U32("graphics/interfac
|
||||
void LoadPokedexAreaMapGfx(const struct PokedexAreaMapTemplate *template)
|
||||
{
|
||||
u8 mode;
|
||||
sPokedexAreaMapBgNum = Alloc(4);
|
||||
sPokedexAreaMapBgNum = Alloc(sizeof(sPokedexAreaMapBgNum));
|
||||
mode = template->mode;
|
||||
|
||||
if (mode == 0)
|
||||
@@ -28,8 +28,9 @@ void LoadPokedexAreaMapGfx(const struct PokedexAreaMapTemplate *template)
|
||||
}
|
||||
else
|
||||
{
|
||||
// This is never reached, only a mode of 0 is given
|
||||
SetBgAttribute(template->bg, BG_ATTR_METRIC, 2);
|
||||
SetBgAttribute(template->bg, BG_ATTR_TYPE, 1);
|
||||
SetBgAttribute(template->bg, BG_ATTR_TYPE, BG_TYPE_AFFINE); // This does nothing. BG_ATTR_TYPE can't be set with this function
|
||||
DecompressAndCopyTileDataToVram(template->bg, sPokedexAreaMapAffine_Gfx, 0, template->offset, 0);
|
||||
sub_8199D3C(DecompressAndCopyTileDataToVram(template->bg, sPokedexAreaMapAffine_Tilemap, 0, 0, 1), template->offset, 64, 64, TRUE);
|
||||
}
|
||||
@@ -41,7 +42,7 @@ void LoadPokedexAreaMapGfx(const struct PokedexAreaMapTemplate *template)
|
||||
*sPokedexAreaMapBgNum = template->bg;
|
||||
}
|
||||
|
||||
bool32 sub_81C4E90(void)
|
||||
bool32 TryShowPokedexAreaMap(void)
|
||||
{
|
||||
if (!FreeTempTileDataBuffersIfPossible())
|
||||
{
|
||||
@@ -56,8 +57,7 @@ bool32 sub_81C4E90(void)
|
||||
|
||||
void FreePokedexAreaMapBgNum(void)
|
||||
{
|
||||
if (sPokedexAreaMapBgNum != NULL)
|
||||
FREE_AND_SET_NULL(sPokedexAreaMapBgNum);
|
||||
TRY_FREE_AND_SET_NULL(sPokedexAreaMapBgNum);
|
||||
}
|
||||
|
||||
void PokedexAreaMapChangeBgY(u32 a0)
|
||||
|
||||
@@ -86,7 +86,7 @@ static void CreateAreaMarkerSprites(void);
|
||||
static void LoadAreaUnknownGraphics(void);
|
||||
static void CreateAreaUnknownSprites(void);
|
||||
static void Task_HandlePokedexAreaScreenInput(u8);
|
||||
static void sub_813D6B4(void);
|
||||
static void ResetPokedexAreaMapBg(void);
|
||||
static void DestroyAreaMarkerSprites(void);
|
||||
|
||||
static const u32 sAreaGlow_Pal[] = INCBIN_U32("graphics/pokedex/area_glow.gbapal");
|
||||
@@ -665,7 +665,7 @@ static void Task_ShowPokedexAreaScreen(u8 taskId)
|
||||
StringFill(sPokedexAreaScreen->charBuffer, CHAR_SPACE, 16);
|
||||
break;
|
||||
case 2:
|
||||
if (sub_81C4E90() == TRUE)
|
||||
if (TryShowPokedexAreaMap() == TRUE)
|
||||
return;
|
||||
PokedexAreaMapChangeBgY(-8);
|
||||
break;
|
||||
@@ -697,7 +697,7 @@ static void Task_ShowPokedexAreaScreen(u8 taskId)
|
||||
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_BG0 | BLDCNT_TGT2_ALL);
|
||||
StartAreaGlow();
|
||||
ShowBg(2);
|
||||
ShowBg(3);
|
||||
ShowBg(3); // TryShowPokedexAreaMap will have done this already
|
||||
SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON);
|
||||
break;
|
||||
case 11:
|
||||
@@ -743,7 +743,7 @@ static void Task_HandlePokedexAreaScreenInput(u8 taskId)
|
||||
return;
|
||||
DestroyAreaMarkerSprites();
|
||||
sPokedexAreaScreen->screenSwitchState[0] = gTasks[taskId].data[1];
|
||||
sub_813D6B4();
|
||||
ResetPokedexAreaMapBg();
|
||||
DestroyTask(taskId);
|
||||
FreePokedexAreaMapBgNum();
|
||||
FREE_AND_SET_NULL(sPokedexAreaScreen);
|
||||
@@ -753,7 +753,7 @@ static void Task_HandlePokedexAreaScreenInput(u8 taskId)
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
|
||||
static void sub_813D6B4(void)
|
||||
static void ResetPokedexAreaMapBg(void)
|
||||
{
|
||||
SetBgAttribute(3, BG_ATTR_CHARBASEINDEX, 0);
|
||||
SetBgAttribute(3, BG_ATTR_PALETTEMODE, 0);
|
||||
|
||||
@@ -9822,13 +9822,13 @@ struct
|
||||
u16 height;
|
||||
} static const sTilemapDimensions[][4] =
|
||||
{
|
||||
{
|
||||
[BG_TYPE_NORMAL] = {
|
||||
{ 256, 256},
|
||||
{ 512, 256},
|
||||
{ 256, 512},
|
||||
{ 512, 512},
|
||||
},
|
||||
{
|
||||
[BG_TYPE_AFFINE] = {
|
||||
{ 128, 128},
|
||||
{ 256, 256},
|
||||
{ 512, 512},
|
||||
@@ -9853,7 +9853,7 @@ static void TilemapUtil_SetMap(u8 id, u8 bg, const void *tilemap, u16 width, u16
|
||||
bgType = GetBgAttribute(bg, BG_ATTR_TYPE);
|
||||
sTilemapUtil[id].altWidth = sTilemapDimensions[bgType][bgScreenSize].width;
|
||||
sTilemapUtil[id].altHeight = sTilemapDimensions[bgType][bgScreenSize].height;
|
||||
if (bgType != 0)
|
||||
if (bgType != BG_TYPE_NORMAL)
|
||||
sTilemapUtil[id].tileSize = 1;
|
||||
else
|
||||
sTilemapUtil[id].tileSize = 2;
|
||||
|
||||
@@ -162,7 +162,7 @@ static void CB2_ReshowBattleScreenAfterMenu(void)
|
||||
BeginHardwarePaletteFade(0xFF, 0, 0x10, 0, 1);
|
||||
gPaletteFade.bufferTransferDisabled = 0;
|
||||
SetMainCallback2(BattleMainCB2);
|
||||
sub_805EF14();
|
||||
FillAroundBattleWindows();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user