mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
simplify
This commit is contained in:
parent
22ab1b4381
commit
6847471536
@ -13,11 +13,15 @@ namespace NewHorizons.OtherMods.AchievementsPlus.NH
|
|||||||
public static void Init()
|
public static void Init()
|
||||||
{
|
{
|
||||||
AchievementHandler.Register(UNIQUE_ID, false, Main.Instance);
|
AchievementHandler.Register(UNIQUE_ID, false, Main.Instance);
|
||||||
|
GlobalMessenger<DeathType>.AddListener("PlayerDeath", OnPlayerDeath);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Earn()
|
public static void OnPlayerDeath(DeathType deathType)
|
||||||
|
{
|
||||||
|
if (deathType == DeathType.Energy && Locator.GetPlayerDetector().GetComponent<FluidDetector>()._activeVolumes.Any(fluidVolume => fluidVolume is TornadoFluidVolume or TornadoBaseFluidVolume or HurricaneFluidVolume))
|
||||||
{
|
{
|
||||||
AchievementHandler.Earn(UNIQUE_ID);
|
AchievementHandler.Earn(UNIQUE_ID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@ -8,16 +8,6 @@ namespace NewHorizons.Patches
|
|||||||
[HarmonyPatch]
|
[HarmonyPatch]
|
||||||
public static class AchievementPatches
|
public static class AchievementPatches
|
||||||
{
|
{
|
||||||
[HarmonyPrefix]
|
|
||||||
[HarmonyPatch(typeof(DeathManager), nameof(DeathManager.KillPlayer))]
|
|
||||||
public static void DeathManager_KillPlayer(DeathType deathType)
|
|
||||||
{
|
|
||||||
if (deathType == DeathType.Energy && Locator.GetPlayerDetector().GetComponent<FluidDetector>()._activeVolumes.Any(fluidVolume => fluidVolume is TornadoFluidVolume or TornadoBaseFluidVolume or HurricaneFluidVolume))
|
|
||||||
{
|
|
||||||
SuckedIntoLavaByTornadoAchievement.Earn();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[HarmonyPrefix]
|
[HarmonyPrefix]
|
||||||
[HarmonyPatch(typeof(ProbeDestructionDetector), nameof(ProbeDestructionDetector.FixedUpdate))]
|
[HarmonyPatch(typeof(ProbeDestructionDetector), nameof(ProbeDestructionDetector.FixedUpdate))]
|
||||||
public static bool ProbeDestructionDetector_FixedUpdate(ProbeDestructionDetector __instance)
|
public static bool ProbeDestructionDetector_FixedUpdate(ProbeDestructionDetector __instance)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user