introduce enemy id enum

This commit is contained in:
Henny022p 2021-05-02 02:57:05 +02:00
parent f477e63fa4
commit b86539d363
19 changed files with 250 additions and 152 deletions

View File

@ -1,8 +0,0 @@
#ifndef GUARD_CREATEENEMY_H
#define GUARD_CREATEENEMY_H
#include "entity.h"
Entity* CreateEnemy(u8, u8);
#endif // GUARD_CREATEENEMY_H

View File

@ -4,6 +4,112 @@
#include "global.h" #include "global.h"
#include "entity.h" #include "entity.h"
typedef enum {
/*0x00*/ OCTOROCK,
/*0x01*/ CHUCHU,
/*0x02*/ LEEVER,
/*0x03*/ PEAHAT,
/*0x04*/ ROLLOBITE,
/*0x05*/ DARK_NUT,
/*0x06*/ HANGING_SEED,
/*0x07*/ BEETLE,
/*0x08*/ KEESE,
/*0x09*/ DOOR_MIMIC,
/*0x0a*/ ROCK_CHUCHU,
/*0x0b*/ SPINY_CHUCHU,
/*0x0c*/ CUCCO_CHICK_AGGR,
/*0x0d*/ MOLDORM,
/*0x0e*/ ENEMY_E,
/*0x0f*/ MOLDWORM,
/*0x10*/ SLUGGULA,
/*0x11*/ PESTO,
/*0x12*/ PUFFSTOOL,
/*0x13*/ CHUCHU_BOSS,
/*0x14*/ LIKE_LIKE,
/*0x15*/ SPEAR_MOBLIN,
/*0x16*/ BUSINESS_SCRUB,
/*0x17*/ RUPEE_LIKE,
/*0x18*/ MADDERPILLAR,
/*0x19*/ WATER_DROP,
/*0x1a*/ WALL_MASTER,
/*0x1b*/ BOMB_PEAHAT,
/*0x1c*/ SPARK,
/*0x1d*/ CHASER,
/*0x1e*/ SPIKED_BEETLE,
/*0x1f*/ SENSOR_BLADE_TRAP,
/*0x20*/ HELMASAUR,
/*0x21*/ FALLING_BOULDER,
/*0x22*/ BOBOMB,
/*0x23*/ WALL_MASTER_2,
/*0x24*/ GLEEROCK,
/*0x25*/ VAATI_EYES_MACRO,
/*0x26*/ TEKTITE,
/*0x27*/ WIZZROBE_WIND,
/*0x28*/ WIZZROBE_FIRE,
/*0x29*/ WIZZROBE_ICE,
/*0x2a*/ ARMOS,
/*0x2b*/ EYEGORE,
/*0x2c*/ ROPE,
/*0x2d*/ SMALL_PESTO,
/*0x2e*/ ACRO_BANDIT,
/*0x2f*/ BLADE_TRAP,
/*0x30*/ KEATON,
/*0x31*/ CROW,
/*0x32*/ MULLDOZER,
/*0x33*/ BOMBAROSSA,
/*0x34*/ WISP,
/*0x35*/ SPINY_BEETLE,
/*0x36*/ MAZAAL_HEAD,
/*0x37*/ MAZAAL_MACRO,
/*0x38*/ MAZAAL_HAND,
/*0x39*/ OCTOROCK_BOSS,
/*0x3a*/ FLYING_POT,
/*0x3b*/ GOBDO,
/*0x3c*/ OCTOROCK_GOLDEN,
/*0x3d*/ TEKTITE_GOLDEN,
/*0x3e*/ ROPE_GOLDEN,
/*0x3f*/ CLOUD_PIRANHA,
/*0x40*/ SCISSORS_BEETLE,
/*0x41*/ CUCCO_AGGR,
/*0x42*/ STALFOS,
/*0x43*/ FLYING_SKULL,
/*0x44*/ MAZAAL_BRACELET,
/*0x45*/ TAKKURI,
/*0x46*/ BOW_MOBLIN,
/*0x47*/ LAKITU,
/*0x48*/ LAKITU_CLOUD,
/*0x49*/ ENEMY_49,
/*0x4a*/ VAATI_REBORN_ENEMY,
/*0x4b*/ VAATI_PROJECTILE,
/*0x4c*/ BALL_CHAIN_SOLIDER,
/*0x4d*/ ENEMY_4D,
/*0x4e*/ GHINI,
/*0x4f*/ VAATI_TRANSFIGURED,
/*0x50*/ ENEMY_50,
/*0x51*/ VAATI_WRATH,
/*0x52*/ VAATI_ARM,
/*0x53*/ DUST,
/*0x54*/ VAATI_BALL,
/*0x55*/ OCTOROCK2,
/*0x56*/ SLIME,
/*0x57*/ MINI_SLIME,
/*0x58*/ FIREBALL_GUY,
/*0x59*/ MINI_FIREBALL_GUY,
/*0x5a*/ ENEMY_5A,
/*0x5b*/ BUSINESS_SCRUB_PROLOGUE,
/*0x5c*/ GYORG_FEMALE,
/*0x5d*/ GYORG_MALE,
/*0x5e*/ CURTAIN,
/*0x5f*/ ENEMY_5F,
/*0x60*/ GYORG_CHILD,
/*0x61*/ GYORG_FEMALE_EYE,
/*0x62*/ ENEMY_62,
/*0x63*/ GYORG_FEMALE_MOUTH,
/*0x64*/ ENEMY_64,
/*0x65*/ TREE_ITEM,
/*0x66*/ ENEMY_66
} Enemy;
extern void Octorok(Entity*); extern void Octorok(Entity*);
extern void Chuchu(Entity*); extern void Chuchu(Entity*);
extern void Leever(Entity*); extern void Leever(Entity*);

