Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.
Merged
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
898 changes: 0 additions & 898 deletions AutoEvent-NWApi/Interfaces/Event.cs

This file was deleted.

398 changes: 0 additions & 398 deletions AutoEvent-NWApi/Loader.cs

This file was deleted.

196 changes: 0 additions & 196 deletions AutoEvent-NWApi/Plugin.cs

This file was deleted.

4 changes: 2 additions & 2 deletions AutoEvent/API/Components/SchematicCollisionComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
using System.Collections.Generic;
using System.Linq;
using AdminToys;
using AutoEvent.API.Schematic;
using AutoEvent.API.Schematic.Objects;
using MER.Lite;
using MER.Lite.Objects;
using Mirror;
using PlayerStatsSystem;
using PluginAPI.Core;
Expand Down
4 changes: 2 additions & 2 deletions AutoEvent/API/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
using PlayerRoles;
using SCPSLAudioApi.AudioCore;
using VoiceChat;
using AutoEvent.API.Schematic.Objects;
using AutoEvent.API.Schematic;
using MER.Lite.Objects;
using MER.Lite;
using PluginAPI.Core;
using InventorySystem.Items.Pickups;
using PlayerStatsSystem;
Expand Down
7 changes: 6 additions & 1 deletion AutoEvent/API/RoleCount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public RoleCount(int minimumPlayers = 0, int maximumPlayers = -1, float playerPe
[Description($"The percentage of players that will be on the team. -1 to ignore.")]
public float PlayerPercentage { get; set; } = 100;

public List<Player> GetPlayers([CanBeNull] List<Player> availablePlayers = null)
public List<Player> GetPlayers(bool alwaysLeaveOnePlayer = true, List<Player>? availablePlayers = null)
{
float percent = Player.GetPlayers().Count * (PlayerPercentage / 100f);
int players = Mathf.Clamp((int)percent, MinimumPlayers,
Expand Down Expand Up @@ -75,6 +75,11 @@ public List<Player> GetPlayers([CanBeNull] List<Player> availablePlayers = null)
DebugLogger.LogDebug("Could not assign player to list.", LogLevel.Warn);
DebugLogger.LogDebug($"{e}", LogLevel.Debug);
}
if(alwaysLeaveOnePlayer && validPlayers.Count >= (availablePlayers ?? Player.GetPlayers()).Count)
{
var plyToRemove = validPlayers.RandomItem();
validPlayers.Remove(plyToRemove);
}
return validPlayers;
}
}
26 changes: 26 additions & 0 deletions AutoEvent/AutoEvent.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<Nullable>enable</Nullable>
<Configurations>Release</Configurations>
<Platforms>AnyCPU</Platforms>
<Version>9.2.0</Version>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release EXILED|AnyCPU' ">
<OutputPath>..\bin\Release\Exiled</OutputPath>
Expand All @@ -34,6 +35,9 @@
<LangVersion>default</LangVersion>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Costura.Fody" Version="5.7.0">
<PrivateAssets>all</PrivateAssets>
Expand Down Expand Up @@ -78,4 +82,26 @@
<Content Include="FodyWeavers.xml" />
<Content Include="PlantUMLDocuments\*" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Remove="SchematicApi\**" />
<EmbeddedResource Remove="SchematicApi\*" />
<EmbeddedResource Remove="PowerupApi\**" />
<EmbeddedResource Remove="PowerupApi\*" />
</ItemGroup>
<ItemGroup>
<None Remove="SchematicApi\**" />
<None Remove="SchematicApi\*" />
<None Remove="PowerupApi\**" />
<None Remove="PowerupApi\*" />
</ItemGroup>
<ItemGroup>
<Compile Remove="SchematicApi\**" />
<Compile Remove="SchematicApi\*" />
<Compile Remove="PowerupApi\**" />
<Compile Remove="PowerupApi\*" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="PowerupApi\PowerupApi.csproj" />
<ProjectReference Include="SchematicApi\SchematicApi.csproj" />
</ItemGroup>
</Project>
12 changes: 12 additions & 0 deletions AutoEvent/AutoEvent.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ VisualStudioVersion = 17.5.33627.172
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoEvent", "AutoEvent.csproj", "{3C3FC008-22E1-4B28-BA50-A241B30CC216}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SchematicApi", "SchematicApi\SchematicApi.csproj", "{580DFED2-B2D7-4B89-B245-D60246BCFB79}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PowerupApi", "PowerupApi\PowerupApi.csproj", "{1B07FE64-A112-499D-8A55-67EE912B1CB7}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Release NWApi|Any CPU = Release NWApi|Any CPU
Expand All @@ -15,6 +19,14 @@ Global
{3C3FC008-22E1-4B28-BA50-A241B30CC216}.Release NWApi|Any CPU.Build.0 = Release NWApi|Any CPU
{3C3FC008-22E1-4B28-BA50-A241B30CC216}.Release Exiled|Any CPU.ActiveCfg = Release EXILED|Any CPU
{3C3FC008-22E1-4B28-BA50-A241B30CC216}.Release Exiled|Any CPU.Build.0 = Release EXILED|Any CPU
{580DFED2-B2D7-4B89-B245-D60246BCFB79}.Release NWApi|Any CPU.ActiveCfg = Release|Any CPU
{580DFED2-B2D7-4B89-B245-D60246BCFB79}.Release NWApi|Any CPU.Build.0 = Release|Any CPU
{580DFED2-B2D7-4B89-B245-D60246BCFB79}.Release Exiled|Any CPU.ActiveCfg = Release|Any CPU
{580DFED2-B2D7-4B89-B245-D60246BCFB79}.Release Exiled|Any CPU.Build.0 = Release|Any CPU
{1B07FE64-A112-499D-8A55-67EE912B1CB7}.Release NWApi|Any CPU.ActiveCfg = Release|Any CPU
{1B07FE64-A112-499D-8A55-67EE912B1CB7}.Release NWApi|Any CPU.Build.0 = Release|Any CPU
{1B07FE64-A112-499D-8A55-67EE912B1CB7}.Release Exiled|Any CPU.ActiveCfg = Release|Any CPU
{1B07FE64-A112-499D-8A55-67EE912B1CB7}.Release Exiled|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
2 changes: 1 addition & 1 deletion AutoEvent/Commands/Config/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ protected override bool ExecuteParent(ArraySegment<string> arguments, ICommandSe

public override string Command => nameof(Config);
public override string[] Aliases => Array.Empty<string>();
public override string Description => "Allows modifying configs before and during events..";
public override string Description => "Allows modifying configs before and during events";
}

