Allow NH water to extinguish dreamworld lanterns

This commit is contained in:
xen-42 2024-10-06 12:26:53 -04:00
parent 3c1abb582e
commit afe2bd558a
3 changed files with 25 additions and 5 deletions

View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
namespace NewHorizons.Components.EOTE;
public class LanternExtinguisher : MonoBehaviour
{
public void Update()
{
if (PlayerState.InDreamWorld() && PlayerState.IsCameraUnderwater())
{
var heldItem = Locator.GetToolModeSwapper().GetItemCarryTool().GetHeldItem();
if (heldItem is DreamLanternItem lantern && lantern._lanternController._lit)
{
Locator.GetDreamWorldController().ExitDreamWorld(DreamWakeType.LanternSubmerged);
}
}
}
}

View File

@ -1,9 +1,4 @@
using Newtonsoft.Json; using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NewHorizons.External.Modules namespace NewHorizons.External.Modules
{ {

View File

@ -6,6 +6,7 @@ using NewHorizons.Builder.Props;
using NewHorizons.Builder.Props.Audio; using NewHorizons.Builder.Props.Audio;
using NewHorizons.Builder.Props.EchoesOfTheEye; using NewHorizons.Builder.Props.EchoesOfTheEye;
using NewHorizons.Builder.Props.TranslatorText; using NewHorizons.Builder.Props.TranslatorText;
using NewHorizons.Components.EOTE;
using NewHorizons.Components.Fixers; using NewHorizons.Components.Fixers;
using NewHorizons.Components.Ship; using NewHorizons.Components.Ship;
using NewHorizons.Components.SizeControllers; using NewHorizons.Components.SizeControllers;
@ -622,6 +623,7 @@ namespace NewHorizons
Locator.GetPlayerBody().gameObject.AddComponent<DebugPropPlacer>(); Locator.GetPlayerBody().gameObject.AddComponent<DebugPropPlacer>();
Locator.GetPlayerBody().gameObject.AddComponent<DebugMenu>(); Locator.GetPlayerBody().gameObject.AddComponent<DebugMenu>();
Locator.GetPlayerBody().gameObject.AddComponent<PlayerShipAtmosphereDetectorFix>(); Locator.GetPlayerBody().gameObject.AddComponent<PlayerShipAtmosphereDetectorFix>();
if (HasDLC) Locator.GetPlayerBody().gameObject.AddComponent<LanternExtinguisher>();
PlayerSpawnHandler.OnSystemReady(shouldWarpInFromShip, shouldWarpInFromVessel); PlayerSpawnHandler.OnSystemReady(shouldWarpInFromShip, shouldWarpInFromVessel);