Merge branch 'master' into link
This commit is contained in:
@@ -60,16 +60,8 @@ extern u8 gBattleCommunication[];
|
||||
|
||||
extern const struct WindowTemplate gUnknown_0833900C;
|
||||
extern const struct CompressedSpriteSheet gMonFrontPicTable[];
|
||||
extern const u8 gUnknown_085B58C9[][4];
|
||||
extern const u16 gUnknown_085B5884[];
|
||||
extern const u8 gUnknown_085B58D9[];
|
||||
extern const u16 gUnknown_085B51E4[];
|
||||
extern const u32 gUnknown_085B4134[];
|
||||
extern const u32 gUnknown_085B482C[];
|
||||
extern const u32 gUnknown_085B4D10[];
|
||||
|
||||
// strings
|
||||
extern const u8 gText_ShedinjaJapaneseName2[];
|
||||
extern const u8 gText_PkmnIsEvolving[];
|
||||
extern const u8 gText_CongratsPkmnEvolved[];
|
||||
extern const u8 gText_BattleYesNoChoice[];
|
||||
@@ -83,7 +75,7 @@ extern void sub_806A068(u16, u8);
|
||||
extern void sub_807F19C(void);
|
||||
extern void sub_807B140(void);
|
||||
extern void EvolutionRenameMon(struct Pokemon *mon, u16 oldSpecies, u16 newSpecies);
|
||||
extern void sub_8085784(void);
|
||||
extern void Overworld_PlaySpecialMapMusic(void);
|
||||
extern void sub_81BFA38(struct Pokemon *party, u8 monId, u8 partyCount, void *CB2_ptr, u16 move);
|
||||
extern u8 sub_81C1B94(void);
|
||||
extern void sub_807F1A8(u8 arg0, const u8 *arg1, u8 arg2);
|
||||
@@ -105,6 +97,80 @@ static void InitMovingBackgroundTask(bool8 isLink);
|
||||
static void sub_813FEE8(u8 taskId);
|
||||
static void sub_8140174(void);
|
||||
|
||||
// const data
|
||||
static const u16 sUnknown_085B4114[] = INCBIN_U16("graphics/evolution_scene/unknown_5B4114.gbapal");
|
||||
static const u32 sUnknown_085B4134[] = INCBIN_U32("graphics/evolution_scene/bg.4bpp.lz");
|
||||
static const u32 sUnknown_085B482C[] = INCBIN_U32("graphics/evolution_scene/bg.bin.lz");
|
||||
static const u32 sUnknown_085B4D10[] = INCBIN_U32("graphics/evolution_scene/bg2.bin.lz");
|
||||
static const u16 sUnknown_085B51E4[] = INCBIN_U16("graphics/evolution_scene/gray_transition_intro.gbapal");
|
||||
static const u16 sUnknown_085B53E4[] = INCBIN_U16("graphics/evolution_scene/gray_transition_lighten.gbapal");
|
||||
static const u16 sUnknown_085B5544[] = INCBIN_U16("graphics/evolution_scene/gray_transition_darken.gbapal");
|
||||
static const u16 sUnknown_085B56E4[] = INCBIN_U16("graphics/evolution_scene/gray_transition_outro.gbapal");
|
||||
static const u16 sUnknown_085B5884[] = INCBIN_U16("graphics/evolution_scene/transition.gbapal");
|
||||
|
||||
static const u8 Text_ShedinjaJapaneseName[] = _("ヌケニン");
|
||||
|
||||
static const u8 sUnknown_085B58C9[][4] =
|
||||
{
|
||||
{ 0x00, 0x0C, 0x01, 0x06 },
|
||||
{ 0x0D, 0x24, 0x05, 0x02 },
|
||||
{ 0x0D, 0x18, 0x01, 0x02 },
|
||||
{ 0x25, 0x31, 0x01, 0x06 },
|
||||
};
|
||||
|
||||
static const u8 sUnknown_085B58D9[][16] = {
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x00, 0x0B, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x00, 0x00 },
|
||||
{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x00, 0x00 },
|
||||
{ 0x00, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0C, 0x00, 0x00 },
|
||||
{ 0x00, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0C, 0x0B, 0x00, 0x00 },
|
||||
{ 0x00, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0C, 0x0B, 0x0A, 0x00, 0x00 },
|
||||
{ 0x00, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x00, 0x00 },
|
||||
{ 0x00, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x00, 0x00 },
|
||||
{ 0x00, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x00, 0x00 },
|
||||
{ 0x00, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x00, 0x00 },
|
||||
{ 0x00, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x00, 0x00 },
|
||||
{ 0x00, 0x0A, 0x0B, 0x0C, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x00, 0x00 },
|
||||
{ 0x00, 0x0B, 0x0C, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x00, 0x00 },
|
||||
{ 0x00, 0x0C, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x00, 0x00 },
|
||||
{ 0x00, 0x0D, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00 },
|
||||
{ 0x00, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x02, 0x00, 0x00 },
|
||||
{ 0x00, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x02, 0x03, 0x00, 0x00 },
|
||||
{ 0x00, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x02, 0x03, 0x04, 0x00, 0x00 },
|
||||
{ 0x00, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x02, 0x03, 0x04, 0x05, 0x00, 0x00 },
|
||||
{ 0x00, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x00, 0x00 },
|
||||
{ 0x00, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x00, 0x00 },
|
||||
{ 0x00, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, 0x00 },
|
||||
{ 0x00, 0x05, 0x04, 0x03, 0x02, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x00, 0x00 },
|
||||
{ 0x00, 0x04, 0x03, 0x02, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x00, 0x00 },
|
||||
{ 0x00, 0x03, 0x02, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x00, 0x00 },
|
||||
{ 0x00, 0x02, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x00, 0x00 },
|
||||
{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x00, 0x00 },
|
||||
{ 0x00, 0x0C, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x0B, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x0A, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x09, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x06, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x05, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
|
||||
};
|
||||
|
||||
static void CB2_BeginEvolutionScene(void)
|
||||
{
|
||||
UpdatePaletteFade();
|
||||
@@ -541,7 +607,7 @@ static void CreateShedinja(u16 preEvoSpecies, struct Pokemon* mon)
|
||||
if (GetMonData(Shedinja, MON_DATA_SPECIES) == SPECIES_SHEDINJA
|
||||
&& GetMonData(Shedinja, MON_DATA_LANGUAGE) == LANGUAGE_JAPANESE
|
||||
&& GetMonData(mon, MON_DATA_SPECIES) == SPECIES_NINJASK)
|
||||
SetMonData(Shedinja, MON_DATA_NICKNAME, gText_ShedinjaJapaneseName2);
|
||||
SetMonData(Shedinja, MON_DATA_NICKNAME, Text_ShedinjaJapaneseName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -591,14 +657,14 @@ static void Task_EvolutionScene(u8 taskID)
|
||||
case 3:
|
||||
if (EvoScene_IsMonAnimFinished(sEvoStructPtr->preEvoSpriteID)) // wait for animation, play tu du SE
|
||||
{
|
||||
PlaySE(BGM_ME_SHINKA);
|
||||
PlaySE(MUS_ME_SHINKA);
|
||||
gTasks[taskID].tState++;
|
||||
}
|
||||
break;
|
||||
case 4: // play evolution music and fade screen black
|
||||
if (!IsSEPlaying())
|
||||
{
|
||||
PlayNewMapMusic(BGM_SHINKA);
|
||||
PlayNewMapMusic(MUS_SHINKA);
|
||||
gTasks[taskID].tState++;
|
||||
BeginNormalPaletteFade(0x1C, 4, 0, 0x10, 0);
|
||||
}
|
||||
@@ -674,7 +740,7 @@ static void Task_EvolutionScene(u8 taskID)
|
||||
{
|
||||
StringExpandPlaceholders(gStringVar4, gText_CongratsPkmnEvolved);
|
||||
BattleHandleAddTextPrinter(gStringVar4, 0);
|
||||
PlayBGM(BGM_FANFA5);
|
||||
PlayBGM(MUS_FANFA5);
|
||||
gTasks[taskID].tState++;
|
||||
SetMonData(mon, MON_DATA_SPECIES, (void*)(&gTasks[taskID].tPostEvoSpecies));
|
||||
CalculateMonStats(mon);
|
||||
@@ -695,7 +761,7 @@ static void Task_EvolutionScene(u8 taskID)
|
||||
if (!(gTasks[taskID].tBits & TASK_BIT_LEARN_MOVE))
|
||||
{
|
||||
StopMapMusic();
|
||||
sub_8085784();
|
||||
Overworld_PlaySpecialMapMusic();
|
||||
}
|
||||
|
||||
gTasks[taskID].tBits |= TASK_BIT_LEARN_MOVE;
|
||||
@@ -724,7 +790,7 @@ static void Task_EvolutionScene(u8 taskID)
|
||||
if (!(gTasks[taskID].tBits & TASK_BIT_LEARN_MOVE))
|
||||
{
|
||||
StopMapMusic();
|
||||
sub_8085784();
|
||||
Overworld_PlaySpecialMapMusic();
|
||||
}
|
||||
if (!gTasks[taskID].tEvoWasStopped)
|
||||
CreateShedinja(gTasks[taskID].tPreEvoSpecies, mon);
|
||||
@@ -769,7 +835,7 @@ static void Task_EvolutionScene(u8 taskID)
|
||||
if (!IsTextPrinterActive(0) && !IsSEPlaying())
|
||||
{
|
||||
BufferMoveToLearnIntoBattleTextBuff2();
|
||||
PlayFanfare(BGM_FANFA1);
|
||||
PlayFanfare(MUS_FANFA1);
|
||||
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_PKMNLEARNEDMOVE - BATTLESTRINGS_ID_ADDER]);
|
||||
BattleHandleAddTextPrinter(gDisplayedStringBattle, 0);
|
||||
gTasks[taskID].tLearnsFirstMove = 0x40; // re-used as a counter
|
||||
@@ -959,15 +1025,15 @@ static void Task_TradeEvolutionScene(u8 taskID)
|
||||
case 2:
|
||||
if (IsCryFinished())
|
||||
{
|
||||
m4aSongNumStop(BGM_SHINKA);
|
||||
PlaySE(BGM_ME_SHINKA);
|
||||
m4aSongNumStop(MUS_SHINKA);
|
||||
PlaySE(MUS_ME_SHINKA);
|
||||
gTasks[taskID].tState++;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (!IsSEPlaying())
|
||||
{
|
||||
PlayBGM(BGM_SHINKA);
|
||||
PlayBGM(MUS_SHINKA);
|
||||
gTasks[taskID].tState++;
|
||||
BeginNormalPaletteFade(0x1C, 4, 0, 0x10, 0);
|
||||
}
|
||||
@@ -1037,7 +1103,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
|
||||
{
|
||||
StringExpandPlaceholders(gStringVar4, gText_CongratsPkmnEvolved);
|
||||
sub_807F1A8(0, gStringVar4, 1);
|
||||
PlayFanfare(BGM_FANFA5);
|
||||
PlayFanfare(MUS_FANFA5);
|
||||
gTasks[taskID].tState++;
|
||||
SetMonData(mon, MON_DATA_SPECIES, (&gTasks[taskID].tPostEvoSpecies));
|
||||
CalculateMonStats(mon);
|
||||
@@ -1070,7 +1136,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayBGM(BGM_SHINKA);
|
||||
PlayBGM(MUS_SHINKA);
|
||||
sub_807F1A8(0, gText_CommunicationStandby5, 1);
|
||||
gTasks[taskID].tState++;
|
||||
}
|
||||
@@ -1114,7 +1180,7 @@ static void Task_TradeEvolutionScene(u8 taskID)
|
||||
if (!IsTextPrinterActive(0) && !IsSEPlaying())
|
||||
{
|
||||
BufferMoveToLearnIntoBattleTextBuff2();
|
||||
PlayFanfare(BGM_FANFA1);
|
||||
PlayFanfare(MUS_FANFA1);
|
||||
BattleStringExpandPlaceholdersToDisplayedString(gBattleStringsTable[STRINGID_PKMNLEARNEDMOVE - BATTLESTRINGS_ID_ADDER]);
|
||||
sub_807F1A8(0, gDisplayedStringBattle, 1);
|
||||
gTasks[taskID].tLearnsFirstMove = 0x40; // re-used as a counter
|
||||
@@ -1327,17 +1393,17 @@ static void sub_813FDEC(u8 taskId)
|
||||
if (data[5]++ < 20)
|
||||
return;
|
||||
|
||||
if (data[0]++ > gUnknown_085B58C9[data[2]][3])
|
||||
if (data[0]++ > sUnknown_085B58C9[data[2]][3])
|
||||
{
|
||||
if (gUnknown_085B58C9[data[2]][1] == data[1])
|
||||
if (sUnknown_085B58C9[data[2]][1] == data[1])
|
||||
{
|
||||
data[3]++;
|
||||
if (data[3] == gUnknown_085B58C9[data[2]][2])
|
||||
if (data[3] == sUnknown_085B58C9[data[2]][2])
|
||||
{
|
||||
data[3] = 0;
|
||||
data[2]++;
|
||||
}
|
||||
data[1] = gUnknown_085B58C9[data[2]][0];
|
||||
data[1] = sUnknown_085B58C9[data[2]][0];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1408,7 +1474,7 @@ static void InitMovingBgValues(u16 *movingBgs)
|
||||
{
|
||||
for (j = 0; j < 16; j++)
|
||||
{
|
||||
movingBgs[i * 16 + j] = gUnknown_085B5884[gUnknown_085B58D9[i * 16 + j]];
|
||||
movingBgs[i * 16 + j] = sUnknown_085B5884[sUnknown_085B58D9[i][j]];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1425,11 +1491,11 @@ static void InitMovingBackgroundTask(bool8 isLink)
|
||||
else
|
||||
innerBgId = 1, outerBgId = 3;
|
||||
|
||||
LoadPalette(gUnknown_085B51E4, 0xA0, 0x20);
|
||||
LoadPalette(sUnknown_085B51E4, 0xA0, 0x20);
|
||||
|
||||
copy_decompressed_tile_data_to_vram_autofree(1, gUnknown_085B4134, FALSE, 0, 0);
|
||||
CopyToBgTilemapBuffer(1, gUnknown_085B482C, 0, 0);
|
||||
CopyToBgTilemapBuffer(outerBgId, gUnknown_085B4D10, 0, 0);
|
||||
copy_decompressed_tile_data_to_vram_autofree(1, sUnknown_085B4134, FALSE, 0, 0);
|
||||
CopyToBgTilemapBuffer(1, sUnknown_085B482C, 0, 0);
|
||||
CopyToBgTilemapBuffer(outerBgId, sUnknown_085B4D10, 0, 0);
|
||||
CopyBgTilemapBufferToVram(1);
|
||||
CopyBgTilemapBufferToVram(outerBgId);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user