Skip to content

Commit f7a4995

Browse files
Updated README and some small fixes
1 parent a1e7d83 commit f7a4995

File tree

3 files changed

+65
-44
lines changed

3 files changed

+65
-44
lines changed

README.md

Lines changed: 58 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,58 @@
1-
# ZombieDoorBreaking
2-
3-
![Downloads](https://img.shields.io/github/downloads/SnivyFilms/ZombieDoorBreaking/total.svg)
4-
5-
This Exiled plugin gives SCP-049-2 a new ability to work alongside other infected humans, improving on it's `"swarm"` thematic by allowing them to open doors that usually can't be open by normal SCPs if there's enough around. Overall, pretty simple!
6-
7-
# Configs
8-
```yml
9-
is_enabled: true
10-
debug: false
11-
breakable_door_modifier: OpenThenLock
12-
zombies_needed: 5
13-
ability_cooldown: 24
14-
max_distance: 24
15-
unlock_after_seconds: 3
16-
rate_limit: 2.5
17-
not_enough_zombies: "<color=red>There isn't enough zombies for this ability! You need {zombiecount} to open this door</color>"
18-
on_cooldown: "<color=red>This ability is currently on cooldown!"
19-
DisplayDuration: 5
20-
```
21-
22-
# Breakable door modifiers
23-
| Variable | Meaning |
24-
| ------------- | ------------- |
25-
| `OpenThenLock` | Opens the door, then it locks it based off the unlock_after_seconds value |
26-
| `Open` | Opens the door, but does not lock it, unlock_after_seconds does nothing |
27-
| `Break` | Breaks open the door, unlock_after_seconds does nothing |
28-
29-
# String variables
30-
| Variable | Meaning |
31-
| ------------- | ------------- |
32-
| `{zombiecount}` | Gets the required amount zombies needed to open/break the door |
1+
[![GitHub release](https://flat.badgen.net/github/release/FrikandelbroodjeCommunity/ZombieDoorBreaking-LabAPI/)](https://github.com/FrikandelbroodjeCommunity/ZombieDoorBreaking-LabAPI/releases/latest)
2+
[![LabAPI Version](https://flat.badgen.net/static/LabAPI%20Version/v1.1.2)](https://github.com/northwood-studios/LabAPI)
3+
[![Original](https://flat.badgen.net/static/Original/SnivyFilms?icon=github)](https://github.com/SnivyFilms/ZombieDoorBreaking)
4+
[![License](https://flat.badgen.net/github/license/FrikandelbroodjeCommunity/ZombieDoorBreaking-LabAPI/)](https://github.com/FrikandelbroodjeCommunity/ZombieDoorBreaking-LabAPI/blob/master/LICENSE)
5+
6+
# About ZombieDoorBreaking
7+
8+
This LabAPI plugin gives SCP-049-2 a new ability to work alongside other infected humans, improving on it's `"swarm"`
9+
thematic by allowing them to open doors that usually can't be open by normal SCPs if there's enough around. Overall,
10+
pretty simple!
11+
12+
# Installation
13+
14+
Place the [latest release](https://github.com/FrikandelbroodjeCommunity/ZombieDoorBreaking-LabAPI/releases/latest) in
15+
the LabAPI plugin folder.
16+
17+
# Usage
18+
19+
When playing as SCP-049-2 you can attempt to break/open a door/gate that normally requires keycard permissions by
20+
interacting with the door (default: E key). The door will then open if enough zombies, that no longer have a cooldown,
21+
are in the vicinity.
22+
23+
Doors that are locked, or already open, cannot be broken or closed.
24+
25+
# Config
26+
27+
| Config | Default | Meaning |
28+
|---------------------------|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|
29+
| `debug` | `false` | When enabled, the plugin will show debug message. When using on a server it is recommended to keep this disabled. |
30+
| `breakable_door_modifier` | `OpenThenLock` | What should happen if the zombie succeed in opening the door (see [modifiers](#Breakable-door-modifiers)). |
31+
| `pryable_gate_modifier` | `Pry` | What should happen if the zombie succeed in opening a pryable gate (see [modifiers](#Pryable-gate-modifiers)). |
32+
| `zombies_needed` | `5` | The amount of zombies that need to be within the `MaxDistance` range of the door in order for it to open. |
33+
| `ability_cooldown` | `24` | The time in seconds before a zombie can attempt to open another door. During this time they cannot count towards the `ZombiesNeeded`. |
34+
| `max_distance` | `16` | The squared maximum amount of distance a zombie can have to the door. This means a value of 16 will represent a max distance of 4 meters (as `4^2 = 16`) |
35+
| `unlock_after_seconds` | `3` | When a modifiers is set to `OpenThenLock`, this determines the amount of time the doors will be locked for in seconds. |
36+
| `rate_limit` | `2.5` | The amount of time in seconds that needs to be between door open attempts, this rate limit affects <i>all</i> doors globally. |
37+
| `display_duration` | `7` | The amount of time in seconds the hints will be shown to players. Make sure this is long enough so players have time to read the messages. |
38+
| `not_enough_zombies_text` | ... | The message shown when a player attempts to open a door, but there are not enough zombies nearby. |
39+
| `on_cooldown_text` | ... | The message shown when a player attempts to open a door, but they are still on cooldown. |
40+
| `on_break_door_text` | ... | The message shown to all players that assisted in opening a door. |
41+
42+
## Breakable door modifiers
43+
44+
| Variable | Meaning |
45+
|----------------|------------------------------------------------------------------------------|
46+
| `OpenThenLock` | Opens the door, then it locks it based off the `unlock_after_seconds` value. |
47+
| `Open` | Opens the door, but does not lock it, `unlock_after_seconds` does nothing. |
48+
| `Break` | Breaks open the door, `unlock_after_seconds` does nothing. |
49+
| `Nothing` | Does nothing, effectively disabling the plugin for doors. |
50+
51+
## Pryable gate modifiers
52+
53+
| Variable | Meaning |
54+
|----------------|----------------------------------------------------------------------------|
55+
| `OpenThenLock` | Opens the door, then it locks it based off the unlock_after_seconds value. |
56+
| `Open` | Opens the door, but does not lock it, `unlock_after_seconds` does nothing. |
57+
| `Pry` | Pries open the door like SCP-096, `unlock_after_seconds` does nothing. |
58+
| `Nothing` | Does nothing, effectively disabling the plugin for doors. |

StrongerZombies/BalanceSettings.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class BalanceSettings
2121
public float AbilityCooldown { get; set; } = 24f;
2222

2323
[Description("The distance you need to be to the door to open/break it")]
24-
public float MaxDistance { get; set; } = 4.35f * 4.35f;
24+
public float MaxDistance { get; set; } = 16;
2525

2626
[Description("If the config for BreakbableDoorModifier is OpenThenLock, this gets how long the door should be locked for")]
2727
public float UnlockAfterSeconds { get; set; } = 3;
@@ -30,7 +30,7 @@ public class BalanceSettings
3030
public float RateLimit { get; set; } = 2.5f;
3131

3232
[Description("Sets the duration that the broadcasts should be shown to users")]
33-
public ushort DisplayDuration { get; set; } = 5;
33+
public ushort DisplayDuration { get; set; } = 7;
3434

3535
[Description("Sets the text that will be shown to the users if there is not enough zombies to open/break the door")]
3636
public string NotEnoughZombiesText { get; set; } = "<color=red>There is not enough zombies for this ability! You need {0} zombies to open this door</color>";

StrongerZombies/Handlers/ZombieHandler.cs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,10 @@ namespace StrongerZombies.Handlers;
1414

1515
public static class ZombieHandler
1616
{
17-
private const string OnCdTag = "sz_oncd";
18-
private const string CooldownTag = "sz_cd";
19-
2017
private static readonly Dictionary<Player, float> Cooldown = new();
2118
private static readonly List<CoroutineHandle> Coroutines = new();
2219

23-
public static BalanceSettings Config => StrongerZombies.Instance.Config ?? new BalanceSettings();
24-
25-
private static string _zombiesNeededBroadcast = string.Empty;
26-
private static string _onCooldownBroadcast = string.Empty;
20+
private static BalanceSettings Config => StrongerZombies.Instance.Config ?? new BalanceSettings();
2721

2822
private static float _rateLimit;
2923
private static bool _roundEnded;
@@ -74,7 +68,7 @@ private static void DoorInteract(PlayerInteractingDoorEventArgs ev)
7468

7569
if (Cooldown.TryGetValue(ev.Player, out var cd) && cd > Time.time)
7670
{
77-
ev.Player.SendHint(string.Format(Config.OnCooldownText, Config.DisplayDuration), 7);
71+
ev.Player.SendHint(Config.OnCooldownText, Config.DisplayDuration);
7872
Logger.Debug("Cannot Break Door: Cooldown", Config.Debug);
7973
return;
8074
}
@@ -88,7 +82,8 @@ private static void DoorInteract(PlayerInteractingDoorEventArgs ev)
8882
if (Config.ZombiesNeeded > nearbyZombies.Length)
8983
{
9084
_rateLimit = Time.time + Config.RateLimit;
91-
ev.Player.SendHint(string.Format(Config.NotEnoughZombiesText, Config.ZombiesNeeded));
85+
ev.Player.SendHint(string.Format(Config.NotEnoughZombiesText, Config.ZombiesNeeded),
86+
Config.DisplayDuration);
9287
Logger.Debug("Cannot Break Door: Not Enough Zombies", Config.Debug);
9388
return;
9489
}
@@ -141,7 +136,7 @@ private static void DoorInteract(PlayerInteractingDoorEventArgs ev)
141136
var newCooldown = Time.time + Config.AbilityCooldown;
142137
foreach (var player in nearbyZombies)
143138
{
144-
player.SendHint(Config.OnBreakDoorText, 7);
139+
player.SendHint(Config.OnBreakDoorText, Config.DisplayDuration);
145140
Cooldown[player] = newCooldown;
146141
}
147142
}

0 commit comments

Comments
 (0)