From 21dae1226880e687150a61e43d6a202c38bfa991 Mon Sep 17 00:00:00 2001 From: Yamato Date: Wed, 31 Jul 2024 19:37:54 +0200 Subject: [PATCH 1/2] This will not be used --- .../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 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 2/2] 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 +}