Merge pull request #338 from TwilitRealm/feature/no-heart-drops

No Heart Drops Feature
This commit is contained in:
TakaRikka
2026-04-12 13:42:16 -07:00
committed by GitHub
4 changed files with 69 additions and 0 deletions
+1
View File
@@ -40,6 +40,7 @@ struct UserSettings {
ConfigVar<bool> disableRupeeCutscenes;
ConfigVar<bool> noSwordRecoil;
ConfigVar<int> damageMultiplier;
ConfigVar<bool> noHeartDrops;
ConfigVar<bool> instantDeath;
ConfigVar<bool> fastClimbing;
ConfigVar<bool> noMissClimbing;
+6
View File
@@ -131,6 +131,12 @@ namespace dusk {
if (ImGui::BeginMenu("Difficulty")) {
config::ImGuiSliderInt("Damage Multiplier", getSettings().game.damageMultiplier, 1, 8, "x%d");
config::ImGuiCheckbox("No Heart Drops", getSettings().game.noHeartDrops);
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Hearts will never drop from enemies,\n"
"pots and various other places.");
}
config::ImGuiCheckbox("Instant Death", getSettings().game.instantDeath);
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Any hit will instantly kill you.");
+2
View File
@@ -28,6 +28,7 @@ UserSettings g_userSettings = {
.disableRupeeCutscenes {"game.disableRupeeCutscenes", false},
.noSwordRecoil {"game.noSwordRecoil", false},
.damageMultiplier {"game.damageMultiplier", 1},
.noHeartDrops{"game.noHeartDrops", false},
.instantDeath {"game.instantDeath", false},
.fastClimbing {"game.fastClimbing", false},
.noMissClimbing {"game.noMissClimbing", false},
@@ -96,6 +97,7 @@ void registerSettings() {
Register(g_userSettings.game.disableRupeeCutscenes);
Register(g_userSettings.game.noSwordRecoil);
Register(g_userSettings.game.damageMultiplier);
Register(g_userSettings.game.noHeartDrops);
Register(g_userSettings.game.instantDeath);
Register(g_userSettings.game.fastClimbing);
Register(g_userSettings.game.fastTears);
+60
View File
@@ -1390,6 +1390,12 @@ fpc_ProcID fopAcM_createItemForPresentDemo(cXyz const* i_pos, int i_itemNo, u8 p
JUT_ASSERT(3214, 0 <= i_itemNo && i_itemNo < 256);
dComIfGp_event_setGtItm(i_itemNo);
#if TARGET_PC
if (dusk::getSettings().game.noHeartDrops && isHeart(i_itemNo)) {
return fpcM_ERROR_PROCESS_ID_e;
}
#endif
if (i_itemNo == dItemNo_NONE_e) {
OS_REPORT("プレゼントデモ用なのに「ハズレ」です![%d]\n", i_itemNo); // Even though it is for a Present Demo, it is a 'Miss'!
return fpcM_ERROR_PROCESS_ID_e;
@@ -1404,6 +1410,12 @@ fpc_ProcID fopAcM_createItemForTrBoxDemo(cXyz const* i_pos, int i_itemNo, int i_
JUT_ASSERT(3259, 0 <= i_itemNo && i_itemNo < 256);
dComIfGp_event_setGtItm(i_itemNo);
#if TARGET_PC
if (dusk::getSettings().game.noHeartDrops && isHeart(i_itemNo)) {
return fpcM_ERROR_PROCESS_ID_e;
}
#endif
if (i_itemNo == dItemNo_NONE_e) {
OS_REPORT("ゲットデモ用なのに「ハズレ」です![%d]\n", i_itemNo); // Even though it is for a Get Demo, it is a 'Miss'!
return fpcM_ERROR_PROCESS_ID_e;
@@ -1529,6 +1541,12 @@ fpc_ProcID fopAcM_createItemFromTable(cXyz const* i_pos, int i_itemNo, int i_ite
JUT_ASSERT(3655, 0 <= i_itemNo && i_itemNo <= 255 && (-1 <= i_itemBitNo && i_itemBitNo < (dSv_info_c::DAN_ITEM + dSv_info_c::MEMORY_ITEM + dSv_info_c::ZONE_ITEM )) || i_itemBitNo == 255);
// clang-format on
#if TARGET_PC
if (dusk::getSettings().game.noHeartDrops && isHeart(i_itemNo)) {
return fpcM_ERROR_PROCESS_ID_e;
}
#endif
u8 tableNum;
ItemTableList* tableList;
tableList = (ItemTableList*)dComIfGp_getItemTable();
@@ -1572,6 +1590,12 @@ fpc_ProcID fopAcM_createDemoItem(const cXyz* i_pos, int i_itemNo, int i_itemBitN
JUT_ASSERT(3824, 0 <= i_itemNo && i_itemNo < 256 && (-1 <= i_itemBitNo && i_itemBitNo < (dSv_info_c::DAN_ITEM + dSv_info_c::MEMORY_ITEM + dSv_info_c::ZONE_ITEM )) || i_itemBitNo == 255);
// clang-format on
#if TARGET_PC
if (dusk::getSettings().game.noHeartDrops && isHeart(i_itemNo)) {
return fpcM_ERROR_PROCESS_ID_e;
}
#endif
if (i_itemNo == dItemNo_NONE_e) {
return fpcM_ERROR_PROCESS_ID_e;
}
@@ -1583,6 +1607,12 @@ fpc_ProcID fopAcM_createDemoItem(const cXyz* i_pos, int i_itemNo, int i_itemBitN
fpc_ProcID fopAcM_createItemForBoss(const cXyz* i_pos, int i_itemNo, int i_roomNo,
const csXyz* i_angle, const cXyz* i_scale, f32 i_speedF,
f32 i_speedY, int param_8) {
#if TARGET_PC
if (dusk::getSettings().game.noHeartDrops && isHeart(i_itemNo)) {
return fpcM_ERROR_PROCESS_ID_e;
}
#endif
int _ = -1;
u32 params = 0xFFFF0000 | param_8 << 8 | (i_itemNo & 0xFF);
@@ -1599,6 +1629,12 @@ fpc_ProcID fopAcM_createItemForBoss(const cXyz* i_pos, int i_itemNo, int i_roomN
fpc_ProcID fopAcM_createItemForMidBoss(const cXyz* i_pos, int i_itemNo, int i_roomNo,
const csXyz* i_angle, const cXyz* i_scale, int param_6,
int param_7) {
#if TARGET_PC
if (dusk::getSettings().game.noHeartDrops && isHeart(i_itemNo)) {
return fpcM_ERROR_PROCESS_ID_e;
}
#endif
UNUSED(i_angle);
UNUSED(param_6);
fpc_ProcID ret = -1;
@@ -1610,6 +1646,12 @@ fpc_ProcID fopAcM_createItemForMidBoss(const cXyz* i_pos, int i_itemNo, int i_ro
fopAc_ac_c* fopAcM_createItemForDirectGet(const cXyz* i_pos, int i_itemNo, int i_roomNo,
const csXyz* i_angle, const cXyz* i_scale, f32 i_speedF,
f32 i_speedY) {
#if TARGET_PC
if (dusk::getSettings().game.noHeartDrops && isHeart(i_itemNo)) {
return NULL;
}
#endif
fopAc_ac_c* item = fopAcM_fastCreateItem(i_pos, i_itemNo, i_roomNo, i_angle, i_scale, &i_speedF, &i_speedY, -1,
0x7, NULL);
fopAc_ac_c* ret = item;
@@ -1619,6 +1661,12 @@ fopAc_ac_c* fopAcM_createItemForDirectGet(const cXyz* i_pos, int i_itemNo, int i
fopAc_ac_c* fopAcM_createItemForSimpleDemo(const cXyz* i_pos, int i_itemNo, int i_roomNo,
const csXyz* i_angle, const cXyz* i_scale, f32 i_speedF,
f32 i_speedY) {
#if TARGET_PC
if (dusk::getSettings().game.noHeartDrops && isHeart(i_itemNo)) {
return NULL;
}
#endif
fopAc_ac_c* item = fopAcM_fastCreateItem(i_pos, i_itemNo, i_roomNo, i_angle, i_scale, &i_speedF, &i_speedY, -1,
0x4, NULL);
fopAc_ac_c* ret = item;
@@ -1631,6 +1679,12 @@ fpc_ProcID fopAcM_createItem(const cXyz* i_pos, int i_itemNo, int i_itemBitNo, i
JUT_ASSERT(4067, 0 <= i_itemNo && i_itemNo < 256 && (-1 <= i_itemBitNo && i_itemBitNo < (dSv_info_c::DAN_ITEM + dSv_info_c::MEMORY_ITEM + dSv_info_c::ZONE_ITEM )) || i_itemBitNo == 255);
// clang-format on
#if TARGET_PC
if (dusk::getSettings().game.noHeartDrops && isHeart(i_itemNo)) {
return fpcM_ERROR_PROCESS_ID_e;
}
#endif
if (i_itemNo == dItemNo_NONE_e) {
return fpcM_ERROR_PROCESS_ID_e;
}
@@ -1695,6 +1749,12 @@ fopAc_ac_c* fopAcM_fastCreateItem2(const cXyz* i_pos, int i_itemNo, int i_itemBi
JUT_ASSERT(4202, 0 <= i_itemNo && i_itemNo < 256 && (-1 <= i_itemBitNo && i_itemBitNo < (dSv_info_c::DAN_ITEM + dSv_info_c::MEMORY_ITEM + dSv_info_c::ZONE_ITEM )) || i_itemBitNo == 255);
// clang-format on
#if TARGET_PC
if (dusk::getSettings().game.noHeartDrops && isHeart(i_itemNo)) {
return NULL;
}
#endif
csXyz item_angle(csXyz::Zero);
if (i_itemNo == dItemNo_NONE_e) {