From 996cd0abad97383304eb9e3ea1088d6eac43410d Mon Sep 17 00:00:00 2001 From: Misaka-ZeroTwo <45165615+Misaka-ZeroTwo@users.noreply.github.com> Date: Sun, 21 Jul 2024 14:48:35 +0800 Subject: [PATCH 01/29] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 035650f02..bcbe907cc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ defaults: working-directory: ./EXILED env: - EXILED_REFERENCES_URL: https://Exiled-Official.github.io/SL-References/Master.zip + EXILED_REFERENCES_URL: https://Exiled-Official.github.io/SL-References/Dev.zip EXILED_REFERENCES_PATH: ${{ github.workspace }}/EXILED/References EXILED_DLL_ARCHIVER_URL: https://github.com/Exiled-Official/EXILED-DLL-Archiver/releases/latest/download/EXILED-DLL-Archiver.exe From 887b6c40306f70abded5b8f0627b5873b57a86b1 Mon Sep 17 00:00:00 2001 From: Jesus QC <69375249+Jesus-QC@users.noreply.github.com> Date: Mon, 22 Jul 2024 13:37:58 +0200 Subject: [PATCH 02/29] [README] Design (#130) --- .github/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/README.md b/.github/README.md index 76ea43932..038283f47 100644 --- a/.github/README.md +++ b/.github/README.md @@ -1,3 +1,4 @@ +
Exiled SCPSL, SCP Secret Laboratory Exiled, Exiled SCP: Secret Laboratory, Modding Framework, Mods, Exiled Mod SCPSL

Exiled

