summaryrefslogtreecommitdiff
path: root/src/object/macroShoe.c
blob: 77c02cf90c041c005c1c435113edbe606b4ba974 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
 * @file macroShoe.c
 * @ingroup Objects
 *
 * @brief Macro Shoe object
 */
#include "asm.h"
#include "entity.h"
#include "tiles.h"
#include "map.h"

void MacroShoe_Init(Entity*);
void MacroShoe_Idle(Entity*);

static const Hitbox MacroShoe_Type0Hitbox;
static const Hitbox MacroShoe_Type1Hitbox;

static const Hitbox* const MacroShoe_TypeHitboxes[] = {
    &MacroShoe_Type0Hitbox,
    &MacroShoe_Type1Hitbox,
};

static const Hitbox MacroShoe_Type0Hitbox = {
    0, 0, { 4, 0, 0, 0 }, 0x34, 0x20,
};

static const Hitbox MacroShoe_Type1Hitbox = {
    0, 0, { 4, 0, 0, 0 }, 0x30, 0x10,
};

void MacroShoe(Entity* this) {
    static void (*const MacroShoe_Actions[])(Entity*) = {
        MacroShoe_Init,
        MacroShoe_Idle,
    };
    MacroShoe_Actions[this->action](this);
    sub_0800445C(this);
}

void MacroShoe_Init(Entity* this) {
    this->action = 1;
    this->hitbox = (Hitbox*)MacroShoe_TypeHitboxes[this->type];
    if (this->type2 == 1) {
        SetTile(SPECIAL_TILE_36, TILE_POS(16, 16), LAYER_BOTTOM);
        SetTile(SPECIAL_TILE_38, TILE_POS(17, 16), LAYER_BOTTOM);
        SetTile(SPECIAL_TILE_37, TILE_POS(18, 16), LAYER_BOTTOM);
    }
}

void MacroShoe_Idle(Entity* this) {
}