|
@@ -1,7 +1,21 @@
|
|
1
|
+#include <oe_images/oea_grass_normal.h>
|
1
|
2
|
#include <pokeagb/pokeagb.h>
|
2
|
3
|
|
3
|
|
-void grass_step_general(struct NpcState *npc)
|
4
|
|
-{
|
|
4
|
+struct SpriteTiles sprite_tiles_grass_normal[5] = {{.data = oea_grass_normalTiles + (0x80/4) * 0, .tag = 0, .size = 0x80},
|
|
5
|
+ {.data = oea_grass_normalTiles + (0x80/4) * 1, .tag = 0, .size = 0x80},
|
|
6
|
+ {.data = oea_grass_normalTiles + (0x80/4) * 2, .tag = 0, .size = 0x80},
|
|
7
|
+ {.data = oea_grass_normalTiles + (0x80/4) * 3, .tag = 0, .size = 0x80},
|
|
8
|
+ {.data = oea_grass_normalTiles + (0x80/4) * 4, .tag = 0, .size = 0x80}};
|
|
9
|
+
|
|
10
|
+struct Template grass_template_normal = {.tiles_tag = 0xFFFF,
|
|
11
|
+ .pal_tag = 0x1005,
|
|
12
|
+ .oam = &oam_data_grass,
|
|
13
|
+ .animation = &anim_image_grass,
|
|
14
|
+ .graphics = sprite_tiles_grass_normal,
|
|
15
|
+ .rotscale = &rotscale_empty,
|
|
16
|
+ .callback = oac_grass};
|
|
17
|
+
|
|
18
|
+void grass_step_general(struct NpcState *npc) {
|
5
|
19
|
oe_state.effect_pos.x = npc->to.x;
|
6
|
20
|
oe_state.effect_pos.y = npc->to.y;
|
7
|
21
|
oe_state.priority = (npc->height) >> 4;
|
|
@@ -13,8 +27,7 @@ void grass_step_general(struct NpcState *npc)
|
13
|
27
|
(void)oe_exec(4);
|
14
|
28
|
}
|
15
|
29
|
|
16
|
|
-void grass_step_elastic(struct NpcState *npc)
|
17
|
|
-{
|
|
30
|
+void grass_step_elastic(struct NpcState *npc) {
|
18
|
31
|
oe_state.effect_pos.x = npc->to.x;
|
19
|
32
|
oe_state.effect_pos.y = npc->to.y;
|
20
|
33
|
oe_state.priority = (npc->height) >> 4;
|
|
@@ -28,3 +41,22 @@ void grass_step_elastic(struct NpcState *npc)
|
28
|
41
|
(void)oe_exec(4);
|
29
|
42
|
}
|
30
|
43
|
|
|
44
|
+void oei_grass_normal(void) {
|
|
45
|
+ s16 x = (s16)oe_state.effect_pos.x;
|
|
46
|
+ s16 y = (s16)oe_state.effect_pos.y;
|
|
47
|
+ oe_adjust_coordinates(&x, &y, 8, 8);
|
|
48
|
+ u8 objid = template_instanciate_reverse_search(&grass_template_normal, x, y, 0);
|
|
49
|
+ if (objid != 64) {
|
|
50
|
+ struct Object *obj = &objects[objid];
|
|
51
|
+ obj->bitfield2 |= 2;
|
|
52
|
+ obj->final_oam.priority = oe_state.field_c & 3;
|
|
53
|
+ obj->priv[0] = oe_state.priority;
|
|
54
|
+ obj->priv[1] = oe_state.effect_pos.x;
|
|
55
|
+ obj->priv[2] = oe_state.effect_pos.y;
|
|
56
|
+ obj->priv[3] = oe_state.local_id_and_mapnumber;
|
|
57
|
+ obj->priv[4] = oe_state.local_mapbank;
|
|
58
|
+ obj->priv[5] = oe_state.sav1_location;
|
|
59
|
+ if (oe_state.field_1c)
|
|
60
|
+ obj_anim_image_seek(obj, 4);
|
|
61
|
+ }
|
|
62
|
+}
|