Merge branch 'master' into flatten_sprite_pos
This commit is contained in:
@@ -263,7 +263,10 @@ static const BattleAICmdFunc sBattleAICmdTable[] =
|
||||
Cmd_if_holds_item, // 0x62
|
||||
};
|
||||
|
||||
static const u16 sDiscouragedPowerfulMoveEffects[] =
|
||||
// For the purposes of determining the most powerful move in a moveset, these
|
||||
// moves are treated the same as having a power of 0 or 1
|
||||
#define IGNORED_MOVES_END 0xFFFF
|
||||
static const u16 sIgnoredPowerfulMoveEffects[] =
|
||||
{
|
||||
EFFECT_EXPLOSION,
|
||||
EFFECT_DREAM_EATER,
|
||||
@@ -277,7 +280,7 @@ static const u16 sDiscouragedPowerfulMoveEffects[] =
|
||||
EFFECT_SUPERPOWER,
|
||||
EFFECT_ERUPTION,
|
||||
EFFECT_OVERHEAT,
|
||||
0xFFFF
|
||||
IGNORED_MOVES_END
|
||||
};
|
||||
|
||||
// code
|
||||
@@ -1177,14 +1180,14 @@ static void Cmd_get_how_powerful_move_is(void)
|
||||
s32 i, checkedMove;
|
||||
s32 moveDmgs[MAX_MON_MOVES];
|
||||
|
||||
for (i = 0; sDiscouragedPowerfulMoveEffects[i] != 0xFFFF; i++)
|
||||
for (i = 0; sIgnoredPowerfulMoveEffects[i] != IGNORED_MOVES_END; i++)
|
||||
{
|
||||
if (gBattleMoves[AI_THINKING_STRUCT->moveConsidered].effect == sDiscouragedPowerfulMoveEffects[i])
|
||||
if (gBattleMoves[AI_THINKING_STRUCT->moveConsidered].effect == sIgnoredPowerfulMoveEffects[i])
|
||||
break;
|
||||
}
|
||||
|
||||
if (gBattleMoves[AI_THINKING_STRUCT->moveConsidered].power > 1
|
||||
&& sDiscouragedPowerfulMoveEffects[i] == 0xFFFF)
|
||||
&& sIgnoredPowerfulMoveEffects[i] == IGNORED_MOVES_END)
|
||||
{
|
||||
gDynamicBasePower = 0;
|
||||
*(&gBattleStruct->dynamicMoveType) = 0;
|
||||
@@ -1192,16 +1195,18 @@ static void Cmd_get_how_powerful_move_is(void)
|
||||
gMoveResultFlags = 0;
|
||||
gCritMultiplier = 1;
|
||||
|
||||
// Considered move has power and is not in sIgnoredPowerfulMoveEffects
|
||||
// Check all other moves and calculate their power
|
||||
for (checkedMove = 0; checkedMove < MAX_MON_MOVES; checkedMove++)
|
||||
{
|
||||
for (i = 0; sDiscouragedPowerfulMoveEffects[i] != 0xFFFF; i++)
|
||||
for (i = 0; sIgnoredPowerfulMoveEffects[i] != IGNORED_MOVES_END; i++)
|
||||
{
|
||||
if (gBattleMoves[gBattleMons[sBattler_AI].moves[checkedMove]].effect == sDiscouragedPowerfulMoveEffects[i])
|
||||
if (gBattleMoves[gBattleMons[sBattler_AI].moves[checkedMove]].effect == sIgnoredPowerfulMoveEffects[i])
|
||||
break;
|
||||
}
|
||||
|
||||
if (gBattleMons[sBattler_AI].moves[checkedMove] != MOVE_NONE
|
||||
&& sDiscouragedPowerfulMoveEffects[i] == 0xFFFF
|
||||
&& sIgnoredPowerfulMoveEffects[i] == IGNORED_MOVES_END
|
||||
&& gBattleMoves[gBattleMons[sBattler_AI].moves[checkedMove]].power > 1)
|
||||
{
|
||||
gCurrentMove = gBattleMons[sBattler_AI].moves[checkedMove];
|
||||
@@ -1217,6 +1222,7 @@ static void Cmd_get_how_powerful_move_is(void)
|
||||
}
|
||||
}
|
||||
|
||||
// Is the considered move the most powerful move available?
|
||||
for (checkedMove = 0; checkedMove < MAX_MON_MOVES; checkedMove++)
|
||||
{
|
||||
if (moveDmgs[checkedMove] > moveDmgs[AI_THINKING_STRUCT->movesetIndex])
|
||||
@@ -1224,13 +1230,14 @@ static void Cmd_get_how_powerful_move_is(void)
|
||||
}
|
||||
|
||||
if (checkedMove == MAX_MON_MOVES)
|
||||
AI_THINKING_STRUCT->funcResult = MOVE_MOST_POWERFUL; // Is the most powerful.
|
||||
AI_THINKING_STRUCT->funcResult = MOVE_MOST_POWERFUL;
|
||||
else
|
||||
AI_THINKING_STRUCT->funcResult = MOVE_NOT_MOST_POWERFUL; // Not the most powerful.
|
||||
AI_THINKING_STRUCT->funcResult = MOVE_NOT_MOST_POWERFUL;
|
||||
}
|
||||
else
|
||||
{
|
||||
AI_THINKING_STRUCT->funcResult = MOVE_POWER_DISCOURAGED; // Highly discouraged in terms of power.
|
||||
// Move has a power of 0/1, or is in the group sIgnoredPowerfulMoveEffects
|
||||
AI_THINKING_STRUCT->funcResult = MOVE_POWER_OTHER;
|
||||
}
|
||||
|
||||
gAIScriptPtr++;
|
||||
|
||||
+4
-4
@@ -1211,8 +1211,8 @@ static const u8 gUnknown_0860D1A0[DOME_TOURNAMENT_TRAINERS_COUNT / 2][DOME_ROUND
|
||||
|
||||
static const u8 gUnknown_0860D1C0[DOME_TOURNAMENT_TRAINERS_COUNT] = {0, 15, 8, 7, 3, 12, 11, 4, 1, 14, 9, 6, 2, 13, 10, 5};
|
||||
|
||||
// Each tourney trainer has a text describing their potential to win, depending on their seed ranking for the current tourney
|
||||
// Dome Ace Tucker has their own separate potential text
|
||||
// The first line of text on a trainers info card. It describes their potential to win, based on their seed in the tournament tree.
|
||||
// Dome Ace Tucker has their own separate potential text.
|
||||
static const u8 *const sBattleDomePotentialTexts[DOME_TOURNAMENT_TRAINERS_COUNT + 1] =
|
||||
{
|
||||
BattleDome_Text_Potential1, // Highest potential
|
||||
@@ -1234,7 +1234,7 @@ static const u8 *const sBattleDomePotentialTexts[DOME_TOURNAMENT_TRAINERS_COUNT
|
||||
BattleDome_Text_PotentialDomeAceTucker,
|
||||
};
|
||||
|
||||
// The first line of text on a trainers info card that gives information about their battle style (dependent on their party's moves)
|
||||
// The second line of text on a trainers info card. It gives information about their battle style (dependent on their party's moves).
|
||||
static const u8 *const sBattleDomeOpponentStyleTexts[NUM_BATTLE_STYLES] =
|
||||
{
|
||||
[DOME_BATTLE_STYLE_RISKY] = BattleDome_Text_StyleRiskDisaster,
|
||||
@@ -1271,7 +1271,7 @@ static const u8 *const sBattleDomeOpponentStyleTexts[NUM_BATTLE_STYLES] =
|
||||
[DOME_BATTLE_STYLE_UNUSED4] = BattleDome_Text_StyleSampleMessage4,
|
||||
};
|
||||
|
||||
// The second line of text on a trainers info card that gives information about their party's stat spread
|
||||
// The third line of text on a trainers info card. It that gives information about their party's stat spread (based on their Pokémon's effort values and Nature).
|
||||
static const u8 *const sBattleDomeOpponentStatsTexts[] =
|
||||
{
|
||||
BattleDome_Text_EmphasizesHPAndAtk, // DOME_TEXT_TWO_GOOD_STATS and DOME_TEXT_HP start here
|
||||
|
||||
@@ -106,7 +106,7 @@ static void BagAction_Give(u8);
|
||||
static void BagAction_Cancel(u8);
|
||||
static void BagAction_UseInBattle(u8);
|
||||
static void BagCursorMoved(s32, bool8, struct ListMenu *);
|
||||
static void PrintItemQuantity(u8, s32, u8);
|
||||
static void PrintItemQuantity(u8 windowId, u32 itemId, u8 y);
|
||||
static void TossItem(u8);
|
||||
static void DontTossItem(u8);
|
||||
|
||||
@@ -651,7 +651,7 @@ static void BagCursorMoved(s32 itemIndex, bool8 onInit, struct ListMenu *list)
|
||||
}
|
||||
}
|
||||
|
||||
static void PrintItemQuantity(u8 windowId, s32 itemIndex, u8 y)
|
||||
static void PrintItemQuantity(u8 windowId, u32 itemIndex, u8 y)
|
||||
{
|
||||
s32 xAlign;
|
||||
if (itemIndex == LIST_CANCEL)
|
||||
|
||||
+2
-2
@@ -1246,7 +1246,7 @@ static void AddMovePoints(u8 caseId, u16 arg1, u8 arg2, u8 arg3)
|
||||
break;
|
||||
case PTS_REFLECT:
|
||||
// If hit Reflect with damaging physical move
|
||||
if (type < TYPE_MYSTERY && power != 0 && tvPtr->side[defSide].reflectMonId != 0)
|
||||
if (IS_TYPE_PHYSICAL(type) && power != 0 && tvPtr->side[defSide].reflectMonId != 0)
|
||||
{
|
||||
u32 id = (tvPtr->side[defSide].reflectMonId - 1) * 4;
|
||||
movePoints->points[defSide][id + tvPtr->side[defSide].reflectMoveSlot] += sPointsArray[caseId][0];
|
||||
@@ -1254,7 +1254,7 @@ static void AddMovePoints(u8 caseId, u16 arg1, u8 arg2, u8 arg3)
|
||||
break;
|
||||
case PTS_LIGHT_SCREEN:
|
||||
// If hit Light Screen with damaging special move
|
||||
if (type >= TYPE_MYSTERY && power != 0 && tvPtr->side[defSide].lightScreenMonId != 0)
|
||||
if (!IS_TYPE_PHYSICAL(type) && power != 0 && tvPtr->side[defSide].lightScreenMonId != 0)
|
||||
{
|
||||
u32 id = (tvPtr->side[defSide].lightScreenMonId - 1) * 4;
|
||||
movePoints->points[defSide][id + tvPtr->side[defSide].lightScreenMoveSlot] += sPointsArray[caseId][0];
|
||||
|
||||
+2
-2
@@ -29,7 +29,7 @@ extern const struct Evolution gEvolutionTable[][EVOS_PER_MON];
|
||||
static void ClearDaycareMonMail(struct DaycareMail *mail);
|
||||
static void SetInitialEggData(struct Pokemon *mon, u16 species, struct DayCare *daycare);
|
||||
static u8 GetDaycareCompatibilityScore(struct DayCare *daycare);
|
||||
static void DaycarePrintMonInfo(u8 windowId, s32 daycareSlotId, u8 y);
|
||||
static void DaycarePrintMonInfo(u8 windowId, u32 daycareSlotId, u8 y);
|
||||
|
||||
// RAM buffers used to assist with BuildEggMoveset()
|
||||
EWRAM_DATA static u16 sHatchedEggLevelUpMoves[EGG_LVL_UP_MOVES_ARRAY_COUNT] = {0};
|
||||
@@ -1226,7 +1226,7 @@ static void DaycarePrintMonLvl(struct DayCare *daycare, u8 windowId, u32 daycare
|
||||
DaycareAddTextPrinter(windowId, lvlText, x, y);
|
||||
}
|
||||
|
||||
static void DaycarePrintMonInfo(u8 windowId, s32 daycareSlotId, u8 y)
|
||||
static void DaycarePrintMonInfo(u8 windowId, u32 daycareSlotId, u8 y)
|
||||
{
|
||||
if (daycareSlotId < (unsigned) DAYCARE_MON_COUNT)
|
||||
{
|
||||
|
||||
+3
-3
@@ -147,7 +147,7 @@ static void ReturnToActionsMenuFromCategories(u8 taskId);
|
||||
static void ExitTraderDecorationMenu(u8 taskId);
|
||||
static void CopyDecorationMenuItemName(u8 *dest, u16 decoration);
|
||||
static void DecorationItemsMenu_OnCursorMove(s32 itemIndex, bool8 flag, struct ListMenu *menu);
|
||||
static void DecorationItemsMenu_PrintDecorationInUse(u8 windowId, s32 itemIndex, u8 y);
|
||||
static void DecorationItemsMenu_PrintDecorationInUse(u8 windowId, u32 itemIndex, u8 y);
|
||||
static void ShowDecorationItemsWindow(u8 taskId);
|
||||
static void HandleDecorationItemsMenuInput(u8 taskId);
|
||||
static void PrintDecorationItemDescription(s32 itemIndex);
|
||||
@@ -912,9 +912,9 @@ static void DecorationItemsMenu_OnCursorMove(s32 itemIndex, bool8 flag, struct L
|
||||
PrintDecorationItemDescription(itemIndex);
|
||||
}
|
||||
|
||||
static void DecorationItemsMenu_PrintDecorationInUse(u8 windowId, s32 itemIndex, u8 y)
|
||||
static void DecorationItemsMenu_PrintDecorationInUse(u8 windowId, u32 itemIndex, u8 y)
|
||||
{
|
||||
if (itemIndex != -2)
|
||||
if (itemIndex != LIST_CANCEL)
|
||||
{
|
||||
if (IsDecorationIndexInSecretBase(itemIndex + 1) == TRUE)
|
||||
BlitMenuInfoIcon(windowId, MENU_INFO_ICON_BALL_RED, 92, y + 2);
|
||||
|
||||
@@ -40,7 +40,7 @@ bool8 IsFreezePlayerFinished(void)
|
||||
}
|
||||
|
||||
|
||||
void ScriptFreezeObjectEvents(void)
|
||||
void FreezeObjects_WaitForPlayer(void)
|
||||
{
|
||||
FreezeObjectEvents();
|
||||
CreateTask(Task_FreezePlayer, 80);
|
||||
@@ -82,7 +82,9 @@ bool8 IsFreezeSelectedObjectAndPlayerFinished(void)
|
||||
}
|
||||
}
|
||||
|
||||
void LockSelectedObjectEvent(void)
|
||||
// Freeze all objects immediately except the selected object and the player.
|
||||
// The selected object and player are frozen once their movement is finished.
|
||||
void FreezeObjects_WaitForPlayerAndSelected(void)
|
||||
{
|
||||
u8 taskId;
|
||||
FreezeObjectEventsExceptOne(gSelectedObjectEvent);
|
||||
@@ -144,6 +146,8 @@ static void Task_FreezeObjectAndPlayer(u8 taskId)
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
|
||||
// Freeze all objects immediately except the player and the approaching trainers.
|
||||
// The approaching trainers and player are frozen once their movement is finished
|
||||
void FreezeForApproachingTrainers(void)
|
||||
{
|
||||
u8 trainerObjectId1, trainerObjectId2, taskId;
|
||||
|
||||
@@ -38,7 +38,7 @@ static const s16 sFarawayIslandRockCoords[4][2] =
|
||||
static u8 GetMewObjectEventId(void)
|
||||
{
|
||||
u8 objectEventId;
|
||||
TryGetObjectEventIdByLocalIdAndMap(1, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &objectEventId);
|
||||
TryGetObjectEventIdByLocalIdAndMap(LOCALID_FARAWAY_ISLAND_MEW, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &objectEventId);
|
||||
return objectEventId;
|
||||
}
|
||||
|
||||
|
||||
+15
-15
@@ -72,12 +72,12 @@ void Task_Truck1(u8 taskId)
|
||||
s16 cameraXpan = 0, cameraYpan = 0;
|
||||
s16 box1, box2, box3;
|
||||
|
||||
box1 = GetTruckBoxMovement(data[0] + 30) * 4; // top box.
|
||||
SetObjectEventSpritePosByLocalIdAndMap(1, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3 - cameraXpan, box1 + 3);
|
||||
box2 = GetTruckBoxMovement(data[0]) * 2; // bottom left box.
|
||||
SetObjectEventSpritePosByLocalIdAndMap(2, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -cameraXpan, box2 - 3);
|
||||
box3 = GetTruckBoxMovement(data[0]) * 4; // bottom right box.
|
||||
SetObjectEventSpritePosByLocalIdAndMap(3, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3 - cameraXpan, box3);
|
||||
box1 = GetTruckBoxMovement(data[0] + 30) * 4;
|
||||
SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_TOP, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3 - cameraXpan, box1 + 3);
|
||||
box2 = GetTruckBoxMovement(data[0]) * 2;
|
||||
SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_L, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -cameraXpan, box2 - 3);
|
||||
box3 = GetTruckBoxMovement(data[0]) * 4;
|
||||
SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_R, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3 - cameraXpan, box3);
|
||||
|
||||
if (++data[0] == SECONDS(500)) // this will never run
|
||||
data[0] = 0; // reset the timer if it gets stuck.
|
||||
@@ -116,11 +116,11 @@ void Task_Truck2(u8 taskId)
|
||||
cameraYpan = GetTruckCameraBobbingY(data[2]);
|
||||
SetCameraPanning(cameraXpan, cameraYpan);
|
||||
box1 = GetTruckBoxMovement(data[2] + 30) * 4;
|
||||
SetObjectEventSpritePosByLocalIdAndMap(1, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3 - cameraXpan, box1 + 3);
|
||||
SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_TOP, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3 - cameraXpan, box1 + 3);
|
||||
box2 = GetTruckBoxMovement(data[2]) * 2;
|
||||
SetObjectEventSpritePosByLocalIdAndMap(2, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -cameraXpan, box2 - 3);
|
||||
SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_L, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -cameraXpan, box2 - 3);
|
||||
box3 = GetTruckBoxMovement(data[2]) * 4;
|
||||
SetObjectEventSpritePosByLocalIdAndMap(3, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3 - cameraXpan, box3);
|
||||
SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_R, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3 - cameraXpan, box3);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,9 +147,9 @@ static void Task_Truck3(u8 taskId)
|
||||
cameraXpan = gTruckCamera_HorizontalTable[data[1]];
|
||||
cameraYpan = 0;
|
||||
SetCameraPanning(cameraXpan, 0);
|
||||
SetObjectEventSpritePosByLocalIdAndMap(1, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3 - cameraXpan, cameraYpan + 3);
|
||||
SetObjectEventSpritePosByLocalIdAndMap(2, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -cameraXpan, cameraYpan - 3);
|
||||
SetObjectEventSpritePosByLocalIdAndMap(3, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3 - cameraXpan, cameraYpan);
|
||||
SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_TOP, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3 - cameraXpan, cameraYpan + 3);
|
||||
SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_L, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -cameraXpan, cameraYpan - 3);
|
||||
SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_R, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3 - cameraXpan, cameraYpan);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,9 +242,9 @@ void EndTruckSequence(u8 taskId)
|
||||
{
|
||||
if (!FuncIsActiveTask(Task_HandleTruckSequence))
|
||||
{
|
||||
SetObjectEventSpritePosByLocalIdAndMap(1, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3, 3);
|
||||
SetObjectEventSpritePosByLocalIdAndMap(2, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 0, -3);
|
||||
SetObjectEventSpritePosByLocalIdAndMap(3, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3, 0);
|
||||
SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_TOP, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3, 3);
|
||||
SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_L, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 0, -3);
|
||||
SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_R, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+16
-16
@@ -3429,7 +3429,7 @@ static void ChangeDeoxysRockLevel(u8 rockLevel)
|
||||
{
|
||||
u8 objectEventId;
|
||||
LoadPalette(&sDeoxysRockPalettes[rockLevel], 0x1A0, 8);
|
||||
TryGetObjectEventIdByLocalIdAndMap(1, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &objectEventId);
|
||||
TryGetObjectEventIdByLocalIdAndMap(LOCALID_BIRTH_ISLAND_EXTERIOR_ROCK, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &objectEventId);
|
||||
|
||||
if (rockLevel == 0)
|
||||
PlaySE(SE_M_CONFUSE_RAY);
|
||||
@@ -3437,9 +3437,9 @@ static void ChangeDeoxysRockLevel(u8 rockLevel)
|
||||
PlaySE(SE_RG_DEOXYS_MOVE);
|
||||
|
||||
CreateTask(WaitForDeoxysRockMovement, 8);
|
||||
gFieldEffectArguments[0] = 1;
|
||||
gFieldEffectArguments[1] = 58;
|
||||
gFieldEffectArguments[2] = 26;
|
||||
gFieldEffectArguments[0] = LOCALID_BIRTH_ISLAND_EXTERIOR_ROCK;
|
||||
gFieldEffectArguments[1] = MAP_NUM(BIRTH_ISLAND_EXTERIOR);
|
||||
gFieldEffectArguments[2] = MAP_GROUP(BIRTH_ISLAND_EXTERIOR);
|
||||
gFieldEffectArguments[3] = sDeoxysRockCoords[rockLevel][0];
|
||||
gFieldEffectArguments[4] = sDeoxysRockCoords[rockLevel][1];
|
||||
|
||||
@@ -3686,18 +3686,18 @@ u32 GetMartEmployeeObjectEventId(void)
|
||||
{
|
||||
static const u8 sPokeMarts[][3] =
|
||||
{
|
||||
{ MAP_GROUP(OLDALE_TOWN_MART), MAP_NUM(OLDALE_TOWN_MART), 1 },
|
||||
{ MAP_GROUP(LAVARIDGE_TOWN_MART), MAP_NUM(LAVARIDGE_TOWN_MART), 1 },
|
||||
{ MAP_GROUP(FALLARBOR_TOWN_MART), MAP_NUM(FALLARBOR_TOWN_MART), 1 },
|
||||
{ MAP_GROUP(VERDANTURF_TOWN_MART), MAP_NUM(VERDANTURF_TOWN_MART), 1 },
|
||||
{ MAP_GROUP(PETALBURG_CITY_MART), MAP_NUM(PETALBURG_CITY_MART), 1 },
|
||||
{ MAP_GROUP(SLATEPORT_CITY_MART), MAP_NUM(SLATEPORT_CITY_MART), 1 },
|
||||
{ MAP_GROUP(MAUVILLE_CITY_MART), MAP_NUM(MAUVILLE_CITY_MART), 1 },
|
||||
{ MAP_GROUP(RUSTBORO_CITY_MART), MAP_NUM(RUSTBORO_CITY_MART), 1 },
|
||||
{ MAP_GROUP(FORTREE_CITY_MART), MAP_NUM(FORTREE_CITY_MART), 1 },
|
||||
{ MAP_GROUP(MOSSDEEP_CITY_MART), MAP_NUM(MOSSDEEP_CITY_MART), 1 },
|
||||
{ MAP_GROUP(SOOTOPOLIS_CITY_MART), MAP_NUM(SOOTOPOLIS_CITY_MART), 1 },
|
||||
{ MAP_GROUP(BATTLE_FRONTIER_MART), MAP_NUM(BATTLE_FRONTIER_MART), 1 }
|
||||
{ MAP_GROUP(OLDALE_TOWN_MART), MAP_NUM(OLDALE_TOWN_MART), LOCALID_OLDALE_MART_CLERK },
|
||||
{ MAP_GROUP(LAVARIDGE_TOWN_MART), MAP_NUM(LAVARIDGE_TOWN_MART), LOCALID_LAVARIDGE_MART_CLERK },
|
||||
{ MAP_GROUP(FALLARBOR_TOWN_MART), MAP_NUM(FALLARBOR_TOWN_MART), LOCALID_FALLARBOR_MART_CLERK },
|
||||
{ MAP_GROUP(VERDANTURF_TOWN_MART), MAP_NUM(VERDANTURF_TOWN_MART), LOCALID_VERDANTURF_MART_CLERK },
|
||||
{ MAP_GROUP(PETALBURG_CITY_MART), MAP_NUM(PETALBURG_CITY_MART), LOCALID_PETALBURG_MART_CLERK },
|
||||
{ MAP_GROUP(SLATEPORT_CITY_MART), MAP_NUM(SLATEPORT_CITY_MART), LOCALID_SLATEPORT_MART_CLERK },
|
||||
{ MAP_GROUP(MAUVILLE_CITY_MART), MAP_NUM(MAUVILLE_CITY_MART), LOCALID_MAUVILLE_MART_CLERK },
|
||||
{ MAP_GROUP(RUSTBORO_CITY_MART), MAP_NUM(RUSTBORO_CITY_MART), LOCALID_RUSTBORO_MART_CLERK },
|
||||
{ MAP_GROUP(FORTREE_CITY_MART), MAP_NUM(FORTREE_CITY_MART), LOCALID_FORTREE_MART_CLERK },
|
||||
{ MAP_GROUP(MOSSDEEP_CITY_MART), MAP_NUM(MOSSDEEP_CITY_MART), LOCALID_MOSSDEEP_MART_CLERK },
|
||||
{ MAP_GROUP(SOOTOPOLIS_CITY_MART), MAP_NUM(SOOTOPOLIS_CITY_MART), LOCALID_SOOTOPOLIS_MART_CLERK },
|
||||
{ MAP_GROUP(BATTLE_FRONTIER_MART), MAP_NUM(BATTLE_FRONTIER_MART), LOCALID_BATTLE_FRONTIER_MART_CLERK }
|
||||
};
|
||||
|
||||
u8 i;
|
||||
|
||||
+14
-9
@@ -66,13 +66,12 @@ static EWRAM_DATA struct HofGfx *sHofGfxPtr = NULL;
|
||||
|
||||
extern struct MusicPlayerInfo gMPlayInfo_BGM;
|
||||
|
||||
// this file's functions
|
||||
static void ClearVramOamPltt_LoadHofPal(void);
|
||||
static void LoadHofGfx(void);
|
||||
static void InitHofBgs(void);
|
||||
static bool8 CreateHofConfettiSprite(void);
|
||||
static void StartCredits(void);
|
||||
static bool8 sub_8175024(void);
|
||||
static bool8 LoadHofBgs(void);
|
||||
static void Task_Hof_InitMonData(u8 taskId);
|
||||
static void Task_Hof_InitTeamSaveData(u8 taskId);
|
||||
static void Task_Hof_SetMonDisplayTask(u8 taskId);
|
||||
@@ -104,7 +103,6 @@ static void HallOfFame_PrintPlayerInfo(u8 unused1, u8 unused2);
|
||||
static void Task_DoDomeConfetti(u8 taskId);
|
||||
static void SpriteCB_HofConfetti(struct Sprite* sprite);
|
||||
|
||||
// const rom data
|
||||
static const struct BgTemplate sHof_BgTemplates[] =
|
||||
{
|
||||
{
|
||||
@@ -136,12 +134,19 @@ static const struct BgTemplate sHof_BgTemplates[] =
|
||||
},
|
||||
};
|
||||
|
||||
static const struct WindowTemplate sHof_WindowTemplate = {0, 2, 2, 0xE, 6, 0xE, 1};
|
||||
static const struct WindowTemplate sHof_WindowTemplate = {
|
||||
.bg = 0,
|
||||
.tilemapLeft = 2,
|
||||
.tilemapTop = 2,
|
||||
.width = 14,
|
||||
.height = 6,
|
||||
.paletteNum = 14,
|
||||
.baseBlock = 1
|
||||
};
|
||||
|
||||
static const u8 sMonInfoTextColors[4] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY};
|
||||
static const u8 sPlayerInfoTextColors[4] = {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY};
|
||||
|
||||
static const u8 sUnused_085E538C[] = {4, 5, 0, 0};
|
||||
static const u8 sUnusedTextColors[4] = {TEXT_COLOR_RED, TEXT_COLOR_LIGHT_RED, TEXT_COLOR_TRANSPARENT};
|
||||
|
||||
static const struct CompressedSpriteSheet sSpriteSheet_Confetti[] =
|
||||
{
|
||||
@@ -383,7 +388,7 @@ static bool8 InitHallOfFameScreen(void)
|
||||
gMain.state++;
|
||||
break;
|
||||
case 3:
|
||||
if (!sub_8175024())
|
||||
if (!LoadHofBgs())
|
||||
{
|
||||
SetVBlankCallback(VBlankCB_HallOfFame);
|
||||
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK);
|
||||
@@ -819,7 +824,7 @@ void CB2_DoHallOfFamePC(void)
|
||||
gMain.state++;
|
||||
break;
|
||||
case 3:
|
||||
if (!sub_8175024())
|
||||
if (!LoadHofBgs())
|
||||
{
|
||||
struct HallofFameTeam *fameTeam = (struct HallofFameTeam*)(gDecompressionBuffer);
|
||||
fameTeam->mon[0] = sDummyFameMon;
|
||||
@@ -1301,7 +1306,7 @@ static void InitHofBgs(void)
|
||||
ChangeBgY(3, 0, 0);
|
||||
}
|
||||
|
||||
static bool8 sub_8175024(void)
|
||||
static bool8 LoadHofBgs(void)
|
||||
{
|
||||
switch (sHofGfxPtr->state)
|
||||
{
|
||||
|
||||
+2
-2
@@ -133,7 +133,7 @@ void UpdatePocketScrollPositions(void);
|
||||
u8 CreateBagInputHandlerTask(u8);
|
||||
void sub_81AC23C(u8);
|
||||
void BagMenu_MoveCursorCallback(s32 a, bool8 b, struct ListMenu*);
|
||||
void BagMenu_ItemPrintCallback(u8 windowId, s32 itemIndex, u8 a);
|
||||
void BagMenu_ItemPrintCallback(u8 windowId, u32 itemIndex, u8 a);
|
||||
void ItemMenu_UseOutOfBattle(u8 taskId);
|
||||
void ItemMenu_Toss(u8 taskId);
|
||||
void ItemMenu_Register(u8 taskId);
|
||||
@@ -893,7 +893,7 @@ void BagMenu_MoveCursorCallback(s32 itemIndex, bool8 onInit, struct ListMenu *li
|
||||
}
|
||||
}
|
||||
|
||||
void BagMenu_ItemPrintCallback(u8 windowId, s32 itemIndex, u8 y)
|
||||
void BagMenu_ItemPrintCallback(u8 windowId, u32 itemIndex, u8 y)
|
||||
{
|
||||
u16 itemId;
|
||||
u16 itemQuantity;
|
||||
|
||||
@@ -244,7 +244,7 @@ static const struct OamData sBerryPicRotatingOamData =
|
||||
.affineParam = 0
|
||||
};
|
||||
|
||||
static const union AnimCmd sSpriteAnim_857FBD8[] =
|
||||
static const union AnimCmd sAnim_BerryPic[] =
|
||||
{
|
||||
ANIMCMD_FRAME(0, 0),
|
||||
ANIMCMD_END
|
||||
@@ -252,7 +252,7 @@ static const union AnimCmd sSpriteAnim_857FBD8[] =
|
||||
|
||||
static const union AnimCmd *const sBerryPicSpriteAnimTable[] =
|
||||
{
|
||||
sSpriteAnim_857FBD8
|
||||
sAnim_BerryPic
|
||||
};
|
||||
|
||||
static const struct SpriteFrameImage sBerryPicSpriteImageTable[] =
|
||||
|
||||
@@ -253,7 +253,7 @@ static u8 sub_81D1D34(u8 a0)
|
||||
return sUnknown_0203CF48[a0];
|
||||
}
|
||||
|
||||
static void sub_81D1D44(u8 windowId, s32 itemId, u8 y)
|
||||
static void sub_81D1D44(u8 windowId, u32 itemId, u8 y)
|
||||
{
|
||||
u8 buffer[30];
|
||||
u16 length;
|
||||
|
||||
+201
-179
@@ -14,12 +14,14 @@
|
||||
#include "sprite.h"
|
||||
#include "task.h"
|
||||
#include "window.h"
|
||||
#include "constants/event_objects.h"
|
||||
#include "constants/maps.h"
|
||||
#include "constants/rgb.h"
|
||||
#include "constants/songs.h"
|
||||
#include "constants/metatile_labels.h"
|
||||
|
||||
struct MirageTowerPulseBlend {
|
||||
struct MirageTowerPulseBlend
|
||||
{
|
||||
u8 taskId;
|
||||
struct PulseBlend pulseBlend;
|
||||
};
|
||||
@@ -37,59 +39,51 @@ struct BgRegOffsets
|
||||
u16 bgVOFS;
|
||||
};
|
||||
|
||||
struct Struct203CF10
|
||||
struct FallAnim_Tower
|
||||
{
|
||||
u8 *buffer;
|
||||
u8 currIndex;
|
||||
u8 *disintegrateRand;
|
||||
u8 disintegrateIdx;
|
||||
};
|
||||
|
||||
struct DynamicSpriteFrameImage
|
||||
{
|
||||
u8 *data;
|
||||
u16 size;
|
||||
};
|
||||
|
||||
struct Struct203CF0C
|
||||
struct FallAnim_Fossil
|
||||
{
|
||||
u8 *frameImageTiles;
|
||||
struct DynamicSpriteFrameImage *frameImage;
|
||||
struct SpriteFrameImage *frameImage;
|
||||
u8 spriteId;
|
||||
u16 *unkC;
|
||||
u16 unk10;
|
||||
u16 *disintegrateRand;
|
||||
u16 disintegrateIdx;
|
||||
};
|
||||
|
||||
#define TAG_CEILING_CRUMBLE 4000
|
||||
|
||||
#define MIRAGE_TOWER_GFX_LENGTH (sizeof(sBlankTile_Gfx) + sizeof(sMirageTower_Gfx))
|
||||
#define ROOT_FOSSIL_GFX_LENGTH sizeof(sRootFossil_Gfx)
|
||||
#define ROOT_FOSSIL_GFX_RANDOMIZER_LENGTH 0x100
|
||||
#define FOSSIL_DISINTEGRATE_LENGTH 0x100
|
||||
|
||||
// extern data
|
||||
extern const struct SpriteSheet gMirageTowerCeilingCrumbleSpriteSheets[];
|
||||
extern const s16 sCeilingCrumblePositions[][3];
|
||||
static const struct SpriteSheet sCeilingCrumbleSpriteSheets[];
|
||||
static const s16 sCeilingCrumblePositions[][3];
|
||||
|
||||
// static functions
|
||||
static void PlayerDescendMirageTower(u8 taskId);
|
||||
static void DoScreenShake(u8 taskId);
|
||||
static void PlayerDescendMirageTower(u8);
|
||||
static void DoScreenShake(u8);
|
||||
static void IncrementCeilingCrumbleFinishedCount(void);
|
||||
static void WaitCeilingCrumble(u8 taskId);
|
||||
static void FinishCeilingCrumbleTask(u8 taskId);
|
||||
static void WaitCeilingCrumble(u8);
|
||||
static void FinishCeilingCrumbleTask(u8);
|
||||
static void CreateCeilingCrumbleSprites(void);
|
||||
static void MoveCeilingCrumbleSprite(struct Sprite* sprite);
|
||||
static void DoMirageTowerDisintegration(u8 taskId);
|
||||
static void InitMirageTowerShake(u8 taskId);
|
||||
static void DoFossilFallAndSink(u8 taskId);
|
||||
static void sub_81BF248(struct Sprite *);
|
||||
static void sub_81BF2B8(u8* a, u16 b, u8 c, u8 d, u8 e);
|
||||
static void SpriteCB_CeilingCrumble(struct Sprite*);
|
||||
static void DoMirageTowerDisintegration(u8);
|
||||
static void InitMirageTowerShake(u8);
|
||||
static void Task_FossilFallAndSink(u8);
|
||||
static void SpriteCB_FallingFossil(struct Sprite *);
|
||||
static void UpdateDisintegrationEffect(u8*, u16, u8, u8, u8);
|
||||
|
||||
// rodata
|
||||
static const u8 sBlankTile_Gfx[32] = {0};
|
||||
static const u8 sMirageTower_Gfx[] = INCBIN_U8("graphics/misc/mirage_tower.4bpp");
|
||||
static const u16 sMirageTowerTilemap[] = INCBIN_U16("graphics/misc/mirage_tower.bin");
|
||||
static const u16 sRootFossil_Pal[] = INCBIN_U16("graphics/misc/fossil.gbapal");
|
||||
static const u8 sRootFossil_Gfx[] = INCBIN_U8("graphics/misc/fossil.4bpp");
|
||||
static const u16 sFossil_Pal[] = INCBIN_U16("graphics/object_events/pics/misc/fossil.gbapal"); // Unused
|
||||
static const u8 sFossil_Gfx[] = INCBIN_U8("graphics/object_events/pics/misc/fossil.4bpp"); // Duplicate of gObjectEventPic_Fossil
|
||||
static const u8 sMirageTowerCrumbles_Gfx[] = INCBIN_U8("graphics/misc/mirage_tower_crumbles.4bpp");
|
||||
static const u16 sMirageTowerCrumbles_Palette[] = INCBIN_U16("graphics/misc/mirage_tower_crumbles.gbapal");
|
||||
|
||||
const s16 sCeilingCrumblePositions[][3] =
|
||||
static const s16 sCeilingCrumblePositions[][3] =
|
||||
{
|
||||
{ 0, 10, 65},
|
||||
{ 17, 3, 50},
|
||||
@@ -101,10 +95,10 @@ const s16 sCeilingCrumblePositions[][3] =
|
||||
{-24, -4, 65},
|
||||
};
|
||||
|
||||
const struct SpriteSheet gMirageTowerCeilingCrumbleSpriteSheets[] =
|
||||
static const struct SpriteSheet sCeilingCrumbleSpriteSheets[] =
|
||||
{
|
||||
{sMirageTowerCrumbles_Gfx, 0x0080, 4000},
|
||||
{NULL}
|
||||
{sMirageTowerCrumbles_Gfx, 0x80, TAG_CEILING_CRUMBLE},
|
||||
{}
|
||||
};
|
||||
|
||||
static const struct MetatileCoords sInvisibleMirageTowerMetatiles[] =
|
||||
@@ -129,13 +123,13 @@ static const struct MetatileCoords sInvisibleMirageTowerMetatiles[] =
|
||||
{20, 58, METATILE_General_SandPit_Center},
|
||||
};
|
||||
|
||||
static const union AnimCmd gSpriteAnim_8617DEC[] =
|
||||
static const union AnimCmd sAnim_FallingFossil[] =
|
||||
{
|
||||
ANIMCMD_FRAME(0, 1),
|
||||
ANIMCMD_END,
|
||||
};
|
||||
|
||||
static const struct OamData gOamData_8617DF4 =
|
||||
static const struct OamData sOamData_FallingFossil =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
@@ -152,14 +146,20 @@ static const struct OamData gOamData_8617DF4 =
|
||||
.affineParam = 0,
|
||||
};
|
||||
|
||||
static const union AnimCmd *const gSpriteAnimTable_8617DFC[] =
|
||||
static const union AnimCmd *const sAnims_FallingFossil[] =
|
||||
{
|
||||
gSpriteAnim_8617DEC,
|
||||
sAnim_FallingFossil,
|
||||
};
|
||||
|
||||
static const struct SpriteTemplate gUnknown_08617E00 =
|
||||
static const struct SpriteTemplate sSpriteTemplate_FallingFossil =
|
||||
{
|
||||
0xFFFF, 0xFFFF, &gOamData_8617DF4, gSpriteAnimTable_8617DFC, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy
|
||||
.tileTag = 0xFFFF,
|
||||
.paletteTag = 0xFFFF,
|
||||
.oam = &sOamData_FallingFossil,
|
||||
.anims = sAnims_FallingFossil,
|
||||
.images = NULL,
|
||||
.affineAnims = gDummySpriteAffineAnimTable,
|
||||
.callback = SpriteCallbackDummy
|
||||
};
|
||||
|
||||
const struct PulseBlendSettings gMirageTowerPulseBlendSettings = {
|
||||
@@ -174,18 +174,18 @@ const struct PulseBlendSettings gMirageTowerPulseBlendSettings = {
|
||||
.unk7_7 = 1,
|
||||
};
|
||||
|
||||
static const union AnimCmd sCeilingCrumble2AnimCmd[] =
|
||||
static const union AnimCmd sAnim_CeilingCrumbleSmall[] =
|
||||
{
|
||||
ANIMCMD_FRAME(0, 12),
|
||||
ANIMCMD_JUMP(0),
|
||||
};
|
||||
|
||||
static const union AnimCmd *const sCeilingCrumble2AnimCmds[] =
|
||||
static const union AnimCmd *const sAnims_CeilingCrumbleSmall[] =
|
||||
{
|
||||
sCeilingCrumble2AnimCmd,
|
||||
sAnim_CeilingCrumbleSmall,
|
||||
};
|
||||
|
||||
static const struct OamData sCeilingCrumble2OamData =
|
||||
static const struct OamData sOamData_CeilingCrumbleSmall =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
@@ -202,28 +202,28 @@ static const struct OamData sCeilingCrumble2OamData =
|
||||
.affineParam = 0,
|
||||
};
|
||||
|
||||
static const struct SpriteTemplate sCeilingCrumbleSpriteTemplate2 = {
|
||||
.tileTag = 4000,
|
||||
static const struct SpriteTemplate sSpriteTemplate_CeilingCrumbleSmall = {
|
||||
.tileTag = TAG_CEILING_CRUMBLE,
|
||||
.paletteTag = 0xFFFF,
|
||||
.oam = &sCeilingCrumble2OamData,
|
||||
.anims = sCeilingCrumble2AnimCmds,
|
||||
.oam = &sOamData_CeilingCrumbleSmall,
|
||||
.anims = sAnims_CeilingCrumbleSmall,
|
||||
.images = NULL,
|
||||
.affineAnims = gDummySpriteAffineAnimTable,
|
||||
.callback = MoveCeilingCrumbleSprite
|
||||
.callback = SpriteCB_CeilingCrumble
|
||||
};
|
||||
|
||||
static const union AnimCmd sCeilingCrumble1AnimCmd[] =
|
||||
static const union AnimCmd sAnim_CeilingCrumbleLarge[] =
|
||||
{
|
||||
ANIMCMD_FRAME(0, 12),
|
||||
ANIMCMD_JUMP(0),
|
||||
};
|
||||
|
||||
static const union AnimCmd *const sCeilingCrumble1AnimCmds[] =
|
||||
static const union AnimCmd *const sAnims_CeilingCrumbleLarge[] =
|
||||
{
|
||||
sCeilingCrumble1AnimCmd,
|
||||
sAnim_CeilingCrumbleLarge,
|
||||
};
|
||||
|
||||
static const struct OamData sCeilingCrumble1OamData =
|
||||
static const struct OamData sOamData_CeilingCrumbleLarge =
|
||||
{
|
||||
.y = 0,
|
||||
.affineMode = ST_OAM_AFFINE_OFF,
|
||||
@@ -240,24 +240,26 @@ static const struct OamData sCeilingCrumble1OamData =
|
||||
.affineParam = 0,
|
||||
};
|
||||
|
||||
static const struct SpriteTemplate sCeilingCrumbleSpriteTemplate1 = {
|
||||
.tileTag = 4000,
|
||||
static const struct SpriteTemplate sSpriteTemplate_CeilingCrumbleLarge = {
|
||||
.tileTag = TAG_CEILING_CRUMBLE,
|
||||
.paletteTag = 0xFFFF,
|
||||
.oam = &sCeilingCrumble1OamData,
|
||||
.anims = sCeilingCrumble1AnimCmds,
|
||||
.oam = &sOamData_CeilingCrumbleLarge,
|
||||
.anims = sAnims_CeilingCrumbleLarge,
|
||||
.images = NULL,
|
||||
.affineAnims = gDummySpriteAffineAnimTable,
|
||||
.callback = MoveCeilingCrumbleSprite
|
||||
.callback = SpriteCB_CeilingCrumble
|
||||
};
|
||||
|
||||
EWRAM_DATA static u8* sMirageTowerGfxBuffer = NULL;
|
||||
EWRAM_DATA static u8* sMirageTowerTilemapBuffer = NULL;
|
||||
EWRAM_DATA static struct Struct203CF0C *sUnknown_0203CF0C = NULL;
|
||||
EWRAM_DATA static struct Struct203CF10 *sUnknown_0203CF10 = NULL;
|
||||
EWRAM_DATA static struct FallAnim_Fossil *sFallingFossil = NULL;
|
||||
EWRAM_DATA static struct FallAnim_Tower *sFallingTower = NULL;
|
||||
EWRAM_DATA static struct BgRegOffsets *sBgShakeOffsets = NULL;
|
||||
EWRAM_DATA struct MirageTowerPulseBlend *sMirageTowerPulseBlend = NULL;
|
||||
EWRAM_DATA static struct MirageTowerPulseBlend *sMirageTowerPulseBlend = NULL;
|
||||
|
||||
static u16 gUnknown_030012A8[8];
|
||||
// Holds data about the disintegration effect for Mirage Tower / the unchosen fossil.
|
||||
// Never read, presumably for debugging
|
||||
static u16 sDebug_DisintegrationData[8];
|
||||
|
||||
bool8 IsMirageTowerVisible(void)
|
||||
{
|
||||
@@ -319,6 +321,7 @@ void SetMirageTowerVisibility(void)
|
||||
|
||||
if (VarGet(VAR_MIRAGE_TOWER_STATE))
|
||||
{
|
||||
// Mirage Tower event has already been completed, hide it
|
||||
FlagClear(FLAG_MIRAGE_TOWER_VISIBLE);
|
||||
return;
|
||||
}
|
||||
@@ -343,32 +346,40 @@ void StartPlayerDescendMirageTower(void)
|
||||
CreateTask(PlayerDescendMirageTower, 8);
|
||||
}
|
||||
|
||||
// As the tower disintegrates, a duplicate object event of the player
|
||||
// is created at the top of the tower and moved down to show the player falling
|
||||
static void PlayerDescendMirageTower(u8 taskId)
|
||||
{
|
||||
u8 objectEventId;
|
||||
struct ObjectEvent *fakePlayerObjectEvent;
|
||||
struct ObjectEvent *playerObjectEvent;
|
||||
struct ObjectEvent *fallingPlayer;
|
||||
struct ObjectEvent *player;
|
||||
|
||||
TryGetObjectEventIdByLocalIdAndMap(45, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &objectEventId);
|
||||
fakePlayerObjectEvent = &gObjectEvents[objectEventId];
|
||||
gSprites[fakePlayerObjectEvent->spriteId].y2 += 4;
|
||||
playerObjectEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
if ((gSprites[fakePlayerObjectEvent->spriteId].y + gSprites[fakePlayerObjectEvent->spriteId].y2) >=
|
||||
(gSprites[playerObjectEvent->spriteId].y + gSprites[playerObjectEvent->spriteId].y2))
|
||||
TryGetObjectEventIdByLocalIdAndMap(LOCALID_ROUTE111_PLAYER_FALLING, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &objectEventId);
|
||||
fallingPlayer = &gObjectEvents[objectEventId];
|
||||
gSprites[fallingPlayer->spriteId].y2 += 4;
|
||||
player = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||
if ((gSprites[fallingPlayer->spriteId].y + gSprites[fallingPlayer->spriteId].y2) >=
|
||||
(gSprites[player->spriteId].y + gSprites[player->spriteId].y2))
|
||||
{
|
||||
DestroyTask(taskId);
|
||||
EnableBothScriptContexts();
|
||||
}
|
||||
}
|
||||
|
||||
#define tXShakeOffset data[0]
|
||||
#define tTimer data[1]
|
||||
#define tNumShakes data[2]
|
||||
#define tShakeDelay data[3]
|
||||
#define tYShakeOffset data[4]
|
||||
|
||||
static void StartScreenShake(u8 yShakeOffset, u8 xShakeOffset, u8 numShakes, u8 shakeDelay)
|
||||
{
|
||||
u8 taskId = CreateTask(DoScreenShake, 9);
|
||||
gTasks[taskId].data[0] = xShakeOffset;
|
||||
gTasks[taskId].data[1] = 0;
|
||||
gTasks[taskId].data[2] = numShakes;
|
||||
gTasks[taskId].data[3] = shakeDelay;
|
||||
gTasks[taskId].data[4] = yShakeOffset;
|
||||
gTasks[taskId].tXShakeOffset = xShakeOffset;
|
||||
gTasks[taskId].tTimer = 0;
|
||||
gTasks[taskId].tNumShakes = numShakes;
|
||||
gTasks[taskId].tShakeDelay = shakeDelay;
|
||||
gTasks[taskId].tYShakeOffset = yShakeOffset;
|
||||
SetCameraPanningCallback(NULL);
|
||||
PlaySE(SE_M_STRENGTH);
|
||||
}
|
||||
@@ -378,15 +389,15 @@ static void DoScreenShake(u8 taskId)
|
||||
s16 *data;
|
||||
|
||||
data = gTasks[taskId].data;
|
||||
data[1]++;
|
||||
if (data[1] % data[3] == 0)
|
||||
tTimer++;
|
||||
if (tTimer % tShakeDelay == 0)
|
||||
{
|
||||
data[1] = 0;
|
||||
data[2]--;
|
||||
data[0] = -data[0];
|
||||
data[4] = -data[4];
|
||||
SetCameraPanning(data[0], data[4]);
|
||||
if (data[2] == 0)
|
||||
tTimer = 0;
|
||||
tNumShakes--;
|
||||
tXShakeOffset = -tXShakeOffset;
|
||||
tYShakeOffset = -tYShakeOffset;
|
||||
SetCameraPanning(tXShakeOffset, tYShakeOffset);
|
||||
if (tNumShakes == 0)
|
||||
{
|
||||
IncrementCeilingCrumbleFinishedCount();
|
||||
DestroyTask(taskId);
|
||||
@@ -395,6 +406,12 @@ static void DoScreenShake(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
#undef tXShakeOffset
|
||||
#undef tTimer
|
||||
#undef tNumShakes
|
||||
#undef tShakeDelay
|
||||
#undef tYShakeOffset
|
||||
|
||||
static void IncrementCeilingCrumbleFinishedCount(void)
|
||||
{
|
||||
u8 taskId = FindTaskIdByFunc(WaitCeilingCrumble);
|
||||
@@ -404,7 +421,7 @@ static void IncrementCeilingCrumbleFinishedCount(void)
|
||||
|
||||
void DoMirageTowerCeilingCrumble(void)
|
||||
{
|
||||
LoadSpriteSheets(gMirageTowerCeilingCrumbleSpriteSheets);
|
||||
LoadSpriteSheets(sCeilingCrumbleSpriteSheets);
|
||||
CreateCeilingCrumbleSprites();
|
||||
CreateTask(WaitCeilingCrumble, 8);
|
||||
StartScreenShake(2, 1, 16, 3);
|
||||
@@ -421,7 +438,7 @@ static void WaitCeilingCrumble(u8 taskId)
|
||||
|
||||
static void FinishCeilingCrumbleTask(u8 taskId)
|
||||
{
|
||||
FreeSpriteTilesByTag(4000);
|
||||
FreeSpriteTilesByTag(TAG_CEILING_CRUMBLE);
|
||||
DestroyTask(taskId);
|
||||
EnableBothScriptContexts();
|
||||
}
|
||||
@@ -433,21 +450,21 @@ static void CreateCeilingCrumbleSprites(void)
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
spriteId = CreateSprite(&sCeilingCrumbleSpriteTemplate1, sCeilingCrumblePositions[i][0] + 120, sCeilingCrumblePositions[i][1], 8);
|
||||
spriteId = CreateSprite(&sSpriteTemplate_CeilingCrumbleLarge, sCeilingCrumblePositions[i][0] + 120, sCeilingCrumblePositions[i][1], 8);
|
||||
gSprites[spriteId].oam.priority = 0;
|
||||
gSprites[spriteId].oam.paletteNum = 0;
|
||||
gSprites[spriteId].data[0] = i;
|
||||
}
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
spriteId = CreateSprite(&sCeilingCrumbleSpriteTemplate2, sCeilingCrumblePositions[i][0] + 115, sCeilingCrumblePositions[i][1] - 3, 8);
|
||||
spriteId = CreateSprite(&sSpriteTemplate_CeilingCrumbleSmall, sCeilingCrumblePositions[i][0] + 115, sCeilingCrumblePositions[i][1] - 3, 8);
|
||||
gSprites[spriteId].oam.priority = 0;
|
||||
gSprites[spriteId].oam.paletteNum = 0;
|
||||
gSprites[spriteId].data[0] = i;
|
||||
}
|
||||
}
|
||||
|
||||
static void MoveCeilingCrumbleSprite(struct Sprite* sprite)
|
||||
static void SpriteCB_CeilingCrumble(struct Sprite* sprite)
|
||||
{
|
||||
sprite->data[1] += 2;
|
||||
sprite->y2 = sprite->data[1] / 2;
|
||||
@@ -478,7 +495,7 @@ void StartMirageTowerShake(void)
|
||||
|
||||
void StartMirageTowerFossilFallAndSink(void)
|
||||
{
|
||||
CreateTask(DoFossilFallAndSink, 9);
|
||||
CreateTask(Task_FossilFallAndSink, 9);
|
||||
}
|
||||
|
||||
static void SetBgShakeOffsets(void)
|
||||
@@ -501,42 +518,44 @@ static void UpdateBgShake(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
#define tState data[0]
|
||||
|
||||
static void InitMirageTowerShake(u8 taskId)
|
||||
{
|
||||
u8 zero;
|
||||
|
||||
switch (gTasks[taskId].data[0])
|
||||
switch (gTasks[taskId].tState)
|
||||
{
|
||||
case 0:
|
||||
FreeAllWindowBuffers();
|
||||
SetBgAttribute(0, BG_ATTR_PRIORITY, 2);
|
||||
gTasks[taskId].data[0]++;
|
||||
gTasks[taskId].tState++;
|
||||
break;
|
||||
case 1:
|
||||
sMirageTowerGfxBuffer = (u8 *)AllocZeroed(MIRAGE_TOWER_GFX_LENGTH);
|
||||
sMirageTowerTilemapBuffer = (u8 *)AllocZeroed(BG_SCREEN_SIZE);
|
||||
ChangeBgX(0, 0, 0);
|
||||
ChangeBgY(0, 0, 0);
|
||||
gTasks[taskId].data[0]++;
|
||||
gTasks[taskId].tState++;
|
||||
break;
|
||||
case 2:
|
||||
CpuSet(sBlankTile_Gfx, sMirageTowerGfxBuffer, MIRAGE_TOWER_GFX_LENGTH / 2);
|
||||
LoadBgTiles(0, sMirageTowerGfxBuffer, MIRAGE_TOWER_GFX_LENGTH, 0);
|
||||
gTasks[taskId].data[0]++;
|
||||
gTasks[taskId].tState++;
|
||||
break;
|
||||
case 3:
|
||||
SetBgTilemapBuffer(0, sMirageTowerTilemapBuffer);
|
||||
CopyToBgTilemapBufferRect_ChangePalette(0, &sMirageTowerTilemap, 12, 29, 6, 12, 17);
|
||||
CopyBgTilemapBufferToVram(0);
|
||||
gTasks[taskId].data[0]++;
|
||||
gTasks[taskId].tState++;
|
||||
break;
|
||||
case 4:
|
||||
ShowBg(0);
|
||||
gTasks[taskId].data[0]++;
|
||||
gTasks[taskId].tState++;
|
||||
break;
|
||||
case 5:
|
||||
SetInvisibleMirageTowerMetatiles();
|
||||
gTasks[taskId].data[0]++;
|
||||
gTasks[taskId].tState++;
|
||||
break;
|
||||
case 6:
|
||||
sBgShakeOffsets = Alloc(sizeof(*sBgShakeOffsets));
|
||||
@@ -558,27 +577,29 @@ static void DoMirageTowerDisintegration(u8 taskId)
|
||||
u16 i;
|
||||
u8 index;
|
||||
|
||||
switch (gTasks[taskId].data[0])
|
||||
switch (gTasks[taskId].tState)
|
||||
{
|
||||
case 1:
|
||||
sUnknown_0203CF10 = AllocZeroed(OUTER_BUFFER_LENGTH * sizeof(struct Struct203CF10));
|
||||
sFallingTower = AllocZeroed(OUTER_BUFFER_LENGTH * sizeof(struct FallAnim_Tower));
|
||||
break;
|
||||
case 3:
|
||||
if (gTasks[taskId].data[3] <= (OUTER_BUFFER_LENGTH - 1))
|
||||
{
|
||||
if (gTasks[taskId].data[1] > 1)
|
||||
{
|
||||
// Initialize disintegration pattern
|
||||
index = gTasks[taskId].data[3];
|
||||
sUnknown_0203CF10[index].buffer = Alloc(INNER_BUFFER_LENGTH);
|
||||
sFallingTower[index].disintegrateRand = Alloc(INNER_BUFFER_LENGTH);
|
||||
for (i = 0; i <= (INNER_BUFFER_LENGTH - 1); i++)
|
||||
sUnknown_0203CF10[index].buffer[i] = i;
|
||||
sFallingTower[index].disintegrateRand[i] = i;
|
||||
|
||||
// Randomize disintegration pattern
|
||||
for (i = 0; i <= (INNER_BUFFER_LENGTH - 1); i++)
|
||||
{
|
||||
u16 rand1, rand2, temp;
|
||||
|
||||
rand1 = Random() % 0x30;
|
||||
rand2 = Random() % 0x30;
|
||||
SWAP(sUnknown_0203CF10[index].buffer[rand2], sUnknown_0203CF10[index].buffer[rand1], temp);
|
||||
rand1 = Random() % INNER_BUFFER_LENGTH;
|
||||
rand2 = Random() % INNER_BUFFER_LENGTH;
|
||||
SWAP(sFallingTower[index].disintegrateRand[rand2], sFallingTower[index].disintegrateRand[rand1], temp);
|
||||
}
|
||||
if (gTasks[taskId].data[3] <= (OUTER_BUFFER_LENGTH - 1))
|
||||
gTasks[taskId].data[3]++;
|
||||
@@ -591,20 +612,20 @@ static void DoMirageTowerDisintegration(u8 taskId)
|
||||
{
|
||||
for (j = 0; j < 1; j++)
|
||||
{
|
||||
sub_81BF2B8(sMirageTowerGfxBuffer,
|
||||
((((OUTER_BUFFER_LENGTH - 1) - i) * INNER_BUFFER_LENGTH) + sUnknown_0203CF10[i].buffer[(sUnknown_0203CF10[i].currIndex)++]),
|
||||
UpdateDisintegrationEffect(sMirageTowerGfxBuffer,
|
||||
(OUTER_BUFFER_LENGTH - 1 - i) * INNER_BUFFER_LENGTH + sFallingTower[i].disintegrateRand[sFallingTower[i].disintegrateIdx++],
|
||||
0, INNER_BUFFER_LENGTH, 1);
|
||||
}
|
||||
if (sUnknown_0203CF10[i].currIndex > (INNER_BUFFER_LENGTH - 1))
|
||||
if (sFallingTower[i].disintegrateIdx > (INNER_BUFFER_LENGTH - 1))
|
||||
{
|
||||
FREE_AND_SET_NULL(sUnknown_0203CF10[i].buffer);
|
||||
FREE_AND_SET_NULL(sFallingTower[i].disintegrateRand);
|
||||
gTasks[taskId].data[2]++;
|
||||
if ((i % 2) == 1)
|
||||
sBgShakeOffsets->bgVOFS--;
|
||||
}
|
||||
}
|
||||
LoadBgTiles(0, sMirageTowerGfxBuffer, MIRAGE_TOWER_GFX_LENGTH, 0);
|
||||
if (sUnknown_0203CF10[OUTER_BUFFER_LENGTH - 1].currIndex > (INNER_BUFFER_LENGTH - 1))
|
||||
if (sFallingTower[OUTER_BUFFER_LENGTH - 1].disintegrateIdx > INNER_BUFFER_LENGTH - 1)
|
||||
break;
|
||||
return;
|
||||
case 4:
|
||||
@@ -617,7 +638,7 @@ static void DoMirageTowerDisintegration(u8 taskId)
|
||||
break;
|
||||
case 5:
|
||||
FREE_AND_SET_NULL(sBgShakeOffsets);
|
||||
FREE_AND_SET_NULL(sUnknown_0203CF10);
|
||||
FREE_AND_SET_NULL(sFallingTower);
|
||||
FREE_AND_SET_NULL(sMirageTowerGfxBuffer);
|
||||
FREE_AND_SET_NULL(sMirageTowerTilemapBuffer);
|
||||
break;
|
||||
@@ -635,127 +656,128 @@ static void DoMirageTowerDisintegration(u8 taskId)
|
||||
EnableBothScriptContexts();
|
||||
break;
|
||||
}
|
||||
gTasks[taskId].data[0]++;
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
|
||||
static void DoFossilFallAndSink(u8 taskId)
|
||||
static void Task_FossilFallAndSink(u8 taskId)
|
||||
{
|
||||
u16 i;
|
||||
u8 *buffer;
|
||||
|
||||
switch (gTasks[taskId].data[0])
|
||||
switch (gTasks[taskId].tState)
|
||||
{
|
||||
case 1:
|
||||
sUnknown_0203CF0C = AllocZeroed(sizeof(*sUnknown_0203CF0C));
|
||||
sUnknown_0203CF0C->frameImageTiles = AllocZeroed(ROOT_FOSSIL_GFX_LENGTH);
|
||||
sUnknown_0203CF0C->frameImage = AllocZeroed(sizeof(*sUnknown_0203CF0C->frameImage));
|
||||
sUnknown_0203CF0C->unkC = AllocZeroed(ROOT_FOSSIL_GFX_RANDOMIZER_LENGTH * sizeof(u16));
|
||||
sUnknown_0203CF0C->unk10 = 0;
|
||||
sFallingFossil = AllocZeroed(sizeof(*sFallingFossil));
|
||||
sFallingFossil->frameImageTiles = AllocZeroed(sizeof(sFossil_Gfx));
|
||||
sFallingFossil->frameImage = AllocZeroed(sizeof(*sFallingFossil->frameImage));
|
||||
sFallingFossil->disintegrateRand = AllocZeroed(FOSSIL_DISINTEGRATE_LENGTH * sizeof(u16));
|
||||
sFallingFossil->disintegrateIdx = 0;
|
||||
break;
|
||||
case 2:
|
||||
buffer = sUnknown_0203CF0C->frameImageTiles;
|
||||
for (i = 0; i < ROOT_FOSSIL_GFX_LENGTH; i++, buffer++)
|
||||
*buffer = sRootFossil_Gfx[i];
|
||||
buffer = sFallingFossil->frameImageTiles;
|
||||
for (i = 0; i < sizeof(sFossil_Gfx); i++, buffer++)
|
||||
*buffer = sFossil_Gfx[i];
|
||||
break;
|
||||
case 3:
|
||||
sUnknown_0203CF0C->frameImage->data = sUnknown_0203CF0C->frameImageTiles;
|
||||
sUnknown_0203CF0C->frameImage->size = ROOT_FOSSIL_GFX_LENGTH;
|
||||
sFallingFossil->frameImage->data = sFallingFossil->frameImageTiles;
|
||||
sFallingFossil->frameImage->size = sizeof(sFossil_Gfx);
|
||||
break;
|
||||
case 4:
|
||||
{
|
||||
struct SpriteTemplate fossilTemplate;
|
||||
|
||||
fossilTemplate = gUnknown_08617E00;
|
||||
fossilTemplate.images = (struct SpriteFrameImage *)(sUnknown_0203CF0C->frameImage);
|
||||
sUnknown_0203CF0C->spriteId = CreateSprite(&fossilTemplate, 128, -16, 1);
|
||||
gSprites[sUnknown_0203CF0C->spriteId].centerToCornerVecX = 0;
|
||||
gSprites[sUnknown_0203CF0C->spriteId].data[0] = gSprites[sUnknown_0203CF0C->spriteId].x;
|
||||
gSprites[sUnknown_0203CF0C->spriteId].data[1] = 1;
|
||||
struct SpriteTemplate fossilTemplate = sSpriteTemplate_FallingFossil;
|
||||
fossilTemplate.images = sFallingFossil->frameImage;
|
||||
sFallingFossil->spriteId = CreateSprite(&fossilTemplate, 128, -16, 1);
|
||||
gSprites[sFallingFossil->spriteId].centerToCornerVecX = 0;
|
||||
gSprites[sFallingFossil->spriteId].data[0] = gSprites[sFallingFossil->spriteId].x;
|
||||
gSprites[sFallingFossil->spriteId].data[1] = 1;
|
||||
}
|
||||
case 5:
|
||||
for (i = 0; i < ROOT_FOSSIL_GFX_RANDOMIZER_LENGTH; i++)
|
||||
sUnknown_0203CF0C->unkC[i] = i;
|
||||
// Initialize disintegration pattern
|
||||
for (i = 0; i < FOSSIL_DISINTEGRATE_LENGTH; i++)
|
||||
sFallingFossil->disintegrateRand[i] = i;
|
||||
break;
|
||||
case 6:
|
||||
for (i = 0; i < (ROOT_FOSSIL_GFX_RANDOMIZER_LENGTH * sizeof(u16)); i++)
|
||||
// Randomize disintegration pattern
|
||||
for (i = 0; i < FOSSIL_DISINTEGRATE_LENGTH * sizeof(u16); i++)
|
||||
{
|
||||
u16 rand1, rand2, temp;
|
||||
|
||||
rand1 = Random() % 0x100;
|
||||
rand2 = Random() % 0x100;
|
||||
SWAP(sUnknown_0203CF0C->unkC[rand2], sUnknown_0203CF0C->unkC[rand1], temp);
|
||||
rand1 = Random() % FOSSIL_DISINTEGRATE_LENGTH;
|
||||
rand2 = Random() % FOSSIL_DISINTEGRATE_LENGTH;
|
||||
SWAP(sFallingFossil->disintegrateRand[rand2], sFallingFossil->disintegrateRand[rand1], temp);
|
||||
}
|
||||
gSprites[sUnknown_0203CF0C->spriteId].callback = sub_81BF248;
|
||||
gSprites[sFallingFossil->spriteId].callback = SpriteCB_FallingFossil;
|
||||
break;
|
||||
case 7:
|
||||
if (gSprites[sUnknown_0203CF0C->spriteId].callback != SpriteCallbackDummy)
|
||||
// Wait for fossil to finish falling / disintegrating
|
||||
if (gSprites[sFallingFossil->spriteId].callback != SpriteCallbackDummy)
|
||||
return;
|
||||
DestroySprite(&gSprites[sUnknown_0203CF0C->spriteId]);
|
||||
FREE_AND_SET_NULL(sUnknown_0203CF0C->unkC);;
|
||||
FREE_AND_SET_NULL(sUnknown_0203CF0C->frameImage);
|
||||
FREE_AND_SET_NULL(sUnknown_0203CF0C->frameImageTiles);
|
||||
FREE_AND_SET_NULL(sUnknown_0203CF0C);
|
||||
DestroySprite(&gSprites[sFallingFossil->spriteId]);
|
||||
FREE_AND_SET_NULL(sFallingFossil->disintegrateRand);;
|
||||
FREE_AND_SET_NULL(sFallingFossil->frameImage);
|
||||
FREE_AND_SET_NULL(sFallingFossil->frameImageTiles);
|
||||
FREE_AND_SET_NULL(sFallingFossil);
|
||||
break;
|
||||
case 8:
|
||||
EnableBothScriptContexts();
|
||||
break;
|
||||
}
|
||||
|
||||
gTasks[taskId].data[0]++;
|
||||
gTasks[taskId].tState++;
|
||||
}
|
||||
|
||||
static void sub_81BF248(struct Sprite *sprite)
|
||||
static void SpriteCB_FallingFossil(struct Sprite *sprite)
|
||||
{
|
||||
if (sUnknown_0203CF0C->unk10 >= (ROOT_FOSSIL_GFX_RANDOMIZER_LENGTH))
|
||||
if (sFallingFossil->disintegrateIdx >= FOSSIL_DISINTEGRATE_LENGTH)
|
||||
{
|
||||
// End animation
|
||||
sprite->callback = SpriteCallbackDummy;
|
||||
}
|
||||
else if (sprite->y >= 96)
|
||||
{
|
||||
// Fossil has reached the ground, update disintegration animation
|
||||
u8 i;
|
||||
for (i = 0; i < 2; i++)
|
||||
sub_81BF2B8(sUnknown_0203CF0C->frameImageTiles, sUnknown_0203CF0C->unkC[sUnknown_0203CF0C->unk10++], 0, 16, 0);
|
||||
UpdateDisintegrationEffect(sFallingFossil->frameImageTiles, sFallingFossil->disintegrateRand[sFallingFossil->disintegrateIdx++], 0, 16, 0);
|
||||
|
||||
StartSpriteAnim(sprite, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Fossil is still falling
|
||||
sprite->y++;
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_81BF2B8(u8* a, u16 b, u8 c, u8 d, u8 e)
|
||||
static void UpdateDisintegrationEffect(u8* tiles, u16 randId, u8 c, u8 size, u8 offset)
|
||||
{
|
||||
u8 r5, r4, r0, r2;
|
||||
u16 var, var2;
|
||||
u8 r2_1, r4_1;
|
||||
u8 b2, c2;
|
||||
u8 heightTiles, height, widthTiles, width;
|
||||
u16 var, baseOffset;
|
||||
u8 col, row;
|
||||
u8 flag, tileMask;
|
||||
|
||||
r4 = b / d;
|
||||
gUnknown_030012A8[0] = r4;
|
||||
height = randId / size;
|
||||
sDebug_DisintegrationData[0] = height;
|
||||
|
||||
r2 = b % d;
|
||||
gUnknown_030012A8[1] = r2;
|
||||
width = randId % size;
|
||||
sDebug_DisintegrationData[1] = width;
|
||||
|
||||
r4_1 = r4 & 7;
|
||||
r2_1 = r2 & 7;
|
||||
gUnknown_030012A8[2] = r4 & 7; //should be using r4_1, but that doesn't match
|
||||
gUnknown_030012A8[3] = r2 & 7; //"
|
||||
row = height & 7;
|
||||
col = width & 7;
|
||||
sDebug_DisintegrationData[2] = height & 7;
|
||||
sDebug_DisintegrationData[3] = width & 7;
|
||||
|
||||
r0 = r2 / 8;
|
||||
r5 = r4 / 8;
|
||||
|
||||
gUnknown_030012A8[4] = r2 / 8; //should be using r0, but that doesn't match
|
||||
gUnknown_030012A8[5] = r4 / 8; //should be using r5, but that doesn't match
|
||||
widthTiles = width / 8;
|
||||
heightTiles = height / 8;
|
||||
sDebug_DisintegrationData[4] = width / 8;
|
||||
sDebug_DisintegrationData[5] = height / 8;
|
||||
|
||||
var = (d / 8) * (r5 * 64) + (r0 * 64);
|
||||
gUnknown_030012A8[6] = var;
|
||||
var = (size / 8) * (heightTiles * 64) + (widthTiles * 64);
|
||||
sDebug_DisintegrationData[6] = var;
|
||||
|
||||
var2 = var + ((r4_1 * 8) + r2_1);
|
||||
var2 /= 2;
|
||||
gUnknown_030012A8[7] = var + ((r4_1 * 8) + r2_1); //should be using var2 with var2 being divided afterwards, but that doesn't match
|
||||
baseOffset = var + ((row * 8) + col);
|
||||
baseOffset /= 2;
|
||||
sDebug_DisintegrationData[7] = var + ((row * 8) + col);
|
||||
|
||||
b2 = ((b % 2) ^ 1);
|
||||
c2 = (c << (b2 << 2)) | 15 << (((b2 ^ 1) << 2));
|
||||
a[var2 + (e * 32)] &= c2;
|
||||
flag = ((randId % 2) ^ 1);
|
||||
tileMask = (c << (flag << 2)) | 15 << (((flag ^ 1) << 2));
|
||||
tiles[baseOffset + (offset * 32)] &= tileMask;
|
||||
}
|
||||
|
||||
+4
-4
@@ -119,7 +119,7 @@ static void sub_816C060(u16 itemId);
|
||||
static void sub_816BEF0(s32 id);
|
||||
static void sub_816B4DC(u8 taskId);
|
||||
static void ItemStorage_MoveCursor(s32 id, bool8 b, struct ListMenu * thisMenu);
|
||||
static void fish4_goto_x5_or_x6(u8 windowId, s32 id, u8 yOffset);
|
||||
static void fish4_goto_x5_or_x6(u8 windowId, u32 id, u8 yOffset);
|
||||
|
||||
// EWRAM
|
||||
static EWRAM_DATA const u8 *gPcItemMenuOptionOrder = NULL;
|
||||
@@ -943,7 +943,7 @@ static void ItemStorage_MoveCursor(s32 id, bool8 b, struct ListMenu *thisMenu)
|
||||
if (gUnknown_0203BCC4->unk666 == 0xFF)
|
||||
{
|
||||
sub_816C0C8();
|
||||
if (id != -2)
|
||||
if (id != LIST_CANCEL)
|
||||
sub_816C060(gSaveBlock1Ptr->pcItems[id].itemId);
|
||||
else
|
||||
sub_816C060(ITEMPC_GO_BACK_TO_PREV);
|
||||
@@ -951,9 +951,9 @@ static void ItemStorage_MoveCursor(s32 id, bool8 b, struct ListMenu *thisMenu)
|
||||
}
|
||||
}
|
||||
|
||||
static void fish4_goto_x5_or_x6(u8 windowId, s32 id, u8 yOffset)
|
||||
static void fish4_goto_x5_or_x6(u8 windowId, u32 id, u8 yOffset)
|
||||
{
|
||||
if (id != -2)
|
||||
if (id != LIST_CANCEL)
|
||||
{
|
||||
if (gUnknown_0203BCC4->unk666 != 0xFF)
|
||||
{
|
||||
|
||||
+4
-4
@@ -264,7 +264,7 @@ static const union AnimCmd *const sSpriteAnimTable_PokeblockCase[] =
|
||||
sSpriteAnim_PokeblockCase
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd sSpriteAffineAnim_85B26C8[] =
|
||||
static const union AffineAnimCmd sAffineAnim_PokeblockCaseShake[] =
|
||||
{
|
||||
AFFINEANIMCMD_FRAME(0, 0, -2, 2),
|
||||
AFFINEANIMCMD_FRAME(0, 0, 2, 4),
|
||||
@@ -273,9 +273,9 @@ static const union AffineAnimCmd sSpriteAffineAnim_85B26C8[] =
|
||||
AFFINEANIMCMD_END
|
||||
};
|
||||
|
||||
static const union AffineAnimCmd *const sSpriteAffineAnimTable_85B26F0[] =
|
||||
static const union AffineAnimCmd *const sAffineAnims_PokeblockCaseShake[] =
|
||||
{
|
||||
sSpriteAffineAnim_85B26C8
|
||||
sAffineAnim_PokeblockCaseShake
|
||||
};
|
||||
|
||||
const struct CompressedSpriteSheet gPokeblockCase_SpriteSheet =
|
||||
@@ -955,7 +955,7 @@ static void SpriteCB_ShakePokeblockCase(struct Sprite *sprite)
|
||||
{
|
||||
case 0:
|
||||
sprite->oam.affineMode = ST_OAM_AFFINE_NORMAL;
|
||||
sprite->affineAnims = sSpriteAffineAnimTable_85B26F0;
|
||||
sprite->affineAnims = sAffineAnims_PokeblockCaseShake;
|
||||
InitSpriteAffineAnim(sprite);
|
||||
sprite->sState = 1;
|
||||
sprite->sTimer = 0;
|
||||
|
||||
@@ -327,7 +327,9 @@ static u32 LoopedTask_OpenRegionMap(s32 taskState)
|
||||
}
|
||||
else
|
||||
{
|
||||
sub_8123030(RGB_BLACK, 6);
|
||||
// Dim the region map when zoom is disabled
|
||||
// (when the player is off the map)
|
||||
BlendRegionMap(RGB_BLACK, 6);
|
||||
}
|
||||
return LT_INC_AND_PAUSE;
|
||||
case 2:
|
||||
|
||||
+10
-8
@@ -71,7 +71,7 @@ static EWRAM_DATA struct {
|
||||
bool8 choseFlyLocation;
|
||||
} *sFlyMap = NULL;
|
||||
|
||||
static bool32 gUnknown_03001180;
|
||||
static bool32 sDrawFlyDestTextWindow;
|
||||
|
||||
// Static ROM declarations
|
||||
|
||||
@@ -621,7 +621,7 @@ bool8 LoadRegionMapGfx(void)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void sub_8123030(u16 color, u32 coeff)
|
||||
void BlendRegionMap(u16 color, u32 coeff)
|
||||
{
|
||||
BlendPalettes(0x380, coeff, color);
|
||||
CpuCopy16(gPlttBufferFaded + 0x70, gPlttBufferUnfaded + 0x70, 0x60);
|
||||
@@ -1696,7 +1696,7 @@ void CB2_OpenFlyMap(void)
|
||||
CreateRegionMapPlayerIcon(1, 1);
|
||||
sFlyMap->mapSecId = sFlyMap->regionMap.mapSecId;
|
||||
StringFill(sFlyMap->nameBuffer, CHAR_SPACE, MAP_NAME_LENGTH);
|
||||
gUnknown_03001180 = TRUE;
|
||||
sDrawFlyDestTextWindow = TRUE;
|
||||
DrawFlyDestTextWindow();
|
||||
gMain.state++;
|
||||
break;
|
||||
@@ -1782,30 +1782,32 @@ static void DrawFlyDestTextWindow(void)
|
||||
name = sMultiNameFlyDestinations[i].name[sFlyMap->regionMap.posWithinMapSec];
|
||||
AddTextPrinterParameterized(1, 1, name, GetStringRightAlignXOffset(1, name, 96), 17, 0, NULL);
|
||||
ScheduleBgCopyTilemapToVram(0);
|
||||
gUnknown_03001180 = TRUE;
|
||||
sDrawFlyDestTextWindow = TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!namePrinted)
|
||||
{
|
||||
if (gUnknown_03001180 == TRUE)
|
||||
if (sDrawFlyDestTextWindow == TRUE)
|
||||
{
|
||||
ClearStdWindowAndFrameToTransparent(1, FALSE);
|
||||
DrawStdFrameWithCustomTileAndPalette(0, FALSE, 101, 13);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Window is already drawn, just empty it
|
||||
FillWindowPixelBuffer(0, PIXEL_FILL(1));
|
||||
}
|
||||
AddTextPrinterParameterized(0, 1, sFlyMap->regionMap.mapSecName, 0, 1, 0, NULL);
|
||||
ScheduleBgCopyTilemapToVram(0);
|
||||
gUnknown_03001180 = FALSE;
|
||||
sDrawFlyDestTextWindow = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gUnknown_03001180 == TRUE)
|
||||
// Selection is on MAPSECTYPE_NONE, draw empty fly destination text window
|
||||
if (sDrawFlyDestTextWindow == TRUE)
|
||||
{
|
||||
ClearStdWindowAndFrameToTransparent(1, FALSE);
|
||||
DrawStdFrameWithCustomTileAndPalette(0, FALSE, 101, 13);
|
||||
@@ -1813,7 +1815,7 @@ static void DrawFlyDestTextWindow(void)
|
||||
FillWindowPixelBuffer(0, PIXEL_FILL(1));
|
||||
CopyWindowToVram(0, 2);
|
||||
ScheduleBgCopyTilemapToVram(0);
|
||||
gUnknown_03001180 = FALSE;
|
||||
sDrawFlyDestTextWindow = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+7
-3
@@ -1203,6 +1203,8 @@ bool8 ScrCmd_turnvobject(struct ScriptContext *ctx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// lockall freezes all object events except the player immediately.
|
||||
// The player is frozen after waiting for their current movement to finish.
|
||||
bool8 ScrCmd_lockall(struct ScriptContext *ctx)
|
||||
{
|
||||
if (IsUpdateLinkStateCBActive())
|
||||
@@ -1211,12 +1213,14 @@ bool8 ScrCmd_lockall(struct ScriptContext *ctx)
|
||||
}
|
||||
else
|
||||
{
|
||||
ScriptFreezeObjectEvents();
|
||||
FreezeObjects_WaitForPlayer();
|
||||
SetupNativeScript(ctx, IsFreezePlayerFinished);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// lock freezes all object events except the player and the selected object immediately.
|
||||
// The player and selected object are frozen after waiting for their current movement to finish.
|
||||
bool8 ScrCmd_lock(struct ScriptContext *ctx)
|
||||
{
|
||||
if (IsUpdateLinkStateCBActive())
|
||||
@@ -1227,12 +1231,12 @@ bool8 ScrCmd_lock(struct ScriptContext *ctx)
|
||||
{
|
||||
if (gObjectEvents[gSelectedObjectEvent].active)
|
||||
{
|
||||
LockSelectedObjectEvent();
|
||||
FreezeObjects_WaitForPlayerAndSelected();
|
||||
SetupNativeScript(ctx, IsFreezeSelectedObjectAndPlayerFinished);
|
||||
}
|
||||
else
|
||||
{
|
||||
ScriptFreezeObjectEvents();
|
||||
FreezeObjects_WaitForPlayer();
|
||||
SetupNativeScript(ctx, IsFreezePlayerFinished);
|
||||
}
|
||||
return TRUE;
|
||||
|
||||
+5
-5
@@ -91,7 +91,7 @@ static void Task_ReturnToItemListAfterDecorationPurchase(u8 taskId);
|
||||
static void Task_HandleShopMenuBuy(u8 taskId);
|
||||
static void Task_HandleShopMenuSell(u8 taskId);
|
||||
static void BuyMenuPrintItemDescriptionAndShowItemIcon(s32 item, bool8 onInit, struct ListMenu *list);
|
||||
static void BuyMenuPrintPriceInList(u8 windowId, s32 item, u8 y);
|
||||
static void BuyMenuPrintPriceInList(u8 windowId, u32 itemId, u8 y);
|
||||
|
||||
static const struct YesNoFuncTable sShopPurchaseYesNoFuncs =
|
||||
{
|
||||
@@ -552,17 +552,17 @@ static void BuyMenuPrintItemDescriptionAndShowItemIcon(s32 item, bool8 onInit, s
|
||||
BuyMenuPrint(2, description, 3, 1, 0, 0);
|
||||
}
|
||||
|
||||
static void BuyMenuPrintPriceInList(u8 windowId, s32 item, u8 y)
|
||||
static void BuyMenuPrintPriceInList(u8 windowId, u32 itemId, u8 y)
|
||||
{
|
||||
u8 x;
|
||||
|
||||
if (item != LIST_CANCEL)
|
||||
if (itemId != LIST_CANCEL)
|
||||
{
|
||||
if (sMartInfo.martType == MART_TYPE_NORMAL)
|
||||
{
|
||||
ConvertIntToDecimalStringN(
|
||||
gStringVar1,
|
||||
ItemId_GetPrice(item) >> GetPriceReduction(POKENEWS_SLATEPORT),
|
||||
ItemId_GetPrice(itemId) >> GetPriceReduction(POKENEWS_SLATEPORT),
|
||||
STR_CONV_MODE_LEFT_ALIGN,
|
||||
5);
|
||||
}
|
||||
@@ -570,7 +570,7 @@ static void BuyMenuPrintPriceInList(u8 windowId, s32 item, u8 y)
|
||||
{
|
||||
ConvertIntToDecimalStringN(
|
||||
gStringVar1,
|
||||
gDecorations[item].price,
|
||||
gDecorations[itemId].price,
|
||||
STR_CONV_MODE_LEFT_ALIGN,
|
||||
5);
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "data.h"
|
||||
#include "constants/battle_frontier.h"
|
||||
#include "constants/contest.h"
|
||||
#include "constants/event_objects.h"
|
||||
#include "constants/items.h"
|
||||
#include "constants/layouts.h"
|
||||
#include "constants/lilycove_lady.h"
|
||||
@@ -335,19 +336,19 @@ static const u8 *const sTVPokemonTodaySuccessfulTextGroup[] = {
|
||||
};
|
||||
|
||||
static const u8 *const sTVTodaysSmartShopperTextGroup[] = {
|
||||
gTVTodaysSmartShopperText00,
|
||||
gTVTodaysSmartShopperText01,
|
||||
gTVTodaysSmartShopperText02,
|
||||
gTVTodaysSmartShopperText03,
|
||||
gTVTodaysSmartShopperText04,
|
||||
gTVTodaysSmartShopperText05,
|
||||
gTVTodaysSmartShopperText06,
|
||||
gTVTodaysSmartShopperText07,
|
||||
gTVTodaysSmartShopperText08,
|
||||
gTVTodaysSmartShopperText09,
|
||||
gTVTodaysSmartShopperText10,
|
||||
gTVTodaysSmartShopperText11,
|
||||
gTVTodaysSmartShopperText12
|
||||
[SMARTSHOPPER_STATE_INTRO] = SmartShopper_Text_Intro,
|
||||
[SMARTSHOPPER_STATE_CLERK_NORMAL] = SmartShopper_Text_ClerkNormal,
|
||||
[SMARTSHOPPER_STATE_RAND_COMMENT_1] = SmartShopper_Text_RandomComment1,
|
||||
[SMARTSHOPPER_STATE_RAND_COMMENT_2] = SmartShopper_Text_RandomComment2,
|
||||
[SMARTSHOPPER_STATE_RAND_COMMENT_3] = SmartShopper_Text_RandomComment3,
|
||||
[SMARTSHOPPER_STATE_RAND_COMMENT_4] = SmartShopper_Text_RandomComment4,
|
||||
[SMARTSHOPPER_STATE_SECOND_ITEM] = SmartShopper_Text_SecondItem,
|
||||
[SMARTSHOPPER_STATE_THIRD_ITEM] = SmartShopper_Text_ThirdItem,
|
||||
[SMARTSHOPPER_STATE_DURING_SALE] = SmartShopper_Text_DuringSale,
|
||||
[SMARTSHOPPER_STATE_OUTRO_NORMAL] = SmartShopper_Text_OutroNormal,
|
||||
[SMARTSHOPPER_STATE_IS_VIP] = SmartShopper_Text_IsVIP,
|
||||
[SMARTSHOPPER_STATE_CLERK_MAX] = SmartShopper_Text_ClerkMax,
|
||||
[SMARTSHOPPER_STATE_OUTRO_MAX] = SmartShopper_Text_OutroMax
|
||||
};
|
||||
|
||||
static const u8 *const sTVBravoTrainerTextGroup[] = {
|
||||
@@ -2785,7 +2786,7 @@ size_t CountDigits(int value)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void sub_80EF40C(u8 varIdx, TVShow *show)
|
||||
static void SmartShopper_BufferPurchaseTotal(u8 varIdx, TVShow *show)
|
||||
{
|
||||
u8 i;
|
||||
int price;
|
||||
@@ -3421,7 +3422,7 @@ void GetMomOrDadStringForTVMessage(void)
|
||||
void HideBattleTowerReporter(void)
|
||||
{
|
||||
VarSet(VAR_BRAVO_TRAINER_BATTLE_TOWER_ON, 0);
|
||||
RemoveObjectEventByLocalIdAndMap(5, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
|
||||
RemoveObjectEventByLocalIdAndMap(LOCALID_BATTLE_TOWER_LOBBY_REPORTER, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup);
|
||||
FlagSet(FLAG_HIDE_BATTLE_TOWER_REPORTER);
|
||||
}
|
||||
|
||||
@@ -4460,78 +4461,85 @@ static void DoTVShowTodaysSmartShopper(void)
|
||||
state = sTVShowState;
|
||||
switch(state)
|
||||
{
|
||||
case 0:
|
||||
case SMARTSHOPPER_STATE_INTRO:
|
||||
TVShowConvertInternationalString(gStringVar1, show->smartshopperShow.playerName, show->smartshopperShow.language);
|
||||
GetMapName(gStringVar2, show->smartshopperShow.shopLocation, 0);
|
||||
if (show->smartshopperShow.itemAmounts[0] >= 255)
|
||||
sTVShowState = 11;
|
||||
sTVShowState = SMARTSHOPPER_STATE_CLERK_MAX;
|
||||
else
|
||||
sTVShowState = 1;
|
||||
sTVShowState = SMARTSHOPPER_STATE_CLERK_NORMAL;
|
||||
break;
|
||||
case 1:
|
||||
case SMARTSHOPPER_STATE_CLERK_NORMAL:
|
||||
TVShowConvertInternationalString(gStringVar1, show->smartshopperShow.playerName, show->smartshopperShow.language);
|
||||
StringCopy(gStringVar2, ItemId_GetName(show->smartshopperShow.itemIds[0]));
|
||||
ConvertIntToDecimalString(2, show->smartshopperShow.itemAmounts[0]);
|
||||
sTVShowState += 1 + (Random() % 4);
|
||||
// Pick a random comment (SMARTSHOPPER_STATE_RAND_COMMENT_#)
|
||||
sTVShowState += SMARTSHOPPER_STATE_CLERK_NORMAL + (Random() % (SMARTSHOPPER_STATE_RAND_COMMENT_4 - SMARTSHOPPER_STATE_RAND_COMMENT_1 + 1));
|
||||
break;
|
||||
case 2:
|
||||
case 4:
|
||||
case 5:
|
||||
case SMARTSHOPPER_STATE_RAND_COMMENT_1:
|
||||
case SMARTSHOPPER_STATE_RAND_COMMENT_3:
|
||||
case SMARTSHOPPER_STATE_RAND_COMMENT_4:
|
||||
if (show->smartshopperShow.itemIds[1] != ITEM_NONE)
|
||||
sTVShowState = 6;
|
||||
sTVShowState = SMARTSHOPPER_STATE_SECOND_ITEM;
|
||||
else
|
||||
sTVShowState = 10;
|
||||
sTVShowState = SMARTSHOPPER_STATE_IS_VIP;
|
||||
break;
|
||||
case 3:
|
||||
case SMARTSHOPPER_STATE_RAND_COMMENT_2:
|
||||
ConvertIntToDecimalString(2, show->smartshopperShow.itemAmounts[0] + 1);
|
||||
if (show->smartshopperShow.itemIds[1] != ITEM_NONE)
|
||||
sTVShowState = 6;
|
||||
sTVShowState = SMARTSHOPPER_STATE_SECOND_ITEM;
|
||||
else
|
||||
sTVShowState = 10;
|
||||
sTVShowState = SMARTSHOPPER_STATE_IS_VIP;
|
||||
break;
|
||||
case 6:
|
||||
case SMARTSHOPPER_STATE_SECOND_ITEM:
|
||||
// Clerk describes 2nd type of item player purchased
|
||||
StringCopy(gStringVar2, ItemId_GetName(show->smartshopperShow.itemIds[1]));
|
||||
ConvertIntToDecimalString(2, show->smartshopperShow.itemAmounts[1]);
|
||||
if (show->smartshopperShow.itemIds[2] != ITEM_NONE)
|
||||
sTVShowState = 7;
|
||||
sTVShowState = SMARTSHOPPER_STATE_THIRD_ITEM;
|
||||
else if (show->smartshopperShow.priceReduced == TRUE)
|
||||
sTVShowState = 8;
|
||||
sTVShowState = SMARTSHOPPER_STATE_DURING_SALE;
|
||||
else
|
||||
sTVShowState = 9;
|
||||
sTVShowState = SMARTSHOPPER_STATE_OUTRO_NORMAL;
|
||||
break;
|
||||
case 7:
|
||||
case SMARTSHOPPER_STATE_THIRD_ITEM:
|
||||
// Clerk describes 3rd type of item player purchased
|
||||
StringCopy(gStringVar2, ItemId_GetName(show->smartshopperShow.itemIds[2]));
|
||||
ConvertIntToDecimalString(2, show->smartshopperShow.itemAmounts[2]);
|
||||
if (show->smartshopperShow.priceReduced == TRUE)
|
||||
sTVShowState = 8;
|
||||
sTVShowState = SMARTSHOPPER_STATE_DURING_SALE;
|
||||
else
|
||||
sTVShowState = 9;
|
||||
sTVShowState = SMARTSHOPPER_STATE_OUTRO_NORMAL;
|
||||
break;
|
||||
case 8:
|
||||
case SMARTSHOPPER_STATE_DURING_SALE:
|
||||
if (show->smartshopperShow.itemAmounts[0] >= 255)
|
||||
sTVShowState = 12;
|
||||
sTVShowState = SMARTSHOPPER_STATE_OUTRO_MAX;
|
||||
else
|
||||
sTVShowState = 9;
|
||||
sTVShowState = SMARTSHOPPER_STATE_OUTRO_NORMAL;
|
||||
break;
|
||||
case 9:
|
||||
sub_80EF40C(1, show);
|
||||
case SMARTSHOPPER_STATE_OUTRO_NORMAL:
|
||||
SmartShopper_BufferPurchaseTotal(1, show);
|
||||
TVShowDone();
|
||||
break;
|
||||
case 10:
|
||||
case SMARTSHOPPER_STATE_IS_VIP:
|
||||
// Clerk says customer is a VIP
|
||||
// Said if player only purchased one type of item
|
||||
if (show->smartshopperShow.priceReduced == TRUE)
|
||||
sTVShowState = 8;
|
||||
sTVShowState = SMARTSHOPPER_STATE_DURING_SALE;
|
||||
else
|
||||
sTVShowState = 9;
|
||||
sTVShowState = SMARTSHOPPER_STATE_OUTRO_NORMAL;
|
||||
break;
|
||||
case 11:
|
||||
case SMARTSHOPPER_STATE_CLERK_MAX:
|
||||
// Clerk's comments if player purchased maximum number of 1st item
|
||||
TVShowConvertInternationalString(gStringVar1, show->smartshopperShow.playerName, show->smartshopperShow.language);
|
||||
StringCopy(gStringVar2, ItemId_GetName(show->smartshopperShow.itemIds[0]));
|
||||
if (show->smartshopperShow.priceReduced == TRUE)
|
||||
sTVShowState = 8;
|
||||
sTVShowState = SMARTSHOPPER_STATE_DURING_SALE;
|
||||
else
|
||||
sTVShowState = 12;
|
||||
sTVShowState = SMARTSHOPPER_STATE_OUTRO_MAX;
|
||||
break;
|
||||
case 12:
|
||||
case SMARTSHOPPER_STATE_OUTRO_MAX:
|
||||
// Outro comments if player purchased maximum number of 1st item
|
||||
TVShowConvertInternationalString(gStringVar1, show->smartshopperShow.playerName, show->smartshopperShow.language);
|
||||
TVShowDone();
|
||||
break;
|
||||
|
||||
+9
-10
@@ -253,10 +253,10 @@ static bool32 UR_PrintFieldMessage(const u8 *);
|
||||
static s32 GetChatLeaderActionRequestMessage(u8 *, u32, u16 *, struct WirelessLink_URoom *);
|
||||
static void Task_InitUnionRoom(u8 taskId);
|
||||
static bool8 AreGnameUnameDifferent(struct WirelessGnameUnamePair*, const struct WirelessGnameUnamePair*);
|
||||
static void ItemPrintFunc_PossibleGroupMembers(u8, s32, u8);
|
||||
static void ListMenuItemPrintFunc_UnionRoomGroups(u8, s32, u8);
|
||||
static void TradeBoardListMenuItemPrintFunc(u8, s32, u8);
|
||||
static void nullsub_14(u8, s32, u8);
|
||||
static void ItemPrintFunc_PossibleGroupMembers(u8 windowId, u32 id, u8 y);
|
||||
static void ListMenuItemPrintFunc_UnionRoomGroups(u8 windowId, u32 id, u8 y);
|
||||
static void TradeBoardListMenuItemPrintFunc(u8 windowId, u32 id, u8 y);
|
||||
static void nullsub_14(u8 windowId, u32 id, u8 y);
|
||||
|
||||
#include "data/union_room.h"
|
||||
|
||||
@@ -835,7 +835,7 @@ static bool8 Leader_SetStateIfMemberListChanged(struct WirelessLink_Leader *data
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void ItemPrintFunc_PossibleGroupMembers(u8 windowId, s32 id, u8 y)
|
||||
static void ItemPrintFunc_PossibleGroupMembers(u8 windowId, u32 id, u8 y)
|
||||
{
|
||||
struct WirelessLink_Leader *data = sWirelessLinkMain.leader;
|
||||
u8 colorIdx = UR_COLOR_DKE_WHT_LTE;
|
||||
@@ -1363,7 +1363,7 @@ static u8 URoomGroupListGetTextColor(struct WirelessLink_Group *data, u32 id)
|
||||
return UR_COLOR_DKE_WHT_LTE;
|
||||
}
|
||||
|
||||
static void ListMenuItemPrintFunc_UnionRoomGroups(u8 windowId, s32 id, u8 y)
|
||||
static void ListMenuItemPrintFunc_UnionRoomGroups(u8 windowId, u32 id, u8 y)
|
||||
{
|
||||
struct WirelessLink_Group *data = sWirelessLinkMain.group;
|
||||
u8 colorId = URoomGroupListGetTextColor(data, id);
|
||||
@@ -4074,9 +4074,8 @@ static s32 UnionRoomGetPlayerInteractionResponse(struct UnkStruct_Main0 *main0,
|
||||
}
|
||||
}
|
||||
|
||||
void nullsub_14(u8 windowId, s32 itemId, u8 y)
|
||||
void nullsub_14(u8 windowId, u32 itemId, u8 y)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
static void TradeBoardPrintItemInfo(u8 windowId, u8 y, struct GFtgtGname * gname, const u8 * uname, u8 colorIdx)
|
||||
@@ -4100,7 +4099,7 @@ static void TradeBoardPrintItemInfo(u8 windowId, u8 y, struct GFtgtGname * gname
|
||||
}
|
||||
}
|
||||
|
||||
static void TradeBoardListMenuItemPrintFunc(u8 windowId, s32 itemId, u8 y)
|
||||
static void TradeBoardListMenuItemPrintFunc(u8 windowId, u32 itemId, u8 y)
|
||||
{
|
||||
struct WirelessLink_Leader *data = sWirelessLinkMain.leader;
|
||||
struct GFtgtGname *rfu;
|
||||
@@ -4420,7 +4419,7 @@ static void HandleCancelActivity(bool32 setData)
|
||||
static void UR_EnableScriptContext2AndFreezeObjectEvents(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
ScriptFreezeObjectEvents();
|
||||
FreezeObjects_WaitForPlayer();
|
||||
}
|
||||
|
||||
static u8 GetActivePartnerSpriteGenderParam(struct WirelessLink_URoom *data)
|
||||
|
||||
@@ -77,18 +77,27 @@ static const u8 sNextFacingDirection[] = {
|
||||
[DIR_EAST] = DIR_NORTH
|
||||
};
|
||||
|
||||
// Local id 1 is the Nurse/Attendant, 2-9 are link players
|
||||
static const u8 sUnionRoomLocalIds[] = { 9, 8, 7, 2, 6, 5, 4, 3 };
|
||||
static const u8 sUnionRoomLocalIds[] = {
|
||||
LOCALID_UNION_ROOM_PLAYER_1,
|
||||
LOCALID_UNION_ROOM_PLAYER_2,
|
||||
LOCALID_UNION_ROOM_PLAYER_3,
|
||||
LOCALID_UNION_ROOM_PLAYER_4,
|
||||
LOCALID_UNION_ROOM_PLAYER_5,
|
||||
LOCALID_UNION_ROOM_PLAYER_6,
|
||||
LOCALID_UNION_ROOM_PLAYER_7,
|
||||
LOCALID_UNION_ROOM_PLAYER_8
|
||||
};
|
||||
|
||||
static const u16 sUnknown[] = {
|
||||
0x2BF,
|
||||
0x2C0,
|
||||
0x2C1,
|
||||
0x2C2,
|
||||
0x2C3,
|
||||
0x2C4,
|
||||
0x2C5,
|
||||
0x2C6
|
||||
// Unused
|
||||
static const u16 sHidePlayerFlags[] = {
|
||||
FLAG_HIDE_UNION_ROOM_PLAYER_1,
|
||||
FLAG_HIDE_UNION_ROOM_PLAYER_2,
|
||||
FLAG_HIDE_UNION_ROOM_PLAYER_3,
|
||||
FLAG_HIDE_UNION_ROOM_PLAYER_4,
|
||||
FLAG_HIDE_UNION_ROOM_PLAYER_5,
|
||||
FLAG_HIDE_UNION_ROOM_PLAYER_6,
|
||||
FLAG_HIDE_UNION_ROOM_PLAYER_7,
|
||||
FLAG_HIDE_UNION_ROOM_PLAYER_8
|
||||
};
|
||||
|
||||
static const u8 sMovement_UnionPlayerExit[2] = {
|
||||
|
||||
Reference in New Issue
Block a user