Merge master into fix-eventobj

This commit is contained in:
GriffinR 2020-01-15 16:11:20 -05:00
commit ea8b1011d3
21 changed files with 135 additions and 134 deletions

View File

@ -447,10 +447,10 @@ gStdScripts_End:: @ 81DC2CC
.include "data/maps/AlteringCave/scripts.inc" .include "data/maps/AlteringCave/scripts.inc"
.include "data/maps/MeteorFalls_StevensCave/scripts.inc" .include "data/maps/MeteorFalls_StevensCave/scripts.inc"
.include "data/scripts/shared_secret_base.inc" .include "data/scripts/shared_secret_base.inc"
.include "data/maps/BattleColosseum2P/scripts.inc" .include "data/maps/BattleColosseum_2P/scripts.inc"
.include "data/maps/TradeCenter/scripts.inc" .include "data/maps/TradeCenter/scripts.inc"
.include "data/maps/RecordCorner/scripts.inc" .include "data/maps/RecordCorner/scripts.inc"
.include "data/maps/BattleColosseum4P/scripts.inc" .include "data/maps/BattleColosseum_4P/scripts.inc"
.include "data/maps/ContestHall/scripts.inc" .include "data/maps/ContestHall/scripts.inc"
.include "data/maps/InsideOfTruck/scripts.inc" .include "data/maps/InsideOfTruck/scripts.inc"
.include "data/maps/SSTidalCorridor/scripts.inc" .include "data/maps/SSTidalCorridor/scripts.inc"

View File

@ -2203,13 +2203,13 @@
}, },
{ {
"id": "LAYOUT_BATTLE_COLOSSEUM_2P", "id": "LAYOUT_BATTLE_COLOSSEUM_2P",
"name": "BattleColosseum2P_Layout", "name": "BattleColosseum_2P_Layout",
"width": 14, "width": 14,
"height": 9, "height": 9,
"primary_tileset": "gTileset_Building", "primary_tileset": "gTileset_Building",
"secondary_tileset": "gTileset_CableClub", "secondary_tileset": "gTileset_CableClub",
"border_filepath": "data/layouts/BattleColosseum2P/border.bin", "border_filepath": "data/layouts/BattleColosseum_2P/border.bin",
"blockdata_filepath": "data/layouts/BattleColosseum2P/map.bin" "blockdata_filepath": "data/layouts/BattleColosseum_2P/map.bin"
}, },
{ {
"id": "LAYOUT_TRADE_CENTER", "id": "LAYOUT_TRADE_CENTER",
@ -2233,13 +2233,13 @@
}, },
{ {
"id": "LAYOUT_BATTLE_COLOSSEUM_4P", "id": "LAYOUT_BATTLE_COLOSSEUM_4P",
"name": "BattleColosseum4P_Layout", "name": "BattleColosseum_4P_Layout",
"width": 14, "width": 14,
"height": 9, "height": 9,
"primary_tileset": "gTileset_Building", "primary_tileset": "gTileset_Building",
"secondary_tileset": "gTileset_CableClub", "secondary_tileset": "gTileset_CableClub",
"border_filepath": "data/layouts/BattleColosseum4P/border.bin", "border_filepath": "data/layouts/BattleColosseum_4P/border.bin",
"blockdata_filepath": "data/layouts/BattleColosseum4P/map.bin" "blockdata_filepath": "data/layouts/BattleColosseum_4P/map.bin"
}, },
{ {
"id": "LAYOUT_CONTEST_HALL", "id": "LAYOUT_CONTEST_HALL",

View File

@ -1,3 +0,0 @@
BattleColosseum2P_MapScripts:: @ 823B77D
.byte 0

View File

@ -1,3 +0,0 @@
BattleColosseum4P_MapScripts:: @ 823B780
.byte 0

View File

@ -1,6 +1,6 @@
{ {
"id": "MAP_BATTLE_COLOSSEUM_2P", "id": "MAP_BATTLE_COLOSSEUM_2P",
"name": "BattleColosseum2P", "name": "BattleColosseum_2P",
"layout": "LAYOUT_BATTLE_COLOSSEUM_2P", "layout": "LAYOUT_BATTLE_COLOSSEUM_2P",
"music": "MUS_RAINBOW", "music": "MUS_RAINBOW",
"region_map_section": "MAPSEC_DYNAMIC", "region_map_section": "MAPSEC_DYNAMIC",
@ -24,7 +24,7 @@
"movement_range_y": 0, "movement_range_y": 0,
"trainer_type": "0", "trainer_type": "0",
"trainer_sight_or_berry_tree_id": "0", "trainer_sight_or_berry_tree_id": "0",
"script": "BattleColosseum2P_EventScript_Attendant", "script": "BattleColosseum_2P_EventScript_Attendant",
"flag": "0" "flag": "0"
} }
], ],
@ -52,7 +52,7 @@
"elevation": 3, "elevation": 3,
"var": "VAR_TEMP_0", "var": "VAR_TEMP_0",
"var_value": "0", "var_value": "0",
"script": "EventScript_BattleColosseum2P_PlayerSpot0" "script": "EventScript_BattleColosseum_2P_PlayerSpot0"
}, },
{ {
"type": "trigger", "type": "trigger",
@ -61,7 +61,7 @@
"elevation": 3, "elevation": 3,
"var": "VAR_TEMP_0", "var": "VAR_TEMP_0",
"var_value": "0", "var_value": "0",
"script": "EventScript_BattleColosseum2P_PlayerSpot1" "script": "EventScript_BattleColosseum_2P_PlayerSpot1"
} }
], ],
"bg_events": [] "bg_events": []

