Skip to content

Commit

Permalink
Add project files.
Browse files Browse the repository at this point in the history
  • Loading branch information
EepySoldier committed May 13, 2023
1 parent b5af5b8 commit c0f52a5
Show file tree
Hide file tree
Showing 9 changed files with 400 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Config.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Neuron.Core.Meta;
using Syml;
using System;
using System.ComponentModel;

namespace SCPExpansionPack
{
[Automatic]
[Serializable]
[DocumentSection("SCP Expansion Pack Settings")]
public class Config : IDocumentSection
{
[Description("Is new coin logic enabled?")]
public bool isCoinEnabled { get; set; } = true;

[Description("For how long doors should remain closed? (seconds)")]
public int coinDuration { get; set; } = 8;

[Description("Is automated nuke enabled?")]
public bool isNukeEnabled { get; set; } = true;

[Description("After how much time should it turn on? (seconds)")]
public int nukeDelay { get; set; } = 1200;

[Description("Can guards escape?")]
public bool guardsEscape { get; set; } = true;

[Description("Should 096 target notification appear?")]
public bool targetNotification { get; set; } = true;
}
}
84 changes: 84 additions & 0 deletions EventHandlers.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
using Neuron.Core.Events;
using Neuron.Core.Meta;
using Ninject;
using Synapse3.SynapseModule;
using Synapse3.SynapseModule.Events;
using Synapse3.SynapseModule.Map;
using Synapse3.SynapseModule.Player;
using System;
using System.Linq;
using System.Threading.Tasks;

namespace SCPExpansionPack
{
[Automatic]
public class EventHandlers : Listener
{
[Inject]
public Plugin plugin { get; set; }

[EventHandler]
public async void Coin(DoorInteractEvent ev)
{
if(plugin.Config.isCoinEnabled)
{
if (ev.Player.Inventory.ItemInHand.ItemType == ItemType.Coin)
{
if (ev.Door.IsBreakable && ev.Door.Locked == false)
{
ev.Allow = false;
ev.Player.Inventory.RemoveItem(ev.Player.Inventory.ItemInHand);
ev.Door.Locked = true;
for (int i = 0; i < plugin.Config.coinDuration; i++)
{
ev.Player.SendHint(plugin.Translation.CoinNotification + (plugin.Config.coinDuration - i).ToString(), (float)1.02);
await Task.Delay(1000);
}
ev.Door.Locked = false;
}
}
}
}

[EventHandler]
public void Scp096AddTarget(Scp096AddTargetEvent ev)
{
if(plugin.Config.targetNotification)
{
ev.Player.SendBroadcast("You've become a target of SCP-096, RUN!", 3);
}
}

[EventHandler]
public async void Nuke(RoundStartEvent ev)
{
if(plugin.Config.isNukeEnabled)
{
NukeService nukeService = Synapse.Get<NukeService>();
CassieService cassieService = Synapse.Get<CassieService>();
await Task.Delay((plugin.Config.nukeDelay - 85) * 1000);
cassieService.Announce(plugin.Translation.CassieMessageO5);
await Task.Delay(60000);
nukeService.InsidePanel.Locked = true;
nukeService.StartDetonation();
}
}

[EventHandler]
public async void GuardsEscape(RoundStartEvent ev)
{
if(plugin.Config.guardsEscape)
{
PlayerService playerService = Synapse.Get<PlayerService>();
while (true)
{
await Task.Delay(1000);
foreach (SynapsePlayer player in playerService.Players.Where(player => player.RoleID == 15))
{
if (player.Position.x > 122 && player.Position.x < 127 && player.Position.z > 17 && player.Position.z < 20) player.RoleID = 13;
}
}
}
}
}
}
24 changes: 24 additions & 0 deletions Plugin.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Neuron.Core.Plugins;
using Synapse3.SynapseModule;

namespace SCPExpansionPack
{
[Plugin(
Author = "LoliEnjoyeer",
Name = "SCP Expansion Pack",
Description = "Adds/Changes various things to/in the game",
Version = "1.0.0"
)]
public class Plugin : ReloadablePlugin<Config, Translation>
{
public override void EnablePlugin()
{
Logger.Info("Expansion Pack has been enabled!");
}

public override void OnReload()
{
Logger.Info("Expansion Pack has been reloaded!");
}
}
}
36 changes: 36 additions & 0 deletions 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("SCPExpansionPack")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SCPExpansionPack")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[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("35bf6d7b-027c-4644-9229-519ca6b379ab")]

