Skip to content

Commit 9b21e76

Browse files
committed
Synapse 3
1 parent b4e567f commit 9b21e76

14 files changed

+427
-188
lines changed

README.md

+19-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,25 @@
11
## SerpentsHand
2-
A ScpSL plugin for Synapse that adds the SerpentsHand organization to the game. They work with the SCPs to eliminate all other beings.
2+
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
33

44
## Installation
5-
1. Install [Synapse](https://github.com/SynapseSL/Synapse/)
6-
2. Place the SerpentsHand.dll in your plugin folder
7-
3. Restart/Start your Server
5+
Download the latest version of SerpentHand and unzip it inside your server directory
86

97
## Credits
108
* [Cyanox62](https://github.com/Cyanox62) is the one who had originally the idea in his [plugin](https://github.com/Cyanox62/SerpentsHand)
9+
10+
## Roles
11+
```
12+
Name: SerpentsHand Cadet
13+
ID: 30
14+
Team: 7
15+
```
16+
```
17+
Name: SerpentsHand Private
18+
ID: 31
19+
Team: 7
20+
```
21+
```
22+
Name: SerpentsHand Sergeant
23+
ID: 32
24+
Team: 7
25+
```

SerpentsHand/App.config

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?><configuration>
2+
<runtime>
3+
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
4+
<dependentAssembly>
5+
<assemblyIdentity name="Microsoft.Extensions.Caching.Memory" publicKeyToken="adb9793829ddae60" culture="neutral" />
6+
<bindingRedirect oldVersion="0.0.0.0-6.0.0.1" newVersion="6.0.0.1" />
7+
</dependentAssembly>
8+
<dependentAssembly>
9+
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
10+
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
11+
</dependentAssembly>
12+
<dependentAssembly>
13+
<assemblyIdentity name="Mono.Cecil" publicKeyToken="50cebf1cceb9d05e" culture="neutral" />
14+
<bindingRedirect oldVersion="0.0.0.0-0.11.4.0" newVersion="0.11.4.0" />
15+
</dependentAssembly>
16+
</assemblyBinding>
17+
</runtime>
18+
</configuration>

SerpentsHand/Config.cs

+112
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.ComponentModel;
4+
using Neuron.Core.Meta;
5+
using PlayerRoles;
6+
using Syml;
7+
using Synapse3.SynapseModule.Config;
8+
using Synapse3.SynapseModule.Map.Rooms;
9+
using Synapse3.SynapseModule.Role;
10+
using UnityEngine;
11+
using YamlDotNet.Serialization;
12+
13+
namespace SerpentsHand;
14+
15+
[Automatic]
16+
[Serializable]
17+
[DocumentSection("SerpentsHand")]
18+
public class Config : IDocumentSection
19+
{
20+
[Description("If friendlyfire for serpentshand is active")]
21+
public bool FriendlyFire { get; set; } = false;
22+
23+
[Description("The chance that a SerpentsHand Squad spawns instead of a Chaos")]
24+
public float SpawnChance { get; set; } = 50f;
25+
26+
[Description("The Cassie announcement that plays when SerpentsHand Spawn")]
27+
public string Cassie { get; set; } = "serpents hand hasentered allremaining";
28+
29+
[Description("The maximal amount of players that can spawn as SerpentsHand in one squad")]
30+
public int SpawnSize { get; set; } = 7;
31+
32+
public SHConfig CadetConfig { get; set; } = new();
33+
34+
public SHConfig PrivateConfig { get; set; } = new();
35+
36+
public SHConfig SergeantConfig { get; set; } = new();
37+
38+
public List<string> UnitNames { get; set; } = new()
39+
{
40+
"Serpent",
41+
"Anomaly",
42+
"Occult",
43+
"ScarletKing",
44+
"Hand",
45+
"Library"
46+
};
47+
48+
[Serializable]
49+
public class SHConfig : IAbstractRoleConfig
50+
{
51+
public RoleTypeId Role { get; set; } = RoleTypeId.Tutorial;
52+
public RoleTypeId VisibleRole { get; set; } = RoleTypeId.None;
53+
public RoleTypeId OwnRole { get; set; } = RoleTypeId.None;
54+
public uint EscapeRole { get; set; } = uint.MaxValue;
55+
public float Health { get; set; } = 120;
56+
public float MaxHealth { get; set; } = 120;
57+
public float ArtificialHealth { get; set; } = 0;
58+
public float MaxArtificialHealth { get; set; } = 75;
59+
60+
public RoomPoint[] PossibleSpawns { get; set; } = new[]
61+
{
62+
new RoomPoint("Surface", new Vector3(0f,1.5f,5f), Vector3.zero)
63+
};
64+
65+
public SerializedPlayerInventory[] PossibleInventories { get; set; } = new[]
66+
{
67+
new SerializedPlayerInventory()
68+
{
69+
Ammo = new SerializedAmmo
70+
{
71+
Ammo5 = 0,
72+
Ammo7 = 120,
73+
Ammo9 = 0,
74+
Ammo12 = 0,
75+
Ammo44 = 0
76+
},
77+
Items = new List<SerializedPlayerItem>
78+
{
79+
new((uint)ItemType.KeycardChaosInsurgency, 0f, 0u, Vector3.one, 100, false),
80+
new((uint)ItemType.Medkit, 0f, 0u, Vector3.one, 100, false),
81+
new((uint)ItemType.GunLogicer, 100f, 0u, Vector3.one, 100, false),
82+
new((uint)ItemType.Painkillers, 0f, 0u, Vector3.one, 100, false),
83+
new((uint)ItemType.ArmorCombat, 0f, 0u, Vector3.one, 100, false)
84+
}
85+
}
86+
};
87+
88+
[YamlIgnore]
89+
public bool CustomDisplay { get; set; } = true;
90+
[YamlIgnore]
91+
public bool Hierarchy { get; set; } = true;
92+
[YamlIgnore]
93+
public bool UseCustomUnitName { get; set; } = true;
94+
[YamlIgnore]
95+
public string CustomUnitName { get; set; }
96+
97+
public SerializedVector3 Scale { get; set; } = Vector3.one;
98+
99+
public SHConfig Copy() => new SHConfig()
100+
{
101+
Role = Role,
102+
VisibleRole = VisibleRole,
103+
EscapeRole = EscapeRole,
104+
Health = Health,
105+
MaxHealth = MaxHealth,
106+
ArtificialHealth = ArtificialHealth,
107+
MaxArtificialHealth = MaxArtificialHealth,
108+
PossibleInventories = PossibleInventories,
109+
PossibleSpawns = PossibleSpawns,
110+
};
111+
}
112+
}

SerpentsHand/EventHandlers.cs

+14-19
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
1-
using Synapse;
1+
using Neuron.Core.Events;
2+
using Neuron.Core.Meta;
3+
using Ninject;
4+
using Synapse3.SynapseModule.Events;
25

3-
namespace SerpentsHand
4-
{
5-
public class EventHandlers
6-
{
7-
public EventHandlers()
8-
{
9-
Server.Get.Events.Player.PlayerSetClassEvent += SetClass;
10-
Server.Get.Events.Round.TeamRespawnEvent += Respawn;
11-
}
6+
namespace SerpentsHand;
127

13-
private void Respawn(Synapse.Api.Events.SynapseEventArguments.TeamRespawnEventArgs ev)
14-
{
15-
if(ev.Team == Respawning.SpawnableTeamType.ChaosInsurgency && UnityEngine.Random.Range(1f,100f) <= PluginClass.Config.SpawnChance) ev.TeamID = 7;
16-
}
8+
[Automatic]
9+
public class EventHandlers : Listener
10+
{
11+
[Inject]
12+
public SerpentsHand Plugin { get; set; }
1713

18-
private void SetClass(Synapse.Api.Events.SynapseEventArguments.PlayerSetClassEventArgs ev)
19-
{
20-
if (ev.Player.RoleID == 30)
21-
ev.Position = PluginClass.Config.SpawnPoint.Parse().Position;
22-
}
14+
[EventHandler]
15+
public void Select(SelectTeamEvent ev)
16+
{
17+
if (ev.TeamId == 1 && UnityEngine.Random.Range(1f, 100f) <= Plugin.Config.SpawnChance) ev.TeamId = 7;
2318
}
2419
}

SerpentsHand/PluginClass.cs

-39
This file was deleted.

SerpentsHand/PluginConfig.cs

-53
This file was deleted.

SerpentsHand/PluginTranslation.cs

-9
This file was deleted.

SerpentsHand/Properties/AssemblyInfo.cs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Reflection;
2-
using System.Runtime.CompilerServices;
32
using System.Runtime.InteropServices;
43

54
// Allgemeine Informationen über eine Assembly werden über die folgenden

SerpentsHand/SerpentsHand.cs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using Neuron.Core.Meta;
2+
using Neuron.Core.Plugins;
3+
using Synapse3.SynapseModule;
4+
5+
namespace SerpentsHand;
6+
7+
[Automatic]
8+
[Plugin(
9+
Name = "SerpentsHand",
10+
Author = "Dimenzio",
11+
Description = "Adds the new Spawnable Team SerpentsHand to the Game",
12+
Version = "3.0.0"
13+
)]
14+
public class SerpentsHand : ReloadablePlugin<Config, Translation>
15+
{
16+
public override void EnablePlugin()
17+
{
18+
Logger.Info("SerpentsHand Enabled!");
19+
}
20+
}

0 commit comments

Comments
 (0)