Standing Torch Tronworld (#1076)

## Improvements

- Standing vision torch now shows up in tronworld
This commit is contained in:
Noah Pilarski 2025-04-10 11:08:28 -04:00 committed by GitHub
commit ce48a8f53e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 20 additions and 3 deletions

View File

@ -43,6 +43,7 @@ namespace NewHorizons.Builder.Props
private static GameObject _autoPrefab; private static GameObject _autoPrefab;
private static GameObject _visionTorchDetectorPrefab; private static GameObject _visionTorchDetectorPrefab;
private static GameObject _standingVisionTorchPrefab; private static GameObject _standingVisionTorchPrefab;
private static GameObject _standingVisionTorchCleanPrefab;
private static readonly int EmissionMap = Shader.PropertyToID("_EmissionMap"); private static readonly int EmissionMap = Shader.PropertyToID("_EmissionMap");
private static bool _isInit; private static bool _isInit;
@ -90,13 +91,28 @@ namespace NewHorizons.Builder.Props
_visionTorchDetectorPrefab.AddComponent<DestroyOnDLC>()._destroyOnDLCNotOwned = true; _visionTorchDetectorPrefab.AddComponent<DestroyOnDLC>()._destroyOnDLCNotOwned = true;
} }
if (_standingVisionTorchCleanPrefab == null)
{
_standingVisionTorchCleanPrefab = SearchUtilities.Find("DreamWorld_Body/Sector_DreamWorld/Sector_DreamZone_4/Interactibles_DreamZone_4_Upper/Prefab_IP_VisionTorchProjector")?.gameObject?.InstantiateInactive()?.Rename("Prefab_DW_VisionTorchProjector")?.DontDestroyOnLoad();
if (_standingVisionTorchCleanPrefab == null)
NHLogger.LogWarning($"Tried to make standing vision torch prefab but couldn't. Do you have the DLC installed?");
else
{
_standingVisionTorchCleanPrefab.AddComponent<DestroyOnDLC>()._destroyOnDLCNotOwned = true;
GameObject.DestroyImmediate(_standingVisionTorchCleanPrefab.FindChild("Prefab_IP_Reel_PrisonPeephole_Vision"));
}
}
if (_standingVisionTorchPrefab == null) if (_standingVisionTorchPrefab == null)
{ {
_standingVisionTorchPrefab = SearchUtilities.Find("RingWorld_Body/Sector_RingWorld/Sector_SecretEntrance/Interactibles_SecretEntrance/Experiment_1/VisionTorchApparatus/VisionTorchRoot/Prefab_IP_VisionTorchProjector")?.gameObject?.InstantiateInactive()?.Rename("Prefab_IP_VisionTorchProjector")?.DontDestroyOnLoad(); _standingVisionTorchPrefab = SearchUtilities.Find("RingWorld_Body/Sector_RingWorld/Sector_SecretEntrance/Interactibles_SecretEntrance/Experiment_1/VisionTorchApparatus/VisionTorchRoot/Prefab_IP_VisionTorchProjector")?.gameObject?.InstantiateInactive()?.Rename("Prefab_IP_VisionTorchProjector")?.DontDestroyOnLoad();
if (_standingVisionTorchPrefab == null) if (_standingVisionTorchPrefab == null)
NHLogger.LogWarning($"Tried to make standing vision torch prefab but couldn't. Do you have the DLC installed?"); NHLogger.LogWarning($"Tried to make standing vision torch prefab but couldn't. Do you have the DLC installed?");
else else
{
_standingVisionTorchPrefab.AddComponent<DestroyOnDLC>()._destroyOnDLCNotOwned = true; _standingVisionTorchPrefab.AddComponent<DestroyOnDLC>()._destroyOnDLCNotOwned = true;
GameObject.Instantiate(_standingVisionTorchCleanPrefab.FindChild("Effects_IP_SIM_VisionTorch"), _standingVisionTorchPrefab.transform, false).Rename("Effects_IP_SIM_VisionTorch");
}
} }
} }
@ -446,10 +462,11 @@ namespace NewHorizons.Builder.Props
{ {
InitPrefabs(); InitPrefabs();
if (_standingVisionTorchPrefab == null) return null; if (_standingVisionTorchPrefab == null || _standingVisionTorchCleanPrefab == null) return null;
// Spawn the torch itself // Spawn the torch itself
var standingTorch = DetailBuilder.Make(planetGO, sector, mod, _standingVisionTorchPrefab, new DetailInfo(info)); var prefab = info.reelCondition == ProjectionInfo.SlideReelCondition.Pristine ? _standingVisionTorchCleanPrefab : _standingVisionTorchPrefab;
var standingTorch = DetailBuilder.Make(planetGO, sector, mod, prefab, new DetailInfo(info));
if (standingTorch == null) if (standingTorch == null)
{ {

View File

@ -82,7 +82,7 @@ namespace NewHorizons.External.Modules.Props.EchoesOfTheEye
[DefaultValue("sevenSlides")] public SlideReelType reelModel = SlideReelType.SevenSlides; [DefaultValue("sevenSlides")] public SlideReelType reelModel = SlideReelType.SevenSlides;
/// <summary> /// <summary>
/// Exclusive to the slide reel type. Condition/material of the reel. Antique is the Stranger, Pristine is the Dreamworld, Rusted is a burned reel. /// Exclusive to the slide reel and standing vision torch type. Condition/material of the reel. Antique is the Stranger, Pristine is the Dreamworld, Rusted (exclusive to slide reels) is a burned reel.
/// </summary> /// </summary>
[DefaultValue("antique")] public SlideReelCondition reelCondition = SlideReelCondition.Antique; [DefaultValue("antique")] public SlideReelCondition reelCondition = SlideReelCondition.Antique;