From 9b21e76c5aa720a8fa3dde24dc6d11bc1fdc6781 Mon Sep 17 00:00:00 2001
From: GrafDimenzio <66207264+GrafDimenzio@users.noreply.github.com>
Date: Thu, 6 Apr 2023 12:45:41 +0200
Subject: [PATCH] Synapse 3
---
README.md | 23 ++++-
SerpentsHand/App.config | 18 ++++
SerpentsHand/Config.cs | 112 ++++++++++++++++++++++++
SerpentsHand/EventHandlers.cs | 33 +++----
SerpentsHand/PluginClass.cs | 39 ---------
SerpentsHand/PluginConfig.cs | 53 -----------
SerpentsHand/PluginTranslation.cs | 9 --
SerpentsHand/Properties/AssemblyInfo.cs | 1 -
SerpentsHand/SerpentsHand.cs | 20 +++++
SerpentsHand/SerpentsHand.csproj | 98 +++++++++++++++++----
SerpentsHand/SerpentsHandRole.cs | 97 ++++++++++++++------
SerpentsHand/SerpentsHandTeam.cs | 69 +++++++++++----
SerpentsHand/Translation.cs | 17 ++++
SerpentsHand/packages.config | 26 ++++--
14 files changed, 427 insertions(+), 188 deletions(-)
create mode 100644 SerpentsHand/App.config
create mode 100644 SerpentsHand/Config.cs
delete mode 100644 SerpentsHand/PluginClass.cs
delete mode 100644 SerpentsHand/PluginConfig.cs
delete mode 100644 SerpentsHand/PluginTranslation.cs
create mode 100644 SerpentsHand/SerpentsHand.cs
create mode 100644 SerpentsHand/Translation.cs
diff --git a/README.md b/README.md
index eb00824..f3c46aa 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,25 @@
## SerpentsHand
-A ScpSL plugin for Synapse that adds the SerpentsHand organization to the game. They work with the SCPs to eliminate all other beings.
+A ScpSL plugin for Synapse that adds the SerpentsHand organization to the game. They replace a Chaos Spawn and tries to kill all Humans in order to support the SCP's
## Installation
-1. Install [Synapse](https://github.com/SynapseSL/Synapse/)
-2. Place the SerpentsHand.dll in your plugin folder
-3. Restart/Start your Server
+Download the latest version of SerpentHand and unzip it inside your server directory
## Credits
* [Cyanox62](https://github.com/Cyanox62) is the one who had originally the idea in his [plugin](https://github.com/Cyanox62/SerpentsHand)
+
+## Roles
+```
+Name: SerpentsHand Cadet
+ID: 30
+Team: 7
+```
+```
+Name: SerpentsHand Private
+ID: 31
+Team: 7
+```
+```
+Name: SerpentsHand Sergeant
+ID: 32
+Team: 7
+```
diff --git a/SerpentsHand/App.config b/SerpentsHand/App.config
new file mode 100644
index 0000000..290e17a
--- /dev/null
+++ b/SerpentsHand/App.config
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SerpentsHand/Config.cs b/SerpentsHand/Config.cs
new file mode 100644
index 0000000..445363b
--- /dev/null
+++ b/SerpentsHand/Config.cs
@@ -0,0 +1,112 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using Neuron.Core.Meta;
+using PlayerRoles;
+using Syml;
+using Synapse3.SynapseModule.Config;
+using Synapse3.SynapseModule.Map.Rooms;
+using Synapse3.SynapseModule.Role;
+using UnityEngine;
+using YamlDotNet.Serialization;
+
+namespace SerpentsHand;
+
+[Automatic]
+[Serializable]
+[DocumentSection("SerpentsHand")]
+public class Config : IDocumentSection
+{
+ [Description("If friendlyfire for serpentshand is active")]
+ public bool FriendlyFire { get; set; } = false;
+
+ [Description("The chance that a SerpentsHand Squad spawns instead of a Chaos")]
+ public float SpawnChance { get; set; } = 50f;
+
+ [Description("The Cassie announcement that plays when SerpentsHand Spawn")]
+ public string Cassie { get; set; } = "serpents hand hasentered allremaining";
+
+ [Description("The maximal amount of players that can spawn as SerpentsHand in one squad")]
+ public int SpawnSize { get; set; } = 7;
+
+ public SHConfig CadetConfig { get; set; } = new();
+
+ public SHConfig PrivateConfig { get; set; } = new();
+
+ public SHConfig SergeantConfig { get; set; } = new();
+
+ public List UnitNames { get; set; } = new()
+ {
+ "Serpent",
+ "Anomaly",
+ "Occult",
+ "ScarletKing",
+ "Hand",
+ "Library"
+ };
+
+ [Serializable]
+ public class SHConfig : IAbstractRoleConfig
+ {
+ public RoleTypeId Role { get; set; } = RoleTypeId.Tutorial;
+ public RoleTypeId VisibleRole { get; set; } = RoleTypeId.None;
+ public RoleTypeId OwnRole { get; set; } = RoleTypeId.None;
+ public uint EscapeRole { get; set; } = uint.MaxValue;
+ public float Health { get; set; } = 120;
+ public float MaxHealth { get; set; } = 120;
+ public float ArtificialHealth { get; set; } = 0;
+ public float MaxArtificialHealth { get; set; } = 75;
+
+ public RoomPoint[] PossibleSpawns { get; set; } = new[]
+ {
+ new RoomPoint("Surface", new Vector3(0f,1.5f,5f), Vector3.zero)
+ };
+
+ public SerializedPlayerInventory[] PossibleInventories { get; set; } = new[]
+ {
+ new SerializedPlayerInventory()
+ {
+ Ammo = new SerializedAmmo
+ {
+ Ammo5 = 0,
+ Ammo7 = 120,
+ Ammo9 = 0,
+ Ammo12 = 0,
+ Ammo44 = 0
+ },
+ Items = new List
+ {
+ new((uint)ItemType.KeycardChaosInsurgency, 0f, 0u, Vector3.one, 100, false),
+ new((uint)ItemType.Medkit, 0f, 0u, Vector3.one, 100, false),
+ new((uint)ItemType.GunLogicer, 100f, 0u, Vector3.one, 100, false),
+ new((uint)ItemType.Painkillers, 0f, 0u, Vector3.one, 100, false),
+ new((uint)ItemType.ArmorCombat, 0f, 0u, Vector3.one, 100, false)
+ }
+ }
+ };
+
+ [YamlIgnore]
+ public bool CustomDisplay { get; set; } = true;
+ [YamlIgnore]
+ public bool Hierarchy { get; set; } = true;
+ [YamlIgnore]
+ public bool UseCustomUnitName { get; set; } = true;
+ [YamlIgnore]
+ public string CustomUnitName { get; set; }
+
+ public SerializedVector3 Scale { get; set; } = Vector3.one;
+
+ public SHConfig Copy() => new SHConfig()
+ {
+ Role = Role,
+ VisibleRole = VisibleRole,
+ EscapeRole = EscapeRole,
+ Health = Health,
+ MaxHealth = MaxHealth,
+ ArtificialHealth = ArtificialHealth,
+ MaxArtificialHealth = MaxArtificialHealth,
+ PossibleInventories = PossibleInventories,
+ PossibleSpawns = PossibleSpawns,
+ };
+ }
+}
diff --git a/SerpentsHand/EventHandlers.cs b/SerpentsHand/EventHandlers.cs
index 2c1dad0..d0ed09c 100644
--- a/SerpentsHand/EventHandlers.cs
+++ b/SerpentsHand/EventHandlers.cs
@@ -1,24 +1,19 @@
-using Synapse;
+using Neuron.Core.Events;
+using Neuron.Core.Meta;
+using Ninject;
+using Synapse3.SynapseModule.Events;
-namespace SerpentsHand
-{
- public class EventHandlers
- {
- public EventHandlers()
- {
- Server.Get.Events.Player.PlayerSetClassEvent += SetClass;
- Server.Get.Events.Round.TeamRespawnEvent += Respawn;
- }
+namespace SerpentsHand;
- private void Respawn(Synapse.Api.Events.SynapseEventArguments.TeamRespawnEventArgs ev)
- {
- if(ev.Team == Respawning.SpawnableTeamType.ChaosInsurgency && UnityEngine.Random.Range(1f,100f) <= PluginClass.Config.SpawnChance) ev.TeamID = 7;
- }
+[Automatic]
+public class EventHandlers : Listener
+{
+ [Inject]
+ public SerpentsHand Plugin { get; set; }
- private void SetClass(Synapse.Api.Events.SynapseEventArguments.PlayerSetClassEventArgs ev)
- {
- if (ev.Player.RoleID == 30)
- ev.Position = PluginClass.Config.SpawnPoint.Parse().Position;
- }
+ [EventHandler]
+ public void Select(SelectTeamEvent ev)
+ {
+ if (ev.TeamId == 1 && UnityEngine.Random.Range(1f, 100f) <= Plugin.Config.SpawnChance) ev.TeamId = 7;
}
}
diff --git a/SerpentsHand/PluginClass.cs b/SerpentsHand/PluginClass.cs
deleted file mode 100644
index a20aebf..0000000
--- a/SerpentsHand/PluginClass.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using Synapse;
-using Synapse.Api.Plugin;
-using Synapse.Translation;
-
-namespace SerpentsHand
-{
- [PluginInformation(
- Author = "Dimenzio",
- Description = "Adds the SerpentsHand to the game",
- LoadPriority = 1,
- Name = "SerpentsHand",
- SynapseMajor = 2,
- SynapseMinor = 9,
- SynapsePatch = 0,
- Version = "v.1.2.3"
- )]
- public class PluginClass : AbstractPlugin
- {
- [Config(section = "SerpentsHand")]
- public static PluginConfig Config { get; set; }
-
- [SynapseTranslation]
- public static new SynapseTranslation Translation { get; set; }
-
- public override void Load()
- {
- Server.Get.TeamManager.RegisterTeam();
- Server.Get.RoleManager.RegisterCustomRole();
-
- Translation.AddTranslation(new PluginTranslation());
- Translation.AddTranslation(new PluginTranslation()
- {
- SpawnMessage = "Du bist ein SerpentsHand\\nDein Ziel ist es den SCPs zu helfen!\\nDrück Esc zum schließen",
- }, "GERMAN");
- new EventHandlers();
- base.Load();
- }
- }
-}
diff --git a/SerpentsHand/PluginConfig.cs b/SerpentsHand/PluginConfig.cs
deleted file mode 100644
index 07696b1..0000000
--- a/SerpentsHand/PluginConfig.cs
+++ /dev/null
@@ -1,53 +0,0 @@
-using Synapse.Config;
-using System.Collections.Generic;
-using System.ComponentModel;
-using UnityEngine;
-
-namespace SerpentsHand
-{
- public class PluginConfig : AbstractConfigSection
- {
- [Description("If friendlyfire for serpentshand is active")]
- public bool Friendlyfire { get; set; } = false;
-
- [Description("The role that serpentshand will look like")]
- public RoleType SpawnRole { get; set; } = RoleType.Tutorial;
-
- [Description("The Health of SerpentsHand members")]
- public float Health { get; set; } = 120;
-
- [Description("The Role Name that is displayed when you look at the Player")]
- public string CustomRoleName { get; set; } = "SerpentsHand";
-
- [Description("The chance that a SerpentsHand Squad spawns instead of a Chaos")]
- public float SpawnChance { get; set; } = 50f;
-
- [Description("The Cassie announcement that plays when SerpentsHand Spawn")]
- public string Cassie { get; set; } = "serpents hand hasentered allremaining";
-
- [Description("The Spawnpoint where SerpentsHand spawn")]
- public SerializedMapPoint SpawnPoint { get; set; } = new SerializedMapPoint("Outside", -0.4426118f, 2.159119f, 7.987663f);
-
- [Description("The maximal amount of players that can spawn as SerpentsHand in one squad")]
- public int SpawnSize { get; set; } = 7;
-
- public SerializedPlayerInventory Inventory { get; set; } = new SerializedPlayerInventory
- {
- Ammo = new SerializedAmmo
- {
- Ammo5 = 40,
- Ammo7 = 40,
- Ammo9 = 30,
- Ammo12 = 14,
- Ammo44 = 18
- },
- Items = new List
- {
- new SerializedPlayerItem((int)ItemType.KeycardChaosInsurgency,0f,0u,Vector3.one,100,false),
- new SerializedPlayerItem((int)ItemType.Medkit,0f,0u,Vector3.one,100,false),
- new SerializedPlayerItem((int)ItemType.GunLogicer,100f,0u,Vector3.one,100,false),
- new SerializedPlayerItem((int)ItemType.Painkillers,0f,0u,Vector3.one,100,false)
- }
- };
- }
-}
diff --git a/SerpentsHand/PluginTranslation.cs b/SerpentsHand/PluginTranslation.cs
deleted file mode 100644
index 6832fd5..0000000
--- a/SerpentsHand/PluginTranslation.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-using Synapse.Translation;
-
-namespace SerpentsHand
-{
- public class PluginTranslation : IPluginTranslation
- {
- public string SpawnMessage { get; set; } = "You are a SerpentsHand\\nYour Goal is it to kill all Humans and help the scps\\nPress Esc to close";
- }
-}
diff --git a/SerpentsHand/Properties/AssemblyInfo.cs b/SerpentsHand/Properties/AssemblyInfo.cs
index 4d16681..013276e 100644
--- a/SerpentsHand/Properties/AssemblyInfo.cs
+++ b/SerpentsHand/Properties/AssemblyInfo.cs
@@ -1,5 +1,4 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Allgemeine Informationen über eine Assembly werden über die folgenden
diff --git a/SerpentsHand/SerpentsHand.cs b/SerpentsHand/SerpentsHand.cs
new file mode 100644
index 0000000..009b4fe
--- /dev/null
+++ b/SerpentsHand/SerpentsHand.cs
@@ -0,0 +1,20 @@
+using Neuron.Core.Meta;
+using Neuron.Core.Plugins;
+using Synapse3.SynapseModule;
+
+namespace SerpentsHand;
+
+[Automatic]
+[Plugin(
+ Name = "SerpentsHand",
+ Author = "Dimenzio",
+ Description = "Adds the new Spawnable Team SerpentsHand to the Game",
+ Version = "3.0.0"
+)]
+public class SerpentsHand : ReloadablePlugin
+{
+ public override void EnablePlugin()
+ {
+ Logger.Info("SerpentsHand Enabled!");
+ }
+}
\ No newline at end of file
diff --git a/SerpentsHand/SerpentsHand.csproj b/SerpentsHand/SerpentsHand.csproj
index e9c4dd6..7b5381b 100644
--- a/SerpentsHand/SerpentsHand.csproj
+++ b/SerpentsHand/SerpentsHand.csproj
@@ -9,9 +9,10 @@
Properties
SerpentsHand
SerpentsHand
- v4.7.2
+ v4.8
512
true
+ 10
true
@@ -21,6 +22,8 @@
DEBUG;TRACE
prompt
4
+ true
+ x64
pdbonly
@@ -29,31 +32,84 @@
TRACE
prompt
4
+ true
+ x64
-
- ..\packages\Lib.Harmony.2.2.0\lib\net472\0Harmony.dll
+
+ ..\packages\Lib.Harmony.2.2.2\lib\net48\0Harmony.dll
- ..\packages\SynapseSL.2.8.3-pre3\lib\net472\Assembly-CSharp.dll
+ ..\packages\SynapseSL.3.0.0-pre1.2\lib\net48\Assembly-CSharp.dll
- ..\packages\SynapseSL.2.8.3-pre3\lib\net472\Assembly-CSharp-firstpass.dll
+ ..\packages\SynapseSL.3.0.0-pre1.2\lib\net48\Assembly-CSharp-firstpass.dll
-
- ..\packages\LiteDB.5.0.11\lib\net45\LiteDB.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.2.8.3-pre3\lib\net472\Mirror.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\SynapseSL.2.8.3-pre3\lib\net472\Synapse.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.2-mauipre.1.22054.8\lib\net461\System.Runtime.CompilerServices.Unsafe.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
@@ -62,29 +118,37 @@
- ..\packages\SynapseSL.2.8.3-pre3\lib\net472\UnityEngine.dll
+ ..\packages\SynapseSL.3.0.0-pre1.2\lib\net48\UnityEngine.dll
- ..\packages\SynapseSL.2.8.3-pre3\lib\net472\UnityEngine.CoreModule.dll
+ ..\packages\SynapseSL.3.0.0-pre1.2\lib\net48\UnityEngine.CoreModule.dll
- ..\packages\SynapseSL.2.8.3-pre3\lib\net472\UnityEngine.PhysicsModule.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. Enable 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/SerpentsHand/SerpentsHandRole.cs b/SerpentsHand/SerpentsHandRole.cs
index 27c094f..3f315e1 100644
--- a/SerpentsHand/SerpentsHandRole.cs
+++ b/SerpentsHand/SerpentsHandRole.cs
@@ -1,36 +1,83 @@
using System.Collections.Generic;
+using Neuron.Core.Meta;
+using Ninject;
+using PlayerRoles;
+using Synapse3.SynapseModule;
+using Synapse3.SynapseModule.Enums;
+using Synapse3.SynapseModule.Role;
-namespace SerpentsHand
-{
- public class SerpentsHandRole : Synapse.Api.Roles.Role
- {
- public override int GetRoleID() => 30;
+namespace SerpentsHand;
- public override string GetRoleName() => "SerpentsHand";
+public abstract class SerpentsHandRole : SynapseAbstractRole
+{
+ [Inject]
+ public SerpentsHand Plugin { get; set; }
+
+ public SerpentsHandTeam ShTeam { get; set; }
+
+ protected Config.SHConfig _config;
+ protected override IAbstractRoleConfig GetConfig() => _config;
- public override int GetTeamID() => 7;
+ public override List GetFriendsID() => Plugin.Config.FriendlyFire
+ ? new List { (uint)Team.SCPs }
+ : new List { (uint)Team.SCPs, 7 };
- public override List GetFriendsID() => PluginClass.Config.Friendlyfire ? new List { (int)Team.SCP } : new List { (int)Team.SCP, 7 };
+ public override List GetEnemiesID() => new List { (uint)Team.ClassD, (uint)Team.FoundationForces, (uint)Team.Scientists };
- public override List GetEnemiesID() => new List { (int)Team.CDP, (int)Team.MTF, (int)Team.RSC };
+ protected override void PreSpawn()
+ {
+ ShTeam ??= Synapse.Get();
+ _config.CustomUnitName = ShTeam.LastSpawnUnit;
+ }
+}
- public override void Spawn()
- {
- Player.RoleType = PluginClass.Config.SpawnRole;
- Player.MaxHealth = PluginClass.Config.Health;
- Player.Health = PluginClass.Config.Health;
- Player.Inventory.Clear();
- PluginClass.Config.Inventory.Apply(Player);
+[Automatic]
+[Role(
+ Id = 30,
+ Name = "SerpentsHand Cadet",
+ TeamId = 7
+)]
+public class SerpentsHandCadet : SerpentsHandRole
+{
+ public override void Load() => _config = Plugin.Config.CadetConfig;
+
+ protected override void OnSpawn(IAbstractRoleConfig config)
+ {
+ if (Player.PlayerType != PlayerType.Dummy)
+ Player.SendWindowMessage(Plugin.Translation.Get(Player).SpawnMessageCadet.Replace("\\n", "\n"));
+ }
+}
- Player.DisplayInfo = PluginClass.Config.CustomRoleName;
- Player.RemoveDisplayInfo(PlayerInfoArea.Role);
- Player.OpenReportWindow(PluginClass.Translation.ActiveTranslation.SpawnMessage.Replace("\\n", "\n"));
- }
+[Automatic]
+[Role(
+ Id = 31,
+ Name = "SerpentsHand Private",
+ TeamId = 7
+)]
+public class SerpentsHandPrivate : SerpentsHandRole
+{
+ public override void Load() => _config = Plugin.Config.PrivateConfig;
+
+ protected override void OnSpawn(IAbstractRoleConfig config)
+ {
+ if (Player.PlayerType != PlayerType.Dummy)
+ Player.SendWindowMessage(Plugin.Translation.Get(Player).SpawnMessagePrivate.Replace("\\n", "\n"));
+ }
+}
- public override void DeSpawn()
- {
- Player.DisplayInfo = string.Empty;
- Player.AddDisplayInfo(PlayerInfoArea.Role);
- }
+[Automatic]
+[Role(
+ Id = 32,
+ Name = "SerpentsHand Sergeant",
+ TeamId = 7
+)]
+public class SerpentsHandSergeant : SerpentsHandRole
+{
+ public override void Load() => _config = Plugin.Config.SergeantConfig;
+
+ protected override void OnSpawn(IAbstractRoleConfig config)
+ {
+ if (Player.PlayerType != PlayerType.Dummy)
+ Player.SendWindowMessage(Plugin.Translation.Get(Player).SpawnMessageSergeant.Replace("\\n", "\n"));
}
}
diff --git a/SerpentsHand/SerpentsHandTeam.cs b/SerpentsHand/SerpentsHandTeam.cs
index 52aca74..4cf4aae 100644
--- a/SerpentsHand/SerpentsHandTeam.cs
+++ b/SerpentsHand/SerpentsHandTeam.cs
@@ -1,25 +1,62 @@
-using Synapse;
-using Synapse.Api;
-using Synapse.Api.Teams;
-using System.Collections.Generic;
+using System.Collections.Generic;
+using Neuron.Core.Meta;
+using Ninject;
+using Synapse3.SynapseModule.Enums;
+using Synapse3.SynapseModule.Map;
+using Synapse3.SynapseModule.Player;
+using Synapse3.SynapseModule.Teams;
+using UnityEngine;
-namespace SerpentsHand
+namespace SerpentsHand;
+
+[Automatic]
+[Team(
+ Id = 7,
+ Name = "SerpentsHand"
+ )]
+public class SerpentsHandTeam : SynapseTeam
{
- [SynapseTeamInformation(
- ID = 7,
- Name = "SerpentsHand"
- )]
- public class SerpentsHandTeam : SynapseTeam
+ [Inject]
+ public SerpentsHand Plugin { get; set; }
+
+ [Inject]
+ public CassieService Cassie { get; set; }
+
+ public string LastSpawnUnit { get; set; }
+
+ public override void SpawnPlayers(List players)
{
- public override void Spawn(List players)
+ LastSpawnUnit = Plugin.Config.UnitNames[Random.Range(1, Plugin.Config.UnitNames.Count)] + "-" +
+ Random.Range(0, 21).ToString("00");
+
+ var count = players.Count;
+ var privates = (count - 1) / 3;
+ for (int i = 0; i < count; i++)
{
- if (players.Count > PluginClass.Config.SpawnSize)
- players = players.GetRange(0, PluginClass.Config.SpawnSize);
+ var player = players[i];
+ if (i == 0)
+ {
+ player.RoleID = 32;
+ continue;
+ }
- foreach (var ply in players)
- ply.RoleID = 30;
+ if (i <= privates)
+ {
+ player.RoleID = 31;
+ continue;
+ }
- Server.Get.Map.GlitchedCassie(PluginClass.Config.Cassie);
+ player.RoleID = 30;
}
}
+
+ public override int MaxWaveSize => Plugin.Config.SpawnSize;
+
+ //I use 15 since it is close the Chaos/Mtf and Plugins can better predict when the respawn actually happens
+ public override float RespawnTime => 15f;
+
+ public override void RespawnAnnouncement()
+ {
+ Cassie.Announce(Plugin.Config.Cassie, CassieSettings.Noise, CassieSettings.Glitched);
+ }
}
diff --git a/SerpentsHand/Translation.cs b/SerpentsHand/Translation.cs
new file mode 100644
index 0000000..e53563d
--- /dev/null
+++ b/SerpentsHand/Translation.cs
@@ -0,0 +1,17 @@
+using Neuron.Core.Meta;
+using Neuron.Modules.Configs.Localization;
+
+namespace SerpentsHand;
+
+[Automatic]
+public class Translation : Translations
+{
+ public string SpawnMessageCadet { get; set; } =
+ "You are a SerpentsHand Cadet\\nYour Goal is it to kill all Humans and help the SCP's\\nPress N to close";
+
+ public string SpawnMessagePrivate { get; set; } =
+ "You are a SerpentsHand Private\\nYour Goal is it to kill all Humans and help the SCP's\\nPress N to close";
+
+ public string SpawnMessageSergeant { get; set; } =
+ "You are a SerpentsHand Sergeant\\nYour Goal is it to kill all Humans and help the SCP's\\nPress N to close";
+}
diff --git a/SerpentsHand/packages.config b/SerpentsHand/packages.config
index f2e29f8..8b0a8ee 100644
--- a/SerpentsHand/packages.config
+++ b/SerpentsHand/packages.config
@@ -1,8 +1,24 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file