Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
god tuts, no god teslas
Browse files Browse the repository at this point in the history
  • Loading branch information
joker-119 committed Jan 25, 2020
1 parent b624309 commit 94aa57b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions AdminTools/EventHandlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -851,5 +851,17 @@ public void OnRoundEnd()
Plugin.Error($"Round End: {e}");
}
}

public void OnTriggerTesla(ref TriggerTeslaEvent ev)
{
if (ev.Player.characterClassManager.GodMode)
ev.Triggerable = false;
}

public void OnSetClass(SetClassEvent ev)
{
if (plugin.GodTuts)
ev.Player.characterClassManager.GodMode = ev.Role == RoleType.Tutorial;
}
}
}
7 changes: 7 additions & 0 deletions AdminTools/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class Plugin : EXILED.Plugin
public List<Jailed> JailedPlayers = new List<Jailed>();
public string OverwatchFilePath;
public string HiddenTagsFilePath;
public bool GodTuts = true;

public override void OnEnable()
{
Expand All @@ -20,6 +21,8 @@ public override void OnEnable()
string overwatchFileName = Path.Combine(path, "AdminTools-Overwatch.txt");
string hiddenTagFileName = Path.Combine(path, "AdminTools-HiddenTags.txt");

GodTuts = Config.GetBool("admin_god_tuts", true);

if (!Directory.Exists(path))
Directory.CreateDirectory(path);

Expand All @@ -36,13 +39,17 @@ public override void OnEnable()
Events.RemoteAdminCommandEvent += EventHandlers.OnCommand;
Events.PlayerJoinEvent += EventHandlers.OnPlayerJoin;
Events.RoundEndEvent += EventHandlers.OnRoundEnd;
Events.TriggerTeslaEvent += EventHandlers.OnTriggerTesla;
Events.SetClassEvent += EventHandlers.OnSetClass;
}

public override void OnDisable()
{
Events.RemoteAdminCommandEvent -= EventHandlers.OnCommand;
Events.PlayerJoinEvent -= EventHandlers.OnPlayerJoin;
Events.RoundEndEvent -= EventHandlers.OnRoundEnd;
Events.TriggerTeslaEvent -= EventHandlers.OnTriggerTesla;
Events.SetClassEvent -= EventHandlers.OnSetClass;
EventHandlers = null;
}

Expand Down

0 comments on commit 94aa57b

Please sign in to comment.