Use FX enum and add another sparkle to the enum

This commit is contained in:
Tal Hayon 2022-11-21 19:17:21 +02:00
parent 1ceeac3c84
commit bf9df14832
16 changed files with 24 additions and 24 deletions

View File

@ -42,7 +42,7 @@ typedef enum {
FX_BROWN_SMOKE_LARGE,
FX_BROWN_SMOKE2,
FX_SWEAT,
FX_26,
FX_SPARKLE4,
FX_27,
FX_SLOW_EXPLOSION,
FX_CONFETTI,

View File

@ -314,13 +314,13 @@ void sub_08030E80(EyegoreEntity* this) {
-11, 9, 11, 9, -9, -2, -8, 10, -11, -1, 11, -1, 9, -2, 8, 10,
};
u32 tmp = super->animationState << 2;
Entity* effect = CreateObject(SPECIAL_FX, 2, 0);
Entity* effect = CreateObject(SPECIAL_FX, FX_DEATH, 0);
if (effect != NULL) {
CopyPosition(super, effect);
effect->x.HALF.HI += gUnk_080CE2F4[tmp + 0];
effect->y.HALF.HI += gUnk_080CE2F4[tmp + 1];
}
effect = CreateObject(SPECIAL_FX, 2, 0);
effect = CreateObject(SPECIAL_FX, FX_DEATH, 0);
if (effect != NULL) {
CopyPosition(super, effect);
effect->x.HALF.HI += gUnk_080CE2F4[tmp + 2];

View File

@ -353,7 +353,7 @@ bool32 sub_0802C0E8(Entity* this) {
void sub_0802C18C(Entity* this) {
this->field_0x78.HALF.LO--;
if ((this->field_0x78.HALF.LO & 7) == 0) {
Entity* ent = CreateObject(SPECIAL_FX, 0x11, 0x40);
Entity* ent = CreateObject(SPECIAL_FX, FX_DASH, 0x40);
if (ent != NULL) {
PositionRelative(this, ent, 0, Q_16_16(1.0));
}

View File

@ -65,7 +65,7 @@ void CreateMagicSparkles(u32 baseX, u32 baseY, u32 layer) {
r = Random();
if (r & 0x7)
return;
spark = CreateObject(SPECIAL_FX, 0x26, 0);
spark = CreateObject(SPECIAL_FX, FX_SPARKLE4, 0);
if (spark == NULL)
return;
offsetX = (r >> 0x8) & 0xF;

View File

@ -28,7 +28,7 @@ void sub_0806C224(void) {
}
void Simon_CreateChest(Entity* this) {
CreateObjectWithParent(this, SPECIAL_FX, 0x43, 0);
CreateObjectWithParent(this, SPECIAL_FX, FX_BIG_EXPLOSION2, 0);
SetTileType(0x73, COORD_TO_TILE(this), this->collisionLayer);
SoundReq(SFX_SECRET_BIG);
}

View File

@ -57,7 +57,7 @@ void sub_0806A26C(Entity* this) {
const s8* ptr;
u32 uVar2, uVar1;
Entity* pEVar1;
pEVar1 = CreateObject(SPECIAL_FX, 0x2f, 0);
pEVar1 = CreateObject(SPECIAL_FX, FX_SLOW_SMOKE_SMALL, 0);
if (pEVar1 != NULL) {
PositionEntityOnTop(this, pEVar1);
uVar2 = uVar1 = Random();

View File

@ -116,7 +116,7 @@ void sub_08099880(BigIceBlockEntity* this) {
uVar4 = (0x3c - super->timer) * 0x20 + 0x100;
SetAffineInfo(super, 0x100, uVar4, 0);
sub_0806FCF4(super, uVar4, 2, 0);
obj = CreateObject(SPECIAL_FX, 0x11, 0x40);
obj = CreateObject(SPECIAL_FX, FX_DASH, 0x40);
if (obj != NULL) {
rand = Random();
x = ((rand >> 0x10) % 0x21) - 0x10;

View File

@ -92,7 +92,7 @@ void FrozenWaterElement_Action2(FrozenWaterElementEntity* this) {
super->spriteOffsetY += 8;
}
value = gUnk_08123DC0[this->unk_74 >> 5];
effect = CreateObject(SPECIAL_FX, 0x11, 0x40);
effect = CreateObject(SPECIAL_FX, FX_DASH, 0x40);
if (effect != NULL) {
rand = Random();
tmp = (((rand >> 0x10) & value) - ((value + 1) >> 1));
@ -101,7 +101,7 @@ void FrozenWaterElement_Action2(FrozenWaterElementEntity* this) {
effect->x.HALF.HI = this->unk_80 + gRoomControls.origin_x + tmp;
effect->y.HALF.HI = this->unk_82 + gRoomControls.origin_y + tmp2;
}
effect = CreateObject(SPECIAL_FX, 2, 0x40);
effect = CreateObject(SPECIAL_FX, FX_DEATH, 0x40);
if (effect != NULL) {
rand = Random();
tmp = (((rand >> 0x10) & value) - ((value + 1) >> 1));

View File

@ -437,7 +437,7 @@ void GyorgBossObject_SpawnChildren(u32 unk0, bool32 fromBlue, u32 animationState
}
if (fromBlue == FALSE) {
Entity* tmp;
tmp = CreateObject(SPECIAL_FX, 2, 0);
tmp = CreateObject(SPECIAL_FX, FX_DEATH, 0);
if (tmp) {
tmp->x.HALF.HI = x;
tmp->y.HALF.HI = y;

View File

@ -166,7 +166,7 @@ bool32 sub_08097008(ObjectOnPillarEntity* this) {
this->tileIndex = tileType;
break;
default:
effect = CreateObject(SPECIAL_FX, 4, 0);
effect = CreateObject(SPECIAL_FX, FX_ROCK, 0);
if (effect != NULL) {
CopyPosition(super, effect);
}
@ -244,11 +244,11 @@ void sub_080971E0(ObjectOnPillarEntity* this) {
EntityWithHitFlag* entity;
u32 tilePosition;
entity = (EntityWithHitFlag*)CreateObject(SPECIAL_FX, 0x11, 0x40);
entity = (EntityWithHitFlag*)CreateObject(SPECIAL_FX, FX_DASH, 0x40);
if (entity != NULL) {
PositionRelative(super, &entity->base, -0x80000, 0x20000);
}
entity = (EntityWithHitFlag*)CreateObject(SPECIAL_FX, 0x11, 0x40);
entity = (EntityWithHitFlag*)CreateObject(SPECIAL_FX, FX_DASH, 0x40);
if (entity != NULL) {
PositionRelative(super, &entity->base, 0x80000, 0x20000);
}

View File

@ -71,7 +71,7 @@ void PushableStatue_Action1(PushableStatueEntity* this) {
sub_08089538(this);
break;
case 0:
obj = CreateObject(SPECIAL_FX, 4, 0);
obj = CreateObject(SPECIAL_FX, FX_ROCK, 0);
if (obj != NULL) {
CopyPosition(super, obj);
}
@ -118,7 +118,7 @@ void PushableStatue_SubAction0(PushableStatueEntity* this) {
sub_08089538(this);
break;
case 0:
obj = CreateObject(SPECIAL_FX, 4, 0);
obj = CreateObject(SPECIAL_FX, FX_ROCK, 0);
if (obj != NULL) {
CopyPosition(super, obj);
}
@ -216,7 +216,7 @@ bool32 sub_080895C0(PushableStatueEntity* this) {
sub_08089454(this);
return TRUE;
}
obj = CreateObject(SPECIAL_FX, 4, 0);
obj = CreateObject(SPECIAL_FX, FX_ROCK, 0);
if (obj != NULL) {
CopyPosition(super, obj);
}

View File

@ -98,7 +98,7 @@ void SmallIceBlock_Action1(SmallIceBlockEntity* this) {
sub_080994B8(this);
break;
case 0:
obj = CreateObject(SPECIAL_FX, 0xd, 0);
obj = CreateObject(SPECIAL_FX, FX_ICE, 0);
if (obj != NULL) {
CopyPosition(super, obj);
}
@ -165,7 +165,7 @@ void SmallIceBlock_Action4(SmallIceBlockEntity* this) {
}
SetAffineInfo(super, 0x100, (0x3c - super->timer) * 0x20 + 0x100, 0);
if ((super->timer & 1) != 0) {
obj = CreateObject(SPECIAL_FX, 0x11, 0x40);
obj = CreateObject(SPECIAL_FX, FX_DASH, 0x40);
if (obj != NULL) {
rand = Random();
x = ((rand >> 0x10) % 9) - 4;

View File

@ -44,7 +44,7 @@ const ObjectDefinition gObjectDefinition_F[] = {
{ { 1, 0, 0, 0, 154, 2, 0 }, { 4, 0, 0, 0, SPRITE_SPECIALFX, 0, 0 } }, // FX_BROWN_SMOKE_LARGE
{ { 1, 0, 0, 0, 154, 2, 0 }, { 4, 0, 0, 0, SPRITE_SPECIALFX, 0, 0 } }, // FX_BROWN_SMOKE2
{ { 1, 0, 0, 0, 243, 0, 0 }, { 1, 0, 0, 0, SPRITE_SPECIALFX_1, 0, 0 } }, // FX_SWEAT
{ { 1, 0, 0, 0, 60, 2, 0 }, { 4, 0, 0, 0, SPRITE_SPECIALFX, 0, 0 } }, // FX_26
{ { 1, 0, 0, 0, 60, 2, 0 }, { 4, 0, 0, 0, SPRITE_SPECIALFX, 0, 0 } }, // FX_SPARKLE4
{ { 1, 0, 0, 0, 96, 2, 0 }, { 0, 0, 0, 0, SPRITE_SPECIALFX_1, 0, 0 } }, // FX_27
{ { 1, 0, 0, 0, 154, 2, 0 }, { 3, 0, 0, 0, SPRITE_SPECIALFX, 0, 0 } }, // FX_SLOW_EXPLOSION
{ { 1, 0, 0, 0, 113, 0, 0 }, { 71, 0, 0, 0, SPRITE_SPECIALFX_1, 0, 0 } }, // FX_CONFETTI

View File

@ -248,7 +248,7 @@ void CreateSparkle(Entity* entity) {
s32 y;
s32 x;
sparkle = CreateObject(SPECIAL_FX, 0x26, 0);
sparkle = CreateObject(SPECIAL_FX, FX_SPARKLE4, 0);
if (sparkle != NULL) {
rand = Random();
x = rand & 0xf;

View File

@ -368,7 +368,7 @@ static void LoadDestructibleTile(TileEntity* tile) {
void sub_0804B388(u32 a1, u32 a2) {
Entity* e;
SetTileType(a2 == 1 ? 38 : 52, a1, a2);
e = CreateObject(SPECIAL_FX, 2, 0);
e = CreateObject(SPECIAL_FX, FX_DEATH, 0);
if (e != NULL) {
e->collisionLayer = a2;
sub_0806F704(e, a1);

View File

@ -998,12 +998,12 @@ void sub_0804BF38(Entity* this, ScriptExecutionContext* context) {
numEnts = ptr->entCnt;
for (entCnt = 0; entCnt < numEnts; entCnt++) {
fx = CreateObject(SPECIAL_FX, 0xf, 0);
fx = CreateObject(SPECIAL_FX, FX_ROCK_SMALL, 0);
if (fx != NULL) {
fx->x.HALF.HI = ptr->x + gRoomControls.origin_x + entCnt * 0x10;
fx->y.HALF.HI = ptr->y + gRoomControls.origin_y + (entCnt & 1) * 8;
}
fx = CreateObject(SPECIAL_FX, 0x54, 0);
fx = CreateObject(SPECIAL_FX, FX_WHITE_PUFF, 0);
if (fx != NULL) {
fx->x.HALF.HI = ptr->x + gRoomControls.origin_x + entCnt * 0x10;
fx->y.HALF.HI = ptr->y + gRoomControls.origin_y + -0xc + (entCnt & 1) * 8;