diff --git a/EXILED/Exiled.API/Extensions/DamageTypeExtensions.cs b/EXILED/Exiled.API/Extensions/DamageTypeExtensions.cs index 6fde63477..6dd94a95d 100644 --- a/EXILED/Exiled.API/Extensions/DamageTypeExtensions.cs +++ b/EXILED/Exiled.API/Extensions/DamageTypeExtensions.cs @@ -164,6 +164,8 @@ public static DamageType GetDamageType(DamageHandlerBase damageHandlerBase) return DamageType.GrayCandy; case Scp1509DamageHandler: return DamageType.Scp1509; + case MarshmallowDamageHandler: + return DamageType.Marshmallow; case Scp049DamageHandler scp049DamageHandler: return scp049DamageHandler.DamageSubType switch { @@ -207,8 +209,6 @@ public static DamageType GetDamageType(DamageHandlerBase damageHandlerBase) case AttackerDamageHandler attackerDamageHandler: { - if (Player.TryGet(attackerDamageHandler.Attacker, out Player attacker) && attacker.CurrentItem?.Type == ItemType.MarshmallowItem) - return DamageType.Marshmallow; return DamageType.Unknown; } } diff --git a/EXILED/Exiled.API/Features/Pickups/JailbirdPickup.cs b/EXILED/Exiled.API/Features/Pickups/JailbirdPickup.cs index eaaf77cb7..93c18ff7b 100644 --- a/EXILED/Exiled.API/Features/Pickups/JailbirdPickup.cs +++ b/EXILED/Exiled.API/Features/Pickups/JailbirdPickup.cs @@ -109,6 +109,9 @@ internal override void ReadItemInfo(Item item) if (item is Jailbird jailBirditem) { + // TODO: Remove if this is fixed https://git.scpslgame.com/northwood-qa/scpsl-bug-reporting/-/issues/2816 + jailBirditem.Base._deterioration.RecheckUsage(); + MeleeDamage = jailBirditem.MeleeDamage; ChargeDamage = jailBirditem.ChargeDamage; FlashDuration = jailBirditem.FlashDuration; diff --git a/EXILED/Exiled.Events/Handlers/Internal/Round.cs b/EXILED/Exiled.Events/Handlers/Internal/Round.cs index cebcffa74..ac058b462 100644 --- a/EXILED/Exiled.Events/Handlers/Internal/Round.cs +++ b/EXILED/Exiled.Events/Handlers/Internal/Round.cs @@ -15,6 +15,7 @@ namespace Exiled.Events.Handlers.Internal using Exiled.API.Extensions; using Exiled.API.Features; using Exiled.API.Features.Core.UserSettings; + using Exiled.API.Features.Doors; using Exiled.API.Features.Items; using Exiled.API.Features.Pools; using Exiled.API.Features.Roles; @@ -23,17 +24,14 @@ namespace Exiled.Events.Handlers.Internal using Exiled.Events.EventArgs.Scp049; using Exiled.Loader; using Exiled.Loader.Features; + using Interactables.Interobjects.DoorUtils; using InventorySystem; using InventorySystem.Items.Firearms.Attachments; using InventorySystem.Items.Firearms.Attachments.Components; using InventorySystem.Items.Usables; - using InventorySystem.Items.Usables.Scp244.Hypothermia; using InventorySystem.Items.Usables.Scp330; using PlayerRoles; - using PlayerRoles.FirstPersonControl; using PlayerRoles.RoleAssign; - using UnityEngine; - using Utils.Networking; using Utils.NonAllocLINQ; /// @@ -60,6 +58,10 @@ public static void OnWaitingForPlayers() if (Events.Instance.Config.Debug) Patches.Events.Map.Generating.Benchmark(); + + // TODO: Remove when this has been fixed https://git.scpslgame.com/northwood-qa/scpsl-bug-reporting/-/issues/1560 + Door door = Door.Get(DoorType.Scp079Armory); + door.AllowsScp106 = false; } /// @@ -94,9 +96,6 @@ public static void OnSpawningRagdoll(SpawningRagdollEventArgs ev) { if (ev.Role.IsDead() || !ev.Role.IsFpcRole()) ev.IsAllowed = false; - - if (ev.DamageHandlerBase is Exiled.Events.Patches.Fixes.FixMarshmallowManFF fixMarshamllowManFf) - ev.DamageHandlerBase = fixMarshamllowManFf.MarshmallowItem.NewDamageHandler; } /// diff --git a/EXILED/Exiled.Events/Patches/Fixes/Fix106ItemManager.cs b/EXILED/Exiled.Events/Patches/Fixes/Fix106ItemManager.cs deleted file mode 100644 index c082edbed..000000000 --- a/EXILED/Exiled.Events/Patches/Fixes/Fix106ItemManager.cs +++ /dev/null @@ -1,45 +0,0 @@ -// ----------------------------------------------------------------------- -// -// Copyright (c) ExMod Team. All rights reserved. -// Licensed under the CC BY-SA 3.0 license. -// -// ----------------------------------------------------------------------- - -namespace Exiled.Events.Patches.Fixes -{ - using System.Collections.Generic; - using System.Reflection.Emit; - - using Exiled.API.Features.Pools; - - using HarmonyLib; - - using PlayerRoles.PlayableScps.Scp106; - - /// - /// Patches the method. - /// Fixes an error caused by this method cuz NW doesn't know how to do array indexing. - /// - [HarmonyPatch(typeof(Scp106PocketItemManager), nameof(Scp106PocketItemManager.GetRandomValidSpawnPosition))] - public class Fix106ItemManager - { - private static IEnumerable Transpiler(IEnumerable instructions) - { - List newInstructions = ListPool.Pool.Get(instructions); - - int offset = 1; - int index = newInstructions.FindIndex(x => x.LoadsConstant(64)) + offset; - - newInstructions[index].opcode = OpCodes.Blt_S; - - index = newInstructions.FindLastIndex(x => x.LoadsConstant(64)) + offset; - - newInstructions[index].opcode = OpCodes.Blt_S; - - for (int z = 0; z < newInstructions.Count; z++) - yield return newInstructions[z]; - - ListPool.Pool.Return(newInstructions); - } - } -} \ No newline at end of file diff --git a/EXILED/Exiled.Events/Patches/Fixes/FixMarshmallowManFF.cs b/EXILED/Exiled.Events/Patches/Fixes/FixMarshmallowManFF.cs deleted file mode 100644 index 51dab211b..000000000 --- a/EXILED/Exiled.Events/Patches/Fixes/FixMarshmallowManFF.cs +++ /dev/null @@ -1,91 +0,0 @@ -// ----------------------------------------------------------------------- -// -// Copyright (c) ExMod Team. All rights reserved. -// Licensed under the CC BY-SA 3.0 license. -// -// ----------------------------------------------------------------------- - -namespace Exiled.Events.Patches.Fixes -{ - using System.Collections.Generic; - using System.Reflection.Emit; - - using CustomPlayerEffects; - using Exiled.API.Features; - using Exiled.API.Features.Pools; - using Footprinting; - using HarmonyLib; - using InventorySystem.Items.MarshmallowMan; - using InventorySystem.Items.Pickups; - using InventorySystem.Items.ThrowableProjectiles; - using Mirror; - using PlayerRoles; - using PlayerRoles.FirstPersonControl; - using PlayerStatsSystem; - using Respawning.NamingRules; - using Subtitles; - - using static HarmonyLib.AccessTools; - - /// - /// Patches the delegate. - /// - [HarmonyPatch(typeof(MarshmallowItem), nameof(MarshmallowItem.ServerAttack))] - internal class FixMarshmallowManFF : AttackerDamageHandler - { -#pragma warning disable SA1600 // Elements should be documented - public FixMarshmallowManFF(MarshmallowItem marshmallowItem, bool isEvilMode) - { - MarshmallowItem = marshmallowItem; - Attacker = new(marshmallowItem.Owner); - Damage = marshmallowItem._attackDamage; - ForceFullFriendlyFire = isEvilMode; - } - - public MarshmallowItem MarshmallowItem { get; set; } - - public override Footprint Attacker { get; set; } - - public override bool AllowSelfDamage { get; } = false; - - public override float Damage { get; set; } - - public override string RagdollInspectText { get; } = DeathTranslations.MarshmallowMan.RagdollTranslation; - - public override CassieAnnouncement CassieDeathAnnouncement { get; } = new() - { - Announcement = "TERMINATED BY MARSHMALLOW MAN", - SubtitleParts = - [ - new SubtitlePart(SubtitleType.TerminatedByMarshmallowMan, null), - ], - }; - - public override string DeathScreenText { get; } = DeathTranslations.MarshmallowMan.DeathscreenTranslation; - - public override string ServerLogsText => "Stabbed with Marshmallow Item by " + Attacker.Nickname; -#pragma warning restore SA1600 // Elements should be documented -#pragma warning disable SA1313 // Parameter names should begin with lower-case letter - - private static IEnumerable Transpiler(IEnumerable instructions) - { - List newInstructions = ListPool.Pool.Get(instructions); - - int index = newInstructions.FindIndex(instruction => instruction.Calls(PropertyGetter(typeof(MarshmallowItem), nameof(MarshmallowItem.NewDamageHandler)))); - - // replace the getter for NewDamageHandler with ctor of FixMarshmallowManFF - newInstructions.RemoveAt(index); - newInstructions.InsertRange(index, new List - { - new(OpCodes.Ldarg_0), - new(OpCodes.Callvirt, PropertyGetter(typeof(MarshmallowItem), nameof(MarshmallowItem.EvilMode))), - new(OpCodes.Newobj, Constructor(typeof(FixMarshmallowManFF), new[] { typeof(MarshmallowItem), typeof(bool) })), - }); - - for (int z = 0; z < newInstructions.Count; z++) - yield return newInstructions[z]; - - ListPool.Pool.Return(newInstructions); - } - } -}