mirror of
https://github.com/zeldaret/tmc
synced 2026-06-03 18:36:43 -04:00
72 lines
1.6 KiB
C
72 lines
1.6 KiB
C
/**
|
|
* @file miniFireballGuy.c
|
|
* @ingroup Enemies
|
|
*
|
|
* @brief Mini Fireball Guy enemy
|
|
*/
|
|
|
|
#include "enemy.h"
|
|
#include "functions.h"
|
|
|
|
extern void sub_08045678(Entity*);
|
|
|
|
extern void (*const gUnk_080D1868[])(Entity*);
|
|
extern void (*const gUnk_080D1880[])(Entity*);
|
|
|
|
void MiniFireballGuy(Entity* this) {
|
|
EnemyFunctionHandler(this, gUnk_080D1868);
|
|
}
|
|
|
|
void sub_080455BC(Entity* this) {
|
|
gUnk_080D1880[this->action](this);
|
|
}
|
|
|
|
void sub_080455D4(Entity* this) {
|
|
sub_0804AA30(this, gUnk_080D1868);
|
|
}
|
|
|
|
void sub_080455E4(Entity* this) {
|
|
if ((this != this->parent) && (this->parent != NULL)) {
|
|
this->field_0x6c.HALF.LO &= 0x7f;
|
|
this->parent->child = this->child;
|
|
this->child->parent = this->parent;
|
|
}
|
|
sub_0804A7D4(this);
|
|
}
|
|
|
|
void nullsub_23(Entity* this) {
|
|
}
|
|
|
|
void sub_08045618(Entity* this) {
|
|
this->action = 1;
|
|
this->spriteSettings.draw = 1;
|
|
this->speed = 0x80;
|
|
this->field_0x3c = this->field_0x3c | 0x10;
|
|
sub_0804A720(this);
|
|
InitializeAnimation(this, 1);
|
|
sub_08045678(this);
|
|
}
|
|
|
|
void sub_08045654(Entity* this) {
|
|
sub_080AEFE0(this);
|
|
GetNextFrame(this);
|
|
if (GravityUpdate(this, 0x1800) == 0) {
|
|
sub_08045678(this);
|
|
}
|
|
}
|
|
|
|
void sub_08045678(Entity* this) {
|
|
|
|
this->zVelocity = 0x1c000;
|
|
if (this->actionDelay != 0) {
|
|
this->actionDelay--;
|
|
} else {
|
|
this->actionDelay = Random() & 3;
|
|
if ((sub_08049FA0(this) == 0) && (Random() & 3)) {
|
|
this->direction = DirectionRound(sub_08049EE4(this) - 4 + (Random() & 8));
|
|
} else {
|
|
this->direction = DirectionRound(Random());
|
|
}
|
|
}
|
|
}
|