View File

@ -234,7 +234,7 @@ u32 CreateItemDrop(Entity* arg0, u32 itemID, u32 itemParameter) {
} }
if (itemID != 0) { if (itemID != 0) {
if (itemID == 0xff) { if (itemID == 0xff) {
itemEntity = CreateEnemy(7, 0); itemEntity = CreateEnemy(BEETLE, 0);
if (itemEntity != NULL) { if (itemEntity != NULL) {
itemEntity->x.HALF.HI = arg0->x.HALF.HI; itemEntity->x.HALF.HI = arg0->x.HALF.HI;
itemEntity->y.HALF.HI = arg0->y.HALF.HI; itemEntity->y.HALF.HI = arg0->y.HALF.HI;

View File

@ -4,108 +4,108 @@
// clang-format off // clang-format off
void (*const gEnemyFunctions[])(Entity* ent) = { void (*const gEnemyFunctions[])(Entity* ent) = {
/*0x00*/ Octorok, [OCTOROCK] = Octorok,
/*0x01*/ Chuchu, [CHUCHU] = Chuchu,
/*0x02*/ Leever, [LEEVER] = Leever,
/*0x03*/ Peahat, [PEAHAT] = Peahat,
/*0x04*/ Rollobite, [ROLLOBITE] = Rollobite,
/*0x05*/ DarkNut, [DARK_NUT] = DarkNut,
/*0x06*/ HangingSeed, [HANGING_SEED] = HangingSeed,
/*0x07*/ Beetle, [BEETLE] = Beetle,
/*0x08*/ Keese, [KEESE] = Keese,
/*0x09*/ DoorMimic, [DOOR_MIMIC] = DoorMimic,
/*0x0a*/ RockChuchu, [ROCK_CHUCHU] = RockChuchu,
/*0x0b*/ SpinyChuchu, [SPINY_CHUCHU] = SpinyChuchu,
/*0x0c*/ CuccoChickAggr, [CUCCO_CHICK_AGGR] = CuccoChickAggr,
/*0x0d*/ Moldorm, [MOLDORM] = Moldorm,
/*0x0e*/ EnemyE, [ENEMY_E] = EnemyE,
/*0x0f*/ Moldworm, [MOLDWORM] = Moldworm,
/*0x10*/ Sluggula, [SLUGGULA] = Sluggula,
/*0x11*/ Pesto, [PESTO] = Pesto,
/*0x12*/ Puffstool, [PUFFSTOOL] = Puffstool,
/*0x13*/ ChuchuBoss, [CHUCHU_BOSS] = ChuchuBoss,
/*0x14*/ LikeLike, [LIKE_LIKE] = LikeLike,
/*0x15*/ SpearMoblin, [SPEAR_MOBLIN] = SpearMoblin,
/*0x16*/ BusinessScrub, [BUSINESS_SCRUB] = BusinessScrub,
/*0x17*/ RupeeLike, [RUPEE_LIKE] = RupeeLike,
/*0x18*/ Madderpillar, [MADDERPILLAR] = Madderpillar,
/*0x19*/ WaterDrop, [WATER_DROP] = WaterDrop,
/*0x1a*/ WallMaster, [WALL_MASTER] = WallMaster,
/*0x1b*/ BombPeahat, [BOMB_PEAHAT] = BombPeahat,
/*0x1c*/ Spark, [SPARK] = Spark,
/*0x1d*/ Chaser, [CHASER] = Chaser,
/*0x1e*/ SpikedBeetle, [SPIKED_BEETLE] = SpikedBeetle,
/*0x1f*/ SensorBladeTrap, [SENSOR_BLADE_TRAP] = SensorBladeTrap,
/*0x20*/ Helmasaur, [HELMASAUR] = Helmasaur,
/*0x21*/ FallingBoulder, [FALLING_BOULDER] = FallingBoulder,
/*0x22*/ Bobomb, [BOBOMB] = Bobomb,
/*0x23*/ WallMaster2, [WALL_MASTER_2] = WallMaster2,
/*0x24*/ Gleerok, [GLEEROCK] = Gleerok,
/*0x25*/ VaatiEyesMacro, [VAATI_EYES_MACRO] = VaatiEyesMacro,
/*0x26*/ Tektite, [TEKTITE] = Tektite,
/*0x27*/ WizzrobeWind, [WIZZROBE_WIND] = WizzrobeWind,
/*0x28*/ WizzrobeFire, [WIZZROBE_FIRE] = WizzrobeFire,
/*0x29*/ WizzrobeIce, [WIZZROBE_ICE] = WizzrobeIce,
/*0x2a*/ Armos, [ARMOS] = Armos,
/*0x2b*/ Eyegore, [EYEGORE] = Eyegore,
/*0x2c*/ Rope, [ROPE] = Rope,
/*0x2d*/ SmallPesto, [SMALL_PESTO] = SmallPesto,
/*0x2e*/ AcroBandit, [ACRO_BANDIT] = AcroBandit,
/*0x2f*/ BladeTrap, [BLADE_TRAP] = BladeTrap,
/*0x30*/ Keaton, [KEATON] = Keaton,
/*0x31*/ Crow, [CROW] = Crow,
/*0x32*/ Mulldozer, [MULLDOZER] = Mulldozer,
/*0x33*/ Bombarossa, [BOMBAROSSA] = Bombarossa,
/*0x34*/ Wisp, [WISP] = Wisp,
/*0x35*/ SpinyBeetle, [SPINY_BEETLE] = SpinyBeetle,
/*0x36*/ MazaalHead, [MAZAAL_HEAD] = MazaalHead,
/*0x37*/ MazaalMacro, [MAZAAL_MACRO] = MazaalMacro,
/*0x38*/ MazaalHand, [MAZAAL_HAND] = MazaalHand,
/*0x39*/ OctorokBoss, [OCTOROCK_BOSS] = OctorokBoss,
/*0x3a*/ FlyingPot, [FLYING_POT] = FlyingPot,
/*0x3b*/ Gibdo, [GOBDO] = Gibdo,
/*0x3c*/ OctorokGolden, [OCTOROCK_GOLDEN] = OctorokGolden,
/*0x3d*/ TektiteGolden, [TEKTITE_GOLDEN] = TektiteGolden,
/*0x3e*/ RopeGolden, [ROPE_GOLDEN] = RopeGolden,
/*0x3f*/ CloudPiranha, [CLOUD_PIRANHA] = CloudPiranha,
/*0x40*/ ScissorsBeetle, [SCISSORS_BEETLE] = ScissorsBeetle,
/*0x41*/ CuccoAggr, [CUCCO_AGGR] = CuccoAggr,
/*0x42*/ Stalfos, [STALFOS] = Stalfos,
/*0x43*/ FlyingSkull, [FLYING_SKULL] = FlyingSkull,
/*0x44*/ MazaalBracelet, [MAZAAL_BRACELET] = MazaalBracelet,
/*0x45*/ Takkuri, [TAKKURI] = Takkuri,
/*0x46*/ BowMoblin, [BOW_MOBLIN] = BowMoblin,
/*0x47*/ Lakitu, [LAKITU] = Lakitu,
/*0x48*/ LakituCloud, [LAKITU_CLOUD] = LakituCloud,
/*0x49*/ Enemy49, [ENEMY_49] = Enemy49,
/*0x4a*/ VaatiRebornEnemy, [VAATI_REBORN_ENEMY] = VaatiRebornEnemy,
/*0x4b*/ VaatiProjectile, [VAATI_PROJECTILE] = VaatiProjectile,
/*0x4c*/ BallChainSoldier, [BALL_CHAIN_SOLIDER] = BallChainSoldier,
/*0x4d*/ Enemy4D, [ENEMY_4D] = Enemy4D,
/*0x4e*/ Ghini, [GHINI] = Ghini,
/*0x4f*/ VaatiTransfigured, [VAATI_TRANSFIGURED] = VaatiTransfigured,
/*0x50*/ Enemy50, [ENEMY_50] = Enemy50,
/*0x51*/ VaatiWrath, [VAATI_WRATH] = VaatiWrath,
/*0x52*/ VaatiArm, [VAATI_ARM] = VaatiArm,
/*0x53*/ Dust, [DUST] = Dust,
/*0x54*/ VaatiBall, [VAATI_BALL] = VaatiBall,
/*0x55*/ Octorok, [OCTOROCK2] = Octorok,
/*0x56*/ Slime, [SLIME] = Slime,
/*0x57*/ MiniSlime, [MINI_SLIME] = MiniSlime,
/*0x58*/ FireballGuy, [FIREBALL_GUY] = FireballGuy,
/*0x59*/ MiniFireballGuy, [MINI_FIREBALL_GUY] = MiniFireballGuy,
/*0x5a*/ Enemy5A, [ENEMY_5A] = Enemy5A,
/*0x5b*/ BusinessScrubPrologue, [BUSINESS_SCRUB_PROLOGUE] = BusinessScrubPrologue,
/*0x5c*/ GyorgFemale, [GYORG_FEMALE] = GyorgFemale,
/*0x5d*/ GyorgMale, [GYORG_MALE] = GyorgMale,
/*0x5e*/ Curtain, [CURTAIN] = Curtain,
/*0x5f*/ Enemy5F, [ENEMY_5F] = Enemy5F,
/*0x60*/ GyorgChild, [GYORG_CHILD] = GyorgChild,
/*0x61*/ GyorgFemaleEye, [GYORG_FEMALE_EYE] = GyorgFemaleEye,
/*0x62*/ Enemy62, [ENEMY_62] = Enemy62,
/*0x63*/ GyorgFemaleMouth, [GYORG_FEMALE_MOUTH] = GyorgFemaleMouth,
/*0x64*/ Enemy64, [ENEMY_64] = Enemy64,
/*0x65*/ TreeItem, [TREE_ITEM] = TreeItem,
/*0x66*/ Enemy66 [ENEMY_66] = Enemy66
}; };
// clang-format on // clang-format on

View File

@ -1,5 +1,6 @@
#include "global.h" #include "global.h"
#include "entity.h" #include "entity.h"
#include "enemy.h"
#include "random.h" #include "random.h"
#include "functions.h" #include "functions.h"
@ -12,7 +13,6 @@ extern u32 sub_080322A4(Entity*);
void sub_080322E8(Entity*); void sub_080322E8(Entity*);
extern void sub_08032338(Entity*); extern void sub_08032338(Entity*);
extern Entity* sub_08049DF4(u32); extern Entity* sub_08049DF4(u32);
extern u32 GetNextFunction(Entity*);
extern Entity* gUnk_020000B0; extern Entity* gUnk_020000B0;
extern u8 gEntCount; extern u8 gEntCount;
@ -212,33 +212,33 @@ void sub_08031C58(Entity* this) {
u32 tmp = Random(); u32 tmp = Random();
tmp &= 3; tmp &= 3;
a = CreateEnemy(0x2e, 1); a = CreateEnemy(ACRO_BANDIT, 1);
a->type2 = 0; a->type2 = 0;
a->parent = NULL; a->parent = NULL;
a->field_0x74.HALF.LO = tmp; a->field_0x74.HALF.LO = tmp;
sub_08031E48(this, a); sub_08031E48(this, a);
a->attachedEntity = CreateEnemy(0x2e, 1); a->attachedEntity = CreateEnemy(ACRO_BANDIT, 1);
b = a->attachedEntity; b = a->attachedEntity;
b->type2 = 1; b->type2 = 1;
b->parent = a; b->parent = a;
b->field_0x74.HALF.LO = tmp; b->field_0x74.HALF.LO = tmp;
sub_08031E48(this, b); sub_08031E48(this, b);
b->attachedEntity = CreateEnemy(0x2e, 1); b->attachedEntity = CreateEnemy(ACRO_BANDIT, 1);
a = b->attachedEntity; a = b->attachedEntity;
a->type2 = 2; a->type2 = 2;
a->parent = b; a->parent = b;
a->field_0x74.HALF.LO = tmp; a->field_0x74.HALF.LO = tmp;
sub_08031E48(this, a); sub_08031E48(this, a);
a->attachedEntity = CreateEnemy(0x2e, 1); a->attachedEntity = CreateEnemy(ACRO_BANDIT, 1);
b = a->attachedEntity; b = a->attachedEntity;
b->type2 = 3; b->type2 = 3;
b->parent = a; b->parent = a;
b->field_0x74.HALF.LO = tmp; b->field_0x74.HALF.LO = tmp;
sub_08031E48(this, b); sub_08031E48(this, b);
b->attachedEntity = CreateEnemy(0x2e, 1); b->attachedEntity = CreateEnemy(ACRO_BANDIT, 1);
a = b->attachedEntity; a = b->attachedEntity;
a->type2 = 4; a->type2 = 4;

View File

@ -1,5 +1,6 @@
#include "global.h" #include "global.h"
#include "entity.h" #include "entity.h"
#include "enemy.h"
#include "player.h" #include "player.h"
#include "random.h" #include "random.h"
#include "object.h" #include "object.h"
@ -8,7 +9,6 @@
extern void sub_08078954(Entity*); extern void sub_08078954(Entity*);
extern void sub_08078930(Entity*); extern void sub_08078930(Entity*);
extern s32 sub_080012DC(Entity*); extern s32 sub_080012DC(Entity*);
extern u32 GetNextFunction(Entity*);
extern Entity* sub_08049DF4(u32); extern Entity* sub_08049DF4(u32);
extern void sub_08079BD8(Entity*); extern void sub_08079BD8(Entity*);
@ -340,7 +340,7 @@ void sub_0802AD54(Entity* this) {
} }
void sub_0802ADDC(Entity* this) { void sub_0802ADDC(Entity* this) {
Entity* ent = CreateEnemy(0x1b, this->type + 2); Entity* ent = CreateEnemy(BOMB_PEAHAT, this->type + 2);
if (ent != NULL) { if (ent != NULL) {
ent->type2 = !!sub_0802B234(this); ent->type2 = !!sub_0802B234(this);
ent->parent = this; ent->parent = this;
@ -568,7 +568,7 @@ void sub_0802B1BC(Entity* this) {
void sub_0802B204(Entity* this) { void sub_0802B204(Entity* this) {
if (sub_080044EC(this, 0x2800) == 1) { if (sub_080044EC(this, 0x2800) == 1) {
Entity* ent = CreateEnemy(0x22, 1); Entity* ent = CreateEnemy(BOBOMB, 1);
if (ent) { if (ent) {
CopyPosition(this, ent); CopyPosition(this, ent);
ent->parent = this->parent; ent->parent = this->parent;

View File

@ -71,7 +71,7 @@ void sub_08045454(Entity* this) {
/* Create 2-5 new MiniFireballGuy */ /* Create 2-5 new MiniFireballGuy */
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
entities[i] = CreateEnemy(0x59, this->type); entities[i] = CreateEnemy(MINI_FIREBALL_GUY, this->type);
off = gUnk_080D1810; off = gUnk_080D1810;
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {

View File

@ -190,7 +190,7 @@ void sub_0803773C(Entity* this) {
void sub_0803775C(Entity* this) { void sub_0803775C(Entity* this) {
Entity* x; Entity* x;
if (!(--this->actionDelay)) { if (!(--this->actionDelay)) {
x = CreateEnemy(0x42, 0); x = CreateEnemy(STALFOS, 0);
if (x != 0) { if (x != 0) {
sub_0804A4E4(this, x); sub_0804A4E4(this, x);
sub_08037C0C(this, x); sub_08037C0C(this, x);

View File

@ -669,7 +669,7 @@ void sub_08047508(Entity* this) {
this->field_0x76.HWORD = this->direction << 8; this->field_0x76.HWORD = this->direction << 8;
} }
if (--this->field_0x7c.HALF.HI == 0) { if (--this->field_0x7c.HALF.HI == 0) {
Entity* tmp = CreateEnemy(0x62, Random() & 3); Entity* tmp = CreateEnemy(ENEMY_62, Random() & 3);
if (tmp) { if (tmp) {
tmp->parent = this; tmp->parent = this;
} }
@ -724,7 +724,7 @@ void sub_0804763C(Entity* this) {
this->field_0x76.HWORD = this->direction << 8; this->field_0x76.HWORD = this->direction << 8;
} }
if (--this->field_0x7c.HALF.HI == 0) { if (--this->field_0x7c.HALF.HI == 0) {
Entity* tmp = CreateEnemy(0x62, Random() & 3); Entity* tmp = CreateEnemy(ENEMY_62, Random() & 3);
if (tmp) { if (tmp) {
tmp->parent = this; tmp->parent = this;
} }
@ -831,7 +831,7 @@ void sub_08047978(Entity* this) {
if (--this->field_0x7c.HALF.HI == 0) { if (--this->field_0x7c.HALF.HI == 0) {
Entity* tmp; Entity* tmp;
this->field_0x7c.HALF.HI = 0xF0; this->field_0x7c.HALF.HI = 0xF0;
tmp = CreateEnemy(0x62, Random() & 3); tmp = CreateEnemy(ENEMY_62, Random() & 3);
if (tmp) { if (tmp) {
tmp->parent = this; tmp->parent = this;
} }

View File

@ -93,7 +93,7 @@ void sub_0802BCA8(Entity* this) {
this->damageType = 0x19; this->damageType = 0x19;
this->field_0x3a = this->field_0x3a & 0xfb; this->field_0x3a = this->field_0x3a & 0xfb;
this->field_0x1c = 0x12; this->field_0x1c = 0x12;
ent = CreateEnemy(0x20, 1); ent = CreateEnemy(HELMASAUR, 1);
if (ent) { if (ent) {
ent->animationState = this->animationState; ent->animationState = this->animationState;
CopyPosition(this, ent); CopyPosition(this, ent);

View File

@ -82,32 +82,32 @@ void sub_0802999C(Entity* this) {
if (gEntCount < 0x44) { if (gEntCount < 0x44) {
Entity *ent1, *ent2, *ent3, *ent4, *ent5, *ent6; Entity *ent1, *ent2, *ent3, *ent4, *ent5, *ent6;
ent1 = CreateEnemy(0x18, 1); ent1 = CreateEnemy(MADDERPILLAR, 1);
ent1->parent = this; ent1->parent = this;
PositionRelative(this, ent1, 0, 5); PositionRelative(this, ent1, 0, 5);
this->attachedEntity = ent1; this->attachedEntity = ent1;
ent2 = CreateEnemy(0x18, 2); ent2 = CreateEnemy(MADDERPILLAR, 2);
ent2->parent = this; ent2->parent = this;
PositionRelative(this, ent2, 0, 4); PositionRelative(this, ent2, 0, 4);
ent1->attachedEntity = ent2; ent1->attachedEntity = ent2;
ent3 = CreateEnemy(0x18, 3); ent3 = CreateEnemy(MADDERPILLAR, 3);
ent3->parent = this; ent3->parent = this;
PositionRelative(this, ent3, 0, 3); PositionRelative(this, ent3, 0, 3);
ent2->attachedEntity = ent3; ent2->attachedEntity = ent3;
ent4 = CreateEnemy(0x18, 4); ent4 = CreateEnemy(MADDERPILLAR, 4);
ent4->parent = this; ent4->parent = this;
PositionRelative(this, ent4, 0, 2); PositionRelative(this, ent4, 0, 2);
ent3->attachedEntity = ent4; ent3->attachedEntity = ent4;
ent5 = CreateEnemy(0x18, 5); ent5 = CreateEnemy(MADDERPILLAR, 5);
ent5->parent = this; ent5->parent = this;
PositionRelative(this, ent5, 0, 1); PositionRelative(this, ent5, 0, 1);
ent4->attachedEntity = ent5; ent4->attachedEntity = ent5;
ent6 = CreateEnemy(0x18, 6); ent6 = CreateEnemy(MADDERPILLAR, 6);
ent6->attachedEntity = this; ent6->attachedEntity = this;
ent6->parent = this; ent6->parent = this;
PositionRelative(this, ent6, 0, 0); PositionRelative(this, ent6, 0, 0);

View File

@ -55,19 +55,19 @@ void sub_08022C58(Entity* this) {
if (gEntCount >= 0x45) if (gEntCount >= 0x45)
return; return;
tail0 = CreateEnemy(0xd, 1); tail0 = CreateEnemy(MOLDORM, 1);
this->attachedEntity = tail0; this->attachedEntity = tail0;
tail0->spritePriority.b0 = 5; tail0->spritePriority.b0 = 5;
tail0->parent = this; tail0->parent = this;
CopyPosition(this, tail0); CopyPosition(this, tail0);
tail1 = CreateEnemy(0xd, 2); tail1 = CreateEnemy(MOLDORM, 2);
tail0->attachedEntity = tail1; tail0->attachedEntity = tail1;
tail1->spritePriority.b0 = 5; tail1->spritePriority.b0 = 5;
tail1->parent = this; tail1->parent = this;
CopyPosition(this, tail1); CopyPosition(this, tail1);
tail2 = CreateEnemy(0xd, 3); tail2 = CreateEnemy(MOLDORM, 3);
tail1->attachedEntity = tail2; tail1->attachedEntity = tail2;
tail2->spritePriority.b0 = 5; tail2->spritePriority.b0 = 5;
tail2->parent = this; tail2->parent = this;

View File

@ -111,28 +111,28 @@ void sub_080231BC(Entity* this) {
if (gEntCount < 0x40) { if (gEntCount < 0x40) {
Entity* ent; Entity* ent;
ent = this->attachedEntity = CreateEnemy(0xf, 1); ent = this->attachedEntity = CreateEnemy(MOLDWORM, 1);
ent->parent = this; ent->parent = this;
ent = ent->attachedEntity = CreateEnemy(0xf, 2); ent = ent->attachedEntity = CreateEnemy(MOLDWORM, 2);
ent->parent = this; ent->parent = this;
ent = ent->attachedEntity = CreateEnemy(0xf, 3); ent = ent->attachedEntity = CreateEnemy(MOLDWORM, 3);
ent->parent = this; ent->parent = this;
ent = ent->attachedEntity = CreateEnemy(0xf, 4); ent = ent->attachedEntity = CreateEnemy(MOLDWORM, 4);
ent->parent = this; ent->parent = this;
ent = ent->attachedEntity = CreateEnemy(0xf, 5); ent = ent->attachedEntity = CreateEnemy(MOLDWORM, 5);
ent->parent = this; ent->parent = this;
ent = ent->attachedEntity = CreateEnemy(0xf, 6); ent = ent->attachedEntity = CreateEnemy(MOLDWORM, 6);
ent->parent = this; ent->parent = this;
ent = ent->attachedEntity = CreateEnemy(0xf, 7); ent = ent->attachedEntity = CreateEnemy(MOLDWORM, 7);
ent->parent = this; ent->parent = this;
ent->attachedEntity = CreateEnemy(0xf, 8); ent->attachedEntity = CreateEnemy(MOLDWORM, 8);
*(Entity**)&ent->attachedEntity->field_0x74 = ent; *(Entity**)&ent->attachedEntity->field_0x74 = ent;
ent = ent->attachedEntity; ent = ent->attachedEntity;
ent->parent = this; ent->parent = this;

View File

@ -51,7 +51,7 @@ void Peahat_OnTick(Entity* this) {
void sub_0801FFDC(Entity* this) { void sub_0801FFDC(Entity* this) {
if (this->field_0x82.HALF.LO) { if (this->field_0x82.HALF.LO) {
if (this->bitfield == 0x94) { if (this->bitfield == 0x94) {
Entity* ent = CreateEnemy(3, PeahatForm_Propeller); Entity* ent = CreateEnemy(PEAHAT, PeahatForm_Propeller);
if (ent) { if (ent) {
CopyPosition(this, ent); CopyPosition(this, ent);
ent->height.HALF.HI -= 8; ent->height.HALF.HI -= 8;

View File

@ -41,7 +41,7 @@ void sub_08022254(Entity* this) {
case 0x16: case 0x16:
case 0x1c: case 0x1c:
CreateFx(this, 4, 0); CreateFx(this, 4, 0);
ent = CreateEnemy(1, 1); ent = CreateEnemy(CHUCHU, 1);
if (ent) { if (ent) {
ent->type2 = 1; ent->type2 = 1;
ent->iframes = -8; ent->iframes = -8;

View File

@ -91,7 +91,7 @@ void sub_080293DC(Entity* this) {
void sub_0802940C(Entity* this) { void sub_0802940C(Entity* this) {
Entity* ent; Entity* ent;
ent = CreateEnemy(0x17, this->type); ent = CreateEnemy(RUPEE_LIKE, this->type);
if (ent != NULL) { if (ent != NULL) {
sub_0804A720(this); sub_0804A720(this);
ent->parent = this; ent->parent = this;

View File

@ -99,7 +99,7 @@ void sub_080450A8(Entity* this) {
/* Create 2-4 new MiniSlime */ /* Create 2-4 new MiniSlime */
for (i = 0; i < count; i++) for (i = 0; i < count; i++)
entities[i] = CreateEnemy(0x57, this->type); entities[i] = CreateEnemy(MINI_SLIME, this->type);
off = gUnk_080D16D4; off = gUnk_080D16D4;
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {

View File

@ -130,7 +130,7 @@ void sub_08023CE0(Entity* this) {
GetNextFrame(this); GetNextFrame(this);
if (this->frames.all) { if (this->frames.all) {
if (this->frames.all & 0x80) { if (this->frames.all & 0x80) {
Entity* ent = CreateEnemy(0x10, 1); Entity* ent = CreateEnemy(SLUGGULA, 1);
if (ent) { if (ent) {
sub_0804A4E4(this, ent); sub_0804A4E4(this, ent);
DeleteThisEntity(); DeleteThisEntity();
@ -161,7 +161,7 @@ void sub_08023E54(Entity* this) {
if (this->field_0xf++ > 27) { if (this->field_0xf++ > 27) {
this->field_0xf = 0; this->field_0xf = 0;
ent = CreateEnemy(0x10, 2); ent = CreateEnemy(SLUGGULA, 2);
if (ent) { if (ent) {
const s8* ptr = &gUnk_080CBDF7[this->animationState * 2]; const s8* ptr = &gUnk_080CBDF7[this->animationState * 2];
PositionRelative(this, ent, ptr[0] << 0x10, ptr[1] << 0x10); PositionRelative(this, ent, ptr[0] << 0x10, ptr[1] << 0x10);

View File

@ -1,10 +1,10 @@
#include "global.h" #include "global.h"
#include "entity.h" #include "entity.h"
#include "enemy.h"
#include "coord.h" #include "coord.h"
#include "random.h" #include "random.h"
#include "functions.h" #include "functions.h"
extern u32 GetNextFunction(Entity*);
extern void sub_080317F8(Entity*); extern void sub_080317F8(Entity*);
extern void (*gUnk_080CE530[])(Entity*); extern void (*gUnk_080CE530[])(Entity*);
@ -122,7 +122,7 @@ void sub_080317F8(Entity* this) {
} }
void sub_08031840(Entity* this) { void sub_08031840(Entity* this) {
Entity* enemy = CreateEnemy(0x2d, this->type); Entity* enemy = CreateEnemy(SMALL_PESTO, this->type);
if (enemy != NULL) { if (enemy != NULL) {
CopyPosition(this, enemy); CopyPosition(this, enemy);
enemy->parent = this; enemy->parent = this;