From aad839995f6351318e4a162767ca91d4a399dc76 Mon Sep 17 00:00:00 2001 From: garak Date: Tue, 11 Jun 2019 20:57:42 -0400 Subject: label metatiles for pacifidlog and fortree bridges --- src/field_tasks.c | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) (limited to 'src/field_tasks.c') diff --git a/src/field_tasks.c b/src/field_tasks.c index 22b8697d8..dff812482 100644 --- a/src/field_tasks.c +++ b/src/field_tasks.c @@ -19,6 +19,7 @@ #include "constants/items.h" #include "constants/songs.h" #include "constants/vars.h" +#include "constants/metatile_labels.h" struct PacifidlogMetatileOffsets { @@ -50,26 +51,26 @@ static const TaskFunc sPerStepCallbacks[] = // they are in pairs but declared as 1D array static const struct PacifidlogMetatileOffsets sHalfSubmergedBridgeMetatileOffsets[] = { - { 0, 0, 0x259}, { 0, 1, 0x261}, - { 0, -1, 0x259}, { 0, 0, 0x261}, - { 0, 0, 0x252}, { 1, 0, 0x253}, - { -1, 0, 0x252}, { 0, 0, 0x253} + { 0, 0, METATILE_ID(Pacifidlog, HalfSubmergedLogs_Vertical0)}, {0, 1, METATILE_ID(Pacifidlog, HalfSubmergedLogs_Vertical1)}, + { 0, -1, METATILE_ID(Pacifidlog, HalfSubmergedLogs_Vertical0)}, {0, 0, METATILE_ID(Pacifidlog, HalfSubmergedLogs_Vertical1)}, + { 0, 0, METATILE_ID(Pacifidlog, HalfSubmergedLogs_Horizontal0)}, {1, 0, METATILE_ID(Pacifidlog, HalfSubmergedLogs_Horizontal1)}, + {-1, 0, METATILE_ID(Pacifidlog, HalfSubmergedLogs_Horizontal0)}, {0, 0, METATILE_ID(Pacifidlog, HalfSubmergedLogs_Horizontal1)} }; static const struct PacifidlogMetatileOffsets sFullySubmergedBridgeMetatileOffsets[] = { - { 0, 0, 0x25A}, { 0, 1, 0x262}, - { 0, -1, 0x25A}, { 0, 0, 0x262}, - { 0, 0, 0x254}, { 1, 0, 0x255}, - { -1, 0, 0x254}, { 0, 0, 0x255} + { 0, 0, METATILE_ID(Pacifidlog, SubmergedLogs_Vertical0)}, {0, 1, METATILE_ID(Pacifidlog, SubmergedLogs_Vertical1)}, + { 0, -1, METATILE_ID(Pacifidlog, SubmergedLogs_Vertical0)}, {0, 0, METATILE_ID(Pacifidlog, SubmergedLogs_Vertical1)}, + { 0, 0, METATILE_ID(Pacifidlog, SubmergedLogs_Horizontal0)}, {1, 0, METATILE_ID(Pacifidlog, SubmergedLogs_Horizontal1)}, + {-1, 0, METATILE_ID(Pacifidlog, SubmergedLogs_Horizontal0)}, {0, 0, METATILE_ID(Pacifidlog, SubmergedLogs_Horizontal1)} }; static const struct PacifidlogMetatileOffsets sFloatingBridgeMetatileOffsets[] = { - { 0, 0, 0x258}, { 0, 1, 0x260}, - { 0, -1, 0x258}, { 0, 0, 0x260}, - { 0, 0, 0x250}, { 1, 0, 0x251}, - { -1, 0, 0x250}, { 0, 0, 0x251} + { 0, 0, METATILE_ID(Pacifidlog, FloatingLogs_Vertical0)}, {0, 1, METATILE_ID(Pacifidlog, FloatingLogs_Vertical1)}, + { 0, -1, METATILE_ID(Pacifidlog, FloatingLogs_Vertical0)}, {0, 0, METATILE_ID(Pacifidlog, FloatingLogs_Vertical1)}, + { 0, 0, METATILE_ID(Pacifidlog, FloatingLogs_Horizontal0)}, {1, 0, METATILE_ID(Pacifidlog, FloatingLogs_Horizontal1)}, + {-1, 0, METATILE_ID(Pacifidlog, FloatingLogs_Horizontal0)}, {0, 0, METATILE_ID(Pacifidlog, FloatingLogs_Horizontal1)} }; // Each element corresponds to a y coordinate row in the sootopolis gym 1F map. @@ -374,11 +375,11 @@ static void SetLoweredForetreeBridgeMetatile(s16 x, s16 y) { switch (MapGridGetMetatileIdAt(x, y)) { - case 0x24e: - MapGridSetMetatileIdAt(x, y, 0x24f); + case METATILE_ID(Fortree, BridgeOverGrass_Raised): + MapGridSetMetatileIdAt(x, y, METATILE_ID(Fortree, BridgeOverGrass_Lowered)); break; - case 0x256: - MapGridSetMetatileIdAt(x, y, 0x257); + case METATILE_ID(Fortree, BridgeOverTrees_Raised): + MapGridSetMetatileIdAt(x, y, METATILE_ID(Fortree, BridgeOverTrees_Lowered)); break; } } @@ -391,11 +392,11 @@ static void SetNormalFortreeBridgeMetatile(s16 x, s16 y) { switch (MapGridGetMetatileIdAt(x, y)) { - case 0x24f: - MapGridSetMetatileIdAt(x, y, 0x24e); + case METATILE_ID(Fortree, BridgeOverGrass_Lowered): + MapGridSetMetatileIdAt(x, y, METATILE_ID(Fortree, BridgeOverGrass_Raised)); break; - case 0x257: - MapGridSetMetatileIdAt(x, y, 0x256); + case METATILE_ID(Fortree, BridgeOverTrees_Lowered): + MapGridSetMetatileIdAt(x, y, METATILE_ID(Fortree, BridgeOverTrees_Raised)); break; } } -- cgit v1.2.3 From 8b26bd1e099a6f2893aa21a82f8f942b1ea6bd23 Mon Sep 17 00:00:00 2001 From: garak Date: Tue, 11 Jun 2019 21:32:27 -0400 Subject: label metatiles for general, fallarbor, and sootopolis gym tilesets --- src/field_tasks.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'src/field_tasks.c') 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) -- cgit v1.2.3 From 9f8a30e4e7bafb50d179859ed1d6004c62bf5698 Mon Sep 17 00:00:00 2001 From: garak Date: Tue, 11 Jun 2019 22:22:50 -0400 Subject: label metatiles in fldeff_cut.c --- src/field_tasks.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/field_tasks.c') diff --git a/src/field_tasks.c b/src/field_tasks.c index 68ff082b6..63539e475 100644 --- a/src/field_tasks.c +++ b/src/field_tasks.c @@ -623,7 +623,7 @@ static void AshGrassPerStepCallback(u8 taskId) if (MapGridGetMetatileIdAt(x, y) == METATILE_ID(Fallarbor, AshGrass)) StartAshFieldEffect(x, y, METATILE_ID(Fallarbor, NormalGrass), 4); else - StartAshFieldEffect(x, y, 0x206, 4);// unsure what metatile this refers to + StartAshFieldEffect(x, y, METATILE_ID(Lavaridge, NormalGrass), 4); if (CheckBagHasItem(ITEM_SOOT_SACK, 1)) { @@ -637,7 +637,7 @@ static void AshGrassPerStepCallback(u8 taskId) static void SetCrackedFloorHoleMetatile(s16 x, s16 y) { - MapGridSetMetatileIdAt(x, y, MapGridGetMetatileIdAt(x, y) == 0x22f ? 0x206 : 0x237);// again unsure what these are referring to + MapGridSetMetatileIdAt(x, y, MapGridGetMetatileIdAt(x, y) == 0x22f ? 0x206 : 0x237);// unsure what these are referring to CurrentMapDrawMetatileAt(x, y); } -- cgit v1.2.3