mirror of
https://github.com/Xeeynamo/sotn-decomp.git
synced 2024-11-23 13:09:44 +00:00
Dedupe EntityEnemyBlood (#487)
This commit is contained in:
parent
5af85580ed
commit
9c33911758
@ -100,3 +100,5 @@ D_80072EB4 = 0x80072EB4;
|
||||
D_80096ED0 = 0x80096ED0;
|
||||
|
||||
g_InitializeEntityData0 = 0x80180508;
|
||||
g_InitializeData0 = 0x801804FC;
|
||||
UnkEntityFunc0 = 0x80192A34;
|
||||
|
@ -1,5 +1,6 @@
|
||||
g_SpriteBanks = 0x80180040;
|
||||
PfnEntityUpdates = 0x80180394;
|
||||
g_InitializeData0 = 0x80180410;
|
||||
g_InitializeEntityData0 = 0x8018041C;
|
||||
UNK_Invincibility0 = 0x801807B8;
|
||||
g_Rooms = 0x801812D4;
|
||||
@ -33,6 +34,7 @@ GetSideToPlayer = 0x801945D4;
|
||||
MoveEntity = 0x80194618;
|
||||
FallEntity = 0x80194648;
|
||||
AllocEntity = 0x80194AD4;
|
||||
UnkEntityFunc0 = 0x80194D08;
|
||||
SetStep = 0x80194EA4;
|
||||
InitializeEntity = 0x80194F74;
|
||||
CollectHeart = 0x801958F4;
|
||||
|
@ -1,6 +1,7 @@
|
||||
g_SpriteBanks = 0x80180040;
|
||||
PfnEntityUpdates = 0x801803C8;
|
||||
g_eBreakableInit = 0x80180458;
|
||||
g_InitializeData0 = 0x80180464;
|
||||
g_InitializeEntityData0 = 0x80180470;
|
||||
g_eBreakableAnimations = 0x80180610;
|
||||
g_eBreakableHitboxes = 0x80180630;
|
||||
@ -48,6 +49,7 @@ GetSideToPlayer = 0x8019A718;
|
||||
MoveEntity = 0x8019A75C;
|
||||
FallEntity = 0x8019A78C;
|
||||
AllocEntity = 0x8019AC18;
|
||||
UnkEntityFunc0 = 0x8019AE4C;
|
||||
SetStep = 0x8019AFE8;
|
||||
SetSubStep = 0x8019B008;
|
||||
InitializeEntity = 0x8019B0B8;
|
||||
|
@ -2,6 +2,7 @@ g_SpriteBanks = 0x80180040;
|
||||
g_pStObjLayout = 0x8018077C;
|
||||
PfnEntityUpdates = 0x80180924;
|
||||
g_eBreakableInit = 0x80180AAC;
|
||||
g_InitializeData0 = 0x80180AB8;
|
||||
g_InitializeEntityData0 = 0x80180AC4;
|
||||
g_eBreakableAnimations = 0x80180E50;
|
||||
g_eBreakableHitboxes = 0x80180E70;
|
||||
@ -81,6 +82,7 @@ GetSideToPlayer = 0x801C4FD4;
|
||||
MoveEntity = 0x801C5018;
|
||||
FallEntity = 0x801C5048;
|
||||
AllocEntity = 0x801C54D4;
|
||||
UnkEntityFunc0 = 0x801C5708;
|
||||
SetStep = 0x801C58A4;
|
||||
InitializeEntity = 0x801C5974;
|
||||
EntityDummy = 0x801C5A70;
|
||||
|
@ -2,6 +2,7 @@ g_SpriteBanks = 0x80180040;
|
||||
g_pStObjLayout = 0x80180728;
|
||||
PfnEntityUpdates = 0x801808D0;
|
||||
g_eBreakableInit = 0x80180A3C;
|
||||
g_InitializeData0 = 0x80180A48;
|
||||
g_InitializeEntityData0 = 0x80180A54;
|
||||
g_eBreakableAnimations = 0x80180E28;
|
||||
g_eBreakableHitboxes = 0x80180E48;
|
||||
@ -56,6 +57,7 @@ GetSideToPlayer = 0x801BC844;
|
||||
MoveEntity = 0x801BC888;
|
||||
FallEntity = 0x801BC8B8;
|
||||
AllocEntity = 0x801BCD44;
|
||||
UnkEntityFunc0 = 0x801BCF78;
|
||||
SetStep = 0x801BD114;
|
||||
SetSubStep = 0x801BD134;
|
||||
InitializeEntity = 0x801BD1E4;
|
||||
|
@ -4,6 +4,7 @@ g_Cluts = 0x80180160;
|
||||
g_TileLayers = 0x80180394;
|
||||
g_EntityGfxs = 0x80180888;
|
||||
PfnEntityUpdates = 0x80180A94;
|
||||
g_InitializeData0 = 0x80180BD4;
|
||||
g_InitializeEntityData0 = 0x80180BE0;
|
||||
g_CallElevator = 0x80180EEC;
|
||||
g_BossFlag = 0x80181010;
|
||||
@ -93,6 +94,7 @@ GetSideToPlayer = 0x801BCC5C;
|
||||
MoveEntity = 0x801BCCA0;
|
||||
FallEntity = 0x801BCCD0;
|
||||
AllocEntity = 0x801BD15C;
|
||||
UnkEntityFunc0 = 0x801BD390;
|
||||
SetStep = 0x801BD52C;
|
||||
SetSubStep = 0x801BD54C;
|
||||
InitializeEntity = 0x801BD5FC;
|
||||
|
@ -1,5 +1,6 @@
|
||||
g_SpriteBanks = 0x80180040;
|
||||
PfnEntityUpdates = 0x801803E4;
|
||||
g_InitializeData0 = 0x8018044C;
|
||||
g_InitializeEntityData0 = 0x80180458;
|
||||
UNK_Invincibility0 = 0x80180690;
|
||||
g_Rooms = 0x801811AC;
|
||||
@ -15,6 +16,7 @@ DestroyEntity = 0x8018D580;
|
||||
PreventEntityFromRespawning = 0x8018D668;
|
||||
MoveEntity = 0x8018D934;
|
||||
FallEntity = 0x8018D964;
|
||||
UnkEntityFunc0 = 0x8018E024;
|
||||
SetStep = 0x8018E1C0;
|
||||
InitializeEntity = 0x8018E290;
|
||||
ReplaceBreakableWithItemDrop = 0x8018E978;
|
||||
@ -24,6 +26,7 @@ EntityEquipItemDrop = 0x8018F9B4;
|
||||
EntityIntenseExplosion = 0x80192248;
|
||||
ClutLerp = 0x8019344C;
|
||||
EntitySoulStealOrb = 0x80194590;
|
||||
EntityEnemyBlood = 0x80194924;
|
||||
func_801951F0 = 0x801951F0;
|
||||
UnkLoopFunc = 0x801959BC;
|
||||
UNK_Update0 = 0x801966A8;
|
||||
|
@ -1,5 +1,6 @@
|
||||
g_SpriteBanks = 0x80180040;
|
||||
PfnEntityUpdates = 0x801804BC;
|
||||
g_InitializeData0 = 0x80180580;
|
||||
g_InitializeEntityData0 = 0x8018058C;
|
||||
g_isSecretStairsButtonPressed = 0x8018089C;
|
||||
g_isDraculaFirstFormDefeated = 0x8018090C;
|
||||
@ -48,6 +49,7 @@ GetSideToPlayer = 0x801B4C78;
|
||||
MoveEntity = 0x801B4CBC;
|
||||
FallEntity = 0x801B4CEC;
|
||||
AllocEntity = 0x801B53CC;
|
||||
UnkEntityFunc0 = 0x801B5600;
|
||||
SetStep = 0x801B5794;
|
||||
SetSubStep = 0x801B57B4;
|
||||
InitializeEntity = 0x801B584C;
|
||||
|
@ -5,6 +5,7 @@ g_EntityGfxs = 0x801801EC;
|
||||
g_pStObjLayout = 0x8018023C;
|
||||
PfnEntityUpdates = 0x801803E4;
|
||||
g_eBreakableInit = 0x80180440;
|
||||
g_InitializeData0 = 0x8018044C;
|
||||
g_eBreakableAnimations = 0x801805B8;
|
||||
g_eBreakableHitboxes = 0x801805D8;
|
||||
g_eBreakableExplosionTypes = 0x801805E0;
|
||||
@ -88,6 +89,7 @@ GetSideToPlayer = 0x8018B970;
|
||||
MoveEntity = 0x8018B9B4;
|
||||
FallEntity = 0x8018B9E4;
|
||||
AllocEntity = 0x8018BE70;
|
||||
UnkEntityFunc0 = 0x8018C0A4;
|
||||
SetStep = 0x8018C240;
|
||||
InitializeEntity = 0x8018C310;
|
||||
EntityDummy = 0x8018C40C;
|
||||
|
@ -557,7 +557,7 @@ u8 func_80194CB0(u8 arg0, u8 arg1, u8 arg2) {
|
||||
return arg2;
|
||||
}
|
||||
|
||||
void func_80194D08(s32 slope, s16 speed) {
|
||||
void UnkEntityFunc0(s32 slope, s16 speed) {
|
||||
Entity* entity;
|
||||
s32 moveX;
|
||||
s32 moveY;
|
||||
|
@ -16,7 +16,7 @@ void EntitySoulStealOrb(Entity* self) {
|
||||
DestroyEntity(self);
|
||||
return;
|
||||
}
|
||||
InitializeEntity(D_80180410);
|
||||
InitializeEntity(g_InitializeData0);
|
||||
D_8008701E[primIndex * 0x1a] = 8;
|
||||
self->primIndex = primIndex;
|
||||
self->animSet = ANIMSET_DRA(0);
|
||||
@ -63,8 +63,8 @@ void EntitySoulStealOrb(Entity* self) {
|
||||
self->ext.soulStealOrb.angle = func_80194E44(
|
||||
self->ext.soulStealOrb.unk7E, self->ext.soulStealOrb.angle,
|
||||
func_80194DC4(self, &PLAYER));
|
||||
func_80194D08(self->ext.soulStealOrb.angle & 0xFFFF,
|
||||
self->ext.soulStealOrb.unk80);
|
||||
UnkEntityFunc0(self->ext.soulStealOrb.angle & 0xFFFF,
|
||||
self->ext.soulStealOrb.unk80);
|
||||
MoveEntity(self); // argument pass necessary to match
|
||||
prim = &g_PrimBuf[self->primIndex];
|
||||
func_80194394(&D_80181238, self);
|
||||
@ -86,152 +86,7 @@ void EntitySoulStealOrb(Entity* self) {
|
||||
}
|
||||
}
|
||||
|
||||
void EntityEnemyBlood(Entity* self) {
|
||||
int fakeTemp; // !TODO: !FAKE
|
||||
Primitive* prim;
|
||||
s32 var_a0_2;
|
||||
u16 params;
|
||||
s16 posX;
|
||||
s32 rnd;
|
||||
s32 i;
|
||||
|
||||
switch (self->step) {
|
||||
case 0:
|
||||
i = g_api.func_800EDB58(17, 12);
|
||||
if (i != -1) {
|
||||
InitializeEntity(D_80180410);
|
||||
prim = &g_PrimBuf[i];
|
||||
self->primIndex = i;
|
||||
self->animSet = ANIMSET_DRA(0);
|
||||
params = self->params;
|
||||
self->hitboxState = 1;
|
||||
self->ext.generic.unk7C.s = 48;
|
||||
self->hitboxHeight = 8;
|
||||
self->zPriority = 0xC0;
|
||||
self->hitboxWidth = 0;
|
||||
self->flags |= FLAG_HAS_PRIMS;
|
||||
|
||||
for (i = 12; i != 0;) {
|
||||
prim->x0 = self->posX.i.hi + ((Random() & (fakeTemp = 7)) - 5);
|
||||
rnd = (Random() & 7) - 5;
|
||||
prim->y0 = self->posY.i.hi + rnd;
|
||||
*(s32*)&prim->r1 = 0;
|
||||
*(s32*)&prim->x1 = 0;
|
||||
prim->u0 = 4;
|
||||
prim->v0 = 4;
|
||||
|
||||
if (params != 0) {
|
||||
func_80194D08(
|
||||
0xCC0 + i * 64, ((Random() & 0xF) * 0x10) + 0x180);
|
||||
} else {
|
||||
func_80194D08(
|
||||
0xB40 - i * 64, ((Random() & 0xF) * 0x10) + 0x180);
|
||||
}
|
||||
|
||||
*(s32*)&prim->u1 = self->velocityX;
|
||||
*(s32*)&prim->r2 = self->velocityY;
|
||||
|
||||
var_a0_2 = *(s32*)&prim->u1;
|
||||
if (var_a0_2 <= -1) {
|
||||
var_a0_2 += 0x3F;
|
||||
}
|
||||
|
||||
*(s32*)&prim->r3 = -(var_a0_2 >> 6);
|
||||
*(s32*)&prim->x3 = -(*(s32*)&prim->r2 / 48) + 0xC00;
|
||||
|
||||
prim->x2 = prim->y2 = (Random() & 7) + 7;
|
||||
prim->r0 = 128;
|
||||
prim->b0 = 16;
|
||||
prim->g0 = 0;
|
||||
prim->priority = self->zPriority;
|
||||
prim->blendMode = 2;
|
||||
i--;
|
||||
if (i != 0) {
|
||||
prim++;
|
||||
}
|
||||
}
|
||||
|
||||
if (params != 0) {
|
||||
self->velocityX = FIX(1.25);
|
||||
self->ext.generic.unk80.modeS32 = -0x200;
|
||||
} else {
|
||||
self->velocityX = FIX(-1.25);
|
||||
self->ext.generic.unk80.modeS32 = 0x200;
|
||||
}
|
||||
self->velocityY = 0;
|
||||
break;
|
||||
}
|
||||
DestroyEntity(self);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (!(--self->ext.generic.unk7C.u)) {
|
||||
DestroyEntity(self);
|
||||
break;
|
||||
}
|
||||
|
||||
if (self->hitboxState != 0) {
|
||||
if (g_Player.unk0C & 0x02000000) {
|
||||
posX = self->posX.i.hi;
|
||||
self->velocityX += self->ext.generic.unk80.modeS32;
|
||||
|
||||
MoveEntity(self); // argument pass necessary to match
|
||||
|
||||
posX -= self->posX.i.hi;
|
||||
if (posX < 0) {
|
||||
posX = -posX;
|
||||
}
|
||||
|
||||
if (self->ext.generic.unk7C.u > 16) {
|
||||
self->ext.generic.unk7E.modeU16 += posX;
|
||||
self->hitboxWidth = self->ext.generic.unk7E.modeU16 / 2;
|
||||
self->hitboxHeight =
|
||||
(self->ext.generic.unk7E.modeU16 / 4) + 8;
|
||||
} else {
|
||||
self->hitboxState = 0;
|
||||
}
|
||||
|
||||
if (self->hitFlags != 0) {
|
||||
if (g_Player.unk56 == 0) {
|
||||
g_Player.unk56 = 1;
|
||||
g_Player.unk58 = 8;
|
||||
if (g_api.CheckEquipmentItemCount(
|
||||
ITEM_BLOODSTONE, ACCESSORY_TYPE)) {
|
||||
g_Player.unk58 *= 2;
|
||||
}
|
||||
}
|
||||
g_Player.unk10++;
|
||||
self->hitboxState = 0;
|
||||
}
|
||||
} else {
|
||||
self->hitboxState = 0;
|
||||
}
|
||||
}
|
||||
|
||||
prim = &g_PrimBuf[self->primIndex];
|
||||
for (i = 12; i != 0; i--, prim++) {
|
||||
*(u16*)&prim->b1 = prim->x0;
|
||||
prim->y1 = prim->y0;
|
||||
*(s32*)&prim->u1 += *(s32*)&prim->r3;
|
||||
*(s32*)&prim->r2 += *(s32*)&prim->x3;
|
||||
*(s32*)&prim->r1 += *(s32*)&prim->u1;
|
||||
*(s32*)&prim->x1 += *(s32*)&prim->r2;
|
||||
*(s16*)&prim->x0 = *(s16*)&prim->b1;
|
||||
prim->y0 = prim->y1;
|
||||
prim->x2--;
|
||||
|
||||
if ((prim->x2 == 0) && (prim->u0 != 0)) {
|
||||
prim->v0--;
|
||||
prim->u0--;
|
||||
if (!(prim->u0 & 1)) {
|
||||
prim->x0++;
|
||||
prim->y0++;
|
||||
}
|
||||
prim->x2 = *(s32*)&prim->y2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#include "../entity_enemy_blood.h"
|
||||
|
||||
void EntityUnkId08(Entity* entity) {
|
||||
ObjInit2* objInit = &D_8018125C[entity->params];
|
||||
|
@ -46,7 +46,7 @@ extern PfnEntityUpdate PfnEntityUpdates[];
|
||||
|
||||
/*** Initializers ***/
|
||||
extern u16 D_80180404[];
|
||||
extern u16 D_80180410[];
|
||||
extern u16 g_InitializeData0[];
|
||||
extern u16 D_80180428[];
|
||||
extern u16 D_80180434[]; // EntityPlatform
|
||||
extern u16 D_80180458[];
|
||||
|
@ -543,7 +543,7 @@ u8 func_8019ADF4(u8 arg0, u8 arg1, u8 arg2) {
|
||||
return arg2;
|
||||
}
|
||||
|
||||
void func_8019AE4C(u16 slope, s16 speed) {
|
||||
void UnkEntityFunc0(u16 slope, s16 speed) {
|
||||
Entity* entity;
|
||||
s32 moveX;
|
||||
s32 moveY;
|
||||
|
@ -31,7 +31,7 @@ void EntityEquipItemDrop(Entity* self) {
|
||||
EntityPrizeDrop(self);
|
||||
return;
|
||||
}
|
||||
InitializeEntity(D_80180464);
|
||||
InitializeEntity(g_InitializeData0);
|
||||
self->ext.generic.unk7C.s = 0;
|
||||
break;
|
||||
|
||||
@ -744,7 +744,7 @@ void EntitySoulStealOrb(Entity* self) {
|
||||
DestroyEntity(self);
|
||||
return;
|
||||
}
|
||||
InitializeEntity(D_80180464);
|
||||
InitializeEntity(g_InitializeData0);
|
||||
D_8008701E[primIndex * 0x1a] = 8;
|
||||
self->primIndex = primIndex;
|
||||
self->animSet = ANIMSET_DRA(0);
|
||||
@ -791,8 +791,8 @@ void EntitySoulStealOrb(Entity* self) {
|
||||
self->ext.soulStealOrb.angle = func_8019AF88(
|
||||
self->ext.soulStealOrb.unk7E, (u16)self->ext.soulStealOrb.angle,
|
||||
0xffff & func_8019AF08(self, &PLAYER));
|
||||
func_8019AE4C(self->ext.soulStealOrb.angle & 0xFFFF,
|
||||
self->ext.soulStealOrb.unk80);
|
||||
UnkEntityFunc0(self->ext.soulStealOrb.angle & 0xFFFF,
|
||||
self->ext.soulStealOrb.unk80);
|
||||
MoveEntity(self); // argument pass necessary to match
|
||||
prim = &g_PrimBuf[self->primIndex];
|
||||
AnimateEntity(&D_801813FC, self);
|
||||
@ -815,152 +815,7 @@ void EntitySoulStealOrb(Entity* self) {
|
||||
}
|
||||
|
||||
// ID 0x0D
|
||||
void EntityEnemyBlood(Entity* self) {
|
||||
int fakeTemp; // !TODO: !FAKE
|
||||
Primitive* prim;
|
||||
s32 var_a0_2;
|
||||
u16 params;
|
||||
s16 posX;
|
||||
s32 rnd;
|
||||
s32 i;
|
||||
|
||||
switch (self->step) {
|
||||
case 0:
|
||||
i = g_api.func_800EDB58(17, 12);
|
||||
if (i != -1) {
|
||||
InitializeEntity(D_80180464);
|
||||
prim = &g_PrimBuf[i];
|
||||
self->primIndex = i;
|
||||
self->animSet = ANIMSET_DRA(0);
|
||||
params = self->params;
|
||||
self->hitboxState = 1;
|
||||
self->ext.generic.unk7C.s = 48;
|
||||
self->hitboxHeight = 8;
|
||||
self->zPriority = 0xC0;
|
||||
self->hitboxWidth = 0;
|
||||
self->flags |= FLAG_HAS_PRIMS;
|
||||
|
||||
for (i = 12; i != 0;) {
|
||||
prim->x0 = self->posX.i.hi + ((Random() & (fakeTemp = 7)) - 5);
|
||||
rnd = (Random() & 7) - 5;
|
||||
prim->y0 = self->posY.i.hi + rnd;
|
||||
*(s32*)&prim->r1 = 0;
|
||||
*(s32*)&prim->x1 = 0;
|
||||
prim->u0 = 4;
|
||||
prim->v0 = 4;
|
||||
|
||||
if (params != 0) {
|
||||
func_8019AE4C(
|
||||
0xCC0 + i * 64, ((Random() & 0xF) * 0x10) + 0x180);
|
||||
} else {
|
||||
func_8019AE4C(
|
||||
0xB40 - i * 64, ((Random() & 0xF) * 0x10) + 0x180);
|
||||
}
|
||||
|
||||
*(s32*)&prim->u1 = self->velocityX;
|
||||
*(s32*)&prim->r2 = self->velocityY;
|
||||
|
||||
var_a0_2 = *(s32*)&prim->u1;
|
||||
if (var_a0_2 <= -1) {
|
||||
var_a0_2 += 0x3F;
|
||||
}
|
||||
|
||||
*(s32*)&prim->r3 = -(var_a0_2 >> 6);
|
||||
*(s32*)&prim->x3 = -(*(s32*)&prim->r2 / 48) + 0xC00;
|
||||
|
||||
prim->x2 = prim->y2 = (Random() & 7) + 7;
|
||||
prim->r0 = 128;
|
||||
prim->b0 = 16;
|
||||
prim->g0 = 0;
|
||||
prim->priority = self->zPriority;
|
||||
prim->blendMode = 2;
|
||||
i--;
|
||||
if (i != 0) {
|
||||
prim++;
|
||||
}
|
||||
}
|
||||
|
||||
if (params != 0) {
|
||||
self->velocityX = FIX(1.25);
|
||||
self->ext.generic.unk80.modeS32 = -0x200;
|
||||
} else {
|
||||
self->velocityX = FIX(-1.25);
|
||||
self->ext.generic.unk80.modeS32 = 0x200;
|
||||
}
|
||||
self->velocityY = 0;
|
||||
break;
|
||||
}
|
||||
DestroyEntity(self);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (!(--self->ext.generic.unk7C.u)) {
|
||||
DestroyEntity(self);
|
||||
break;
|
||||
}
|
||||
|
||||
if (self->hitboxState != 0) {
|
||||
if (g_Player.unk0C & 0x02000000) {
|
||||
posX = self->posX.i.hi;
|
||||
self->velocityX += self->ext.generic.unk80.modeS32;
|
||||
|
||||
MoveEntity(self); // argument pass necessary to match
|
||||
|
||||
posX -= self->posX.i.hi;
|
||||
if (posX < 0) {
|
||||
posX = -posX;
|
||||
}
|
||||
|
||||
if (self->ext.generic.unk7C.u > 16) {
|
||||
self->ext.generic.unk7E.modeU16 += posX;
|
||||
self->hitboxWidth = self->ext.generic.unk7E.modeU16 / 2;
|
||||
self->hitboxHeight =
|
||||
(self->ext.generic.unk7E.modeU16 / 4) + 8;
|
||||
} else {
|
||||
self->hitboxState = 0;
|
||||
}
|
||||
|
||||
if (self->hitFlags != 0) {
|
||||
if (g_Player.unk56 == 0) {
|
||||
g_Player.unk56 = 1;
|
||||
g_Player.unk58 = 8;
|
||||
if (g_api.CheckEquipmentItemCount(
|
||||
ITEM_BLOODSTONE, ACCESSORY_TYPE)) {
|
||||
g_Player.unk58 *= 2;
|
||||
}
|
||||
}
|
||||
g_Player.unk10++;
|
||||
self->hitboxState = 0;
|
||||
}
|
||||
} else {
|
||||
self->hitboxState = 0;
|
||||
}
|
||||
}
|
||||
|
||||
prim = &g_PrimBuf[self->primIndex];
|
||||
for (i = 12; i != 0; i--, prim++) {
|
||||
*(u16*)&prim->b1 = prim->x0;
|
||||
prim->y1 = prim->y0;
|
||||
*(s32*)&prim->u1 += *(s32*)&prim->r3;
|
||||
*(s32*)&prim->r2 += *(s32*)&prim->x3;
|
||||
*(s32*)&prim->r1 += *(s32*)&prim->u1;
|
||||
*(s32*)&prim->x1 += *(s32*)&prim->r2;
|
||||
*(s16*)&prim->x0 = *(s16*)&prim->b1;
|
||||
prim->y0 = prim->y1;
|
||||
prim->x2--;
|
||||
|
||||
if ((prim->x2 == 0) && (prim->u0 != 0)) {
|
||||
prim->v0--;
|
||||
prim->u0--;
|
||||
if (!(prim->u0 & 1)) {
|
||||
prim->x0++;
|
||||
prim->y0++;
|
||||
}
|
||||
prim->x2 = *(s32*)&prim->y2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#include "../entity_enemy_blood.h"
|
||||
|
||||
extern ObjInit2 D_80181420[];
|
||||
void EntityRoomForeground(Entity* entity) {
|
||||
|
@ -49,7 +49,7 @@ LayoutEntity* D_80180220[];
|
||||
LayoutEntity* D_801802F4[];
|
||||
|
||||
/* *** Initializers *** */
|
||||
extern u16 D_80180464[];
|
||||
extern u16 g_InitializeData0[];
|
||||
extern u16 D_80180488[]; // EntityBackgroundClouds
|
||||
extern u16 D_80180494[];
|
||||
extern u16 D_801804A0[];
|
||||
|
146
src/st/entity_enemy_blood.h
Normal file
146
src/st/entity_enemy_blood.h
Normal file
@ -0,0 +1,146 @@
|
||||
void EntityEnemyBlood(Entity* self) {
|
||||
int fakeTemp; // !TODO: !FAKE
|
||||
Primitive* prim;
|
||||
s32 var_a0_2;
|
||||
u16 params;
|
||||
s16 posX;
|
||||
s32 rnd;
|
||||
s32 i;
|
||||
|
||||
switch (self->step) {
|
||||
case 0:
|
||||
i = g_api.func_800EDB58(17, 12);
|
||||
if (i != -1) {
|
||||
InitializeEntity(g_InitializeData0);
|
||||
prim = &g_PrimBuf[i];
|
||||
self->primIndex = i;
|
||||
self->animSet = ANIMSET_DRA(0);
|
||||
params = self->params;
|
||||
self->hitboxState = 1;
|
||||
self->ext.generic.unk7C.s = 48;
|
||||
self->hitboxHeight = 8;
|
||||
self->zPriority = 0xC0;
|
||||
self->hitboxWidth = 0;
|
||||
self->flags |= FLAG_HAS_PRIMS;
|
||||
|
||||
for (i = 12; i != 0;) {
|
||||
prim->x0 = self->posX.i.hi + ((Random() & (fakeTemp = 7)) - 5);
|
||||
rnd = (Random() & 7) - 5;
|
||||
prim->y0 = self->posY.i.hi + rnd;
|
||||
*(s32*)&prim->r1 = 0;
|
||||
*(s32*)&prim->x1 = 0;
|
||||
prim->u0 = 4;
|
||||
prim->v0 = 4;
|
||||
|
||||
if (params != 0) {
|
||||
UnkEntityFunc0(
|
||||
0xCC0 + i * 64, ((Random() & 0xF) * 0x10) + 0x180);
|
||||
} else {
|
||||
UnkEntityFunc0(
|
||||
0xB40 - i * 64, ((Random() & 0xF) * 0x10) + 0x180);
|
||||
}
|
||||
|
||||
*(s32*)&prim->u1 = self->velocityX;
|
||||
*(s32*)&prim->r2 = self->velocityY;
|
||||
|
||||
var_a0_2 = *(s32*)&prim->u1;
|
||||
if (var_a0_2 <= -1) {
|
||||
var_a0_2 += 0x3F;
|
||||
}
|
||||
|
||||
*(s32*)&prim->r3 = -(var_a0_2 >> 6);
|
||||
*(s32*)&prim->x3 = -(*(s32*)&prim->r2 / 48) + 0xC00;
|
||||
|
||||
prim->x2 = prim->y2 = (Random() & 7) + 7;
|
||||
prim->r0 = 128;
|
||||
prim->b0 = 16;
|
||||
prim->g0 = 0;
|
||||
prim->priority = self->zPriority;
|
||||
prim->blendMode = 2;
|
||||
i--;
|
||||
if (i != 0) {
|
||||
prim++;
|
||||
}
|
||||
}
|
||||
|
||||
if (params != 0) {
|
||||
self->velocityX = FIX(1.25);
|
||||
self->ext.generic.unk80.modeS32 = -0x200;
|
||||
} else {
|
||||
self->velocityX = FIX(-1.25);
|
||||
self->ext.generic.unk80.modeS32 = 0x200;
|
||||
}
|
||||
self->velocityY = 0;
|
||||
break;
|
||||
}
|
||||
DestroyEntity(self);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (!(--self->ext.generic.unk7C.u)) {
|
||||
DestroyEntity(self);
|
||||
break;
|
||||
}
|
||||
|
||||
if (self->hitboxState != 0) {
|
||||
if (g_Player.unk0C & 0x02000000) {
|
||||
posX = self->posX.i.hi;
|
||||
self->velocityX += self->ext.generic.unk80.modeS32;
|
||||
|
||||
MoveEntity(self); // argument pass necessary to match
|
||||
|
||||
posX -= self->posX.i.hi;
|
||||
if (posX < 0) {
|
||||
posX = -posX;
|
||||
}
|
||||
|
||||
if (self->ext.generic.unk7C.u > 16) {
|
||||
self->ext.generic.unk7E.modeU16 += posX;
|
||||
self->hitboxWidth = self->ext.generic.unk7E.modeU16 / 2;
|
||||
self->hitboxHeight =
|
||||
(self->ext.generic.unk7E.modeU16 / 4) + 8;
|
||||
} else {
|
||||
self->hitboxState = 0;
|
||||
}
|
||||
|
||||
if (self->hitFlags != 0) {
|
||||
if (g_Player.unk56 == 0) {
|
||||
g_Player.unk56 = 1;
|
||||
g_Player.unk58 = 8;
|
||||
if (g_api.CheckEquipmentItemCount(
|
||||
ITEM_BLOODSTONE, ACCESSORY_TYPE)) {
|
||||
g_Player.unk58 *= 2;
|
||||
}
|
||||
}
|
||||
g_Player.unk10++;
|
||||
self->hitboxState = 0;
|
||||
}
|
||||
} else {
|
||||
self->hitboxState = 0;
|
||||
}
|
||||
}
|
||||
|
||||
prim = &g_PrimBuf[self->primIndex];
|
||||
for (i = 12; i != 0; i--, prim++) {
|
||||
*(u16*)&prim->b1 = prim->x0;
|
||||
prim->y1 = prim->y0;
|
||||
*(s32*)&prim->u1 += *(s32*)&prim->r3;
|
||||
*(s32*)&prim->r2 += *(s32*)&prim->x3;
|
||||
*(s32*)&prim->r1 += *(s32*)&prim->u1;
|
||||
*(s32*)&prim->x1 += *(s32*)&prim->r2;
|
||||
*(s16*)&prim->x0 = *(s16*)&prim->b1;
|
||||
prim->y0 = prim->y1;
|
||||
prim->x2--;
|
||||
|
||||
if ((prim->x2 == 0) && (prim->u0 != 0)) {
|
||||
prim->v0--;
|
||||
prim->u0--;
|
||||
if (!(prim->u0 & 1)) {
|
||||
prim->x0++;
|
||||
prim->y0++;
|
||||
}
|
||||
prim->x2 = *(s32*)&prim->y2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
#include "mad.h"
|
||||
|
||||
extern u16 D_801804FC[];
|
||||
extern u16 g_InitializeData0[];
|
||||
extern u16 D_80180D4C[];
|
||||
extern u8* D_80180DB0[];
|
||||
extern u16 D_80180E10[];
|
||||
@ -34,7 +34,7 @@ void EntityPrizeDrop(Entity* self) {
|
||||
|
||||
switch (self->step) {
|
||||
case 0:
|
||||
InitializeEntity(D_801804FC);
|
||||
InitializeEntity(g_InitializeData0);
|
||||
self->zPriority = g_zEntityCenter.S16.unk0 - 0x14;
|
||||
self->blendMode = 0;
|
||||
if (itemId >= 0x18) {
|
||||
@ -748,7 +748,7 @@ void EntitySoulStealOrb(Entity* self) {
|
||||
DestroyEntity(self);
|
||||
return;
|
||||
}
|
||||
InitializeEntity(D_801804FC);
|
||||
InitializeEntity(g_InitializeData0);
|
||||
D_8008701E[primIndex * 0x1a] = 8;
|
||||
self->primIndex = primIndex;
|
||||
self->animSet = ANIMSET_DRA(0);
|
||||
@ -795,8 +795,8 @@ void EntitySoulStealOrb(Entity* self) {
|
||||
self->ext.soulStealOrb.angle = func_80192B70(
|
||||
self->ext.soulStealOrb.unk7E, (u16)self->ext.soulStealOrb.angle,
|
||||
0xffff & func_80192AF0(self, &PLAYER));
|
||||
func_80192A34(self->ext.soulStealOrb.angle & 0xFFFF,
|
||||
self->ext.soulStealOrb.unk80);
|
||||
UnkEntityFunc0(self->ext.soulStealOrb.angle & 0xFFFF,
|
||||
self->ext.soulStealOrb.unk80);
|
||||
MoveEntity(self); // argument pass necessary to match
|
||||
prim = &g_PrimBuf[self->primIndex];
|
||||
AnimateEntity(&D_801810D8, self);
|
||||
@ -818,152 +818,7 @@ void EntitySoulStealOrb(Entity* self) {
|
||||
}
|
||||
}
|
||||
|
||||
void EntityEnemyBlood(Entity* self) {
|
||||
int fakeTemp; // !TODO: !FAKE
|
||||
Primitive* prim;
|
||||
s32 var_a0_2;
|
||||
u16 params;
|
||||
s16 posX;
|
||||
s32 rnd;
|
||||
s32 i;
|
||||
|
||||
switch (self->step) {
|
||||
case 0:
|
||||
i = g_api.func_800EDB58(17, 12);
|
||||
if (i != -1) {
|
||||
InitializeEntity(D_801804FC);
|
||||
prim = &g_PrimBuf[i];
|
||||
self->primIndex = i;
|
||||
self->animSet = ANIMSET_DRA(0);
|
||||
params = self->params;
|
||||
self->hitboxState = 1;
|
||||
self->ext.generic.unk7C.s = 48;
|
||||
self->hitboxHeight = 8;
|
||||
self->zPriority = 0xC0;
|
||||
self->hitboxWidth = 0;
|
||||
self->flags |= FLAG_HAS_PRIMS;
|
||||
|
||||
for (i = 12; i != 0;) {
|
||||
prim->x0 = self->posX.i.hi + ((Random() & (fakeTemp = 7)) - 5);
|
||||
rnd = (Random() & 7) - 5;
|
||||
prim->y0 = self->posY.i.hi + rnd;
|
||||
*(s32*)&prim->r1 = 0;
|
||||
*(s32*)&prim->x1 = 0;
|
||||
prim->u0 = 4;
|
||||
prim->v0 = 4;
|
||||
|
||||
if (params != 0) {
|
||||
func_80192A34(
|
||||
0xCC0 + i * 64, ((Random() & 0xF) * 0x10) + 0x180);
|
||||
} else {
|
||||
func_80192A34(
|
||||
0xB40 - i * 64, ((Random() & 0xF) * 0x10) + 0x180);
|
||||
}
|
||||
|
||||
*(s32*)&prim->u1 = self->velocityX;
|
||||
*(s32*)&prim->r2 = self->velocityY;
|
||||
|
||||
var_a0_2 = *(s32*)&prim->u1;
|
||||
if (var_a0_2 <= -1) {
|
||||
var_a0_2 += 0x3F;
|
||||
}
|
||||
|
||||
*(s32*)&prim->r3 = -(var_a0_2 >> 6);
|
||||
*(s32*)&prim->x3 = -(*(s32*)&prim->r2 / 48) + 0xC00;
|
||||
|
||||
prim->x2 = prim->y2 = (Random() & 7) + 7;
|
||||
prim->r0 = 128;
|
||||
prim->b0 = 16;
|
||||
prim->g0 = 0;
|
||||
prim->priority = self->zPriority;
|
||||
prim->blendMode = 2;
|
||||
i--;
|
||||
if (i != 0) {
|
||||
prim++;
|
||||
}
|
||||
}
|
||||
|
||||
if (params != 0) {
|
||||
self->velocityX = FIX(1.25);
|
||||
self->ext.generic.unk80.modeS32 = -0x200;
|
||||
} else {
|
||||
self->velocityX = FIX(-1.25);
|
||||
self->ext.generic.unk80.modeS32 = 0x200;
|
||||
}
|
||||
self->velocityY = 0;
|
||||
break;
|
||||
}
|
||||
DestroyEntity(self);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (!(--self->ext.generic.unk7C.u)) {
|
||||
DestroyEntity(self);
|
||||
break;
|
||||
}
|
||||
|
||||
if (self->hitboxState != 0) {
|
||||
if (g_Player.unk0C & 0x02000000) {
|
||||
posX = self->posX.i.hi;
|
||||
self->velocityX += self->ext.generic.unk80.modeS32;
|
||||
|
||||
MoveEntity(self); // argument pass necessary to match
|
||||
|
||||
posX -= self->posX.i.hi;
|
||||
if (posX < 0) {
|
||||
posX = -posX;
|
||||
}
|
||||
|
||||
if (self->ext.generic.unk7C.u > 16) {
|
||||
self->ext.generic.unk7E.modeU16 += posX;
|
||||
self->hitboxWidth = self->ext.generic.unk7E.modeU16 / 2;
|
||||
self->hitboxHeight =
|
||||
(self->ext.generic.unk7E.modeU16 / 4) + 8;
|
||||
} else {
|
||||
self->hitboxState = 0;
|
||||
}
|
||||
|
||||
if (self->hitFlags != 0) {
|
||||
if (g_Player.unk56 == 0) {
|
||||
g_Player.unk56 = 1;
|
||||
g_Player.unk58 = 8;
|
||||
if (g_api.CheckEquipmentItemCount(
|
||||
ITEM_BLOODSTONE, ACCESSORY_TYPE)) {
|
||||
g_Player.unk58 *= 2;
|
||||
}
|
||||
}
|
||||
g_Player.unk10++;
|
||||
self->hitboxState = 0;
|
||||
}
|
||||
} else {
|
||||
self->hitboxState = 0;
|
||||
}
|
||||
}
|
||||
|
||||
prim = &g_PrimBuf[self->primIndex];
|
||||
for (i = 12; i != 0; i--, prim++) {
|
||||
*(u16*)&prim->b1 = prim->x0;
|
||||
prim->y1 = prim->y0;
|
||||
*(s32*)&prim->u1 += *(s32*)&prim->r3;
|
||||
*(s32*)&prim->r2 += *(s32*)&prim->x3;
|
||||
*(s32*)&prim->r1 += *(s32*)&prim->u1;
|
||||
*(s32*)&prim->x1 += *(s32*)&prim->r2;
|
||||
*(s16*)&prim->x0 = *(s16*)&prim->b1;
|
||||
prim->y0 = prim->y1;
|
||||
prim->x2--;
|
||||
|
||||
if ((prim->x2 == 0) && (prim->u0 != 0)) {
|
||||
prim->v0--;
|
||||
prim->u0--;
|
||||
if (!(prim->u0 & 1)) {
|
||||
prim->x0++;
|
||||
prim->y0++;
|
||||
}
|
||||
prim->x2 = *(s32*)&prim->y2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#include "../entity_enemy_blood.h"
|
||||
|
||||
void EntityRoomForeground(Entity* entity) {
|
||||
ObjInit2* obj = &D_801810F4[entity->params];
|
||||
|
@ -542,7 +542,7 @@ u8 func_801929DC(u8 arg0, u8 arg1, u8 arg2) {
|
||||
return arg2;
|
||||
}
|
||||
|
||||
void func_80192A34(u16 slope, s16 speed) {
|
||||
void UnkEntityFunc0(u16 slope, s16 speed) {
|
||||
Entity* entity;
|
||||
s32 moveX;
|
||||
s32 moveY;
|
||||
|
@ -510,7 +510,7 @@ u8 func_801C56B0(u8 arg0, u8 arg1, u8 arg2) {
|
||||
}
|
||||
|
||||
// Duplicate
|
||||
void func_801C5708(u16 slope, s16 speed) {
|
||||
void UnkEntityFunc0(u16 slope, s16 speed) {
|
||||
Entity* entity;
|
||||
s32 moveX;
|
||||
s32 moveY;
|
||||
|
@ -21,7 +21,7 @@ void EntityPrizeDrop(Entity* self) {
|
||||
}
|
||||
switch (self->step) {
|
||||
case 0:
|
||||
InitializeEntity(D_80180AB8);
|
||||
InitializeEntity(g_InitializeData0);
|
||||
self->zPriority = g_zEntityCenter.S16.unk0 - 0x14;
|
||||
self->blendMode = 0;
|
||||
if (itemId >= 0x18) {
|
||||
@ -303,7 +303,7 @@ void EntityEquipItemDrop(Entity* self) {
|
||||
EntityPrizeDrop(self);
|
||||
return;
|
||||
}
|
||||
InitializeEntity(D_80180AB8);
|
||||
InitializeEntity(g_InitializeData0);
|
||||
self->ext.generic.unk7C.s = 0;
|
||||
break;
|
||||
|
||||
@ -1014,7 +1014,7 @@ void EntitySoulStealOrb(Entity* self) {
|
||||
DestroyEntity(self);
|
||||
return;
|
||||
}
|
||||
InitializeEntity(D_80180AB8);
|
||||
InitializeEntity(g_InitializeData0);
|
||||
D_8008701E[primIndex * 0x1a] = 8;
|
||||
self->primIndex = primIndex;
|
||||
self->animSet = ANIMSET_DRA(0);
|
||||
@ -1061,8 +1061,8 @@ void EntitySoulStealOrb(Entity* self) {
|
||||
self->ext.soulStealOrb.angle = func_801C5844(
|
||||
self->ext.soulStealOrb.unk7E, (u16)self->ext.soulStealOrb.angle,
|
||||
0xffff & func_801C57C4(self, &g_Entities[PLAYER_CHARACTER]));
|
||||
func_801C5708(self->ext.soulStealOrb.angle & 0xFFFF,
|
||||
self->ext.soulStealOrb.unk80);
|
||||
UnkEntityFunc0(self->ext.soulStealOrb.angle & 0xFFFF,
|
||||
self->ext.soulStealOrb.unk80);
|
||||
MoveEntity(self);
|
||||
prim = &g_PrimBuf[self->primIndex];
|
||||
AnimateEntity(&D_80182740, self);
|
||||
@ -1084,152 +1084,7 @@ void EntitySoulStealOrb(Entity* self) {
|
||||
}
|
||||
}
|
||||
|
||||
void EntityEnemyBlood(Entity* self) {
|
||||
int fakeTemp; // !TODO: !FAKE
|
||||
Primitive* prim;
|
||||
s32 var_a0_2;
|
||||
u16 params;
|
||||
s16 posX;
|
||||
s32 rnd;
|
||||
s32 i;
|
||||
|
||||
switch (self->step) {
|
||||
case 0:
|
||||
i = g_api.func_800EDB58(17, 12);
|
||||
if (i != -1) {
|
||||
InitializeEntity(D_80180AB8);
|
||||
prim = &g_PrimBuf[i];
|
||||
self->primIndex = i;
|
||||
self->animSet = ANIMSET_DRA(0);
|
||||
params = self->params;
|
||||
self->hitboxState = 1;
|
||||
self->ext.generic.unk7C.s = 48;
|
||||
self->hitboxHeight = 8;
|
||||
self->zPriority = 0xC0;
|
||||
self->hitboxWidth = 0;
|
||||
self->flags |= FLAG_HAS_PRIMS;
|
||||
|
||||
for (i = 12; i != 0;) {
|
||||
prim->x0 = self->posX.i.hi + ((Random() & (fakeTemp = 7)) - 5);
|
||||
rnd = (Random() & 7) - 5;
|
||||
prim->y0 = self->posY.i.hi + rnd;
|
||||
*(s32*)&prim->r1 = 0;
|
||||
*(s32*)&prim->x1 = 0;
|
||||
prim->u0 = 4;
|
||||
prim->v0 = 4;
|
||||
|
||||
if (params != 0) {
|
||||
func_801C5708(
|
||||
0xCC0 + i * 64, ((Random() & 0xF) * 0x10) + 0x180);
|
||||
} else {
|
||||
func_801C5708(
|
||||
0xB40 - i * 64, ((Random() & 0xF) * 0x10) + 0x180);
|
||||
}
|
||||
|
||||
*(s32*)&prim->u1 = self->velocityX;
|
||||
*(s32*)&prim->r2 = self->velocityY;
|
||||
|
||||
var_a0_2 = *(s32*)&prim->u1;
|
||||
if (var_a0_2 <= -1) {
|
||||
var_a0_2 += 0x3F;
|
||||
}
|
||||
|
||||
*(s32*)&prim->r3 = -(var_a0_2 >> 6);
|
||||
*(s32*)&prim->x3 = -(*(s32*)&prim->r2 / 48) + 0xC00;
|
||||
|
||||
prim->x2 = prim->y2 = (Random() & 7) + 7;
|
||||
prim->r0 = 128;
|
||||
prim->b0 = 16;
|
||||
prim->g0 = 0;
|
||||
prim->priority = self->zPriority;
|
||||
prim->blendMode = 2;
|
||||
i--;
|
||||
if (i != 0) {
|
||||
prim++;
|
||||
}
|
||||
}
|
||||
|
||||
if (params != 0) {
|
||||
self->velocityX = FIX(1.25);
|
||||
self->ext.generic.unk80.modeS32 = -0x200;
|
||||
} else {
|
||||
self->velocityX = FIX(-1.25);
|
||||
self->ext.generic.unk80.modeS32 = 0x200;
|
||||
}
|
||||
self->velocityY = 0;
|
||||
break;
|
||||
}
|
||||
DestroyEntity(self);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (!(--self->ext.generic.unk7C.u)) {
|
||||
DestroyEntity(self);
|
||||
break;
|
||||
}
|
||||
|
||||
if (self->hitboxState != 0) {
|
||||
if (g_Player.unk0C & 0x02000000) {
|
||||
posX = self->posX.i.hi;
|
||||
self->velocityX += self->ext.generic.unk80.modeS32;
|
||||
|
||||
MoveEntity(self); // argument pass necessary to match
|
||||
|
||||
posX -= self->posX.i.hi;
|
||||
if (posX < 0) {
|
||||
posX = -posX;
|
||||
}
|
||||
|
||||
if (self->ext.generic.unk7C.u > 16) {
|
||||
self->ext.generic.unk7E.modeU16 += posX;
|
||||
self->hitboxWidth = self->ext.generic.unk7E.modeU16 / 2;
|
||||
self->hitboxHeight =
|
||||
(self->ext.generic.unk7E.modeU16 / 4) + 8;
|
||||
} else {
|
||||
self->hitboxState = 0;
|
||||
}
|
||||
|
||||
if (self->hitFlags != 0) {
|
||||
if (g_Player.unk56 == 0) {
|
||||
g_Player.unk56 = 1;
|
||||
g_Player.unk58 = 8;
|
||||
if (g_api.CheckEquipmentItemCount(
|
||||
ITEM_BLOODSTONE, ACCESSORY_TYPE)) {
|
||||
g_Player.unk58 *= 2;
|
||||
}
|
||||
}
|
||||
g_Player.unk10++;
|
||||
self->hitboxState = 0;
|
||||
}
|
||||
} else {
|
||||
self->hitboxState = 0;
|
||||
}
|
||||
}
|
||||
|
||||
prim = &g_PrimBuf[self->primIndex];
|
||||
for (i = 12; i != 0; i--, prim++) {
|
||||
*(u16*)&prim->b1 = prim->x0;
|
||||
prim->y1 = prim->y0;
|
||||
*(s32*)&prim->u1 += *(s32*)&prim->r3;
|
||||
*(s32*)&prim->r2 += *(s32*)&prim->x3;
|
||||
*(s32*)&prim->r1 += *(s32*)&prim->u1;
|
||||
*(s32*)&prim->x1 += *(s32*)&prim->r2;
|
||||
*(s16*)&prim->x0 = *(s16*)&prim->b1;
|
||||
prim->y0 = prim->y1;
|
||||
prim->x2--;
|
||||
|
||||
if ((prim->x2 == 0) && (prim->u0 != 0)) {
|
||||
prim->v0--;
|
||||
prim->u0--;
|
||||
if (!(prim->u0 & 1)) {
|
||||
prim->x0++;
|
||||
prim->y0++;
|
||||
}
|
||||
prim->x2 = *(s32*)&prim->y2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#include "../entity_enemy_blood.h"
|
||||
|
||||
void EntityRoomForeground(Entity* entity) {
|
||||
ObjInit2* objInit = &D_80182764[entity->params];
|
||||
|
@ -31,7 +31,7 @@ extern void func_801C8C84(
|
||||
extern POLY_GT4* func_801D6DB8(POLY_GT4* poly);
|
||||
|
||||
LayoutEntity* D_80180850[];
|
||||
extern u16 D_80180AB8[];
|
||||
extern u16 g_InitializeData0[];
|
||||
extern u16 g_InitializeEntityData0[];
|
||||
extern u16 D_80180AD0[];
|
||||
extern u16 D_80180ADC[]; // Init EntityCastleDoor
|
||||
|
@ -557,7 +557,7 @@ u8 func_801BCF20(u8 arg0, u8 arg1, u8 arg2) {
|
||||
return arg2;
|
||||
}
|
||||
|
||||
void func_801BCF78(u16 slope, s16 speed) {
|
||||
void UnkEntityFunc0(u16 slope, s16 speed) {
|
||||
Entity* entity;
|
||||
s32 moveX;
|
||||
s32 moveY;
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "np3.h"
|
||||
|
||||
u16 D_80180A48[];
|
||||
u16 g_InitializeData0[];
|
||||
u16 D_80181DB0[];
|
||||
u8* D_80181E14[];
|
||||
u16 D_80181E74[];
|
||||
@ -25,7 +25,7 @@ void EntityPrizeDrop(Entity* self) {
|
||||
}
|
||||
switch (self->step) {
|
||||
case 0:
|
||||
InitializeEntity(D_80180A48);
|
||||
InitializeEntity(g_InitializeData0);
|
||||
self->zPriority = g_zEntityCenter.S16.unk0 - 0x14;
|
||||
self->blendMode = 0;
|
||||
if (itemId >= 0x18) {
|
||||
@ -307,7 +307,7 @@ void EntityEquipItemDrop(Entity* self) {
|
||||
EntityPrizeDrop(self);
|
||||
return;
|
||||
}
|
||||
InitializeEntity(D_80180A48);
|
||||
InitializeEntity(g_InitializeData0);
|
||||
self->ext.generic.unk7C.s = 0;
|
||||
break;
|
||||
|
||||
@ -1135,7 +1135,7 @@ void EntitySoulStealOrb(Entity* self) {
|
||||
DestroyEntity(self);
|
||||
return;
|
||||
}
|
||||
InitializeEntity(D_80180A48);
|
||||
InitializeEntity(g_InitializeData0);
|
||||
D_8008701E[primIndex * 0x1a] = 8;
|
||||
self->primIndex = primIndex;
|
||||
self->animSet = ANIMSET_DRA(0);
|
||||
@ -1182,8 +1182,8 @@ void EntitySoulStealOrb(Entity* self) {
|
||||
self->ext.soulStealOrb.angle = func_801BD0B4(
|
||||
self->ext.soulStealOrb.unk7E, (u16)self->ext.soulStealOrb.angle,
|
||||
0xffff & func_801BD034(self, &g_Entities[PLAYER_CHARACTER]));
|
||||
func_801BCF78(self->ext.soulStealOrb.angle & 0xFFFF,
|
||||
self->ext.soulStealOrb.unk80);
|
||||
UnkEntityFunc0(self->ext.soulStealOrb.angle & 0xFFFF,
|
||||
self->ext.soulStealOrb.unk80);
|
||||
MoveEntity(self);
|
||||
prim = &g_PrimBuf[self->primIndex];
|
||||
AnimateEntity(&D_801820CC, self);
|
||||
@ -1205,152 +1205,7 @@ void EntitySoulStealOrb(Entity* self) {
|
||||
}
|
||||
}
|
||||
|
||||
void EntityEnemyBlood(Entity* self) {
|
||||
int fakeTemp; // !TODO: !FAKE
|
||||
Primitive* prim;
|
||||
s32 var_a0_2;
|
||||
u16 params;
|
||||
s16 posX;
|
||||
s32 rnd;
|
||||
s32 i;
|
||||
|
||||
switch (self->step) {
|
||||
case 0:
|
||||
i = g_api.func_800EDB58(17, 12);
|
||||
if (i != -1) {
|
||||
InitializeEntity(D_80180A48);
|
||||
prim = &g_PrimBuf[i];
|
||||
self->primIndex = i;
|
||||
self->animSet = ANIMSET_DRA(0);
|
||||
params = self->params;
|
||||
self->hitboxState = 1;
|
||||
self->ext.generic.unk7C.s = 48;
|
||||
self->hitboxHeight = 8;
|
||||
self->zPriority = 0xC0;
|
||||
self->hitboxWidth = 0;
|
||||
self->flags |= FLAG_HAS_PRIMS;
|
||||
|
||||
for (i = 12; i != 0;) {
|
||||
prim->x0 = self->posX.i.hi + ((Random() & (fakeTemp = 7)) - 5);
|
||||
rnd = (Random() & 7) - 5;
|
||||
prim->y0 = self->posY.i.hi + rnd;
|
||||
*(s32*)&prim->r1 = 0;
|
||||
*(s32*)&prim->x1 = 0;
|
||||
prim->u0 = 4;
|
||||
prim->v0 = 4;
|
||||
|
||||
if (params != 0) {
|
||||
func_801BCF78(
|
||||
0xCC0 + i * 64, ((Random() & 0xF) * 0x10) + 0x180);
|
||||
} else {
|
||||
func_801BCF78(
|
||||
0xB40 - i * 64, ((Random() & 0xF) * 0x10) + 0x180);
|
||||
}
|
||||
|
||||
*(s32*)&prim->u1 = self->velocityX;
|
||||
*(s32*)&prim->r2 = self->velocityY;
|
||||
|
||||
var_a0_2 = *(s32*)&prim->u1;
|
||||
if (var_a0_2 <= -1) {
|
||||
var_a0_2 += 0x3F;
|
||||
}
|
||||
|
||||
*(s32*)&prim->r3 = -(var_a0_2 >> 6);
|
||||
*(s32*)&prim->x3 = -(*(s32*)&prim->r2 / 48) + 0xC00;
|
||||
|
||||
prim->x2 = prim->y2 = (Random() & 7) + 7;
|
||||
prim->r0 = 128;
|
||||
prim->b0 = 16;
|
||||
prim->g0 = 0;
|
||||
prim->priority = self->zPriority;
|
||||
prim->blendMode = 2;
|
||||
i--;
|
||||
if (i != 0) {
|
||||
prim++;
|
||||
}
|
||||
}
|
||||
|
||||
if (params != 0) {
|
||||
self->velocityX = FIX(1.25);
|
||||
self->ext.generic.unk80.modeS32 = -0x200;
|
||||
} else {
|
||||
self->velocityX = FIX(-1.25);
|
||||
self->ext.generic.unk80.modeS32 = 0x200;
|
||||
}
|
||||
self->velocityY = 0;
|
||||
break;
|
||||
}
|
||||
DestroyEntity(self);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (!(--self->ext.generic.unk7C.u)) {
|
||||
DestroyEntity(self);
|
||||
break;
|
||||
}
|
||||
|
||||
if (self->hitboxState != 0) {
|
||||
if (g_Player.unk0C & 0x02000000) {
|
||||
posX = self->posX.i.hi;
|
||||
self->velocityX += self->ext.generic.unk80.modeS32;
|
||||
|
||||
MoveEntity(self); // argument pass necessary to match
|
||||
|
||||
posX -= self->posX.i.hi;
|
||||
if (posX < 0) {
|
||||
posX = -posX;
|
||||
}
|
||||
|
||||
if (self->ext.generic.unk7C.u > 16) {
|
||||
self->ext.generic.unk7E.modeU16 += posX;
|
||||
self->hitboxWidth = self->ext.generic.unk7E.modeU16 / 2;
|
||||
self->hitboxHeight =
|
||||
(self->ext.generic.unk7E.modeU16 / 4) + 8;
|
||||
} else {
|
||||
self->hitboxState = 0;
|
||||
}
|
||||
|
||||
if (self->hitFlags != 0) {
|
||||
if (g_Player.unk56 == 0) {
|
||||
g_Player.unk56 = 1;
|
||||
g_Player.unk58 = 8;
|
||||
if (g_api.CheckEquipmentItemCount(
|
||||
ITEM_BLOODSTONE, ACCESSORY_TYPE)) {
|
||||
g_Player.unk58 *= 2;
|
||||
}
|
||||
}
|
||||
g_Player.unk10++;
|
||||
self->hitboxState = 0;
|
||||
}
|
||||
} else {
|
||||
self->hitboxState = 0;
|
||||
}
|
||||
}
|
||||
|
||||
prim = &g_PrimBuf[self->primIndex];
|
||||
for (i = 12; i != 0; i--, prim++) {
|
||||
*(u16*)&prim->b1 = prim->x0;
|
||||
prim->y1 = prim->y0;
|
||||
*(s32*)&prim->u1 += *(s32*)&prim->r3;
|
||||
*(s32*)&prim->r2 += *(s32*)&prim->x3;
|
||||
*(s32*)&prim->r1 += *(s32*)&prim->u1;
|
||||
*(s32*)&prim->x1 += *(s32*)&prim->r2;
|
||||
*(s16*)&prim->x0 = *(s16*)&prim->b1;
|
||||
prim->y0 = prim->y1;
|
||||
prim->x2--;
|
||||
|
||||
if ((prim->x2 == 0) && (prim->u0 != 0)) {
|
||||
prim->v0--;
|
||||
prim->u0--;
|
||||
if (!(prim->u0 & 1)) {
|
||||
prim->x0++;
|
||||
prim->y0++;
|
||||
}
|
||||
prim->x2 = *(s32*)&prim->y2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#include "../entity_enemy_blood.h"
|
||||
|
||||
extern ObjInit2 D_801820F0[];
|
||||
void EntityRoomForeground(Entity* entity) {
|
||||
|
@ -53,7 +53,7 @@ extern u8 g_eBreakableHitboxes[];
|
||||
extern u8 g_eBreakableExplosionTypes[];
|
||||
extern u16 g_eBreakableanimSets[];
|
||||
extern u8 g_eBreakableBlendModes[];
|
||||
extern u16 D_80180A48[];
|
||||
extern u16 g_InitializeData0[];
|
||||
extern u16 g_InitializeEntityData0[];
|
||||
extern u16 D_80180A60[];
|
||||
extern u16 D_80180A6C[];
|
||||
|
@ -609,7 +609,7 @@ u8 func_801BD338(u8 arg0, u8 arg1, u8 arg2) {
|
||||
return arg2;
|
||||
}
|
||||
|
||||
void func_801BD390(u16 slope, s16 speed) {
|
||||
void UnkEntityFunc0(u16 slope, s16 speed) {
|
||||
Entity* entity;
|
||||
s32 moveX;
|
||||
s32 moveY;
|
||||
|
@ -24,7 +24,7 @@ void EntityPrizeDrop(Entity* self) {
|
||||
}
|
||||
switch (self->step) {
|
||||
case 0:
|
||||
InitializeEntity(D_80180BD4);
|
||||
InitializeEntity(g_InitializeData0);
|
||||
self->zPriority = g_zEntityCenter.S16.unk0 - 0x14;
|
||||
self->blendMode = 0;
|
||||
if (itemId >= 0x18) {
|
||||
@ -309,7 +309,7 @@ void EntityEquipItemDrop(Entity* self) {
|
||||
EntityPrizeDrop(self);
|
||||
return;
|
||||
}
|
||||
InitializeEntity(D_80180BD4);
|
||||
InitializeEntity(g_InitializeData0);
|
||||
self->ext.generic.unk7C.s = 0;
|
||||
break;
|
||||
|
||||
@ -1141,7 +1141,7 @@ void EntitySoulStealOrb(Entity* self) {
|
||||
DestroyEntity(self);
|
||||
return;
|
||||
}
|
||||
InitializeEntity(D_80180BD4);
|
||||
InitializeEntity(g_InitializeData0);
|
||||
D_8008701E[primIndex * 0x1a] = 8;
|
||||
self->primIndex = primIndex;
|
||||
self->animSet = ANIMSET_DRA(0);
|
||||
@ -1188,8 +1188,8 @@ void EntitySoulStealOrb(Entity* self) {
|
||||
self->ext.soulStealOrb.angle = func_801BD4CC(
|
||||
self->ext.soulStealOrb.unk7E, self->ext.soulStealOrb.angle,
|
||||
0xffff & func_801BD44C(self, &PLAYER));
|
||||
func_801BD390(self->ext.soulStealOrb.angle & 0xFFFF,
|
||||
self->ext.soulStealOrb.unk80);
|
||||
UnkEntityFunc0(self->ext.soulStealOrb.angle & 0xFFFF,
|
||||
self->ext.soulStealOrb.unk80);
|
||||
MoveEntity(self); // argument pass necessary to match
|
||||
prim = &g_PrimBuf[self->primIndex];
|
||||
AnimateEntity(&D_80181FF0, self);
|
||||
@ -1211,152 +1211,7 @@ void EntitySoulStealOrb(Entity* self) {
|
||||
}
|
||||
}
|
||||
|
||||
void EntityEnemyBlood(Entity* self) {
|
||||
int fakeTemp; // !TODO: !FAKE
|
||||
Primitive* prim;
|
||||
s32 var_a0_2;
|
||||
u16 params;
|
||||
s16 posX;
|
||||
s32 rnd;
|
||||
s32 i;
|
||||
|
||||
switch (self->step) {
|
||||
case 0:
|
||||
i = g_api.func_800EDB58(17, 12);
|
||||
if (i != -1) {
|
||||
InitializeEntity(D_80180BD4);
|
||||
prim = &g_PrimBuf[i];
|
||||
self->primIndex = i;
|
||||
self->animSet = ANIMSET_DRA(0);
|
||||
params = self->params;
|
||||
self->hitboxState = 1;
|
||||
self->ext.generic.unk7C.s = 48;
|
||||
self->hitboxHeight = 8;
|
||||
self->zPriority = 0xC0;
|
||||
self->hitboxWidth = 0;
|
||||
self->flags |= FLAG_HAS_PRIMS;
|
||||
|
||||
for (i = 12; i != 0;) {
|
||||
prim->x0 = self->posX.i.hi + ((Random() & (fakeTemp = 7)) - 5);
|
||||
rnd = (Random() & 7) - 5;
|
||||
prim->y0 = self->posY.i.hi + rnd;
|
||||
*(s32*)&prim->r1 = 0;
|
||||
*(s32*)&prim->x1 = 0;
|
||||
prim->u0 = 4;
|
||||
prim->v0 = 4;
|
||||
|
||||
if (params != 0) {
|
||||
func_801BD390(
|
||||
0xCC0 + i * 64, ((Random() & 0xF) * 0x10) + 0x180);
|
||||
} else {
|
||||
func_801BD390(
|
||||
0xB40 - i * 64, ((Random() & 0xF) * 0x10) + 0x180);
|
||||
}
|
||||
|
||||
*(s32*)&prim->u1 = self->velocityX;
|
||||
*(s32*)&prim->r2 = self->velocityY;
|
||||
|
||||
var_a0_2 = *(s32*)&prim->u1;
|
||||
if (var_a0_2 <= -1) {
|
||||
var_a0_2 += 0x3F;
|
||||
}
|
||||
|
||||
*(s32*)&prim->r3 = -(var_a0_2 >> 6);
|
||||
*(s32*)&prim->x3 = -(*(s32*)&prim->r2 / 48) + 0xC00;
|
||||
|
||||
prim->x2 = prim->y2 = (Random() & 7) + 7;
|
||||
prim->r0 = 128;
|
||||
prim->b0 = 16;
|
||||
prim->g0 = 0;
|
||||
prim->priority = self->zPriority;
|
||||
prim->blendMode = 2;
|
||||
i--;
|
||||
if (i != 0) {
|
||||
prim++;
|
||||
}
|
||||
}
|
||||
|
||||
if (params != 0) {
|
||||
self->velocityX = FIX(1.25);
|
||||
self->ext.generic.unk80.modeS32 = -0x200;
|
||||
} else {
|
||||
self->velocityX = FIX(-1.25);
|
||||
self->ext.generic.unk80.modeS32 = 0x200;
|
||||
}
|
||||
self->velocityY = 0;
|
||||
break;
|
||||
}
|
||||
DestroyEntity(self);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (!(--self->ext.generic.unk7C.u)) {
|
||||
DestroyEntity(self);
|
||||
break;
|
||||
}
|
||||
|
||||
if (self->hitboxState != 0) {
|
||||
if (g_Player.unk0C & 0x02000000) {
|
||||
posX = self->posX.i.hi;
|
||||
self->velocityX += self->ext.generic.unk80.modeS32;
|
||||
|
||||
MoveEntity(self); // argument pass necessary to match
|
||||
|
||||
posX -= self->posX.i.hi;
|
||||
if (posX < 0) {
|
||||
posX = -posX;
|
||||
}
|
||||
|
||||
if (self->ext.generic.unk7C.u > 16) {
|
||||
self->ext.generic.unk7E.modeU16 += posX;
|
||||
self->hitboxWidth = self->ext.generic.unk7E.modeU16 / 2;
|
||||
self->hitboxHeight =
|
||||
(self->ext.generic.unk7E.modeU16 / 4) + 8;
|
||||
} else {
|
||||
self->hitboxState = 0;
|
||||
}
|
||||
|
||||
if (self->hitFlags != 0) {
|
||||
if (g_Player.unk56 == 0) {
|
||||
g_Player.unk56 = 1;
|
||||
g_Player.unk58 = 8;
|
||||
if (g_api.CheckEquipmentItemCount(
|
||||
ITEM_BLOODSTONE, ACCESSORY_TYPE)) {
|
||||
g_Player.unk58 *= 2;
|
||||
}
|
||||
}
|
||||
g_Player.unk10++;
|
||||
self->hitboxState = 0;
|
||||
}
|
||||
} else {
|
||||
self->hitboxState = 0;
|
||||
}
|
||||
}
|
||||
|
||||
prim = &g_PrimBuf[self->primIndex];
|
||||
for (i = 12; i != 0; i--, prim++) {
|
||||
*(u16*)&prim->b1 = prim->x0;
|
||||
prim->y1 = prim->y0;
|
||||
*(s32*)&prim->u1 += *(s32*)&prim->r3;
|
||||
*(s32*)&prim->r2 += *(s32*)&prim->x3;
|
||||
*(s32*)&prim->r1 += *(s32*)&prim->u1;
|
||||
*(s32*)&prim->x1 += *(s32*)&prim->r2;
|
||||
*(s16*)&prim->x0 = *(s16*)&prim->b1;
|
||||
prim->y0 = prim->y1;
|
||||
prim->x2--;
|
||||
|
||||
if ((prim->x2 == 0) && (prim->u0 != 0)) {
|
||||
prim->v0--;
|
||||
prim->u0--;
|
||||
if (!(prim->u0 & 1)) {
|
||||
prim->x0++;
|
||||
prim->y0++;
|
||||
}
|
||||
prim->x2 = *(s32*)&prim->y2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#include "../entity_enemy_blood.h"
|
||||
|
||||
void EntityRoomForeground(Entity* entity) {
|
||||
ObjInit2* objInit = &D_80182014[entity->params];
|
||||
|
@ -258,7 +258,7 @@ void func_801C7884(Entity* entity) {
|
||||
|
||||
switch (entity->step) {
|
||||
case 0:
|
||||
InitializeEntity(D_80180BD4);
|
||||
InitializeEntity(g_InitializeData0);
|
||||
entity->hitboxState = 0;
|
||||
|
||||
case 1:
|
||||
|
@ -265,7 +265,7 @@ extern u8 D_80180CF4[];
|
||||
extern s32 D_80182600[];
|
||||
extern s32 D_8018216C;
|
||||
extern s32 D_80182174;
|
||||
extern u16 D_80180BD4[];
|
||||
extern u16 g_InitializeData0[];
|
||||
extern u16 D_80180BC8[];
|
||||
extern u16 D_80181CA8[];
|
||||
extern u16 D_80181CD8[];
|
||||
|
@ -284,7 +284,7 @@ INCLUDE_ASM("asm/us/st/rwrp/nonmatchings/A59C", func_8018DF84);
|
||||
|
||||
INCLUDE_ASM("asm/us/st/rwrp/nonmatchings/A59C", func_8018DFCC);
|
||||
|
||||
INCLUDE_ASM("asm/us/st/rwrp/nonmatchings/A59C", func_8018E024);
|
||||
INCLUDE_ASM("asm/us/st/rwrp/nonmatchings/A59C", UnkEntityFunc0);
|
||||
|
||||
INCLUDE_ASM("asm/us/st/rwrp/nonmatchings/A59C", func_8018E0B0);
|
||||
|
||||
@ -665,7 +665,7 @@ void EntitySoulStealOrb(Entity* self) {
|
||||
DestroyEntity(self);
|
||||
return;
|
||||
}
|
||||
InitializeEntity(D_8018044C);
|
||||
InitializeEntity(g_InitializeData0);
|
||||
D_8008701E[primIndex * 0x1a] = 8;
|
||||
self->primIndex = primIndex;
|
||||
self->animSet = ANIMSET_DRA(0);
|
||||
@ -712,8 +712,8 @@ void EntitySoulStealOrb(Entity* self) {
|
||||
self->ext.soulStealOrb.angle = func_8018E160(
|
||||
self->ext.soulStealOrb.unk7E, (u16)self->ext.soulStealOrb.angle,
|
||||
0xffff & func_8018E0E0(self, &PLAYER));
|
||||
func_8018E024(self->ext.soulStealOrb.angle & 0xFFFF,
|
||||
self->ext.soulStealOrb.unk80);
|
||||
UnkEntityFunc0(self->ext.soulStealOrb.angle & 0xFFFF,
|
||||
self->ext.soulStealOrb.unk80);
|
||||
MoveEntity(self); // argument pass necessary to match
|
||||
prim = &g_PrimBuf[self->primIndex];
|
||||
func_8018D6B0(&D_80181110, self);
|
||||
@ -735,7 +735,7 @@ void EntitySoulStealOrb(Entity* self) {
|
||||
}
|
||||
}
|
||||
|
||||
INCLUDE_ASM("asm/us/st/rwrp/nonmatchings/A59C", func_80194924);
|
||||
#include "../entity_enemy_blood.h"
|
||||
|
||||
void func_80194DD4(Entity* entity) {
|
||||
ObjInit2* objInit = &D_80181134[entity->params];
|
||||
|
@ -16,7 +16,7 @@ void CreateEntityFromLayout(Entity*, LayoutEntity*);
|
||||
|
||||
extern u16 D_801810A0[]; // NOTE(sestren): Random angle offsets?
|
||||
extern u16 D_801810B0[]; // NOTE(sestren): Animation frame properties?
|
||||
extern u16 D_8018044C[];
|
||||
extern u16 g_InitializeData0[];
|
||||
extern u16 D_80181110[];
|
||||
|
||||
// *** EntitySoulStealOrb properties END ***
|
||||
|
@ -564,7 +564,7 @@ u8 func_801B55A8(u8 arg0, u8 arg1, u8 arg2) {
|
||||
return arg2;
|
||||
}
|
||||
|
||||
void func_801B5600(u16 slope, s16 speed) {
|
||||
void UnkEntityFunc0(u16 slope, s16 speed) {
|
||||
Entity* entity;
|
||||
s32 moveX;
|
||||
s32 moveY;
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "game.h"
|
||||
#include "st0.h"
|
||||
|
||||
u16 D_80180580[];
|
||||
u16 g_InitializeData0[];
|
||||
u8* D_80181D18[];
|
||||
u16 D_80181D74[];
|
||||
|
||||
@ -29,7 +29,7 @@ void EntityPrizeDrop(Entity* self) {
|
||||
|
||||
switch (self->step) {
|
||||
case 0:
|
||||
InitializeEntity(D_80180580);
|
||||
InitializeEntity(g_InitializeData0);
|
||||
self->zPriority = g_zEntityCenter.S16.unk0 - 0x14;
|
||||
self->blendMode = 0;
|
||||
if (itemId >= 0x17) {
|
||||
@ -787,7 +787,7 @@ void EntitySoulStealOrb(Entity* self) {
|
||||
DestroyEntity(self);
|
||||
return;
|
||||
}
|
||||
InitializeEntity(D_80180580);
|
||||
InitializeEntity(g_InitializeData0);
|
||||
D_8008701E[primIndex * 0x1a] = 8;
|
||||
self->primIndex = primIndex;
|
||||
self->animSet = ANIMSET_DRA(0);
|
||||
@ -834,8 +834,8 @@ void EntitySoulStealOrb(Entity* self) {
|
||||
self->ext.soulStealOrb.angle = func_801B573C(
|
||||
self->ext.soulStealOrb.unk7E, (u16)self->ext.soulStealOrb.angle,
|
||||
0xffff & func_801B56BC(self, &PLAYER));
|
||||
func_801B5600(self->ext.soulStealOrb.angle & 0xFFFF,
|
||||
self->ext.soulStealOrb.unk80);
|
||||
UnkEntityFunc0(self->ext.soulStealOrb.angle & 0xFFFF,
|
||||
self->ext.soulStealOrb.unk80);
|
||||
MoveEntity(self); // argument pass necessary to match
|
||||
prim = &g_PrimBuf[self->primIndex];
|
||||
AnimateEntity(&D_80181FC4, self);
|
||||
@ -857,152 +857,7 @@ void EntitySoulStealOrb(Entity* self) {
|
||||
}
|
||||
}
|
||||
|
||||
void EntityEnemyBlood(Entity* self) {
|
||||
int fakeTemp; // !TODO: !FAKE
|
||||
Primitive* prim;
|
||||
s32 var_a0_2;
|
||||
u16 params;
|
||||
s16 posX;
|
||||
s32 rnd;
|
||||
s32 i;
|
||||
|
||||
switch (self->step) {
|
||||
case 0:
|
||||
i = g_api.func_800EDB58(17, 12);
|
||||
if (i != -1) {
|
||||
InitializeEntity(D_80180580);
|
||||
prim = &g_PrimBuf[i];
|
||||
self->primIndex = i;
|
||||
self->animSet = ANIMSET_DRA(0);
|
||||
params = self->params;
|
||||
self->hitboxState = 1;
|
||||
self->ext.generic.unk7C.s = 48;
|
||||
self->hitboxHeight = 8;
|
||||
self->zPriority = 0xC0;
|
||||
self->hitboxWidth = 0;
|
||||
self->flags |= FLAG_HAS_PRIMS;
|
||||
|
||||
for (i = 12; i != 0;) {
|
||||
prim->x0 = self->posX.i.hi + ((Random() & (fakeTemp = 7)) - 5);
|
||||
rnd = (Random() & 7) - 5;
|
||||
prim->y0 = self->posY.i.hi + rnd;
|
||||
*(s32*)&prim->r1 = 0;
|
||||
*(s32*)&prim->x1 = 0;
|
||||
prim->u0 = 4;
|
||||
prim->v0 = 4;
|
||||
|
||||
if (params != 0) {
|
||||
func_801B5600(
|
||||
0xCC0 + i * 64, ((Random() & 0xF) * 0x10) + 0x180);
|
||||
} else {
|
||||
func_801B5600(
|
||||
0xB40 - i * 64, ((Random() & 0xF) * 0x10) + 0x180);
|
||||
}
|
||||
|
||||
*(s32*)&prim->u1 = self->velocityX;
|
||||
*(s32*)&prim->r2 = self->velocityY;
|
||||
|
||||
var_a0_2 = *(s32*)&prim->u1;
|
||||
if (var_a0_2 <= -1) {
|
||||
var_a0_2 += 0x3F;
|
||||
}
|
||||
|
||||
*(s32*)&prim->r3 = -(var_a0_2 >> 6);
|
||||
*(s32*)&prim->x3 = -(*(s32*)&prim->r2 / 48) + 0xC00;
|
||||
|
||||
prim->x2 = prim->y2 = (Random() & 7) + 7;
|
||||
prim->r0 = 128;
|
||||
prim->b0 = 16;
|
||||
prim->g0 = 0;
|
||||
prim->priority = self->zPriority;
|
||||
prim->blendMode = 2;
|
||||
i--;
|
||||
if (i != 0) {
|
||||
prim++;
|
||||
}
|
||||
}
|
||||
|
||||
if (params != 0) {
|
||||
self->velocityX = FIX(1.25);
|
||||
self->ext.generic.unk80.modeS32 = -0x200;
|
||||
} else {
|
||||
self->velocityX = FIX(-1.25);
|
||||
self->ext.generic.unk80.modeS32 = 0x200;
|
||||
}
|
||||
self->velocityY = 0;
|
||||
break;
|
||||
}
|
||||
DestroyEntity(self);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (!(--self->ext.generic.unk7C.u)) {
|
||||
DestroyEntity(self);
|
||||
break;
|
||||
}
|
||||
|
||||
if (self->hitboxState != 0) {
|
||||
if (g_Player.unk0C & 0x02000000) {
|
||||
posX = self->posX.i.hi;
|
||||
self->velocityX += self->ext.generic.unk80.modeS32;
|
||||
|
||||
MoveEntity(self); // argument pass necessary to match
|
||||
|
||||
posX -= self->posX.i.hi;
|
||||
if (posX < 0) {
|
||||
posX = -posX;
|
||||
}
|
||||
|
||||
if (self->ext.generic.unk7C.u > 16) {
|
||||
self->ext.generic.unk7E.modeU16 += posX;
|
||||
self->hitboxWidth = self->ext.generic.unk7E.modeU16 / 2;
|
||||
self->hitboxHeight =
|
||||
(self->ext.generic.unk7E.modeU16 / 4) + 8;
|
||||
} else {
|
||||
self->hitboxState = 0;
|
||||
}
|
||||
|
||||
if (self->hitFlags != 0) {
|
||||
if (g_Player.unk56 == 0) {
|
||||
g_Player.unk56 = 1;
|
||||
g_Player.unk58 = 8;
|
||||
if (g_api.CheckEquipmentItemCount(
|
||||
ITEM_BLOODSTONE, ACCESSORY_TYPE)) {
|
||||
g_Player.unk58 *= 2;
|
||||
}
|
||||
}
|
||||
g_Player.unk10++;
|
||||
self->hitboxState = 0;
|
||||
}
|
||||
} else {
|
||||
self->hitboxState = 0;
|
||||
}
|
||||
}
|
||||
|
||||
prim = &g_PrimBuf[self->primIndex];
|
||||
for (i = 12; i != 0; i--, prim++) {
|
||||
*(u16*)&prim->b1 = prim->x0;
|
||||
prim->y1 = prim->y0;
|
||||
*(s32*)&prim->u1 += *(s32*)&prim->r3;
|
||||
*(s32*)&prim->r2 += *(s32*)&prim->x3;
|
||||
*(s32*)&prim->r1 += *(s32*)&prim->u1;
|
||||
*(s32*)&prim->x1 += *(s32*)&prim->r2;
|
||||
*(s16*)&prim->x0 = *(s16*)&prim->b1;
|
||||
prim->y0 = prim->y1;
|
||||
prim->x2--;
|
||||
|
||||
if ((prim->x2 == 0) && (prim->u0 != 0)) {
|
||||
prim->v0--;
|
||||
prim->u0--;
|
||||
if (!(prim->u0 & 1)) {
|
||||
prim->x0++;
|
||||
prim->y0++;
|
||||
}
|
||||
prim->x2 = *(s32*)&prim->y2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#include "../entity_enemy_blood.h"
|
||||
|
||||
extern ObjInit2 D_80181FE8[];
|
||||
void EntityRoomForeground(Entity* entity) {
|
||||
|
@ -226,7 +226,7 @@ PfnEntityUpdate PfnEntityUpdates[] = {
|
||||
u16 g_eBreakableInit[] = {
|
||||
0x8001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
|
||||
};
|
||||
u16 D_8018044C[] = {
|
||||
u16 g_InitializeData0[] = {
|
||||
0x0003, 0x0000, 0x0000, 0x0000, 0x0001, 0x0000,
|
||||
};
|
||||
u16 D_80180458[] = {
|
||||
|
@ -619,7 +619,7 @@ u8 func_8018C04C(u8 arg0, u8 arg1, u8 arg2) {
|
||||
return arg2;
|
||||
}
|
||||
|
||||
void func_8018C0A4(u16 slope, s16 speed) {
|
||||
void UnkEntityFunc0(u16 slope, s16 speed) {
|
||||
Entity* entity;
|
||||
s32 moveX;
|
||||
s32 moveY;
|
||||
|
@ -4,7 +4,7 @@ PfnEntityUpdate PfnEntityUpdates[];
|
||||
|
||||
// if self->params & 0x8000 then the item will not disappear
|
||||
// self->ext.generic.unk80.modeS8.unk0: frames left before the prize disappear
|
||||
u16 D_8018044C[];
|
||||
u16 g_InitializeData0[];
|
||||
extern u16 D_80180608[];
|
||||
u16 D_80180DF4[];
|
||||
u8* D_80180E58[];
|
||||
@ -31,7 +31,7 @@ void EntityPrizeDrop(Entity* self) {
|
||||
}
|
||||
switch (self->step) {
|
||||
case 0:
|
||||
InitializeEntity(D_8018044C);
|
||||
InitializeEntity(g_InitializeData0);
|
||||
self->zPriority = g_zEntityCenter.S16.unk0 - 0x14;
|
||||
self->blendMode = 0;
|
||||
if (itemId >= 0x18) {
|
||||
@ -318,7 +318,7 @@ void EntityEquipItemDrop(Entity* self) {
|
||||
EntityPrizeDrop(self);
|
||||
return;
|
||||
}
|
||||
InitializeEntity(D_8018044C);
|
||||
InitializeEntity(g_InitializeData0);
|
||||
self->ext.equipItemDrop.timer = 0;
|
||||
break;
|
||||
|
||||
@ -1229,7 +1229,7 @@ void EntitySoulStealOrb(Entity* self) {
|
||||
DestroyEntity(self);
|
||||
return;
|
||||
}
|
||||
InitializeEntity(D_8018044C);
|
||||
InitializeEntity(g_InitializeData0);
|
||||
D_8008701E[primIndex * 0x1a] = 8;
|
||||
self->primIndex = primIndex;
|
||||
self->animSet = ANIMSET_DRA(0);
|
||||
@ -1276,8 +1276,8 @@ void EntitySoulStealOrb(Entity* self) {
|
||||
self->ext.soulStealOrb.angle = func_8018C1E0(
|
||||
self->ext.soulStealOrb.unk7E, (u16)self->ext.soulStealOrb.angle,
|
||||
0xffff & func_8018C160(self, &PLAYER));
|
||||
func_8018C0A4(self->ext.soulStealOrb.angle & 0xFFFF,
|
||||
self->ext.soulStealOrb.unk80);
|
||||
UnkEntityFunc0(self->ext.soulStealOrb.angle & 0xFFFF,
|
||||
self->ext.soulStealOrb.unk80);
|
||||
MoveEntity(self); // argument pass necessary to match
|
||||
prim = &g_PrimBuf[self->primIndex];
|
||||
AnimateEntity(&D_80181110, self);
|
||||
@ -1299,152 +1299,7 @@ void EntitySoulStealOrb(Entity* self) {
|
||||
}
|
||||
}
|
||||
|
||||
void EntityEnemyBlood(Entity* self) {
|
||||
int fakeTemp; // !TODO: !FAKE
|
||||
Primitive* prim;
|
||||
s32 var_a0_2;
|
||||
u16 params;
|
||||
s16 posX;
|
||||
s32 rnd;
|
||||
s32 i;
|
||||
|
||||
switch (self->step) {
|
||||
case 0:
|
||||
i = g_api.func_800EDB58(17, 12);
|
||||
if (i != -1) {
|
||||
InitializeEntity(D_8018044C);
|
||||
prim = &g_PrimBuf[i];
|
||||
self->primIndex = i;
|
||||
self->animSet = ANIMSET_DRA(0);
|
||||
params = self->params;
|
||||
self->hitboxState = 1;
|
||||
self->ext.generic.unk7C.s = 48;
|
||||
self->hitboxHeight = 8;
|
||||
self->zPriority = 0xC0;
|
||||
self->hitboxWidth = 0;
|
||||
self->flags |= FLAG_HAS_PRIMS;
|
||||
|
||||
for (i = 12; i != 0;) {
|
||||
prim->x0 = self->posX.i.hi + ((Random() & (fakeTemp = 7)) - 5);
|
||||
rnd = (Random() & 7) - 5;
|
||||
prim->y0 = self->posY.i.hi + rnd;
|
||||
*(s32*)&prim->r1 = 0;
|
||||
*(s32*)&prim->x1 = 0;
|
||||
prim->u0 = 4;
|
||||
prim->v0 = 4;
|
||||
|
||||
if (params != 0) {
|
||||
func_8018C0A4(
|
||||
0xCC0 + i * 64, ((Random() & 0xF) * 0x10) + 0x180);
|
||||
} else {
|
||||
func_8018C0A4(
|
||||
0xB40 - i * 64, ((Random() & 0xF) * 0x10) + 0x180);
|
||||
}
|
||||
|
||||
*(s32*)&prim->u1 = self->velocityX;
|
||||
*(s32*)&prim->r2 = self->velocityY;
|
||||
|
||||
var_a0_2 = *(s32*)&prim->u1;
|
||||
if (var_a0_2 <= -1) {
|
||||
var_a0_2 += 0x3F;
|
||||
}
|
||||
|
||||
*(s32*)&prim->r3 = -(var_a0_2 >> 6);
|
||||
*(s32*)&prim->x3 = -(*(s32*)&prim->r2 / 48) + 0xC00;
|
||||
|
||||
prim->x2 = prim->y2 = (Random() & 7) + 7;
|
||||
prim->r0 = 128;
|
||||
prim->b0 = 16;
|
||||
prim->g0 = 0;
|
||||
prim->priority = self->zPriority;
|
||||
prim->blendMode = 2;
|
||||
i--;
|
||||
if (i != 0) {
|
||||
prim++;
|
||||
}
|
||||
}
|
||||
|
||||
if (params != 0) {
|
||||
self->velocityX = FIX(1.25);
|
||||
self->ext.generic.unk80.modeS32 = -0x200;
|
||||
} else {
|
||||
self->velocityX = FIX(-1.25);
|
||||
self->ext.generic.unk80.modeS32 = 0x200;
|
||||
}
|
||||
self->velocityY = 0;
|
||||
break;
|
||||
}
|
||||
DestroyEntity(self);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (!(--self->ext.generic.unk7C.u)) {
|
||||
DestroyEntity(self);
|
||||
break;
|
||||
}
|
||||
|
||||
if (self->hitboxState != 0) {
|
||||
if (g_Player.unk0C & 0x02000000) {
|
||||
posX = self->posX.i.hi;
|
||||
self->velocityX += self->ext.generic.unk80.modeS32;
|
||||
|
||||
MoveEntity(self); // argument pass necessary to match
|
||||
|
||||
posX -= self->posX.i.hi;
|
||||
if (posX < 0) {
|
||||
posX = -posX;
|
||||
}
|
||||
|
||||
if (self->ext.generic.unk7C.u > 16) {
|
||||
self->ext.generic.unk7E.modeU16 += posX;
|
||||
self->hitboxWidth = self->ext.generic.unk7E.modeU16 / 2;
|
||||
self->hitboxHeight =
|
||||
(self->ext.generic.unk7E.modeU16 / 4) + 8;
|
||||
} else {
|
||||
self->hitboxState = 0;
|
||||
}
|
||||
|
||||
if (self->hitFlags != 0) {
|
||||
if (g_Player.unk56 == 0) {
|
||||
g_Player.unk56 = 1;
|
||||
g_Player.unk58 = 8;
|
||||
if (g_api.CheckEquipmentItemCount(
|
||||
ITEM_BLOODSTONE, ACCESSORY_TYPE)) {
|
||||
g_Player.unk58 *= 2;
|
||||
}
|
||||
}
|
||||
g_Player.unk10++;
|
||||
self->hitboxState = 0;
|
||||
}
|
||||
} else {
|
||||
self->hitboxState = 0;
|
||||
}
|
||||
}
|
||||
|
||||
prim = &g_PrimBuf[self->primIndex];
|
||||
for (i = 12; i != 0; i--, prim++) {
|
||||
*(u16*)&prim->b1 = prim->x0;
|
||||
prim->y1 = prim->y0;
|
||||
*(s32*)&prim->u1 += *(s32*)&prim->r3;
|
||||
*(s32*)&prim->r2 += *(s32*)&prim->x3;
|
||||
*(s32*)&prim->r1 += *(s32*)&prim->u1;
|
||||
*(s32*)&prim->x1 += *(s32*)&prim->r2;
|
||||
*(s16*)&prim->x0 = *(s16*)&prim->b1;
|
||||
prim->y0 = prim->y1;
|
||||
prim->x2--;
|
||||
|
||||
if ((prim->x2 == 0) && (prim->u0 != 0)) {
|
||||
prim->v0--;
|
||||
prim->u0--;
|
||||
if (!(prim->u0 & 1)) {
|
||||
prim->x0++;
|
||||
prim->y0++;
|
||||
}
|
||||
prim->x2 = *(s32*)&prim->y2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#include "../entity_enemy_blood.h"
|
||||
|
||||
ObjInit2 D_80181134[];
|
||||
u16 D_80180494[];
|
||||
|
Loading…
Reference in New Issue
Block a user