Skip to content

Commit a46548e

Browse files
authored
Add files via upload
1 parent 2f17e88 commit a46548e

File tree

13 files changed

+392
-39
lines changed

13 files changed

+392
-39
lines changed

SCP-600V/API/Players/Scp600manager.cs

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,21 @@
55
namespace SCP_600V.API.Players
66
{
77
internal class Scp600manager
8-
{
8+
{
99
internal static void Remove(Player ply)
1010
{
1111
if(Scp600PlyGet.IsScp600(ply))
1212
{
1313
ply.SessionVariables.Remove("IsSCP600");
1414
ply.SessionVariables.Remove("IsScp");
1515
ply.MaxHealth = 100;
16-
16+
if (Sai.Instance.Config.IsVisibleBadge)
17+
{
18+
if (ply.Group != null)
19+
{
20+
ply.Group = null;
21+
}
22+
}
1723
ply.CustomInfo = string.Empty;
1824
ply.ReferenceHub.nicknameSync.ShownPlayerInfo &= ~PlayerInfoArea.Nickname;
1925
ply.ReferenceHub.nicknameSync.ShownPlayerInfo &= ~PlayerInfoArea.UnitName;
@@ -27,14 +33,17 @@ internal static void Add(Player ply)
2733
{
2834
ply.SessionVariables.Add("IsSCP600", null);
2935
ply.SessionVariables.Add("IsScp", null);
30-
UserGroup a = new UserGroup();
31-
a.KickPower = 0;
32-
a.RequiredKickPower = 0;
33-
a.BadgeColor = $"{Sai.Instance.Config.BadgeColor}";
34-
a.BadgeText = "SCP-600V";
35-
if (ply.Group == null)
36+
if (Sai.Instance.Config.IsVisibleBadge)
3637
{
37-
ply.Group = a;
38+
UserGroup a = new UserGroup();
39+
a.KickPower = 0;
40+
a.RequiredKickPower = 0;
41+
a.BadgeColor = $"{Sai.Instance.Config.BadgeColor}";
42+
a.BadgeText = "SCP-600V";
43+
if (ply.Group == null)
44+
{
45+
ply.Group = a;
46+
}
3847
}
3948
ply.CustomInfo = $"{ply.Nickname}\nSCP-600V-{Scp600PlyGet.GetScp600().Count}";
4049
ply.ReferenceHub.nicknameSync.ShownPlayerInfo &= ~PlayerInfoArea.Nickname;

SCP-600V/API/Players/Servroles.cs

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
using System;
2+
using Exiled.API.Features;
3+
using Exiled.API.Enums;
4+
using System.Collections.Generic;
5+
using PlayerRoles;
6+
using System.Linq;
7+
8+
namespace SCP_600V.API.Players
9+
{
10+
public class Servroles
11+
{
12+
/// <summary>
13+
/// get player as human not scp's
14+
/// </summary>
15+
/// <returns></returns>
16+
public int GetAllPlayerAsNotScp()
17+
{
18+
int a = 0;
19+
foreach (Player b in Player.List)
20+
{
21+
if (!Scp600PlyGet.IsScp600(b))
22+
{
23+
if (!Scp600PlyGet.IsSH(b))
24+
{
25+
if (!b.IsScp)
26+
{
27+
a += 1;
28+
}
29+
}
30+
}
31+
}
32+
return a;
33+
}
34+
/// <summary>
35+
/// Get amount user per team
36+
/// </summary>
37+
/// <param name="team">Exiled.API.Enums.Team</param>
38+
/// <returns>int number</returns>
39+
public static int TeamsUser(Team team) => Player.List.Where(x => x.Role.Team == team&& !x.SessionVariables.ContainsKey("IsSCP600")).Count();
40+
/// <summary>
41+
/// Get amount user per costum role by session variable key
42+
/// </summary>
43+
/// <param name="keyrole">string key</param>
44+
/// <returns>int number</returns>
45+
public static int RolesUser(string keyrole) => Player.List.Where(x => x.SessionVariables.ContainsKey((string)keyrole)).Count();
46+
}
47+
}

SCP-600V/Command/VariableEdit.cs

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
using CommandSystem;
2+
using Exiled.API.Features;
3+
using Exiled.Permissions.Extensions;
4+
using System;
5+
6+
namespace SCP_600V.Command
7+
{
8+
internal class VariableEdit : ICommand
9+
{
10+
public string Command { get; set; } = "varedit";
11+
12+
public string[] Aliases { get; set; } = { "ve" };
13+
14+
public string Description { get; set; } = "varedit <add/remove> <tag> <userID>";
15+
16+
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
17+
{
18+
Player ply = Player.Get(sender);
19+
Player arguser = Player.Get(arguments.At(2));
20+
if (ply.CheckPermission("s6.debug"))
21+
{
22+
if (arguser != null)
23+
{
24+
try
25+
{
26+
if (arguments.At(0) == "add")
27+
{
28+
if (!arguser.SessionVariables.ContainsKey(arguments.At(1)))
29+
{
30+
arguser.SessionVariables.Add(arguments.At(1), null);
31+
response = "";
32+
return true;
33+
}
34+
response = "IsContained";
35+
return false;
36+
}
37+
if (arguments.At(0) == "remove")
38+
{
39+
if (!arguser.SessionVariables.ContainsKey(arguments.At(1)))
40+
{
41+
arguser.SessionVariables.Remove(arguments.At(1));
42+
response = "";
43+
return true;
44+
}
45+
response = "Not found";
46+
return false;
47+
}
48+
}
49+
catch
50+
{
51+
response = Sai.Instance.Config.PlayerNF;
52+
return false;
53+
}
54+
}
55+
if (arguser == null)
56+
{
57+
if (arguments.At(0) == "add")
58+
{
59+
if (!ply.SessionVariables.ContainsKey(arguments.At(1)))
60+
{
61+
ply.SessionVariables.Add(arguments.At(1), null);
62+
response = "";
63+
return true;
64+
}
65+
response = "IsContained";
66+
return false;
67+
}
68+
if (arguments.At(0) == "remove")
69+
{
70+
if (!ply.SessionVariables.ContainsKey(arguments.At(1)))
71+
{
72+
ply.SessionVariables.Remove(arguments.At(1));
73+
response = "";
74+
return true;
75+
}
76+
response = "Not found";
77+
return false;
78+
}
79+
}
80+
}
81+
if (ply.CheckPermission("s6.debug") == false)
82+
{
83+
response = Sai.Instance.Config.PermissionDenied;
84+
return false;
85+
}
86+
response = "idk";
87+
return false;
88+
}
89+
}
90+
}

SCP-600V/Config.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ internal class Config: IConfig
1717
[Description("Can the player see the debug message in the server console")]
1818
public bool Debug { get; set; } = false;
1919
/// <summary>
20+
/// whether the creators of the plugin will be visible among the players
21+
/// </summary>
22+
[Description("whether the creators of the plugin will be visible among the players\r\n")]
23+
public bool VisibleCreators { get; set; } = true;
24+
/// <summary>
2025
/// Can SCPs beat our
2126
/// </summary>
2227
[Description("Can SCPs beat our")]
@@ -96,5 +101,21 @@ internal class Config: IConfig
96101
/// </summary>
97102
[Description("message to the player when he transforms into another player")]
98103
public string MessageScpTransform { get; set; } = "you transformed into {player}";
104+
/// <summary>
105+
/// whether badge will be assigned to the object from the beginning of the game
106+
/// </summary>
107+
[Description("whether badge will be assigned to the object from the beginning of the game")]
108+
public bool IsVisibleBadge { get; set; } = true;
109+
110+
/// <summary>
111+
/// if the server has disabled friendly fire set true
112+
/// </summary>
113+
[Description("if the server has disabled friendly fire set true")]
114+
public bool IsFFEnabled { get; set; } = false;
115+
/// <summary>
116+
/// due to the mechanics of the game, the game often reduces the damage dealt
117+
/// </summary>
118+
[Description("due to the mechanics of the game, the game often reduces the damage dealt")]
119+
public int MultipleDamage { get; set; } = 3;
99120
}
100121
}

SCP-600V/EventHandler/GameEvent/OnDamage.cs

Lines changed: 97 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
using Exiled.API.Features;
44
using EvArg = Exiled.Events.EventArgs;
55
using api = SCP_600V.API.Players.Scp600PlyGet;
6+
using PlayerRoles;
7+
using Exiled.API.Features.Roles;
68

79
namespace SCP_600V.EventHandler.GameEvent
810
{
@@ -14,29 +16,28 @@ internal void DamageHandler(EvArg.Player.HurtingEventArgs e)
1416
{
1517
if ( e.Player != null )
1618
{
17-
if (api.IsScp600(e.Player))
19+
if (api.IsScp600(e.Attacker) == true)
1820
{
19-
if (e.Attacker.Role.Team == PlayerRoles.Team.SCPs|| e.Attacker.SessionVariables.ContainsKey("IsScp")|| e.Attacker.SessionVariables.ContainsKey("IsScp035")|| e.Attacker.SessionVariables.ContainsKey("IsSH"))
21+
bool a = Scp600DamageHandler(e.Attacker, e.Player);
22+
if ( a )
2023
{
21-
if (!Sai.Instance.Config.IsScpCanDamageMe)
22-
{
23-
e.DamageHandler.Damage = 0;
24-
e.IsAllowed = false;
25-
}
26-
else
27-
{
28-
e.IsAllowed = true;
29-
}
24+
e.DamageHandler.Damage = e.DamageHandler.Damage * Sai.Instance.Config.MultipleDamage;
25+
e.IsAllowed = true;
3026
}
31-
}
32-
if (api.IsScp600(e.Attacker))
33-
{
34-
if (e.Player.Role.Team == PlayerRoles.Team.SCPs)
27+
if ( a == false)
3528
{
3629
e.DamageHandler.Damage = 0;
3730
e.IsAllowed = false;
3831
}
39-
if (api.IsCustomScp(e.Player)|api.IsScp035(e.Player)|api.IsSH(e.Player)|api.IsScp600(e.Player))
32+
}
33+
if (api.IsScp600(e.Attacker) == false)
34+
{
35+
bool a = NoScp600DamageHandler(e.Attacker, e.Player);
36+
if ( a )
37+
{
38+
e.IsAllowed = true;
39+
}
40+
if ( a == false )
4041
{
4142
e.DamageHandler.Damage = 0;
4243
e.IsAllowed = false;
@@ -45,5 +46,85 @@ internal void DamageHandler(EvArg.Player.HurtingEventArgs e)
4546
}
4647
}
4748
}
49+
internal bool Scp600DamageHandler(Player atacker, Player player)
50+
{
51+
if (Sai.Instance.Config.IsScpCanDamageMe == false)
52+
{
53+
if (player.Role.Team == Team.SCPs)
54+
{
55+
return false;
56+
}
57+
if (api.IsSH(player) || api.IsCustomScp(player) || api.IsScp035(player) || api.IsScp600(player))
58+
{
59+
return false;
60+
}
61+
else
62+
{
63+
return true;
64+
}
65+
}
66+
else
67+
{
68+
return true;
69+
}
70+
}
71+
72+
internal bool NoScp600DamageHandler(Player atacker, Player player)
73+
{
74+
if (Sai.Instance.Config.IsFFEnabled == false)
75+
{
76+
if (Sai.Instance.Config.IsScpCanDamageMe == false)
77+
{
78+
if (api.IsCustomScp(atacker) || api.IsSH(atacker) || api.IsScp035(atacker) || api.IsScp600(atacker) || atacker.Role.Team == Team.SCPs)
79+
{
80+
if (api.IsScp600(player))
81+
{
82+
return false;
83+
}
84+
else
85+
{
86+
return true;
87+
}
88+
}
89+
else
90+
{
91+
return true;
92+
}
93+
}
94+
else
95+
{
96+
return true;
97+
}
98+
}
99+
else
100+
{
101+
if (api.IsCustomScp(atacker) || api.IsSH(atacker) || api.IsScp035(atacker) || api.IsScp600(atacker))
102+
{
103+
if (api.IsScp600(player))
104+
{
105+
return false;
106+
}
107+
else
108+
{
109+
return true;
110+
}
111+
}
112+
if (atacker.Role.Team == player.Role.Team)
113+
{
114+
if (api.IsScp600(player))
115+
{
116+
return true;
117+
}
118+
else
119+
{
120+
return false;
121+
}
122+
}
123+
else
124+
{
125+
return true;
126+
}
127+
}
128+
}
48129
}
49130
}

0 commit comments

Comments
 (0)