Class Respawn
A set of tools to handle team respawns more easily.
public static class Respawn
- Inheritance
-
Respawn
- Inherited Members
Properties
ChaosVan
Gets the Chaos Van's UnityEngine.GameObject.
public static GameObject ChaosVan { get; }
Property Value
- GameObject
CurrentState
Gets the current state of the Respawning.WaveManager.
public static WaveQueueState CurrentState { get; }
Property Value
- WaveQueueState
FactionInfluence
Gets the Dictionary<TKey, TValue> containing faction influence.
public static Dictionary<Faction, float> FactionInfluence { get; }
Property Value
- Dictionary<Faction, float>
IsSpawning
Gets a value indicating whether the respawn process for a Respawning.Waves.SpawnableWaveBase is currently in progress..
public static bool IsSpawning { get; }
Property Value
NextKnownSpawnableFaction
Gets the next known SpawnableFaction that will spawn.
public static SpawnableFaction NextKnownSpawnableFaction { get; }
Property Value
Remarks
This returns SpawnableFaction.None unless a respawn has already started.
NtfHelicopter
Gets the NTF Helicopter's UnityEngine.GameObject.
public static GameObject NtfHelicopter { get; }
Property Value
- GameObject
PausedWaves
Gets the List<T> of paused Respawning.Waves.SpawnableWaveBase's.
public static List<SpawnableWaveBase> PausedWaves { get; }
Property Value
- List<SpawnableWaveBase>
ProtectedCanShoot
Gets or sets a value indicating whether spawn protected players can shoot.
public static bool ProtectedCanShoot { get; set; }
Property Value
ProtectedTeams
Gets a List<T> of PlayerRoles.Teams that have spawn protection.
public static List<Team> ProtectedTeams { get; }
Property Value
- List<Team>
ProtectionEnabled
Gets or sets a value indicating whether spawn protection is enabled.
public static bool ProtectionEnabled { get; set; }
Property Value
ProtectionTime
Gets or sets the spawn protection time, in seconds.
public static float ProtectionTime { get; set; }
Property Value
Methods
AdvanceTimer(SpawnableFaction, float)
Advances the respawn timer for Respawning.Waves.TimeBasedWaves.
public static void AdvanceTimer(SpawnableFaction spawnableFaction, float seconds)
Parameters
spawnableFactionSpawnableFactionThe SpawnableFaction whose Respawning.Waves.TimeBasedWave's timer is to be advanced.
secondsfloatNumber of seconds to advance the timers by.
AdvanceTimer(SpawnableFaction, TimeSpan)
Advances the respawn timer for Respawning.Waves.TimeBasedWaves.
public static void AdvanceTimer(SpawnableFaction spawnableFaction, TimeSpan time)
Parameters
spawnableFactionSpawnableFactionThe SpawnableFaction whose Respawning.Waves.TimeBasedWave's timer is to be advanced.
timeTimeSpanA TimeSpan representing the amount of time to advance the timers by.
AdvanceTimer(Faction, float)
Advances the respawn timer for Respawning.Waves.TimeBasedWaves.
public static void AdvanceTimer(Faction faction, float seconds)
Parameters
factionFactionThe PlayerRoles.Faction whose Respawning.Waves.TimeBasedWave's timers are to be advanced.
secondsfloatNumber of seconds to advance the timers by.
Remarks
This advances the timer for both the normal and mini wave.
AdvanceTimer(Faction, TimeSpan)
Advances the respawn timer for Respawning.Waves.TimeBasedWaves.
public static void AdvanceTimer(Faction faction, TimeSpan time)
Parameters
factionFactionThe PlayerRoles.Faction whose Respawning.Waves.TimeBasedWave's timers are to be advanced.
timeTimeSpanA TimeSpan representing the amount of time to advance the timers by.
Remarks
This advances the timer for both the normal and mini wave.
ForceWave(SpawnableFaction)
Starts the spawn sequence of the given SpawnableFaction.
public static void ForceWave(SpawnableFaction spawnableFaction)
Parameters
spawnableFactionSpawnableFactionThe SpawnableFaction whose wave to spawn.
ForceWave(Faction, bool)
Starts the spawn sequence of the given PlayerRoles.Faction.
public static void ForceWave(Faction faction, bool isMini = false)
Parameters
factionFactionThe PlayerRoles.Faction whose wave to spawn.
isMiniboolWhether the wave should be a mini wave or not.
ForceWave(SpawnableWaveBase)
Starts the spawn sequence of the given Respawning.Waves.SpawnableWaveBase.
public static void ForceWave(SpawnableWaveBase spawnableWaveBase)
Parameters
spawnableWaveBaseSpawnableWaveBaseThe Respawning.Waves.SpawnableWaveBase to spawn.
GetInfluence(Faction)
Get influence to a given PlayerRoles.Faction.
public static float GetInfluence(Faction faction)
Parameters
factionFactionThe PlayerRoles.Faction to get influence.
Returns
- float
Get the faction influence..
GrantInfluence(Faction, int)
Grants influence to a given PlayerRoles.Faction's Respawning.Waves.Generic.ILimitedWaves.
public static void GrantInfluence(Faction faction, int amount)
Parameters
factionFactionThe PlayerRoles.Faction to whose Respawning.Waves.Generic.ILimitedWaves to grant influence.
amountintThe amount of influence to grant.
GrantTokens(Faction, int)
Grants tokens to a given PlayerRoles.Faction's Respawning.Waves.Generic.ILimitedWaves.
public static bool GrantTokens(Faction faction, int amount)
Parameters
factionFactionThe PlayerRoles.Faction to whose Respawning.Waves.Generic.ILimitedWaves to grant tokens.
amountintThe amount of tokens to grant.
Returns
- bool
trueif tokens were successfully granted to an Respawning.Waves.Generic.ILimitedWave, otherwisefalse.
ModifyTokens(Faction, int)
Modifies tokens of a given PlayerRoles.Faction's Respawning.Waves.Generic.ILimitedWaves by a given amount.
public static bool ModifyTokens(Faction faction, int amount)
Parameters
factionFactionThe PlayerRoles.Faction whose Respawning.Waves.Generic.ILimitedWaves' tokens are to be modified.
amountintThe amount of tokens to add/remove.
Returns
- bool
trueif tokens were successfully modified for an Respawning.Waves.Generic.ILimitedWave, otherwisefalse.
PauseWave(SpawnableFaction)
Pauses a specific respawn wave by removing it from the active wave list and adding it to the paused wave list.
public static void PauseWave(SpawnableFaction spawnableFaction)
Parameters
spawnableFactionSpawnableFactionThe SpawnableFaction representing the wave to pause.
PauseWaves()
Pauses respawn waves by removing them from WaveManager.Waves and storing them in PausedWaves.
public static void PauseWaves()
PauseWaves(List<SpawnableFaction>)
Pauses the specified list of respawn waves by iterating through each wave and pausing it using the PauseWave(SpawnableFaction) method.
public static void PauseWaves(List<SpawnableFaction> spawnableFactions)
Parameters
spawnableFactionsList<SpawnableFaction>A list of SpawnableFaction instances representing the waves to pause.
PlayEffect(SpawnableWaveBase)
Play the spawn effect of a Respawning.Waves.SpawnableWaveBase.
public static void PlayEffect(SpawnableWaveBase wave)
Parameters
waveSpawnableWaveBaseThe Respawning.Waves.SpawnableWaveBase whose effect should be played.
RemoveInfluence(Faction, int)
Removes influence from a given PlayerRoles.Faction's Respawning.Waves.Generic.ILimitedWaves.
public static void RemoveInfluence(Faction faction, int amount)
Parameters
factionFactionThe PlayerRoles.Faction from whose Respawning.Waves.Generic.ILimitedWaves to remove influence.
amountintThe amount of influence to remove.
RemoveTokens(Faction, int)
Removes tokens from a given PlayerRoles.Faction's Respawning.Waves.Generic.ILimitedWaves.
public static bool RemoveTokens(Faction faction, int amount)
Parameters
factionFactionThe PlayerRoles.Faction from whose Respawning.Waves.Generic.ILimitedWaves to remove tokens.
amountintThe amount of tokens to remove.
Returns
- bool
trueif tokens were successfully removed from an Respawning.Waves.Generic.ILimitedWave, otherwisefalse.
RestartWave(SpawnableFaction)
Restarts a specific respawn wave by adding it back to the active wave list and removing it from the paused wave list if necessary.
public static void RestartWave(SpawnableFaction spawnableFaction)
Parameters
spawnableFactionSpawnableFactionThe SpawnableFaction representing the wave to restart.
RestartWaves()
Restarts respawn waves by clearing WaveManager.Waves and filling it with new values..
public static void RestartWaves()
Remarks
This also clears PausedWaves.
RestartWaves(List<SpawnableFaction>)
Restarts the specified respawn waves by iterating through each wave and restarting it using the RestartWave(SpawnableFaction) method.
public static void RestartWaves(List<SpawnableFaction> spawnableFactions)
Parameters
spawnableFactionsList<SpawnableFaction>A list of SpawnableFaction instances representing the waves to restart.
ResumeWaves()
Resumes respawn waves by filling WaveManager.Waves with values stored in PausedWaves.
public static void ResumeWaves()
Remarks
This also clears PausedWaves.
SetInfluence(Faction, float)
Set influence to a given PlayerRoles.Faction.
public static void SetInfluence(Faction faction, float influence)
Parameters
factionFactionThe PlayerRoles.Faction to set influence.
influencefloatThe amount of influence to set.
SetTokens(SpawnableFaction, int)
Sets the amount of tokens of an Respawning.Waves.Generic.ILimitedWave of the given SpawnableFaction.
public static bool SetTokens(SpawnableFaction spawnableFaction, int amount)
Parameters
spawnableFactionSpawnableFactionThe SpawnableFaction whose Respawning.Waves.Generic.ILimitedWave's tokens to set.
amountintThe amount of tokens to set.
Returns
- bool
trueif tokens were successfully set for an Respawning.Waves.Generic.ILimitedWave, otherwisefalse.
SummonChaosInsurgencyVan()
Summons the Chaos Insurgency van.
public static void SummonChaosInsurgencyVan()
Remarks
This will also trigger Music effect.
SummonNtfChopper()
Summons the NTF chopper.
public static void SummonNtfChopper()
TryGetFactionInfluence(Faction, out float)
Tries to get the influence value of a given PlayerRoles.Faction.
public static bool TryGetFactionInfluence(Faction faction, out float influence)
Parameters
factionFactionThe PlayerRoles.Faction whose influence to get.
influencefloatThe amount of influence a faction has.
Returns
- bool
Whether an entry was successfully found.
TryGetTokens(SpawnableFaction, out int)
Tries to get the tokens of a given SpawnableFaction's Respawning.Waves.Generic.ILimitedWave.
public static bool TryGetTokens(SpawnableFaction spawnableFaction, out int tokens)
Parameters
spawnableFactionSpawnableFactionThe SpawnableFaction from whose Respawning.Waves.Generic.ILimitedWave to get the tokens.
tokensintThe amount of tokens an Respawning.Waves.Generic.ILimitedWave has, if one was found, otherwise
0.
Returns
- bool
trueif an Respawning.Waves.Generic.ILimitedWave was successfully found, otherwisefalse.
TryGetWaveBase(SpawnableFaction, out SpawnableWaveBase)
Tries to get a Respawning.Waves.SpawnableWaveBase.
public static bool TryGetWaveBase(SpawnableFaction spawnableFaction, out SpawnableWaveBase spawnableWaveBase)
Parameters
spawnableFactionSpawnableFactionA SpawnableFaction determining which wave to search for.
spawnableWaveBaseSpawnableWaveBaseThe found Respawning.Waves.SpawnableWaveBase.
Returns
- bool
trueifspawnableWaveBasewas successfully found. Otherwise,false.
- See Also
TryGetWaveBase<T>(out T)
Tries to get a Respawning.Waves.SpawnableWaveBase.
public static bool TryGetWaveBase<T>(out T spawnableWaveBase) where T : SpawnableWaveBase
Parameters
spawnableWaveBaseTThe found Respawning.Waves.SpawnableWaveBase.
Returns
- bool
trueifspawnableWaveBasewas successfully found. Otherwise,false.
Type Parameters
TType of Respawning.Waves.SpawnableWaveBase.
- See Also
TryGetWaveBases(Faction, out IEnumerable<SpawnableWaveBase>)
Tries to get an IEnumerable<T> of Respawning.Waves.SpawnableWaveBase.
public static bool TryGetWaveBases(Faction faction, out IEnumerable<SpawnableWaveBase> spawnableWaveBases)
Parameters
factionFactionA PlayerRoles.Faction determining which waves to search for.
spawnableWaveBasesIEnumerable<SpawnableWaveBase>The IEnumerable<T> containing found Respawning.Waves.SpawnableWaveBase's if there are any, otherwise
null.
Returns
- bool
trueifspawnableWaveBaseswas successfully found. Otherwise,false.
- See Also