Skip to content
This repository has been archived by the owner on Sep 4, 2023. It is now read-only.

Commit

Permalink
latest in sexiled technology
Browse files Browse the repository at this point in the history
  • Loading branch information
Parkeymon committed Feb 19, 2022
1 parent 3015154 commit 9c0a6e1
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 13 deletions.
4 changes: 2 additions & 2 deletions BetterDoggie/BetterDoggie.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public class BetterDoggie : Plugin<Config>
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()
Expand Down
2 changes: 1 addition & 1 deletion BetterDoggie/BetterDoggie.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="EXILED" Version="4.1.2" />
<PackageReference Include="EXILED" Version="5.0.0-beta.1" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions BetterDoggie/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
31 changes: 21 additions & 10 deletions BetterDoggie/EventHandlers.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
namespace BetterDoggie
{
using System;
using UnityEngine;
using Exiled.API.Features;
using Exiled.Events.EventArgs;
using Interactables.Interobjects;
Expand All @@ -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);

Expand All @@ -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<SinkHole>(3f, true);
ev.Attacker.EnableEffect<SinkHole>(BetterDoggie.Singleton.Config.SlowdownDuration, BetterDoggie.Singleton.Config.ShouldSlowdownStack);
ev.Attacker.ChangeEffectIntensity<SinkHole>(2);
}

Expand All @@ -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;
Expand Down Expand Up @@ -91,5 +91,16 @@ private static void BustDoor(DoorVariant door, Player ply, bool speedBoost)
ply.ChangeEffectIntensity<MovementBoost>(BetterDoggie.Singleton.Config.BustBoostAmount);
Timing.CallDelayed(2f, () => ply.ChangeEffectIntensity<MovementBoost>(BetterDoggie.Singleton.Config.ColaSpeedBoost));
}


/// <summary>
/// Check if player is 939
/// </summary>
/// <param name="role"></param>
/// <returns></returns>
private static bool Is939(RoleType role)
{
return role == RoleType.Scp93953 || role == RoleType.Scp93989;
}
}
}

0 comments on commit 9c0a6e1

Please sign in to comment.