Skip to content

Commit

Permalink
Update EXILED to 8.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Ugi0 committed Sep 10, 2023
0 parents commit 7449436
Show file tree
Hide file tree
Showing 8 changed files with 323 additions and 0 deletions.
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# SigmaWarhead

> ![sigmawp](https://github.com/TenDRILLL/SigmaWarhead/assets/32621403/0266a0b0-d7a6-4417-a482-af1f6db2a860)
>
> 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.
16 changes: 16 additions & 0 deletions SigmaWarhead.sln
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
35 changes: 35 additions & 0 deletions SigmaWarhead/Properties/AssemblyInfo.cs
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")]
109 changes: 109 additions & 0 deletions SigmaWarhead/SigmaWarhead.csproj
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>
21 changes: 21 additions & 0 deletions SigmaWarhead/com.github.sekasin.sigmawarhead/Config.cs
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 SigmaWarhead/com.github.sekasin.sigmawarhead/EventHandler.cs
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();
}
}
27 changes: 27 additions & 0 deletions SigmaWarhead/com.github.sekasin.sigmawarhead/Plugin.cs
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.");
}
}
}
5 changes: 5 additions & 0 deletions SigmaWarhead/packages.config
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>

0 comments on commit 7449436

Please sign in to comment.