Skip to content

Commit

Permalink
The zombie hotline opens up calls for all SCPs
Browse files Browse the repository at this point in the history
Pat give me the unbased UGA member tag
  • Loading branch information
babyboucher committed Aug 31, 2020
1 parent 004ad84 commit 15f6073
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
10 changes: 8 additions & 2 deletions ZombieSuicideHotline/Config.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
using System.ComponentModel;
using Exiled.API.Interfaces;
using System.Collections.Generic;

namespace ZombieSuicideHotline
{
public class Config : IConfig {
[Description("Is the plugin enabled?")]
public bool IsEnabled { get; set; } = true;

[Description("How much do Teslas and Drops deal to zombies?")]
public float ZombieDmg { get; set; } = 0;
[Description("A list of classes that should beable to call the suicide hotline and what precent of their health is done")]
public Dictionary<string, float> HotlineCalls { get; set; } = new Dictionary<string, float>
{
{
"Scp0492", 0.5f
},
};
}
}
16 changes: 9 additions & 7 deletions ZombieSuicideHotline/PlayerHandlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,18 @@ public void OnPlayerDied(DiedEventArgs ev)

public void OnPlayerHurt(HurtingEventArgs ev)
{
if (ev.Target.Role == RoleType.Scp0492 && (ev.DamageType == DamageTypes.Tesla || ev.DamageType == DamageTypes.Wall || ev.DamageType == DamageTypes.Decont))
if ((ev.DamageType == DamageTypes.Tesla || ev.DamageType == DamageTypes.Wall || ev.DamageType == DamageTypes.Decont))
{
Player targetPlayer = GetTeleportTarget(ev.Target);
if (targetPlayer != null)
if (plugin.Config.HotlineCalls.ContainsKey(ev.Target.Role.ToString()))
{
Player targetPlayer = GetTeleportTarget(ev.Target);
if (targetPlayer != null)
{
ev.Amount = plugin.Config.ZombieDmg;
ev.Target.Position = targetPlayer.Position;
ev.Amount = (ev.Target.Health * plugin.Config.HotlineCalls[ev.Target.Role.ToString()]);
ev.Target.Position = targetPlayer.Position;
}
}

}
}
}

public void OnPlayerLeft(LeftEventArgs ev)
Expand Down

0 comments on commit 15f6073

Please sign in to comment.