Skip to content
Open
Show file tree
Hide file tree
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
57 changes: 33 additions & 24 deletions EndConditionsExtension/Config.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
using EndConditionsExtension.Elements;
using Exiled.API.Interfaces;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EndConditionsExtension
{
internal class Config : IConfig
{
[Description("Is the plugin enabled?")]
public bool IsEnabled { get; set; }
[Description("Do enable the debug (developer) mode?")]
public bool Debug { get; set; }
[Description("A list of conditions for each CustomRole")]
public Dictionary<int, EndCondition> EndConditions { get; set; } = new()
{
{ 1, new() }
};
}
}
using EndConditionsExtension.Elements;
using System.Collections.Generic;
using System.ComponentModel;

namespace EndConditionsExtension
{
public class Config
{
[Description("Is the plugin enabled?")]
public bool IsEnabled { get; set; } = true;

[Description("Enable debug (developer) mode?")]
public bool Debug { get; set; } = false;

[Description("Traditional per-role-ID end conditions (Key = Role ID)")]
public Dictionary<int, EndCondition> EndConditions { get; set; } = new()
{
{ 1, new EndCondition() }
};

[Description("Custom-team based end conditions (Key = CustomTeamId name)")]
public Dictionary<string, CustomTeamEndCondition> CustomTeamEndConditions { get; set; } = new()
{
{ "SerpentHand", new CustomTeamEndCondition() }
};

[Description("Escape-based win conditions (Key = Identifier)")]
public Dictionary<string, EscapeWinCondition> EscapeWinConditions { get; set; } = new()
{
{ "SerpentHandEscape", new EscapeWinCondition() }
};
}
}
29 changes: 29 additions & 0 deletions EndConditionsExtension/Elements/CustomTeamEndCondition.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using PlayerRoles;
using PlayerRoles.RoleAssign;
using System.Collections.Generic;
using System.ComponentModel;

namespace EndConditionsExtension.Elements
{
public class CustomTeamEndCondition
{
[Description("The custom team identifier this applies to (e.g., 'SerpentHand')")]
public string CustomTeamId { get; set; } = "SerpentHand";

[Description("List of base teams that are friendly to this custom team")]
public List<Team> FriendlyTeams { get; set; } = new()
{
Team.ChaosInsurgency,
Team.SCPs
};

[Description("Does this team need to be the only team left alive (along with friendlies)?")]
public bool MustBeLastStanding { get; set; } = true;

[Description("Maximum number of non-friendly players allowed alive for the round to end (Requires MustBeLastStanding = false)")]
public int MaxEnemyPlayers { get; set; } = 0;

[Description("Which team wins the round when this condition is met?")]
public LeadingTeam WinningTeam { get; set; } = LeadingTeam.ChaosInsurgency;
}
}
51 changes: 27 additions & 24 deletions EndConditionsExtension/Elements/EndCondition.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
using EndConditionsExtension.Structures;
using Exiled.API.Enums;
using PlayerRoles;
using System.Collections.Generic;
using System.ComponentModel;

namespace EndConditionsExtension.Elements
{
internal class EndCondition : IEndCondition
{
[Description("Decide if to end the round must remain only the CustomRole's team, no matter the number")]
public bool MustRemainOnlyOneTeam { get; set; } = false;
[Description("If the must_remain_only_one_team bool is false here you can decide which teams are needed to end the round and the maximum number of members that they can have. Leave it empty to allow all roles\n# You don't need to include here the role team")]
public Dictionary<Team, int> RemainingTeams { get; set; } = new()
{
{ Team.ClassD, 5 },
{ Team.Scientists, 1 }
};
[Description("Here you can decide how many people are needed to keep the round going (this will be effective if the first bool is false) and evaluates all of the roles in the remaining_teams dictionary")]
public int MaxPlayersToEnd { get; set; }
[Description("Set the team who will win if this condition will be true")]
public LeadingTeam WinningTeam { get; set; } = LeadingTeam.Draw;
}
}
using EndConditionsExtension.Structures;
using PlayerRoles;
using PlayerRoles.RoleAssign;
using System.Collections.Generic;
using System.ComponentModel;

namespace EndConditionsExtension.Elements
{
public class EndCondition : IEndCondition
{
[Description("Decide if to end the round must remain only the CustomRole's team, no matter the number")]
public bool MustRemainOnlyOneTeam { get; set; } = false;

[Description("If the must_remain_only_one_team bool is false here you can decide which teams are needed to end the round and the maximum number of members that they can have. Leave it empty to allow all roles\n# You don't need to include here the role team")]
public Dictionary<Team, int> RemainingTeams { get; set; } = new()
{
{ Team.ClassD, 5 },
{ Team.Scientists, 1 }
};

[Description("Here you can decide how many people are needed to keep the round going (this will be effective if the first bool is false) and evaluates all of the roles in the remaining_teams dictionary")]
public int MaxPlayersToEnd { get; set; }

[Description("Set the team who will win if this condition will be true")]
public LeadingTeam WinningTeam { get; set; } = LeadingTeam.Draw;
}
}
29 changes: 29 additions & 0 deletions EndConditionsExtension/Elements/EscapeWinCondition.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using PlayerRoles.RoleAssign;
using System.ComponentModel;

namespace EndConditionsExtension.Elements
{
public class EscapeWinCondition
{
[Description("The custom team identifier this applies to (e.g., 'SerpentHand')")]
public string CustomTeamId { get; set; } = "SerpentHand";

[Description("How many players of this custom team must escape to trigger the win condition")]
public int RequiredEscapes { get; set; } = 1;

[Description("Does at least one SCP need to be alive for the escape to count towards the win condition?")]
public bool RequireScpAlive { get; set; } = true;

[Description("How many SCPs must be alive when the required escapes is reached? (Requires RequireScpAlive = true)")]
public int RequireScpEscortCount { get; set; } = 1;

[Description("Which team wins the round when this condition is met?")]
public LeadingTeam WinningTeam { get; set; } = LeadingTeam.ChaosInsurgency;

[Description("How many points to award the winning team (if scoring is enabled)")]
public int AwardPoints { get; set; } = 2;

[Description("Optional broadcast to send to all players when this condition is met (Leave empty to disable)")]
public string Broadcast { get; set; } = "<color=green>The Serpent's Hand has escaped with an SCP! They win!</color>";
}
}
Loading