new-horizons/NewHorizons/Patches/PlayerImpactAudioPatches.cs
2025-02-10 16:12:02 -05:00

22 lines
625 B
C#

using HarmonyLib;
using NewHorizons.Handlers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NewHorizons.Patches;
[HarmonyPatch]
public static class PlayerImpactAudioPatches
{
[HarmonyPrefix]
[HarmonyPatch(typeof(PlayerImpactAudio), nameof(PlayerImpactAudio.OnImpact))]
public static bool PlayerImpactAudio_OnImpact()
{
// DeathManager and PlayerResources _invincible stops player dying but you still hear the impact sounds which is annoying so we disable them
return !InvulnerabilityHandler.Invincible;
}
}