mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-04 02:47:22 +00:00
add 1.1.13 qm patch
This commit is contained in:
parent
8d3a37f039
commit
f8f795a84b
@ -3,7 +3,6 @@ using QSB.Messaging;
|
|||||||
using QSB.Patches;
|
using QSB.Patches;
|
||||||
using QSB.Player;
|
using QSB.Player;
|
||||||
using QSB.ShipSync;
|
using QSB.ShipSync;
|
||||||
using QSB.Utility;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
@ -19,7 +18,7 @@ internal class QuantumMoonPatches : QSBPatch
|
|||||||
public static bool CheckPlayerFogProximity(QuantumMoon __instance)
|
public static bool CheckPlayerFogProximity(QuantumMoon __instance)
|
||||||
{
|
{
|
||||||
var playerDistance = Vector3.Distance(__instance.transform.position, Locator.GetPlayerCamera().transform.position);
|
var playerDistance = Vector3.Distance(__instance.transform.position, Locator.GetPlayerCamera().transform.position);
|
||||||
var fogOffset = (__instance._stateIndex == 5) ? __instance._eyeStateFogOffset : 0f;
|
var fogOffset = __instance._stateIndex == 5 ? __instance._eyeStateFogOffset : 0f;
|
||||||
var distanceFromFog = playerDistance - (__instance._fogRadius + fogOffset);
|
var distanceFromFog = playerDistance - (__instance._fogRadius + fogOffset);
|
||||||
var fogAlpha = 0f;
|
var fogAlpha = 0f;
|
||||||
|
|
||||||
@ -74,10 +73,12 @@ internal class QuantumMoonPatches : QSBPatch
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
var shouldStayAtEye = __instance._hasSunCollapsed || __instance.IsLockedByProbeSnapshot();
|
||||||
var vector = Locator.GetPlayerTransform().position - __instance.transform.position;
|
var vector = Locator.GetPlayerTransform().position - __instance.transform.position;
|
||||||
Locator.GetPlayerBody().SetVelocity(__instance._moonBody.GetPointVelocity(Locator.GetPlayerTransform().position) - (vector.normalized * 5f));
|
Locator.GetPlayerBody().SetVelocity(__instance._moonBody.GetPointVelocity(Locator.GetPlayerTransform().position) - vector.normalized * 5f);
|
||||||
var d = 80f;
|
var offset = shouldStayAtEye ? 80f : __instance._fogRadius - 1f;
|
||||||
Locator.GetPlayerBody().SetPosition(__instance.transform.position + (__instance._vortexReturnPivot.up * d));
|
Locator.GetPlayerBody().SetPosition(__instance.transform.position + __instance._vortexReturnPivot.up * offset);
|
||||||
|
Locator.GetPlayerBody().SetRotation(__instance._vortexReturnPivot.rotation);
|
||||||
if (!Physics.autoSyncTransforms)
|
if (!Physics.autoSyncTransforms)
|
||||||
{
|
{
|
||||||
Physics.SyncTransforms();
|
Physics.SyncTransforms();
|
||||||
@ -86,8 +87,15 @@ internal class QuantumMoonPatches : QSBPatch
|
|||||||
var component = Locator.GetPlayerCamera().GetComponent<PlayerCameraController>();
|
var component = Locator.GetPlayerCamera().GetComponent<PlayerCameraController>();
|
||||||
component.SetDegreesY(component.GetMinDegreesY());
|
component.SetDegreesY(component.GetMinDegreesY());
|
||||||
__instance._vortexAudio.SetLocalVolume(0f);
|
__instance._vortexAudio.SetLocalVolume(0f);
|
||||||
__instance._collapseToIndex = 1;
|
if (!shouldStayAtEye)
|
||||||
__instance.Collapse(true);
|
{
|
||||||
|
__instance._collapseToIndex = 1;
|
||||||
|
__instance.Collapse(true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
__instance._vortexAudio.FadeIn(1f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -105,7 +113,7 @@ internal class QuantumMoonPatches : QSBPatch
|
|||||||
}
|
}
|
||||||
|
|
||||||
var distance = Vector3.Distance(moon.transform.position, Locator.GetShipTransform().position);
|
var distance = Vector3.Distance(moon.transform.position, Locator.GetShipTransform().position);
|
||||||
var fogOffset = (moon._stateIndex == 5) ? moon._eyeStateFogOffset : 0f;
|
var fogOffset = moon._stateIndex == 5 ? moon._eyeStateFogOffset : 0f;
|
||||||
var distanceFromFog = distance - (moon._fogRadius + fogOffset);
|
var distanceFromFog = distance - (moon._fogRadius + fogOffset);
|
||||||
return distanceFromFog < 10f; // to account for ship size
|
return distanceFromFog < 10f; // to account for ship size
|
||||||
}
|
}
|
||||||
@ -113,7 +121,7 @@ internal class QuantumMoonPatches : QSBPatch
|
|||||||
public static bool GetTransformInFog(QuantumMoon moon, Transform transform)
|
public static bool GetTransformInFog(QuantumMoon moon, Transform transform)
|
||||||
{
|
{
|
||||||
var distance = Vector3.Distance(moon.transform.position, transform.position);
|
var distance = Vector3.Distance(moon.transform.position, transform.position);
|
||||||
var fogOffset = (moon._stateIndex == 5) ? moon._eyeStateFogOffset : 0f;
|
var fogOffset = moon._stateIndex == 5 ? moon._eyeStateFogOffset : 0f;
|
||||||
var distanceFromFog = distance - (moon._fogRadius + fogOffset);
|
var distanceFromFog = distance - (moon._fogRadius + fogOffset);
|
||||||
return distanceFromFog < 0f;
|
return distanceFromFog < 0f;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user