-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7449436
Showing
8 changed files
with
323 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# SigmaWarhead | ||
|
||
>  | ||
> | ||
> EXILED plugin that re-creates Auto-Nuke feature with a custom C.A.S.S.I.E. voiceline and configurable timer. | ||
Just edit the config to your liking. | ||
|
||
### Installation | ||
## Installation | ||
Download SigmaWarhead.dll from [Releases](/Releases). | ||
|
||
Move SigmaWarhead.dll to .config/EXILED/Plugins and restart server. | ||
|
||
## Configuration | ||
Edit values in .config/EXILED/Configs/PORT-config.yml | ||
|
||
Example config with default values: | ||
```yml | ||
sigma_warhead: | ||
# Is the Plugin enabled. | ||
is_enabled: true | ||
# Debug mode. | ||
debug: true | ||
# C.A.S.S.I.E. voicelines. | ||
cassie_lines: | ||
launch: Automatic .G3 jam_020_5 Sigma .G1 Warhead has been activated by .G6 pitch_0.69 O5 pitch_1.00 . Time until jam_020_3 detonation is .G2 T minus 90 seconds . | ||
# Minutes since start of round to activate Sigma Warhead. | ||
activation_time: 20 | ||
``` | ||
* is_enabled | ||
> A boolean; Controls if SigmaWarhead is enabled or not. | ||
* debug | ||
> A boolean; Enables some extra logging. | ||
* cassie_lines | ||
> A dictionary with strings; Custom Cassie voicelines. Is a dict if I later implement more. | ||
* activation_time | ||
> An int; Defines how many minutes since the start of round to starting of Sigma Warhead. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SigmaWarhead", "SigmaWarhead\SigmaWarhead.csproj", "{EC5EB752-ED14-4C9F-95EB-87ED4AF70884}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{EC5EB752-ED14-4C9F-95EB-87ED4AF70884}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{EC5EB752-ED14-4C9F-95EB-87ED4AF70884}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{EC5EB752-ED14-4C9F-95EB-87ED4AF70884}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{EC5EB752-ED14-4C9F-95EB-87ED4AF70884}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System.Reflection; | ||
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("SigmaWarhead")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("SigmaWarhead")] | ||
[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("EC5EB752-ED14-4C9F-95EB-87ED4AF70884")] | ||
|
||
// 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")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" DefaultTargets="Build" 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>{EC5EB752-ED14-4C9F-95EB-87ED4AF70884}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>SigmaWarhead</RootNamespace> | ||
<AssemblyName>SigmaWarhead</AssemblyName> | ||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<LangVersion>latest</LangVersion> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<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' "> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<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, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\EXILED.8.2.1\lib\net48\Assembly-CSharp-Publicized.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Assembly-CSharp-firstpass"> | ||
<HintPath>F:\JetBrains\Assemblies\Assembly-CSharp-firstpass.dll</HintPath> | ||
</Reference> | ||
<Reference Include="CommandSystem.Core, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\EXILED.8.2.1\lib\net48\CommandSystem.Core.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Exiled.API, Version=8.2.1.0, Culture=neutral, processorArchitecture=Amd64"> | ||
<HintPath>..\packages\EXILED.8.2.1\lib\net48\Exiled.API.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Exiled.CreditTags, Version=8.2.1.0, Culture=neutral, processorArchitecture=Amd64"> | ||
<HintPath>..\packages\EXILED.8.2.1\lib\net48\Exiled.CreditTags.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Exiled.CustomItems, Version=8.2.1.0, Culture=neutral, processorArchitecture=Amd64"> | ||
<HintPath>..\packages\EXILED.8.2.1\lib\net48\Exiled.CustomItems.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Exiled.CustomRoles, Version=8.2.1.0, Culture=neutral, processorArchitecture=Amd64"> | ||
<HintPath>..\packages\EXILED.8.2.1\lib\net48\Exiled.CustomRoles.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Exiled.Events, Version=8.2.1.0, Culture=neutral, processorArchitecture=Amd64"> | ||
<HintPath>..\packages\EXILED.8.2.1\lib\net48\Exiled.Events.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Exiled.Loader, Version=8.2.1.0, Culture=neutral, processorArchitecture=Amd64"> | ||
<HintPath>..\packages\EXILED.8.2.1\lib\net48\Exiled.Loader.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Exiled.Permissions, Version=8.2.1.0, Culture=neutral, processorArchitecture=Amd64"> | ||
<HintPath>..\packages\EXILED.8.2.1\lib\net48\Exiled.Permissions.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Exiled.Updater, Version=3.1.2.0, Culture=neutral, processorArchitecture=Amd64"> | ||
<HintPath>..\packages\EXILED.8.2.1\lib\net48\Exiled.Updater.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Mirror"> | ||
<HintPath>F:\JetBrains\Assemblies\Mirror.dll</HintPath> | ||
</Reference> | ||
<Reference Include="NorthwoodLib, Version=1.3.0.0, Culture=neutral, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\EXILED.8.2.1\lib\net48\NorthwoodLib.dll</HintPath> | ||
</Reference> | ||
<Reference Include="PluginAPI, Version=12.0.0.0, Culture=neutral, processorArchitecture=Amd64"> | ||
<HintPath>..\packages\EXILED.8.2.1\lib\net48\PluginAPI.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System"/> | ||
<Reference Include="System.Core"/> | ||
<Reference Include="System.Data"/> | ||
<Reference Include="System.Xml"/> | ||
<Reference Include="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\Defiant_Zombie.KSP.Skeleton.UnityEngine.CoreModule.1.11.2\lib\UnityEngine.CoreModule.dll</HintPath> | ||
</Reference> | ||
<Reference Include="YamlDotNet, Version=11.0.0.0, Culture=neutral, PublicKeyToken=ec19458f3c15af5e, processorArchitecture=MSIL"> | ||
<HintPath>..\packages\EXILED.8.2.1\lib\net48\YamlDotNet.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="com.github.sekasin.sigmawarhead\Config.cs" /> | ||
<Compile Include="com.github.sekasin.sigmawarhead\EventHandler.cs" /> | ||
<Compile Include="com.github.sekasin.sigmawarhead\Plugin.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs"/> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="App.config" /> | ||
<None Include="packages.config" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets"/> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using Exiled.API.Interfaces; | ||
|
||
namespace SigmaWarhead.com.github.sekasin.sigmawarhead { | ||
public sealed class Config : IConfig { | ||
[Description("Is the Plugin enabled.")] | ||
public bool IsEnabled { get; set; } = true; | ||
|
||
[Description("Debug mode.")] | ||
public bool Debug { get; set; } = false; | ||
|
||
[Description("C.A.S.S.I.E. voicelines.")] | ||
public Dictionary<string, string> CassieLines { get; set; } = new(){ | ||
{ "launch", "Automatic .G3 jam_020_5 Sigma .G1 Warhead has been activated by .G6 pitch_0.69 O5 pitch_1.00 . Time until jam_020_3 detonation is .G2 T minus 90 seconds ." } | ||
}; | ||
|
||
[Description("Minutes since start of round to activate Sigma Warhead.")] | ||
public int ActivationTime { get; set; } = 20; | ||
} | ||
} |
72 changes: 72 additions & 0 deletions
72
SigmaWarhead/com.github.sekasin.sigmawarhead/EventHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
using System.Linq; | ||
using Exiled.API.Features; | ||
using Exiled.Events.EventArgs.Server; | ||
using Server = Exiled.Events.Handlers.Server; | ||
using MEC; | ||
|
||
namespace SigmaWarhead.com.github.sekasin.sigmawarhead; | ||
|
||
public class EventHandler | ||
{ | ||
private readonly Plugin<Config> _main; | ||
private readonly bool _debugMode; | ||
private readonly int TimeToLaunch; | ||
private readonly string LaunchMessage; | ||
CoroutineHandle timer; | ||
|
||
public EventHandler(Plugin<Config> plugin) | ||
{ | ||
_main = plugin; | ||
_debugMode = plugin.Config.Debug; | ||
if (_debugMode) { | ||
Log.Info("Loading EventHandler"); | ||
} | ||
|
||
TimeToLaunch = plugin.Config.ActivationTime; | ||
LaunchMessage = plugin.Config.CassieLines.FirstOrDefault(x => x.Key == "launch").Value; | ||
|
||
Server.RoundStarted += StartSigma; | ||
Server.RestartingRound += StopSigma; | ||
Server.RoundEnded += StopSigma2; | ||
} | ||
|
||
public void UnregisterEvents() | ||
{ | ||
Server.RoundStarted -= StartSigma; | ||
Server.RestartingRound -= StopSigma; | ||
Server.RoundEnded -= StopSigma2; | ||
} | ||
|
||
internal void StartSigma() | ||
{ | ||
timer = Timing.CallDelayed(TimeToLaunch * 60, LaunchSigmaWarhead); | ||
if (_debugMode) | ||
{ | ||
Log.Debug("SigmaWarhead armed and will launch in " + TimeToLaunch + " minutes."); | ||
} | ||
} | ||
|
||
internal void StopSigma() | ||
{ | ||
Timing.KillCoroutines(timer); | ||
Log.Info("SigmaWarhead timer destroyed."); | ||
} | ||
|
||
internal void StopSigma2(RoundEndedEventArgs args) | ||
{ | ||
StopSigma(); | ||
} | ||
|
||
internal void LaunchSigmaWarhead() | ||
{ | ||
Log.Info("SigmaWarhead launched."); | ||
Cassie.Clear(); | ||
Cassie.Message(LaunchMessage, false, true, true); | ||
Timing.CallDelayed(12, () => { | ||
Warhead.Controller.StartDetonation(false, true); | ||
Warhead.Controller.ForceTime(80); | ||
Warhead.IsLocked = true; | ||
}); | ||
StopSigma(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
using Exiled.API.Features; | ||
|
||
namespace SigmaWarhead.com.github.sekasin.sigmawarhead { | ||
public class SigmaWarhead : Plugin<Config> { | ||
public override string Name => "SigmaWarhead"; | ||
public override string Author => "TenDRILLL"; | ||
public override Version Version => new Version(1, 0, 4); | ||
public EventHandler EventHandler; | ||
|
||
public override void OnEnabled() { | ||
Log.Info("SigmaWarhead loading..."); | ||
if (!Config.IsEnabled) { | ||
Log.Warn("SigmaWarhead disabled from config, unloading..."); | ||
OnDisabled(); | ||
return; | ||
} | ||
EventHandler = new EventHandler(this); | ||
Log.Info("SigmaWarhead loaded."); | ||
} | ||
|
||
public override void OnDisabled() { | ||
EventHandler.UnregisterEvents(); | ||
Log.Info("SigmaWarhead unloaded."); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Defiant_Zombie.KSP.Skeleton.UnityEngine.CoreModule" version="1.11.2" targetFramework="net48" /> | ||
<package id="EXILED" version="8.2.1" targetFramework="net48" /> | ||
</packages> |