Skip to content
Merged
Changes from 1 commit
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
34 changes: 12 additions & 22 deletions EXILED/Exiled.API/Features/Respawn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,27 +185,15 @@ public static bool TryGetWaveBase(SpawnableFaction faction, out SpawnableWaveBas
/// Docs.
/// </summary>
/// <param name="faction">Docs1.</param>
/// <param name="time">Docs2.</param>
public static void AdvanceTime(Faction faction, float time) => WaveManager.AdvanceTimer(faction, time);

/// <summary>
/// Docs.
/// </summary>
/// <param name="wave">Docs1.</param>
public static void SpawnWave(SpawnableWaveBase wave) => WaveManager.Spawn(wave);
/// <param name="seconds">Docs2.</param>
public static void AdvanceTimer(Faction faction, float seconds) => WaveManager.AdvanceTimer(faction, seconds);

/// <summary>
/// Docs.
/// </summary>
/// <param name="faction">Docs1.</param>
/// <param name="mini">Docs2.</param>
/// <typeparam name="T">Docs3.</typeparam>
public static void SpawnWave<T>(Faction faction, bool mini)
where T : SpawnableWaveBase
{
if (TryGetWaveBase(out T wave))
SpawnWave(wave);
}
/// <param name="time">Docs2.</param>
public static void AdvanceTimer(Faction faction, TimeSpan time) => AdvanceTimer(faction, (float)time.TotalSeconds);

/// <summary>
/// Play effects when a certain class spawns.
Expand Down Expand Up @@ -239,7 +227,8 @@ public static void SummonChaosInsurgencyVan()
/// </summary>
/// <param name="team">The <see cref="SpawnableTeamType"/> to grant tickets to.</param>
/// <param name="amount">The amount of tickets to grant.</param>
public static void GrantTickets(Faction team, int amount)
/// <param name="mini">Docs3.</param>
public static void GrantTickets(Faction team, int amount, bool mini = false)
{
if (TryGetWaveBase(team, out SpawnableWaveBase wave) && wave is ILimitedWave limitedWave)
limitedWave.RespawnTokens += amount;
Expand Down Expand Up @@ -272,7 +261,7 @@ public static void ModifyTickets(Faction team, int amount)
/// </summary>
/// <param name="faction"><see cref="SpawnableTeamType"/>'s faction.</param>
/// <returns>Tickets of team or <c>-1</c> if team doesn't depend on tickets.</returns>
public static int GetTickets(SpawnableFaction faction)
public static int GetTokens(SpawnableFaction faction)
Comment thread
Mikihero marked this conversation as resolved.
Outdated
{
if (TryGetWaveBase(faction, out SpawnableWaveBase wave) && wave is ILimitedWave limitedWave)
return limitedWave.RespawnTokens;
Expand All @@ -283,11 +272,12 @@ public static int GetTickets(SpawnableFaction faction)
/// <summary>
/// Forces a spawn of the given <see cref="SpawnableTeamType"/>.
/// </summary>
/// <param name="team">The <see cref="SpawnableTeamType"/> to spawn.</param>
public static void ForceWave(Faction team)
/// <param name="faction">The <see cref="SpawnableTeamType"/> to spawn.</param>
/// <param name="mini">Docs.</param>
public static void ForceWave(Faction faction, bool mini = false)
{
if (TryGetWaveBase(team, out SpawnableWaveBase wave))
ForceWave(wave);
SpawnableWaveBase waveBase = WaveManager.Waves.Find(x => x.TargetFaction == faction && (mini && x is IMiniWave));
Comment thread
Misaka-ZeroTwo marked this conversation as resolved.
Outdated
ForceWave(waveBase);
}

/// <summary>
Expand Down