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
spawnableFaction
SpawnableFactionThe SpawnableFaction whose Respawning.Waves.TimeBasedWave's timer is to be advanced.
seconds
floatNumber 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
spawnableFaction
SpawnableFactionThe SpawnableFaction whose Respawning.Waves.TimeBasedWave's timer is to be advanced.
time
TimeSpanA 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
faction
FactionThe PlayerRoles.Faction whose Respawning.Waves.TimeBasedWave's timers are to be advanced.
seconds
floatNumber 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
faction
FactionThe PlayerRoles.Faction whose Respawning.Waves.TimeBasedWave's timers are to be advanced.
time
TimeSpanA 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
spawnableFaction
SpawnableFactionThe 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
faction
FactionThe PlayerRoles.Faction whose wave to spawn.
isMini
boolWhether 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
spawnableWaveBase
SpawnableWaveBaseThe Respawning.Waves.SpawnableWaveBase to spawn.
GetInfluence(Faction)
Get influence to a given PlayerRoles.Faction.
public static float GetInfluence(Faction faction)
Parameters
faction
FactionThe 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
faction
FactionThe PlayerRoles.Faction to whose Respawning.Waves.Generic.ILimitedWaves to grant influence.
amount
intThe 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
faction
FactionThe PlayerRoles.Faction to whose Respawning.Waves.Generic.ILimitedWaves to grant tokens.
amount
intThe amount of tokens to grant.
Returns
- bool
true
if 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
faction
FactionThe PlayerRoles.Faction whose Respawning.Waves.Generic.ILimitedWaves' tokens are to be modified.
amount
intThe amount of tokens to add/remove.
Returns
- bool
true
if tokens were successfully modified for an Respawning.Waves.Generic.ILimitedWave, otherwisefalse
.
PauseWaves()
Pauses respawn waves by removing them from WaveManager.Waves and storing them in PausedWaves.
public static void PauseWaves()
PlayEffect(SpawnableWaveBase)
Play the spawn effect of a Respawning.Waves.SpawnableWaveBase.
public static void PlayEffect(SpawnableWaveBase wave)
Parameters
wave
SpawnableWaveBaseThe 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
faction
FactionThe PlayerRoles.Faction from whose Respawning.Waves.Generic.ILimitedWaves to remove influence.
amount
intThe 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
faction
FactionThe PlayerRoles.Faction from whose Respawning.Waves.Generic.ILimitedWaves to remove tokens.
amount
intThe amount of tokens to remove.
Returns
- bool
true
if tokens were successfully removed from an Respawning.Waves.Generic.ILimitedWave, otherwisefalse
.
RestartWaves()
Restarts respawn waves by clearing WaveManager.Waves and filling it with new values..
public static void RestartWaves()
Remarks
This also clears PausedWaves.
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
faction
FactionThe PlayerRoles.Faction to set influence.
influence
floatThe 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
spawnableFaction
SpawnableFactionThe SpawnableFaction whose Respawning.Waves.Generic.ILimitedWave's tokens to set.
amount
intThe amount of tokens to set.
Returns
- bool
true
if 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
faction
FactionThe PlayerRoles.Faction whose influence to get.
influence
floatThe 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
spawnableFaction
SpawnableFactionThe SpawnableFaction from whose Respawning.Waves.Generic.ILimitedWave to get the tokens.
tokens
intThe amount of tokens an Respawning.Waves.Generic.ILimitedWave has, if one was found, otherwise
0
.
Returns
- bool
true
if 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
spawnableFaction
SpawnableFactionA SpawnableFaction determining which wave to search for.
spawnableWaveBase
SpawnableWaveBaseThe found Respawning.Waves.SpawnableWaveBase.
Returns
- bool
true
ifspawnableWaveBase
was 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
spawnableWaveBase
TThe found Respawning.Waves.SpawnableWaveBase.
Returns
- bool
true
ifspawnableWaveBase
was successfully found. Otherwise,false
.
Type Parameters
T
Type 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
faction
FactionA PlayerRoles.Faction determining which waves to search for.
spawnableWaveBases
IEnumerable<SpawnableWaveBase>The IEnumerable<T> containing found Respawning.Waves.SpawnableWaveBase's if there are any, otherwise
null
.
Returns
- bool
true
ifspawnableWaveBases
was successfully found. Otherwise,false
.
- See Also