From 2212ec0148feba827985308f02bfcdd9302e341f Mon Sep 17 00:00:00 2001 From: yannt Date: Thu, 27 May 2021 19:39:47 +0200 Subject: [PATCH] =?UTF-8?q?Projektdateien=20hinzuf=C3=BCgen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bleeding.sln | 25 +++++++++ Bleeding/Bleeding.csproj | 85 +++++++++++++++++++++++++++++ Bleeding/Pluginclass.cs | 45 +++++++++++++++ Bleeding/Properties/AssemblyInfo.cs | 36 ++++++++++++ Bleeding/packages.config | 8 +++ 5 files changed, 199 insertions(+) create mode 100644 Bleeding.sln create mode 100644 Bleeding/Bleeding.csproj create mode 100644 Bleeding/Pluginclass.cs create mode 100644 Bleeding/Properties/AssemblyInfo.cs create mode 100644 Bleeding/packages.config diff --git a/Bleeding.sln b/Bleeding.sln new file mode 100644 index 0000000..5e855d4 --- /dev/null +++ b/Bleeding.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31321.278 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bleeding", "Bleeding\Bleeding.csproj", "{E8E0EC72-9D8E-4775-8164-0FE2DB5A942A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E8E0EC72-9D8E-4775-8164-0FE2DB5A942A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E8E0EC72-9D8E-4775-8164-0FE2DB5A942A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E8E0EC72-9D8E-4775-8164-0FE2DB5A942A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E8E0EC72-9D8E-4775-8164-0FE2DB5A942A}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {D4112D21-07E7-4344-9590-0EDF89E98189} + EndGlobalSection +EndGlobal diff --git a/Bleeding/Bleeding.csproj b/Bleeding/Bleeding.csproj new file mode 100644 index 0000000..1be8caf --- /dev/null +++ b/Bleeding/Bleeding.csproj @@ -0,0 +1,85 @@ + + + + + Debug + AnyCPU + {E8E0EC72-9D8E-4775-8164-0FE2DB5A942A} + Library + Properties + Bleeding + Bleeding + v4.7.2 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Lib.Harmony.2.0.4\lib\net472\0Harmony.dll + + + ..\packages\SynapseSL.2.6.0\lib\net472\Assembly-CSharp.dll + + + ..\packages\SynapseSL.2.6.0\lib\net472\Assembly-CSharp-firstpass.dll + + + ..\packages\LiteDB.5.0.9\lib\net45\LiteDB.dll + + + ..\packages\SynapseSL.2.6.0\lib\net472\Mirror.dll + + + ..\packages\SynapseSL.2.6.0\lib\net472\Synapse.dll + + + + + + ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll + + + + + + + + + ..\packages\SynapseSL.2.6.0\lib\net472\UnityEngine.dll + + + ..\packages\SynapseSL.2.6.0\lib\net472\UnityEngine.CoreModule.dll + + + ..\packages\SynapseSL.2.6.0\lib\net472\UnityEngine.PhysicsModule.dll + + + ..\packages\YamlDotNet.8.1.2\lib\net45\YamlDotNet.dll + + + + + + + + + + + \ No newline at end of file diff --git a/Bleeding/Pluginclass.cs b/Bleeding/Pluginclass.cs new file mode 100644 index 0000000..b9ebd9b --- /dev/null +++ b/Bleeding/Pluginclass.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Synapse.Api.Plugin; +using Synapse; + +namespace Bleeding +{ + [PluginInformation( + Author = "Wuffeli", + Description = "This Plugin will add bleeding to the game!", + LoadPriority = 0, + Name = "Bleeding", + SynapseMajor = 2, + SynapseMinor = 6, + SynapsePatch = 1, + Version = "V1.0.0" + )] + public class Pluginclass : AbstractPlugin + { + public override void Load() + { + base.Load(); + Synapse.Api.Logger.Get.Info("Bleeding started successfully!"); + Server.Get.Events.Player.PlayerDamageEvent += Player_PlayerDamageEvent; + } + + private void Player_PlayerDamageEvent(Synapse.Api.Events.SynapseEventArguments.PlayerDamageEventArgs ev) + { + if (ev.DamageAmount >= 5 && ev.HitInfo.GetDamageType() != DamageTypes.None) + { + ev.Victim.GiveTextHint("You will die in 60 seconds because of blood loss! Heal yourself with a MEDKIT!", 5); + var health = ev.Victim.Health - ev.DamageAmount; + + MEC.Timing.CallDelayed(60f, () => + { + if (ev.Victim.Health <= health) + ev.Victim.Kill(DamageTypes.None); + }); + } + } + } +} diff --git a/Bleeding/Properties/AssemblyInfo.cs b/Bleeding/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..0de6f5c --- /dev/null +++ b/Bleeding/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die einer Assembly zugeordnet sind. +[assembly: AssemblyTitle("Bleeding")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Bleeding")] +[assembly: AssemblyCopyright("Copyright © 2021")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly +// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von +// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. +[assembly: ComVisible(false)] + +// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird +[assembly: Guid("e8e0ec72-9d8e-4775-8164-0fe2db5a942a")] + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, +// indem Sie "*" wie unten gezeigt eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Bleeding/packages.config b/Bleeding/packages.config new file mode 100644 index 0000000..52adbad --- /dev/null +++ b/Bleeding/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file