diff --git a/data/field_effect_scripts.s b/data/field_effect_scripts.s index 2edf13661e..291d6abec1 100644 --- a/data/field_effect_scripts.s +++ b/data/field_effect_scripts.s @@ -10,79 +10,66 @@ gFieldEffectScriptPointers:: @ 82DB9D4 .4byte gFieldEffectScript_UseCutOnTree .4byte gFieldEffectScript_Shadow .4byte gFieldEffectScript_TallGrass - .4byte gFieldEffectScript_Ripple .4byte gFieldEffectScript_FieldMoveShowMon .4byte gFieldEffectScript_Ash .4byte gFieldEffectScript_SurfBlob .4byte gFieldEffectScript_UseSurf - .4byte gFieldEffectScript_GroundImpactDust .4byte gFieldEffectScript_Unknown11 .4byte gFieldEffectScript_BikeHopTallGrass .4byte gFieldEffectScript_SandFootprints .4byte gFieldEffectScript_BikeHopBigSplash - .4byte gFieldEffectScript_Splash .4byte gFieldEffectScript_BikeHopSmallSplash .4byte gFieldEffectScript_LongGrass .4byte gFieldEffectScript_Unknown18 .4byte gFieldEffectScript_Unknown19 - .4byte gFieldEffectScript_Unknown20 .4byte gFieldEffectScript_Unknown21 .4byte gFieldEffectScript_Unknown22 .4byte gFieldEffectScript_BerryTreeGrowthSparkle .4byte gFieldEffectScript_DeepSandFootprints - .4byte gFieldEffectScript_Unknown25 .4byte gFieldEffectScript_Unknown26 .4byte gFieldEffectScript_Unknown27 .4byte gFieldEffectScript_TreeDisguise .4byte gFieldEffectScript_MountainDisguise - .4byte gFieldEffectScript_Unknown30 .4byte gFieldEffectScript_UseFly .4byte gFieldEffectScript_FlyIn .4byte gFieldEffectScript_QuestionMarkIcon .4byte gFieldEffectScript_FeetInFlowingWater - .4byte gFieldEffectScript_BikeTireTracks .4byte gFieldEffectScript_SandDisguisePlaceholder .4byte gFieldEffectScript_UseRockSmash .4byte gFieldEffectScript_Unknown38 .4byte gFieldEffectScript_Unknown39 - .4byte gFieldEffectScript_Unknown40 .4byte gFieldEffectScript_ShortGrass .4byte gFieldEffectScript_HotSpringsWater .4byte gFieldEffectScript_Unknown43 .4byte gFieldEffectScript_Unknown44 - .4byte gFieldEffectScript_Unknown45 .4byte gFieldEffectScript_HeartIcon .4byte gFieldEffectScript_Unknown47 .4byte gFieldEffectScript_Unknown48 .4byte gFieldEffectScript_JumpOutOfAsh - .4byte gFieldEffectScript_Unknown50 .4byte gFieldEffectScript_Unknown51 .4byte gFieldEffectScript_Unknown52 .4byte gFieldEffectScript_Bubbles .4byte gFieldEffectScript_Unknown54 - .4byte gFieldEffectScript_Unknown55 .4byte gFieldEffectScript_Unknown56 .4byte gFieldEffectScript_Unknown57 .4byte gFieldEffectScript_Unknown58 .4byte gFieldEffectScript_FieldMoveShowMonInit - .4byte gFieldEffectScript_UsePuzzleEffect .4byte gFieldEffectScript_Unknown61 .4byte gFieldEffectScript_Unknown62 .4byte gFieldEffectScript_Unknown63 .4byte gFieldEffectScript_Rayquaza - .4byte gFieldEffectScript_Unknown65 .4byte gFieldEffectScript_Unknown66 diff --git a/data/maps/AncientTomb/scripts.inc b/data/maps/AncientTomb/scripts.inc index 7e9b027b27..241cb50f13 100644 --- a/data/maps/AncientTomb/scripts.inc +++ b/data/maps/AncientTomb/scripts.inc @@ -25,7 +25,7 @@ AncientTomb_EventScript_238FEE:: @ 8238FEE return AncientTomb_MapScript1_238FF2: @ 8238FF2 - call_if_unset FLAG_SYS_BRAILLE_REGISTEEL_HM, AncientTomb_EventScript_238FFC + call_if_unset FLAG_SYS_REGISTEEL_PUZZLE_COMPLETED, AncientTomb_EventScript_238FFC end AncientTomb_EventScript_238FFC:: @ 8238FFC @@ -39,7 +39,7 @@ AncientTomb_EventScript_238FFC:: @ 8238FFC AncientTomb_EventScript_239033:: @ 8239033 lockall - goto_if_set FLAG_SYS_BRAILLE_REGISTEEL_HM, AncientTomb_EventScript_239046 + goto_if_set FLAG_SYS_REGISTEEL_PUZZLE_COMPLETED, AncientTomb_EventScript_239046 braillemessage AncientTomb_Braille_2A6D06 waitbuttonpress hidebox2 diff --git a/data/maps/DesertRuins/scripts.inc b/data/maps/DesertRuins/scripts.inc index ff58b3ba5e..ac0b547afc 100644 --- a/data/maps/DesertRuins/scripts.inc +++ b/data/maps/DesertRuins/scripts.inc @@ -16,7 +16,7 @@ DesertRuins_EventScript_22D975:: @ 822D975 return DesertRuins_MapScript1_22D989: @ 822D989 - call_if_unset FLAG_SYS_BRAILLE_REGIROCK_HM, DesertRuins_EventScript_22D993 + call_if_unset FLAG_SYS_REGIROCK_PUZZLE_COMPLETE, DesertRuins_EventScript_22D993 end DesertRuins_EventScript_22D993:: @ 822D993 @@ -39,7 +39,7 @@ DesertRuins_EventScript_22D9D7:: @ 822D9D7 DesertRuins_EventScript_22D9DB:: @ 822D9DB lockall - goto_if_set FLAG_SYS_BRAILLE_REGIROCK_HM, DesertRuins_EventScript_22D9EE + goto_if_set FLAG_SYS_REGIROCK_PUZZLE_COMPLETE, DesertRuins_EventScript_22D9EE braillemessage DesertRuins_Braille_2A6CA0 waitbuttonpress hidebox2 diff --git a/include/constants/flags.h b/include/constants/flags.h index 11a0c849cf..a7bc4c88ea 100644 --- a/include/constants/flags.h +++ b/include/constants/flags.h @@ -1352,9 +1352,9 @@ #define FLAG_SYS_ENC_UP_ITEM (SYSTEM_FLAGS + 0x4D) #define FLAG_SYS_ENC_DOWN_ITEM (SYSTEM_FLAGS + 0x4E) #define FLAG_SYS_BRAILLE_DIG (SYSTEM_FLAGS + 0x4F) -#define FLAG_SYS_BRAILLE_REGIROCK_HM (SYSTEM_FLAGS + 0x50) -#define FLAG_SYS_BRAILLE_REGICE_PUZZLE (SYSTEM_FLAGS + 0x51) -#define FLAG_SYS_BRAILLE_REGISTEEL_HM (SYSTEM_FLAGS + 0x52) +#define FLAG_SYS_REGIROCK_PUZZLE_COMPLETE (SYSTEM_FLAGS + 0x50) +#define FLAG_SYS_BRAILLE_REGICE_PUZZLE (SYSTEM_FLAGS + 0x51) +#define FLAG_SYS_REGISTEEL_PUZZLE_COMPLETED (SYSTEM_FLAGS + 0x52) #define FLAG_SYS_HAS_EON_TICKET (SYSTEM_FLAGS + 0x53) #define FLAG_LANDMARK_POKEMON_LEAGUE (SYSTEM_FLAGS + 0x54) diff --git a/src/braille_puzzles.c b/src/braille_puzzles.c index 449c1dfea2..f894919405 100644 --- a/src/braille_puzzles.c +++ b/src/braille_puzzles.c @@ -70,8 +70,8 @@ void DoBrailleRegisteelEffect(void); bool8 ShouldDoBrailleDigEffect(void) { if (!FlagGet(FLAG_SYS_BRAILLE_DIG) - && (gSaveBlock1Ptr->location.mapGroup == 0x18 - && gSaveBlock1Ptr->location.mapNum == 0x47)) + && (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(SEALED_CHAMBER_OUTER_ROOM) + && gSaveBlock1Ptr->location.mapNum == MAP_NUM(SEALED_CHAMBER_OUTER_ROOM))) { if (gSaveBlock1Ptr->pos.x == 10 && gSaveBlock1Ptr->pos.y == 3) return TRUE; @@ -86,12 +86,12 @@ bool8 ShouldDoBrailleDigEffect(void) 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); + MapGridSetMetatileIdAt(16, 8, 0x22A); + MapGridSetMetatileIdAt(17, 8, 0x22B); + MapGridSetMetatileIdAt(18, 8, 0x22C); + MapGridSetMetatileIdAt(16, 9, 0xE32); + MapGridSetMetatileIdAt(17, 9, 0x233); + MapGridSetMetatileIdAt(18, 9, 0xE34); DrawWholeMapView(); PlaySE(SE_BAN); FlagSet(FLAG_SYS_BRAILLE_DIG); @@ -117,7 +117,7 @@ bool8 CheckRelicanthWailord(void) void ShouldDoBrailleRegirockEffectOld(void) { /* - if (!FlagGet(FLAG_SYS_BRAILLE_REGIROCK_HM) && (gSaveBlock1.location.mapGroup == MAP_GROUP_DESERT_RUINS && gSaveBlock1.location.mapNum == MAP_ID_DESERT_RUINS)) + if (!FlagGet(FLAG_SYS_REGIROCK_PUZZLE_COMPLETE) && (gSaveBlock1.location.mapGroup == MAP_GROUP_DESERT_RUINS && gSaveBlock1.location.mapNum == MAP_ID_DESERT_RUINS)) { if (gSaveBlock1.pos.x == 10 && gSaveBlock1.pos.y == 23) return TRUE; @@ -141,13 +141,13 @@ void DoBrailleRegirockEffect(void) MapGridSetMetatileIdAt(16, 27, 3636); DrawWholeMapView(); PlaySE(SE_BAN); - FlagSet(FLAG_SYS_BRAILLE_REGIROCK_HM); + FlagSet(FLAG_SYS_REGIROCK_PUZZLE_COMPLETE); ScriptContext2_Disable(); } bool8 ShouldDoBrailleRegisteelEffect(void) { - if (!FlagGet(FLAG_SYS_BRAILLE_REGISTEEL_HM) && (gSaveBlock1.location.mapGroup == MAP_GROUP_ANCIENT_TOMB && gSaveBlock1.location.mapNum == MAP_ID_ANCIENT_TOMB)) + if (!FlagGet(FLAG_SYS_REGISTEEL_PUZZLE_COMPLETED) && (gSaveBlock1.location.mapGroup == MAP_GROUP_ANCIENT_TOMB && gSaveBlock1.location.mapNum == MAP_ID_ANCIENT_TOMB)) { if (gSaveBlock1.pos.x == 8 && gSaveBlock1.pos.y == 25) return TRUE; @@ -187,7 +187,7 @@ void UseFlyAncientTomb_Finish(void) MapGridSetMetatileIdAt(16, 27, 3636); DrawWholeMapView(); PlaySE(SE_BAN); - FlagSet(FLAG_SYS_BRAILLE_REGISTEEL_HM); + FlagSet(FLAG_SYS_REGISTEEL_PUZZLE_COMPLETED); ScriptContext2_Disable(); } */ @@ -241,7 +241,7 @@ void SealedChamberShakingEffect(u8 taskId) // moved later in the function because it was rewritten. bool8 ShouldDoBrailleRegirockEffect(void) { - if (!FlagGet(FLAG_SYS_BRAILLE_REGIROCK_HM) + if (!FlagGet(FLAG_SYS_REGIROCK_PUZZLE_COMPLETE) && gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(DESERT_RUINS) && gSaveBlock1Ptr->location.mapNum == MAP_NUM(DESERT_RUINS)) { @@ -279,21 +279,21 @@ void UseRegirockHm_Callback(void) void DoBrailleRegirockEffect(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); + MapGridSetMetatileIdAt(14, 26, 0x22A); + MapGridSetMetatileIdAt(15, 26, 0x22B); + MapGridSetMetatileIdAt(16, 26, 0x22C); + MapGridSetMetatileIdAt(14, 27, 0xE32); + MapGridSetMetatileIdAt(15, 27, 0x233); + MapGridSetMetatileIdAt(16, 27, 0xE34); DrawWholeMapView(); PlaySE(SE_BAN); - FlagSet(FLAG_SYS_BRAILLE_REGIROCK_HM); + FlagSet(FLAG_SYS_REGIROCK_PUZZLE_COMPLETE); ScriptContext2_Disable(); } bool8 ShouldDoBrailleRegisteelEffect(void) { - if (!FlagGet(FLAG_SYS_BRAILLE_REGISTEEL_HM) && (gSaveBlock1Ptr->location.mapGroup == 0x18 && gSaveBlock1Ptr->location.mapNum == 0x44)) + if (!FlagGet(FLAG_SYS_REGISTEEL_PUZZLE_COMPLETED) && (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(ANCIENT_TOMB) && gSaveBlock1Ptr->location.mapNum == MAP_NUM(ANCIENT_TOMB))) { if (gSaveBlock1Ptr->pos.x == 8 && gSaveBlock1Ptr->pos.y == 25) { @@ -318,15 +318,15 @@ void UseRegisteelHm_Callback(void) void DoBrailleRegisteelEffect(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); + MapGridSetMetatileIdAt(14, 26, 0x22A); + MapGridSetMetatileIdAt(15, 26, 0x22B); + MapGridSetMetatileIdAt(16, 26, 0x22C); + MapGridSetMetatileIdAt(14, 27, 0xE32); + MapGridSetMetatileIdAt(15, 27, 0x233); + MapGridSetMetatileIdAt(16, 27, 0xE34); DrawWholeMapView(); PlaySE(SE_BAN); - FlagSet(FLAG_SYS_BRAILLE_REGISTEEL_HM); + FlagSet(FLAG_SYS_REGISTEEL_PUZZLE_COMPLETED); ScriptContext2_Disable(); } @@ -429,8 +429,8 @@ bool8 ShouldDoBrailleRegicePuzzle(void) { u8 i; - if (gSaveBlock1Ptr->location.mapGroup == 0x18 - && gSaveBlock1Ptr->location.mapNum == 0x43) + if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(ISLAND_CAVE) + && gSaveBlock1Ptr->location.mapNum == MAP_NUM(ISLAND_CAVE)) { if (FlagGet(FLAG_SYS_BRAILLE_REGICE_PUZZLE)) return FALSE; @@ -467,7 +467,7 @@ bool8 ShouldDoBrailleRegicePuzzle(void) } varValue = VarGet(VAR_REGICE_STEPS_1); - if (varValue != 0xFFFF || VarGet(VAR_REGICE_STEPS_2) != varValue || VarGet(VAR_REGICE_STEPS_3) != 0xF) + if (varValue != 0xFFFF || VarGet(VAR_REGICE_STEPS_2) != 0xFFFF || VarGet(VAR_REGICE_STEPS_3) != 0xF) return FALSE; // This final check is redundant.