From 29fb86f92d0d71624e32810abef934312457e351 Mon Sep 17 00:00:00 2001 From: Sonic Dreamcaster Date: Sun, 24 Nov 2024 21:12:16 -0300 Subject: [PATCH] new cheat: Unbreakable wings. --- src/engine/fox_play.c | 36 ++++++++++++++++++++---------------- src/port/ui/ImguiUI.cpp | 10 +++++++--- 2 files changed, 27 insertions(+), 19 deletions(-) diff --git a/src/engine/fox_play.c b/src/engine/fox_play.c index 53dea3d9..38407a59 100644 --- a/src/engine/fox_play.c +++ b/src/engine/fox_play.c @@ -935,14 +935,16 @@ void Player_DamageWings(Player* player, s32 side, s32 damage) { gRightWingFlashTimer[player->num] = 30; if (player->arwing.rightWingState == WINGSTATE_INTACT) { gRightWingHealth[player->num] -= damage; - if (gRightWingHealth[player->num] <= 0) { - Play_SpawnDebris(1, player->hit1.x, player->hit1.y, player->hit1.z); - player->arwing.rightWingState = WINGSTATE_BROKEN; - func_effect_8007D0E0(player->hit1.x, player->hit1.y, player->hit1.z, 2.0f); - gRightWingDebrisTimer[player->num] = 50; - Player_PlaySfx(player->sfxSource, NA_SE_ARWING_WING_BROKEN, player->num); - if (gAllRangeWingRepairTimer == 0) { - gAllRangeWingRepairTimer = 1000; + if (CVarGetInteger("gUnbreakableWings", 0) == 0) { + if (gRightWingHealth[player->num] <= 0) { + Play_SpawnDebris(1, player->hit1.x, player->hit1.y, player->hit1.z); + player->arwing.rightWingState = WINGSTATE_BROKEN; + func_effect_8007D0E0(player->hit1.x, player->hit1.y, player->hit1.z, 2.0f); + gRightWingDebrisTimer[player->num] = 50; + Player_PlaySfx(player->sfxSource, NA_SE_ARWING_WING_BROKEN, player->num); + if (gAllRangeWingRepairTimer == 0) { + gAllRangeWingRepairTimer = 1000; + } } } } @@ -950,14 +952,16 @@ void Player_DamageWings(Player* player, s32 side, s32 damage) { gLeftWingFlashTimer[player->num] = 30; if (player->arwing.leftWingState == WINGSTATE_INTACT) { gLeftWingHealth[player->num] -= damage; - if (gLeftWingHealth[player->num] <= 0) { - Play_SpawnDebris(0, player->hit2.x, player->hit2.y, player->hit2.z); - player->arwing.leftWingState = WINGSTATE_BROKEN; - func_effect_8007D0E0(player->hit2.x, player->hit2.y, player->hit2.z, 2.0f); - gLeftWingDebrisTimer[player->num] = 50; - Player_PlaySfx(player->sfxSource, NA_SE_ARWING_WING_BROKEN, player->num); - if (gAllRangeWingRepairTimer == 0) { - gAllRangeWingRepairTimer = 1000; + if (CVarGetInteger("gUnbreakableWings", 0) == 0) { + if (gLeftWingHealth[player->num] <= 0) { + Play_SpawnDebris(0, player->hit2.x, player->hit2.y, player->hit2.z); + player->arwing.leftWingState = WINGSTATE_BROKEN; + func_effect_8007D0E0(player->hit2.x, player->hit2.y, player->hit2.z, 2.0f); + gLeftWingDebrisTimer[player->num] = 50; + Player_PlaySfx(player->sfxSource, NA_SE_ARWING_WING_BROKEN, player->num); + if (gAllRangeWingRepairTimer == 0) { + gAllRangeWingRepairTimer = 1000; + } } } } diff --git a/src/port/ui/ImguiUI.cpp b/src/port/ui/ImguiUI.cpp index ac99a4bc..69abe820 100644 --- a/src/port/ui/ImguiUI.cpp +++ b/src/port/ui/ImguiUI.cpp @@ -425,7 +425,12 @@ void DrawEnhancementsMenu() { if (UIWidgets::BeginMenu("Gameplay")) { UIWidgets::CVarCheckbox("No Level of Detail (LOD)", "gDisableLOD", { - .tooltip = "Disable Level of Detail (LOD) to avoid models using lower poly versions at a distance" + .tooltip = "Disable Level of Detail (LOD) to avoid models using lower poly versions at a distance", + .defaultValue = true + }); + UIWidgets::CVarCheckbox("Character heads inside Arwings at all times", "gTeamFaces", { + .tooltip = "Character heads are displayed inside Arwings in all cutscenes", + .defaultValue = true }); ImGui::EndMenu(); @@ -454,6 +459,7 @@ void DrawEnhancementsMenu() { void DrawCheatsMenu() { if (UIWidgets::BeginMenu("Cheats")) { UIWidgets::CVarCheckbox("Infinite Lives", "gInfiniteLives"); + UIWidgets::CVarCheckbox("Unbreakable Wings", "gUnbreakableWings"); UIWidgets::CVarCheckbox("Infinite Bombs", "gInfiniteBombs"); UIWidgets::CVarCheckbox("Hyper Laser", "gHyperLaser"); @@ -475,8 +481,6 @@ void DrawHit64Menu() { UIWidgets::CVarCheckbox("Start with Peppy dead", "gHit64PeppyDead", { .tooltip = "Start the level with with Peppy dead." }); - // UIWidgets::CVarCheckbox("Infinite Bombs", "gInfiniteBombs"); - // UIWidgets::CVarCheckbox("Hyper Laser", "gHyperLaser"); ImGui::EndMenu(); }