CollectSubweapon + duplicates (#326)

This function was already decompiled for ST0, it was reviewed and merged
in a previous PR, The one for the MAD overlay is a duplicate of the same
func. As for the rest of the overlays, the function calls SetStep
instead of just modifying the Current Entity step and step_s directly,
so with that little change the "normal" version of the function is now
decompiled.
This commit is contained in:
Alejandro Asenjo Nitti 2023-07-07 13:25:55 -03:00 committed by GitHub
parent bfc9683a5c
commit 1cfdc7a44b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 312 additions and 82 deletions

View File

@ -20,8 +20,10 @@ EntityRedDoor = 0x8019362C;
DestroyEntity = 0x80194264;
MoveEntity = 0x80194618;
AllocEntity = 0x80194AD4;
SetStep = 0x80194EA4;
InitializeEntity = 0x80194F74;
CollectHeart = 0x801958F4;
CollectSubweapon = 0x80195A50;
EntityPrizeDrop = 0x80195C84;
EntityExplosion = 0x801964F8;
EntityEquipItemDrop = 0x80196698;

View File

@ -39,7 +39,9 @@ AnimateEntity = 0x8019A4D8;
MoveEntity = 0x8019A75C;
FallEntity = 0x8019A78C;
AllocEntity = 0x8019AC18;
SetStep = 0x8019AFE8;
InitializeEntity = 0x8019B0B8;
CollectSubweapon = 0x8019BB94;
CollectHeartVessel = 0x8019BCAC;
CollectLifeVessel = 0x8019BD50;
DestroyCurrentEntity = 0x8019BDA0;

View File

@ -74,6 +74,7 @@ AnimateEntity = 0x801C4D94;
MoveEntity = 0x801C5018;
FallEntity = 0x801C5048;
AllocEntity = 0x801C54D4;
SetStep = 0x801C58A4;
InitializeEntity = 0x801C5974;
EntityDummy = 0x801C5A70;
ReplaceBreakableWithItemDrop = 0x801C605C;

View File

@ -4,8 +4,11 @@ Random = 0x8018A168;
Update = 0x8018A198;
CreateEntityWhenInVerticalRange = 0x8018BE1C;
CreateEntityWhenInHorizontalRange = 0x8018BF34;
DestroyEntity = 0x8018D580;
MoveEntity = 0x8018D934;
FallEntity = 0x8018D964;
SetStep = 0x8018E1C0;
CollectSubweapon = 0x8018ED6C;
ClutLerp = 0x8019344C;
EntitySoulStealOrb = 0x80194590;
func_801951F0 = 0x801951F0;

View File

@ -84,6 +84,7 @@ AnimateEntity = 0x8018B730;
MoveEntity = 0x8018B9B4;
FallEntity = 0x8018B9E4;
AllocEntity = 0x8018BE70;
SetStep = 0x8018C240;
InitializeEntity = 0x8018C310;
EntityDummy = 0x8018C40C;
ReplaceBreakableWithItemDrop = 0x8018C9F8;

View File

@ -685,16 +685,16 @@ Entity* AllocEntity(Entity* start, Entity* end) {
INCLUDE_ASM("asm/saturn/game/f_nonmat", f607B1C8, func_0607B1C8);
// SAT: func_0607B218
void func_801C58A4(s32 state) {
g_CurrentEntity->step = state;
void func_801C58A4(s32 step) {
g_CurrentEntity->step = step;
g_CurrentEntity->step_s = 0;
g_CurrentEntity->animFrameIdx = 0;
g_CurrentEntity->animFrameDuration = 0;
}
// SAT: func_0607B240
void func_801C58C4(s32 state) {
g_CurrentEntity->step_s = state;
void func_801C58C4(s32 step_s) {
g_CurrentEntity->step_s = step_s;
g_CurrentEntity->animFrameIdx = 0;
g_CurrentEntity->animFrameDuration = 0;
}

View File

@ -846,7 +846,7 @@ u16 func_80194E44(u16 arg0, u16 arg1, u16 arg2) {
return arg2;
}
void func_80194EA4(u8 step) {
void SetStep(u8 step) {
Entity* entity = g_CurrentEntity;
entity->step = step;
@ -995,7 +995,38 @@ void CollectHeart(u16 index) {
INCLUDE_ASM("asm/us/st/cen/nonmatchings/D600", func_80195974);
INCLUDE_ASM("asm/us/st/cen/nonmatchings/D600", func_80195A50);
void CollectSubweapon(u16 subWeaponIdx) {
Entity* player = &PLAYER;
u16 subWeapon;
g_api.PlaySfx(NA_SE_PL_IT_PICKUP);
subWeapon = g_Status.subWeapon;
g_Status.subWeapon = D_80180EEC[subWeaponIdx];
if (subWeapon == g_Status.subWeapon) {
subWeapon = 1;
g_CurrentEntity->unk6D = 0x10;
} else {
subWeapon = D_80180F1C[subWeapon];
g_CurrentEntity->unk6D = 0x60;
}
if (subWeapon != 0) {
g_CurrentEntity->params = subWeapon;
g_CurrentEntity->posY.i.hi = player->posY.i.hi + 12;
SetStep(7);
g_CurrentEntity->accelerationY = -0x28000;
g_CurrentEntity->animCurFrame = 0;
g_CurrentEntity->ext.generic.unk88.S16.unk2 = 5;
if (player->facing != 1) {
g_CurrentEntity->accelerationX = -0x20000;
return;
}
g_CurrentEntity->accelerationX = 0x20000;
return;
}
DestroyEntity(g_CurrentEntity);
}
INCLUDE_ASM("asm/us/st/cen/nonmatchings/D600", func_80195B68);

View File

@ -39,6 +39,8 @@ extern ObjInit2 D_80180490[];
extern u16 D_801805D8[];
extern s32 D_8018068C[];
extern s16 D_80180BBC[];
extern u16 D_80180EEC[];
extern u16 D_80180F1C[];
extern s8 D_80180FE8[];
extern u16 D_801811C8[];
extern u16 D_801811D8[];

View File

@ -793,7 +793,7 @@ u16 func_8019AF88(u16 arg0, s16 arg1, s16 arg2) {
return arg2;
}
void func_8019AFE8(u8 step) {
void SetStep(u8 step) {
Entity* entity;
entity = g_CurrentEntity;
@ -1042,7 +1042,38 @@ void func_8019BA38(u16 arg0) {
INCLUDE_ASM("asm/us/st/dre/nonmatchings/14214", func_8019BAB8);
INCLUDE_ASM("asm/us/st/dre/nonmatchings/14214", func_8019BB94);
void CollectSubweapon(u16 subWeaponIdx) {
Entity* player = &PLAYER;
u16 subWeapon;
g_api.PlaySfx(NA_SE_PL_IT_PICKUP);
subWeapon = g_Status.subWeapon;
g_Status.subWeapon = D_801810B0[subWeaponIdx];
if (subWeapon == g_Status.subWeapon) {
subWeapon = 1;
g_CurrentEntity->unk6D = 0x10;
} else {
subWeapon = D_801810E0[subWeapon];
g_CurrentEntity->unk6D = 0x60;
}
if (subWeapon != 0) {
g_CurrentEntity->params = subWeapon;
g_CurrentEntity->posY.i.hi = player->posY.i.hi + 12;
SetStep(7);
g_CurrentEntity->accelerationY = -0x28000;
g_CurrentEntity->animCurFrame = 0;
g_CurrentEntity->ext.generic.unk88.S16.unk2 = 5;
if (player->facing != 1) {
g_CurrentEntity->accelerationX = -0x20000;
return;
}
g_CurrentEntity->accelerationX = 0x20000;
return;
}
DestroyEntity(g_CurrentEntity);
}
void CollectHeartVessel(void) {
if (g_CurrentPlayableCharacter != PLAYER_ALUCARD) {

View File

@ -27,7 +27,7 @@ void EntityEquipItemDrop(Entity* self) {
self->pfnUpdate = EntityPrizeDrop;
self->params = 0;
self->objectId = 3;
func_8019AFE8(0);
SetStep(0);
EntityPrizeDrop(self);
return;
}

View File

@ -74,6 +74,8 @@ extern u16 D_801811A4[];
extern u32 D_8018130C[];
extern u8 D_80181324[];
extern u16 D_80181328[];
extern u16 D_801810B0[];
extern u16 D_801810E0[];
extern s16 D_801A3EDE;
extern u16 D_801A3EE0;
extern s16 D_801A3EE2;

View File

@ -982,8 +982,39 @@ void func_801937BC(void) {}
void func_801937C4(void) { DestroyEntity(g_CurrentEntity); }
// DECOMP_ME_WIP CollectSubweapon https://decomp.me/scratch/GsS0m
INCLUDE_ASM("asm/us/st/mad/nonmatchings/D8C8", CollectSubweapon);
void CollectSubweapon(u16 subWeaponIdx) {
Entity* player = &PLAYER;
u16 subWeapon;
g_api.PlaySfx(0x672);
subWeapon = g_Status.subWeapon;
g_Status.subWeapon = D_80180D1C[subWeaponIdx];
if (subWeapon == g_Status.subWeapon) {
subWeapon = 1;
g_CurrentEntity->unk6D = 0x10;
} else {
subWeapon = D_80180D4C[subWeapon];
g_CurrentEntity->unk6D = 0x60;
}
if (subWeapon != 0) {
g_CurrentEntity->params = subWeapon;
g_CurrentEntity->posY.i.hi = player->posY.i.hi + 12;
g_CurrentEntity->step = 7;
g_CurrentEntity->step_s = 0;
g_CurrentEntity->accelerationY = -0x28000;
g_CurrentEntity->animCurFrame = 0;
g_CurrentEntity->ext.generic.unk88.S16.unk2 = 5;
if (player->facing != 1) {
g_CurrentEntity->accelerationX = -0x20000;
return;
}
g_CurrentEntity->accelerationX = 0x20000;
return;
}
DestroyEntity(g_CurrentEntity);
}
void CollectHeartVessel(void) {
g_api.PlaySfx(0x670);

View File

@ -52,13 +52,15 @@ extern s32 D_80097908;
// ST/MAD
extern u16 D_8018052C[];
extern u16 D_801806B4[];
extern u16 D_80180F5C[];
extern u16 D_80180544[];
extern ObjInit2 D_8018056C[];
extern u16 D_80180D1C[];
extern u16 D_80180D4C[];
extern s16 D_80180ED8[];
extern s32 D_80180E18[];
extern s32 D_80180EC4[];
extern s16 D_80180EDA[];
extern u16 D_80180F5C[];
extern u16 D_80180FBC[];
extern s32 D_80180FCC[];
extern s32 D_80180FE4[];

View File

@ -39,7 +39,7 @@ void EntityFlyingOwlAndLeaves(Entity* entity) {
g_api.PlaySfx(0x7A4);
}
if (entity->posX.i.hi < 192) {
func_801C58A4(3);
SetStep(3);
if (entity->params != 0) {
entity->accelerationX = 0x80000;
entity->accelerationY = 0x30000;
@ -849,15 +849,15 @@ u16 func_801C5844(u16 arg0, u16 arg1, u16 arg2) {
return arg2;
}
void func_801C58A4(u8 state) {
g_CurrentEntity->step = state;
void SetStep(u8 step) {
g_CurrentEntity->step = step;
g_CurrentEntity->step_s = 0;
g_CurrentEntity->animFrameIdx = 0;
g_CurrentEntity->animFrameDuration = 0;
}
void func_801C58C4(u8 state) {
g_CurrentEntity->step_s = state;
void func_801C58C4(u8 step_s) {
g_CurrentEntity->step_s = step_s;
g_CurrentEntity->animFrameIdx = 0;
g_CurrentEntity->animFrameDuration = 0;
}
@ -1112,7 +1112,38 @@ void CollectGold(u16 goldSize) {
DestroyEntity(g_CurrentEntity);
}
INCLUDE_ASM("asm/us/st/no3/nonmatchings/3E134", CollectSubweapon);
void CollectSubweapon(u16 subWeaponIdx) {
Entity* player = &PLAYER;
u16 subWeapon;
g_api.PlaySfx(NA_SE_PL_IT_PICKUP);
subWeapon = g_Status.subWeapon;
g_Status.subWeapon = D_801823F4[subWeaponIdx];
if (subWeapon == g_Status.subWeapon) {
subWeapon = 1;
g_CurrentEntity->unk6D = 0x10;
} else {
subWeapon = D_80182424[subWeapon];
g_CurrentEntity->unk6D = 0x60;
}
if (subWeapon != 0) {
g_CurrentEntity->params = subWeapon;
g_CurrentEntity->posY.i.hi = player->posY.i.hi + 12;
SetStep(7);
g_CurrentEntity->accelerationY = -0x28000;
g_CurrentEntity->animCurFrame = 0;
g_CurrentEntity->ext.generic.unk88.S16.unk2 = 5;
if (player->facing != 1) {
g_CurrentEntity->accelerationX = -0x20000;
return;
}
g_CurrentEntity->accelerationX = 0x20000;
return;
}
DestroyEntity(g_CurrentEntity);
}
void CollectHeartVessel(void) {
if (g_CurrentPlayableCharacter != PLAYER_ALUCARD) {

View File

@ -301,7 +301,7 @@ void EntityEquipItemDrop(Entity* self) {
self->pfnUpdate = EntityPrizeDrop;
self->params = 0;
self->objectId = 3;
func_801C58A4(0);
SetStep(0);
EntityPrizeDrop(self);
return;
}
@ -1264,7 +1264,7 @@ INCLUDE_ASM("asm/us/st/no3/nonmatchings/46684", func_801CF438);
void func_801CF58C(Entity* self) {
self->accelerationX = 0;
self->ext.generic.unk84.S16.unk2 = 0x100;
func_801C58A4(6);
SetStep(6);
g_api.PlaySfx(0x783);
self->ext.generic.unk80.modeS16.unk0 = 0x20;
}
@ -1273,7 +1273,7 @@ void func_801CF5E0(Entity* self) {
s16 temp_v0;
if (self->facing == func_801C4FD4()) {
func_801C58A4(5);
SetStep(5);
return;
}
@ -1286,21 +1286,21 @@ void func_801CF5E0(Entity* self) {
self->ext.generic.unk84.S16.unk0 - self->posX.i.hi - g_Camera.posX.i.hi;
if (temp_v0 > 16) {
func_801C58A4(3);
SetStep(3);
if (self->facing != 0) {
self->ext.generic.unk7C.S8.unk0 = 0;
} else {
self->ext.generic.unk7C.S8.unk0 = 1;
}
} else if (temp_v0 < -16) {
func_801C58A4(3);
SetStep(3);
if (self->facing != 0) {
self->ext.generic.unk7C.S8.unk0 = 1;
} else {
self->ext.generic.unk7C.S8.unk0 = 0;
}
} else {
func_801C58A4(7);
SetStep(7);
}
self->ext.generic.unk80.modeS16.unk0 = 0;
@ -1677,14 +1677,14 @@ void func_801D59D0(void) {
s32 temp2 = func_801C5A98(&D_80183C38, 3);
if ((temp == 128) || (temp2 & 2)) {
func_801C58A4(5);
SetStep(5);
return;
}
if (g_CurrentEntity->ext.generic.unk7C.U8.unk0 == 0) {
if (func_801C4F64() < 64) {
if (g_CurrentEntity->facing != (func_801C4FD4() & 1)) {
func_801C58A4(4);
SetStep(4);
}
}
} else {

View File

@ -44,7 +44,7 @@ void EntityZombie(Entity* self) {
case 2:
if (AnimateEntity(D_80183C84, self) == 0) {
func_801C58A4(3);
SetStep(3);
}
if (self->animFrameDuration == 0) {
self->hitboxOffY -= 2;
@ -63,7 +63,7 @@ void EntityZombie(Entity* self) {
if (temp_a0 & 0xC0) {
self->hitboxState = 0;
func_801C58A4(4);
SetStep(4);
}
break;

View File

@ -70,6 +70,7 @@ extern u8 D_80181B4C[];
extern u16 D_80181C8C[];
extern u16 D_80181CC0[];
extern s16 D_801820C4[];
extern u16 D_801823F4[];
extern u8* D_80182438[];
extern u16 D_80182424[];
extern u8* D_80182488[];

View File

@ -619,8 +619,8 @@ void SetStep(u8 step) {
g_CurrentEntity->animFrameDuration = 0;
}
void SetSubStep(u8 arg0) {
g_CurrentEntity->step_s = arg0;
void SetSubStep(u8 step_s) {
g_CurrentEntity->step_s = step_s;
g_CurrentEntity->animFrameIdx = 0;
g_CurrentEntity->animFrameDuration = 0;
}
@ -870,7 +870,38 @@ void CollectGold(u16 goldSize) {
DestroyEntity(g_CurrentEntity);
}
INCLUDE_ASM("asm/us/st/np3/nonmatchings/390BC", CollectSubweapon);
void CollectSubweapon(u16 subWeaponIdx) {
Entity* player = &PLAYER;
u16 subWeapon;
g_api.PlaySfx(NA_SE_PL_IT_PICKUP);
subWeapon = g_Status.subWeapon;
g_Status.subWeapon = D_80181D80[subWeaponIdx];
if (subWeapon == g_Status.subWeapon) {
subWeapon = 1;
g_CurrentEntity->unk6D = 0x10;
} else {
subWeapon = D_80181DB0[subWeapon];
g_CurrentEntity->unk6D = 0x60;
}
if (subWeapon != 0) {
g_CurrentEntity->params = subWeapon;
g_CurrentEntity->posY.i.hi = player->posY.i.hi + 12;
SetStep(7);
g_CurrentEntity->accelerationY = -0x28000;
g_CurrentEntity->animCurFrame = 0;
g_CurrentEntity->ext.generic.unk88.S16.unk2 = 5;
if (player->facing != 1) {
g_CurrentEntity->accelerationX = -0x20000;
return;
}
g_CurrentEntity->accelerationX = 0x20000;
return;
}
DestroyEntity(g_CurrentEntity);
}
void CollectHeartVessel(void) {
if (g_CurrentPlayableCharacter != PLAYER_ALUCARD) {

View File

@ -179,6 +179,8 @@ extern u8 D_801815FC[];
extern u16 D_80181618[];
extern u16 D_8018164C[];
extern s16 D_80181A50[];
extern u16 D_80181D80[];
extern u16 D_80181DB0[];
extern const u32* D_80181DC4[];
extern const s32 c_GoldPrizes[];
extern u16 D_80181E74[];

View File

@ -829,20 +829,16 @@ u16 func_801BD4CC(u16 arg0, s16 arg1, s16 arg2) {
}
void SetStep(u8 step) {
Entity* entity = g_CurrentEntity;
entity->step = step;
entity->step_s = 0;
entity->animFrameIdx = 0;
entity->animFrameDuration = 0;
g_CurrentEntity->step = step;
g_CurrentEntity->step_s = 0;
g_CurrentEntity->animFrameIdx = 0;
g_CurrentEntity->animFrameDuration = 0;
}
void SetSubStep(u8 step_s) {
Entity* entity = g_CurrentEntity;
entity->step_s = step_s;
entity->animFrameIdx = 0;
entity->animFrameDuration = 0;
g_CurrentEntity->step_s = step_s;
g_CurrentEntity->animFrameIdx = 0;
g_CurrentEntity->animFrameDuration = 0;
}
void func_801BD568(u16 arg0, u16 sfxId) {
@ -1092,8 +1088,38 @@ void CollectGold(u16 goldSize) {
DestroyEntity(g_CurrentEntity);
}
// DECOMP_ME_WIP CollectSubweapon https://decomp.me/scratch/gto6i
INCLUDE_ASM("asm/us/st/nz0/nonmatchings/36DE4", CollectSubweapon);
void CollectSubweapon(u16 subWeaponIdx) {
Entity* player = &PLAYER;
u16 subWeapon;
g_api.PlaySfx(NA_SE_PL_IT_PICKUP);
subWeapon = g_Status.subWeapon;
g_Status.subWeapon = D_80181CA8[subWeaponIdx];
if (subWeapon == g_Status.subWeapon) {
subWeapon = 1;
g_CurrentEntity->unk6D = 0x10;
} else {
subWeapon = D_80181CD8[subWeapon];
g_CurrentEntity->unk6D = 0x60;
}
if (subWeapon != 0) {
g_CurrentEntity->params = subWeapon;
g_CurrentEntity->posY.i.hi = player->posY.i.hi + 12;
SetStep(7);
g_CurrentEntity->accelerationY = -0x28000;
g_CurrentEntity->animCurFrame = 0;
g_CurrentEntity->ext.generic.unk88.S16.unk2 = 5;
if (player->facing != 1) {
g_CurrentEntity->accelerationX = -0x20000;
return;
}
g_CurrentEntity->accelerationX = 0x20000;
return;
}
DestroyEntity(g_CurrentEntity);
}
void CollectHeartVessel(void) {
if (g_CurrentPlayableCharacter != PLAYER_ALUCARD) {

View File

@ -259,6 +259,7 @@ extern s32 D_80182600[];
extern s32 D_8018216C;
extern s32 D_80182174;
extern u16 D_80180BD4[];
extern u16 D_80181CA8[];
extern u16 D_80181CD8[];
extern u8* D_80181D3C[];
extern u16 D_80180C94[];

View File

@ -165,7 +165,7 @@ INCLUDE_ASM("asm/us/st/rwrp/nonmatchings/8DF0", func_8018C72C);
INCLUDE_ASM("asm/us/st/rwrp/nonmatchings/8DF0", func_8018C7E0);
void func_8018C854(u16 objectId, Entity* source, Entity* entity) {
func_8018D580(entity);
DestroyEntity(entity);
entity->objectId = objectId;
entity->pfnUpdate = D_801803E0[objectId];
entity->posX.i.hi = source->posX.i.hi;
@ -176,7 +176,7 @@ INCLUDE_ASM("asm/us/st/rwrp/nonmatchings/8DF0", func_8018C8D0);
INCLUDE_ASM("asm/us/st/rwrp/nonmatchings/8DF0", func_8018C948);
INCLUDE_ASM("asm/us/st/rwrp/nonmatchings/8DF0", func_8018D580);
INCLUDE_ASM("asm/us/st/rwrp/nonmatchings/8DF0", DestroyEntity);
INCLUDE_ASM("asm/us/st/rwrp/nonmatchings/8DF0", func_8018D5EC);
@ -239,15 +239,15 @@ INCLUDE_ASM("asm/us/st/rwrp/nonmatchings/8DF0", func_8018E118);
INCLUDE_ASM("asm/us/st/rwrp/nonmatchings/8DF0", func_8018E160);
void func_8018E1C0(s32 arg0) {
g_CurrentEntity->step = arg0 & 0xFF;
void SetStep(u8 step) {
g_CurrentEntity->step = step;
g_CurrentEntity->step_s = 0;
g_CurrentEntity->animFrameIdx = 0;
g_CurrentEntity->animFrameDuration = 0;
}
void func_8018E1E0(s32 arg0) {
g_CurrentEntity->step_s = arg0 & 0xFF;
void func_8018E1E0(u8 step_s) {
g_CurrentEntity->step_s = step_s;
g_CurrentEntity->animFrameIdx = 0;
g_CurrentEntity->animFrameDuration = 0;
}
@ -294,13 +294,44 @@ INCLUDE_ASM("asm/us/st/rwrp/nonmatchings/8DF0", func_8018EC10);
INCLUDE_ASM("asm/us/st/rwrp/nonmatchings/8DF0", func_8018EC90);
INCLUDE_ASM("asm/us/st/rwrp/nonmatchings/8DF0", func_8018ED6C);
void CollectSubweapon(u16 subWeaponIdx) {
Entity* player = &PLAYER;
u16 subWeapon;
g_api.PlaySfx(NA_SE_PL_IT_PICKUP);
subWeapon = g_Status.subWeapon;
g_Status.subWeapon = D_80180DC4[subWeaponIdx];
if (subWeapon == g_Status.subWeapon) {
subWeapon = 1;
g_CurrentEntity->unk6D = 0x10;
} else {
subWeapon = D_80180DF4[subWeapon];
g_CurrentEntity->unk6D = 0x60;
}
if (subWeapon != 0) {
g_CurrentEntity->params = subWeapon;
g_CurrentEntity->posY.i.hi = player->posY.i.hi + 12;
SetStep(7);
g_CurrentEntity->accelerationY = -0x28000;
g_CurrentEntity->animCurFrame = 0;
g_CurrentEntity->ext.generic.unk88.S16.unk2 = 5;
if (player->facing != 1) {
g_CurrentEntity->accelerationX = -0x20000;
return;
}
g_CurrentEntity->accelerationX = 0x20000;
return;
}
DestroyEntity(g_CurrentEntity);
}
INCLUDE_ASM("asm/us/st/rwrp/nonmatchings/8DF0", func_8018EE84);
INCLUDE_ASM("asm/us/st/rwrp/nonmatchings/8DF0", func_8018EF28);
void func_8018EF78(void) { func_8018D580(g_CurrentEntity); }
void func_8018EF78(void) { DestroyEntity(g_CurrentEntity); }
INCLUDE_ASM("asm/us/st/rwrp/nonmatchings/8DF0", func_8018EFA0);
@ -586,7 +617,7 @@ void EntitySoulStealOrb(Entity* self) {
case 0:
primIndex = g_api.AllocPrimitives(PRIM_GT4, 1);
if (primIndex == -1) {
func_8018D580(self);
DestroyEntity(self);
return;
}
func_8018E290(D_8018044C);
@ -621,7 +652,7 @@ void EntitySoulStealOrb(Entity* self) {
g_Player.unk56 = 1;
g_Player.unk58 = 8;
}
func_8018D580(self);
DestroyEntity(self);
return;
}
if (self->unk1A < 0x100) {

View File

@ -21,4 +21,7 @@ extern u16 D_80181110[];
// *** EntitySoulStealOrb properties END ***
extern u16 D_80180DC4[];
extern u16 D_80180DF4[];
#endif

View File

@ -1037,6 +1037,7 @@ u8 D_80180EEC[] = {
0x02, 0x0E, 0x02, 0x0F, 0x02, 0x10, 0x02, 0x11, 0x02, 0x12,
0x03, 0x13, 0x04, 0x14, 0x00, 0x00, 0x00, 0x00,
};
extern u16 D_80180F1C[];
u8 D_80180F08[] = {
0x02, 0x15, 0x02, 0x16, 0x02, 0x17, 0x02, 0x18, 0x02, 0x19, 0x02, 0x1A,
0x02, 0x1B, 0x02, 0x1C, 0x02, 0x1D, 0x02, 0x1E, 0x02, 0x1F, 0x02, 0x20,
@ -2344,15 +2345,15 @@ u16 func_8018C1E0(u16 arg0, s16 arg1, s16 arg2) {
return arg2;
}
void func_8018C240(u8 step) {
void SetStep(u8 step) {
g_CurrentEntity->step = step;
g_CurrentEntity->step_s = 0;
g_CurrentEntity->animFrameIdx = 0;
g_CurrentEntity->animFrameDuration = 0;
}
void func_8018C260(u8 arg0) {
g_CurrentEntity->step_s = arg0;
void func_8018C260(u8 step_s) {
g_CurrentEntity->step_s = step_s;
g_CurrentEntity->animFrameIdx = 0;
g_CurrentEntity->animFrameDuration = 0;
}
@ -2606,43 +2607,38 @@ void CollectGold(u16 goldSize) {
DestroyEntity(g_CurrentEntity);
}
#ifndef NON_MATCHING
void CollectSubweapon(u16);
INCLUDE_ASM("asm/us/st/wrp/nonmatchings/6FD0", CollectSubweapon);
#else
void CollectSubweapon(u16 arg0) {
u16 temp_v0;
u16 var_a0;
Entity* player;
void CollectSubweapon(u16 subWeaponIdx) {
Entity* player = &PLAYER;
u16 subWeapon;
g_api.PlaySfx(NA_SE_PL_IT_PICKUP);
player = &PLAYER;
temp_v0 = D_80180DC4[arg0];
// player_equip_left_hand = temp_v0;
if (player_equip_left_hand == temp_v0) {
var_a0 = 1;
subWeapon = g_Status.subWeapon;
g_Status.subWeapon = D_80180DC4[subWeaponIdx];
if (subWeapon == g_Status.subWeapon) {
subWeapon = 1;
g_CurrentEntity->unk6D = 0x10;
} else {
var_a0 = D_80180DF4[player_equip_left_hand];
subWeapon = D_80180DF4[subWeapon];
g_CurrentEntity->unk6D = 0x60;
}
if (var_a0 != 0) {
g_CurrentEntity->params = var_a0;
g_CurrentEntity->posY.i.hi = player->posY.i.hi + 0xC;
func_8018C240(7);
if (subWeapon != 0) {
g_CurrentEntity->params = subWeapon;
g_CurrentEntity->posY.i.hi = player->posY.i.hi + 12;
SetStep(7);
g_CurrentEntity->accelerationY = -0x28000;
g_CurrentEntity->animCurFrame = 0;
g_CurrentEntity->unk8A = 5;
g_CurrentEntity->ext.generic.unk88.S16.unk2 = 5;
if (player->facing != 1) {
g_CurrentEntity->accelerationX = -0x20000;
} else {
g_CurrentEntity->accelerationX = 0x20000;
return;
}
} else {
DestroyEntity(g_CurrentEntity);
g_CurrentEntity->accelerationX = 0x20000;
return;
}
DestroyEntity(g_CurrentEntity);
}
#endif
void CollectHeartVessel(void) {
if (g_CurrentPlayableCharacter != PLAYER_ALUCARD) {

View File

@ -316,7 +316,7 @@ void EntityEquipItemDrop(Entity* self) {
self->pfnUpdate = EntityPrizeDrop;
self->params = 0;
self->objectId = 3;
func_8018C240(0);
SetStep(0);
EntityPrizeDrop(self);
return;
}