From e7ae10a490dfa85cb01bffc93333d37bcc90eb1c Mon Sep 17 00:00:00 2001 From: DGvagabond <54526517+DGvagabond@users.noreply.github.com> Date: Fri, 10 Dec 2021 21:01:33 -0500 Subject: [PATCH] Updated to 4.1.5 --- Config.cs | 10 ++++++++-- EventHandlers.cs | 24 ++++++++++++++++-------- Scp008X.cs | 20 +++++++++++++------- 3 files changed, 37 insertions(+), 17 deletions(-) diff --git a/Config.cs b/Config.cs index 84da9f4..436cc92 100644 --- a/Config.cs +++ b/Config.cs @@ -1,8 +1,14 @@ -using System.ComponentModel; -using Exiled.API.Interfaces; +// ----------------------------------------------------------------------- +// +// Copyright (c) DGvagabond. All rights reserved. +// +// ----------------------------------------------------------------------- namespace SCP008X { + using System.ComponentModel; + using Exiled.API.Interfaces; + public sealed class Config : IConfig { public bool IsEnabled { get; set; } = true; diff --git a/EventHandlers.cs b/EventHandlers.cs index 03c3bf7..5af5de4 100644 --- a/EventHandlers.cs +++ b/EventHandlers.cs @@ -1,12 +1,18 @@ -using Exiled.Events.EventArgs; -using Exiled.API.Features; -using Exiled.API.Enums; -using Exiled.API.Extensions; -using MEC; -using Random = System.Random; +// ----------------------------------------------------------------------- +// +// Copyright (c) DGvagabond. All rights reserved. +// +// ----------------------------------------------------------------------- namespace SCP008X { + using Exiled.Events.EventArgs; + using Exiled.API.Features; + using Exiled.API.Enums; + using Exiled.API.Extensions; + using MEC; + using Random = System.Random; + public class EventHandlers { public Random Gen = new Random(); @@ -25,6 +31,7 @@ public void OnVerified(VerifiedEventArgs ev) public void OnHurt(HurtingEventArgs ev) { + if (ev.Attacker == null || ev.Target == null) return; if (ev.Attacker.Role == RoleType.Scp0492 && ev.Attacker != ev.Target) { ev.Amount = Scp008X.Instance.Config.ZombieDamage; @@ -51,7 +58,7 @@ public void OnHurt(HurtingEventArgs ev) { var leftover = ev.Amount - ev.Target.ArtificialHealth; ev.Target.ArtificialHealth = 0; - ev.Target.Hurt(leftover, ev.Attacker, ev.DamageType); + ev.Target.Hurt($"Hit by {ev.Attacker.DisplayNickname}", leftover); } else { @@ -88,7 +95,8 @@ public void OnRoleChange(ChangingRoleEventArgs ev) { Timing.CallDelayed(1f, () => { - ev.Player.ArtificialHealthDecay = ev.NewRole.GetTeam() != Team.SCP ? 1 : 0; + // TODO Create a workaround for ArtificialHealthDecay + // ev.Player.ArtificialHealthDecay = ev.NewRole.GetTeam() != Team.SCP ? 1 : 0; if(ev.NewRole == RoleType.Scp0492) { if(ev.Player.GetEffect(EffectType.Scp207).IsEnabled) ev.Player.DisableEffect(EffectType.Scp207); diff --git a/Scp008X.cs b/Scp008X.cs index 5ce4b01..5d7a7e7 100644 --- a/Scp008X.cs +++ b/Scp008X.cs @@ -1,11 +1,17 @@ -using System; -using Exiled.API.Features; -using PlayerEvents = Exiled.Events.Handlers.Player; -using ServerEvents = Exiled.Events.Handlers.Server; -using Exiled.Events.Handlers; +// ----------------------------------------------------------------------- +// +// Copyright (c) DGvagabond. All rights reserved. +// +// ----------------------------------------------------------------------- namespace SCP008X { + using System; + using Exiled.API.Features; + using PlayerEvents = Exiled.Events.Handlers.Player; + using ServerEvents = Exiled.Events.Handlers.Server; + using Exiled.Events.Handlers; + public class Scp008X : Plugin { internal static Scp008X Instance { get; } = new Scp008X(); @@ -15,8 +21,8 @@ private Scp008X() { } public override string Author => "DGvagabond"; public override string Name => "Scp008X"; - public override Version Version { get; } = new Version(3, 0, 0, 1); - public override Version RequiredExiledVersion { get; } = new Version(3, 0, 0); + public override Version Version { get; } = new Version(3, 1, 0, 0); + public override Version RequiredExiledVersion { get; } = new Version(4, 1, 5); private EventHandlers _events;