View File

@ -0,0 +1,3 @@
BattleColosseum_2P_MapScripts:: @ 823B77D
.byte 0

View File

@ -1,6 +1,6 @@
{ {
"id": "MAP_BATTLE_COLOSSEUM_4P", "id": "MAP_BATTLE_COLOSSEUM_4P",
"name": "BattleColosseum4P", "name": "BattleColosseum_4P",
"layout": "LAYOUT_BATTLE_COLOSSEUM_4P", "layout": "LAYOUT_BATTLE_COLOSSEUM_4P",
"music": "MUS_RAINBOW", "music": "MUS_RAINBOW",
"region_map_section": "MAPSEC_DYNAMIC", "region_map_section": "MAPSEC_DYNAMIC",
@ -52,7 +52,7 @@
"elevation": 3, "elevation": 3,
"var": "VAR_TEMP_0", "var": "VAR_TEMP_0",
"var_value": "0", "var_value": "0",
"script": "EventScript_BattleColosseum4P_PlayerSpot0" "script": "EventScript_BattleColosseum_4P_PlayerSpot0"
}, },
{ {
"type": "trigger", "type": "trigger",
@ -61,7 +61,7 @@
"elevation": 3, "elevation": 3,
"var": "VAR_TEMP_0", "var": "VAR_TEMP_0",
"var_value": "0", "var_value": "0",
"script": "EventScript_BattleColosseum4P_PlayerSpot2" "script": "EventScript_BattleColosseum_4P_PlayerSpot2"
}, },
{ {
"type": "trigger", "type": "trigger",
@ -70,7 +70,7 @@
"elevation": 3, "elevation": 3,
"var": "VAR_TEMP_0", "var": "VAR_TEMP_0",
"var_value": "0", "var_value": "0",
"script": "EventScript_BattleColosseum4P_PlayerSpot1" "script": "EventScript_BattleColosseum_4P_PlayerSpot1"
}, },
{ {
"type": "trigger", "type": "trigger",
@ -79,7 +79,7 @@
"elevation": 3, "elevation": 3,
"var": "VAR_TEMP_0", "var": "VAR_TEMP_0",
"var_value": "0", "var_value": "0",
"script": "EventScript_BattleColosseum4P_PlayerSpot3" "script": "EventScript_BattleColosseum_4P_PlayerSpot3"
} }
], ],
"bg_events": [] "bg_events": []

View File

@ -0,0 +1,3 @@
BattleColosseum_4P_MapScripts:: @ 823B780
.byte 0

View File

@ -456,10 +456,10 @@
"SecretBase_YellowCave4", "SecretBase_YellowCave4",
"SecretBase_Tree4", "SecretBase_Tree4",
"SecretBase_Shrub4", "SecretBase_Shrub4",
"BattleColosseum2P", "BattleColosseum_2P",
"TradeCenter", "TradeCenter",
"RecordCorner", "RecordCorner",
"BattleColosseum4P", "BattleColosseum_4P",
"ContestHall", "ContestHall",
"UnknownLinkContestRoom_25_29", "UnknownLinkContestRoom_25_29",
"UnknownLinkContestRoom_25_30", "UnknownLinkContestRoom_25_30",

View File

