Skip to content

Commit

Permalink
Updated to 4.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
DGvagabond committed Dec 11, 2021
1 parent 671c3b2 commit e7ae10a
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 17 deletions.
10 changes: 8 additions & 2 deletions Config.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
using System.ComponentModel;
using Exiled.API.Interfaces;
// -----------------------------------------------------------------------
// <copyright file="Config.cs">
// Copyright (c) DGvagabond. All rights reserved.
// </copyright>
// -----------------------------------------------------------------------

namespace SCP008X
{
using System.ComponentModel;
using Exiled.API.Interfaces;

public sealed class Config : IConfig
{
public bool IsEnabled { get; set; } = true;
Expand Down
24 changes: 16 additions & 8 deletions EventHandlers.cs
Original file line number Diff line number Diff line change
@@ -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 file="EventHandlers.cs">
// Copyright (c) DGvagabond. All rights reserved.
// </copyright>
// -----------------------------------------------------------------------

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();
Expand All @@ -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;
Expand All @@ -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
{
Expand Down Expand Up @@ -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);
Expand Down
20 changes: 13 additions & 7 deletions Scp008X.cs
Original file line number Diff line number Diff line change
@@ -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 file="Scp008X.cs">
// Copyright (c) DGvagabond. All rights reserved.
// </copyright>
// -----------------------------------------------------------------------

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<Config>
{
internal static Scp008X Instance { get; } = new Scp008X();
Expand All @@ -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;

Expand Down

0 comments on commit e7ae10a

Please sign in to comment.