You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: UncomplicatedCustomTeams/API/Features/Team.cs
+59-34Lines changed: 59 additions & 34 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
-
usingPlayerRoles;
1
+
usingExiled.API.Enums;
2
+
usingPlayerRoles;
2
3
usingSystem;
3
4
usingSystem.Collections.Generic;
4
5
usingSystem.ComponentModel;
@@ -66,6 +67,13 @@ public static void Register(Team team)
66
67
/// </summary>
67
68
publicuintSpawnChance{get;set;}=100;
68
69
70
+
/// <summary>
71
+
/// If set to true, this team's successful spawn roll will not prevent other teams
72
+
/// with the same SpawnWave from being evaluated.
73
+
/// </summary>
74
+
[Description("Set to true to allow this team to spawn alongside other teams during the same Spawn Wave. If false (default), it will be the only one.")]
75
+
publicboolAllowConcurrentSpawns{get;set;}=false;
76
+
69
77
/// <summary>
70
78
/// Defines the spawn conditions for a custom team.
71
79
/// </summary>
@@ -91,39 +99,25 @@ public static void Register(Team team)
publicVector3SpawnRotation{get;set;}=Vector3.zero;// yaml has skill issue with Quaternion
214
219
220
+
[Description("Spawn this team AFTER the custom team with the specified ID has spawned. SpawnWave must be set to 'TeamDependent'.")]
221
+
publicuintAfterTeamSpawn{get;set;}=0;
222
+
223
+
[Description("Spawn this team AFTER the custom team with the specified ID has been completely eliminated. SpawnWave must be set to 'TeamDependent'.")]
224
+
publicuintAfterTeamDeath{get;set;}=0;
225
+
226
+
[Description("How many generators must be engaged for this team to spawn. Only works if SpawnWave is set to 'AfterGeneratorActivated'. Value should be between 1 and 3.")]
227
+
publicintRequiredEngagedGenerators{get;set;}=1;
228
+
215
229
privateItemType_usedItem=ItemType.None;
216
230
privateint?_customItemId=null;
217
231
218
-
[Description("Specify the item or custom item ID that triggers this team spawn. Only works if SpawnWave is set to 'UsedItem'.")]
232
+
[Description("Specify the Game Base Utem or EXILED Custom Item ID that triggers this team spawn. Only works if SpawnWave is set to 'UsedItem'.")]
219
233
publicstringUsedItem
220
234
{
221
235
get
@@ -266,7 +280,7 @@ public string UsedItem
266
280
/// <returns><c>true</c> if the spawn position is required; otherwise, <c>false</c>.</returns>
[Description("Delay in seconds before this sound starts playing.")]
287
301
publicfloatDelay{get;set;}=0f;
288
302
}
303
+
304
+
publicclassRoundEndRule
305
+
{
306
+
[Description("If true, the round will not end while this team is alive, effectively blocking standard round-end conditions. NOTE: This does NOT prevent the round from ending if this team wins by eliminating all enemies. If they win, the round ends immediately.")]
307
+
publicboolPreventRoundEndIfAlive{get;set;}=true;
308
+
[Description("A list of vanilla teams that are considered allies. The Custom Team does NOT need to eliminate players from these teams to trigger the win condition.")]
LogManager.Warn($"Forced team '{Plugin.NextTeam.Team.Name}' wave mismatch ({Plugin.NextTeam.Team.SpawnConditions.SpawnWave} vs {faction}). Aborting force.");
70
+
shouldSpawn=false;
71
+
}
72
+
elseif(!IgnoreSpawnChance)
73
+
{
74
+
introll=UnityEngine.Random.Range(0,100);
75
+
if(roll>=Plugin.NextTeam.Team.SpawnChance)
76
+
{
77
+
LogManager.Info($"Forced wave for '{Plugin.NextTeam.Team.Name}' failed RNG roll. Reverting to standard check.");
78
+
shouldSpawn=false;
79
+
}
80
+
}
81
+
82
+
if(shouldSpawn)
83
+
{
84
+
ForcedNextWave=false;
85
+
CustomTeamSpawnedThisWave=true;
86
+
LimitPlayersToCustomTeam(ev);
87
+
LogManager.Debug($"Forced wave executed for {Plugin.NextTeam.Team.Name}");
88
+
return;
89
+
}
90
+
else
91
+
{
92
+
ForcedNextWave=false;
93
+
Plugin.NextTeam=null;
94
+
}
95
+
}
96
+
54
97
if(factionisWaveType.None)
55
98
{
56
99
Plugin.NextTeam=null;
@@ -61,32 +104,27 @@ public void OnRespawningTeam(RespawningTeamEventArgs ev)
61
104
62
105
if(!teamsToSpawn.Any())
63
106
{
64
-
LogManager.Debug("No valid team found in EvaluateSpawns, aborting team selection.");
0 commit comments