From 57a6a5e6564aec89ab45f2d4c3b911f59f7db210 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 26 Jun 2017 22:26:02 -0400 Subject: PerStepCallback_8069F64 --- src/field_tasks.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'src') 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)++; + } + } + } + } +} -- cgit v1.2.3