summaryrefslogtreecommitdiff
path: root/src/field_tasks.c
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2017-06-26 22:26:02 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2017-06-26 22:26:02 -0400
commit57a6a5e6564aec89ab45f2d4c3b911f59f7db210 (patch)
tree206ae4351827c32d143f194f5a728a9f8fdce667 /src/field_tasks.c
parentb8c5ff4a42662ca8810d10e2509cff7923d73d08 (diff)
PerStepCallback_8069F64
Diffstat (limited to 'src/field_tasks.c')
-rwxr-xr-xsrc/field_tasks.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/field_tasks.c b/src/field_tasks.c
index f68c6bbe4..ea70cf227 100755
--- a/src/field_tasks.c
+++ b/src/field_tasks.c
@@ -6,11 +6,14 @@
#include "task.h"
#include "main.h"
#include "vars.h"
+#include "item.h"
+#include "items.h"
#include "event_data.h"
#include "rom4.h"
#include "clock.h"
#include "script.h"
#include "field_special_scene.h"
+#include "field_effect_helpers.h"
#include "secret_base.h"
#include "metatile_behavior.h"
#include "fieldmap.h"
@@ -689,3 +692,35 @@ void PerStepCallback_8069DD4(u8 taskId)
break;
}
}
+
+void PerStepCallback_8069F64(u8 taskId)
+{
+ s16 x, y;
+ u16 *var;
+ s16 *data = gTasks[taskId].data;
+ PlayerGetDestCoords(&x, &y);
+ if (x != data[1] || y != data[2])
+ {
+ data[1] = x;
+ data[2] = y;
+ if (MetatileBehavior_IsAshGrass(MapGridGetMetatileBehaviorAt(x, y)))
+ {
+ if (MapGridGetMetatileIdAt(x, y) == 0x20a)
+ {
+ ash(x, y, 0x212, 4);
+ }
+ else
+ {
+ ash(x, y, 0x206, 4);
+ }
+ if (CheckBagHasItem(ITEM_SOOT_SACK, 1))
+ {
+ var = GetVarPointer(VAR_ASH_GATHER_COUNT);
+ if (*var < 9999)
+ {
+ (*var)++;
+ }
+ }
+ }
+ }
+}