// 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")]
147 changes: 147 additions & 0 deletions SCPExpansionPack.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
<?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>{35BF6D7B-027C-4644-9229-519CA6B379AB}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SCPExpansionPack</RootNamespace>
<AssemblyName>SCPExpansionPack</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</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="0Harmony, Version=2.2.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\Lib.Harmony.2.2.2\lib\net48\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\SynapseSL.3.0.0-pre1.2\lib\net48\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\SynapseSL.3.0.0-pre1.2\lib\net48\Assembly-CSharp-firstpass.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Bcl.AsyncInterfaces.6.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Caching.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Extensions.Caching.Abstractions.6.0.0\lib\net461\Microsoft.Extensions.Caching.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Caching.Memory, Version=6.0.0.1, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Extensions.Caching.Memory.6.0.1\lib\net461\Microsoft.Extensions.Caching.Memory.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Extensions.DependencyInjection.Abstractions.6.0.0\lib\net461\Microsoft.Extensions.DependencyInjection.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Extensions.Logging.Abstractions.6.0.0\lib\net461\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Options, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Extensions.Options.6.0.0\lib\net461\Microsoft.Extensions.Options.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.Primitives, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>packages\Microsoft.Extensions.Primitives.6.0.0\lib\net461\Microsoft.Extensions.Primitives.dll</HintPath>
</Reference>
<Reference Include="Mirror, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\SynapseSL.3.0.0-pre1.2\lib\net48\Mirror.dll</HintPath>
</Reference>
<Reference Include="Neuron.Core, Version=1.0.2.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\NeuronModding.Core.1.0.2\lib\netstandard2.0\Neuron.Core.dll</HintPath>
</Reference>
<Reference Include="Neuron.Modules.Commands, Version=1.0.2.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\NeuronModding.Modules.Commands.1.0.2\lib\netstandard2.0\Neuron.Modules.Commands.dll</HintPath>
</Reference>
<Reference Include="Neuron.Modules.Configs, Version=1.0.2.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\NeuronModding.Modules.Configs.1.0.2\lib\netstandard2.0\Neuron.Modules.Configs.dll</HintPath>
</Reference>
<Reference Include="Neuron.Modules.Patcher, Version=1.0.2.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\NeuronModding.Modules.Patcher.1.0.2\lib\netstandard2.0\Neuron.Modules.Patcher.dll</HintPath>
</Reference>
<Reference Include="Ninject, Version=3.3.6.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
<HintPath>packages\Ninject.3.3.6\lib\net45\Ninject.dll</HintPath>
</Reference>
<Reference Include="SYML, Version=1.0.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\SYML.1.0.2\lib\netstandard2.0\SYML.dll</HintPath>
</Reference>
<Reference Include="Synapse3.SynapseModule, Version=3.0.0.0, Culture=neutral, processorArchitecture=AMD64">
<HintPath>packages\SynapseSL.3.0.0-pre1.2\lib\net48\Synapse3.SynapseModule.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Core" />
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<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, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\SynapseSL.3.0.0-pre1.2\lib\net48\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\SynapseSL.3.0.0-pre1.2\lib\net48\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\SynapseSL.3.0.0-pre1.2\lib\net48\UnityEngine.PhysicsModule.dll</HintPath>
</Reference>
<Reference Include="YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL">
<HintPath>packages\YamlDotNet.11.2.1\lib\net45\YamlDotNet.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Config.cs" />
<Compile Include="EventHandlers.cs" />
<Compile Include="Plugin.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Translation.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="packages\Microsoft.Extensions.Logging.Abstractions.6.0.0\build\Microsoft.Extensions.Logging.Abstractions.targets" Condition="Exists('packages\Microsoft.Extensions.Logging.Abstractions.6.0.0\build\Microsoft.Extensions.Logging.Abstractions.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('packages\Microsoft.Extensions.Logging.Abstractions.6.0.0\build\Microsoft.Extensions.Logging.Abstractions.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Microsoft.Extensions.Logging.Abstractions.6.0.0\build\Microsoft.Extensions.Logging.Abstractions.targets'))" />
</Target>
</Project>
25 changes: 25 additions & 0 deletions SCPExpansionPack.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33213.308
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SCPExpansionPack", "SCPExpansionPack.csproj", "{35BF6D7B-027C-4644-9229-519CA6B379AB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{35BF6D7B-027C-4644-9229-519CA6B379AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{35BF6D7B-027C-4644-9229-519CA6B379AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{35BF6D7B-027C-4644-9229-519CA6B379AB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{35BF6D7B-027C-4644-9229-519CA6B379AB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {68FA150B-FD88-47F7-AD7D-BB300B1565AB}
EndGlobalSection
EndGlobal
14 changes: 14 additions & 0 deletions Translation.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Neuron.Core.Meta;
using Neuron.Modules.Configs.Localization;
using System;

namespace SCPExpansionPack
{
[Automatic]
[Serializable]
public class Translation : Translations<Translation>
{
public string CoinNotification { get; set; } = "Doors are locked for: ";
public string CassieMessageO5 { get; set; } = "cassie_sl pitch_.2 .g4 .g4 pitch_1 . Facility diagnostic anomaly detected . .g2 o 5 password accepted .g3 . automatic warhead detonation sequence authorized pitch_.9 .g3 . pitch_1 detonation start tminus 1 minute . all personnel evacuate pitch_.8 . .g1 . .g1 . .g1 pitch_1 bell_end";
}
}
15 changes: 15 additions & 0 deletions app.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Extensions.Caching.Memory" publicKeyToken="adb9793829ddae60" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.1" newVersion="6.0.0.1" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Loading

0 comments on commit c0f52a5

Please sign in to comment.