new-horizons/NewHorizons/Components/Volumes/BlackHoleWarpVolume.cs

29 lines
1000 B
C#

using NewHorizons.Handlers;
namespace NewHorizons.Components.Volumes
{
public class BlackHoleWarpVolume : BlackHoleDestructionVolume
{
public string TargetSolarSystem { get; set; }
public string TargetSpawnID { get; set; }
public override void Awake()
{
base.Awake();
_deathType = DeathType.Meditation;
}
public override void VanishShip(OWRigidbody shipBody, RelativeLocationData entryLocation)
{
if (PlayerState.IsInsideShip()) Main.Instance.ChangeCurrentStarSystem(TargetSolarSystem, true);
}
public override void VanishPlayer(OWRigidbody playerBody, RelativeLocationData entryLocation)
{
Locator.GetPlayerAudioController().PlayOneShotInternal(AudioType.BH_BlackHoleEmission);
Main.Instance.ChangeCurrentStarSystem(TargetSolarSystem, PlayerState.AtFlightConsole());
PlayerSpawnHandler.TargetSpawnID = TargetSpawnID;
}
}
}