From b3e957d6324cbb09e50a48400dc5b20add3156c3 Mon Sep 17 00:00:00 2001 From: Yamato Date: Wed, 30 Oct 2024 23:10:02 +0100 Subject: [PATCH 01/29] secret update --- EXILED/Exiled.API/Enums/EffectType.cs | 10 ++++ .../Extensions/EffectTypeExtension.cs | 6 ++- .../Exiled.API/Extensions/MirrorExtensions.cs | 6 ++- .../DamageHandlers/CustomDamageHandler.cs | 2 +- .../DamageHandlers/GenericDamageHandler.cs | 8 ++- .../Exiled.API/Features/Doors/ElevatorDoor.cs | 18 +++---- EXILED/Exiled.API/Features/Items/Firearm.cs | 51 ++++++++++++++----- EXILED/Exiled.API/Features/Lift.cs | 20 +++----- EXILED/Exiled.API/Features/Map.cs | 12 +++-- .../Features/Pickups/FirearmPickup.cs | 18 ++++--- EXILED/Exiled.API/Features/Player.cs | 23 ++++++--- EXILED/Exiled.API/Features/Ragdoll.cs | 2 +- .../Exiled.API/Features/Roles/Scp079Role.cs | 2 +- EXILED/Exiled.API/Features/Round.cs | 4 +- EXILED/Exiled.API/Features/Toys/AdminToy.cs | 2 +- EXILED/Exiled.API/Features/Window.cs | 6 +-- .../Exiled.Events/Patches/Generic/LiftList.cs | 2 +- 17 files changed, 120 insertions(+), 72 deletions(-) diff --git a/EXILED/Exiled.API/Enums/EffectType.cs b/EXILED/Exiled.API/Enums/EffectType.cs index 734fdb8ce4..9359136bda 100644 --- a/EXILED/Exiled.API/Enums/EffectType.cs +++ b/EXILED/Exiled.API/Enums/EffectType.cs @@ -239,5 +239,15 @@ public enum EffectType /// . /// Slowness, + + /// + /// . + /// + Scp1344, + + /// + /// . + /// + SeveredEyes, } } diff --git a/EXILED/Exiled.API/Extensions/EffectTypeExtension.cs b/EXILED/Exiled.API/Extensions/EffectTypeExtension.cs index 126b5eae41..5b08794db8 100644 --- a/EXILED/Exiled.API/Extensions/EffectTypeExtension.cs +++ b/EXILED/Exiled.API/Extensions/EffectTypeExtension.cs @@ -33,7 +33,7 @@ public static class EffectTypeExtension { EffectType.AmnesiaVision, typeof(AmnesiaVision) }, { EffectType.Asphyxiated, typeof(Asphyxiated) }, { EffectType.Bleeding, typeof(Bleeding) }, - { EffectType.Blinded, typeof(Blinded) }, + { EffectType.Blinded, typeof(Blindness) }, { EffectType.BodyshotReduction, typeof(BodyshotReduction) }, { EffectType.Burned, typeof(Burned) }, { EffectType.CardiacArrest, typeof(CardiacArrest) }, @@ -74,6 +74,8 @@ public static class EffectTypeExtension { EffectType.Ghostly, typeof(Ghostly) }, { EffectType.FogControl, typeof(FogControl) }, { EffectType.Slowness, typeof(Slowness) }, + { EffectType.Scp1344, typeof(Scp1344) }, + { EffectType.SeveredEyes, typeof(SeveredEyes) }, }); /// @@ -146,7 +148,7 @@ or EffectType.Corroding or EffectType.Decontaminating or EffectType.Hemorrhage o /// The . /// Whether or not the effect heals. /// - public static bool IsHealing(this EffectType effect) => effect.TryGetType(out Type type) && typeof(IHealablePlayerEffect).IsAssignableFrom(type); + public static bool IsHealing(this EffectType effect) => effect.TryGetType(out Type type) && typeof(IHealableEffect).IsAssignableFrom(type); /// /// Returns whether or not the provided is a negative effect. diff --git a/EXILED/Exiled.API/Extensions/MirrorExtensions.cs b/EXILED/Exiled.API/Extensions/MirrorExtensions.cs index 568eabf511..2ed2886251 100644 --- a/EXILED/Exiled.API/Extensions/MirrorExtensions.cs +++ b/EXILED/Exiled.API/Extensions/MirrorExtensions.cs @@ -151,7 +151,7 @@ public static ReadOnlyDictionary RpcFullNames /// Plays a beep sound that only the target can hear. /// /// Target to play sound to. - public static void PlayBeepSound(this Player player) => SendFakeTargetRpc(player, ReferenceHub.HostHub.networkIdentity, typeof(AmbientSoundPlayer), nameof(AmbientSoundPlayer.RpcPlaySound), 7); + public static void PlayBeepSound(this Player player) => SendFakeTargetRpc(player, ReferenceHub._hostHub.networkIdentity, typeof(AmbientSoundPlayer), nameof(AmbientSoundPlayer.RpcPlaySound), 7); /// /// Set on the player that only the can see. @@ -171,6 +171,8 @@ public static ReadOnlyDictionary RpcFullNames /// GunAudioMessage's audioClipId to set (default = 0). public static void PlayGunSound(this Player player, Vector3 position, ItemType itemType, byte volume, byte audioClipId = 0) { + // TODO: Not finish + /* GunAudioMessage message = new() { Weapon = itemType, @@ -180,7 +182,7 @@ public static void PlayGunSound(this Player player, Vector3 position, ItemType i ShooterPosition = new RelativePosition(position), }; - player.Connection.Send(message); + player.Connection.Send(message);*/ } /// diff --git a/EXILED/Exiled.API/Features/DamageHandlers/CustomDamageHandler.cs b/EXILED/Exiled.API/Features/DamageHandlers/CustomDamageHandler.cs index 47aa8f4f13..07bee5377b 100644 --- a/EXILED/Exiled.API/Features/DamageHandlers/CustomDamageHandler.cs +++ b/EXILED/Exiled.API/Features/DamageHandlers/CustomDamageHandler.cs @@ -71,7 +71,7 @@ public CustomDamageHandler(Player target, Player attacker, float damage, DamageT Base = { Owner = attacker.ReferenceHub }, }; - CustomBase = new FirearmDamageHandler(firearm, target, new BaseFirearmHandler(firearm.Base, damage)); + CustomBase = new FirearmDamageHandler(firearm, target, new PlayerStatsSystem.FirearmDamageHandler() { Firearm = firearm.Base, Damage = damage }); } /// diff --git a/EXILED/Exiled.API/Features/DamageHandlers/GenericDamageHandler.cs b/EXILED/Exiled.API/Features/DamageHandlers/GenericDamageHandler.cs index 56c6ad2822..9c1228db3e 100644 --- a/EXILED/Exiled.API/Features/DamageHandlers/GenericDamageHandler.cs +++ b/EXILED/Exiled.API/Features/DamageHandlers/GenericDamageHandler.cs @@ -10,14 +10,12 @@ namespace Exiled.API.Features.DamageHandlers using Enums; using Footprinting; - using Items; using PlayerRoles.PlayableScps.Scp096; using PlayerRoles.PlayableScps.Scp939; using PlayerStatsSystem; - using UnityEngine; /// @@ -113,7 +111,7 @@ public GenericDamageHandler(Player player, Player attacker, float damage, Damage Base = new MicroHidDamageHandler(microHidOwner, damage); break; case DamageType.Explosion: - Base = new ExplosionDamageHandler(attacker.Footprint, UnityEngine.Vector3.zero, damage, 0); + Base = new ExplosionDamageHandler(attacker.Footprint, UnityEngine.Vector3.zero, damage, 0, ExplosionType.Grenade); break; case DamageType.Firearm: GenericFirearm(player, attacker, damage, damageType, ItemType.GunAK); @@ -155,7 +153,7 @@ public GenericDamageHandler(Player player, Player attacker, float damage, Damage GenericFirearm(player, attacker, damage, damageType, ItemType.GunA7); break; case DamageType.ParticleDisruptor: - Base = new DisruptorDamageHandler(Attacker, damage); + Base = new DisruptorDamageHandler(new (Item.Create(ItemType.ParticleDisruptor, attacker).Base as InventorySystem.Items.Firearms.Firearm, InventorySystem.Items.Firearms.Modules.DisruptorActionModule.FiringState.FiringSingle), Vector3.up, damage); break; case DamageType.Scp096: Scp096Role curr096 = attacker.ReferenceHub.roleManager.CurrentRole as Scp096Role ?? new Scp096Role(); @@ -259,7 +257,7 @@ private void GenericFirearm(Player player, Player attacker, float amount, Damage Owner = attacker.ReferenceHub, }, }; - Base = new PlayerStatsSystem.FirearmDamageHandler(firearm.Base, amount); + Base = new PlayerStatsSystem.FirearmDamageHandler() { Firearm = firearm.Base, Damage = amount }; } } } diff --git a/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs b/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs index d5d303d103..a9e9aeca4d 100644 --- a/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs +++ b/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs @@ -36,28 +36,28 @@ internal ElevatorDoor(Interactables.Interobjects.ElevatorDoor door, List r public new Interactables.Interobjects.ElevatorDoor Base { get; } /// - /// Gets the that this door's belongs to. + /// Gets the that this door's belongs to. /// - public ElevatorManager.ElevatorGroup Group => Base.Group; + public ElevatorGroup Group => Base.Group; /// /// Gets the type according to . /// public ElevatorType ElevatorType => Group switch { - ElevatorManager.ElevatorGroup.Scp049 => ElevatorType.Scp049, - ElevatorManager.ElevatorGroup.GateA => ElevatorType.GateA, - ElevatorManager.ElevatorGroup.GateB => ElevatorType.GateB, - ElevatorManager.ElevatorGroup.LczA01 or ElevatorManager.ElevatorGroup.LczA02 => ElevatorType.LczA, - ElevatorManager.ElevatorGroup.LczB01 or ElevatorManager.ElevatorGroup.LczB02 => ElevatorType.LczB, - ElevatorManager.ElevatorGroup.Nuke => ElevatorType.Nuke, + ElevatorGroup.Scp049 => ElevatorType.Scp049, + ElevatorGroup.GateA => ElevatorType.GateA, + ElevatorGroup.GateB => ElevatorType.GateB, + ElevatorGroup.LczA01 or ElevatorGroup.LczA02 => ElevatorType.LczA, + ElevatorGroup.LczB01 or ElevatorGroup.LczB02 => ElevatorType.LczB, + ElevatorGroup.Nuke => ElevatorType.Nuke, _ => ElevatorType.Unknown, }; /// /// Gets the target panel for this lift. /// - public ElevatorPanel Panel => Base.TargetPanel; + public ElevatorPanel Panel => Base.PanelSettings; /// /// Gets the associated with this elevator door. diff --git a/EXILED/Exiled.API/Features/Items/Firearm.cs b/EXILED/Exiled.API/Features/Items/Firearm.cs index f9b4b2cece..f410827d1d 100644 --- a/EXILED/Exiled.API/Features/Items/Firearm.cs +++ b/EXILED/Exiled.API/Features/Items/Firearm.cs @@ -68,11 +68,13 @@ public Firearm(BaseFirearm itemBase) internal Firearm(ItemType type) : this((BaseFirearm)Server.Host.Inventory.CreateItemInstance(new(type, 0), false)) { + // TODO Not finish + /* FirearmStatusFlags firearmStatusFlags = FirearmStatusFlags.MagazineInserted; if (Base.HasAdvantageFlag(AttachmentDescriptiveAdvantages.Flashlight)) firearmStatusFlags |= FirearmStatusFlags.FlashlightEnabled; - Base.Status = new FirearmStatus(MaxAmmo, firearmStatusFlags, Base.Status.Attachments); + Base.Status = new FirearmStatus(MaxAmmo, firearmStatusFlags, Base.Status.Attachments);*/ } /// . @@ -112,21 +114,23 @@ public static IReadOnlyDictionary /// Gets or sets the amount of ammo in the firearm. /// - public byte Ammo + public int Ammo { - get => Base.Status.Ammo; - set => Base.Status = new FirearmStatus(value, Base.Status.Flags, Base.Status.Attachments); + get => (Base.Modules[Array.IndexOf(Base.Modules, typeof(MagazineModule))] as MagazineModule).AmmoStored; + set => (Base.Modules[Array.IndexOf(Base.Modules, typeof(MagazineModule))] as MagazineModule).AmmoStored = value; } /// /// Gets or sets the max ammo for this firearm. /// /// Disruptor can't be used for MaxAmmo. - public byte MaxAmmo + public int MaxAmmo { - get => Base.AmmoManagerModule.MaxAmmo; + get => (Base.Modules[Array.IndexOf(Base.Modules, typeof(MagazineModule))] as MagazineModule).AmmoMax; set { + // TODO Not finish + /* switch (Base.AmmoManagerModule) { case TubularMagazineAmmoManager tubularMagazineAmmoManager: @@ -141,7 +145,7 @@ public byte MaxAmmo default: Log.Warn($"MaxAmmo can't be used for this Item: {Type} ({Base.AmmoManagerModule})"); return; - } + }*/ } } @@ -153,8 +157,11 @@ public byte MaxAmmo /// /// Gets the of the firearm. /// - public AmmoType AmmoType => Base.AmmoType.GetAmmoType(); + // TODO not finish Base.AmmoType.GetAmmoType(); + public AmmoType AmmoType => AmmoType.None; + // TODO Not finish + /* /// /// Gets a value indicating whether the firearm is being aimed. /// @@ -179,6 +186,7 @@ public byte MaxAmmo /// Gets a value indicating whether or not the firearm is automatic. /// public bool IsAutomatic => Base is AutomaticFirearm; + */ /// /// Gets the s of the firearm. @@ -202,6 +210,8 @@ public IEnumerable AttachmentIdentifiers /// public uint BaseCode => BaseCodesValue[FirearmType]; + // TODO Not finish + /* /// /// Gets or sets the fire rate of the firearm, if it is an automatic weapon. /// @@ -236,6 +246,7 @@ public RecoilSettings Recoil /// Gets the firearm's . Will be for non-automatic weapons. /// public FirearmRecoilPattern RecoilPattern => Base is AutomaticFirearm auto ? auto._recoilPattern : null; + */ /// /// Gets a of and [] which contains all available attachments for all firearms. @@ -277,7 +288,9 @@ public void AddAttachment(AttachmentIdentifier identifier) : identifier.Code; Base.ApplyAttachmentsCode((Base.GetCurrentAttachmentsCode() & ~toRemove) | newCode, true); - Base.Status = new FirearmStatus(Math.Min(Ammo, MaxAmmo), Base.Status.Flags, Base.GetCurrentAttachmentsCode()); + + // TODO Not finish + // Base.Status = new FirearmStatus(Math.Min(Ammo, MaxAmmo), Base.Status.Flags, Base.GetCurrentAttachmentsCode()); } /// @@ -319,10 +332,12 @@ public void RemoveAttachment(AttachmentIdentifier identifier) Base.ApplyAttachmentsCode(Base.GetCurrentAttachmentsCode() & ~code, true); + // TODO: Not finish + /* if (identifier.Name == AttachmentName.Flashlight) Base.Status = new FirearmStatus(Math.Min(Ammo, MaxAmmo), Base.Status.Flags & ~FirearmStatusFlags.FlashlightEnabled, Base.GetCurrentAttachmentsCode()); else - Base.Status = new FirearmStatus(Math.Min(Ammo, MaxAmmo), Base.Status.Flags, Base.GetCurrentAttachmentsCode()); + Base.Status = new FirearmStatus(Math.Min(Ammo, MaxAmmo), Base.Status.Flags, Base.GetCurrentAttachmentsCode());*/ } /// @@ -335,10 +350,12 @@ public void RemoveAttachment(AttachmentName attachmentName) Base.ApplyAttachmentsCode(Base.GetCurrentAttachmentsCode() & ~code, true); + // TODO Not finish + /* if (attachmentName == AttachmentName.Flashlight) Base.Status = new FirearmStatus(Math.Min(Ammo, MaxAmmo), Base.Status.Flags & ~FirearmStatusFlags.FlashlightEnabled, Base.GetCurrentAttachmentsCode()); else - Base.Status = new FirearmStatus(Math.Min(Ammo, MaxAmmo), Base.Status.Flags, Base.GetCurrentAttachmentsCode()); + Base.Status = new FirearmStatus(Math.Min(Ammo, MaxAmmo), Base.Status.Flags, Base.GetCurrentAttachmentsCode());*/ } /// @@ -356,10 +373,12 @@ public void RemoveAttachment(AttachmentSlot attachmentSlot) Base.ApplyAttachmentsCode(Base.GetCurrentAttachmentsCode() & ~code, true); + // TODO Not finish + /* if (firearmAttachment.Name == AttachmentName.Flashlight) Base.Status = new FirearmStatus(Math.Min(Ammo, MaxAmmo), Base.Status.Flags & ~FirearmStatusFlags.FlashlightEnabled, Base.GetCurrentAttachmentsCode()); else - Base.Status = new FirearmStatus(Math.Min(Ammo, MaxAmmo), Base.Status.Flags, Base.GetCurrentAttachmentsCode()); + Base.Status = new FirearmStatus(Math.Min(Ammo, MaxAmmo), Base.Status.Flags, Base.GetCurrentAttachmentsCode());*/ } /// @@ -613,11 +632,13 @@ public override Item Clone() Ammo = Ammo, }; + // TODO Not finish + /* if (cloneableItem.Base is AutomaticFirearm) { cloneableItem.FireRate = FireRate; cloneableItem.Recoil = Recoil; - } + }*/ cloneableItem.AddAttachment(AttachmentIdentifiers); @@ -633,13 +654,15 @@ internal override void ChangeOwner(Player oldOwner, Player newOwner) { Base.Owner = newOwner.ReferenceHub; + // TODO: NOT FINISH + /* if (Base.HitregModule is StandardHitregBase hitReg) { hitReg.Hub = Base.Owner; } Base._sendStatusNextFrame = true; - Base._footprintValid = false; + Base._footprintValid = false;*/ } } } diff --git a/EXILED/Exiled.API/Features/Lift.cs b/EXILED/Exiled.API/Features/Lift.cs index 9a3b183c26..df032ff477 100644 --- a/EXILED/Exiled.API/Features/Lift.cs +++ b/EXILED/Exiled.API/Features/Lift.cs @@ -121,8 +121,8 @@ public Quaternion Rotation /// public ElevatorSequence Status { - get => Base._curSequence; - set => Base._curSequence = value; + get => Base.CurSequence; + set => Base.CurSequence = value; } /// @@ -162,7 +162,7 @@ public ElevatorSequence Status /// /// Gets a value indicating whether the lift is locked. /// - public bool IsLocked => Base.ActiveLocks > 0; + public bool IsLocked => Base.ActiveLocksAnyDoors > 0 || Base.ActiveLocksAllDoors > 0; /// /// Gets or sets the . @@ -196,12 +196,12 @@ public float AnimationTime /// /// Gets the . /// - public int CurrentLevel => Base.CurrentLevel; + public int CurrentLevel => Base.DestinationLevel; /// /// Gets the . /// - public Doors.ElevatorDoor CurrentDestination => Door.Get(Base.CurrentDestination); + public Doors.ElevatorDoor CurrentDestination => Door.Get(Base.DestinationDoor); /// /// Gets a of which contains all the instances from the specified . @@ -272,9 +272,8 @@ public static bool TryMeltPlayer(Player player) /// Tries to start the lift. /// /// The destination level. - /// Indicates whether the start will be forced or not. - /// if the lift was started successfully; otherwise, . - public bool TryStart(int level, bool isForced = false) => TrySetDestination(Group, level, isForced); + /// Allowing queing. + public void TryStart(int level, bool allowQueueing = false) => Base.ServerSetDestination(level, allowQueueing); /// /// Changes lock of the lift. @@ -295,12 +294,7 @@ public void ChangeLock(DoorLockReason lockReason) else { door.ChangeLock((DoorLockType)lockReason); - - if (CurrentLevel != 1) - TrySetDestination(Group, 1, true); } - - Base.RefreshLocks(Group, door.Base); } } diff --git a/EXILED/Exiled.API/Features/Map.cs b/EXILED/Exiled.API/Features/Map.cs index d0b31f3919..eaef01e59f 100644 --- a/EXILED/Exiled.API/Features/Map.cs +++ b/EXILED/Exiled.API/Features/Map.cs @@ -102,7 +102,7 @@ public static int Seed set { if (!SeedSynchronizer.MapGenerated) - SeedSynchronizer._singleton.Network_syncSeed = value; + SeedSynchronizer.Seed = value; } } @@ -121,7 +121,7 @@ public static bool IsDecontaminationEnabled /// /// Gets the . /// - public static AmbientSoundPlayer AmbientSoundPlayer => ambientSoundPlayer ??= ReferenceHub.HostHub.GetComponent(); + public static AmbientSoundPlayer AmbientSoundPlayer => ambientSoundPlayer ??= ReferenceHub._hostHub.GetComponent(); /// /// Gets the . @@ -319,7 +319,7 @@ public static void CleanAllRagdolls(IEnumerable ragDolls) /// /// The position of the blood decal. /// The direction of the blood decal. - public static void PlaceBlood(Vector3 position, Vector3 direction) => new GunDecalMessage(position, direction, DecalPoolType.Blood).SendToAuthenticated(0); + public static void PlaceBlood(Vector3 position, Vector3 direction) => _ = 0; /* new GunDecalMessage(position, direction, DecalPoolType.Blood).SendToAuthenticated(0);*/ // TODO: Not finish /// /// Gets all the near cameras. @@ -380,15 +380,17 @@ public static void ExplodeEffect(Vector3 position, ProjectileType projectileType /// The audio clip ID to play. public static void PlayGunSound(Vector3 position, ItemType firearmType, byte maxDistance = 45, byte audioClipId = 0) { + // TODO: Not finish + /* GunAudioMessage msg = new() { Weapon = firearmType, AudioClipId = audioClipId, MaxDistance = maxDistance, - ShooterHub = ReferenceHub.HostHub, + ShooterHub = ReferenceHub._hostHub, ShooterPosition = new RelativePosition(position), }; - msg.SendToAuthenticated(); + msg.SendToAuthenticated();*/ } /// diff --git a/EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs b/EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs index 112ae6a8b3..4b78d4b544 100644 --- a/EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs +++ b/EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs @@ -38,8 +38,10 @@ internal FirearmPickup(ItemType type) Base = (BaseFirearm)((Pickup)this).Base; IsDistributed = true; + // TODO not finish + /* if (type is ItemType.ParticleDisruptor && Status.Ammo == 0) - Status = new FirearmStatus(5, FirearmStatusFlags.MagazineInserted, 0); + Status = new FirearmStatus(5, FirearmStatusFlags.MagazineInserted, 0);*/ } /// @@ -50,12 +52,16 @@ internal FirearmPickup(ItemType type) /// /// Gets or sets a value indicating whether the pickup is already distributed. /// - public bool IsDistributed - { + public bool IsDistributed { get; set; } + + // TODO NOT FINISH + /*{ get => Base.Distributed; set => Base.Distributed = value; - } + }*/ + // TODO not finish +/* /// /// Gets or sets the . /// @@ -90,12 +96,12 @@ public uint Attachments { get => Base.NetworkStatus.Attachments; set => Base.NetworkStatus = new(Base.NetworkStatus.Ammo, Base.NetworkStatus.Flags, value); - } + }*/ /// /// Returns the FirearmPickup in a human readable format. /// /// A string containing FirearmPickup related data. - public override string ToString() => $"{Type} ({Serial}) [{Weight}] *{Scale}* |{IsDistributed}| -{Ammo}-"; + public override string ToString() => $"{Type} ({Serial}) [{Weight}] *{Scale}* |{IsDistributed}| -{/*Ammo*/0}-"; } } diff --git a/EXILED/Exiled.API/Features/Player.cs b/EXILED/Exiled.API/Features/Player.cs index 9e55712eef..2abf4c4890 100644 --- a/EXILED/Exiled.API/Features/Player.cs +++ b/EXILED/Exiled.API/Features/Player.cs @@ -39,6 +39,8 @@ namespace Exiled.API.Features using InventorySystem.Items.Firearms; using InventorySystem.Items.Firearms.Attachments; using InventorySystem.Items.Firearms.BasicMessages; + using InventorySystem.Items.Firearms.Modules; + using InventorySystem.Items.Firearms.ShotEvents; using InventorySystem.Items.Usables; using InventorySystem.Items.Usables.Scp330; using MapGeneration.Distributors; @@ -613,6 +615,8 @@ public ScpSpawnPreferences.SpawnPreferences ScpPreferences /// Players can be cuffed without another player being the cuffer. public bool IsCuffed => Inventory.IsDisarmed(); + // TODO NOT FINISH + /* /// /// Gets a value indicating whether or not the player is reloading a weapon. /// @@ -627,6 +631,7 @@ public ScpSpawnPreferences.SpawnPreferences ScpPreferences /// Gets a value indicating whether or not the player has enabled weapon's flashlight module. /// public bool HasFlashlightModuleEnabled => CurrentItem is Firearm firearm && firearm.FlashlightEnabled; + */ /// /// Gets a value indicating whether or not the player is jumping. @@ -1795,9 +1800,12 @@ public bool ReloadWeapon() { if (CurrentItem is Firearm firearm) { - bool result = firearm.Base.AmmoManagerModule.ServerTryReload(); + // TODO not finish + /* + bool result = firearm.Base.Ammo.ServerTryReload(); Connection.Send(new RequestMessage(firearm.Serial, RequestType.Reload)); return result; + */ } return false; @@ -2118,7 +2126,7 @@ public void Hurt(Player attacker, float amount, DamageType damageType = DamageTy /// The throw force. /// The armor penetration amount. public void Hurt(Player attacker, float damage, Vector3 force = default, int armorPenetration = 0) => - Hurt(new ExplosionDamageHandler(attacker.Footprint, force, damage, armorPenetration)); + Hurt(new ExplosionDamageHandler(attacker.Footprint, force, damage, armorPenetration, ExplosionType.Grenade)); /// /// Hurts the player. @@ -2221,7 +2229,7 @@ public void Vaporize(Player attacker = null, string cassieAnnouncement = "") if ((Role.Side != Side.Scp) && !string.IsNullOrEmpty(cassieAnnouncement)) Cassie.Message(cassieAnnouncement); - Kill(new DisruptorDamageHandler(attacker?.Footprint ?? Footprint, -1)); + Kill(new DisruptorDamageHandler(new DisruptorShotEvent(Item.Create(ItemType.ParticleDisruptor, attacker).Base as InventorySystem.Items.Firearms.Firearm, DisruptorActionModule.FiringState.FiringSingle), Vector3.up, -1)); } /// @@ -2652,12 +2660,15 @@ public Item AddItem(FirearmType firearmType, IEnumerable i else if (Preferences is not null && Preferences.TryGetValue(firearmType, out AttachmentIdentifier[] attachments)) firearm.Base.ApplyAttachmentsCode(attachments.GetAttachmentsCode(), true); + // TODO Not finish + /* FirearmStatusFlags flags = FirearmStatusFlags.MagazineInserted; if (firearm.Attachments.Any(a => a.Name == AttachmentName.Flashlight)) flags |= FirearmStatusFlags.FlashlightEnabled; firearm.Base.Status = new FirearmStatus(firearm.MaxAmmo, flags, firearm.Base.GetCurrentAttachmentsCode()); + */ } AddItem(item); @@ -2805,7 +2816,7 @@ public void AddItem(Firearm item, IEnumerable identifiers) /// /// The of the item to be added. /// The that was added. - public Item AddItem(Pickup pickup) => Item.Get(Inventory.ServerAddItem(pickup.Type, pickup.Serial, pickup.Base)); + public Item AddItem(Pickup pickup) => Item.Get(Inventory.ServerAddItem(pickup.Type, ItemAddReason.Undefined, pickup.Serial, pickup.Base)); /// /// Adds an item to the player's inventory. @@ -2815,7 +2826,7 @@ public void AddItem(Firearm item, IEnumerable identifiers) /// The that was added. public Item AddItem(FirearmPickup pickup, IEnumerable identifiers) { - Firearm firearm = Item.Get(Inventory.ServerAddItem(pickup.Type, pickup.Serial, pickup.Base)); + Firearm firearm = Item.Get(Inventory.ServerAddItem(pickup.Type, ItemAddReason.Undefined, pickup.Serial, pickup.Base)); if (identifiers is not null) firearm.AddAttachment(identifiers); @@ -3742,7 +3753,7 @@ public void SetCooldownItem(float time, ItemType itemType) /// /// Explode the player. /// - public void Explode() => ExplosionUtils.ServerExplode(ReferenceHub); + public void Explode() => ExplosionUtils.ServerExplode(ReferenceHub, ExplosionType.Grenade); /// /// Explode the player. diff --git a/EXILED/Exiled.API/Features/Ragdoll.cs b/EXILED/Exiled.API/Features/Ragdoll.cs index e1aefa56a0..2402340d95 100644 --- a/EXILED/Exiled.API/Features/Ragdoll.cs +++ b/EXILED/Exiled.API/Features/Ragdoll.cs @@ -117,7 +117,7 @@ public DamageHandlerBase DamageHandler /// /// Gets a value indicating whether or not the ragdoll has been already cleaned up. /// - public bool IsFrozen => Base._frozen; + public bool IsFrozen => Base.Frozen; /// /// Gets or sets a value indicating whether or not the ragdoll can be cleaned up. diff --git a/EXILED/Exiled.API/Features/Roles/Scp079Role.cs b/EXILED/Exiled.API/Features/Roles/Scp079Role.cs index 05334e3089..19b5a95bf2 100644 --- a/EXILED/Exiled.API/Features/Roles/Scp079Role.cs +++ b/EXILED/Exiled.API/Features/Roles/Scp079Role.cs @@ -593,7 +593,7 @@ public void ActivateTesla(bool consumeEnergy = true) Scp079Camera cam = CurrentCameraSync.CurrentCamera; RewardManager.MarkRoom(cam.Room); - if (!TeslaGateController.Singleton.TeslaGates.TryGetFirst(x => RoomIdUtils.IsTheSameRoom(cam.Position, x.transform.position), out global::TeslaGate teslaGate)) + if (!global::TeslaGate.AllGates.Find(x => RoomIdUtils.IsTheSameRoom(cam.Position, x.transform.position), out global::TeslaGate teslaGate)) return; if (consumeEnergy) diff --git a/EXILED/Exiled.API/Features/Round.cs b/EXILED/Exiled.API/Features/Round.cs index fb06a1b860..77933d8f31 100644 --- a/EXILED/Exiled.API/Features/Round.cs +++ b/EXILED/Exiled.API/Features/Round.cs @@ -44,12 +44,12 @@ public static class Round /// /// Gets a value indicating whether the round is started or not. /// - public static bool IsStarted => ReferenceHub.LocalHub?.characterClassManager.RoundStarted ?? false; + public static bool IsStarted => ReferenceHub.TryGetHostHub(out ReferenceHub hub) && hub.characterClassManager.RoundStarted; /// /// Gets a value indicating whether the round in progress or not. /// - public static bool InProgress => ReferenceHub.LocalHub != null && RoundSummary.RoundInProgress(); + public static bool InProgress => ReferenceHub._localHubSet && RoundSummary.RoundInProgress(); /// /// Gets a value indicating whether the round is ended or not. diff --git a/EXILED/Exiled.API/Features/Toys/AdminToy.cs b/EXILED/Exiled.API/Features/Toys/AdminToy.cs index 5287096a1b..675afcf645 100644 --- a/EXILED/Exiled.API/Features/Toys/AdminToy.cs +++ b/EXILED/Exiled.API/Features/Toys/AdminToy.cs @@ -98,7 +98,7 @@ public Quaternion Rotation set { AdminToyBase.transform.rotation = value; - AdminToyBase.NetworkRotation = new LowPrecisionQuaternion(value); + AdminToyBase.NetworkRotation = value; } } diff --git a/EXILED/Exiled.API/Features/Window.cs b/EXILED/Exiled.API/Features/Window.cs index 63ca362fdd..fc526daf71 100644 --- a/EXILED/Exiled.API/Features/Window.cs +++ b/EXILED/Exiled.API/Features/Window.cs @@ -132,10 +132,10 @@ public bool DisableScpDamage /// /// Gets or sets a value indicating whether or not this window is broken. /// - public BreakableWindow.BreakableWindowStatus SyncStatus + public bool SyncStatus { - get => Base.NetworksyncStatus; - set => Base.NetworksyncStatus = value; + get => Base.prevStatus; + set => Base.prevStatus = value; } /// diff --git a/EXILED/Exiled.Events/Patches/Generic/LiftList.cs b/EXILED/Exiled.Events/Patches/Generic/LiftList.cs index f1f9a058b9..7a15548134 100644 --- a/EXILED/Exiled.Events/Patches/Generic/LiftList.cs +++ b/EXILED/Exiled.Events/Patches/Generic/LiftList.cs @@ -24,7 +24,7 @@ private static void Postfix() { Lift.ElevatorChamberToLift.Clear(); - foreach (KeyValuePair lift in ElevatorManager.SpawnedChambers) + foreach (KeyValuePair lift in ElevatorManager.SpawnedChambers) { _ = new Lift(lift.Value); } From f32c003da1491c00449baae7785e09061ed1166b Mon Sep 17 00:00:00 2001 From: Yamato Date: Wed, 30 Oct 2024 23:25:40 +0100 Subject: [PATCH 02/29] i can't do more --- .../EventArgs/Scp330/InteractingScp330EventArgs.cs | 1 - .../Patches/Fixes/Scp3114FriendlyFireFix.cs | 4 ++++ EXILED/Exiled.Events/Patches/Generic/LiftList.cs | 10 ++++------ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/EXILED/Exiled.Events/EventArgs/Scp330/InteractingScp330EventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp330/InteractingScp330EventArgs.cs index cd4d4922fd..b1442fe785 100644 --- a/EXILED/Exiled.Events/EventArgs/Scp330/InteractingScp330EventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Scp330/InteractingScp330EventArgs.cs @@ -12,7 +12,6 @@ namespace Exiled.Events.EventArgs.Scp330 using Interfaces; using InventorySystem.Items.Usables.Scp330; - using YamlDotNet.Core.Tokens; /// /// Contains all information before a player interacts with SCP-330. diff --git a/EXILED/Exiled.Events/Patches/Fixes/Scp3114FriendlyFireFix.cs b/EXILED/Exiled.Events/Patches/Fixes/Scp3114FriendlyFireFix.cs index 70eca7fba4..07f9908489 100644 --- a/EXILED/Exiled.Events/Patches/Fixes/Scp3114FriendlyFireFix.cs +++ b/EXILED/Exiled.Events/Patches/Fixes/Scp3114FriendlyFireFix.cs @@ -95,6 +95,10 @@ public Scp3114FriendlyFireFix2(Footprint attacker, float damage) public override float Damage { get; set; } public override string ServerLogsText { get; } + + public override string RagdollInspectText { get; } + + public override string DeathScreenText { get; } #pragma warning restore SA1600 // Elements should be documented private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) diff --git a/EXILED/Exiled.Events/Patches/Generic/LiftList.cs b/EXILED/Exiled.Events/Patches/Generic/LiftList.cs index 7a15548134..b2cf4609e6 100644 --- a/EXILED/Exiled.Events/Patches/Generic/LiftList.cs +++ b/EXILED/Exiled.Events/Patches/Generic/LiftList.cs @@ -7,26 +7,24 @@ namespace Exiled.Events.Patches.Generic { - using System.Collections.Generic; - using API.Features; using HarmonyLib; using Interactables.Interobjects; /// - /// Patches . + /// Patches . /// - [HarmonyPatch(typeof(ElevatorManager), nameof(ElevatorManager.RefreshChambers))] + [HarmonyPatch(typeof(ElevatorManager), nameof(ElevatorManager.SpawnAllChambers))] internal class LiftList { private static void Postfix() { Lift.ElevatorChamberToLift.Clear(); - foreach (KeyValuePair lift in ElevatorManager.SpawnedChambers) + foreach (ElevatorChamber lift in ElevatorChamber.AllChambers) { - _ = new Lift(lift.Value); + _ = new Lift(lift); } } } From 09ef74469585465942fc432e8ad723d875ae544d Mon Sep 17 00:00:00 2001 From: Yamato Date: Thu, 31 Oct 2024 12:58:56 +0100 Subject: [PATCH 03/29] more --- EXILED/Exiled.API/Features/Items/Firearm.cs | 11 ++++++----- .../Map/PlacingBulletHoleEventArgs.cs | 19 +++++++++++++------ .../Handlers/Internal/MapGenerated.cs | 4 +--- .../Patches/Events/Map/PlacingBulletHole.cs | 18 +++++++----------- .../Fixes/WeaponAttachmentDesyncFix.cs | 6 ++++-- 5 files changed, 31 insertions(+), 27 deletions(-) diff --git a/EXILED/Exiled.API/Features/Items/Firearm.cs b/EXILED/Exiled.API/Features/Items/Firearm.cs index f410827d1d..f2cd70aae0 100644 --- a/EXILED/Exiled.API/Features/Items/Firearm.cs +++ b/EXILED/Exiled.API/Features/Items/Firearm.cs @@ -160,18 +160,20 @@ public int MaxAmmo // TODO not finish Base.AmmoType.GetAmmoType(); public AmmoType AmmoType => AmmoType.None; - // TODO Not finish + // TODO: Not finish /* /// /// Gets a value indicating whether the firearm is being aimed. /// - public bool Aiming => Base.AdsModule.ServerAds; + public bool Aiming => Base.IsAiming;*/ /// /// Gets a value indicating whether the firearm's flashlight module is enabled. /// - public bool FlashlightEnabled => Base.Status.Flags.HasFlagFast(FirearmStatusFlags.FlashlightEnabled); + public bool FlashlightEnabled => Base.IsEmittingLight; + // TODO NOT FINISH + /* /// /// Gets a value indicating whether the firearm's NightVision is being used. /// @@ -185,8 +187,7 @@ public int MaxAmmo /// /// Gets a value indicating whether or not the firearm is automatic. /// - public bool IsAutomatic => Base is AutomaticFirearm; - */ + public bool IsAutomatic => Base is AutomaticFirearm;*/ /// /// Gets the s of the firearm. diff --git a/EXILED/Exiled.Events/EventArgs/Map/PlacingBulletHoleEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/PlacingBulletHoleEventArgs.cs index 8e237af27e..a1f4d21ca3 100644 --- a/EXILED/Exiled.Events/EventArgs/Map/PlacingBulletHoleEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Map/PlacingBulletHoleEventArgs.cs @@ -8,7 +8,7 @@ namespace Exiled.Events.EventArgs.Map { using API.Features; - + using Exiled.API.Features.Items; using Interfaces; using UnityEngine; @@ -16,20 +16,21 @@ namespace Exiled.Events.EventArgs.Map /// /// Contains all information before placing a bullet hole decal. /// - public class PlacingBulletHoleEventArgs : IPlayerEvent, IDeniableEvent + public class PlacingBulletHoleEventArgs : IFirearmEvent, IPlayerEvent, IDeniableEvent { /// /// Initializes a new instance of the class. /// - /// - /// + /// + /// /// /// /// /// - public PlacingBulletHoleEventArgs(Player owner, RaycastHit hit) + public PlacingBulletHoleEventArgs(Firearm firearm, RaycastHit hit) { - Player = owner; + Firearm = firearm; + Player = Firearm.Owner; Position = hit.point; Rotation = Quaternion.LookRotation(hit.normal); } @@ -53,5 +54,11 @@ public PlacingBulletHoleEventArgs(Player owner, RaycastHit hit) /// Gets the decal owner. /// public Player Player { get; } + + /// + public Firearm Firearm { get; } + + /// + public Item Item => Firearm; } } \ No newline at end of file diff --git a/EXILED/Exiled.Events/Handlers/Internal/MapGenerated.cs b/EXILED/Exiled.Events/Handlers/Internal/MapGenerated.cs index 30ad47c9f0..44374c9427 100644 --- a/EXILED/Exiled.Events/Handlers/Internal/MapGenerated.cs +++ b/EXILED/Exiled.Events/Handlers/Internal/MapGenerated.cs @@ -90,9 +90,7 @@ private static void GenerateAttachments() } uint baseCode = 0; - - attachmentsSlots - .ForEach(slot => baseCode += attachmentIdentifiers + attachmentsSlots.ForEach(slot => baseCode += attachmentIdentifiers .Where(attachment => attachment.Slot == slot) .Min(slot => slot.Code)); diff --git a/EXILED/Exiled.Events/Patches/Events/Map/PlacingBulletHole.cs b/EXILED/Exiled.Events/Patches/Events/Map/PlacingBulletHole.cs index 9431ddb4df..6afd818ac2 100644 --- a/EXILED/Exiled.Events/Patches/Events/Map/PlacingBulletHole.cs +++ b/EXILED/Exiled.Events/Patches/Events/Map/PlacingBulletHole.cs @@ -11,16 +11,12 @@ namespace Exiled.Events.Patches.Events.Map using System.Reflection.Emit; using API.Features.Pools; - + using Decals; using Exiled.Events.Attributes; using Exiled.Events.EventArgs.Map; - using Handlers; - using HarmonyLib; - using InventorySystem.Items.Firearms.Modules; - using UnityEngine; using static HarmonyLib.AccessTools; @@ -28,11 +24,11 @@ namespace Exiled.Events.Patches.Events.Map using Player = API.Features.Player; /// - /// Patches . + /// Patches . /// Adds the event. /// [EventPatch(typeof(Map), nameof(Map.PlacingBulletHole))] - [HarmonyPatch(typeof(StandardHitregBase), nameof(StandardHitregBase.PlaceBulletholeDecal))] + [HarmonyPatch(typeof(ImpactEffectsModule), nameof(ImpactEffectsModule.ServerSendImpactDecal))] internal static class PlacingBulletHole { private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) @@ -48,15 +44,15 @@ private static IEnumerable Transpiler(IEnumerable - /// Patches . + /// Patches . /// Fixes if a plugin gives you an weapon that you do not have ammo for, your attachments will not correctly appear on said weapon. /// [HarmonyPatch(typeof(AttachmentsServerHandler), nameof(AttachmentsServerHandler.SetupProvidedWeapon))] @@ -98,5 +100,5 @@ private static IEnumerable Transpiler(IEnumerable.Pool.Return(newInstructions); } - } + }*/ } \ No newline at end of file From ab3755b7afda4ca4e126e3231d3b2bf1741ecaa4 Mon Sep 17 00:00:00 2001 From: Yamato Date: Thu, 31 Oct 2024 13:22:12 +0100 Subject: [PATCH 04/29] temporary --- EXILED/Exiled.API/Exiled.API.csproj | 1 + EXILED/Exiled.API/Features/Toys/AdminToy.cs | 1 + EXILED/Exiled.API/Features/Toys/Speaker.cs | 12 ++++++++++++ 3 files changed, 14 insertions(+) create mode 100644 EXILED/Exiled.API/Features/Toys/Speaker.cs diff --git a/EXILED/Exiled.API/Exiled.API.csproj b/EXILED/Exiled.API/Exiled.API.csproj index e0949b7fff..edcf8d9032 100644 --- a/EXILED/Exiled.API/Exiled.API.csproj +++ b/EXILED/Exiled.API/Exiled.API.csproj @@ -28,6 +28,7 @@ + $(EXILED_REFERENCES)\netstandard.dl diff --git a/EXILED/Exiled.API/Features/Toys/AdminToy.cs b/EXILED/Exiled.API/Features/Toys/AdminToy.cs index 675afcf645..c6b913029a 100644 --- a/EXILED/Exiled.API/Features/Toys/AdminToy.cs +++ b/EXILED/Exiled.API/Features/Toys/AdminToy.cs @@ -155,6 +155,7 @@ public static AdminToy Get(AdminToyBase adminToyBase) LightSourceToy lightSourceToy => new Light(lightSourceToy), PrimitiveObjectToy primitiveObjectToy => new Primitive(primitiveObjectToy), ShootingTarget shootingTarget => new ShootingTargetToy(shootingTarget), + SpeakerToy speakerToy => new Speaker(speakerToy), _ => throw new System.NotImplementedException() }; } diff --git a/EXILED/Exiled.API/Features/Toys/Speaker.cs b/EXILED/Exiled.API/Features/Toys/Speaker.cs new file mode 100644 index 0000000000..fd8a3d0c15 --- /dev/null +++ b/EXILED/Exiled.API/Features/Toys/Speaker.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Exiled.API.Features.Toys +{ + internal class Speaker + { + } +} From fc868dc4612c81aecf8976d3f13a89fb1f097e2f Mon Sep 17 00:00:00 2001 From: Yamato Date: Thu, 31 Oct 2024 13:33:05 +0100 Subject: [PATCH 05/29] Speaker --- EXILED/Exiled.API/Features/Toys/Speaker.cs | 84 ++++++++++++++++++++-- 1 file changed, 78 insertions(+), 6 deletions(-) diff --git a/EXILED/Exiled.API/Features/Toys/Speaker.cs b/EXILED/Exiled.API/Features/Toys/Speaker.cs index fd8a3d0c15..ef281397ab 100644 --- a/EXILED/Exiled.API/Features/Toys/Speaker.cs +++ b/EXILED/Exiled.API/Features/Toys/Speaker.cs @@ -1,12 +1,84 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +// ----------------------------------------------------------------------- +// +// Copyright (c) Exiled Team. All rights reserved. +// Licensed under the CC BY-SA 3.0 license. +// +// ----------------------------------------------------------------------- namespace Exiled.API.Features.Toys { - internal class Speaker + using AdminToys; + + using Enums; + using Exiled.API.Interfaces; + + /// + /// A wrapper class for . + /// + public class Speaker : AdminToy, IWrapper { + /// + /// Initializes a new instance of the class. + /// + /// The of the toy. + internal Speaker(SpeakerToy speakerToy) + : base(speakerToy, AdminToyType.Speaker) => Base = speakerToy; + + /// + /// Gets the base . + /// + public SpeakerToy Base { get; } + + /// + /// Gets or sets the volume of the audio source. + /// + /// + /// A representing the volume level of the audio source, + /// where 0.0 is silent and 1.0 is full volume. + /// + public float Volume + { + get => Base.NetworkVolume; + set => Base.NetworkVolume = value; + } + + /// + /// Gets or sets a value indicating whether the audio source is spatialized. + /// + /// + /// A where true means the audio source is spatial, allowing + /// for 3D audio positioning relative to the listener; false means it is non-spatial. + /// + public bool IsSpatial + { + get => Base.NetworkIsSpatial; + set => Base.NetworkIsSpatial = value; + } + + /// + /// Gets or sets the maximum distance at which the audio source can be heard. + /// + /// + /// A representing the maximum hearing distance for the audio source. + /// Beyond this distance, the audio will not be audible. + /// + public float MaxDistance + { + get => Base.NetworkMaxDistance; + set => Base.NetworkMaxDistance = value; + } + + /// + /// Gets or sets the minimum distance at which the audio source reaches full volume. + /// + /// + /// A representing the distance from the source at which the audio is heard at full volume. + /// Within this range, volume will not decrease with proximity. + /// + public float MinDistance + { + get => Base.NetworkMinDistance; + set => Base.NetworkMinDistance = value; + } } } From 3f2172cd2fa61b6e3a9c6da4ac749e8ad1dbfb06 Mon Sep 17 00:00:00 2001 From: Yamato Date: Thu, 31 Oct 2024 13:38:29 +0100 Subject: [PATCH 06/29] More propperty --- EXILED/Exiled.API/Enums/AdminToyType.cs | 5 +++ EXILED/Exiled.API/Exiled.API.csproj | 1 - EXILED/Exiled.API/Features/Toys/Light.cs | 42 ++++++++++++++++++++++-- 3 files changed, 44 insertions(+), 4 deletions(-) diff --git a/EXILED/Exiled.API/Enums/AdminToyType.cs b/EXILED/Exiled.API/Enums/AdminToyType.cs index 6a4f1324a4..0eb3e1884f 100644 --- a/EXILED/Exiled.API/Enums/AdminToyType.cs +++ b/EXILED/Exiled.API/Enums/AdminToyType.cs @@ -27,5 +27,10 @@ public enum AdminToyType /// ShootingTarget toy. /// ShootingTarget, + + /// + /// Speaker toy. + /// + Speaker, } } \ No newline at end of file diff --git a/EXILED/Exiled.API/Exiled.API.csproj b/EXILED/Exiled.API/Exiled.API.csproj index edcf8d9032..e0949b7fff 100644 --- a/EXILED/Exiled.API/Exiled.API.csproj +++ b/EXILED/Exiled.API/Exiled.API.csproj @@ -28,7 +28,6 @@ - $(EXILED_REFERENCES)\netstandard.dl diff --git a/EXILED/Exiled.API/Features/Toys/Light.cs b/EXILED/Exiled.API/Features/Toys/Light.cs index e484c9e042..eb2fe4056c 100644 --- a/EXILED/Exiled.API/Features/Toys/Light.cs +++ b/EXILED/Exiled.API/Features/Toys/Light.cs @@ -55,6 +55,33 @@ public float Range set => Base.NetworkLightRange = value; } + /// + /// Gets or sets the angle of the light. + /// + public float SpotAngle + { + get => Base.NetworkSpotAngle; + set => Base.NetworkSpotAngle = value; + } + + /// + /// Gets or sets the inner angle of the light. + /// + public float InnerSpotAngle + { + get => Base.NetworkInnerSpotAngle; + set => Base.NetworkInnerSpotAngle = value; + } + + /// + /// Gets or sets the shadow strength of the light. + /// + public float ShadowStrength + { + get => Base.NetworkShadowStrength; + set => Base.NetworkShadowStrength = value; + } + /// /// Gets or sets the color of the primitive. /// @@ -67,10 +94,19 @@ public Color Color /// /// Gets or sets a value indicating whether the light should cause shadows from other objects. /// - public bool ShadowEmission + public LightShape LightShape + { + get => Base.NetworkLightShape; + set => Base.NetworkLightShape = value; + } + + /// + /// Gets or sets a value indicating whether the light should cause shadows from other objects. + /// + public LightType LightType { - get => Base.NetworkLightShadows; - set => Base.NetworkLightShadows = value; + get => Base.NetworkLightType; + set => Base.NetworkLightType = value; } /// From 23f7cc7f91806f313590ebd78bd481298746bd83 Mon Sep 17 00:00:00 2001 From: Yamato Date: Thu, 31 Oct 2024 14:35:53 +0100 Subject: [PATCH 07/29] Panel Change --- EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs b/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs index a9e9aeca4d..a1838bd226 100644 --- a/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs +++ b/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs @@ -12,6 +12,7 @@ namespace Exiled.API.Features.Doors using Exiled.API.Enums; using Interactables.Interobjects; + using Interactables.Interobjects.DoorUtils; /// /// Represents an elevator door. @@ -55,9 +56,14 @@ internal ElevatorDoor(Interactables.Interobjects.ElevatorDoor door, List r }; /// - /// Gets the target panel for this lift. + /// Gets the target panel settings for this lift. /// - public ElevatorPanel Panel => Base.PanelSettings; + public PanelVisualSettings PanelSettings => Base.PanelSettings; + + /// + /// Gets if the panel is permanent. + /// + public bool PermanentPanels => Base.PermanentPanels; /// /// Gets the associated with this elevator door. From 65b67191ec0bbc7ebfd7fc2ed12dcd76a9a7f39b Mon Sep 17 00:00:00 2001 From: Yamato Date: Thu, 31 Oct 2024 16:01:29 +0100 Subject: [PATCH 08/29] i don't find more to do --- EXILED/EXILED.props | 2 +- EXILED/Exiled.API/Extensions/ItemExtensions.cs | 5 +++-- .../Features/Components/CollisionHandler.cs | 6 ++++-- EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs | 2 +- EXILED/Exiled.API/Features/Toys/Light.cs | 11 ++++++----- EXILED/Exiled.CreditTags/Exiled.CreditTags.csproj | 2 -- 6 files changed, 15 insertions(+), 13 deletions(-) diff --git a/EXILED/EXILED.props b/EXILED/EXILED.props index c496e96ba6..dd5b27d7e7 100644 --- a/EXILED/EXILED.props +++ b/EXILED/EXILED.props @@ -15,7 +15,7 @@ - 8.12.2 + 8.13.0 false diff --git a/EXILED/Exiled.API/Extensions/ItemExtensions.cs b/EXILED/Exiled.API/Extensions/ItemExtensions.cs index 2aa7c90fc0..57eaed961e 100644 --- a/EXILED/Exiled.API/Extensions/ItemExtensions.cs +++ b/EXILED/Exiled.API/Extensions/ItemExtensions.cs @@ -18,6 +18,7 @@ namespace Exiled.API.Extensions using InventorySystem; using InventorySystem.Items; using InventorySystem.Items.Firearms.Attachments; + using InventorySystem.Items.Firearms.Modules; using InventorySystem.Items.Pickups; using Structs; @@ -123,12 +124,12 @@ public static T GetItemBase(this ItemType type) /// /// The weapon that you want to get maximum of. /// Returns the maximum. - public static byte GetMaxAmmo(this FirearmType item) + public static int GetMaxAmmo(this FirearmType item) { if (!InventoryItemLoader.AvailableItems.TryGetValue(item.GetItemType(), out ItemBase itemBase) || itemBase is not InventorySystem.Items.Firearms.Firearm firearm) return 0; - return firearm.AmmoManagerModule.MaxAmmo; + return (firearm.Modules.FirstOrDefault(x => x is IAmmoContainerModule) as IAmmoContainerModule).AmmoMax; } /// diff --git a/EXILED/Exiled.API/Features/Components/CollisionHandler.cs b/EXILED/Exiled.API/Features/Components/CollisionHandler.cs index db956103b2..25f9e7a18f 100644 --- a/EXILED/Exiled.API/Features/Components/CollisionHandler.cs +++ b/EXILED/Exiled.API/Features/Components/CollisionHandler.cs @@ -56,9 +56,11 @@ private void OnCollisionEnter(Collision collision) Log.Error("Grenade is null!"); if (collision is null) Log.Error("wat"); - if (collision.gameObject == null) + if (collision.collider) + Log.Error("water"); + if (collision.collider.gameObject == null) Log.Error("pepehm"); - if (collision.gameObject == Owner || collision.gameObject.TryGetComponent(out _)) + if (collision.collider.gameObject == Owner || collision.collider.gameObject.TryGetComponent(out _)) return; Grenade.TargetTime = 0.1f; diff --git a/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs b/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs index a1838bd226..45f2f2b08c 100644 --- a/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs +++ b/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs @@ -61,7 +61,7 @@ internal ElevatorDoor(Interactables.Interobjects.ElevatorDoor door, List r public PanelVisualSettings PanelSettings => Base.PanelSettings; /// - /// Gets if the panel is permanent. + /// Gets a value indicating whether gets the panel is permanent. /// public bool PermanentPanels => Base.PermanentPanels; diff --git a/EXILED/Exiled.API/Features/Toys/Light.cs b/EXILED/Exiled.API/Features/Toys/Light.cs index eb2fe4056c..315c001e30 100644 --- a/EXILED/Exiled.API/Features/Toys/Light.cs +++ b/EXILED/Exiled.API/Features/Toys/Light.cs @@ -131,11 +131,12 @@ public static Light Create(Vector3? position = null, Vector3? rotation = null, V /// The new . public static Light Create(Vector3? position /*= null*/, Vector3? rotation /*= null*/, Vector3? scale /*= null*/, bool spawn /*= true*/, Color? color /*= null*/) { - Light light = new(UnityEngine.Object.Instantiate(ToysHelper.LightBaseObject)); - - light.Position = position ?? Vector3.zero; - light.Rotation = Quaternion.Euler(rotation ?? Vector3.zero); - light.Scale = scale ?? Vector3.one; + Light light = new(UnityEngine.Object.Instantiate(ToysHelper.LightBaseObject)) + { + Position = position ?? Vector3.zero, + Rotation = Quaternion.Euler(rotation ?? Vector3.zero), + Scale = scale ?? Vector3.one, + }; if (spawn) light.Spawn(); diff --git a/EXILED/Exiled.CreditTags/Exiled.CreditTags.csproj b/EXILED/Exiled.CreditTags/Exiled.CreditTags.csproj index adc9595c83..9382489fb3 100644 --- a/EXILED/Exiled.CreditTags/Exiled.CreditTags.csproj +++ b/EXILED/Exiled.CreditTags/Exiled.CreditTags.csproj @@ -43,6 +43,4 @@ if [[ ! -z "$EXILED_DEV_REFERENCES" ]]; then cp "$(OutputPath)$(AssemblyName).dll" "$EXILED_DEV_REFERENCES/Plugins/"; fi - - From efc9b16b739ba21ed4b037ccd082ea3db5363a89 Mon Sep 17 00:00:00 2001 From: Yamato Date: Thu, 31 Oct 2024 16:46:51 +0100 Subject: [PATCH 09/29] PitKiller --- .../Patches/Events/Player/EnteringKillerCollision.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EXILED/Exiled.Events/Patches/Events/Player/EnteringKillerCollision.cs b/EXILED/Exiled.Events/Patches/Events/Player/EnteringKillerCollision.cs index 3f277f3ad2..daf74337b5 100644 --- a/EXILED/Exiled.Events/Patches/Events/Player/EnteringKillerCollision.cs +++ b/EXILED/Exiled.Events/Patches/Events/Player/EnteringKillerCollision.cs @@ -19,11 +19,11 @@ namespace Exiled.Events.Patches.Events.Player using static HarmonyLib.AccessTools; /// - /// Patches . + /// Patches . /// Adds the event. /// [EventPatch(typeof(Handlers.Player), nameof(Handlers.Player.EnteringKillerCollision))] - [HarmonyPatch(typeof(CheckpointKiller), nameof(CheckpointKiller.OnTriggerEnter))] + [HarmonyPatch(typeof(PitKiller), nameof(PitKiller.OnTriggerEnter))] internal static class EnteringKillerCollision { private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) From 7f7801991a747471df1c05c2656f5f0f790b9311 Mon Sep 17 00:00:00 2001 From: Yamato Date: Tue, 5 Nov 2024 20:48:08 +0100 Subject: [PATCH 10/29] . --- EXILED/Exiled.API/Features/Player.cs | 2 +- EXILED/Exiled.Events/Patches/Events/Player/Shot.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/EXILED/Exiled.API/Features/Player.cs b/EXILED/Exiled.API/Features/Player.cs index 2abf4c4890..cc35166657 100644 --- a/EXILED/Exiled.API/Features/Player.cs +++ b/EXILED/Exiled.API/Features/Player.cs @@ -626,12 +626,12 @@ public ScpSpawnPreferences.SpawnPreferences ScpPreferences /// Gets a value indicating whether or not the player is aiming with a weapon. /// public bool IsAimingDownWeapon => CurrentItem is Firearm firearm && firearm.Aiming; + */ /// /// Gets a value indicating whether or not the player has enabled weapon's flashlight module. /// public bool HasFlashlightModuleEnabled => CurrentItem is Firearm firearm && firearm.FlashlightEnabled; - */ /// /// Gets a value indicating whether or not the player is jumping. diff --git a/EXILED/Exiled.Events/Patches/Events/Player/Shot.cs b/EXILED/Exiled.Events/Patches/Events/Player/Shot.cs index ff34d42a39..b0a3c97845 100644 --- a/EXILED/Exiled.Events/Patches/Events/Player/Shot.cs +++ b/EXILED/Exiled.Events/Patches/Events/Player/Shot.cs @@ -165,7 +165,7 @@ private static IEnumerable Transpiler(IEnumerable Transpiler(IEnumerable Date: Sat, 16 Nov 2024 21:23:18 +0100 Subject: [PATCH 11/29] ExtraTargetCount --- EXILED/Exiled.API/Features/Round.cs | 8 ++++---- EXILED/Exiled.API/Features/Warhead.cs | 2 +- EXILED/Exiled.Events/Patches/Events/Server/RoundEnd.cs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/EXILED/Exiled.API/Features/Round.cs b/EXILED/Exiled.API/Features/Round.cs index 77933d8f31..7777308791 100644 --- a/EXILED/Exiled.API/Features/Round.cs +++ b/EXILED/Exiled.API/Features/Round.cs @@ -68,12 +68,12 @@ public static class Round public static RoundSummary.SumInfo_ClassList LastClassList { get; internal set; } /// - /// Gets or sets a value indicating the amount of Chaos Targets remaining. + /// Gets or sets a value indicating the amount of Extra Targets remaining. /// - public static int ChaosTargetCount + public static int ExtraTargetCount { - get => RoundSummary.singleton.Network_chaosTargetCount; - set => RoundSummary.singleton.Network_chaosTargetCount = value; + get => RoundSummary.singleton.Network_extraTargets; + set => RoundSummary.singleton.Network_extraTargets = value; } /// diff --git a/EXILED/Exiled.API/Features/Warhead.cs b/EXILED/Exiled.API/Features/Warhead.cs index 241d94c735..6184ba4d1f 100644 --- a/EXILED/Exiled.API/Features/Warhead.cs +++ b/EXILED/Exiled.API/Features/Warhead.cs @@ -113,7 +113,7 @@ public static WarheadStatus Status /// /// Gets a value indicating whether or not the warhead has already been detonated. /// - public static bool IsDetonated => Controller._alreadyDetonated; + public static bool IsDetonated => Controller.AlreadyDetonated; /// /// Gets a value indicating whether or not the warhead detonation is in progress. diff --git a/EXILED/Exiled.Events/Patches/Events/Server/RoundEnd.cs b/EXILED/Exiled.Events/Patches/Events/Server/RoundEnd.cs index 53b8d446bd..d13edb7e5f 100644 --- a/EXILED/Exiled.Events/Patches/Events/Server/RoundEnd.cs +++ b/EXILED/Exiled.Events/Patches/Events/Server/RoundEnd.cs @@ -68,9 +68,9 @@ private static IEnumerable Transpiler(IEnumerable x.Calls(PropertyGetter(typeof(RoundSummary), nameof(RoundSummary.ChaosTargetCount)))) + offset; + index = newInstructions.FindIndex(x => x.Calls(PropertyGetter(typeof(RoundSummary), nameof(RoundSummary.Network_extraTargets)))) + offset; Label label = (Label)newInstructions[index].operand; newInstructions.RemoveAt(index); From fc5b384a1664a78b42569586323f5a2eba00955c Mon Sep 17 00:00:00 2001 From: Yamato Date: Mon, 25 Nov 2024 22:07:56 +0100 Subject: [PATCH 12/29] Nuke --- EXILED/Exiled.API/Features/Doors/Door.cs | 2 +- EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/EXILED/Exiled.API/Features/Doors/Door.cs b/EXILED/Exiled.API/Features/Doors/Door.cs index 3102856420..315142c53f 100644 --- a/EXILED/Exiled.API/Features/Doors/Door.cs +++ b/EXILED/Exiled.API/Features/Doors/Door.cs @@ -614,7 +614,7 @@ private DoorType GetDoorType() }, "Elevator" => (Base as Interactables.Interobjects.ElevatorDoor)?.Group switch { - ElevatorGroup.Nuke => DoorType.ElevatorNuke, + ElevatorGroup.Nuke01 or ElevatorGroup.Nuke02 => DoorType.ElevatorNuke, ElevatorGroup.Scp049 => DoorType.ElevatorScp049, ElevatorGroup.GateB => DoorType.ElevatorGateB, ElevatorGroup.GateA => DoorType.ElevatorGateA, diff --git a/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs b/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs index ddf2722605..fdbde23487 100644 --- a/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs +++ b/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs @@ -51,7 +51,7 @@ internal ElevatorDoor(Interactables.Interobjects.ElevatorDoor door, List r ElevatorGroup.GateB => ElevatorType.GateB, ElevatorGroup.LczA01 or ElevatorGroup.LczA02 => ElevatorType.LczA, ElevatorGroup.LczB01 or ElevatorGroup.LczB02 => ElevatorType.LczB, - ElevatorGroup.Nuke => ElevatorType.Nuke, + ElevatorGroup.Nuke01 or ElevatorGroup.Nuke02 => ElevatorType.Nuke, _ => ElevatorType.Unknown, }; From da29f33431749782846f6c04975305770989dabb Mon Sep 17 00:00:00 2001 From: Yamato Date: Mon, 25 Nov 2024 22:17:08 +0100 Subject: [PATCH 13/29] fix error --- EXILED/Exiled.API/Features/Roles/Scp106Role.cs | 10 +++++----- .../Patches/Fixes/Scp3114FriendlyFireFix.cs | 3 --- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/EXILED/Exiled.API/Features/Roles/Scp106Role.cs b/EXILED/Exiled.API/Features/Roles/Scp106Role.cs index 24ff42992e..86b6f16a2d 100644 --- a/EXILED/Exiled.API/Features/Roles/Scp106Role.cs +++ b/EXILED/Exiled.API/Features/Roles/Scp106Role.cs @@ -254,10 +254,10 @@ public float CaptureCooldown /// public float RemainingSinkholeCooldown { - get => SinkholeController.Cooldown.Remaining; + get => SinkholeController._submergeCooldown.Remaining; set { - SinkholeController.Cooldown.Remaining = value; + SinkholeController._submergeCooldown.Remaining = value; SinkholeController.ServerSendRpc(true); } } @@ -267,8 +267,8 @@ public float RemainingSinkholeCooldown /// public bool IsStalking { - get => StalkAbility.IsActive; - set => StalkAbility.IsActive = value; + get => StalkAbility.StalkActive; + set => StalkAbility.ServerSetStalk(value); } /// @@ -294,7 +294,7 @@ public bool UsePortal(Vector3 position, float cost = 0f) return false; HuntersAtlasAbility._estimatedCost = cost; - HuntersAtlasAbility.SetSubmerged(true); + HuntersAtlasAbility._syncSubmerged = true; return true; } diff --git a/EXILED/Exiled.Events/Patches/Fixes/Scp3114FriendlyFireFix.cs b/EXILED/Exiled.Events/Patches/Fixes/Scp3114FriendlyFireFix.cs index 7dc45195df..79aba61f51 100644 --- a/EXILED/Exiled.Events/Patches/Fixes/Scp3114FriendlyFireFix.cs +++ b/EXILED/Exiled.Events/Patches/Fixes/Scp3114FriendlyFireFix.cs @@ -96,9 +96,6 @@ public Scp3114FriendlyFireFix2(Footprint attacker, float damage) public override string ServerLogsText { get; } - public override string RagdollInspectText { get; } - - public override string DeathScreenText { get; } #pragma warning restore SA1600 // Elements should be documented private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) From 0b0d63f1d9900371fad493b5b8733f77815167bd Mon Sep 17 00:00:00 2001 From: Yamato Date: Mon, 25 Nov 2024 22:23:54 +0100 Subject: [PATCH 14/29] remove uneeded code --- .../Exiled.API/Features/Roles/Scp106Role.cs | 55 +------------------ 1 file changed, 3 insertions(+), 52 deletions(-) diff --git a/EXILED/Exiled.API/Features/Roles/Scp106Role.cs b/EXILED/Exiled.API/Features/Roles/Scp106Role.cs index 86b6f16a2d..ffbe2a658b 100644 --- a/EXILED/Exiled.API/Features/Roles/Scp106Role.cs +++ b/EXILED/Exiled.API/Features/Roles/Scp106Role.cs @@ -149,11 +149,6 @@ public bool IsSubmerged /// public float SinkholeCurrentTime => SinkholeController.ElapsedToggle; - /// - /// Gets a value indicating the normalized state of the sinkhole. - /// - public float SinkholeNormalizedState => SinkholeController.NormalizedState; - /// /// Gets a value indicating whether SCP-106 is currently in the middle of an animation. /// @@ -169,64 +164,20 @@ public bool IsSubmerged /// public bool SinkholeState { - get => SinkholeController.State; - set => SinkholeController.State = value; + get => StalkAbility.StalkActive; + set => StalkAbility.StalkActive = value; } /// /// Gets the sinkhole target duration. /// - public float SinkholeTargetDuration => SinkholeController.TargetDuration; + public float SinkholeTargetDuration => SinkholeController.TargetTransitionDuration; /// /// Gets the speed multiplier of the sinkhole. /// public float SinkholeSpeedMultiplier => SinkholeController.SpeedMultiplier; - // TODO: ReAdd Setter but before making an propper way to overwrite NW constant only when the propperty has been used -#pragma warning disable SA1623 // Property summary documentation should match accessors -#pragma warning disable SA1202 - /// - /// Gets or sets how mush cost the Ability Stalk will cost per tick when being stationary. - /// - internal float VigorStalkCostStationary { get; } = Scp106StalkAbility.VigorStalkCostStationary; - - /// - /// Gets or sets how mush cost the Ability Stalk will cost per tick when moving. - /// - internal float VigorStalkCostMoving { get; } = Scp106StalkAbility.VigorStalkCostMoving; - - /// - /// Gets or sets how mush vigor will be regenerate while moving per seconds. - /// - internal float VigorRegeneration { get; } = Scp106StalkAbility.VigorRegeneration; - - /// - /// Gets or sets the duration of Corroding effect. - /// - internal float CorrodingTime { get; } = Scp106Attack.CorrodingTime; - - /// - /// Gets or sets how mush vigor Scp106 will gain when being reward for having caught a player. - /// - internal float VigorCaptureReward { get; } = Scp106Attack.VigorCaptureReward; - - /// - /// Gets or sets how mush reduction cooldown Scp106 will gain when being reward for having caught a player. - /// - internal float CooldownReductionReward { get; } = Scp106Attack.CooldownReductionReward; - - /// - /// Gets or sets the cooldown duration of it's Sinkhole ability's. - /// - internal float SinkholeCooldownDuration { get; } = Scp106SinkholeController.CooldownDuration; - - /// - /// Gets or sets how mush vigor it's ability Hunter Atlas will cost per meter. - /// - internal float HuntersAtlasCostPerMeter { get; } = Scp106HuntersAtlasAbility.CostPerMeter; -#pragma warning restore SA1623 // Property summary documentation should match accessors - /// /// Gets or sets how mush damage Scp106 will dealt when attacking a player. /// From 24a4119f660f838b537b6530a5df819d3aacd860 Mon Sep 17 00:00:00 2001 From: Yamato Date: Mon, 25 Nov 2024 22:25:23 +0100 Subject: [PATCH 15/29] Fix --- EXILED/Exiled.API/Features/Lift.cs | 2 +- EXILED/Exiled.API/Features/Roles/Scp106Role.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/EXILED/Exiled.API/Features/Lift.cs b/EXILED/Exiled.API/Features/Lift.cs index 25cec0ccf7..c749424908 100644 --- a/EXILED/Exiled.API/Features/Lift.cs +++ b/EXILED/Exiled.API/Features/Lift.cs @@ -140,7 +140,7 @@ public ElevatorSequence Status ElevatorGroup.GateB => ElevatorType.GateB, ElevatorGroup.LczA01 or ElevatorGroup.LczA02 => ElevatorType.LczA, ElevatorGroup.LczB01 or ElevatorGroup.LczB02 => ElevatorType.LczB, - ElevatorGroup.Nuke => ElevatorType.Nuke, + ElevatorGroup.Nuke01 or ElevatorGroup.Nuke02 => ElevatorType.Nuke, _ => ElevatorType.Unknown, }; diff --git a/EXILED/Exiled.API/Features/Roles/Scp106Role.cs b/EXILED/Exiled.API/Features/Roles/Scp106Role.cs index ffbe2a658b..0e3acb5f71 100644 --- a/EXILED/Exiled.API/Features/Roles/Scp106Role.cs +++ b/EXILED/Exiled.API/Features/Roles/Scp106Role.cs @@ -265,7 +265,7 @@ public void CapturePlayer(Player player) // Convert to bool. return; Attack.SendCooldown(Attack._hitCooldown); - Vigor += VigorCaptureReward; + Vigor += Scp106Attack.VigorCaptureReward; Attack.ReduceSinkholeCooldown(); Hitmarker.SendHitmarkerDirectly(Attack.Owner, 1f); From b56d6e6bcc4f20ff9f2afdd917a04c4c6550ae08 Mon Sep 17 00:00:00 2001 From: Yamato Date: Mon, 25 Nov 2024 22:30:24 +0100 Subject: [PATCH 16/29] Fix --- EXILED/Exiled.API/Features/Player.cs | 2 +- .../AddRespawnTargetMultiplierConfig.cs | 54 ------------------- 2 files changed, 1 insertion(+), 55 deletions(-) delete mode 100644 EXILED/Exiled.Events/Patches/Generic/AddRespawnTargetMultiplierConfig.cs diff --git a/EXILED/Exiled.API/Features/Player.cs b/EXILED/Exiled.API/Features/Player.cs index befbe2453b..26c2bcddfc 100644 --- a/EXILED/Exiled.API/Features/Player.cs +++ b/EXILED/Exiled.API/Features/Player.cs @@ -361,7 +361,7 @@ public string CustomInfo set { // NW Client check. - if (value.Contains('<')) + if (value.Contains('<')) { foreach (string token in value.Split('<')) { diff --git a/EXILED/Exiled.Events/Patches/Generic/AddRespawnTargetMultiplierConfig.cs b/EXILED/Exiled.Events/Patches/Generic/AddRespawnTargetMultiplierConfig.cs deleted file mode 100644 index c8b3700c6a..0000000000 --- a/EXILED/Exiled.Events/Patches/Generic/AddRespawnTargetMultiplierConfig.cs +++ /dev/null @@ -1,54 +0,0 @@ -// ----------------------------------------------------------------------- -// -// Copyright (c) ExMod Team. All rights reserved. -// Licensed under the CC BY-SA 3.0 license. -// -// ----------------------------------------------------------------------- - -namespace Exiled.Events.Patches.Generic.Scp079API -{ - using System.Collections.Generic; - using System.Reflection.Emit; - - using API.Features.Pools; - using HarmonyLib; - - using static HarmonyLib.AccessTools; - - using Scp049Role = API.Features.Roles.Scp049Role; - - /// - /// Patches . - /// Adds the as NW config. - /// - [HarmonyPatch(typeof(RoundSummary), nameof(RoundSummary.ServerOnRespawned))] - internal class AddRespawnTargetMultiplierConfig - { - private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) - { - List newInstructions = ListPool.Pool.Get(instructions); - - // replace "this.ChaosTargetCount += (int)((double)respawnedPlayers.Count * 0.75);" - // with " this.ChaosTargetCount += (int)((double)respawnedPlayers.Count * ConfigFile.ServerConfig.GetDouble("respawn_target_multiplier", 0.75);" - int offset = 0; - int index = newInstructions.FindIndex(instruction => instruction.opcode == OpCodes.Ldc_R8) + offset; - newInstructions.RemoveAt(index); - - newInstructions.InsertRange( - index, - new CodeInstruction[] - { - // ConfigFile.ServerConfig.GetDouble("respawn_target_multiplier", 0.75); - new(OpCodes.Ldsfld, Field(typeof(GameCore.ConfigFile), nameof(GameCore.ConfigFile.ServerConfig))), - new(OpCodes.Ldstr, "respawn_target_multiplier"), - new(OpCodes.Ldc_R8, RoundSummary.RespawnTargetMultiplier), - new(OpCodes.Call, Method(typeof(YamlConfig), nameof(YamlConfig.GetDouble))), - }); - - for (int z = 0; z < newInstructions.Count; z++) - yield return newInstructions[z]; - - ListPool.Pool.Return(newInstructions); - } - } -} \ No newline at end of file From fb87a4c9994b10f7ddfe9fef2a867c669de38cf7 Mon Sep 17 00:00:00 2001 From: Yamato Date: Mon, 25 Nov 2024 22:45:45 +0100 Subject: [PATCH 17/29] PocketTeleportList --- EXILED/Exiled.API/Features/Map.cs | 4 +-- EXILED/Exiled.API/Features/Toys/Speaker.cs | 4 +-- .../Generic/PocketDimensionTeleportList.cs | 29 +++++++++++++++++++ .../Patches/Generic/TeleportList.cs | 26 ----------------- .../Extensions/Permissions.cs | 4 +-- 5 files changed, 35 insertions(+), 32 deletions(-) create mode 100644 EXILED/Exiled.Events/Patches/Generic/PocketDimensionTeleportList.cs delete mode 100644 EXILED/Exiled.Events/Patches/Generic/TeleportList.cs diff --git a/EXILED/Exiled.API/Features/Map.cs b/EXILED/Exiled.API/Features/Map.cs index bc7451f250..78de0ba12d 100644 --- a/EXILED/Exiled.API/Features/Map.cs +++ b/EXILED/Exiled.API/Features/Map.cs @@ -44,9 +44,9 @@ namespace Exiled.API.Features public static class Map { /// - /// A list of s on the map. + /// Gets a list of s on the map. /// - internal static readonly List TeleportsValue = new(8); + internal static readonly List TeleportsValue { get; } = new(); private static AmbientSoundPlayer ambientSoundPlayer; diff --git a/EXILED/Exiled.API/Features/Toys/Speaker.cs b/EXILED/Exiled.API/Features/Toys/Speaker.cs index ef281397ab..dc03c3ff9d 100644 --- a/EXILED/Exiled.API/Features/Toys/Speaker.cs +++ b/EXILED/Exiled.API/Features/Toys/Speaker.cs @@ -1,6 +1,6 @@ // ----------------------------------------------------------------------- -// -// Copyright (c) Exiled Team. All rights reserved. +// +// Copyright (c) ExMod Team. All rights reserved. // Licensed under the CC BY-SA 3.0 license. // // ----------------------------------------------------------------------- diff --git a/EXILED/Exiled.Events/Patches/Generic/PocketDimensionTeleportList.cs b/EXILED/Exiled.Events/Patches/Generic/PocketDimensionTeleportList.cs new file mode 100644 index 0000000000..f537907649 --- /dev/null +++ b/EXILED/Exiled.Events/Patches/Generic/PocketDimensionTeleportList.cs @@ -0,0 +1,29 @@ +// ----------------------------------------------------------------------- +// +// Copyright (c) ExMod Team. All rights reserved. +// Licensed under the CC BY-SA 3.0 license. +// +// ----------------------------------------------------------------------- + +namespace Exiled.Events.Patches.Generic +{ +#pragma warning disable SA1313 + using API.Features; + + using HarmonyLib; + + /// + /// Patches . + /// + [HarmonyPatch] + internal class PocketDimensionTeleportList + { + [HarmonyPatch(typeof(PocketDimensionTeleport), nameof(PocketDimensionTeleport.Awake))] + [HarmonyPostfix] + private static void Adding(PocketDimensionTeleport __instance) => _ = Map.TeleportsValue.AddItem(__instance); + + [HarmonyPatch(typeof(PocketDimensionTeleport), nameof(PocketDimensionTeleport.OnDestroy))] + [HarmonyPostfix] + private static void Removing(PocketDimensionTeleport __instance) => Map.TeleportsValue.Remove(__instance); + } +} \ No newline at end of file diff --git a/EXILED/Exiled.Events/Patches/Generic/TeleportList.cs b/EXILED/Exiled.Events/Patches/Generic/TeleportList.cs deleted file mode 100644 index 40520ec27f..0000000000 --- a/EXILED/Exiled.Events/Patches/Generic/TeleportList.cs +++ /dev/null @@ -1,26 +0,0 @@ -// ----------------------------------------------------------------------- -// -// Copyright (c) ExMod Team. All rights reserved. -// Licensed under the CC BY-SA 3.0 license. -// -// ----------------------------------------------------------------------- - -namespace Exiled.Events.Patches.Generic -{ - using API.Features; - using HarmonyLib; - using MapGeneration; - - /// - /// Patches . - /// - [HarmonyPatch(typeof(ImageGenerator), nameof(ImageGenerator.GenerateMap))] - internal class TeleportList - { - private static void Prefix() - { - Map.TeleportsValue.Clear(); - Map.TeleportsValue.AddRange(UnityEngine.Object.FindObjectsOfType()); - } - } -} \ No newline at end of file diff --git a/EXILED/Exiled.Permissions/Extensions/Permissions.cs b/EXILED/Exiled.Permissions/Extensions/Permissions.cs index 6d5708bf3b..b03271b4be 100644 --- a/EXILED/Exiled.Permissions/Extensions/Permissions.cs +++ b/EXILED/Exiled.Permissions/Extensions/Permissions.cs @@ -21,7 +21,7 @@ namespace Exiled.Permissions.Extensions using Features; using Properties; - + using Query; using RemoteAdmin; using YamlDotNet.Core; @@ -176,7 +176,7 @@ public static bool CheckPermission(this CommandSender sender, string permission) { return true; } - else if (sender is PlayerCommandSender || sender is UserPrint) + else if (sender is PlayerCommandSender || sender is QueryCommandSender) { if (Player.Get(sender.SenderId) is not Player player) return false; From e838047a1d460aec93c3b72842c030250e034cd0 Mon Sep 17 00:00:00 2001 From: Yamato Date: Mon, 25 Nov 2024 22:50:03 +0100 Subject: [PATCH 18/29] . --- EXILED/Exiled.API/Features/Map.cs | 9 +++++---- EXILED/Exiled.API/Features/Roles/Scp106Role.cs | 8 +++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/EXILED/Exiled.API/Features/Map.cs b/EXILED/Exiled.API/Features/Map.cs index 78de0ba12d..5ecf3bfa72 100644 --- a/EXILED/Exiled.API/Features/Map.cs +++ b/EXILED/Exiled.API/Features/Map.cs @@ -43,10 +43,6 @@ namespace Exiled.API.Features /// public static class Map { - /// - /// Gets a list of s on the map. - /// - internal static readonly List TeleportsValue { get; } = new(); private static AmbientSoundPlayer ambientSoundPlayer; @@ -128,6 +124,11 @@ public static bool IsDecontaminationEnabled /// public static SqueakSpawner SqueakSpawner => squeakSpawner ??= Object.FindObjectOfType(); + /// + /// Gets a list of s on the map. + /// + internal static List TeleportsValue { get; } = new(); + /// /// Broadcasts a message to all players. /// diff --git a/EXILED/Exiled.API/Features/Roles/Scp106Role.cs b/EXILED/Exiled.API/Features/Roles/Scp106Role.cs index 0e3acb5f71..ff93dbbed0 100644 --- a/EXILED/Exiled.API/Features/Roles/Scp106Role.cs +++ b/EXILED/Exiled.API/Features/Roles/Scp106Role.cs @@ -254,15 +254,16 @@ public bool UsePortal(Vector3 position, float cost = 0f) /// Send a player to the pocket dimension. /// /// The to send. - public void CapturePlayer(Player player) // Convert to bool. + /// If the player will be capture. + public bool CapturePlayer(Player player) { if (player is null) - return; + return false; Attack._targetHub = player.ReferenceHub; DamageHandlerBase handler = new ScpDamageHandler(Attack.Owner, AttackDamage, DeathTranslations.PocketDecay); if (!Attack._targetHub.playerStats.DealDamage(handler)) - return; + return false; Attack.SendCooldown(Attack._hitCooldown); Vigor += Scp106Attack.VigorCaptureReward; @@ -270,6 +271,7 @@ public void CapturePlayer(Player player) // Convert to bool. Hitmarker.SendHitmarkerDirectly(Attack.Owner, 1f); player.EnableEffect(EffectType.PocketCorroding); + return true; } /// From 5c33e278730c00f3bfe6a042892aba7b27d5371f Mon Sep 17 00:00:00 2001 From: Yamato Date: Mon, 25 Nov 2024 23:02:03 +0100 Subject: [PATCH 19/29] TryGetFirst --- EXILED/Exiled.API/Features/Map.cs | 1 - EXILED/Exiled.API/Features/Roles/Scp079Role.cs | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/EXILED/Exiled.API/Features/Map.cs b/EXILED/Exiled.API/Features/Map.cs index 5ecf3bfa72..8bcd02ba2a 100644 --- a/EXILED/Exiled.API/Features/Map.cs +++ b/EXILED/Exiled.API/Features/Map.cs @@ -43,7 +43,6 @@ namespace Exiled.API.Features /// public static class Map { - private static AmbientSoundPlayer ambientSoundPlayer; private static SqueakSpawner squeakSpawner; diff --git a/EXILED/Exiled.API/Features/Roles/Scp079Role.cs b/EXILED/Exiled.API/Features/Roles/Scp079Role.cs index 1ae1b67960..2480ca3d88 100644 --- a/EXILED/Exiled.API/Features/Roles/Scp079Role.cs +++ b/EXILED/Exiled.API/Features/Roles/Scp079Role.cs @@ -593,7 +593,7 @@ public void ActivateTesla(bool consumeEnergy = true) Scp079Camera cam = CurrentCameraSync.CurrentCamera; RewardManager.MarkRoom(cam.Room); - if (!global::TeslaGate.AllGates.Find(x => RoomIdUtils.IsTheSameRoom(cam.Position, x.transform.position), out global::TeslaGate teslaGate)) + if (!global::TeslaGate.AllGates.TryGetFirst(x => RoomIdUtils.IsTheSameRoom(cam.Position, x.transform.position), out global::TeslaGate teslaGate)) return; if (consumeEnergy) From 9ff62a9dc84eb033f43eb07c2b13895aaf35188f Mon Sep 17 00:00:00 2001 From: Yamato Date: Mon, 25 Nov 2024 23:13:51 +0100 Subject: [PATCH 20/29] Update doc --- EXILED/Exiled.API/Features/Player.cs | 1 - EXILED/Exiled.Loader/AutoUpdateFiles.cs | 2 +- EXILED/Exiled.Loader/AutoUpdateFiles.tt | 4 +- .../SCPSLRessources/NW_Documentation.md | 1119 ++++++++++++++--- 4 files changed, 981 insertions(+), 145 deletions(-) diff --git a/EXILED/Exiled.API/Features/Player.cs b/EXILED/Exiled.API/Features/Player.cs index 26c2bcddfc..1af09fa4fc 100644 --- a/EXILED/Exiled.API/Features/Player.cs +++ b/EXILED/Exiled.API/Features/Player.cs @@ -47,7 +47,6 @@ namespace Exiled.API.Features using MEC; using Mirror; using Mirror.LiteNetLib4Mirror; - using NorthwoodLib; using PlayerRoles; using PlayerRoles.FirstPersonControl; using PlayerRoles.RoleAssign; diff --git a/EXILED/Exiled.Loader/AutoUpdateFiles.cs b/EXILED/Exiled.Loader/AutoUpdateFiles.cs index 6f947df3f8..2b2aff96d9 100644 --- a/EXILED/Exiled.Loader/AutoUpdateFiles.cs +++ b/EXILED/Exiled.Loader/AutoUpdateFiles.cs @@ -17,6 +17,6 @@ public static class AutoUpdateFiles /// /// Gets which SCP: SL version generated Exiled. /// - public static readonly Version RequiredSCPSLVersion = new(13, 5, 0, 1); + public static readonly Version RequiredSCPSLVersion = new(14, 0, 0, 0); } } \ No newline at end of file diff --git a/EXILED/Exiled.Loader/AutoUpdateFiles.tt b/EXILED/Exiled.Loader/AutoUpdateFiles.tt index 6c38d3d4c5..07176b7f8f 100644 --- a/EXILED/Exiled.Loader/AutoUpdateFiles.tt +++ b/EXILED/Exiled.Loader/AutoUpdateFiles.tt @@ -1,6 +1,6 @@ // ----------------------------------------------------------------------- -// -// Copyright (c) Exiled Team. All rights reserved. +// +// Copyright (c) ExMod Team. All rights reserved. // Licensed under the CC BY-SA 3.0 license. // // ----------------------------------------------------------------------- diff --git a/EXILED/docs/articles/SCPSLRessources/NW_Documentation.md b/EXILED/docs/articles/SCPSLRessources/NW_Documentation.md index 8192210961..d08dbef3d6 100644 --- a/EXILED/docs/articles/SCPSLRessources/NW_Documentation.md +++ b/EXILED/docs/articles/SCPSLRessources/NW_Documentation.md @@ -25,28 +25,33 @@ Last Update (13.5.0.1) - [Damage Handlers](#damagehandlers) - [AchievementName](#achievementname) - [ActionCategory](#actioncategory) -- [ActionModuleResponse](#actionmoduleresponse) - [ActionName](#actionname) - [Activity](#activity) - [AdminFlags](#adminflags) - [AlphaPanelOperations](#alphapaneloperations) +- [AnimItemLayer3p](#animitemlayer3p) +- [AnimState3p](#animstate3p) - [AttachmentDescriptiveAdvantages](#attachmentdescriptiveadvantages) - [AttachmentDescriptiveDownsides](#attachmentdescriptivedownsides) - [AttachmentEditorsTranslation](#attachmenteditorstranslation) - [AttachmentName](#attachmentname) - [AttachmentParam](#attachmentparam) +- [AttachmentParamState](#attachmentparamstate) - [AttachmentSlot](#attachmentslot) +- [AttachmentStatus](#attachmentstatus) - [AttackResult](#attackresult) - [AttackType](#attacktype) - [AttackType](#attacktype) -- [AudioMixerChannelType](#audiomixerchanneltype) - [AuthenticationResponseFlags](#authenticationresponseflags) +- [Authorization](#authorization) - [AutoHideType](#autohidetype) +- [AutosyncInstantiationStatus](#autosyncinstantiationstatus) - [BadgePreferences](#badgepreferences) - [BadgeVisibilityPreferences](#badgevisibilitypreferences) - [BanType](#bantype) - [BlockedInteraction](#blockedinteraction) - [BroadcastFlags](#broadcastflags) +- [BuoyancyMode](#buoyancymode) - [CallType](#calltype) - [CandyKindID](#candykindid) - [CassieAnnouncementType](#cassieannouncementtype) @@ -54,15 +59,19 @@ Last Update (13.5.0.1) - [CentralAuthPreauthFlags](#centralauthpreauthflags) - [ChallengeState](#challengestate) - [ChallengeType](#challengetype) +- [ChamberState](#chamberstate) - [CheckpointErrorType](#checkpointerrortype) - [CheckpointSequenceStage](#checkpointsequencestage) +- [ClientFlags](#clientflags) - [ClientInstanceMode](#clientinstancemode) +- [ClientReceivedContentType](#clientreceivedcontenttype) - [ClientSwitchState](#clientswitchstate) - [ClientType](#clienttype) - [CloudState](#cloudstate) - [CmdTeleportData](#cmdteleportdata) - [CollectionDeserializeToBehaviour](#collectiondeserializetobehaviour) - [CollisionsDisablingReasons](#collisionsdisablingreasons) +- [ColorMode](#colormode) - [CommandOperationMode](#commandoperationmode) - [Condition](#condition) - [ConfigShare](#configshare) @@ -72,7 +81,6 @@ Last Update (13.5.0.1) - [ConnectRequestResult](#connectrequestresult) - [ConsoleLogType](#consolelogtype) - [ConsumeError](#consumeerror) -- [CurrentAction](#currentaction) - [CursorOverrideMode](#cursoroverridemode) - [DataType](#datatype) - [DebugLevel](#debuglevel) @@ -91,26 +99,35 @@ Last Update (13.5.0.1) - [DoorDamageType](#doordamagetype) - [DoorLockMode](#doorlockmode) - [DoorLockReason](#doorlockreason) +- [DropdownEntryType](#dropdownentrytype) - [DtoaMode](#dtoamode) - [EffectClassification](#effectclassification) -- [EffectType](#effecttype) - [ElevatorGroup](#elevatorgroup) - [ElevatorSequence](#elevatorsequence) +- [EmotionBlendshape](#emotionblendshape) +- [EmotionPresetType](#emotionpresettype) - [EncryptedChannel](#encryptedchannel) - [Entry](#entry) - [EscapeScenarioType](#escapescenariotype) - [EType](#etype) +- [ExampleId](#exampleid) +- [ExampleId](#exampleid) +- [ExampleId](#exampleid) +- [ExplosionType](#explosiontype) - [FacilityZone](#facilityzone) - [Faction](#faction) - [FailReason](#failreason) - [FalloffType](#fallofftype) - [FastDtoaMode](#fastdtoamode) - [FilmmakerBlendPreset](#filmmakerblendpreset) -- [FirearmAudioFlags](#firearmaudioflags) -- [FirearmStatusFlags](#firearmstatusflags) +- [FirearmAnim](#firearmanim) +- [FirearmCategory](#firearmcategory) +- [FirearmWorldmodelType](#firearmworldmodeltype) +- [FiringState](#firingstate) - [Flags](#flags) - [Flags](#flags) - [FogType](#fogtype) +- [FoldoutMode](#foldoutmode) - [FootstepLoudness](#footsteploudness) - [FpcViewMode](#fpcviewmode) - [FreezingMode](#freezingmode) @@ -136,11 +153,15 @@ Last Update (13.5.0.1) - [HotkeysTranslation](#hotkeystranslation) - [HttpQueryMode](#httpquerymode) - [IcomText](#icomtext) +- [IconType](#icontype) - [IndicatorType](#indicatortype) - [InputActivationMode](#inputactivationmode) - [IntercomState](#intercomstate) +- [InventoryGuiAction](#inventoryguiaction) +- [InventoryGuiTranslation](#inventoryguitranslation) - [InvisibilityFlags](#invisibilityflags) - [IPAddressType](#ipaddresstype) +- [ItemAddReason](#itemaddreason) - [ItemCategory](#itemcategory) - [ItemDescriptionType](#itemdescriptiontype) - [ItemTierFlags](#itemtierflags) @@ -155,12 +176,20 @@ Last Update (13.5.0.1) - [LocalAddrType](#localaddrtype) - [LoggingState](#loggingstate) - [MainBoolsSettings](#mainboolssettings) +- [MapGenerationPhase](#mapgenerationphase) - [MappingLifetime](#mappinglifetime) +- [MessageHeader](#messageheader) +- [MessageHeader](#messageheader) - [MessageImportance](#messageimportance) +- [MessageType](#messagetype) +- [MessageType](#messagetype) - [MiscControlsSetting](#misccontrolssetting) - [MiscPrivacySetting](#miscprivacysetting) - [MiscVideoSetting](#miscvideosetting) +- [MixerChannel](#mixerchannel) - [Mode](#mode) +- [Mode](#mode) +- [ModifierMode](#modifiermode) - [Modules](#modules) - [NatAddressType](#nataddresstype) - [NetLogLevel](#netloglevel) @@ -175,6 +204,7 @@ Last Update (13.5.0.1) - [OpusCtlGetRequest](#opusctlgetrequest) - [OpusCtlSetRequest](#opusctlsetrequest) - [OpusStatusCode](#opusstatuscode) +- [OtherCondition](#othercondition) - [OutputCodes](#outputcodes) - [PacketProperty](#packetproperty) - [ParameterMixingMode](#parametermixingmode) @@ -188,6 +218,7 @@ Last Update (13.5.0.1) - [PlayerMovementState](#playermovementstate) - [PlayerPermissions](#playerpermissions) - [PlayerSorting](#playersorting) +- [PopupState](#popupstate) - [PortMapper](#portmapper) - [PrimitiveFlags](#primitiveflags) - [ProcessCreationFlags](#processcreationflags) @@ -195,22 +226,29 @@ Last Update (13.5.0.1) - [RadioCommand](#radiocommand) - [RadioRangeLevel](#radiorangelevel) - [RejectionReason](#rejectionreason) +- [RemoteAdminResponseFlags](#remoteadminresponseflags) +- [RemovalMode](#removalmode) - [ReproProjectAssetType](#reproprojectassettype) - [RequestType](#requesttype) -- [RequestType](#requesttype) -- [RespawnSequencePhase](#respawnsequencephase) +- [RespawnSetting](#respawnsetting) - [ResurrectError](#resurrecterror) - [RoleChangeReason](#rolechangereason) - [RoleSpawnFlags](#rolespawnflags) - [RoleTypeId](#roletypeid) - [RoomName](#roomname) - [RoomShape](#roomshape) -- [RoomType](#roomtype) +- [RootCullablePriority](#rootcullablepriority) - [RoundRestartType](#roundrestarttype) +- [RpcHeader](#rpcheader) - [RpcStateMsg](#rpcstatemsg) - [RpcType](#rpctype) - [RpcType](#rpctype) - [RpcType](#rpctype) +- [RpcType](#rpctype) +- [RpcType](#rpctype) +- [RpcType](#rpctype) +- [RpcType](#rpctype) +- [RpcType](#rpctype) - [ScanSequenceStep](#scansequencestep) - [Scp0492SoundId](#scp0492soundid) - [Scp079HudTranslation](#scp079hudtranslation) @@ -218,6 +256,7 @@ Last Update (13.5.0.1) - [Scp096HitResult](#scp096hitresult) - [Scp096HudTranslation](#scp096hudtranslation) - [Scp096RageState](#scp096ragestate) +- [Scp1344Status](#scp1344status) - [Scp173SoundId](#scp173soundid) - [Scp244State](#scp244state) - [Scp3114HudTranslation](#scp3114hudtranslation) @@ -231,25 +270,34 @@ Last Update (13.5.0.1) - [SecurityLevel](#securitylevel) - [SensitivitySetting](#sensitivitysetting) - [ServerLogType](#serverlogtype) +- [ServerOperativeSystem](#serveroperativesystem) - [ServerRateLimit](#serverratelimit) +- [ServerReceivedContentType](#serverreceivedcontenttype) - [ServerShutdownState](#servershutdownstate) +- [ServerType](#servertype) - [SettingType](#settingtype) - [ShutdownResult](#shutdownresult) +- [SpawnableRoomConnectorType](#spawnableroomconnectortype) - [SpawnableTeamType](#spawnableteamtype) - [SpectatableListElementType](#spectatablelistelementtype) - [SpectatorSpawnReason](#spectatorspawnreason) - [States](#states) - [StatusType](#statustype) +- [SteamLobbyPrivacy](#steamlobbyprivacy) +- [StorageLocation](#storagelocation) - [StructureType](#structuretype) - [SubtitleType](#subtitletype) +- [SyncDataFlags](#syncdataflags) - [SyncMode](#syncmode) - [TargetButton](#targetbutton) - [Team](#team) -- [ThirdpersonItemAnimationName](#thirdpersonitemanimationname) - [TrackerMessage](#trackermessage) -- [TriggerState](#triggerstate) +- [TransitionStatus](#transitionstatus) +- [TurnStatus](#turnstatus) - [UISetting](#uisetting) - [UnconnectedMessageType](#unconnectedmessagetype) +- [UpdateMessageFlags](#updatemessageflags) +- [UserResponseMode](#userresponsemode) - [ValidationError](#validationerror) - [ValidationError](#validationerror) - [ValidationError](#validationerror) @@ -262,6 +310,10 @@ Last Update (13.5.0.1) - [VoiceChatSupportMode](#voicechatsupportmode) - [VoiceLinesName](#voicelinesname) - [VolumeSliderSetting](#volumeslidersetting) +- [WarheadScenarioType](#warheadscenariotype) +- [WaveQueueState](#wavequeuestate) +- [WearableElements](#wearableelements) +- [WearableSlot](#wearableslot) - [WorkstationStatus](#workstationstatus) ### AchievementName @@ -302,6 +354,24 @@ Last Update (13.5.0.1) [30] = IllPassThanks [31] = Overcurrent [32] = PropertyOfChaos + [33] = Overtime + [34] = RuleBreaker + [35] = CompleteTheMission + [36] = ArmyOfOne + [37] = LMGG + [38] = OnSpeakingTerms + [39] = HatsOffToYou + [40] = Hawkeye + [41] = AmnesticAmbush + [42] = AfterlifeCommunicator + [43] = TheEnemyOfMyEnemy + [44] = SignalLost + [45] = ThinkFast + [46] = TrilateralTermination + [47] = MutuallyAssuredDestruction + [48] = UndeadSpaceProgram + [49] = ArizonaRanger + [50] = Matador ``` @@ -322,18 +392,6 @@ Last Update (13.5.0.1) -### ActionModuleResponse - -
InventorySystem.Items.Firearms.Modules.ActionModuleResponse - -``` - [0] = Idle - [1] = Shoot - [2] = Dry -``` - -
- ### ActionName
ActionName @@ -360,7 +418,7 @@ Last Update (13.5.0.1) [18] = Noclip [19] = GameConsole [21] = InspectItem - [22] = RevolverCockHammer + [22] = WeaponAlt [23] = ThrowItem [27] = HideGUI [28] = NoClipFogToggle @@ -413,6 +471,37 @@ Last Update (13.5.0.1)
+### AnimItemLayer3p + +
InventorySystem.Items.Thirdperson.AnimItemLayer3p + +``` + [0] = Left + [1] = Right + [2] = Middle + [3] = Additive + [4] = PreMovement +``` + +
+ +### AnimState3p + +
InventorySystem.Items.Thirdperson.AnimState3p + +``` + [0] = Override0 + [1] = Override1 + [2] = Override2 + [3] = Additive0 + [4] = Additive1 + [5] = Additive2 + [6] = RunForward + [7] = SprintForward +``` + +
+ ### AttachmentDescriptiveAdvantages
InventorySystem.Items.Firearms.Attachments.AttachmentDescriptiveAdvantages @@ -423,6 +512,7 @@ Last Update (13.5.0.1) [4] = AmmoCounter [8] = FlashSuppression [16] = NightVision + [32] = ShotgunShells ```
@@ -434,6 +524,7 @@ Last Update (13.5.0.1) ``` [0] = None [2] = Laser + [4] = NoHeadshots ``` @@ -547,6 +638,21 @@ Last Update (13.5.0.1) [19] = AmmoConsumptionMultiplier [20] = ReloadSpeedMultiplier [21] = PreventReload + [22] = RunningInaccuracyMultiplier + [23] = DoubleActionSpeedMultiplier +``` + + + +### AttachmentParamState + +
InventorySystem.Items.Firearms.Attachments.AttachmentParamState + +``` + [0] = Disabled + [2] = UserInterface + [4] = SilentlyActive + [6] = ActiveAndDisplayed ```
@@ -569,6 +675,19 @@ Last Update (13.5.0.1) +### AttachmentStatus + +
InventorySystem.Items.Firearms.Extensions.ConditionalEvaluator+AttachmentStatus + +``` + [0] = Disabled + [1] = Enabled + [2] = EnabledAndReady + [3] = EnabledAndNotReady +``` + +
+ ### AttackResult
PlayerRoles.PlayableScps.Subroutines.AttackResult @@ -607,29 +726,27 @@ Last Update (13.5.0.1)
-### AudioMixerChannelType +### AuthenticationResponseFlags -
AudioPooling.AudioMixerChannelType +
CentralAuth.AuthenticationResponseFunctions+AuthenticationResponseFlags ``` - [0] = DefaultSfx - [1] = Interface - [2] = Weapons - [3] = VoiceChat - [4] = NoDucking + [1] = AuthToken + [2] = BadgeToken + [4] = DoNotTrack + [8] = HideBadge ```
-### AuthenticationResponseFlags +### Authorization -
CentralAuth.AuthenticationResponseFunctions+AuthenticationResponseFlags +
InventorySystem.Items.Firearms.Modules.IReloadUnloadValidatorModule+Authorization ``` - [1] = AuthToken - [2] = BadgeToken - [4] = DoNotTrack - [8] = HideBadge + [0] = Idle + [1] = Allowed + [2] = Vetoed ```
@@ -646,6 +763,19 @@ Last Update (13.5.0.1)
+### AutosyncInstantiationStatus + +
InventorySystem.Items.Autosync.AutosyncInstantiationStatus + +``` + [0] = Unspecified + [1] = Template + [2] = InventoryInstance + [3] = SimulatedInstance +``` + +
+ ### BadgePreferences
ServerRoles+BadgePreferences @@ -693,6 +823,7 @@ Last Update (13.5.0.1) [8] = GrabItems [16] = ItemPrimaryAction [48] = ItemUsage + [64] = UndisarmPlayers [255] = All ``` @@ -710,6 +841,21 @@ Last Update (13.5.0.1)
+### BuoyancyMode + +
WaterPhysics.BuoyancyMode + +``` + [0] = SuperHeavy + [1] = NonBuoyant + [2] = ShortTimeFloaters + [3] = LongTimeFloaters + [4] = Floater + [5] = SuperLight +``` + +
+ ### CallType
LiteNetLib.Utils.NetSerializer+CallType @@ -806,6 +952,18 @@ Last Update (13.5.0.1)
+### ChamberState + +
InventorySystem.Items.Firearms.Modules.CylinderAmmoModule+ChamberState + +``` + [0] = Empty + [1] = Live + [2] = Discharged +``` + +
+ ### CheckpointErrorType
Interactables.Interobjects.CheckpointDoor+CheckpointErrorType @@ -831,6 +989,22 @@ Last Update (13.5.0.1)
+### ClientFlags + +
Query.QueryHandshake+ClientFlags + +``` + [0] = None + [1] = SuppressRaResponses + [2] = SubscribeServerConsole + [4] = SubscribeServerLogs + [8] = RemoteAdminMetadata + [16] = RestrictPermissions + [32] = SpecifyLogUsername +``` + +
+ ### ClientInstanceMode
CentralAuth.ClientInstanceMode @@ -840,6 +1014,22 @@ Last Update (13.5.0.1) [1] = ReadyClient [2] = Host [3] = DedicatedServer + [4] = Dummy +``` + +
+ +### ClientReceivedContentType + +
Query.QueryMessage+ClientReceivedContentType + +``` + [0] = ConsoleString + [1] = CommandException + [2] = QueryMessage + [3] = RemoteAdminSerializedResponse + [4] = RemoteAdminPlaintextResponse + [5] = RemoteAdminUnsuccessfulPlaintextResponse ```
@@ -912,6 +1102,18 @@ Last Update (13.5.0.1)
+### ColorMode + +
InventorySystem.Drawers.AlertContent+ColorMode + +``` + [0] = White + [1] = Role + [2] = Accented +``` + +
+ ### CommandOperationMode
Misc+CommandOperationMode @@ -1037,18 +1239,6 @@ Last Update (13.5.0.1)
-### CurrentAction - -
InventorySystem.Items.Firearms.Modules.TubularMagazineAmmoManager+CurrentAction - -``` - [0] = Idle - [1] = Reloading - [2] = Unloading -``` - -
- ### CursorOverrideMode
CursorManagement.CursorOverrideMode @@ -1122,6 +1312,7 @@ Last Update (13.5.0.1) [1] = Bullet [2] = Blood [3] = Buckshot + [4] = GlassCrack ```
@@ -1286,6 +1477,7 @@ Last Update (13.5.0.1) [4] = Grenade [8] = Weapon [16] = Scp096 + [32] = ParticleDisruptor ``` @@ -1323,6 +1515,20 @@ Last Update (13.5.0.1) +### DropdownEntryType + +
UserSettings.ServerSpecific.SSDropdownSetting+DropdownEntryType + +``` + [0] = Regular + [1] = Scrollable + [2] = ScrollableLoop + [3] = Hybrid + [4] = HybridLoop +``` + +
+ ### DtoaMode
Utf8Json.Internal.DoubleConversion.DoubleToStringConverter+DtoaMode @@ -1346,20 +1552,9 @@ Last Update (13.5.0.1)
-### EffectType - -
Respawning.RespawnEffectsController+EffectType - -``` - [0] = Selection - [1] = UponRespawn -``` - -
- ### ElevatorGroup -
Interactables.Interobjects.ElevatorManager+ElevatorGroup +
Interactables.Interobjects.ElevatorGroup ``` [0] = GateA @@ -1368,8 +1563,9 @@ Last Update (13.5.0.1) [3] = LczA02 [4] = LczB01 [5] = LczB02 - [6] = Nuke + [6] = Nuke01 [7] = Scp049 + [8] = Nuke02 ```
@@ -1388,6 +1584,54 @@ Last Update (13.5.0.1)
+### EmotionBlendshape + +
PlayerRoles.FirstPersonControl.Thirdperson.Subcontrollers.EmotionBlendshape + +``` + [0] = Undefined + [1] = Frown + [2] = BrowRaise + [3] = EyeTapLeft + [4] = EyeTapRight + [5] = EyeCloseLeft + [6] = EyeCloseRight + [7] = EyeOpenLeft + [8] = EyeOpenRight + [9] = EyesBottom + [10] = Worried + [11] = MouthOpen + [12] = JawDrop + [13] = Grin + [14] = SmileOpen + [15] = Disgusted + [16] = Angry + [17] = LipsTop + [18] = LipsNormalBottom + [19] = LipsStretchBottom + [20] = Ogre + [21] = Chad + [22] = MixClosedEyes +``` + +
+ +### EmotionPresetType + +
PlayerRoles.FirstPersonControl.Thirdperson.Subcontrollers.EmotionPresetType + +``` + [0] = Neutral + [1] = Happy + [2] = AwkwardSmile + [3] = Scared + [4] = Angry + [5] = Chad + [6] = Ogre +``` + +
+ ### EncryptedChannel
EncryptedChannelManager+EncryptedChannel @@ -1443,6 +1687,77 @@ Last Update (13.5.0.1)
+### ExampleId + +
UserSettings.ServerSpecific.Examples.SSAbilitiesExample+ExampleId + +``` + [0] = SpeedBoostKey + [1] = SpeedBoostToggle + [2] = HealAlly +``` + +
+ +### ExampleId + +
UserSettings.ServerSpecific.Examples.SSLightSpawnerExample+ExampleId + +``` + [0] = IntensitySlider + [1] = RangeSlider + [2] = ColorPresetDropdown + [3] = CustomColor + [4] = ColorInfo + [5] = ShadowType + [6] = ShadowStrength + [7] = LightType + [8] = LightShape + [9] = SpotAngle + [10] = InnerSpotAngle + [11] = ConfirmButton + [12] = DestroyAllButton +``` + +
+ +### ExampleId + +
UserSettings.ServerSpecific.Examples.SSPrimitiveSpawnerExample+ExampleId + +``` + [0] = ConfirmButton + [1] = DestroyAllButton + [2] = TypeDropdown + [3] = ColorPresetDropdown + [4] = ColorField + [5] = ColorAlphaSlider + [6] = CollisionsToggle + [7] = RendererToggle + [8] = ColorInfo + [9] = ScaleSliderX + [10] = ScaleSliderY + [11] = ScaleSliderZ +``` + +
+ +### ExplosionType + +
ExplosionType + +``` + [0] = Grenade + [1] = SCP018 + [2] = PinkCandy + [3] = Cola + [4] = Disruptor + [5] = Jailbird + [6] = Custom +``` + +
+ ### FacilityZone
MapGeneration.FacilityZone @@ -1523,30 +1838,54 @@ Last Update (13.5.0.1)
-### FirearmAudioFlags +### FirearmAnim -
InventorySystem.Items.Firearms.FirearmAudioFlags +
InventorySystem.Items.Firearms.Thirdperson.FirearmThirdpersonItem+FirearmAnim ``` - [0] = None - [2] = ScaleDistance - [4] = IsGunshot - [8] = SendToPlayers - [16] = UseDedicatedAudioChannel + [0] = Ads + [1] = Hip + [2] = Reload ```
-### FirearmStatusFlags +### FirearmCategory -
InventorySystem.Items.Firearms.FirearmStatusFlags +
InventorySystem.Items.Firearms.FirearmCategory + +``` + [0] = Unclassified + [1] = Pistol + [2] = Revolver + [3] = SubmachineGun + [4] = Rifle + [5] = LightMachineGun + [6] = Shotgun +``` + +
+ +### FirearmWorldmodelType + +
InventorySystem.Items.Firearms.FirearmWorldmodelType + +``` + [0] = Pickup + [1] = Thirdperson + [2] = Presentation +``` + +
+ +### FiringState + +
InventorySystem.Items.Firearms.Modules.DisruptorActionModule+FiringState ``` [0] = None - [2] = Cocked - [4] = MagazineInserted - [8] = FlashlightEnabled - [16] = Chambered + [1] = FiringRapid + [2] = FiringSingle ```
@@ -1598,6 +1937,20 @@ Last Update (13.5.0.1)
+### FoldoutMode + +
UserSettings.ServerSpecific.SSTextArea+FoldoutMode + +``` + [0] = NotCollapsable + [1] = CollapseOnEntry + [2] = ExtendOnEntry + [3] = CollapsedByDefault + [4] = ExtendedByDefault +``` + +
+ ### FootstepLoudness
PlayerRoles.FirstPersonControl.Thirdperson.AnimatedCharacterModel+FootstepLoudness @@ -1975,6 +2328,20 @@ Last Update (13.5.0.1)
+### IconType + +
InventorySystem.Items.Firearms.Extensions.DisruptorDualCamExtension+IconType + +``` + [0] = None + [1] = DesintegratorMode + [2] = BurstMode + [3] = CriticalWarn + [4] = CrashWarn +``` + +
+ ### IndicatorType
PlayerRoles.PlayableScps.Scp079.Map.Scp079TeammateIndicators+IndicatorType @@ -2012,6 +2379,52 @@ Last Update (13.5.0.1)
+### InventoryGuiAction + +
InventorySystem.GUI.InventoryGuiAction + +``` + [0] = None + [1] = Drop + [2] = Select +``` + +
+ +### InventoryGuiTranslation + +
InventorySystem.GUI.InventoryGuiTranslation + +``` + [0] = FirearmAmmo + [1] = FirearmDamage + [2] = FirearmFireRate + [3] = FirearmHipAcc + [4] = FirearmAdsAcc + [5] = Weight + [6] = Length + [7] = DropAmmo + [8] = ArmorHelmetEfficacy + [9] = ArmorVestEfficacy + [10] = ArmorStaminaUsage + [11] = ArmorMovementSpeed + [12] = ArmorItemLimits + [13] = ArmorAmmoLimits + [14] = ArmorTotal + [15] = ArmorPenetration + [16] = RunningInaccuracy + [17] = MarshmallowCackleHint + [18] = RemainingCharge + [19] = RemainingAmmo + [20] = MicroHidPrimaryHint + [21] = MicroHidSecondaryHint + [22] = DisruptorToggleModeHint + [23] = JailbirdAttackHint + [24] = JailbirdChargeHint +``` + +
+ ### InvisibilityFlags
PlayerRoles.Visibility.InvisibilityFlags @@ -2039,6 +2452,21 @@ Last Update (13.5.0.1)
+### ItemAddReason + +
InventorySystem.Items.ItemAddReason + +``` + [0] = Undefined + [1] = PickedUp + [2] = AdminCommand + [3] = StartingItem + [4] = Scp914Upgrade + [5] = StatusEffect +``` + +
+ ### ItemCategory
ItemCategory @@ -2051,7 +2479,7 @@ Last Update (13.5.0.1) [4] = Firearm [5] = Grenade [6] = SCPItem - [7] = MicroHID + [7] = SpecialWeapon [8] = Ammo [9] = Armor ``` @@ -2146,6 +2574,7 @@ Last Update (13.5.0.1) [52] = GunFRMG0 [53] = GunA7 [54] = Lantern + [55] = SCP1344 [-1] = None ``` @@ -2315,6 +2744,21 @@ Last Update (13.5.0.1)
+### MapGenerationPhase + +
MapGeneration.MapGenerationPhase + +``` + [0] = ParentRoomRegistration + [1] = RelativePositioningWaypoints + [2] = ComplexDecorationsAndClutter + [3] = SimpleDecorations + [4] = CullingCaching + [5] = SpawnableStructures +``` + +
+ ### MappingLifetime
LiteNetLib4Mirror.Open.Nat.MappingLifetime @@ -2328,6 +2772,35 @@ Last Update (13.5.0.1)
+### MessageHeader + +
InventorySystem.Items.Firearms.Modules.AnimatorReloaderModuleBase+MessageHeader + +``` + [0] = Custom + [1] = Reload + [2] = Unload + [3] = Stop + [4] = RequestRejected +``` + +
+ +### MessageHeader + +
InventorySystem.Items.Firearms.Modules.AutomaticActionModule+MessageHeader + +``` + [0] = CmdShoot + [1] = RpcPublicSync + [2] = RpcResponse + [3] = RpcFire + [4] = RpcDryFire + [5] = RpcNewPlayerSync +``` + +
+ ### MessageImportance
MessageImportance @@ -2341,6 +2814,40 @@ Last Update (13.5.0.1)
+### MessageType + +
InventorySystem.Items.Firearms.Modules.DisruptorActionModule+MessageType + +``` + [0] = RpcRequireReloadTrue + [1] = RpcRequireReloadFalse + [2] = RpcRequireReloadFullResync + [3] = RpcStartFiring + [4] = RpcOnShot + [5] = CmdRequestStartFiring + [6] = CmdConfirmDischarge +``` + +
+ +### MessageType + +
InventorySystem.Items.Firearms.Modules.DoubleActionModule+MessageType + +``` + [0] = RpcNewPlayerResync + [1] = RpcSetCockedTrue + [2] = RpcSetCockedFalse + [3] = RpcFire + [4] = RpcDryFire + [5] = CmdUpdatePulling + [6] = CmdShoot + [7] = StartPulling + [8] = StartCocking +``` + +
+ ### MiscControlsSetting
UserSettings.ControlsSettings.MiscControlsSetting @@ -2383,6 +2890,32 @@ Last Update (13.5.0.1) [1] = ExplosionShake [2] = HeadBobbing [3] = FlashbangDarkMode + [4] = ShowNeedles +``` + +
+ +### MixerChannel + +
AudioPooling.MixerChannel + +``` + [0] = DefaultSfx + [1] = Interface + [2] = Weapons + [3] = VoiceChat + [4] = NoDucking +``` + +
+ +### Mode + +
InventorySystem.Items.Firearms.Extensions.ViewmodelReloadOnlyLayerExtension+Mode + +``` + [0] = DuringReloadsAndUnloads + [1] = OutsideReloadsAndUnloads ```
@@ -2392,13 +2925,26 @@ Last Update (13.5.0.1)
InventorySystem.Items.Autosync.AutosyncRpc+Mode ``` - [0] = Local + [0] = SpecificClient [1] = AllClients [2] = Conditional ```
+### ModifierMode + +
InventorySystem.Items.Firearms.Modules.Misc.StatModifier+ModifierMode + +``` + [0] = Inactive + [1] = Add + [2] = Multiply + [3] = Override +``` + +
+ ### Modules
ServerLogs+Modules @@ -2409,9 +2955,12 @@ Last Update (13.5.0.1) [2] = ClassChange [3] = Permissions [4] = Administrative - [5] = Logger + [5] = GameLogic [6] = DataAccess [7] = Detector + [8] = Throwable + [9] = Door + [10] = Elevator ```
@@ -2603,6 +3152,19 @@ Last Update (13.5.0.1)
+### OtherCondition + +
InventorySystem.Items.Firearms.Extensions.ConditionalEvaluator+OtherCondition + +``` + [0] = Equipped + [1] = Firstperson + [2] = Pickup + [3] = Thirdperson +``` + +
+ ### OutputCodes
ServerOutput.OutputCodes @@ -2695,6 +3257,8 @@ Last Update (13.5.0.1) [5] = AOQuality [6] = BloodDecalsEnabled [7] = BulletDecalsEnabled + [8] = BloodDecalsLimit + [9] = BulletDecalsLimits ```
@@ -2818,6 +3382,7 @@ Last Update (13.5.0.1) [67108864] = Effects [134217728] = FriendlyFireDetectorImmunity [268435456] = FriendlyFireDetectorTempDisable + [536870912] = ServerLogLiveFeed ``` @@ -2835,6 +3400,19 @@ Last Update (13.5.0.1) +### PopupState + +
Interactables.Interobjects.PopupInterobject+PopupState + +``` + [0] = Off + [1] = Enabling + [2] = On + [3] = Disabling +``` + +
+ ### PortMapper
LiteNetLib4Mirror.Open.Nat.PortMapper @@ -2953,6 +3531,28 @@ Last Update (13.5.0.1)
+### RemoteAdminResponseFlags + +
RemoteAdminResponse+RemoteAdminResponseFlags + +``` + [1] = Successful + [2] = LogInConsole +``` + +
+ +### RemovalMode + +
InventorySystem.Items.Firearms.Extensions.WorldmodelMagazineExtension+RemovalMode + +``` + [0] = DeactivateObject + [1] = SetScaleZero +``` + +
+ ### ReproProjectAssetType
ReproProjectAssetType @@ -2979,33 +3579,13 @@ Last Update (13.5.0.1)
-### RequestType - -
InventorySystem.Items.Firearms.BasicMessages.RequestType - -``` - [0] = Unload - [1] = Reload - [2] = AdsIn - [3] = AdsOut - [4] = Dryfire - [5] = ToggleFlashlight - [6] = ReloadStop - [7] = RequestStatuses - [8] = Inspect -``` - -
- -### RespawnSequencePhase +### RespawnSetting -
Respawning.RespawnManager+RespawnSequencePhase +
Respawning.Graphics.RespawnSetting ``` - [0] = RespawnCooldown - [1] = SelectingTeam - [2] = PlayingEntryAnimations - [3] = SpawningSelectedTeam + [0] = RespawnInterfaceVisible + [1] = ObjectiveFeedVisible ```
@@ -3039,6 +3619,7 @@ Last Update (13.5.0.1) [6] = Revived [7] = RemoteAdmin [8] = Destroyed + [9] = RespawnMiniwave ```
@@ -3085,6 +3666,7 @@ Last Update (13.5.0.1) [21] = Overwatch [22] = Filmmaker [23] = Scp3114 + [24] = Destroyed [-1] = None ``` @@ -3152,17 +3734,14 @@ Last Update (13.5.0.1) -### RoomType +### RootCullablePriority -
MapGeneration.ImageGenerator+RoomType +
ProgressiveCulling.RootCullablePriority ``` - [0] = Straight - [1] = Curve - [2] = RoomT - [3] = Cross - [4] = Endoff - [5] = Prison + [0] = PreCull + [1] = Rooms + [2] = Dynamic ```
@@ -3179,6 +3758,17 @@ Last Update (13.5.0.1)
+### RpcHeader + +
InventorySystem.Items.Firearms.Modules.AnimationToggleableReloaderModule+RpcHeader + +``` + [0] = SyncLoadable + [1] = Cancel +``` + +
+ ### RpcStateMsg
PlayerRoles.PlayableScps.Scp939.Mimicry.MimicPointController+RpcStateMsg @@ -3218,6 +3808,18 @@ Last Update (13.5.0.1) ### RpcType +
PlayerRoles.PlayableScps.Scp106.Scp106StalkAbility+RpcType + +``` + [0] = StalkActive + [1] = StalkInactive + [2] = NotEnoughVigor +``` + +
+ +### RpcType +
InventorySystem.Items.MarshmallowMan.MarshmallowItem+RpcType ``` @@ -3228,6 +3830,57 @@ Last Update (13.5.0.1)
+### RpcType + +
InventorySystem.Items.Firearms.Modules.EventBasedEquipperModule+RpcType + +``` + [0] = SeedSync + [1] = FirstTimeTrue + [2] = FirstTimeFalse + [3] = ResyncAllFirstTime +``` + +
+ +### RpcType + +
InventorySystem.Items.Firearms.Modules.ImpactEffectsModule+RpcType + +``` + [0] = ImpactDecal + [1] = TracerDefault + [2] = TracerOverride + [3] = PlayerHit +``` + +
+ +### RpcType + +
InventorySystem.Items.Firearms.Modules.PumpActionModule+RpcType + +``` + [0] = ResyncOne + [1] = ResyncAll + [2] = Shoot + [3] = SchedulePump +``` + +
+ +### RpcType + +
InventorySystem.Items.Firearms.Attachments.FlashlightAttachment+RpcType + +``` + [0] = Enabled + [1] = Disabled + [2] = FullResync +``` + +
+ ### ScanSequenceStep
PlayerRoles.PlayableScps.Scp079.Scp079ScannerSequence+ScanSequenceStep @@ -3412,6 +4065,24 @@ Last Update (13.5.0.1)
+### Scp1344Status + +
InventorySystem.Items.Usables.Scp1344.Scp1344Status + +``` + [0] = Idle + [1] = Equipping + [2] = Activating + [3] = Stabbing + [4] = Active + [5] = Dropping + [6] = Deactivating + [7] = CancelingDeactivation + [8] = Inspecting +``` + +
+ ### Scp173SoundId
PlayerRoles.PlayableScps.Scp173.Scp173AudioPlayer+Scp173SoundId @@ -3630,10 +4301,22 @@ Last Update (13.5.0.1) [3] = KillLog [4] = GameEvent [5] = InternalMessage - [6] = RateLimit + [6] = AuthRateLimit [7] = Teamkill [8] = Suicide [9] = AdminChat + [10] = Query +``` + +
+ +### ServerOperativeSystem + +
Steam.ServerOperativeSystem + +``` + [108] = Linux + [119] = Windows ```
@@ -3649,6 +4332,16 @@ Last Update (13.5.0.1)
+### ServerReceivedContentType + +
Query.QueryMessage+ServerReceivedContentType + +``` + [0] = Command +``` + +
+ ### ServerShutdownState
ServerShutdown+ServerShutdownState @@ -3662,6 +4355,18 @@ Last Update (13.5.0.1)
+### ServerType + +
Steam.ServerType + +``` + [100] = Dedicated + [108] = Listen + [112] = SourceTV +``` + +
+ ### SettingType
UserSettings.GUIElements.UserSettingDependency+Dependency+SettingType @@ -3686,6 +4391,31 @@ Last Update (13.5.0.1)
+### SpawnableRoomConnectorType + +
MapGeneration.RoomConnectors.SpawnableRoomConnectorType + +``` + [0] = None + [1] = EzStandardDoor + [2] = HczStandardDoor + [3] = LczStandardDoor + [4] = HczOneSidedWall + [5] = HczTwoSidedWall + [6] = OpenHallway + [7] = OpenHallwayClutterA + [8] = OpenHallwayClutterB + [9] = OpenHallwayClutterC + [10] = OpenHallwayConstructA + [11] = HczBulkDoor + [12] = OpenHallwayClutterD + [13] = OpenHallwayClutterE + [14] = OpenHallwayClutterF + [15] = OpenHallwayClutterG +``` + +
+ ### SpawnableTeamType
Respawning.SpawnableTeamType @@ -3748,6 +4478,30 @@ Last Update (13.5.0.1)
+### SteamLobbyPrivacy + +
UserSettings.OtherSettings.SteamLobbyPrivacy + +``` + [0] = Private + [1] = Friends + [2] = Public +``` + +
+ +### StorageLocation + +
FavoriteAndHistory+StorageLocation + +``` + [0] = History + [1] = Favorites + [2] = IPHistory +``` + +
+ ### StructureType
MapGeneration.Distributors.StructureType @@ -3759,6 +4513,7 @@ Last Update (13.5.0.1) [3] = Scp079Generator [4] = SmallWallCabinet [5] = Workstation + [6] = ExperimentalWeaponLocker ```
@@ -3802,6 +4557,23 @@ Last Update (13.5.0.1) +### SyncDataFlags + +
InventorySystem.Items.Firearms.Modules.AutomaticActionModule+SyncDataFlags + +``` + [0] = None + [1] = AmmoChamberedBit0 + [2] = AmmoChamberedBit1 + [4] = AmmoChamberedBit2 + [8] = AmmoChamberedBit3 + [15] = AmmoChamberedFilter + [16] = Cocked + [32] = BoltLocked +``` + +
+ ### SyncMode
PlayerStatsSystem.SyncedStatBase+SyncMode @@ -3846,31 +4618,6 @@ Last Update (13.5.0.1)
-### ThirdpersonItemAnimationName - -
InventorySystem.Items.Thirdperson.ThirdpersonItemAnimationName - -``` - [0] = Override0 - [1] = Override1 - [2] = Override2 - [3] = IdlePoseAdditive - [4] = SprintLeftAdditive - [5] = SprintRightAdditive - [6] = SprintStraightAdditive - [7] = SprintBackAdditive - [8] = WalkLeftAdditive - [9] = WalkRightAdditive - [10] = WalkStraightAdditive - [11] = WalkBackAdditive - [12] = PrimaryAdditive - [13] = SecAdditive0 - [14] = SecAdditive1 - [15] = SecAdditive2 -``` - -
- ### TrackerMessage
PlayerRoles.PlayableScps.Scp079.Scp079ScannerSequence+TrackerMessage @@ -3885,14 +4632,26 @@ Last Update (13.5.0.1)
-### TriggerState +### TransitionStatus + +
PlayerRoles.FirstPersonControl.Thirdperson.Subcontrollers.InventorySubcontroller+TransitionStatus + +``` + [0] = RetractingPrevious + [1] = EquippingNew + [2] = Done +``` + +
+ +### TurnStatus -
InventorySystem.Items.Firearms.Modules.DoubleAction+TriggerState +
PlayerRoles.FirstPersonControl.Thirdperson.Subcontrollers.IdlePoseRetainerSubcontroller+TurnStatus ``` - [0] = Released - [1] = Pulling - [2] = SearLock + [0] = Idle + [1] = TurningRight + [2] = TurningLeft ```
@@ -3909,6 +4668,8 @@ Last Update (13.5.0.1) [4] = HideIP [5] = FlashTaskbar [6] = PhotosensitivityDoNotShow + [7] = ImperialUnits + [8] = InaccuracyAsDispersion ```
@@ -3924,6 +4685,33 @@ Last Update (13.5.0.1) +### UpdateMessageFlags + +
Respawning.UpdateMessageFlags + +``` + [0] = None + [1] = Timer + [2] = Pause + [4] = Trigger + [8] = Tokens + [11] = All +``` + +
+ +### UserResponseMode + +
UserSettings.ServerSpecific.ServerSpecificSettingBase+UserResponseMode + +``` + [0] = None + [1] = ChangeOnly + [2] = AcquisitionAndChange +``` + +
+ ### ValidationError
PlayerRoles.PlayableScps.Scp079.Scp079BlackoutRoomAbility+ValidationError @@ -4095,6 +4883,54 @@ Last Update (13.5.0.1)
+### WarheadScenarioType + +
WarheadScenarioType + +``` + [0] = Start + [1] = Resume + [2] = DeadmanSwitch +``` + +
+ +### WaveQueueState + +
Respawning.WaveManager+WaveQueueState + +``` + [0] = Idle + [1] = WaveSelected + [2] = WaveSpawning +``` + +
+ +### WearableElements + +
PlayerRoles.FirstPersonControl.Thirdperson.Subcontrollers.WearableElements + +``` + [0] = None + [1] = Scp268Hat + [2] = Scp1344Goggles +``` + +
+ +### WearableSlot + +
InventorySystem.Items.WearableSlot + +``` + [0] = Body + [1] = Eyes + [2] = Hat +``` + +
+ ### WorkstationStatus
InventorySystem.Items.Firearms.Attachments.WorkstationController+WorkstationStatus @@ -4148,6 +4984,7 @@ Last Update (13.5.0.1) | 21 | Overwatch | Dead | None | Draw | | 22 | Filmmaker | Dead | None | Draw | | 23 | Scp3114 | SCPs | Scp | Anomalies | +| 24 | Destroyed | Dead | None | Draw | ```
From 5abc9c25d812e4d403f135535bc32dcb91d3c204 Mon Sep 17 00:00:00 2001 From: Yamato Date: Mon, 25 Nov 2024 23:23:55 +0100 Subject: [PATCH 21/29] PitDeath --- EXILED/Exiled.API/Extensions/EffectTypeExtension.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/EXILED/Exiled.API/Extensions/EffectTypeExtension.cs b/EXILED/Exiled.API/Extensions/EffectTypeExtension.cs index a4de4fda76..0ec8cd8239 100644 --- a/EXILED/Exiled.API/Extensions/EffectTypeExtension.cs +++ b/EXILED/Exiled.API/Extensions/EffectTypeExtension.cs @@ -76,6 +76,7 @@ public static class EffectTypeExtension { EffectType.Slowness, typeof(Slowness) }, { EffectType.Scp1344, typeof(Scp1344) }, { EffectType.SeveredEyes, typeof(SeveredEyes) }, + { EffectType.PitDeath, typeof(PitDeath) }, }); /// From 8a52f98aedc1bca0512ab6fc3fd4b3579c645c53 Mon Sep 17 00:00:00 2001 From: Yamato Date: Mon, 25 Nov 2024 23:27:49 +0100 Subject: [PATCH 22/29] effect uppdate --- EXILED/Exiled.API/Enums/EffectType.cs | 12 +++++++++++- EXILED/Exiled.API/Extensions/EffectTypeExtension.cs | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/EXILED/Exiled.API/Enums/EffectType.cs b/EXILED/Exiled.API/Enums/EffectType.cs index 249643e0d3..b2894486ee 100644 --- a/EXILED/Exiled.API/Enums/EffectType.cs +++ b/EXILED/Exiled.API/Enums/EffectType.cs @@ -21,7 +21,7 @@ public enum EffectType /// /// This EffectType do not exist it's only use when not found or error. /// - None = -1, // TODO: remove = -1 + None, /// /// The player isn't able to open their inventory or reload a weapon. @@ -249,5 +249,15 @@ public enum EffectType /// . /// SeveredEyes, + + /// + /// . + /// + PitDeath, + + /// + /// . + /// + Blurred, } } diff --git a/EXILED/Exiled.API/Extensions/EffectTypeExtension.cs b/EXILED/Exiled.API/Extensions/EffectTypeExtension.cs index 0ec8cd8239..0b977356e1 100644 --- a/EXILED/Exiled.API/Extensions/EffectTypeExtension.cs +++ b/EXILED/Exiled.API/Extensions/EffectTypeExtension.cs @@ -77,6 +77,7 @@ public static class EffectTypeExtension { EffectType.Scp1344, typeof(Scp1344) }, { EffectType.SeveredEyes, typeof(SeveredEyes) }, { EffectType.PitDeath, typeof(PitDeath) }, + { EffectType.Blurred, typeof(Blurred) }, }); /// From 14b30d399ee135fb7476bac75cdd6ba774eea53e Mon Sep 17 00:00:00 2001 From: Nameless <85962933+Misfiy@users.noreply.github.com> Date: Tue, 26 Nov 2024 13:55:03 +0100 Subject: [PATCH 23/29] that? --- EXILED/Exiled.API/Features/Npc.cs | 3 +++ EXILED/Exiled.API/Features/Player.cs | 3 +-- EXILED/Exiled.API/Features/Roles/Scp106Role.cs | 9 ++++++--- EXILED/Exiled.CustomItems/API/Features/CustomWeapon.cs | 4 ++-- .../EventArgs/Scp079/ElevatorTeleportingEventArgs.cs | 2 +- EXILED/Exiled.Events/Events.cs | 4 ++-- .../Patches/Events/Map/ExplodingFlashGrenade.cs | 5 +++-- .../Patches/Events/Player/ChangingRoleAndSpawned.cs | 7 ++----- .../Patches/Events/Scp330/InteractingScp330.cs | 1 - 9 files changed, 20 insertions(+), 18 deletions(-) diff --git a/EXILED/Exiled.API/Features/Npc.cs b/EXILED/Exiled.API/Features/Npc.cs index 28ee0d1174..09e519ac63 100644 --- a/EXILED/Exiled.API/Features/Npc.cs +++ b/EXILED/Exiled.API/Features/Npc.cs @@ -5,6 +5,8 @@ // // ----------------------------------------------------------------------- +using GameCore; + namespace Exiled.API.Features { #nullable enable @@ -144,6 +146,7 @@ public override Vector3 Position [Obsolete("This metod is marked as obsolet due to a bug that make player have the same id. Use Npc.Spawn(string) instead")] public static Npc Spawn(string name, RoleTypeId role, int id = 0, string userId = PlayerAuthenticationManager.DedicatedId, Vector3? position = null) { + // TODO: Use DummyUtils.SpawnDummy GameObject newObject = UnityEngine.Object.Instantiate(Mirror.NetworkManager.singleton.playerPrefab); Npc npc = new(newObject) diff --git a/EXILED/Exiled.API/Features/Player.cs b/EXILED/Exiled.API/Features/Player.cs index 1af09fa4fc..9c6df0940e 100644 --- a/EXILED/Exiled.API/Features/Player.cs +++ b/EXILED/Exiled.API/Features/Player.cs @@ -36,9 +36,7 @@ namespace Exiled.API.Features using InventorySystem.Disarming; using InventorySystem.Items; using InventorySystem.Items.Armor; - using InventorySystem.Items.Firearms; using InventorySystem.Items.Firearms.Attachments; - using InventorySystem.Items.Firearms.BasicMessages; using InventorySystem.Items.Firearms.Modules; using InventorySystem.Items.Firearms.ShotEvents; using InventorySystem.Items.Usables; @@ -47,6 +45,7 @@ namespace Exiled.API.Features using MEC; using Mirror; using Mirror.LiteNetLib4Mirror; + using NorthwoodLib; using PlayerRoles; using PlayerRoles.FirstPersonControl; using PlayerRoles.RoleAssign; diff --git a/EXILED/Exiled.API/Features/Roles/Scp106Role.cs b/EXILED/Exiled.API/Features/Roles/Scp106Role.cs index ff93dbbed0..917047252c 100644 --- a/EXILED/Exiled.API/Features/Roles/Scp106Role.cs +++ b/EXILED/Exiled.API/Features/Roles/Scp106Role.cs @@ -13,7 +13,6 @@ namespace Exiled.API.Features.Roles using PlayerRoles; using PlayerRoles.PlayableScps; using PlayerRoles.PlayableScps.HumeShield; - using PlayerRoles.PlayableScps.Scp049; using PlayerRoles.PlayableScps.Scp106; using PlayerRoles.Subroutines; using PlayerStatsSystem; @@ -125,8 +124,12 @@ public float Vigor /// public bool IsSubmerged { - get => Base.IsSubmerged; - set => HuntersAtlasAbility.SetSubmerged(value); + get => HuntersAtlasAbility._syncSubmerged; + set + { + HuntersAtlasAbility._syncSubmerged = value; + HuntersAtlasAbility.ServerSendRpc(true); + } } /// diff --git a/EXILED/Exiled.CustomItems/API/Features/CustomWeapon.cs b/EXILED/Exiled.CustomItems/API/Features/CustomWeapon.cs index 8151b4d55c..d55782b6ef 100644 --- a/EXILED/Exiled.CustomItems/API/Features/CustomWeapon.cs +++ b/EXILED/Exiled.CustomItems/API/Features/CustomWeapon.cs @@ -104,7 +104,7 @@ public override ItemType Type if (!Attachments.IsEmpty()) firearm.AddAttachment(Attachments); - byte ammo = firearm.Ammo; + int ammo = firearm.Ammo; firearm.MaxAmmo = ClipSize; Log.Debug($"{nameof(Name)}.{nameof(Spawn)}: Spawning weapon with {ammo} ammo."); Pickup? pickup = firearm.CreatePickup(position); @@ -214,7 +214,7 @@ private void OnInternalReloading(ReloadingWeaponEventArgs ev) Log.Debug($"{nameof(Name)}.{nameof(OnInternalReloading)}: Continuing with internal reload.."); ev.IsAllowed = false; - byte remainingClip = ((Firearm)ev.Player.CurrentItem).Ammo; + int remainingClip = ((Firearm)ev.Player.CurrentItem).Ammo; if (remainingClip >= ClipSize) return; diff --git a/EXILED/Exiled.Events/EventArgs/Scp079/ElevatorTeleportingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Scp079/ElevatorTeleportingEventArgs.cs index da8aae1748..48d137a32f 100644 --- a/EXILED/Exiled.Events/EventArgs/Scp079/ElevatorTeleportingEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Scp079/ElevatorTeleportingEventArgs.cs @@ -40,7 +40,7 @@ public ElevatorTeleportingEventArgs(Player player, RoomIdentifier room, Elevator Player = player; Scp079 = player.Role.As(); Room = Room.Get(room); - Lift = Lift.Get(elevatorDoor.TargetPanel.AssignedChamber); + Lift = Lift.Get(elevatorDoor.Chamber); AuxiliaryPowerCost = auxiliaryPowerCost; IsAllowed = auxiliaryPowerCost <= Scp079.Energy; } diff --git a/EXILED/Exiled.Events/Events.cs b/EXILED/Exiled.Events/Events.cs index f11eab2e17..cb3d0e166b 100644 --- a/EXILED/Exiled.Events/Events.cs +++ b/EXILED/Exiled.Events/Events.cs @@ -60,7 +60,7 @@ public override void OnEnabled() PlayerAuthenticationManager.OnInstanceModeChanged -= RoleAssigner.CheckLateJoin; SceneManager.sceneUnloaded += Handlers.Internal.SceneUnloaded.OnSceneUnloaded; - MapGeneration.SeedSynchronizer.OnMapGenerated += Handlers.Internal.MapGenerated.OnMapGenerated; + MapGeneration.SeedSynchronizer.OnGenerationFinished += Handlers.Internal.MapGenerated.OnMapGenerated; UsableItemsController.ServerOnUsingCompleted += Handlers.Internal.Round.OnServerOnUsingCompleted; Handlers.Server.WaitingForPlayers += Handlers.Internal.Round.OnWaitingForPlayers; Handlers.Server.RestartingRound += Handlers.Internal.Round.OnRestartingRound; @@ -92,7 +92,7 @@ public override void OnDisabled() Unpatch(); SceneManager.sceneUnloaded -= Handlers.Internal.SceneUnloaded.OnSceneUnloaded; - MapGeneration.SeedSynchronizer.OnMapGenerated -= Handlers.Internal.MapGenerated.OnMapGenerated; + MapGeneration.SeedSynchronizer.OnGenerationFinished -= Handlers.Internal.MapGenerated.OnMapGenerated; UsableItemsController.ServerOnUsingCompleted -= Handlers.Internal.Round.OnServerOnUsingCompleted; Handlers.Server.WaitingForPlayers -= Handlers.Internal.Round.OnWaitingForPlayers; Handlers.Server.RestartingRound -= Handlers.Internal.Round.OnRestartingRound; diff --git a/EXILED/Exiled.Events/Patches/Events/Map/ExplodingFlashGrenade.cs b/EXILED/Exiled.Events/Patches/Events/Map/ExplodingFlashGrenade.cs index 3237e5603c..29cabcadbf 100644 --- a/EXILED/Exiled.Events/Patches/Events/Map/ExplodingFlashGrenade.cs +++ b/EXILED/Exiled.Events/Patches/Events/Map/ExplodingFlashGrenade.cs @@ -14,6 +14,7 @@ namespace Exiled.Events.Patches.Events.Map using API.Features.Pools; using Exiled.Events.EventArgs.Map; using Exiled.Events.Patches.Generic; + using Footprinting; using HarmonyLib; using InventorySystem.Items.ThrowableProjectiles; using UnityEngine; @@ -67,9 +68,9 @@ private static void ProcessEvent(FlashbangGrenade instance, float distance) Player player = Player.Get(referenceHub); if ((instance.transform.position - referenceHub.transform.position).sqrMagnitude >= distance) continue; - if (!ExiledEvents.Instance.Config.CanFlashbangsAffectThrower && instance.PreviousOwner.SameLife(new(referenceHub))) + if (!ExiledEvents.Instance.Config.CanFlashbangsAffectThrower && instance.PreviousOwner.LifeIdentifier != new Footprint(referenceHub).LifeIdentifier) continue; - if (!IndividualFriendlyFire.CheckFriendlyFirePlayer(instance.PreviousOwner, player.ReferenceHub) && !instance.PreviousOwner.SameLife(new(referenceHub))) + if (!IndividualFriendlyFire.CheckFriendlyFirePlayer(instance.PreviousOwner, player.ReferenceHub) && instance.PreviousOwner.LifeIdentifier != new Footprint(referenceHub).LifeIdentifier) continue; if (Physics.Linecast(instance.transform.position, player.CameraTransform.position, instance._blindingMask)) continue; diff --git a/EXILED/Exiled.Events/Patches/Events/Player/ChangingRoleAndSpawned.cs b/EXILED/Exiled.Events/Patches/Events/Player/ChangingRoleAndSpawned.cs index d89fa46762..37cbdc9e7a 100644 --- a/EXILED/Exiled.Events/Patches/Events/Player/ChangingRoleAndSpawned.cs +++ b/EXILED/Exiled.Events/Patches/Events/Player/ChangingRoleAndSpawned.cs @@ -14,16 +14,13 @@ namespace Exiled.Events.Patches.Events.Player using API.Features; using API.Features.Pools; - using API.Features.Roles; using Exiled.Events.EventArgs.Player; - using HarmonyLib; - using InventorySystem; + using InventorySystem.Items; using InventorySystem.Items.Armor; using InventorySystem.Items.Pickups; - using PlayerRoles; using static HarmonyLib.AccessTools; @@ -238,7 +235,7 @@ private static void ChangeInventory(ChangingRoleEventArgs ev) } foreach (ItemType item in ev.Items) - inventory.ServerAddItem(item); + inventory.ServerAddItem(item, ItemAddReason.StartingItem); foreach (KeyValuePair keyValuePair in ev.Ammo) inventory.ServerAddAmmo(keyValuePair.Key, keyValuePair.Value); diff --git a/EXILED/Exiled.Events/Patches/Events/Scp330/InteractingScp330.cs b/EXILED/Exiled.Events/Patches/Events/Scp330/InteractingScp330.cs index 28b657a45f..63907bb773 100644 --- a/EXILED/Exiled.Events/Patches/Events/Scp330/InteractingScp330.cs +++ b/EXILED/Exiled.Events/Patches/Events/Scp330/InteractingScp330.cs @@ -13,7 +13,6 @@ namespace Exiled.Events.Patches.Events.Scp330 using System.Collections.Generic; using System.Reflection.Emit; - using Exiled.API.Features.Items; using Exiled.API.Features.Pools; using Exiled.Events.Attributes; using Exiled.Events.EventArgs.Scp330; From 3f07d0e815427c3edb688f314a2c5a41c6e1e037 Mon Sep 17 00:00:00 2001 From: Nameless <85962933+Misfiy@users.noreply.github.com> Date: Tue, 26 Nov 2024 14:42:15 +0100 Subject: [PATCH 24/29] respawn + npc + remove obsolete --- EXILED/Exiled.API/Enums/SpawnLocationType.cs | 6 -- .../Exiled.API/Extensions/MirrorExtensions.cs | 11 --- EXILED/Exiled.API/Features/Items/Armor.cs | 9 +- .../Exiled.API/Features/Items/Flashlight.cs | 7 -- EXILED/Exiled.API/Features/Map.cs | 19 ---- EXILED/Exiled.API/Features/Npc.cs | 21 ++++- EXILED/Exiled.API/Features/Pickups/Pickup.cs | 24 +---- .../Pickups/Projectiles/Projectile.cs | 13 --- .../Pickups/Projectiles/Scp018Projectile.cs | 11 +-- EXILED/Exiled.API/Features/Player.cs | 89 +------------------ EXILED/Exiled.API/Features/Respawn.cs | 30 ++++++- .../Exiled.API/Features/Roles/Scp3114Role.cs | 13 +-- EXILED/Exiled.API/Features/Round.cs | 9 +- EXILED/Exiled.API/Features/Server.cs | 8 -- 14 files changed, 54 insertions(+), 216 deletions(-) diff --git a/EXILED/Exiled.API/Enums/SpawnLocationType.cs b/EXILED/Exiled.API/Enums/SpawnLocationType.cs index 927542ffe3..12d32ce2a2 100644 --- a/EXILED/Exiled.API/Enums/SpawnLocationType.cs +++ b/EXILED/Exiled.API/Enums/SpawnLocationType.cs @@ -147,11 +147,5 @@ public enum SpawnLocationType /// Just inside the door at the bottom of the server's room. /// InsideServersBottom, - - /// - /// Inside a random locker on the map. - /// - [Obsolete("Use LockerSpawnPoint instead")] - InsideLocker, } } \ No newline at end of file diff --git a/EXILED/Exiled.API/Extensions/MirrorExtensions.cs b/EXILED/Exiled.API/Extensions/MirrorExtensions.cs index 5709838998..1339044732 100644 --- a/EXILED/Exiled.API/Extensions/MirrorExtensions.cs +++ b/EXILED/Exiled.API/Extensions/MirrorExtensions.cs @@ -224,17 +224,6 @@ public static void SetName(this Player target, Player player, string name) target.SendFakeSyncVar(player.NetworkIdentity, typeof(NicknameSync), nameof(NicknameSync.Network_displayName), name); } - /// - /// Sets of a that only the player can see. - /// - /// Room to modify. - /// Only this player can see room color. - /// Light intensity multiplier to set. - [Obsolete("This features has been remove by NW", true)] - public static void SetRoomLightIntensityForTargetOnly(this Room room, Player target, float multiplier) - { - } - /// /// Change character model for appearance. /// It will continue until 's changes. diff --git a/EXILED/Exiled.API/Features/Items/Armor.cs b/EXILED/Exiled.API/Features/Items/Armor.cs index 30b99bc7c8..6fe2bc0975 100644 --- a/EXILED/Exiled.API/Features/Items/Armor.cs +++ b/EXILED/Exiled.API/Features/Items/Armor.cs @@ -115,14 +115,9 @@ public float StaminaUseMultiplier public float StaminaRegenMultiplier { get; set; } = 1f; /// - /// Gets or sets how much the users movement speed should be affected when wearing this armor. (higher values = slower movement). + /// Gets how much the users movement speed should be affected when wearing this armor. (higher values = slower movement). /// - public float MovementSpeedMultiplier - { - get => Base._movementSpeedMultiplier; - [Obsolete("This Setter was causing desync to client", true)] - set => _ = value; - } + public float MovementSpeedMultiplier => Base._movementSpeedMultiplier; /// /// Gets how much worse and s are affected by wearing this armor. diff --git a/EXILED/Exiled.API/Features/Items/Flashlight.cs b/EXILED/Exiled.API/Features/Items/Flashlight.cs index 7cdf432bf3..0e9de906ba 100644 --- a/EXILED/Exiled.API/Features/Items/Flashlight.cs +++ b/EXILED/Exiled.API/Features/Items/Flashlight.cs @@ -45,13 +45,6 @@ internal Flashlight(ItemType type) /// Can be or . public new ToggleableLightItemBase Base { get; } - /// - [Obsolete("Use IsEmittingLight instead.")] - public bool Active - { - get => IsEmittingLight; - set => IsEmittingLight = value; - } /// /// Gets or sets a value indicating whether the item is emitting light. diff --git a/EXILED/Exiled.API/Features/Map.cs b/EXILED/Exiled.API/Features/Map.cs index 8bcd02ba2a..d3950db22a 100644 --- a/EXILED/Exiled.API/Features/Map.cs +++ b/EXILED/Exiled.API/Features/Map.cs @@ -74,15 +74,6 @@ DecontaminationController.Singleton.NetworkDecontaminationOverride is Decontamin /// public static ReadOnlyCollection PocketDimensionTeleports { get; } = TeleportsValue.AsReadOnly(); - /// - /// Gets all objects in the current map. - /// - /// - /// This property is obsolete. Use instead to retrieve a collection of all instances. - /// - [Obsolete("Use Locker.List instead.")] - public static ReadOnlyCollection Lockers { get; } = Features.Lockers.Locker.BaseToExiledLockers.Keys.ToList().AsReadOnly(); - /// /// Gets all objects. /// @@ -229,16 +220,6 @@ public static void ResetLightsColor() light.NetworkOverrideColor = Color.clear; } - /// - /// Gets a random object from the current map. - /// - /// - /// This method is obsolete. Use instead to get a random instance. - /// - /// A randomly selected object. - [Obsolete("Use Locker.Random() instead.")] - public static MapGeneration.Distributors.Locker GetRandomLocker() => Lockers.GetRandomValue(); - /// /// Gets a random . /// diff --git a/EXILED/Exiled.API/Features/Npc.cs b/EXILED/Exiled.API/Features/Npc.cs index 09e519ac63..d31b0b5303 100644 --- a/EXILED/Exiled.API/Features/Npc.cs +++ b/EXILED/Exiled.API/Features/Npc.cs @@ -5,8 +5,6 @@ // // ----------------------------------------------------------------------- -using GameCore; - namespace Exiled.API.Features { #nullable enable @@ -21,6 +19,7 @@ namespace Exiled.API.Features using Exiled.API.Features.Components; using Exiled.API.Features.Roles; using Footprinting; + using GameCore; using MEC; using Mirror; using PlayerRoles; @@ -134,6 +133,21 @@ public override Vector3 Position /// The NPC associated with the NetworkConnection, or null if not found. public static new Npc? Get(NetworkConnection conn) => Player.Get(conn) as Npc; + // TODO: Write docs. + public static Npc Create(string name, RoleTypeId role, Vector3 position) + { + // TODO: Test this. + Npc npc = new(DummyUtils.SpawnDummy(name)) + { + IsNPC = true, + }; + + npc.Role.Set(role); + npc.Position = position; + + return npc; + } + /// /// Spawns an NPC based on the given parameters. /// @@ -143,10 +157,9 @@ public override Vector3 Position /// The userID of the NPC. /// The position to spawn the NPC. /// The spawned. - [Obsolete("This metod is marked as obsolet due to a bug that make player have the same id. Use Npc.Spawn(string) instead")] + [Obsolete("This method is marked as obsolete due to a bug that make player have the same id. Use Npc.Spawn(string) instead", true)] public static Npc Spawn(string name, RoleTypeId role, int id = 0, string userId = PlayerAuthenticationManager.DedicatedId, Vector3? position = null) { - // TODO: Use DummyUtils.SpawnDummy GameObject newObject = UnityEngine.Object.Instantiate(Mirror.NetworkManager.singleton.playerPrefab); Npc npc = new(newObject) diff --git a/EXILED/Exiled.API/Features/Pickups/Pickup.cs b/EXILED/Exiled.API/Features/Pickups/Pickup.cs index 89e9df4875..286e7cf7b8 100644 --- a/EXILED/Exiled.API/Features/Pickups/Pickup.cs +++ b/EXILED/Exiled.API/Features/Pickups/Pickup.cs @@ -130,16 +130,7 @@ internal Pickup(ItemType type) /// /// Gets or sets the pickup's PhysicsModule. /// - public PickupStandardPhysics PhysicsModule - { - get => Base.PhysicsModule as PickupStandardPhysics; - [Obsolete("Unsafe.")] - set - { - Base.PhysicsModule.DestroyModule(); - Base.PhysicsModule = value; - } - } + public PickupStandardPhysics PhysicsModule => Base.PhysicsModule as PickupStandardPhysics; /// /// Gets or sets the unique serial number for the item. @@ -557,19 +548,6 @@ public static Pickup Create(ItemType type) public static Pickup CreateAndSpawn(ItemType type, Vector3 position, Quaternion rotation, Player previousOwner = null) where T : Pickup => CreateAndSpawn(type, position, rotation, previousOwner) as T; - /// - /// Spawns a . - /// - /// The too spawn. - /// The position to spawn the at. - /// The rotation to spawn the . - /// An optional previous owner of the item. - /// The Spawn. - /// - [Obsolete("Use pickup.Spawn(Vector3, Quaternion, Player) instead of this", true)] - public static Pickup Spawn(Pickup pickup, Vector3 position, Quaternion rotation, Player previousOwner = null) - => pickup.Spawn(position, rotation, previousOwner); - /// /// Returns the amount of time it will take for the provided to pick up this item, based on and active status effects. /// diff --git a/EXILED/Exiled.API/Features/Pickups/Projectiles/Projectile.cs b/EXILED/Exiled.API/Features/Pickups/Projectiles/Projectile.cs index e6bdb26149..7abab57d65 100644 --- a/EXILED/Exiled.API/Features/Pickups/Projectiles/Projectile.cs +++ b/EXILED/Exiled.API/Features/Pickups/Projectiles/Projectile.cs @@ -114,19 +114,6 @@ internal Projectile(ItemType type) public static Projectile Create(ProjectileType projectiletype) where T : Projectile => Create(projectiletype) as T; - /// - /// Spawns a . - /// - /// The too spawn. - /// The position to spawn the at. - /// The rotation to spawn the . - /// Whether the should be in active state after spawn. - /// An optional previous owner of the item. - /// The Spawn. - [Obsolete("Use pickup.Spawn(Vector3, Quaternion, Player) instead of this", true)] - public static Projectile Spawn(Projectile pickup, Vector3 position, Quaternion rotation, bool shouldBeActive = true, Player previousOwner = null) - => pickup.Spawn(position, rotation, shouldBeActive, previousOwner); - /// /// Creates and spawns a . /// diff --git a/EXILED/Exiled.API/Features/Pickups/Projectiles/Scp018Projectile.cs b/EXILED/Exiled.API/Features/Pickups/Projectiles/Scp018Projectile.cs index 1452a921d7..6bb4763708 100644 --- a/EXILED/Exiled.API/Features/Pickups/Projectiles/Scp018Projectile.cs +++ b/EXILED/Exiled.API/Features/Pickups/Projectiles/Scp018Projectile.cs @@ -52,16 +52,7 @@ internal Scp018Projectile() /// /// Gets or sets the pickup's PhysicsModule. /// - public new Scp018Physics PhysicsModule - { - get => Base.PhysicsModule as Scp018Physics; - [Obsolete("Unsafe.", true)] - set - { - Base.PhysicsModule.DestroyModule(); - Base.PhysicsModule = value; - } - } + public new Scp018Physics PhysicsModule => Base.PhysicsModule as Scp018Physics; /// /// Gets or sets the pickup's max velocity. diff --git a/EXILED/Exiled.API/Features/Player.cs b/EXILED/Exiled.API/Features/Player.cs index 9c6df0940e..cee9a0fd94 100644 --- a/EXILED/Exiled.API/Features/Player.cs +++ b/EXILED/Exiled.API/Features/Player.cs @@ -158,7 +158,7 @@ public Player(GameObject gameObject) public Dictionary> CustomRoleFriendlyFireMultiplier { get; set; } = DictionaryPool>.Pool.Get(); /// - /// Gets or sets a unique custom role that does not adbide to base game for this player. Used in conjunction with . + /// Gets or sets a unique custom role that does not abide to base game for this player. Used in conjunction with . /// public string UniqueRole { get; set; } = string.Empty; @@ -260,12 +260,6 @@ public int Id /// public string UserId => referenceHub.authManager.UserId; - /// - /// Gets or sets the player's custom user id. - /// - [Obsolete("Remove by NW", true)] - public string CustomUserId { get; set; } - /// /// Gets the player's user id without the authentication. /// @@ -2471,17 +2465,6 @@ public ushort GetAmmoLimit(AmmoType type, bool ignoreArmor = false) return InventorySystem.Configs.InventoryLimits.GetAmmoLimit(type.GetItemType(), referenceHub); } - /// - /// Gets the maximum amount of ammo the player can hold, given the ammo . - /// - /// The of the ammo to check. - /// The maximum amount of ammo this player can carry. - [Obsolete("Use Player::GetAmmoLimit(AmmoType, bool) instead.")] - public int GetAmmoLimit(AmmoType type) - { - return (int)InventorySystem.Configs.InventoryLimits.GetAmmoLimit(type.GetItemType(), referenceHub); - } - /// /// Gets the maximum amount of ammo the player can hold, given the ammo . /// This limit will scale with the armor the player is wearing. @@ -2538,15 +2521,6 @@ public void ResetAmmoLimit(AmmoType ammoType) /// If the player has a custom limit for the specific . public bool HasCustomAmmoLimit(AmmoType ammoType) => CustomAmmoLimits.ContainsKey(ammoType); - /// - /// Gets the maximum amount of an the player can hold, based on the armor the player is wearing, as well as server configuration. - /// - /// The to check. - /// The maximum amount of items in the category that the player can hold. - [Obsolete("Use Player::GetCategoryLimit(ItemCategory, bool) instead.")] - public int GetCategoryLimit(ItemCategory category) => - InventorySystem.Configs.InventoryLimits.GetCategoryLimit(category, referenceHub); - /// /// Gets the maximum amount of an the player can hold, based on the armor the player is wearing, as well as server configuration. /// @@ -2674,16 +2648,6 @@ public Item AddItem(ItemType itemType) return item; } - /// - /// Adds an item of the specified type with default durability(ammo/charge) and no mods to the player's inventory. - /// - /// The item to be added. - /// The attachments to be added to the item. - /// The given to the player. - [Obsolete("Use AddItem(ItemType) or AddItem(FirearmType, IEnumerable)", true)] - public Item AddItem(ItemType itemType, IEnumerable identifiers = null) - => itemType.GetFirearmType() is FirearmType.None ? AddItem(itemType) : AddItem(itemType.GetFirearmType(), identifiers); - /// /// Adds an firearm of the specified type with default durability(ammo/charge) and no mods to the player's inventory. /// @@ -2735,17 +2699,6 @@ public IEnumerable AddItem(ItemType itemType, int amount) return items; } - /// - /// Adds the amount of items of the specified type with default durability(ammo/charge) and no mods to the player's inventory. - /// - /// The item to be added. - /// The amount of items to be added. - /// The attachments to be added to the item. - /// An containing the items given. - [Obsolete("Use AddItem(ItemType, int) or AddItem(FirearmType, int, IEnumerable)", true)] - public IEnumerable AddItem(ItemType itemType, int amount, IEnumerable identifiers) - => itemType.GetFirearmType() is FirearmType.None ? AddItem(itemType, amount) : AddItem(itemType.GetFirearmType(), amount, identifiers); - /// /// Adds the amount of firearms of the specified type with default durability(ammo/charge) and no mods to the player's inventory. /// @@ -2785,22 +2738,6 @@ public IEnumerable AddItem(IEnumerable items) return returnedItems; } - /// - /// Adds the list of items of the specified type with default durability(ammo/charge) and no mods to the player's inventory. - /// - /// The of and of to be added. - /// An containing the items given. - [Obsolete("Use AddItem(Dictionary>) instead of this", true)] - public IEnumerable AddItem(Dictionary> items) - { - List returnedItems = new(items.Count); - - foreach (KeyValuePair> item in items) - returnedItems.Add(AddItem(item.Key, item.Value)); - - return returnedItems; - } - /// /// Adds the list of items of the specified type with default durability(ammo/charge) and no mods to the player's inventory. /// @@ -2909,23 +2846,6 @@ public Item AddItem(ItemBase itemBase, Item item = null) return null; } - /// - /// Adds the of items to the player's inventory. - /// - /// The item to be added. - /// The amount of items to be added. - [Obsolete("Removed this method can't be functional")] - public void AddItem(Item item, int amount) => _ = item; - - /// - /// Adds the of items to the player's inventory. - /// - /// The firearm to be added. - /// The amount of items to be added. - /// The attachments to be added to the item. - [Obsolete("Removed this method can't be functional")] - public void AddItem(Firearm firearm, int amount, IEnumerable identifiers) => _ = firearm; - /// /// Adds the list of items to the player's inventory. /// @@ -3368,13 +3288,6 @@ public void EnableEffects(IEnumerable types, float duration = 0f, bo } } - /// - /// Enables a of on the player. - /// - /// The of to enable. - [Obsolete("Use SyncEffects(IEnumerable) instead of this")] - public void EnableEffects(IEnumerable effects) => SyncEffects(effects); - /// /// Syncs a of on the player. /// diff --git a/EXILED/Exiled.API/Features/Respawn.cs b/EXILED/Exiled.API/Features/Respawn.cs index 9ac5d68125..ad9a69cff4 100644 --- a/EXILED/Exiled.API/Features/Respawn.cs +++ b/EXILED/Exiled.API/Features/Respawn.cs @@ -15,6 +15,7 @@ namespace Exiled.API.Features using Enums; using PlayerRoles; using Respawning; + using Respawning.Waves; using UnityEngine; /// @@ -81,10 +82,15 @@ public static float TimeUntilNextPhase /// public static DateTime NextTeamTime => DateTime.UtcNow.AddSeconds(TimeUntilSpawnWave.TotalSeconds); + /// + /// Gets the current state of the . + /// + public static WaveManager.WaveQueueState CurrentState => WaveManager.State; + /// /// Gets a value indicating whether a team is currently being spawned or the animations are playing for a team. /// - public static bool IsSpawning => RespawnManager.Singleton._curSequence is RespawnManager.RespawnSequencePhase.PlayingEntryAnimations or RespawnManager.RespawnSequencePhase.SpawningSelectedTeam; + public static bool IsSpawning => WaveManager.State == WaveManager.WaveQueueState.WaveSpawning; /// /// Gets or sets the amount of spawn tickets belonging to the Chaos Insurgency. @@ -138,6 +144,28 @@ public static bool ProtectedCanShoot /// public static List ProtectedTeams => SpawnProtected.ProtectedTeams; + // TODO: Docs (can include miniwave). + public static bool TryGetWaveBase(out T spawnWave) + where T : SpawnableWaveBase => WaveManager.TryGet(out spawnWave); + + // TODO: Docs (Does not include mini wave). + public static bool TryGetWaveBase(Faction faction, out SpawnableWaveBase spawnWave) + => WaveManager.TryGet(out spawnWave); + + // TODO: Docs. + public static void AdvanceTime(Faction faction, float time) => WaveManager.AdvanceTimer(faction, time); + + // TODO: Docs. + public static void SpawnWave(SpawnableWaveBase wave) => WaveManager.Spawn(wave); + + // TODO: Docs. + public static void SpawnWave(Faction faction, bool mini) + where T : SpawnableWaveBase + { + if (TryGetWaveBase(out T wave)) + SpawnWave(wave); + } + /// /// Play an effect when a certain class spawns. /// diff --git a/EXILED/Exiled.API/Features/Roles/Scp3114Role.cs b/EXILED/Exiled.API/Features/Roles/Scp3114Role.cs index 05a28e0f80..ab157b92cd 100644 --- a/EXILED/Exiled.API/Features/Roles/Scp3114Role.cs +++ b/EXILED/Exiled.API/Features/Roles/Scp3114Role.cs @@ -7,7 +7,6 @@ namespace Exiled.API.Features.Roles { - using System; using System.Collections.Generic; using Exiled.API.Enums; @@ -158,22 +157,12 @@ public RoleTypeId StolenRole } } - /// - /// Gets or sets the SCP-3114's Ragdoll used for it's FakeIdentity. - /// - [Obsolete("Ragdoll in Role now has other meaning. Use IdentityRagdoll instead.")] - public new Ragdoll Ragdoll - { - get => IdentityRagdoll; - set => IdentityRagdoll = value; - } - /// /// Gets or sets the SCP-3114's Ragdoll used for it's FakeIdentity. /// public Ragdoll IdentityRagdoll { - get => Ragdoll.Get(Identity.CurIdentity.Ragdoll); + get => Features.Ragdoll.Get(Identity.CurIdentity.Ragdoll); set { Identity.CurIdentity.Ragdoll = value?.Base; diff --git a/EXILED/Exiled.API/Features/Round.cs b/EXILED/Exiled.API/Features/Round.cs index bda3f192cc..d998c06a3c 100644 --- a/EXILED/Exiled.API/Features/Round.cs +++ b/EXILED/Exiled.API/Features/Round.cs @@ -122,14 +122,9 @@ public static int Kills } /// - /// Gets or sets the number of surviving SCPs. + /// Gets the number of surviving SCPs. /// - public static int SurvivingSCPs - { - get => RoundSummary.SurvivingSCPs; - [Obsolete("This value is rewritten by NW every time it's used", true)] - set => RoundSummary.SurvivingSCPs = value; - } + public static int SurvivingSCPs => RoundSummary.SurvivingSCPs; /// /// Gets or sets the number of kills made by SCPs. diff --git a/EXILED/Exiled.API/Features/Server.cs b/EXILED/Exiled.API/Features/Server.cs index af596f6310..c79d0c4c1d 100644 --- a/EXILED/Exiled.API/Features/Server.cs +++ b/EXILED/Exiled.API/Features/Server.cs @@ -267,14 +267,6 @@ public static bool ShutdownRedirect(ushort redirectPort) return true; } - /// - /// Runs a server command. - /// - /// The command to be run. - /// The running the command. - [Obsolete("Use Server.ExecuteCommand() instead.")] - public static void RunCommand(string command, CommandSender sender = null) => GameCore.Console.singleton.TypeCommand(command, sender); - /// /// Executes a server command. /// From d9dabe0f7616a902a52089d0f08d02505aea0870 Mon Sep 17 00:00:00 2001 From: Nameless <85962933+Misfiy@users.noreply.github.com> Date: Tue, 26 Nov 2024 14:48:29 +0100 Subject: [PATCH 25/29] fix signature --- EXILED/Exiled.Events/Patches/Fixes/NWFixScp096BreakingDoor.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/EXILED/Exiled.Events/Patches/Fixes/NWFixScp096BreakingDoor.cs b/EXILED/Exiled.Events/Patches/Fixes/NWFixScp096BreakingDoor.cs index 0e98e6559b..8360e824c6 100644 --- a/EXILED/Exiled.Events/Patches/Fixes/NWFixScp096BreakingDoor.cs +++ b/EXILED/Exiled.Events/Patches/Fixes/NWFixScp096BreakingDoor.cs @@ -5,6 +5,8 @@ // // ----------------------------------------------------------------------- +using Footprinting; + namespace Exiled.Events.Patches.Fixes { using System.Collections.Generic; @@ -20,7 +22,7 @@ namespace Exiled.Events.Patches.Fixes using static HarmonyLib.AccessTools; /// - /// Patches the delegate. + /// Patches the delegate. /// Fixes open doors getting easily broke. /// Bug reported to NW (https://git.scpslgame.com/northwood-qa/scpsl-bug-reporting/-/issues/198). /// From 0e2dc5ce7938a4fccedb6e96dd19b5c0cf55faba Mon Sep 17 00:00:00 2001 From: VALERA771 Date: Tue, 26 Nov 2024 19:28:41 +0300 Subject: [PATCH 26/29] API fixed Tbh i don't really believe that anything from this will work as expcted but... something deeply inside tells that it will --- EXILED/Exiled.API/Enums/RespawnEffectType.cs | 11 +- EXILED/Exiled.API/Enums/SpawnableFaction.cs | 28 +++ .../Exiled.API/Extensions/ItemExtensions.cs | 8 + .../Exiled.API/Features/Doors/ElevatorDoor.cs | 18 +- EXILED/Exiled.API/Features/Items/Firearm.cs | 62 +++--- EXILED/Exiled.API/Features/Items/Item.cs | 9 + EXILED/Exiled.API/Features/Respawn.cs | 177 +++++++++++------- .../Exiled.API/Features/Roles/Scp106Role.cs | 5 - 8 files changed, 182 insertions(+), 136 deletions(-) create mode 100644 EXILED/Exiled.API/Enums/SpawnableFaction.cs diff --git a/EXILED/Exiled.API/Enums/RespawnEffectType.cs b/EXILED/Exiled.API/Enums/RespawnEffectType.cs index 672f26d401..d26f7be267 100644 --- a/EXILED/Exiled.API/Enums/RespawnEffectType.cs +++ b/EXILED/Exiled.API/Enums/RespawnEffectType.cs @@ -16,21 +16,16 @@ namespace Exiled.API.Enums /// /// /// - public enum RespawnEffectType : byte + public enum RespawnEffectType { - /// - /// Plays the music to alive and . - /// - PlayChaosInsurgencyMusic = 0, - /// /// Summons the van. /// - SummonChaosInsurgencyVan = 128, + SummonChaosInsurgencyVan, /// /// Summons the NTF chopper. /// - SummonNtfChopper = 129, + SummonNtfChopper, } } \ No newline at end of file diff --git a/EXILED/Exiled.API/Enums/SpawnableFaction.cs b/EXILED/Exiled.API/Enums/SpawnableFaction.cs new file mode 100644 index 0000000000..3a7d590ae3 --- /dev/null +++ b/EXILED/Exiled.API/Enums/SpawnableFaction.cs @@ -0,0 +1,28 @@ +namespace Exiled.API.Enums +{ + /// + /// All spawnable factions. + /// + public enum SpawnableFaction + { + /// + /// Normal NTF wave. + /// + NtfWave, + + /// + /// Normal Chaos wave. + /// + ChaosWave, + + /// + /// Mini NTF wave. + /// + NtfMiniWave, + + /// + /// Mini Chaos wave. + /// + ChaosMiniWave, + } +} \ No newline at end of file diff --git a/EXILED/Exiled.API/Extensions/ItemExtensions.cs b/EXILED/Exiled.API/Extensions/ItemExtensions.cs index bc2560d42d..3fc97516f3 100644 --- a/EXILED/Exiled.API/Extensions/ItemExtensions.cs +++ b/EXILED/Exiled.API/Extensions/ItemExtensions.cs @@ -324,5 +324,13 @@ public static uint GetBaseCode(this FirearmType type) /// The to check. /// of the specified . public static ItemCategory GetCategory(this ItemType type) => GetItemBase(type).Category; + + /// + /// Checks if the specified has the specified . + /// + /// Weapon to check. + /// Attachment to check. + /// true if weapon has the specified attachment. Otherwise, false. + public static bool HasAttachment(this Firearm firearm, AttachmentName attachment) => firearm.Attachments.FirstOrDefault(x => x.Name == attachment)?.IsEnabled ?? false; } } diff --git a/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs b/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs index fdbde23487..dd597645c3 100644 --- a/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs +++ b/EXILED/Exiled.API/Features/Doors/ElevatorDoor.cs @@ -13,6 +13,7 @@ namespace Exiled.API.Features.Doors using Exiled.API.Enums; using Interactables.Interobjects; using Interactables.Interobjects.DoorUtils; + using UnityEngine; /// /// Represents an elevator door. @@ -29,6 +30,8 @@ internal ElevatorDoor(Interactables.Interobjects.ElevatorDoor door, List r { Base = door; Lift = Lift.Get(x => x.Group == Group).FirstOrDefault(); + + Panel = Object.FindObjectsOfType().FirstOrDefault(x => x._door == door); } /// @@ -41,6 +44,11 @@ internal ElevatorDoor(Interactables.Interobjects.ElevatorDoor door, List r /// public ElevatorGroup Group => Base.Group; + /// + /// Gets the associated with this lift. + /// + public ElevatorPanel Panel { get; } + /// /// Gets the type according to . /// @@ -55,16 +63,6 @@ internal ElevatorDoor(Interactables.Interobjects.ElevatorDoor door, List r _ => ElevatorType.Unknown, }; - /// - /// Gets the target panel settings for this lift. - /// - public PanelVisualSettings PanelSettings => Base.PanelSettings; - - /// - /// Gets a value indicating whether gets the panel is permanent. - /// - public bool PermanentPanels => Base.PermanentPanels; - /// /// Gets the associated with this elevator door. /// diff --git a/EXILED/Exiled.API/Features/Items/Firearm.cs b/EXILED/Exiled.API/Features/Items/Firearm.cs index d025d7ba18..29e6805712 100644 --- a/EXILED/Exiled.API/Features/Items/Firearm.cs +++ b/EXILED/Exiled.API/Features/Items/Firearm.cs @@ -68,13 +68,10 @@ public Firearm(BaseFirearm itemBase) internal Firearm(ItemType type) : this((BaseFirearm)Server.Host.Inventory.CreateItemInstance(new(type, 0), false)) { - // TODO Not finish - /* - FirearmStatusFlags firearmStatusFlags = FirearmStatusFlags.MagazineInserted; - if (Base.HasAdvantageFlag(AttachmentDescriptiveAdvantages.Flashlight)) - firearmStatusFlags |= FirearmStatusFlags.FlashlightEnabled; + FlashlightAttachment flashlight = Attachments.OfType().FirstOrDefault(); - Base.Status = new FirearmStatus(MaxAmmo, firearmStatusFlags, Base.Status.Attachments);*/ + if (flashlight != null && flashlight.IsEnabled) + flashlight.ServerSendStatus(true); } /// . @@ -127,26 +124,7 @@ public int Ammo public int MaxAmmo { get => (Base.Modules[Array.IndexOf(Base.Modules, typeof(MagazineModule))] as MagazineModule).AmmoMax; - set - { - // TODO Not finish - /* - switch (Base.AmmoManagerModule) - { - case TubularMagazineAmmoManager tubularMagazineAmmoManager: - tubularMagazineAmmoManager.MaxAmmo = (byte)(value - Base.AttachmentsValue(AttachmentParam.MagazineCapacityModifier) - (Base.Status.Flags.HasFlagFast(FirearmStatusFlags.Cocked) ? tubularMagazineAmmoManager.ChamberedRounds : 0)); - break; - case ClipLoadedInternalMagAmmoManager clipLoadedInternalMagAmmoManager: - clipLoadedInternalMagAmmoManager.MaxAmmo = (byte)(value - Base.AttachmentsValue(AttachmentParam.MagazineCapacityModifier)); - break; - case AutomaticAmmoManager automaticAmmoManager: - automaticAmmoManager.MaxAmmo = (byte)(value - Base.AttachmentsValue(AttachmentParam.MagazineCapacityModifier) - automaticAmmoManager.ChamberedAmount); - break; - default: - Log.Warn($"MaxAmmo can't be used for this Item: {Type} ({Base.AmmoManagerModule})"); - return; - }*/ - } + set => (Base.Modules[Array.IndexOf(Base.Modules, typeof(MagazineModule))] as MagazineModule)._defaultCapacity = value; // Synced? } /// @@ -157,15 +135,14 @@ public int MaxAmmo /// /// Gets the of the firearm. /// - // TODO not finish Base.AmmoType.GetAmmoType(); - public AmmoType AmmoType => AmmoType.None; + // TODO not finish Base.AmmoType.GetAmmoType(); Why not working? + public AmmoType AmmoType => Type.GetAmmoType(); + - // TODO: Not finish - /* /// /// Gets a value indicating whether the firearm is being aimed. /// - public bool Aiming => Base.IsAiming;*/ + public bool Aiming => Base.Modules.OfType().FirstOrDefault()?.AdsTarget ?? false; /// /// Gets a value indicating whether the firearm's flashlight module is enabled. @@ -173,7 +150,7 @@ public int MaxAmmo public bool FlashlightEnabled => Base.IsEmittingLight; // TODO NOT FINISH - /* + /// /// Gets a value indicating whether the firearm's NightVision is being used. /// @@ -187,7 +164,7 @@ public int MaxAmmo /// /// Gets a value indicating whether the firearm is automatic. /// - public bool IsAutomatic => Base is AutomaticFirearm;*/ + public bool IsAutomatic => Array.Exists(Base.Modules, x => x is AutomaticActionModule); /// /// Gets the s of the firearm. @@ -211,8 +188,6 @@ public IEnumerable AttachmentIdentifiers /// public uint BaseCode => BaseCodesValue[FirearmType]; - // TODO Not finish - /* /// /// Gets or sets the fire rate of the firearm, if it is an automatic weapon. /// @@ -220,11 +195,13 @@ public IEnumerable AttachmentIdentifiers /// public float FireRate { - get => Base is AutomaticFirearm auto ? auto._fireRate : 1f; + get => Base.Modules.OfType().FirstOrDefault()?.BaseFireRate ?? 0f; set { - if (Base is AutomaticFirearm auto) - auto._fireRate = value; + AutomaticActionModule module = Base.Modules.OfType().FirstOrDefault(); + + if (module != null) + module.BaseFireRate = value; } } @@ -235,14 +212,17 @@ public float FireRate /// public RecoilSettings Recoil { - get => Base is AutomaticFirearm auto ? auto._recoil : default; + get => Base.Modules.OfType().FirstOrDefault()?.BaseRecoil ?? default; set { - if (Base is AutomaticFirearm auto) - auto.ActionModule = new AutomaticAction(Base, auto._semiAutomatic, auto._boltTravelTime, 1f / auto._fireRate, auto._dryfireClipId, auto._triggerClipId, auto._gunshotPitchRandomization, value, auto._recoilPattern, false, Mathf.Max(1, auto._chamberSize)); + RecoilPatternModule module = Base.Modules.OfType().FirstOrDefault(); + + if (module != null) + module.BaseRecoil = value; } } + /* /// /// Gets the firearm's . Will be for non-automatic weapons. /// diff --git a/EXILED/Exiled.API/Features/Items/Item.cs b/EXILED/Exiled.API/Features/Items/Item.cs index 7ba1afab59..e278376e1d 100644 --- a/EXILED/Exiled.API/Features/Items/Item.cs +++ b/EXILED/Exiled.API/Features/Items/Item.cs @@ -233,6 +233,15 @@ public static T Get(ItemBase itemBase) /// Returns the Item found or if not found. public static Item Get(ushort serial) => List.FirstOrDefault(x => x.Serial == serial); + /// + /// Gets the Item belonging to the specified serial. + /// + /// The Item serial. + /// The specified type. + /// Returns the Item found or if not found. + public static T Get(ushort serial) + where T : Item => Get(serial) as T; + /// /// Creates a new with the proper inherited subclass. /// diff --git a/EXILED/Exiled.API/Features/Respawn.cs b/EXILED/Exiled.API/Features/Respawn.cs index ad9a69cff4..83f4569126 100644 --- a/EXILED/Exiled.API/Features/Respawn.cs +++ b/EXILED/Exiled.API/Features/Respawn.cs @@ -5,6 +5,8 @@ // // ----------------------------------------------------------------------- +using Respawning.Waves.Generic; + namespace Exiled.API.Features { using System; @@ -55,20 +57,26 @@ public static GameObject ChaosVan } /// - /// Gets or sets the next known that will spawn. + /// Gets or sets the next known that will spawn. /// - public static SpawnableTeamType NextKnownTeam + public static Faction NextKnownFaction { - get => RespawnManager.Singleton.NextKnownTeam; - set => RespawnManager.Singleton.NextKnownTeam = value; + get => WaveManager._nextWave.TargetFaction; + set => WaveManager._nextWave = WaveManager.Waves.Find(x => x.TargetFaction == value); } + /// + /// Gets the next known that will spawn. + /// + public static SpawnableTeamType NextKnownTeam => NextKnownFaction.GetSpawnableTeam(); + + /* TODO: Possibly moved to TimedWave /// /// Gets or sets the amount of seconds before the next respawn phase will occur. /// public static float TimeUntilNextPhase { - get => RespawnManager.Singleton._timeForNextSequence - (float)RespawnManager.Singleton._stopwatch.Elapsed.TotalSeconds; + get => RespawnManager.Singleton._timeForNextSequence - (float)RespawnManager.Singleton._stopwatch.Elapsed.TotalSeconds set => RespawnManager.Singleton._timeForNextSequence = (float)RespawnManager.Singleton._stopwatch.Elapsed.TotalSeconds + value; } @@ -81,6 +89,7 @@ public static float TimeUntilNextPhase /// Gets a indicating the moment in UTC time the next respawn wave will occur. /// public static DateTime NextTeamTime => DateTime.UtcNow.AddSeconds(TimeUntilSpawnWave.TotalSeconds); + */ /// /// Gets the current state of the . @@ -92,26 +101,6 @@ public static float TimeUntilNextPhase /// public static bool IsSpawning => WaveManager.State == WaveManager.WaveQueueState.WaveSpawning; - /// - /// Gets or sets the amount of spawn tickets belonging to the Chaos Insurgency. - /// - /// - public static float ChaosTickets - { - get => RespawnTokensManager.Counters[0].Amount; - set => RespawnTokensManager.ModifyTokens(SpawnableTeamType.ChaosInsurgency, value); - } - - /// - /// Gets or sets the amount of spawn tickets belonging to the NTF. - /// - /// - public static float NtfTickets - { - get => RespawnTokensManager.Counters[1].Amount; - set => RespawnTokensManager.ModifyTokens(SpawnableTeamType.NineTailedFox, value); - } - /// /// Gets or sets a value indicating whether spawn protection is enabled. /// @@ -144,13 +133,55 @@ public static bool ProtectedCanShoot /// public static List ProtectedTeams => SpawnProtected.ProtectedTeams; - // TODO: Docs (can include miniwave). + /// + /// Tries to get a . + /// + /// Found . + /// Type of . + /// true if was successfully found. Otherwise, false. public static bool TryGetWaveBase(out T spawnWave) where T : SpawnableWaveBase => WaveManager.TryGet(out spawnWave); - // TODO: Docs (Does not include mini wave). + /// + /// Tries to get a from a . + /// + /// Team's . + /// Found . + /// true if was successfully found. Otherwise, false. public static bool TryGetWaveBase(Faction faction, out SpawnableWaveBase spawnWave) - => WaveManager.TryGet(out spawnWave); + => WaveManager.TryGet(faction, out spawnWave); + + /// + /// Tries to get a from a . + /// + /// Team's . + /// Found . + /// true if was successfully found. Otherwise, false. + public static bool TryGetWaveBase(SpawnableFaction faction, out SpawnableWaveBase spawnWave) + { + switch (faction) + { + case SpawnableFaction.NtfWave: + bool result = TryGetWaveBase(out NtfSpawnWave ntfSpawnWave); + spawnWave = ntfSpawnWave; + return result; + case SpawnableFaction.NtfMiniWave: + result = TryGetWaveBase(out NtfMiniWave ntfMiniWave); + spawnWave = ntfMiniWave; + return result; + case SpawnableFaction.ChaosWave: + result = TryGetWaveBase(out ChaosSpawnWave chaosSpawnWave); + spawnWave = chaosSpawnWave; + return result; + case SpawnableFaction.ChaosMiniWave: + result = TryGetWaveBase(out ChaosMiniWave chaosMiniWave); + spawnWave = chaosMiniWave; + return result; + } + + spawnWave = null; + return false; + } // TODO: Docs. public static void AdvanceTime(Faction faction, float time) => WaveManager.AdvanceTimer(faction, time); @@ -166,56 +197,31 @@ public static void SpawnWave(Faction faction, bool mini) SpawnWave(wave); } - /// - /// Play an effect when a certain class spawns. - /// - /// The effect to be played. - public static void PlayEffect(byte effect) => PlayEffects(new[] { effect }); - - /// - /// Play an effect when a certain class spawns. - /// - /// The effect to be played. - public static void PlayEffect(RespawnEffectType effect) => PlayEffects(new[] { effect }); - /// /// Play effects when a certain class spawns. /// - /// The effects to be played. - public static void PlayEffects(byte[] effects) + /// The for which effects should be played. + public static void PlayEffect(SpawnableWaveBase wave) { - foreach (RespawnEffectsController controller in RespawnEffectsController.AllControllers) - controller?.RpcPlayEffects(effects); + WaveUpdateMessage.ServerSendUpdate(wave, UpdateMessageFlags.Trigger); } - /// - /// Play effects when a certain class spawns. - /// - /// The effects to be played. - public static void PlayEffects(RespawnEffectType[] effects) => PlayEffects(effects.Select(effect => (byte)effect).ToArray()); - /// /// Summons the NTF chopper. /// - public static void SummonNtfChopper() => PlayEffects(new[] { RespawnEffectType.SummonNtfChopper }); + public static void SummonNtfChopper() + { + if (TryGetWaveBase(Faction.FoundationStaff, out SpawnableWaveBase wave)) + PlayEffect(wave); + } /// /// Summons the van. /// - /// Whether to play the Chaos Insurgency spawn music. - public static void SummonChaosInsurgencyVan(bool playMusic = true) + public static void SummonChaosInsurgencyVan() { - PlayEffects( - playMusic - ? new[] - { - RespawnEffectType.PlayChaosInsurgencyMusic, - RespawnEffectType.SummonChaosInsurgencyVan, - } - : new[] - { - RespawnEffectType.SummonChaosInsurgencyVan, - }); + if (TryGetWaveBase(Faction.FoundationEnemy, out SpawnableWaveBase wave)) + PlayEffect(wave); } /// @@ -223,33 +229,60 @@ public static void SummonChaosInsurgencyVan(bool playMusic = true) /// /// The to grant tickets to. /// The amount of tickets to grant. - public static void GrantTickets(SpawnableTeamType team, float amount) => RespawnTokensManager.GrantTokens(team, Math.Max(0, amount)); + public static void GrantTickets(Faction team, int amount) + { + if (TryGetWaveBase(team, out SpawnableWaveBase wave) && wave is ILimitedWave limitedWave) + limitedWave.RespawnTokens += amount; + } /// /// Removes tickets from a . /// /// The to remove tickets from. /// The amount of tickets to remove. - public static void RemoveTickets(SpawnableTeamType team, float amount) => RespawnTokensManager.RemoveTokens(team, Math.Max(0, amount)); + public static void RemoveTickets(Faction team, int amount) + { + if (TryGetWaveBase(team, out SpawnableWaveBase wave) && wave is ILimitedWave limitedWave) + limitedWave.RespawnTokens = Math.Max(0, limitedWave.RespawnTokens - amount); + } /// /// Modify tickets from a . /// /// The to modify tickets from. /// The amount of tickets to modify. - public static void ModifyTickets(SpawnableTeamType team, float amount) => RespawnTokensManager.ModifyTokens(team, amount); + public static void ModifyTickets(Faction team, int amount) + { + if (TryGetWaveBase(team, out SpawnableWaveBase wave) && wave is ILimitedWave limitedWave) + limitedWave.RespawnTokens = amount; + } + + /// + /// Gets the amount of tickets from a . + /// + /// 's faction. + /// Tickets of team or -1 if team doesn't depend on tickets. + public static int GetTickets(SpawnableFaction faction) + { + if (TryGetWaveBase(faction, out SpawnableWaveBase wave) && wave is ILimitedWave limitedWave) + return limitedWave.RespawnTokens; + + return -1; + } /// /// Forces a spawn of the given . /// /// The to spawn. - /// Whether effects will be played with the spawn. - public static void ForceWave(SpawnableTeamType team, bool playEffects = false) + public static void ForceWave(Faction team) { - if (playEffects) - RespawnEffectsController.ExecuteAllEffects(RespawnEffectsController.EffectType.Selection, team); + if (TryGetWaveBase(team, out SpawnableWaveBase wave)) + ForceWave(wave); + } - RespawnManager.Singleton.ForceSpawnTeam(team); + public static void ForceWave(SpawnableWaveBase wave) + { + WaveManager.Spawn(wave); } } } \ No newline at end of file diff --git a/EXILED/Exiled.API/Features/Roles/Scp106Role.cs b/EXILED/Exiled.API/Features/Roles/Scp106Role.cs index 917047252c..48f3f04a00 100644 --- a/EXILED/Exiled.API/Features/Roles/Scp106Role.cs +++ b/EXILED/Exiled.API/Features/Roles/Scp106Role.cs @@ -176,11 +176,6 @@ public bool SinkholeState /// public float SinkholeTargetDuration => SinkholeController.TargetTransitionDuration; - /// - /// Gets the speed multiplier of the sinkhole. - /// - public float SinkholeSpeedMultiplier => SinkholeController.SpeedMultiplier; - /// /// Gets or sets how mush damage Scp106 will dealt when attacking a player. /// From 97560f6dc87102718e203b9b8c90b6476f406bbd Mon Sep 17 00:00:00 2001 From: VALERA771 Date: Tue, 26 Nov 2024 20:47:17 +0300 Subject: [PATCH 27/29] oh fuck is it real?! --- EXILED/Exiled.API/Features/Items/Firearm.cs | 37 +++++- .../Features/Pickups/FirearmPickup.cs | 19 +-- .../API/Features/CustomItem.cs | 23 ++-- .../API/Features/CustomWeapon.cs | 2 +- .../EventArgs/Player/EscapingEventArgs.cs | 52 -------- .../EventArgs/Player/ShootingEventArgs.cs | 2 +- .../Server/RespawnedTeamEventArgs.cs | 9 +- EXILED/Exiled.Events/Events.cs | 4 +- EXILED/Exiled.Events/Handlers/Server.cs | 4 +- .../Patches/Events/Player/ChangingItem.cs | 5 +- .../Events/Player/EscapingAndEscaped.cs | 32 +---- .../Events/Player/FirearmRequestReceived.cs | 9 +- .../Events/Player/InteractingElevator.cs | 17 ++- .../Patches/Events/Player/Shot.cs | 118 +++--------------- .../Fixes/Fix106RegenerationWithScp244.cs | 8 +- .../Patches/Generic/FirearmDistribution.cs | 27 ++++ .../Patches/Generic/IndividualFriendlyFire.cs | 2 +- 17 files changed, 136 insertions(+), 234 deletions(-) create mode 100644 EXILED/Exiled.Events/Patches/Generic/FirearmDistribution.cs diff --git a/EXILED/Exiled.API/Features/Items/Firearm.cs b/EXILED/Exiled.API/Features/Items/Firearm.cs index 29e6805712..dd9025e1b8 100644 --- a/EXILED/Exiled.API/Features/Items/Firearm.cs +++ b/EXILED/Exiled.API/Features/Items/Firearm.cs @@ -5,6 +5,8 @@ // // ----------------------------------------------------------------------- +using MEC; + namespace Exiled.API.Features.Items { using System; @@ -135,8 +137,7 @@ public int MaxAmmo /// /// Gets the of the firearm. /// - // TODO not finish Base.AmmoType.GetAmmoType(); Why not working? - public AmmoType AmmoType => Type.GetAmmoType(); + public AmmoType AmmoType => (Base.Modules.OfType().FirstOrDefault()?.AmmoType ?? ItemType.None).GetAmmoType(); /// @@ -602,6 +603,28 @@ public void ClearPreferences() ClearPreferences(player); } + /// + /// Reloads current . + /// + /// Whether empty magazine should be loaded. + public void Reload(bool emptyMagazine = false) + { + MagazineModule magazineModule = Base.Modules.OfType().FirstOrDefault(); + + if (magazineModule == null) + return; + + magazineModule.ServerRemoveMagazine(); + + Timing.CallDelayed(0.1f, () => + { + if (emptyMagazine) + magazineModule.ServerInsertEmptyMagazine(); + else + magazineModule.ServerInsertMagazine(); + }); + } + /// /// Clones current object. /// @@ -645,5 +668,15 @@ internal override void ChangeOwner(Player oldOwner, Player newOwner) Base._sendStatusNextFrame = true; Base._footprintValid = false;*/ } + + internal override void ReadPickupInfo(Pickup pickup) + { + base.ReadPickupInfo(pickup); + + if (pickup is FirearmPickup firearmPickup) + { + MaxAmmo + } + } } } diff --git a/EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs b/EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs index 4af2bce974..936ac1d2c3 100644 --- a/EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs +++ b/EXILED/Exiled.API/Features/Pickups/FirearmPickup.cs @@ -61,7 +61,8 @@ internal FirearmPickup(ItemType type) }*/ // TODO not finish -/* + + /* /// /// Gets or sets the . /// @@ -70,16 +71,15 @@ public FirearmStatus Status get => Base.NetworkStatus; set => Base.NetworkStatus = value; } + */ /// /// Gets or sets a value indicating how many ammo have this . /// - public byte Ammo - { - get => Base.NetworkStatus.Ammo; - set => Base.NetworkStatus = new(value, Base.NetworkStatus.Flags, Base.NetworkStatus.Attachments); - } + /// This will be updated only when item will be picked up. + public int Ammo { get; set; } + /* /// /// Gets or sets the . /// @@ -88,15 +88,16 @@ public FirearmStatusFlags Flags get => Base.NetworkStatus.Flags; set => Base.NetworkStatus = new(Base.NetworkStatus.Ammo, value, Base.NetworkStatus.Attachments); } + */ /// /// Gets or sets a value indicating whether the attachment code have this . /// public uint Attachments { - get => Base.NetworkStatus.Attachments; - set => Base.NetworkStatus = new(Base.NetworkStatus.Ammo, Base.NetworkStatus.Flags, value); - }*/ + get => Base.Worldmodel.AttachmentCode; + set => Base.Worldmodel.AttachmentCode = value; + } /// /// Returns the FirearmPickup in a human readable format. diff --git a/EXILED/Exiled.CustomItems/API/Features/CustomItem.cs b/EXILED/Exiled.CustomItems/API/Features/CustomItem.cs index feba8be326..dcfd61f285 100644 --- a/EXILED/Exiled.CustomItems/API/Features/CustomItem.cs +++ b/EXILED/Exiled.CustomItems/API/Features/CustomItem.cs @@ -619,20 +619,17 @@ public virtual uint Spawn(IEnumerable spawnPoints, uint limit) spawned++; -#pragma warning disable CS0618 // Type or member is obsolete \\ TODO: REMOVE THIS - if (spawnPoint is DynamicSpawnPoint dynamicSpawnPoint && dynamicSpawnPoint.Location == SpawnLocationType.InsideLocker) + /*if (spawnPoint is DynamicSpawnPoint dynamicSpawnPoint && dynamicSpawnPoint.Location == SpawnLocationType.InsideLocker) { for (int i = 0; i < 50; i++) { - if (Map.Lockers is null) + if (Exiled.API.Features.Lockers.Locker.List is null) { Log.Debug($"{nameof(Spawn)}: Locker list is null."); continue; } - Locker locker = - Map.Lockers[ - Loader.Random.Next(Map.Lockers.Count)]; + Locker locker = Exiled.API.Features.Lockers.Locker.Random(); if (locker is null) { @@ -683,8 +680,20 @@ public virtual uint Spawn(IEnumerable spawnPoints, uint limit) } Log.Debug($"Spawned {Name} at {spawnPoint.Position} ({spawnPoint.Name})"); + }*/ + + Pickup? pickup = Spawn(spawnPoint.Position); + + if (pickup == null) + continue; + + if (spawnPoint is LockerSpawnPoint) + pickup.IsLocked = true; + + if (pickup.Is(out Exiled.API.Features.Pickups.FirearmPickup firearmPickup) && this is CustomWeapon customWeapon) + { + firearmPickup } -#pragma warning restore CS0618 // Type or member is obsolete } return spawned; diff --git a/EXILED/Exiled.CustomItems/API/Features/CustomWeapon.cs b/EXILED/Exiled.CustomItems/API/Features/CustomWeapon.cs index d55782b6ef..728a81d31e 100644 --- a/EXILED/Exiled.CustomItems/API/Features/CustomWeapon.cs +++ b/EXILED/Exiled.CustomItems/API/Features/CustomWeapon.cs @@ -229,7 +229,7 @@ private void OnInternalReloading(ReloadingWeaponEventArgs ev) return; } - ev.Player.Connection.Send(new RequestMessage(ev.Firearm.Serial, RequestType.Reload)); + ev.Firearm.Reload(true); byte amountToReload = (byte)Math.Min(ClipSize - remainingClip, ev.Player.Ammo[ammoType.GetItemType()]); diff --git a/EXILED/Exiled.Events/EventArgs/Player/EscapingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/EscapingEventArgs.cs index b8076e2887..a10eea6922 100644 --- a/EXILED/Exiled.Events/EventArgs/Player/EscapingEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Player/EscapingEventArgs.cs @@ -42,52 +42,6 @@ public EscapingEventArgs(Player player, RoleTypeId newRole, EscapeScenario escap IsAllowed = escapeScenario is not EscapeScenario.CustomEscape; } - /// - /// Initializes a new instance of the class. - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public EscapingEventArgs(Player player, RoleTypeId newRole, EscapeScenario escapeScenario, KeyValuePair respawnTickets) - : this(player, newRole, escapeScenario) - { - RespawnTickets = respawnTickets; - } - - /// - /// Initializes a new instance of the class. - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// A that will be initialized with. - /// - /// - /// A that will be initialized with. - /// - public EscapingEventArgs(Player player, RoleTypeId newRole, EscapeScenario escapeScenario, SpawnableTeamType teamToGrantTickets, float ticketsToGrant) - : this(player, newRole, escapeScenario) - { - if (teamToGrantTickets != SpawnableTeamType.None) - RespawnTickets = new KeyValuePair(teamToGrantTickets, ticketsToGrant); - } - /// /// Gets the player who's escaping. /// @@ -103,12 +57,6 @@ public EscapingEventArgs(Player player, RoleTypeId newRole, EscapeScenario escap /// public EscapeScenario EscapeScenario { get; set; } - /// - /// Gets or sets the RespawnTickets that will represent the amount of tickets granted to a specific after the player escapes. - /// - /// - public KeyValuePair RespawnTickets { get; set; } - /// /// Gets or sets a value indicating whether the player can escape. /// diff --git a/EXILED/Exiled.Events/EventArgs/Player/ShootingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Player/ShootingEventArgs.cs index 177b3c5a68..6a61a64b96 100644 --- a/EXILED/Exiled.Events/EventArgs/Player/ShootingEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Player/ShootingEventArgs.cs @@ -38,7 +38,7 @@ public class ShootingEventArgs : IPlayerEvent, IDeniableEvent, IFirearmEvent /// /// /// - public ShootingEventArgs(Player shooter, BaseFirearm firearm, ShotMessage msg) + public ShootingEventArgs(Player shooter, BaseFirearm firearm) { Player = shooter; Firearm = Item.Get(firearm).As(); diff --git a/EXILED/Exiled.Events/EventArgs/Server/RespawnedTeamEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Server/RespawnedTeamEventArgs.cs index cbc6886cfe..d3d62667a0 100644 --- a/EXILED/Exiled.Events/EventArgs/Server/RespawnedTeamEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Server/RespawnedTeamEventArgs.cs @@ -13,6 +13,7 @@ namespace Exiled.Events.EventArgs.Server using Exiled.API.Features; using Exiled.Events.EventArgs.Interfaces; using Respawning; + using Respawning.Waves; /// /// Contains all information after team spawns. @@ -23,11 +24,11 @@ public class RespawnedTeamEventArgs : IExiledEvent /// Initializes a new instance of the class. /// /// - /// - public RespawnedTeamEventArgs(SpawnableTeamType team, IEnumerable hubs) + /// + public RespawnedTeamEventArgs(SpawnableWaveBase wave, IEnumerable hubs) { Players = hubs.Select(Player.Get); - Team = team; + Wave = wave; } /// @@ -38,6 +39,6 @@ public RespawnedTeamEventArgs(SpawnableTeamType team, IEnumerable /// /// Gets the spawned team. /// - public SpawnableTeamType Team { get; } + public SpawnableWaveBase Wave { get; } } } diff --git a/EXILED/Exiled.Events/Events.cs b/EXILED/Exiled.Events/Events.cs index cb3d0e166b..d06cb587c2 100644 --- a/EXILED/Exiled.Events/Events.cs +++ b/EXILED/Exiled.Events/Events.cs @@ -71,7 +71,7 @@ public override void OnEnabled() Handlers.Map.ChangedIntoGrenade += Handlers.Internal.ExplodingGrenade.OnChangedIntoGrenade; CharacterClassManager.OnRoundStarted += Handlers.Server.OnRoundStarted; - RespawnManager.ServerOnRespawned += Handlers.Server.OnRespawnedTeam; + WaveManager.OnWaveSpawned += Handlers.Server.OnRespawnedTeam; InventorySystem.InventoryExtensions.OnItemAdded += Handlers.Player.OnItemAdded; InventorySystem.InventoryExtensions.OnItemRemoved += Handlers.Player.OnItemRemoved; @@ -106,7 +106,7 @@ public override void OnDisabled() InventorySystem.InventoryExtensions.OnItemAdded -= Handlers.Player.OnItemAdded; InventorySystem.InventoryExtensions.OnItemRemoved -= Handlers.Player.OnItemRemoved; - RespawnManager.ServerOnRespawned -= Handlers.Server.OnRespawnedTeam; + WaveManager.OnWaveSpawned -= Handlers.Server.OnRespawnedTeam; RagdollManager.OnRagdollSpawned -= Handlers.Internal.RagdollList.OnSpawnedRagdoll; RagdollManager.OnRagdollRemoved -= Handlers.Internal.RagdollList.OnRemovedRagdoll; ItemPickupBase.OnPickupAdded -= Handlers.Internal.PickupEvent.OnSpawnedPickup; diff --git a/EXILED/Exiled.Events/Handlers/Server.cs b/EXILED/Exiled.Events/Handlers/Server.cs index f7032f6ed9..399a5fcfe0 100644 --- a/EXILED/Exiled.Events/Handlers/Server.cs +++ b/EXILED/Exiled.Events/Handlers/Server.cs @@ -5,6 +5,8 @@ // // ----------------------------------------------------------------------- +using Respawning.Waves; + namespace Exiled.Events.Handlers { using System.Collections.Generic; @@ -165,7 +167,7 @@ public static class Server /// /// /// - public static void OnRespawnedTeam(SpawnableTeamType teamType, List hubs) => RespawnedTeam.InvokeSafely(new RespawnedTeamEventArgs(teamType, hubs)); + public static void OnRespawnedTeam(SpawnableWaveBase teamType, List hubs) => RespawnedTeam.InvokeSafely(new RespawnedTeamEventArgs(teamType, hubs)); /// /// Called before adding an unit name. diff --git a/EXILED/Exiled.Events/Patches/Events/Player/ChangingItem.cs b/EXILED/Exiled.Events/Patches/Events/Player/ChangingItem.cs index 9fa2a4f1b2..d4ee8d7d3a 100644 --- a/EXILED/Exiled.Events/Patches/Events/Player/ChangingItem.cs +++ b/EXILED/Exiled.Events/Patches/Events/Player/ChangingItem.cs @@ -41,9 +41,8 @@ private static IEnumerable Transpiler(IEnumerable instruction.Calls(Method(typeof(EquipDequipModifierExtensions), nameof(EquipDequipModifierExtensions.CanEquip)))) + offset; + int offset = 1; + int index = newInstructions.FindIndex(x => x.opcode == OpCodes.Bne_Un_S) + offset; newInstructions.InsertRange( index, diff --git a/EXILED/Exiled.Events/Patches/Events/Player/EscapingAndEscaped.cs b/EXILED/Exiled.Events/Patches/Events/Player/EscapingAndEscaped.cs index 9bf3bb35f3..be16ad1900 100644 --- a/EXILED/Exiled.Events/Patches/Events/Player/EscapingAndEscaped.cs +++ b/EXILED/Exiled.Events/Patches/Events/Player/EscapingAndEscaped.cs @@ -63,14 +63,8 @@ private static IEnumerable Transpiler(IEnumerable cctor.GetParameters().Any(param => param.ParameterType == typeof(SpawnableTeamType)))), + new(OpCodes.Newobj, GetDeclaredConstructors(typeof(EscapingEventArgs))[0]), new(OpCodes.Dup), new(OpCodes.Dup), new(OpCodes.Stloc, ev.LocalIndex), @@ -89,20 +83,6 @@ private static IEnumerable Transpiler(IEnumerable instruction.Calls(Method(typeof(RespawnTokensManager), nameof(RespawnTokensManager.GrantTokens)))) + offset; - labels = newInstructions[index].ExtractLabels(); - newInstructions.RemoveRange(index, 3); - newInstructions.InsertRange( - index, - new CodeInstruction[] - { - // GrantAllTickets(ev) - new CodeInstruction(OpCodes.Ldloc, ev.LocalIndex).WithLabels(labels), - new(OpCodes.Call, Method(typeof(EscapingAndEscaped), nameof(GrantAllTickets))), - }); - offset = 4; index = newInstructions.FindIndex(x => x.Is(OpCodes.Stfld, Field(typeof(Escape.EscapeMessage), nameof(Escape.EscapeMessage.EscapeTime)))) + offset; @@ -127,10 +107,6 @@ private static IEnumerable Transpiler(IEnumerable Transpiler(IEnumerable.Pool.Return(newInstructions); } - - private static void GrantAllTickets(EscapingEventArgs ev) - { - if (Enum.IsDefined(typeof(SpawnableTeamType), ev.RespawnTickets.Key) && ev.RespawnTickets.Key != SpawnableTeamType.None) - RespawnTokensManager.ModifyTokens(ev.RespawnTickets.Key, ev.RespawnTickets.Value); - } } /// diff --git a/EXILED/Exiled.Events/Patches/Events/Player/FirearmRequestReceived.cs b/EXILED/Exiled.Events/Patches/Events/Player/FirearmRequestReceived.cs index 585552f936..7da404755e 100644 --- a/EXILED/Exiled.Events/Patches/Events/Player/FirearmRequestReceived.cs +++ b/EXILED/Exiled.Events/Patches/Events/Player/FirearmRequestReceived.cs @@ -14,20 +14,18 @@ namespace Exiled.Events.Patches.Events.Player using API.Features.Pools; using Exiled.API.Features.Items; - using Exiled.Events.Attributes; using Exiled.Events.EventArgs.Player; - using Handlers; - using HarmonyLib; - using InventorySystem.Items; + using InventorySystem.Items.Firearms; using InventorySystem.Items.Firearms.BasicMessages; using PluginAPI.Events; using static HarmonyLib.AccessTools; + /* TODO /// /// Patches . /// Adds , , @@ -39,7 +37,7 @@ namespace Exiled.Events.Patches.Events.Player [EventPatch(typeof(Player), nameof(Player.DryfiringWeapon))] [EventPatch(typeof(Player), nameof(Player.AimingDownSight))] [EventPatch(typeof(Player), nameof(Player.TogglingWeaponFlashlight))] - [HarmonyPatch(typeof(FirearmBasicMessagesHandler), nameof(FirearmBasicMessagesHandler.ServerRequestReceived))] + [HarmonyPatch(typeof(FirearmUtils), nameof())] internal static class FirearmRequestReceived { private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) @@ -272,4 +270,5 @@ private static IEnumerable Transpiler(IEnumerable.Pool.Return(newInstructions); } } + */ } \ No newline at end of file diff --git a/EXILED/Exiled.Events/Patches/Events/Player/InteractingElevator.cs b/EXILED/Exiled.Events/Patches/Events/Player/InteractingElevator.cs index f1394242f3..7c886013f7 100644 --- a/EXILED/Exiled.Events/Patches/Events/Player/InteractingElevator.cs +++ b/EXILED/Exiled.Events/Patches/Events/Player/InteractingElevator.cs @@ -28,17 +28,16 @@ namespace Exiled.Events.Patches.Events.Player /// Adds the event. /// [EventPatch(typeof(Handlers.Player), nameof(Handlers.Player.InteractingElevator))] - [HarmonyPatch(typeof(ElevatorManager), nameof(ElevatorManager.ServerReceiveMessage))] + [HarmonyPatch(typeof(ElevatorChamber), nameof(ElevatorChamber.ServerInteract))] internal class InteractingElevator { private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) { List newInstructions = ListPool.Pool.Get(instructions); - Label @break = (Label)newInstructions.FindLast(i => i.opcode == OpCodes.Leave_S).operand; + Label returnLabel = generator.DefineLabel(); - int offset = -2; - int index = newInstructions.FindLastIndex(i => i.opcode == OpCodes.Newobj) + offset; + newInstructions[newInstructions.Count - 1].labels.Add(returnLabel); // InteractingElevatorEventArgs ev = new(Player.Get(referenceHub), elevatorChamber, true); // @@ -46,16 +45,14 @@ private static IEnumerable Transpiler(IEnumerable Transpiler(IEnumerable // ----------------------------------------------------------------------- +using System; + namespace Exiled.Events.Patches.Events.Player { #pragma warning disable SA1402 // File may only contain a single type @@ -29,11 +31,11 @@ namespace Exiled.Events.Patches.Events.Player using Item = API.Features.Items.Item; /// - /// Patches . + /// Patches . /// Adds the events. /// [EventPatch(typeof(Handlers.Player), nameof(Handlers.Player.Shot))] - [HarmonyPatch(typeof(SingleBulletHitreg), nameof(SingleBulletHitreg.ServerProcessRaycastHit))] + [HarmonyPatch(typeof(HitscanHitregModuleBase), nameof(HitscanHitregModuleBase.ServerProcessTargetHit))] internal static class Shot { /// @@ -47,7 +49,7 @@ internal static class Shot /// If the shot is allowed. internal static bool ProcessShot(ReferenceHub player, Firearm firearm, RaycastHit hit, IDestructible destructible, ref float damage) { - ShotEventArgs shotEvent = new(Player.Get(player), Item.Get(firearm).Cast(), hit, destructible, damage); + ShotEventArgs shotEvent = new(Player.Get(player), Item.Get(firearm), hit, destructible, damage); Handlers.Player.OnShot(shotEvent); @@ -64,30 +66,29 @@ private static IEnumerable Transpiler(IEnumerable instruction.Calls(Method(typeof(FirearmBaseStats), nameof(FirearmBaseStats.DamageAtDistance)))) + offset; + int offset = 1; + int index = newInstructions.FindIndex(x => x.opcode == OpCodes.Stloc_0) + offset; newInstructions.InsertRange( index, new CodeInstruction[] { // this.Hub - new(OpCodes.Ldarg_0), - new(OpCodes.Callvirt, PropertyGetter(typeof(StandardHitregBase), nameof(StandardHitregBase.Hub))), + new(OpCodes.Ldarg_1), + new(OpCodes.Callvirt, PropertyGetter(typeof(HitboxIdentity), nameof(HitboxIdentity.TargetHub))), // this.Firearm new(OpCodes.Ldarg_0), - new(OpCodes.Callvirt, PropertyGetter(typeof(StandardHitregBase), nameof(StandardHitregBase.Firearm))), + new(OpCodes.Callvirt, PropertyGetter(typeof(SingleBulletHitscan), nameof(SingleBulletHitscan.Firearm))), // hit new(OpCodes.Ldarg_2), // destructible - new(OpCodes.Ldloc_0), + new(OpCodes.Ldloc_1), // damage - new(OpCodes.Ldloca_S, 1), + new(OpCodes.Ldloca_S, 0), new(OpCodes.Call, Method(typeof(Shot), nameof(ProcessShot), new[] { typeof(ReferenceHub), typeof(Firearm), typeof(RaycastHit), typeof(IDestructible), typeof(float).MakeByRefType(), })), @@ -96,7 +97,7 @@ private static IEnumerable Transpiler(IEnumerable instruction.Calls(Method(typeof(StandardHitregBase), nameof(StandardHitregBase.PlaceBulletholeDecal)))) + offset; @@ -131,94 +132,7 @@ private static IEnumerable Transpiler(IEnumerable.Pool.Return(newInstructions); - } - } - - /// - /// Patches . - /// Adds the events. - /// - [EventPatch(typeof(Handlers.Player), nameof(Handlers.Player.Shot))] - [HarmonyPatch(typeof(BuckshotHitreg), nameof(BuckshotHitreg.ShootPellet))] - internal static class ShotBuckshot - { - private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) - { - List newInstructions = ListPool.Pool.Get(instructions); - - Label returnLabel = generator.DefineLabel(); - - int offset = -3; - int index = newInstructions.FindIndex(instruction => instruction.Calls(Method(typeof(StandardHitregBase), nameof(StandardHitregBase.PlaceBulletholeDecal)))) + offset; - - newInstructions.InsertRange( - index, - new CodeInstruction[] - { - // this.Hub - new(OpCodes.Ldarg_0), - new(OpCodes.Callvirt, PropertyGetter(typeof(BuckshotHitreg), nameof(BuckshotHitreg.Owner))), - - // this.Firearm - new(OpCodes.Ldarg_0), - new(OpCodes.Callvirt, PropertyGetter(typeof(BuckshotHitreg), nameof(BuckshotHitreg.Firearm))), - - // hit - new(OpCodes.Ldloc_2), - - // destructible - new(OpCodes.Ldloc_3), - - // damage - new(OpCodes.Ldc_R4, 0f), - new(OpCodes.Stloc_S, 4), - new(OpCodes.Ldloca_S, 4), - - new(OpCodes.Call, Method(typeof(Shot), nameof(Shot.ProcessShot), new[] { typeof(ReferenceHub), typeof(Firearm), typeof(RaycastHit), typeof(IDestructible), typeof(float).MakeByRefType(), })), - - // if (!ev.CanHurt) - // return; - new(OpCodes.Brfalse_S, returnLabel), - }); - - offset = 0; - index = newInstructions.FindLastIndex(instruction => instruction.opcode == OpCodes.Ldsfld) + offset; - - newInstructions.InsertRange( - index, - new CodeInstruction[] - { - // this.Hub - new(OpCodes.Ldarg_0), - new(OpCodes.Callvirt, PropertyGetter(typeof(BuckshotHitreg), nameof(BuckshotHitreg.Owner))), - - // this.Firearm - new(OpCodes.Ldarg_0), - new(OpCodes.Callvirt, PropertyGetter(typeof(BuckshotHitreg), nameof(BuckshotHitreg.Firearm))), - - // hit - new(OpCodes.Ldloc_2), - - // destructible - new(OpCodes.Ldloc_3), - - // damage - new(OpCodes.Ldloca_S, 4), - - new(OpCodes.Call, Method(typeof(Shot), nameof(Shot.ProcessShot), new[] { typeof(ReferenceHub), typeof(Firearm), typeof(RaycastHit), typeof(IDestructible), typeof(float).MakeByRefType(), })), - - // if (!ev.CanHurt) - // return; - new(OpCodes.Brfalse_S, returnLabel), - }); + });*/ newInstructions[newInstructions.Count - 1].WithLabels(returnLabel); @@ -229,12 +143,13 @@ private static IEnumerable Transpiler(IEnumerable /// Patches . /// Adds the events. /// [EventPatch(typeof(Handlers.Player), nameof(Handlers.Player.Shot))] - [HarmonyPatch(typeof(DisruptorHitreg), nameof(DisruptorHitreg.ServerPerformShot))] + [HarmonyPatch(typeof(DisruptorHitregModule), nameof(DisruptorHitregModule.ServerProcessTargetHit))] internal static class ShotDisruptor { private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) @@ -315,4 +230,5 @@ private static IEnumerable Transpiler(IEnumerable.Pool.Return(newInstructions); } } + */ } diff --git a/EXILED/Exiled.Events/Patches/Fixes/Fix106RegenerationWithScp244.cs b/EXILED/Exiled.Events/Patches/Fixes/Fix106RegenerationWithScp244.cs index c9c27135f3..7cc7da66ca 100644 --- a/EXILED/Exiled.Events/Patches/Fixes/Fix106RegenerationWithScp244.cs +++ b/EXILED/Exiled.Events/Patches/Fixes/Fix106RegenerationWithScp244.cs @@ -12,10 +12,10 @@ namespace Exiled.Events.Patches.Fixes using API.Features.Pools; using CustomPlayerEffects; + using Exiled.API.Features; + using Exiled.API.Features.Roles; using HarmonyLib; using InventorySystem.Items.Usables.Scp244.Hypothermia; - using PlayerRoles; - using PlayerRoles.PlayableScps.Scp106; using static HarmonyLib.AccessTools; @@ -48,8 +48,8 @@ private static IEnumerable Transpiler(IEnumerable +// Copyright (c) ExMod Team. All rights reserved. +// Licensed under the CC BY-SA 3.0 license. +// +// ----------------------------------------------------------------------- + +namespace Exiled.Events.Patches.Generic +{ +#pragma warning disable SA1313 + using Exiled.API.Features.Pickups; + using HarmonyLib; + + using BaseFirearm = InventorySystem.Items.Firearms.FirearmPickup; + + /// + /// Patch to add . + /// + [HarmonyPatch(typeof(BaseFirearm), nameof(BaseFirearm.OnDistributed))] + internal static class FirearmDistribution + { + private static void Postfix(BaseFirearm __instance) + { + Pickup.Get(__instance).IsDistributed = true; + } + } +} \ No newline at end of file diff --git a/EXILED/Exiled.Events/Patches/Generic/IndividualFriendlyFire.cs b/EXILED/Exiled.Events/Patches/Generic/IndividualFriendlyFire.cs index 5cf9fd956d..d95b88a878 100644 --- a/EXILED/Exiled.Events/Patches/Generic/IndividualFriendlyFire.cs +++ b/EXILED/Exiled.Events/Patches/Generic/IndividualFriendlyFire.cs @@ -97,7 +97,7 @@ public static bool CheckFriendlyFirePlayerRules(Footprint attackerFootprint, Ref // Only check friendlyFire if the FootPrint hasn't changed (Fix for Grenade not dealing damage because it's from a dead player) // TODO rework FriendlyFireRule to make it compatible with Footprint - if (!attackerFootprint.SameLife(new Footprint(attackerFootprint.Hub))) + if (!attackerFootprint.Equals(new Footprint(attackerFootprint.Hub))) return false; // Check if attackerFootprint.Hub or victimHub is null and log debug information From 3511303d5388f221cf6689ac8de939ab1a7d4beb Mon Sep 17 00:00:00 2001 From: Yamato Date: Tue, 26 Nov 2024 18:54:32 +0100 Subject: [PATCH 28/29] useless fix --- EXILED/Exiled.API/Enums/SpawnableFaction.cs | 9 ++++++++- EXILED/Exiled.API/Features/Items/Firearm.cs | 13 ++++--------- EXILED/Exiled.API/Features/Respawn.cs | 4 +--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/EXILED/Exiled.API/Enums/SpawnableFaction.cs b/EXILED/Exiled.API/Enums/SpawnableFaction.cs index 3a7d590ae3..131a7a4ff4 100644 --- a/EXILED/Exiled.API/Enums/SpawnableFaction.cs +++ b/EXILED/Exiled.API/Enums/SpawnableFaction.cs @@ -1,4 +1,11 @@ -namespace Exiled.API.Enums +// ----------------------------------------------------------------------- +// +// Copyright (c) ExMod Team. All rights reserved. +// Licensed under the CC BY-SA 3.0 license. +// +// ----------------------------------------------------------------------- + +namespace Exiled.API.Enums { /// /// All spawnable factions. diff --git a/EXILED/Exiled.API/Features/Items/Firearm.cs b/EXILED/Exiled.API/Features/Items/Firearm.cs index dd9025e1b8..9952ecef35 100644 --- a/EXILED/Exiled.API/Features/Items/Firearm.cs +++ b/EXILED/Exiled.API/Features/Items/Firearm.cs @@ -5,8 +5,6 @@ // // ----------------------------------------------------------------------- -using MEC; - namespace Exiled.API.Features.Items { using System; @@ -14,15 +12,11 @@ namespace Exiled.API.Features.Items using System.Linq; using CameraShaking; - using Enums; - using Exiled.API.Features.Pickups; using Exiled.API.Interfaces; using Exiled.API.Structs; - using Extensions; - using InventorySystem; using InventorySystem.Items; using InventorySystem.Items.Firearms; @@ -31,7 +25,7 @@ namespace Exiled.API.Features.Items using InventorySystem.Items.Firearms.BasicMessages; using InventorySystem.Items.Firearms.Modules; using InventorySystem.Items.Pickups; - + using MEC; using UnityEngine; using BaseFirearm = InventorySystem.Items.Firearms.Firearm; @@ -139,7 +133,6 @@ public int MaxAmmo /// public AmmoType AmmoType => (Base.Modules.OfType().FirstOrDefault()?.AmmoType ?? ItemType.None).GetAmmoType(); - /// /// Gets a value indicating whether the firearm is being aimed. /// @@ -669,13 +662,15 @@ internal override void ChangeOwner(Player oldOwner, Player newOwner) Base._footprintValid = false;*/ } + /// internal override void ReadPickupInfo(Pickup pickup) { base.ReadPickupInfo(pickup); if (pickup is FirearmPickup firearmPickup) { - MaxAmmo + // TODO: If synced + // MaxAmmo = firearmPickup.MaxAmmo; } } } diff --git a/EXILED/Exiled.API/Features/Respawn.cs b/EXILED/Exiled.API/Features/Respawn.cs index 83f4569126..1f3774f438 100644 --- a/EXILED/Exiled.API/Features/Respawn.cs +++ b/EXILED/Exiled.API/Features/Respawn.cs @@ -5,19 +5,17 @@ // // ----------------------------------------------------------------------- -using Respawning.Waves.Generic; - namespace Exiled.API.Features { using System; using System.Collections.Generic; - using System.Linq; using CustomPlayerEffects; using Enums; using PlayerRoles; using Respawning; using Respawning.Waves; + using Respawning.Waves.Generic; using UnityEngine; /// From 93785c5c33c021f6c36cc69641d97bf92f2c3795 Mon Sep 17 00:00:00 2001 From: VALERA771 Date: Tue, 26 Nov 2024 21:22:22 +0300 Subject: [PATCH 29/29] something new here --- .../Exiled.API/Extensions/RoleExtensions.cs | 15 ++- EXILED/Exiled.API/Features/Items/Firearm.cs | 23 ++-- EXILED/Exiled.API/Features/Items/Item.cs | 9 ++ EXILED/Exiled.API/Features/Player.cs | 7 +- .../API/EventArgs/OwnerEscapingEventArgs.cs | 15 +-- .../EventArgs/Map/PlacingBloodEventArgs.cs | 64 ---------- .../Map/SpawningTeamVehicleEventArgs.cs | 6 +- .../Server/RespawningTeamEventArgs.cs | 39 ++----- EXILED/Exiled.Events/Handlers/Map.cs | 11 -- .../Patches/Events/Map/PlacingBlood.cs | 110 ------------------ .../Patches/Events/Map/SpawningTeamVehicle.cs | 9 +- .../Patches/Events/Scp106/ExitStalking.cs | 2 +- .../Patches/Events/Scp106/Stalking.cs | 4 +- .../Events/Scp330/InteractingScp330.cs | 6 +- .../Patches/Events/Server/RespawningTeam.cs | 44 +++---- 15 files changed, 88 insertions(+), 276 deletions(-) delete mode 100644 EXILED/Exiled.Events/EventArgs/Map/PlacingBloodEventArgs.cs delete mode 100644 EXILED/Exiled.Events/Patches/Events/Map/PlacingBlood.cs diff --git a/EXILED/Exiled.API/Extensions/RoleExtensions.cs b/EXILED/Exiled.API/Extensions/RoleExtensions.cs index c36592500a..e86805f009 100644 --- a/EXILED/Exiled.API/Extensions/RoleExtensions.cs +++ b/EXILED/Exiled.API/Extensions/RoleExtensions.cs @@ -17,7 +17,7 @@ namespace Exiled.API.Extensions using InventorySystem.Configs; using PlayerRoles; using PlayerRoles.FirstPersonControl; - + using Respawning.Waves; using UnityEngine; using Team = PlayerRoles.Team; @@ -210,5 +210,18 @@ public static Dictionary GetStartingAmmo(this RoleTypeId roleT return info.Ammo.ToDictionary(kvp => kvp.Key.GetAmmoType(), kvp => kvp.Value); } + + /// + /// Gets the of a . + /// + /// A instance. + /// associated with the wave. + public static SpawnableFaction GetFaction(this SpawnableWaveBase waveBase) => waveBase switch + { + NtfSpawnWave => SpawnableFaction.NtfWave, + NtfMiniWave => SpawnableFaction.NtfMiniWave, + ChaosSpawnWave => SpawnableFaction.ChaosWave, + _ => SpawnableFaction.ChaosMiniWave + }; } } diff --git a/EXILED/Exiled.API/Features/Items/Firearm.cs b/EXILED/Exiled.API/Features/Items/Firearm.cs index 9952ecef35..0ec5a64933 100644 --- a/EXILED/Exiled.API/Features/Items/Firearm.cs +++ b/EXILED/Exiled.API/Features/Items/Firearm.cs @@ -5,6 +5,8 @@ // // ----------------------------------------------------------------------- +using MEC; + namespace Exiled.API.Features.Items { using System; @@ -12,11 +14,15 @@ namespace Exiled.API.Features.Items using System.Linq; using CameraShaking; + using Enums; + using Exiled.API.Features.Pickups; using Exiled.API.Interfaces; using Exiled.API.Structs; + using Extensions; + using InventorySystem; using InventorySystem.Items; using InventorySystem.Items.Firearms; @@ -25,7 +31,7 @@ namespace Exiled.API.Features.Items using InventorySystem.Items.Firearms.BasicMessages; using InventorySystem.Items.Firearms.Modules; using InventorySystem.Items.Pickups; - using MEC; + using UnityEngine; using BaseFirearm = InventorySystem.Items.Firearms.Firearm; @@ -133,6 +139,7 @@ public int MaxAmmo /// public AmmoType AmmoType => (Base.Modules.OfType().FirstOrDefault()?.AmmoType ?? ItemType.None).GetAmmoType(); + /// /// Gets a value indicating whether the firearm is being aimed. /// @@ -650,26 +657,16 @@ public override Item Clone() internal override void ChangeOwner(Player oldOwner, Player newOwner) { Base.Owner = newOwner.ReferenceHub; - - // TODO: NOT FINISH - /* - if (Base.HitregModule is StandardHitregBase hitReg) - { - hitReg.Hub = Base.Owner; - } - - Base._sendStatusNextFrame = true; - Base._footprintValid = false;*/ + Base._footprintCacheSet = false; } - /// internal override void ReadPickupInfo(Pickup pickup) { base.ReadPickupInfo(pickup); if (pickup is FirearmPickup firearmPickup) { - // TODO: If synced + // TODO If synced // MaxAmmo = firearmPickup.MaxAmmo; } } diff --git a/EXILED/Exiled.API/Features/Items/Item.cs b/EXILED/Exiled.API/Features/Items/Item.cs index e278376e1d..308c757582 100644 --- a/EXILED/Exiled.API/Features/Items/Item.cs +++ b/EXILED/Exiled.API/Features/Items/Item.cs @@ -174,6 +174,15 @@ public ushort Serial /// public Player Owner => Player.Get(Base.Owner) ?? Server.Host; + /// + /// Gets or sets a reason for adding this item to the inventory. + /// + public ItemAddReason AddReason + { + get => Base.ServerAddReason; + set => Base.ServerAddReason = value; + } + /// /// Gets an existing or creates a new instance of one. /// diff --git a/EXILED/Exiled.API/Features/Player.cs b/EXILED/Exiled.API/Features/Player.cs index cee9a0fd94..6a67717b18 100644 --- a/EXILED/Exiled.API/Features/Player.cs +++ b/EXILED/Exiled.API/Features/Player.cs @@ -2793,8 +2793,9 @@ public void AddItem(Firearm item, IEnumerable identifiers) /// Adds an item to the player's inventory. /// /// The of the item to be added. + /// The reason the item was added. /// The that was added. - public Item AddItem(Pickup pickup) => Item.Get(Inventory.ServerAddItem(pickup.Type, ItemAddReason.Undefined, pickup.Serial, pickup.Base)); + public Item AddItem(Pickup pickup, ItemAddReason addReason = ItemAddReason.Undefined) => Item.Get(Inventory.ServerAddItem(pickup.Type, addReason, pickup.Serial, pickup.Base)); /// /// Adds an item to the player's inventory. @@ -2817,12 +2818,14 @@ public Item AddItem(FirearmPickup pickup, IEnumerable iden /// /// The item to be added. /// The object of the item. + /// The reason the item was added. /// The that was added. - public Item AddItem(ItemBase itemBase, Item item = null) + public Item AddItem(ItemBase itemBase, Item item = null, ItemAddReason addReason = ItemAddReason.AdminCommand) { try { item ??= Item.Get(itemBase); + item.AddReason = addReason; Inventory.UserInventory.Items[item.Serial] = itemBase; diff --git a/EXILED/Exiled.CustomItems/API/EventArgs/OwnerEscapingEventArgs.cs b/EXILED/Exiled.CustomItems/API/EventArgs/OwnerEscapingEventArgs.cs index 1c81585faf..2fc89ef333 100644 --- a/EXILED/Exiled.CustomItems/API/EventArgs/OwnerEscapingEventArgs.cs +++ b/EXILED/Exiled.CustomItems/API/EventArgs/OwnerEscapingEventArgs.cs @@ -30,20 +30,7 @@ public class OwnerEscapingEventArgs : EscapingEventArgs /// /// The instance. public OwnerEscapingEventArgs(Item item, EscapingEventArgs ev) - : this(item, ev.Player, ev.NewRole, ev.EscapeScenario, ev.RespawnTickets) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// - /// - /// - /// - /// - public OwnerEscapingEventArgs(Item item, Player player, RoleTypeId newRole, EscapeScenario escapeScenario, KeyValuePair respawnTickets = default) - : base(player, newRole, escapeScenario, respawnTickets) + : base(ev.Player, ev.NewRole, ev.EscapeScenario) { Item = item; } diff --git a/EXILED/Exiled.Events/EventArgs/Map/PlacingBloodEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/PlacingBloodEventArgs.cs deleted file mode 100644 index 673b51915a..0000000000 --- a/EXILED/Exiled.Events/EventArgs/Map/PlacingBloodEventArgs.cs +++ /dev/null @@ -1,64 +0,0 @@ -// ----------------------------------------------------------------------- -// -// Copyright (c) ExMod Team. All rights reserved. -// Licensed under the CC BY-SA 3.0 license. -// -// ----------------------------------------------------------------------- - -namespace Exiled.Events.EventArgs.Map -{ - using API.Features; - - using Interfaces; - - using UnityEngine; - - /// - /// Contains all information before placing a blood decal. - /// - public class PlacingBloodEventArgs : IPlayerEvent, IDeniableEvent - { - /// - /// Initializes a new instance of the class. - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public PlacingBloodEventArgs(Player player, Player target, RaycastHit hit, bool isAllowed = true) - { - Player = player; - Target = target; - Position = hit.point; - IsAllowed = isAllowed; - } - - /// - /// Gets the who's placing the blood. - /// - public Player Player { get; } - - /// - /// Gets the target's instance. - /// - public Player Target { get; } - - /// - /// Gets or sets the blood placing position. - /// - public Vector3 Position { get; set; } - - /// - /// Gets or sets a value indicating whether the blood can be placed. - /// - public bool IsAllowed { get; set; } - } -} \ No newline at end of file diff --git a/EXILED/Exiled.Events/EventArgs/Map/SpawningTeamVehicleEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Map/SpawningTeamVehicleEventArgs.cs index 16b31daac9..d1b633b7b0 100644 --- a/EXILED/Exiled.Events/EventArgs/Map/SpawningTeamVehicleEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Map/SpawningTeamVehicleEventArgs.cs @@ -5,6 +5,8 @@ // // ----------------------------------------------------------------------- +using Respawning.Waves; + namespace Exiled.Events.EventArgs.Map { using Exiled.Events.EventArgs.Interfaces; @@ -24,7 +26,7 @@ public class SpawningTeamVehicleEventArgs : IDeniableEvent /// /// /// - public SpawningTeamVehicleEventArgs(SpawnableTeamType team, bool isAllowed = true) + public SpawningTeamVehicleEventArgs(SpawnableWaveBase team, bool isAllowed = true) { Team = team; IsAllowed = isAllowed; @@ -33,7 +35,7 @@ public SpawningTeamVehicleEventArgs(SpawnableTeamType team, bool isAllowed = tru /// /// Gets or sets which vehicle should spawn. /// - public SpawnableTeamType Team { get; set; } + public SpawnableWaveBase Team { get; set; } /// /// Gets or sets a value indicating whether the vehicle can be spawned. diff --git a/EXILED/Exiled.Events/EventArgs/Server/RespawningTeamEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Server/RespawningTeamEventArgs.cs index ab0234c2a3..eee756d7b0 100644 --- a/EXILED/Exiled.Events/EventArgs/Server/RespawningTeamEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Server/RespawningTeamEventArgs.cs @@ -5,6 +5,8 @@ // // ----------------------------------------------------------------------- +using Respawning.Waves; + namespace Exiled.Events.EventArgs.Server { using System.Collections.Generic; @@ -22,7 +24,6 @@ namespace Exiled.Events.EventArgs.Server /// public class RespawningTeamEventArgs : IDeniableEvent { - private SpawnableTeamType nextKnownTeam; private int maximumRespawnAmount; /// @@ -31,6 +32,9 @@ public class RespawningTeamEventArgs : IDeniableEvent /// /// /// + /// + /// + /// /// /// /// @@ -40,14 +44,12 @@ public class RespawningTeamEventArgs : IDeniableEvent /// /// /// - public RespawningTeamEventArgs(List players, int maxRespawn, SpawnableTeamType nextKnownTeam, bool isAllowed = true) + public RespawningTeamEventArgs(List players, Queue queue, int maxRespawn, SpawnableWaveBase nextKnownTeam, bool isAllowed = true) { Players = players; MaximumRespawnAmount = maxRespawn; - - this.nextKnownTeam = nextKnownTeam; - SpawnQueue = new(); - SpawnableTeam.GenerateQueue(SpawnQueue, players.Count); + SpawnQueue = queue; + NextKnownTeam = nextKnownTeam; IsAllowed = isAllowed; } @@ -77,30 +79,7 @@ public int MaximumRespawnAmount /// /// Gets or sets a value indicating what the next respawnable team is. /// - public SpawnableTeamType NextKnownTeam - { - get => nextKnownTeam; - set - { - nextKnownTeam = value; - - if (!RespawnManager.SpawnableTeams.TryGetValue(value, out SpawnableTeamHandlerBase spawnableTeam)) - { - MaximumRespawnAmount = 0; - return; - } - - MaximumRespawnAmount = spawnableTeam.MaxWaveSize; - if (RespawnManager.SpawnableTeams.TryGetValue(nextKnownTeam, out SpawnableTeamHandlerBase @base)) - @base.GenerateQueue(SpawnQueue, Players.Count); - } - } - - /// - /// Gets the current spawnable team. - /// - public SpawnableTeamHandlerBase SpawnableTeam - => RespawnManager.SpawnableTeams.TryGetValue(NextKnownTeam, out SpawnableTeamHandlerBase @base) ? @base : null; + public SpawnableWaveBase NextKnownTeam { get; set; } /// /// Gets or sets a value indicating whether the spawn can occur. diff --git a/EXILED/Exiled.Events/Handlers/Map.cs b/EXILED/Exiled.Events/Handlers/Map.cs index eaaf3703ea..c617ba5e8a 100644 --- a/EXILED/Exiled.Events/Handlers/Map.cs +++ b/EXILED/Exiled.Events/Handlers/Map.cs @@ -25,11 +25,6 @@ public static class Map /// public static Event PlacingBulletHole { get; set; } = new(); - /// - /// Invoked before placing blood. - /// - public static Event PlacingBlood { get; set; } = new(); - /// /// Invoked before announcing the light containment zone decontamination. /// @@ -121,12 +116,6 @@ public static class Map /// The instance. public static void OnPlacingBulletHole(PlacingBulletHoleEventArgs ev) => PlacingBulletHole.InvokeSafely(ev); - /// - /// Called before placing bloods. - /// - /// The instance. - public static void OnPlacingBlood(PlacingBloodEventArgs ev) => PlacingBlood.InvokeSafely(ev); - /// /// Called before announcing the light containment zone decontamination. /// diff --git a/EXILED/Exiled.Events/Patches/Events/Map/PlacingBlood.cs b/EXILED/Exiled.Events/Patches/Events/Map/PlacingBlood.cs deleted file mode 100644 index f8703fe0b3..0000000000 --- a/EXILED/Exiled.Events/Patches/Events/Map/PlacingBlood.cs +++ /dev/null @@ -1,110 +0,0 @@ -// ----------------------------------------------------------------------- -// -// Copyright (c) ExMod Team. All rights reserved. -// Licensed under the CC BY-SA 3.0 license. -// -// ----------------------------------------------------------------------- - -namespace Exiled.Events.Patches.Events.Map -{ - using System.Collections.Generic; - using System.Reflection.Emit; - - using API.Features.Pools; - using Exiled.Events.Attributes; - using Exiled.Events.EventArgs.Map; - - using HarmonyLib; - - using InventorySystem.Items.Firearms.Modules; - - using UnityEngine; - - using static HarmonyLib.AccessTools; - - using ExiledEvents = Exiled.Events.Events; - - /// - /// Patches . - /// Adds the event. - /// - [EventPatch(typeof(Handlers.Map), nameof(Handlers.Map.PlacingBlood))] - [HarmonyPatch(typeof(StandardHitregBase), nameof(StandardHitregBase.PlaceBloodDecal))] - internal static class PlacingBlood - { - private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) - { - List newInstructions = ListPool.Pool.Get(instructions); - - Label returnLabel = generator.DefineLabel(); - - LocalBuilder ev = generator.DeclareLocal(typeof(PlacingBloodEventArgs)); - - // if (!ExiledEvents.Instance.Config.CanSpawnBlood) - // return; - // - // PlacingBloodEventArgs ev = new(Player.Get(this.Hub), Player.Get(target.NetworkId), hit, true); - // - // Handlers.Map.OnPlacingBlood(ev); - // - // if (!ev.IsAllowed) - // return; - // - // hit.point = ev.Position; - newInstructions.InsertRange( - 0, - new[] - { - // if (!ExiledEvents.Instance.Config.CanSpawnBlood) - // return; - new CodeInstruction(OpCodes.Call, PropertyGetter(typeof(ExiledEvents), nameof(ExiledEvents.Instance))), - new(OpCodes.Callvirt, PropertyGetter(typeof(ExiledEvents), nameof(ExiledEvents.Config))), - new(OpCodes.Callvirt, PropertyGetter(typeof(Config), nameof(Config.CanSpawnBlood))), - new(OpCodes.Brfalse_S, returnLabel), - - // Player.Get(this.Hub) - new(OpCodes.Ldarg_0), - new(OpCodes.Callvirt, PropertyGetter(typeof(StandardHitregBase), nameof(StandardHitregBase.Hub))), - new(OpCodes.Call, Method(typeof(API.Features.Player), nameof(API.Features.Player.Get), new[] { typeof(ReferenceHub) })), - - // Player.Get(target.NetworkId) - new(OpCodes.Ldarg_3), - new(OpCodes.Callvirt, PropertyGetter(typeof(IDestructible), nameof(IDestructible.NetworkId))), - new(OpCodes.Call, Method(typeof(API.Features.Player), nameof(API.Features.Player.Get), new[] { typeof(uint) })), - - // hit - new(OpCodes.Ldarg_2), - - // true - new(OpCodes.Ldc_I4_1), - - // PlacingBloodEventArgs ev = new(Player, Player, RaycastHit, bool) - new(OpCodes.Newobj, GetDeclaredConstructors(typeof(PlacingBloodEventArgs))[0]), - new(OpCodes.Dup), - new(OpCodes.Dup), - new(OpCodes.Stloc_S, ev.LocalIndex), - - // Handlers.Map.OnPlacingBlood(ev) - new(OpCodes.Call, Method(typeof(Handlers.Map), nameof(Handlers.Map.OnPlacingBlood))), - - // if (!ev.isAllowed) - // return; - new(OpCodes.Callvirt, PropertyGetter(typeof(PlacingBloodEventArgs), nameof(PlacingBloodEventArgs.IsAllowed))), - new(OpCodes.Brfalse_S, returnLabel), - - // hit.info = ev.Position - new(OpCodes.Ldarga_S, 2), - new(OpCodes.Ldloc_S, ev.LocalIndex), - new(OpCodes.Callvirt, PropertyGetter(typeof(PlacingBloodEventArgs), nameof(PlacingBloodEventArgs.Position))), - new(OpCodes.Callvirt, PropertySetter(typeof(RaycastHit), nameof(RaycastHit.point))), - }); - - newInstructions[newInstructions.Count - 1].labels.Add(returnLabel); - - 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/Events/Map/SpawningTeamVehicle.cs b/EXILED/Exiled.Events/Patches/Events/Map/SpawningTeamVehicle.cs index 7edd275136..4e1f430e4b 100644 --- a/EXILED/Exiled.Events/Patches/Events/Map/SpawningTeamVehicle.cs +++ b/EXILED/Exiled.Events/Patches/Events/Map/SpawningTeamVehicle.cs @@ -5,6 +5,8 @@ // // ----------------------------------------------------------------------- +using Respawning.Waves; + namespace Exiled.Events.Patches.Events.Map { using System.Collections.Generic; @@ -21,11 +23,11 @@ namespace Exiled.Events.Patches.Events.Map using static HarmonyLib.AccessTools; /// - /// Patches . + /// Patches . /// Adds the event. /// [EventPatch(typeof(Handlers.Map), nameof(Handlers.Map.SpawningTeamVehicle))] - [HarmonyPatch(typeof(RespawnEffectsController), nameof(RespawnEffectsController.ExecuteAllEffects))] + [HarmonyPatch(typeof(WaveUpdateMessage), nameof(WaveUpdateMessage.ServerSendUpdate))] internal static class SpawningTeamVehicle { private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) @@ -42,8 +44,7 @@ private static IEnumerable Transpiler(IEnumerable event. /// [EventPatch(typeof(Handlers.Scp106), nameof(Handlers.Scp106.ExitStalking))] - [HarmonyPatch(typeof(Scp106StalkAbility), nameof(Scp106StalkAbility.IsActive), MethodType.Setter)] + [HarmonyPatch(typeof(Scp106StalkAbility), nameof(Scp106StalkAbility.StalkActive), MethodType.Setter)] public class ExitStalking { private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) diff --git a/EXILED/Exiled.Events/Patches/Events/Scp106/Stalking.cs b/EXILED/Exiled.Events/Patches/Events/Scp106/Stalking.cs index e4f6e8e060..9ba430942b 100644 --- a/EXILED/Exiled.Events/Patches/Events/Scp106/Stalking.cs +++ b/EXILED/Exiled.Events/Patches/Events/Scp106/Stalking.cs @@ -37,7 +37,7 @@ private static IEnumerable Transpiler(IEnumerable instruction.operand == (object)PropertyGetter(typeof(Scp106StalkAbility), nameof(Scp106StalkAbility.IsActive))) + offset; + int index = newInstructions.FindIndex(instruction => instruction.operand == (object)PropertyGetter(typeof(Scp106StalkAbility), nameof(Scp106StalkAbility.StalkActive))) + offset; newInstructions.InsertRange( index, new CodeInstruction[] @@ -66,7 +66,7 @@ private static IEnumerable Transpiler(IEnumerable instruction.operand == (object)PropertySetter(typeof(Scp106StalkAbility), nameof(Scp106StalkAbility.IsActive))) + offset; + index = newInstructions.FindIndex(instruction => instruction.operand == (object)PropertySetter(typeof(Scp106StalkAbility), nameof(Scp106StalkAbility.StalkActive))) + offset; newInstructions.InsertRange( index, new CodeInstruction[] diff --git a/EXILED/Exiled.Events/Patches/Events/Scp330/InteractingScp330.cs b/EXILED/Exiled.Events/Patches/Events/Scp330/InteractingScp330.cs index 63907bb773..9d1787ea11 100644 --- a/EXILED/Exiled.Events/Patches/Events/Scp330/InteractingScp330.cs +++ b/EXILED/Exiled.Events/Patches/Events/Scp330/InteractingScp330.cs @@ -7,6 +7,8 @@ namespace Exiled.Events.Patches.Events.Scp330 { + using InventorySystem.Items; + #pragma warning disable SA1402 #pragma warning disable SA1313 @@ -124,7 +126,7 @@ private static IEnumerable Transpiler(IEnumerable instruction.LoadsField(Field(typeof(Scp330Interobject), nameof(Scp330Interobject._takenCandies)))) + offset; + instruction => instruction.LoadsField(Field(typeof(Scp330Interobject), nameof(Scp330Interobject._previousUses)))) + offset; Label notSeverLabel = newInstructions[index].labels[0]; @@ -158,7 +160,7 @@ private static bool ServerProcessPickup(ReferenceHub player, CandyKindID candy, { if (!Scp330Bag.TryGetBag(player, out bag)) { - player.inventory.ServerAddItem(ItemType.SCP330); + player.inventory.ServerAddItem(ItemType.SCP330, ItemAddReason.AdminCommand); if (!Scp330Bag.TryGetBag(player, out bag)) return false; diff --git a/EXILED/Exiled.Events/Patches/Events/Server/RespawningTeam.cs b/EXILED/Exiled.Events/Patches/Events/Server/RespawningTeam.cs index a4d077c1ff..ea2f3546ff 100644 --- a/EXILED/Exiled.Events/Patches/Events/Server/RespawningTeam.cs +++ b/EXILED/Exiled.Events/Patches/Events/Server/RespawningTeam.cs @@ -17,27 +17,29 @@ namespace Exiled.Events.Patches.Events.Server using Exiled.Events.EventArgs.Server; using Exiled.Events.Handlers; using HarmonyLib; + using PlayerRoles; using Respawning; using Respawning.NamingRules; + using Respawning.Waves; using static HarmonyLib.AccessTools; using Player = API.Features.Player; /// - /// Patch the . + /// Patch the . /// Adds the event. /// [EventPatch(typeof(Server), nameof(Server.RespawningTeam))] - [HarmonyPatch(typeof(RespawnManager), nameof(RespawnManager.Spawn))] + [HarmonyPatch(typeof(WaveSpawner), nameof(WaveSpawner.SpawnWave))] internal static class RespawningTeam { private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) { List newInstructions = ListPool.Pool.Get(instructions); - int offset = -6; - int index = newInstructions.FindIndex(instruction => instruction.Calls(Method(typeof(UnitNamingRule), nameof(UnitNamingRule.TryGetNamingRule)))) + offset; + int offset = 1; + int index = newInstructions.FindIndex(instruction => instruction.Calls(Method(typeof(SpawnableWaveBase), nameof(SpawnableWaveBase.PopulateQueue)))) + offset; LocalBuilder ev = generator.DeclareLocal(typeof(RespawningTeamEventArgs)); @@ -48,15 +50,14 @@ private static IEnumerable Transpiler(IEnumerable Transpiler(IEnumerable Transpiler(IEnumerable Transpiler(IEnumerable i.opcode == OpCodes.Callvirt && (MethodInfo)i.operand == Method(typeof(SpawnableTeamHandlerBase), nameof(SpawnableTeamHandlerBase.GenerateQueue))) + offset, 7); + // wave = ev.NextKnownTeam; + new(OpCodes.Callvirt, PropertyGetter(typeof(RespawningTeamEventArgs), nameof(RespawningTeamEventArgs.NextKnownTeam))), + new(OpCodes.Starg_S, 1), + }); for (int z = 0; z < newInstructions.Count; z++) yield return newInstructions[z]; @@ -118,5 +115,12 @@ private static IEnumerable Transpiler(IEnumerable GetPlayers(List hubs) => hubs.Select(Player.Get).ToList(); private static List GetHubs(List players) => players.Select(player => player.ReferenceHub).ToList(); + + private static void RefillQueue(Queue newQueue) + { + WaveSpawner.SpawnQueue.Clear(); + foreach (RoleTypeId role in newQueue) + WaveSpawner.SpawnQueue.Enqueue(role); + } } } \ No newline at end of file