summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorscnorton <scnorton@biociphers.org>2017-06-20 11:57:29 -0400
committerscnorton <scnorton@biociphers.org>2017-06-20 11:57:29 -0400
commitfc175709153e9b9d2c0ef3fc16e02a5179325cb9 (patch)
treecb9ed60713ce0f203697a7ad5742c8de86c8bbc5 /src
parent36b2378f1536dd2c7055ad31f62720a32b5d66bc (diff)
PCTurnOffEffect
Diffstat (limited to 'src')
-rwxr-xr-xsrc/field_specials.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/field_specials.c b/src/field_specials.c
index 3bf3b3628..15b5b7631 100755
--- a/src/field_specials.c
+++ b/src/field_specials.c
@@ -745,6 +745,7 @@ void FieldShowRegionMap(void)
static void Task_PCTurnOnEffect(u8);
static void PCTurnOffEffect_0(struct Task *);
static void PCTurnOffEffect_1(s16, s8, s8);
+static void PCTurnOffEffect(void);
void DoPCTurnOnEffect(void)
{
@@ -842,3 +843,49 @@ static void PCTurnOffEffect_1(s16 flag, s8 dx, s8 dy)
}
MapGridSetMetatileIdAt(gSaveBlock1.pos.x + dx + 7, gSaveBlock1.pos.y + dy + 7, tileId | 0xc00);
}
+
+void DoPCTurnOffEffect(void)
+{
+ PCTurnOffEffect();
+}
+
+static void PCTurnOffEffect(void)
+{
+ u16 tileId;
+ s8 dx, dy;
+ u8 playerDirectionLowerNybble;
+
+ dx = 0;
+ dy = 0;
+ tileId = 0;
+ playerDirectionLowerNybble = player_get_direction_lower_nybble();
+ switch (playerDirectionLowerNybble)
+ {
+ case DIR_NORTH:
+ dx = 0;
+ dy = -1;
+ break;
+ case DIR_WEST:
+ dx = -1;
+ dy = -1;
+ break;
+ case DIR_EAST:
+ dx = 1;
+ dy = -1;
+ break;
+ }
+ if (gSpecialVar_0x8004 == 0)
+ {
+ tileId = 0x4;
+ }
+ else if (gSpecialVar_0x8004 == 1)
+ {
+ tileId = 0x25a;
+ }
+ else if (gSpecialVar_0x8004 == 2)
+ {
+ tileId = 0x259;
+ }
+ MapGridSetMetatileIdAt(gSaveBlock1.pos.x + dx + 7, gSaveBlock1.pos.y + dy + 7, tileId | 0xc00);
+ DrawWholeMapView();
+}