mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 11:37:40 +01:00
Merge pull request #1474 from GriffinRichards/clean-miragetower
Clean up Mirage Tower
This commit is contained in:
commit
72bb2bd160
@ -563,7 +563,7 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_AddSemifinalAudience:: @ 824C594
|
|||||||
createvobject OBJ_EVENT_GFX_HEX_MANIAC, 28, 5, 2, 3, DIR_SOUTH
|
createvobject OBJ_EVENT_GFX_HEX_MANIAC, 28, 5, 2, 3, DIR_SOUTH
|
||||||
createvobject OBJ_EVENT_GFX_SCHOOL_KID_M, 29, 5, 1, 3, DIR_SOUTH
|
createvobject OBJ_EVENT_GFX_SCHOOL_KID_M, 29, 5, 1, 3, DIR_SOUTH
|
||||||
createvobject OBJ_EVENT_GFX_MART_EMPLOYEE, 30, 6, 2, 3, DIR_SOUTH
|
createvobject OBJ_EVENT_GFX_MART_EMPLOYEE, 30, 6, 2, 3, DIR_SOUTH
|
||||||
createvobject OBJ_EVENT_GFX_WOMAN_5, 31, 8, 2, 3, 1
|
createvobject OBJ_EVENT_GFX_WOMAN_5, 31, 8, 2, 3, DIR_SOUTH
|
||||||
return
|
return
|
||||||
|
|
||||||
BattleFrontier_BattleDomeBattleRoom_EventScript_AddFinalAudience:: @ 824C652
|
BattleFrontier_BattleDomeBattleRoom_EventScript_AddFinalAudience:: @ 824C652
|
||||||
|
@ -3,6 +3,8 @@
|
|||||||
.set LOCALID_ATTENDANT_MULTIS, 8
|
.set LOCALID_ATTENDANT_MULTIS, 8
|
||||||
.set LOCALID_ATTENDANT_LINK_MULTIS, 9
|
.set LOCALID_ATTENDANT_LINK_MULTIS, 9
|
||||||
|
|
||||||
|
@ Note: LOCALID_BATTLE_TOWER_LOBBY_REPORTER is a local id for this map used elsewhere. It's defined in event_objects.h
|
||||||
|
|
||||||
BattleFrontier_BattleTowerLobby_MapScripts:: @ 823E67B
|
BattleFrontier_BattleTowerLobby_MapScripts:: @ 823E67B
|
||||||
map_script MAP_SCRIPT_ON_RESUME, BattleFrontier_BattleTowerLobby_OnResume
|
map_script MAP_SCRIPT_ON_RESUME, BattleFrontier_BattleTowerLobby_OnResume
|
||||||
map_script MAP_SCRIPT_ON_TRANSITION, BattleFrontier_BattleTowerLobby_OnTransition
|
map_script MAP_SCRIPT_ON_TRANSITION, BattleFrontier_BattleTowerLobby_OnTransition
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
.set LOCALID_DEOXYS_ROCK, 1
|
|
||||||
.set LOCALID_DEOXYS, 2
|
.set LOCALID_DEOXYS, 2
|
||||||
|
|
||||||
|
@ Note: LOCALID_BIRTH_ISLAND_EXTERIOR_ROCK is a local id for this map used elsewhere. It's defined in event_objects.h
|
||||||
|
|
||||||
BirthIsland_Exterior_MapScripts:: @ 8267F15
|
BirthIsland_Exterior_MapScripts:: @ 8267F15
|
||||||
map_script MAP_SCRIPT_ON_TRANSITION, BirthIsland_Exterior_OnTransition
|
map_script MAP_SCRIPT_ON_TRANSITION, BirthIsland_Exterior_OnTransition
|
||||||
map_script MAP_SCRIPT_ON_RESUME, BirthIsland_Exterior_OnResume
|
map_script MAP_SCRIPT_ON_RESUME, BirthIsland_Exterior_OnResume
|
||||||
@ -68,9 +69,9 @@ BirthIsland_Exterior_EventScript_NotSolved3:: @ 8267FBF
|
|||||||
|
|
||||||
BirthIsland_Exterior_EventScript_Deoxys:: @ 8267FC1
|
BirthIsland_Exterior_EventScript_Deoxys:: @ 8267FC1
|
||||||
waitse
|
waitse
|
||||||
setfieldeffectargument 0, LOCALID_DEOXYS_ROCK
|
setfieldeffectargument 0, LOCALID_BIRTH_ISLAND_EXTERIOR_ROCK
|
||||||
setfieldeffectargument 1, 58
|
setfieldeffectargument 1, MAP_NUM(BIRTH_ISLAND_EXTERIOR)
|
||||||
setfieldeffectargument 2, 26
|
setfieldeffectargument 2, MAP_GROUP(BIRTH_ISLAND_EXTERIOR)
|
||||||
dofieldeffect FLDEFF_DESTROY_DEOXYS_ROCK
|
dofieldeffect FLDEFF_DESTROY_DEOXYS_ROCK
|
||||||
playbgm MUS_RG_ENCOUNTER_DEOXYS, FALSE
|
playbgm MUS_RG_ENCOUNTER_DEOXYS, FALSE
|
||||||
waitfieldeffect FLDEFF_DESTROY_DEOXYS_ROCK
|
waitfieldeffect FLDEFF_DESTROY_DEOXYS_ROCK
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
.set LOCALID_MEW, 1
|
@ Note: LOCALID_FARAWAY_ISLAND_MEW is a local id for this map used elsewhere. It's defined in event_objects.h
|
||||||
|
|
||||||
FarawayIsland_Interior_MapScripts:: @ 8267CFA
|
FarawayIsland_Interior_MapScripts:: @ 8267CFA
|
||||||
map_script MAP_SCRIPT_ON_RESUME, FarawayIsland_Interior_OnResume
|
map_script MAP_SCRIPT_ON_RESUME, FarawayIsland_Interior_OnResume
|
||||||
@ -58,13 +58,13 @@ FarawayIsland_Interior_OnFrame: @ 8267D98
|
|||||||
FarawayIsland_Interior_EventScript_FindMew:: @ 8267DA2
|
FarawayIsland_Interior_EventScript_FindMew:: @ 8267DA2
|
||||||
lockall
|
lockall
|
||||||
playse SE_PIN
|
playse SE_PIN
|
||||||
applymovement LOCALID_MEW, Common_Movement_ExclamationMark
|
applymovement LOCALID_FARAWAY_ISLAND_MEW, Common_Movement_ExclamationMark
|
||||||
waitmovement 0
|
waitmovement 0
|
||||||
applymovement LOCALID_MEW, Common_Movement_Delay48
|
applymovement LOCALID_FARAWAY_ISLAND_MEW, Common_Movement_Delay48
|
||||||
waitmovement 0
|
waitmovement 0
|
||||||
applymovement LOCALID_MEW, FarawayIsland_Interior_Movement_MewMoveAndHide
|
applymovement LOCALID_FARAWAY_ISLAND_MEW, FarawayIsland_Interior_Movement_MewMoveAndHide
|
||||||
waitmovement 0
|
waitmovement 0
|
||||||
copyobjectxytoperm LOCALID_MEW
|
copyobjectxytoperm LOCALID_FARAWAY_ISLAND_MEW
|
||||||
setvar VAR_TEMP_1, 1
|
setvar VAR_TEMP_1, 1
|
||||||
releaseall
|
releaseall
|
||||||
end
|
end
|
||||||
@ -120,7 +120,7 @@ FarawayIsland_Interior_Movement_MewFloatUpEast: @ 8267DEB
|
|||||||
FarawayIsland_Interior_EventScript_Mew:: @ 8267DF2
|
FarawayIsland_Interior_EventScript_Mew:: @ 8267DF2
|
||||||
lock
|
lock
|
||||||
faceplayer
|
faceplayer
|
||||||
applymovement LOCALID_MEW, FarawayIsland_Interior_Movement_MewAppear
|
applymovement LOCALID_FARAWAY_ISLAND_MEW, FarawayIsland_Interior_Movement_MewAppear
|
||||||
waitmovement 0
|
waitmovement 0
|
||||||
setvar VAR_0x8004, 0
|
setvar VAR_0x8004, 0
|
||||||
special SetMewAboveGrass
|
special SetMewAboveGrass
|
||||||
@ -171,22 +171,22 @@ FarawayIsland_Interior_EventScript_PlayerOrMewRan:: @ 8267EA4
|
|||||||
end
|
end
|
||||||
|
|
||||||
FarawayIsland_Interior_EventScript_FoundMewNorth:: @ 8267EAF
|
FarawayIsland_Interior_EventScript_FoundMewNorth:: @ 8267EAF
|
||||||
applymovement LOCALID_MEW, FarawayIsland_Interior_Movement_MewFloatUpNorth
|
applymovement LOCALID_FARAWAY_ISLAND_MEW, FarawayIsland_Interior_Movement_MewFloatUpNorth
|
||||||
waitmovement 0
|
waitmovement 0
|
||||||
return
|
return
|
||||||
|
|
||||||
FarawayIsland_Interior_EventScript_FoundMewSouth:: @ 8267EBA
|
FarawayIsland_Interior_EventScript_FoundMewSouth:: @ 8267EBA
|
||||||
applymovement LOCALID_MEW, FarawayIsland_Interior_Movement_MewFloatUpSouth
|
applymovement LOCALID_FARAWAY_ISLAND_MEW, FarawayIsland_Interior_Movement_MewFloatUpSouth
|
||||||
waitmovement 0
|
waitmovement 0
|
||||||
return
|
return
|
||||||
|
|
||||||
FarawayIsland_Interior_EventScript_FoundMewWest:: @ 8267EC5
|
FarawayIsland_Interior_EventScript_FoundMewWest:: @ 8267EC5
|
||||||
applymovement LOCALID_MEW, FarawayIsland_Interior_Movement_MewFloatUpWest
|
applymovement LOCALID_FARAWAY_ISLAND_MEW, FarawayIsland_Interior_Movement_MewFloatUpWest
|
||||||
waitmovement 0
|
waitmovement 0
|
||||||
return
|
return
|
||||||
|
|
||||||
FarawayIsland_Interior_EventScript_FoundMewEast:: @ 8267ED0
|
FarawayIsland_Interior_EventScript_FoundMewEast:: @ 8267ED0
|
||||||
applymovement LOCALID_MEW, FarawayIsland_Interior_Movement_MewFloatUpEast
|
applymovement LOCALID_FARAWAY_ISLAND_MEW, FarawayIsland_Interior_Movement_MewFloatUpEast
|
||||||
waitmovement 0
|
waitmovement 0
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -194,7 +194,7 @@ FarawayIsland_Interior_EventScript_HideMewWhenGrassCut:: @ 8267EDB
|
|||||||
lockall
|
lockall
|
||||||
fadescreenswapbuffers FADE_TO_BLACK
|
fadescreenswapbuffers FADE_TO_BLACK
|
||||||
setflag FLAG_HIDE_MEW
|
setflag FLAG_HIDE_MEW
|
||||||
removeobject LOCALID_MEW
|
removeobject LOCALID_FARAWAY_ISLAND_MEW
|
||||||
fadescreenswapbuffers FADE_FROM_BLACK
|
fadescreenswapbuffers FADE_FROM_BLACK
|
||||||
msgbox FarawayIsland_Interior_Text_TheFeelingOfBeingWatchedFaded, MSGBOX_DEFAULT
|
msgbox FarawayIsland_Interior_Text_TheFeelingOfBeingWatchedFaded, MSGBOX_DEFAULT
|
||||||
closemessage
|
closemessage
|
||||||
|
@ -2,9 +2,10 @@
|
|||||||
.set LOCALID_VICTORIA, 2
|
.set LOCALID_VICTORIA, 2
|
||||||
.set LOCALID_VIVI, 3
|
.set LOCALID_VIVI, 3
|
||||||
.set LOCALID_VICKY, 4
|
.set LOCALID_VICKY, 4
|
||||||
.set LOCALID_PLAYER_FALLING, 45
|
|
||||||
.set LOCALID_ROCK_SMASH_MAN, 46
|
.set LOCALID_ROCK_SMASH_MAN, 46
|
||||||
|
|
||||||
|
@ Note: LOCALID_ROUTE111_PLAYER_FALLING is a local id for this map used elsewhere. It's defined in event_objects.h
|
||||||
|
|
||||||
Route111_MapScripts:: @ 81F0CA7
|
Route111_MapScripts:: @ 81F0CA7
|
||||||
map_script MAP_SCRIPT_ON_LOAD, Route111_OnLoad
|
map_script MAP_SCRIPT_ON_LOAD, Route111_OnLoad
|
||||||
map_script MAP_SCRIPT_ON_TRANSITION, Route111_OnTransition
|
map_script MAP_SCRIPT_ON_TRANSITION, Route111_OnTransition
|
||||||
@ -127,11 +128,11 @@ Route111_EventScript_MirageTowerDisappear:: @ 81F0E60
|
|||||||
waitstate
|
waitstate
|
||||||
delay 24
|
delay 24
|
||||||
playse SE_FALL
|
playse SE_FALL
|
||||||
addobject LOCALID_PLAYER_FALLING
|
addobject LOCALID_ROUTE111_PLAYER_FALLING
|
||||||
special StartPlayerDescendMirageTower
|
special StartPlayerDescendMirageTower
|
||||||
waitstate
|
waitstate
|
||||||
showobjectat OBJ_EVENT_ID_PLAYER, MAP_LITTLEROOT_TOWN
|
showobjectat OBJ_EVENT_ID_PLAYER, MAP_LITTLEROOT_TOWN
|
||||||
removeobject LOCALID_PLAYER_FALLING
|
removeobject LOCALID_ROUTE111_PLAYER_FALLING
|
||||||
delay 16
|
delay 16
|
||||||
turnobject OBJ_EVENT_ID_PLAYER, DIR_NORTH
|
turnobject OBJ_EVENT_ID_PLAYER, DIR_NORTH
|
||||||
delay 16
|
delay 16
|
||||||
|
@ -1,11 +1,4 @@
|
|||||||
.set LOCALID_UR_PLAYER_4, 2
|
@ Note: LOCALID_UNION_ROOM_PLAYER_# are local ids for this map used elsewhere. They're defined in event_objects.h
|
||||||
.set LOCALID_UR_PLAYER_8, 3
|
|
||||||
.set LOCALID_UR_PLAYER_7, 4
|
|
||||||
.set LOCALID_UR_PLAYER_6, 5
|
|
||||||
.set LOCALID_UR_PLAYER_5, 6
|
|
||||||
.set LOCALID_UR_PLAYER_3, 7
|
|
||||||
.set LOCALID_UR_PLAYER_2, 8
|
|
||||||
.set LOCALID_UR_PLAYER_1, 9
|
|
||||||
|
|
||||||
UnionRoom_MapScripts:: @ 823D1A6
|
UnionRoom_MapScripts:: @ 823D1A6
|
||||||
map_script MAP_SCRIPT_ON_RESUME, UnionRoom_OnResume
|
map_script MAP_SCRIPT_ON_RESUME, UnionRoom_OnResume
|
||||||
@ -21,14 +14,14 @@ UnionRoom_OnResume: @ 823D1B1
|
|||||||
setflag FLAG_HIDE_UNION_ROOM_PLAYER_6
|
setflag FLAG_HIDE_UNION_ROOM_PLAYER_6
|
||||||
setflag FLAG_HIDE_UNION_ROOM_PLAYER_7
|
setflag FLAG_HIDE_UNION_ROOM_PLAYER_7
|
||||||
setflag FLAG_HIDE_UNION_ROOM_PLAYER_8
|
setflag FLAG_HIDE_UNION_ROOM_PLAYER_8
|
||||||
removeobject LOCALID_UR_PLAYER_1
|
removeobject LOCALID_UNION_ROOM_PLAYER_1
|
||||||
removeobject LOCALID_UR_PLAYER_2
|
removeobject LOCALID_UNION_ROOM_PLAYER_2
|
||||||
removeobject LOCALID_UR_PLAYER_3
|
removeobject LOCALID_UNION_ROOM_PLAYER_3
|
||||||
removeobject LOCALID_UR_PLAYER_4
|
removeobject LOCALID_UNION_ROOM_PLAYER_4
|
||||||
removeobject LOCALID_UR_PLAYER_5
|
removeobject LOCALID_UNION_ROOM_PLAYER_5
|
||||||
removeobject LOCALID_UR_PLAYER_6
|
removeobject LOCALID_UNION_ROOM_PLAYER_6
|
||||||
removeobject LOCALID_UR_PLAYER_7
|
removeobject LOCALID_UNION_ROOM_PLAYER_7
|
||||||
removeobject LOCALID_UR_PLAYER_8
|
removeobject LOCALID_UNION_ROOM_PLAYER_8
|
||||||
special RunUnionRoom
|
special RunUnionRoom
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 298 B |
@ -279,7 +279,37 @@
|
|||||||
|
|
||||||
#define FIRST_DECORATION_SPRITE_GFX OBJ_EVENT_GFX_PICHU_DOLL
|
#define FIRST_DECORATION_SPRITE_GFX OBJ_EVENT_GFX_PICHU_DOLL
|
||||||
|
|
||||||
|
// Special object event local ids
|
||||||
#define OBJ_EVENT_ID_PLAYER 0xFF
|
#define OBJ_EVENT_ID_PLAYER 0xFF
|
||||||
#define OBJ_EVENT_ID_CAMERA 0x7F
|
#define OBJ_EVENT_ID_CAMERA 0x7F
|
||||||
|
|
||||||
|
// Object event local ids referenced in C files
|
||||||
|
#define LOCALID_ROUTE111_PLAYER_FALLING 45
|
||||||
|
#define LOCALID_BIRTH_ISLAND_EXTERIOR_ROCK 1
|
||||||
|
#define LOCALID_FARAWAY_ISLAND_MEW 1
|
||||||
|
#define LOCALID_UNION_ROOM_PLAYER_4 2
|
||||||
|
#define LOCALID_UNION_ROOM_PLAYER_8 3
|
||||||
|
#define LOCALID_UNION_ROOM_PLAYER_7 4
|
||||||
|
#define LOCALID_UNION_ROOM_PLAYER_6 5
|
||||||
|
#define LOCALID_UNION_ROOM_PLAYER_5 6
|
||||||
|
#define LOCALID_UNION_ROOM_PLAYER_3 7
|
||||||
|
#define LOCALID_UNION_ROOM_PLAYER_2 8
|
||||||
|
#define LOCALID_UNION_ROOM_PLAYER_1 9
|
||||||
|
#define LOCALID_BATTLE_TOWER_LOBBY_REPORTER 5
|
||||||
|
#define LOCALID_TRUCK_BOX_TOP 1
|
||||||
|
#define LOCALID_TRUCK_BOX_BOTTOM_L 2
|
||||||
|
#define LOCALID_TRUCK_BOX_BOTTOM_R 3
|
||||||
|
#define LOCALID_OLDALE_MART_CLERK 1
|
||||||
|
#define LOCALID_LAVARIDGE_MART_CLERK 1
|
||||||
|
#define LOCALID_FALLARBOR_MART_CLERK 1
|
||||||
|
#define LOCALID_VERDANTURF_MART_CLERK 1
|
||||||
|
#define LOCALID_PETALBURG_MART_CLERK 1
|
||||||
|
#define LOCALID_SLATEPORT_MART_CLERK 1
|
||||||
|
#define LOCALID_MAUVILLE_MART_CLERK 1
|
||||||
|
#define LOCALID_RUSTBORO_MART_CLERK 1
|
||||||
|
#define LOCALID_FORTREE_MART_CLERK 1
|
||||||
|
#define LOCALID_MOSSDEEP_MART_CLERK 1
|
||||||
|
#define LOCALID_SOOTOPOLIS_MART_CLERK 1
|
||||||
|
#define LOCALID_BATTLE_FRONTIER_MART_CLERK 1
|
||||||
|
|
||||||
#endif // GUARD_CONSTANTS_EVENT_OBJECTS_H
|
#endif // GUARD_CONSTANTS_EVENT_OBJECTS_H
|
||||||
|
@ -38,7 +38,7 @@ static const s16 sFarawayIslandRockCoords[4][2] =
|
|||||||
static u8 GetMewObjectEventId(void)
|
static u8 GetMewObjectEventId(void)
|
||||||
{
|
{
|
||||||
u8 objectEventId;
|
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;
|
return objectEventId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,12 +72,12 @@ void Task_Truck1(u8 taskId)
|
|||||||
s16 cameraXpan = 0, cameraYpan = 0;
|
s16 cameraXpan = 0, cameraYpan = 0;
|
||||||
s16 box1, box2, box3;
|
s16 box1, box2, box3;
|
||||||
|
|
||||||
box1 = GetTruckBoxMovement(data[0] + 30) * 4; // top box.
|
box1 = GetTruckBoxMovement(data[0] + 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[0]) * 2; // bottom left box.
|
box2 = GetTruckBoxMovement(data[0]) * 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[0]) * 4; // bottom right box.
|
box3 = GetTruckBoxMovement(data[0]) * 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);
|
||||||
|
|
||||||
if (++data[0] == SECONDS(500)) // this will never run
|
if (++data[0] == SECONDS(500)) // this will never run
|
||||||
data[0] = 0; // reset the timer if it gets stuck.
|
data[0] = 0; // reset the timer if it gets stuck.
|
||||||
@ -116,11 +116,11 @@ void Task_Truck2(u8 taskId)
|
|||||||
cameraYpan = GetTruckCameraBobbingY(data[2]);
|
cameraYpan = GetTruckCameraBobbingY(data[2]);
|
||||||
SetCameraPanning(cameraXpan, cameraYpan);
|
SetCameraPanning(cameraXpan, cameraYpan);
|
||||||
box1 = GetTruckBoxMovement(data[2] + 30) * 4;
|
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;
|
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;
|
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]];
|
cameraXpan = gTruckCamera_HorizontalTable[data[1]];
|
||||||
cameraYpan = 0;
|
cameraYpan = 0;
|
||||||
SetCameraPanning(cameraXpan, 0);
|
SetCameraPanning(cameraXpan, 0);
|
||||||
SetObjectEventSpritePosByLocalIdAndMap(1, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3 - cameraXpan, cameraYpan + 3);
|
SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_TOP, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3 - cameraXpan, cameraYpan + 3);
|
||||||
SetObjectEventSpritePosByLocalIdAndMap(2, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -cameraXpan, cameraYpan - 3);
|
SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_L, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -cameraXpan, cameraYpan - 3);
|
||||||
SetObjectEventSpritePosByLocalIdAndMap(3, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3 - cameraXpan, cameraYpan);
|
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))
|
if (!FuncIsActiveTask(Task_HandleTruckSequence))
|
||||||
{
|
{
|
||||||
SetObjectEventSpritePosByLocalIdAndMap(1, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3, 3);
|
SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_TOP, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 3, 3);
|
||||||
SetObjectEventSpritePosByLocalIdAndMap(2, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 0, -3);
|
SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_L, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, 0, -3);
|
||||||
SetObjectEventSpritePosByLocalIdAndMap(3, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3, 0);
|
SetObjectEventSpritePosByLocalIdAndMap(LOCALID_TRUCK_BOX_BOTTOM_R, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, -3, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3429,7 +3429,7 @@ static void ChangeDeoxysRockLevel(u8 rockLevel)
|
|||||||
{
|
{
|
||||||
u8 objectEventId;
|
u8 objectEventId;
|
||||||
LoadPalette(&sDeoxysRockPalettes[rockLevel], 0x1A0, 8);
|
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)
|
if (rockLevel == 0)
|
||||||
PlaySE(SE_M_CONFUSE_RAY);
|
PlaySE(SE_M_CONFUSE_RAY);
|
||||||
@ -3437,9 +3437,9 @@ static void ChangeDeoxysRockLevel(u8 rockLevel)
|
|||||||
PlaySE(SE_RG_DEOXYS_MOVE);
|
PlaySE(SE_RG_DEOXYS_MOVE);
|
||||||
|
|
||||||
CreateTask(WaitForDeoxysRockMovement, 8);
|
CreateTask(WaitForDeoxysRockMovement, 8);
|
||||||
gFieldEffectArguments[0] = 1;
|
gFieldEffectArguments[0] = LOCALID_BIRTH_ISLAND_EXTERIOR_ROCK;
|
||||||
gFieldEffectArguments[1] = 58;
|
gFieldEffectArguments[1] = MAP_NUM(BIRTH_ISLAND_EXTERIOR);
|
||||||
gFieldEffectArguments[2] = 26;
|
gFieldEffectArguments[2] = MAP_GROUP(BIRTH_ISLAND_EXTERIOR);
|
||||||
gFieldEffectArguments[3] = sDeoxysRockCoords[rockLevel][0];
|
gFieldEffectArguments[3] = sDeoxysRockCoords[rockLevel][0];
|
||||||
gFieldEffectArguments[4] = sDeoxysRockCoords[rockLevel][1];
|
gFieldEffectArguments[4] = sDeoxysRockCoords[rockLevel][1];
|
||||||
|
|
||||||
@ -3686,18 +3686,18 @@ u32 GetMartEmployeeObjectEventId(void)
|
|||||||
{
|
{
|
||||||
static const u8 sPokeMarts[][3] =
|
static const u8 sPokeMarts[][3] =
|
||||||
{
|
{
|
||||||
{ MAP_GROUP(OLDALE_TOWN_MART), MAP_NUM(OLDALE_TOWN_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), 1 },
|
{ MAP_GROUP(LAVARIDGE_TOWN_MART), MAP_NUM(LAVARIDGE_TOWN_MART), LOCALID_LAVARIDGE_MART_CLERK },
|
||||||
{ MAP_GROUP(FALLARBOR_TOWN_MART), MAP_NUM(FALLARBOR_TOWN_MART), 1 },
|
{ MAP_GROUP(FALLARBOR_TOWN_MART), MAP_NUM(FALLARBOR_TOWN_MART), LOCALID_FALLARBOR_MART_CLERK },
|
||||||
{ MAP_GROUP(VERDANTURF_TOWN_MART), MAP_NUM(VERDANTURF_TOWN_MART), 1 },
|
{ MAP_GROUP(VERDANTURF_TOWN_MART), MAP_NUM(VERDANTURF_TOWN_MART), LOCALID_VERDANTURF_MART_CLERK },
|
||||||
{ MAP_GROUP(PETALBURG_CITY_MART), MAP_NUM(PETALBURG_CITY_MART), 1 },
|
{ MAP_GROUP(PETALBURG_CITY_MART), MAP_NUM(PETALBURG_CITY_MART), LOCALID_PETALBURG_MART_CLERK },
|
||||||
{ MAP_GROUP(SLATEPORT_CITY_MART), MAP_NUM(SLATEPORT_CITY_MART), 1 },
|
{ MAP_GROUP(SLATEPORT_CITY_MART), MAP_NUM(SLATEPORT_CITY_MART), LOCALID_SLATEPORT_MART_CLERK },
|
||||||
{ MAP_GROUP(MAUVILLE_CITY_MART), MAP_NUM(MAUVILLE_CITY_MART), 1 },
|
{ MAP_GROUP(MAUVILLE_CITY_MART), MAP_NUM(MAUVILLE_CITY_MART), LOCALID_MAUVILLE_MART_CLERK },
|
||||||
{ MAP_GROUP(RUSTBORO_CITY_MART), MAP_NUM(RUSTBORO_CITY_MART), 1 },
|
{ MAP_GROUP(RUSTBORO_CITY_MART), MAP_NUM(RUSTBORO_CITY_MART), LOCALID_RUSTBORO_MART_CLERK },
|
||||||
{ MAP_GROUP(FORTREE_CITY_MART), MAP_NUM(FORTREE_CITY_MART), 1 },
|
{ MAP_GROUP(FORTREE_CITY_MART), MAP_NUM(FORTREE_CITY_MART), LOCALID_FORTREE_MART_CLERK },
|
||||||
{ MAP_GROUP(MOSSDEEP_CITY_MART), MAP_NUM(MOSSDEEP_CITY_MART), 1 },
|
{ MAP_GROUP(MOSSDEEP_CITY_MART), MAP_NUM(MOSSDEEP_CITY_MART), LOCALID_MOSSDEEP_MART_CLERK },
|
||||||
{ MAP_GROUP(SOOTOPOLIS_CITY_MART), MAP_NUM(SOOTOPOLIS_CITY_MART), 1 },
|
{ MAP_GROUP(SOOTOPOLIS_CITY_MART), MAP_NUM(SOOTOPOLIS_CITY_MART), LOCALID_SOOTOPOLIS_MART_CLERK },
|
||||||
{ MAP_GROUP(BATTLE_FRONTIER_MART), MAP_NUM(BATTLE_FRONTIER_MART), 1 }
|
{ MAP_GROUP(BATTLE_FRONTIER_MART), MAP_NUM(BATTLE_FRONTIER_MART), LOCALID_BATTLE_FRONTIER_MART_CLERK }
|
||||||
};
|
};
|
||||||
|
|
||||||
u8 i;
|
u8 i;
|
||||||
|
@ -244,7 +244,7 @@ static const struct OamData sBerryPicRotatingOamData =
|
|||||||
.affineParam = 0
|
.affineParam = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
static const union AnimCmd sSpriteAnim_857FBD8[] =
|
static const union AnimCmd sAnim_BerryPic[] =
|
||||||
{
|
{
|
||||||
ANIMCMD_FRAME(0, 0),
|
ANIMCMD_FRAME(0, 0),
|
||||||
ANIMCMD_END
|
ANIMCMD_END
|
||||||
@ -252,7 +252,7 @@ static const union AnimCmd sSpriteAnim_857FBD8[] =
|
|||||||
|
|
||||||
static const union AnimCmd *const sBerryPicSpriteAnimTable[] =
|
static const union AnimCmd *const sBerryPicSpriteAnimTable[] =
|
||||||
{
|
{
|
||||||
sSpriteAnim_857FBD8
|
sAnim_BerryPic
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct SpriteFrameImage sBerryPicSpriteImageTable[] =
|
static const struct SpriteFrameImage sBerryPicSpriteImageTable[] =
|
||||||
|
@ -14,12 +14,14 @@
|
|||||||
#include "sprite.h"
|
#include "sprite.h"
|
||||||
#include "task.h"
|
#include "task.h"
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
#include "constants/event_objects.h"
|
||||||
#include "constants/maps.h"
|
#include "constants/maps.h"
|
||||||
#include "constants/rgb.h"
|
#include "constants/rgb.h"
|
||||||
#include "constants/songs.h"
|
#include "constants/songs.h"
|
||||||
#include "constants/metatile_labels.h"
|
#include "constants/metatile_labels.h"
|
||||||
|
|
||||||
struct MirageTowerPulseBlend {
|
struct MirageTowerPulseBlend
|
||||||
|
{
|
||||||
u8 taskId;
|
u8 taskId;
|
||||||
struct PulseBlend pulseBlend;
|
struct PulseBlend pulseBlend;
|
||||||
};
|
};
|
||||||
@ -37,59 +39,51 @@ struct BgRegOffsets
|
|||||||
u16 bgVOFS;
|
u16 bgVOFS;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Struct203CF10
|
struct FallAnim_Tower
|
||||||
{
|
{
|
||||||
u8 *buffer;
|
u8 *disintegrateRand;
|
||||||
u8 currIndex;
|
u8 disintegrateIdx;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DynamicSpriteFrameImage
|
struct FallAnim_Fossil
|
||||||
{
|
|
||||||
u8 *data;
|
|
||||||
u16 size;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Struct203CF0C
|
|
||||||
{
|
{
|
||||||
u8 *frameImageTiles;
|
u8 *frameImageTiles;
|
||||||
struct DynamicSpriteFrameImage *frameImage;
|
struct SpriteFrameImage *frameImage;
|
||||||
u8 spriteId;
|
u8 spriteId;
|
||||||
u16 *unkC;
|
u16 *disintegrateRand;
|
||||||
u16 unk10;
|
u16 disintegrateIdx;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define TAG_CEILING_CRUMBLE 4000
|
||||||
|
|
||||||
#define MIRAGE_TOWER_GFX_LENGTH (sizeof(sBlankTile_Gfx) + sizeof(sMirageTower_Gfx))
|
#define MIRAGE_TOWER_GFX_LENGTH (sizeof(sBlankTile_Gfx) + sizeof(sMirageTower_Gfx))
|
||||||
#define ROOT_FOSSIL_GFX_LENGTH sizeof(sRootFossil_Gfx)
|
#define FOSSIL_DISINTEGRATE_LENGTH 0x100
|
||||||
#define ROOT_FOSSIL_GFX_RANDOMIZER_LENGTH 0x100
|
|
||||||
|
|
||||||
// extern data
|
static const struct SpriteSheet sCeilingCrumbleSpriteSheets[];
|
||||||
extern const struct SpriteSheet gMirageTowerCeilingCrumbleSpriteSheets[];
|
static const s16 sCeilingCrumblePositions[][3];
|
||||||
extern const s16 sCeilingCrumblePositions[][3];
|
|
||||||
|
|
||||||
// static functions
|
static void PlayerDescendMirageTower(u8);
|
||||||
static void PlayerDescendMirageTower(u8 taskId);
|
static void DoScreenShake(u8);
|
||||||
static void DoScreenShake(u8 taskId);
|
|
||||||
static void IncrementCeilingCrumbleFinishedCount(void);
|
static void IncrementCeilingCrumbleFinishedCount(void);
|
||||||
static void WaitCeilingCrumble(u8 taskId);
|
static void WaitCeilingCrumble(u8);
|
||||||
static void FinishCeilingCrumbleTask(u8 taskId);
|
static void FinishCeilingCrumbleTask(u8);
|
||||||
static void CreateCeilingCrumbleSprites(void);
|
static void CreateCeilingCrumbleSprites(void);
|
||||||
static void MoveCeilingCrumbleSprite(struct Sprite* sprite);
|
static void SpriteCB_CeilingCrumble(struct Sprite*);
|
||||||
static void DoMirageTowerDisintegration(u8 taskId);
|
static void DoMirageTowerDisintegration(u8);
|
||||||
static void InitMirageTowerShake(u8 taskId);
|
static void InitMirageTowerShake(u8);
|
||||||
static void DoFossilFallAndSink(u8 taskId);
|
static void Task_FossilFallAndSink(u8);
|
||||||
static void sub_81BF248(struct Sprite *);
|
static void SpriteCB_FallingFossil(struct Sprite *);
|
||||||
static void sub_81BF2B8(u8* a, u16 b, u8 c, u8 d, u8 e);
|
static void UpdateDisintegrationEffect(u8*, u16, u8, u8, u8);
|
||||||
|
|
||||||
// rodata
|
|
||||||
static const u8 sBlankTile_Gfx[32] = {0};
|
static const u8 sBlankTile_Gfx[32] = {0};
|
||||||
static const u8 sMirageTower_Gfx[] = INCBIN_U8("graphics/misc/mirage_tower.4bpp");
|
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 sMirageTowerTilemap[] = INCBIN_U16("graphics/misc/mirage_tower.bin");
|
||||||
static const u16 sRootFossil_Pal[] = INCBIN_U16("graphics/misc/fossil.gbapal");
|
static const u16 sFossil_Pal[] = INCBIN_U16("graphics/object_events/pics/misc/fossil.gbapal"); // Unused
|
||||||
static const u8 sRootFossil_Gfx[] = INCBIN_U8("graphics/misc/fossil.4bpp");
|
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 u8 sMirageTowerCrumbles_Gfx[] = INCBIN_U8("graphics/misc/mirage_tower_crumbles.4bpp");
|
||||||
static const u16 sMirageTowerCrumbles_Palette[] = INCBIN_U16("graphics/misc/mirage_tower_crumbles.gbapal");
|
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},
|
{ 0, 10, 65},
|
||||||
{ 17, 3, 50},
|
{ 17, 3, 50},
|
||||||
@ -101,10 +95,10 @@ const s16 sCeilingCrumblePositions[][3] =
|
|||||||
{-24, -4, 65},
|
{-24, -4, 65},
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct SpriteSheet gMirageTowerCeilingCrumbleSpriteSheets[] =
|
static const struct SpriteSheet sCeilingCrumbleSpriteSheets[] =
|
||||||
{
|
{
|
||||||
{sMirageTowerCrumbles_Gfx, 0x0080, 4000},
|
{sMirageTowerCrumbles_Gfx, 0x80, TAG_CEILING_CRUMBLE},
|
||||||
{NULL}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct MetatileCoords sInvisibleMirageTowerMetatiles[] =
|
static const struct MetatileCoords sInvisibleMirageTowerMetatiles[] =
|
||||||
@ -129,13 +123,13 @@ static const struct MetatileCoords sInvisibleMirageTowerMetatiles[] =
|
|||||||
{20, 58, METATILE_General_SandPit_Center},
|
{20, 58, METATILE_General_SandPit_Center},
|
||||||
};
|
};
|
||||||
|
|
||||||
static const union AnimCmd gSpriteAnim_8617DEC[] =
|
static const union AnimCmd sAnim_FallingFossil[] =
|
||||||
{
|
{
|
||||||
ANIMCMD_FRAME(0, 1),
|
ANIMCMD_FRAME(0, 1),
|
||||||
ANIMCMD_END,
|
ANIMCMD_END,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct OamData gOamData_8617DF4 =
|
static const struct OamData sOamData_FallingFossil =
|
||||||
{
|
{
|
||||||
.y = 0,
|
.y = 0,
|
||||||
.affineMode = ST_OAM_AFFINE_OFF,
|
.affineMode = ST_OAM_AFFINE_OFF,
|
||||||
@ -152,14 +146,20 @@ static const struct OamData gOamData_8617DF4 =
|
|||||||
.affineParam = 0,
|
.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 = {
|
const struct PulseBlendSettings gMirageTowerPulseBlendSettings = {
|
||||||
@ -174,18 +174,18 @@ const struct PulseBlendSettings gMirageTowerPulseBlendSettings = {
|
|||||||
.unk7_7 = 1,
|
.unk7_7 = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const union AnimCmd sCeilingCrumble2AnimCmd[] =
|
static const union AnimCmd sAnim_CeilingCrumbleSmall[] =
|
||||||
{
|
{
|
||||||
ANIMCMD_FRAME(0, 12),
|
ANIMCMD_FRAME(0, 12),
|
||||||
ANIMCMD_JUMP(0),
|
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,
|
.y = 0,
|
||||||
.affineMode = ST_OAM_AFFINE_OFF,
|
.affineMode = ST_OAM_AFFINE_OFF,
|
||||||
@ -202,28 +202,28 @@ static const struct OamData sCeilingCrumble2OamData =
|
|||||||
.affineParam = 0,
|
.affineParam = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct SpriteTemplate sCeilingCrumbleSpriteTemplate2 = {
|
static const struct SpriteTemplate sSpriteTemplate_CeilingCrumbleSmall = {
|
||||||
.tileTag = 4000,
|
.tileTag = TAG_CEILING_CRUMBLE,
|
||||||
.paletteTag = 0xFFFF,
|
.paletteTag = 0xFFFF,
|
||||||
.oam = &sCeilingCrumble2OamData,
|
.oam = &sOamData_CeilingCrumbleSmall,
|
||||||
.anims = sCeilingCrumble2AnimCmds,
|
.anims = sAnims_CeilingCrumbleSmall,
|
||||||
.images = NULL,
|
.images = NULL,
|
||||||
.affineAnims = gDummySpriteAffineAnimTable,
|
.affineAnims = gDummySpriteAffineAnimTable,
|
||||||
.callback = MoveCeilingCrumbleSprite
|
.callback = SpriteCB_CeilingCrumble
|
||||||
};
|
};
|
||||||
|
|
||||||
static const union AnimCmd sCeilingCrumble1AnimCmd[] =
|
static const union AnimCmd sAnim_CeilingCrumbleLarge[] =
|
||||||
{
|
{
|
||||||
ANIMCMD_FRAME(0, 12),
|
ANIMCMD_FRAME(0, 12),
|
||||||
ANIMCMD_JUMP(0),
|
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,
|
.y = 0,
|
||||||
.affineMode = ST_OAM_AFFINE_OFF,
|
.affineMode = ST_OAM_AFFINE_OFF,
|
||||||
@ -240,24 +240,26 @@ static const struct OamData sCeilingCrumble1OamData =
|
|||||||
.affineParam = 0,
|
.affineParam = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct SpriteTemplate sCeilingCrumbleSpriteTemplate1 = {
|
static const struct SpriteTemplate sSpriteTemplate_CeilingCrumbleLarge = {
|
||||||
.tileTag = 4000,
|
.tileTag = TAG_CEILING_CRUMBLE,
|
||||||
.paletteTag = 0xFFFF,
|
.paletteTag = 0xFFFF,
|
||||||
.oam = &sCeilingCrumble1OamData,
|
.oam = &sOamData_CeilingCrumbleLarge,
|
||||||
.anims = sCeilingCrumble1AnimCmds,
|
.anims = sAnims_CeilingCrumbleLarge,
|
||||||
.images = NULL,
|
.images = NULL,
|
||||||
.affineAnims = gDummySpriteAffineAnimTable,
|
.affineAnims = gDummySpriteAffineAnimTable,
|
||||||
.callback = MoveCeilingCrumbleSprite
|
.callback = SpriteCB_CeilingCrumble
|
||||||
};
|
};
|
||||||
|
|
||||||
EWRAM_DATA static u8* sMirageTowerGfxBuffer = NULL;
|
EWRAM_DATA static u8* sMirageTowerGfxBuffer = NULL;
|
||||||
EWRAM_DATA static u8* sMirageTowerTilemapBuffer = NULL;
|
EWRAM_DATA static u8* sMirageTowerTilemapBuffer = NULL;
|
||||||
EWRAM_DATA static struct Struct203CF0C *sUnknown_0203CF0C = NULL;
|
EWRAM_DATA static struct FallAnim_Fossil *sFallingFossil = NULL;
|
||||||
EWRAM_DATA static struct Struct203CF10 *sUnknown_0203CF10 = NULL;
|
EWRAM_DATA static struct FallAnim_Tower *sFallingTower = NULL;
|
||||||
EWRAM_DATA static struct BgRegOffsets *sBgShakeOffsets = 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)
|
bool8 IsMirageTowerVisible(void)
|
||||||
{
|
{
|
||||||
@ -319,6 +321,7 @@ void SetMirageTowerVisibility(void)
|
|||||||
|
|
||||||
if (VarGet(VAR_MIRAGE_TOWER_STATE))
|
if (VarGet(VAR_MIRAGE_TOWER_STATE))
|
||||||
{
|
{
|
||||||
|
// Mirage Tower event has already been completed, hide it
|
||||||
FlagClear(FLAG_MIRAGE_TOWER_VISIBLE);
|
FlagClear(FLAG_MIRAGE_TOWER_VISIBLE);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -343,32 +346,40 @@ void StartPlayerDescendMirageTower(void)
|
|||||||
CreateTask(PlayerDescendMirageTower, 8);
|
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)
|
static void PlayerDescendMirageTower(u8 taskId)
|
||||||
{
|
{
|
||||||
u8 objectEventId;
|
u8 objectEventId;
|
||||||
struct ObjectEvent *fakePlayerObjectEvent;
|
struct ObjectEvent *fallingPlayer;
|
||||||
struct ObjectEvent *playerObjectEvent;
|
struct ObjectEvent *player;
|
||||||
|
|
||||||
TryGetObjectEventIdByLocalIdAndMap(45, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &objectEventId);
|
TryGetObjectEventIdByLocalIdAndMap(LOCALID_ROUTE111_PLAYER_FALLING, gSaveBlock1Ptr->location.mapNum, gSaveBlock1Ptr->location.mapGroup, &objectEventId);
|
||||||
fakePlayerObjectEvent = &gObjectEvents[objectEventId];
|
fallingPlayer = &gObjectEvents[objectEventId];
|
||||||
gSprites[fakePlayerObjectEvent->spriteId].pos2.y += 4;
|
gSprites[fallingPlayer->spriteId].pos2.y += 4;
|
||||||
playerObjectEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
|
player = &gObjectEvents[gPlayerAvatar.objectEventId];
|
||||||
if ((gSprites[fakePlayerObjectEvent->spriteId].pos1.y + gSprites[fakePlayerObjectEvent->spriteId].pos2.y) >=
|
if ((gSprites[fallingPlayer->spriteId].pos1.y + gSprites[fallingPlayer->spriteId].pos2.y) >=
|
||||||
(gSprites[playerObjectEvent->spriteId].pos1.y + gSprites[playerObjectEvent->spriteId].pos2.y))
|
(gSprites[player->spriteId].pos1.y + gSprites[player->spriteId].pos2.y))
|
||||||
{
|
{
|
||||||
DestroyTask(taskId);
|
DestroyTask(taskId);
|
||||||
EnableBothScriptContexts();
|
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)
|
static void StartScreenShake(u8 yShakeOffset, u8 xShakeOffset, u8 numShakes, u8 shakeDelay)
|
||||||
{
|
{
|
||||||
u8 taskId = CreateTask(DoScreenShake, 9);
|
u8 taskId = CreateTask(DoScreenShake, 9);
|
||||||
gTasks[taskId].data[0] = xShakeOffset;
|
gTasks[taskId].tXShakeOffset = xShakeOffset;
|
||||||
gTasks[taskId].data[1] = 0;
|
gTasks[taskId].tTimer = 0;
|
||||||
gTasks[taskId].data[2] = numShakes;
|
gTasks[taskId].tNumShakes = numShakes;
|
||||||
gTasks[taskId].data[3] = shakeDelay;
|
gTasks[taskId].tShakeDelay = shakeDelay;
|
||||||
gTasks[taskId].data[4] = yShakeOffset;
|
gTasks[taskId].tYShakeOffset = yShakeOffset;
|
||||||
SetCameraPanningCallback(NULL);
|
SetCameraPanningCallback(NULL);
|
||||||
PlaySE(SE_M_STRENGTH);
|
PlaySE(SE_M_STRENGTH);
|
||||||
}
|
}
|
||||||
@ -378,15 +389,15 @@ static void DoScreenShake(u8 taskId)
|
|||||||
s16 *data;
|
s16 *data;
|
||||||
|
|
||||||
data = gTasks[taskId].data;
|
data = gTasks[taskId].data;
|
||||||
data[1]++;
|
tTimer++;
|
||||||
if (data[1] % data[3] == 0)
|
if (tTimer % tShakeDelay == 0)
|
||||||
{
|
{
|
||||||
data[1] = 0;
|
tTimer = 0;
|
||||||
data[2]--;
|
tNumShakes--;
|
||||||
data[0] = -data[0];
|
tXShakeOffset = -tXShakeOffset;
|
||||||
data[4] = -data[4];
|
tYShakeOffset = -tYShakeOffset;
|
||||||
SetCameraPanning(data[0], data[4]);
|
SetCameraPanning(tXShakeOffset, tYShakeOffset);
|
||||||
if (data[2] == 0)
|
if (tNumShakes == 0)
|
||||||
{
|
{
|
||||||
IncrementCeilingCrumbleFinishedCount();
|
IncrementCeilingCrumbleFinishedCount();
|
||||||
DestroyTask(taskId);
|
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)
|
static void IncrementCeilingCrumbleFinishedCount(void)
|
||||||
{
|
{
|
||||||
u8 taskId = FindTaskIdByFunc(WaitCeilingCrumble);
|
u8 taskId = FindTaskIdByFunc(WaitCeilingCrumble);
|
||||||
@ -404,7 +421,7 @@ static void IncrementCeilingCrumbleFinishedCount(void)
|
|||||||
|
|
||||||
void DoMirageTowerCeilingCrumble(void)
|
void DoMirageTowerCeilingCrumble(void)
|
||||||
{
|
{
|
||||||
LoadSpriteSheets(gMirageTowerCeilingCrumbleSpriteSheets);
|
LoadSpriteSheets(sCeilingCrumbleSpriteSheets);
|
||||||
CreateCeilingCrumbleSprites();
|
CreateCeilingCrumbleSprites();
|
||||||
CreateTask(WaitCeilingCrumble, 8);
|
CreateTask(WaitCeilingCrumble, 8);
|
||||||
StartScreenShake(2, 1, 16, 3);
|
StartScreenShake(2, 1, 16, 3);
|
||||||
@ -421,7 +438,7 @@ static void WaitCeilingCrumble(u8 taskId)
|
|||||||
|
|
||||||
static void FinishCeilingCrumbleTask(u8 taskId)
|
static void FinishCeilingCrumbleTask(u8 taskId)
|
||||||
{
|
{
|
||||||
FreeSpriteTilesByTag(4000);
|
FreeSpriteTilesByTag(TAG_CEILING_CRUMBLE);
|
||||||
DestroyTask(taskId);
|
DestroyTask(taskId);
|
||||||
EnableBothScriptContexts();
|
EnableBothScriptContexts();
|
||||||
}
|
}
|
||||||
@ -433,21 +450,21 @@ static void CreateCeilingCrumbleSprites(void)
|
|||||||
|
|
||||||
for (i = 0; i < 8; i++)
|
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.priority = 0;
|
||||||
gSprites[spriteId].oam.paletteNum = 0;
|
gSprites[spriteId].oam.paletteNum = 0;
|
||||||
gSprites[spriteId].data[0] = i;
|
gSprites[spriteId].data[0] = i;
|
||||||
}
|
}
|
||||||
for (i = 0; i < 8; 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.priority = 0;
|
||||||
gSprites[spriteId].oam.paletteNum = 0;
|
gSprites[spriteId].oam.paletteNum = 0;
|
||||||
gSprites[spriteId].data[0] = i;
|
gSprites[spriteId].data[0] = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void MoveCeilingCrumbleSprite(struct Sprite* sprite)
|
static void SpriteCB_CeilingCrumble(struct Sprite* sprite)
|
||||||
{
|
{
|
||||||
sprite->data[1] += 2;
|
sprite->data[1] += 2;
|
||||||
sprite->pos2.y = sprite->data[1] / 2;
|
sprite->pos2.y = sprite->data[1] / 2;
|
||||||
@ -478,7 +495,7 @@ void StartMirageTowerShake(void)
|
|||||||
|
|
||||||
void StartMirageTowerFossilFallAndSink(void)
|
void StartMirageTowerFossilFallAndSink(void)
|
||||||
{
|
{
|
||||||
CreateTask(DoFossilFallAndSink, 9);
|
CreateTask(Task_FossilFallAndSink, 9);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SetBgShakeOffsets(void)
|
static void SetBgShakeOffsets(void)
|
||||||
@ -501,42 +518,44 @@ static void UpdateBgShake(u8 taskId)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define tState data[0]
|
||||||
|
|
||||||
static void InitMirageTowerShake(u8 taskId)
|
static void InitMirageTowerShake(u8 taskId)
|
||||||
{
|
{
|
||||||
u8 zero;
|
u8 zero;
|
||||||
|
|
||||||
switch (gTasks[taskId].data[0])
|
switch (gTasks[taskId].tState)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
FreeAllWindowBuffers();
|
FreeAllWindowBuffers();
|
||||||
SetBgAttribute(0, BG_ATTR_PRIORITY, 2);
|
SetBgAttribute(0, BG_ATTR_PRIORITY, 2);
|
||||||
gTasks[taskId].data[0]++;
|
gTasks[taskId].tState++;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
sMirageTowerGfxBuffer = (u8 *)AllocZeroed(MIRAGE_TOWER_GFX_LENGTH);
|
sMirageTowerGfxBuffer = (u8 *)AllocZeroed(MIRAGE_TOWER_GFX_LENGTH);
|
||||||
sMirageTowerTilemapBuffer = (u8 *)AllocZeroed(BG_SCREEN_SIZE);
|
sMirageTowerTilemapBuffer = (u8 *)AllocZeroed(BG_SCREEN_SIZE);
|
||||||
ChangeBgX(0, 0, 0);
|
ChangeBgX(0, 0, 0);
|
||||||
ChangeBgY(0, 0, 0);
|
ChangeBgY(0, 0, 0);
|
||||||
gTasks[taskId].data[0]++;
|
gTasks[taskId].tState++;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
CpuSet(sBlankTile_Gfx, sMirageTowerGfxBuffer, MIRAGE_TOWER_GFX_LENGTH / 2);
|
CpuSet(sBlankTile_Gfx, sMirageTowerGfxBuffer, MIRAGE_TOWER_GFX_LENGTH / 2);
|
||||||
LoadBgTiles(0, sMirageTowerGfxBuffer, MIRAGE_TOWER_GFX_LENGTH, 0);
|
LoadBgTiles(0, sMirageTowerGfxBuffer, MIRAGE_TOWER_GFX_LENGTH, 0);
|
||||||
gTasks[taskId].data[0]++;
|
gTasks[taskId].tState++;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
SetBgTilemapBuffer(0, sMirageTowerTilemapBuffer);
|
SetBgTilemapBuffer(0, sMirageTowerTilemapBuffer);
|
||||||
CopyToBgTilemapBufferRect_ChangePalette(0, &sMirageTowerTilemap, 12, 29, 6, 12, 17);
|
CopyToBgTilemapBufferRect_ChangePalette(0, &sMirageTowerTilemap, 12, 29, 6, 12, 17);
|
||||||
CopyBgTilemapBufferToVram(0);
|
CopyBgTilemapBufferToVram(0);
|
||||||
gTasks[taskId].data[0]++;
|
gTasks[taskId].tState++;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
ShowBg(0);
|
ShowBg(0);
|
||||||
gTasks[taskId].data[0]++;
|
gTasks[taskId].tState++;
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
SetInvisibleMirageTowerMetatiles();
|
SetInvisibleMirageTowerMetatiles();
|
||||||
gTasks[taskId].data[0]++;
|
gTasks[taskId].tState++;
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
sBgShakeOffsets = Alloc(sizeof(*sBgShakeOffsets));
|
sBgShakeOffsets = Alloc(sizeof(*sBgShakeOffsets));
|
||||||
@ -558,27 +577,29 @@ static void DoMirageTowerDisintegration(u8 taskId)
|
|||||||
u16 i;
|
u16 i;
|
||||||
u8 index;
|
u8 index;
|
||||||
|
|
||||||
switch (gTasks[taskId].data[0])
|
switch (gTasks[taskId].tState)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
sUnknown_0203CF10 = AllocZeroed(OUTER_BUFFER_LENGTH * sizeof(struct Struct203CF10));
|
sFallingTower = AllocZeroed(OUTER_BUFFER_LENGTH * sizeof(struct FallAnim_Tower));
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if (gTasks[taskId].data[3] <= (OUTER_BUFFER_LENGTH - 1))
|
if (gTasks[taskId].data[3] <= (OUTER_BUFFER_LENGTH - 1))
|
||||||
{
|
{
|
||||||
if (gTasks[taskId].data[1] > 1)
|
if (gTasks[taskId].data[1] > 1)
|
||||||
{
|
{
|
||||||
|
// Initialize disintegration pattern
|
||||||
index = gTasks[taskId].data[3];
|
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++)
|
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++)
|
for (i = 0; i <= (INNER_BUFFER_LENGTH - 1); i++)
|
||||||
{
|
{
|
||||||
u16 rand1, rand2, temp;
|
u16 rand1, rand2, temp;
|
||||||
|
rand1 = Random() % INNER_BUFFER_LENGTH;
|
||||||
rand1 = Random() % 0x30;
|
rand2 = Random() % INNER_BUFFER_LENGTH;
|
||||||
rand2 = Random() % 0x30;
|
SWAP(sFallingTower[index].disintegrateRand[rand2], sFallingTower[index].disintegrateRand[rand1], temp);
|
||||||
SWAP(sUnknown_0203CF10[index].buffer[rand2], sUnknown_0203CF10[index].buffer[rand1], temp);
|
|
||||||
}
|
}
|
||||||
if (gTasks[taskId].data[3] <= (OUTER_BUFFER_LENGTH - 1))
|
if (gTasks[taskId].data[3] <= (OUTER_BUFFER_LENGTH - 1))
|
||||||
gTasks[taskId].data[3]++;
|
gTasks[taskId].data[3]++;
|
||||||
@ -591,20 +612,20 @@ static void DoMirageTowerDisintegration(u8 taskId)
|
|||||||
{
|
{
|
||||||
for (j = 0; j < 1; j++)
|
for (j = 0; j < 1; j++)
|
||||||
{
|
{
|
||||||
sub_81BF2B8(sMirageTowerGfxBuffer,
|
UpdateDisintegrationEffect(sMirageTowerGfxBuffer,
|
||||||
((((OUTER_BUFFER_LENGTH - 1) - i) * INNER_BUFFER_LENGTH) + sUnknown_0203CF10[i].buffer[(sUnknown_0203CF10[i].currIndex)++]),
|
(OUTER_BUFFER_LENGTH - 1 - i) * INNER_BUFFER_LENGTH + sFallingTower[i].disintegrateRand[sFallingTower[i].disintegrateIdx++],
|
||||||
0, INNER_BUFFER_LENGTH, 1);
|
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]++;
|
gTasks[taskId].data[2]++;
|
||||||
if ((i % 2) == 1)
|
if ((i % 2) == 1)
|
||||||
sBgShakeOffsets->bgVOFS--;
|
sBgShakeOffsets->bgVOFS--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LoadBgTiles(0, sMirageTowerGfxBuffer, MIRAGE_TOWER_GFX_LENGTH, 0);
|
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;
|
break;
|
||||||
return;
|
return;
|
||||||
case 4:
|
case 4:
|
||||||
@ -617,7 +638,7 @@ static void DoMirageTowerDisintegration(u8 taskId)
|
|||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
FREE_AND_SET_NULL(sBgShakeOffsets);
|
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(sMirageTowerGfxBuffer);
|
||||||
FREE_AND_SET_NULL(sMirageTowerTilemapBuffer);
|
FREE_AND_SET_NULL(sMirageTowerTilemapBuffer);
|
||||||
break;
|
break;
|
||||||
@ -635,127 +656,128 @@ static void DoMirageTowerDisintegration(u8 taskId)
|
|||||||
EnableBothScriptContexts();
|
EnableBothScriptContexts();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
gTasks[taskId].data[0]++;
|
gTasks[taskId].tState++;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void DoFossilFallAndSink(u8 taskId)
|
static void Task_FossilFallAndSink(u8 taskId)
|
||||||
{
|
{
|
||||||
u16 i;
|
u16 i;
|
||||||
u8 *buffer;
|
u8 *buffer;
|
||||||
|
|
||||||
switch (gTasks[taskId].data[0])
|
switch (gTasks[taskId].tState)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
sUnknown_0203CF0C = AllocZeroed(sizeof(*sUnknown_0203CF0C));
|
sFallingFossil = AllocZeroed(sizeof(*sFallingFossil));
|
||||||
sUnknown_0203CF0C->frameImageTiles = AllocZeroed(ROOT_FOSSIL_GFX_LENGTH);
|
sFallingFossil->frameImageTiles = AllocZeroed(sizeof(sFossil_Gfx));
|
||||||
sUnknown_0203CF0C->frameImage = AllocZeroed(sizeof(*sUnknown_0203CF0C->frameImage));
|
sFallingFossil->frameImage = AllocZeroed(sizeof(*sFallingFossil->frameImage));
|
||||||
sUnknown_0203CF0C->unkC = AllocZeroed(ROOT_FOSSIL_GFX_RANDOMIZER_LENGTH * sizeof(u16));
|
sFallingFossil->disintegrateRand = AllocZeroed(FOSSIL_DISINTEGRATE_LENGTH * sizeof(u16));
|
||||||
sUnknown_0203CF0C->unk10 = 0;
|
sFallingFossil->disintegrateIdx = 0;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
buffer = sUnknown_0203CF0C->frameImageTiles;
|
buffer = sFallingFossil->frameImageTiles;
|
||||||
for (i = 0; i < ROOT_FOSSIL_GFX_LENGTH; i++, buffer++)
|
for (i = 0; i < sizeof(sFossil_Gfx); i++, buffer++)
|
||||||
*buffer = sRootFossil_Gfx[i];
|
*buffer = sFossil_Gfx[i];
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
sUnknown_0203CF0C->frameImage->data = sUnknown_0203CF0C->frameImageTiles;
|
sFallingFossil->frameImage->data = sFallingFossil->frameImageTiles;
|
||||||
sUnknown_0203CF0C->frameImage->size = ROOT_FOSSIL_GFX_LENGTH;
|
sFallingFossil->frameImage->size = sizeof(sFossil_Gfx);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
{
|
{
|
||||||
struct SpriteTemplate fossilTemplate;
|
struct SpriteTemplate fossilTemplate = sSpriteTemplate_FallingFossil;
|
||||||
|
fossilTemplate.images = sFallingFossil->frameImage;
|
||||||
fossilTemplate = gUnknown_08617E00;
|
sFallingFossil->spriteId = CreateSprite(&fossilTemplate, 128, -16, 1);
|
||||||
fossilTemplate.images = (struct SpriteFrameImage *)(sUnknown_0203CF0C->frameImage);
|
gSprites[sFallingFossil->spriteId].centerToCornerVecX = 0;
|
||||||
sUnknown_0203CF0C->spriteId = CreateSprite(&fossilTemplate, 128, -16, 1);
|
gSprites[sFallingFossil->spriteId].data[0] = gSprites[sFallingFossil->spriteId].pos1.x;
|
||||||
gSprites[sUnknown_0203CF0C->spriteId].centerToCornerVecX = 0;
|
gSprites[sFallingFossil->spriteId].data[1] = 1;
|
||||||
gSprites[sUnknown_0203CF0C->spriteId].data[0] = gSprites[sUnknown_0203CF0C->spriteId].pos1.x;
|
|
||||||
gSprites[sUnknown_0203CF0C->spriteId].data[1] = 1;
|
|
||||||
}
|
}
|
||||||
case 5:
|
case 5:
|
||||||
for (i = 0; i < ROOT_FOSSIL_GFX_RANDOMIZER_LENGTH; i++)
|
// Initialize disintegration pattern
|
||||||
sUnknown_0203CF0C->unkC[i] = i;
|
for (i = 0; i < FOSSIL_DISINTEGRATE_LENGTH; i++)
|
||||||
|
sFallingFossil->disintegrateRand[i] = i;
|
||||||
break;
|
break;
|
||||||
case 6:
|
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;
|
u16 rand1, rand2, temp;
|
||||||
|
rand1 = Random() % FOSSIL_DISINTEGRATE_LENGTH;
|
||||||
rand1 = Random() % 0x100;
|
rand2 = Random() % FOSSIL_DISINTEGRATE_LENGTH;
|
||||||
rand2 = Random() % 0x100;
|
SWAP(sFallingFossil->disintegrateRand[rand2], sFallingFossil->disintegrateRand[rand1], temp);
|
||||||
SWAP(sUnknown_0203CF0C->unkC[rand2], sUnknown_0203CF0C->unkC[rand1], temp);
|
|
||||||
}
|
}
|
||||||
gSprites[sUnknown_0203CF0C->spriteId].callback = sub_81BF248;
|
gSprites[sFallingFossil->spriteId].callback = SpriteCB_FallingFossil;
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (gSprites[sUnknown_0203CF0C->spriteId].callback != SpriteCallbackDummy)
|
// Wait for fossil to finish falling / disintegrating
|
||||||
|
if (gSprites[sFallingFossil->spriteId].callback != SpriteCallbackDummy)
|
||||||
return;
|
return;
|
||||||
DestroySprite(&gSprites[sUnknown_0203CF0C->spriteId]);
|
DestroySprite(&gSprites[sFallingFossil->spriteId]);
|
||||||
FREE_AND_SET_NULL(sUnknown_0203CF0C->unkC);;
|
FREE_AND_SET_NULL(sFallingFossil->disintegrateRand);;
|
||||||
FREE_AND_SET_NULL(sUnknown_0203CF0C->frameImage);
|
FREE_AND_SET_NULL(sFallingFossil->frameImage);
|
||||||
FREE_AND_SET_NULL(sUnknown_0203CF0C->frameImageTiles);
|
FREE_AND_SET_NULL(sFallingFossil->frameImageTiles);
|
||||||
FREE_AND_SET_NULL(sUnknown_0203CF0C);
|
FREE_AND_SET_NULL(sFallingFossil);
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
EnableBothScriptContexts();
|
EnableBothScriptContexts();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
gTasks[taskId].tState++;
|
||||||
gTasks[taskId].data[0]++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
sprite->callback = SpriteCallbackDummy;
|
||||||
}
|
}
|
||||||
else if (sprite->pos1.y >= 96)
|
else if (sprite->pos1.y >= 96)
|
||||||
{
|
{
|
||||||
|
// Fossil has reached the ground, update disintegration animation
|
||||||
u8 i;
|
u8 i;
|
||||||
for (i = 0; i < 2; 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);
|
StartSpriteAnim(sprite, 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Fossil is still falling
|
||||||
sprite->pos1.y++;
|
sprite->pos1.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;
|
u8 heightTiles, height, widthTiles, width;
|
||||||
u16 var, var2;
|
u16 var, baseOffset;
|
||||||
u8 r2_1, r4_1;
|
u8 col, row;
|
||||||
u8 b2, c2;
|
u8 flag, tileMask;
|
||||||
|
|
||||||
r4 = b / d;
|
height = randId / size;
|
||||||
gUnknown_030012A8[0] = r4;
|
sDebug_DisintegrationData[0] = height;
|
||||||
|
|
||||||
r2 = b % d;
|
width = randId % size;
|
||||||
gUnknown_030012A8[1] = r2;
|
sDebug_DisintegrationData[1] = width;
|
||||||
|
|
||||||
r4_1 = r4 & 7;
|
row = height & 7;
|
||||||
r2_1 = r2 & 7;
|
col = width & 7;
|
||||||
gUnknown_030012A8[2] = r4 & 7; //should be using r4_1, but that doesn't match
|
sDebug_DisintegrationData[2] = height & 7;
|
||||||
gUnknown_030012A8[3] = r2 & 7; //"
|
sDebug_DisintegrationData[3] = width & 7;
|
||||||
|
|
||||||
r0 = r2 / 8;
|
widthTiles = width / 8;
|
||||||
r5 = r4 / 8;
|
heightTiles = height / 8;
|
||||||
|
sDebug_DisintegrationData[4] = width / 8;
|
||||||
gUnknown_030012A8[4] = r2 / 8; //should be using r0, but that doesn't match
|
sDebug_DisintegrationData[5] = height / 8;
|
||||||
gUnknown_030012A8[5] = r4 / 8; //should be using r5, but that doesn't match
|
|
||||||
|
|
||||||
var = (d / 8) * (r5 * 64) + (r0 * 64);
|
var = (size / 8) * (heightTiles * 64) + (widthTiles * 64);
|
||||||
gUnknown_030012A8[6] = var;
|
sDebug_DisintegrationData[6] = var;
|
||||||
|
|
||||||
var2 = var + ((r4_1 * 8) + r2_1);
|
baseOffset = var + ((row * 8) + col);
|
||||||
var2 /= 2;
|
baseOffset /= 2;
|
||||||
gUnknown_030012A8[7] = var + ((r4_1 * 8) + r2_1); //should be using var2 with var2 being divided afterwards, but that doesn't match
|
sDebug_DisintegrationData[7] = var + ((row * 8) + col);
|
||||||
|
|
||||||
b2 = ((b % 2) ^ 1);
|
flag = ((randId % 2) ^ 1);
|
||||||
c2 = (c << (b2 << 2)) | 15 << (((b2 ^ 1) << 2));
|
tileMask = (c << (flag << 2)) | 15 << (((flag ^ 1) << 2));
|
||||||
a[var2 + (e * 32)] &= c2;
|
tiles[baseOffset + (offset * 32)] &= tileMask;
|
||||||
}
|
}
|
||||||
|
@ -264,7 +264,7 @@ static const union AnimCmd *const sSpriteAnimTable_PokeblockCase[] =
|
|||||||
sSpriteAnim_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, 2),
|
||||||
AFFINEANIMCMD_FRAME(0, 0, 2, 4),
|
AFFINEANIMCMD_FRAME(0, 0, 2, 4),
|
||||||
@ -273,9 +273,9 @@ static const union AffineAnimCmd sSpriteAffineAnim_85B26C8[] =
|
|||||||
AFFINEANIMCMD_END
|
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 =
|
const struct CompressedSpriteSheet gPokeblockCase_SpriteSheet =
|
||||||
@ -955,7 +955,7 @@ static void SpriteCB_ShakePokeblockCase(struct Sprite *sprite)
|
|||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
sprite->oam.affineMode = ST_OAM_AFFINE_NORMAL;
|
sprite->oam.affineMode = ST_OAM_AFFINE_NORMAL;
|
||||||
sprite->affineAnims = sSpriteAffineAnimTable_85B26F0;
|
sprite->affineAnims = sAffineAnims_PokeblockCaseShake;
|
||||||
InitSpriteAffineAnim(sprite);
|
InitSpriteAffineAnim(sprite);
|
||||||
sprite->sState = 1;
|
sprite->sState = 1;
|
||||||
sprite->sTimer = 0;
|
sprite->sTimer = 0;
|
||||||
|
3
src/tv.c
3
src/tv.c
@ -36,6 +36,7 @@
|
|||||||
#include "data.h"
|
#include "data.h"
|
||||||
#include "constants/battle_frontier.h"
|
#include "constants/battle_frontier.h"
|
||||||
#include "constants/contest.h"
|
#include "constants/contest.h"
|
||||||
|
#include "constants/event_objects.h"
|
||||||
#include "constants/items.h"
|
#include "constants/items.h"
|
||||||
#include "constants/layouts.h"
|
#include "constants/layouts.h"
|
||||||
#include "constants/lilycove_lady.h"
|
#include "constants/lilycove_lady.h"
|
||||||
@ -3421,7 +3422,7 @@ void GetMomOrDadStringForTVMessage(void)
|
|||||||
void HideBattleTowerReporter(void)
|
void HideBattleTowerReporter(void)
|
||||||
{
|
{
|
||||||
VarSet(VAR_BRAVO_TRAINER_BATTLE_TOWER_ON, 0);
|
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);
|
FlagSet(FLAG_HIDE_BATTLE_TOWER_REPORTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,18 +77,27 @@ static const u8 sNextFacingDirection[] = {
|
|||||||
[DIR_EAST] = DIR_NORTH
|
[DIR_EAST] = DIR_NORTH
|
||||||
};
|
};
|
||||||
|
|
||||||
// Local id 1 is the Nurse/Attendant, 2-9 are link players
|
static const u8 sUnionRoomLocalIds[] = {
|
||||||
static const u8 sUnionRoomLocalIds[] = { 9, 8, 7, 2, 6, 5, 4, 3 };
|
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[] = {
|
// Unused
|
||||||
0x2BF,
|
static const u16 sHidePlayerFlags[] = {
|
||||||
0x2C0,
|
FLAG_HIDE_UNION_ROOM_PLAYER_1,
|
||||||
0x2C1,
|
FLAG_HIDE_UNION_ROOM_PLAYER_2,
|
||||||
0x2C2,
|
FLAG_HIDE_UNION_ROOM_PLAYER_3,
|
||||||
0x2C3,
|
FLAG_HIDE_UNION_ROOM_PLAYER_4,
|
||||||
0x2C4,
|
FLAG_HIDE_UNION_ROOM_PLAYER_5,
|
||||||
0x2C5,
|
FLAG_HIDE_UNION_ROOM_PLAYER_6,
|
||||||
0x2C6
|
FLAG_HIDE_UNION_ROOM_PLAYER_7,
|
||||||
|
FLAG_HIDE_UNION_ROOM_PLAYER_8
|
||||||
};
|
};
|
||||||
|
|
||||||
static const u8 sMovement_UnionPlayerExit[2] = {
|
static const u8 sMovement_UnionPlayerExit[2] = {
|
||||||
|
Loading…
Reference in New Issue
Block a user