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

Commit

Permalink
Fixed spawning command (how long was that hecked up? yikes) and end r…
Browse files Browse the repository at this point in the history
…ound conditions should workTM
  • Loading branch information
MrMith committed Dec 24, 2018
1 parent 1e75c43 commit e214240
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 43 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ Put SCP-343.dll under the release tab into sm_plugins folder.
| :---: | :---: | :---: | :---: |
| scp343_spawnchance | Float | 10 | Percent chance for SPC-343 to spawn at the start of the round. |
| scp343_opendoortime | Integer | 300 | How many seconds after roundstart till SCP-343 can open any door in the game (Like door bypass). |
| scp343_hp | Integer | -1 | How much health should SCP-343 have, set to -1 for GodMode. |
| scp343_hp | Integer | -1 | How much health should SCP-343 have. Set to -1 for GodMode. |
| scp343_nuke_interact | Boolean | false | Should SCP-343 beable to interact with the nuke? |
| scp343_ispassive | Boolean | false | Should SCP-343 be a passive SCP? (Do you need to kill him to end the round.)|
| scp343_itemconverttoggle | Boolean | false | Should SPC-343 convert items? |
| scp343_itemdroplist | Integer List | 0,1,2,3,4,5,6,7,8,9,10,11,14,17,19,22,27,28,29 | What items SCP-343 drops instead of picking up.|
| scp343_itemstoconvert | Integer List | 13,16,20,21,23,24,25,26,30 | What items SCP-343 converts. |
Expand Down
6 changes: 3 additions & 3 deletions SCP-343/SCP_343.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ namespace SCP_343
name = "SCP-343",
description = "SCP-343 is a passive immortal D-Class Personnel. He spawns with one Flashlight and any weapon he picks up is morphed to prevent violence. He seeks to help out who he deems worthy.",
id = "Mith.SCP-343",
version = "1.3.2",
version = "1.3.3",
SmodMajor = 3,
SmodMinor = 2,
SmodRevision = 0
SmodRevision = 1
)]
class SCP343 : Plugin
{
Expand Down Expand Up @@ -60,7 +60,7 @@ public override void Register()
this.AddConfig(new Smod2.Config.ConfigSetting("scp343_spawnchance", 10f, Smod2.Config.SettingType.FLOAT, true, "Percent chance for SPC-343 to spawn at the start of the round."));
this.AddConfig(new Smod2.Config.ConfigSetting("scp343_itemconverttoggle", false, Smod2.Config.SettingType.BOOL, true, "Should SPC-343 convert items?"));
this.AddConfig(new Smod2.Config.ConfigSetting("scp343_opendoortime", 300, Smod2.Config.SettingType.NUMERIC, true, "How long in seconds till SPC-343 can open any door."));
this.AddConfig(new Smod2.Config.ConfigSetting("scp343_hp", -1, Smod2.Config.SettingType.NUMERIC, true, "How much health should SCP-343 have. Set to -1 for GodMode."));
this.AddConfig(new Smod2.Config.ConfigSetting("scp343_hp", -1, Smod2.Config.SettingType.NUMERIC, true, "How much health should SCP-343 have. Set to -1 for GodMode and if set to anything but -1 then he is counted as a normal SCP and MTF must kill him like a normal SCP."));
this.AddConfig(new Smod2.Config.ConfigSetting("scp343_nuke_interact", false, Smod2.Config.SettingType.BOOL, true, "Should SPC-343 beable to interact with the nuke."));
this.AddConfig(new Smod2.Config.ConfigSetting("scp343_disable", false, Smod2.Config.SettingType.BOOL, true, "Should SPC-343 beable to interact with the nuke."));
this.AddConfig(new Smod2.Config.ConfigSetting("scp343_debug", false, Smod2.Config.SettingType.BOOL, true, "Internal testing config so I stop pushing commits that are broken >:("));
Expand Down
9 changes: 5 additions & 4 deletions SCP-343/SCP_343Commands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ public string[] OnCall(ICommandSender sender, string[] args)
{
if (args.Length > 0)
{
Regex regex = new Regex(@"\D+");
string PlayerIDString = regex.Replace(args[0],"");

foreach (Player Playa in PluginManager.Manager.Server.GetPlayers())
{
string PlayerIDString = Regex.Match(args[0], @"\d+").Value;
if (Int32.TryParse(PlayerIDString, out int PlayerIDInt))
{
if (Playa.PlayerId == PlayerIDInt)
Expand All @@ -42,16 +44,15 @@ public string[] OnCall(ICommandSender sender, string[] args)
{
Playa.SetHealth(EventLogic._343Config.SCP343_HP);
}

SCP343.Active343AndBadgeDict.Add(Playa.SteamId, new SCP343.PlayerInfo(Playa.GetUserGroup().Name, Playa.GetUserGroup().Color));

Playa.SetRank("red", "SCP-343");
return new string[] { "Made " + Playa.Name + " SCP343!" };
}
}
return new string[] {"Couldn't parse playerid."};
}
return new string[] { "" };
return new string[] { "Couldn't parse playerid." };
}
else { return new string[] { "You must put a playerid." }; }
}
Expand Down
96 changes: 61 additions & 35 deletions SCP-343/SCP_343EventLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,56 +216,82 @@ public void OnCheckEscape(PlayerCheckEscapeEvent ev)

