2020-12-20 10:56:15 +00:00
|
|
|
|
using OWML.Utils;
|
2021-10-20 09:10:30 +01:00
|
|
|
|
using QSB.Events;
|
2021-06-19 15:35:40 +01:00
|
|
|
|
using QSB.ShipSync;
|
2021-10-20 09:10:30 +01:00
|
|
|
|
using QSB.Utility.Events;
|
2020-12-08 09:31:29 +00:00
|
|
|
|
using UnityEngine;
|
2021-10-20 09:10:30 +01:00
|
|
|
|
using UnityEngine.InputSystem;
|
2020-03-14 21:42:43 +01:00
|
|
|
|
|
2020-07-30 22:27:14 +02:00
|
|
|
|
namespace QSB.Utility
|
2020-03-14 21:42:43 +01:00
|
|
|
|
{
|
2020-12-02 21:23:01 +00:00
|
|
|
|
public class DebugActions : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
private void GoToVessel()
|
|
|
|
|
{
|
|
|
|
|
var spawnPoint = GameObject.Find("Spawn_Vessel").GetComponent<SpawnPoint>();
|
2020-03-14 21:42:43 +01:00
|
|
|
|
|
2020-12-02 21:23:01 +00:00
|
|
|
|
var playerBody = Locator.GetPlayerBody();
|
|
|
|
|
playerBody.WarpToPositionRotation(spawnPoint.transform.position, spawnPoint.transform.rotation);
|
|
|
|
|
playerBody.SetVelocity(spawnPoint.GetPointVelocity());
|
|
|
|
|
}
|
2020-03-14 21:42:43 +01:00
|
|
|
|
|
2020-12-02 21:23:01 +00:00
|
|
|
|
private void InsertWarpCore()
|
|
|
|
|
{
|
|
|
|
|
var warpCore = GameObject.Find("Prefab_NOM_WarpCoreVessel").GetComponent<WarpCoreItem>();
|
|
|
|
|
var socket = GameObject.Find("Interactibles_VesselBridge").GetComponentInChildren<WarpCoreSocket>();
|
|
|
|
|
socket.PlaceIntoSocket(warpCore);
|
2020-12-08 09:31:29 +00:00
|
|
|
|
var bridgeVolume = FindObjectOfType<VesselWarpController>().GetValue<OWTriggerVolume>("_bridgeVolume");
|
|
|
|
|
bridgeVolume.AddObjectToVolume(Locator.GetPlayerDetector());
|
|
|
|
|
bridgeVolume.AddObjectToVolume(Locator.GetPlayerCameraDetector());
|
2020-12-02 21:23:01 +00:00
|
|
|
|
}
|
2020-03-14 21:42:43 +01:00
|
|
|
|
|
2021-07-12 22:02:50 +01:00
|
|
|
|
private void DamageShipElectricalSystem() => ShipManager.Instance.ShipElectricalComponent.SetDamaged(true);
|
2021-06-19 15:35:40 +01:00
|
|
|
|
|
2020-12-14 21:41:56 +01:00
|
|
|
|
public void Update()
|
2020-12-02 21:23:01 +00:00
|
|
|
|
{
|
2020-12-14 16:24:52 +00:00
|
|
|
|
if (!QSBCore.DebugMode)
|
2020-12-02 21:23:01 +00:00
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
2021-06-18 22:38:32 +01:00
|
|
|
|
|
2021-10-20 09:10:30 +01:00
|
|
|
|
if (Keyboard.current[Key.Numpad4].wasPressedThisFrame)
|
2021-08-08 19:48:48 +01:00
|
|
|
|
{
|
2021-10-20 09:10:30 +01:00
|
|
|
|
DamageShipElectricalSystem();
|
2021-08-08 19:48:48 +01:00
|
|
|
|
}
|
|
|
|
|
|
2021-10-20 09:10:30 +01:00
|
|
|
|
if (Keyboard.current[Key.Numpad5].wasPressedThisFrame)
|
2021-06-19 15:35:40 +01:00
|
|
|
|
{
|
2021-10-20 09:10:30 +01:00
|
|
|
|
QSBEventManager.FireEvent(EventNames.QSBDebugEvent, DebugEventEnum.TriggerSupernova);
|
2021-06-19 15:35:40 +01:00
|
|
|
|
}
|
|
|
|
|
|
2021-10-20 09:10:30 +01:00
|
|
|
|
if (Keyboard.current[Key.Numpad7].wasPressedThisFrame)
|
2020-12-02 21:23:01 +00:00
|
|
|
|
{
|
|
|
|
|
GoToVessel();
|
|
|
|
|
}
|
2021-06-18 22:38:32 +01:00
|
|
|
|
|
2021-10-20 09:10:30 +01:00
|
|
|
|
if (Keyboard.current[Key.Numpad8].wasPressedThisFrame)
|
2020-12-02 21:23:01 +00:00
|
|
|
|
{
|
|
|
|
|
InsertWarpCore();
|
|
|
|
|
}
|
2021-06-18 22:38:32 +01:00
|
|
|
|
|
2021-10-20 09:10:30 +01:00
|
|
|
|
if (Keyboard.current[Key.Numpad9].wasPressedThisFrame)
|
2020-12-02 21:23:01 +00:00
|
|
|
|
{
|
2021-10-26 18:56:36 +01:00
|
|
|
|
PlayerData.SaveWarpedToTheEye(60);
|
2020-12-14 21:41:56 +01:00
|
|
|
|
LoadManager.LoadSceneAsync(OWScene.EyeOfTheUniverse, true, LoadManager.FadeType.ToWhite);
|
2020-12-02 21:23:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-11-28 09:55:25 +00:00
|
|
|
|
}
|