Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
6hundred9 authored Mar 31, 2024
1 parent 1862380 commit 229ce2c
Show file tree
Hide file tree
Showing 5 changed files with 241 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Scp575-Exiled8/Config.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using Exiled.API.Interfaces;
using Exiled.API.Features;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
using UserSettings.AudioSettings;

namespace Scp575_Exiled8
{
public class Config : IConfig
{
public bool IsEnabled { get; set; } = true;
public bool Debug { get; set; } = false;
public int spawnChance { get; set; } = 100;
public int minSpawnTime { get; set; } = 120;
public int maxSpawnTime { get; set; } = 180;
public int minBlackoutTime { get; set; } = 60;
public int maxBlackoutTime { get; set; } = 90;
[Description("The breach message used for C.A.S.S.I.E announcement")]
public string breachCassie { get; set; } = "Attention . All personnel . SCP 5 7 5 has breached containment";
[Description("The recontainment message used for C.A.S.S.I.E announcement")]
public string recontainCassie { get; set; } = "SCP 5 7 5 has been recontained";
}
}
73 changes: 73 additions & 0 deletions Scp575-Exiled8/Events/ServerHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@

using Exiled.API.Features;
using PluginAPI.Events;
using System;
using System.Collections;
using System.Threading;
using MEC;
using System.Collections.Generic;
using Exiled.Events.EventArgs.Server;
using UnityEngine;
using Random = UnityEngine.Random;
using Exiled.Events.EventArgs.Player;
using PlayerRoles;
using System.Linq;
using System.Diagnostics.Eventing.Reader;

namespace Scp575_Exiled8.Events
{
public class ServerHandler
{
private static Config config = Scp575.Instance.Config;
private static bool scpsAlive = true;
private static MEC.CoroutineHandle yes;
private static bool breached = false;

public static void OnRoundStarted()
{
yes = Timing.RunCoroutine(iHaveNoIdeaWhatToNameThis());
}

public static void OnRoundEnded(RoundEndedEventArgs ev)
{
Timing.KillCoroutines(yes);
}



public static IEnumerator<float> iHaveNoIdeaWhatToNameThis()
{
for (; ; )
{

yield return Timing.WaitForSeconds(Random.Range(config.minSpawnTime, config.maxSpawnTime));
if (Player.List.Count(x => x.IsScp) == 0) scpsAlive = false; else scpsAlive = true;
if (Random.Range(config.spawnChance, 101) == 100 && scpsAlive)
{
Log.Info("Spawn condition met");
if (scpsAlive)
{
Map.TurnOffAllLights(Random.Range(config.minBlackoutTime, config.maxSpawnTime));
if (!breached) Cassie.Message(config.breachCassie); Log.Info("Breached");
if (breached) Log.Info("Breach already happened");
breached = true;
} else
{
if (breached)
{
Cassie.Message(config.recontainCassie);
Log.Info("No More SCPs are left");
break;
}
else Log.Info("Breach never happened");
break;

}
} else
{
Log.Info("Spawn condition not met");
}
}
}
}
}
36 changes: 36 additions & 0 deletions Scp575-Exiled8/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Scp939MaxHealth-Exiled880")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Scp939MaxHealth-Exiled880")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("0efba00c-a84f-4ca1-8714-8390e9ce993b")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
64 changes: 64 additions & 0 deletions Scp575-Exiled8/Scp575-Exiled8.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{0EFBA00C-A84F-4CA1-8714-8390E9CE993B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Scp939MaxHealth_Exiled880</RootNamespace>
<AssemblyName>Scp575-Exiled8</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>false</DebugSymbols>
<DebugType>none</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Assembly-CSharp-firstpass">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Config.cs" />
<Compile Include="Events\ServerHandler.cs" />
<Compile Include="Scp575.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="EXILED">
<Version>8.8.0</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Connected Services\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
41 changes: 41 additions & 0 deletions Scp575-Exiled8/Scp575.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using Exiled.API.Features;
using Exiled;
using Exiled.Events.EventArgs.Player;
using Scp575_Exiled8.Events;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;

namespace Scp575_Exiled8
{
public class Scp575 : Plugin<Config>
{
public override string Author => "6hundred9";
public override string Name => "SCP575";

public override string Prefix => "575";

public override Version Version => new Version(2, 1, 0);

public static Scp575 Instance { get; set; } = null;



public override void OnEnabled()
{
Instance = this;
Exiled.Events.Handlers.Server.RoundStarted += ServerHandler.OnRoundStarted;
Exiled.Events.Handlers.Server.RoundEnded += ServerHandler.OnRoundEnded;
}

public override void OnDisabled()
{
Exiled.Events.Handlers.Server.RoundStarted -= ServerHandler.OnRoundStarted;
Exiled.Events.Handlers.Server.RoundEnded -= ServerHandler.OnRoundEnded;

}
}
}

0 comments on commit 229ce2c

Please sign in to comment.