diff --git a/include/effects.h b/include/effects.h new file mode 100644 index 00000000..696ab9ab --- /dev/null +++ b/include/effects.h @@ -0,0 +1,118 @@ +#ifndef EFFECTS_H +#define EFFECTS_H + +#include "entity.h" + +typedef enum { + FX_FALL_DOWN, + FX_EXPLOSION, + FX_DEATH, + FX_BUSH, + FX_ROCK, + FX_POT_SHATTER, + FX_6, + FX_SPARKLE, + FX_8, + FX_9, + FX_A, + FX_WATER_SPLASH, + FX_LAVA_SPLASH, + FX_ICE, + FX_ROCK_HUGE, + FX_ROCK_SMALL, + FX_REFLECT, + FX_DASH, + FX_BLUE_SPARKLE, + FX_RED_BUSH, + FX_SPARKLE2, + FX_ROCK2, + FX_FIRE, + FX_GRASS_CUT, + FX_18, + FX_SWORD_MAGIC, + FX_LIGHTNING, + FX_LIGHTNING_STRIKE, + FX_STARS, + FX_STARS_STRIKE, + FX_STARS_STRIKE2, + FX_REFLECT2, + FX_RIPPLE, + FX_RIPPLE_LARGE, + FX_BROWN_SMOKE, + FX_BROWN_SMOKE_LARGE, + FX_BROWN_SMOKE2, + FX_SWEAT, + FX_26, + FX_27, + FX_SLOW_EXPLOSION, + FX_CONFETTI, + FX_CONFETTI_LARGE, + FX_GREEN_SPLASH2, + FX_REFECT3, + FX_SIGN, + FX_SLOW_SMOKE2, + FX_SLOW_SMOKE_SMALL, + FX_SPARKLE_SECRET, + FX_MAILBOX_UNUSED, + FX_32, + FX_33, + FX_34, + FX_BIG_EXPLOSION, + FX_LAVA_SPLASH_HUGE, + FX_GRASS_CUT2, + FX_BUSH_CUT2, + FX_BUSH_CUT3, + FX_EGG, + FX_WOOD, + FX_BONE, + FX_STARS2, + FX_GRASS_CUT3, + FX_GRASS_CUT4, + FX_GRASS_CUT5, + FX_REFLECT4, + FX_STEAM_EFC, + FX_BIG_EXPLOSION2, + FX_WHITE_SPLASH, + FX_WHITE_ROCK, + FX_GIANT_EXPLOSION, + FX_GIANT_EXPLOSION2, + FX_GIANT_EXPLOSION3, + FX_GREEN_ORB, + FX_GREEN_ORB_SLOW, + FX_WHITE_AURA, + FX_WOOD2, + FX_SPARKLE3, + FX_MAGIC_STORM, + FX_BLUE_EFC, + FX_REFLECT5, + FX_GIANT_EXPLOSION4, + FX_GREEN_SPLASH, + FX_BLUE_PUFF, + FX_WHITE_PUFF, + FX_AURA_BASE, + FX_RED_AURA, + FX_BLUE_AURA, + FX_58, + FX_59, + FX_5A, + FX_5B, + FX_BARREL_BEAM, + FX_BARREL, + FX_5E, + FX_5F, + FX_60, + FX_STONE_BLOCK, + FX_62, + FX_63, + FX_64, + FX_65, + FX_66, + FX_67, + FX_68, + FX_69, + FX_6A, + FX_6B, + FX_6C, +} Effect; + +#endif // EFFECTS_H \ No newline at end of file diff --git a/src/arm_proxy.c b/src/arm_proxy.c index e1f13c74..982ddb65 100644 --- a/src/arm_proxy.c +++ b/src/arm_proxy.c @@ -10,6 +10,7 @@ #include "manager.h" #include "utils.h" #include "npc.h" +#include "effects.h" extern u8 gUnk_03003DE0; extern u8 gUnk_03000C30; @@ -227,7 +228,7 @@ void HandlePlayerLife(Entity* this) { } else if ((gSave.stats.effectTimer == 0) || --gSave.stats.effectTimer == 0) { gSave.stats.effect = 0; } else if ((gSave.stats.effectTimer & 0x3f) == 0) { - CreateFx(this, 0x55 + gSave.stats.effect, 0); + CreateFx(this, FX_AURA_BASE + gSave.stats.effect, 0); } } #endif diff --git a/src/code_080A29BC.c b/src/code_080A29BC.c index c085a684..17fb9fba 100644 --- a/src/code_080A29BC.c +++ b/src/code_080A29BC.c @@ -2,6 +2,7 @@ #include "entity.h" #include "room.h" #include "object.h" +#include "effects.h" void sub_080A29C8(s32 xOff, s32 yOff, u32 layer) { Entity* pEVar1; @@ -15,15 +16,15 @@ void sub_080A29C8(s32 xOff, s32 yOff, u32 layer) { } void sub_080A29FC(Entity* parent) { - CreateFx(parent, 0x11, 0); + CreateFx(parent, FX_DASH, 0); } void sub_080A2A08(Entity* parent) { - CreateFx(parent, 0x6, 0); + CreateFx(parent, FX_6, 0); } void sub_080A2A14(Entity* parent) { - CreateFx(parent, 0xb, 0); + CreateFx(parent, FX_WATER_SPLASH, 0); } Entity* sub_080A2A20(Entity* parent, u32 form, u32 parameter) { @@ -50,7 +51,7 @@ Entity* sub_080A2A3C(Entity* parent, u32 form, u32 subtype, u32 param_4) { Entity* sub_080A2A64(Entity* parent) { Entity* pEVar1; - pEVar1 = CreateFx(parent, 0x20, 0); + pEVar1 = CreateFx(parent, FX_SPARKLE2, 0); if (pEVar1 != NULL) { pEVar1->spritePriority.b0 = 7; } diff --git a/src/createObject.c b/src/createObject.c index cf3655c9..0d18f6b1 100644 --- a/src/createObject.c +++ b/src/createObject.c @@ -4,6 +4,7 @@ #include "room.h" #include "createObject.h" #include "object.h" +#include "effects.h" Entity* CreateObject(u32 subtype, u32 form, u32 parameter) { Entity* entity; @@ -36,13 +37,13 @@ Entity* CreateFx(Entity* parentEnt, u32 form, u32 parameter) { } void CreateDust(Entity* parent) { - CreateFx(parent, 2, 0); + CreateFx(parent, FX_DEATH, 0); } void CreateDustAt(s32 xOff, s32 yOff, u32 layer) { Entity* ent; - ent = CreateObject(SPECIAL_FX, 2, 0); + ent = CreateObject(SPECIAL_FX, FX_DEATH, 0); if (ent != NULL) { ent->x.HALF.HI = gRoomControls.roomOriginX + xOff; ent->y.HALF.HI = gRoomControls.roomOriginY + yOff; @@ -51,15 +52,15 @@ void CreateDustAt(s32 xOff, s32 yOff, u32 layer) { } void CreateDustSmall(Entity* parent) { - CreateFx(parent, 0x11, 0); + CreateFx(parent, FX_DASH, 0); } void CreateExplosionBroken(Entity* parent) { - CreateFx(parent, 0x6, 0); + CreateFx(parent, FX_6, 0); } void CreateWaterSplash(Entity* parent) { - CreateFx(parent, 0xb, 0); + CreateFx(parent, FX_WATER_SPLASH, 0); } Entity* sub_080A2A20(Entity* parent, u32 form, u32 parameter) { @@ -86,7 +87,7 @@ Entity* sub_080A2A3C(Entity* parent, u32 form, u32 subtype, u32 param_4) { Entity* CreateWaterTrace(Entity* parent) { Entity* ent; - ent = CreateFx(parent, 0x20, 0); + ent = CreateFx(parent, FX_RIPPLE, 0); if (ent != NULL) { ent->spritePriority.b0 = 7; } diff --git a/src/enemy/businessScrub.c b/src/enemy/businessScrub.c index afc9da4e..730f1aa7 100644 --- a/src/enemy/businessScrub.c +++ b/src/enemy/businessScrub.c @@ -6,6 +6,7 @@ #include "random.h" #include "npc.h" #include "functions.h" +#include "effects.h" extern void sub_0801D040(Entity*, u32); extern Entity* sub_08049DF4(u32); @@ -60,7 +61,7 @@ void sub_08028934(Entity* this) { this->actionDelay = 0x28; this->flags &= ~0x80; sub_080290E0(this, 4); - pEVar1 = CreateFx(this, 3, 0); + pEVar1 = CreateFx(this, FX_BUSH, 0); if (pEVar1 != NULL) { pEVar1->height.HALF.HI -= 8; } diff --git a/src/enemy/doorMimic.c b/src/enemy/doorMimic.c index 2bfc1fc4..ff59c26d 100644 --- a/src/enemy/doorMimic.c +++ b/src/enemy/doorMimic.c @@ -1,6 +1,7 @@ #include "enemy.h" #include "entity.h" #include "functions.h" +#include "effects.h" extern s16 sub_080001DA(u32, u32); // ? extern void sub_08049CF4(); @@ -37,7 +38,7 @@ void sub_08021FF4(Entity* this) { void sub_08022004(Entity* this) { SetTile((u16)this->field_0x7c.HALF.LO, (u16)this->field_0x7c.HALF.HI, this->collisionLayer); - CreateFx(this, 5, 0); + CreateFx(this, FX_POT_SHATTER, 0); sub_08049CF4(this); DeleteThisEntity(); } @@ -80,7 +81,7 @@ void sub_080220F0(Entity* this) { this->field_0x44 = 0; off = gUnk_080CB76C[this->type2]; for (i = 0; i < 6; i++, off++) { - Entity* fx = CreateFx(this, 0x11, 0); + Entity* fx = CreateFx(this, FX_DASH, 0); if (fx) { fx->x.HALF.HI += off->h; fx->y.HALF.HI += off->v; diff --git a/src/enemy/fallingBoulder.c b/src/enemy/fallingBoulder.c index 74135810..5195b542 100644 --- a/src/enemy/fallingBoulder.c +++ b/src/enemy/fallingBoulder.c @@ -1,6 +1,7 @@ #include "enemy.h" #include "random.h" #include "functions.h" +#include "effects.h" void sub_0802C4B0(Entity*); void sub_0802C62C(Entity*); @@ -92,7 +93,7 @@ NONMATCH("asm/non_matching/fallingBoulder/sub_0802C334.inc", void sub_0802C334(E u32 diff = 0; s32 i; for (i = 1; i > -1; i--) { - Entity* ent = CreateFx(this, 0x15, 0); + Entity* ent = CreateFx(this, FX_ROCK2, 0); if (ent) { ent->x.HALF.HI += 12; ent->x.HALF.HI -= diff; diff --git a/src/enemy/fireballGuy.c b/src/enemy/fireballGuy.c index f7851aad..42916d3e 100644 --- a/src/enemy/fireballGuy.c +++ b/src/enemy/fireballGuy.c @@ -3,6 +3,7 @@ #include "enemy.h" #include "random.h" #include "functions.h" +#include "effects.h" typedef struct { s8 h, v; @@ -88,7 +89,7 @@ void sub_08045454(Entity* this) { off++; } - ent = CreateFx(this, 2, 0); + ent = CreateFx(this, FX_DEATH, 0); if (ent) CopyPosition(this, ent); diff --git a/src/enemy/gyorgMale.c b/src/enemy/gyorgMale.c index effceb3b..7aaa2153 100644 --- a/src/enemy/gyorgMale.c +++ b/src/enemy/gyorgMale.c @@ -6,6 +6,7 @@ #include "fileScreen.h" #include "random.h" #include "functions.h" +#include "effects.h" void (*const gUnk_080D1AFC[8])(Entity*); void (*const gUnk_080D1B1C[7])(Entity*); @@ -935,7 +936,7 @@ void sub_08047BF0(Entity* this) { sub_08047E48(this); if (this->actionDelay == 0) { if ((this->field_0xf++ & 0xF) == 0) { - tmp = CreateFx(this, 0x51, 0); + tmp = CreateFx(this, FX_GIANT_EXPLOSION4, 0); if (tmp) { u32 rand = Random(); tmp->x.HALF.HI += (rand & 0x1E) + 0xFFF1; @@ -960,17 +961,17 @@ void sub_08047BF0(Entity* this) { if (this->actionDelay == 0x5A) { tmp = this->attachedEntity; tmp->spriteSettings.b.draw = 0; - CreateFx(tmp, 0x51, 0); + CreateFx(tmp, FX_GIANT_EXPLOSION4, 0); } else { if (this->actionDelay == 0x3C) { tmp = this->attachedEntity->attachedEntity; tmp->spriteSettings.b.draw = 0; - CreateFx(tmp, 0x51, 0); + CreateFx(tmp, FX_GIANT_EXPLOSION4, 0); } else { if (this->actionDelay == 0x1E) { tmp = this->attachedEntity->attachedEntity->attachedEntity; tmp->spriteSettings.b.draw = 0; - CreateFx(tmp, 0x51, 0); + CreateFx(tmp, FX_GIANT_EXPLOSION4, 0); } } } diff --git a/src/enemy/hangingSeed.c b/src/enemy/hangingSeed.c index fe6fe0fc..95593f7b 100644 --- a/src/enemy/hangingSeed.c +++ b/src/enemy/hangingSeed.c @@ -1,6 +1,7 @@ #include "entity.h" #include "enemy.h" #include "functions.h" +#include "effects.h" extern void (*const gHangingSeedFunctions[])(Entity*); extern void (*const gUnk_080CB588[])(Entity*); @@ -15,7 +16,7 @@ void HangingSeed_OnTick(Entity* this) { void sub_080216FC(Entity* this) { if (this->bitfield & 0x80) { - CreateFx(this, 3, 0x80); + CreateFx(this, FX_BUSH, 0x80); DeleteThisEntity(); } } diff --git a/src/enemy/keaton.c b/src/enemy/keaton.c index 1ed5af8e..1b4f20c0 100644 --- a/src/enemy/keaton.c +++ b/src/enemy/keaton.c @@ -3,6 +3,7 @@ #include "enemy.h" #include "random.h" #include "functions.h" +#include "effects.h" extern Entity* gUnk_020000B0; @@ -222,7 +223,7 @@ void sub_08032794(Entity* this) { Entity* target; s8* temp; - target = CreateFx(this, 0x11, 0x40); + target = CreateFx(this, FX_DASH, 0x40); if (target != NULL) { temp = &gUnk_080CE810[this->animationState * 2]; PositionRelative(this, target, temp[0] << 0x10, temp[1] << 0x10); diff --git a/src/enemy/lakitu.c b/src/enemy/lakitu.c index cbbab57f..b35d9540 100644 --- a/src/enemy/lakitu.c +++ b/src/enemy/lakitu.c @@ -5,6 +5,7 @@ #include "coord.h" #include "random.h" #include "player.h" +#include "effects.h" extern void (*const LakituActionFuncs[])(Entity*); @@ -61,7 +62,7 @@ void sub_0803C784(Entity* this) { sub_0803CBAC(this); } else { if (this->damageType == 0x43) { - Entity* fx = CreateFx(this, 2, 0); + Entity* fx = CreateFx(this, FX_DEATH, 0); if (fx != NULL) { u32 angle = (this->knockbackDirection ^ 0x10) << 3; @@ -360,25 +361,25 @@ void sub_0803CC08(Entity* this) { return; } - fx = CreateFx(this, 2, 0); + fx = CreateFx(this, FX_DEATH, 0); if (fx != NULL) { fx->x.HALF.HI += 6; fx->y.HALF.HI += 6; } - fx = CreateFx(this, 2, 0); + fx = CreateFx(this, FX_DEATH, 0); if (fx != NULL) { fx->x.HALF.HI -= 6; fx->y.HALF.HI += 6; } - fx = CreateFx(this, 2, 0); + fx = CreateFx(this, FX_DEATH, 0); if (fx != NULL) { fx->x.HALF.HI += 6; fx->y.HALF.HI -= 6; } - fx = CreateFx(this, 2, 0); + fx = CreateFx(this, FX_DEATH, 0); if (fx != NULL) { fx->x.HALF.HI -= 6; fx->y.HALF.HI -= 6; diff --git a/src/enemy/lakituCloud.c b/src/enemy/lakituCloud.c index df0c0cca..b7301df7 100644 --- a/src/enemy/lakituCloud.c +++ b/src/enemy/lakituCloud.c @@ -2,6 +2,7 @@ #include "entity.h" #include "player.h" #include "functions.h" +#include "effects.h" extern u32 GetNextFunction(Entity*); @@ -126,7 +127,7 @@ void sub_0803CE14(Entity* this) { } void sub_0803CE3C(Entity* this) { - CreateFx(this, 2, 0); + CreateFx(this, FX_DEATH, 0); this->action = 2; this->actionDelay = 60; diff --git a/src/enemy/madderpillar.c b/src/enemy/madderpillar.c index 7d1fa2ee..513848d9 100644 --- a/src/enemy/madderpillar.c +++ b/src/enemy/madderpillar.c @@ -2,6 +2,7 @@ #include "entity.h" #include "random.h" #include "functions.h" +#include "effects.h" extern u8 gEntCount; extern Hitbox gUnk_080FD298; @@ -163,7 +164,7 @@ void sub_08029B2C(Entity* this) { if (sub_0802A14C(this)) { if (this->field_0x86.HALF.LO) { if (--this->actionDelay == 0) { - CreateFx(this, 0x48, 0); + CreateFx(this, FX_GIANT_EXPLOSION3, 0); DeleteEntity(this); } } else { @@ -241,7 +242,7 @@ void sub_08029C6C(Entity* this) { void sub_08029C98(Entity* this) { if (sub_0802A14C(this)) { - CreateFx(this, 0x48, 0); + CreateFx(this, FX_GIANT_EXPLOSION3, 0); DeleteEntity(this); } else { gUnk_080CCDA8[this->action](this); diff --git a/src/enemy/mazaalBracelet.c b/src/enemy/mazaalBracelet.c index be47d87f..a0f50903 100644 --- a/src/enemy/mazaalBracelet.c +++ b/src/enemy/mazaalBracelet.c @@ -4,6 +4,7 @@ #include "random.h" #include "object.h" #include "functions.h" +#include "effects.h" void sub_0803B538(Entity*); u32 sub_0803B4E4(Entity*); @@ -962,7 +963,7 @@ void sub_0803B1B8(Entity* this) { this->field_0x7c.HALF.HI = 0x5dc; this->spriteSettings.b.draw = 0; this->damageType = 0x14; - temp = CreateFx(this, 0x51, 0); + temp = CreateFx(this, FX_GIANT_EXPLOSION4, 0); if (temp != (Entity*)0x0) { temp->x.HALF.HI += this->hitbox->offset_x; temp->y.HALF.HI += this->hitbox->offset_y; diff --git a/src/enemy/mazaalHead.c b/src/enemy/mazaalHead.c index bfa45e69..04b80eff 100644 --- a/src/enemy/mazaalHead.c +++ b/src/enemy/mazaalHead.c @@ -6,6 +6,7 @@ #include "random.h" #include "object.h" #include "functions.h" +#include "effects.h" extern void UnloadOBJPalette(Entity*); @@ -78,7 +79,7 @@ void (*const gUnk_080CECB4[])(Entity*) = { }; const u8 gUnk_080CECEC[] = { 0xff, 0xfe, 0xff, 0x00, 0x01, 0x02, 0x01, 0x00 }; const s8 gUnk_080CECF4[] = { -2, 0x01, -8, -4, -0x14, 0x08, 0x0e, -0x10, -6, 0x0c, 0x12, -2, 0x00, 0x00 }; -const u8 gUnk_080CED02[] = { 0x46, 0x46, 0x47, 0x48 }; +const u8 gUnk_080CED02[] = { FX_GIANT_EXPLOSION, FX_GIANT_EXPLOSION, FX_GIANT_EXPLOSION2, FX_GIANT_EXPLOSION3 }; const u8 gUnk_080CED06[] = { 0xff, 0x00, 0x01, 0x00, 0x00, 0x00 }; void (*const gUnk_080CED0C[])(Entity*) = { sub_08034578, sub_080344E0, sub_0803451C, sub_080344E0, sub_08034558, sub_080344E0, sub_0803451C, sub_080346A0, diff --git a/src/enemy/mazaalMacro.c b/src/enemy/mazaalMacro.c index 0e32a810..e9cf7191 100644 --- a/src/enemy/mazaalMacro.c +++ b/src/enemy/mazaalMacro.c @@ -5,6 +5,7 @@ #include "script.h" #include "structures.h" #include "functions.h" +#include "effects.h" extern void sub_0807B600(u32); @@ -43,7 +44,7 @@ void (*const gUnk_080CEEB0[])(Entity*) = { sub_08034E30, sub_08034E68, sub_08034EC0, sub_08034ED8, sub_08034EE4, sub_08034F58, }; -const u8 gUnk_080CEEC8[] = { 0x46, 0x46, 0x47, 0x48 }; +const u8 gUnk_080CEEC8[] = { FX_GIANT_EXPLOSION, FX_GIANT_EXPLOSION, FX_GIANT_EXPLOSION2, FX_GIANT_EXPLOSION3 }; const u8 gUnk_080CEECC[] = { 0x58, 0x68, 0x88, 0x68, 0xb8, 0x68, 0x58, 0xa8, 0x88, 0xa8, 0xb8, 0xa8 }; const s16 gUnk_080CEED8[] = { -0x82, -0x81, -0x80, -0x7f, -0x7e, -0x42, -0x41, -0x40, -0x3f, -0x3e, -2, -1, 1, 2, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x7e, 0x7f, 0x80, 0x81, 0x82 }; @@ -113,7 +114,7 @@ void sub_08034D4C(Entity* this) { void sub_08034DC8(Entity* this) { if (gScreenTransition.field_0x39 == 0) { - CreateFx(this, 0x51, 0); + CreateFx(this, FX_GIANT_EXPLOSION4, 0); sub_0807BA8C(COORD_TO_TILE(this), this->collisionLayer); DeleteThisEntity(); } diff --git a/src/enemy/moldworm.c b/src/enemy/moldworm.c index cb27ab6d..8f805aaf 100644 --- a/src/enemy/moldworm.c +++ b/src/enemy/moldworm.c @@ -2,6 +2,7 @@ #include "entity.h" #include "random.h" #include "functions.h" +#include "effects.h" extern void sub_0800449C(Entity*, u32); extern bool32 sub_08023A38(u32); @@ -177,7 +178,7 @@ void sub_08023330(Entity* this) { this->field_0x7c.BYTES.byte3 = 0; sub_08023A88(this, this->animationState); CopyPosition(this, this->attachedEntity); - CreateFx(this, 4, 0); + CreateFx(this, FX_ROCK, 0); } } @@ -199,7 +200,7 @@ void sub_08023398(Entity* this) { this->damageType = 0x85; this->attachedEntity->actionDelay = 1; sub_08023A68(this); - CreateFx(this, 4, 0); + CreateFx(this, FX_ROCK, 0); return; } this->field_0x78.HWORD = 0x28; diff --git a/src/enemy/puffstool.c b/src/enemy/puffstool.c index 69df19d6..b7139173 100644 --- a/src/enemy/puffstool.c +++ b/src/enemy/puffstool.c @@ -3,6 +3,7 @@ #include "random.h" #include "object.h" #include "functions.h" +#include "effects.h" extern u32 sub_080002E0(u32, u32); extern u32 sub_080002C8(u16, u8); @@ -520,12 +521,12 @@ bool32 sub_08025AB8(u32 tile, u32 layer) { void sub_08025AE8(Entity* this) { Entity* ent; - ent = CreateFx(this, 0x22, 0); + ent = CreateFx(this, FX_BROWN_SMOKE, 0); if (ent) { ent->y.WORD--; } - ent = CreateFx(this, 0x23, 0); + ent = CreateFx(this, FX_BROWN_SMOKE_LARGE, 0); if (ent) { ent->y.WORD++; } diff --git a/src/enemy/rockChuchu.c b/src/enemy/rockChuchu.c index 9e3ad499..e4f2bf30 100644 --- a/src/enemy/rockChuchu.c +++ b/src/enemy/rockChuchu.c @@ -2,6 +2,7 @@ #include "entity.h" #include "random.h" #include "functions.h" +#include "effects.h" extern void sub_0804A4E4(Entity*, Entity*); @@ -40,7 +41,7 @@ void sub_08022254(Entity* this) { break; case 0x16: case 0x1c: - CreateFx(this, 4, 0); + CreateFx(this, FX_ROCK, 0); ent = CreateEnemy(CHUCHU, 1); if (ent) { ent->type2 = 1; diff --git a/src/enemy/slime.c b/src/enemy/slime.c index cd79f8f7..34f9cb55 100644 --- a/src/enemy/slime.c +++ b/src/enemy/slime.c @@ -4,6 +4,7 @@ #include "room.h" #include "random.h" #include "functions.h" +#include "effects.h" typedef struct { s8 h, v; @@ -115,7 +116,7 @@ void sub_080450A8(Entity* this) { off++; } - ent = CreateFx(this, 2, 0); + ent = CreateFx(this, FX_DEATH, 0); if (ent) CopyPosition(this, ent); diff --git a/src/enemy/spark.c b/src/enemy/spark.c index e11228e6..71e913c5 100644 --- a/src/enemy/spark.c +++ b/src/enemy/spark.c @@ -2,6 +2,7 @@ #include "entity.h" #include "object.h" #include "functions.h" +#include "effects.h" extern void (*const gUnk_080CD234[])(Entity*); extern void (*const gUnk_080CD24C[])(Entity*); @@ -23,7 +24,7 @@ void sub_0802B2E0(Entity* this) { this->iframes = 0; this->spriteSettings.b.draw = 0; this->action = 2; - ent = CreateFx(this, 2, 0); + ent = CreateFx(this, FX_DEATH, 0); if (ent) { this->attachedEntity = ent; this->actionDelay = 14; diff --git a/src/enemy/spearMoblin.c b/src/enemy/spearMoblin.c index a66fe5b3..34beba3a 100644 --- a/src/enemy/spearMoblin.c +++ b/src/enemy/spearMoblin.c @@ -2,6 +2,7 @@ #include "entity.h" #include "random.h" #include "functions.h" +#include "effects.h" extern bool32 sub_0806FC80(Entity*, Entity*, u32); extern Entity* sub_08049DF4(u32); @@ -224,7 +225,7 @@ void sub_08028528(Entity* this) { if ((this->actionDelay & 7) == 0) { EnqueueSFX(0xf0); - CreateFx(this, 2, 0x40); + CreateFx(this, FX_DEATH, 0x40); } if (++this->field_0x7a.HALF.HI == 0x80) { diff --git a/src/enemy/vaatiArm.c b/src/enemy/vaatiArm.c index e7e1570b..c4d7037b 100644 --- a/src/enemy/vaatiArm.c +++ b/src/enemy/vaatiArm.c @@ -6,6 +6,7 @@ #include "random.h" #include "utils.h" #include "functions.h" +#include "effects.h" extern void DoExitTransition(ScreenTransitionData*); @@ -1064,7 +1065,7 @@ static inline void deleteThing(Entity* this, const u32 index) { if (index == 1) { this->spriteSettings.b.draw = 0; } - CreateFx(((VaatiArm_HeapStruct*)this->myHeap)->entities[index], 0x51, 0); + CreateFx(((VaatiArm_HeapStruct*)this->myHeap)->entities[index], FX_GIANT_EXPLOSION4, 0); ((VaatiArm_HeapStruct*)this->myHeap)->entities[index]->myHeap = NULL; DeleteEntity(((VaatiArm_HeapStruct*)this->myHeap)->entities[index]); } @@ -1331,7 +1332,7 @@ void sub_08043D08(Entity* this) { entity->spriteSettings.b.draw = 0; InitializeAnimation(entity, 0x13); sub_0804AA1C(entity); - fx = CreateFx(entity, 0x51, 0); + fx = CreateFx(entity, FX_GIANT_EXPLOSION4, 0); if (fx != NULL) { fx->x.HALF.HI += gUnk_080D13E9[this->type2]; fx->y.HALF.HI -= 6; diff --git a/src/enemy/vaatiRebornEnemy.c b/src/enemy/vaatiRebornEnemy.c index 9df23058..f96527e9 100644 --- a/src/enemy/vaatiRebornEnemy.c +++ b/src/enemy/vaatiRebornEnemy.c @@ -6,6 +6,7 @@ #include "audio.h" #include "area.h" #include "functions.h" +#include "effects.h" extern void sub_080AEFB4(Entity*); extern u8 gEntCount; @@ -477,7 +478,7 @@ void VaatiRebornEnemyType0Action7(Entity* this) { SetRoomFlag(1); } else { if ((this->actionDelay & 7) == 0) { - fx = CreateFx(this, 2, 0); + fx = CreateFx(this, FX_DEATH, 0); if (fx != NULL) { tmp = Random() & 0x3f3f; fx->x.HALF.HI = ((tmp & 0xff) - 0x20) + fx->x.HALF.HI; diff --git a/src/enemy/vaatiTransfigured.c b/src/enemy/vaatiTransfigured.c index 9efa55e8..94d7935a 100644 --- a/src/enemy/vaatiTransfigured.c +++ b/src/enemy/vaatiTransfigured.c @@ -5,6 +5,7 @@ #include "flags.h" #include "audio.h" #include "functions.h" +#include "effects.h" void sub_080409B0(Entity*); void sub_080408EC(Entity*); @@ -567,7 +568,7 @@ void VaatiTransfiguredType0Action7(Entity* this) { } this->field_0xf = (this->field_0xf + 1) & 7; if (this->field_0xf == 0) { - pEVar3 = CreateFx(this, 0x55, 0); + pEVar3 = CreateFx(this, FX_AURA_BASE, 0); if (pEVar3 != NULL) { uVar4 = Random() & 0x3f3f; pEVar3->x.HALF.HI += (uVar4 & 0xff) - 0x20; diff --git a/src/enemy/vaatiWrath.c b/src/enemy/vaatiWrath.c index 6a4df2d7..9e319d8c 100644 --- a/src/enemy/vaatiWrath.c +++ b/src/enemy/vaatiWrath.c @@ -10,6 +10,7 @@ #include "structures.h" #include "functions.h" #include "save.h" +#include "effects.h" extern u8 gEntCount; @@ -708,7 +709,7 @@ void sub_08041E78(Entity* this) { const s8* temp; if ((this->field_0xf & 0xf) == 0) { - fx = CreateFx(this, 0x51, 0); + fx = CreateFx(this, FX_GIANT_EXPLOSION4, 0); if (fx != NULL) { temp = &gUnk_080D0E90[this->field_0xf >> 3 & 0xe]; fx->x.HALF.HI += *temp++; diff --git a/src/enemy/vaatiWrathEye.c b/src/enemy/vaatiWrathEye.c index 53434faa..2fd855f5 100644 --- a/src/enemy/vaatiWrathEye.c +++ b/src/enemy/vaatiWrathEye.c @@ -2,6 +2,7 @@ #include "audio.h" #include "structures.h" #include "functions.h" +#include "effects.h" void sub_080485D8(Entity*); void sub_080485FC(Entity*); @@ -158,7 +159,7 @@ void VaatiWrathEyeAction7(Entity* this) { this->actionDelay = 0x3c; this->flags &= 0x7f; this->spriteSettings.b.draw = 0; - CreateFx(this, 0x1f, 0x40); + CreateFx(this, FX_REFLECT2, 0x40); this->parent->field_0x7a.HALF.HI |= 0x10 << this->type; } else { if (--this->actionDelay != 0) { diff --git a/src/enemy/wisp.c b/src/enemy/wisp.c index 247cf0a0..213665c3 100644 --- a/src/enemy/wisp.c +++ b/src/enemy/wisp.c @@ -6,6 +6,7 @@ #include "random.h" #include "createObject.h" #include "functions.h" +#include "effects.h" extern void (*const gUnk_080CEB74[])(Entity*); extern void (*const gUnk_080CEB8C[])(Entity*); @@ -52,7 +53,7 @@ void sub_08033564(Entity* this) { this->flags &= 0x7f; this->iframes = 0; this->spriteSettings.b.draw = FALSE; - ent = CreateFx(this, 2, 0); + ent = CreateFx(this, FX_DEATH, 0); if (ent != NULL) { this->attachedEntity = ent; this->actionDelay = 0xe; diff --git a/src/item/itemPegasusBoots.c b/src/item/itemPegasusBoots.c index 0eca0fe9..9cd2ef72 100644 --- a/src/item/itemPegasusBoots.c +++ b/src/item/itemPegasusBoots.c @@ -2,6 +2,7 @@ #include "audio.h" #include "random.h" #include "functions.h" +#include "effects.h" extern void (*const gUnk_0811BDCC[])(ItemBehavior* beh, u32); @@ -26,10 +27,10 @@ void ItemPegasusBoots(ItemBehavior* this, u32 arg1) { if (((gPlayerState.flags.all & 0x80) == 0) && ((this->field_0x5[2] & 7) == 0)) { if (gPlayerState.field_0x10[2] == 0x11) { if (gPlayerEntity.spriteOffsetY == 0) { - CreateFx(&gPlayerEntity, 0x52, 0); + CreateFx(&gPlayerEntity, FX_GREEN_SPLASH, 0); } } else { - fx = CreateFx(&gPlayerEntity, 0x11, 0x40); + fx = CreateFx(&gPlayerEntity, FX_DASH, 0x40); if ((fx != NULL) && (fx->y.HALF.HI = fx->y.HALF.HI + 2, this->stateID != 2)) { uVar4 = Random() & 3; if ((Random() & 1) != 0) { diff --git a/src/npc/bladeBrothers.c b/src/npc/bladeBrothers.c index 37067485..6567e840 100644 --- a/src/npc/bladeBrothers.c +++ b/src/npc/bladeBrothers.c @@ -9,6 +9,7 @@ #include "npc.h" #include "audio.h" #include "functions.h" +#include "effects.h" extern void (*gUnk_081115C0[])(Entity*); extern void (*gUnk_081115D0[])(Entity*); @@ -165,7 +166,7 @@ void sub_08068BD0(Entity* this) { void sub_08068BEC(Entity* this, u32 unused) { Entity* target; - target = CreateFx(this, 0x44, 0); + target = CreateFx(this, FX_WHITE_SPLASH, 0); if (target) { target->spritePriority.b0 = 1; PositionRelative(this, target, 0, -0x100000); diff --git a/src/npc/castorWildsStatue.c b/src/npc/castorWildsStatue.c index b508d100..f78e1d56 100644 --- a/src/npc/castorWildsStatue.c +++ b/src/npc/castorWildsStatue.c @@ -2,6 +2,7 @@ #include "script.h" #include "functions.h" #include "flags.h" +#include "effects.h" extern Hitbox gUnk_08110E94; @@ -87,7 +88,7 @@ void sub_08067534(Entity* this) { Entity* entity; s32 i; for (i = 0; i < 2; ++i) { - entity = CreateFx(this, 2, 0); + entity = CreateFx(this, FX_DEATH, 0); if (entity != NULL) { entity->x.HALF.HI += gUnk_08110E64[i]; entity->y.HALF.HI += 0x1c; diff --git a/src/npc/ezloCap.c b/src/npc/ezloCap.c index 6f1a16bd..3133fc00 100644 --- a/src/npc/ezloCap.c +++ b/src/npc/ezloCap.c @@ -3,6 +3,7 @@ #include "script.h" #include "audio.h" #include "functions.h" +#include "effects.h" const u8 gUnk_08114134[]; const u8 gUnk_08114144[]; @@ -55,7 +56,7 @@ void sub_0806D944(Entity* this) { // Ezlo Angry FX void sub_0806D96C(Entity* this) { - Entity* fx = CreateFx(this, 0x42, 0); + Entity* fx = CreateFx(this, FX_STEAM_EFC, 0); if (fx != NULL) { fx->spritePriority.b0 = 1; PositionRelative(this, fx, 0, 0xFFE80000); diff --git a/src/npc/goron.c b/src/npc/goron.c index 46a6e940..441a80a6 100644 --- a/src/npc/goron.c +++ b/src/npc/goron.c @@ -3,6 +3,7 @@ #include "functions.h" #include "textbox.h" #include "script.h" +#include "effects.h" extern void (*gUnk_08111A80[])(Entity*); extern void (*gUnk_08111A8C[])(Entity*); @@ -79,13 +80,13 @@ void sub_080693D0(Entity* this) { } void sub_08069428(Entity* this, s32 offsetX, bool32 createFx65) { - Entity* fx = CreateFx(this, 4, 0); + Entity* fx = CreateFx(this, FX_ROCK, 0); if (fx) { PositionRelative(this, fx, offsetX, 0xFFF00000); ResolveEntityOnTop(this, fx); } if (createFx65 != 0) { - fx = CreateFx(this, 65, 0); + fx = CreateFx(this, FX_REFLECT4, 0); if (fx) { PositionRelative(this, fx, offsetX, 0xFFF00000); ResolveEntityOnTop(this, fx); diff --git a/src/npc/mailbox.c b/src/npc/mailbox.c index bab9a8ba..6309b2bd 100644 --- a/src/npc/mailbox.c +++ b/src/npc/mailbox.c @@ -2,6 +2,7 @@ #include "entity.h" #include "textbox.h" #include "functions.h" +#include "effects.h" extern void sub_08063280(); @@ -58,5 +59,5 @@ void sub_08063280(Entity* this, u32 unused) { var = e->frames.all & 0x7F; e->frames.all ^= var; if (var == 2) - CreateFx(e, 49, 0); + CreateFx(e, FX_MAILBOX_UNUSED, 0); } diff --git a/src/npc/melari.c b/src/npc/melari.c index 1e911439..99c04122 100644 --- a/src/npc/melari.c +++ b/src/npc/melari.c @@ -6,6 +6,7 @@ #include "random.h" #include "audio.h" #include "functions.h" +#include "effects.h" extern void sub_08068780(Entity*); extern s32 sub_0806EDD8(Entity*, u32, u32); @@ -91,7 +92,7 @@ void sub_08068780(Entity* this) { } else { EnqueueSFX(gUnk_08111538[(s32)Random() % 3]); } - ent = CreateFx(this, 0x3d, 0x20); + ent = CreateFx(this, FX_STARS2, 0x20); if (ent != NULL) { PositionRelative(this, ent, 0x180000, -0xa0000); } diff --git a/src/npc/percy.c b/src/npc/percy.c index 5bd1fc37..1317fce2 100644 --- a/src/npc/percy.c +++ b/src/npc/percy.c @@ -6,6 +6,7 @@ #include "flags.h" #include "script.h" #include "save.h" +#include "effects.h" extern void sub_0806B41C(Entity*); extern void sub_0806B3CC(Entity*); @@ -63,7 +64,7 @@ void sub_0806B41C(Entity* this) { this->action = 1; this->spriteSettings.b.draw = 1; if (this->type2 == 2) { - CreateFx(this, 0x25, 0); + CreateFx(this, FX_SWEAT, 0); } sub_0807DD50(this); } diff --git a/src/npc/postman.c b/src/npc/postman.c index c0708c12..3d61962e 100644 --- a/src/npc/postman.c +++ b/src/npc/postman.c @@ -9,6 +9,7 @@ #include "save.h" #include "script.h" #include "flags.h" +#include "effects.h" extern void sub_08060528(Entity*); extern void sub_0806EE04(Entity*, void*, u32); @@ -99,7 +100,7 @@ void sub_080604DC(Entity* this) { if (((u32)(this->spriteSettings.raw << 0x1e) >> 0x1e == 1) && sub_080040A8(this)) { if ((this->frames.all & 1) != 0) { this->frames.all &= 0xfe; - ent = CreateFx(this, 0x11, 0x40); + ent = CreateFx(this, FX_DASH, 0x40); if (ent != NULL) { ent->y.HALF.HI++; sub_0805E3A0(ent, 3); diff --git a/src/npc/smith.c b/src/npc/smith.c index c15b1219..55471f6c 100644 --- a/src/npc/smith.c +++ b/src/npc/smith.c @@ -7,6 +7,7 @@ #include "npc.h" #include "audio.h" #include "functions.h" +#include "effects.h" extern void sub_08078850(Entity*, u32, u32, u32*); @@ -43,7 +44,7 @@ void Smith(Entity* this) { } if ((this->frames.all & 1) != 0) { this->frames.all &= 0xfe; - CreateFx(this, 0x3d, 0x20); + CreateFx(this, FX_STARS2, 0x20); SoundReq(gUnk_08110380[(Random() & 7)]); } } diff --git a/src/npc/stamp.c b/src/npc/stamp.c index 51b209b3..54cc7ec6 100644 --- a/src/npc/stamp.c +++ b/src/npc/stamp.c @@ -3,6 +3,7 @@ #include "textbox.h" #include "functions.h" #include "script.h" +#include "effects.h" extern void sub_08062CA4(); @@ -57,7 +58,7 @@ void sub_08062C7C(Entity* ent) { ent->action = 1; sub_0807DD64(ent); InitializeAnimation(ent, 0); - CreateFx(ent, 37, 0); + CreateFx(ent, FX_SWEAT, 0); sub_08062CA4(ent); } diff --git a/src/npc/townsperson.c b/src/npc/townsperson.c index de089fbe..3db8fd02 100644 --- a/src/npc/townsperson.c +++ b/src/npc/townsperson.c @@ -9,6 +9,7 @@ #include "random.h" #include "structures.h" #include "functions.h" +#include "effects.h" typedef struct { u8 frame1; @@ -228,7 +229,7 @@ void sub_08061E90(Entity* this, Entity* arg1) { void sub_08061F94(Entity* this) { Entity* ent; - ent = CreateFx(this, 0x35, 0); + ent = CreateFx(this, FX_BIG_EXPLOSION, 0); if (ent != NULL) { ResolveEntityOnTop(this, ent); } diff --git a/src/object/bigVortex.c b/src/object/bigVortex.c index 866309ae..9a06d4ff 100644 --- a/src/object/bigVortex.c +++ b/src/object/bigVortex.c @@ -3,6 +3,7 @@ #include "flags.h" #include "object.h" #include "functions.h" +#include "effects.h" extern void sub_08098E3C(Entity*); extern void sub_08098E88(Entity*); @@ -43,7 +44,7 @@ void sub_08098D6C(Entity* this) { if (CheckFlags(this->field_0x86.HWORD)) { this->action = 2; this->actionDelay = 0x2d; - ent = CreateFx(this, 0x43, 0); + ent = CreateFx(this, FX_BIG_EXPLOSION2, 0); if (ent != NULL) { ent->y.HALF.HI += 8; } diff --git a/src/object/bird.c b/src/object/bird.c index 3d1558e3..0dad159f 100644 --- a/src/object/bird.c +++ b/src/object/bird.c @@ -6,6 +6,7 @@ #include "random.h" #include "object.h" #include "functions.h" +#include "effects.h" extern void (*const gUnk_08123EC0[])(Entity*); extern void (*const gUnk_08123EEC[])(Entity*); @@ -99,7 +100,7 @@ void sub_0809D0AC(Entity* this) { this->collisionLayer = 1; SetLocalFlag(0x45); SoundReq(SFX_SECRET); - fx = CreateFx(this, 0x11, 0); + fx = CreateFx(this, FX_DASH, 0); if (fx != NULL) { sub_0806FAD8(this, fx); } diff --git a/src/object/book.c b/src/object/book.c index b51c4716..356b85d9 100644 --- a/src/object/book.c +++ b/src/object/book.c @@ -5,6 +5,7 @@ #include "flags.h" #include "room.h" #include "textbox.h" +#include "effects.h" extern void (*const BookActionFuncs[])(Entity*); extern s8 const gUnk_08123D94[]; @@ -135,7 +136,7 @@ void sub_0809B56C(Entity* this) { SetFlag(this->field_0x86.HWORD); - fx = CreateFx(this, 2, 0); + fx = CreateFx(this, FX_DEATH, 0); if (fx) { ResolveEntityOnTop(this, fx); } diff --git a/src/object/button.c b/src/object/button.c index 5111575e..52876a45 100644 --- a/src/object/button.c +++ b/src/object/button.c @@ -4,6 +4,7 @@ #include "room.h" #include "audio.h" #include "functions.h" +#include "effects.h" extern void (*const gUnk_0811EE38[])(Entity*); @@ -231,13 +232,13 @@ u32 sub_08081F00(u32* unk1, u32* unk2) { } void sub_08081F24(Entity* this) { - Entity* fx = CreateFx(this, 0x11, 0x40); + Entity* fx = CreateFx(this, FX_DASH, 0x40); if (fx) { fx->scriptedScene = 3; fx->x.HALF.HI += 7; fx->y.HALF.HI += 5; } - fx = CreateFx(this, 0x11, 0x40); + fx = CreateFx(this, FX_DASH, 0x40); if (fx) { fx->scriptedScene = 3; fx->x.HALF.HI -= 7; diff --git a/src/object/lockedDoor.c b/src/object/lockedDoor.c index f7918284..d82a3e3d 100644 --- a/src/object/lockedDoor.c +++ b/src/object/lockedDoor.c @@ -4,6 +4,7 @@ #include "game.h" #include "audio.h" #include "functions.h" +#include "effects.h" void sub_08083338(Entity*); void sub_080834B4(Entity*); @@ -315,12 +316,12 @@ u32 sub_080837B0(Entity* this) { void sub_08083814(Entity* this, u32 unk0) { Entity* fx; const struct_0811F730* tmp = &gUnk_0811F730[unk0]; - fx = CreateFx(this, 0x11, 0x40); + fx = CreateFx(this, FX_DASH, 0x40); if (fx) { fx->x.HALF.HI += tmp->unk_00.x; fx->y.HALF.HI += tmp->unk_00.y; } - fx = CreateFx(this, 0x11, 0x40); + fx = CreateFx(this, FX_DASH, 0x40); if (fx) { fx->x.HALF.HI += tmp->unk_02.x; fx->y.HALF.HI += tmp->unk_02.y; diff --git a/src/object/mask.c b/src/object/mask.c index b6d06206..05a49fb7 100644 --- a/src/object/mask.c +++ b/src/object/mask.c @@ -6,6 +6,7 @@ #include "player.h" #include "flags.h" #include "functions.h" +#include "effects.h" extern void (*MaskActionFuncs[])(Entity*); @@ -111,7 +112,7 @@ void sub_08092B0C(Entity* this) { break; } - CreateFx(this, 5, 0); + CreateFx(this, FX_POT_SHATTER, 0); sub_0805457C(this, 3); } else { diff --git a/src/object/metalDoor.c b/src/object/metalDoor.c index 475a35ac..a65cf709 100644 --- a/src/object/metalDoor.c +++ b/src/object/metalDoor.c @@ -4,6 +4,7 @@ #include "flags.h" #include "audio.h" #include "functions.h" +#include "effects.h" extern u32 sub_08083734(Entity*, u32); extern void sub_080A080C(Entity*); @@ -56,12 +57,12 @@ void sub_080A074C(Entity* this) { this->height.HALF.HI = 0; this->x.HALF.HI = this->field_0x70.HALF.LO; this->y.HALF.HI = this->field_0x70.HALF.HI; - ent = CreateFx(this, 0x11, 0x40); + ent = CreateFx(this, FX_DASH, 0x40); if (ent != NULL) { ent->x.HALF.HI += 0xc; ent->y.HALF.HI -= 0xc; } - ent = CreateFx(this, 0x11, 0x40); + ent = CreateFx(this, FX_DASH, 0x40); if (ent != NULL) { ent->x.HALF.HI -= 0xc; ent->y.HALF.HI -= 0xc; diff --git a/src/object/objectA2.c b/src/object/objectA2.c index 2cc132fe..73cb101f 100644 --- a/src/object/objectA2.c +++ b/src/object/objectA2.c @@ -5,6 +5,7 @@ #include "audio.h" #include "structures.h" #include "functions.h" +#include "effects.h" void sub_0809F318(Entity*); void sub_0809F374(Entity*); @@ -85,7 +86,7 @@ void sub_0809F408(Entity* this) { switch (this->frames.all) { case 9: this->frames.all = 0; - CreateFx(this, 0x43, 0); + CreateFx(this, FX_BIG_EXPLOSION2, 0); gMenu.field_0x0 = 1; break; case 0x80: diff --git a/src/object/pot.c b/src/object/pot.c index 7aff3672..f3423433 100644 --- a/src/object/pot.c +++ b/src/object/pot.c @@ -5,6 +5,7 @@ #include "room.h" #include "object.h" #include "functions.h" +#include "effects.h" void sub_08082824(Entity*); static void sub_08082850(Entity*, Entity*); @@ -97,7 +98,7 @@ void sub_08082310(Entity* this) { break; default: if (sub_080002B8(this) == 13) { - CreateFx(this, 0, 0); + CreateFx(this, FX_FALL_DOWN, 0); } else if (tileType == 0x4005) { gPlayerState.field_0xab = 4; SetTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); @@ -137,13 +138,13 @@ void sub_08082588(Entity* this) { void sub_0808259C(Entity* this) { switch (sub_080043E8(this)) { case 2: - CreateFx(this, 11, 0); + CreateFx(this, FX_WATER_SPLASH, 0); break; case 1: - CreateFx(this, 0, 0); + CreateFx(this, FX_FALL_DOWN, 0); break; case 3: - CreateFx(this, 12, 0); + CreateFx(this, FX_LAVA_SPLASH, 0); break; default: sub_08082850(this, &gPlayerEntity); @@ -261,7 +262,7 @@ void sub_08082824(Entity* this) { static void sub_08082850(Entity* this, Entity* parent) { u32 parameter = sub_0808288C(this, this->type, this->field_0x7c.BYTES.byte1, this->type2); - Entity* fxEntity = CreateFx(this, 5, parameter); + Entity* fxEntity = CreateFx(this, FX_POT_SHATTER, parameter); if (fxEntity) { fxEntity->parent = parent; } diff --git a/src/object/treeHidingPortal.c b/src/object/treeHidingPortal.c index 53f593bb..dcaf3ebc 100644 --- a/src/object/treeHidingPortal.c +++ b/src/object/treeHidingPortal.c @@ -6,6 +6,7 @@ #include "room.h" #include "structures.h" #include "functions.h" +#include "effects.h" extern void sub_0809E96C(Entity*); extern void CreateSparkle(Entity*); @@ -70,7 +71,7 @@ void sub_0809E918(Entity* this) { Entity* fx; s16* i = gUnk_08124364; while (*i != -1000) { - fx = CreateFx(this, 3, 0); + fx = CreateFx(this, FX_BUSH, 0); if (fx != NULL) { fx->x.HALF.HI += i[0]; fx->y.HALF.HI += i[1]; diff --git a/src/object/windcrest.c b/src/object/windcrest.c index 91bdb37a..3ebaef24 100644 --- a/src/object/windcrest.c +++ b/src/object/windcrest.c @@ -4,6 +4,7 @@ #include "save.h" #include "script.h" #include "functions.h" +#include "effects.h" extern void sub_08078850(Entity*, u32, u32, u8*); @@ -26,5 +27,5 @@ void sub_080A2124(Entity* this) { void Windcrest_Unlock(Entity* this) { SoundReq(SFX_SECRET); gSave.windcrests = gSave.windcrests | 1 << (this->type2 + 0x18); - CreateFx(this, 0x46, 0); + CreateFx(this, FX_GIANT_EXPLOSION, 0); } diff --git a/src/player.c b/src/player.c index 92ddc33d..655f4a28 100644 --- a/src/player.c +++ b/src/player.c @@ -10,6 +10,7 @@ #include "object.h" #include "functions.h" #include "object.h" +#include "effects.h" static void (*const sPlayerActions[])(Entity*); extern void (*const gUnk_0811BA60[])(Entity*); @@ -501,7 +502,7 @@ void sub_0807127C(Entity* this) { if ((gPlayerState.flags.all & 0x10000) == 0) sub_08004168(this); - CreateFx(this, 11, 0); + CreateFx(this, FX_WATER_SPLASH, 0); if ((gPlayerState.flags.all & 8) == 0) gPlayerState.field_0x8 = 0x72c; @@ -1143,7 +1144,7 @@ void sub_08072008(Entity* this) { this->flags |= 0x80; this->spriteOffsetX = 0; gPlayerState.flags.all &= ~(0x800 | 0x1); - CreateFx(this, 0xd, 0); + CreateFx(this, FX_ICE, 0); sub_080791BC(); } @@ -1305,7 +1306,7 @@ void sub_08072354(Entity* this) { gPlayerState.field_0x8 = 0x2c1; gPlayerState.flags.all &= ~0x400; UpdateSpriteForCollisionLayer(this); - CreateFx(this, 0xc, 0); + CreateFx(this, FX_LAVA_SPLASH, 0); SoundReq(SFX_1A6); } @@ -1459,7 +1460,7 @@ void sub_080726F4(Entity* this) { this->direction = (this->animationState & 6) << 2; if (((gPlayerState.flags.all & 0x80) == 0) && (--this->actionDelay == 0xff)) { - CreateFx(&gPlayerEntity, 0x11, 0x40); + CreateFx(&gPlayerEntity, FX_DASH, 0x40); this->actionDelay = 4; } if ((gPlayerState.flags.all & 2) == 0) { diff --git a/src/playerItem/playerItem14.c b/src/playerItem/playerItem14.c index 5883ccc2..dca41640 100644 --- a/src/playerItem/playerItem14.c +++ b/src/playerItem/playerItem14.c @@ -3,6 +3,7 @@ #include "functions.h" #include "player.h" #include "room.h" +#include "effects.h" extern void (*const gUnk_08109AC8[])(Entity*); extern Hitbox gUnk_08109AD0; @@ -46,11 +47,11 @@ void sub_0805FC74(Entity* this) { } if (!sub_080002F0(COORD_TO_TILE(this), gPlayerEntity.collisionLayer, 0x80) && sub_080040D8(this, &gUnk_08003E44, this->x.HALF.HI, this->y.HALF.HI)) { - CreateFx(this, 0x19, 0); + CreateFx(this, FX_SWORD_MAGIC, 0); DeleteThisEntity(); } if (this->bitfield != 0) { - CreateFx(this, 0x19, 0); + CreateFx(this, FX_SWORD_MAGIC, 0); DeleteThisEntity(); } } else { diff --git a/src/playerItem/playerItemBow.c b/src/playerItem/playerItemBow.c index 351a2907..7f6aaf22 100644 --- a/src/playerItem/playerItemBow.c +++ b/src/playerItem/playerItemBow.c @@ -1,6 +1,7 @@ #include "global.h" #include "entity.h" #include "functions.h" +#include "effects.h" extern void (*const gUnk_080B3E30[])(Entity*); @@ -33,6 +34,6 @@ void sub_08019444(Entity* this) { void sub_08019468(Entity* this) { if (this->field_0x40 == 0x0e) { - CreateFx(this, 0x50, 0); + CreateFx(this, FX_REFLECT5, 0); } } diff --git a/src/playerItem/playerItemSwordBeam.c b/src/playerItem/playerItemSwordBeam.c index 7329b69b..8fb41232 100644 --- a/src/playerItem/playerItemSwordBeam.c +++ b/src/playerItem/playerItemSwordBeam.c @@ -3,6 +3,7 @@ #include "coord.h" #include "functions.h" #include "audio.h" +#include "effects.h" extern void (*const gUnk_080B43F4[])(Entity*); @@ -70,11 +71,11 @@ void sub_08019580(Entity* this) { } if ((sub_080002F0(TILE(this->x.HALF.HI, this->y.HALF.HI), gPlayerEntity.collisionLayer, 0x80) == 0) && (sub_080040D8(this, &gUnk_08003E44, this->x.HALF.HI, this->y.HALF.HI) != 0)) { - CreateFx(this, 0x19, 0); + CreateFx(this, FX_SWORD_MAGIC, 0); DeleteThisEntity(); } if (this->bitfield != 0) { - CreateFx(this, 0x19, 0); + CreateFx(this, FX_SWORD_MAGIC, 0); DeleteThisEntity(); } if (sub_08008790(this, 0xc) != NULL) { diff --git a/src/projectile/cannonballProjectile.c b/src/projectile/cannonballProjectile.c index 8c6e7da4..150d5fe3 100644 --- a/src/projectile/cannonballProjectile.c +++ b/src/projectile/cannonballProjectile.c @@ -1,6 +1,7 @@ #include "entity.h" #include "enemy.h" #include "functions.h" +#include "effects.h" extern void CreateItemOnGround(Entity*); extern s32 sub_080AF090(Entity*); @@ -46,7 +47,7 @@ void CannonballProjectile_Init(Entity* this) { void CannonballProjectile_Action1(Entity* this) { GetNextFrame(this); if (sub_080AF090(this) == 0) { - CreateFx(this, 2, 0); + CreateFx(this, FX_DEATH, 0); DeleteThisEntity(); } sub_080AB5F4(this); @@ -56,7 +57,7 @@ void CannonballProjectile_Action2(Entity* this) { GetNextFrame(this); sub_080AF090(this); if ((sub_080AB634(this) == 0) && (this->collisions != 0)) { - CreateFx(this, 2, 0); + CreateFx(this, FX_DEATH, 0); DeleteThisEntity(); } } @@ -85,7 +86,7 @@ bool32 sub_080AB634(Entity* this) { entities[i]->action = 3; entities[i]->actionDelay = 0x1e; entities[i]->spriteSettings.b.draw = 0; - CreateFx(entities[i], 0x45, 0); + CreateFx(entities[i], FX_WHITE_ROCK, 0); } DeleteEntity(this); return TRUE; diff --git a/src/projectile/dirtBallProjectile.c b/src/projectile/dirtBallProjectile.c index fd2765e7..371473da 100644 --- a/src/projectile/dirtBallProjectile.c +++ b/src/projectile/dirtBallProjectile.c @@ -3,6 +3,7 @@ #include "player.h" #include "coord.h" #include "functions.h" +#include "effects.h" extern void sub_08078954(Entity*); @@ -129,13 +130,13 @@ void DirtBallProjectile_Action2(Entity* this) { if (tmp != 0) { switch (tmp) { case 2: - CreateFx(this, 0xb, 0); + CreateFx(this, FX_WATER_SPLASH, 0); break; case 1: - CreateFx(this, 0, 0); + CreateFx(this, FX_FALL_DOWN, 0); break; case 3: - CreateFx(this, 0xc, 0); + CreateFx(this, FX_LAVA_SPLASH, 0); break; } DeleteThisEntity(); @@ -148,7 +149,7 @@ void DirtBallProjectile_Action2(Entity* this) { this->action = 3; return; case 2: - entity = CreateFx(this, 5, 0x80); + entity = CreateFx(this, FX_POT_SHATTER, 0x80); if (entity != NULL) { entity->parent = NULL; } diff --git a/src/projectile/gleerokProjectile.c b/src/projectile/gleerokProjectile.c index 287b0013..d8eeff71 100644 --- a/src/projectile/gleerokProjectile.c +++ b/src/projectile/gleerokProjectile.c @@ -5,6 +5,7 @@ #include "functions.h" #include "random.h" #include "audio.h" +#include "effects.h" extern void sub_0806F5BC(Entity*, u32, u32); extern u32 sub_080041DC(Entity*, u32, u32); @@ -90,7 +91,7 @@ void GleerokProjectile_Action1(Entity* this) { if (this->type == 3) { if (sub_08003FC4(this, 0x1800) == 0) { sub_08008790(this, 7); - CreateFx(this, 4, 0); + CreateFx(this, FX_ROCK, 0); DeleteThisEntity(); } } else { diff --git a/src/projectile/lakituCloudProjectile.c b/src/projectile/lakituCloudProjectile.c index 76ac9ea5..25599826 100644 --- a/src/projectile/lakituCloudProjectile.c +++ b/src/projectile/lakituCloudProjectile.c @@ -2,6 +2,7 @@ #include "enemy.h" #include "functions.h" #include "player.h" +#include "effects.h" extern void sub_0800449C(Entity*, u32); extern void sub_08079D84(void); @@ -26,7 +27,7 @@ void nullsub_539(Entity* this) { void sub_080A9CF0(Entity* this) { if (sub_0806F520() == 0) { - CreateFx(this, 2, 0); + CreateFx(this, FX_DEATH, 0); DeleteThisEntity(); } LakituCloudProjectile_SubActions[this->subAction](this); @@ -46,7 +47,7 @@ void LakituCloudProjectile_SubAction2(Entity* this) { sub_0800449C(&gPlayerEntity, 0x7a); sub_08079D84(); } - CreateFx(this, 2, 0); + CreateFx(this, FX_DEATH, 0); DeleteThisEntity(); } } diff --git a/src/projectile/lakituLightning.c b/src/projectile/lakituLightning.c index 8d055ba6..975491c2 100644 --- a/src/projectile/lakituLightning.c +++ b/src/projectile/lakituLightning.c @@ -1,5 +1,6 @@ #include "entity.h" #include "enemy.h" +#include "effects.h" extern s32 sub_080AF090(Entity*); extern s32 sub_080A7EB0(Entity*); @@ -35,7 +36,7 @@ void LakituLightning_Action1(Entity* this) { GetNextFrame(this); sub_080AF090(this); if ((this->collisions != 0) || (--this->actionDelay == 0)) { - CreateFx(this, 0x4f, 0); + CreateFx(this, FX_BLUE_EFC, 0); DeleteThisEntity(); } if (sub_080A7EB0(this) != 0) { diff --git a/src/projectile/octorokBossProjectile.c b/src/projectile/octorokBossProjectile.c index 5d41b4f1..6f677525 100644 --- a/src/projectile/octorokBossProjectile.c +++ b/src/projectile/octorokBossProjectile.c @@ -3,6 +3,7 @@ #include "random.h" #include "functions.h" #include "audio.h" +#include "effects.h" void OctorokBossProjectile_Action2(Entity*); extern void sub_080AE58C(Entity*, u32, u32); @@ -183,14 +184,14 @@ void OctorokBossProjectile_Action1(Entity* this) { if (sub_08003FC4(this, 0x1800) != 0) { return; } - CreateFx(this, 4, 0); + CreateFx(this, FX_ROCK, 0); DeleteThisEntity(); break; } } void OctorokBossProjectile_Action2(Entity* this) { - CreateFx(this, 4, 0); + CreateFx(this, FX_ROCK, 0); DeleteThisEntity(); } diff --git a/src/projectile/stalfosProjectile.c b/src/projectile/stalfosProjectile.c index c743fcbc..0c48006f 100644 --- a/src/projectile/stalfosProjectile.c +++ b/src/projectile/stalfosProjectile.c @@ -1,6 +1,7 @@ #include "entity.h" #include "enemy.h" #include "functions.h" +#include "effects.h" extern void (*const StalfosProjectile_Functions[])(Entity*); extern void (*const StalfosProjectile_Actions[])(Entity*); @@ -126,9 +127,9 @@ void StalfosProjectile_Action3(Entity* this) { void sub_080A9BA8(Entity* this) { if (this->type == 0) { - CreateFx(this, 5, 0); + CreateFx(this, FX_POT_SHATTER, 0); } else { - CreateFx(this, 0x3c, 0); + CreateFx(this, FX_BONE, 0); } DeleteThisEntity(); } diff --git a/src/projectile/v2Projectile.c b/src/projectile/v2Projectile.c index 0420790b..ffb558a1 100644 --- a/src/projectile/v2Projectile.c +++ b/src/projectile/v2Projectile.c @@ -4,6 +4,7 @@ #include "functions.h" #include "random.h" #include "audio.h" +#include "effects.h" extern void (*const V2Projectile_Functions[])(Entity*); extern void (*const gUnk_0812A7EC[])(Entity*); @@ -26,7 +27,7 @@ ASM_FUNC("asm/non_matching/v2Projectile/sub_080ABBF4.inc", void sub_080ABBF4(Ent void sub_080ABC54(Entity* this) { if (sub_0806F520() == 0) { - CreateFx(this, 2, 0); + CreateFx(this, FX_DEATH, 0); DeleteThisEntity(); } gUnk_0812A808[this->subAction](this); @@ -44,7 +45,7 @@ void sub_080ABC90(Entity* this) { ModHealth(-2); sub_0800449C(&gPlayerEntity, 0x7a); sub_08079D84(); - CreateFx(this, 2, 0); + CreateFx(this, FX_DEATH, 0); DeleteThisEntity(); } } @@ -96,7 +97,7 @@ ASM_FUNC("asm/non_matching/v2Projectile/sub_080ABE04.inc", void sub_080ABE04(Ent void sub_080ABE88(Entity* this) { if (sub_08003FC4(this, 0x1800) == 0) { - CreateFx(this, 4, 0); + CreateFx(this, FX_ROCK, 0); DeleteThisEntity(); } } diff --git a/src/projectile/v3TennisBallProjectile.c b/src/projectile/v3TennisBallProjectile.c index 82d64a3c..d2c4ef74 100644 --- a/src/projectile/v3TennisBallProjectile.c +++ b/src/projectile/v3TennisBallProjectile.c @@ -2,6 +2,7 @@ #include "enemy.h" #include "audio.h" #include "functions.h" +#include "effects.h" extern s32 sub_080AF090(Entity*); extern s32 sub_080A7EB0(Entity*); @@ -56,7 +57,7 @@ void sub_080ACB90(Entity* this) { Entity* parent = this->parent; if ((this->x.HALF.HI == parent->x.HALF.HI) && (this->y.HALF.HI <= parent->y.HALF.HI)) { parent->field_0xf = 1; - CreateFx(this, 0x1f, 0x40); + CreateFx(this, FX_REFLECT2, 0x40); EnqueueSFX(SFX_ITEM_GLOVES_KNOCKBACK); DeleteThisEntity(); } diff --git a/src/room.c b/src/room.c index 6e1c44d5..227073c2 100644 --- a/src/room.c +++ b/src/room.c @@ -13,6 +13,7 @@ #include "script.h" #include "random.h" #include "functions.h" +#include "effects.h" void sub_0804B3C4(void* arg0) { sub_0804B29C(arg0); @@ -5825,7 +5826,7 @@ void sub_0804F5E8(void) { void sub_0804F680(Entity* parent, s32 x, s32 y) { Entity* fx; - fx = CreateFx(parent, 2, 0); + fx = CreateFx(parent, FX_DEATH, 0); if (fx != NULL) { fx->x.HALF.HI = gRoomControls.roomOriginX + x; fx->y.HALF.HI = gRoomControls.roomOriginY + y; @@ -5866,13 +5867,13 @@ void sub_0804F760(Entity* this) { void sub_0804F79C(Entity* parent) { Entity* fx; - fx = CreateFx(parent, 0x35, 0); + fx = CreateFx(parent, FX_BIG_EXPLOSION, 0); if (fx != NULL) { fx->spriteRendering.b3 = 0; fx->x.HALF.HI = gRoomControls.roomOriginX + 0x1b8; fx->y.HALF.HI = gRoomControls.roomOriginY + 0x148; } - fx = CreateFx(parent, 0x35, 0); + fx = CreateFx(parent, FX_BIG_EXPLOSION, 0); if (fx != NULL) { fx->spriteRendering.b3 = 0; fx->x.HALF.HI = gRoomControls.roomOriginX + 0x238; diff --git a/src/script.c b/src/script.c index 9529156f..fd1c2dcf 100644 --- a/src/script.c +++ b/src/script.c @@ -12,6 +12,7 @@ #include "audio.h" #include "functions.h" #include "main.h" +#include "effects.h" void InitScriptForEntity(Entity*, ScriptExecutionContext*, u16*); void InitScriptExecutionContext(ScriptExecutionContext* context, u16* script); @@ -1684,7 +1685,7 @@ void sub_0807F360(Entity* entity, ScriptExecutionContext* context) { void sub_0807F36C(Entity* entity, ScriptExecutionContext* context) { Entity* fx; - fx = CreateFx(entity, 0x41, 0); + fx = CreateFx(entity, FX_REFLECT4, 0); if (fx != NULL) { fx->spritePriority.b0 = 1; PositionRelative(entity, fx, 0, -524288);