Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions EXILED/Exiled.API/Features/Warhead.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,21 +186,59 @@ public static void Start()
Controller.StartDetonation(false);
}

/// <summary>
/// Starts the warhead countdown.
/// </summary>
/// <param name="isAutomatic">Indicates whether the warhead is started automatically.</param>
/// <param name="suppressSubtitles">If <see langword="true"/>, subtitles will not be displayed during the countdown.</param>
/// <param name="trigger">The <see cref="Player"/> of the entity that triggered the warhead.</param>
public static void Start(bool isAutomatic, bool suppressSubtitles = false, Player trigger = null)
{
Controller.InstantPrepare();
Controller.StartDetonation(isAutomatic, suppressSubtitles, trigger == null ? null : trigger.ReferenceHub);
}

/// <summary>
/// Stops the warhead.
/// </summary>
public static void Stop() => Controller.CancelDetonation();

/// <summary>
/// Stops the warhead detonation process.
/// </summary>
/// <param name="disabler">
/// The <see cref="Player"/> who is disabling the warhead.
/// If <see langword="null"/>, the warhead will be stopped without a specific player reference.
/// </param>
public static void Stop(Player disabler) => Controller.CancelDetonation(disabler.ReferenceHub);

/// <summary>
/// Detonates the warhead.
/// </summary>
public static void Detonate() => Controller.ForceTime(0f);

/// <summary>
/// Detonates the warhead after the specified remaining time.
/// </summary>
/// <param name="remaining">
/// The time in seconds until the warhead detonates.
/// If set to <see langword="0"/>, the warhead will detonate immediately.
/// </param>
public static void Detonate(float remaining) => Controller.ForceTime(remaining);

/// <summary>
/// Shake all players, like if the warhead has been detonated.
/// </summary>
public static void Shake() => Controller.RpcShake(false);

/// <summary>
/// Shake all players, like if the warhead has been detonated.
/// </summary>
/// <param name="archieve">
/// If <see langword="true"/>, the shake effect will be archived.
/// </param>
public static void Shake(bool archieve) => Controller.RpcShake(archieve);

/// <summary>
/// Gets whether the provided position will be detonated by the alpha warhead.
/// </summary>
Expand Down