Merge branch 'main' into feature/no-low-hp-sound

This commit is contained in:
MelonSpeedruns
2026-04-04 21:50:00 -04:00
committed by GitHub
7 changed files with 81 additions and 27 deletions
+5 -2
View File
@@ -35,6 +35,7 @@ struct UserSettings {
int damageMultiplier;
bool instantDeath;
bool fastClimbing;
bool noMissClimbing;
bool fastTears;
// Preferences
@@ -46,10 +47,12 @@ struct UserSettings {
bool useWaterProjectionOffset;
// Audio
bool noLowHpSound;
bool noLowHpSound;
bool midnasLamentNonStop;
// Cheats
bool enableFastIronBoots;
bool canTransformAnywhere;
// Technical
bool restoreWiiGlitches;
+9
View File
@@ -107,6 +107,15 @@ static Z2EnemyInfo mEnemyInfo[64] = {
void Z2SoundObjMgr::searchEnemy() {
twilightBattle_ = 0;
#if TARGET_PC
if (Z2GetSeqMgr()->checkBgmIDPlaying(Z2BGM_MIDNA_SOS) &&
dusk::getSettings().game.midnasLamentNonStop)
{
Z2GetSeqMgr()->changeSubBgmStatus(0);
return;
}
#endif
if (!Z2GetLink()) {
Z2GetSeqMgr()->stopBattleBgm(1, 1);
return;
+28 -22
View File
@@ -19,28 +19,6 @@ void daAlink_c::handleQuickTransform() {
return;
}
// Make sure Link isn't riding anything (horse, boar, etc.)
if (checkRide()) {
return;
}
switch (mProcID) {
// Make sure Link is not underwater or talking to someone.
case PROC_TALK:
case PROC_SWIM_UP:
case PROC_SWIM_DIVE:
return;
// If Link is targeting or pulling a chain, we don't want to remove the ability to use items in combat accidently.
case PROC_ATN_ACTOR_MOVE:
case PROC_ATN_ACTOR_WAIT:
case PROC_WOLF_ATN_AC_MOVE:
break;
default:
// Disable the input that was just pressed, as sometimes it could cause items to be used or Wolf Link to dig.
mDoCPd_c::getCpadInfo(PAD_1).mPressedButtonFlags = 0;
break;
}
// Ensure there is a proper pointer to the mMeterClass and mpMeterDraw structs in g_meter2_info.
const auto meterClassPtr = g_meter2_info.getMeterClass();
if (!meterClassPtr) {
@@ -52,18 +30,46 @@ void daAlink_c::handleQuickTransform() {
return;
}
mDoCPd_c::getCpadInfo(PAD_1).mPressedButtonFlags = 0;
// Ensure that the Z Button is not dimmed
if (meterDrawPtr->getButtonZAlpha() != 1.f) {
Z2GetAudioMgr()->seStart(Z2SE_SYS_ERROR, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0);
return;
}
// The game will crash if trying to quick transform while holding the Ball and Chain
if (mEquipItem == dItemNo_IRONBALL_e) {
Z2GetAudioMgr()->seStart(Z2SE_SYS_ERROR, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0);
return;
}
// Use the game's default checks for if the player can currently transform
if (!m_midnaActor->checkMetamorphoseEnableBase()) {
Z2GetAudioMgr()->seStart(Z2SE_SYS_ERROR, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0);
return;
}
bool canTransform = false;
if (mLinkAcch.ChkGroundHit() && !checkModeFlg(MODE_PLAYER_FLY) && !checkMagneBootsOn()) {
if (!checkForestOldCentury()) {
if (checkMidnaRide()) {
if ((checkWolf() &&
(checkModeFlg(MODE_UNK_1000) || dComIfGp_checkPlayerStatus0(0, 0x10))) ||
(!checkWolf() &&
(checkEventRun() || getMidnaActor()->checkMetamorphoseEnable()) &&
(checkModeFlg(4) || dComIfGp_checkPlayerStatus0(0, 0x10))))
{
canTransform = true;
}
}
}
}
if (!canTransform)
{
Z2GetAudioMgr()->seStart(Z2SE_SYS_ERROR, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0);
return;
}
+12
View File
@@ -285,7 +285,11 @@ int daAlink_c::procHangStartInit() {
offNoResetFlg2(FLG2_UNK_2000);
if (checkHangFootWall()) {
#if TARGET_PC
if (!is_prev_hangReady && cM_rnd() < 0.7f && !dusk::getSettings().game.noMissClimbing) {
#else
if (!is_prev_hangReady && cM_rnd() < 0.7f) {
#endif
setSingleAnimeParam(ANM_CLIMB_HANG_MISS, &mpHIO->mLadder.m.mWallAttachMissAnm);
field_0x3478 = mpHIO->mLadder.m.mWallAttachMissAnm.mCancelFrame;
voiceStart(Z2SE_AL_V_FOOT_MISS);
@@ -2084,7 +2088,11 @@ int daAlink_c::procClimbUpStartInit(int param_0) {
speed.y = 0.0f;
mNormalSpeed = 0.0f;
#if TARGET_PC
if (param_0 || var_r29 || cM_rnd() < 0.3f || dusk::getSettings().game.noMissClimbing) {
#else
if (param_0 || var_r29 || cM_rnd() < 0.3f) {
#endif
setSingleAnimeParam(ANM_CLIMB_HANG, &mpHIO->mLadder.m.mWallAttachAnm);
field_0x3478 = mpHIO->mLadder.m.mWallAttachAnm.mCancelFrame;
voiceStart(Z2SE_AL_V_JUMP_HANG);
@@ -2161,7 +2169,11 @@ int daAlink_c::procClimbDownStartInit(s16 param_0) {
deleteEquipItem(TRUE, FALSE);
#if TARGET_PC
if (cM_rnd() < 0.7f || dusk::getSettings().game.noMissClimbing) {
#else
if (cM_rnd() < 0.7f) {
#endif
setSingleAnimeParam(ANM_CLIMB_HANG, &mpHIO->mLadder.m.mWallAttachAnm);
field_0x3478 = mpHIO->mLadder.m.mWallAttachAnm.mCancelFrame;
mProcVar0.field_0x3008 = 0;
+8 -3
View File
@@ -3046,12 +3046,17 @@ void daMidna_c::setMidnaNoDrawFlg() {
BOOL daMidna_c::checkMetamorphoseEnableBase() {
BOOL tmp;
if (
!daAlink_getAlinkActorClass()->checkMidnaRide() || (g_env_light.mEvilInitialized & 0x80) ||
if (!daAlink_getAlinkActorClass()->checkMidnaRide() || (g_env_light.mEvilInitialized & 0x80) ||
/* dSv_event_flag_c::M_077 - Main Event - Get shadow crystal (can now transform) */
!dComIfGs_isEventBit(0xD04) ||
#if TARGET_PC
(fopAcIt_Judge((fopAcIt_JudgeFunc)daMidna_searchNpc, &tmp) &&
!dusk::getSettings().game.canTransformAnywhere)
#else
fopAcIt_Judge((fopAcIt_JudgeFunc)daMidna_searchNpc, &tmp)
) {
#endif
)
{
return FALSE;
}
return TRUE;
+16
View File
@@ -37,6 +37,12 @@ namespace dusk {
ImGui::SetTooltip("Quicker climbing on ladders and vines like the HD version");
}
ImGui::Checkbox("No Climbing Miss Animation", &getSettings().game.noMissClimbing);
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Prevents Link from playing a struggle animation\n"
"when using the Clawshot on vines at a weird angle");
}
ImGui::Checkbox("Faster Tears of Light", &getSettings().game.fastTears);
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Tears of Light dropped by Shadow Insects pop out faster like the HD version");
@@ -71,6 +77,10 @@ namespace dusk {
ImGui::Checkbox("No Low HP Sound", &getSettings().game.noLowHpSound);
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Disable the beeping sound when having low health");
ImGui::Checkbox("Non-Stop Midna's Lament", &getSettings().game.midnasLamentNonStop);
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Prevents enemy music while Midna's Lament is playing");
}
ImGui::EndMenu();
@@ -79,6 +89,12 @@ namespace dusk {
if (ImGui::BeginMenu("Cheats")) {
ImGui::Checkbox("Fast Iron Boots", &getSettings().game.enableFastIronBoots);
ImGui::Checkbox("Can Transform Anywhere",
&getSettings().game.canTransformAnywhere);
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Allows you to transform between forms even if NPCs are looking");
}
ImGui::EndMenu();
}
+3
View File
@@ -31,6 +31,7 @@ UserSettings g_userSettings = {
.damageMultiplier = 1,
.instantDeath = false,
.fastClimbing = false,
.noMissClimbing = false,
.fastTears = false,
// Preferences
@@ -43,9 +44,11 @@ UserSettings g_userSettings = {
// Audio
.noLowHpSound = false,
.midnasLamentNonStop = false,
// Cheats
.enableFastIronBoots = false,
.canTransformAnywhere = false,
// Technical
.restoreWiiGlitches = false,