@ -710,63 +710,63 @@ EventScript_CableBoxResults:: @ 8277365
releaseall releaseall
end end
EventScript_BattleColosseum2P_PlayerSpot0:: @ 8277374 EventScript_BattleColosseum_2P_PlayerSpot0:: @ 8277374
setvar VAR_0x8005, 0 setvar VAR_0x8005, 0
special ColosseumPlayerSpotTriggered special ColosseumPlayerSpotTriggered
waitstate waitstate
end end
EventScript_BattleColosseum2P_PlayerSpot1:: @ 827737E EventScript_BattleColosseum_2P_PlayerSpot1:: @ 827737E
setvar VAR_0x8005, 1 setvar VAR_0x8005, 1
special ColosseumPlayerSpotTriggered special ColosseumPlayerSpotTriggered
waitstate waitstate
end end
EventScript_BattleColosseum4P_PlayerSpot0:: @ 8277388 EventScript_BattleColosseum_4P_PlayerSpot0:: @ 8277388
fadescreen FADE_TO_BLACK fadescreen FADE_TO_BLACK
special ChooseHalfPartyForBattle special ChooseHalfPartyForBattle
waitstate waitstate
compare VAR_RESULT, 0 compare VAR_RESULT, 0
goto_if_eq EventScript_BattleColosseum4P_CancelSpotTrigger goto_if_eq EventScript_BattleColosseum_4P_CancelSpotTrigger
setvar VAR_0x8005, 0 setvar VAR_0x8005, 0
special ColosseumPlayerSpotTriggered special ColosseumPlayerSpotTriggered
waitstate waitstate
end end
EventScript_BattleColosseum4P_PlayerSpot1:: @ 82773A3 EventScript_BattleColosseum_4P_PlayerSpot1:: @ 82773A3
fadescreen FADE_TO_BLACK fadescreen FADE_TO_BLACK
special ChooseHalfPartyForBattle special ChooseHalfPartyForBattle
waitstate waitstate
compare VAR_RESULT, 0 compare VAR_RESULT, 0
goto_if_eq EventScript_BattleColosseum4P_CancelSpotTrigger goto_if_eq EventScript_BattleColosseum_4P_CancelSpotTrigger
setvar VAR_0x8005, 1 setvar VAR_0x8005, 1
special ColosseumPlayerSpotTriggered special ColosseumPlayerSpotTriggered
waitstate waitstate
end end
EventScript_BattleColosseum4P_PlayerSpot2:: @ 82773BE EventScript_BattleColosseum_4P_PlayerSpot2:: @ 82773BE
fadescreen FADE_TO_BLACK fadescreen FADE_TO_BLACK
special ChooseHalfPartyForBattle special ChooseHalfPartyForBattle
waitstate waitstate
compare VAR_RESULT, 0 compare VAR_RESULT, 0
goto_if_eq EventScript_BattleColosseum4P_CancelSpotTrigger goto_if_eq EventScript_BattleColosseum_4P_CancelSpotTrigger
setvar VAR_0x8005, 2 setvar VAR_0x8005, 2
special ColosseumPlayerSpotTriggered special ColosseumPlayerSpotTriggered
waitstate waitstate
end end
EventScript_BattleColosseum4P_PlayerSpot3:: @ 82773D9 EventScript_BattleColosseum_4P_PlayerSpot3:: @ 82773D9
fadescreen FADE_TO_BLACK fadescreen FADE_TO_BLACK
special ChooseHalfPartyForBattle special ChooseHalfPartyForBattle
waitstate waitstate
compare VAR_RESULT, 0 compare VAR_RESULT, 0
goto_if_eq EventScript_BattleColosseum4P_CancelSpotTrigger goto_if_eq EventScript_BattleColosseum_4P_CancelSpotTrigger
setvar VAR_0x8005, 3 setvar VAR_0x8005, 3
special ColosseumPlayerSpotTriggered special ColosseumPlayerSpotTriggered
waitstate waitstate
end end
EventScript_BattleColosseum4P_CancelSpotTrigger:: @ 82773F4 EventScript_BattleColosseum_4P_CancelSpotTrigger:: @ 82773F4
end end
EventScript_TradeCenter_Chair0:: @ 82773F5 EventScript_TradeCenter_Chair0:: @ 82773F5
@ -855,9 +855,9 @@ CableClub_EventScript_TooBusyToNotice:: @ 827749C
closemessage closemessage
end end
BattleColosseum2P_EventScript_Attendant:: @ 82774A6 BattleColosseum_2P_EventScript_Attendant:: @ 82774A6
special Script_FacePlayer special Script_FacePlayer
msgbox BattleColosseum2P_Text_TakePlaceStartBattle, MSGBOX_DEFAULT msgbox BattleColosseum_2P_Text_TakePlaceStartBattle, MSGBOX_DEFAULT
special Script_ClearHeldMovement special Script_ClearHeldMovement
closemessage closemessage
end end

View File

@ -123,7 +123,7 @@ CableClub_Text_GotToLookAtColoredTrainerCard: @ 827847B
.string "TRAINER CARD!\p" .string "TRAINER CARD!\p"
.string "It's a {STR_VAR_2} card!$" .string "It's a {STR_VAR_2} card!$"
BattleColosseum2P_Text_TakePlaceStartBattle: @ 82784B4 BattleColosseum_2P_Text_TakePlaceStartBattle: @ 82784B4
.string "Please take your place and start\n" .string "Please take your place and start\n"
.string "your battle.$" .string "your battle.$"

