From c0f52a543c96d4baada87c14540a22282f767ef0 Mon Sep 17 00:00:00 2001 From: Cool Joe Date: Sat, 13 May 2023 19:37:22 +0200 Subject: [PATCH] Add project files. --- Config.cs | 31 ++++++++ EventHandlers.cs | 84 +++++++++++++++++++++ Plugin.cs | 24 ++++++ Properties/AssemblyInfo.cs | 36 +++++++++ SCPExpansionPack.csproj | 147 +++++++++++++++++++++++++++++++++++++ SCPExpansionPack.sln | 25 +++++++ Translation.cs | 14 ++++ app.config | 15 ++++ packages.config | 24 ++++++ 9 files changed, 400 insertions(+) create mode 100644 Config.cs create mode 100644 EventHandlers.cs create mode 100644 Plugin.cs create mode 100644 Properties/AssemblyInfo.cs create mode 100644 SCPExpansionPack.csproj create mode 100644 SCPExpansionPack.sln create mode 100644 Translation.cs create mode 100644 app.config create mode 100644 packages.config diff --git a/Config.cs b/Config.cs new file mode 100644 index 0000000..d779265 --- /dev/null +++ b/Config.cs @@ -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; + } +} diff --git a/EventHandlers.cs b/EventHandlers.cs new file mode 100644 index 0000000..3647a93 --- /dev/null +++ b/EventHandlers.cs @@ -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(); + CassieService cassieService = Synapse.Get(); + 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(); + 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; + } + } + } + } + } +} diff --git a/Plugin.cs b/Plugin.cs new file mode 100644 index 0000000..2b2098b --- /dev/null +++ b/Plugin.cs @@ -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 + { + public override void EnablePlugin() + { + Logger.Info("Expansion Pack has been enabled!"); + } + + public override void OnReload() + { + Logger.Info("Expansion Pack has been reloaded!"); + } + } +} diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..8104cfa --- /dev/null +++ b/Properties/AssemblyInfo.cs @@ -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")] diff --git a/SCPExpansionPack.csproj b/SCPExpansionPack.csproj new file mode 100644 index 0000000..9116428 --- /dev/null +++ b/SCPExpansionPack.csproj @@ -0,0 +1,147 @@ + + + + + Debug + AnyCPU + {35BF6D7B-027C-4644-9229-519CA6B379AB} + Library + Properties + SCPExpansionPack + SCPExpansionPack + v4.8 + 512 + true + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + packages\Lib.Harmony.2.2.2\lib\net48\0Harmony.dll + + + packages\SynapseSL.3.0.0-pre1.2\lib\net48\Assembly-CSharp.dll + + + packages\SynapseSL.3.0.0-pre1.2\lib\net48\Assembly-CSharp-firstpass.dll + + + packages\Microsoft.Bcl.AsyncInterfaces.6.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll + + + packages\Microsoft.Extensions.Caching.Abstractions.6.0.0\lib\net461\Microsoft.Extensions.Caching.Abstractions.dll + + + packages\Microsoft.Extensions.Caching.Memory.6.0.1\lib\net461\Microsoft.Extensions.Caching.Memory.dll + + + packages\Microsoft.Extensions.DependencyInjection.Abstractions.6.0.0\lib\net461\Microsoft.Extensions.DependencyInjection.Abstractions.dll + + + packages\Microsoft.Extensions.Logging.Abstractions.6.0.0\lib\net461\Microsoft.Extensions.Logging.Abstractions.dll + + + packages\Microsoft.Extensions.Options.6.0.0\lib\net461\Microsoft.Extensions.Options.dll + + + packages\Microsoft.Extensions.Primitives.6.0.0\lib\net461\Microsoft.Extensions.Primitives.dll + + + packages\SynapseSL.3.0.0-pre1.2\lib\net48\Mirror.dll + + + packages\NeuronModding.Core.1.0.2\lib\netstandard2.0\Neuron.Core.dll + + + packages\NeuronModding.Modules.Commands.1.0.2\lib\netstandard2.0\Neuron.Modules.Commands.dll + + + packages\NeuronModding.Modules.Configs.1.0.2\lib\netstandard2.0\Neuron.Modules.Configs.dll + + + packages\NeuronModding.Modules.Patcher.1.0.2\lib\netstandard2.0\Neuron.Modules.Patcher.dll + + + packages\Ninject.3.3.6\lib\net45\Ninject.dll + + + packages\SYML.1.0.2\lib\netstandard2.0\SYML.dll + + + packages\SynapseSL.3.0.0-pre1.2\lib\net48\Synapse3.SynapseModule.dll + + + + packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + + + + + packages\System.Memory.4.5.4\lib\net461\System.Memory.dll + + + + packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + + packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + + + packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll + + + + + + + + + packages\SynapseSL.3.0.0-pre1.2\lib\net48\UnityEngine.dll + + + packages\SynapseSL.3.0.0-pre1.2\lib\net48\UnityEngine.CoreModule.dll + + + packages\SynapseSL.3.0.0-pre1.2\lib\net48\UnityEngine.PhysicsModule.dll + + + packages\YamlDotNet.11.2.1\lib\net45\YamlDotNet.dll + + + + + + + + + + + + + + + + + + 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}. + + + + \ No newline at end of file diff --git a/SCPExpansionPack.sln b/SCPExpansionPack.sln new file mode 100644 index 0000000..9705167 --- /dev/null +++ b/SCPExpansionPack.sln @@ -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 diff --git a/Translation.cs b/Translation.cs new file mode 100644 index 0000000..d15660f --- /dev/null +++ b/Translation.cs @@ -0,0 +1,14 @@ +using Neuron.Core.Meta; +using Neuron.Modules.Configs.Localization; +using System; + +namespace SCPExpansionPack +{ + [Automatic] + [Serializable] + public class Translation : Translations + { + 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"; + } +} diff --git a/app.config b/app.config new file mode 100644 index 0000000..ea2c5fc --- /dev/null +++ b/app.config @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/packages.config b/packages.config new file mode 100644 index 0000000..8b0a8ee --- /dev/null +++ b/packages.config @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file