mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
Merge branch 'dev' into eye-of-the-universe
This commit is contained in:
commit
5dcdd6a882
@ -22,8 +22,8 @@ namespace NewHorizons.Builder.Props
|
||||
|
||||
public static int NumberOfFrequencies;
|
||||
|
||||
public static List<SignalName> QMSignals { get; private set; }
|
||||
public static List<SignalName> CloakedSignals { get; private set; }
|
||||
private static List<SignalName> _qmSignals;
|
||||
private static List<SignalName> _cloakedSignals;
|
||||
|
||||
public static bool Initialized;
|
||||
|
||||
@ -77,12 +77,22 @@ namespace NewHorizons.Builder.Props
|
||||
_nextCustomFrequencyName = 256;
|
||||
NumberOfFrequencies = 8;
|
||||
|
||||
QMSignals = new List<SignalName>() { SignalName.Quantum_QM };
|
||||
CloakedSignals = new List<SignalName>();
|
||||
_qmSignals = new List<SignalName>() { SignalName.Quantum_QM };
|
||||
_cloakedSignals = new List<SignalName>();
|
||||
|
||||
Initialized = true;
|
||||
}
|
||||
|
||||
public static bool IsCloaked(this SignalName signalName)
|
||||
{
|
||||
return _cloakedSignals.Contains(signalName);
|
||||
}
|
||||
|
||||
public static bool IsOnQuantumMoon(this SignalName signalName)
|
||||
{
|
||||
return _qmSignals.Contains(signalName);
|
||||
}
|
||||
|
||||
public static SignalFrequency AddFrequency(string str)
|
||||
{
|
||||
if (_customFrequencyNames == null) Init();
|
||||
@ -228,8 +238,8 @@ namespace NewHorizons.Builder.Props
|
||||
signalGO.SetActive(true);
|
||||
|
||||
// Track certain special signal things
|
||||
if (planetGO.GetComponent<AstroObject>()?.GetAstroObjectName() == AstroObject.Name.QuantumMoon) QMSignals.Add(name);
|
||||
if (info.insideCloak) CloakedSignals.Add(name);
|
||||
if (planetGO.GetComponent<AstroObject>()?.GetAstroObjectName() == AstroObject.Name.QuantumMoon) _qmSignals.Add(name);
|
||||
if (info.insideCloak) _cloakedSignals.Add(name);
|
||||
|
||||
return signalGO;
|
||||
}
|
||||
|
||||
@ -118,7 +118,11 @@ namespace NewHorizons.Patches
|
||||
public static bool AudioSignal_UpdateSignalStrength(AudioSignal __instance, Signalscope scope, float distToClosestScopeObstruction)
|
||||
{
|
||||
if (!SignalBuilder.Initialized) return true;
|
||||
if (!SignalBuilder.CloakedSignals.Contains(__instance._name) && !SignalBuilder.QMSignals.Contains(__instance._name)) return true;
|
||||
|
||||
var isCloaked = SignalBuilder.IsCloaked(__instance._name);
|
||||
var isOnQuantumMoon = SignalBuilder.IsOnQuantumMoon(__instance._name);
|
||||
|
||||
if (!isCloaked && !isOnQuantumMoon) return true;
|
||||
|
||||
__instance._canBePickedUpByScope = false;
|
||||
if (__instance._sunController != null && __instance._sunController.IsPointInsideSupernova(__instance.transform.position))
|
||||
@ -129,7 +133,7 @@ namespace NewHorizons.Patches
|
||||
}
|
||||
|
||||
// This part is modified from the original to include all QM signals
|
||||
if (Locator.GetQuantumMoon() != null && Locator.GetQuantumMoon().IsPlayerInside() && !SignalBuilder.QMSignals.Contains(__instance._name))
|
||||
if (Locator.GetQuantumMoon() != null && Locator.GetQuantumMoon().IsPlayerInside() && !isOnQuantumMoon)
|
||||
{
|
||||
__instance._signalStrength = 0f;
|
||||
__instance._degreesFromScope = 180f;
|
||||
@ -166,7 +170,7 @@ namespace NewHorizons.Patches
|
||||
}
|
||||
|
||||
// If it's a cloaked signal we don't want to hear it outside the cloak field
|
||||
if (SignalBuilder.CloakedSignals.Contains(__instance._name))
|
||||
if (isCloaked)
|
||||
{
|
||||
if (!PlayerState.InCloakingField())
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user