Skip to content

Commit

Permalink
Synapse 3
Browse files Browse the repository at this point in the history
  • Loading branch information
GrafDimenzio committed Apr 6, 2023
1 parent b4e567f commit 9b21e76
Show file tree
Hide file tree
Showing 14 changed files with 427 additions and 188 deletions.
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
```
18 changes: 18 additions & 0 deletions SerpentsHand/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?><configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<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>
<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="Mono.Cecil" publicKeyToken="50cebf1cceb9d05e" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-0.11.4.0" newVersion="0.11.4.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
112 changes: 112 additions & 0 deletions SerpentsHand/Config.cs
Original file line number Diff line number Diff line change
@@ -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<string> 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<SerializedPlayerItem>
{
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,
};
}
}
33 changes: 14 additions & 19 deletions SerpentsHand/EventHandlers.cs
Original file line number Diff line number Diff line change
@@ -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;
}
}
39 changes: 0 additions & 39 deletions SerpentsHand/PluginClass.cs

This file was deleted.

53 changes: 0 additions & 53 deletions SerpentsHand/PluginConfig.cs

This file was deleted.

9 changes: 0 additions & 9 deletions SerpentsHand/PluginTranslation.cs

This file was deleted.

1 change: 0 additions & 1 deletion SerpentsHand/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// Allgemeine Informationen über eine Assembly werden über die folgenden
Expand Down
20 changes: 20 additions & 0 deletions SerpentsHand/SerpentsHand.cs
Original file line number Diff line number Diff line change
@@ -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<Config, Translation>
{
public override void EnablePlugin()
{
Logger.Info("SerpentsHand Enabled!");
}
}
Loading

0 comments on commit 9b21e76

Please sign in to comment.