From 0db72319326c6b29b0fdcdd1e7767a7e7ba46a1d Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Thu, 12 Jan 2017 00:53:22 -0500 Subject: decompile braille_puzzles.c (#187) * begin decompiling braille_puzzles.c * finish decompiling braille_puzzles.c --- src/braille_puzzles.c | 262 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 262 insertions(+) create mode 100644 src/braille_puzzles.c (limited to 'src/braille_puzzles.c') diff --git a/src/braille_puzzles.c b/src/braille_puzzles.c new file mode 100644 index 000000000..1493f1793 --- /dev/null +++ b/src/braille_puzzles.c @@ -0,0 +1,262 @@ +#include "global.h" +#include "event_data.h" +#include "flags.h" +#include "asm.h" +#include "field_camera.h" +#include "field_effect.h" +#include "map_obj_lock.h" +#include "sound.h" +#include "script.h" +#include "songs.h" +#include "species.h" +#include "task.h" +#include "menu.h" + +extern u8 gPlayerPartyCount; +extern u8 gUnknown_03005CE0; + +extern u32 gUnknown_0202FF84[]; + +extern u8 gUnknown_0815EF19[]; + +void UseFlyAncientTomb_Callback(void); +void UseFlyAncientTomb_Finish(void); +void Task_BrailleWait(u8 taskId); +bool32 BrailleWait_CheckButtonPress(void); +void SealedChamberShakingEffect(u8 taskId); + +bool8 ShouldDoBrailleDigEffect(void) +{ + if(!FlagGet(SYS_BRAILLE_DIG) && (gSaveBlock1.location.mapGroup == 0x18 && gSaveBlock1.location.mapNum == 0x47)) + { + if(gSaveBlock1.pos.x == 10 && gSaveBlock1.pos.y == 3) + return TRUE; + else if(gSaveBlock1.pos.x == 9 && gSaveBlock1.pos.y == 3) + return TRUE; + else if(gSaveBlock1.pos.x == 11 && gSaveBlock1.pos.y == 3) + return TRUE; + } + + return FALSE; +} + +void DoBrailleDigEffect(void) +{ + MapGridSetMetatileIdAt(16, 8, 554); + MapGridSetMetatileIdAt(17, 8, 555); + MapGridSetMetatileIdAt(18, 8, 556); + MapGridSetMetatileIdAt(16, 9, 3634); + MapGridSetMetatileIdAt(17, 9, 563); + MapGridSetMetatileIdAt(18, 9, 3636); + DrawWholeMapView(); + PlaySE(SE_BAN); + FlagSet(SYS_BRAILLE_DIG); + ScriptContext2_Disable(); +} + +bool8 CheckRelicanthWailord(void) +{ + if(GetMonData(&gPlayerParty, MON_DATA_SPECIES2, 0) == SPECIES_RELICANTH) + { + CalculatePlayerPartyCount(); + + if(GetMonData(&gPlayerParty[gPlayerPartyCount - 1], MON_DATA_SPECIES2, 0) == SPECIES_WAILORD) + return TRUE; + } + return FALSE; +} + +bool8 ShouldDoBrailleStrengthEffect(void) +{ + if(!FlagGet(SYS_BRAILLE_STRENGTH) && (gSaveBlock1.location.mapGroup == 0x18 && gSaveBlock1.location.mapNum == 0x6)) + { + if(gSaveBlock1.pos.x == 10 && gSaveBlock1.pos.y == 23) + return TRUE; + else if(gSaveBlock1.pos.x == 9 && gSaveBlock1.pos.y == 23) + return TRUE; + else if(gSaveBlock1.pos.x == 11 && gSaveBlock1.pos.y == 23) + return TRUE; + } + + return FALSE; +} + +void DoBrailleStrengthEffect(void) +{ + FieldEffectActiveListRemove(0x28); + MapGridSetMetatileIdAt(14, 26, 554); + MapGridSetMetatileIdAt(15, 26, 555); + MapGridSetMetatileIdAt(16, 26, 556); + MapGridSetMetatileIdAt(14, 27, 3634); + MapGridSetMetatileIdAt(15, 27, 563); + MapGridSetMetatileIdAt(16, 27, 3636); + DrawWholeMapView(); + PlaySE(SE_BAN); + FlagSet(SYS_BRAILLE_STRENGTH); + ScriptContext2_Disable(); +} + +bool8 ShouldDoBrailleFlyEffect(void) +{ + if(!FlagGet(SYS_BRAILLE_FLY) && (gSaveBlock1.location.mapGroup == 0x18 && gSaveBlock1.location.mapNum == 0x44)) + { + if(gSaveBlock1.pos.x == 8 && gSaveBlock1.pos.y == 25) + return TRUE; + } + + return FALSE; +} + +void DoBrailleFlyEffect(void) +{ + gUnknown_0202FF84[0] = gUnknown_03005CE0; + FieldEffectStart(0x3C); +} + +bool8 FldEff_UseFlyAncientTomb(void) +{ + u8 taskId = oei_task_add(); + + gTasks[taskId].data[8] = (u32)UseFlyAncientTomb_Callback >> 16; + gTasks[taskId].data[9] = (u32)UseFlyAncientTomb_Callback; + return FALSE; +} + +void UseFlyAncientTomb_Callback(void) +{ + FieldEffectActiveListRemove(0x3C); + UseFlyAncientTomb_Finish(); +} + +void UseFlyAncientTomb_Finish(void) +{ + MapGridSetMetatileIdAt(14, 26, 554); + MapGridSetMetatileIdAt(15, 26, 555); + MapGridSetMetatileIdAt(16, 26, 556); + MapGridSetMetatileIdAt(14, 27, 3634); + MapGridSetMetatileIdAt(15, 27, 563); + MapGridSetMetatileIdAt(16, 27, 3636); + DrawWholeMapView(); + PlaySE(SE_BAN); + FlagSet(SYS_BRAILLE_FLY); + ScriptContext2_Disable(); +} + +void DoBrailleWait(void) +{ + if(!FlagGet(SYS_BRAILLE_WAIT)) + CreateTask(Task_BrailleWait, 0x50); +} + +void Task_BrailleWait(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + switch(data[0]) + { + case 0: + data[1] = 7200; + data[0] = 1; + break; + case 1: + if(BrailleWait_CheckButtonPress() != FALSE) + { + MenuZeroFillScreen(); + PlaySE(5); + data[0] = 2; + } + else + { + data[1] = data[1] - 1; + if(data[1] == 0) + { + MenuZeroFillScreen(); + data[0] = 3; + data[1] = 30; + } + } + break; + case 2: + if(BrailleWait_CheckButtonPress() == FALSE) + { + data[1] = data[1] - 1; + if(data[1] == 0) + data[0] = 4; + break; + } + sub_8064E2C(); + DestroyTask(taskId); + ScriptContext2_Disable(); + break; + case 3: + data[1] = data[1] - 1; + if(data[1] == 0) + data[0] = 4; + break; + case 4: + sub_8064E2C(); + ScriptContext1_SetupScript(gUnknown_0815EF19); + DestroyTask(taskId); + break; + } +} + +bool32 BrailleWait_CheckButtonPress(void) +{ + u16 var = 0xFF; + + if(gSaveBlock2.optionsButtonMode == 1) + var |= 0x300; + if(gSaveBlock2.optionsButtonMode == 2) + var |= 0x200; + + if((var & gMain.newKeys) != FALSE) + return TRUE; + else + return FALSE; +} + +void DoSealedChamberShakingEffect1(void) +{ + u8 taskId = CreateTask(SealedChamberShakingEffect, 0x9); + + gTasks[taskId].data[1] = 0; + gTasks[taskId].data[2] = 0; + gTasks[taskId].data[4] = 2; + gTasks[taskId].data[5] = 5; + gTasks[taskId].data[6] = 50; + SetCameraPanningCallback(0); +} + +void DoSealedChamberShakingEffect2(void) +{ + u8 taskId = CreateTask(SealedChamberShakingEffect, 0x9); + + gTasks[taskId].data[1] = 0; + gTasks[taskId].data[2] = 0; + gTasks[taskId].data[4] = 3; + gTasks[taskId].data[5] = 5; + gTasks[taskId].data[6] = 2; + SetCameraPanningCallback(0); +} + +void SealedChamberShakingEffect(u8 taskId) +{ + struct Task *task = &gTasks[taskId]; + + task->data[1]++; + + if(!(task->data[1] % task->data[5])) + { + task->data[1] = 0; + task->data[2]++; + task->data[4] = -task->data[4]; + SetCameraPanning(0, task->data[4]); + if(task->data[2] == task->data[6]) + { + DestroyTask(taskId); + EnableBothScriptContexts(); + InstallCameraPanAheadCallback(); + } + } +} -- cgit v1.2.3 From 648c6c7093f5173694562929f615380f297ad306 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Tue, 17 Jan 2017 13:41:12 +0100 Subject: Move `gStringVar` declarations to text.h --- src/braille_puzzles.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/braille_puzzles.c') diff --git a/src/braille_puzzles.c b/src/braille_puzzles.c index 1493f1793..73bcfd909 100644 --- a/src/braille_puzzles.c +++ b/src/braille_puzzles.c @@ -11,6 +11,7 @@ #include "species.h" #include "task.h" #include "menu.h" +#include "text.h" extern u8 gPlayerPartyCount; extern u8 gUnknown_03005CE0; -- cgit v1.2.3 From c9722602cb47eb5b6ecbccddf13df5f286a8ef7b Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Tue, 17 Jan 2017 14:13:04 +0100 Subject: Sort includes --- src/braille_puzzles.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/braille_puzzles.c') diff --git a/src/braille_puzzles.c b/src/braille_puzzles.c index 73bcfd909..c8c81c045 100644 --- a/src/braille_puzzles.c +++ b/src/braille_puzzles.c @@ -1,16 +1,16 @@ #include "global.h" -#include "event_data.h" -#include "flags.h" #include "asm.h" +#include "event_data.h" #include "field_camera.h" #include "field_effect.h" +#include "flags.h" #include "map_obj_lock.h" -#include "sound.h" +#include "menu.h" #include "script.h" #include "songs.h" +#include "sound.h" #include "species.h" #include "task.h" -#include "menu.h" #include "text.h" extern u8 gPlayerPartyCount; -- cgit v1.2.3 From 801877553db80267a62c0c3c0b2805b6716d1ef9 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Tue, 17 Jan 2017 14:38:44 +0100 Subject: Remove trailing whitespace --- src/braille_puzzles.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/braille_puzzles.c') diff --git a/src/braille_puzzles.c b/src/braille_puzzles.c index c8c81c045..cf05bdf20 100644 --- a/src/braille_puzzles.c +++ b/src/braille_puzzles.c @@ -104,7 +104,7 @@ bool8 ShouldDoBrailleFlyEffect(void) if(gSaveBlock1.pos.x == 8 && gSaveBlock1.pos.y == 25) return TRUE; } - + return FALSE; } @@ -117,7 +117,7 @@ void DoBrailleFlyEffect(void) bool8 FldEff_UseFlyAncientTomb(void) { u8 taskId = oei_task_add(); - + gTasks[taskId].data[8] = (u32)UseFlyAncientTomb_Callback >> 16; gTasks[taskId].data[9] = (u32)UseFlyAncientTomb_Callback; return FALSE; @@ -205,12 +205,12 @@ void Task_BrailleWait(u8 taskId) bool32 BrailleWait_CheckButtonPress(void) { u16 var = 0xFF; - + if(gSaveBlock2.optionsButtonMode == 1) var |= 0x300; if(gSaveBlock2.optionsButtonMode == 2) var |= 0x200; - + if((var & gMain.newKeys) != FALSE) return TRUE; else @@ -220,7 +220,7 @@ bool32 BrailleWait_CheckButtonPress(void) void DoSealedChamberShakingEffect1(void) { u8 taskId = CreateTask(SealedChamberShakingEffect, 0x9); - + gTasks[taskId].data[1] = 0; gTasks[taskId].data[2] = 0; gTasks[taskId].data[4] = 2; @@ -232,7 +232,7 @@ void DoSealedChamberShakingEffect1(void) void DoSealedChamberShakingEffect2(void) { u8 taskId = CreateTask(SealedChamberShakingEffect, 0x9); - + gTasks[taskId].data[1] = 0; gTasks[taskId].data[2] = 0; gTasks[taskId].data[4] = 3; @@ -244,7 +244,7 @@ void DoSealedChamberShakingEffect2(void) void SealedChamberShakingEffect(u8 taskId) { struct Task *task = &gTasks[taskId]; - + task->data[1]++; if(!(task->data[1] % task->data[5])) -- cgit v1.2.3 From bcaab977727ded65c9eeaef9dbef9e9441d26fb7 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Sat, 21 Jan 2017 16:48:06 -0800 Subject: formatting --- src/braille_puzzles.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'src/braille_puzzles.c') diff --git a/src/braille_puzzles.c b/src/braille_puzzles.c index cf05bdf20..8bbd1ce13 100644 --- a/src/braille_puzzles.c +++ b/src/braille_puzzles.c @@ -28,13 +28,13 @@ void SealedChamberShakingEffect(u8 taskId); bool8 ShouldDoBrailleDigEffect(void) { - if(!FlagGet(SYS_BRAILLE_DIG) && (gSaveBlock1.location.mapGroup == 0x18 && gSaveBlock1.location.mapNum == 0x47)) + if (!FlagGet(SYS_BRAILLE_DIG) && (gSaveBlock1.location.mapGroup == 0x18 && gSaveBlock1.location.mapNum == 0x47)) { - if(gSaveBlock1.pos.x == 10 && gSaveBlock1.pos.y == 3) + if (gSaveBlock1.pos.x == 10 && gSaveBlock1.pos.y == 3) return TRUE; - else if(gSaveBlock1.pos.x == 9 && gSaveBlock1.pos.y == 3) + else if (gSaveBlock1.pos.x == 9 && gSaveBlock1.pos.y == 3) return TRUE; - else if(gSaveBlock1.pos.x == 11 && gSaveBlock1.pos.y == 3) + else if (gSaveBlock1.pos.x == 11 && gSaveBlock1.pos.y == 3) return TRUE; } @@ -57,11 +57,11 @@ void DoBrailleDigEffect(void) bool8 CheckRelicanthWailord(void) { - if(GetMonData(&gPlayerParty, MON_DATA_SPECIES2, 0) == SPECIES_RELICANTH) + if (GetMonData(&gPlayerParty, MON_DATA_SPECIES2, 0) == SPECIES_RELICANTH) { CalculatePlayerPartyCount(); - if(GetMonData(&gPlayerParty[gPlayerPartyCount - 1], MON_DATA_SPECIES2, 0) == SPECIES_WAILORD) + if (GetMonData(&gPlayerParty[gPlayerPartyCount - 1], MON_DATA_SPECIES2, 0) == SPECIES_WAILORD) return TRUE; } return FALSE; @@ -69,13 +69,13 @@ bool8 CheckRelicanthWailord(void) bool8 ShouldDoBrailleStrengthEffect(void) { - if(!FlagGet(SYS_BRAILLE_STRENGTH) && (gSaveBlock1.location.mapGroup == 0x18 && gSaveBlock1.location.mapNum == 0x6)) + if (!FlagGet(SYS_BRAILLE_STRENGTH) && (gSaveBlock1.location.mapGroup == 0x18 && gSaveBlock1.location.mapNum == 0x6)) { - if(gSaveBlock1.pos.x == 10 && gSaveBlock1.pos.y == 23) + if (gSaveBlock1.pos.x == 10 && gSaveBlock1.pos.y == 23) return TRUE; - else if(gSaveBlock1.pos.x == 9 && gSaveBlock1.pos.y == 23) + else if (gSaveBlock1.pos.x == 9 && gSaveBlock1.pos.y == 23) return TRUE; - else if(gSaveBlock1.pos.x == 11 && gSaveBlock1.pos.y == 23) + else if (gSaveBlock1.pos.x == 11 && gSaveBlock1.pos.y == 23) return TRUE; } @@ -99,9 +99,9 @@ void DoBrailleStrengthEffect(void) bool8 ShouldDoBrailleFlyEffect(void) { - if(!FlagGet(SYS_BRAILLE_FLY) && (gSaveBlock1.location.mapGroup == 0x18 && gSaveBlock1.location.mapNum == 0x44)) + if (!FlagGet(SYS_BRAILLE_FLY) && (gSaveBlock1.location.mapGroup == 0x18 && gSaveBlock1.location.mapNum == 0x44)) { - if(gSaveBlock1.pos.x == 8 && gSaveBlock1.pos.y == 25) + if (gSaveBlock1.pos.x == 8 && gSaveBlock1.pos.y == 25) return TRUE; } @@ -145,7 +145,7 @@ void UseFlyAncientTomb_Finish(void) void DoBrailleWait(void) { - if(!FlagGet(SYS_BRAILLE_WAIT)) + if (!FlagGet(SYS_BRAILLE_WAIT)) CreateTask(Task_BrailleWait, 0x50); } @@ -153,14 +153,14 @@ void Task_BrailleWait(u8 taskId) { s16 *data = gTasks[taskId].data; - switch(data[0]) + switch (data[0]) { case 0: data[1] = 7200; data[0] = 1; break; case 1: - if(BrailleWait_CheckButtonPress() != FALSE) + if (BrailleWait_CheckButtonPress() != FALSE) { MenuZeroFillScreen(); PlaySE(5); @@ -169,7 +169,7 @@ void Task_BrailleWait(u8 taskId) else { data[1] = data[1] - 1; - if(data[1] == 0) + if (data[1] == 0) { MenuZeroFillScreen(); data[0] = 3; @@ -178,10 +178,10 @@ void Task_BrailleWait(u8 taskId) } break; case 2: - if(BrailleWait_CheckButtonPress() == FALSE) + if (BrailleWait_CheckButtonPress() == FALSE) { data[1] = data[1] - 1; - if(data[1] == 0) + if (data[1] == 0) data[0] = 4; break; } @@ -191,7 +191,7 @@ void Task_BrailleWait(u8 taskId) break; case 3: data[1] = data[1] - 1; - if(data[1] == 0) + if (data[1] == 0) data[0] = 4; break; case 4: @@ -206,12 +206,12 @@ bool32 BrailleWait_CheckButtonPress(void) { u16 var = 0xFF; - if(gSaveBlock2.optionsButtonMode == 1) + if (gSaveBlock2.optionsButtonMode == 1) var |= 0x300; - if(gSaveBlock2.optionsButtonMode == 2) + if (gSaveBlock2.optionsButtonMode == 2) var |= 0x200; - if((var & gMain.newKeys) != FALSE) + if ((var & gMain.newKeys) != FALSE) return TRUE; else return FALSE; @@ -247,13 +247,13 @@ void SealedChamberShakingEffect(u8 taskId) task->data[1]++; - if(!(task->data[1] % task->data[5])) + if (!(task->data[1] % task->data[5])) { task->data[1] = 0; task->data[2]++; task->data[4] = -task->data[4]; SetCameraPanning(0, task->data[4]); - if(task->data[2] == task->data[6]) + if (task->data[2] == task->data[6]) { DestroyTask(taskId); EnableBothScriptContexts(); -- cgit v1.2.3 From d4703599837531d1118b64822c85755f28747ee1 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Sat, 18 Mar 2017 03:56:44 +0100 Subject: label braille_puzzles.c event script --- src/braille_puzzles.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/braille_puzzles.c') diff --git a/src/braille_puzzles.c b/src/braille_puzzles.c index 8bbd1ce13..37eda65d3 100644 --- a/src/braille_puzzles.c +++ b/src/braille_puzzles.c @@ -12,19 +12,15 @@ #include "species.h" #include "task.h" #include "text.h" +#include "braille_puzzles.h" +#include "rom6.h" extern u8 gPlayerPartyCount; extern u8 gUnknown_03005CE0; extern u32 gUnknown_0202FF84[]; -extern u8 gUnknown_0815EF19[]; - -void UseFlyAncientTomb_Callback(void); -void UseFlyAncientTomb_Finish(void); -void Task_BrailleWait(u8 taskId); -bool32 BrailleWait_CheckButtonPress(void); -void SealedChamberShakingEffect(u8 taskId); +extern u8 gIslandCave_EventScript_OpenRegiiceChamber[]; // regiice event script bool8 ShouldDoBrailleDigEffect(void) { @@ -196,7 +192,7 @@ void Task_BrailleWait(u8 taskId) break; case 4: sub_8064E2C(); - ScriptContext1_SetupScript(gUnknown_0815EF19); + ScriptContext1_SetupScript(gIslandCave_EventScript_OpenRegiiceChamber); DestroyTask(taskId); break; } -- cgit v1.2.3 From 3d5864529e93265ea1711b638a4ab7b3d563086d Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Wed, 22 Mar 2017 06:04:41 +0100 Subject: label changes for clarity --- src/braille_puzzles.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/braille_puzzles.c') diff --git a/src/braille_puzzles.c b/src/braille_puzzles.c index 37eda65d3..94643691c 100644 --- a/src/braille_puzzles.c +++ b/src/braille_puzzles.c @@ -16,7 +16,7 @@ #include "rom6.h" extern u8 gPlayerPartyCount; -extern u8 gUnknown_03005CE0; +extern u8 gLastFieldPokeMenuOpened; extern u32 gUnknown_0202FF84[]; @@ -106,7 +106,7 @@ bool8 ShouldDoBrailleFlyEffect(void) void DoBrailleFlyEffect(void) { - gUnknown_0202FF84[0] = gUnknown_03005CE0; + gUnknown_0202FF84[0] = gLastFieldPokeMenuOpened; FieldEffectStart(0x3C); } -- cgit v1.2.3 From ddc846fa6a0d9a13cfba6f52488a66f6f4562a2d Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Thu, 27 Apr 2017 15:43:31 +0200 Subject: Sort includes --- src/braille_puzzles.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/braille_puzzles.c') diff --git a/src/braille_puzzles.c b/src/braille_puzzles.c index 94643691c..220e8420c 100644 --- a/src/braille_puzzles.c +++ b/src/braille_puzzles.c @@ -1,4 +1,5 @@ #include "global.h" +#include "braille_puzzles.h" #include "asm.h" #include "event_data.h" #include "field_camera.h" @@ -6,14 +7,13 @@ #include "flags.h" #include "map_obj_lock.h" #include "menu.h" +#include "rom6.h" #include "script.h" #include "songs.h" #include "sound.h" #include "species.h" #include "task.h" #include "text.h" -#include "braille_puzzles.h" -#include "rom6.h" extern u8 gPlayerPartyCount; extern u8 gLastFieldPokeMenuOpened; -- cgit v1.2.3 From 010eb456d63b0d644285f263f310d73bfb9646b2 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Sat, 20 May 2017 17:49:54 +0200 Subject: Decrease indentation level of switches --- src/braille_puzzles.c | 74 +++++++++++++++++++++++++-------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'src/braille_puzzles.c') diff --git a/src/braille_puzzles.c b/src/braille_puzzles.c index 220e8420c..2ee4f91bb 100644 --- a/src/braille_puzzles.c +++ b/src/braille_puzzles.c @@ -151,50 +151,50 @@ void Task_BrailleWait(u8 taskId) switch (data[0]) { - case 0: - data[1] = 7200; - data[0] = 1; - break; - case 1: - if (BrailleWait_CheckButtonPress() != FALSE) + case 0: + data[1] = 7200; + data[0] = 1; + break; + case 1: + if (BrailleWait_CheckButtonPress() != FALSE) + { + MenuZeroFillScreen(); + PlaySE(5); + data[0] = 2; + } + else + { + data[1] = data[1] - 1; + if (data[1] == 0) { MenuZeroFillScreen(); - PlaySE(5); - data[0] = 2; - } - else - { - data[1] = data[1] - 1; - if (data[1] == 0) - { - MenuZeroFillScreen(); - data[0] = 3; - data[1] = 30; - } - } - break; - case 2: - if (BrailleWait_CheckButtonPress() == FALSE) - { - data[1] = data[1] - 1; - if (data[1] == 0) - data[0] = 4; - break; + data[0] = 3; + data[1] = 30; } - sub_8064E2C(); - DestroyTask(taskId); - ScriptContext2_Disable(); - break; - case 3: + } + break; + case 2: + if (BrailleWait_CheckButtonPress() == FALSE) + { data[1] = data[1] - 1; if (data[1] == 0) data[0] = 4; break; - case 4: - sub_8064E2C(); - ScriptContext1_SetupScript(gIslandCave_EventScript_OpenRegiiceChamber); - DestroyTask(taskId); - break; + } + sub_8064E2C(); + DestroyTask(taskId); + ScriptContext2_Disable(); + break; + case 3: + data[1] = data[1] - 1; + if (data[1] == 0) + data[0] = 4; + break; + case 4: + sub_8064E2C(); + ScriptContext1_SetupScript(gIslandCave_EventScript_OpenRegiiceChamber); + DestroyTask(taskId); + break; } } -- cgit v1.2.3 From 4d2b22a899c11dfcacfec6889968ab01655a3fe3 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Fri, 26 May 2017 14:53:51 +0200 Subject: Add headers --- src/braille_puzzles.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/braille_puzzles.c') diff --git a/src/braille_puzzles.c b/src/braille_puzzles.c index 2ee4f91bb..f0ef51ac2 100644 --- a/src/braille_puzzles.c +++ b/src/braille_puzzles.c @@ -1,6 +1,7 @@ +#include "fieldmap.h" +#include "main.h" #include "global.h" #include "braille_puzzles.h" -#include "asm.h" #include "event_data.h" #include "field_camera.h" #include "field_effect.h" -- cgit v1.2.3 From f26daa3d6954d2db3a7c44b79d319a7a084462c2 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Fri, 26 May 2017 15:01:42 +0200 Subject: Sort includes --- src/braille_puzzles.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/braille_puzzles.c') diff --git a/src/braille_puzzles.c b/src/braille_puzzles.c index f0ef51ac2..4de945b9c 100644 --- a/src/braille_puzzles.c +++ b/src/braille_puzzles.c @@ -1,11 +1,11 @@ -#include "fieldmap.h" -#include "main.h" #include "global.h" #include "braille_puzzles.h" #include "event_data.h" #include "field_camera.h" #include "field_effect.h" +#include "fieldmap.h" #include "flags.h" +#include "main.h" #include "map_obj_lock.h" #include "menu.h" #include "rom6.h" -- cgit v1.2.3