Skip to content

Commit f1461a2

Browse files
authored
Nya update
1 parent e2019b6 commit f1461a2

File tree

10 files changed

+124
-36
lines changed

10 files changed

+124
-36
lines changed

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

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,27 @@ internal static void Remove(Player ply)
1313
ply.SessionVariables.Remove("IsSCP600");
1414
ply.SessionVariables.Remove("IsScp");
1515
ply.MaxHealth = 100;
16-
if (Sai.Instance.Config.IsVisibleBadge)
16+
if (/*Sai.Instance.Config.IsVisibleBadge*/true)
1717
{
18-
if (ply.Group != null)
18+
if (ply.Group != null& !ply.RemoteAdminAccess)
1919
{
2020
ply.Group = null;
2121
}
2222
}
23-
ply.CustomInfo = string.Empty;
23+
/*ply.CustomInfo = string.Empty;
2424
ply.ReferenceHub.nicknameSync.ShownPlayerInfo &= ~PlayerInfoArea.Nickname;
2525
ply.ReferenceHub.nicknameSync.ShownPlayerInfo &= ~PlayerInfoArea.UnitName;
2626
ply.ReferenceHub.nicknameSync.ShownPlayerInfo &= ~PlayerInfoArea.Role;
2727
ply.InfoArea |= ~PlayerInfoArea.Nickname;
2828
ply.InfoArea |= ~PlayerInfoArea.UnitName;
29-
Log.Debug("Remove all session variables and set default hp");
29+
Log.Debug("Remove all session variables and set default hp");*/
3030
}
3131
}
3232
internal static void Add(Player ply)
3333
{
3434
ply.SessionVariables.Add("IsSCP600", null);
3535
ply.SessionVariables.Add("IsScp", null);
36-
if (Sai.Instance.Config.IsVisibleBadge)
36+
if (Sai.Instance.Config.IsVisibleBadge &!ply.RemoteAdminAccess)
3737
{
3838
UserGroup a = new UserGroup();
3939
a.KickPower = 0;
@@ -45,13 +45,10 @@ internal static void Add(Player ply)
4545
ply.Group = a;
4646
}
4747
}
48-
ply.CustomInfo = $"{ply.Nickname}\nSCP-600V-{Scp600PlyGet.GetScp600().Count}";
49-
ply.ReferenceHub.nicknameSync.ShownPlayerInfo &= ~PlayerInfoArea.Nickname;
50-
ply.ReferenceHub.nicknameSync.ShownPlayerInfo &= ~PlayerInfoArea.UnitName;
51-
ply.ReferenceHub.nicknameSync.ShownPlayerInfo &= ~PlayerInfoArea.Role;
48+
5249
if (Sai.Instance.Config.CanBleading)
5350
{
54-
ply.EnableEffect(new Effect(EffectType.Bleeding, 9999f));
51+
ply.GameObject.AddComponent<Component.HurtingPerTime>();
5552
}
5653
}
5754
}

