Skip to content

Commit e387160

Browse files
committed
Added 035_can_use_medical_items, defaults to true
1 parent ac3cd65 commit e387160

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

scp035/Configs.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ internal static class Configs
1919
internal static bool corrodeLifeSteal;
2020
internal static bool corrodeTrail;
2121
internal static bool corrodeHost;
22+
internal static bool canUseMedicalItems;
2223

2324
internal static float corrodeDistance;
2425
internal static float rotateInterval;
@@ -44,6 +45,7 @@ internal static void ReloadConfig()
4445
Configs.corrodeHost = Plugin.Config.GetBool("035_corrode_host", false);
4546
Configs.corrodeHostInterval = Plugin.Config.GetFloat("035_corrode_host_interval", 6f);
4647
Configs.corrodeHostAmount = Plugin.Config.GetInt("035_corrode_host_amount", 5);
48+
Configs.canUseMedicalItems = Plugin.Config.GetBool("035_can_use_medical_items", true);
4749
if (Configs.possibleItems == null || Configs.possibleItems.Count == 0)
4850
{
4951
Configs.possibleItems = new List<int>() { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 19, 20, 21, 23, 24, 25, 26, 27, 30, 33, 34 };

scp035/EventHandlers.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ partial class EventHandlers
1919
private static bool hasTag;
2020
private bool isRoundStarted;
2121
private static bool isRotating;
22+
private static int maxHP;
2223
// Arbitrary number to keep track of items
2324
private const float dur = 327;
2425
private static System.Random rand = new System.Random();
@@ -208,7 +209,7 @@ public void OnPocketDimensionDie(PocketDimDeathEvent ev)
208209

209210
public void OnUseMedicalItem(MedicalItemEvent ev)
210211
{
211-
if (ev.Player.queryProcessor.PlayerId == scpPlayer?.queryProcessor.PlayerId && (ev.Item == ItemType.Adrenaline || ev.Item == ItemType.Painkillers || ev.Item == ItemType.Medkit || ev.Item == ItemType.SCP500))
212+
if (!Configs.canUseMedicalItems && ev.Player.queryProcessor.PlayerId == scpPlayer?.queryProcessor.PlayerId && (ev.Item == ItemType.Adrenaline || ev.Item == ItemType.Painkillers || ev.Item == ItemType.Medkit || ev.Item == ItemType.SCP500))
212213
{
213214
ev.Allow = false;
214215
}

scp035/Logic.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ private static void KillScp035(bool setRank = true)
5454
if (hasTag) scpPlayer.RefreshTag();
5555
if (isHidden) scpPlayer.HideTag();
5656
}
57+
scpPlayer.playerStats.maxHP = maxHP;
5758
scpPlayer = null;
5859
isRotating = true;
5960
RefreshItems();
@@ -71,6 +72,8 @@ public static void Spawn035(ReferenceHub p035, ReferenceHub player = null, bool
7172

7273
foreach (Inventory.SyncItemInfo item in player.inventory.items) p035.inventory.AddNewItem(item.id);
7374
}
75+
maxHP = p035.playerStats.maxHP;
76+
p035.playerStats.maxHP = Configs.health;
7477
p035.playerStats.health = Configs.health;
7578
p035.ammoBox.Networkamount = "250:250:250";
7679
}

0 commit comments

Comments
 (0)