Added howling anywhere (R+X)

This commit is contained in:
MelonSpeedruns
2026-04-13 18:08:05 -04:00
parent ad94d9656f
commit d865c82f76
11 changed files with 102 additions and 45 deletions
+1
View File
@@ -4549,6 +4549,7 @@ public:
/* 0x03850 */ daAlink_procFunc mpProcFunc;
#if TARGET_PC
void handleWolfHowl();
void handleQuickTransform();
bool checkGyroAimItemContext();
#endif
-3
View File
@@ -27,9 +27,6 @@ public:
bool chkEveOccur();
void exeModeHowl();
void exeModeMapDisp();
#if TARGET_PC
void exeModeSetTime();
#endif
bool chkMapDispMode();
u8 getGoldWolfIdx();
+1 -1
View File
@@ -61,7 +61,7 @@ struct UserSettings {
ConfigVar<bool> noMissClimbing;
ConfigVar<bool> fastTears;
ConfigVar<bool> instantSaves;
ConfigVar<bool> timeStones;
ConfigVar<bool> sunsSong;
// Preferences
ConfigVar<bool> enableMirrorMode;
+4 -4
View File
@@ -117,8 +117,8 @@ static Z2WolfHowlLine sNewSong3[9] = {
#if TARGET_PC
static Z2WolfHowlLine sHowlTimeSong[6] = {
{HOWL_LINE_HIGH, 30}, {HOWL_LINE_LOW, 40}, {HOWL_LINE_MID, 30},
{HOWL_LINE_HIGH, 30}, {HOWL_LINE_LOW, 40}, {HOWL_LINE_MID, 30},
{HOWL_LINE_MID, 20}, {HOWL_LINE_LOW, 20}, {HOWL_LINE_HIGH, 40},
{HOWL_LINE_MID, 20}, {HOWL_LINE_LOW, 20}, {HOWL_LINE_HIGH, 40},
};
#endif
@@ -368,9 +368,9 @@ void Z2WolfHowlMgr::setCorrectData(s8 curveID, Z2WolfHowlData* data) {
break;
#if TARGET_PC
case Z2WOLFHOWL_TIMESONG:
cPitchUp = 1.12246f;
cPitchUp = 1.259906f;
cPitchCenter = 0.94387f;
cPitchDown = 0.74915f;
cPitchDown = 0.840885f;
break;
#endif
default:
+59
View File
@@ -4,6 +4,65 @@
#include "d/d_meter2_draw.h"
#include "d/d_meter2_info.h"
void daAlink_c::handleWolfHowl() {
if (checkWolf()) {
if (!dusk::getSettings().game.sunsSong) {
return;
}
// Check to see if Link has the ability to transform.
if (!dComIfGs_isEventBit(dSv_event_flag_c::M_077)) {
return;
}
// 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) {
return;
}
const auto meterDrawPtr = meterClassPtr->getMeterDrawPtr();
if (!meterDrawPtr) {
return;
}
// Ensure that link is not in a cutscene.
if (checkEventRun()) {
Z2GetAudioMgr()->seStart(Z2SE_SYS_ERROR, NULL, 0, 0, 1.0f, 1.0f, -1.0f, -1.0f, 0);
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;
}
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;
}
}
}
}
getWolfHowlMgrP()->setCorrectCurve(9);
procWolfHowlDemoInit();
}
}
void daAlink_c::handleQuickTransform() {
if (!dusk::getSettings().game.enableQuickTransform) {
return;
+19 -16
View File
@@ -3942,15 +3942,7 @@ int daAlink_c::procWolfHowlDemoInit() {
} else if (name == fpcNm_TAG_HOWL_e) {
mZ2WolfHowlMgr.setCorrectCurve(static_cast<daTag_Howl_c*>(field_0x27f4)->getCurveID());
} else if (name == fpcNm_Obj_WindStone_e) {
#if TARGET_PC
if (!static_cast<daWindStone_c*>(field_0x27f4)->chkEveOccur() && dusk::getSettings().game.timeStones) {
mZ2WolfHowlMgr.setCorrectCurve(9);
} else {
mZ2WolfHowlMgr.setCorrectCurve(static_cast<daWindStone_c*>(field_0x27f4)->getTuneId());
}
#else
mZ2WolfHowlMgr.setCorrectCurve(static_cast<daWindStone_c*>(field_0x27f4)->getTuneId());
#endif
mProcVar0.field_0x3008 = static_cast<daWindStone_c*>(field_0x27f4)->getNextSceneId();
mProcVar4.field_0x3010 = 1;
} else if (name == fpcNm_Obj_SmWStone_e) {
@@ -3962,7 +3954,13 @@ int daAlink_c::procWolfHowlDemoInit() {
mZ2WolfHowlMgr.setCorrectCurve(-1);
}
} else {
#if TARGET_PC
if (mZ2WolfHowlMgr.getCorrectCurveID() != 9) {
mZ2WolfHowlMgr.setCorrectCurve(-1);
}
#else
mZ2WolfHowlMgr.setCorrectCurve(-1);
#endif
}
mNormalSpeed = 0.0f;
@@ -4100,17 +4098,22 @@ int daAlink_c::procWolfHowlDemo() {
if (checkUnderMove0BckNoArcWolf(WANM_HOWL_END) || isSkipEdge) {
if (checkAnmEnd(frameCtrl_p) || isSkipEdge) {
if (mProcVar0.mHowlExitID >= 0) {
#if TARGET_PC
if (daAlink_getAlinkActorClass()->getCorrectCurveID() == 9) {
g_env_light.time_change_rate = 1.0f;
dComIfGp_event_reset();
dCam_getBody()->EndEventCamera(fopAcM_GetID(this));
return 1;
}
#endif
dStage_changeScene(mProcVar0.mHowlExitID, 0.0f, 0, fopAcM_GetRoomNo(this),
shape_angle.y, -1);
} else {
#if TARGET_PC
if (daAlink_getAlinkActorClass()->getCorrectCurveID() == 9) {
if (dComIfGp_roomControl_getTimePass()) {
g_env_light.time_change_rate = 1.0f;
dComIfGp_event_reset();
dCam_getBody()->EndEventCamera(fopAcM_GetID(this));
} else {
setWolfHowlNotHappen(isSkipEdge);
}
return 1;
}
#endif
fopAc_ac_c* actor_p = NULL;
if (gwolf_p == NULL) {
fopAcIt_Executor((fopAcIt_ExecutorFunc)daAlink_searchWolfHowl,
-13
View File
@@ -87,9 +87,6 @@ int daWindStone_c::execute() {
exeModeMapDisp();
break;
case 2:
#if TARGET_PC
exeModeSetTime();
#endif
break;
}
setModelMtx();
@@ -183,16 +180,6 @@ void daWindStone_c::exeModeMapDisp() {
}
}
#if TARGET_PC
void daWindStone_c::exeModeSetTime() {
attention_info.flags = 0;
if (!chkEveOccur() && chkWlfInRange() && dusk::getSettings().game.timeStones) {
attention_info.flags |= fopAc_AttnFlag_ETC_e;
attention_info.distances[fopAc_attn_ETC_e] = 65;
}
}
#endif
bool daWindStone_c::chkMapDispMode() {
if (fopAcM_isSwitch(this, getSwBit2())) {
return false;
+1 -1
View File
@@ -39,7 +39,7 @@ static void ApplyPresetDusk() {
s.game.instantSaves.setValue(true);
s.game.midnasLamentNonStop.setValue(true);
s.game.enableFrameInterpolation.setValue(true);
s.game.timeStones.setValue(true);
s.game.sunsSong.setValue(true);
s.game.bloomMode.setValue(BloomMode::Dusk);
}
+9 -5
View File
@@ -11,6 +11,15 @@ namespace dusk {
if (ImGui::BeginMenu("Enhancements")) {
if (ImGui::BeginMenu("Quality of Life")) {
config::ImGuiCheckbox("Quick Transform (R+Y)", getSettings().game.enableQuickTransform);
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Allows you to quickly transform between forms\n"
"without having to talk to Midna.");
}
config::ImGuiCheckbox("Sun's Song (R+X)", getSettings().game.sunsSong);
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Allows Wolf Link to howl and change the time of day.");
}
config::ImGuiCheckbox("Bigger Wallets", getSettings().game.biggerWallets);
if (ImGui::IsItemHovered()) {
@@ -63,11 +72,6 @@ namespace dusk {
ImGui::SetTooltip("Skip the delay when writing to the Memory Card.");
}
config::ImGuiCheckbox("Time Stones", getSettings().game.timeStones);
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Allows Wolf Link to use Howling Stones to set the time to midnight.");
}
ImGui::EndMenu();
}
+2 -2
View File
@@ -35,7 +35,7 @@ UserSettings g_userSettings = {
.noMissClimbing {"game.noMissClimbing", false},
.fastTears {"game.fastTears", false},
.instantSaves {"game.instantSaves", false},
.timeStones {"game.timeStones", false},
.sunsSong {"game.sunsSong", false},
// Preferences
.enableMirrorMode {"game.enableMirrorMode", false},
@@ -112,7 +112,7 @@ void registerSettings() {
Register(g_userSettings.game.fastClimbing);
Register(g_userSettings.game.fastTears);
Register(g_userSettings.game.instantSaves);
Register(g_userSettings.game.timeStones);
Register(g_userSettings.game.sunsSong);
Register(g_userSettings.game.enableMirrorMode);
Register(g_userSettings.game.invertCameraXAxis);
Register(g_userSettings.game.bloomMode);
+6
View File
@@ -748,6 +748,12 @@ void fapGm_Execute() {
#endif
#if TARGET_PC
if (mDoCPd_c::getHoldR(PAD_1) && mDoCPd_c::getTrigX(PAD_1)) {
if (const auto link = g_dComIfG_gameInfo.play.getPlayer(0)) {
dynamic_cast<daAlink_c*>(link)->handleWolfHowl();
}
}
if (mDoCPd_c::getHoldR(PAD_1) && mDoCPd_c::getTrigY(PAD_1)) {
if (const auto link = g_dComIfG_gameInfo.play.getPlayer(0)) {
dynamic_cast<daAlink_c*>(link)->handleQuickTransform();