From bb989cd1141b7835df5880e441187b85f1a597c2 Mon Sep 17 00:00:00 2001 From: Mister_Nebula <41904486+misternebula@users.noreply.github.com> Date: Sun, 1 Jan 2023 14:40:28 +0000 Subject: [PATCH 1/5] 2023 babyyyyyy --- QSB/QSBCore.cs | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/QSB/QSBCore.cs b/QSB/QSBCore.cs index ac00caf9..eb17db01 100644 --- a/QSB/QSBCore.cs +++ b/QSB/QSBCore.cs @@ -20,7 +20,7 @@ using UnityEngine; using UnityEngine.InputSystem; /* - Copyright (C) 2020 - 2022 + Copyright (C) 2020 - 2023 Henry Pointer (_nebula / misternebula), Will Corby (JohnCorby), Aleksander Waage (AmazingAlek), diff --git a/README.md b/README.md index a8769d61..83c15d4d 100644 --- a/README.md +++ b/README.md @@ -211,7 +211,7 @@ The template for this file is this : ## License and legal stuff -Copyright (C) 2020 - 2022 : +Copyright (C) 2020 - 2023 : - Henry Pointer (_nebula or misternebula) - Will Corby (JohnCorby) - Aleksander Waage (AmazingAlek) From 2577c9b2c2c060d324f749134061526f964abb1b Mon Sep 17 00:00:00 2001 From: Mister_Nebula <41904486+misternebula@users.noreply.github.com> Date: Sun, 1 Jan 2023 14:40:56 +0000 Subject: [PATCH 2/5] add licenses for projects --- EpicOnlineTransport/License.md | 21 +++++++++++++++++++++ MirrorWeaver/License.md | 22 ++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 EpicOnlineTransport/License.md create mode 100644 MirrorWeaver/License.md diff --git a/EpicOnlineTransport/License.md b/EpicOnlineTransport/License.md new file mode 100644 index 00000000..255489bd --- /dev/null +++ b/EpicOnlineTransport/License.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Nudge Nudge Games + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/MirrorWeaver/License.md b/MirrorWeaver/License.md new file mode 100644 index 00000000..887d9b65 --- /dev/null +++ b/MirrorWeaver/License.md @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2015, Unity Technologies +Copyright (c) 2019, vis2k, Paul and Contributors + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file From 593dabeffa266168673fb085a891fb40642b2902 Mon Sep 17 00:00:00 2001 From: Mister_Nebula <41904486+misternebula@users.noreply.github.com> Date: Sun, 1 Jan 2023 14:41:28 +0000 Subject: [PATCH 3/5] add copyright/license/etc into csproj --- EpicOnlineTransport/EpicOnlineTransport.csproj | 11 +++++++++++ EpicRerouter/EpicRerouter.csproj | 11 +++++++++++ MirrorWeaver/MirrorWeaver.csproj | 14 ++++++++++++++ QSB/QSB.csproj | 13 +++++++++++++ 4 files changed, 49 insertions(+) diff --git a/EpicOnlineTransport/EpicOnlineTransport.csproj b/EpicOnlineTransport/EpicOnlineTransport.csproj index a1563cdf..8b101b34 100644 --- a/EpicOnlineTransport/EpicOnlineTransport.csproj +++ b/EpicOnlineTransport/EpicOnlineTransport.csproj @@ -1,9 +1,20 @@ EpicTransport + EpicOnlineTransport + Nudge Nudge Games + Nudge Nudge Games + Copyright © 2021 Nudge Nudge Games + License.md + + + True + \ + + diff --git a/EpicRerouter/EpicRerouter.csproj b/EpicRerouter/EpicRerouter.csproj index 12a9d566..d797329f 100644 --- a/EpicRerouter/EpicRerouter.csproj +++ b/EpicRerouter/EpicRerouter.csproj @@ -1,7 +1,18 @@ Exe + LICENSE + Epic Rerouter + William Corby, Henry Pointer + William Corby, Henry Pointer + Copyright © William Corby, Henry Pointer 2022-2023 + + + True + \ + + diff --git a/MirrorWeaver/MirrorWeaver.csproj b/MirrorWeaver/MirrorWeaver.csproj index f14d405b..94ee363f 100644 --- a/MirrorWeaver/MirrorWeaver.csproj +++ b/MirrorWeaver/MirrorWeaver.csproj @@ -1,10 +1,24 @@  Exe + License.md + Mirror Weaver + Unity Technologies, vis2k, Paul and Contributors, William Corby + Unity Technologies, vis2k, Paul and Contributors, William Corby + + + + + + + True + \ + + diff --git a/QSB/QSB.csproj b/QSB/QSB.csproj index 2187011e..f52bdb61 100644 --- a/QSB/QSB.csproj +++ b/QSB/QSB.csproj @@ -21,6 +21,11 @@ $(UnityAssetsDir)\Dlls + LICENSE + Quantum Space Buddies + Henry Pointer, William Corby, Aleksander Waage, Ricardo Lopes + Copyright © Henry Pointer, William Corby, Aleksander Waage, Ricardo Lopes 2020-2023 + README.md @@ -32,6 +37,14 @@ + + True + \ + + + True + \ + PreserveNewest From 318fe39ea9582d3657a1ca8cce0f308f34055b51 Mon Sep 17 00:00:00 2001 From: Mister_Nebula <41904486+misternebula@users.noreply.github.com> Date: Sun, 1 Jan 2023 15:53:25 +0000 Subject: [PATCH 4/5] gorp --- MirrorWeaver/MirrorWeaver.csproj | 3 --- 1 file changed, 3 deletions(-) diff --git a/MirrorWeaver/MirrorWeaver.csproj b/MirrorWeaver/MirrorWeaver.csproj index 94ee363f..8cc6f6c8 100644 --- a/MirrorWeaver/MirrorWeaver.csproj +++ b/MirrorWeaver/MirrorWeaver.csproj @@ -12,9 +12,6 @@ - - - True From 1f9b4be7e3fd7da6498be54646b7fb1d03769ab9 Mon Sep 17 00:00:00 2001 From: Mister_Nebula <41904486+misternebula@users.noreply.github.com> Date: Sun, 1 Jan 2023 16:09:04 +0000 Subject: [PATCH 5/5] Cleanup ResetPlayer --- QSB/DeathSync/RespawnOnDeath.cs | 226 ++++++++++++++++++-------------- 1 file changed, 127 insertions(+), 99 deletions(-) diff --git a/QSB/DeathSync/RespawnOnDeath.cs b/QSB/DeathSync/RespawnOnDeath.cs index 50dcab53..dc58ce44 100644 --- a/QSB/DeathSync/RespawnOnDeath.cs +++ b/QSB/DeathSync/RespawnOnDeath.cs @@ -69,6 +69,43 @@ public class RespawnOnDeath : MonoBehaviour RespawnManager.Instance.TriggerRespawnMap(); + SetupDeathPositions(); + + // do some exit dream world stuff since real deaths dont do that + if (PlayerState.InDreamWorld()) + { + ResetPlayerDreamworld(); + } + + ResetCloak(); + ResetPlayerComponents(); + ResetCanvases(); + + var mixer = Locator.GetAudioMixer(); + mixer._deathMixed = false; + mixer._nonEndTimesVolume.FadeTo(1, 0.5f); + mixer._endTimesVolume.FadeTo(1, 0.5f); + mixer.MixMap(); + + var playerBody = Locator.GetPlayerBody(); + playerBody.WarpToPositionRotation(_playerSpawnPoint.transform.position, _playerSpawnPoint.transform.rotation); + playerBody.SetVelocity(_playerSpawnPoint.GetPointVelocity()); + _playerSpawnPoint.AddObjectToTriggerVolumes(Locator.GetPlayerDetector().gameObject); + _playerSpawnPoint.AddObjectToTriggerVolumes(_fluidDetector.gameObject); + _playerSpawnPoint.OnSpawnPlayer(); + + _playerResources._isSuffocating = false; + _playerResources.DebugRefillResources(); + // death by oxygen turns this off, so we gotta enable it again + Delay.RunNextFrame(() => _playerResources.enabled = true); + + ResetSuitState(); + + QSBPlayerManager.LocalPlayer.LocalFlashlight.TurnOff(false); + } + + private void SetupDeathPositions() + { var inSpace = PlayerTransformSync.LocalInstance.SectorDetector.SectorList.Count == 0; if (inSpace) @@ -86,94 +123,71 @@ public class RespawnOnDeath : MonoBehaviour _deathPositionRelative = DeathClosestAstroObject.InverseTransformPoint(deathPosition); DeathPlayerUpVector = Locator.GetPlayerTransform().up; DeathPlayerForwardVector = Locator.GetPlayerTransform().forward; + } - // do some exit dream world stuff since real deaths dont do that - if (PlayerState.InDreamWorld()) + private void ResetPlayerDreamworld() + { + var __instance = Locator.GetDreamWorldController(); + + var wakeType = DreamWakeType.Default; // TODO maybe get actual death type? idk + __instance._wakeType = wakeType; + __instance.CheckDreamZone2Completion(); + __instance.CheckSleepWakeDieAchievement(wakeType); + + __instance._activeGhostGrabController?.ReleasePlayer(); + __instance._activeZoomPoint?.CancelZoom(); + + if (__instance._outsideLanternBounds) { - var __instance = Locator.GetDreamWorldController(); - - var wakeType = DreamWakeType.Default; // TODO maybe get actual death type? idk - __instance._wakeType = wakeType; - __instance.CheckDreamZone2Completion(); - __instance.CheckSleepWakeDieAchievement(wakeType); - - __instance._activeGhostGrabController?.ReleasePlayer(); - __instance._activeZoomPoint?.CancelZoom(); - - if (__instance._outsideLanternBounds) - { - __instance.EnterLanternBounds(); - } - - __instance._simulationCamera.OnExitDreamWorld(); - SunLightController.UnregisterSunOverrider(__instance); - if (__instance._proxyShadowLight != null) - { - __instance._proxyShadowLight.enabled = true; - } - __instance._insideDream = false; - __instance._waitingToLightLantern = false; - __instance._playerLantern.OnExitDreamWorld(); - - // TODO : drop player lantern at campfire - - Locator.GetPlayerSectorDetector().RemoveFromAllSectors(); - - __instance._playerLantern.OnExitDreamWorld(); - __instance._dreamArrivalPoint.OnExitDreamWorld(); - __instance._dreamCampfire.OnDreamCampfireExtinguished -= __instance.OnDreamCampfireExtinguished; - __instance._dreamCampfire = null; - - __instance.ExtinguishDreamRaft(); - Locator.GetAudioMixer().UnmixDreamWorld(); - Locator.GetAudioMixer().UnmixSleepAtCampfire(1f); - - if (__instance._playerCamAmbientLightRenderer != null) - { - __instance._playerCamAmbientLightRenderer.enabled = false; - } - - __instance._playerCamera.cullingMask |= 1 << LayerMask.NameToLayer("Sun"); - __instance._playerCamera.farClipPlane = __instance._prevPlayerCameraFarPlaneDist; - __instance._prevPlayerCameraFarPlaneDist = 0f; - __instance._playerCamera.mainCamera.backgroundColor = Color.black; - __instance._playerCamera.planetaryFog.enabled = true; - __instance._playerCamera.postProcessingSettings.screenSpaceReflectionAvailable = false; - __instance._playerCamera.postProcessingSettings.ambientOcclusionAvailable = true; - - GlobalMessenger.FireEvent("ExitDreamWorld"); + __instance.EnterLanternBounds(); } - var sectorList = PlayerTransformSync.LocalInstance.SectorDetector.SectorList; - if (sectorList.All(x => x.Type != Sector.Name.TimberHearth)) + __instance._simulationCamera.OnExitDreamWorld(); + SunLightController.UnregisterSunOverrider(__instance); + if (__instance._proxyShadowLight != null) { - // stops sectors from breaking when you die on TH?? - Locator.GetPlayerSectorDetector().RemoveFromAllSectors(); - Locator.GetPlayerCameraDetector().GetComponent().DeactivateAllVolumes(0f); + __instance._proxyShadowLight.enabled = true; + } + __instance._insideDream = false; + __instance._waitingToLightLantern = false; + __instance._playerLantern.OnExitDreamWorld(); + + // TODO : drop player lantern at campfire + + Locator.GetPlayerSectorDetector().RemoveFromAllSectors(); + + __instance._playerLantern.OnExitDreamWorld(); + __instance._dreamArrivalPoint.OnExitDreamWorld(); + __instance._dreamCampfire.OnDreamCampfireExtinguished -= __instance.OnDreamCampfireExtinguished; + __instance._dreamCampfire = null; + + __instance.ExtinguishDreamRaft(); + Locator.GetAudioMixer().UnmixDreamWorld(); + Locator.GetAudioMixer().UnmixSleepAtCampfire(1f); + + if (__instance._playerCamAmbientLightRenderer != null) + { + __instance._playerCamAmbientLightRenderer.enabled = false; } - // undo stuff that PlayerDeath event does - var cloak = Locator.GetCloakFieldController(); - cloak._playerInsideCloak = false; - cloak._playerCloakFactor = 0f; - cloak._worldFadeFactor = 0f; - cloak._interiorRevealFactor = 0f; - cloak._rendererFade = 1; - cloak.OnPlayerExit.Invoke(); - GlobalMessenger.FireEvent("ExitCloak"); + __instance._playerCamera.cullingMask |= 1 << LayerMask.NameToLayer("Sun"); + __instance._playerCamera.farClipPlane = __instance._prevPlayerCameraFarPlaneDist; + __instance._prevPlayerCameraFarPlaneDist = 0f; + __instance._playerCamera.mainCamera.backgroundColor = Color.black; + __instance._playerCamera.planetaryFog.enabled = true; + __instance._playerCamera.postProcessingSettings.screenSpaceReflectionAvailable = false; + __instance._playerCamera.postProcessingSettings.ambientOcclusionAvailable = true; + GlobalMessenger.FireEvent("ExitDreamWorld"); + } + + private void ResetCanvases() + { foreach (var item in QSBWorldSync.GetUnityObjects()) { item.OnPlayerResurrection(); } - PlayerState._isDead = false; - Locator.GetPlayerController().OnPlayerResurrection(); - QSBWorldSync.GetUnityObject().enabled = true; - Locator.GetPlayerCamera().GetComponent().OnPlayerResurrection(); - Locator.GetPlayerAudioController().OnPlayerResurrection(); - Locator.GetDeathManager()._isDying = false; - foreach (var item in QSBWorldSync.GetUnityObjects()) { item.enabled = true; @@ -195,30 +209,10 @@ public class RespawnOnDeath : MonoBehaviour { item.enabled = true; } + } - var visorEffect = QSBWorldSync.GetUnityObject(); - visorEffect._cracked = false; - visorEffect._crackStartTime = 0f; - visorEffect._crackEffectRenderer.enabled = false; - visorEffect._crackEffectRenderer.material.SetFloat(visorEffect._propID_Cutoff, 1f); - - var mixer = Locator.GetAudioMixer(); - mixer._deathMixed = false; - mixer._nonEndTimesVolume.FadeTo(1, 0.5f); - mixer._endTimesVolume.FadeTo(1, 0.5f); - mixer.MixMap(); - - var playerBody = Locator.GetPlayerBody(); - playerBody.WarpToPositionRotation(_playerSpawnPoint.transform.position, _playerSpawnPoint.transform.rotation); - playerBody.SetVelocity(_playerSpawnPoint.GetPointVelocity()); - _playerSpawnPoint.AddObjectToTriggerVolumes(Locator.GetPlayerDetector().gameObject); - _playerSpawnPoint.AddObjectToTriggerVolumes(_fluidDetector.gameObject); - _playerSpawnPoint.OnSpawnPlayer(); - - _playerResources._isSuffocating = false; - _playerResources.DebugRefillResources(); - // death by oxygen turns this off, so we gotta enable it again - Delay.RunNextFrame(() => _playerResources.enabled = true); + private void ResetSuitState() + { _spaceSuit.RemoveSuit(true); foreach (var pickupVolume in _suitPickupVolumes) @@ -235,8 +229,42 @@ public class RespawnOnDeath : MonoBehaviour } } } + } - QSBPlayerManager.LocalPlayer.LocalFlashlight.TurnOff(false); + private void ResetCloak() + { + var cloak = Locator.GetCloakFieldController(); + cloak._playerInsideCloak = false; + cloak._playerCloakFactor = 0f; + cloak._worldFadeFactor = 0f; + cloak._interiorRevealFactor = 0f; + cloak._rendererFade = 1; + cloak.OnPlayerExit.Invoke(); + GlobalMessenger.FireEvent("ExitCloak"); + } + + private void ResetPlayerComponents() + { + var sectorList = PlayerTransformSync.LocalInstance.SectorDetector.SectorList; + if (sectorList.All(x => x.Type != Sector.Name.TimberHearth)) + { + // stops sectors from breaking when you die on TH?? + Locator.GetPlayerSectorDetector().RemoveFromAllSectors(); + Locator.GetPlayerCameraDetector().GetComponent().DeactivateAllVolumes(0f); + } + + PlayerState._isDead = false; + Locator.GetPlayerController().OnPlayerResurrection(); + QSBWorldSync.GetUnityObject().enabled = true; + Locator.GetPlayerCamera().GetComponent().OnPlayerResurrection(); + Locator.GetPlayerAudioController().OnPlayerResurrection(); + Locator.GetDeathManager()._isDying = false; + + var visorEffect = QSBWorldSync.GetUnityObject(); + visorEffect._cracked = false; + visorEffect._crackStartTime = 0f; + visorEffect._crackEffectRenderer.enabled = false; + visorEffect._crackEffectRenderer.material.SetFloat(visorEffect._propID_Cutoff, 1f); } private SpawnPoint GetSpawnPoint()