Skip to content

Commit

Permalink
Revert "I think I added something, I think"
Browse files Browse the repository at this point in the history
This reverts commit a9bb907.
  • Loading branch information
babyboucher committed Dec 18, 2020
1 parent 04cddf2 commit 6e631ae
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 62 deletions.
26 changes: 1 addition & 25 deletions ZombieSuicideHotline/Config.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.ComponentModel;
using Exiled.API.Interfaces;
using System.Collections.Generic;
using UnityEngine;

namespace ZombieSuicideHotline
{
Expand Down Expand Up @@ -40,28 +39,5 @@ public class Config : IConfig {
"Scp93989", -1f
},
};

[Description("A list of classes that should go back to there spawn if there are no valid SCPs to go to")]
public Dictionary<string, Vector3> Gobacktospawn { get; set; } = new Dictionary<string, Vector3>
{
{
"Scp049", new Vector3(0.0f, 1.0f, 0.0f)
},
{
"Scp096", new Vector3(0.0f, 1.0f, 0.0f)
},
{
"Scp106", new Vector3(0.0f, 1.0f, 0.0f)
},
{
"Scp173", new Vector3(0.0f, 1.0f, 0.0f)
},
{
"Scp93953", new Vector3(0.0f, 1.0f, 0.0f)
},
{
"Scp93989", new Vector3(0.0f, 1.0f, 0.0f)
},
};
}
}
}
29 changes: 2 additions & 27 deletions ZombieSuicideHotline/PlayerHandlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using Exiled.Events.EventArgs;
using Player = Exiled.API.Features.Player;
using Exiled.API.Features;
using UnityEngine;

public class PlayerHandlers
{
Expand All @@ -25,7 +24,6 @@ public void OnRoundEnd()
if (this.plugin.zombies.ContainsKey(player.UserId))
{
this.plugin.zombies[player.UserId].Disconnected = false;
this.plugin.zombies[player.UserId].LastDeath = 0f;
}
}
}
Expand Down Expand Up @@ -53,10 +51,6 @@ public void OnPlayerSpawn(SpawningEventArgs ev)
ev.Position = targetPlayer.Position;
}
}
if (Plugin.Singleton.Config.Gobacktospawn.ContainsKey(player.Role.ToString()))
{
Plugin.Singleton.Config.Gobacktospawn[player.Role.ToString()] = player.Position;
}
if (ev.RoleType == RoleType.Scp049)
{
player.Broadcast(10, "Use .recall to bring all your zombies to you");
Expand All @@ -74,10 +68,6 @@ public void OnPlayerDied(DiedEventArgs ev)
{
plugin.zombies[player.UserId].Disconnected = false;
}
if (ev.Killer.Role == RoleType.Scp049)
{
plugin.zombies[player.UserId].LastDeath = Time.time;
}
}

public void OnPlayerHurt(HurtingEventArgs ev)
Expand All @@ -92,14 +82,6 @@ public void OnPlayerHurt(HurtingEventArgs ev)
ev.Amount = (ev.Target.Health * plugin.Config.HotlineCalls[ev.Target.Role.ToString()]);
ev.Target.Position = targetPlayer.Position;
}
if (Plugin.Singleton.Config.Gobacktospawn.ContainsKey(ev.Target.Role.ToString()))
{
ev.Target.Position = Plugin.Singleton.Config.Gobacktospawn[ev.Target.Role.ToString()];
}
if (ev.Target.Role == RoleType.Scp0492)
{
ev.Target.Position = Plugin.Singleton.Config.Gobacktospawn["Scp049"];
}
}
}
}
Expand All @@ -110,10 +92,6 @@ public void OnPlayerLeft(LeftEventArgs ev)
{
plugin.zombies[ev.Player.UserId].Disconnected = true;
}
if (this.plugin.zombies[ev.Player.UserId].LastDeath + 10 <Time.time)
{
plugin.zombies[ev.Player.UserId].Disconnected = true;
}
}

public Player GetTeleportTarget(Player sourcePlayer)
Expand All @@ -131,12 +109,9 @@ public Player GetTeleportTarget(Player sourcePlayer)
continue;
}

if (player.Role != RoleType.Scp0492 || player.Role != RoleType.Scp173)
if (targetPlayer == null)
{
if (player.Role == RoleType.Scp106)
{
continue;
}
targetPlayer = player;
}

if (player.Team == Team.SCP)
Expand Down
4 changes: 2 additions & 2 deletions ZombieSuicideHotline/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class Zombie
public string Name;
public string SteamId;
public string IpAddress;
public float LastDeath = 0f;
public int LastRecall = 0;
public bool Undead = false;
public bool Disconnected = false;
//public Dictionary<string, Zombie> Zombies = new Dictionary<string, Zombie>();
Expand All @@ -73,7 +73,7 @@ public Zombie(int playerId, string name, string steamId, string ipAddress)

public override string ToString()
{
return "[ PlayerId: " + PlayerId + ", Name: " + Name + ", SteamID: " + SteamId + ", IpAddress: " + IpAddress + ", LastRecall: " + LastDeath + ", Undead: " + Undead + ", Disconnected: " + Disconnected + " ]";
return "[ PlayerId: " + PlayerId + ", Name: " + Name + ", SteamID: " + SteamId + ", IpAddress: " + IpAddress + ", LastRecall: " + LastRecall + ", Undead: " + Undead + ", Disconnected: " + Disconnected + " ]";
}
}
}
9 changes: 1 addition & 8 deletions ZombieSuicideHotline/RetreatCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace ZombieSuicideHotline
[CommandHandler(typeof(ClientCommandHandler))]
class RetreatCommand : ICommand
{
public string Command => "retreat";
public string Command => "retreat"; //Why is this called respawn?

public string[] Aliases => null;

Expand Down Expand Up @@ -80,13 +80,6 @@ public Player GetTeleportTarget(Player sourcePlayer)
break;
}
}
if (targetPlayer == null)
{
if (Plugin.Singleton.Config.Gobacktospawn.ContainsKey(sourcePlayer.Role.ToString()))
{
sourcePlayer.Position = Plugin.Singleton.Config.Gobacktospawn[sourcePlayer.Role.ToString()];
}
}
return targetPlayer;
}
}
Expand Down

0 comments on commit 6e631ae

Please sign in to comment.