mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-06-14 05:34:38 -04:00
add some cheats
This commit is contained in:
@@ -92,6 +92,15 @@ struct UserSettings {
|
||||
ConfigVar<bool> gyroInvertYaw;
|
||||
|
||||
// Cheats
|
||||
ConfigVar<bool> infiniteHearts;
|
||||
ConfigVar<bool> infiniteArrows;
|
||||
ConfigVar<bool> infiniteBombs;
|
||||
ConfigVar<bool> infiniteOil;
|
||||
ConfigVar<bool> infiniteOxygen;
|
||||
ConfigVar<bool> infiniteRupees;
|
||||
ConfigVar<bool> moonJump;
|
||||
ConfigVar<bool> superClawshot;
|
||||
ConfigVar<bool> alwaysGreatspin;
|
||||
ConfigVar<bool> enableFastIronBoots;
|
||||
ConfigVar<bool> canTransformAnywhere;
|
||||
ConfigVar<bool> fastSpinner;
|
||||
|
||||
@@ -817,6 +817,12 @@ BOOL daAlink_c::checkDownAttackState() {
|
||||
}
|
||||
|
||||
BOOL daAlink_c::checkCutLargeTurnState() const {
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.alwaysGreatspin) {
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
return ((dComIfGs_isEventBit(dSv_event_flag_c::F_0344) || checkNoResetFlg3(FLG3_TRANING_CUT_LARGE_TURN))
|
||||
&& dComIfGs_getLife() == dComIfGs_getMaxLifeGauge()
|
||||
)
|
||||
|
||||
@@ -290,6 +290,12 @@ BOOL daAlink_c::checkHookshotStickBG(cBgS_PolyInfo& i_polyinfo) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.superClawshot) {
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (dComIfG_Bgsp().ChkPolyHSStick(i_polyinfo)) {
|
||||
dBgW_Base* bgw_p = dComIfG_Bgsp().GetBgWBasePointer(i_polyinfo);
|
||||
if (bgw_p != NULL && bgw_p->ChkPushPullOk()) {
|
||||
@@ -448,6 +454,12 @@ void daAlink_c::setHookshotSight() {
|
||||
max_length = mpHIO->mItem.mHookshot.m.mMaxLength;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.superClawshot) {
|
||||
max_length = 69420.0f;
|
||||
}
|
||||
#endif
|
||||
|
||||
BOOL line_cross = checkSightLine(max_length, &sight_pos);
|
||||
|
||||
if (mHookTargetAcKeep.getActor() != NULL) {
|
||||
@@ -890,6 +902,14 @@ void daAlink_c::setHookshotPos() {
|
||||
max_length = mpHIO->mItem.mHookshot.m.mMaxLength;
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.superClawshot) {
|
||||
return_speed = 2870.0f;
|
||||
shoot_speed = 2870.0f;
|
||||
max_length = 69420.0f;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (mItemMode == HS_MODE_RETURN_e) {
|
||||
if (targetAc_p != NULL) {
|
||||
if (checkLv7BossRoom()) {
|
||||
@@ -899,6 +919,12 @@ void daAlink_c::setHookshotPos() {
|
||||
}
|
||||
}
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.superClawshot) {
|
||||
return_speed = 500.0f;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (checkModeFlg(0x400)) {
|
||||
return_speed += current.pos.abs(field_0x3798);
|
||||
}
|
||||
@@ -1548,6 +1574,12 @@ int daAlink_c::procHookshotFly() {
|
||||
f32 temp_f31 = field_0x37d4.abs();
|
||||
f32 temp_f30 = mpHIO->mItem.mHookshot.m.mStickReturnSpeed + spAC.abs(mHookshotTopPos);
|
||||
|
||||
#if TARGET_PC
|
||||
if (dusk::getSettings().game.superClawshot) {
|
||||
temp_f30 = 500.0f + spAC.abs(mHookshotTopPos);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (temp_f31 < temp_f30 || mProcVar1.field_0x300a == 0) {
|
||||
setHookshotReturnEnd();
|
||||
} else {
|
||||
|
||||
@@ -202,6 +202,16 @@ namespace dusk {
|
||||
ImGui::Separator();
|
||||
|
||||
if (ImGui::BeginMenu("Cheats")) {
|
||||
config::ImGuiCheckbox("Infinite Hearts", getSettings().game.infiniteHearts);
|
||||
config::ImGuiCheckbox("Infinite Arrows", getSettings().game.infiniteArrows);
|
||||
config::ImGuiCheckbox("Infinite Bombs", getSettings().game.infiniteBombs);
|
||||
config::ImGuiCheckbox("Infinite Oil", getSettings().game.infiniteOil);
|
||||
config::ImGuiCheckbox("Infinite Oxygen", getSettings().game.infiniteOxygen);
|
||||
config::ImGuiCheckbox("Infinite Rupees", getSettings().game.infiniteRupees);
|
||||
config::ImGuiCheckbox("Moon Jump (R+A)", getSettings().game.moonJump);
|
||||
config::ImGuiCheckbox("Super Clawshot", getSettings().game.superClawshot);
|
||||
config::ImGuiCheckbox("Always Greatspin", getSettings().game.alwaysGreatspin);
|
||||
|
||||
config::ImGuiCheckbox("Fast Iron Boots", getSettings().game.enableFastIronBoots);
|
||||
|
||||
config::ImGuiCheckbox("Can Transform Anywhere", getSettings().game.canTransformAnywhere);
|
||||
|
||||
@@ -66,6 +66,15 @@ UserSettings g_userSettings = {
|
||||
.gyroInvertYaw {"game.gyroInvertYaw", false},
|
||||
|
||||
// Cheats
|
||||
.infiniteHearts {"game.infiniteHearts", false},
|
||||
.infiniteArrows{"game.infiniteArrows", false},
|
||||
.infiniteBombs{"game.infiniteBombs", false},
|
||||
.infiniteOil{"game.infiniteOil", false},
|
||||
.infiniteOxygen{"game.infiniteOxygen", false},
|
||||
.infiniteRupees{"game.infiniteRupees", false},
|
||||
.moonJump{"game.moonJump", false},
|
||||
.superClawshot{"game.superClawshot", false},
|
||||
.alwaysGreatspin{"game.alwaysGreatspin", false},
|
||||
.enableFastIronBoots {"game.enableFastIronBoots", false},
|
||||
.canTransformAnywhere {"game.canTransformAnywhere", false},
|
||||
.fastSpinner {"game.fastSpinner", false},
|
||||
@@ -139,6 +148,15 @@ void registerSettings() {
|
||||
Register(g_userSettings.game.midnasLamentNonStop);
|
||||
Register(g_userSettings.game.enableTurboKeybind);
|
||||
Register(g_userSettings.game.fastSpinner);
|
||||
Register(g_userSettings.game.infiniteHearts);
|
||||
Register(g_userSettings.game.infiniteArrows);
|
||||
Register(g_userSettings.game.infiniteBombs);
|
||||
Register(g_userSettings.game.infiniteOil);
|
||||
Register(g_userSettings.game.infiniteOxygen);
|
||||
Register(g_userSettings.game.infiniteRupees);
|
||||
Register(g_userSettings.game.moonJump);
|
||||
Register(g_userSettings.game.superClawshot);
|
||||
Register(g_userSettings.game.alwaysGreatspin);
|
||||
Register(g_userSettings.game.enableFrameInterpolation);
|
||||
Register(g_userSettings.game.enableGyroAim);
|
||||
Register(g_userSettings.game.enableGyroRollgoal);
|
||||
|
||||
+57
-21
@@ -732,6 +732,62 @@ static void fapGm_AfterRecord() {
|
||||
dusk::frame_interp::end_record();
|
||||
fapGm_After();
|
||||
}
|
||||
|
||||
static void duskExecute() {
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
if (dusk::getSettings().game.moonJump && (mDoCPd_c::getHoldR(PAD_1) && mDoCPd_c::getHoldA(PAD_1))) {
|
||||
if (const auto link = g_dComIfG_gameInfo.play.getPlayer(0)) {
|
||||
link->speed.y = 56.0f;
|
||||
}
|
||||
}
|
||||
|
||||
if (dusk::getSettings().game.fastSpinner && mDoCPd_c::getHoldR(PAD_1)) {
|
||||
if (const auto link = g_dComIfG_gameInfo.play.getPlayer(0)) {
|
||||
auto spinnerActor = (fopAc_ac_c*)dynamic_cast<daAlink_c*>(link)->getSpinnerActor();
|
||||
if (spinnerActor) {
|
||||
if (spinnerActor->speedF < 60.f)
|
||||
spinnerActor->speedF += 2.f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (dusk::getSettings().game.infiniteHearts) {
|
||||
dComIfGs_setLife((dComIfGs_getMaxLife() / 5) * 4);
|
||||
}
|
||||
|
||||
if (dusk::getSettings().game.infiniteArrows) {
|
||||
dComIfGs_setArrowNum(dComIfGs_getArrowMax());
|
||||
}
|
||||
|
||||
if (dusk::getSettings().game.infiniteBombs) {
|
||||
dComIfGs_setBombNum(0, 99);
|
||||
dComIfGs_setBombNum(1, 99);
|
||||
dComIfGs_setBombNum(2, 99);
|
||||
}
|
||||
|
||||
if (dusk::getSettings().game.infiniteOil) {
|
||||
dComIfGs_setOil(dComIfGs_getMaxOil());
|
||||
}
|
||||
|
||||
if (dusk::getSettings().game.infiniteRupees) {
|
||||
dComIfGs_setRupee(9999);
|
||||
}
|
||||
|
||||
if (dusk::getSettings().game.infiniteOxygen) {
|
||||
dComIfGp_setOxygen(dComIfGp_getMaxOxygen());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void fapGm_Execute() {
|
||||
@@ -747,27 +803,7 @@ 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();
|
||||
}
|
||||
}
|
||||
|
||||
if (dusk::getSettings().game.fastSpinner && mDoCPd_c::getHoldR(PAD_1)) {
|
||||
if (const auto link = g_dComIfG_gameInfo.play.getPlayer(0)) {
|
||||
auto spinnerActor = (fopAc_ac_c*)dynamic_cast<daAlink_c*>(link)->getSpinnerActor();
|
||||
if (spinnerActor) {
|
||||
if (spinnerActor->speedF < 60.f)
|
||||
spinnerActor->speedF += 2.f;
|
||||
}
|
||||
}
|
||||
}
|
||||
duskExecute();
|
||||
#endif
|
||||
|
||||
#ifdef TARGET_PC
|
||||
|
||||
Reference in New Issue
Block a user