EXtended In-runtime Library for External Development
From b48c4ae43ccac8341ab91c6e3df835dcda4a0852 Mon Sep 17 00:00:00 2001 From: Jesus QC <69375249+Jesus-QC@users.noreply.github.com> Date: Wed, 24 Jul 2024 10:37:14 +0200 Subject: [PATCH 03/29] [README] CCBYSA3.0 --- .github/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/README.md b/.github/README.md index 038283f47..4da34bd0b 100644 --- a/.github/README.md +++ b/.github/README.md @@ -112,5 +112,5 @@ Localized READMEs
-
This repo is a fork of Exiled-Team/EXILED after the old repository was taken hostage by the old lead developer.
+
This repo is a fork of Exiled-Team/EXILED after changes in project leadership.
You can access the commit this update was forked from here.
From abae896c23573678cd52e88a4975b5606346b346 Mon Sep 17 00:00:00 2001 From: Misaka-ZeroTwo <45165615+Misaka-ZeroTwo@users.noreply.github.com> Date: Fri, 26 Jul 2024 00:19:35 +0800 Subject: [PATCH 04/29] Update main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7be77c41a..6f9bc0f85 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ defaults: working-directory: ./EXILED env: - EXILED_REFERENCES_URL: https://Exiled-Official.github.io/SL-References/Master.zip + EXILED_REFERENCES_URL: https://exmod-team.github.io/SL-References/Master.zip EXILED_REFERENCES_PATH: ${{ github.workspace }}/EXILED/References jobs: From 8d7dab9e1b01d22d5d0b20e42b22c6c4f3d09f53 Mon Sep 17 00:00:00 2001 From: Misaka-ZeroTwo <45165615+Misaka-ZeroTwo@users.noreply.github.com> Date: Fri, 26 Jul 2024 00:20:50 +0800 Subject: [PATCH 05/29] Update release.yml --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bcbe907cc..efdac4cc8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,9 +11,9 @@ defaults: working-directory: ./EXILED env: - EXILED_REFERENCES_URL: https://Exiled-Official.github.io/SL-References/Dev.zip + EXILED_REFERENCES_URL: https://exmod-team.github.io/SL-References/Dev.zip EXILED_REFERENCES_PATH: ${{ github.workspace }}/EXILED/References - EXILED_DLL_ARCHIVER_URL: https://github.com/Exiled-Official/EXILED-DLL-Archiver/releases/latest/download/EXILED-DLL-Archiver.exe + EXILED_DLL_ARCHIVER_URL: https://github.com/ExMod-Team/EXILED-DLL-Archiver/releases/latest/download/EXILED-DLL-Archiver.exe jobs: build: From 475db8c32b3e2d0ce0b0014b1cee25828063cfa1 Mon Sep 17 00:00:00 2001 From: Misaka-ZeroTwo <45165615+Misaka-ZeroTwo@users.noreply.github.com> Date: Fri, 26 Jul 2024 00:22:48 +0800 Subject: [PATCH 06/29] Update dev.yml --- .github/workflows/dev.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 6a9486427..c1f7fe301 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -14,9 +14,9 @@ defaults: working-directory: ./EXILED env: - EXILED_REFERENCES_URL: https://Exiled-Official.github.io/SL-References/Dev.zip + EXILED_REFERENCES_URL: https://exmod-team.github.io/SL-Reference/Dev.zip EXILED_REFERENCES_PATH: ${{ github.workspace }}/EXILED/References - EXILED_DLL_ARCHIVER_URL: https://github.com/Exiled-Official/EXILED-DLL-Archiver/releases/latest/download/EXILED-DLL-Archiver.exe + EXILED_DLL_ARCHIVER_URL: https://github.com/ExMod-Team/EXILED-DLL-Archiver/releases/latest/download/EXILED-DLL-Archiver.exe jobs: From 4e7406bc6facb4d23ce1f3137577d7e31a48c863 Mon Sep 17 00:00:00 2001 From: Misaka-ZeroTwo <45165615+Misaka-ZeroTwo@users.noreply.github.com> Date: Fri, 26 Jul 2024 00:31:24 +0800 Subject: [PATCH 07/29] Update Updater.cs --- EXILED/Exiled.Loader/Updater.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EXILED/Exiled.Loader/Updater.cs b/EXILED/Exiled.Loader/Updater.cs index 6990c1812..fb0636570 100644 --- a/EXILED/Exiled.Loader/Updater.cs +++ b/EXILED/Exiled.Loader/Updater.cs @@ -31,7 +31,7 @@ namespace Exiled.Loader /// internal sealed class Updater { - private const long REPOID = 828620622; + private const long REPOID = 833723500; private const string INSTALLER_ASSET_NAME_LINUX = "Exiled.Installer-Linux"; private const string INSTALLER_ASSET_NAME_WIN = "Exiled.Installer-Win.exe"; @@ -332,4 +332,4 @@ private bool FindAsset(string assetName, Release release, out ReleaseAsset asset return false; } } -} \ No newline at end of file +} From dfed0ee07c6e4380105d2477ef27142406ef249a Mon Sep 17 00:00:00 2001 From: Misaka-ZeroTwo <45165615+Misaka-ZeroTwo@users.noreply.github.com> Date: Fri, 26 Jul 2024 00:31:46 +0800 Subject: [PATCH 08/29] Update Program.cs --- EXILED/Exiled.Installer/Program.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EXILED/Exiled.Installer/Program.cs b/EXILED/Exiled.Installer/Program.cs index 34912cc51..559c17c82 100644 --- a/EXILED/Exiled.Installer/Program.cs +++ b/EXILED/Exiled.Installer/Program.cs @@ -42,7 +42,7 @@ internal enum PathResolution internal static class Program { - private const long RepoID = 828620622; + private const long RepoID = 833723500; private const string ExiledAssetName = "exiled.tar.gz"; // This is the lowest version the installer will check to install @@ -303,4 +303,4 @@ private static Release FindRelease(CommandSettings args, IEnumerable re return enumerable.First(); } } -} \ No newline at end of file +} From 0b108104c391b3622b1b196a082b6fcea632444a Mon Sep 17 00:00:00 2001 From: Misaka-ZeroTwo <45165615+Misaka-ZeroTwo@users.noreply.github.com> Date: Fri, 26 Jul 2024 01:33:28 +0800 Subject: [PATCH 09/29] Update dev.yml --- .github/workflows/dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index c1f7fe301..a608aa15a 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -14,7 +14,7 @@ defaults: working-directory: ./EXILED env: - EXILED_REFERENCES_URL: https://exmod-team.github.io/SL-Reference/Dev.zip + EXILED_REFERENCES_URL: https://exmod-team.github.io/SL-References/Dev.zip EXILED_REFERENCES_PATH: ${{ github.workspace }}/EXILED/References EXILED_DLL_ARCHIVER_URL: https://github.com/ExMod-Team/EXILED-DLL-Archiver/releases/latest/download/EXILED-DLL-Archiver.exe From 42b541e4602f28313d1a6a9fb1f1c006660585d4 Mon Sep 17 00:00:00 2001 From: Misaka-ZeroTwo <45165615+Misaka-ZeroTwo@users.noreply.github.com> Date: Fri, 26 Jul 2024 17:39:39 +0800 Subject: [PATCH 10/29] Update labeler.yml --- .github/labeler.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 34ff31f3f..5098459b0 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -13,29 +13,28 @@ Scripts: # Add the 'Scripts' label regarding-events: # Add the 'Events' label - changed-files: - - any-glob-to-any-file: Exiled.Events/** # Any Modifications to events + - any-glob-to-any-file: EXILED/Exiled.Events/** # Any Modifications to events regarding-api: # Add the 'API' label - changed-files: - - any-glob-to-any-file: Exiled.API/** # Any modifications to the API + - any-glob-to-any-file: EXILED/Exiled.API/** # Any modifications to the API regarding-transpiler: # Add the 'transpiler' label - changed-files: - - any-glob-to-any-file: Exiled.Events/Patches/**/* # Any modifications to transpiler files + - any-glob-to-any-file: EXILED/Exiled.Events/Patches/**/* # Any modifications to transpiler files CustomModules: # Add the 'CustomModules' label - changed-files: - - any-glob-to-any-file: Exiled.CustomModules/** # Any modifications to CustomModules + - any-glob-to-any-file: EXILED/Exiled.CustomModules/** # Any modifications to CustomModules Installer: # Add the 'Installer' label - changed-files: - - any-glob-to-any-file: Exiled.Installer/** # Any modifications to the Installer + - any-glob-to-any-file: EXILED/Exiled.Installer/** # Any modifications to the Installer Localization: # Add the 'Localization' label - changed-files: - - any-glob-to-any-file: Localization/** # Any modifications to Localization + - any-glob-to-any-file: EXILED/Localization/** # Any modifications to Localization GitHub_Actions: # Add the 'GitHub' label - changed-files: - any-glob-to-any-file: .github/** # Any modifications to github related files - From 92af4ce0a4e98085e2a9e5e266845530c1b99625 Mon Sep 17 00:00:00 2001 From: Misaka-ZeroTwo <45165615+Misaka-ZeroTwo@users.noreply.github.com> Date: Fri, 26 Jul 2024 17:39:56 +0800 Subject: [PATCH 11/29] Update labeler.yml --- .github/labeler.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 34ff31f3f..5098459b0 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -13,29 +13,28 @@ Scripts: # Add the 'Scripts' label regarding-events: # Add the 'Events' label - changed-files: - - any-glob-to-any-file: Exiled.Events/** # Any Modifications to events + - any-glob-to-any-file: EXILED/Exiled.Events/** # Any Modifications to events regarding-api: # Add the 'API' label - changed-files: - - any-glob-to-any-file: Exiled.API/** # Any modifications to the API + - any-glob-to-any-file: EXILED/Exiled.API/** # Any modifications to the API regarding-transpiler: # Add the 'transpiler' label - changed-files: - - any-glob-to-any-file: Exiled.Events/Patches/**/* # Any modifications to transpiler files + - any-glob-to-any-file: EXILED/Exiled.Events/Patches/**/* # Any modifications to transpiler files CustomModules: # Add the 'CustomModules' label - changed-files: - - any-glob-to-any-file: Exiled.CustomModules/** # Any modifications to CustomModules + - any-glob-to-any-file: EXILED/Exiled.CustomModules/** # Any modifications to CustomModules Installer: # Add the 'Installer' label - changed-files: - - any-glob-to-any-file: Exiled.Installer/** # Any modifications to the Installer + - any-glob-to-any-file: EXILED/Exiled.Installer/** # Any modifications to the Installer Localization: # Add the 'Localization' label - changed-files: - - any-glob-to-any-file: Localization/** # Any modifications to Localization + - any-glob-to-any-file: EXILED/Localization/** # Any modifications to Localization GitHub_Actions: # Add the 'GitHub' label - changed-files: - any-glob-to-any-file: .github/** # Any modifications to github related files - From fd3840aac37e308cdb4efde92ec01d19da91b188 Mon Sep 17 00:00:00 2001 From: Misaka-ZeroTwo <45165615+Misaka-ZeroTwo@users.noreply.github.com> Date: Wed, 31 Jul 2024 19:07:27 +0800 Subject: [PATCH 12/29] Merge to dev (#8) --- .github/workflows/main.yml | 2 +- .github/workflows/release.yml | 4 ++-- EXILED/Exiled.Installer/Program.cs | 4 ++-- EXILED/Exiled.Loader/Updater.cs | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7be77c41a..6f9bc0f85 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ defaults: working-directory: ./EXILED env: - EXILED_REFERENCES_URL: https://Exiled-Official.github.io/SL-References/Master.zip + EXILED_REFERENCES_URL: https://exmod-team.github.io/SL-References/Master.zip EXILED_REFERENCES_PATH: ${{ github.workspace }}/EXILED/References jobs: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bcbe907cc..efdac4cc8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,9 +11,9 @@ defaults: working-directory: ./EXILED env: - EXILED_REFERENCES_URL: https://Exiled-Official.github.io/SL-References/Dev.zip + EXILED_REFERENCES_URL: https://exmod-team.github.io/SL-References/Dev.zip EXILED_REFERENCES_PATH: ${{ github.workspace }}/EXILED/References - EXILED_DLL_ARCHIVER_URL: https://github.com/Exiled-Official/EXILED-DLL-Archiver/releases/latest/download/EXILED-DLL-Archiver.exe + EXILED_DLL_ARCHIVER_URL: https://github.com/ExMod-Team/EXILED-DLL-Archiver/releases/latest/download/EXILED-DLL-Archiver.exe jobs: build: diff --git a/EXILED/Exiled.Installer/Program.cs b/EXILED/Exiled.Installer/Program.cs index 34912cc51..559c17c82 100644 --- a/EXILED/Exiled.Installer/Program.cs +++ b/EXILED/Exiled.Installer/Program.cs @@ -42,7 +42,7 @@ internal enum PathResolution internal static class Program { - private const long RepoID = 828620622; + private const long RepoID = 833723500; private const string ExiledAssetName = "exiled.tar.gz"; // This is the lowest version the installer will check to install @@ -303,4 +303,4 @@ private static Release FindRelease(CommandSettings args, IEnumerable re return enumerable.First(); } } -} \ No newline at end of file +} diff --git a/EXILED/Exiled.Loader/Updater.cs b/EXILED/Exiled.Loader/Updater.cs index 6990c1812..fb0636570 100644 --- a/EXILED/Exiled.Loader/Updater.cs +++ b/EXILED/Exiled.Loader/Updater.cs @@ -31,7 +31,7 @@ namespace Exiled.Loader /// internal sealed class Updater { - private const long REPOID = 828620622; + private const long REPOID = 833723500; private const string INSTALLER_ASSET_NAME_LINUX = "Exiled.Installer-Linux"; private const string INSTALLER_ASSET_NAME_WIN = "Exiled.Installer-Win.exe"; @@ -332,4 +332,4 @@ private bool FindAsset(string assetName, Release release, out ReleaseAsset asset return false; } } -} \ No newline at end of file +} From bd63934fd1e27c66f9766d7edf08033c63580c4e Mon Sep 17 00:00:00 2001 From: Yamato <66829532+louis1706@users.noreply.github.com> Date: Thu, 1 Aug 2024 00:22:18 +0200 Subject: [PATCH 13/29] This will not be used (#13) --- .../Generic/Scp049API/CallAbilityDuration.cs | 63 ---------- .../Scp049API/SenseAbilityBaseCooldown.cs | 64 ---------- .../Scp049API/SenseAbilityReducedCooldown.cs | 64 ---------- .../Scp106API/CooldownReductionReward.cs | 67 ----------- .../Patches/Generic/Scp106API/CustomAttack.cs | 111 ------------------ .../Scp106API/HunterAtlastCostPerMetter.cs | 67 ----------- .../Scp106API/SinkholeAbilityCooldown.cs | 67 ----------- .../Generic/Scp106API/StalkVigorUse.cs | 84 ------------- .../Generic/Scp106API/VigorRegeneration.cs | 66 ----------- 9 files changed, 653 deletions(-) delete mode 100644 EXILED/Exiled.Events/Patches/Generic/Scp049API/CallAbilityDuration.cs delete mode 100644 EXILED/Exiled.Events/Patches/Generic/Scp049API/SenseAbilityBaseCooldown.cs delete mode 100644 EXILED/Exiled.Events/Patches/Generic/Scp049API/SenseAbilityReducedCooldown.cs delete mode 100644 EXILED/Exiled.Events/Patches/Generic/Scp106API/CooldownReductionReward.cs delete mode 100644 EXILED/Exiled.Events/Patches/Generic/Scp106API/CustomAttack.cs delete mode 100644 EXILED/Exiled.Events/Patches/Generic/Scp106API/HunterAtlastCostPerMetter.cs delete mode 100644 EXILED/Exiled.Events/Patches/Generic/Scp106API/SinkholeAbilityCooldown.cs delete mode 100644 EXILED/Exiled.Events/Patches/Generic/Scp106API/StalkVigorUse.cs delete mode 100644 EXILED/Exiled.Events/Patches/Generic/Scp106API/VigorRegeneration.cs diff --git a/EXILED/Exiled.Events/Patches/Generic/Scp049API/CallAbilityDuration.cs b/EXILED/Exiled.Events/Patches/Generic/Scp049API/CallAbilityDuration.cs deleted file mode 100644 index ddfb45adb..000000000 --- a/EXILED/Exiled.Events/Patches/Generic/Scp049API/CallAbilityDuration.cs +++ /dev/null @@ -1,63 +0,0 @@ -// ----------------------------------------------------------------------- -// -// Copyright (c) Exiled 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 Exiled.API.Features; - using HarmonyLib; - using PlayerRoles.PlayableScps.Scp049; - using PlayerRoles.Subroutines; - - using static HarmonyLib.AccessTools; - - using BaseScp049Role = PlayerRoles.PlayableScps.Scp049.Scp049Role; - using Scp049Role = API.Features.Roles.Scp049Role; - - /// - /// Patches . - /// Adds the property. - /// - // [HarmonyPatch(typeof(Scp049CallAbility), nameof(Scp049CallAbility.ServerProcessCmd))] - internal class CallAbilityDuration - { - private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) - { - List newInstructions = ListPool.Pool.Get(instructions); - - LocalBuilder scp049Role = generator.DeclareLocal(typeof(Scp049Role)); - - // replace "this.Duration.Trigger(20.0)" with "this.Duration.Trigger((Player.Get(base.Owner).Role as Scp049Role).CallAbilityDuration)" - int offset = -1; - int index = newInstructions.FindIndex(instruction => instruction.operand == (object)Method(typeof(AbilityCooldown), nameof(AbilityCooldown.Trigger))) + offset; - newInstructions.RemoveAt(index); - - newInstructions.InsertRange( - index, - new CodeInstruction[] - { - // Player.Get(base.Owner).Role - new(OpCodes.Ldarg_0), - new(OpCodes.Call, PropertyGetter(typeof(StandardSubroutine), nameof(StandardSubroutine.Owner))), - new(OpCodes.Call, Method(typeof(Player), nameof(Player.Get), new[] { typeof(ReferenceHub) })), - new(OpCodes.Callvirt, PropertyGetter(typeof(Player), nameof(Player.Role))), - - // (Player.Get(base.Owner).Role as Scp049Role).CallAbilityDuration - new(OpCodes.Isinst, typeof(Scp049Role)), - new(OpCodes.Callvirt, PropertyGetter(typeof(Scp049Role), nameof(Scp049Role.CallAbilityDuration))), - }); - - 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/Generic/Scp049API/SenseAbilityBaseCooldown.cs b/EXILED/Exiled.Events/Patches/Generic/Scp049API/SenseAbilityBaseCooldown.cs deleted file mode 100644 index a70583b5f..000000000 --- a/EXILED/Exiled.Events/Patches/Generic/Scp049API/SenseAbilityBaseCooldown.cs +++ /dev/null @@ -1,64 +0,0 @@ -// ----------------------------------------------------------------------- -// -// Copyright (c) Exiled 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 Exiled.API.Features; - - using HarmonyLib; - using PlayerRoles.PlayableScps.Scp049; - using PlayerRoles.Subroutines; - - using static HarmonyLib.AccessTools; - - using BaseScp049Role = PlayerRoles.PlayableScps.Scp049.Scp049Role; - using Scp049Role = API.Features.Roles.Scp049Role; - - /// - /// Patches . - /// Adds the property. - /// - // [HarmonyPatch(typeof(Scp049SenseAbility), nameof(Scp049SenseAbility.ServerProcessKilledPlayer))] - internal class SenseAbilityBaseCooldown - { - private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) - { - List newInstructions = ListPool.Pool.Get(instructions); - - LocalBuilder scp049Role = generator.DeclareLocal(typeof(Scp049Role)); - - // replace "this.Duration.Trigger(40.0)" with "this.Duration.Trigger((Player.Get(base.Owner).Role as Scp049Role).SenseAbilityBaseCooldown)" - int offset = -1; - int index = newInstructions.FindIndex(instruction => instruction.operand == (object)Method(typeof(AbilityCooldown), nameof(AbilityCooldown.Trigger))) + offset; - newInstructions.RemoveAt(index); - - newInstructions.InsertRange( - index, - new CodeInstruction[] - { - // Player.Get(base.Owner).Role - new(OpCodes.Ldarg_0), - new(OpCodes.Call, PropertyGetter(typeof(StandardSubroutine), nameof(StandardSubroutine.Owner))), - new(OpCodes.Call, Method(typeof(Player), nameof(Player.Get), new[] { typeof(ReferenceHub) })), - new(OpCodes.Callvirt, PropertyGetter(typeof(Player), nameof(Player.Role))), - - // (Player.Get(base.Owner).Role as Scp049Role).SenseAbilityBaseCooldown - new(OpCodes.Isinst, typeof(Scp049Role)), - new(OpCodes.Callvirt, PropertyGetter(typeof(Scp049Role), nameof(Scp049Role.SenseAbilityBaseCooldown))), - }); - - 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/Generic/Scp049API/SenseAbilityReducedCooldown.cs b/EXILED/Exiled.Events/Patches/Generic/Scp049API/SenseAbilityReducedCooldown.cs deleted file mode 100644 index 88c8333a1..000000000 --- a/EXILED/Exiled.Events/Patches/Generic/Scp049API/SenseAbilityReducedCooldown.cs +++ /dev/null @@ -1,64 +0,0 @@ -// ----------------------------------------------------------------------- -// -// Copyright (c) Exiled 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 Exiled.API.Features; - - using HarmonyLib; - using PlayerRoles.PlayableScps.Scp049; - using PlayerRoles.Subroutines; - - using static HarmonyLib.AccessTools; - - using BaseScp049Role = PlayerRoles.PlayableScps.Scp049.Scp049Role; - using Scp049Role = API.Features.Roles.Scp049Role; - - /// - /// Patches . - /// Adds the property. - /// - // [HarmonyPatch(typeof(Scp049SenseAbility), nameof(Scp049SenseAbility.ServerLoseTarget))] - internal class SenseAbilityReducedCooldown - { - private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) - { - List newInstructions = ListPool.Pool.Get(instructions); - - LocalBuilder scp049Role = generator.DeclareLocal(typeof(Scp049Role)); - - // replace "this.Duration.Trigger(40.0)" with "this.Duration.Trigger((Player.Get(base.Owner).Role as Scp049Role).SenseAbilityReducedCooldown)" - int offset = -1; - int index = newInstructions.FindIndex(instruction => instruction.operand == (object)Method(typeof(AbilityCooldown), nameof(AbilityCooldown.Trigger))) + offset; - newInstructions.RemoveAt(index); - - newInstructions.InsertRange( - index, - new CodeInstruction[] - { - // Player.Get(base.Owner).Role - new(OpCodes.Ldarg_0), - new(OpCodes.Call, PropertyGetter(typeof(StandardSubroutine), nameof(StandardSubroutine.Owner))), - new(OpCodes.Call, Method(typeof(Player), nameof(Player.Get), new[] { typeof(ReferenceHub) })), - new(OpCodes.Callvirt, PropertyGetter(typeof(Player), nameof(Player.Role))), - - // (Player.Get(base.Owner).Role as Scp049Role).SenseAbilityReducedCooldown - new(OpCodes.Isinst, typeof(Scp049Role)), - new(OpCodes.Callvirt, PropertyGetter(typeof(Scp049Role), nameof(Scp049Role.SenseAbilityReducedCooldown))), - }); - - 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/Generic/Scp106API/CooldownReductionReward.cs b/EXILED/Exiled.Events/Patches/Generic/Scp106API/CooldownReductionReward.cs deleted file mode 100644 index 4f509aad2..000000000 --- a/EXILED/Exiled.Events/Patches/Generic/Scp106API/CooldownReductionReward.cs +++ /dev/null @@ -1,67 +0,0 @@ -// ----------------------------------------------------------------------- -// -// Copyright (c) Exiled Team. All rights reserved. -// Licensed under the CC BY-SA 3.0 license. -// -// ----------------------------------------------------------------------- - -namespace Exiled.Events.Patches.Generic.Scp106API -{ - using System.Collections.Generic; - using System.Reflection; - using System.Reflection.Emit; - - using API.Features.Pools; - using Exiled.API.Features; - using HarmonyLib; - using PlayerRoles.PlayableScps.Scp106; - using PlayerRoles.Subroutines; - - using static HarmonyLib.AccessTools; - - using BaseScp106Role = PlayerRoles.PlayableScps.Scp106.Scp106Role; - using Scp106Role = API.Features.Roles.Scp106Role; - - /// - /// Patches . - /// Adds the property. - /// - // [HarmonyPatch(typeof(Scp106Attack), nameof(Scp106Attack.ReduceSinkholeCooldown))] - internal class CooldownReductionReward - { - private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) - { - List newInstructions = ListPool.Pool.Get(instructions); - - LocalBuilder scp049Role = generator.DeclareLocal(typeof(Scp106Role)); - - // replace "base.ScpRole.Sinkhole.Cooldown.NextUse -= 5.0; - // with - // Scp106Role scp106Role = Player.Get(this.Owner).Role.As() - // replace "base.ScpRole.Sinkhole.Cooldown.NextUse -= scp106Role.CooldownReductionReward; - int offset = 0; - int index = newInstructions.FindLastIndex(instruction => instruction.opcode == OpCodes.Ldc_R4) + offset; - newInstructions.RemoveAt(index); - - newInstructions.InsertRange( - index, - new CodeInstruction[] - { - // Player.Get(base.Owner).Role - new(OpCodes.Ldarg_0), - new(OpCodes.Call, PropertyGetter(typeof(StandardSubroutine), nameof(StandardSubroutine.Owner))), - new(OpCodes.Call, Method(typeof(Player), nameof(Player.Get), new[] { typeof(ReferenceHub) })), - new(OpCodes.Callvirt, PropertyGetter(typeof(Player), nameof(Player.Role))), - - // (Player.Get(base.Owner).Role as Scp106Role).CooldownReductionReward - new(OpCodes.Isinst, typeof(Scp106Role)), - new(OpCodes.Callvirt, PropertyGetter(typeof(Scp106Role), nameof(Scp106Role.CooldownReductionReward))), - }); - - for (int z = 0; z < newInstructions.Count; z++) - yield return newInstructions[z]; - - ListPool.Pool.Return(newInstructions); - } - } -} diff --git a/EXILED/Exiled.Events/Patches/Generic/Scp106API/CustomAttack.cs b/EXILED/Exiled.Events/Patches/Generic/Scp106API/CustomAttack.cs deleted file mode 100644 index f6469919a..000000000 --- a/EXILED/Exiled.Events/Patches/Generic/Scp106API/CustomAttack.cs +++ /dev/null @@ -1,111 +0,0 @@ -// ----------------------------------------------------------------------- -// -// Copyright (c) Exiled Team. All rights reserved. -// Licensed under the CC BY-SA 3.0 license. -// -// ----------------------------------------------------------------------- - -namespace Exiled.Events.Patches.Generic.Scp106API -{ - using System.Collections.Generic; - using System.Reflection.Emit; - - using API.Features.Pools; - using Exiled.API.Features; - using HarmonyLib; - using PlayerRoles.PlayableScps.Scp106; - using PlayerRoles.Subroutines; - - using static HarmonyLib.AccessTools; - - using BaseScp106Role = PlayerRoles.PlayableScps.Scp106.Scp106Role; - using Scp106Role = API.Features.Roles.Scp106Role; - - /// - /// Patches . - /// Adds the , , property. - /// - // [HarmonyPatch(typeof(Scp106Attack), nameof(Scp106Attack.ServerShoot))] - internal class CustomAttack - { - private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) - { - List newInstructions = ListPool.Pool.Get(instructions); - - LocalBuilder scp049Role = generator.DeclareLocal(typeof(Scp106Role)); - - // replace "base.Vigor.VigorAmount += 0.3f;" - // with - // Scp106Role scp106Role = Player.Get(this.Owner).Role.As() - // "base.Vigor.VigorAmount += scp106Role.VigorCaptureReward;" - int offset = 0; - int index = newInstructions.FindIndex(instruction => instruction.operand == (object)Scp106Attack.VigorCaptureReward) + offset; - newInstructions.RemoveAt(index); - - newInstructions.InsertRange( - index, - new CodeInstruction[] - { - // Player.Get(base.Owner).Role - new(OpCodes.Ldarg_0), - new(OpCodes.Call, PropertyGetter(typeof(StandardSubroutine), nameof(StandardSubroutine.Owner))), - new(OpCodes.Call, Method(typeof(Player), nameof(Player.Get), new[] { typeof(ReferenceHub) })), - new(OpCodes.Callvirt, PropertyGetter(typeof(Player), nameof(Player.Role))), - - // (Player.Get(base.Owner).Role as Scp106Role).AttackDamage - new(OpCodes.Isinst, typeof(Scp106Role)), - new(OpCodes.Callvirt, PropertyGetter(typeof(Scp106Role), nameof(Scp106Role.VigorCaptureReward))), - }); - - // replace "base.Vigor.VigorAmount += 0.3f;" - // with - // Scp106Role scp106Role = Player.Get(this.Owner).Role.As() - // "base.Vigor.VigorAmount += scp106Role.VigorCaptureReward;" - offset = 0; - index = newInstructions.FindIndex(instruction => instruction.operand == (object)Scp106Attack.VigorCaptureReward) + offset; - newInstructions.RemoveAt(index); - - newInstructions.InsertRange( - index, - new CodeInstruction[] - { - // Player.Get(base.Owner).Role - new(OpCodes.Ldarg_0), - new(OpCodes.Call, PropertyGetter(typeof(StandardSubroutine), nameof(StandardSubroutine.Owner))), - new(OpCodes.Call, Method(typeof(Player), nameof(Player.Get), new[] { typeof(ReferenceHub) })), - new(OpCodes.Callvirt, PropertyGetter(typeof(Player), nameof(Player.Role))), - - // (Player.Get(base.Owner).Role as Scp106Role).AttackDamage - new(OpCodes.Isinst, typeof(Scp106Role)), - new(OpCodes.Callvirt, PropertyGetter(typeof(Scp106Role), nameof(Scp106Role.VigorCaptureReward))), - }); - - // replace "playerEffectsController.EnableEffect(20f, false);" - // with - // Scp106Role scp106Role = Player.Get(this.Owner).Role.As() - // "playerEffectsController.EnableEffect(scp106Role.CorrodingTime, false);" - offset = 0; - index = newInstructions.FindLastIndex(instruction => instruction.opcode == OpCodes.Ldc_R4) + offset; - newInstructions.RemoveAt(index); - - newInstructions.InsertRange( - index, - new CodeInstruction[] - { - // Player.Get(base.Owner).Role - new(OpCodes.Ldarg_0), - new(OpCodes.Call, PropertyGetter(typeof(StandardSubroutine), nameof(StandardSubroutine.Owner))), - new(OpCodes.Call, Method(typeof(Player), nameof(Player.Get), new[] { typeof(ReferenceHub) })), - new(OpCodes.Callvirt, PropertyGetter(typeof(Player), nameof(Player.Role))), - - // (Player.Get(base.Owner).Role as Scp106Role).CorrodingTime - new(OpCodes.Isinst, typeof(Scp106Role)), - new(OpCodes.Callvirt, PropertyGetter(typeof(Scp106Role), nameof(Scp106Role.CorrodingTime))), - }); - for (int z = 0; z < newInstructions.Count; z++) - yield return newInstructions[z]; - - ListPool.Pool.Return(newInstructions); - } - } -} diff --git a/EXILED/Exiled.Events/Patches/Generic/Scp106API/HunterAtlastCostPerMetter.cs b/EXILED/Exiled.Events/Patches/Generic/Scp106API/HunterAtlastCostPerMetter.cs deleted file mode 100644 index d85ac0151..000000000 --- a/EXILED/Exiled.Events/Patches/Generic/Scp106API/HunterAtlastCostPerMetter.cs +++ /dev/null @@ -1,67 +0,0 @@ -// ----------------------------------------------------------------------- -// -// Copyright (c) Exiled Team. All rights reserved. -// Licensed under the CC BY-SA 3.0 license. -// -// ----------------------------------------------------------------------- - -namespace Exiled.Events.Patches.Generic.Scp106API -{ - using System.Collections.Generic; - using System.Reflection; - using System.Reflection.Emit; - - using API.Features.Pools; - using Exiled.API.Features; - using HarmonyLib; - using PlayerRoles.PlayableScps.Scp106; - using PlayerRoles.Subroutines; - - using static HarmonyLib.AccessTools; - - using BaseScp106Role = PlayerRoles.PlayableScps.Scp106.Scp106Role; - using Scp106Role = API.Features.Roles.Scp106Role; - - /// - /// Patches . - /// Adds the property. - /// - // [HarmonyPatch(typeof(Scp106HuntersAtlasAbility), nameof(Scp106HuntersAtlasAbility.ServerProcessCmd))] - internal class HunterAtlastCostPerMetter - { - private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) - { - List newInstructions = ListPool.Pool.Get(instructions); - - LocalBuilder scp049Role = generator.DeclareLocal(typeof(Scp106Role)); - - // replace "num = (position2 - this._syncPos).MagnitudeIgnoreY() * 0.019f;" - // with - // Scp106Role scp106Role = Player.Get(this.Owner).Role.As() - // replace "num = (position2 - this._syncPos).MagnitudeIgnoreY() * scp106Role.HuntersAtlasCostPerMeter;" - int offset = 0; - int index = newInstructions.FindLastIndex(instruction => instruction.opcode == OpCodes.Ldc_R4) + offset; - newInstructions.RemoveAt(index); - - newInstructions.InsertRange( - index, - new CodeInstruction[] - { - // Player.Get(base.Owner).Role - new(OpCodes.Ldarg_0), - new(OpCodes.Call, PropertyGetter(typeof(StandardSubroutine), nameof(StandardSubroutine.Owner))), - new(OpCodes.Call, Method(typeof(Player), nameof(Player.Get), new[] { typeof(ReferenceHub) })), - new(OpCodes.Callvirt, PropertyGetter(typeof(Player), nameof(Player.Role))), - - // (Player.Get(base.Owner).Role as Scp106Role).HuntersAtlasCostPerMeter - new(OpCodes.Isinst, typeof(Scp106Role)), - new(OpCodes.Callvirt, PropertyGetter(typeof(Scp106Role), nameof(Scp106Role.HuntersAtlasCostPerMeter))), - }); - - for (int z = 0; z < newInstructions.Count; z++) - yield return newInstructions[z]; - - ListPool.Pool.Return(newInstructions); - } - } -} diff --git a/EXILED/Exiled.Events/Patches/Generic/Scp106API/SinkholeAbilityCooldown.cs b/EXILED/Exiled.Events/Patches/Generic/Scp106API/SinkholeAbilityCooldown.cs deleted file mode 100644 index 519fef858..000000000 --- a/EXILED/Exiled.Events/Patches/Generic/Scp106API/SinkholeAbilityCooldown.cs +++ /dev/null @@ -1,67 +0,0 @@ -// ----------------------------------------------------------------------- -// -// Copyright (c) Exiled Team. All rights reserved. -// Licensed under the CC BY-SA 3.0 license. -// -// ----------------------------------------------------------------------- - -namespace Exiled.Events.Patches.Generic.Scp106API -{ - using System.Collections.Generic; - using System.Reflection; - using System.Reflection.Emit; - - using API.Features.Pools; - using Exiled.API.Features; - using HarmonyLib; - using PlayerRoles.PlayableScps.Scp106; - using PlayerRoles.Subroutines; - - using static HarmonyLib.AccessTools; - - using BaseScp106Role = PlayerRoles.PlayableScps.Scp106.Scp106Role; - using Scp106Role = API.Features.Roles.Scp106Role; - - /// - /// Patches . - /// Adds the property. - /// - // [HarmonyPatch(typeof(Scp106Attack), nameof(Scp106Attack.ReduceSinkholeCooldown))] - internal class SinkholeAbilityCooldown - { - private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) - { - List newInstructions = ListPool.Pool.Get(instructions); - - LocalBuilder scp049Role = generator.DeclareLocal(typeof(Scp106Role)); - - // replace "this.Cooldown.Trigger(20.0);" - // with - // Scp106Role scp106Role = Player.Get(this.Owner).Role.As() - // replace "this.Cooldown.Trigger(scp106Role.SinkholeCooldownDuration);" - int offset = 0; - int index = newInstructions.FindLastIndex(instruction => instruction.opcode == OpCodes.Ldc_R4) + offset; - newInstructions.RemoveAt(index); - - newInstructions.InsertRange( - index, - new CodeInstruction[] - { - // Player.Get(base.Owner).Role - new(OpCodes.Ldarg_0), - new(OpCodes.Call, PropertyGetter(typeof(StandardSubroutine), nameof(StandardSubroutine.Owner))), - new(OpCodes.Call, Method(typeof(Player), nameof(Player.Get), new[] { typeof(ReferenceHub) })), - new(OpCodes.Callvirt, PropertyGetter(typeof(Player), nameof(Player.Role))), - - // (Player.Get(base.Owner).Role as Scp106Role).SinkholeCooldownDuration - new(OpCodes.Isinst, typeof(Scp106Role)), - new(OpCodes.Callvirt, PropertyGetter(typeof(Scp106Role), nameof(Scp106Role.SinkholeCooldownDuration))), - }); - - for (int z = 0; z < newInstructions.Count; z++) - yield return newInstructions[z]; - - ListPool.Pool.Return(newInstructions); - } - } -} diff --git a/EXILED/Exiled.Events/Patches/Generic/Scp106API/StalkVigorUse.cs b/EXILED/Exiled.Events/Patches/Generic/Scp106API/StalkVigorUse.cs deleted file mode 100644 index 38b7a9e53..000000000 --- a/EXILED/Exiled.Events/Patches/Generic/Scp106API/StalkVigorUse.cs +++ /dev/null @@ -1,84 +0,0 @@ -// ----------------------------------------------------------------------- -// -// Copyright (c) Exiled Team. All rights reserved. -// Licensed under the CC BY-SA 3.0 license. -// -// ----------------------------------------------------------------------- - -namespace Exiled.Events.Patches.Generic.Scp106API -{ - using System.Collections.Generic; - using System.Reflection.Emit; - - using API.Features.Pools; - using Exiled.API.Features; - using HarmonyLib; - using PlayerRoles.PlayableScps.Scp106; - using PlayerRoles.Subroutines; - - using static HarmonyLib.AccessTools; - - using BaseScp106Role = PlayerRoles.PlayableScps.Scp106.Scp106Role; - using Scp106Role = API.Features.Roles.Scp106Role; - - /// - /// Patches . - /// Adds the and property. - /// - // [HarmonyPatch(typeof(Scp106StalkAbility), nameof(Scp106StalkAbility.UpdateServerside))] - internal class StalkVigorUse - { - private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) - { - List newInstructions = ListPool.Pool.Get(instructions); - - LocalBuilder scp049Role = generator.DeclareLocal(typeof(Scp106Role)); - - // replace "float num = base.ScpRole.FpcModule.Motor.MovementDetected ? 0.09f : 0.06f;" - // with - // Scp106Role scp106Role = Player.Get(this.Owner).Role.As() - // "float num = base.ScpRole.FpcModule.Motor.MovementDetected ? scp106Role.VigorStalkCostMoving : scp106Role.VigorStalkCostStationary;" - int offset = 0; - int index = newInstructions.FindIndex(instruction => instruction.opcode == OpCodes.Ldc_R4) + offset; - newInstructions.RemoveAt(index); - - newInstructions.InsertRange( - index, - new CodeInstruction[] - { - // Player.Get(base.Owner).Role - new(OpCodes.Ldarg_0), - new(OpCodes.Call, PropertyGetter(typeof(StandardSubroutine), nameof(StandardSubroutine.Owner))), - new(OpCodes.Call, Method(typeof(Player), nameof(Player.Get), new[] { typeof(ReferenceHub) })), - new(OpCodes.Callvirt, PropertyGetter(typeof(Player), nameof(Player.Role))), - - // (Player.Get(base.Owner).Role as Scp106Role).VigorStalkCostMoving - new(OpCodes.Isinst, typeof(Scp106Role)), - new(OpCodes.Callvirt, PropertyGetter(typeof(Scp106Role), nameof(Scp106Role.VigorStalkCostMoving))), - }); - - offset = 0; - index = newInstructions.FindIndex(instruction => instruction.opcode == OpCodes.Ldc_R4) + offset; - newInstructions.RemoveAt(index); - - newInstructions.InsertRange( - index, - new CodeInstruction[] - { - // Player.Get(base.Owner).Role - new(OpCodes.Ldarg_0), - new(OpCodes.Call, PropertyGetter(typeof(StandardSubroutine), nameof(StandardSubroutine.Owner))), - new(OpCodes.Call, Method(typeof(Player), nameof(Player.Get), new[] { typeof(ReferenceHub) })), - new(OpCodes.Callvirt, PropertyGetter(typeof(Player), nameof(Player.Role))), - - // (Player.Get(base.Owner).Role as Scp106Role).VigorStalkCostStationary - new(OpCodes.Isinst, typeof(Scp106Role)), - new(OpCodes.Callvirt, PropertyGetter(typeof(Scp106Role), nameof(Scp106Role.VigorStalkCostStationary))), - }); - for (int z = 0; z < newInstructions.Count; z++) - yield return newInstructions[z]; - - ListPool.Pool.Return(newInstructions); - } - } -} diff --git a/EXILED/Exiled.Events/Patches/Generic/Scp106API/VigorRegeneration.cs b/EXILED/Exiled.Events/Patches/Generic/Scp106API/VigorRegeneration.cs deleted file mode 100644 index f14fd51d1..000000000 --- a/EXILED/Exiled.Events/Patches/Generic/Scp106API/VigorRegeneration.cs +++ /dev/null @@ -1,66 +0,0 @@ -// ----------------------------------------------------------------------- -// -// Copyright (c) Exiled Team. All rights reserved. -// Licensed under the CC BY-SA 3.0 license. -// -// ----------------------------------------------------------------------- - -namespace Exiled.Events.Patches.Generic.Scp106API -{ - using System.Collections.Generic; - using System.Reflection.Emit; - - using API.Features.Pools; - using Exiled.API.Features; - using HarmonyLib; - using PlayerRoles.PlayableScps.Scp106; - using PlayerRoles.Subroutines; - - using static HarmonyLib.AccessTools; - - using BaseScp106Role = PlayerRoles.PlayableScps.Scp106.Scp106Role; - using Scp106Role = API.Features.Roles.Scp106Role; - - /// - /// Patches . - /// Adds the property. - /// - // [HarmonyPatch(typeof(Scp106StalkAbility), nameof(Scp106StalkAbility.UpdateMovementState))] - internal class VigorRegeneration - { - private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) - { - List newInstructions = ListPool.Pool.Get(instructions); - - LocalBuilder scp049Role = generator.DeclareLocal(typeof(Scp106Role)); - - // replace "base.Vigor.VigorAmount += 0.03f * Time.deltaTime;" - // with - // Scp106Role scp106Role = Player.Get(this.Owner).Role.As() - // "base.Vigor.VigorAmount += scp106Role.VigorRegeneration * Time.deltaTime;" - int offset = -4; - int index = newInstructions.FindIndex(instruction => instruction.operand == (object)PropertySetter(typeof(Scp106VigorAbilityBase), nameof(Scp106VigorAbilityBase.VigorAmount))) + offset; - newInstructions.RemoveAt(index); - - newInstructions.InsertRange( - index, - new CodeInstruction[] - { - // Player.Get(base.Owner).Role - new(OpCodes.Ldarg_0), - new(OpCodes.Call, PropertyGetter(typeof(StandardSubroutine), nameof(StandardSubroutine.Owner))), - new(OpCodes.Call, Method(typeof(Player), nameof(Player.Get), new[] { typeof(ReferenceHub) })), - new(OpCodes.Callvirt, PropertyGetter(typeof(Player), nameof(Player.Role))), - - // (Player.Get(base.Owner).Role as Scp106Role).VigorRegeneration - new(OpCodes.Isinst, typeof(Scp106Role)), - new(OpCodes.Callvirt, PropertyGetter(typeof(Scp106Role), nameof(Scp106Role.VigorRegeneration))), - }); - - for (int z = 0; z < newInstructions.Count; z++) - yield return newInstructions[z]; - - ListPool.Pool.Return(newInstructions); - } - } -} From 4654bf21815cb2a478d63c1e978f2f6e28a12119 Mon Sep 17 00:00:00 2001 From: x3rt Date: Wed, 31 Jul 2024 16:26:25 -0600 Subject: [PATCH 14/29] Clear Ammo before Clearing Items (#4) --- EXILED/Exiled.API/Features/Player.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EXILED/Exiled.API/Features/Player.cs b/EXILED/Exiled.API/Features/Player.cs index 4991e13d4..def165726 100644 --- a/EXILED/Exiled.API/Features/Player.cs +++ b/EXILED/Exiled.API/Features/Player.cs @@ -2728,8 +2728,8 @@ public void ResetInventory(IEnumerable newItems) /// public void ClearInventory(bool destroy = true) { - ClearItems(destroy); ClearAmmo(); + ClearItems(destroy); } /// From 596a425645cfd7e23360fd92da89616ce64aed01 Mon Sep 17 00:00:00 2001 From: Jesus QC <69375249+Jesus-QC@users.noreply.github.com> Date: Thu, 1 Aug 2024 01:21:28 +0200 Subject: [PATCH 15/29] fetching master (#138) Co-authored-by: Nameless <85962933+Misfiy@users.noreply.github.com> Co-authored-by: Misaka-ZeroTwo <45165615+Misaka-ZeroTwo@users.noreply.github.com> --- .github/labeler.yml | 13 ++++++------- .github/workflows/main.yml | 2 +- .github/workflows/release.yml | 4 ++-- EXILED/Exiled.Installer/Program.cs | 4 ++-- EXILED/Exiled.Loader/Updater.cs | 4 ++-- 5 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 34ff31f3f..5098459b0 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -13,29 +13,28 @@ Scripts: # Add the 'Scripts' label regarding-events: # Add the 'Events' label - changed-files: - - any-glob-to-any-file: Exiled.Events/** # Any Modifications to events + - any-glob-to-any-file: EXILED/Exiled.Events/** # Any Modifications to events regarding-api: # Add the 'API' label - changed-files: - - any-glob-to-any-file: Exiled.API/** # Any modifications to the API + - any-glob-to-any-file: EXILED/Exiled.API/** # Any modifications to the API regarding-transpiler: # Add the 'transpiler' label - changed-files: - - any-glob-to-any-file: Exiled.Events/Patches/**/* # Any modifications to transpiler files + - any-glob-to-any-file: EXILED/Exiled.Events/Patches/**/* # Any modifications to transpiler files CustomModules: # Add the 'CustomModules' label - changed-files: - - any-glob-to-any-file: Exiled.CustomModules/** # Any modifications to CustomModules + - any-glob-to-any-file: EXILED/Exiled.CustomModules/** # Any modifications to CustomModules Installer: # Add the 'Installer' label - changed-files: - - any-glob-to-any-file: Exiled.Installer/** # Any modifications to the Installer + - any-glob-to-any-file: EXILED/Exiled.Installer/** # Any modifications to the Installer Localization: # Add the 'Localization' label - changed-files: - - any-glob-to-any-file: Localization/** # Any modifications to Localization + - any-glob-to-any-file: EXILED/Localization/** # Any modifications to Localization GitHub_Actions: # Add the 'GitHub' label - changed-files: - any-glob-to-any-file: .github/** # Any modifications to github related files - diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7be77c41a..6f9bc0f85 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ defaults: working-directory: ./EXILED env: - EXILED_REFERENCES_URL: https://Exiled-Official.github.io/SL-References/Master.zip + EXILED_REFERENCES_URL: https://exmod-team.github.io/SL-References/Master.zip EXILED_REFERENCES_PATH: ${{ github.workspace }}/EXILED/References jobs: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bcbe907cc..efdac4cc8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,9 +11,9 @@ defaults: working-directory: ./EXILED env: - EXILED_REFERENCES_URL: https://Exiled-Official.github.io/SL-References/Dev.zip + EXILED_REFERENCES_URL: https://exmod-team.github.io/SL-References/Dev.zip EXILED_REFERENCES_PATH: ${{ github.workspace }}/EXILED/References - EXILED_DLL_ARCHIVER_URL: https://github.com/Exiled-Official/EXILED-DLL-Archiver/releases/latest/download/EXILED-DLL-Archiver.exe + EXILED_DLL_ARCHIVER_URL: https://github.com/ExMod-Team/EXILED-DLL-Archiver/releases/latest/download/EXILED-DLL-Archiver.exe jobs: build: diff --git a/EXILED/Exiled.Installer/Program.cs b/EXILED/Exiled.Installer/Program.cs index 34912cc51..559c17c82 100644 --- a/EXILED/Exiled.Installer/Program.cs +++ b/EXILED/Exiled.Installer/Program.cs @@ -42,7 +42,7 @@ internal enum PathResolution internal static class Program { - private const long RepoID = 828620622; + private const long RepoID = 833723500; private const string ExiledAssetName = "exiled.tar.gz"; // This is the lowest version the installer will check to install @@ -303,4 +303,4 @@ private static Release FindRelease(CommandSettings args, IEnumerable re return enumerable.First(); } } -} \ No newline at end of file +} diff --git a/EXILED/Exiled.Loader/Updater.cs b/EXILED/Exiled.Loader/Updater.cs index 6990c1812..fb0636570 100644 --- a/EXILED/Exiled.Loader/Updater.cs +++ b/EXILED/Exiled.Loader/Updater.cs @@ -31,7 +31,7 @@ namespace Exiled.Loader /// internal sealed class Updater { - private const long REPOID = 828620622; + private const long REPOID = 833723500; private const string INSTALLER_ASSET_NAME_LINUX = "Exiled.Installer-Linux"; private const string INSTALLER_ASSET_NAME_WIN = "Exiled.Installer-Win.exe"; @@ -332,4 +332,4 @@ private bool FindAsset(string assetName, Release release, out ReleaseAsset asset return false; } } -} \ No newline at end of file +} From 2b0276b62ba06808e4ccf900ef58152f889d55b6 Mon Sep 17 00:00:00 2001 From: Misaka-ZeroTwo <45165615+Misaka-ZeroTwo@users.noreply.github.com> Date: Thu, 1 Aug 2024 20:49:03 +0800 Subject: [PATCH 16/29] Update labeler.yml --- .github/labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 5098459b0..97048dd23 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -35,6 +35,6 @@ Localization: # Add the 'Localization' label - changed-files: - any-glob-to-any-file: EXILED/Localization/** # Any modifications to Localization -GitHub_Actions: # Add the 'GitHub' label +GitHub: # Add the 'GitHub' label - changed-files: - any-glob-to-any-file: .github/** # Any modifications to github related files From 04bffe85addfc161051d32bb41fc2828062d21d1 Mon Sep 17 00:00:00 2001 From: Misaka-ZeroTwo <45165615+Misaka-ZeroTwo@users.noreply.github.com> Date: Thu, 1 Aug 2024 20:49:20 +0800 Subject: [PATCH 17/29] Update labeler.yml --- .github/labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 5098459b0..97048dd23 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -35,6 +35,6 @@ Localization: # Add the 'Localization' label - changed-files: - any-glob-to-any-file: EXILED/Localization/** # Any modifications to Localization -GitHub_Actions: # Add the 'GitHub' label +GitHub: # Add the 'GitHub' label - changed-files: - any-glob-to-any-file: .github/** # Any modifications to github related files From 0698e6ee9f55adae1f2e37375226842b3986fef4 Mon Sep 17 00:00:00 2001 From: ZeroTwo <63092138+NotZer0Two@users.noreply.github.com> Date: Thu, 1 Aug 2024 19:41:18 +0200 Subject: [PATCH 18/29] `[Exiled::API]` Added WhitelistedPlayers, SetIntercomDisplayTextForTargetOnly and ResetIntercomDisplayText (#6) * Sync Changes * Suggestion Co-authored-by: Misaka-ZeroTwo <45165615+Misaka-ZeroTwo@users.noreply.github.com> --------- Co-authored-by: Misaka-ZeroTwo <45165615+Misaka-ZeroTwo@users.noreply.github.com> --- EXILED/Exiled.API/Extensions/MirrorExtensions.cs | 13 +++++++++++++ EXILED/Exiled.API/Features/Server.cs | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/EXILED/Exiled.API/Extensions/MirrorExtensions.cs b/EXILED/Exiled.API/Extensions/MirrorExtensions.cs index 8b30327d4..2dd66766c 100644 --- a/EXILED/Exiled.API/Extensions/MirrorExtensions.cs +++ b/EXILED/Exiled.API/Extensions/MirrorExtensions.cs @@ -25,6 +25,7 @@ namespace Exiled.API.Extensions using PlayerRoles; using PlayerRoles.FirstPersonControl; using PlayerRoles.PlayableScps.Scp049.Zombies; + using PlayerRoles.Voice; using RelativePositioning; using Respawning; @@ -181,6 +182,18 @@ public static void PlayGunSound(this Player player, Vector3 position, ItemType i player.Connection.Send(message); } + /// + /// Sets that only the player can see. + /// + /// Only this player can see Display Text. + /// Text displayed to the player. + public static void SetIntercomDisplayTextForTargetOnly(this Player target, string text) => target.SendFakeSyncVar(IntercomDisplay._singleton.netIdentity, typeof(IntercomDisplay), nameof(IntercomDisplay.Network_overrideText), text); + + /// + /// Resync . + /// + public static void ResetIntercomDisplayText() => ResyncSyncVar(IntercomDisplay._singleton.netIdentity, typeof(IntercomDisplay), nameof(IntercomDisplay.Network_overrideText)); + /// /// Sets of a that only the player can see. /// diff --git a/EXILED/Exiled.API/Features/Server.cs b/EXILED/Exiled.API/Features/Server.cs index 26cf64c98..908096434 100644 --- a/EXILED/Exiled.API/Features/Server.cs +++ b/EXILED/Exiled.API/Features/Server.cs @@ -178,6 +178,11 @@ public static bool IsWhitelisted set => ServerConsole.WhiteListEnabled = value; } + /// + /// Gets the list of user IDs of players currently whitelisted. + /// + public static HashSet WhitelistedPlayers => WhiteList.Users; + /// /// Gets a value indicating whether or not this server is verified. /// From 2e1686e120528c4d7dfaf7b6f1ec7d369ad33a26 Mon Sep 17 00:00:00 2001 From: Misaka-ZeroTwo <45165615+Misaka-ZeroTwo@users.noreply.github.com> Date: Fri, 2 Aug 2024 01:46:22 +0800 Subject: [PATCH 19/29] Fix ChargingJailbird (#2) * Update ChargingJailbirdEventArgs.cs * Update JailbirdPatch.cs * Update dev.yml * Update labeler.yml --- .../EventArgs/Item/ChargingJailbirdEventArgs.cs | 11 ++++++++++- .../Patches/Events/Item/JailbirdPatch.cs | 5 +---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/EXILED/Exiled.Events/EventArgs/Item/ChargingJailbirdEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Item/ChargingJailbirdEventArgs.cs index 1b17a1bb0..38f6ea7f8 100644 --- a/EXILED/Exiled.Events/EventArgs/Item/ChargingJailbirdEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Item/ChargingJailbirdEventArgs.cs @@ -7,6 +7,8 @@ namespace Exiled.Events.EventArgs.Item { + using System; + using Exiled.API.Features; using Exiled.API.Features.Items; using Exiled.Events.EventArgs.Interfaces; @@ -26,7 +28,9 @@ public ChargingJailbirdEventArgs(ReferenceHub player, InventorySystem.Items.Item { Player = Player.Get(player); Item = Item.Get(swingItem); +#pragma warning disable CS0618 IsAllowed = isAllowed; +#pragma warning restore CS0618 } /// @@ -42,6 +46,11 @@ public ChargingJailbirdEventArgs(ReferenceHub player, InventorySystem.Items.Item /// /// Gets or sets a value indicating whether or not the Jailbird can be charged. /// - public bool IsAllowed { get; set; } + public bool IsAllowed + { + get; + [Obsolete("This event cannot be denied as it will cause desync.")] + set; + } } } diff --git a/EXILED/Exiled.Events/Patches/Events/Item/JailbirdPatch.cs b/EXILED/Exiled.Events/Patches/Events/Item/JailbirdPatch.cs index ec33236e0..1f8489fd3 100644 --- a/EXILED/Exiled.Events/Patches/Events/Item/JailbirdPatch.cs +++ b/EXILED/Exiled.Events/Patches/Events/Item/JailbirdPatch.cs @@ -88,10 +88,7 @@ private static bool HandleJailbird(JailbirdItem instance, JailbirdMessageType me ChargingJailbirdEventArgs ev = new(instance.Owner, instance); Item.OnChargingJailbird(ev); - if (ev.IsAllowed) - return true; - instance.SendRpc(JailbirdMessageType.ChargeFailed, null); - return false; + return true; } default: From ef07853c3740c51f5379be7c4a96d377811af77f Mon Sep 17 00:00:00 2001 From: VALERA771 <72030575+VALERA771@users.noreply.github.com> Date: Thu, 1 Aug 2024 22:10:58 +0300 Subject: [PATCH 20/29] Adding auto assignment to pr (#7) * Create auto-assigning.yml * Update and rename labeler.yml to pull_request_opened.yml * Delete .github/workflows/auto-assigning.yml --- .github/workflows/{labeler.yml => pull_request_opened.yml} | 4 ++++ 1 file changed, 4 insertions(+) rename .github/workflows/{labeler.yml => pull_request_opened.yml} (79%) diff --git a/.github/workflows/labeler.yml b/.github/workflows/pull_request_opened.yml similarity index 79% rename from .github/workflows/labeler.yml rename to .github/workflows/pull_request_opened.yml index 0486bfaec..aa26845fb 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/pull_request_opened.yml @@ -20,3 +20,7 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} configuration-path: .github/labeler.yml sync-labels: true + assign-author: + runs-on: ubuntu-latest + steps: + - uses: toshimaru/auto-author-assign@v2.1.1 From e6661e8f27e23a47591cba79d08e477490d2284f Mon Sep 17 00:00:00 2001 From: Jesus QC <69375249+Jesus-QC@users.noreply.github.com> Date: Thu, 1 Aug 2024 21:31:13 +0200 Subject: [PATCH 21/29] Update dev.yml --- .github/workflows/dev.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 6a9486427..fc2b53f4f 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -14,7 +14,7 @@ defaults: working-directory: ./EXILED env: - EXILED_REFERENCES_URL: https://Exiled-Official.github.io/SL-References/Dev.zip + EXILED_REFERENCES_URL: https://exmod-team.github.io/SL-References/Master.zip EXILED_REFERENCES_PATH: ${{ github.workspace }}/EXILED/References EXILED_DLL_ARCHIVER_URL: https://github.com/Exiled-Official/EXILED-DLL-Archiver/releases/latest/download/EXILED-DLL-Archiver.exe From fe05d8dd6026365e9b1215913ffd8200d0c6823c Mon Sep 17 00:00:00 2001 From: Jesus QC <69375249+Jesus-QC@users.noreply.github.com> Date: Thu, 1 Aug 2024 21:31:50 +0200 Subject: [PATCH 22/29] fixed docs pipeline --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 351cdd3be..df73ad9a5 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -12,7 +12,7 @@ permissions: id-token: write env: - EXILED_REFERENCES_URL: https://Exiled-Official.github.io/SL-References/Dev.zip + EXILED_REFERENCES_URL: https://exmod-team.github.io/SL-References/Master.zip EXILED_REFERENCES_PATH: ${{ github.workspace }}/EXILED/References # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. From 5783c17177f406792b3b4f83a5a0f46ed4b1089a Mon Sep 17 00:00:00 2001 From: Misaka-ZeroTwo <45165615+Misaka-ZeroTwo@users.noreply.github.com> Date: Fri, 2 Aug 2024 05:24:38 +0800 Subject: [PATCH 23/29] Pull request template (#10) * Create pull_request_template.md * Update pull_request_template.md * Update pull_request_template.md * Update pull_request_template.md * Update pull_request_template.md --- .github/pull_request_template.md | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..032dc22c6 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,35 @@ +## Description +**Describe the changes** + + +**What is the current behavior?** (You can also link to an open issue here) + + +**What is the new behavior?** (if this is a feature change) + + +**Does this PR introduce a breaking change?** (What changes might users need to make in their application due to this PR?) + + +**Other information**: + +
+ +## Types of changes + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to change) +- [ ] Documentations +
+ +## Submission checklist + +- [ ] I have checked the project can be compiled +- [ ] I have tested my changes and it worked as expected + +### Patches (if there are any changes related to Harmony patches) +- [ ] I have checked no IL patching errors in the console + +### Other +- [ ] Still requires more testing From c9654eee7c41eacf1b4301c45f58ea7c39b14765 Mon Sep 17 00:00:00 2001 From: VALERA771 <72030575+VALERA771@users.noreply.github.com> Date: Fri, 2 Aug 2024 00:26:08 +0300 Subject: [PATCH 24/29] uwu (#5) --- EXILED/Exiled.API/Features/Player.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/EXILED/Exiled.API/Features/Player.cs b/EXILED/Exiled.API/Features/Player.cs index def165726..ed937ead5 100644 --- a/EXILED/Exiled.API/Features/Player.cs +++ b/EXILED/Exiled.API/Features/Player.cs @@ -2319,6 +2319,16 @@ public void Broadcast(ushort duration, string message, global::Broadcast.Broadca public void AddAmmo(AmmoType ammoType, ushort amount) => Inventory.ServerAddAmmo(ammoType.GetItemType(), amount); + /// + /// Adds the amount of a specified ammo type to player's inventory. + /// + /// A dictionary of ammo types that will be added. + public void AddAmmo(Dictionary ammoBag) + { + foreach (KeyValuePair kvp in ammoBag) + AddAmmo(kvp.Key, kvp.Value); + } + /// /// Adds the amount of a weapon's ammo type to the player's inventory. /// @@ -2338,6 +2348,16 @@ public void SetAmmo(AmmoType ammoType, ushort amount) Inventory.ServerSetAmmo(itemType, amount); } + /// + /// Sets the amount of a specified ammo type to player's inventory. + /// + /// A dictionary of ammo types that will be added. + public void SetAmmo(Dictionary ammoBag) + { + foreach (KeyValuePair kvp in ammoBag) + SetAmmo(kvp.Key, kvp.Value); + } + /// /// Gets the ammo count of a specified ammo type in a player's inventory. /// From 0b577df72c4956d5dff1c9e9087cfa6b52674d39 Mon Sep 17 00:00:00 2001 From: Alex Rouse <123724383+ALEXWARELLC@users.noreply.github.com> Date: Fri, 2 Aug 2024 18:29:22 +0800 Subject: [PATCH 25/29] Possible fix for broken GitHub Action. (#25) --- .github/workflows/pull_request_opened.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/pull_request_opened.yml b/.github/workflows/pull_request_opened.yml index aa26845fb..a54bed971 100644 --- a/.github/workflows/pull_request_opened.yml +++ b/.github/workflows/pull_request_opened.yml @@ -22,5 +22,8 @@ jobs: sync-labels: true assign-author: runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: - uses: toshimaru/auto-author-assign@v2.1.1 From 565373318d5aba8d2af3a438a03f2988a8a87e38 Mon Sep 17 00:00:00 2001 From: Yamato <66829532+louis1706@users.noreply.github.com> Date: Fri, 2 Aug 2024 21:12:57 +0200 Subject: [PATCH 26/29] AdminToy.List (#18) * AdminToy.List * Better AdminToy::Get() * Update EXILED/Exiled.API/Features/Toys/AdminToy.cs Co-authored-by: IRacle <79921583+IRacle1@users.noreply.github.com> * TODO * Fix Error * Fix2 --------- Co-authored-by: IRacle <79921583+IRacle1@users.noreply.github.com> --- EXILED/Exiled.API/Features/Map.cs | 7 +--- EXILED/Exiled.API/Features/Toys/AdminToy.cs | 33 +++++++++++++++++-- .../Handlers/Internal/SceneUnloaded.cs | 4 +-- 3 files changed, 33 insertions(+), 11 deletions(-) diff --git a/EXILED/Exiled.API/Features/Map.cs b/EXILED/Exiled.API/Features/Map.cs index 14f6d8214..24edcc90c 100644 --- a/EXILED/Exiled.API/Features/Map.cs +++ b/EXILED/Exiled.API/Features/Map.cs @@ -57,11 +57,6 @@ public static class Map ///
internal static readonly List TeleportsValue = new(8); - /// - /// A list of s on the map. - /// - internal static readonly List ToysValue = new(); - private static TantrumEnvironmentalHazard tantrumPrefab; private static Scp939AmnesticCloudInstance amnesticCloudPrefab; @@ -130,7 +125,7 @@ DecontaminationController.Singleton.NetworkDecontaminationOverride is Decontamin /// /// Gets all objects. /// - public static ReadOnlyCollection Toys { get; } = ToysValue.AsReadOnly(); + public static ReadOnlyCollection Toys => AdminToy.BaseToAdminToy.Values.ToList().AsReadOnly(); // TODO: Obsolete it and make people use AdminToy.List /// /// Gets or sets the current seed of the map. diff --git a/EXILED/Exiled.API/Features/Toys/AdminToy.cs b/EXILED/Exiled.API/Features/Toys/AdminToy.cs index fdbe03da1..2139059e9 100644 --- a/EXILED/Exiled.API/Features/Toys/AdminToy.cs +++ b/EXILED/Exiled.API/Features/Toys/AdminToy.cs @@ -7,6 +7,7 @@ namespace Exiled.API.Features.Toys { + using System.Collections.Generic; using System.Linq; using AdminToys; @@ -14,6 +15,7 @@ namespace Exiled.API.Features.Toys using Enums; using Exiled.API.Interfaces; using Footprinting; + using InventorySystem.Items; using Mirror; using UnityEngine; @@ -23,6 +25,11 @@ namespace Exiled.API.Features.Toys /// public abstract class AdminToy : IWorldSpace { + /// + /// A dictionary of all 's that have been converted into . + /// + internal static readonly Dictionary BaseToAdminToy = new(new ComponentsEqualityComparer()); + /// /// Initializes a new instance of the class. /// @@ -33,9 +40,14 @@ internal AdminToy(AdminToyBase toyAdminToyBase, AdminToyType type) AdminToyBase = toyAdminToyBase; ToyType = type; - Map.ToysValue.Add(this); + BaseToAdminToy.Add(toyAdminToyBase, this); } + /// + /// Gets a list of all 's on the server. + /// + public static IReadOnlyCollection List => BaseToAdminToy.Values; + /// /// Gets the original . /// @@ -130,7 +142,22 @@ public bool IsStatic /// /// The instance. /// The corresponding instance. - public static AdminToy Get(AdminToyBase adminToyBase) => Map.Toys.FirstOrDefault(x => x.AdminToyBase == adminToyBase); + public static AdminToy Get(AdminToyBase adminToyBase) + { + if (adminToyBase == null) + return null; + + if (BaseToAdminToy.TryGetValue(adminToyBase, out AdminToy adminToy)) + return adminToy; + + return adminToyBase switch + { + LightSourceToy lightSourceToy => new Light(lightSourceToy), + PrimitiveObjectToy primitiveObjectToy => new Primitive(primitiveObjectToy), + ShootingTarget shootingTarget => new ShootingTargetToy(shootingTarget), + _ => throw new System.NotImplementedException() + }; + } /// /// Spawns the toy into the game. Use to remove it. @@ -147,7 +174,7 @@ public bool IsStatic /// public void Destroy() { - Map.ToysValue.Remove(this); + BaseToAdminToy.Remove(AdminToyBase); NetworkServer.Destroy(AdminToyBase.gameObject); } } diff --git a/EXILED/Exiled.Events/Handlers/Internal/SceneUnloaded.cs b/EXILED/Exiled.Events/Handlers/Internal/SceneUnloaded.cs index 9bcb75cc8..4ecdc5f93 100644 --- a/EXILED/Exiled.Events/Handlers/Internal/SceneUnloaded.cs +++ b/EXILED/Exiled.Events/Handlers/Internal/SceneUnloaded.cs @@ -8,7 +8,7 @@ namespace Exiled.Events.Handlers.Internal { using API.Features; - + using Exiled.API.Features.Toys; using UnityEngine.SceneManagement; #pragma warning disable SA1611 // Element parameters should be documented @@ -35,7 +35,7 @@ public static void OnSceneUnloaded(Scene _) { Player.UserIdsCache.Clear(); Player.Dictionary.Clear(); - Map.ToysValue.Clear(); + AdminToy.BaseToAdminToy.Clear(); } } } \ No newline at end of file From 5a519a43b5be251f741dd5a8272267a08cb8892d Mon Sep 17 00:00:00 2001 From: Yamato <66829532+louis1706@users.noreply.github.com> Date: Fri, 2 Aug 2024 21:18:36 +0200 Subject: [PATCH 27/29] Fix `Jailbird::WearState` (#12) * Jailbird * Fix * Exception * Fix NW moment --- EXILED/Exiled.API/Features/Items/Jailbird.cs | 30 ++++++++- .../Item/ChargingJailbirdEventArgs.cs | 11 +++- .../EventArgs/Item/SwingingEventArgs.cs | 9 ++- .../Patches/Fixes/Jailbird914CoarseFix.cs | 61 +++++++++++++++++++ 4 files changed, 104 insertions(+), 7 deletions(-) create mode 100644 EXILED/Exiled.Events/Patches/Fixes/Jailbird914CoarseFix.cs diff --git a/EXILED/Exiled.API/Features/Items/Jailbird.cs b/EXILED/Exiled.API/Features/Items/Jailbird.cs index 9e508da11..2f8bfb524 100644 --- a/EXILED/Exiled.API/Features/Items/Jailbird.cs +++ b/EXILED/Exiled.API/Features/Items/Jailbird.cs @@ -7,11 +7,14 @@ namespace Exiled.API.Features.Items { + using System; + using Exiled.API.Features.Pickups; using Exiled.API.Interfaces; using InventorySystem.Items.Autosync; using InventorySystem.Items.Jailbird; using Mirror; + using UnityEngine; using JailbirdPickup = Pickups.JailbirdPickup; @@ -114,12 +117,35 @@ public JailbirdWearState WearState get => Base._deterioration.WearState; set { - if (JailbirdDeteriorationTracker.ReceivedStates.ContainsKey(Serial)) - JailbirdDeteriorationTracker.ReceivedStates[Serial] = value; + TotalDamageDealt = GetDamage(value); + TotalCharges = GetCharge(value); Base._deterioration.RecheckUsage(); } } + /// + /// Calculates the damage corresponding to a given . + /// + /// The wear state to calculate damage for. + /// The amount of damage associated with the specified wear state. + public float GetDamage(JailbirdWearState wearState) + { + foreach (Keyframe keyframe in Base._deterioration._damageToWearState.keys) + { + if (Base._deterioration.FloatToState(keyframe.value) == wearState) + return keyframe.time; + } + + throw new Exception("Wear state not found in damage to wear state mapping."); + } + + /// + /// Gets the charge needed to reach a specific . + /// + /// The desired wear state to calculate the charge for. + /// The charge value required to achieve the specified wear state. + public int GetCharge(JailbirdWearState wearState) => (int)wearState; + /// /// Breaks the Jailbird. /// diff --git a/EXILED/Exiled.Events/EventArgs/Item/ChargingJailbirdEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Item/ChargingJailbirdEventArgs.cs index 38f6ea7f8..6ac613800 100644 --- a/EXILED/Exiled.Events/EventArgs/Item/ChargingJailbirdEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Item/ChargingJailbirdEventArgs.cs @@ -27,7 +27,7 @@ public class ChargingJailbirdEventArgs : IPlayerEvent, IItemEvent, IDeniableEven public ChargingJailbirdEventArgs(ReferenceHub player, InventorySystem.Items.ItemBase swingItem, bool isAllowed = true) { Player = Player.Get(player); - Item = Item.Get(swingItem); + Jailbird = (Jailbird)Item.Get(swingItem); #pragma warning disable CS0618 IsAllowed = isAllowed; #pragma warning restore CS0618 @@ -39,9 +39,14 @@ public ChargingJailbirdEventArgs(ReferenceHub player, InventorySystem.Items.Item public Player Player { get; } /// - /// Gets the that is being charged. This will always be a . + /// Gets the that is being charged. /// - public Item Item { get; } + public Jailbird Jailbird { get; } + + /// + /// Gets the that is being charged. + /// + public Item Item => Jailbird; /// /// Gets or sets a value indicating whether or not the Jailbird can be charged. diff --git a/EXILED/Exiled.Events/EventArgs/Item/SwingingEventArgs.cs b/EXILED/Exiled.Events/EventArgs/Item/SwingingEventArgs.cs index 17c0319b0..6c8f0fce8 100644 --- a/EXILED/Exiled.Events/EventArgs/Item/SwingingEventArgs.cs +++ b/EXILED/Exiled.Events/EventArgs/Item/SwingingEventArgs.cs @@ -25,7 +25,7 @@ public class SwingingEventArgs : IPlayerEvent, IItemEvent, IDeniableEvent public SwingingEventArgs(ReferenceHub player, InventorySystem.Items.ItemBase swingItem, bool isAllowed = true) { Player = Player.Get(player); - Item = Item.Get(swingItem); + Jailbird = (Jailbird)Item.Get(swingItem); IsAllowed = isAllowed; } @@ -34,10 +34,15 @@ public SwingingEventArgs(ReferenceHub player, InventorySystem.Items.ItemBase swi /// public Player Player { get; } + /// + /// Gets the that is being swung. + /// + public Jailbird Jailbird { get; } + /// /// Gets the that is being swung. /// - public Item Item { get; } + public Item Item => Jailbird; /// /// Gets or sets a value indicating whether or not the item can be swung. diff --git a/EXILED/Exiled.Events/Patches/Fixes/Jailbird914CoarseFix.cs b/EXILED/Exiled.Events/Patches/Fixes/Jailbird914CoarseFix.cs new file mode 100644 index 000000000..680e40608 --- /dev/null +++ b/EXILED/Exiled.Events/Patches/Fixes/Jailbird914CoarseFix.cs @@ -0,0 +1,61 @@ +// ----------------------------------------------------------------------- +// +// Copyright (c) Exiled Team. All rights reserved. +// Licensed under the CC BY-SA 3.0 license. +// +// ----------------------------------------------------------------------- + +namespace Exiled.Events.Patches.Events.Player +{ +#pragma warning disable IDE0060 + + using System.Collections.Generic; + using System.Reflection.Emit; + + using API.Features; + using API.Features.Pools; + + using HarmonyLib; + using InventorySystem.Items.Jailbird; + using Mirror; + + using static HarmonyLib.AccessTools; + + /// + /// Patches . + /// Bug reported to NW (https://trello.com/c/kyr3hV9B). + /// + [HarmonyPatch(typeof(JailbirdDeteriorationTracker), nameof(JailbirdDeteriorationTracker.Setup))] + internal static class Jailbird914CoarseFix + { + private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator generator) + { + List newInstructions = ListPool.Pool.Get(instructions); + + int offset = -1; + int index = newInstructions.FindIndex(i => i.opcode == OpCodes.Blt_S) + offset; + + List