#region OnCheckRoundEnd
/// <summary>
/// Checks all teams to do custom round end if 343 is alive and all MTF for example.
/// Checks all teams to do custom round end if 343 is alive and all MTF for example, and if hp is set to anything but -1 then he is counted as a normal SCP and MTF must kill him like a normal SCP.
/// </summary>
public void OnCheckRoundEnd(CheckRoundEndEvent ev)
{
if (SCP343.Active343AndBadgeDict.Count >= 1 && !_343Config.scp343_debug && _343Config.SCP343_HP == -1)
if (SCP343.Active343AndBadgeDict.Count >= 1 && !_343Config.scp343_debug)
{
SCP343.teamAliveCount.Clear();
foreach(Team team in Enum.GetValues(typeof(Team)))
foreach (Team team in Enum.GetValues(typeof(Team)))
{
SCP343.teamAliveCount[team] = 0;
}

foreach(Player player in PluginManager.Manager.Server.GetPlayers())
foreach (Player player in PluginManager.Manager.Server.GetPlayers())
{
SCP343.teamAliveCount[player.TeamRole.Team]++;

}

if (SCP343.teamAliveCount[Team.SCP] == 0
&& SCP343.teamAliveCount[Team.CHAOS_INSURGENCY] == 0
&& SCP343.teamAliveCount[Team.CLASSD] == SCP343.Active343AndBadgeDict.Count
&& SCP343.teamAliveCount[Team.SCIENTIST] == 0)
{
Smod2.PluginManager.Manager.Server.Round.Stats.ClassDEscaped = 0;
ev.Status = ROUND_END_STATUS.MTF_VICTORY;
}//If SCPs, Chaos, ClassD and Scientists are dead then MTF win.
else if (SCP343.teamAliveCount[Team.SCP] == 0
&& SCP343.teamAliveCount[Team.CLASSD] == SCP343.Active343AndBadgeDict.Count
&& SCP343.teamAliveCount[Team.SCIENTIST] == 0
&& SCP343.teamAliveCount[Team.NINETAILFOX] == 0)
{
ev.Status = ROUND_END_STATUS.CI_VICTORY;
Smod2.PluginManager.Manager.Server.Round.Stats.ScientistsEscaped = 0;
}//If SCPs, ClassD, Scientists and MTF are dead then Chaos win.
else if (SCP343.teamAliveCount[Team.NINETAILFOX] == 0
&& SCP343.teamAliveCount[Team.CHAOS_INSURGENCY] == 0
&& SCP343.teamAliveCount[Team.CLASSD] == SCP343.Active343AndBadgeDict.Count
&& SCP343.teamAliveCount[Team.SCIENTIST] == 0)
if (_343Config.SCP343_HP == -1)
{
ev.Status = ROUND_END_STATUS.SCP_VICTORY;
Smod2.PluginManager.Manager.Server.Round.Stats.ClassDEscaped = 0;
Smod2.PluginManager.Manager.Server.Round.Stats.ScientistsEscaped = 0;
} //If MTF, Chaos, ClassD and Scientists are dead then SCPs win.
else if (SCP343.teamAliveCount[Team.NINETAILFOX] == 0
&& SCP343.teamAliveCount[Team.CLASSD] == SCP343.Active343AndBadgeDict.Count
&& SCP343.teamAliveCount[Team.SCIENTIST] == 0)
if (SCP343.teamAliveCount[Team.SCP] == 0
&& SCP343.teamAliveCount[Team.CHAOS_INSURGENCY] == 0
&& SCP343.teamAliveCount[Team.CLASSD] == SCP343.Active343AndBadgeDict.Count
&& SCP343.teamAliveCount[Team.SCIENTIST] == 0)
{
Smod2.PluginManager.Manager.Server.Round.Stats.ScientistsEscaped = 1;
Smod2.PluginManager.Manager.Server.Round.Stats.ClassDEscaped = 0;
ev.Status = ROUND_END_STATUS.MTF_VICTORY;
}//If SCPs, Chaos, ClassD and Scientists are dead then MTF win.
else if (SCP343.teamAliveCount[Team.SCP] == 0
&& SCP343.teamAliveCount[Team.CLASSD] == SCP343.Active343AndBadgeDict.Count
&& SCP343.teamAliveCount[Team.SCIENTIST] == 0
&& SCP343.teamAliveCount[Team.NINETAILFOX] == 0)
{
Smod2.PluginManager.Manager.Server.Round.Stats.ClassDEscaped = 0;
Smod2.PluginManager.Manager.Server.Round.Stats.ScientistsEscaped = 0;
ev.Status = ROUND_END_STATUS.CI_VICTORY;
}//If SCPs, ClassD, Scientists and MTF are dead then Chaos win.
else if (SCP343.teamAliveCount[Team.NINETAILFOX] == 0
&& SCP343.teamAliveCount[Team.CHAOS_INSURGENCY] == 0
&& SCP343.teamAliveCount[Team.CLASSD] == SCP343.Active343AndBadgeDict.Count
&& SCP343.teamAliveCount[Team.SCIENTIST] == 0)
{
Smod2.PluginManager.Manager.Server.Round.Stats.ClassDEscaped = 0;
Smod2.PluginManager.Manager.Server.Round.Stats.ScientistsEscaped = 0;
ev.Status = ROUND_END_STATUS.SCP_VICTORY;
} //If MTF, Chaos, ClassD and Scientists are dead then SCPs win.
else if (SCP343.teamAliveCount[Team.NINETAILFOX] == 0
&& SCP343.teamAliveCount[Team.CLASSD] == SCP343.Active343AndBadgeDict.Count
&& SCP343.teamAliveCount[Team.SCIENTIST] == 0)
{
Smod2.PluginManager.Manager.Server.Round.Stats.ClassDEscaped = 0;
Smod2.PluginManager.Manager.Server.Round.Stats.ScientistsEscaped = 0;
ev.Status = ROUND_END_STATUS.SCP_CI_VICTORY;
}//If MTF, ClassD and Scientists are dead then SCPS & Chaos win.
}
else
{
ev.Status = ROUND_END_STATUS.SCP_CI_VICTORY;
Smod2.PluginManager.Manager.Server.Round.Stats.ClassDEscaped = 0;
Smod2.PluginManager.Manager.Server.Round.Stats.ScientistsEscaped = 0;
}//If MTF, ClassD and Scientists are dead then SCPS & Chaos win.
if (SCP343.teamAliveCount[Team.NINETAILFOX] == 0
&& SCP343.teamAliveCount[Team.CHAOS_INSURGENCY] == 0
&& SCP343.teamAliveCount[Team.CLASSD] == SCP343.Active343AndBadgeDict.Count
&& SCP343.teamAliveCount[Team.SCIENTIST] == 0)
{
Smod2.PluginManager.Manager.Server.Round.Stats.ClassDEscaped = 0;
Smod2.PluginManager.Manager.Server.Round.Stats.ScientistsEscaped = 0;
ev.Status = ROUND_END_STATUS.SCP_VICTORY;
} //If MTF, Chaos, ClassD and Scientists are dead then SCPs win.
else if (SCP343.teamAliveCount[Team.NINETAILFOX] == 0
&& SCP343.teamAliveCount[Team.CLASSD] == SCP343.Active343AndBadgeDict.Count
&& SCP343.teamAliveCount[Team.SCIENTIST] == 0)
{
Smod2.PluginManager.Manager.Server.Round.Stats.ClassDEscaped = 1;
Smod2.PluginManager.Manager.Server.Round.Stats.ScientistsEscaped = 0;
ev.Status = ROUND_END_STATUS.SCP_CI_VICTORY;
}//If MTF, ClassD and Scientists are dead then SCPS & Chaos win.
}
}
}
#endregion
Expand Down

0 comments on commit e214240

Please sign in to comment.