Decompiled source of Tweaker v1.9.2
plugins/Dex.Tweaker.dll
Decompiled a day ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using System.Text.Json; using System.Text.Json.Serialization; using AIGraph; using AK; using Agents; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using CellMenu; using ChainedPuzzles; using Dex.Tweaker.Config; using Dex.Tweaker.Core; using Dex.Tweaker.DataTransfer; using Dex.Tweaker.Patch; using Dex.Tweaker.Util; using Enemies; using GameData; using Gear; using Globals; using HarmonyLib; using Il2CppInterop.Runtime.InteropTypes; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSystem; using Il2CppSystem.Collections.Generic; using LevelGeneration; using MTFO.Managers; using Microsoft.CodeAnalysis; using Player; using SNetwork; using TMPro; using UnityEngine; using UnityEngine.AI; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("Dex.Tweaker")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.9.2")] [assembly: AssemblyInformationalVersion("1.9.2")] [assembly: AssemblyProduct("Dex.Tweaker")] [assembly: AssemblyTitle("Dex.Tweaker")] [assembly: AssemblyVersion("1.9.2.0")] 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 Dex.Tweaker { [HarmonyPatch(typeof(LocalPlayerAgent), "UpdateInfectionLocal")] internal class LocalPlayerAgent_UpdateInfectionLocal { public static void Prefix(LocalPlayerAgent __instance) { //IL_002b: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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_00a7: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) Dex.Tweaker.Core.ObjectiveModifier.Update(ref __instance); if (ConfigManager.UseDebugNavMesh.Value && !((Object)(object)Dex.Tweaker.Core.Debug.VisualNavMesh == (Object)null)) { if (Input.GetKeyDown(ConfigManager.DebugNavMeshToggle.Value)) { Dex.Tweaker.Core.Debug.VisualNavMesh.SetActive(!Dex.Tweaker.Core.Debug.VisualNavMesh.active); } if (Input.GetKeyDown(ConfigManager.DebugNavMeshReset.Value)) { Dex.Tweaker.Core.Debug.VisualNavMesh.transform.localPosition = Vector3.zero; } if (Input.GetKeyDown(ConfigManager.DebugNavMeshUp.Value)) { Dex.Tweaker.Core.Debug.VisualNavMesh.transform.localPosition = Dex.Tweaker.Core.Debug.VisualNavMesh.transform.localPosition + Vector3.one * 0.01f; } if (Input.GetKeyDown(ConfigManager.DebugNavMeshDown.Value)) { Dex.Tweaker.Core.Debug.VisualNavMesh.transform.localPosition = Dex.Tweaker.Core.Debug.VisualNavMesh.transform.localPosition - Vector3.one * 0.01f; } } } } [BepInPlugin("com.Dex.Tweaker", "Dex.Tweaker", "1.9.2")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInProcess("GTFO.exe")] internal class Plugin : BasePlugin { public static Harmony Instance { get; set; } public override void Load() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0065: Expected O, but got Unknown //IL_007a: 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_0099: Expected O, but got Unknown //IL_0099: Expected O, but got Unknown //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Expected O, but got Unknown //IL_00cd: Expected O, but got Unknown //IL_00e2: 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_0101: Expected O, but got Unknown //IL_0101: Expected O, but got Unknown //IL_0116: 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_0135: Expected O, but got Unknown //IL_0135: Expected O, but got Unknown //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Expected O, but got Unknown //IL_0165: Expected O, but got Unknown //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Expected O, but got Unknown //IL_019a: Expected O, but got Unknown //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Expected O, but got Unknown //IL_021c: Expected O, but got Unknown //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Expected O, but got Unknown //IL_0296: Expected O, but got Unknown if (Global.RundownIdToLoad > 1) { ((BasePlugin)this).Log.LogWarning((object)"Edit the data blocks to load rundown id 1 for tweaker to work"); ((BasePlugin)this).Unload(); return; } Instance = new Harmony("com.Dex.Tweaker"); Log.Source = ((BasePlugin)this).Log; ConfigManager.UseDebugNavMesh = ((BasePlugin)this).Config.Bind<bool>(new ConfigDefinition("Debug Nav Mesh", "Enable"), false, new ConfigDescription("Show where enemies can walk?", (AcceptableValueBase)null, Array.Empty<object>())); ConfigManager.DebugNavMeshToggle = ((BasePlugin)this).Config.Bind<KeyCode>(new ConfigDefinition("Debug Nav Mesh", "Toggle visibility"), (KeyCode)292, new ConfigDescription("Input key to toggle visibility of the debug nav mesh", (AcceptableValueBase)null, Array.Empty<object>())); ConfigManager.DebugNavMeshUp = ((BasePlugin)this).Config.Bind<KeyCode>(new ConfigDefinition("Debug Nav Mesh", "Move up"), (KeyCode)280, new ConfigDescription("Input key to move debug nav mesh up", (AcceptableValueBase)null, Array.Empty<object>())); ConfigManager.DebugNavMeshDown = ((BasePlugin)this).Config.Bind<KeyCode>(new ConfigDefinition("Debug Nav Mesh", "Move down"), (KeyCode)281, new ConfigDescription("Input key to move debug nav mesh down", (AcceptableValueBase)null, Array.Empty<object>())); ConfigManager.DebugNavMeshReset = ((BasePlugin)this).Config.Bind<KeyCode>(new ConfigDefinition("Debug Nav Mesh", "Reset position"), (KeyCode)279, new ConfigDescription("Input key to reset debug nav mesh position", (AcceptableValueBase)null, Array.Empty<object>())); ConfigManager.UseDebug = ((BasePlugin)this).Config.Bind<bool>(new ConfigDefinition("Logging", "Debug"), false, new ConfigDescription("Use debug log messages?", (AcceptableValueBase)null, Array.Empty<object>())); ConfigManager.LoadJson(); if (((BasePlugin)this).Config.Bind<bool>(new ConfigDefinition("Client Patch", "Official Server Interactions"), false, new ConfigDescription("This will disable analytics on game event reporting, most drop server interactions and steam from setting friend data", (AcceptableValueBase)null, Array.Empty<object>())).Value) { Instance.PatchAll(typeof(DropServerGameSession_ReportLayerProgression)); Instance.PatchAll(typeof(DropServerGameSession_ReportSessionResult)); Instance.PatchAll(typeof(DropServerManager_GetBoosterImplantPlayerDataAsync)); Instance.PatchAll(typeof(DropServerManager_UpdateBoosterImplantPlayerDataAsync)); } if (((BasePlugin)this).Config.Bind<bool>(new ConfigDefinition("Client Patch", "General UI changes"), false, new ConfigDescription("This will enable various ui changes such as the watermark and signature", (AcceptableValueBase)null, Array.Empty<object>())).Value) { Instance.PatchAll(typeof(CM_StartupScreen_SetText)); } if (ConfigManager.UseDebug.Value) { Instance.PatchAll(typeof(Dam_EnemyDamageLimb_ExplosionDamage)); Instance.PatchAll(typeof(Dam_SyncedDamageBase_RegisterDamage)); } if (((BasePlugin)this).Config.Bind<bool>(new ConfigDefinition("Client Patch", "Terminal zone location"), false, new ConfigDescription("This will show the current location of a terminal on the screen. It may require all clients to have it enabled otherwise issues may occur.", (AcceptableValueBase)null, Array.Empty<object>())).Value) { Instance.PatchAll(typeof(LG_ComputerTerminalCommandInterpreter_SetupCommands)); } Instance.PatchAll(typeof(CM_PageRundown_New_Update)); Instance.PatchAll(typeof(WardenObjective_OnLocalPlayerStartExpedition)); Instance.PatchAll(typeof(LG_ComputerTerminal_Setup)); } } } namespace Dex.Tweaker.Util { internal class Log { public static ManualLogSource Source { get; set; } public static void Message(object input) { Source.LogMessage(input); } public static void Info(object input) { Source.LogInfo(input); } public static void Debug(object input) { if (ConfigManager.UseDebug.Value) { Source.LogDebug(input); } } public static void Warning(object input) { Source.LogWarning(input); } public static void Error(object input) { Source.LogError(input); } public static void Fatal(object input) { Source.LogFatal(input); } } internal class MTFOInfo { public const string GUID = "com.dak.MTFO"; public static string CustomPath => ConfigManager.CustomPath; } } namespace Dex.Tweaker.Patch { [HarmonyPatch(typeof(BulletWeapon), "BulletHit")] internal class BulletWeapon_BulletHit { public static void Prefix(ref WeaponHitData weaponRayData) { if (!ConfigManager.DifficultyScale.Config.internalEnabled) { return; } switch (SNet.SessionHub.PlayersInSession.Count) { case 1: if (ConfigManager.DifficultyScale.Config.Solo.enabled && ConfigManager.DifficultyScale.Config.Solo.BulletDamage != 1f) { WeaponHitData obj3 = weaponRayData; obj3.damage *= ConfigManager.DifficultyScale.Config.Solo.BulletDamage; } break; case 2: if (ConfigManager.DifficultyScale.Config.Duo.enabled && ConfigManager.DifficultyScale.Config.Duo.BulletDamage != 1f) { WeaponHitData obj2 = weaponRayData; obj2.damage *= ConfigManager.DifficultyScale.Config.Duo.BulletDamage; } break; case 3: if (ConfigManager.DifficultyScale.Config.Trio.enabled && ConfigManager.DifficultyScale.Config.Trio.BulletDamage != 1f) { WeaponHitData obj4 = weaponRayData; obj4.damage *= ConfigManager.DifficultyScale.Config.Trio.BulletDamage; } break; case 4: if (ConfigManager.DifficultyScale.Config.Full.enabled && ConfigManager.DifficultyScale.Config.Full.BulletDamage != 1f) { WeaponHitData obj = weaponRayData; obj.damage *= ConfigManager.DifficultyScale.Config.Full.BulletDamage; } break; default: Log.Warning("Abnormal number of players detected in session"); break; } } } [HarmonyPatch(typeof(CM_PageLoadout), "UpdatePageData")] internal class CM_PageLoadout_UpdatePageData { public static void Prefix(CM_PageLoadout __instance) { Dex.Tweaker.Core.ObjectiveModifier.Modifier = null; } } [HarmonyPatch(typeof(CM_PageRundown_New), "Update")] internal class CM_PageRundown_New_Update { public static void Postfix(CM_PageRundown_New __instance) { if (ConfigManager.RundownLayout.Config.internalEnabled) { if (ConfigManager.RundownLayout.Config.HideProgression) { __instance.m_tierMarkerSectorSummary.SetVisible(false, 0f); } if (ConfigManager.RundownLayout.Config.HideTiers) { __instance.m_tierMarker1.SetVisible(false, 0f); __instance.m_tierMarker2.SetVisible(false, 0f); __instance.m_tierMarker3.SetVisible(false, 0f); __instance.m_tierMarker4.SetVisible(false, 0f); __instance.m_tierMarker5.SetVisible(false, 0f); } } } } [HarmonyPatch(typeof(CM_PageRundown_New), "UpdateExpeditionIconProgression")] internal class CM_PageRundown_New_UpdateExpeditionIconProgression { public static bool DebugLogged { get; set; } public static void Postfix(CM_PageRundown_New __instance) { if (RundownManager.RundownProgression == null || !ConfigManager.RundownLayout.Config.internalEnabled) { return; } StringBuilder stringBuilder = new StringBuilder(); bool emptyLog = true; int index = 0; string format = " {0,8} |"; StringBuilder label = new StringBuilder(); StringBuilder scale = new StringBuilder(); StringBuilder posX = new StringBuilder(); StringBuilder posY = new StringBuilder(); StringBuilder posZ = new StringBuilder(); label.Append(string.Format(format, "Label")); scale.Append(string.Format(format, "Scale")); posX.Append(string.Format(format, "PosX")); posY.Append(string.Format(format, "PosY")); posZ.Append(string.Format(format, "PosZ")); if (ConfigManager.RundownLayout.Config.Tier1 != null) { ExpeditionButton[] tier2 = ConfigManager.RundownLayout.Config.Tier1; foreach (ExpeditionButton tier3 in tier2) { if (__instance.m_expIconsTier1 == null || __instance.m_expIconsTier1.Count < 1) { break; } ReplaceIcon(__instance.m_expIconsTier1[index], tier3); } } index = 0; if (ConfigManager.RundownLayout.Config.Tier2 != null) { ExpeditionButton[] tier2 = ConfigManager.RundownLayout.Config.Tier2; foreach (ExpeditionButton tier4 in tier2) { if (__instance.m_expIconsTier2 == null || __instance.m_expIconsTier2.Count < 1) { break; } ReplaceIcon(__instance.m_expIconsTier2[index], tier4); } } index = 0; if (ConfigManager.RundownLayout.Config.Tier3 != null) { ExpeditionButton[] tier2 = ConfigManager.RundownLayout.Config.Tier3; foreach (ExpeditionButton tier5 in tier2) { if (__instance.m_expIconsTier3 == null || __instance.m_expIconsTier3.Count < 1) { break; } ReplaceIcon(__instance.m_expIconsTier3[index], tier5); } } index = 0; if (ConfigManager.RundownLayout.Config.Tier4 != null) { ExpeditionButton[] tier2 = ConfigManager.RundownLayout.Config.Tier4; foreach (ExpeditionButton tier6 in tier2) { if (__instance.m_expIconsTier4 == null || __instance.m_expIconsTier4.Count < 1) { break; } ReplaceIcon(__instance.m_expIconsTier4[index], tier6); } } index = 0; if (ConfigManager.RundownLayout.Config.Tier5 != null) { ExpeditionButton[] tier2 = ConfigManager.RundownLayout.Config.Tier5; foreach (ExpeditionButton tier7 in tier2) { if (__instance.m_expIconsTier5 == null || __instance.m_expIconsTier5.Count < 1) { break; } ReplaceIcon(__instance.m_expIconsTier5[index], tier7); } } if (!emptyLog && !DebugLogged) { stringBuilder.AppendLine("Expedition Icons"); stringBuilder.AppendLine(label.ToString()); stringBuilder.AppendLine(scale.ToString()); stringBuilder.AppendLine(posX.ToString()); stringBuilder.AppendLine(posY.ToString()); stringBuilder.AppendLine(posZ.ToString()); Log.Debug(stringBuilder.ToString()); DebugLogged = true; } void ReplaceIcon(CM_ExpeditionIcon_New expIcon, ExpeditionButton tier) { //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: 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_0138: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) ((Component)expIcon.m_decryptErrorText).gameObject.SetActive(true); ((TMP_Text)expIcon.m_decryptErrorText).SetText((tier.Decrypt == null) ? string.Empty : tier.Decrypt, true); ((CM_Item)expIcon).SetText(tier.Label); expIcon.m_useArtifactHeatText = tier.Heat; if (!string.IsNullOrEmpty(tier.Status)) { ((TMP_Text)expIcon.m_statusText).SetText(tier.Status + "\n" + ((TMP_Text)expIcon.m_statusText).text, true); } emptyLog = false; label.Append(string.Format(format, tier.Label)); scale.Append(string.Format(format, ((Component)expIcon).transform.localScale.x)); posX.Append(string.Format(format, ((Component)expIcon).transform.localPosition.x)); posY.Append(string.Format(format, ((Component)expIcon).transform.localPosition.y)); posZ.Append(string.Format(format, ((Component)expIcon).transform.localPosition.z)); ((Component)expIcon).transform.localScale = new Vector3(tier.Scale, tier.Scale, tier.Scale); ((Component)expIcon).transform.localPosition = new Vector3(tier.Position.X, tier.Position.Y, tier.Position.Z); index++; } } } [HarmonyPatch(typeof(CM_StartupScreen), "SetText")] internal class CM_StartupScreen_SetText { public static void Prefix(ref string txt) { txt += "\n\nTweaker <color=#808080>by Dex</color>"; } } [HarmonyPatch(typeof(CP_Bioscan_Core), "Master_OnPlayerScanChangedCheckProgress")] internal class CP_Bioscan_Core_Master_OnPlayerScanChangedCheckProgress { public static void Prefix(ref float scanProgress) { if (!ConfigManager.DifficultyScale.Config.internalEnabled) { return; } switch (SNet.SessionHub.PlayersInSession.Count) { case 1: if (ConfigManager.DifficultyScale.Config.Solo.enabled && ConfigManager.DifficultyScale.Config.Solo.ProgressBioscan != 1f) { scanProgress *= ConfigManager.DifficultyScale.Config.Solo.ProgressBioscan; } break; case 2: if (ConfigManager.DifficultyScale.Config.Duo.enabled && ConfigManager.DifficultyScale.Config.Duo.ProgressBioscan != 1f) { scanProgress *= ConfigManager.DifficultyScale.Config.Duo.ProgressBioscan; } break; case 3: if (ConfigManager.DifficultyScale.Config.Trio.enabled && ConfigManager.DifficultyScale.Config.Trio.ProgressBioscan != 1f) { scanProgress *= ConfigManager.DifficultyScale.Config.Trio.ProgressBioscan; } break; case 4: if (ConfigManager.DifficultyScale.Config.Full.enabled && ConfigManager.DifficultyScale.Config.Full.ProgressBioscan != 1f) { scanProgress *= ConfigManager.DifficultyScale.Config.Full.ProgressBioscan; } break; default: Log.Warning("Abnormal number of players detected in session"); break; } } } [HarmonyPatch(typeof(Dam_EnemyDamageLimb), "ExplosionDamage")] internal class Dam_EnemyDamageLimb_ExplosionDamage { public static void Prefix(ref float dam, Dam_EnemyDamageLimb __instance) { Log.Debug($"Explosion damage: {dam} target: {((Object)__instance.m_base).name}"); } } [HarmonyPatch(typeof(Dam_PlayerDamageBase), "OnIncomingDamage")] internal class Dam_PlayerDamageBase_OnIncomingDamage { public static void Prefix(ref float damage) { if (!ConfigManager.DifficultyScale.Config.internalEnabled) { return; } switch (SNet.SessionHub.PlayersInSession.Count) { case 1: if (ConfigManager.DifficultyScale.Config.Solo.enabled && ConfigManager.DifficultyScale.Config.Solo.DamagePlayer != 1f) { damage *= ConfigManager.DifficultyScale.Config.Solo.DamagePlayer; } break; case 2: if (ConfigManager.DifficultyScale.Config.Duo.enabled && ConfigManager.DifficultyScale.Config.Duo.DamagePlayer != 1f) { damage *= ConfigManager.DifficultyScale.Config.Duo.DamagePlayer; } break; case 3: if (ConfigManager.DifficultyScale.Config.Trio.enabled && ConfigManager.DifficultyScale.Config.Trio.DamagePlayer != 1f) { damage *= ConfigManager.DifficultyScale.Config.Trio.DamagePlayer; } break; case 4: if (ConfigManager.DifficultyScale.Config.Full.enabled && ConfigManager.DifficultyScale.Config.Full.DamagePlayer != 1f) { damage *= ConfigManager.DifficultyScale.Config.Full.DamagePlayer; } break; default: Log.Warning("Abnormal number of players detected in session"); break; } } } [HarmonyPatch(typeof(Dam_SyncedDamageBase), "RegisterDamage")] internal class Dam_SyncedDamageBase_RegisterDamage { public static void Postfix(ref float dam, Dam_SyncedDamageBase __instance) { Log.Debug($"Registered Damage: {dam} Health: {__instance.Health} / {__instance.HealthMax} Target: {((Object)__instance).name}"); } } [HarmonyPatch(typeof(DropServerGameSession), "ReportLayerProgression")] internal class DropServerGameSession_ReportLayerProgression { public static bool Prefix() { return false; } } [HarmonyPatch(typeof(DropServerGameSession), "ReportSessionResult")] internal class DropServerGameSession_ReportSessionResult { public static bool Prefix() { return false; } } [HarmonyPatch(typeof(DropServerManager), "GetBoosterImplantPlayerDataAsync")] internal class DropServerManager_GetBoosterImplantPlayerDataAsync { public static bool Prefix() { return false; } } [HarmonyPatch(typeof(DropServerManager), "UpdateBoosterImplantPlayerDataAsync")] internal class DropServerManager_UpdateBoosterImplantPlayerDataAsync { public static bool Prefix() { return false; } } [HarmonyPatch(typeof(ElevatorCargoCage), "SpawnObjectiveItemsInLandingArea")] internal class ElevatorCargoCage_SpawnObjectiveItemsInLandingArea { public static Dex.Tweaker.DataTransfer.ElevatorCargo Cargo { get; set; } public static bool Prefix() { Cargo = null; Dex.Tweaker.DataTransfer.ElevatorCargo[] config = ConfigManager.ElevatorCargo.Config; foreach (Dex.Tweaker.DataTransfer.ElevatorCargo elevatorCargo in config) { if (elevatorCargo.internalEnabled && elevatorCargo.DataBlockId == ((GameDataBlockBase<WardenObjectiveDataBlock>)(object)WardenObjectiveManager.Current.m_activeWardenObjectives[(LG_LayerType)0]).persistentID) { if (elevatorCargo.ForceDisable || elevatorCargo.OverrideObjectiveSpawns) { ElevatorRide.Current.m_cargoCageInUse = !elevatorCargo.ForceDisable; return false; } Cargo = elevatorCargo; break; } } return true; } public static void Postfix(ElevatorCargoCage __instance) { if (Cargo != null && Cargo.ItemID.Length >= 1) { __instance.m_itemsToMoveToCargo = new List<Transform>(); for (int i = 0; i < Cargo.ItemID.Length; i++) { LG_PickupItem val = LG_PickupItem.SpawnGenericPickupItem(ElevatorShaftLanding.CargoAlign); val.SpawnNode = Builder.GetElevatorArea().m_courseNode; val.SetupAsBigPickupItem(Random.Range(0, int.MaxValue), Cargo.ItemID[i], false, 0); __instance.m_itemsToMoveToCargo.Add(((Component)val).transform); } ElevatorRide.Current.m_cargoCageInUse = true; } } } [HarmonyPatch(typeof(EnemyCostManager), "AddCost", new Type[] { typeof(eDimensionIndex), typeof(float) })] internal class EnemyCostManager_AddCost { public static void Prefix(ref float points) { if (!ConfigManager.DifficultyScale.Config.internalEnabled) { return; } switch (SNet.SessionHub.PlayersInSession.Count) { case 1: if (ConfigManager.DifficultyScale.Config.Solo.enabled && ConfigManager.DifficultyScale.Config.Solo.EnemyWaveCost != 1f) { points *= ConfigManager.DifficultyScale.Config.Solo.EnemyWaveCost; } break; case 2: if (ConfigManager.DifficultyScale.Config.Duo.enabled && ConfigManager.DifficultyScale.Config.Duo.EnemyWaveCost != 1f) { points *= ConfigManager.DifficultyScale.Config.Duo.EnemyWaveCost; } break; case 3: if (ConfigManager.DifficultyScale.Config.Trio.enabled && ConfigManager.DifficultyScale.Config.Trio.EnemyWaveCost != 1f) { points *= ConfigManager.DifficultyScale.Config.Trio.EnemyWaveCost; } break; case 4: if (ConfigManager.DifficultyScale.Config.Full.enabled && ConfigManager.DifficultyScale.Config.Full.EnemyWaveCost != 1f) { points *= ConfigManager.DifficultyScale.Config.Full.EnemyWaveCost; } break; default: Log.Warning("Abnormal number of players detected in session"); break; } } } [HarmonyPatch(typeof(EnemyDetection), "DetectOnNoiseDistance_Conditional_AnimatedWindow")] internal class EnemyDetection_DetectOnNoiseDistance_Conditional_AnimatedWindow { public static void Prefix(ref AgentTarget agentTarget) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Invalid comparison between Unknown and I4 if (ConfigManager.PlayerModifier.Config.internalEnabled && !ConfigManager.PlayerModifier.Config.CanStealthBhop && (int)agentTarget.m_agent.Noise == 5) { agentTarget.m_agent.Noise = (NoiseType)4; } } } [HarmonyPatch(typeof(EnemyScanner), "Setup")] internal class EnemyScanner_Setup { public static void Prefix(ref ItemDataBlock data, EnemyScanner __instance) { object[] array = new object[11] { __instance.m_scanConeDotMin, __instance.m_maxScanWorldRadius, __instance.m_localObjRadius, __instance.m_enemyObjMinScale, __instance.m_maxObjs, EnemyScanner.s_maxCourseNodeDistance, __instance.m_scanDelay, __instance.m_pulseDuration, __instance.m_posDelay, EnemyScanner.s_tagDuration, __instance.m_rechargeDuration }; StringBuilder stringBuilder = new StringBuilder(); string format = " {0,21}: {1}"; stringBuilder.AppendLine("Enemyscanner Setup"); object[] array2 = array; foreach (object arg in array2) { stringBuilder.AppendLine(string.Format(format, "info", arg)); } Dex.Tweaker.DataTransfer.BioTracker[] config = ConfigManager.BioTracker.Config; foreach (Dex.Tweaker.DataTransfer.BioTracker bioTracker in config) { if (bioTracker.internalEnabled && bioTracker.ItemID == ((GameDataBlockBase<ItemDataBlock>)(object)data).persistentID) { array[0] = bioTracker.scanConeDotMin; array[1] = bioTracker.maxScanWorldRadius; array[2] = bioTracker.localObjRadius; array[3] = bioTracker.enemyObjMinScale; array[4] = bioTracker.maxObjs; array[5] = bioTracker.maxCourseNodeDistance; array[6] = bioTracker.scanDelay; array[7] = bioTracker.pulseDuration; array[8] = bioTracker.posDelay; array[9] = bioTracker.tagDuration; array[10] = bioTracker.rechargeDuration; StringBuilder stringBuilder2 = stringBuilder; StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(9, 2, stringBuilder2); handler.AppendLiteral("Loaded "); handler.AppendFormatted(bioTracker.name); handler.AppendLiteral("["); handler.AppendFormatted(bioTracker.ItemID); handler.AppendLiteral("]"); stringBuilder2.AppendLine(ref handler); break; } } Log.Debug(stringBuilder.ToString()); } } [HarmonyPatch(typeof(GlowstickInstance), "OnCollisionEnter")] internal class GlowstickInstance_OnCollisionEnter { public static void Postfix(Collision col) { if (ConfigManager.GamerGlowstick.Config.internalEnabled) { Dex.Tweaker.Core.GamerGlowstick.TurnOffLights(ref col); } } } [HarmonyPatch(typeof(GlowstickInstance), "OnDespawn")] internal class GlowstickInstance_OnDespawn { public static void Prefix(GlowstickInstance __instance) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (ConfigManager.GamerGlowstick.Config.internalEnabled) { Dex.Tweaker.Core.GamerGlowstick.Despawn(((Object)__instance).GetInstanceID(), ((Component)__instance).transform.position); } } } [HarmonyPatch(typeof(GlowstickInstance), "Update")] internal class GlowstickInstance_Update { public static void Postfix(GlowstickInstance __instance) { } } [HarmonyPatch(typeof(GlueGun), "Setup")] internal class GlueGun_Setup { public static void Prefix(ref ItemDataBlock data, GlueGun __instance) { Log.Debug($"GlueGun Setup\n\ttimeToMaxPressure{__instance.m_timeToMaxpressure}\n\ttimeToDepleatePressure:{__instance.m_timeToDepleatePressure}\n\tm_pressureProgressToFire:{__instance.m_pressureProgressToFire}\n\tm_meterAngMinpressure:{__instance.m_meterAngMinpressure}\n\tm_meterAngMaxpressure:{__instance.m_meterAngMaxpressure}\n\tm_fireDelayMin:{__instance.m_fireDelayMin}\n\tm_fireDelayMax:{__instance.m_fireDelayMax}\n\tm_forceSizeMin:{__instance.m_forceSizeMin}\n\tm_forceSizeMax:{__instance.m_forceSizeMax}\n\tm_spreadMin:{__instance.m_spreadMin}\n\tm_spreadMax:{__instance.m_spreadMax}\n\tm_burstShotsMin:{__instance.m_burstShotsMin}\n\tm_burstShotsMax:{__instance.m_burstShotsMax}\n\tm_burstShotDelay:{__instance.m_burstShotDelay}\n\tm_noiseScaleTarget:{__instance.m_noiseScaleTarget}\n\tm_noiseIntensity:{__instance.m_noiseIntensity}\n\tm_meterShakeAng:{__instance.m_meterShakeAng}\n\tm_syncTimeout:{__instance.m_syncTimeout}"); Dex.Tweaker.DataTransfer.FoamLauncher[] config = ConfigManager.FoamLauncher.Config; foreach (Dex.Tweaker.DataTransfer.FoamLauncher foamLauncher in config) { if (foamLauncher.internalEnabled && foamLauncher.ItemID == ((GameDataBlockBase<ItemDataBlock>)(object)data).persistentID) { __instance.m_timeToMaxpressure = foamLauncher.TimeToMaxPressure; __instance.m_timeToDepleatePressure = foamLauncher.TimeToDepleatePressure; __instance.m_pressureProgressToFire = foamLauncher.PressureProgressToFire; __instance.m_meterAngMinpressure = foamLauncher.MeterAngPressure.Min; __instance.m_meterAngMaxpressure = foamLauncher.MeterAngPressure.Max; __instance.m_fireDelayMin = foamLauncher.FireDelay.Min; __instance.m_fireDelayMax = foamLauncher.FireDelay.Max; __instance.m_forceSizeMin = foamLauncher.ForceSize.Min; __instance.m_forceSizeMax = foamLauncher.ForceSize.Max; __instance.m_spreadMin = foamLauncher.Spread.Min; __instance.m_spreadMax = foamLauncher.Spread.Max; __instance.m_burstShotsMin = foamLauncher.BurstShots.Min; __instance.m_burstShotsMax = foamLauncher.BurstShots.Max; __instance.m_burstShotDelay = foamLauncher.BurstShotDelay; __instance.m_noiseScaleTarget = foamLauncher.NoiseScaleTarget; __instance.m_noiseIntensity = foamLauncher.NoiseIntensity; __instance.m_meterShakeAng = foamLauncher.MeterShakeAng; __instance.m_syncTimeout = foamLauncher.SyncTimeout; break; } } } } [HarmonyPatch(typeof(InfectionSpitter), "TryPlaySound")] internal class InfectionSpitter_TryPlaySound { public static void Prefix(ref uint id) { if (Dex.Tweaker.Core.InfectionSpitter.SpitterModifiers.TryGetValue(RundownManager.ActiveExpedition.LevelLayoutData, out InfectionSpitterConfig value)) { switch (id) { case 3688585605u: id = value.SoundEventPreSpit; break; case 443010049u: id = value.SoundEventFoamed; break; case 1800579437u: id = value.SoundEventScared; break; case 1580085442u: id = value.SoundEventPrimed; break; case 483235199u: id = value.SoundEventOut; break; case 1548233641u: id = value.SoundEventPurrLoop; break; case 600057560u: id = value.SoundEventIn; break; case 3829473415u: id = value.SoundEventPurrStop; break; case 3124402583u: id = value.SoundEventSpit; break; case 990281653u: id = value.SoundEventReleasedFromFoam; break; } } } } [HarmonyPatch(typeof(LG_ComputerTerminalCommandInterpreter), "SetupCommands")] internal class LG_ComputerTerminalCommandInterpreter_SetupCommands { public static void Postfix(LG_ComputerTerminalCommandInterpreter __instance) { __instance.AddOutput("LOCATION: <color=orange>" + __instance.m_terminal.SpawnNode.m_zone.NavInfo.GetFormattedText((LG_NavInfoFormat)7) + "</color>", true); } } [HarmonyPatch(typeof(LG_ComputerTerminal), "Setup")] internal class LG_ComputerTerminal_Setup { public static uint CurrentIndex { get; set; } public static void Prefix() { CurrentIndex++; } public static void Postfix(LG_ComputerTerminal __instance) { //IL_0025: 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_0055: 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_0085: 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_00b5: Unknown result type (might be due to invalid IL or missing references) object[] args = new object[9] { CurrentIndex, __instance.ItemKey, ((Component)__instance).transform.position.x, ((Component)__instance).transform.position.y, ((Component)__instance).transform.position.z, ((Component)__instance).transform.rotation.x, ((Component)__instance).transform.rotation.y, ((Component)__instance).transform.rotation.z, ((Component)__instance).transform.rotation.w }; Log.Debug(string.Format("[{0,2}] {1,-13} position {2,13}, {3,13}, {4,13} | rotation {5,13}, {6,13}, {7,13}, {8,13}", args)); } } [HarmonyPatch(typeof(LG_SecurityDoor_Locks), "SetupForChainedPuzzle")] internal class LG_SecurityDoor_Locks_SetupForChainedPuzzle { public static void Postfix(ref ChainedPuzzleInstance puzzleToOpen, LG_SecurityDoor_Locks __instance) { //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Expected O, but got Unknown Log.Debug($"Security door chained puzzle id:{((GameDataBlockBase<ChainedPuzzleDataBlock>)(object)puzzleToOpen.Data).persistentID} name: {puzzleToOpen.Data.PublicAlarmName}"); bool flag = false; int currentPuzzle = 0; for (int i = 0; i < ConfigManager.HackDoorPuzzle.Config.Length; i++) { if (ConfigManager.HackDoorPuzzle.Config[i].internalEnabled && ConfigManager.HackDoorPuzzle.Config[i].ChainedPuzzleToEnterID == ((GameDataBlockBase<ChainedPuzzleDataBlock>)(object)puzzleToOpen.Data).persistentID) { currentPuzzle = i; flag = true; } } if (!flag) { return; } ((Interact_Base)__instance.m_intOpenDoor).SetActive(false); ((Interact_Base)__instance.m_intHack).SetActive(true); if (ConfigManager.HackDoorPuzzle.Config[currentPuzzle].SetInteractionMessage) { __instance.m_intOpenDoor.InteractionMessage = ((Interact_Timed)__instance.m_intHack).InteractionMessage; } LG_GenericHackable val = ((Component)__instance).gameObject.AddComponent<LG_GenericHackable>(); CellSoundPlayer sound = new CellSoundPlayer(((Component)__instance).transform.position); val.OnHackSuccess += __instance.OnPuzzleHackIntroSolved; val.OnHackSuccess += Action.op_Implicit((Action)delegate { sound.Stop(); }); val.OnHackingMiss += Action<AIG_CourseNode>.op_Implicit((Action<AIG_CourseNode>)delegate(AIG_CourseNode node) { //IL_0090: 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) sound.Post(ConfigManager.HackDoorPuzzle.Config[currentPuzzle].SoundEventID, true); sound.Post(ConfigManager.HackDoorPuzzle.Config[currentPuzzle].SoundAlarmID, true); if (SNet.IsMaster) { ushort num = default(ushort); Mastermind.Current.TriggerSurvivalWave(node, ConfigManager.HackDoorPuzzle.Config[currentPuzzle].WaveSettingsID, ConfigManager.HackDoorPuzzle.Config[currentPuzzle].WavePopulationDataID, ref num, (SurvivalWaveSpawnType)0, 0f, 2f, true, false, default(Vector3), ""); Log.Debug("Hack missed on zone door!"); } }); val.Setup(); __instance.m_intHack.Hackable = ((Il2CppObjectBase)val).Cast<iHackable>(); Log.Debug($"Added hack lock to zone door with chained puzzle id {((GameDataBlockBase<ChainedPuzzleDataBlock>)(object)puzzleToOpen.Data).persistentID}"); } } [HarmonyPatch(typeof(LG_WeakDoorBladeDamage), "MeleeDamage")] internal class LG_WeakDoorBladeDamage_MeleeDamage { public static float damageMem; public static void Prefix(ref float dam, float environmentMulti) { damageMem = dam * environmentMulti * ConfigManager.WeakDoorDamage.Config.MeleeDamageMultiplier; Log.Debug($"WeakDoor MeleeDamage:\n{dam} Damage\n{environmentMulti} EnvironmentMulti\n{ConfigManager.WeakDoorDamage.Config.MeleeDamageMultiplier} WeakDoor MeleeDamageMultiplier\nresult of {damageMem} damage recorded"); } public static void Postfix(ref float dam, float environmentMulti) { damageMem = 0f; } } [HarmonyPatch(typeof(LG_WeakDoor), "AttemptDamage")] internal class LG_WeakDoor_AttemptDamage { public static bool Prefix(LG_WeakDoor __instance, Vector3 sourcePos) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (LG_WeakDoorBladeDamage_MeleeDamage.damageMem == 0f) { return true; } __instance.m_sync.AttemptDoorInteraction((eDoorInteractionType)7, LG_WeakDoorBladeDamage_MeleeDamage.damageMem, 0f, sourcePos, (Agent)null); Log.Debug($"Attempting custom damagevalue on weakdoor of {LG_WeakDoorBladeDamage_MeleeDamage.damageMem}"); return false; } } [HarmonyPatch(typeof(MeleeWeaponFirstPerson), "DoAttackDamage")] internal class MeleeWeaponFirstPerson_DoAttackDamage { public static void Prefix(MeleeWeaponFirstPerson __instance) { if (!ConfigManager.DifficultyScale.Config.internalEnabled) { return; } switch (SNet.SessionHub.PlayersInSession.Count) { case 1: if (ConfigManager.DifficultyScale.Config.Solo.enabled && ConfigManager.DifficultyScale.Config.Solo.HammerDamage != 1f) { __instance.m_damageToDeal *= ConfigManager.DifficultyScale.Config.Solo.HammerDamage; } break; case 2: if (ConfigManager.DifficultyScale.Config.Duo.enabled && ConfigManager.DifficultyScale.Config.Duo.HammerDamage != 1f) { __instance.m_damageToDeal *= ConfigManager.DifficultyScale.Config.Duo.HammerDamage; } break; case 3: if (ConfigManager.DifficultyScale.Config.Trio.enabled && ConfigManager.DifficultyScale.Config.Trio.HammerDamage != 1f) { __instance.m_damageToDeal *= ConfigManager.DifficultyScale.Config.Trio.HammerDamage; } break; case 4: if (ConfigManager.DifficultyScale.Config.Full.enabled && ConfigManager.DifficultyScale.Config.Full.HammerDamage != 1f) { __instance.m_damageToDeal *= ConfigManager.DifficultyScale.Config.Full.HammerDamage; } break; default: Log.Warning("Abnormal number of players detected in session"); break; } } } [HarmonyPatch(typeof(MineDeployerFirstPerson), "Setup")] internal class MineDeployerFirstPerson_Setup { public static void Prefix(ref ItemDataBlock data, MineDeployerFirstPerson __instance) { Log.Debug($"Mine Deployer Setup\n\tm_deployPickupInteractionDuration:{__instance.m_deployPickupInteractionDuration}\n\tm_timeBetweenPlacements:{__instance.m_timeBetweenPlacements}"); Dex.Tweaker.DataTransfer.Mine[] config = ConfigManager.Mine.Config; foreach (Dex.Tweaker.DataTransfer.Mine mine in config) { if (mine.internalEnabled && mine.ItemID == ((GameDataBlockBase<ItemDataBlock>)(object)data).persistentID) { __instance.m_deployPickupInteractionDuration = mine.DeployPickupInteractionDuration; __instance.m_timeBetweenPlacements = mine.TimeBetweenPlacements; break; } } } } [HarmonyPatch(typeof(MineDeployerInstance_Detonate_Explosive), "Setup")] internal class MineDeployerInstance_Detonate_Explosive_Setup { public static void Prefix(ref iMineDeployerInstanceCore core, MineDeployerInstance_Detonate_Explosive __instance) { Log.Debug($"Mine Explosive Setup\n\tdelay:{__instance.m_delay}\n\tradius:{__instance.m_radius}\n\tdistanceMin:{__instance.m_distanceMin}\n\tdistanceMax:{__instance.m_distanceMax}\n\tdamageMin:{__instance.m_damageMin}\n\tdamageMax:{__instance.m_damageMax}\n\texplosionForce:{__instance.m_explosionForce}\n\texplosionDelay:{__instance.m_explosionDelay}"); Dex.Tweaker.DataTransfer.Mine[] config = ConfigManager.Mine.Config; foreach (Dex.Tweaker.DataTransfer.Mine mine in config) { if (mine.internalEnabled && mine.ItemID == ((GameDataBlockBase<ItemDataBlock>)(object)((Item)((PlayerInventoryBase)core.Owner.FPItemHolder.m_inventoryLocal).WieldedItem).ItemDataBlock).persistentID) { __instance.m_delay = mine.Delay; __instance.m_radius = mine.Radius; __instance.m_distanceMin = mine.Distance.Min; __instance.m_distanceMax = mine.Distance.Max; __instance.m_damageMin = mine.Damage.Min; __instance.m_damageMax = mine.Damage.Max; __instance.m_explosionForce = mine.Force; __instance.m_explosionDelay = mine.ExplosionDelay; break; } } } } [HarmonyPatch(typeof(NavMeshBuilder), "UpdateNavMeshDataAsync")] internal class NavMeshBuilder_UpdateNavMeshDataAsync { public static void Prefix(ref NavMeshBuildSettings buildSettings) { //IL_04aa: Unknown result type (might be due to invalid IL or missing references) StringBuilder stringBuilder = new StringBuilder("Nav Mesh Build original settings\n"); StringBuilder stringBuilder2 = stringBuilder; StringBuilder stringBuilder3 = stringBuilder2; StringBuilder.AppendInterpolatedStringHandler handler = new StringBuilder.AppendInterpolatedStringHandler(13, 1, stringBuilder2); handler.AppendLiteral("\tAgent climb:"); handler.AppendFormatted(((NavMeshBuildSettings)(ref buildSettings)).agentClimb); stringBuilder3.AppendLine(ref handler); stringBuilder2 = stringBuilder; StringBuilder stringBuilder4 = stringBuilder2; handler = new StringBuilder.AppendInterpolatedStringHandler(14, 1, stringBuilder2); handler.AppendLiteral("\tAgent height:"); handler.AppendFormatted(((NavMeshBuildSettings)(ref buildSettings)).agentHeight); stringBuilder4.AppendLine(ref handler); stringBuilder2 = stringBuilder; StringBuilder stringBuilder5 = stringBuilder2; handler = new StringBuilder.AppendInterpolatedStringHandler(14, 1, stringBuilder2); handler.AppendLiteral("\tAgent radius:"); handler.AppendFormatted(((NavMeshBuildSettings)(ref buildSettings)).agentRadius); stringBuilder5.AppendLine(ref handler); stringBuilder2 = stringBuilder; StringBuilder stringBuilder6 = stringBuilder2; handler = new StringBuilder.AppendInterpolatedStringHandler(13, 1, stringBuilder2); handler.AppendLiteral("\tAgent slope:"); handler.AppendFormatted(((NavMeshBuildSettings)(ref buildSettings)).agentSlope); stringBuilder6.AppendLine(ref handler); stringBuilder2 = stringBuilder; StringBuilder stringBuilder7 = stringBuilder2; handler = new StringBuilder.AppendInterpolatedStringHandler(17, 1, stringBuilder2); handler.AppendLiteral("\tMin region area:"); handler.AppendFormatted(((NavMeshBuildSettings)(ref buildSettings)).minRegionArea); stringBuilder7.AppendLine(ref handler); stringBuilder2 = stringBuilder; StringBuilder stringBuilder8 = stringBuilder2; handler = new StringBuilder.AppendInterpolatedStringHandler(20, 1, stringBuilder2); handler.AppendLiteral("\tOverride tile size:"); handler.AppendFormatted(((NavMeshBuildSettings)(ref buildSettings)).overrideTileSize); stringBuilder8.AppendLine(ref handler); stringBuilder2 = stringBuilder; StringBuilder stringBuilder9 = stringBuilder2; handler = new StringBuilder.AppendInterpolatedStringHandler(21, 1, stringBuilder2); handler.AppendLiteral("\tOverride voxel size:"); handler.AppendFormatted(((NavMeshBuildSettings)(ref buildSettings)).overrideVoxelSize); stringBuilder9.AppendLine(ref handler); stringBuilder2 = stringBuilder; StringBuilder stringBuilder10 = stringBuilder2; handler = new StringBuilder.AppendInterpolatedStringHandler(11, 1, stringBuilder2); handler.AppendLiteral("\tTile size:"); handler.AppendFormatted(((NavMeshBuildSettings)(ref buildSettings)).tileSize); stringBuilder10.AppendLine(ref handler); stringBuilder2 = stringBuilder; StringBuilder stringBuilder11 = stringBuilder2; handler = new StringBuilder.AppendInterpolatedStringHandler(12, 1, stringBuilder2); handler.AppendLiteral("\tVoxel size:"); handler.AppendFormatted(((NavMeshBuildSettings)(ref buildSettings)).voxelSize); stringBuilder11.AppendLine(ref handler); if (!ConfigManager.NavMesh.Config.internalEnabled) { Log.Debug(stringBuilder.ToString()); return; } ((NavMeshBuildSettings)(ref buildSettings)).agentClimb = ConfigManager.NavMesh.Config.Agent.Climb; ((NavMeshBuildSettings)(ref buildSettings)).agentHeight = ConfigManager.NavMesh.Config.Agent.Height; ((NavMeshBuildSettings)(ref buildSettings)).agentRadius = ConfigManager.NavMesh.Config.Agent.Radius; ((NavMeshBuildSettings)(ref buildSettings)).agentSlope = ConfigManager.NavMesh.Config.Agent.Slope; ((NavMeshBuildSettings)(ref buildSettings)).minRegionArea = ConfigManager.NavMesh.Config.minRegionArea; ((NavMeshBuildSettings)(ref buildSettings)).overrideTileSize = ConfigManager.NavMesh.Config.Override.TileSize; ((NavMeshBuildSettings)(ref buildSettings)).overrideVoxelSize = ConfigManager.NavMesh.Config.Override.VoxelSize; ((NavMeshBuildSettings)(ref buildSettings)).tileSize = ConfigManager.NavMesh.Config.TileSize; Dex.Tweaker.Core.NavMesh.VoxelSize = ConfigManager.NavMesh.Config.Agent.Radius / ConfigManager.NavMesh.Config.VoxelSizeDenominator; ((NavMeshBuildSettings)(ref buildSettings)).voxelSize = Dex.Tweaker.Core.NavMesh.VoxelSize; stringBuilder.AppendLine("Nav Mesh Build settings\n"); stringBuilder2 = stringBuilder; StringBuilder stringBuilder12 = stringBuilder2; handler = new StringBuilder.AppendInterpolatedStringHandler(13, 1, stringBuilder2); handler.AppendLiteral("\tAgent climb:"); handler.AppendFormatted(((NavMeshBuildSettings)(ref buildSettings)).agentClimb); stringBuilder12.AppendLine(ref handler); stringBuilder2 = stringBuilder; StringBuilder stringBuilder13 = stringBuilder2; handler = new StringBuilder.AppendInterpolatedStringHandler(14, 1, stringBuilder2); handler.AppendLiteral("\tAgent height:"); handler.AppendFormatted(((NavMeshBuildSettings)(ref buildSettings)).agentHeight); stringBuilder13.AppendLine(ref handler); stringBuilder2 = stringBuilder; StringBuilder stringBuilder14 = stringBuilder2; handler = new StringBuilder.AppendInterpolatedStringHandler(14, 1, stringBuilder2); handler.AppendLiteral("\tAgent radius:"); handler.AppendFormatted(((NavMeshBuildSettings)(ref buildSettings)).agentRadius); stringBuilder14.AppendLine(ref handler); stringBuilder2 = stringBuilder; StringBuilder stringBuilder15 = stringBuilder2; handler = new StringBuilder.AppendInterpolatedStringHandler(13, 1, stringBuilder2); handler.AppendLiteral("\tAgent slope:"); handler.AppendFormatted(((NavMeshBuildSettings)(ref buildSettings)).agentSlope); stringBuilder15.AppendLine(ref handler); stringBuilder2 = stringBuilder; StringBuilder stringBuilder16 = stringBuilder2; handler = new StringBuilder.AppendInterpolatedStringHandler(17, 1, stringBuilder2); handler.AppendLiteral("\tMin region area:"); handler.AppendFormatted(((NavMeshBuildSettings)(ref buildSettings)).minRegionArea); stringBuilder16.AppendLine(ref handler); stringBuilder2 = stringBuilder; StringBuilder stringBuilder17 = stringBuilder2; handler = new StringBuilder.AppendInterpolatedStringHandler(20, 1, stringBuilder2); handler.AppendLiteral("\tOverride tile size:"); handler.AppendFormatted(((NavMeshBuildSettings)(ref buildSettings)).overrideTileSize); stringBuilder17.AppendLine(ref handler); stringBuilder2 = stringBuilder; StringBuilder stringBuilder18 = stringBuilder2; handler = new StringBuilder.AppendInterpolatedStringHandler(21, 1, stringBuilder2); handler.AppendLiteral("\tOverride voxel size:"); handler.AppendFormatted(((NavMeshBuildSettings)(ref buildSettings)).overrideVoxelSize); stringBuilder18.AppendLine(ref handler); stringBuilder2 = stringBuilder; StringBuilder stringBuilder19 = stringBuilder2; handler = new StringBuilder.AppendInterpolatedStringHandler(11, 1, stringBuilder2); handler.AppendLiteral("\tTile size:"); handler.AppendFormatted(((NavMeshBuildSettings)(ref buildSettings)).tileSize); stringBuilder19.AppendLine(ref handler); stringBuilder2 = stringBuilder; StringBuilder stringBuilder20 = stringBuilder2; handler = new StringBuilder.AppendInterpolatedStringHandler(12, 1, stringBuilder2); handler.AppendLiteral("\tVoxel size:"); handler.AppendFormatted(((NavMeshBuildSettings)(ref buildSettings)).voxelSize); stringBuilder20.AppendLine(ref handler); if (ConfigManager.UseDebugNavMesh.Value && (Object)(object)Dex.Tweaker.Core.Debug.VisualNavMesh != (Object)null) { Dex.Tweaker.Core.Debug.VisualNavMesh.SetActive(false); Dex.Tweaker.Core.Debug.VisualNavMesh.transform.localPosition = Vector3.zero; } Log.Debug(stringBuilder.ToString()); } } [HarmonyPatch(typeof(PlayerAgent), "Setup")] internal class PlayerAgent_Setup { public static void Postfix(PlayerAgent __instance) { //IL_0032: 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 (ConfigManager.PlayerModifier.Config.internalEnabled && ConfigManager.PlayerModifier.Config.ModelScale != 1f) { ((Component)__instance.PlayerSyncModel).transform.localScale = Vector3.one * ConfigManager.PlayerModifier.Config.ModelScale; } } } [HarmonyPatch(typeof(PlayerBackpackManager), "PickupHealthRel")] internal class PlayerBackpackManager_PickupHealthRel { public static void Prefix(ref float amountRel) { if (ConfigManager.ResourcePack.Config.internalEnabled && Dex.Tweaker.Core.ResourcePack.ObjectiveModifiers.TryGetValue(((GameDataBlockBase<WardenObjectiveDataBlock>)(object)WardenObjectiveManager.Current.m_activeWardenObjectives[(LG_LayerType)0]).persistentID, out ObjectiveResourceModifier value) && value.internalEnabled) { amountRel *= value.healthAmountMulti; } } } [HarmonyPatch(typeof(PlayerBackpackManager), "ReceiveAmmoGive")] internal class PlayerBackpackManager_ReceiveAmmoGive { public static void Prefix(ref pAmmoGive data) { //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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected I4, but got Unknown if (!ConfigManager.ResourcePack.Config.internalEnabled) { return; } Log.Error("Resource pack config enabled"); SNet_Player val = default(SNet_Player); ((pPlayer)(ref data.targetPlayer)).TryGetPlayer(ref val); PlayerBackpack val2 = default(PlayerBackpack); PlayerBackpackManager.TryGetBackpack(val, ref val2); Enumerator<BackpackItem> enumerator = val2.BackpackItems.GetEnumerator(); while (enumerator.MoveNext()) { BulletWeapon val3 = ((Il2CppObjectBase)enumerator.Current).TryCast<BulletWeapon>(); if ((Object)(object)val3 == (Object)null || !Dex.Tweaker.Core.ResourcePack.WeaponModifiers.TryGetValue(((GameDataBlockBase<ArchetypeDataBlock>)(object)((ItemEquippable)val3).ArchetypeData).persistentID, out WeaponResourceModifier value)) { continue; } AmmoType ammoType = ((ItemEquippable)val3).AmmoType; switch ((int)ammoType) { case 0: if (data.ammoStandardRel > 0f) { data.ammoStandardRel = value.ammopackAmountRel; } break; case 1: if (data.ammoSpecialRel > 0f) { data.ammoSpecialRel = value.ammopackAmountRel; } break; case 2: if (data.ammoClassRel > 0f) { data.ammoClassRel = value.ammopackAmountRel; } break; } } if (Dex.Tweaker.Core.ResourcePack.ObjectiveModifiers.TryGetValue(((GameDataBlockBase<WardenObjectiveDataBlock>)(object)WardenObjectiveManager.Current.m_activeWardenObjectives[(LG_LayerType)0]).persistentID, out ObjectiveResourceModifier value2) && value2.internalEnabled) { data.ammoStandardRel *= value2.ammoStandardMulti; data.ammoSpecialRel *= value2.ammoSpecialMulti; data.ammoClassRel *= value2.ammoClassMulti; } } } [HarmonyPatch(typeof(PlayerLocomotion), "AddExternalPushForce")] internal class PlayerLocomotion_AddExternalPushForce { public static void Prefix(ref Vector3 force) { //IL_0029: 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) if (ConfigManager.PlayerModifier.Config.internalEnabled && ConfigManager.PlayerModifier.Config.SlideForceScale != 1f) { force *= ConfigManager.PlayerModifier.Config.SlideForceScale; } } } [HarmonyPatch(typeof(PLOC_Stand), "Update")] internal class PLOC_Stand_Update { public static void Postfix(PLOC_Stand __instance) { if (ConfigManager.PlayerModifier.Config.internalEnabled && ConfigManager.PlayerModifier.Config.EvadeSpeed != 3f && __instance.m_moveSpeedMulti == 3f) { __instance.m_moveSpeedMulti = ConfigManager.PlayerModifier.Config.EvadeSpeed; } } } [HarmonyPatch(typeof(SentryGunInstance), "GiveAmmoRel")] internal static class SentryGunInstance_GiveAmmoRel { private static void Prefix(ref float ammoClassRel) { if (ConfigManager.ResourcePack.Config.internalEnabled && Dex.Tweaker.Core.ResourcePack.ObjectiveModifiers.TryGetValue(((GameDataBlockBase<WardenObjectiveDataBlock>)(object)WardenObjectiveManager.Current.m_activeWardenObjectives[(LG_LayerType)0]).persistentID, out ObjectiveResourceModifier value) && value.internalEnabled) { ammoClassRel *= value.ammoClassMulti; } } } [HarmonyPatch(typeof(WardenObjectiveManager), "OnLocalPlayerStartExpedition")] internal class WardenObjectiveManager_OnLocalPlayerStartExpedition_2 { public static void Postfix() { if (!ConfigManager.PlayerAIBot.Config.InternalEnabled) { return; } PlayerAIBot.s_playerInSightMaxDistance = ConfigManager.PlayerAIBot.Config.PlayerInSightMaxDistance; PlayerAIBot.s_playerInSightMinCos = ConfigManager.PlayerAIBot.Config.PlayerInSightMinCos; PlayerAIBot.s_recognisedItemTypes.Clear(); foreach (uint recognizedItemType in ConfigManager.PlayerAIBot.Config.RecognizedItemTypes) { PlayerAIBot.s_recognisedItemTypes.Add(recognizedItemType); } PlayerAIBot.s_sleeperCheckIntervalNeg = ConfigManager.PlayerAIBot.Config.SleeperCheckIntervalNeg; PlayerAIBot.s_sleeperCheckIntervalPos = ConfigManager.PlayerAIBot.Config.SleeperCheckIntervalPos; PlayerAIBot.s_sleeperCheckMaxDistance = ConfigManager.PlayerAIBot.Config.SleeperCheckMaxDistance; PlayerAIBot.s_sleeperCheckMaxDistanceSQ = ConfigManager.PlayerAIBot.Config.SleeperCheckMaxDistanceSQ; PlayerAIBot.s_sleeperCheckResetDistance = ConfigManager.PlayerAIBot.Config.SleeperCheckResetDistance; PlayerAIBot.s_sleeperCheckResetDistanceSQ = ConfigManager.PlayerAIBot.Config.SleeperCheckResetDistanceSQ; PlayerAIBot.s_twitchingSleeperCheckDistance = ConfigManager.PlayerAIBot.Config.TwitchingSleeperCheckDistance; PlayerAIBot.s_twitchingSleeperCheckDistanceSQ = ConfigManager.PlayerAIBot.Config.TwitchingSleeperCheckDistanceSQ; RootPlayerBotAction.s_collectItemSearchDistance = ConfigManager.PlayerAIBot.Config.RootPlayerBotAction.CollectItemSearchDistance; RootPlayerBotAction.s_collectItemStandDistance = ConfigManager.PlayerAIBot.Config.RootPlayerBotAction.CollectItemStandDistance; ((Il2CppArrayBase<float>)(object)RootPlayerBotAction.s_combatDistanceMinMax)[0] = ConfigManager.PlayerAIBot.Config.RootPlayerBotAction.CombatDistanceMin; ((Il2CppArrayBase<float>)(object)RootPlayerBotAction.s_combatDistanceMinMax)[1] = ConfigManager.PlayerAIBot.Config.RootPlayerBotAction.CombatDistanceMax; ((Il2CppArrayBase<float>)(object)RootPlayerBotAction.s_enemiesTagDelay)[0] = ConfigManager.PlayerAIBot.Config.RootPlayerBotAction.EnemiesTagDelayA; ((Il2CppArrayBase<float>)(object)RootPlayerBotAction.s_enemiesTagDelay)[1] = ConfigManager.PlayerAIBot.Config.RootPlayerBotAction.EnemiesTagDelayB; RootPlayerBotAction.s_flashlightOnDelay = ConfigManager.PlayerAIBot.Config.RootPlayerBotAction.FlashlightOnDelay; RootPlayerBotAction.s_followLeaderMaxDistance = ConfigManager.PlayerAIBot.Config.RootPlayerBotAction.FollowLeaderMaxDistance; RootPlayerBotAction.s_followLeaderRadius = ConfigManager.PlayerAIBot.Config.RootPlayerBotAction.FollowLeaderRadius; RootPlayerBotAction.s_gateScanSearchDistance = ConfigManager.PlayerAIBot.Config.RootPlayerBotAction.GateScanSearchDistance; ((Il2CppArrayBase<float>)(object)RootPlayerBotAction.s_gateScanStandDistance)[0] = ConfigManager.PlayerAIBot.Config.RootPlayerBotAction.GateScanStandDistanceA; ((Il2CppArrayBase<float>)(object)RootPlayerBotAction.s_gateScanStandDistance)[1] = ConfigManager.PlayerAIBot.Config.RootPlayerBotAction.GateScanStandDistanceB; RootPlayerBotAction.s_highlightSearchDistance = ConfigManager.PlayerAIBot.Config.RootPlayerBotAction.HighlightSearchDistance; RootPlayerBotAction.s_highlightStandDistance = ConfigManager.PlayerAIBot.Config.RootPlayerBotAction.HighlightStandDistance; PlayerBotActionFollow.s_SearchRadiusMul = ConfigManager.PlayerAIBot.Config.PlayerBotActionFollow.SearchRadiusMul; PlayerBotActionFollow.s_VerifyRadiusMul = ConfigManager.PlayerAIBot.Config.PlayerBotActionFollow.VerifyRadiusMul; PlayerBotActionIdle.s_equipWeaponDelay = ConfigManager.PlayerAIBot.Config.PlayerBotActionIdle.EquipWeaponDelay; PlayerBotActionUseBioscan.s_SearchRadiusMul = ConfigManager.PlayerAIBot.Config.PlayerBotActionUseBioscan.SearchRadiusMul; PlayerBotActionUseBioscan.s_VerifyCurrentPositionRadiusMul = ConfigManager.PlayerAIBot.Config.PlayerBotActionUseBioscan.VerifyCurrentPositionRadiusMul; PlayerBotActionAttack.s_meleeReach = ConfigManager.PlayerAIBot.Config.PlayerBotActionAttack.MeleeReach; ((Il2CppArrayBase<float>)(object)PlayerBotActionAttack.s_optimalBulletRange)[0] = ConfigManager.PlayerAIBot.Config.PlayerBotActionAttack.OptimalBulletRangeA; ((Il2CppArrayBase<float>)(object)PlayerBotActionAttack.s_optimalBulletRange)[1] = ConfigManager.PlayerAIBot.Config.PlayerBotActionAttack.OptimalBulletRangeB; ((Il2CppArrayBase<float>)(object)PlayerBotActionAttack.s_optimalMeleeRange)[0] = ConfigManager.PlayerAIBot.Config.PlayerBotActionAttack.OptimalMeleeRangeA; ((Il2CppArrayBase<float>)(object)PlayerBotActionAttack.s_optimalMeleeRange)[1] = ConfigManager.PlayerAIBot.Config.PlayerBotActionAttack.OptimalMeleeRangeB; PlayerBotActionRevive.s_ApproachRadius = ConfigManager.PlayerAIBot.Config.PlayerBotActionRevive.ApproachRadius; PlayerBotActionRevive.s_TravelHaste = ConfigManager.PlayerAIBot.Config.PlayerBotActionRevive.TravelHaste; PlayerBotActionRevive.s_VerifyRadiusMul = ConfigManager.PlayerAIBot.Config.PlayerBotActionRevive.VerifyRadiusMul; PlayerBotActionUseEnemyScanner.s_ApproachRadius = ConfigManager.PlayerAIBot.Config.PlayerBotActionUseEnemyScanner.ApproachRadius; PlayerBotActionUseEnemyScanner.s_nrScanAngles = ConfigManager.PlayerAIBot.Config.PlayerBotActionUseEnemyScanner.NrScanAngles; PlayerBotActionUseEnemyScanner.s_scanDurationPerAngle = ConfigManager.PlayerAIBot.Config.PlayerBotActionUseEnemyScanner.ScanDurationPerAngle; PlayerBotActionUseEnemyScanner.s_VerifyRadiusMul = ConfigManager.PlayerAIBot.Config.PlayerBotActionUseEnemyScanner.VerifyRadiusMul; PlayerBotActionCollectItem.s_range = ConfigManager.PlayerAIBot.Config.PlayerBotActionCollectItem.Range; PlayerBotActionCollectItem.s_transferDuration = ConfigManager.PlayerAIBot.Config.PlayerBotActionCollectItem.TransferDuration; PlayerBotActionShareResourcePack.s_ApproachRadius = ConfigManager.PlayerAIBot.Config.PlayerBotActionShareResourcePack.ApproachRadius; PlayerBotActionShareResourcePack.s_duration = ConfigManager.PlayerAIBot.Config.PlayerBotActionShareResourcePack.Duration; PlayerBotActionShareResourcePack.s_VerifyRadiusMul = ConfigManager.PlayerAIBot.Config.PlayerBotActionShareResourcePack.VerifyRadiusMul; PlayerBotActionEvadeProjectile.s_evasionStartETA = ConfigManager.PlayerAIBot.Config.PlayerBotActionEvadeProjectile.EvasionStartETA; PlayerBotActionEvadeProjectile.s_lookStartETA = ConfigManager.PlayerAIBot.Config.PlayerBotActionEvadeProjectile.lookStartETA; PlayerBotActionEvadeProjectile.s_sideStepDistance = ConfigManager.PlayerAIBot.Config.PlayerBotActionEvadeProjectile.SideStepDistance; } } [HarmonyPatch(typeof(WardenObjectiveManager), "OnLocalPlayerStartExpedition")] internal class WardenObjectiveManager_OnLocalPlayerStartExpedition_3 { public static void Postfix() { Dex.Tweaker.Core.InfectionSpitter.Load(); if (!Dex.Tweaker.Core.InfectionSpitter.SpitterModifiers.TryGetValue(RundownManager.ActiveExpedition.LevelLayoutData, out InfectionSpitterConfig value)) { SetValues(Dex.Tweaker.DataTransfer.InfectionSpitter.DefaultSpitterConfig); } else { SetValues(value); } } public static void SetValues(InfectionSpitterConfig config) { //IL_0021: 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) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_00dd: 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) InfectionSpitter.s_dangerColor = new Color(config.DangerColor.X, config.DangerColor.Y, config.DangerColor.Z); InfectionSpitter.s_glowColor = new Color(config.GlowColor.X, config.GlowColor.Y, config.GlowColor.Z); InfectionSpitter.s_startGlowColor = new Color(config.StartGlowColor.X, config.StartGlowColor.Y, config.StartGlowColor.Z); InfectionSpitter.s_retractedMinScale = new Vector3(config.RetractedMinScale.X, config.RetractedMinScale.Y, config.RetractedMinScale.Z); Enumerator<InfectionSpitter> enumerator = InfectionSpitter.s_allSpitters.GetEnumerator(); while (enumerator.MoveNext()) { InfectionSpitter current = enumerator.Current; current.m_scaleOrg *= config.ScaleMulti; Transform transform = ((Component)current).transform; transform.localScale *= config.ScaleMulti; current.m_retractSpeed *= config.RetractSpeedMulti; current.m_expandSpeed *= config.ExpandSpeedMulti; current.m_lightRetractSpeed *= config.LightRetractSpeedMulti; } } } [HarmonyPatch(typeof(WardenObjectiveManager), "OnLocalPlayerStartExpedition")] internal class WardenObjective_OnLocalPlayerStartExpedition { public static void Postfix() { Dex.Tweaker.Core.ObjectiveModifier.Load(); } } } namespace Dex.Tweaker.DataTransfer { internal class BioTracker { public float scanConeDotMin { get; set; } = 0.85f; public float maxScanWorldRadius { get; set; } = 70f; public float localObjRadius { get; set; } = 0.15f; public float enemyObjMinScale { get; set; } = 0.25f; public int maxObjs { get; set; } = 20; public int maxCourseNodeDistance { get; set; } = 3; public float scanDelay { get; set; } = 1.5f; public float pulseDuration { get; set; } = 0.5f; public float posDelay { get; set; } = 0.85f; public float tagDuration { get; set; } = 1f; public float rechargeDuration { get; set; } = 8.5f; public uint ItemID { get; set; } = 28u; public string name { get; set; } = "Default"; public bool internalEnabled { get; set; } } internal abstract class ConfigBaseMultiple<T> where T : new() { [JsonIgnore] public T[] Config { get; private set; } public virtual string GetFileName => typeof(T).Name + ".json"; public ConfigBaseMultiple() { string path = Path.Combine(MTFOInfo.CustomPath, "Tweaker", GetFileName); if (File.Exists(path)) { Config = JsonSerializer.Deserialize<T[]>(File.ReadAllText(path)); } else { Config = new T[1] { new T() }; File.WriteAllText(path, JsonSerializer.Serialize(Config, new JsonSerializerOptions { WriteIndented = true })); } Log.Debug("Loaded " + GetFileName); OnConfigLoaded(); } public abstract void OnConfigLoaded(); } internal abstract class ConfigBaseSingle<T> where T : new() { [JsonIgnore] public T Config { get; private set; } public virtual string GetFileName => typeof(T).Name + ".json"; public ConfigBaseSingle() { string path = Path.Combine(MTFOInfo.CustomPath, "Tweaker", GetFileName); if (File.Exists(path)) { Config = JsonSerializer.Deserialize<T>(File.ReadAllText(path)); } else { Config = new T(); File.WriteAllText(path, JsonSerializer.Serialize(Config, new JsonSerializerOptions { WriteIndented = true })); } Log.Debug("Loaded " + GetFileName); OnConfigLoaded(); } public abstract void OnConfigLoaded(); } internal class DifficultyScale { public Scale Solo { get; set; } = new Scale(); public Scale Duo { get; set; } = new Scale(); public Scale Trio { get; set; } = new Scale(); public Scale Full { get; set; } = new Scale(); public bool internalEnabled { get; set; } } internal class ElevatorCargo { public uint DataBlockId { get; set; } = 34u; public uint[] ItemID { get; set; } = new uint[1] { 133u }; public bool ForceDisable { get; set; } public bool OverrideObjectiveSpawns { get; set; } public string name { get; set; } = "Fog Turbine"; public bool internalEnabled { get; set; } } internal class ExpeditionButton { [JsonIgnore] private float x; [JsonIgnore] private float y; [JsonIgnore] private float z; public string Decrypt { get; set; } public string Label { get; set; } public bool Heat { get; set; } public string Status { get; set; } public float Scale { get; set; } public Vector3 Position { get; set; } public ExpeditionButton() { } public ExpeditionButton(string label, float scale, float x, float y, float z, string decrypt = null, bool heat = false, string status = null) { Decrypt = decrypt; Label = label; Heat = heat; Status = status; Scale = scale; Position = new Vector3(x, y, z); } } internal class FoamLauncher { public float TimeToMaxPressure { get; set; } = 2.5f; public float TimeToDepleatePressure { get; set; } = 0.8f; public float PressureProgressToFire { get; set; } = 0.075f; public MinMax MeterAngPressure { get; set; } = new MinMax(112f, -108f); public MinMax FireDelay { get; set; } = new MinMax(0.2f, 2f); public MinMax ForceSize { get; set; } = new MinMax(14f, 16f); public MinMax Spread { get; set; } = new MinMax(1f, 7f); public MinMaxInt BurstShots { get; set; } = new MinMaxInt(1, 12); public float BurstShotDelay { get; set; } = 0.08f; public float NoiseScaleTarget { get; set; } = 0.005f; public float NoiseIntensity { get; set; } = 15f; public float MeterShakeAng { get; set; } = 8f; public float SyncTimeout { get; set; } = 2f; public uint ItemID { get; set; } = 73u; public string name { get; set; } = "Default"; public bool internalEnabled { get; set; } } internal class GamerGlowstick { public uint ItemID { get; set; } = 130u; public float PulseRate { get; set; } = 1f; public RGB Max { get; set; } = new RGB(0.8f, 0.8f, 0.8f); public RGB Min { get; set; } = new RGB(0.4f, 0.4f, 0.4f); public bool ToggleLevelLight { get; set; } = true; public bool internalEnabled { get; set; } } internal class HackDoorPuzzle { public uint ChainedPuzzleToEnterID { get; set; } = 84u; public uint WaveSettingsID { get; set; } = 3u; public uint WavePopulationDataID { get; set; } = 1u; public uint SoundEventID { get; set; } = EVENTS.HACKING_PUZZLE_LOCK_ALARM; public uint SoundAlarmID { get; set; } = EVENTS.DOOR_ALARM; public bool SetInteractionMessage { get; set; } = true; public string name { get; set; } = "Default"; public bool internalEnabled { get; set; } } internal class Hammer { public MinMax Damage { get; set; } = new MinMax(4f, 20f); public float PrecisionDamageMulti { get; set; } = 1f; public float CameraDamageRayLength { get; set; } = 1.8f; public float InputBufferTime { get; set; } = 0.5f; public float MaxPushFrequency { get; set; } = 1.2f; public float AttackDamageSphereDotScale { get; set; } = 0.9f; public float PushDamageSphereRadius { get; set; } = 0.6f; public float SyncTimeout { get; set; } = 2f; public float BufferedAttackTime { get; set; } = -1f; public float BufferedPushTime { get; set; } = -1f; public MinMax StaminaSpeed { get; set; } = new MinMax(0.8f, 1f); public float ChargeUpTime { get; set; } = 2f; public float AutoAttackTime { get; set; } = 4f; public HammerData AttackMissRight { get; set; } = new HammerData { AnimBlendIn = 0.2f, AttackLength = 1f, AttackHitTime = 0.3333333f, AttackCamFwdHitTime = 0.5f, DamageStartTime = 0.3333333f, DamageEndTime = 0.7666667f, ComboEarlyTime = 2f / 3f }; public HammerData AttackMissLeft { get; set; } = new HammerData { AnimBlendIn = 0.2f, AttackLength = 1f, AttackHitTime = 0.3333333f, AttackCamFwdHitTime = 0.5f, DamageStartTime = 0.3333333f, DamageEndTime = 0.7666667f, ComboEarlyTime = 2f / 3f }; public HammerData AttackHitRight { get; set; } = new HammerData { AnimBlendIn = 0f, AttackLength = 0.5f, AttackHitTime = 0.5f, ComboEarlyTime = 0.4f }; public HammerData AttackHitLeft { get; set; } = new HammerData { AnimBlendIn = 0f, AttackLength = 0.5f, AttackHitTime = 0.5f, ComboEarlyTime = 0.4f }; public HammerData AttackPush { get; set; } = new HammerData { AnimBlendIn = 0.2f, AttackLength = 2f / 3f, DamageStartTime = 0.1333333f, DamageEndTime = 0.2666667f, AttackCamFwdHitTime = 0.3333333f, ComboEarlyTime = 5f / 6f }; public HammerData AttackChargeUpRight { get; set; } = new HammerData { AnimBlendIn = 0.23f }; public HammerData AttackChargeUpLeft { get; set; } = new HammerData { AnimBlendIn = 0.3f }; public HammerData AttackChargeUpReleaseRight { get; set; } = new HammerData { AnimBlendIn = 0f, AttackLength = 0.3666667f, AttackHitTime = 0.1333333f, DamageStartTime = 0f, DamageEndTime = 0.3666667f, AttackCamFwdHitTime = 0.1333333f, ComboEarlyTime = 0.3f }; public HammerData AttackChargeUpReleaseLeft { get; set; } = new HammerData { AnimBlendIn = 0f, AttackLength = 0.3666667f, AttackHitTime = 0.1333333f, DamageStartTime = 0f, DamageEndTime = 0.3666667f, AttackCamFwdHitTime = 0.1333333f, ComboEarlyTime = 0.3f }; public HammerPart Head { get; set; } = new HammerPart(); public HammerPart Neck { get; set; } = new HammerPart(); public HammerPart Handle { get; set; } = new HammerPart(); public HammerPart Pommel { get; set; } = new HammerPart(); public uint ItemID { get; set; } = 100u; public string name { get; set; } = "Default"; public bool internalEnabled { get; set; } } internal class HammerData { public float AnimBlendIn { get; set; } public float AttackLength { get; set; } public float AttackHitTime { get; set; } public float AttackCamFwdHitTime { get; set; } public float DamageStartTime { get; set; } public float DamageEndTime { get; set; } public float ComboEarlyTime { get; set; } } internal class HammerPart { public Vector3 Scale { get; set; } = new Vector3(1f, 1f, 1f); public Vector3 Position { get; set; } = new Vector3(0f, 0f, 0f); public Vector3 Rotation { get; set; } = new Vector3(0f, 0f, 0f); } internal class Infection { public float Amount { get; set; } = 0.01f; public MinMax Rate { get; set; } = new MinMax(1f, 1.5f); public bool Enabled { get; set; } } internal class InfectionSpitter { public bool InternalEnabled { get; set; } public List<InfectionSpitterConfig> SpitterConfig { get; set; } = new List<InfectionSpitterConfig> { new InfectionSpitterConfig() }; public static InfectionSpitterConfig DefaultSpitterConfig { get; set; } = new InfectionSpitterConfig(); } internal class InfectionSpitterConfig { public uint LevelLayoutID { get; set; } public bool InternalEnabled { get; set; } public Vector3 GlowColor { get; set; } = new Vector3(0.05f, 0.5f, 0.375f); public Vector3 DangerColor { get; set; } = new Vector3(0.2f, 0.1f, 0f); public Vector3 StartGlowColor { get; set; } = new Vector3(0.03f, 0.3f, 0.225f); public Vector3 RetractedMinScale { get; set; } = new Vector3(0.8f, 0.7f, 0.8f); public float ScaleMulti { get; set; } = 1f; public float ExpandSpeedMulti { get; set; } = 1f; public float RetractSpeedMulti { get; set; } = 1f; public float LightRetractSpeedMulti { get; set; } = 1f; public uint SoundEventPreSpit { get; set; } = 3688585605u; public uint SoundEventFoamed { get; set; } = 443010049u; public uint SoundEventScared { get; set; } = 1800579437u; public uint SoundEventPrimed { get; set; } = 1580085442u; public uint SoundEventOut { get; set; } = 483235199u; public uint SoundEventPurrLoop { get; set; } = 1548233641u; public uint SoundEventIn { get; set; } = 600057560u; public uint SoundEventPurrStop { get; set; } = 3829473415u; public uint SoundEventSpit { get; set; } = 3124402583u; public uint SoundEventReleasedFromFoam { get; set; } = 990281653u; } internal class Mine { public float Delay { get; set; } = 0.25f; public float Radius { get; set; } = 2.5f; public MinMax Distance { get; set; } = new MinMax(3f, 15f); public MinMax Damage { get; set; } = new MinMax(15f, 35f); public float Force { get; set; } = 1000f; public float ExplosionDelay { get; set; } = 0.25f; public float DeployPickupInteractionDuration { get; set; } = 0.5f; public float TimeBetweenPlacements { get; set; } = 2f; public uint ItemID { get; set; } = 37u; public string name { get; set; } = "Default"; public bool internalEnabled { get; set; } } internal class MinMax { public float Min { get; set; } public float Max { get; set; } public MinMax(float min, float max) { Min = min; Max = max; } } internal class MinMaxInt { public int Min { get; set; } public int Max { get; set; } public MinMaxInt(int min, int max) { Min = min; Max = max; } } internal class NavMesh { public NavMeshAgent Agent { get; set; } = new NavMeshAgent(); public float minRegionArea { get; set; } public NavMeshOverride Override { get; set; } = new NavMeshOverride(); public int TileSize { get; set; } = 768; public float VoxelSizeDenominator { get; set; } = 3f; public bool MediumQualityObstacleAvoidance { get; set; } = true; public bool ReduceAgentRadius { get; set; } = true; public bool internalEnabled { get; set; } } internal class NavMeshAgent { public float Climb { get; set; } = 0.5f; public float Height { get; set; } = 2f; public float Radius { get; set; } = 0.25f; public float Slope { get; set; } = 55f; } internal class NavMeshOverride { public bool TileSize { get; set; } public bool VoxelSize { get; set; } } internal class ObjectiveModifier { public uint DataBlockId { get; set; } = 34u; public float TimeLimit { get; set; } = 10f; public Infection Infection { get; set; } = new Infection(); public bool ExplodePlayer { get; set; } = true; public string name { get; set; } = "Default"; public bool internalEnabled { get; set; } = true; } internal class ObjectiveResourceModifier { public uint DataBlockId { get; set; } = 34u; public float ammoStandardMulti { get; set; } = 1f; public float ammoSpecialMulti { get; set; } = 1f; public float ammoClassMulti { get; set; } = 1f; public float healthAmountMulti { get; set; } = 1f; public string name { get; set; } = "Default"; public bool internalEnabled { get; set; } } internal class PageExpeditionResult { public string Fail { get; set; } = "EXPEDITION FAILED"; public string Success { get; set; } = "EXPEDITION SUCCESS"; public bool internalEnabled { get; set; } } internal class PlayerAIBot { public float PlayerInSightMaxDistance { get; set; } = 15f; public float PlayerInSightMinCos { get; set; } = 0.9f; public List<uint> RecognizedItemTypes { get; set; } = new List<uint> { 139u, 144u, 117u, 115u, 114u, 130u, 167u, 102u, 101u, 127u, 132u }; public float SleeperCheckIntervalNeg { get; set; } = 10f; public float SleeperCheckIntervalPos { get; set; } = 1.5f; public float SleeperCheckMaxDistance { get; set; } = 25f; public float SleeperCheckMaxDistanceSQ { get; set; } = 625f; public float SleeperCheckResetDistance { get; set; } = 8f; public float SleeperCheckResetDistanceSQ { get; set; } = 64f; public float TwitchingSleeperCheckDistance { get; set; } = 10f; public float TwitchingSleeperCheckDistanceSQ { get; set; } = 100f; public RootPlayerBotAction RootPlayerBotAction { get; set; } = new RootPlayerBotAction(); public PlayerBotActionIdle PlayerBotActionIdle { get; set; } = new PlayerBotActionIdle(); public PlayerBotActionFollow PlayerBotActionFollow { get; set; } = new PlayerBotActionFollow(); public PlayerBotActionUseBioscan PlayerBotActionUseBioscan { get; set; } = new PlayerBotActionUseBioscan(); public PlayerBotActionAttack PlayerBotActionAttack { get; set; } = new PlayerBotActionAttack(); public PlayerBotActionRevive PlayerBotActionRevive { get; set; } = new PlayerBotActionRevive(); public PlayerBotActionUseEnemyScanner PlayerBotActionUseEnemyScanner { get; set; } = new PlayerBotActionUseEnemyScanner(); public PlayerBotActionCollectItem PlayerBotActionCollectItem { get; set; } = new PlayerBotActionCollectItem(); public PlayerBotActionShareResourcePack PlayerBotActionShareResourcePack { get; set; } = new PlayerBotActionShareResourcePack(); public PlayerBotActionEvadeProjectile PlayerBotActionEvadeProjectile { get; set; } = new PlayerBotActionEvadeProjectile(); public bool InternalEnabled { get; set; } } internal class PlayerBotActionAttack { public float MeleeReach { get; set; } = 2f; public float OptimalBulletRangeA { get; set; } = 2f; public float OptimalBulletRangeB { get; set; } = 10f; public float OptimalMeleeRangeA { get; set; } = 0.75f; public float OptimalMeleeRangeB { get; set; } = 5f; } internal class PlayerBotActionCollectItem { public float Range { get; set; } = 1.5f; public float TransferDuration { get; set; } = 1f; } internal class PlayerBotActionEvadeProjectile { public float EvasionStartETA { get; set; } = 0.25f; public float lookStartETA { get; set; } = 1f; public float SideStepDistance { get; set; } = 2f; } internal class PlayerBotActionFollow { public float SearchRadiusMul { get; set; } = 0.8f; public float VerifyRadiusMul { get; set; } = 1f; } internal class PlayerBotActionIdle { public float EquipWeaponDelay { get; set; } = 6f; public float PrioFreezeForTwitcher { get; set; } = 13f; public float Prio { get; set; } = 1f; } internal class PlayerBotActionRevive { public float ApproachRadius { get; set; } = 0.8f; public float TravelHaste { get; set; } = 0.9f; public float VerifyRadiusMul { get; set; } = 1.15f; } internal class PlayerBotActionShareResourcePack { public float ApproachRadius { get; set; } = 1.1f; public float Duration { get; set; } = 1.5f; public float VerifyRadiusMul { get; set; } = 1.15f; } internal class PlayerBotActionUseBioscan { public float SearchRadiusMul { get; set; } = 0.8f; public float VerifyCurrentPositionRadiusMul { get; set; } = 0.9f; } internal class PlayerBotActionUseEnemyScanner { public float ApproachRadius { get; set; } = 0.8f; public int NrScanAngles { get; set; } = 10; public float ScanDurationPerAngle { get; set; } = 0.4f; public float VerifyRadiusMul { get; set; } = 1.2f; } internal class PlayerModifier { public float SlideForceScale { get; set; } = 1f; public float EvadeSpeed { get; set; } = 3f; public float ModelScale { get; set; } = 1f; public bool CanStealthBhop { get; set; } = true; public bool internalEnabled { get; set; } } internal class ResourcePack { public List<ObjectiveResourceModifier> ObjectiveResourceModifiers { get; set; } = new List<ObjectiveResourceModifier> { new ObjectiveResourceModifier() }; public List<WeaponResourceModifier> WeaponResourceModifiers { get; set; } = new List<WeaponResourceModifier> { new WeaponResourceModifier() }; public bool internalEnabled { get; set; } } internal class RGB { public float Red { get; set; } public float Green { get; set; } public float Blue { get; set; } public RGB(float red, float green, float blue) { Red = red; Green = green; Blue = blue; } } internal class RootPlayerBotAction { public float CollectItemSearchDistance { get; set; } = 15f; public float CollectItemStandDistance { get; set; } = 1f; public float CombatDistanceMin { get; set; } = 2f; public float CombatDistanceMax { get; set; } = 10f; public float EnemiesTagDelayA { get; set; } = 6f; public float EnemiesTagDelayB { get; set; } = 4f; public float FlashlightOnDelay { get; set; } = 1.5f; public float FollowLeaderMaxDistance { get; set; } = 10f; public float FollowLeaderRadius { get; set; } = 7f; public float GateScanSearchDistance { get; set; } = 8f; public float GateScanStandDistanceA { get; set; } = 1f; public float GateScanStandDistanceB { get; set; } = 3f; public float HighlightSearchDistance { get; set; } = 8f; public float HighlightStandDistance { get; set; } = 1.5f; } internal class RundownLayout { public ExpeditionButton[] Tier1 { get; set; } = new ExpeditionButton[3] { new ExpeditionButton("A1", 1.666667f, -450f, 0f, 0f), new ExpeditionButton("A2", 1.666667f, 0f, -270f, 0f), new ExpeditionButton("A3", 1.666667f, 450f, 0f, 0f) }; public ExpeditionButton[] Tier2 { get; set; } = new ExpeditionButton[4] { new ExpeditionButton("B1", 1.428571f, -525f, 0f, 0f), new ExpeditionButton("B2", 1.428571f, -175f, -210f, 0f), new ExpeditionButton("B3", 1.428571f, 175f, -210f, 0f), new ExpeditionButton("B4", 1.428571f, 525f, 0f, 0f) }; public ExpeditionButton[] Tier3 { get; set; } = new ExpeditionButton[3] { new ExpeditionButton("C1", 1.818182f, -412.5f, 0f, 0f), new ExpeditionButton("C2", 1.818182f, 0f, -247.5f, 0f), new ExpeditionButton("C3", 1.818182f, 412.5f, 0f, 0f) }; public ExpeditionButton[] Tier4 { get; set; } = new ExpeditionButton[2] { new ExpeditionButton("D1", 2.5f, -300f, 0f, 0f), new ExpeditionButton("D2", 2.5f, 300f, 0f, 0f) }; public ExpeditionButton[] Tier5 { get; set; } = new ExpeditionButton[1] { new ExpeditionButton("E1", 10f, -75f, 0f, 0f) }; public bool HideProgression { get; set; } = true; public bool HideTiers { get; set; } = true; public bool internalEnabled { get; set; } } internal class Scale { public float BulletDamage { get; set; } = 1f; public float DamagePlayer { get; set; } = 1f; public float HammerDamage { get; set; } = 1f; public float EnemyWaveCost { get; set; } = 1f; public float ProgressBioscan { get; set; } = 1f; public bool enabled { get; set; } } internal class Vector3 { public float X { get; set; } public float Y { get; set; } public float Z { get; set; } public Vector3() { } public Vector3(float x, float y, float z) { X = x; Y = y; Z = z; } } internal class WeakDoorDamage { public bool internalEnabled { get; set; } public float MeleeDamageMultiplier { get; set; } = 0.25f; } internal class WeaponResourceModifier { public uint ArchetypeID { get; set; } public float ammopackAmountRel { get; set; } = 0.2f; public string name { get; set; } = "Default"; public bool internalEnabled { get; set; } } } namespace Dex.Tweaker.Core { internal class ConfigManager { public static Dex.Tweaker.Config.BioTracker BioTracker { get; private set; } public static Dex.Tweaker.Config.DifficultyScale DifficultyScale { get; private set; } public static Dex.Tweaker.Config.ElevatorCargo ElevatorCargo { get; private set; } public static Dex.Tweaker.Config.FoamLauncher FoamLauncher { get; private set; } public static Dex.Tweaker.Config.GamerGlowstick GamerGlowstick { get; private set; } public static Dex.Tweaker.Config.HackDoorPuzzle HackDoorPuzzle { get; private set; } public static Dex.Tweaker.Config.Mine Mine { get; private set; } public static Dex.Tweaker.Config.NavMesh NavMesh { get; private set; } public static Dex.Tweaker.Config.ObjectiveModifier ObjectiveModifier { get; private set; } public static Dex.Tweaker.Config.PlayerModifier PlayerModifier { get; private set; } public static Dex.Tweaker.Config.ResourcePack ResourcePack { get; private set; } public static Dex.Tweaker.Config.RundownLayout RundownLayout { get; private set; } public static Dex.Tweaker.Config.WeakDoorDamage WeakDoorDamage { get; private set; } public static Dex.Tweaker.Config.PlayerAIBot PlayerAIBot { get; private set; } public static Dex.Tweaker.Config.InfectionSpitter InfectionSpitter { get; private set; } public static ConfigEntry<bool> UseDebugNavMesh { get; set; } public static ConfigEntry<KeyCode> DebugNavMeshToggle { get; set; } public static ConfigEntry<KeyCode> DebugNavMeshUp { get; set; } public static ConfigEntry<KeyCode> DebugNavMeshDown { get; set; } public static ConfigEntry<KeyCode> DebugNavMeshReset { get; set; } public static ConfigEntry<bool> UseDebug { get; set; } public static void LoadJson() { string path = Path.Combine(MTFOInfo.CustomPath, "Tweaker"); if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } BioTracker = new Dex.Tweaker.Config.BioTracker(); DifficultyScale = new Dex.Tweaker.Config.DifficultyScale(); ElevatorCargo = new Dex.Tweaker.Config.ElevatorCargo(); FoamLauncher = new Dex.Tweaker.Config.FoamLauncher(); GamerGlowstick = new Dex.Tweaker.Config.GamerGlowstick(); HackDoorPuzzle = new Dex.Tweaker.Config.HackDoorPuzzle(); Mine = new Dex.Tweaker.Config.Mine(); NavMesh = new Dex.Tweaker.Config.NavMesh(); ObjectiveModifier = new Dex.Tweaker.Config.ObjectiveModifier(); PlayerModifier = new Dex.Tweaker.Config.PlayerModifier(); ResourcePack = new Dex.Tweaker.Config.ResourcePack(); RundownLayout = new Dex.Tweaker.Config.RundownLayout(); WeakDoorDamage = new Dex.Tweaker.Config.WeakDoorDamage(); PlayerAIBot = new Dex.Tweaker.Config.PlayerAIBot(); InfectionSpitter = new Dex.Tweaker.Config.InfectionSpitter(); } } internal class Debug { public static GameObject VisualNavMesh { get; private set; } public static void GenerateNavMesh() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Expected O, but got Unknown //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Expected O, but got Unknown if (ConfigManager.UseDebugNavMesh.Value) { Mesh val = new Mesh(); ((Object)val).name = "DebugNavMesh"; NavMeshTriangulation val2 = NavMesh.CalculateTriangulation(); val.indexFormat = (IndexFormat)(Mathf.Max(((Il2CppArrayBase<Vector3>)(object)val2.vertices).Length, ((Il2CppArrayBase<int>)(object)val2.indices).Length) < 65534); val.vertices = val2.vertices; val.triangles = val2.indices; string text = $"Debug Nav Mesh\n\tvertices:{((Il2CppArrayBase<Vector3>)(object)val2.vertices).Length}\n\ttriangles:{((Il2CppArrayBase<int>)(object)val2.indices).Length}"; if ((Object)(object)VisualNavMesh == (Object)null) { VisualNavMesh = new GameObject(); Object.DontDestroyOnLoad((Object)(object)VisualNavMesh); MeshFilter val3 = VisualNavMesh.AddComponent<MeshFilter>(); MeshRenderer obj = VisualNavMesh.AddComponent<MeshRenderer>(); val3.mesh = val; ((Renderer)obj).material = new Material(Shader.Find("Standard")); text += "\n\tMesh created"; } else { VisualNavMesh.GetComponent<MeshFilter>().mesh = val; text += "\n\tMesh already exists! updated information for it"; } VisualNavMesh.SetActive(false); Log.Debug(text); } } } internal class GamerGlowstick { private class Light { public static LG_LightCollection collection { get; set; } public static bool turnOff { get; set; } } public class Setting { public Color color { get; set; } public Color target { get; set; } public float time { get; set; } } public class Param { public static bool internalEnabled => ConfigManager.GamerGlowstick.Config.internalEnabled; public static uint itemID => ConfigManager.GamerGlowstick.Config.ItemID; public static float newRed => ConfigManager.GamerGlowstick.Config.Min.Red + Random.value * (ConfigManager.GamerGlowstick.Config.Max.Red - ConfigManager.GamerGlowstick.Config.Min.Red); public static float newGreen => ConfigManager.GamerGlowstick.Config.Min.Green + Random.value * (ConfigManager.GamerGlowstick.Config.Max.Green - ConfigManager.GamerGlowstick.Config.Min.Green); public static float newBlue => ConfigManager.GamerGlowstick.Config.Min.Blue + Random.value * (ConfigManager.GamerGlowstick.Config.Max.Blue - ConfigManager.GamerGlowstick.Config.Min.Blue); } public static CellSoundPlayer m_sound { get; set; } public static Dictionary<int, Setting> lookup { get; set; } private static bool isActive { get; set; } private static bool notUsed { get; set; } public static int currentID { get; set; } private static ulong cellSoundNum { get; set; } public static bool Exist(int instanceID, Item item) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) if (Param.internalEnabled && ((GameDataBlockBase<ItemDataBlock>)(object)item.ItemDataBlock).persistentID == Param.itemID) { notUsed = false; if (lookup == null) { lookup = new Dictionary<int, Setting>(); } if (lookup.Count == 0) { PlayerAgent val = default(PlayerAgent); if (PlayerManager.TryGetLocalPlayerAgent(ref val)) { Light.collection = LG_LightCollection.Create(((Agent)val).CourseNode, ((Agent)val).Position, (LG_LightCollectionSorting)1, 100f); } isActive = true; Light.turnOff = true; } if (lookup.ContainsKey(instanceID)) { Update(instanceID); currentID = instanceID; return true; } lookup.Add(instanceID, new Setting()); return false; } notUsed = true; return false; } public static void Update(int instanceID) { //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_0071: Unknown result type (might be due to invalid IL or missing references) if (lookup[instanceID].time <= Time.deltaTime) { lookup[instanceID].color = lookup[instanceID].target; lookup[instanceID].target = new Color { r = Param.newRed, g = Param.newGreen, b = Param.newBlue }; lookup[instanceID].time += ConfigManager.GamerGlowstick.Config.PulseRate; } else { lookup[instanceID].color = Color.Lerp(lookup[instanceID].color, lookup[instanceID].target, Time.deltaTime / lookup[instanceID].time); lookup[instanceID].time -= Time.deltaTime; } } public static void TurnOffLights(ref Collision col) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (!notUsed && isActive && Light.turnOff) { Light.collection.SetMode(false); Light.turnOff = false; cellSoundNum = CellSound.Post(EVENTS.LIGHTS_OFF_GLOBAL, col.transform.position); } } public static void Despawn(int instanceID, Vector3 position) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) if (!notUsed) { if (lookup.TryGetValue(instanceID, out Setting _)) { lookup.Remove(instanceID); } if (lookup.Count < 1 && isActive) { Light.collection.SetMode(true); isActive = false; cellSoundNum = CellSound.Post(EVENTS.LIGHTS_ON_INTENSITY_4, position); } } } } internal class InfectionSpitter { public static Dictionary<uint, InfectionSpitterConfig> SpitterModifiers { get; private set; } = new Dictionary<uint, InfectionSpitterConfig>(); public static bool IsSetup { get; set; } = false; public static void Load() { if (!ConfigManager.InfectionSpitter.Config.InternalEnabled || IsSetup) { return; } foreach (InfectionSpitterConfig item in ConfigManager.InfectionSpitter.Config.SpitterConfig) { if (item.InternalEnabled) { SpitterModifiers.Add(item.LevelLayoutID, item); } } IsSetup = true; } } internal class NavMesh { public static float VoxelSize { get; set; } } internal class ObjectiveModifier { public static Dex.Tweaker.DataTransfer.ObjectiveModifier Modifier { get; set; } public static bool Enabled { get; set; } public static float Time => Clock.Time; public static float TimeDelta => Time.deltaTime; public static float TimeLevelStart { get; set; } public static float TimeLimit { get; set; } public static float InfectionCurrent { get; set; } public static float InfectionTarget { get; set; } public static float InfectionTime { get; set; } public static void Load() { Dex.Tweaker.DataTransfer.ObjectiveModifier[] config = ConfigManager.ObjectiveModifier.Config; foreach (Dex.Tweaker.DataTransfer.ObjectiveModifier objectiveModifier in config) { if (objectiveModifier.internalEnabled) { Modifier = ((objectiveModifier.DataBlockId == RundownManager.ActiveExpedition.MainLayerData.ObjectiveData.DataBlockId) ? objectiveModifier : null); if (Modifier != null) { InfectionTime = 0f; InfectionCurrent = 0f; InfectionTarget = 0f; TimeLevelStart = Time; TimeLimit = TimeLevelStart + objectiveModifier.TimeLimit; Modifier = objectiveModifier; break; } } } ResourcePack.Load(); Debug.GenerateNavMesh(); } public static void Update(ref LocalPlayerAgent playerAgent) { //IL_0035: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: 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_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) if (Modifier == null || Time <= TimeLimit) { return; } if (Modifier.ExplodePlayer) { ((Dam_SyncedDamageBase)((PlayerAgent)playerAgent).Damage).ExplosionDamage(((PlayerAgent)playerAgent).PlayerData.health, ((Agent)playerAgent).Position, Vector3.one * 100f, 0u); CellSound.Post(EVENTS.STICKYMINEEXPLODE, ((Agent)playerAgent).Position); Modifier = null; } else { if (!Modifier.Infection.Enabled) { return; } if (InfectionTime <= TimeDelta) { InfectionCurrent = InfectionTarget; InfectionTarget = ((PlayerAgent)playerAgent).Damage.Infection + Modifier.Infection.Amount; InfectionTime = Random.Range(Modifier.Infection.Rate.Min, Modifier.Infection.Rate.Max); if (InfectionCurrent != 0f) { ((PlayerAgent)playerAgent).Damage.ModifyInfection(new pInfection { amount = InfectionCurrent, mode = (pInfectionMode)0 }, true, true); } } else { InfectionCurrent = Mathf.Lerp(((PlayerAgent)playerAgent).Damage.Infection, InfectionTarget, TimeDelta / InfectionTime); InfectionTime -= TimeDelta; ((PlayerAgent)playerAgent).Damage.ModifyInfection(new pInfection { amount = InfectionCurrent, mode = (pInfectionMode)0 }, false, false); } } } } internal class ResourcePack { public static Dictionary<uint, ObjectiveResourceModifier> ObjectiveModifiers { get; private set; } = new Dictionary<uint, ObjectiveResourceModifier>(); public static Dictionary<uint, WeaponResourceModifier> WeaponModifiers { get; private set; } = new Dictionary<uint, WeaponResourceModifier>(); public static void Load() { if (!ConfigManager.ResourcePack.Config.internalEnabled) { return; } ObjectiveModifiers.Clear(); WeaponModifiers.Clear(); foreach (ObjectiveResourceModifier objectiveResourceModifier in ConfigManager.ResourcePack.Config.ObjectiveResourceModifiers) { if (objectiveResourceModifier.internalEnabled && !ObjectiveModifiers.ContainsKey(objectiveResourceModifier.DataBlockId)) { ObjectiveModifiers.Add(objectiveResourceModifier.DataBlockId, objectiveResourceModifier); } } foreach (WeaponResourceModifier weaponResourceModifier in ConfigManager.ResourcePack.Config.WeaponResourceModifiers) { if (weaponResourceModifier.internalEnabled && !ObjectiveModifiers.ContainsKey(weaponResourceModifier.ArchetypeID)) { WeaponModifiers.Add(weaponResourceModifier.ArchetypeID, weaponResourceModifier); } } } } } namespace Dex.Tweaker.Config { internal class BioTracker : ConfigBaseMultiple<Dex.Tweaker.DataTransfer.BioTracker> { public override void OnConfigLoaded() { Dex.Tweaker.DataTransfer.BioTracker[] config = base.Config; for (int i = 0; i < config.Length; i++) { if (config[i].internalEnabled) { Plugin.Instance.PatchAll(typeof(EnemyScanner_Setup)); break; } } } } internal class DifficultyScale : ConfigBaseSingle<Dex.Tweaker.DataTransfer.DifficultyScale> { public override void OnConfigLoaded() { if (base.Config.internalEnabled) { Plugin.Instance.PatchAll(typeof(BulletWeapon_BulletHit))