From 9c0a6e16b7defef96cf6b8567b138af2f5000468 Mon Sep 17 00:00:00 2001 From: Parkeymon <68636315+Parkeymon@users.noreply.github.com> Date: Sat, 19 Feb 2022 11:42:04 -0800 Subject: [PATCH] latest in sexiled technology --- BetterDoggie/BetterDoggie.cs | 4 ++-- BetterDoggie/BetterDoggie.csproj | 2 +- BetterDoggie/Config.cs | 6 ++++++ BetterDoggie/EventHandlers.cs | 31 +++++++++++++++++++++---------- 4 files changed, 30 insertions(+), 13 deletions(-) diff --git a/BetterDoggie/BetterDoggie.cs b/BetterDoggie/BetterDoggie.cs index f64614b..06f0f9f 100644 --- a/BetterDoggie/BetterDoggie.cs +++ b/BetterDoggie/BetterDoggie.cs @@ -14,8 +14,8 @@ public class BetterDoggie : Plugin public override string Author => "Parkeymon"; public override string Name => "BetterDoggie"; public override string Prefix => "better_doggie"; - public override Version Version => new Version(1, 2, 1); - public override Version RequiredExiledVersion => new Version(4, 0, 0); + public override Version Version => new Version(1, 2, 2); + public override Version RequiredExiledVersion => new Version(5, 0, 0); public override PluginPriority Priority => PluginPriority.Low; public override void OnEnabled() diff --git a/BetterDoggie/BetterDoggie.csproj b/BetterDoggie/BetterDoggie.csproj index a81db72..dad4069 100644 --- a/BetterDoggie/BetterDoggie.csproj +++ b/BetterDoggie/BetterDoggie.csproj @@ -5,7 +5,7 @@ - + diff --git a/BetterDoggie/Config.cs b/BetterDoggie/Config.cs index a945bb4..bc61dca 100644 --- a/BetterDoggie/Config.cs +++ b/BetterDoggie/Config.cs @@ -19,6 +19,12 @@ public class Config : IConfig [Description("Should the dog get the a speed boost? (Set to 0 or less to disable)")] public byte ColaSpeedBoost { get; set; } = 20; + [Description("The duration the dog should get slowed down when attacking.")] + public float SlowdownDuration { get; set; } = 3f; + + [Description("Should the slowdown time stack for each attack the dog does? (Add X seconds to slowdown versus just resetting it to X seconds)")] + public bool ShouldSlowdownStack { get; set; } = true; + [Description("The size of the dog when it spawns.")] public Vector3 DoggieScale { get; set; } = new Vector3(.85f, .85f, .85f); diff --git a/BetterDoggie/EventHandlers.cs b/BetterDoggie/EventHandlers.cs index fc45fe0..43d3410 100644 --- a/BetterDoggie/EventHandlers.cs +++ b/BetterDoggie/EventHandlers.cs @@ -1,7 +1,6 @@ namespace BetterDoggie { using System; - using UnityEngine; using Exiled.API.Features; using Exiled.Events.EventArgs; using Interactables.Interobjects; @@ -13,15 +12,16 @@ public static class EventHandlers { public static void OnChangingRoles(ChangingRoleEventArgs ev) { - if (ev.Player.Role == RoleType.Scp93953 || ev.Player.Role == RoleType.Scp93989) - ev.Player.Scale = new Vector3(1, 1, 1); - - if (ev.NewRole != RoleType.Scp93953 && ev.NewRole != RoleType.Scp93989) + // Not sure why that was there. Probably me being stupid or I didnt comment something that said it was there for a reason lmao + /*if (Is939(ev.Player.Role)) + ev.Player.Scale = new Vector3(1, 1, 1);*/ + + if (!ev.NewRole.Is939()) return; Timing.CallDelayed(2f, () => { - if (ev.Player == null || (ev.Player.Role != RoleType.Scp93953 && ev.Player.Role != RoleType.Scp93989)) return; + if (ev.Player == null || !Is939(ev.Player.Role)) return; ev.Player.Broadcast(BetterDoggie.Singleton.Config.SpawnBroadcast); @@ -40,16 +40,16 @@ public static void OnChangingRoles(ChangingRoleEventArgs ev) public static void OnHurtingPlayer(HurtingEventArgs ev) { - if (ev.Attacker == null || ev.Target == null || ev.Attacker == ev.Target || (ev.Attacker.Role != RoleType.Scp93953 && ev.Attacker.Role != RoleType.Scp93989)) + if (ev.Attacker == null || ev.Target == null || ev.Attacker == ev.Target || !Is939(ev.Attacker.Role)) return; - // Original damage + percentage of hume shield gone * max damage (40 + .50 * 150) + // Original damage + percentage of hume shield gone * max damage | ex. (40 + .50 * 150) var maxHume = BetterDoggie.Singleton.Config.DoggieAhp; ev.Amount = BetterDoggie.Singleton.Config.BaseDamage + Math.Abs(ev.Attacker.ArtificialHealth - maxHume) / (maxHume * BetterDoggie.Singleton.Config.MaxDamageBoost); - ev.Attacker.EnableEffect(3f, true); + ev.Attacker.EnableEffect(BetterDoggie.Singleton.Config.SlowdownDuration, BetterDoggie.Singleton.Config.ShouldSlowdownStack); ev.Attacker.ChangeEffectIntensity(2); } @@ -58,7 +58,7 @@ public static void OnInteractingDoor(InteractingDoorEventArgs ev) if (!BetterDoggie.Singleton.Config.EnableDogDoorBusting) return; - if ((ev.Player.Role != RoleType.Scp93953 && ev.Player.Role != RoleType.Scp93989) + if (!Is939(ev.Player.Role) || (ev.Door.Base is IDamageableDoor door && door.IsDestroyed) || (ev.Door.Base is PryableDoor gate && gate.IsConsideredOpen())) return; @@ -91,5 +91,16 @@ private static void BustDoor(DoorVariant door, Player ply, bool speedBoost) ply.ChangeEffectIntensity(BetterDoggie.Singleton.Config.BustBoostAmount); Timing.CallDelayed(2f, () => ply.ChangeEffectIntensity(BetterDoggie.Singleton.Config.ColaSpeedBoost)); } + + + /// + /// Check if player is 939 + /// + /// + /// + private static bool Is939(RoleType role) + { + return role == RoleType.Scp93953 || role == RoleType.Scp93989; + } } } \ No newline at end of file