diff --git a/include/constants/metatile_labels.h b/include/constants/metatile_labels.h index 552a615fa..fc37c123d 100644 --- a/include/constants/metatile_labels.h +++ b/include/constants/metatile_labels.h @@ -1,6 +1,12 @@ #ifndef GUARD_METATILE_LABELS_H #define GUARD_METATILE_LABELS_H +// gTileset_General +#define METATILE_General_MuddySlope_Frame0 0x0E8 +#define METATILE_General_MuddySlope_Frame1 0x0E9 +#define METATILE_General_MuddySlope_Frame2 0x0EA +#define METATILE_General_MuddySlope_Frame3 0x0EB + // gTileset_Building #define METATILE_Building_PC_Off 0x004 #define METATILE_Building_PC_On 0x005 @@ -100,6 +106,13 @@ #define METATILE_Fortree_BridgeOverTrees_Raised 0x256 #define METATILE_Fortree_BridgeOverTrees_Lowered 0x257 +// gTileset_SootopolisGym +#define METATILE_SootopolisGym_Ice_Cracked 0x20E +#define METATILE_SootopolisGym_Ice_Broken 0x206 + +// gTileset_Fallarbor +#define METATILE_Fallarbor_AshGrass 0x20A +#define METATILE_Fallarbor_NormalGrass 0x212 diff --git a/src/field_effect_helpers.c b/src/field_effect_helpers.c index c715da25d..fb883b105 100755 --- a/src/field_effect_helpers.c +++ b/src/field_effect_helpers.c @@ -868,13 +868,13 @@ u32 FldEff_Unknown22(void) return 0; } -void StartAshFieldEffect(s16 x, s16 y, u16 c, s16 d) +void StartAshFieldEffect(s16 x, s16 y, u16 metatileId, s16 d) { gFieldEffectArguments[0] = x; gFieldEffectArguments[1] = y; gFieldEffectArguments[2] = 0x52; gFieldEffectArguments[3] = 1; - gFieldEffectArguments[4] = c; + gFieldEffectArguments[4] = metatileId; gFieldEffectArguments[5] = d; FieldEffectStart(FLDEFF_ASH); } diff --git a/src/field_tasks.c b/src/field_tasks.c index dff812482..68ff082b6 100644 --- a/src/field_tasks.c +++ b/src/field_tasks.c @@ -104,7 +104,12 @@ static const u16 sSootopolisGymIceRowVars[] = 0 }; -static const u16 sMuddySlopeMetatiles[] = {0xe8, 0xeb, 0xea, 0xe9}; +static const u16 sMuddySlopeMetatiles[] = { + METATILE_ID(General, MuddySlope_Frame0), + METATILE_ID(General, MuddySlope_Frame3), + METATILE_ID(General, MuddySlope_Frame2), + METATILE_ID(General, MuddySlope_Frame1) +}; static void Task_RunPerStepCallback(u8 taskId) { @@ -524,7 +529,7 @@ void SetSootopolisGymCrackedIceMetatiles(void) for (y = 0; y < height; y++) { if (IsIcePuzzleCoordVisited(x, y) == TRUE) - MapGridSetMetatileIdAt(x + 7, y + 7, 0x20e); + MapGridSetMetatileIdAt(x + 7, y + 7, METATILE_ID(SootopolisGym, Ice_Cracked)); } } } @@ -579,7 +584,7 @@ static void SootopolisGymIcePerStepCallback(u8 taskId) x = data[4]; y = data[5]; PlaySE(SE_RU_BARI); - MapGridSetMetatileIdAt(x, y, 0x20e); + MapGridSetMetatileIdAt(x, y, METATILE_ID(SootopolisGym, Ice_Cracked)); CurrentMapDrawMetatileAt(x, y); MarkIcePuzzleCoordVisited(x - 7, y - 7); data[1] = 1; @@ -595,7 +600,7 @@ static void SootopolisGymIcePerStepCallback(u8 taskId) x = data[4]; y = data[5]; PlaySE(SE_RU_GASYAN); - MapGridSetMetatileIdAt(x, y, 0x206); + MapGridSetMetatileIdAt(x, y, METATILE_ID(SootopolisGym, Ice_Broken)); CurrentMapDrawMetatileAt(x, y); data[1] = 1; } @@ -615,10 +620,10 @@ static void AshGrassPerStepCallback(u8 taskId) data[2] = y; if (MetatileBehavior_IsAshGrass(MapGridGetMetatileBehaviorAt(x, y))) { - if (MapGridGetMetatileIdAt(x, y) == 0x20a) - StartAshFieldEffect(x, y, 0x212, 4); + if (MapGridGetMetatileIdAt(x, y) == METATILE_ID(Fallarbor, AshGrass)) + StartAshFieldEffect(x, y, METATILE_ID(Fallarbor, NormalGrass), 4); else - StartAshFieldEffect(x, y, 0x206, 4); + StartAshFieldEffect(x, y, 0x206, 4);// unsure what metatile this refers to if (CheckBagHasItem(ITEM_SOOT_SACK, 1)) { @@ -632,7 +637,7 @@ static void AshGrassPerStepCallback(u8 taskId) static void SetCrackedFloorHoleMetatile(s16 x, s16 y) { - MapGridSetMetatileIdAt(x, y, MapGridGetMetatileIdAt(x, y) == 0x22f ? 0x206 : 0x237); + MapGridSetMetatileIdAt(x, y, MapGridGetMetatileIdAt(x, y) == 0x22f ? 0x206 : 0x237);// again unsure what these are referring to CurrentMapDrawMetatileAt(x, y); } @@ -687,7 +692,7 @@ static void SetMuddySlopeMetatile(s16 *data, s16 x, s16 y) MapGridSetMetatileIdAt(x, y, tile); CurrentMapDrawMetatileAt(x, y); - MapGridSetMetatileIdAt(x, y, 0xe8); + MapGridSetMetatileIdAt(x, y, METATILE_ID(General, MuddySlope_Frame0)); } static void Task_MuddySlope(u8 taskId)