Skip to content
This repository was archived by the owner on Sep 4, 2023. It is now read-only.

Commit 0e8bcba

Browse files
committed
Changed a lot of stuff lol
1 parent 9321102 commit 0e8bcba

File tree

13 files changed

+210
-55
lines changed

13 files changed

+210
-55
lines changed
11.1 KB
Binary file not shown.
Binary file not shown.

.vs/BetterDoggie/FileContentIndex/read.lock

Whitespace-only changes.

.vs/BetterDoggie/v17/.futdcache.v1

148 Bytes
Binary file not shown.

.vs/BetterDoggie/v17/.suo

31 KB
Binary file not shown.
129 KB
Binary file not shown.
361 KB
Binary file not shown.

BetterDoggie/BetterDoggie.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
namespace BetterDoggie
22
{
33
using System;
4+
using System.Collections.Generic;
45
using Exiled.API.Features;
6+
using Exiled.API.Features.Items;
57
using Exiled.API.Enums;
8+
using MEC;
69

710
using PlayerEvents = Exiled.Events.Handlers.Player;
8-
using ServerEvents = Exiled.Events.Handlers.Server;
911

1012
public class BetterDoggie : Plugin<Config>
1113
{
@@ -17,6 +19,9 @@ public class BetterDoggie : Plugin<Config>
1719
public override Version Version => new Version(1, 2, 3);
1820
public override Version RequiredExiledVersion => new Version(5, 0, 0);
1921
public override PluginPriority Priority => PluginPriority.Low;
22+
23+
public Dictionary<Player, CoroutineHandle?> ActiveAbilities = new Dictionary<Player, CoroutineHandle?>();
24+
public Dictionary<Player, int> AbilityCooldowns = new Dictionary<Player, int>();
2025

2126
public override void OnEnabled()
2227
{

BetterDoggie/BetterDoggie.csproj

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,29 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="EXILED" Version="5.0.0-beta.5" />
9-
</ItemGroup>
10-
11-
<ItemGroup>
12-
<Reference Include="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
13-
<HintPath>$(EXILED_REFERENCES)\Assembly-CSharp-Publicized.dll</HintPath>
8+
<Reference Include="Assembly-CSharp">
9+
<HintPath>..\..\EXILED References\EXILED 5\Assembly-CSharp.dll</HintPath>
10+
</Reference>
11+
<Reference Include="Assembly-CSharp-firstpass">
12+
<HintPath>..\..\EXILED References\Internal\11.2\Assembly-CSharp-firstpass.dll</HintPath>
13+
</Reference>
14+
<Reference Include="CommandSystem.Core">
15+
<HintPath>..\..\EXILED References\Internal\11.2\CommandSystem.Core.dll</HintPath>
16+
</Reference>
17+
<Reference Include="Exiled.API">
18+
<HintPath>..\..\EXILED References\EXILED 5\EXILED\Plugins\dependencies\Exiled.API.dll</HintPath>
19+
</Reference>
20+
<Reference Include="Exiled.Events">
21+
<HintPath>..\..\EXILED References\EXILED 5\EXILED\Plugins\Exiled.Events.dll</HintPath>
1422
</Reference>
15-
<Reference Include="Assembly-CSharp-firstpass, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
16-
<HintPath>$(EXILED_REFERENCES)\Assembly-CSharp-firstpass.dll</HintPath>
23+
<Reference Include="Exiled.Permissions">
24+
<HintPath>..\..\EXILED References\EXILED 5\EXILED\Plugins\Exiled.Permissions.dll</HintPath>
1725
</Reference>
18-
<Reference Include="Mirror, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
19-
<HintPath>$(EXILED_REFERENCES)\Mirror.dll</HintPath>
26+
<Reference Include="Mirror">
27+
<HintPath>..\..\EXILED References\Internal\11.2\Mirror.dll</HintPath>
2028
</Reference>
21-
<Reference Include="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
22-
<HintPath>$(EXILED_REFERENCES)\UnityEngine.CoreModule.dll</HintPath>
29+
<Reference Include="UnityEngine.CoreModule">
30+
<HintPath>..\..\EXILED References\Internal\11.2\UnityEngine.CoreModule.dll</HintPath>
2331
</Reference>
2432
</ItemGroup>
2533

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using CommandSystem;
4+
using Exiled.API.Features;
5+
using MEC;
6+
7+
namespace BetterDoggie.Commands
8+
{
9+
[CommandHandler(typeof(ClientCommandHandler))]
10+
public class BoostCommand : ICommand
11+
{
12+
public string Command { get; } = "doggieboost";
13+
public string[] Aliases { get; } = Array.Empty<string>();
14+
public string Description { get; } = "Grants a temporary boost to SCP-939.";
15+
16+
private Config _config = BetterDoggie.Singleton.Config;
17+
private Dictionary<Player, CoroutineHandle?> _activeAbilities = BetterDoggie.Singleton.ActiveAbilities;
18+
private Dictionary<Player, int> _abilityCooldowns = BetterDoggie.Singleton.AbilityCooldowns;
19+
20+
public bool Execute(ArraySegment<string> arguments, ICommandSender sender, out string response)
21+
{
22+
Player player = Player.Get((sender as CommandSender)?.SenderId);
23+
24+
if (Is939(player.Role.Type))
25+
{
26+
if (_abilityCooldowns.ContainsKey(player))
27+
{
28+
response = $"Door busting ability on cooldown for {_abilityCooldowns[player]} more seconds.";
29+
return true;
30+
}
31+
32+
if (_activeAbilities.ContainsKey(player))
33+
{
34+
if (!(_activeAbilities[player] == null)) Timing.KillCoroutines((CoroutineHandle)_activeAbilities[player]);
35+
36+
_activeAbilities.Remove(player);
37+
_abilityCooldowns.Add(player, _config.DoorBustingCooldown);
38+
39+
Timing.RunCoroutine(CooldownCoroutine(player));
40+
41+
response = "Door busting ability disabled.";
42+
return true;
43+
}
44+
else
45+
{
46+
_activeAbilities.Add(player, null);
47+
48+
player.ShowHint("<color=green>Door busting ability activated.");
49+
50+
response = "Door busting ability enabled.";
51+
return true;
52+
}
53+
}
54+
else
55+
{
56+
response = "You must be an SCP-939 to run this command.";
57+
return false;
58+
}
59+
}
60+
61+
private IEnumerator<float> CooldownCoroutine(Player player)
62+
{
63+
for(int i = _config.DoorBustingCooldown; i > 0; i--)
64+
{
65+
_abilityCooldowns[player] -= 1;
66+
67+
player.ShowHint($"Door busting ability can be re-activated in {i} seconds.", 1);
68+
69+
yield return Timing.WaitForSeconds(1f);
70+
}
71+
72+
_abilityCooldowns.Remove(player);
73+
_activeAbilities.Remove(player);
74+
}
75+
76+
private static bool Is939(RoleType role)
77+
{
78+
return role == RoleType.Scp93953 || role == RoleType.Scp93989;
79+
}
80+
}
81+
}

0 commit comments

Comments
 (0)