CEN HD CollectHeartVessel/CollectLifeVessel (#1717)

This commit is contained in:
sozud 2024-10-02 17:36:30 -07:00 committed by GitHub
parent 6903e8f2bf
commit c90cbfaebe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 53 additions and 44 deletions

View File

@ -15,6 +15,8 @@ actor_names = 0x801806B4;
D_80180768 = 0x80180798;
D_80180780 = 0x801807B0;
D_80180C94 = 0x80180DEC;
aluric_subweapons_idx = 0x80180F38;
aluric_subweapons_id = 0x80180F4C;
g_goldCollectTexts = 0x80180F60;
c_GoldPrizes = 0x80180F88;
c_HeartPrizes = 0x80181018;

View File

@ -17,11 +17,14 @@
#include "../collect_gold.h"
INCLUDE_ASM("st/cen/nonmatchings/e_collect", CollectSubweapon);
extern u16 aluric_subweapons_idx[];
extern u16 aluric_subweapons_id[];
#include "../collect_subweapon.h"
#include "../collect_heart_vessel.h"
INCLUDE_ASM("st/cen/nonmatchings/e_collect", CollectLifeVessel);
#include "../collect_life_vessel.h"
INCLUDE_ASM("st/cen/nonmatchings/e_collect", DestroyCurrentEntity);

View File

@ -0,0 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
static void CollectLifeVessel(void) {
g_api.PlaySfx(SFX_HEART_PICKUP);
g_api.func_800FE044(5, 0x8000);
DestroyEntity(g_CurrentEntity);
}

View File

@ -0,0 +1,38 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
static void CollectSubweapon(u16 subWeaponIdx) {
Entity* player = &PLAYER;
u16 subWeapon;
g_api.PlaySfx(SFX_ITEM_PICKUP);
subWeapon = g_Status.subWeapon;
g_Status.subWeapon = aluric_subweapons_idx[subWeaponIdx - 14];
if (subWeapon == g_Status.subWeapon) {
subWeapon = 1;
g_CurrentEntity->unk6D[0] = 0x10;
} else {
subWeapon = aluric_subweapons_id[subWeapon];
g_CurrentEntity->unk6D[0] = 0x60;
}
if (subWeapon) {
g_CurrentEntity->params = subWeapon;
g_CurrentEntity->posY.i.hi = player->posY.i.hi + 12;
#if defined VERSION_BETA || STAGE == STAGE_ST0
g_CurrentEntity->step = 7;
g_CurrentEntity->step_s = 0;
#else
SetStep(7);
#endif
g_CurrentEntity->velocityY = FIX(-2.5);
g_CurrentEntity->animCurFrame = 0;
g_CurrentEntity->ext.equipItemDrop.unk8A = 5;
if (player->facingLeft != 1) {
g_CurrentEntity->velocityX = FIX(-2);
return;
}
g_CurrentEntity->velocityX = FIX(2);
return;
}
DestroyEntity(g_CurrentEntity);
}

View File

@ -160,43 +160,7 @@ void func_801937BC(void) {}
void UnusedDestroyCurrentEntity(void) { DestroyEntity(g_CurrentEntity); }
#endif
static void CollectSubweapon(u16 subWeaponIdx) {
Entity* player = &PLAYER;
u16 subWeapon;
g_api.PlaySfx(SFX_ITEM_PICKUP);
subWeapon = g_Status.subWeapon;
g_Status.subWeapon = aluric_subweapons_idx[subWeaponIdx - 14];
if (subWeapon == g_Status.subWeapon) {
subWeapon = 1;
g_CurrentEntity->unk6D[0] = 0x10;
} else {
subWeapon = aluric_subweapons_id[subWeapon];
g_CurrentEntity->unk6D[0] = 0x60;
}
if (subWeapon) {
g_CurrentEntity->params = subWeapon;
g_CurrentEntity->posY.i.hi = player->posY.i.hi + 12;
#if defined VERSION_BETA || STAGE == STAGE_ST0
g_CurrentEntity->step = 7;
g_CurrentEntity->step_s = 0;
#else
SetStep(7);
#endif
g_CurrentEntity->velocityY = FIX(-2.5);
g_CurrentEntity->animCurFrame = 0;
g_CurrentEntity->ext.equipItemDrop.unk8A = 5;
if (player->facingLeft != 1) {
g_CurrentEntity->velocityX = FIX(-2);
return;
}
g_CurrentEntity->velocityX = FIX(2);
return;
}
DestroyEntity(g_CurrentEntity);
}
#include "collect_subweapon.h"
#if STAGE != STAGE_ST0
#include "collect_heart_vessel.h"

View File

@ -160,11 +160,7 @@ static void CollectSubweapon(u16 subWeaponIdx) {
#include "../collect_heart_vessel.h"
static void CollectLifeVessel(void) {
g_api.PlaySfx(SFX_HEART_PICKUP);
g_api.func_800FE044(5, 0x8000);
DestroyEntity(g_CurrentEntity);
}
#include "../collect_life_vessel.h"
static void CollectDummy(u16 id) { DestroyEntity(g_CurrentEntity); }