View File

@ -33,7 +33,7 @@ void ChooseMonForSoftboiled(u8 taskId);
// flash // flash
bool8 SetUpFieldMove_Flash(void); bool8 SetUpFieldMove_Flash(void);
void c2_change_map(void); void CB2_DoChangeMap(void);
bool8 GetMapPairFadeToType(u8 a1, u8 a2); bool8 GetMapPairFadeToType(u8 a1, u8 a2);
bool8 GetMapPairFadeFromType(u8 a1, u8 a2); bool8 GetMapPairFadeFromType(u8 a1, u8 a2);

View File

@ -14,53 +14,54 @@
#include "sprite.h" #include "sprite.h"
#include "task.h" #include "task.h"
#include "constants/songs.h" #include "constants/songs.h"
#include "constants/map_types.h"
// structures // structures
struct FlashStruct struct FlashStruct
{ {
u8 unk0; u8 fromType;
u8 unk1; u8 toType;
bool8 unk2; bool8 isEnter;
bool8 unk3; bool8 isExit;
void (*func)(void); void (*func)(void);
}; };
// static functions // static functions
static void FieldCallback_Flash(void); static void FieldCallback_Flash(void);
static void FldEff_UseFlash(void); static void FldEff_UseFlash(void);
static bool8 sub_8137304(void); static bool8 TryDoMapTransition(void);
static void sub_81373F0(void); static void DoExitCaveTransition(void);
static void sub_8137404(u8 taskId); static void Task_ExitCaveTransition1(u8 taskId);
static void sub_8137420(u8 taskId); static void Task_ExitCaveTransition2(u8 taskId);
static void sub_81374C4(u8 taskId); static void Task_ExitCaveTransition3(u8 taskId);
static void sub_813750C(u8 taskId); static void Task_ExitCaveTransition4(u8 taskId);
static void sub_8137574(u8 taskId); static void Task_ExitCaveTransition5(u8 taskId);
static void sub_81375A8(void); static void DoEnterCaveTransition(void);
static void sub_81375BC(u8 taskId); static void Task_EnterCaveTransition1(u8 taskId);
static void sub_81375D8(u8 taskId); static void Task_EnterCaveTransition2(u8 taskId);
static void sub_8137678(u8 taskId); static void Task_EnterCaveTransition3(u8 taskId);
static void sub_81376DC(u8 taskId); static void Task_EnterCaveTransition4(u8 taskId);
// rodata // rodata
static const struct FlashStruct gUnknown_085B27C8[] = static const struct FlashStruct sTransitionTypes[] =
{ {
{1, 4, 1, 0, sub_81375A8}, {MAP_TYPE_TOWN, MAP_TYPE_UNDERGROUND, TRUE, FALSE, DoEnterCaveTransition},
{2, 4, 1, 0, sub_81375A8}, {MAP_TYPE_CITY, MAP_TYPE_UNDERGROUND, TRUE, FALSE, DoEnterCaveTransition},
{3, 4, 1, 0, sub_81375A8}, {MAP_TYPE_ROUTE, MAP_TYPE_UNDERGROUND, TRUE, FALSE, DoEnterCaveTransition},
{5, 4, 1, 0, sub_81375A8}, {MAP_TYPE_UNDERWATER, MAP_TYPE_UNDERGROUND, TRUE, FALSE, DoEnterCaveTransition},
{6, 4, 1, 0, sub_81375A8}, {MAP_TYPE_OCEAN_ROUTE, MAP_TYPE_UNDERGROUND, TRUE, FALSE, DoEnterCaveTransition},
{7, 4, 1, 0, sub_81375A8}, {MAP_TYPE_UNUSED_2, MAP_TYPE_UNDERGROUND, TRUE, FALSE, DoEnterCaveTransition},
{8, 4, 1, 0, sub_81375A8}, {MAP_TYPE_INDOOR, MAP_TYPE_UNDERGROUND, TRUE, FALSE, DoEnterCaveTransition},
{9, 4, 1, 0, sub_81375A8}, {MAP_TYPE_SECRET_BASE, MAP_TYPE_UNDERGROUND, TRUE, FALSE, DoEnterCaveTransition},
{4, 1, 0, 1, sub_81373F0}, {MAP_TYPE_UNDERGROUND, MAP_TYPE_TOWN, FALSE, TRUE, DoExitCaveTransition},
{4, 2, 0, 1, sub_81373F0}, {MAP_TYPE_UNDERGROUND, MAP_TYPE_CITY, FALSE, TRUE, DoExitCaveTransition},
{4, 3, 0, 1, sub_81373F0}, {MAP_TYPE_UNDERGROUND, MAP_TYPE_ROUTE, FALSE, TRUE, DoExitCaveTransition},
{4, 5, 0, 1, sub_81373F0}, {MAP_TYPE_UNDERGROUND, MAP_TYPE_UNDERWATER, FALSE, TRUE, DoExitCaveTransition},
{4, 6, 0, 1, sub_81373F0}, {MAP_TYPE_UNDERGROUND, MAP_TYPE_OCEAN_ROUTE, FALSE, TRUE, DoExitCaveTransition},
{4, 7, 0, 1, sub_81373F0}, {MAP_TYPE_UNDERGROUND, MAP_TYPE_UNUSED_2, FALSE, TRUE, DoExitCaveTransition},
{4, 8, 0, 1, sub_81373F0}, {MAP_TYPE_UNDERGROUND, MAP_TYPE_INDOOR, FALSE, TRUE, DoExitCaveTransition},
{4, 9, 0, 1, sub_81373F0}, {MAP_TYPE_UNDERGROUND, MAP_TYPE_SECRET_BASE, FALSE, TRUE, DoExitCaveTransition},
{0, 0, 0, 0, NULL}, {},
}; };
static const u16 gCaveTransitionPalette_White[] = INCBIN_U16("graphics/misc/cave_transition_white.gbapal"); static const u16 gCaveTransitionPalette_White[] = INCBIN_U16("graphics/misc/cave_transition_white.gbapal");
@ -108,7 +109,7 @@ static void FldEff_UseFlash(void)
ScriptContext1_SetupScript(EventScript_FldEffFlash); ScriptContext1_SetupScript(EventScript_FldEffFlash);
} }
static void sub_81371D4(void) static void CB2_ChangeMapMain(void)
{ {
RunTasks(); RunTasks();
AnimateSprites(); AnimateSprites();
@ -116,14 +117,14 @@ static void sub_81371D4(void)
UpdatePaletteFade(); UpdatePaletteFade();
} }
static void sub_81371EC(void) static void VBC_ChangeMapVBlank(void)
{ {
LoadOam(); LoadOam();
ProcessSpriteCopyRequests(); ProcessSpriteCopyRequests();
TransferPlttBuffer(); TransferPlttBuffer();
} }
void c2_change_map(void) void CB2_DoChangeMap(void)
{ {
u16 ime; u16 ime;
@ -148,23 +149,23 @@ void c2_change_map(void)
REG_IME = 0; REG_IME = 0;
REG_IE |= INTR_FLAG_VBLANK; REG_IE |= INTR_FLAG_VBLANK;
REG_IME = ime; REG_IME = ime;
SetVBlankCallback(sub_81371EC); SetVBlankCallback(VBC_ChangeMapVBlank);
SetMainCallback2(sub_81371D4); SetMainCallback2(CB2_ChangeMapMain);
if (!sub_8137304()) if (!TryDoMapTransition())
SetMainCallback2(gMain.savedCallback); SetMainCallback2(gMain.savedCallback);
} }
static bool8 sub_8137304(void) static bool8 TryDoMapTransition(void)
{ {
u8 i; u8 i;
u8 v0 = GetLastUsedWarpMapType(); u8 fromType = GetLastUsedWarpMapType();
u8 v1 = GetCurrentMapType(); u8 toType = GetCurrentMapType();
for (i = 0; gUnknown_085B27C8[i].unk0; i++) for (i = 0; sTransitionTypes[i].fromType; i++)
{ {
if (gUnknown_085B27C8[i].unk0 == v0 && gUnknown_085B27C8[i].unk1 == v1) if (sTransitionTypes[i].fromType == fromType && sTransitionTypes[i].toType == toType)
{ {
gUnknown_085B27C8[i].func(); sTransitionTypes[i].func();
return TRUE; return TRUE;
} }
} }
@ -172,51 +173,51 @@ static bool8 sub_8137304(void)
return FALSE; return FALSE;
} }
bool8 GetMapPairFadeToType(u8 a1, u8 a2) bool8 GetMapPairFadeToType(u8 _fromType, u8 _toType)
{ {
u8 i; u8 i;
u8 v0 = a1; u8 fromType = _fromType;
u8 v1 = a2; u8 toType = _toType;
for (i = 0; gUnknown_085B27C8[i].unk0; i++) for (i = 0; sTransitionTypes[i].fromType; i++)
{ {
if (gUnknown_085B27C8[i].unk0 == v0 && gUnknown_085B27C8[i].unk1 == v1) if (sTransitionTypes[i].fromType == fromType && sTransitionTypes[i].toType == toType)
{ {
return gUnknown_085B27C8[i].unk2; return sTransitionTypes[i].isEnter;
} }
} }
return FALSE; return FALSE;
} }
bool8 GetMapPairFadeFromType(u8 a1, u8 a2) bool8 GetMapPairFadeFromType(u8 _fromType, u8 _toType)
{ {
u8 i; u8 i;
u8 v0 = a1; u8 fromType = _fromType;
u8 v1 = a2; u8 toType = _toType;
for (i = 0; gUnknown_085B27C8[i].unk0; i++) for (i = 0; sTransitionTypes[i].fromType; i++)
{ {
if (gUnknown_085B27C8[i].unk0 == v0 && gUnknown_085B27C8[i].unk1 == v1) if (sTransitionTypes[i].fromType == fromType && sTransitionTypes[i].toType == toType)
{ {
return gUnknown_085B27C8[i].unk3; return sTransitionTypes[i].isExit;
} }
} }
return FALSE; return FALSE;
} }
static void sub_81373F0(void) static void DoExitCaveTransition(void)
{ {
CreateTask(sub_8137404, 0); CreateTask(Task_ExitCaveTransition1, 0);
} }
static void sub_8137404(u8 taskId) static void Task_ExitCaveTransition1(u8 taskId)
{ {
gTasks[taskId].func = sub_8137420; gTasks[taskId].func = Task_ExitCaveTransition2;
} }
static void sub_8137420(u8 taskId) static void Task_ExitCaveTransition2(u8 taskId)
{ {
SetGpuReg(REG_OFFSET_DISPCNT, 0); SetGpuReg(REG_OFFSET_DISPCNT, 0);
LZ77UnCompVram(gCaveTransitionTiles, (void *)(VRAM + 0xC000)); LZ77UnCompVram(gCaveTransitionTiles, (void *)(VRAM + 0xC000));
@ -241,12 +242,12 @@ static void sub_8137420(u8 taskId)
| DISPCNT_OBJ_1D_MAP | DISPCNT_OBJ_1D_MAP
| DISPCNT_BG0_ON | DISPCNT_BG0_ON
| DISPCNT_OBJ_ON); | DISPCNT_OBJ_ON);
gTasks[taskId].func = sub_81374C4; gTasks[taskId].func = Task_ExitCaveTransition3;
gTasks[taskId].data[0] = 16; gTasks[taskId].data[0] = 16;
gTasks[taskId].data[1] = 0; gTasks[taskId].data[1] = 0;
} }
static void sub_81374C4(u8 taskId) static void Task_ExitCaveTransition3(u8 taskId)
{ {
u16 count = gTasks[taskId].data[1]; u16 count = gTasks[taskId].data[1];
u16 blend = count + 0x1000; u16 blend = count + 0x1000;
@ -259,11 +260,11 @@ static void sub_81374C4(u8 taskId)
else else
{ {
gTasks[taskId].data[2] = 0; gTasks[taskId].data[2] = 0;
gTasks[taskId].func = sub_813750C; gTasks[taskId].func = Task_ExitCaveTransition4;
} }
} }
static void sub_813750C(u8 taskId) static void Task_ExitCaveTransition4(u8 taskId)
{ {
u16 count; u16 count;
@ -278,12 +279,12 @@ static void sub_813750C(u8 taskId)
else else
{ {
LoadPalette(gCaveTransitionPalette_White, 0, 0x20); LoadPalette(gCaveTransitionPalette_White, 0, 0x20);
gTasks[taskId].func = sub_8137574; gTasks[taskId].func = Task_ExitCaveTransition5;
gTasks[taskId].data[2] = 8; gTasks[taskId].data[2] = 8;
} }
} }
static void sub_8137574(u8 taskId) static void Task_ExitCaveTransition5(u8 taskId)
{ {
if (gTasks[taskId].data[2]) if (gTasks[taskId].data[2])
gTasks[taskId].data[2]--; gTasks[taskId].data[2]--;
@ -291,17 +292,17 @@ static void sub_8137574(u8 taskId)
SetMainCallback2(gMain.savedCallback); SetMainCallback2(gMain.savedCallback);
} }
static void sub_81375A8(void) static void DoEnterCaveTransition(void)
{ {
CreateTask(sub_81375BC, 0); CreateTask(Task_EnterCaveTransition1, 0);
} }
static void sub_81375BC(u8 taskId) static void Task_EnterCaveTransition1(u8 taskId)
{ {
gTasks[taskId].func = sub_81375D8; gTasks[taskId].func = Task_EnterCaveTransition2;
} }
static void sub_81375D8(u8 taskId) static void Task_EnterCaveTransition2(u8 taskId)
{ {
SetGpuReg(REG_OFFSET_DISPCNT, 0); SetGpuReg(REG_OFFSET_DISPCNT, 0);
LZ77UnCompVram(gCaveTransitionTiles, (void *)(VRAM + 0xC000)); LZ77UnCompVram(gCaveTransitionTiles, (void *)(VRAM + 0xC000));
@ -320,13 +321,13 @@ static void sub_81375D8(u8 taskId)
| DISPCNT_OBJ_ON); | DISPCNT_OBJ_ON);
LoadPalette(gCaveTransitionPalette_White, 0xE0, 0x20); LoadPalette(gCaveTransitionPalette_White, 0xE0, 0x20);
LoadPalette(gCaveTransitionPalette_Black, 0, 0x20); LoadPalette(gCaveTransitionPalette_Black, 0, 0x20);
gTasks[taskId].func = sub_8137678; gTasks[taskId].func = Task_EnterCaveTransition3;
gTasks[taskId].data[0] = 16; gTasks[taskId].data[0] = 16;
gTasks[taskId].data[1] = 0; gTasks[taskId].data[1] = 0;
gTasks[taskId].data[2] = 0; gTasks[taskId].data[2] = 0;
} }
static void sub_8137678(u8 taskId) static void Task_EnterCaveTransition3(u8 taskId)
{ {
u16 count = gTasks[taskId].data[2]; u16 count = gTasks[taskId].data[2];
@ -346,11 +347,11 @@ static void sub_8137678(u8 taskId)
| BLDCNT_TGT2_BG3 | BLDCNT_TGT2_BG3
| BLDCNT_TGT2_OBJ | BLDCNT_TGT2_OBJ
| BLDCNT_TGT2_BD); | BLDCNT_TGT2_BD);
gTasks[taskId].func = sub_81376DC; gTasks[taskId].func = Task_EnterCaveTransition4;
} }
} }
static void sub_81376DC(u8 taskId) static void Task_EnterCaveTransition4(u8 taskId)
{ {
u16 count = 16 - gTasks[taskId].data[1]; u16 count = 16 - gTasks[taskId].data[1];
u16 blend = count + 0x1000; u16 blend = count + 0x1000;

View File

@ -1884,7 +1884,7 @@ static void SpriteCB_MovePlayerDownWhileShrinking(struct Sprite *sprite)
static u8 NewGameBirchSpeech_CreateLotadSprite(u8 a, u8 b) static u8 NewGameBirchSpeech_CreateLotadSprite(u8 a, u8 b)
{ {
return CreatePicSprite2(SPECIES_LOTAD, 8, 0, 1, a, b, 14, -1); return CreatePicSprite2(SPECIES_LOTAD, SHINY_ODDS, 0, 1, a, b, 14, -1);
} }
static void AddBirchSpeechObjects(u8 taskId) static void AddBirchSpeechObjects(u8 taskId)

View File

@ -89,16 +89,16 @@ extern const u8 EventScript_DoLinkRoomExit[];
extern const u8 CableClub_EventScript_TooBusyToNotice[]; extern const u8 CableClub_EventScript_TooBusyToNotice[];
extern const u8 CableClub_EventScript_ReadTrainerCard[]; extern const u8 CableClub_EventScript_ReadTrainerCard[];
extern const u8 CableClub_EventScript_ReadTrainerCardColored[]; extern const u8 CableClub_EventScript_ReadTrainerCardColored[];
extern const u8 EventScript_BattleColosseum4P_PlayerSpot0[]; extern const u8 EventScript_BattleColosseum_4P_PlayerSpot0[];
extern const u8 EventScript_BattleColosseum4P_PlayerSpot1[]; extern const u8 EventScript_BattleColosseum_4P_PlayerSpot1[];
extern const u8 EventScript_BattleColosseum4P_PlayerSpot2[]; extern const u8 EventScript_BattleColosseum_4P_PlayerSpot2[];
extern const u8 EventScript_BattleColosseum4P_PlayerSpot3[]; extern const u8 EventScript_BattleColosseum_4P_PlayerSpot3[];
extern const u8 EventScript_RecordCenter_Spot0[]; extern const u8 EventScript_RecordCenter_Spot0[];
extern const u8 EventScript_RecordCenter_Spot1[]; extern const u8 EventScript_RecordCenter_Spot1[];
extern const u8 EventScript_RecordCenter_Spot2[]; extern const u8 EventScript_RecordCenter_Spot2[];
extern const u8 EventScript_RecordCenter_Spot3[]; extern const u8 EventScript_RecordCenter_Spot3[];
extern const u8 EventScript_BattleColosseum2P_PlayerSpot0[]; extern const u8 EventScript_BattleColosseum_2P_PlayerSpot0[];
extern const u8 EventScript_BattleColosseum2P_PlayerSpot1[]; extern const u8 EventScript_BattleColosseum_2P_PlayerSpot1[];
extern const u8 EventScript_TradeCenter_Chair1[]; extern const u8 EventScript_TradeCenter_Chair1[];
extern const u8 EventScript_TradeCenter_Chair0[]; extern const u8 EventScript_TradeCenter_Chair0[];
extern const u8 EventScript_ConfirmLeaveTradeRoom[]; extern const u8 EventScript_ConfirmLeaveTradeRoom[];
@ -1580,7 +1580,7 @@ void CB2_LoadMap(void)
ScriptContext1_Init(); ScriptContext1_Init();
ScriptContext2_Disable(); ScriptContext2_Disable();
SetMainCallback1(NULL); SetMainCallback1(NULL);
SetMainCallback2(c2_change_map); SetMainCallback2(CB2_DoChangeMap);
gMain.savedCallback = CB2_LoadMap2; gMain.savedCallback = CB2_LoadMap2;
} }
@ -2782,13 +2782,13 @@ static const u8 *TryInteractWithPlayer(struct TradeRoomPlayer *player)
// these event scripts runs. // these event scripts runs.
static u16 GetDirectionForEventScript(const u8 *script) static u16 GetDirectionForEventScript(const u8 *script)
{ {
if (script == EventScript_BattleColosseum4P_PlayerSpot0) if (script == EventScript_BattleColosseum_4P_PlayerSpot0)
return FACING_FORCED_RIGHT; return FACING_FORCED_RIGHT;
else if (script == EventScript_BattleColosseum4P_PlayerSpot1) else if (script == EventScript_BattleColosseum_4P_PlayerSpot1)
return FACING_FORCED_LEFT; return FACING_FORCED_LEFT;
else if (script == EventScript_BattleColosseum4P_PlayerSpot2) else if (script == EventScript_BattleColosseum_4P_PlayerSpot2)
return FACING_FORCED_RIGHT; return FACING_FORCED_RIGHT;
else if (script == EventScript_BattleColosseum4P_PlayerSpot3) else if (script == EventScript_BattleColosseum_4P_PlayerSpot3)
return FACING_FORCED_LEFT; return FACING_FORCED_LEFT;
else if (script == EventScript_RecordCenter_Spot0) else if (script == EventScript_RecordCenter_Spot0)
return FACING_FORCED_RIGHT; return FACING_FORCED_RIGHT;
@ -2798,9 +2798,9 @@ static u16 GetDirectionForEventScript(const u8 *script)
return FACING_FORCED_RIGHT; return FACING_FORCED_RIGHT;
else if (script == EventScript_RecordCenter_Spot3) else if (script == EventScript_RecordCenter_Spot3)
return FACING_FORCED_LEFT; return FACING_FORCED_LEFT;
else if (script == EventScript_BattleColosseum2P_PlayerSpot0) else if (script == EventScript_BattleColosseum_2P_PlayerSpot0)
return FACING_FORCED_RIGHT; return FACING_FORCED_RIGHT;
else if (script == EventScript_BattleColosseum2P_PlayerSpot1) else if (script == EventScript_BattleColosseum_2P_PlayerSpot1)
return FACING_FORCED_LEFT; return FACING_FORCED_LEFT;
else if (script == EventScript_TradeCenter_Chair0) else if (script == EventScript_TradeCenter_Chair0)
return FACING_FORCED_RIGHT; return FACING_FORCED_RIGHT;

View File

@ -4674,7 +4674,7 @@ u32 sub_80C0E68(u16 a)
u16 CreateMonSpriteFromNationalDexNumber(u16 nationalNum, s16 x, s16 y, u16 paletteSlot) u16 CreateMonSpriteFromNationalDexNumber(u16 nationalNum, s16 x, s16 y, u16 paletteSlot)
{ {
nationalNum = NationalPokedexNumToSpecies(nationalNum); nationalNum = NationalPokedexNumToSpecies(nationalNum);
return CreateMonPicSprite_HandleDeoxys(nationalNum, 8, sub_80C0E68(nationalNum), TRUE, x, y, paletteSlot, 0xFFFF); return CreateMonPicSprite_HandleDeoxys(nationalNum, SHINY_ODDS, sub_80C0E68(nationalNum), TRUE, x, y, paletteSlot, 0xFFFF);
} }
u16 sub_80C0EF8(u16 species, s16 x, s16 y, s8 paletteSlot) u16 sub_80C0EF8(u16 species, s16 x, s16 y, s8 paletteSlot)

View File

@ -640,7 +640,7 @@ static u8 CreatePokemonFrontSprite(u16 species, u8 x, u8 y)
{ {
u8 spriteId; u8 spriteId;
spriteId = CreatePicSprite2(species, 8, 0, 1, x, y, 0xE, 0xFFFF); spriteId = CreatePicSprite2(species, SHINY_ODDS, 0, 1, x, y, 0xE, 0xFFFF);
gSprites[spriteId].oam.priority = 0; gSprites[spriteId].oam.priority = 0;
return spriteId; return spriteId;
} }