SCP-600V/Command/GetSessionVariables.cs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,27 @@ public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out s
2323
Player ply = Player.Get(arguments.At(0));
2424
if (send.CheckPermission("s6.debug"))
2525
{
26-
if (ply == null)
26+
if (send == null)
2727
{
28-
response = Sai.Instance.Config.PlayerNF;
28+
response = "Unkown error";
2929
return false;
3030
}
31-
if (ply != null)
31+
if (send != null)
3232
{
3333
StringBuilder asd = new StringBuilder();
34-
foreach (string arga in ply.SessionVariables.Keys)
34+
if (ply != null)
3535
{
36-
asd.Append(arga + ", ");
36+
foreach (string arga in ply.SessionVariables.Keys)
37+
{
38+
asd.Append(arga + ", ");
39+
}
40+
}
41+
else
42+
{
43+
foreach (string arga in send.SessionVariables.Keys)
44+
{
45+
asd.Append(arga + ", ");
46+
}
3747
}
3848
response = asd.ToString();
3949
return true;

SCP-600V/Command/MaxHealth.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using Exiled.API.Features;
33
using CommandSystem;
44
using Exiled.Permissions.Extensions;
5-
using FMOD;
65

76
namespace SCP_600V.Command
87
{
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
using Exiled.API.Features;
2+
using Exiled.API.Enums;
3+
using MEC;
4+
using UnityEngine;
5+
using System.Collections.Generic;
6+
using PlayerRoles;
7+
8+
namespace SCP_600V.Component
9+
{
10+
internal class HurtingPerTime: MonoBehaviour
11+
{
12+
private CoroutineHandle _coroutineHandle;
13+
private Player _Player;
14+
private bool IScp = true;
15+
private void Awake()
16+
{
17+
Log.Debug("Initialiaze Hurting for scp-600");
18+
_Player = Player.Get(gameObject);
19+
_coroutineHandle = Timing.RunCoroutine(Hurter());
20+
}
21+
private IEnumerator<float> Hurter()
22+
{
23+
for (; ; )
24+
{
25+
IScp = Player.Get(gameObject).SessionVariables.ContainsKey("IsSCP600");
26+
if (_Player.Role == RoleTypeId.Spectator & IScp)
27+
{
28+
IScp = false;
29+
_Player.SessionVariables.Remove("IsSCP600");
30+
_Player.SessionVariables.Remove("IsScp");
31+
}
32+
if (IScp)
33+
{
34+
Log.Debug("Hurting player");
35+
_Player.Hurt(5f, DamageType.Unknown);
36+
yield return Timing.WaitForSeconds(5f);
37+
}
38+
else
39+
{
40+
Log.Debug("Call break");
41+
Timing.KillCoroutines(_coroutineHandle);
42+
Destroy(this);
43+
break;
44+
}
45+
}
46+
Destroy(this);
47+
}
48+
}
49+
}

SCP-600V/Config.cs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
using System;
2-
using System.Collections.Generic;
1+
using System.Collections.Generic;
32
using System.ComponentModel;
43
using Exiled.API.Enums;
5-
using Exiled.API.Features;
6-
using Exiled.API.Features.Items;
74
using Exiled.API.Interfaces;
85

96
namespace SCP_600V
@@ -33,7 +30,7 @@ internal class Config : IConfig
3330
/// <summary>
3431
/// Percentage to spawn stsp at the beginning of the game
3532
/// </summary>
36-
[Description("Percentage to spawn stsp at the beginning of the game")]
33+
[Description("Percentage to spawn scp at the beginning of the game")]
3734
public int PercentToSpawn { get; set; } = 25;
3835
/// <summary>
3936
/// determines if SCP-600 will take damage over its lifetime
@@ -48,18 +45,18 @@ internal class Config : IConfig
4845
/// <summary>
4946
/// Badge color in player list
5047
/// </summary>
51-
[Description("Badge color in player list")]
48+
[Description("Badge color in player list only lowers chars")]
5249
public string BadgeColor { get; set; } = "red";
5350
/// <summary>
5451
/// message when entering a command to change the player's class when he did not specify a class argument
5552
/// </summary>
56-
[Description("message when entering a command to change the player's class when he did not specify a class argument")]
57-
public string ClassType { get; set; } = "Set class name: {name}";
53+
//[Description("message when entering a command to change the player's class when he did not specify a class argument")]
54+
//public string ClassType { get; set; } = "Set class name: {name}";
5855
/// <summary>
5956
/// message when entering a command when a player has reached the limit in reincarnations in the game
6057
/// </summary>
61-
[Description("message when entering a command when a player has reached the limit in reincarnations in the game")]
62-
public string AtempLimitMessage { get; set; } = "Wait next game";
58+
//[Description("message when entering a command when a player has reached the limit in reincarnations in the game")]
59+
//public string AtempLimitMessage { get; set; } = "Wait next game";
6360
/// <summary>
6461
/// message when entering a command when the player is not an object
6562
/// </summary>
@@ -109,7 +106,7 @@ internal class Config : IConfig
109106
/// message if player dead by scp-600
110107
/// </summary>
111108
[Description("message if player dead by scp-600")]
112-
public string MessageDeathPlayerByScp600 { get; set; } = "your killed by <color=\"red\">SCP-600V</color>";
109+
public string MessageDeathPlayerByScp600 { get; set; } = "your killed by <color=#FF0000>SCP-600V</color>";
113110
/// <summary>
114111
/// whether badge will be assigned to the object from the beginning of the game
115112
/// </summary>

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public void OnPlayerKill(EvArg.Player.DiedEventArgs ev)
3232
Vector3 rota = ev.Attacker.Rotation;
3333
Log.Debug($"Get all parameters");
3434

35-
if (ev.Attacker.Nickname != ev.Player.Nickname)
35+
if (ev.Attacker != ev.Player)
3636
{
3737
if (api.Scp600PlyGet.IsScp600(ev.Attacker))
3838
{
@@ -69,7 +69,6 @@ public void OnPlayerKill(EvArg.Player.DiedEventArgs ev)
6969
ev.Player.ShowHint($"\n\n\n\n\n\n\n{Sai.Instance.Config.MessageDeathPlayerByScp600}");
7070
if (Sai.Instance.Config.CanBleading)
7171
{
72-
ev.Attacker.EnableEffect(new Effect(EffectType.Bleeding, 9999f));
7372
ev.Attacker.Heal(10);
7473
}
7574
Log.Debug("Scp600 get new role");
@@ -87,9 +86,9 @@ public void OnPlayerKill(EvArg.Player.DiedEventArgs ev)
8786
ev.Player.SessionVariables.Remove("IsScp");
8887
ev.Player.MaxHealth = 100;
8988

90-
ev.Player.CustomInfo = string.Empty;
91-
ev.Player.InfoArea |= ~PlayerInfoArea.Nickname;
92-
ev.Player.InfoArea |= ~PlayerInfoArea.UnitName;
89+
//ev.Player.CustomInfo = string.Empty;
90+
//ev.Player.InfoArea |= ~PlayerInfoArea.Nickname;
91+
//ev.Player.InfoArea |= ~PlayerInfoArea.UnitName;
9392
Log.Debug("Remove all session variables and set default hp");
9493
Log.Debug("scp600 player is dead");
9594
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using PlayerRoles;
2+
using api = SCP_600V.API.Players;
3+
using System.Collections.Generic;
4+
using Exiled.API.Features;
5+
using EvArg = Exiled.Events.EventArgs;
6+
using Item = Exiled.API.Features.Items;
7+
using UnityEngine;
8+
using Exiled.API.Enums;
9+
using MEC;
10+
using Exiled.API.Features.Items;
11+
using System;
12+
13+
namespace SCP_600V.EventHandler.GameEvent
14+
{
15+
internal class OnKilled
16+
{
17+
public void KillingPlayer(EvArg.Player.KillingPlayerEventArgs e)
18+
{
19+
if (e.Player != null& api.Scp600PlyGet.IsScp600(e.Player))
20+
{
21+
Log.Debug("Killing player argument");
22+
api.Scp600manager.Remove(e.Player);
23+
}
24+
}
25+
}
26+
}

SCP-600V/Properties/AssemblyInfo.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Reflection;
1+
using System.Resources;
2+
using System.Reflection;
23
using System.Runtime.CompilerServices;
34
using System.Runtime.InteropServices;
45

@@ -32,5 +33,6 @@
3233
// Можно задать все значения или принять номера сборки и редакции по умолчанию
3334
// используя "*", как показано ниже:
3435
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.7.4.0")]
36-
[assembly: AssemblyFileVersion("1.7.4.0")]
36+
[assembly: AssemblyVersion("1.7.5.0")]
37+
[assembly: AssemblyFileVersion("1.7.5.0")]
38+
[assembly: NeutralResourcesLanguage("ru-RU")]

SCP-600V/SCP-600V.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@
6767
<SpecificVersion>False</SpecificVersion>
6868
<HintPath>..\..\..\..\AppData\Roaming\EXILED\Plugins\Exiled.Permissions.dll</HintPath>
6969
</Reference>
70+
<Reference Include="Exiled.Updater">
71+
<HintPath>..\..\..\..\AppData\Roaming\EXILED\Plugins\Exiled.Updater.dll</HintPath>
72+
</Reference>
7073
<Reference Include="Mirror">
7174
<HintPath>..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\SCP Secret Laboratory Dedicated Server\SCPSL_Data\Managed\Mirror.dll</HintPath>
7275
</Reference>
@@ -114,10 +117,12 @@
114117
<Compile Include="Command\PermissionList.cs" />
115118
<Compile Include="Command\Spawn.cs" />
116119
<Compile Include="Command\VariableEdit.cs" />
120+
<Compile Include="Component\HurtingPerTime.cs" />
117121
<Compile Include="Config.cs" />
118122
<Compile Include="EventHandler\GameEvent\OnDamage.cs" />
119123
<Compile Include="EventHandler\GameEvent\OnDeath.cs" />
120124
<Compile Include="EventHandler\GameEvent\OnEscape.cs" />
125+
<Compile Include="EventHandler\GameEvent\OnKilled.cs" />
121126
<Compile Include="EventHandler\GameEvent\OnRoleChenged.cs" />
122127
<Compile Include="EventHandler\GameEvent\Scp106.cs" />
123128
<Compile Include="EventHandler\GameEvent\Scp173.cs" />

SCP-600V/Sai.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System;
2-
using System.Net.Http.Headers;
32
using Exiled.API.Features;
43
using Hand = Exiled.Events.Handlers;
54

@@ -15,6 +14,7 @@ internal class Sai: Plugin<Config>
1514
public EventHandler.GameEvent.OnRoleChenged orc;
1615
public EventHandler.GameEvent.Scp106 spd;
1716
public EventHandler.GameEvent.OnEscape osc;
17+
public EventHandler.GameEvent.OnKilled opk;
1818
//public EventHandler.GameEvent.Scp173 s1;
1919

2020
public override void OnEnabled()
@@ -28,6 +28,7 @@ public override void OnEnabled()
2828
orc = new EventHandler.GameEvent.OnRoleChenged();
2929
spd = new EventHandler.GameEvent.Scp106();
3030
osc = new SCP_600V.EventHandler.GameEvent.OnEscape();
31+
opk = new EventHandler.GameEvent.OnKilled();
3132
//s1 = new EventHandler.GameEvent.Scp173();
3233
Hand.Server.RoundStarted += str.OnRoundStarted;
3334
Hand.Server.EndingRound += er.OnEndingRound;
@@ -36,6 +37,7 @@ public override void OnEnabled()
3637
Hand.Player.ChangingRole += orc.OnRoleChenge;
3738
Hand.Player.EnteringPocketDimension += spd.OnPocketDemensionCapture;
3839
Hand.Player.Escaping += osc.OnEscaped;
40+
Hand.Player.KillingPlayer += opk.KillingPlayer;
3941
//Hand.Scp173.Blinking += s1.OnScp173Visibled;
4042
}
4143
public override void OnDisabled()
@@ -49,6 +51,7 @@ public override void OnDisabled()
4951
orc = null;
5052
spd = null;
5153
osc = null;
54+
opk = null;
5255
//s1 = null;
5356

5457
Hand.Server.RoundStarted -= str.OnRoundStarted;
@@ -58,6 +61,7 @@ public override void OnDisabled()
5861
Hand.Player.ChangingRole -= orc.OnRoleChenge;
5962
Hand.Player.EnteringPocketDimension -= spd.OnPocketDemensionCapture;
6063
Hand.Player.Escaping -= osc.OnEscaped;
64+
Hand.Player.KillingPlayer -= opk.KillingPlayer;
6165
//Hand.Scp173.Blinking -= s1.OnScp173Visibled;
6266
}
6367
}

0 commit comments

Comments
 (0)