/*
Expand Down
2 changes: 1 addition & 1 deletion AutoEvent/Commands/Debug/Debug.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,5 @@ protected override bool ExecuteParent(ArraySegment<string> arguments, ICommandSe

public override string Command => nameof(global::AutoEvent.Commands.Debug);
public override string[] Aliases => Array.Empty<string>();
public override string Description => "Runs various debug functions.";
public override string Description => "Runs various debug functions";
}
7 changes: 4 additions & 3 deletions AutoEvent/Commands/Debug/PowerupCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using AutoEvent.Interfaces;
using CommandSystem;
using PluginAPI.Core;
using Powerups;
using UnityEngine;
using Player = PluginAPI.Core.Player;
#if EXILED
Expand All @@ -28,7 +29,7 @@ namespace AutoEvent.Commands.Debug;

public class PowerupCommand : ICommand, IPermission, IUsageProvider
{
public string Command => nameof(Interfaces.Powerup);
public string Command => "Powerup";
public string[] Aliases => Array.Empty<string>();
public string Description => "Manages powerups.";
public string[] Usage => new []{ "Give / Remove / Spawn / List", "Player / Powerup", "Powerup / Position X", "Position Y", "Position Z" };
Expand All @@ -47,7 +48,7 @@ public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out s
goto usage;
}
Player ply = null!;
Interfaces.Powerup powerup = null!;
Powerup powerup = null!;

switch (arguments.At(0).ToLower())
{
Expand Down Expand Up @@ -142,7 +143,7 @@ public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out s
case 1:
if (arguments.At(i) == "*")
{
foreach (Interfaces.Powerup powerupInstance in PowerupManager.RegisteredPowerups)
foreach (Powerup powerupInstance in PowerupManager.RegisteredPowerups)
{
if (powerupInstance.ActivePlayers.ContainsKey(ply))
{
Expand Down
Loading