using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using ArtifactOfPotential; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using EntityStates; using EntityStates.Bandit2; using EntityStates.Bandit2.Weapon; using EntityStates.Captain.Weapon; using EntityStates.Chef; using EntityStates.Engi.EngiWeapon; using EntityStates.FalseSon; using EntityStates.InfiniteTowerSafeWard; using EntityStates.LunarTeleporter; using EntityStates.Mage.Weapon; using EntityStates.Merc.Weapon; using EntityStates.Missions.Arena.NullWard; using EntityStates.Missions.BrotherEncounter; using EntityStates.MoonElevator; using EntityStates.SolusMine; using EntityStates.Toolbot; using EntityStates.Treebot.Weapon; using EntityStates.VoidSurvivor; using IL; using IL.EntityStates.Bandit2.Weapon; using IL.EntityStates.Captain.Weapon; using IL.EntityStates.Engi.EngiWeapon; using IL.EntityStates.FalseSonBoss; using IL.EntityStates.GolemMonster; using IL.EntityStates.LunarWisp; using IL.EntityStates.Mage; using IL.EntityStates.Mage.Weapon; using IL.EntityStates.Seeker; using IL.EntityStates.Treebot.Weapon; using IL.EntityStates.VoidSurvivor.Weapon; using IL.RoR2; using IL.RoR2.Artifacts; using IL.RoR2.CharacterAI; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using MonoMod.RuntimeDetour; using On.EntityStates.Bandit2; using On.EntityStates.Bandit2.Weapon; using On.EntityStates.Captain.Weapon; using On.EntityStates.Chef; using On.EntityStates.FalseSon; using On.EntityStates.InfiniteTowerSafeWard; using On.EntityStates.LunarTeleporter; using On.EntityStates.Merc.Weapon; using On.EntityStates.Missions.Arena.NullWard; using On.EntityStates.Missions.BrotherEncounter; using On.EntityStates.SolusMine; using On.EntityStates.Toolbot; using On.EntityStates.VoidSurvivor; using On.RoR2; using On.RoR2.Projectile; using On.RoR2.Skills; using On.RoR2.UI; using R2API.Utils; using RiskOfOptions; using RiskOfOptions.Options; using RiskyTweaks.FireSelect; using RiskyTweaks.Tweaks; using RiskyTweaks.Tweaks.Survivors.Bandit2; using RiskyTweaks.Tweaks.Survivors.Mage; using RiskyTweaks.Tweaks.Survivors.Merc; using RoR2; using RoR2.CharacterAI; using RoR2.Items; using RoR2.Orbs; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using ShareSuite; using TMPro; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("RiskyTweaks")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+9e48e0ae39de7294be0fca50bd5049bf825792fa")] [assembly: AssemblyProduct("RiskyTweaks")] [assembly: AssemblyTitle("RiskyTweaks")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace RiskyTweaks { internal static class CommonHooks { internal static void DisableRemoveBuffGeneric(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, typeof(CharacterBody), "RemoveBuff") })) { val.EmitDelegate>((Func)((BuffIndex orig) => (BuffIndex)(-1))); } else { Debug.LogError((object)"RiskyTweaks: DisableRemoveBuffGeneric IL Hook failed"); } } internal static void DisableAddBuffGeneric(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, typeof(CharacterBody), "AddBuff") })) { val.EmitDelegate>((Func)((BuffIndex orig) => (BuffIndex)(-1))); } else { Debug.LogError((object)"RiskyTweaks: DisableAddBuffGeneric IL Hook failed"); } } } internal class LoadLanguage { internal static string assemblyDir => Path.GetDirectoryName(RiskyTweaks.pluginInfo.Location); internal static string languageRoot => Path.Combine(assemblyDir, "language"); internal static void fixme(orig_SetFolders orig, Language self, IEnumerable newFolders) { if (Directory.Exists(languageRoot)) { IEnumerable second = Directory.EnumerateDirectories(Path.Combine(languageRoot), self.name); orig.Invoke(self, newFolders.Union(second)); } else { orig.Invoke(self, newFolders); } } } internal static class ModCompat { public static class TeleExpansionCompat { public static bool pluginLoaded; } public static class RiskOfOptionsCompat { public static bool pluginLoaded; internal static void AddOptions() { if (pluginLoaded) { AddOptionsInternal(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static void AddOptionsInternal() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Expected O, but got Unknown //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Expected O, but got Unknown //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Expected O, but got Unknown //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Expected O, but got Unknown //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Expected O, but got Unknown //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(TweakBase.Instance.Enabled)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(FireSelectManager.scrollSelection)); ModSettingsManager.AddOption((BaseOption)new KeyBindOption(FireSelectManager.nextButton)); ModSettingsManager.AddOption((BaseOption)new KeyBindOption(FireSelectManager.prevButton)); if (TweakBase.Instance.Enabled.Value) { ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(PrimaryAutoFire.FireMode.Enabled)); ModSettingsManager.AddOption((BaseOption)new KeyBindOption(PrimaryAutoFire.FireMode.defaultButton)); ModSettingsManager.AddOption((BaseOption)new KeyBindOption(PrimaryAutoFire.FireMode.spamButton)); } ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(EngiAutoFire.Enabled)); ModSettingsManager.AddOption((BaseOption)new KeyBindOption(EngiAutoFire.autoButton)); ModSettingsManager.AddOption((BaseOption)new KeyBindOption(EngiAutoFire.holdButton)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(CaptainAutoFire.Enabled)); ModSettingsManager.AddOption((BaseOption)new KeyBindOption(CaptainAutoFire.defaultButton)); ModSettingsManager.AddOption((BaseOption)new KeyBindOption(CaptainAutoFire.autoButton)); ModSettingsManager.AddOption((BaseOption)new KeyBindOption(CaptainAutoFire.chargedButton)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(TweakBase.Instance.Enabled)); } } public static class ShareSuiteCompat { public static class ItemSettings { public static bool common; public static bool uncommon; public static bool legendary; public static bool boss; public static bool lunar; public static bool voidItem; } public static bool pluginLoaded; internal static void ReadSettings() { if (pluginLoaded) { ReadSettingsInternal(); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static void ReadSettingsInternal() { ItemSettings.common = ShareSuite.WhiteItemsShared.Value; ItemSettings.uncommon = ShareSuite.GreenItemsShared.Value; ItemSettings.legendary = ShareSuite.RedItemsShared.Value; ItemSettings.boss = ShareSuite.BossItemsShared.Value; ItemSettings.lunar = ShareSuite.LunarItemsShared.Value; ItemSettings.voidItem = ShareSuite.VoidItemsShared.Value; } } public static class ArtifactOfPotentialCompat { public static bool pluginLoaded; public static bool IsArtifactActive() { bool result = false; if (pluginLoaded) { result = IsArtifactActiveInternal(); } return result; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static bool IsArtifactActiveInternal() { return Object.op_Implicit((Object)(object)RunArtifactManager.instance) && RunArtifactManager.instance.IsArtifactEnabled(PotentialArtifact.Potential); } } public static class RiskyArtifactsCompat { internal static class ArtifactDefs { public static ArtifactDef Primacy; } public static bool pluginLoaded; internal static void InitArtifactDefs() { ArtifactDefs.Primacy = ArtifactCatalog.FindArtifactDef("RiskyArtifactOfPrimacy"); } public static bool IsPrimacyActive() { return (Object)(object)ArtifactDefs.Primacy != (Object)null && Object.op_Implicit((Object)(object)RunArtifactManager.instance) && RunArtifactManager.instance.IsArtifactEnabled(ArtifactDefs.Primacy); } } internal static void Init() { RiskOfOptionsCompat.pluginLoaded = Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"); ShareSuiteCompat.pluginLoaded = Chainloader.PluginInfos.ContainsKey("com.funkfrog_sipondo.sharesuite"); ShareSuiteCompat.ReadSettings(); ArtifactOfPotentialCompat.pluginLoaded = Chainloader.PluginInfos.ContainsKey("zombieseatflesh7.ArtifactOfPotential"); TeleExpansionCompat.pluginLoaded = Chainloader.PluginInfos.ContainsKey("com.Moffein.TeleExpansion"); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(RiskOfOptionsCompat.AddOptions)); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(RiskyArtifactsCompat.InitArtifactDefs)); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.Moffein.RiskyTweaks", "RiskyTweaks", "1.10.1")] public class RiskyTweaks : BaseUnityPlugin { public static PluginInfo pluginInfo; private void Awake() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown pluginInfo = ((BaseUnityPlugin)this).Info; Language.SetFolders += new hook_SetFolders(LoadLanguage.fixme); ModCompat.Init(); ((Component)this).gameObject.AddComponent(); FireSelectManager.Init(((BaseUnityPlugin)this).Config); AddToAssembly(); } private void AddToAssembly() { IEnumerable enumerable = from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(TweakBase)) select type; foreach (Type item in enumerable) { TweakBase tweakBase = (TweakBase)Activator.CreateInstance(item); tweakBase.Init(((BaseUnityPlugin)this).Config); } } } public static class SneedUtils { private static SceneDef bazaarSceneDef = Addressables.LoadAssetAsync((object)"RoR2/Base/bazaar/bazaar.asset").WaitForCompletion(); public static bool IsInBazaar() { SceneDef sceneDefForCurrentScene = SceneCatalog.GetSceneDefForCurrentScene(); return Object.op_Implicit((Object)(object)sceneDefForCurrentScene) && (Object)(object)sceneDefForCurrentScene == (Object)(object)bazaarSceneDef; } public static bool SetAddressableEntityStateField(string fullEntityStatePath, string fieldName, string value) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) EntityStateConfiguration val = Addressables.LoadAssetAsync((object)fullEntityStatePath).WaitForCompletion(); for (int i = 0; i < val.serializedFieldsCollection.serializedFields.Length; i++) { if (val.serializedFieldsCollection.serializedFields[i].fieldName == fieldName) { val.serializedFieldsCollection.serializedFields[i].fieldValue.stringValue = value; return true; } } return false; } public static bool GetKeyPressed(ConfigEntry entry) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) KeyboardShortcut value = entry.Value; foreach (KeyCode modifier in ((KeyboardShortcut)(ref value)).Modifiers) { if (!Input.GetKey(modifier)) { return false; } } value = entry.Value; return Input.GetKeyDown(((KeyboardShortcut)(ref value)).MainKey); } } } namespace RiskyTweaks.Tweaks { public abstract class TweakBase : TweakBase where T : TweakBase { public static T Instance { get; private set; } public TweakBase() { if (Instance != null) { throw new InvalidOperationException("Singleton class \"" + typeof(T).Name + "\" inheriting TweakBase was instantiated twice"); } Instance = this as T; } } public abstract class TweakBase { public abstract string ConfigCategoryString { get; } public abstract string ConfigOptionName { get; } public abstract string ConfigDescriptionString { get; } public ConfigEntry Enabled { get; private set; } public virtual bool StopLoadOnConfigDisable => true; protected virtual void ReadConfig(ConfigFile config) { Enabled = config.Bind(ConfigCategoryString, ConfigOptionName, true, ConfigDescriptionString); } internal void Init(ConfigFile config) { ReadConfig(config); if (!StopLoadOnConfigDisable || Enabled.Value) { ApplyChanges(); } } protected virtual void ApplyChanges() { } } } namespace RiskyTweaks.Tweaks.Survivors.VoidSurvivor { public class CrushCorruptBuff : TweakBase { public override string ConfigCategoryString => "Survivors - Void Fiend"; public override string ConfigOptionName => "(Client-Side) Corrupted Crush - Buff Skill"; public override string ConfigDescriptionString => "Corrupted Crush triggers faster and can be retriggered as many times as you want."; protected override void ApplyChanges() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) SkillDef val = Addressables.LoadAssetAsync((object)"RoR2/DLC1/VoidSurvivor/CrushHealth.asset").WaitForCompletion(); val.baseMaxStock = 1; val.baseRechargeInterval = 0f; val.rechargeStock = 1; SneedUtils.SetAddressableEntityStateField("RoR2/DLC1/VoidSurvivor/EntityStates.VoidSurvivor.Weapon.ChargeCrushHealth.asset", "baseDuration", "0.3"); } } public class FasterCorruptTransition : TweakBase { public override string ConfigCategoryString => "Survivors - Void Fiend"; public override string ConfigOptionName => "(Client-Side) Corruption - Faster Animation"; public override string ConfigDescriptionString => "Corruption transition animation is faster."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown CorruptionTransitionBase.OnEnter += new hook_OnEnter(CorruptionTransitionBase_OnEnter); } private void CorruptionTransitionBase_OnEnter(orig_OnEnter orig, CorruptionTransitionBase self) { if (self.duration > 0f) { self.duration = 0.5f; } orig.Invoke(self); } } public class PrimarySpread : TweakBase { public override string ConfigCategoryString => "Survivors - Void Fiend"; public override string ConfigOptionName => "(Client-Side) Drown - Remove Spread"; public override string ConfigDescriptionString => "Removes random spread."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown FireHandBeam.OnEnter += new Manipulator(RemoveBulletSpread); FireCorruptHandBeam.FireBullet += new Manipulator(RemoveBulletSpread); } private void RemoveBulletSpread(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "Fire") })) { val.EmitDelegate>((Func)delegate(BulletAttack bulletAttack) { bulletAttack.minSpread = 0f; bulletAttack.maxSpread = 0f; return bulletAttack; }); } else { Debug.LogError((object)"RiskyTweaks: VoidSurvivor PrimarySpread IL hook failed."); } } } public class UtilityMoveSpeedScaling : TweakBase { public override string ConfigCategoryString => "Survivors - Void Fiend"; public override string ConfigOptionName => "(Client-Side) Uncorrupted Trespass - Disable Move Speed Scaling"; public override string ConfigDescriptionString => "Disables move speed scaling on Uncorrupted Trespass."; public override bool StopLoadOnConfigDisable => false; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown VoidBlinkBase.GetVelocity += new hook_GetVelocity(VoidBlinkBase_GetVelocity); } private Vector3 VoidBlinkBase_GetVelocity(orig_GetVelocity orig, VoidBlinkBase self) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) if (base.Enabled.Value && Object.op_Implicit((Object)(object)((EntityState)self).characterBody) && !((EntityState)self).characterBody.HasBuff(Buffs.VoidSurvivorCorruptMode)) { ((BaseState)self).moveSpeedStat = 10.15f; } return orig.Invoke(self); } } } namespace RiskyTweaks.Tweaks.Survivors.Treebot { public class SelfDamageTweaks : TweakBase { public override string ConfigCategoryString => "Survivors - REX"; public override string ConfigOptionName => "(Server-Side) Seed Barrage Self-Damage Consistency"; public override string ConfigDescriptionString => "Seed Barrage self-damage is affected by armor, like the other 2 plant skills."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown FireMortar2.OnEnter += new Manipulator(FireMortar2_OnEnter); } private void FireMortar2_OnEnter(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "TakeDamage") })) { val.EmitDelegate>((Func)delegate(DamageInfo damageInfo) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) damageInfo.damageType &= DamageTypeCombo.op_Implicit((DamageType)(-3)); return damageInfo; }); } else { Debug.LogError((object)"RiskyTweaks: TreeBot SelfDamageTweaks IL Hook failed"); } } } public class UtilityKnockback : TweakBase { public override string ConfigCategoryString => "Survivors - REX"; public override string ConfigOptionName => "(Server-Side) Utility Knockback Rework"; public override string ConfigDescriptionString => "Reworks Utility knockback to be stronger and more consistent."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown FireSonicBoom.OnEnter += new Manipulator(FireSonicBoom_OnEnter); } private void FireSonicBoom_OnEnter(ILContext il) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) bool flag = true; ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "RefreshCandidates") })) { val.EmitDelegate>((Func)delegate(BullseyeSearch bullseye) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) bullseye.searchOrigin -= bullseye.searchDirection; bullseye.maxDistanceFilter += 1f; return bullseye; }); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "TakeDamageForce") })) { val.Index -= 6; val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldloc, 4); val.EmitDelegate>((Func)delegate(Vector3 origForce, FireSonicBoom self, HurtBox hurtBox) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = ((BaseState)self).GetAimRay(); Vector3 val2 = 2800f * ((Ray)(ref aimRay)).direction; CharacterBody body2 = hurtBox.healthComponent.body; if (Object.op_Implicit((Object)(object)body2.characterMotor) && body2.characterMotor.isGrounded) { val2.y = Mathf.Max(val2.y, 1200f); } if (body2.isChampion && Object.op_Implicit((Object)(object)body2.characterMotor) && body2.characterMotor.isGrounded) { val2.y /= 0.7f; } return val2; }); val.Index += 3; val.Emit(OpCodes.Ldloc, 4); val.EmitDelegate>((Func)delegate(float origForceMult, HurtBox hurtBox) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (hurtBox.healthComponent.body.bodyIndex == BodyPrefabs.SolusHeartBody.bodyIndex) { return origForceMult; } float num = 1f; CharacterBody body = hurtBox.healthComponent.body; if (Object.op_Implicit((Object)(object)body.characterMotor)) { num = body.characterMotor.mass; } else if (Object.op_Implicit((Object)(object)body.rigidbody)) { num = body.rigidbody.mass; } float num2 = Mathf.Max(num / 100f, 1f); if (body.isChampion && Object.op_Implicit((Object)(object)body.characterMotor) && body.characterMotor.isGrounded) { num2 *= 0.7f; } return num2; }); flag = false; } } if (flag) { Debug.LogError((object)"RiskyTweaks: Treebot UtilityKnockback IL Hook failed"); } } } } namespace RiskyTweaks.Tweaks.Survivors.Toolbot { public class RetoolReload : TweakBase { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_OnEnter <>9__8_0; internal void b__8_0(orig_OnEnter orig, ToolbotStanceSwap self) { orig.Invoke(self); if (((EntityState)self).isAuthority) { GenericSkill primarySkill = ((ToolbotStanceBase)self).GetPrimarySkill1(); if (Object.op_Implicit((Object)(object)primarySkill)) { primarySkill.stock = primarySkill.maxStock; } GenericSkill primarySkill2 = ((ToolbotStanceBase)self).GetPrimarySkill2(); if (Object.op_Implicit((Object)(object)primarySkill2)) { primarySkill2.stock = primarySkill2.maxStock; } } } } public override string ConfigCategoryString => "Survivors - MUL-T"; public override string ConfigOptionName => "(Client-Side) Retool Reload"; public override string ConfigDescriptionString => "Retool resets primary stocks to full."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown object obj = <>c.<>9__8_0; if (obj == null) { hook_OnEnter val = delegate(orig_OnEnter orig, ToolbotStanceSwap self) { orig.Invoke(self); if (((EntityState)self).isAuthority) { GenericSkill primarySkill = ((ToolbotStanceBase)self).GetPrimarySkill1(); if (Object.op_Implicit((Object)(object)primarySkill)) { primarySkill.stock = primarySkill.maxStock; } GenericSkill primarySkill2 = ((ToolbotStanceBase)self).GetPrimarySkill2(); if (Object.op_Implicit((Object)(object)primarySkill2)) { primarySkill2.stock = primarySkill2.maxStock; } } }; <>c.<>9__8_0 = val; obj = (object)val; } ToolbotStanceSwap.OnEnter += (hook_OnEnter)obj; } } public class ScrapICBM : TweakBase { public override string ConfigCategoryString => "Survivors - MUL-T"; public override string ConfigOptionName => "(Client-Side) Scrap Launcher - ICBM Synergy"; public override string ConfigDescriptionString => "Scrap Launcher synergizes with ICBM."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown FireGrenadeLauncher.ModifyProjectileAimRay += new hook_ModifyProjectileAimRay(FireGrenadeLauncher_ModifyProjectileAimRay); } private Ray FireGrenadeLauncher_ModifyProjectileAimRay(orig_ModifyProjectileAimRay orig, FireGrenadeLauncher self, Ray aimRay) { //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)((EntityState)self).characterBody) && Object.op_Implicit((Object)(object)((EntityState)self).characterBody.inventory)) { int itemCount = ((EntityState)self).characterBody.inventory.GetItemCount(Items.MoreMissile); int num = itemCount - 1; if (itemCount > 0) { float num2 = 1f; if (num > 0) { num2 += 0.5f * (float)num; } ((GenericProjectileBaseState)self).damageCoefficient = ((GenericProjectileBaseState)self).damageCoefficient * num2; Vector3 val = Vector3.Cross(Vector3.up, ((Ray)(ref aimRay)).direction); Vector3 val2 = Vector3.Cross(((Ray)(ref aimRay)).direction, val); float num3 = 0f; float num4 = 0f; float num5 = 0f; num5 = Random.Range(1f + num3, 1f + num3) * 3f; num4 = num5 / 2f; Vector3 val3 = Quaternion.AngleAxis((0f - num5) * 0.5f, val2) * ((Ray)(ref aimRay)).direction; Quaternion val4 = Quaternion.AngleAxis(num4, val2); Ray val5 = default(Ray); ((Ray)(ref val5))..ctor(((Ray)(ref aimRay)).origin, val3); for (int i = 0; i < 3; i++) { if (i != 1) { ProjectileManager.instance.FireProjectile(((GenericProjectileBaseState)self).projectilePrefab, ((Ray)(ref val5)).origin, Util.QuaternionSafeLookRotation(((Ray)(ref val5)).direction), ((EntityState)self).gameObject, ((BaseState)self).damageStat * ((GenericProjectileBaseState)self).damageCoefficient, ((GenericProjectileBaseState)self).force, ((BaseState)self).RollCrit(), (DamageColorIndex)0, (GameObject)null, -1f, (DamageTypeCombo?)null); } ((Ray)(ref val5)).direction = val4 * ((Ray)(ref val5)).direction; } } } return orig.Invoke(self, aimRay); } } public class ScrapLauncherAttackSpeed : TweakBase { public override string ConfigCategoryString => "Survivors - MUL-T"; public override string ConfigOptionName => "(Client-Side) Scrap Launcher - Attack Speed Scaling"; public override string ConfigDescriptionString => "Scrap Launcher cooldown scales with attack speed."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) ToolbotWeaponSkillDef val = Addressables.LoadAssetAsync((object)"RoR2/Base/Toolbot/ToolbotBodyFireGrenadeLauncher.asset").WaitForCompletion(); ((SkillDef)val).attackSpeedBuffsRestockSpeed = true; ((SkillDef)val).attackSpeedBuffsRestockSpeed_Multiplier = 1f; } } public class ScrapLauncherFalloff : TweakBase { public override string ConfigCategoryString => "Survivors - MUL-T"; public override string ConfigOptionName => "(Server-Side) Scrap Launcher - Remove Falloff"; public override string ConfigDescriptionString => "Scrap Launcher always deals full damage to enemies in the AoE."; protected override void ApplyChanges() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync((object)"RoR2/Base/Toolbot/ToolbotGrenadeLauncherProjectile.prefab").WaitForCompletion(); ProjectileImpactExplosion component = val.GetComponent(); ((ProjectileExplosion)component).falloffModel = (FalloffModel)0; } } public class ScrapLauncherNoSpread : TweakBase { public override string ConfigCategoryString => "Survivors - MUL-T"; public override string ConfigOptionName => "(Client-Side) Scrap Launcher - Remove Spread"; public override string ConfigDescriptionString => "Removes random spread."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { SneedUtils.SetAddressableEntityStateField("RoR2/Base/Toolbot/EntityStates.Toolbot.FireGrenadeLauncher.asset", "maxSpread", "0"); } } } namespace RiskyTweaks.Tweaks.Survivors.Seeker { public class MeditateBuff : TweakBase { private static GameObject cleanseEffect = Addressables.LoadAssetAsync((object)"RoR2/DLC2/Seeker/SpiritPunchMuzzleFlashVFX.prefab").WaitForCompletion(); public override string ConfigCategoryString => "Survivors - Seeker"; public override string ConfigOptionName => "(Server-Side) Meditate Buff"; public override string ConfigDescriptionString => "Meditate stuns and cleanses projectiles."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown SeekerController.CmdTriggerHealPulse += new hook_CmdTriggerHealPulse(SeekerController_CmdTriggerHealPulse); Meditate.Update += new Manipulator(Meditate_Update); } private void Meditate_Update(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "Fire") })) { val.EmitDelegate>((Func)delegate(BlastAttack blast) { ref DamageType damageType = ref blast.damageType.damageType; damageType = (DamageType)((uint)damageType | 0x20u); return blast; }); } else { Debug.LogError((object)"RiskyTweaks: Meditate Stun IL Hook failed."); } } private void SeekerController_CmdTriggerHealPulse(orig_CmdTriggerHealPulse orig, SeekerController self, float value, Vector3 corePosition, float blastRadius, float fxScale) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, value, corePosition, blastRadius, fxScale); if (!NetworkServer.active) { return; } List instancesList = InstanceTracker.GetInstancesList(); List list = new List(); foreach (ProjectileController item in instancesList) { TeamIndex val = (TeamIndex)((!Object.op_Implicit((Object)(object)self.characterBody.teamComponent)) ? (-1) : ((int)self.characterBody.teamComponent.teamIndex)); if (!item.cannotBeDeleted && item.teamFilter.teamIndex != val) { Vector3 val2 = ((Component)item).transform.position - ((Component)self).transform.position; if (!(((Vector3)(ref val2)).sqrMagnitude >= blastRadius * blastRadius)) { list.Add(((Component)item).gameObject); } } } GameObject[] array = list.ToArray(); for (int i = 0; i < array.Length; i++) { EffectManager.SimpleEffect(cleanseEffect, array[i].transform.position, array[i].transform.rotation, true); Object.Destroy((Object)(object)array[i]); } } } public class RemoveM2FoV : TweakBase { public override string ConfigCategoryString => "Survivors - Seeker"; public override string ConfigOptionName => "(Client-Side) Remove M2 FoV Modifier"; public override string ConfigDescriptionString => "Prevents FoV from changing when using Seeker's M2."; public override bool StopLoadOnConfigDisable => false; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown UnseenHand.FixedUpdate += new Manipulator(UnseenHand_FixedUpdate); } private void UnseenHand_FixedUpdate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCall(x, typeof(EntityState), "get_cameraTargetParams") })) { val.EmitDelegate>((Func)((CameraTargetParams orig) => null)); } else { Debug.LogError((object)"RiskyTweaks: Seeker RemoveM2FoV IL Hook failed."); } } } } namespace RiskyTweaks.Tweaks.Survivors.Railgunner { public class PolarFieldBuff : TweakBase { private const float reductionFactor = 3f; public override string ConfigCategoryString => "Survivors - Railgunner"; public override string ConfigOptionName => "(Server-Side) Polar Field Damage Reduction"; public override string ConfigDescriptionString => "Projectiles slowed by Polar Field deal less damage."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown SlowDownProjectiles.OnTriggerEnter += new hook_OnTriggerEnter(SlowDownProjectiles_OnTriggerEnter); SlowDownProjectiles.OnTriggerExit += new hook_OnTriggerExit(SlowDownProjectiles_OnTriggerExit); } private void SlowDownProjectiles_OnTriggerEnter(orig_OnTriggerEnter orig, SlowDownProjectiles self, Collider other) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) if (((Object)((Component)self).gameObject).name == "RailgunnerMineAltDetonated(Clone)" && Object.op_Implicit((Object)(object)self.teamFilter)) { TeamFilter component = ((Component)other).GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.teamIndex != self.teamFilter.teamIndex) { ProjectileDamage component2 = ((Component)other).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.damage /= 3f; } } } orig.Invoke(self, other); } private void SlowDownProjectiles_OnTriggerExit(orig_OnTriggerExit orig, SlowDownProjectiles self, Collider other) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) if (((Object)((Component)self).gameObject).name == "RailgunnerMineAltDetonated(Clone)" && Object.op_Implicit((Object)(object)self.teamFilter)) { TeamFilter component = ((Component)other).GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.teamIndex != self.teamFilter.teamIndex) { ProjectileDamage component2 = ((Component)other).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.damage *= 3f; } } } orig.Invoke(self, other); } } } namespace RiskyTweaks.Tweaks.Survivors.Merc { public class M1AttackSpeed : TweakBase { public override string ConfigCategoryString => "Survivors - Mercenary"; public override string ConfigOptionName => "(Client-Side) Primary Attack Speed Tweak"; public override string ConfigDescriptionString => "Third primary hit doesnt scale with attack speed to allow for Expose combos."; public override bool StopLoadOnConfigDisable => false; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown GroundLight2.OnEnter += new hook_OnEnter(GroundLight2_OnEnter); } private void GroundLight2_OnEnter(orig_OnEnter orig, GroundLight2 self) { if (base.Enabled.Value) { if (self.isComboFinisher) { ((BasicMeleeAttack)self).ignoreAttackSpeed = true; } else { ((BasicMeleeAttack)self).ignoreAttackSpeed = false; } } orig.Invoke(self); } } public class Regen : TweakBase { public override string ConfigCategoryString => "Survivors - Mercenary"; public override string ConfigOptionName => "(Server-Side) Regen Buff"; public override string ConfigDescriptionString => "Gives Mercenary standard melee character regen."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { GameObject val = LegacyResourcesAPI.Load("Prefabs/CharacterBodies/MercBody"); CharacterBody component = val.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.baseRegen = 2.5f; component.levelRegen = 0.5f; } } } } namespace RiskyTweaks.Tweaks.Survivors.Mage { public class FasterIceWall : TweakBase { public override string ConfigCategoryString => "Survivors - Artificer"; public override string ConfigOptionName => "(Client-Side) Snapfreeze - Instant Deploy"; public override string ConfigDescriptionString => "Snapfreeze fires as soon as you let go of the button."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown PrepWall.FixedUpdate += new Manipulator(PrepWall_FixedUpdate); } private void PrepWall_FixedUpdate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(PrepWall), "duration") })) { val.EmitDelegate>((Func)((float duration) => 0f)); } else { Debug.LogError((object)"RiskyTweaks: FasterIceWall IL hook failed."); } } } public class FlamethrowerGuaranteedBurn : TweakBase { public override string ConfigCategoryString => "Survivors - Artificer"; public override string ConfigOptionName => "(Client-Side) Flamethrower - Guaranteed Burn"; public override string ConfigDescriptionString => "Increases Flamethrower's burn chance to 100% so that it's as strong as it was before SotV's burn nerfs."; protected override void ApplyChanges() { SneedUtils.SetAddressableEntityStateField("RoR2/Base/Mage/EntityStates.Mage.Weapon.Flamethrower.asset", "ignitePercentChance", "100"); } } public class FlamethrowerRange : TweakBase { public override string ConfigCategoryString => "Survivors - Artificer"; public override string ConfigOptionName => "(Client-Side) Flamethrower - Increase Range"; public override string ConfigDescriptionString => "Increases Artificer's flamethrower range from 20m to 30m to match CHEF."; protected override void ApplyChanges() { SneedUtils.SetAddressableEntityStateField("RoR2/Base/Mage/EntityStates.Mage.Weapon.Flamethrower.asset", "maxDistance", "30"); } } public class IonSurgeMoveScaling : TweakBase { public override string ConfigCategoryString => "Survivors - Artificer"; public override string ConfigOptionName => "(Client-Side) Ion Surge - Disable Movement Speed Scaling"; public override string ConfigDescriptionString => "Makes Ion Surge always go a consistent distance regardless of movement speed."; public override bool StopLoadOnConfigDisable => false; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown FlyUpState.HandleMovements += new Manipulator(FlyUpState_HandleMovements); } private void FlyUpState_HandleMovements(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "moveSpeedStat") })) { int index = val.Index; val.Index = index + 1; val.EmitDelegate>((Func)((float orig) => base.Enabled.Value ? 7f : orig)); } else { Debug.LogError((object)"RiskyTweaks: IonSurgeMoveScaling IL hook failed."); } } } } namespace RiskyTweaks.Tweaks.Survivors.Loader { public class SprintQoL : TweakBase { public override string ConfigCategoryString => "Survivors - Loader"; public override string ConfigOptionName => "(Client-Side) Sprint QoL"; public override string ConfigDescriptionString => "Non-primary skills don't cancel sprinting."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) SkillDef val = Addressables.LoadAssetAsync((object)"RoR2/Base/Loader/FireHook.asset").WaitForCompletion(); SkillDef val2 = Addressables.LoadAssetAsync((object)"RoR2/Base/Loader/FireYankHook.asset").WaitForCompletion(); SkillDef val3 = Addressables.LoadAssetAsync((object)"RoR2/Base/Loader/ChargeFist.asset").WaitForCompletion(); SkillDef val4 = Addressables.LoadAssetAsync((object)"RoR2/Base/Loader/ChargeZapFist.asset").WaitForCompletion(); val.cancelSprintingOnActivation = false; val2.cancelSprintingOnActivation = false; val3.cancelSprintingOnActivation = false; val4.cancelSprintingOnActivation = false; SkillDef val5 = Addressables.LoadAssetAsync((object)"RoR2/Base/Loader/GroundSlam.asset").WaitForCompletion(); val5.cancelSprintingOnActivation = false; SkillDef val6 = Addressables.LoadAssetAsync((object)"RoR2/Base/Loader/ThrowPylon.asset").WaitForCompletion(); val6.cancelSprintingOnActivation = false; } } } namespace RiskyTweaks.Tweaks.Survivors.Huntress { public class Tracking : TweakBase { public ConfigEntry trackingMode; public override string ConfigCategoryString => "Survivors - Huntress"; public override string ConfigOptionName => "(Client-Side) Tracking Tweaks"; public override string ConfigDescriptionString => "Makes Huntress target the enemy closest to your crosshair, and increases the targeting angle."; public override bool StopLoadOnConfigDisable => true; protected override void ReadConfig(ConfigFile config) { base.ReadConfig(config); trackingMode = config.Bind(ConfigCategoryString, ConfigOptionName + " - Tracking Mode", (SortMode)2, "Type of tracking to use. Vanilla is by Distance only."); } protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown HuntressTracker.Start += new hook_Start(HuntressTracker_Start); HuntressTracker.SearchForTarget += new Manipulator(HuntressTracker_SearchForTarget); } private void HuntressTracker_Start(orig_Start orig, HuntressTracker self) { orig.Invoke(self); self.maxTrackingAngle = 45f; } private void HuntressTracker_SearchForTarget(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(BullseyeSearch), "sortMode") })) { val.EmitDelegate>((Func)((SortMode orig) => trackingMode.Value)); } else { Debug.LogError((object)"RiskyTweaks: Huntress Tracking IL Hook failed"); } } } } namespace RiskyTweaks.Tweaks.Survivors.FalseSon { public class LaserAttackSpeed : TweakBase { public override string ConfigCategoryString => "Survivors - False Son"; public override string ConfigOptionName => "(Client-Side) Laser of the Father - Attack Speed Scaling"; public override string ConfigDescriptionString => "Laser of the Father properly scales tickrate with attack speed."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown LaserFatherCharged.OnEnter += new hook_OnEnter(LaserFatherCharged_OnEnter); } private void LaserFatherCharged_OnEnter(orig_OnEnter orig, LaserFatherCharged self) { orig.Invoke(self); self.fireFrequency = LaserFatherCharged.baseFireFrequency * ((BaseState)self).attackSpeedStat; } } public class LaserProcCoefficient : TweakBase { public override string ConfigCategoryString => "Survivors - False Son"; public override string ConfigOptionName => "(Client-Side) Laser of the Father - Increase Proc Coefficient"; public override string ConfigDescriptionString => "Increases Laser of the Father proc coefficient to 1."; protected override void ApplyChanges() { SneedUtils.SetAddressableEntityStateField("RoR2/DLC2/FalseSon/EntityStates.FalseSon.LaserFatherCharged.asset", "procCoefficientPerTick", "1"); } } public class SlamHiddenCooldown : TweakBase { public override string ConfigCategoryString => "Survivors - False Son"; public override string ConfigOptionName => "(Client-Side) Club of the Forsaken - Remove Slam Cooldown"; public override string ConfigDescriptionString => "Removes hidden non-scaling cooldown from Club of the Forsaken's slam."; protected override void ApplyChanges() { SneedUtils.SetAddressableEntityStateField("RoR2/DLC2/FalseSon/EntityStates.FalseSon.ClubSwing.asset", "secondaryAltCooldownDuration", "0"); } } public class SlamProcCoefficient : TweakBase { public override string ConfigCategoryString => "Survivors - False Son"; public override string ConfigOptionName => "(Client-Side) Club of the Forsaken - Reduce Proc Coefficient"; public override string ConfigDescriptionString => "Reduces fully-charged Club of the Forsaken proc coefficient to 1."; protected override void ApplyChanges() { SneedUtils.SetAddressableEntityStateField("RoR2/DLC2/FalseSon/EntityStates.FalseSon.ChargedClubSwing.asset", "unchargedBlastProcCoefficient", "1"); SneedUtils.SetAddressableEntityStateField("RoR2/DLC2/FalseSon/EntityStates.FalseSon.ChargedClubSwing.asset", "blastProcCoefficient", "1"); SneedUtils.SetAddressableEntityStateField("RoR2/DLC2/FalseSon/EntityStates.FalseSon.ClubGroundSlam.asset", "blastProcCoefficient", "1"); } } } namespace RiskyTweaks.Tweaks.Survivors.Engi { public class MobileTurretBuff : TweakBase { public override string ConfigCategoryString => "Survivors - Engineer"; public override string ConfigOptionName => "(Server-Side) Mobile Turret Buff"; public override string ConfigDescriptionString => "Mobile Turrets always sprint and have a longer range."; protected override void ApplyChanges() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown GameObject val = Addressables.LoadAssetAsync((object)"RoR2/Base/Engi/EngiWalkerTurretBody.prefab").WaitForCompletion(); CharacterBody component = val.GetComponent(); component.bodyFlags = (BodyFlags)(component.bodyFlags | 1); if (component.baseRegen < 1f) { component.baseRegen = 1f; component.levelRegen = 0.2f; } SneedUtils.SetAddressableEntityStateField("RoR2/Base/Engi/EntityStates.EngiTurret.EngiTurretWeapon.FireBeam.asset", "maxDistance", "45"); Component[] components = (Component[])(object)Addressables.LoadAssetAsync((object)"RoR2/Base/Engi/EngiWalkerTurretMaster.prefab").WaitForCompletion().GetComponents(); Component[] array = components; Component[] array2 = array; for (int i = 0; i < array2.Length; i++) { AISkillDriver val2 = (AISkillDriver)array2[i]; if (val2.customName != "Rest") { val2.shouldSprint = true; } if (val2.customName == "ChaseAndFireAtEnemy") { val2.maxDistance = 45f; } } } } } namespace RiskyTweaks.Tweaks.Survivors.Croco { public class BiggerHitbox : TweakBase { public override string ConfigCategoryString => "Survivors - Acrid"; public override string ConfigOptionName => "(Client-Side) Bigger Melee Hitbox"; public override string ConfigDescriptionString => "Increases melee hitbox size."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = Addressables.LoadAssetAsync((object)"RoR2/Base/Croco/CrocoBody.prefab").WaitForCompletion().GetComponent(); HitBoxGroup componentInChildren = ((Component)component).GetComponentInChildren(); if (componentInChildren.groupName == "Slash") { Transform transform = ((Component)componentInChildren.hitBoxes[0]).transform; transform.localScale = new Vector3(40f, 40f, 45f); transform.localPosition = new Vector3(0f, 11f, 15f); } } } public class PoisonDamageCap : TweakBase { public override string ConfigCategoryString => "Survivors - Acrid"; public override string ConfigOptionName => "(Server-Side) Remove Poison Damage Cap"; public override string ConfigDescriptionString => "Removes the hidden damage cap of Poison"; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown DotController.AddDot_GameObject_float_HurtBox_DotIndex_float_Nullable1_Nullable1_Nullable1 += new Manipulator(DotController_AddDot_GameObject_float_HurtBox_DotIndex_float_Nullable1_Nullable1_Nullable1); } private void DotController_AddDot_GameObject_float_HurtBox_DotIndex_float_Nullable1_Nullable1_Nullable1(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 50f) })) { val.Index += 2; val.EmitDelegate>((Func)((float orig) => float.MaxValue)); } else { Debug.LogError((object)"RiskyTweaks: Croco PoisonDamageCap IL Hook failed"); } } } public class Regenerative : TweakBase { public override string ConfigCategoryString => "Survivors - Acrid"; public override string ConfigOptionName => "(Server-Side) Regenerative is Healing"; public override string ConfigDescriptionString => "Regenerative counts as healing and is no longer affected by difficulty regen modifiers."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown CharacterBody.RecalculateStats += new Manipulator(CharacterBody_RecalculateStats); HealthComponent.ServerFixedUpdate += new hook_ServerFixedUpdate(HealthComponent_ServerFixedUpdate); } private void CharacterBody_RecalculateStats(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "CrocoRegen") })) { val.EmitDelegate>((Func)((BuffDef orig) => null)); } else { Debug.LogError((object)"RiskyTweaks: Croco Regenerative IL hook failed."); } } private void HealthComponent_ServerFixedUpdate(orig_ServerFixedUpdate orig, HealthComponent self, float deltaTime) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, deltaTime); if (Object.op_Implicit((Object)(object)self.body)) { int buffCount = self.body.GetBuffCount(Buffs.CrocoRegen); if (buffCount > 0) { self.HealFraction(0.1f * deltaTime * (float)buffCount, default(ProcChainMask)); } } } } } namespace RiskyTweaks.Tweaks.Survivors.CHEF { public class GlazeInterrupt : TweakBase { public override string ConfigCategoryString => "Survivors - CHEF"; public override string ConfigOptionName => "(Client-Side) Glaze InterruptPriority"; public override string ConfigDescriptionString => "Glaze is no longer interrupted by Sear."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown Glaze.GetMinimumInterruptPriority += new hook_GetMinimumInterruptPriority(Glaze_GetMinimumInterruptPriority); } private InterruptPriority Glaze_GetMinimumInterruptPriority(orig_GetMinimumInterruptPriority orig, Glaze self) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)((self.grenadeCount < Glaze.grenadeCountMax) ? 3 : 2); } } public class SnappierCleaver : TweakBase { public override string ConfigCategoryString => "Survivors - CHEF"; public override string ConfigOptionName => "(Server-Side) Snappier Dice"; public override string ConfigDescriptionString => "Dice has a shorter minimum delay before returning."; protected override void ApplyChanges() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync((object)"RoR2/DLC2/Chef/ChefCleaver.prefab").WaitForCompletion(); CleaverProjectile component = val.GetComponent(); component.minTravelTime = 0.2f; } } } namespace RiskyTweaks.Tweaks.Survivors.Captain { public class ChargedShotgunFalloff : TweakBase { public override string ConfigCategoryString => "Survivors - Captain"; public override string ConfigOptionName => "(Client-Side) Charged Shotgun Falloff"; public override string ConfigDescriptionString => "Vulcan Shotgun has no falloff when fully charged"; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown FireCaptainShotgun.ModifyBullet += new hook_ModifyBullet(FireCaptainShotgun_ModifyBullet); } private void FireCaptainShotgun_ModifyBullet(orig_ModifyBullet orig, FireCaptainShotgun self, BulletAttack bulletAttack) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, bulletAttack); if (((GenericBulletBaseState)self).fireSoundString == "FireCaptainShotgun.tightSoundString") { bulletAttack.falloffModel = (FalloffModel)0; } } } internal class OrbitalHiddenRealms : TweakBase { public override string ConfigCategoryString => "Survivors - Captain"; public override string ConfigOptionName => "(Client-Side) Orbital Skills in Hidden Realms"; public override string ConfigDescriptionString => "Allows Orbital Skills to be used in Hidden Realms."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown Hook val = new Hook((MethodBase)Reflection.GetMethodCached(typeof(CaptainOrbitalSkillDef), "get_isAvailable"), Reflection.GetMethodCached(typeof(OrbitalHiddenRealms), "IsAvailable")); } private static bool IsAvailable(CaptainOrbitalSkillDef self) { return true; } } } namespace RiskyTweaks.Tweaks.Survivors.Bandit2 { public class BlastPierce : TweakBase { public override string ConfigCategoryString => "Survivors - Bandit"; public override string ConfigOptionName => "(Client-Side) Blast - Pierce Enemies"; public override string ConfigDescriptionString => "Blast can pierce through multiple enemies."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown Bandit2FireRifle.ModifyBullet += new hook_ModifyBullet(Bandit2FireRifle_ModifyBullet); } private void Bandit2FireRifle_ModifyBullet(orig_ModifyBullet orig, Bandit2FireRifle self, BulletAttack bulletAttack) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, bulletAttack); bulletAttack.stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask; } } public class BlastSpread : TweakBase { public override string ConfigCategoryString => "Survivors - Bandit"; public override string ConfigOptionName => "(Client-Side) Blast - Reduce Spread"; public override string ConfigDescriptionString => "Blast spread is reduced."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown Bandit2FireRifle.ModifyBullet += new hook_ModifyBullet(Bandit2FireRifle_ModifyBullet); } private void Bandit2FireRifle_ModifyBullet(orig_ModifyBullet orig, Bandit2FireRifle self, BulletAttack bulletAttack) { orig.Invoke(self, bulletAttack); bulletAttack.maxSpread *= 0.5f; bulletAttack.minSpread = 0f; } } public class BuffSuperBleed : TweakBase { private bool hookIsApplied = false; public override string ConfigCategoryString => "Survivors - Bandit"; public override string ConfigOptionName => "(Server-Side) Hemorrhage Ignores Armor"; public override string ConfigDescriptionString => "Hemorrhage ignores positive armor."; protected override void ApplyChanges() { AddHook(); } public void AddHook() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown if (!hookIsApplied) { HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(HealthComponent_TakeDamageProcess); hookIsApplied = true; } } public void RemoveHook() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown if (hookIsApplied) { HealthComponent.TakeDamageProcess -= new hook_TakeDamageProcess(HealthComponent_TakeDamageProcess); hookIsApplied = false; } } private void HealthComponent_TakeDamageProcess(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) if ((int)damageInfo.dotIndex == 6 && DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)67108864)) != 0L && DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)131072)) == 0) { float num = self.body.armor + self.adaptiveArmorValue; if (num > 0f) { damageInfo.damage *= (100f + num) / 100f; } } orig.Invoke(self, damageInfo); } } public class CloakHoldButton : TweakBase { private const float minCloakDuration = 0.3f; public override string ConfigCategoryString => "Survivors - Bandit"; public override string ConfigOptionName => "(Client-Side) Smokebomb Auto Trigger on Hold"; public override string ConfigDescriptionString => "Smokebomb automatically triggers as soon as it is available if the button is held."; protected override void ApplyChanges() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown Addressables.LoadAssetAsync((object)"RoR2/Base/Bandit2/ThrowSmokebomb.asset").WaitForCompletion().mustKeyPress = false; ThrowSmokebomb.GetMinimumInterruptPriority += new hook_GetMinimumInterruptPriority(ThrowSmokebomb_GetMinimumInterruptPriority); StealthMode.GetMinimumInterruptPriority += new hook_GetMinimumInterruptPriority(StealthMode_GetMinimumInterruptPriority); } private InterruptPriority StealthMode_GetMinimumInterruptPriority(orig_GetMinimumInterruptPriority orig, StealthMode self) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)((((EntityState)self).fixedAge > 0.3f) ? 1 : 7); } private InterruptPriority ThrowSmokebomb_GetMinimumInterruptPriority(orig_GetMinimumInterruptPriority orig, ThrowSmokebomb self) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)((((EntityState)self).fixedAge > 0.3f) ? 2 : 3); } } public class KnifeHitbox : TweakBase { public override string ConfigCategoryString => "Survivors - Bandit"; public override string ConfigOptionName => "(Client-Side) Knife Hitbox"; public override string ConfigDescriptionString => "Increases knife hitbox size."; protected override void ApplyChanges() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = Addressables.LoadAssetAsync((object)"RoR2/Base/Bandit2/Bandit2Body.prefab").WaitForCompletion().GetComponent(); HitBoxGroup componentInChildren = ((Component)component).GetComponentInChildren(); if (componentInChildren.groupName == "SlashBlade") { Transform transform = ((Component)componentInChildren.hitBoxes[0]).transform; transform.localScale = new Vector3(10.35f, 6f, 7.5f); transform.localPosition += new Vector3(0f, 0f, 1f); } } } public class KnifeLunge : TweakBase { private AnimationCurve knifeVelocity; public override string ConfigCategoryString => "Survivors - Bandit"; public override string ConfigOptionName => "(Client-Side) Knife Lunge"; public override string ConfigDescriptionString => "Lunge forwards when using Serrated Dagger."; protected override void ApplyChanges() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Expected O, but got Unknown knifeVelocity = BuildSlashVelocityCurve(); SkillDef val = Addressables.LoadAssetAsync((object)"RoR2/Base/Bandit2/SlashBlade.asset").WaitForCompletion(); val.canceledFromSprinting = false; SlashBlade.OnEnter += new hook_OnEnter(SlashBlade_OnEnter); SneedUtils.SetAddressableEntityStateField("RoR2/Base/Bandit2/EntityStates.Bandit2.Weapon.SlashBlade.asset", "ignoreAttackSpeed", "1"); Hook val2 = new Hook((MethodBase)Reflection.GetMethodCached(typeof(SlashBlade), "get_minimumDuration"), Reflection.GetMethodCached(typeof(KnifeLunge), "GetBandit2SlashBladeMinDurationHook")); } private void SlashBlade_OnEnter(orig_OnEnter orig, SlashBlade self) { orig.Invoke(self); if (Object.op_Implicit((Object)(object)((EntityState)self).characterBody) && ((EntityState)self).characterBody.isSprinting) { ((BasicMeleeAttack)self).ignoreAttackSpeed = true; ((BasicMeleeAttack)self).forceForwardVelocity = true; ((BasicMeleeAttack)self).forwardVelocityCurve = knifeVelocity; } } private static float GetBandit2SlashBladeMinDurationHook(SlashBlade self) { return 0.3f; } private AnimationCurve BuildSlashVelocityCurve() { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown Keyframe val = default(Keyframe); ((Keyframe)(ref val))..ctor(0f, 3f, -8.182907f, -3.3333333f, 0f, 0.058712736f); ((Keyframe)(ref val)).weightedMode = (WeightedMode)0; ((Keyframe)(ref val)).tangentMode = 65; Keyframe val2 = default(Keyframe); ((Keyframe)(ref val2))..ctor(0.3f, 0f, -3.3333333f, -3.3333333f, 1f / 3f, 1f / 3f); ((Keyframe)(ref val2)).weightedMode = (WeightedMode)0; ((Keyframe)(ref val2)).tangentMode = 34; Keyframe[] keys = (Keyframe[])(object)new Keyframe[2] { val, val2 }; return new AnimationCurve { preWrapMode = (WrapMode)8, postWrapMode = (WrapMode)8, keys = keys }; } } public class PrimaryAutoFire : TweakBase { public static class FireMode { public enum Bandit2FireMode { Default, Spam } private static bool initialized = false; public static Bandit2FireMode currentfireMode = Bandit2FireMode.Default; public static ConfigEntry Enabled; public static ConfigEntry defaultButton; public static ConfigEntry spamButton; public static List targetSkills = new List { (SkillDef)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/Bandit2/FireShotgun2.asset").WaitForCompletion(), (SkillDef)(object)Addressables.LoadAssetAsync((object)"RoR2/Base/Bandit2/Bandit2Blast.asset").WaitForCompletion() }; private static BodyIndex targetBodyIndex; internal static void Init(ConfigFile config) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown if (!initialized) { initialized = true; ReadConfig(config); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(OnLoad)); SkillIcon.Update += new hook_Update(SkillIcon_Update); FireSelectManager.FireModeActions = (FireSelectManager.FireMode)Delegate.Combine(FireSelectManager.FireModeActions, new FireSelectManager.FireMode(FireModeAction)); } } private static void ReadConfig(ConfigFile config) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) Enabled = config.Bind("Fire Select - Bandit Primary Autofire", "Use Fire Select", true, "Enable firemode selection. Requires Bandit Primary Autofire to be enabled."); Enabled.SettingChanged += Enabled_SettingChanged; defaultButton = config.Bind("Fire Select - Bandit Primary Autofire", "Default Button", KeyboardShortcut.Empty, "Button to select Default firemode."); spamButton = config.Bind("Fire Select - Bandit Primary Autofire", "Spam Button", KeyboardShortcut.Empty, "Button to select Spam firemode."); } private static void Enabled_SettingChanged(object sender, EventArgs e) { if (!Enabled.Value) { currentfireMode = Bandit2FireMode.Default; } } private static void OnLoad() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) targetBodyIndex = BodyCatalog.FindBodyIndex("Bandit2Body"); } private static void SkillIcon_Update(orig_Update orig, SkillIcon self) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Invalid comparison between Unknown and I4 //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (Enabled.Value && Object.op_Implicit((Object)(object)self.targetSkill) && (int)self.targetSkillSlot == 0 && self.targetSkill.characterBody.bodyIndex == targetBodyIndex && targetSkills.Contains(self.targetSkill.skillDef)) { ((Component)self.stockText).gameObject.SetActive(true); ((TMP_Text)self.stockText).fontSize = 12f; ((TMP_Text)self.stockText).SetText(currentfireMode.ToString() + "(" + self.targetSkill.stock + ")", true); } } private static void CycleFireMode() { if (currentfireMode == Bandit2FireMode.Default) { currentfireMode = Bandit2FireMode.Spam; } else { currentfireMode = Bandit2FireMode.Default; } } private static void FireModeAction() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) if (Enabled.Value) { float y = Input.mouseScrollDelta.y; KeyboardShortcut value = FireSelectManager.nextButton.Value; bool flag = ((KeyboardShortcut)(ref value)).IsDown(); value = FireSelectManager.prevButton.Value; bool flag2 = ((KeyboardShortcut)(ref value)).IsDown(); if ((FireSelectManager.scrollSelection.Value && y != 0f) || flag || flag2) { CycleFireMode(); } if (SneedUtils.GetKeyPressed(defaultButton)) { currentfireMode = Bandit2FireMode.Default; } else if (SneedUtils.GetKeyPressed(spamButton)) { currentfireMode = Bandit2FireMode.Spam; } } } } public override string ConfigCategoryString => "Survivors - Bandit"; public override string ConfigOptionName => "(Client-Side) Primary Autofire"; public override string ConfigDescriptionString => "Primaries automatically fire when holding down the button."; protected override void ReadConfig(ConfigFile config) { base.ReadConfig(config); FireMode.Init(config); } protected override void ApplyChanges() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown ReloadSkillDef val = Addressables.LoadAssetAsync((object)"RoR2/Base/Bandit2/FireShotgun2.asset").WaitForCompletion(); ((SkillDef)val).mustKeyPress = false; ((SkillDef)val).interruptPriority = (InterruptPriority)1; ReloadSkillDef val2 = Addressables.LoadAssetAsync((object)"RoR2/Base/Bandit2/Bandit2Blast.asset").WaitForCompletion(); ((SkillDef)val2).mustKeyPress = false; ((SkillDef)val2).interruptPriority = (InterruptPriority)1; Bandit2FirePrimaryBase.GetMinimumInterruptPriority += new hook_GetMinimumInterruptPriority(Bandit2FirePrimaryBase_GetMinimumInterruptPriority); Bandit2FirePrimaryBase.OnEnter += new hook_OnEnter(Bandit2FirePrimaryBase_OnEnter); } private void Bandit2FirePrimaryBase_OnEnter(orig_OnEnter orig, Bandit2FirePrimaryBase self) { if (FireMode.currentfireMode == FireMode.Bandit2FireMode.Default) { self.minimumBaseDuration = 0.3f; } else { self.minimumBaseDuration = 0.12f; } orig.Invoke(self); } private InterruptPriority Bandit2FirePrimaryBase_GetMinimumInterruptPriority(orig_GetMinimumInterruptPriority orig, Bandit2FirePrimaryBase self) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) if (((EntityState)self).fixedAge <= self.minimumDuration && ((EntityState)self).inputBank.skill1.wasDown) { return (InterruptPriority)2; } return (InterruptPriority)0; } } public class SpecialHold : TweakBase { public override string ConfigCategoryString => "Survivors - Bandit"; public override string ConfigOptionName => "(Client-Side) Special Hold Button"; public override string ConfigDescriptionString => "Revolver skills only fire after releasing the button."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown BasePrepSidearmRevolverState.FixedUpdate += new Manipulator(BasePrepSidearmRevolverState_FixedUpdate); } private void BasePrepSidearmRevolverState_FixedUpdate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCall(x, typeof(EntityState), "get_fixedAge") })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)((float fixedAge, BasePrepSidearmRevolverState self) => (((EntityState)self).isAuthority && Object.op_Implicit((Object)(object)((EntityState)self).inputBank) && ((EntityState)self).inputBank.skill4.down) ? (-1f) : fixedAge)); } } } public class SpecialSprint : TweakBase { public override string ConfigCategoryString => "Survivors - Bandit"; public override string ConfigOptionName => "(Client-Side) Special Disable Sprint Cancel"; public override string ConfigDescriptionString => "Sprinting no longer cancels Revolver skills."; protected override void ApplyChanges() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown Addressables.LoadAssetAsync((object)"RoR2/Base/Bandit2/SkullRevolver.asset").WaitForCompletion().canceledFromSprinting = false; Addressables.LoadAssetAsync((object)"RoR2/Base/Bandit2/ResetRevolver.asset").WaitForCompletion().canceledFromSprinting = false; BaseSidearmState.FixedUpdate += new Manipulator(BaseSidearmState_FixedUpdate); } private void BaseSidearmState_FixedUpdate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, typeof(CharacterBody), "get_isSprinting") })) { val.EmitDelegate>((Func)((bool isSprinting) => false)); } else { Debug.LogError((object)"RiskyTweaks: Bandit SpecialSprint IL Hook failed."); } } } } namespace RiskyTweaks.Tweaks.Stages { public class ArtifactWorldDropChance : TweakBase { private static int killCount; public override string ConfigCategoryString => "Stages"; public override string ConfigOptionName => "(Server-Side) Bulwarks Ambry - Anti Softlock"; public override string ConfigDescriptionString => "Artifact Keys are guaranteed to drop after a certain amount of kills."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown Stage.onStageStartGlobal += ResetKillCount; CombatState.OnCharacterDeathGlobal += new hook_OnCharacterDeathGlobal(ArtifactKeyDrop); ArtifactTrialMissionController.OnStartServer += new hook_OnStartServer(ArtifactTrialMissionController_OnStartServer); } private void ArtifactTrialMissionController_OnStartServer(orig_OnStartServer orig, ArtifactTrialMissionController self) { orig.Invoke(self); if (self.chanceForKeyDrop < 0.04f) { self.chanceForKeyDrop = 0.04f; } } private void ResetKillCount(Stage obj) { killCount = 0; } private void ArtifactKeyDrop(orig_OnCharacterDeathGlobal orig, EntityState self, DamageReport damageReport) { //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) ArtifactTrialMissionControllerBaseState val = (ArtifactTrialMissionControllerBaseState)(object)((self is ArtifactTrialMissionControllerBaseState) ? self : null); bool flag = Util.CheckRoll(Util.GetExpAdjustedDropChancePercent(val.missionController.chanceForKeyDrop * 100f, ((Component)damageReport.victim).gameObject), 0f, (CharacterMaster)null); int num = Mathf.CeilToInt(1f / val.missionController.chanceForKeyDrop); killCount++; if (killCount > num) { flag = true; } if (flag) { killCount = 0; Debug.LogFormat("Creating artifact key pickup droplet.", Array.Empty()); PickupDropletController.CreatePickupDroplet(val.missionController.GenerateDrop(), damageReport.victimBody.corePosition, Vector3.up * 20f); } } } } namespace RiskyTweaks.Tweaks.Stages.VoidStage { public class FasterHoldout : TweakBase { public override string ConfigCategoryString => "Stages - Void Locus"; public override string ConfigOptionName => "(Server-Side) Faster Holdout"; public override string ConfigDescriptionString => "Reduce time it takes to charge Void Signals."; protected override void ApplyChanges() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (ModCompat.TeleExpansionCompat.pluginLoaded) { Debug.LogWarning((object)"RiskyTweaks: Skipped Void Locus FasterHoldout because TeleExpansion is loaded."); return; } GameObject val = Addressables.LoadAssetAsync((object)"RoR2/DLC1/DeepVoidPortalBattery/DeepVoidPortalBattery.prefab").WaitForCompletion(); HoldoutZoneController component = val.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.baseChargeDuration = 40f; } } } public class NerfFog : TweakBase { public override string ConfigCategoryString => "Stages - Void Locus"; public override string ConfigOptionName => "(Server-Side) Nerf Fog"; public override string ConfigDescriptionString => "Nerfs fog damage settings to be consistent with Void Fields."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown VoidStageMissionController.RequestFog += new hook_RequestFog(VoidStageMissionController_RequestFog); } private FogRequest VoidStageMissionController_RequestFog(orig_RequestFog orig, VoidStageMissionController self, IZone zone) { if (Object.op_Implicit((Object)(object)self.fogDamageController)) { self.fogDamageController.healthFractionPerSecond = 0.025f; self.fogDamageController.healthFractionRampCoefficientPerSecond = 0f; } return orig.Invoke(self, zone); } } public class PillarsDropItems : TweakBase { private static Vector3 rewardPositionOffset = new Vector3(0f, 3f, 0f); public static float whiteChance = 45f; public static float greenChance = 40f; public static float redChance = 5f; public static float voidChance = 10f; public override string ConfigCategoryString => "Stages - Void Locus"; public override string ConfigOptionName => "(Server-Side) Signals Drop Items"; public override string ConfigDescriptionString => "Signals drop items for the team on completion."; protected override void ReadConfig(ConfigFile config) { base.ReadConfig(config); whiteChance = config.Bind(ConfigCategoryString, ConfigOptionName + " - Tier1 Chance", 45f, "Chance to drop white items.").Value; greenChance = config.Bind(ConfigCategoryString, ConfigOptionName + " - Tier2 Chance", 40f, "Chance to drop green items.").Value; redChance = config.Bind(ConfigCategoryString, ConfigOptionName + " - Tier3 Chance", 5f, "Chance to drop red items.").Value; voidChance = config.Bind(ConfigCategoryString, ConfigOptionName + " - Void Chance", 10f, "Chance to drop Void items.").Value; } protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown HoldoutZoneController.OnDisable += new hook_OnDisable(HoldoutZoneController_OnDisable); } private void HoldoutZoneController_OnDisable(orig_OnDisable orig, HoldoutZoneController self) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected I4, but got Unknown //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Expected O, but got Unknown //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (!NetworkServer.active) { return; } SceneDef sceneDefForCurrentScene = SceneCatalog.GetSceneDefForCurrentScene(); if (!Object.op_Implicit((Object)(object)sceneDefForCurrentScene) || !sceneDefForCurrentScene.baseSceneName.Equals("voidstage")) { return; } PickupDropTable val = SelectItem(); UniquePickup val2 = val.GeneratePickup(Run.instance.bossRewardRng); PickupIndex pickupIndex = val2.pickupIndex; ItemTier itemTier = PickupCatalog.GetPickupDef(pickupIndex).itemTier; if (!(pickupIndex != PickupIndex.none)) { return; } PickupDef pickupDef = PickupCatalog.GetPickupDef(pickupIndex); int participatingPlayerCount = Run.instance.participatingPlayerCount; if (participatingPlayerCount == 0 || !Object.op_Implicit((Object)(object)((Component)self).transform)) { return; } int num = participatingPlayerCount; bool flag = false; ItemTier val3 = itemTier; ItemTier val4 = val3; switch ((int)val4) { case 0: if (ModCompat.ShareSuiteCompat.ItemSettings.common) { num = 1; } break; case 1: if (ModCompat.ShareSuiteCompat.ItemSettings.uncommon) { num = 1; } break; case 2: if (ModCompat.ShareSuiteCompat.ItemSettings.legendary) { num = 1; } break; case 6: case 7: case 8: case 9: if (ModCompat.ShareSuiteCompat.ItemSettings.voidItem) { num = 1; } break; } float num2 = 360f / (float)num; Vector3 val5 = Quaternion.AngleAxis((float)Random.Range(0, 360), Vector3.up) * (Vector3.up * 40f + Vector3.forward * 5f); Quaternion val6 = Quaternion.AngleAxis(num2, Vector3.up); Option[] array = PickupPickerController.GenerateOptionsFromDropTable(3, val, Run.instance.bossRewardRng); if (array.Length != 0 && ((Option)(ref array[0])).pickupIndex != PickupIndex.none) { pickupDef = PickupCatalog.GetPickupDef(((Option)(ref array[0])).pickupIndex); } if (pickupDef != null && pickupDef.pickupIndex != PickupIndex.none) { SimpleChatMessage val7 = new SimpleChatMessage(); val7.baseToken = "VOID_SIGNAL_COMPLETE_RISKYMOD"; val7.paramTokens = new string[1] { "" + Language.GetStringFormatted(pickupDef.nameToken, Array.Empty()) + "" }; Chat.SendBroadcastChat((ChatMessageBase)(object)val7); } int num3 = 0; while (num3 < num) { CreatePickupInfo val8 = default(CreatePickupInfo); val8.pickerOptions = array; val8.prefabOverride = Addressables.LoadAssetAsync((object)"RoR2/DLC1/OptionPickup/OptionPickup.prefab").WaitForCompletion(); val8.rotation = Quaternion.identity; ((CreatePickupInfo)(ref val8)).pickupIndex = PickupCatalog.FindPickupIndex(itemTier); PickupDropletController.CreatePickupDroplet(val8, ((Component)self).transform.position + rewardPositionOffset, val5); num3++; val5 = val6 * val5; } } private static PickupDropTable SelectItem() { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) Xoroshiro128Plus bossRewardRng = Run.instance.bossRewardRng; float num = whiteChance + greenChance + redChance + voidChance; if (bossRewardRng.RangeFloat(0f, num) <= whiteChance && whiteChance > 0f) { return Addressables.LoadAssetAsync((object)"RoR2/Base/Common/dtTier1Item.asset").WaitForCompletion(); } num -= whiteChance; if (bossRewardRng.RangeFloat(0f, num) <= greenChance && greenChance > 0f) { return Addressables.LoadAssetAsync((object)"RoR2/Base/Common/dtTier2Item.asset").WaitForCompletion(); } num -= greenChance; if (bossRewardRng.RangeFloat(0f, num) <= redChance && redChance > 0f) { return Addressables.LoadAssetAsync((object)"RoR2/Base/Common/dtTier3Item.asset").WaitForCompletion(); } return Addressables.LoadAssetAsync((object)"RoR2/Base/Common/dtVoidChest.asset").WaitForCompletion(); } } } namespace RiskyTweaks.Tweaks.Stages.VoidRaid { public class NerfFog : TweakBase { private SceneDef voidRaidScene = Addressables.LoadAssetAsync((object)"RoR2/DLC1/voidraid/voidraid.asset").WaitForCompletion(); public override string ConfigCategoryString => "Stages - Planetarium"; public override string ConfigOptionName => "(Server-Side) Nerf Fog"; public override string ConfigDescriptionString => "Nerfs fog damage settings to be consistent with Void Fields."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown FogDamageController.Start += new hook_Start(FogDamageController_Start); } private void FogDamageController_Start(orig_Start orig, FogDamageController self) { orig.Invoke(self); if ((Object)(object)SceneCatalog.GetSceneDefForCurrentScene() == (Object)(object)voidRaidScene) { self.healthFractionPerSecond = 0.025f; self.healthFractionRampCoefficientPerSecond = 0f; } } } } namespace RiskyTweaks.Tweaks.Stages.Moon { public class FasterHoldout : TweakBase { public override string ConfigCategoryString => "Stages - Commencement"; public override string ConfigOptionName => "(Server-Side) Faster Holdout"; public override string ConfigDescriptionString => "Reduce time it takes to charge the Pillar of Mass and Soul."; protected override void ApplyChanges() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (ModCompat.TeleExpansionCompat.pluginLoaded) { Debug.LogWarning((object)"RiskyTweaks: Skipped Commencement FasterHoldout because TeleExpansion is loaded."); return; } ModifyHoldout(Addressables.LoadAssetAsync((object)"RoR2/Base/moon2/MoonBatteryMass.prefab").WaitForCompletion(), 40f); ModifyHoldout(Addressables.LoadAssetAsync((object)"RoR2/Base/moon2/MoonBatterySoul.prefab").WaitForCompletion(), 20f); } private void ModifyHoldout(GameObject gameObject, float durationOverride) { if (Object.op_Implicit((Object)(object)gameObject)) { HoldoutZoneController component = gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.baseChargeDuration = durationOverride; } } } } public class PillarsDropItems : TweakBase { private static Vector3 rewardPositionOffset = new Vector3(0f, 3f, 0f); public static float whiteChance = 50f; public static float greenChance = 40f; public static float redChance = 10f; public static float lunarChance = 0f; public static float pearlOverwriteChance = 15f; public override string ConfigCategoryString => "Stages - Commencement"; public override string ConfigOptionName => "(Server-Side) Pillars Drop Items"; public override string ConfigDescriptionString => "Pillars drop items for the team on completion."; protected override void ReadConfig(ConfigFile config) { base.ReadConfig(config); whiteChance = config.Bind(ConfigCategoryString, ConfigOptionName + " - Tier1 Chance", 50f, "Chance to drop white items.").Value; greenChance = config.Bind(ConfigCategoryString, ConfigOptionName + " - Tier2 Chance", 40f, "Chance to drop green items.").Value; redChance = config.Bind(ConfigCategoryString, ConfigOptionName + " - Tier3 Chance", 10f, "Chance to drop red items.").Value; lunarChance = config.Bind(ConfigCategoryString, ConfigOptionName + " - Lunar Chance", 0f, "Chance to drop lunar items.").Value; pearlOverwriteChance = config.Bind(ConfigCategoryString, ConfigOptionName + " - Pearl Overwrite Chance", 15f, "Chance for non-Tier3 items to be rerolled into a Pearl.").Value; } protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown MoonBatteryMissionController.OnBatteryCharged += new hook_OnBatteryCharged(MoonBatteryMissionController_OnBatteryCharged); } private void MoonBatteryMissionController_OnBatteryCharged(orig_OnBatteryCharged orig, MoonBatteryMissionController self, HoldoutZoneController holdoutZone) { //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Expected I4, but got Unknown //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Expected O, but got Unknown //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Invalid comparison between Unknown and I4 //IL_041e: Unknown result type (might be due to invalid IL or missing references) //IL_0426: Unknown result type (might be due to invalid IL or missing references) //IL_042b: Unknown result type (might be due to invalid IL or missing references) //IL_0430: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_0446: Unknown result type (might be due to invalid IL or missing references) //IL_0448: Unknown result type (might be due to invalid IL or missing references) //IL_044d: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_03fa: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_0407: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) self.Network_numChargedBatteries = self._numChargedBatteries + 1; if (self._numChargedBatteries >= self._numRequiredBatteries && NetworkServer.active) { for (int i = 0; i < self.elevatorStateMachines.Length; i++) { self.elevatorStateMachines[i].SetNextState((EntityState)new InactiveToReady()); } } if (!NetworkServer.active) { return; } PickupIndex val = SelectItem(); ItemTier itemTier = PickupCatalog.GetPickupDef(val).itemTier; if (!(val != PickupIndex.none)) { return; } string text = "Pillar"; PurchaseInteraction component = ((Component)holdoutZone).gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { text = component.GetDisplayName(); } PickupDef pickupDef = PickupCatalog.GetPickupDef(val); int participatingPlayerCount = Run.instance.participatingPlayerCount; if (participatingPlayerCount == 0 || !Object.op_Implicit((Object)(object)((Component)holdoutZone).transform)) { return; } int num = participatingPlayerCount; bool flag = false; ItemTier val2 = itemTier; ItemTier val3 = val2; PickupDropTable val4; switch (val3 - 1) { case 0: if (ModCompat.ShareSuiteCompat.ItemSettings.uncommon) { num = 1; flag = true; } val4 = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/dtTier2Item.asset").WaitForCompletion(); break; case 1: if (ModCompat.ShareSuiteCompat.ItemSettings.legendary) { num = 1; flag = true; } val4 = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/dtTier3Item.asset").WaitForCompletion(); break; case 2: if (ModCompat.ShareSuiteCompat.ItemSettings.lunar) { num = 1; flag = true; } val4 = Addressables.LoadAssetAsync((object)"RoR2/Base/LunarChest/dtLunarChest.asset").WaitForCompletion(); break; default: if (ModCompat.ShareSuiteCompat.ItemSettings.common) { num = 1; flag = true; } val4 = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/dtTier1Item.asset").WaitForCompletion(); break; } float num2 = 360f / (float)num; Vector3 val5 = Quaternion.AngleAxis((float)Random.Range(0, 360), Vector3.up) * (Vector3.up * 40f + Vector3.forward * 5f); Quaternion val6 = Quaternion.AngleAxis(num2, Vector3.up); Option[] array = PickupPickerController.GenerateOptionsFromDropTable(3, val4, Run.instance.bossRewardRng); if (array.Length != 0 && ((Option)(ref array[0])).pickupIndex != PickupIndex.none) { pickupDef = PickupCatalog.GetPickupDef(((Option)(ref array[0])).pickupIndex); } if (pickupDef != null && pickupDef.pickupIndex != PickupIndex.none) { SimpleChatMessage val7 = new SimpleChatMessage(); val7.baseToken = "MOON_PILLAR_COMPLETE_RISKYMOD"; val7.paramTokens = new string[2] { text, "" + Language.GetStringFormatted(pickupDef.nameToken, Array.Empty()) + "" }; Chat.SendBroadcastChat((ChatMessageBase)(object)val7); } int num3 = 0; while (num3 < num) { PickupIndex val8 = PickupIndex.none; bool flag2 = false; if ((int)itemTier != 2 && !flag && !ModCompat.ShareSuiteCompat.ItemSettings.boss) { float num4 = pearlOverwriteChance; float num5 = num4; if (Run.instance.bossRewardRng.RangeFloat(0f, 100f) < num4) { val8 = SelectPearl(); } flag2 = !(val8 == PickupIndex.none); } if (!flag2) { if (!ModCompat.ArtifactOfPotentialCompat.IsArtifactActive()) { PickupDropletController.CreatePickupDroplet(pickupDef.pickupIndex, ((Component)holdoutZone).transform.position + rewardPositionOffset, val5); } else { CreatePickupInfo val9 = default(CreatePickupInfo); val9.pickerOptions = array; val9.prefabOverride = Addressables.LoadAssetAsync((object)"RoR2/DLC1/OptionPickup/OptionPickup.prefab").WaitForCompletion(); val9.rotation = Quaternion.identity; ((CreatePickupInfo)(ref val9)).pickupIndex = PickupCatalog.FindPickupIndex(itemTier); PickupDropletController.CreatePickupDroplet(val9, ((Component)holdoutZone).transform.position + rewardPositionOffset, val5); } } else { PickupDropletController.CreatePickupDroplet(val8, ((Component)holdoutZone).transform.position + rewardPositionOffset, val5); } num3++; val5 = val6 * val5; } } private static PickupIndex SelectPearl() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) PickupIndex val = PickupCatalog.FindPickupIndex(Items.Pearl.itemIndex); PickupIndex val2 = PickupCatalog.FindPickupIndex(Items.ShinyPearl.itemIndex); bool flag = val != PickupIndex.none && Run.instance.IsItemAvailable(Items.Pearl.itemIndex); bool flag2 = val2 != PickupIndex.none && Run.instance.IsItemAvailable(Items.ShinyPearl.itemIndex); PickupIndex result = PickupIndex.none; if (flag && flag2) { result = val; if (Run.instance.bossRewardRng.RangeFloat(0f, 100f) <= 20f) { result = val2; } } else if (flag) { result = val; } else if (flag2) { result = val2; } return result; } private static PickupIndex SelectItem() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) Xoroshiro128Plus bossRewardRng = Run.instance.bossRewardRng; PickupIndex result = PickupIndex.none; float num = whiteChance + greenChance + redChance + lunarChance; List list; if (bossRewardRng.RangeFloat(0f, num) <= whiteChance && whiteChance > 0f) { list = Run.instance.availableTier1DropList; } else { num -= whiteChance; if (bossRewardRng.RangeFloat(0f, num) <= greenChance && greenChance > 0f) { list = Run.instance.availableTier2DropList; } else { num -= greenChance; list = ((!(bossRewardRng.RangeFloat(0f, num) <= redChance) || !(redChance > 0f)) ? Run.instance.availableLunarCombinedDropList : Run.instance.availableTier3DropList); } } if (list.Count > 0) { result = bossRewardRng.NextElementUniform(list); } return result; } } public class PortalGoesToLocus : TweakBase { public override string ConfigCategoryString => "Stages - Commencement"; public override string ConfigOptionName => "(Server-Side) Frog leads to Void Locus"; public override string ConfigDescriptionString => "Petting the frog leads to Void Locus instead of going directly to Voidling."; protected override void ApplyChanges() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync((object)"RoR2/Base/moon/FrogInteractable.prefab").WaitForCompletion(); PortalSpawner component = val.GetComponent(); component.portalSpawnCard = Addressables.LoadAssetAsync((object)"RoR2/DLC1/PortalVoid/iscVoidPortal.asset").WaitForCompletion(); Transform spawnReferenceLocation = component.spawnReferenceLocation; spawnReferenceLocation.localPosition += Vector3.down * 5f; } } } namespace RiskyTweaks.Tweaks.Stages.Arena { public class NerfFog : TweakBase { private SceneDef arenaScene = Addressables.LoadAssetAsync((object)"RoR2/Base/arena/arena.asset").WaitForCompletion(); public override string ConfigCategoryString => "Stages - Void Fields"; public override string ConfigOptionName => "(Server-Side) Remove SotS Part 2 Ramping Fog Damage"; public override string ConfigDescriptionString => "Reverts SotS Phase 2 teamwide fog damage penalties."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ArenaMissionController.UpdateFogDamageVoidFieldsDamageMultiplier += new hook_UpdateFogDamageVoidFieldsDamageMultiplier(ArenaMissionController_UpdateFogDamageVoidFieldsDamageMultiplier); } private void ArenaMissionController_UpdateFogDamageVoidFieldsDamageMultiplier(orig_UpdateFogDamageVoidFieldsDamageMultiplier orig, ArenaMissionController self, int voidFieldsDamageMultiplier) { } } public class RemoveItemGain : TweakBase { private SceneDef arenaScene = Addressables.LoadAssetAsync((object)"RoR2/Base/arena/arena.asset").WaitForCompletion(); public override string ConfigCategoryString => "Stages - Void Fields"; public override string ConfigOptionName => "(Server-Side) Remove SotS Part 2 Item Gain"; public override string ConfigDescriptionString => "Reverts the SotS Part 2 change that makes enemies gain items while you are outside the bubble."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown Active.HandlePenalties += new hook_HandlePenalties(Active_HandlePenalties); } private void Active_HandlePenalties(orig_HandlePenalties orig, Active self, ref float percentOfPlayersInRadius) { self.timeSincePreviousItemPunishment = 0f; orig.Invoke(self, ref percentOfPlayersInRadius); } } } namespace RiskyTweaks.Tweaks.Items { public class BottledChaosBlacklist : TweakBase { public override string ConfigCategoryString => "Items"; public override string ConfigOptionName => "(Server-Side) Bottled Chaos - Blacklist Equipments"; public override string ConfigDescriptionString => "Blacklists Volcanic Egg and Eccentric Vase from being randomly triggered."; protected override void ApplyChanges() { RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(OnLoad)); } private void OnLoad() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) Equipment.FireBallDash.canBeRandomlyTriggered = false; Equipment.Gateway.canBeRandomlyTriggered = false; EquipmentCatalog.randomTriggerEquipmentList.Remove(Equipment.FireBallDash.equipmentIndex); EquipmentCatalog.randomTriggerEquipmentList.Remove(Equipment.Gateway.equipmentIndex); } } public class EclipseLiteStocks : TweakBase { public override string ConfigCategoryString => "Items"; public override string ConfigOptionName => "(Server-Side) Eclipse Lite - Scale to Stocks Per Cooldown"; public override string ConfigDescriptionString => "Eclipse Lite barrier regen is divided by the amount of stocks given per recharge."; protected override void ApplyChanges() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown base.ApplyChanges(); CharacterBody.OnSkillCooldown += new Manipulator(CharacterBody_OnSkillCooldown); } private void CharacterBody_OnSkillCooldown(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Items), "BarrierOnCooldown") }) && val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "AddBarrierAuthority") })) { val.Emit(OpCodes.Ldarg_1); val.Emit(OpCodes.Ldarg_2); val.EmitDelegate>((Func)delegate(float perc, GenericSkill skill, int restock) { if (Object.op_Implicit((Object)(object)skill) && Object.op_Implicit((Object)(object)skill.skillDef)) { int rechargeStock = skill.skillDef.GetRechargeStock(skill); if (rechargeStock > 1) { perc /= (float)rechargeStock; } } return perc; }); } else { Debug.LogError((object)"RiskyTweaks: EclipseLiteStocks IL hook failed."); } } } public class GasolineScaling : TweakBase { public override string ConfigCategoryString => "Items"; public override string ConfigOptionName => "(Server-Side) Gasoline - Faster Burn Damage"; public override string ConfigDescriptionString => "Burn damage ticks faster at higher stacks."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown GlobalEventManager.ProcIgniteOnKill += new Manipulator(GlobalEventManager_ProcIgniteOnKill); } private void GlobalEventManager_ProcIgniteOnKill(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(InflictDotInfo), "damageMultiplier") })) { val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Func)delegate(float damageMult, int itemCount) { damageMult = 0.75f + 0.25f * (float)itemCount; return damageMult; }); } else { Debug.LogError((object)"RiskyTweaks: GasolineScaling IL Hook failed"); } } } public class PenniesDisableInBazaar : TweakBase { public override string ConfigCategoryString => "Items"; public override string ConfigOptionName => "(Server-Side) Roll of Pennies - Disable in Bazaar"; public override string ConfigDescriptionString => "Disables this item in the Bazaar."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown HealthComponent.TakeDamageProcess += new Manipulator(HealthComponent_TakeDamageProcess); } private void HealthComponent_TakeDamageProcess(ILContext il) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown bool flag = true; ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(ItemCounts), "goldOnHurt") })) { val.EmitDelegate>((Func)((int origItemCount) => (!SneedUtils.IsInBazaar()) ? origItemCount : 0)); flag = false; } if (flag) { Debug.LogError((object)"RiskyTweaks: PenniesDisableInBazaar IL hook failed."); } } } public class PredatoryRefresh : TweakBase { public override string ConfigCategoryString => "Items"; public override string ConfigOptionName => "(Server-Side) Predatory Instincts - Refresh On Proc"; public override string ConfigDescriptionString => "Buff duration refreshes when proccing."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown GlobalEventManager.OnCrit += new hook_OnCrit(RefreshPredatoryOnCrit); } private void RefreshPredatoryOnCrit(orig_OnCrit orig, GlobalEventManager self, CharacterBody body, DamageInfo damageInfo, CharacterMaster master, float procCoefficient, ProcChainMask procChainMask) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, body, damageInfo, master, procCoefficient, procChainMask); if (!Object.op_Implicit((Object)(object)body)) { return; } int buffCount = body.GetBuffCount(Buffs.AttackSpeedOnCrit); if (buffCount <= 0) { return; } int num = 0; TimedBuff[] array = (TimedBuff[])(object)new TimedBuff[buffCount]; float num2 = 0f; for (int i = 0; i < body.timedBuffs.Count; i++) { if (body.timedBuffs[i].buffIndex == Buffs.AttackSpeedOnCrit.buffIndex) { if (num2 < body.timedBuffs[i].timer) { num2 = body.timedBuffs[i].timer; } if (num < array.Length) { array[num] = body.timedBuffs[i]; num++; } } } for (int j = 0; j < array.Length; j++) { if (array[j] != null && array[j].timer < num2) { array[j].timer = num2; } } } } public class ShurikenBand : TweakBase { public bool playersOnly; public override string ConfigCategoryString => "Items"; public override string ConfigOptionName => "(Server-Side) Shuriken - No Band Proc"; public override string ConfigDescriptionString => "Shuriken doesn't trigger elemental bands."; protected override void ReadConfig(ConfigFile config) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown base.ReadConfig(config); playersOnly = config.Bind(ConfigCategoryString, ConfigOptionName + " - Only Affect Players", true, new ConfigDescription("Makes the Shuriken band tweak only affect players.", (AcceptableValueBase)null, Array.Empty())).Value; } protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown PrimarySkillShurikenBehavior.FireShuriken += new hook_FireShuriken(PrimarySkillShurikenBehavior_FireShuriken); } private void PrimarySkillShurikenBehavior_FireShuriken(orig_FireShuriken orig, PrimarySkillShurikenBehavior self) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = self.GetAimRay(); FireProjectileInfo val = default(FireProjectileInfo); val.projectilePrefab = self.projectilePrefab; val.position = ((Ray)(ref aimRay)).origin; val.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction) * self.GetRandomRollPitch(); val.owner = ((Component)self).gameObject; val.damage = ((ItemBehavior)self).body.damage * (3f + 1f * (float)((ItemBehavior)self).stack); val.force = 0f; val.crit = Util.CheckRoll(((ItemBehavior)self).body.crit, ((ItemBehavior)self).body.master); val.damageColorIndex = (DamageColorIndex)3; val.damageTypeOverride = null; ((FireProjectileInfo)(ref val)).speedOverride = -1f; val.procChainMask = default(ProcChainMask); FireProjectileInfo val2 = val; if (!playersOnly || (Object.op_Implicit((Object)(object)((ItemBehavior)self).body) && ((ItemBehavior)self).body.isPlayerControlled)) { ((ProcChainMask)(ref val2.procChainMask)).AddProc((ProcType)12); } ProjectileManager.instance.FireProjectile(val2); } } public class VisionsAttackSpeed : TweakBase { public override string ConfigCategoryString => "Items"; public override string ConfigOptionName => "(Client-Side) Visions of Heresy - Attack Speed Scaling"; public override string ConfigDescriptionString => "Visions of Heresy cooldown scales with Attack Speed."; protected override void ApplyChanges() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown if (Chainloader.PluginInfos.ContainsKey("com.Moffein.Heretic")) { Debug.LogWarning((object)"RiskyTweaks: Skipping Visions Attack Speed because Heretic is loaded."); return; } LunarPrimaryReplacementSkill val = Addressables.LoadAssetAsync((object)"RoR2/Base/LunarSkillReplacements/LunarPrimaryReplacement.asset").WaitForCompletion(); ((SkillDef)val).attackSpeedBuffsRestockSpeed = true; ((SkillDef)val).attackSpeedBuffsRestockSpeed_Multiplier = 1f; LunarPrimaryReplacementSkill.GetRechargeInterval += new hook_GetRechargeInterval(LunarPrimaryReplacementSkill_GetRechargeInterval); } private float LunarPrimaryReplacementSkill_GetRechargeInterval(orig_GetRechargeInterval orig, LunarPrimaryReplacementSkill self, GenericSkill skillSlot) { float num = orig.Invoke(self, skillSlot); if (((SkillDef)self).attackSpeedBuffsRestockSpeed && Object.op_Implicit((Object)(object)skillSlot)) { float num2 = skillSlot.characterBody.attackSpeed - skillSlot.characterBody.baseAttackSpeed; num2 *= ((SkillDef)self).attackSpeedBuffsRestockSpeed_Multiplier; num2 += 1f; if (num2 < 0.5f) { num2 = 0.5f; } num /= num2; } return num; } } } namespace RiskyTweaks.Tweaks.Items.Warbanner { public class SpawnInMorePlaces : TweakBase { public override string ConfigCategoryString => "Items"; public override string ConfigOptionName => "(Server-Side) Warbanner - Spawn In More Places"; public override string ConfigDescriptionString => "Warbanner spawns in Mithrix Phase 1 and Simulacrum."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown Phase1.OnEnter += new hook_OnEnter(Phase1_OnEnter); Active.OnEnter += new hook_OnEnter(Active_OnEnter); } private void Active_OnEnter(orig_OnEnter orig, Active self) { orig.Invoke(self); SpawnBanners(); } private void Phase1_OnEnter(orig_OnEnter orig, Phase1 self) { orig.Invoke(self); SpawnBanners(); } private void SpawnBanner(CharacterBody body) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Invalid comparison between Unknown and I4 //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)body.inventory) && Object.op_Implicit((Object)(object)body.teamComponent) && (int)body.teamComponent.teamIndex == 1) { int itemCount = body.inventory.GetItemCount(Items.WardOnLevel); if (itemCount > 0 && Object.op_Implicit((Object)(object)WardOnLevelManager.wardPrefab)) { GameObject val = Object.Instantiate(WardOnLevelManager.wardPrefab, body.transform.position, Quaternion.identity); val.GetComponent().teamIndex = (TeamIndex)1; val.GetComponent().Networkradius = 8f + 8f * (float)itemCount; NetworkServer.Spawn(val); } } } private void SpawnBanners() { ReadOnlyCollection teamMembers = TeamComponent.GetTeamMembers((TeamIndex)1); for (int i = 0; i < teamMembers.Count; i++) { TeamComponent val = teamMembers[i]; CharacterBody body = val.body; if (Object.op_Implicit((Object)(object)body)) { SpawnBanner(body); } } } } } namespace RiskyTweaks.Tweaks.Items.GhorsTome { public class DisableInBazaar : TweakBase { public override string ConfigCategoryString => "Items"; public override string ConfigOptionName => "(Server-Side) Ghors Tome - Disable in Bazaar"; public override string ConfigDescriptionString => "Disables this item in the Bazaar."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown GlobalEventManager.OnCharacterDeath += new Manipulator(GlobalEventManager_OnCharacterDeath); } private void GlobalEventManager_OnCharacterDeath(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Items), "BonusGoldPackOnKill") })) { val.EmitDelegate>((Func)((ItemDef origItem) => SneedUtils.IsInBazaar() ? null : origItem)); } else { Debug.LogError((object)"RiskyTweaks: GhorsTome DisableInBazaar IL Hook failed"); } } } public class SelfishGoldPacks : TweakBase { public override string ConfigCategoryString => "Items"; public override string ConfigOptionName => "(Server-Side) Ghors Tome - Selfish Gold Packs"; public override string ConfigDescriptionString => "Gold from this item is given to the person who picked it up, instead of distributing it among the team."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown MoneyPickup.OnTriggerStay += new hook_OnTriggerStay(MoneyPickup_OnTriggerStay); } private void MoneyPickup_OnTriggerStay(orig_OnTriggerStay orig, MoneyPickup self, Collider other) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) if (((Object)self.baseObject).name == "BonusMoneyPack(Clone)" && NetworkServer.active && self.alive) { TeamIndex objectTeam = TeamComponent.GetObjectTeam(((Component)other).gameObject); if (objectTeam == self.teamFilter.teamIndex) { bool flag = true; CharacterBody component = ((Component)other).gameObject.GetComponent(); if (!Object.op_Implicit((Object)(object)component) || !component.isPlayerControlled) { flag = false; } if (flag && Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.master)) { self.alive = false; Vector3 position = ((Component)self).transform.position; component.master.GiveMoney((uint)self.goldReward); if (Object.op_Implicit((Object)(object)self.pickupEffectPrefab)) { EffectManager.SimpleEffect(self.pickupEffectPrefab, position, Quaternion.identity, true); } Object.Destroy((Object)(object)self.baseObject); return; } } } orig.Invoke(self, other); } } } namespace RiskyTweaks.Tweaks.Items.FrostRelic { public class DisableFOV : TweakBase { public override string ConfigCategoryString => "Items"; public override string ConfigOptionName => "(Client-Side) Frost Relic - Disable FOV"; public override string ConfigDescriptionString => "Disables FOV modifier from this item."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown IcicleAuraController.OnIciclesActivated += new hook_OnIciclesActivated(IcicleAuraController_OnIciclesActivated); } private void IcicleAuraController_OnIciclesActivated(orig_OnIciclesActivated orig, IcicleAuraController self) { orig.Invoke(self); AimRequest aimRequest = self.aimRequest; if (aimRequest != null) { aimRequest.Dispose(); } } } public class RemoveBubble : TweakBase { public override string ConfigCategoryString => "Items"; public override string ConfigOptionName => "(Client-Side) Frost Relic - Remove Bubble"; public override string ConfigDescriptionString => "Removes bubble VFX from this item."; protected override void ApplyChanges() { if (Chainloader.PluginInfos.ContainsKey("com.Gorakh.ItemQualities")) { Debug.LogWarning((object)"RiskyTweaks: Skipping FrostRelic RemoveBubble because Quality is installed, to prevent incompats."); return; } GameObject val = LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/IcicleAura"); ParticleSystemRenderer[] componentsInChildren = val.GetComponentsInChildren(); ParticleSystemRenderer[] array = componentsInChildren; foreach (ParticleSystemRenderer val2 in array) { if (((Object)val2).name == "Area") { Object.Destroy((Object)(object)val2); } } } } } namespace RiskyTweaks.Tweaks.Interactables { public class BloodShrineMinReward : TweakBase { public override string ConfigCategoryString => "Interactables"; public override string ConfigOptionName => "(Server-Side) Blood Shrine Minimum Reward"; public override string ConfigDescriptionString => "Blood Shrines always reward enough money for at least 1 chest."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ShrineBloodBehavior.AddShrineStack += new Manipulator(ShrineBloodBehavior_AddShrineStack); } private void ShrineBloodBehavior_AddShrineStack(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 1) })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(uint cost, ShrineBloodBehavior self) { if (!Object.op_Implicit((Object)(object)Stage.instance) || !Object.op_Implicit((Object)(object)Run.instance)) { return cost; } int difficultyScaledCost = Run.instance.GetDifficultyScaledCost(25, Stage.instance.entryDifficultyCoefficient); float num = (float)self.purchaseInteraction.cost / 50f; int num2 = (int)((float)difficultyScaledCost * num); return (uint)Mathf.Max((int)cost, num2); }); } else { Debug.LogError((object)"RiskyTweaks: BloodShrineMinReward IL Hook failed"); } } } public class MountainShrineCostScale : TweakBase { public static int maxPerStage = -1; private static InteractableSpawnCard shrineBoss = Addressables.LoadAssetAsync((object)"RoR2/Base/ShrineBoss/iscShrineBoss.asset").WaitForCompletion(); private static InteractableSpawnCard shrineBossSandy = Addressables.LoadAssetAsync((object)"RoR2/Base/ShrineBoss/iscShrineBossSandy.asset").WaitForCompletion(); private static InteractableSpawnCard shrineBossSnowy = Addressables.LoadAssetAsync((object)"RoR2/Base/ShrineBoss/iscShrineBossSnowy.asset").WaitForCompletion(); private static int shrineBossCostInitial; public override string ConfigCategoryString => "Interactables"; public override string ConfigOptionName => "(Server-Side) Mountain Shrine Cost Scaling"; public override string ConfigDescriptionString => "Mountain Shrine director cost increases with playercount."; protected override void ReadConfig(ConfigFile config) { base.ReadConfig(config); maxPerStage = config.Bind(ConfigCategoryString, ConfigOptionName + " - Max Per Stage", -1, "Maximum that can spawn on 1 stage. Set to -1 for no limit.").Value; } protected override void ApplyChanges() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(GetInitialShrineCost)); SceneDirector.Start += new hook_Start(SceneDirector_Start); } private void SceneDirector_Start(orig_Start orig, SceneDirector self) { if (NetworkServer.active && Object.op_Implicit((Object)(object)Run.instance)) { int num = Mathf.Max(Run.instance.participatingPlayerCount, 1); float shrineBossCost = 1f + 0.5f * (float)(num - 1); SetShrineBossCost(shrineBossCost); } orig.Invoke(self); } private void GetInitialShrineCost() { shrineBossCostInitial = ((SpawnCard)shrineBoss).directorCreditCost; if (maxPerStage >= 0) { shrineBoss.maxSpawnsPerStage = maxPerStage; shrineBossSandy.maxSpawnsPerStage = maxPerStage; shrineBossSnowy.maxSpawnsPerStage = maxPerStage; } } private static void SetShrineBossCost(float costMultiplier) { ((SpawnCard)shrineBoss).directorCreditCost = Mathf.FloorToInt((float)shrineBossCostInitial * costMultiplier); ((SpawnCard)shrineBossSandy).directorCreditCost = Mathf.FloorToInt((float)shrineBossCostInitial * costMultiplier); ((SpawnCard)shrineBossSnowy).directorCreditCost = Mathf.FloorToInt((float)shrineBossCostInitial * costMultiplier); } } public class PrimordialTeleLoop : TweakBase { public class PrimordialTeleInitialState : MonoBehaviour { public void Start() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown if (ModCompat.RiskyArtifactsCompat.IsPrimacyActive()) { Object.Destroy((Object)(object)this); return; } if (NetworkServer.active && !isNaturalLunar) { EntityStateMachine component = ((Component)this).GetComponent(); component.SetNextState((EntityState)new Idle()); } Object.Destroy((Object)(object)this); } } private static InteractableSpawnCard teleCard = Addressables.LoadAssetAsync((object)"RoR2/Base/Teleporters/iscTeleporter.asset").WaitForCompletion(); private static InteractableSpawnCard primordialTeleCard = Addressables.LoadAssetAsync((object)"RoR2/Base/Teleporters/iscLunarTeleporter.asset").WaitForCompletion(); private static bool isNaturalLunar = false; private static bool firstIdleToActive = true; public override string ConfigCategoryString => "Interactables"; public override string ConfigOptionName => "(Server-Side) Primordial Teleporter After Loop"; public override string ConfigDescriptionString => "Replaces the Teleporter with the Primordial Teleporter after looping, like in RoR1."; protected override void ApplyChanges() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown LegacyResourcesAPI.Load("prefabs/networkedobjects/teleporters/LunarTeleporterProngs").AddComponent(); SceneDirector.PlaceTeleporter += new Manipulator(SceneDirector_PlaceTeleporter); Stage.Start += new hook_Start(Stage_Start); IdleToActive.OnExit += new hook_OnExit(IdleToActive_OnExit); } private void IdleToActive_OnExit(orig_OnExit orig, IdleToActive self) { if (ModCompat.RiskyArtifactsCompat.IsPrimacyActive()) { orig.Invoke(self); } else if (!firstIdleToActive || isNaturalLunar) { firstIdleToActive = false; orig.Invoke(self); } else { firstIdleToActive = false; } } private IEnumerator Stage_Start(orig_Start orig, Stage self) { firstIdleToActive = true; return orig.Invoke(self); } private void SceneDirector_PlaceTeleporter(ILContext il) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown bool flag = true; ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "teleporterSpawnCard") }) && val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "teleporterSpawnCard") })) { int index = val.Index; val.Index = index + 1; val.EmitDelegate>((Func)delegate(SpawnCard origTeleporter) { if (ModCompat.RiskyArtifactsCompat.IsPrimacyActive()) { return origTeleporter; } bool flag2 = (Object)(object)origTeleporter == (Object)(object)teleCard; isNaturalLunar = !flag2; if (Run.instance.stageClearCount >= 5 && flag2) { origTeleporter = (SpawnCard)(object)primordialTeleCard; } return origTeleporter; }); flag = false; } if (flag) { Debug.LogError((object)"RiskyTweaks: PrimordialTeleLoop IL hook failed."); } } } public class ShrineCombatItems : TweakBase { public static int maxPerStage = 3; public static float whiteChance = 100f; public static float greenChance = 0f; public static float redChance = 0f; private static Vector3 rewardPositionOffset = new Vector3(0f, 6f, 0f); private static InteractableSpawnCard shrineCombat = Addressables.LoadAssetAsync((object)"RoR2/Base/ShrineCombat/iscShrineCombat.asset").WaitForCompletion(); private static InteractableSpawnCard shrineCombatSandy = Addressables.LoadAssetAsync((object)"RoR2/Base/ShrineCombat/iscShrineCombatSandy.asset").WaitForCompletion(); private static InteractableSpawnCard shrineCombatSnowy = Addressables.LoadAssetAsync((object)"RoR2/Base/ShrineCombat/iscShrineCombatSnowy.asset").WaitForCompletion(); private static int shrineCombatCostInitial; public override string ConfigCategoryString => "Interactables - Shrine of Combat Items"; public override string ConfigOptionName => "(Server-Side) Shrine of Combat Items"; public override string ConfigDescriptionString => "Shrine of Combat gives less money, but drops items for the team on completion."; protected override void ReadConfig(ConfigFile config) { base.ReadConfig(config); maxPerStage = config.Bind(ConfigCategoryString, ConfigOptionName + " - Max Per Stage", 3, "Maximum that can spawn on 1 stage. Set to -1 for no limit.").Value; whiteChance = config.Bind(ConfigCategoryString, ConfigOptionName + " - Tier1 Chance", 100f, "Chance to drop white items.").Value; greenChance = config.Bind(ConfigCategoryString, ConfigOptionName + " - Tier2 Chance", 0f, "Chance to drop green items.").Value; redChance = config.Bind(ConfigCategoryString, ConfigOptionName + " - Tier3 Chance", 0f, "Chance to drop red items.").Value; } protected override void ApplyChanges() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(GetInitialShrineCost)); SceneDirector.Start += new hook_Start(SceneDirector_Start); ShrineCombatBehavior.Awake += new hook_Awake(ShrineCombatBehavior_Awake); ShrineCombatBehavior.OnDefeatedServer += new hook_OnDefeatedServer(ShrineCombatBehavior_OnDefeatedServer); } private void ShrineCombatBehavior_OnDefeatedServer(orig_OnDefeatedServer orig, ShrineCombatBehavior self) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Invalid comparison between Unknown and I4 //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Invalid comparison between Unknown and I4 //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Expected O, but got Unknown //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (!NetworkServer.active) { return; } ItemTier val = (ItemTier)5; PickupIndex val2 = SelectItem(); PickupDef pickupDef = PickupCatalog.GetPickupDef(val2); if (!(val2 != PickupIndex.none)) { return; } int participatingPlayerCount = Run.instance.participatingPlayerCount; if (participatingPlayerCount == 0 || !Object.op_Implicit((Object)(object)((Component)self).transform)) { return; } int num = participatingPlayerCount; val = pickupDef.itemTier; ItemTier val3 = val; ItemTier val4 = val3; PickupDropTable val5; if ((int)val4 != 1) { if ((int)val4 == 2) { val5 = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/dtTier3Item.asset").WaitForCompletion(); if (ModCompat.ShareSuiteCompat.ItemSettings.legendary) { num = 1; } } else { val5 = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/dtTier1Item.asset").WaitForCompletion(); if (ModCompat.ShareSuiteCompat.ItemSettings.common) { num = 1; } } } else { val5 = Addressables.LoadAssetAsync((object)"RoR2/Base/Common/dtTier2Item.asset").WaitForCompletion(); if (ModCompat.ShareSuiteCompat.ItemSettings.uncommon) { num = 1; } } float num2 = 360f / (float)num; Vector3 val6 = Quaternion.AngleAxis((float)Random.Range(0, 360), Vector3.up) * (Vector3.up * 40f + Vector3.forward * 5f); Quaternion val7 = Quaternion.AngleAxis(num2, Vector3.up); Option[] array = PickupPickerController.GenerateOptionsFromDropTable(3, val5, Run.instance.bossRewardRng); if (array.Length != 0 && ((Option)(ref array[0])).pickupIndex != PickupIndex.none) { pickupDef = PickupCatalog.GetPickupDef(((Option)(ref array[0])).pickupIndex); val2 = pickupDef.pickupIndex; } int num3 = 0; while (num3 < num) { if (!ModCompat.ArtifactOfPotentialCompat.IsArtifactActive()) { PickupDropletController.CreatePickupDroplet(pickupDef.pickupIndex, ((Component)self).transform.position + rewardPositionOffset, val6); } else { CreatePickupInfo val8 = default(CreatePickupInfo); val8.pickerOptions = array; val8.prefabOverride = Addressables.LoadAssetAsync((object)"RoR2/DLC1/OptionPickup/OptionPickup.prefab").WaitForCompletion(); val8.rotation = Quaternion.identity; ((CreatePickupInfo)(ref val8)).pickupIndex = PickupCatalog.FindPickupIndex(val); PickupDropletController.CreatePickupDroplet(val8, ((Component)self).transform.position + rewardPositionOffset, val6); } num3++; val6 = val7 * val6; } SimpleChatMessage val9 = new SimpleChatMessage(); val9.baseToken = "SHRINE_COMBAT_END_TRIAL_RISKYMOD"; val9.paramTokens = new string[1] { "" + Language.GetStringFormatted(pickupDef.nameToken, Array.Empty()) + "" }; Chat.SendBroadcastChat((ChatMessageBase)(object)val9); } private void ShrineCombatBehavior_Awake(orig_Awake orig, ShrineCombatBehavior self) { orig.Invoke(self); if (Object.op_Implicit((Object)(object)self.combatDirector)) { if (self.combatDirector.expRewardCoefficient == 0.2f) { self.combatDirector.expRewardCoefficient = 0.067f; } else if (self.combatDirector.expRewardCoefficient == 0.067f) { self.combatDirector.expRewardCoefficient = 0.199f; } } } private void SceneDirector_Start(orig_Start orig, SceneDirector self) { if (NetworkServer.active && Object.op_Implicit((Object)(object)Run.instance)) { int num = Mathf.Max(Run.instance.participatingPlayerCount, 1); float shrineCombatCost = 1f + 0.5f * (float)(num - 1); SetShrineCombatCost(shrineCombatCost); } orig.Invoke(self); } private void GetInitialShrineCost() { shrineCombatCostInitial = ((SpawnCard)shrineCombat).directorCreditCost; if (maxPerStage >= 0) { shrineCombat.maxSpawnsPerStage = maxPerStage; shrineCombatSandy.maxSpawnsPerStage = maxPerStage; shrineCombatSnowy.maxSpawnsPerStage = maxPerStage; } } private static void SetShrineCombatCost(float costMultiplier) { ((SpawnCard)shrineCombat).directorCreditCost = Mathf.FloorToInt((float)shrineCombatCostInitial * costMultiplier); ((SpawnCard)shrineCombatSandy).directorCreditCost = Mathf.FloorToInt((float)shrineCombatCostInitial * costMultiplier); ((SpawnCard)shrineCombatSnowy).directorCreditCost = Mathf.FloorToInt((float)shrineCombatCostInitial * costMultiplier); } private static PickupIndex SelectItem() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) Xoroshiro128Plus treasureRng = Run.instance.treasureRng; PickupIndex result = PickupIndex.none; float num = whiteChance + greenChance + redChance; List list; if (treasureRng.RangeFloat(0f, num) <= whiteChance) { list = Run.instance.availableTier1DropList; } else { num -= whiteChance; if (treasureRng.RangeFloat(0f, num) <= greenChance) { list = Run.instance.availableTier2DropList; } else { num -= greenChance; list = Run.instance.availableTier3DropList; } } if (list.Count > 0) { result = treasureRng.NextElementUniform(list); } return result; } } } namespace RiskyTweaks.Tweaks.General { public class CloakBuff : TweakBase { public override string ConfigCategoryString => "General"; public override string ConfigOptionName => "(Server-Side) Cloak Buff"; public override string ConfigDescriptionString => "Increases Cloak position update delay from 2s to 3s."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown Target.GetBullseyePosition += new Manipulator(Target_GetBullseyePosition); } private void Target_GetBullseyePosition(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 2f) })) { val.Next.Operand = 3f; } else { Debug.LogError((object)"RiskyTweaks: CloakBuff IL Hook failed"); } } } public class FasterStandStillEffects : TweakBase { public override string ConfigCategoryString => "General"; public override string ConfigOptionName => "(Server-Side) Faster Stand-Still Effects"; public override string ConfigDescriptionString => "Lowers the duration required to trigger On-Standing-Still effects."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown CharacterBody.GetNotMoving += new Manipulator(CharacterBody_GetNotMoving); } private void CharacterBody_GetNotMoving(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1f) })) { val.Next.Operand = 0.5f; } else { Debug.LogError((object)"RiskyTweaks: FasterStandStillEffects IL Hook failed"); } } } public class ShockBuff : TweakBase { public override string ConfigCategoryString => "General"; public override string ConfigOptionName => "(Server-Side) Shock Buff"; public override string ConfigDescriptionString => "Removes Shock HP threshold."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { SneedUtils.SetAddressableEntityStateField("RoR2/Base/Common/EntityStates.ShockState.asset", "healthFractionToForceExit", "1"); } } } namespace RiskyTweaks.Tweaks.Equipment { public class BFGTendrils : TweakBase { public override string ConfigCategoryString => "Equipment"; public override string ConfigOptionName => "(Server-Side) Preon Accumulator - Band QoL"; public override string ConfigDescriptionString => "Preon Accumulator tendrils deal slightly less damage so they don't proc bands."; protected override void ApplyChanges() { GameObject val = LegacyResourcesAPI.Load("prefabs/projectiles/BeamSphere"); ProjectileProximityBeamController component = val.GetComponent(); component.damageCoefficient = 1.9f; } } public class CaffeinatorPressurePlate : TweakBase { public override string ConfigCategoryString => "Equipment"; public override string ConfigOptionName => "(Server-Side) Remote Caffeinator - Trigger Pressure Plates"; public override string ConfigDescriptionString => "Rermote Caffeinator can trigger pressure plates on Abandoned Aqueduct."; protected override void ApplyChanges() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync((object)"RoR2/DLC1/VendingMachine/VendingMachine.prefab").WaitForCompletion(); CapsuleCollider val2 = val.AddComponent(); val.layer = LayerIndex.fakeActor.intVal; } } } namespace RiskyTweaks.Tweaks.Enemies { public class AllowFallDeath : TweakBase { public override string ConfigCategoryString => "Enemies"; public override string ConfigOptionName => "(Server-Side) Lethal Fall Damage"; public override string ConfigDescriptionString => "Allows monsters to die from fall damage and increases fall damage taken."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(HealthComponent_TakeDamageProcess); } private void HealthComponent_TakeDamageProcess(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Invalid comparison between Unknown and I4 //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) if (!self.body.isPlayerControlled && (!Object.op_Implicit((Object)(object)self.body.teamComponent) || (int)self.body.teamComponent.teamIndex != 1) && DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)2097152) & DamageTypeCombo.op_Implicit((DamageType)1)) != 0) { damageInfo.damageType &= DamageTypeCombo.op_Implicit((DamageType)(-2)); damageInfo.damageType |= DamageTypeCombo.op_Implicit((DamageType)262144); damageInfo.damage *= 1.5f; } orig.Invoke(self, damageInfo); } } public class DisableRegen : TweakBase { public override string ConfigCategoryString => "Enemies"; public override string ConfigOptionName => "(Server-Side) Disable Regen"; public override string ConfigDescriptionString => "Removes passive health regen from the few enemies that have it."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { string[] array = new string[4] { "RoR2/Base/LunarGolem/LunarGolemBody.prefab", "RoR2/Base/Imp/ImpBody.prefab", "RoR2/Base/MiniMushroom/MiniMushroomBody.prefab", "RoR2/Base/HermitCrab/HermitCrabBody.prefab" }; string[] array2 = array; foreach (string addressablePath in array2) { RemoveRegen(addressablePath); } } private void RemoveRegen(string addressablePath) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync((object)addressablePath).WaitForCompletion(); if (Object.op_Implicit((Object)(object)val)) { CharacterBody component = val.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.baseRegen = 0f; component.levelRegen = 0f; } } } } public class FullVision : TweakBase { public override string ConfigCategoryString => "Enemies"; public override string ConfigOptionName => "(Server-Side) AI Full Vision"; public override string ConfigDescriptionString => "Enemies are always aware of player locations."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown BaseAI.ManagedFixedUpdate += new Manipulator(BaseAI_ManagedFixedUpdate); } private void BaseAI_ManagedFixedUpdate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(BaseAI), "fullVision") })) { val.EmitDelegate>((Func)((bool useFullVision) => true)); } else { Debug.LogError((object)"RiskyTweaks: FullVision IL Hook failed."); } } } public class NoBossRepeat : TweakBase { private const int maxStages = 2; private List previousCards = new List(); public override string ConfigCategoryString => "Enemies"; public override string ConfigOptionName => "(Server-Side) No Boss Repeat"; public override string ConfigDescriptionString => "Reduces the chance of getting the same teleporter boss multiple stages in a row."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown Run.onRunStartGlobal += Run_onRunStartGlobal; CombatDirector.SetNextSpawnAsBoss += new Manipulator(CombatDirector_SetNextSpawnAsBoss); } private void CombatDirector_SetNextSpawnAsBoss(ILContext il) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown //IL_003f: Unknown result type (might be due to invalid IL or missing references) bool flag2 = true; ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "IsAvailable") })) { val.Emit(OpCodes.Ldloc_3); val.EmitDelegate, bool>>((Func, bool>)((bool flag, ChoiceInfo choice) => (!flag || choice.value == null || !((Object)(object)choice.value.spawnCard != (Object)null) || !previousCards.Contains(choice.value.spawnCard.prefab)) && flag)); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCall(x, "PrepareNewMonsterWave") })) { val.EmitDelegate>((Func)delegate(DirectorCard card) { if (card != null && (Object)(object)card.spawnCard != (Object)null) { if (previousCards.Count > 0 && previousCards.Count + 1 > 2) { previousCards.RemoveAt(0); } previousCards.Add(card.spawnCard.prefab); } return card; }); flag2 = false; } } if (flag2) { Debug.LogError((object)"RiskyTweaks: NoBossRepeat IL Hook failed"); } } private void Run_onRunStartGlobal(Run obj) { previousCards.Clear(); } } public class NoLevelupHeal : TweakBase { public override string ConfigCategoryString => "Enemies"; public override string ConfigOptionName => "(Server-Side) No Levelup Heal"; public override string ConfigDescriptionString => "Enemies dont regain HP on levelup."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats); } private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Invalid comparison between Unknown and I4 float level = self.level; float health = self.healthComponent.health; float shield = self.healthComponent.shield; orig.Invoke(self); if (self.level > level && (int)self.teamComponent.teamIndex != 1 && self.healthComponent.combinedHealthFraction < 1f) { if (self.healthComponent.health > health) { self.healthComponent.health = health; } if (self.healthComponent.shield > shield) { self.healthComponent.shield = shield; } } } } public class RaiseLevelCap : TweakBase { public static float levelCap = 9999f; public static float stopSound = 300f; public override string ConfigCategoryString => "Enemies"; public override string ConfigOptionName => "(Server-Side) Raise Level Cap"; public override string ConfigDescriptionString => "Raise monster level cap. WARNING: Healthbars may look buggy for clients without the mod once scaling goes past 99!"; public override bool StopLoadOnConfigDisable => true; protected override void ReadConfig(ConfigFile config) { base.ReadConfig(config); levelCap = config.Bind(ConfigCategoryString, ConfigOptionName + " - Max Level", 9999f, "Maximum level if Raise Level Cap is enabled.").Value; } protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown Run.RecalculateDifficultyCoefficentInternal += new Manipulator(Run_RecalculateDifficultyCoefficentInternal); LevelUpEffectManager.OnRunAmbientLevelUp += new hook_OnRunAmbientLevelUp(LevelUpEffectManager_OnRunAmbientLevelUp); LevelUpEffectManager.OnTeamLevelUp += new hook_OnTeamLevelUp(LevelUpEffectManager_OnTeamLevelUp); } private void LevelUpEffectManager_OnTeamLevelUp(orig_OnTeamLevelUp orig, TeamIndex teamIndex) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) if ((int)teamIndex == 1 || !Object.op_Implicit((Object)(object)TeamManager.instance) || !((float)TeamManager.instance.teamLevels[teamIndex] > stopSound)) { orig.Invoke(teamIndex); } } private void LevelUpEffectManager_OnRunAmbientLevelUp(orig_OnRunAmbientLevelUp orig, Run run) { if (run.ambientLevel <= stopSound) { orig.Invoke(run); } } private void Run_RecalculateDifficultyCoefficentInternal(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "ambientLevelCap") })) { val.Remove(); val.Emit(OpCodes.Ldsfld, "levelCap"); } else { Debug.LogError((object)"RiskyTweaks: RaiseLevelCap IL Hook failed"); } } } public class SceneDirectorRewards : TweakBase { public override string ConfigCategoryString => "Enemies"; public override string ConfigOptionName => "(Server-Side) Scenedirector Monster Rewards"; public override string ConfigDescriptionString => "Monsters that spawn on stage start give the same amount of money as Teleporter monsters."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown SceneDirector.PopulateScene += new hook_PopulateScene(SceneDirector_PopulateScene); } private void SceneDirector_PopulateScene(orig_PopulateScene orig, SceneDirector self) { if (Object.op_Implicit((Object)(object)self) && self.expRewardCoefficient < 0.11f) { self.expRewardCoefficient = 0.11f; } orig.Invoke(self); } } } namespace RiskyTweaks.Tweaks.Enemies.Scorchling { public class RemoveIframes : TweakBase { public override string ConfigCategoryString => "Enemies - Scorch Wurm"; public override string ConfigOptionName => "(Server-Side) Remove Invulnerability Frames"; public override string ConfigDescriptionString => "Removes invulnerability when burrowing."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown ScorchlingController.Burrow += new Manipulator(CommonHooks.DisableAddBuffGeneric); ScorchlingController.Breach += new Manipulator(CommonHooks.DisableRemoveBuffGeneric); } } } namespace RiskyTweaks.Tweaks.Enemies.Parent { public class DirectorCost : TweakBase { public override string ConfigCategoryString => "Enemies - Parent"; public override string ConfigOptionName => "(Server-Side) Lower Director Cost"; public override string ConfigDescriptionString => "Lowers director cost to be in-line with the nerfed HP from the Anniversary update."; protected override void ApplyChanges() { CharacterSpawnCard val = LegacyResourcesAPI.Load("spawncards/characterspawncards/cscparent"); ((SpawnCard)val).directorCreditCost = 75; } } } namespace RiskyTweaks.Tweaks.Enemies.MajorConstruct { public class AIRework : TweakBase { public override string ConfigCategoryString => "Enemies - Xi Construct"; public override string ConfigOptionName => "(Server-Side) AI Rework"; public override string ConfigDescriptionString => "Makes the boss stay closer to players when fighting."; protected override void ApplyChanges() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) AISkillDriver val = (from x in Addressables.LoadAssetAsync((object)"RoR2/DLC1/MajorAndMinorConstruct/MegaConstructMaster.prefab").WaitForCompletion().GetComponents() where x.customName == "FleeStep" select x).First(); AISkillDriver val2 = (from x in Addressables.LoadAssetAsync((object)"RoR2/DLC1/MajorAndMinorConstruct/MegaConstructMaster.prefab").WaitForCompletion().GetComponents() where x.customName == "FollowStep" select x).First(); AISkillDriver val3 = (from x in Addressables.LoadAssetAsync((object)"RoR2/DLC1/MajorAndMinorConstruct/MegaConstructMaster.prefab").WaitForCompletion().GetComponents() where x.customName == "FollowFast" select x).First(); AISkillDriver val4 = (from x in Addressables.LoadAssetAsync((object)"RoR2/DLC1/MajorAndMinorConstruct/MegaConstructMaster.prefab").WaitForCompletion().GetComponents() where x.customName == "ShootStep" select x).First(); val2.minDistance = 30f; val3.minDistance = 75f; } } } namespace RiskyTweaks.Tweaks.Enemies.LunarWisp { public class AllowStun : TweakBase { public override string ConfigCategoryString => "Enemies - Lunar Wisp"; public override string ConfigOptionName => "(Server-Side) Allow Stun and Freeze"; public override string ConfigDescriptionString => "Allows this monster to be affected by stun and freeze."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) GameObject val = LegacyResourcesAPI.Load("prefabs/characterbodies/lunarwispbody"); SetStateOnHurt val2 = val.GetComponent(); if (!Object.op_Implicit((Object)(object)val2)) { val2 = val.AddComponent(); } val2.hitThreshold = 0.5f; val2.canBeHitStunned = true; val2.canBeStunned = true; val2.canBeFrozen = true; EntityStateMachine targetStateMachine = null; EntityStateMachine val3 = null; EntityStateMachine[] components = val.GetComponents(); EntityStateMachine[] array = components; foreach (EntityStateMachine val4 in array) { string customName = val4.customName; string text = customName; if (!(text == "Body")) { if (text == "Weapon") { val3 = val4; } } else { targetStateMachine = val4; } } val2.targetStateMachine = targetStateMachine; val2.idleStateMachine = (EntityStateMachine[])(object)new EntityStateMachine[1] { val3 }; val2.hurtState = new SerializableEntityStateType(typeof(HurtStateFlyer)); } } public class HitscanFalloff : TweakBase { public override string ConfigCategoryString => "Enemies - Lunar Wisp"; public override string ConfigOptionName => "(Server-Side) Bullet Falloff"; public override string ConfigDescriptionString => "Hitscan attacks have falloff."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown FireLunarGuns.OnFireAuthority += new Manipulator(FireLunarGuns_OnFireAuthority); } private void FireLunarGuns_OnFireAuthority(ILContext il) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown bool flag = true; ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "Fire") })) { val.EmitDelegate>((Func)delegate(BulletAttack bulletAttack) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) bulletAttack.falloffModel = (FalloffModel)1; return bulletAttack; }); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "Fire") })) { val.EmitDelegate>((Func)delegate(BulletAttack bulletAttack) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) bulletAttack.falloffModel = (FalloffModel)1; return bulletAttack; }); flag = false; } } if (flag) { Debug.LogError((object)"RiskyTweaks: LunarWisp HitscanFalloff IL Hook failed"); } } } public class IncreaseDirectorCost : TweakBase { public override string ConfigCategoryString => "Enemies - Lunar Wisp"; public override string ConfigOptionName => "(Server-Side) Increase Director Cost"; public override string ConfigDescriptionString => "Increases director cost to be more in-line with other flying enemies."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) CharacterSpawnCard val = Addressables.LoadAssetAsync((object)"RoR2/Base/LunarWisp/cscLunarWisp.asset").WaitForCompletion(); ((SpawnCard)val).directorCreditCost = 700; } } } namespace RiskyTweaks.Tweaks.Enemies.Halcyonite { public class AllowVoidDeath : TweakBase { public override string ConfigCategoryString => "Enemies - Halcyonite"; public override string ConfigOptionName => "(Server-Side) Remove Void Immunity"; public override string ConfigDescriptionString => "Allow this enemy to die to Void Implosions."; protected override void ApplyChanges() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = Addressables.LoadAssetAsync((object)"RoR2/DLC2/Halcyonite/HalcyoniteBody.prefab").WaitForCompletion().GetComponent(); component.bodyFlags = (BodyFlags)(component.bodyFlags & -2049); } } public class FullStun : TweakBase { public override string ConfigCategoryString => "Enemies - Halcyonite"; public override string ConfigOptionName => "(Server-Side) Allow Attack Interrupt"; public override string ConfigDescriptionString => "Removes stun and freeze immunity from certain states."; protected override void ApplyChanges() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync((object)"RoR2/DLC2/Halcyonite/HalcyoniteBody.prefab").WaitForCompletion(); EntityStateMachine[] components = val.GetComponents(); SetStateOnHurt ssoh = val.GetComponent(); ssoh.idleStateMachine = components.Where((EntityStateMachine esm) => (Object)(object)esm != (Object)(object)ssoh.targetStateMachine).ToArray(); } } public class ShrineStatBoostLevel : TweakBase { public override string ConfigCategoryString => "Enemies - Halcyonite"; public override string ConfigOptionName => "(Server-Side) Shrine Stat Boost Cap"; public override string ConfigDescriptionString => "Caps shrine stat boosts at +20 (12x damage, 4x hp)."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown CombatDirector.HalcyoniteShrineActivation += new hook_HalcyoniteShrineActivation(CombatDirector_HalcyoniteShrineActivation); } private void CombatDirector_HalcyoniteShrineActivation(orig_HalcyoniteShrineActivation orig, CombatDirector self, float monsterCredit, DirectorCard chosenDirectorCard, int difficultyLevel, Transform shrineTransform) { orig.Invoke(self, monsterCredit, chosenDirectorCard, Mathf.Min(20, difficultyLevel), shrineTransform); } } } namespace RiskyTweaks.Tweaks.Enemies.Grandparent { public class ImmediatelyClearBurn : TweakBase { public override string ConfigCategoryString => "Enemies - Grandparent"; public override string ConfigOptionName => "(Server-Side) Immediately Clear Sun Afterburn"; public override string ConfigDescriptionString => "Sun afterburn is immediately cleared when breaking LoS."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown CharacterBody.UpdateBuffs += new hook_UpdateBuffs(CharacterBody_UpdateBuffs); } private void CharacterBody_UpdateBuffs(orig_UpdateBuffs orig, CharacterBody self, float deltaTime) { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Invalid comparison between Unknown and I4 bool flag = self.HasBuff(Buffs.Overheat); orig.Invoke(self, deltaTime); if (!(NetworkServer.active && flag) || self.HasBuff(Buffs.Overheat)) { return; } DotController val = DotController.FindDotController(((Component)self).gameObject); if (!Object.op_Implicit((Object)(object)val)) { return; } for (int num = val.dotStackList.Count - 1; num >= 0; num--) { DotStack val2 = val.dotStackList[num]; if ((int)val2.dotIndex == 1) { val2.damage = 0f; val2.timer = 0f; val.RemoveDotStackAtServer(num); } } } } } namespace RiskyTweaks.Tweaks.Enemies.Golem { public class ConsistentClap : TweakBase { public override string ConfigCategoryString => "Enemies - Golem"; public override string ConfigOptionName => "(Server-Side) Consistent Clap Damage"; public override string ConfigDescriptionString => "Golem Clap always does 30 damage, insstead of scaling between 0-40 based on AoE range."; protected override void ApplyChanges() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown SneedUtils.SetAddressableEntityStateField("RoR2/Base/Golem/EntityStates.GolemMonster.ClapState.asset", "damageCoefficient", "1.5"); ClapState.FixedUpdate += new Manipulator(ClapState_FixedUpdate); } private void ClapState_FixedUpdate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "Fire") })) { val.EmitDelegate>((Func)delegate(BlastAttack blastAttack) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) blastAttack.falloffModel = (FalloffModel)0; return blastAttack; }); } else { Debug.LogError((object)"RiskyTweaks: Golem ConsistentClap IL Hook failed"); } } } } namespace RiskyTweaks.Tweaks.Enemies.FalseSonBoss { public class RemoveIFrames : TweakBase { public override string ConfigCategoryString => "Enemies - False Son"; public override string ConfigOptionName => "(Server-Side) Remove Invulnerability Frames"; public override string ConfigDescriptionString => "Removes invulnerability from Corrupted Paths."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown CorruptedPathsDash.OnEnter += new Manipulator(CommonHooks.DisableAddBuffGeneric); CorruptedPathsDash.OnExit += new Manipulator(CommonHooks.DisableRemoveBuffGeneric); } } } namespace RiskyTweaks.Tweaks.Enemies.DLC3 { public class MinePodNoSelfDamage : TweakBase { private class StoreKillerTeam : MonoBehaviour { public TeamIndex teamIndex = (TeamIndex)(-1); } public override string ConfigCategoryString => "Enemies - DLC3"; public override string ConfigOptionName => "Solus Mines inherit killer team."; public override string ConfigDescriptionString => "Solus Mines inherit killer team to prevent self damage."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) EarlyDetonate.GetTeamIndex += new hook_GetTeamIndex(EarlyDetonate_GetTeamIndex); GlobalEventManager.OnCharacterDeath += new hook_OnCharacterDeath(GlobalEventManager_OnCharacterDeath); Addressables.LoadAssetAsync((object)"RoR2/DLC3/SolusMine/SolusMineBody.prefab").WaitForCompletion().AddComponent(); } private TeamIndex EarlyDetonate_GetTeamIndex(orig_GetTeamIndex orig, EarlyDetonate self) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Invalid comparison between Unknown and I4 //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) StoreKillerTeam component = ((EntityState)self).gameObject.GetComponent(); if (Object.op_Implicit((Object)(object)component) && (int)component.teamIndex != -1) { return component.teamIndex; } return orig.Invoke(self); } private void GlobalEventManager_OnCharacterDeath(orig_OnCharacterDeath orig, GlobalEventManager self, DamageReport damageReport) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Invalid comparison between Unknown and I4 //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) if (damageReport.victimBodyIndex == BodyPrefabs.SolusMineBody.bodyIndex && Object.op_Implicit((Object)(object)damageReport.victim) && (int)damageReport.attackerTeamIndex != -1) { StoreKillerTeam component = ((Component)damageReport.victim).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.teamIndex = damageReport.attackerTeamIndex; } } orig.Invoke(self, damageReport); } } public class SolusArmor : TweakBase { public override string ConfigCategoryString => "Enemies - DLC3"; public override string ConfigOptionName => "Remove armor from Solus Scorchers."; public override string ConfigDescriptionString => "Removes armor from Solus Scorchers."; protected override void ApplyChanges() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) Addressables.LoadAssetAsync((object)"RoR2/DLC3/Tanker/TankerBody.prefab").WaitForCompletion().GetComponent() .baseArmor = 0f; } } public class SolusSpawnrates : TweakBase { public override string ConfigCategoryString => "Enenemies - DLC3"; public override string ConfigOptionName => "Fix spawncosts."; public override string ConfigDescriptionString => "Fix spawncosts for most DLC3 enemies being set too low."; protected override void ApplyChanges() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) SetSpawnCost(Addressables.LoadAssetAsync((object)"RoR2/DLC3/WorkerUnit/cscWorkerUnit.asset").WaitForCompletion(), 16); SetSpawnCost(Addressables.LoadAssetAsync((object)"RoR2/DLC3/Tanker/cscTanker.asset").WaitForCompletion(), 35); SetSpawnCost(Addressables.LoadAssetAsync((object)"RoR2/DLC3/MinePod/cscMinePod.asset").WaitForCompletion(), 52); SetSpawnCost(Addressables.LoadAssetAsync((object)"RoR2/DLC3/DefectiveUnit/cscDefectiveUnit.asset").WaitForCompletion(), 54); } private void SetSpawnCost(CharacterSpawnCard csc, int cost) { if (((SpawnCard)csc).directorCreditCost < cost) { ((SpawnCard)csc).directorCreditCost = cost; } } } } namespace RiskyTweaks.Tweaks.Enemies.Child { public class RemoveIFrames : TweakBase { public override string ConfigCategoryString => "Enemies - Child"; public override string ConfigOptionName => "(Server-Side) Remove Invulnerability Frames"; public override string ConfigDescriptionString => "Removes invulnerability when teleporting."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ChildMonsterController.RegisterTeleport += new hook_RegisterTeleport(ChildMonsterController_RegisterTeleport); } private void ChildMonsterController_RegisterTeleport(orig_RegisterTeleport orig, ChildMonsterController self, bool addInvincibility) { orig.Invoke(self, false); } } } namespace RiskyTweaks.Tweaks.Enemies.Brother { public class NoFallDamage : TweakBase { public override string ConfigCategoryString => "Enemies - Mithrix"; public override string ConfigOptionName => "(Server-Side) No Fall Damage"; public override string ConfigDescriptionString => "Prevents Mithrix from killing himself with fall damage."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) GameObject val = Addressables.LoadAssetAsync((object)"RoR2/Base/Brother/BrotherBody.prefab").WaitForCompletion(); CharacterBody component = val.GetComponent(); component.bodyFlags = (BodyFlags)(component.bodyFlags | 1); GameObject val2 = Addressables.LoadAssetAsync((object)"RoR2/Base/Brother/BrotherHurtBody.prefab").WaitForCompletion(); CharacterBody component2 = val2.GetComponent(); component2.bodyFlags = (BodyFlags)(component2.bodyFlags | 1); } } public class Phase4GuaranteedItem : TweakBase { private BodyIndex brotherHurtIndex; public override string ConfigCategoryString => "Enemies - Mithrix"; public override string ConfigOptionName => "(Server-Side) Phase 4 Guaranteed Item Return"; public override string ConfigDescriptionString => "Hitting Mithrix is guaranteed to return an item, on a timed cooldown."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(OnLoad)); GameObject val = Addressables.LoadAssetAsync((object)"RoR2/Base/Brother/BrotherHurtBody.prefab").WaitForCompletion(); val.AddComponent(); HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage); } private void OnLoad() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) brotherHurtIndex = BodyCatalog.FindBodyIndex("BrotherHurtBody"); } private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, damageInfo); if (!NetworkServer.active || damageInfo.rejected || !Object.op_Implicit((Object)(object)damageInfo.attacker) || self.body.bodyIndex != brotherHurtIndex) { return; } GuaranteedItemReturnComponent component = ((Component)self).GetComponent(); if (!Object.op_Implicit((Object)(object)component) || !component.ShouldGuaranteedSteal(damageInfo.attacker)) { return; } CharacterBody component2 = damageInfo.attacker.GetComponent(); if (Object.op_Implicit((Object)(object)component2) && Object.op_Implicit((Object)(object)component2.inventory)) { ReturnStolenItemsOnGettingHit component3 = ((Component)self).GetComponent(); if (Object.op_Implicit((Object)(object)component3) && Object.op_Implicit((Object)(object)component3.itemStealController) && component3.itemStealController.ReclaimItemForInventory(component2.inventory, int.MaxValue)) { Debug.Log((object)("Phase4Tweaks: Guaranteed item return for " + (object)component2)); component.SetStealItemCooldown(damageInfo.attacker); } } } } public class GuaranteedItemReturnComponent : MonoBehaviour { private class AttackerCooldown { public GameObject attacker; private float cooldown; public AttackerCooldown(GameObject attacker, float cooldown) { this.attacker = attacker; this.cooldown = cooldown; } public void SetCooldown(float duration) { cooldown = duration; } public void ReduceCooldown(float duration) { if (cooldown > 0f) { cooldown -= duration; } } public bool CanSteal() { return cooldown <= 0f; } } public static float cooldownDuration = 15f; public static float closeRangeDistanceSqr = 900f; public static float closeRangeCooldownMult = 3f; private List cooldowns = new List(); private void FixedUpdate() { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { return; } float num = Time.fixedDeltaTime * closeRangeCooldownMult; foreach (AttackerCooldown cooldown in cooldowns) { bool flag = false; if (Object.op_Implicit((Object)(object)cooldown.attacker)) { Vector3 val = cooldown.attacker.transform.position - ((Component)this).transform.position; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude <= closeRangeDistanceSqr) { flag = true; } } cooldown.ReduceCooldown(flag ? num : Time.fixedDeltaTime); } cooldowns = cooldowns.Where((AttackerCooldown ac) => (Object)(object)ac.attacker != (Object)null).ToList(); } public void SetStealItemCooldown(GameObject attacker) { GameObject attacker2 = attacker; if (Object.op_Implicit((Object)(object)attacker2)) { AttackerCooldown attackerCooldown = cooldowns.Find((AttackerCooldown c) => (Object)(object)c.attacker == (Object)(object)attacker2); if (attackerCooldown != null) { attackerCooldown.SetCooldown(cooldownDuration); return; } attackerCooldown = new AttackerCooldown(attacker2, cooldownDuration); cooldowns.Add(attackerCooldown); } } public bool ShouldGuaranteedSteal(GameObject attacker) { GameObject attacker2 = attacker; if (!Object.op_Implicit((Object)(object)attacker2)) { return false; } AttackerCooldown attackerCooldown = cooldowns.Find((AttackerCooldown c) => (Object)(object)c.attacker == (Object)(object)attacker2); if (attackerCooldown == null) { attackerCooldown = new AttackerCooldown(attacker2, 0f); cooldowns.Add(attackerCooldown); } return attackerCooldown.CanSteal(); } } } namespace RiskyTweaks.Tweaks.Enemies.Bell { public class FullStun : TweakBase { public override string ConfigCategoryString => "Enemies - Brass Contraption"; public override string ConfigOptionName => "(Server-Side) Allow Attack Interrupt"; public override string ConfigDescriptionString => "Stuns can interrupt the attack chargeup."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { GameObject val = LegacyResourcesAPI.Load("prefabs/characterbodies/bellbody"); EntityStateMachine val2 = null; EntityStateMachine[] components = val.GetComponents(); EntityStateMachine[] array = components; foreach (EntityStateMachine val3 in array) { string customName = val3.customName; string text = customName; if (text == "Weapon") { val2 = val3; } } SetStateOnHurt component = val.GetComponent(); component.idleStateMachine = (EntityStateMachine[])(object)new EntityStateMachine[1] { val2 }; } } } namespace RiskyTweaks.Tweaks.Enemies.Beetle { public class BeetleBuff : TweakBase { public override string ConfigCategoryString => "Enemies - Beetle"; public override string ConfigOptionName => "(Server-Side) Buff Enemy"; public override string ConfigDescriptionString => "Buffs hitbox size, slightly buffs attack speed and move speed."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { GameObject val = LegacyResourcesAPI.Load("prefabs/characterbodies/beetlebody"); ModifyStats(val); ModifyAttack(); ExpandHitbox(val); } private void ModifyStats(GameObject go) { CharacterBody component = go.GetComponent(); float num = 8f; if (component.baseMoveSpeed < num) { component.baseMoveSpeed = num; } } private void ModifyAttack() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Invalid comparison between Unknown and I4 SneedUtils.SetAddressableEntityStateField("RoR2/Base/Beetle/EntityStates.BeetleMonster.HeadbuttState.asset", "baseDuration", "1.2"); GameObject val = Addressables.LoadAssetAsync((object)"RoR2/Base/Beetle/BeetleMaster.prefab").WaitForCompletion(); float num = 5f; AISkillDriver[] components = val.GetComponents(); AISkillDriver[] array = components; foreach (AISkillDriver val2 in array) { if ((int)val2.skillSlot == 0 && val2.maxDistance < num) { val2.maxDistance = num; } } } private void ExpandHitbox(GameObject enemyObject) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = enemyObject.GetComponent(); HitBoxGroup componentInChildren = ((Component)component).GetComponentInChildren(); if (componentInChildren.groupName == "Headbutt") { Transform transform = ((Component)componentInChildren.hitBoxes[0]).transform; transform.localScale = new Vector3(2.5f, 4f, 1.7f); transform.localPosition = new Vector3(0f, 0.3f, 0.2f); } } } } namespace RiskyTweaks.Tweaks.Artifacts { public class VengeanceFallDamage : TweakBase { public override string ConfigCategoryString => "Artifacts - Vengeance"; public override string ConfigOptionName => "(Server-Side) No Fall Damage"; public override string ConfigDescriptionString => "Vengeance Umbras are immune to fall damage."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown HealthComponent.TakeDamageProcess += new hook_TakeDamageProcess(HealthComponent_TakeDamageProcess); } private void HealthComponent_TakeDamageProcess(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active && DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)2097152)) != 0 && self.itemCounts.invadingDoppelganger > 0) { damageInfo.damage = 0f; damageInfo.rejected = true; } orig.Invoke(self, damageInfo); } } public class VengeanceNerfNkuhana : TweakBase { public override string ConfigCategoryString => "Artifacts - Vengeance"; public override string ConfigOptionName => "(Server-Side) Nerf Nkuhanas Opinion"; public override string ConfigDescriptionString => "Nkuhanas Opinion deals 90% less damage from Vengeance Umbras."; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown HealthComponent.ServerFixedUpdate += new Manipulator(HealthComponent_ServerFixedUpdate); } private void HealthComponent_ServerFixedUpdate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "damageValue") })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(float damage, HealthComponent self) { if (self.itemCounts.invadingDoppelganger > 0) { damage *= 0.1f; } return damage; }); } else { Debug.LogError((object)"RiskyTweaks: VengeanceNerfNkuhana IL Hook failed"); } } } public class VengeancePercentHeal : TweakBase { public override string ConfigCategoryString => "Artifacts - Vengeance"; public override string ConfigOptionName => "(Server-Side) Vengeance Percent Heal Nerf"; public override string ConfigDescriptionString => "Vengeance Umbras receive reduced healing proportional to their HP bonus."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown HealthComponent.HealFraction += new hook_HealFraction(HealthComponent_HealFraction); } private float HealthComponent_HealFraction(orig_HealFraction orig, HealthComponent self, float fraction, ProcChainMask procChainMask) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (self.itemCounts.invadingDoppelganger > 0) { fraction *= 0.1f; } return orig.Invoke(self, fraction, procChainMask); } } public class VengeanceVoidTeam : TweakBase { public override string ConfigCategoryString => "Artifacts - Vengeance"; public override string ConfigOptionName => "(Server-Side) Void Team"; public override string ConfigDescriptionString => "Vengeance Umbras are a part of the Void team."; public override bool StopLoadOnConfigDisable => true; protected override void ApplyChanges() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown DoppelgangerInvasionManager.CreateDoppelganger += new Manipulator(DoppelgangerInvasionManager_CreateDoppelganger); } private void DoppelgangerInvasionManager_CreateDoppelganger(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "TrySpawnObject") })) { val.EmitDelegate>((Func)delegate(DirectorSpawnRequest spawnRequest) { spawnRequest.teamIndexOverride = (TeamIndex)4; return spawnRequest; }); } else { Debug.LogError((object)"RiskyTweaks: VengeanceVoidTeam IL Hook failed"); } } } } namespace RiskyTweaks.FireSelect { public static class CaptainAutoFire { public enum CaptainFireMode { Default, Auto, Charged } public static CaptainFireMode currentfireMode = CaptainFireMode.Default; public static ConfigEntry Enabled; public static ConfigEntry defaultButton; public static ConfigEntry chargedButton; public static ConfigEntry autoButton; public static List targetSkills = new List { Addressables.LoadAssetAsync((object)"RoR2/Base/Captain/CaptainShotgun.asset").WaitForCompletion() }; private static BodyIndex targetBodyIndex; internal static void Init(ConfigFile config) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown ReadConfig(config); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(OnLoad)); SkillIcon.Update += new hook_Update(SkillIcon_Update); FireSelectManager.FireModeActions = (FireSelectManager.FireMode)Delegate.Combine(FireSelectManager.FireModeActions, new FireSelectManager.FireMode(FireModeAction)); ChargeCaptainShotgun.FixedUpdate += new Manipulator(ChargeCaptainShotgun_FixedUpdate); } private static void ChargeCaptainShotgun_FixedUpdate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(ButtonState), "down") })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(bool down, ChargeCaptainShotgun self) { if (currentfireMode == CaptainFireMode.Auto) { return false; } return (currentfireMode == CaptainFireMode.Charged) ? (((EntityState)self).fixedAge < self.chargeDuration) : down; }); } else { Debug.LogError((object)"RiskyTweaks: CaptainAutoFire IL Hook failed."); } } public static void CycleFireMode(int direction) { int num = (int)(direction + currentfireMode); if (num < 0) { currentfireMode = CaptainFireMode.Charged; } else if (num > 2) { currentfireMode = CaptainFireMode.Default; } else { currentfireMode = (CaptainFireMode)num; } } public static void FireModeAction() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) float y = Input.mouseScrollDelta.y; if (FireSelectManager.scrollSelection.Value && y != 0f) { CycleFireMode((!(y < 0f)) ? 1 : (-1)); } if (SneedUtils.GetKeyPressed(FireSelectManager.nextButton)) { CycleFireMode(1); } if (SneedUtils.GetKeyPressed(FireSelectManager.prevButton)) { CycleFireMode(-1); } if (SneedUtils.GetKeyPressed(defaultButton)) { currentfireMode = CaptainFireMode.Default; } if (SneedUtils.GetKeyPressed(autoButton)) { currentfireMode = CaptainFireMode.Auto; } if (SneedUtils.GetKeyPressed(chargedButton)) { currentfireMode = CaptainFireMode.Charged; } } private static void ReadConfig(ConfigFile config) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) Enabled = config.Bind("Fire Select - Captain", "Use Fire Select", true, "Enable firemode selection."); Enabled.SettingChanged += Enabled_SettingChanged; defaultButton = config.Bind("Fire Select - Captain", "Default Button", KeyboardShortcut.Empty, "Button to select Default firemode."); autoButton = config.Bind("Fire Select - Captain", "Auto Button", KeyboardShortcut.Empty, "Button to select Auto firemode."); chargedButton = config.Bind("Fire Select - Captain", "Charged Button", KeyboardShortcut.Empty, "Button to select Charged firemode."); } private static void Enabled_SettingChanged(object sender, EventArgs e) { if (!Enabled.Value) { currentfireMode = CaptainFireMode.Default; } } private static void SkillIcon_Update(orig_Update orig, SkillIcon self) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Invalid comparison between Unknown and I4 //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (Enabled.Value && Object.op_Implicit((Object)(object)self.targetSkill) && (int)self.targetSkillSlot == 0 && self.targetSkill.characterBody.bodyIndex == targetBodyIndex && targetSkills.Contains(self.targetSkill.skillDef)) { ((Component)self.stockText).gameObject.SetActive(true); ((TMP_Text)self.stockText).fontSize = 12f; ((TMP_Text)self.stockText).SetText(currentfireMode.ToString(), true); } } private static void OnLoad() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) targetBodyIndex = BodyCatalog.FindBodyIndex("CaptainBody"); } } public static class EngiAutoFire { public enum EngiFireMode { Default, Auto, Hold } public static EngiFireMode currentfireMode = EngiFireMode.Default; public static ConfigEntry Enabled; public static ConfigEntry holdButton; public static ConfigEntry autoButton; public static List targetSkills = new List { Addressables.LoadAssetAsync((object)"RoR2/Base/Engi/EngiBodyFireGrenade.asset").WaitForCompletion() }; private static BodyIndex targetBodyIndex; internal static void Init(ConfigFile config) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown ReadConfig(config); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(OnLoad)); SkillIcon.Update += new hook_Update(SkillIcon_Update); FireSelectManager.FireModeActions = (FireSelectManager.FireMode)Delegate.Combine(FireSelectManager.FireModeActions, new FireSelectManager.FireMode(FireModeAction)); ChargeGrenades.OnEnter += new Manipulator(ChargeGrenades_OnEnter); } private static void ChargeGrenades_OnEnter(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)2, new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(ChargeGrenades), "baseTotalDuration") })) { val.EmitDelegate>((Func)delegate(float duration) { if (currentfireMode == EngiFireMode.Auto) { return ChargeGrenades.baseMaxChargeTime; } return (currentfireMode == EngiFireMode.Hold) ? 10000000f : duration; }); } else { Debug.LogError((object)"RiskyTweaks: EngiAutoFire IL Hook failed."); } } private static void ReadConfig(ConfigFile config) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) Enabled = config.Bind("Fire Select - Engineer", "Use Fire Select", true, "Enable firemode selection."); Enabled.SettingChanged += Enabled_SettingChanged; if (Enabled.Value) { currentfireMode = EngiFireMode.Hold; } autoButton = config.Bind("Fire Select - Engineer", "Auto Button", KeyboardShortcut.Empty, "Button to select Auto firemode."); holdButton = config.Bind("Fire Select - Engineer", "Hold Button", KeyboardShortcut.Empty, "Button to select Hold firemode."); } private static void Enabled_SettingChanged(object sender, EventArgs e) { if (!Enabled.Value) { currentfireMode = EngiFireMode.Default; } else if (currentfireMode == EngiFireMode.Default) { currentfireMode = EngiFireMode.Hold; } } private static void SkillIcon_Update(orig_Update orig, SkillIcon self) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Invalid comparison between Unknown and I4 //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (Enabled.Value && Object.op_Implicit((Object)(object)self.targetSkill) && (int)self.targetSkillSlot == 0 && self.targetSkill.characterBody.bodyIndex == targetBodyIndex && targetSkills.Contains(self.targetSkill.skillDef)) { ((Component)self.stockText).gameObject.SetActive(true); ((TMP_Text)self.stockText).fontSize = 12f; ((TMP_Text)self.stockText).SetText(currentfireMode.ToString(), true); } } private static void CycleFireMode() { if (currentfireMode == EngiFireMode.Auto) { currentfireMode = EngiFireMode.Hold; } else { currentfireMode = EngiFireMode.Auto; } } private static void FireModeAction() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) if (Enabled.Value) { float y = Input.mouseScrollDelta.y; KeyboardShortcut value = FireSelectManager.nextButton.Value; bool flag = ((KeyboardShortcut)(ref value)).IsDown(); value = FireSelectManager.prevButton.Value; bool flag2 = ((KeyboardShortcut)(ref value)).IsDown(); if (flag || flag2 || y != 0f) { CycleFireMode(); } if (SneedUtils.GetKeyPressed(autoButton)) { currentfireMode = EngiFireMode.Auto; } else if (SneedUtils.GetKeyPressed(holdButton)) { currentfireMode = EngiFireMode.Hold; } } } private static void OnLoad() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) targetBodyIndex = BodyCatalog.FindBodyIndex("EngiBody"); } } public class FireSelectManager : MonoBehaviour { public delegate void FireMode(); public static ConfigEntry scrollSelection; public static ConfigEntry nextButton; public static ConfigEntry prevButton; public static FireMode FireModeActions; private static void ReadConfig(ConfigFile config) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) scrollSelection = config.Bind("Fire Select", "Scroll Selection", true, "Scroll wheel swaps between firemodes."); nextButton = config.Bind("Fire Select", "Next Button", KeyboardShortcut.Empty, "Button to swap to next firemode."); prevButton = config.Bind("Fire Select", "Previous Button", KeyboardShortcut.Empty, "Button to swap to previous firemode."); } internal static void Init(ConfigFile config) { ReadConfig(config); CaptainAutoFire.Init(config); EngiAutoFire.Init(config); } private void Update() { if (FireModeActions != null) { FireModeActions(); } } } }