mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Add volumes for changing star system and triggering credits
This commit is contained in:
parent
086ca65f9d
commit
f1097a65d5
@ -203,7 +203,7 @@ namespace NewHorizons.Builder.Body
|
||||
if (hasDestructionVolume) destructionVolumeGO.AddComponent<BlackHoleDestructionVolume>();
|
||||
else if (targetStarSystem != null)
|
||||
{
|
||||
var wormholeVolume = destructionVolumeGO.AddComponent<ChangeStarSystemVolume>();
|
||||
var wormholeVolume = destructionVolumeGO.AddComponent<BlackHoleWarpVolume>();
|
||||
wormholeVolume.TargetSolarSystem = targetStarSystem;
|
||||
}
|
||||
}
|
||||
|
||||
18
NewHorizons/Builder/Volumes/ChangeStarSystemVolumeBuilder.cs
Normal file
18
NewHorizons/Builder/Volumes/ChangeStarSystemVolumeBuilder.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using NewHorizons.Components.Volumes;
|
||||
using NewHorizons.External.Modules;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.Builder.Volumes
|
||||
{
|
||||
internal static class ChangeStarSystemVolumeBuilder
|
||||
{
|
||||
public static WarpVolume Make(GameObject planetGO, Sector sector, VolumesModule.ChangeStarSystemVolumeInfo info)
|
||||
{
|
||||
var volume = VolumeBuilder.Make<WarpVolume>(planetGO, sector, info);
|
||||
|
||||
volume.TargetSolarSystem = info.targetStarSystem;
|
||||
|
||||
return volume;
|
||||
}
|
||||
}
|
||||
}
|
||||
18
NewHorizons/Builder/Volumes/CreditsVolumeBuilder.cs
Normal file
18
NewHorizons/Builder/Volumes/CreditsVolumeBuilder.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using NewHorizons.Components.Volumes;
|
||||
using NewHorizons.External.Modules;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.Builder.Volumes
|
||||
{
|
||||
internal static class CreditsVolumeBuilder
|
||||
{
|
||||
public static LoadCreditsVolume Make(GameObject planetGO, Sector sector, VolumesModule.LoadCreditsVolumeInfo info)
|
||||
{
|
||||
var volume = VolumeBuilder.Make<LoadCreditsVolume>(planetGO, sector, info);
|
||||
|
||||
volume.creditsType = info.creditsType;
|
||||
|
||||
return volume;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -192,6 +192,20 @@ namespace NewHorizons.Builder.Volumes
|
||||
VolumeBuilder.Make<LightlessLightSourceVolume>(go, sector, lightSourceVolume);
|
||||
}
|
||||
}
|
||||
if (config.Volumes.solarSystemVolume != null)
|
||||
{
|
||||
foreach (var solarSystemVolume in config.Volumes.solarSystemVolume)
|
||||
{
|
||||
ChangeStarSystemVolumeBuilder.Make(go, sector, solarSystemVolume);
|
||||
}
|
||||
}
|
||||
if (config.Volumes.creditsVolume != null)
|
||||
{
|
||||
foreach (var creditsVolume in config.Volumes.creditsVolume)
|
||||
{
|
||||
CreditsVolumeBuilder.Make(go, sector, creditsVolume);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
namespace NewHorizons.Components.Volumes
|
||||
namespace NewHorizons.Components.Volumes
|
||||
{
|
||||
public class ChangeStarSystemVolume : BlackHoleDestructionVolume
|
||||
public class BlackHoleWarpVolume : BlackHoleDestructionVolume
|
||||
{
|
||||
public string TargetSolarSystem { get; set; }
|
||||
|
||||
35
NewHorizons/Components/Volumes/LoadCreditsVolume.cs
Normal file
35
NewHorizons/Components/Volumes/LoadCreditsVolume.cs
Normal file
@ -0,0 +1,35 @@
|
||||
using NewHorizons.External.Modules;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.Components.Volumes
|
||||
{
|
||||
internal class LoadCreditsVolume : BaseVolume
|
||||
{
|
||||
public VolumesModule.LoadCreditsVolumeInfo.CreditsType creditsType = VolumesModule.LoadCreditsVolumeInfo.CreditsType.Fast;
|
||||
|
||||
public override void OnTriggerVolumeEntry(GameObject hitObj)
|
||||
{
|
||||
if (hitObj.CompareTag("PlayerDetector"))
|
||||
{
|
||||
switch(creditsType)
|
||||
{
|
||||
case VolumesModule.LoadCreditsVolumeInfo.CreditsType.Fast:
|
||||
LoadManager.LoadScene(OWScene.Credits_Fast, LoadManager.FadeType.ToBlack);
|
||||
break;
|
||||
case VolumesModule.LoadCreditsVolumeInfo.CreditsType.Final:
|
||||
LoadManager.LoadScene(OWScene.Credits_Final, LoadManager.FadeType.ToBlack);
|
||||
break;
|
||||
case VolumesModule.LoadCreditsVolumeInfo.CreditsType.Kazoo:
|
||||
TimelineObliterationController.s_hasRealityEnded = true;
|
||||
LoadManager.LoadScene(OWScene.Credits_Fast, LoadManager.FadeType.ToBlack);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnTriggerVolumeExit(GameObject hitObj)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
31
NewHorizons/Components/Volumes/WarpVolume.cs
Normal file
31
NewHorizons/Components/Volumes/WarpVolume.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using NewHorizons.External.Modules;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace NewHorizons.Components.Volumes
|
||||
{
|
||||
internal class WarpVolume : BaseVolume
|
||||
{
|
||||
public string TargetSolarSystem;
|
||||
|
||||
public override void OnTriggerVolumeEntry(GameObject hitObj)
|
||||
{
|
||||
if (hitObj.CompareTag("PlayerDetector"))
|
||||
{
|
||||
if (Main.Instance.CurrentStarSystem != TargetSolarSystem) // Otherwise it really breaks idk why
|
||||
{
|
||||
Main.Instance.ChangeCurrentStarSystem(TargetSolarSystem, PlayerState.AtFlightConsole());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnTriggerVolumeExit(GameObject hitObj)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
37
NewHorizons/External/Modules/VolumesModule.cs
vendored
37
NewHorizons/External/Modules/VolumesModule.cs
vendored
@ -106,6 +106,16 @@ namespace NewHorizons.External.Modules
|
||||
/// </summary>
|
||||
public PriorityVolumeInfo[] zeroGravityVolumes;
|
||||
|
||||
/// <summary>
|
||||
/// Entering this volume will load a new solar system.
|
||||
/// </summary>
|
||||
public ChangeStarSystemVolumeInfo[] solarSystemVolume;
|
||||
|
||||
/// <summary>
|
||||
/// Enter this volume to be sent to the end credits scene
|
||||
/// </summary>
|
||||
public LoadCreditsVolumeInfo[] creditsVolume;
|
||||
|
||||
[JsonObject]
|
||||
public class VolumeInfo
|
||||
{
|
||||
@ -136,6 +146,33 @@ namespace NewHorizons.External.Modules
|
||||
public string rename;
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class ChangeStarSystemVolumeInfo : VolumeInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// The star system that entering this volume will send you to.
|
||||
/// </summary>
|
||||
[DefaultValue("SolarSystem")]
|
||||
public string targetStarSystem;
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class LoadCreditsVolumeInfo : VolumeInfo
|
||||
{
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum CreditsType
|
||||
{
|
||||
[EnumMember(Value = @"fast")] Fast = 0,
|
||||
|
||||
[EnumMember(Value = @"final")] Final = 1,
|
||||
|
||||
[EnumMember(Value = @"kazoo")] Kazoo = 2
|
||||
}
|
||||
|
||||
[DefaultValue("fast")]
|
||||
public CreditsType creditsType = CreditsType.Fast;
|
||||
}
|
||||
|
||||
[JsonObject]
|
||||
public class PriorityVolumeInfo : VolumeInfo
|
||||
{
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
"author": "xen, Bwc9876, clay, MegaPiggy, John, Trifid, Hawkbar, Book",
|
||||
"name": "New Horizons",
|
||||
"uniqueName": "xen.NewHorizons",
|
||||
"version": "1.8.5",
|
||||
"version": "1.8.6",
|
||||
"owmlVersion": "2.9.0",
|
||||
"dependencies": [ "JohnCorby.VanillaFix", "_nebula.MenuFramework", "xen.CommonCameraUtility", "dgarro.CustomShipLogModes" ],
|
||||
"conflicts": [ "Raicuparta.QuantumSpaceBuddies", "PacificEngine.OW_Randomizer" ],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user