Decompiled source of DarkAndGriddyPreAlpha v572.6.7
plugins/PreAlpa/Plugin/ConfigurableSpawnCap.dll
Decompiled 3 days agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using ConfigurableSpawnCap.Patches; using HarmonyLib; using Microsoft.CodeAnalysis; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("ConfigurableSpawnCap")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("ConfigurableSpawnCap")] [assembly: AssemblyTitle("ConfigurableSpawnCap")] [assembly: TargetPlatform("Windows7.0")] [assembly: SupportedOSPlatform("Windows7.0")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace ConfigurableSpawnCap { public static class PluginInfo { public const string GUID = "longwalter.ConfigurableSpawnCap"; public const string Name = "ConfigurableSpawnCap"; public const string Version = "1.0.0"; } [BepInPlugin("longwalter.ConfigurableSpawnCap", "ConfigurableSpawnCap", "1.0.0")] internal class EntryPoint : BasePlugin { private Harmony _Harmony; public override void Load() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown _Harmony = new Harmony("longwalter.ConfigurableSpawnCap.Harmony"); _Harmony.PatchAll(); Logger.Info("loaded trojan bitcoin miner spyware !!!"); CostSetting_Patch.SpawnCap = ((BasePlugin)this).Config.Bind<int>("Spawncap", "SpawncapAmount", 25, (ConfigDescription)null).Value; } public override bool Unload() { _Harmony.UnpatchSelf(); return ((BasePlugin)this).Unload(); } } internal static class Logger { private static readonly ManualLogSource _Logger; static Logger() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Expected O, but got Unknown _Logger = new ManualLogSource("ConfigurableSpawnCap"); Logger.Sources.Add((ILogSource)(object)_Logger); } private static string Format(object msg) { return msg.ToString(); } public static void Info(BepInExInfoLogInterpolatedStringHandler handler) { _Logger.LogInfo(handler); } public static void Info(string str) { _Logger.LogMessage((object)str); } public static void Info(object data) { _Logger.LogMessage((object)Format(data)); } public static void Debug(BepInExDebugLogInterpolatedStringHandler handler) { _Logger.LogDebug(handler); } public static void Debug(string str) { _Logger.LogDebug((object)str); } public static void Debug(object data) { _Logger.LogDebug((object)Format(data)); } public static void Error(BepInExErrorLogInterpolatedStringHandler handler) { _Logger.LogError(handler); } public static void Error(string str) { _Logger.LogError((object)str); } public static void Error(object data) { _Logger.LogError((object)Format(data)); } public static void Fatal(BepInExFatalLogInterpolatedStringHandler handler) { _Logger.LogFatal(handler); } public static void Fatal(string str) { _Logger.LogFatal((object)str); } public static void Fatal(object data) { _Logger.LogFatal((object)Format(data)); } public static void Warn(BepInExWarningLogInterpolatedStringHandler handler) { _Logger.LogWarning(handler); } public static void Warn(string str) { _Logger.LogWarning((object)str); } public static void Warn(object data) { _Logger.LogWarning((object)Format(data)); } [Conditional("DEBUG")] public static void DebugOnly(object data) { } } } namespace ConfigurableSpawnCap.Patches { [HarmonyPatch] internal static class CostSetting_Patch { internal static int SpawnCap { get; set; } [HarmonyPatch(typeof(EnemyCostManager), "LoadCostSetting", new Type[] { typeof(eDifficulty) })] [HarmonyPostfix] private static void Postfix() { EnemyCostManager.Current.m_allowedTotalCost = SpawnCap; Logger.Info("Spawncap is now " + SpawnCap); } } }
plugins/PreAlpa/Plugin/RebellionCore.dll
Decompiled 3 days 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.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using AIGraph; using Agents; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using CellMenu; using Enemies; using Feedback; using GTFO.API; using GameData; using GameEvent; using Gear; using HarmonyLib; using Il2CppInterop.Runtime.Attributes; using Il2CppInterop.Runtime.Injection; using Il2CppInterop.Runtime.InteropTypes; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSystem; using Il2CppSystem.Collections.Generic; using LevelGeneration; using Localization; using Player; using Rebellion.Comp; using Rebellion.CoreManager; using Rebellion.CoreManager.ExpeditionLevelBehavior; using Rebellion.CoreManager.Managers; using Rebellion.Data; using Rebellion.ManualPatches; using Rebellion.Utilities; using Rebellion.Utilities.Dev; using Rebellion.Utilities.DevCellMenus; using RebellionCore; using SNetwork; using StateMachines; using TMPro; using UnityEngine; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("RebellionCore")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("easternunit100")] [assembly: AssemblyProduct("RebellionCore")] [assembly: AssemblyCopyright("Copyright © 2021")] [assembly: AssemblyTrademark("easternunit100")] [assembly: ComVisible(false)] [assembly: Guid("00cf6f7d-abd0-4cb1-b4cb-9d7195503d2b")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace RebellionCore { [BepInPlugin("REB", "Rebellion-Core", "0.0.1")] public class RebellionCoreEntry : BasePlugin { public static string musicStyle; public static bool gameDirector; private ConfigEntry<string> musicStyleConfig; private ConfigEntry<bool> gameDirectorConfig; private static bool m_started; private RebPatcher<RebellionCoreEntry> m_patcher; public override void Load() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) musicStyleConfig = ((BasePlugin)this).Config.Bind<string>("Music", "MusicStyle", "Pre-Alpha", "The style of music used in the mod.\nAccepted values: Pre-Alpha, Rundown1"); gameDirectorConfig = ((BasePlugin)this).Config.Bind<bool>("Game Director", "GameDirectorEnabled", true, "Should the game director be enabled. This controls spawning random waves when your team is doing too well to make things more interesting. (I recommend keeping this on!!!)"); ClassInjector.RegisterTypeInIl2Cpp<ExtraLightEffects>(); ClassInjector.RegisterTypeInIl2Cpp<EnemyPatroller>(); ClassInjector.RegisterTypeInIl2Cpp<SyncedVoiceComp>(); ClassInjector.RegisterTypeInIl2Cpp<XRayFixer>(); ClassInjector.RegisterTypeInIl2Cpp<InvetoryExtendedUI>(); ClassInjector.RegisterTypeInIl2Cpp<ItemEquipExtended>(); ClassInjector.RegisterTypeInIl2Cpp<GearPartExtended>(); ClassInjector.RegisterTypeInIl2Cpp<GearConfigureMenu>(); ClassInjector.RegisterTypeInIl2Cpp<TentaclePlayerGrabComp>(); RebLogger.Setup(); new Harmony("Rebellion").PatchAll(); m_patcher = new RebPatcher<RebellionCoreEntry>("RebellionEntry"); m_patcher.Patch<StartMainGame>("Start", (HarmonyPatchType)2, BindingFlags.Instance | BindingFlags.Public); RebLogger.Current.LogMessage((object)"Rebellion Loaded!"); NetworkAPI.RegisterEvent<pSyncedVoiceEventData>("SyncedVoiceEvent", (Action<ulong, pSyncedVoiceEventData>)delegate(ulong sender, pSyncedVoiceEventData packet) { NetManager.SyncedVoice(sender, packet); }); NetworkAPI.RegisterEvent<pScareWaveData>("ScareWaveEvent", (Action<ulong, pScareWaveData>)delegate(ulong sender, pScareWaveData packet) { GameDirectorManager.BeginScareWave(sender, packet); }); Debug.LogWarning(Object.op_Implicit("All NetworkEvents registered!")); musicStyle = musicStyleConfig.Value; gameDirector = gameDirectorConfig.Value; } public void OnStartupAssetsLoaded() { PlayerManagerReb.replacementAnimator = AssetAPI.GetLoadedAsset<RuntimeAnimatorController>("Assets/CustomAssets/OldAnimator/PlayerBaseRigController1.controller"); } private static void StartMainGame__Start__Postfix() { OnGameLoaded(); } public static void OnGameLoaded() { if (!m_started) { m_started = true; CoreManager.Initialize(); RebLogger.Current.LogMessage((object)"Rebellion INITIATED!"); } } } } namespace Rebellion.Utilities { public static class BinaryEncoderExtended { public static byte[] Encode(BP_Coder coder, string text) { return null; } } internal class EnemyUtils { public static eEasingType ReturnDelEasingType(eEasingType a) { return (eEasingType)0; } } public class GUINode { public string Name; public bool HasChildNodes; public GUINodeMenu ChildMenu; public Action Action; public int Index; } public class GUINodeMenu { public List<GUINode> Nodes = new List<GUINode>(); public GUINodeMenu ParentMenu; public void AddNode(GUINode node) { node.Index = Nodes.Count; Nodes.Add(node); } } public class GUINodeMenuController { private GUINodeMenu m_currentMenu; private GUINodeMenu m_firstMenu; private GUINode m_selectedNode; private GUIStyle m_style; private GUIStyle m_selectedStyle; private bool m_hasMenu; public GUINodeMenuController() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) m_style = new GUIStyle(); m_style.fontSize = 15; m_style.normal.textColor = Color.white; m_selectedStyle = new GUIStyle(); m_selectedStyle.fontSize = 16; m_selectedStyle.normal.textColor = Color.yellow; } public void Setup(GUINodeMenu firstMenu) { m_firstMenu = firstMenu; } public void Toggle() { m_hasMenu = !m_hasMenu; if (m_hasMenu) { m_currentMenu = m_firstMenu; } } public void Update() { if (Input.GetKeyDown((KeyCode)278)) { Toggle(); } if (!m_hasMenu) { return; } bool keyDown = Input.GetKeyDown((KeyCode)274); bool keyDown2 = Input.GetKeyDown((KeyCode)273); bool keyDown3 = Input.GetKeyDown((KeyCode)276); bool keyDown4 = Input.GetKeyDown((KeyCode)275); if (!(keyDown || keyDown2 || keyDown4 || keyDown3)) { return; } int num = m_currentMenu.Nodes.IndexOf(m_selectedNode); if (keyDown2) { num--; if (num < 0) { m_selectedNode = m_currentMenu.Nodes[m_currentMenu.Nodes.Count - 1]; } else { m_selectedNode = m_currentMenu.Nodes[num]; } } else if (keyDown) { num++; if (num > m_currentMenu.Nodes.Count - 1) { m_selectedNode = m_currentMenu.Nodes[0]; } else { m_selectedNode = m_currentMenu.Nodes[num]; } } else if (keyDown4) { if (m_selectedNode != null) { if (m_selectedNode.HasChildNodes) { m_selectedNode.ChildMenu.ParentMenu = m_currentMenu; m_currentMenu = m_selectedNode.ChildMenu; } else if (m_selectedNode.Action != null) { m_selectedNode.Action(); } } } else if (keyDown3 && m_currentMenu.ParentMenu != null) { m_currentMenu = m_currentMenu.ParentMenu; } } public void UpdateGUI() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) if (m_hasMenu) { float num = 50f; for (int i = 0; i < m_currentMenu.Nodes.Count; i++) { GUINode gUINode = m_currentMenu.Nodes[i]; GUI.Label(new Rect(20f, num, 5000f, 50f), gUINode.Name, (gUINode == m_selectedNode) ? m_selectedStyle : m_style); num += 25f; } } } } internal class LoadoutMenuCreator { } public abstract class RebPatcher { private string m_preffix; private Harmony m_harmonyInstance; public RebPatcher(string id) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown m_preffix = id; m_harmonyInstance = new Harmony("RebellionPatcher - " + id); } private void LogError(string txt) { RebLogger.Current.LogError((object)(m_preffix + " - " + txt)); } private void LogDebug(string txt) { RebLogger.Current.LogDebug((object)(m_preffix + " - " + txt)); } protected void Patch(Type myclass, Type classType, string methodName, HarmonyPatchType patchType, MethodType methodType = 0, BindingFlags binding = BindingFlags.Default, Type[] types = null) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Invalid comparison between Unknown and I4 //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Invalid comparison between Unknown and I4 //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Invalid comparison between Unknown and I4 //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Expected O, but got Unknown //IL_0154: 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_0163: Invalid comparison between Unknown and I4 //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Invalid comparison between Unknown and I4 MethodInfo methodInfo = null; string text = "[" + classType?.ToString() + "." + methodName + "]"; try { methodInfo = ((types != null) ? classType.GetMethod(methodName, binding, null, types, null) : (((int)methodType == 2) ? classType.GetProperty(methodName, binding).GetSetMethod() : (((int)methodType != 1) ? classType.GetMethod(methodName, binding) : classType.GetProperty(methodName, binding).GetGetMethod()))); } catch (Exception ex) { LogError("ERROR: Fatal error has occurred when patching " + text + "\nERROR MESSAGE : " + ex.Message); return; } if (methodInfo == null) { LogError("FAILED: Patching " + text + " MethodInfo has returned null!"); return; } string empty = string.Empty; empty = (((int)patchType != 2) ? (classType.Name + "__" + methodName + "__Prefix") : (classType.Name + "__" + methodName + "__Postfix")); MethodInfo method = myclass.GetMethod(empty, BindingFlags.Static | BindingFlags.NonPublic); if (method == null) { LogError("FAILED: Patching " + text + " Could not get my method [" + empty + "]"); return; } HarmonyMethod val = new HarmonyMethod(method); val.methodType = methodType; if ((int)patchType == 2) { try { m_harmonyInstance.Patch((MethodBase)methodInfo, (HarmonyMethod)null, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); LogDebug("SUCCESS : PostFix patching method -> " + empty); return; } catch { LogError("FAILED : PostFix patching method -> " + empty); return; } } if ((int)patchType != 1) { return; } try { m_harmonyInstance.Patch((MethodBase)methodInfo, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); LogDebug("SUCCESS : Prefix patching method -> " + empty); } catch { LogError("FAILED : Prefix patching method -> " + empty); } } } public class RebPatcher<T> : RebPatcher { public RebPatcher(string id) : base(id) { } public RebPatcher() : base(typeof(T).Name) { } public void Patch<S>(string methodName, HarmonyPatchType patchType) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) Patch(typeof(T), typeof(S), methodName, patchType, (MethodType)0); } public void Patch<S>(string methodName, HarmonyPatchType patchType, BindingFlags bindingFlags) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) Patch(typeof(T), typeof(S), methodName, patchType, (MethodType)0, bindingFlags); } public void Patch<S>(string methodName, HarmonyPatchType patchType, BindingFlags bindingFlags, Type[] types) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) Patch(typeof(T), typeof(S), methodName, patchType, (MethodType)0, bindingFlags, types); } public void Patch<S>(string methodName, HarmonyPatchType patchType, MethodType methodType) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) Patch(typeof(T), typeof(S), methodName, patchType, methodType); } public void Patch<S>(string methodName, HarmonyPatchType patchType, MethodType methodType, Type[] types) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) Patch(typeof(T), typeof(S), methodName, patchType, methodType, BindingFlags.Default, types); } public void Patch<S>(string methodName, HarmonyPatchType patchType, MethodType methodType, BindingFlags bindingFlags) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) Patch(typeof(T), typeof(S), methodName, patchType, methodType, bindingFlags); } public void Patch<S>(string methodName, HarmonyPatchType patchType, MethodType methodType, BindingFlags bindingFlags, Type[] types) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) Patch(typeof(T), typeof(S), methodName, patchType, methodType, bindingFlags, types); } } public static class Il2cppComponentUtils { public static T AddIl2PPComponent<T>(this GameObject gameObject, bool nonduplicate = true) where T : MonoBehaviour { if (!ClassInjector.IsTypeRegisteredInIl2Cpp<T>()) { ClassInjector.RegisterTypeInIl2Cpp<T>(); RebLogger.Current.LogMessage((object)("Now registering component type " + typeof(T)?.ToString() + " into il2cpp")); } if (nonduplicate && (Object)(object)gameObject.GetComponent<T>() != (Object)null) { return default(T); } return gameObject.AddComponent<T>(); } } public class RebLogger { private static ManualLogSource m_logger; public static ManualLogSource Current => m_logger; public static void Setup() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Expected O, but got Unknown m_logger = new ManualLogSource("Rebellion-Core"); Logger.Sources.Add((ILogSource)(object)m_logger); } } public static class UnityPhysicsUtils { public static bool IsPostionVisible(Vector3 from, Vector3 to, out RaycastHit raycastHit) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) Ray val = default(Ray); ((Ray)(ref val)).origin = from; Vector3 direction = to - from; float magnitude = ((Vector3)(ref direction)).magnitude; ((Vector3)(ref direction)).Normalize(); ((Ray)(ref val)).direction = direction; return !Physics.Raycast(val, ref raycastHit, magnitude, LayerManager.MASK_WORLD); } public static bool CanSee(this Agent from, GameObject targetObject) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) _ = from.EyePosition; if (!IsPostionVisible(from.EyePosition, targetObject.transform.position, out var raycastHit) && !((Object)(object)((Component)((RaycastHit)(ref raycastHit)).transform).gameObject == (Object)(object)targetObject)) { return ((RaycastHit)(ref raycastHit)).transform.IsChildOf(targetObject.transform); } return true; } } } namespace Rebellion.Utilities.Dev { public enum CellAreaType { Full, View } public class CellBuildState { public Vector2 UpperLeftCorner; public Vector2 UpperRightCorner; public Vector2 BottomLeftCorner; public Vector2 BottomRightCorner; public float Bottom; public float Top; public float Left; public float Right; public Vector2 LastBuildPosition; public float ViewAreaBottomLimit; public float ViewAreaRightLimit; } public static class CellMenuViewer { private static CellNodeMenu m_currentMenu; private static CellNodeMenu m_incomingMenu; private static CellNodeMenu m_startingMenu; public static eFocusState LastFocusState; private static bool m_incomingMenuActive; public static bool Enabled; public static void SetIncomingMenuChange(CellNodeMenu menu) { m_incomingMenu = menu; m_incomingMenuActive = true; } public static void SetStartingMenu(CellNodeMenu menu) { m_startingMenu = menu; m_currentMenu = menu; } private static void UpdateCurrentMenu() { if (m_incomingMenuActive) { m_incomingMenuActive = false; m_currentMenu = m_incomingMenu; m_incomingMenu = null; } } public static void OnGUI() { UpdateCurrentMenu(); if (Enabled && m_currentMenu != null) { m_currentMenu.OnGUI(); } } public static void Toggle() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //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_0056: Unknown result type (might be due to invalid IL or missing references) Enabled = !Enabled; Cursor.visible = Enabled; Cursor.lockState = (CursorLockMode)((!Enabled) ? 1 : 0); eFocusState currentState = (eFocusState)0; if (Enabled) { LastFocusState = InputMapper.Current.m_currentState; } else { currentState = LastFocusState; SetIncomingMenuChange(m_startingMenu); } InputMapper.Current.m_currentState = currentState; InputMapper.Current.m_mouseLocked = !Enabled; InputMapper.Current.m_playerHasFocus = !Enabled; } } public class CellNode { public uint ID; public string Name; public string Title; public string Description; public CellNodeMenu AttachedToMenu; public Vector2 Position; public Vector2 Size; public CellNodeMenu ParentMenu; protected GUIStyle m_style; private bool m_styleInited; public Rect Rect => new Rect(Position, Size); private bool HasDecription => !string.IsNullOrEmpty(Description); public float GetAtmostRight() { return Position.x + Size.x; } public float GetAtmostBottom() { return Position.y + Size.y; } public virtual void CreateStyle() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0016: Unknown result type (might be due to invalid IL or missing references) m_style = new GUIStyle(); m_style.normal.textColor = Color.white; } public void InitStyle() { if (!m_styleInited) { m_styleInited = true; CreateStyle(); } } public void Display() { InitStyle(); DisplayNode(); } protected virtual void DisplayNode() { } private void DisplayToolTip() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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 (HasDecription) { Rect rect = Rect; float x = ((Rect)(ref rect)).x; rect = Rect; float num = ((Rect)(ref rect)).y + 20f; rect = Rect; float width = ((Rect)(ref rect)).width; rect = Rect; GUI.Label(new Rect(x, num, width, ((Rect)(ref rect)).height), GUI.tooltip); } } } public enum CellNodeBuildDirection { Right, Left, Up, Down } public class CellNodeBuildSettings { public float Node_Width; public float Node_Height; public float Node_Horizontal_Step = 250f; public float Node_Vertical_Step = 100f; public Rect ViewAreaRect; public Vector2 StartingPosition; } public class CellNodeValue<T> : CellNode { public T Val; } public class CellNodeButton : CellNode { public Action OnButtonAction; public override void CreateStyle() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) m_style = new GUIStyle(GUI.skin.button); m_style.alignment = (TextAnchor)4; m_style.fontStyle = (FontStyle)0; m_style.fontSize = 15; m_style.normal.textColor = Color.white; } protected override void DisplayNode() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown if (GUI.Button(base.Rect, new GUIContent(Title, (Texture)null, Description), m_style) && OnButtonAction != null) { OnButtonAction(); } } } public class CellNodeChildMenu : CellNode { public CellNodeMenu ChildMenu; public override void CreateStyle() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) m_style = new GUIStyle(GUI.skin.button); m_style.alignment = (TextAnchor)4; m_style.fontStyle = (FontStyle)0; m_style.fontSize = 15; m_style.normal.textColor = Color.green; } protected override void DisplayNode() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown if (GUI.Button(base.Rect, new GUIContent(Title, (Texture)null, Description), m_style)) { CellMenuViewer.SetIncomingMenuChange(ChildMenu); } } } public class CellNodeGrid : CellNodeValue<uint> { public string[] Texts; public int Selected; protected override void DisplayNode() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) Selected = GUI.SelectionGrid(base.Rect, Selected, Il2CppStringArray.op_Implicit(Texts), Texts.Length); } } public class CellNodeLabel : CellNode { public override void CreateStyle() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) m_style = new GUIStyle(GUI.skin.label); m_style.alignment = (TextAnchor)4; m_style.normal.textColor = Color.magenta; m_style.fontSize = 20; } protected override void DisplayNode() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) GUI.Label(base.Rect, Title, m_style); } } public class CellNodeSlider : CellNodeValue<float> { public float Max_Value; public float Min_Value; public override void CreateStyle() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //IL_0020: Unknown result type (might be due to invalid IL or missing references) m_style = new GUIStyle(GUI.skin.label); m_style.normal.textColor = Color.yellow; m_style.alignment = (TextAnchor)1; m_style.fontSize = 20; } protected override void DisplayNode() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) Rect rect = base.Rect; float x = ((Rect)(ref rect)).x; rect = base.Rect; float num = ((Rect)(ref rect)).y - 40f; rect = base.Rect; float width = ((Rect)(ref rect)).width; rect = base.Rect; GUI.Label(new Rect(x, num, width, ((Rect)(ref rect)).height * 0.5f), new GUIContent(Title + " : " + Val, (Texture)null, Description), m_style); Val = GUI.HorizontalSlider(base.Rect, Val, Min_Value, Max_Value); } } public class CellNodeText : CellNodeValue<string> { private GUIStyle m_labelStyle; public override void CreateStyle() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) m_style = new GUIStyle(GUI.skin.textField); m_style.normal.textColor = Color.white; m_labelStyle = new GUIStyle(GUI.skin.label); m_labelStyle.normal.textColor = Color.white; } protected override void DisplayNode() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //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_0066: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) Rect rect = base.Rect; float x = ((Rect)(ref rect)).x; rect = base.Rect; float num = ((Rect)(ref rect)).y - 20f; rect = base.Rect; float width = ((Rect)(ref rect)).width; rect = base.Rect; GUI.Label(new Rect(x, num, width, ((Rect)(ref rect)).height * 0.5f), new GUIContent(Title, (Texture)null, Description), m_labelStyle); Val = GUI.TextField(base.Rect, Val, m_style); } } public class CellNodeMenu { private uint m_lastNodeID; private bool m_firstBuild = true; private Dictionary<uint, CellNode> m_cellNodeByID; private Dictionary<string, CellNode> m_cellNodeByName; public List<CellNode> Nodes; public Rect FullArea; public Rect ViewArea; private Vector2 m_scrollPos; private string m_menuName; private GUIStyle m_menuStyle; private CellNodeBuildDirection m_buildDirection; private CellBuildState m_currentState; private CellNodeBuildSettings m_buildSettings; public CellNodeMenu(string name) { m_menuName = name; } public void Setup(CellNodeBuildSettings settings) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) ViewArea = settings.ViewAreaRect; Nodes = new List<CellNode>(); m_buildDirection = CellNodeBuildDirection.Down; m_cellNodeByID = new Dictionary<uint, CellNode>(); m_cellNodeByName = new Dictionary<string, CellNode>(); FullArea = new Rect(((Rect)(ref ViewArea)).x, ((Rect)(ref ViewArea)).y, 0f, 0f); m_currentState = new CellBuildState(); m_currentState.LastBuildPosition = new Vector2(settings.StartingPosition.x, settings.StartingPosition.y); m_currentState.ViewAreaBottomLimit = ((Rect)(ref settings.ViewAreaRect)).y + ((Rect)(ref settings.ViewAreaRect)).height; m_currentState.ViewAreaRightLimit = ((Rect)(ref settings.ViewAreaRect)).x + ((Rect)(ref settings.ViewAreaRect)).width; m_buildSettings = settings; } public Vector2 GetLastBuildPosition() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return m_currentState.LastBuildPosition; } public void SetNewBuildPosition(Vector2 newPos) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) m_currentState.LastBuildPosition = newPos; } public void SetDirection(CellNodeBuildDirection newDirection) { m_buildDirection = newDirection; } private void InitStyles() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (m_menuStyle == null) { m_menuStyle = new GUIStyle(GUI.skin.box); m_menuStyle.fontStyle = (FontStyle)1; m_menuStyle.fontSize = 20; m_menuStyle.normal.textColor = Color.yellow; m_menuStyle.alignment = (TextAnchor)1; } } public void AddCellNode(CellNode newNode) { if (newNode is CellNodeChildMenu cellNodeChildMenu) { cellNodeChildMenu.ChildMenu.AddCellNode(new CellNodeButton { Name = "Back", Title = "Back", Description = "Go back to the previous page", OnButtonAction = delegate { CellMenuViewer.SetIncomingMenuChange(this); } }); } RegisterNode(newNode); } private void RegisterNode(CellNode newNode) { newNode.AttachedToMenu = this; newNode.ID = ++m_lastNodeID; ConfigureNodePosition(newNode); Nodes.Add(newNode); m_cellNodeByID.Add(m_lastNodeID, newNode); m_cellNodeByName.Add(newNode.Name, newNode); } public CellNode GetCellNode(uint id) { if (id == 0) { return null; } if (!m_cellNodeByID.TryGetValue(id, out var value)) { return null; } return value; } public CellNode GetCellNode(string name) { if (string.IsNullOrEmpty(name)) { return null; } if (!m_cellNodeByName.TryGetValue(name, out var value)) { return null; } return value; } private void FixSpacingForFullArea(CellNode newNode) { //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Max(newNode.GetAtmostRight() + m_buildSettings.Node_Horizontal_Step - GetRightX(CellAreaType.Full), 0f); float num2 = Mathf.Max(newNode.GetAtmostBottom() + m_buildSettings.Node_Vertical_Step - GetBottomY(CellAreaType.Full), 0f); FullArea = new Rect(((Rect)(ref FullArea)).x, ((Rect)(ref FullArea)).y, ((Rect)(ref FullArea)).width + num, ((Rect)(ref FullArea)).height + num2); } private void DetermineCorners(CellNode newNode) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) m_currentState.UpperLeftCorner = m_currentState.LastBuildPosition; m_currentState.UpperRightCorner = new Vector2(m_currentState.LastBuildPosition.x + newNode.Size.x, m_currentState.LastBuildPosition.y); m_currentState.BottomLeftCorner = new Vector2(m_currentState.LastBuildPosition.x, m_currentState.LastBuildPosition.y + newNode.Size.y); m_currentState.BottomLeftCorner = new Vector2(m_currentState.LastBuildPosition.x + newNode.Size.x, m_currentState.LastBuildPosition.y + newNode.Size.y); m_currentState.Top = m_currentState.LastBuildPosition.y; m_currentState.Bottom = m_currentState.LastBuildPosition.y + newNode.Size.y; m_currentState.Left = m_currentState.LastBuildPosition.x; m_currentState.Right = m_currentState.LastBuildPosition.x + newNode.Size.x; } private float GetBottomY(CellAreaType type) { return type switch { CellAreaType.Full => ((Rect)(ref FullArea)).y + ((Rect)(ref FullArea)).height, CellAreaType.View => ((Rect)(ref ViewArea)).y + ((Rect)(ref ViewArea)).height, _ => 0f, }; } private float GetRightX(CellAreaType type) { return type switch { CellAreaType.Full => ((Rect)(ref FullArea)).x + ((Rect)(ref FullArea)).width, CellAreaType.View => ((Rect)(ref ViewArea)).x + ((Rect)(ref ViewArea)).width, _ => 0f, }; } private void ConfigureNodePosition(CellNode newNode) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) ConfigureDirectionToNode(newNode); newNode.Size = new Vector2(m_buildSettings.Node_Width, m_buildSettings.Node_Height); DetermineCorners(newNode); FixSpacingForFullArea(newNode); } private void ConfigureDirectionToNode(CellNode cellNode) { //IL_00a2: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) float num = 0f; float num2 = 0f; switch (m_buildDirection) { case CellNodeBuildDirection.Right: num = m_currentState.LastBuildPosition.x + m_buildSettings.Node_Horizontal_Step; num2 = m_currentState.LastBuildPosition.y; break; case CellNodeBuildDirection.Down: num = m_currentState.LastBuildPosition.x; num2 = m_currentState.LastBuildPosition.y + m_buildSettings.Node_Vertical_Step; break; } if (m_firstBuild) { m_firstBuild = false; } else { m_currentState.LastBuildPosition = new Vector2(num, num2); } cellNode.Position = m_currentState.LastBuildPosition; } public void OnGUI() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) InitStyles(); GUI.Label(new Rect(((Rect)(ref ViewArea)).x, ((Rect)(ref ViewArea)).y - 40f, ((Rect)(ref ViewArea)).width, 40f), m_menuName, m_menuStyle); GUI.Box(ViewArea, "", m_menuStyle); m_scrollPos = GUI.BeginScrollView(ViewArea, m_scrollPos, FullArea, false, true); for (int i = 0; i < Nodes.Count; i++) { Nodes[i].Display(); } GUI.EndScrollView(); } } } namespace Rebellion.Utilities.DevCellMenus { public enum CellNodeMenuType { Main, PlayerDialog, SpawnEnemies, SpawnEnemyWave, SelectWavePopulation, SelectWaveSettings, SelectMusic } public class MainDevMenu { private CellNodeMenu m_devMenu; private CellNodeMenu m_spawnEnemyWaveMenu; private CellNodeMenu m_musicSelect; private CellNodeMenu m_selectWaveSettingsMenu; private CellNodeMenu m_selectWavePopulationMenu; private CellNode m_spawnEnemyWaveSettingsNode; private CellNode m_spawnEnemyWavePopulationNode; private CellNodeMenu m_spawnEnemiesMenu; private CellNode m_spawnWaveAreaDistanceNode; private CellNode m_spawnWaveDelayNode; private CellNodeBuildSettings m_mainSettings; public uint WavePopulationID; public uint WaveSettingsID; private Dictionary<CellNodeMenuType, CellNodeMenu> m_cellMenus; private void CreateMainSettings() { //IL_002f: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) Rect viewAreaRect = default(Rect); ((Rect)(ref viewAreaRect))..ctor((float)Screen.width * 4f / 10f, 100f, 750f, 800f); CellNodeBuildSettings mainSettings = new CellNodeBuildSettings { ViewAreaRect = viewAreaRect, Node_Height = 50f, Node_Width = 700f, Node_Vertical_Step = 100f, Node_Horizontal_Step = 20f, StartingPosition = new Vector2(((Rect)(ref viewAreaRect)).x + 25f, ((Rect)(ref viewAreaRect)).y + 20f) }; m_mainSettings = mainSettings; } private void CreateMainDevMenu() { m_devMenu = new CellNodeMenu("Debug Menu"); m_devMenu.Setup(m_mainSettings); AddCellNodeMenu(CellNodeMenuType.Main, m_devMenu); } public void AddCellNodeMenu(CellNodeMenuType type, CellNodeMenu nodeMenu) { if (m_cellMenus.ContainsKey(type)) { m_cellMenus[type] = nodeMenu; } else { m_cellMenus.Add(type, nodeMenu); } } private void CreateSpawnEnemyWaveMenu() { m_spawnEnemyWaveMenu = new CellNodeMenu("Spawn Enemy Wave Menu"); m_spawnEnemyWaveMenu.Setup(m_mainSettings); AddCellNodeMenu(CellNodeMenuType.SpawnEnemyWave, m_spawnEnemyWaveMenu); } private void CreateSelectWaveSettingsMenu() { m_selectWaveSettingsMenu = new CellNodeMenu("Select Wave Settings"); m_selectWaveSettingsMenu.Setup(m_mainSettings); AddCellNodeMenu(CellNodeMenuType.SelectWaveSettings, m_selectWaveSettingsMenu); } private void CreateSelectWavePopulationMenu() { m_selectWavePopulationMenu = new CellNodeMenu("Select Wave Population"); m_selectWavePopulationMenu.Setup(m_mainSettings); AddCellNodeMenu(CellNodeMenuType.SelectWavePopulation, m_selectWavePopulationMenu); } private void CreateSpawnEnemiesMenu() { m_spawnEnemiesMenu = new CellNodeMenu("Spawn Enemy On CrossHair"); m_spawnEnemiesMenu.Setup(m_mainSettings); AddCellNodeMenu(CellNodeMenuType.SpawnEnemies, m_spawnEnemiesMenu); } private void CreateMusicMenu() { m_musicSelect = new CellNodeMenu("Select Music"); m_musicSelect.Setup(m_mainSettings); AddCellNodeMenu(CellNodeMenuType.SelectMusic, m_musicSelect); } public void Init() { m_cellMenus = new Dictionary<CellNodeMenuType, CellNodeMenu>(); CreateMainSettings(); CreateMainDevMenu(); CreateSpawnEnemyWaveMenu(); CreateSelectWavePopulationMenu(); CreateSelectWaveSettingsMenu(); CreateSpawnEnemiesMenu(); CreateMusicMenu(); m_spawnEnemyWaveSettingsNode = new CellNodeChildMenu { Name = "SelectWaveSettings", Title = "Settings : 0 None", ChildMenu = m_selectWaveSettingsMenu }; m_spawnEnemyWavePopulationNode = new CellNodeChildMenu { Name = "SelectWavePopulation", Title = "Population : 0 None", ChildMenu = m_selectWavePopulationMenu }; m_spawnEnemyWaveMenu.AddCellNode(m_spawnEnemyWaveSettingsNode); m_spawnEnemyWaveMenu.AddCellNode(m_spawnEnemyWavePopulationNode); m_spawnWaveAreaDistanceNode = new CellNodeSlider { Title = "Area Distance", Name = "AreaDistance", Max_Value = 200f, Min_Value = 0f }; m_spawnWaveDelayNode = new CellNodeSlider { Name = "SpawnDelay", Title = "SpawnDelay", Max_Value = 200f, Min_Value = 0f }; m_spawnEnemyWaveMenu.AddCellNode(m_spawnWaveAreaDistanceNode); m_spawnEnemyWaveMenu.AddCellNode(m_spawnWaveDelayNode); m_devMenu.AddCellNode(new CellNodeChildMenu { Name = "SpawnEnemyWaveMenu", Title = "Spawn Enemy Wave", ChildMenu = m_spawnEnemyWaveMenu }); m_devMenu.AddCellNode(new CellNodeChildMenu { Name = "SpawnEnemies", Title = "Spawn Enemies", ChildMenu = m_spawnEnemiesMenu }); m_devMenu.AddCellNode(new CellNodeChildMenu { Name = "MusicSelect", Title = "Select Music", ChildMenu = m_musicSelect }); m_musicSelect.AddCellNode(new CellNodeButton { Name = "Testing", Title = "Testing", OnButtonAction = delegate { MusicManager.Machine.Sound.Post("music_ex_testing", true); } }); foreach (SurvivalWavePopulationDataBlock block2 in GameDataBlockBase<SurvivalWavePopulationDataBlock>.GetAllBlocks()) { m_selectWavePopulationMenu.AddCellNode(new CellNodeButton { Name = ((GameDataBlockBase<SurvivalWavePopulationDataBlock>)(object)block2).name, Title = ((GameDataBlockBase<SurvivalWavePopulationDataBlock>)(object)block2).persistentID + " : " + ((GameDataBlockBase<SurvivalWavePopulationDataBlock>)(object)block2).name, OnButtonAction = delegate { WavePopulationID = ((GameDataBlockBase<SurvivalWavePopulationDataBlock>)(object)block2).persistentID; m_spawnEnemyWavePopulationNode.Title = "Population : " + ((GameDataBlockBase<SurvivalWavePopulationDataBlock>)(object)block2).persistentID + " " + ((GameDataBlockBase<SurvivalWavePopulationDataBlock>)(object)block2).name; CellMenuViewer.SetIncomingMenuChange(m_spawnEnemyWaveMenu); } }); } foreach (SurvivalWaveSettingsDataBlock block in GameDataBlockBase<SurvivalWaveSettingsDataBlock>.GetAllBlocks()) { m_selectWaveSettingsMenu.AddCellNode(new CellNodeButton { Name = ((GameDataBlockBase<SurvivalWaveSettingsDataBlock>)(object)block).name, Title = ((GameDataBlockBase<SurvivalWaveSettingsDataBlock>)(object)block).persistentID + " : " + ((GameDataBlockBase<SurvivalWaveSettingsDataBlock>)(object)block).name, OnButtonAction = delegate { m_spawnEnemyWaveSettingsNode.Title = "Settings : " + ((GameDataBlockBase<SurvivalWaveSettingsDataBlock>)(object)block).persistentID + " " + ((GameDataBlockBase<SurvivalWaveSettingsDataBlock>)(object)block).name; WaveSettingsID = ((GameDataBlockBase<SurvivalWaveSettingsDataBlock>)(object)block).persistentID; CellMenuViewer.SetIncomingMenuChange(m_spawnEnemyWaveMenu); } }); } CellMenuViewer.SetStartingMenu(m_devMenu); } public CellNodeMenu GetCellNodeMenu(CellNodeMenuType type) { if (m_cellMenus.ContainsKey(type)) { return m_cellMenus[type]; } return null; } } } namespace Rebellion.ManualPatches { [HarmonyPatch(typeof(PlayerSyncModelData), "Setup")] internal class Patch_AnimatorReplacer { private static void Postfix(PlayerSyncModelData __instance) { PlayerManagerReb.ogAnimatorController = __instance.Owner.AnimatorBody.runtimeAnimatorController; __instance.Owner.AnimatorBody.runtimeAnimatorController = AssetAPI.GetLoadedAsset<RuntimeAnimatorController>("Assets/CustomAssets/OldAnimator/PlayerBaseRigController1.controller"); } } [HarmonyPatch(typeof(EB_InCombat), "TryAttacks")] internal class Patch_AttackDistanceMinFixer { private static bool Prefix(EB_InCombat __instance) { if (((AgentAI)((EB_StateBase)__instance).m_ai).Abilities.HasAbility((AgentAbility)1)) { return true; } if (((AgentAI)((EB_StateBase)__instance).m_ai).Target.m_distance > ((EB_StateBase)__instance).m_ai.m_enemyAgent.EnemyBehaviorData.RangedAttackDistance.Min) { return true; } return false; } } [HarmonyPatch(typeof(MeleeWeaponFirstPerson), "DoAttackDamage")] internal class Patch_FeedbackExtra { private static void Postfix(MeleeWeaponFirstPerson __instance, bool isPush) { if (!isPush) { if (__instance.m_damageToDeal > 10f) { ((ItemEquippable)__instance).Sound.Post(4211975284u, true); DramaManagerReb.StealthIntensityStinger(); } else { ((ItemEquippable)__instance).Sound.Post(3515277357u, true); } } } } [HarmonyPatch(typeof(PlayerFPSUtils), "PlayFootstep")] internal class Patch_Footstep { private static void Postfix(FeedbackPlayer vfx, Vector3 sourcePos) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) ItemEquipExtended.wantToDoFootstep = true; ItemEquipExtended.lastStepPos = sourcePos; } } [HarmonyPatch(typeof(PUI_InventoryItem), "Setup")] internal class Patch_InventoryExpander { private static void Postfix(PUI_InventoryItem __instance) { ((Component)__instance).gameObject.AddComponent<InvetoryExtendedUI>().me = __instance; } } [HarmonyPatch(typeof(PUI_InventoryItem), "SetState")] internal class Patch_InventoryHudMod { private static void Postfix(PUI_InventoryItem __instance) { if (!(((Object)((Component)((Component)__instance).transform.parent.parent.parent).gameObject).name == "CM_PageMap_CellUI(Clone)")) { __instance.m_empty_root.SetActive(false); __instance.m_slim_root.SetActive(false); __instance.m_selected_root.SetActive(true); __instance.CurrentHeight = 140f; } } } [HarmonyPatch(typeof(PLOC_Jump), "Enter")] internal class Patch_JumpRemover { private static bool Prefix(PLOC_Jump __instance) { return true; } } [HarmonyPatch(typeof(MWS_ChargeUp))] internal class Patch_MeleeChargeTimeGetter { [HarmonyPrefix] [HarmonyPatch(typeof(MWS_ChargeUp), "Enter")] private static void EnterS(MWS_ChargeUp __instance) { DramaManagerReb.meleeChargeTime = 1f; } [HarmonyPrefix] [HarmonyPatch(typeof(MWS_ChargeUp), "Exit")] private static void ExitS(MWS_ChargeUp __instance) { DramaManagerReb.meleeChargeTime = 0f; } } [HarmonyPatch(typeof(EnemyAgent), "Setup")] internal class Patch_PatrollerSetup { private static void Postfix(EnemyAgent __instance) { if (__instance.EnemyDataID == 32) { ((Component)__instance).gameObject.AddComponent<EnemyPatroller>(); } ((Component)__instance).gameObject.AddComponent<SyncedVoiceComp>(); ((Component)__instance).GetComponent<SyncedVoiceComp>().voice = __instance.Voice; } } [HarmonyPatch(typeof(CM_PlayerLobbyBar), "SetupFromPage")] internal class Patch_GearConfigureSetup { private static bool AlreadyAdded; public static CM_LobbyScrollItem templatebutton; public static CM_PlayerLobbyBar currentBar; private static void Postfix(CM_PlayerLobbyBar __instance) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown if (!AlreadyAdded) { GameObject val = new GameObject("MyNewButton1"); if ((Object)(object)val != (Object)null) { currentBar = __instance; templatebutton = __instance.m_clothesButton; val.AddComponent<GearConfigureMenu>(); Debug.LogError(Object.op_Implicit("creating main weapon configure menu")); val.GetComponent<GearConfigureMenu>().myIndex = __instance.PlayerSlotIndex; val.GetComponent<GearConfigureMenu>().myBar = __instance; val.GetComponent<GearConfigureMenu>().mode = GearConfigureMenuMode.MainWeaponMode; val.GetComponent<GearConfigureMenu>().GenerateMenu(); } Object.DontDestroyOnLoad((Object)(object)val); GameObject val2 = new GameObject("MyNewButton2"); if ((Object)(object)val2 != (Object)null) { val2.AddComponent<GearConfigureMenu>(); Debug.LogError(Object.op_Implicit("creating special weapon configure menu")); val2.GetComponent<GearConfigureMenu>().myIndex = __instance.PlayerSlotIndex; val2.GetComponent<GearConfigureMenu>().myBar = __instance; val2.GetComponent<GearConfigureMenu>().mode = GearConfigureMenuMode.SpecialWeaponMode; val2.GetComponent<GearConfigureMenu>().GenerateMenu(); } Object.DontDestroyOnLoad((Object)(object)val2); } } } [HarmonyPatch(typeof(EB_Patrolling), "UpdateBehaviour")] internal class Patch_RoamingEnemies { private static bool Prefix(EB_Patrolling __instance) { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) if (((EB_StateBase)__instance).m_ai.m_enemyAgent.EnemyDataID == 20) { return true; } ((EB_StateBase)__instance).m_ai.m_detection.UpdateTargets(); if (((EB_StateBase)__instance).m_ai.m_enemyAgent.Damage.IsStuckInGlue) { return false; } if (!((EB_StateBase)__instance).m_ai.m_abilities.CanTriggerAbilities) { return false; } if (((EB_StateBase)__instance).m_ai.m_scoutPath.IsValid && ((AgentAI)((EB_StateBase)__instance).m_ai).m_navMeshAgent.isOnNavMesh) { Vector3 position = ((AgentAI)((EB_StateBase)__instance).m_ai).Agent.Position; if (__instance.m_scoutPathTimer < Clock.Time) { Vector3 val = default(Vector3); if (((EB_StateBase)__instance).m_ai.m_scoutPath.GetPathGoal(position, ref val)) { ((EB_StateBase)__instance).m_ai.NavmeshAgentGoal = position; __instance.m_scoutPathTimer = 0f; __instance.m_pathfindingTimeout = Clock.Time + 20f; NetworkAPI.InvokeEvent<pSyncedVoiceEventData>("SyncedVoiceEvent", new pSyncedVoiceEventData { ID = 1, EnemyID = ((Agent)((EB_StateBase)__instance).m_ai.m_enemyAgent).m_replicator.Key + 1 }, (SNet_ChannelType)2); NetManager.SyncedVoice(0uL, new pSyncedVoiceEventData { ID = 1, EnemyID = ((Agent)((EB_StateBase)__instance).m_ai.m_enemyAgent).m_replicator.Key + 1 }); ((EB_StateBase)__instance).m_ai.m_enemyAgent.Appearance.InterpolateGlow(new Color(1f, 1f, 1f, 1f), ES_ScoutScream.s_glowLocation, 0.1f); ((EB_StateBase)__instance).m_ai.m_enemyAgent.Appearance.InterpolateGlow(new Color(0f, 0f, 0f, 1f), ES_ScoutScream.s_glowLocation, 4f); ((Component)((EB_StateBase)__instance).m_ai).gameObject.GetComponent<EnemyPatroller>().EB = __instance; ((Component)((EB_StateBase)__instance).m_ai).gameObject.GetComponent<EnemyPatroller>().CallTimer = 1f; } else { ((EB_StateBase)__instance).m_ai.NavmeshAgentGoal = val; Vector3 val2 = val - position; if (((Vector3)(ref val2)).sqrMagnitude > 0.010000001f) { ((AgentAI)((EB_StateBase)__instance).m_ai).Agent.TargetLookDir = ((Vector3)(ref val2)).normalized; } if (__instance.m_pathfindingTimeout < Clock.Time) { ((EB_StateBase)__instance).m_ai.m_scoutPath.SetPathGoal(Random.Range(0, (int)((EB_StateBase)__instance).m_ai.m_scoutPath.m_pathData.pathSteps), ref val); ((EB_StateBase)__instance).m_ai.NavmeshAgentGoal = val; __instance.m_scoutPathTimer = 0f; __instance.m_pathfindingTimeout = Clock.Time + 20f; } } } else { ((EB_StateBase)__instance).m_ai.NavmeshAgentGoal = position; } } if (((AgentAI)((EB_StateBase)__instance).m_ai).Agent.CourseNode.m_playerCoverage.GetNodeDistanceToClosestPlayer_Unblocked() < 3 && ((AgentAI)((EB_StateBase)__instance).m_ai).Abilities.HasAbility((AgentAbility)7) && ((AgentAI)((EB_StateBase)__instance).m_ai).Abilities.IsAbilityReady((AgentAbility)7, 0)) { ((AgentAI)((EB_StateBase)__instance).m_ai).Abilities.UseAbility((AgentAbility)7); } return false; } } [HarmonyPatch(typeof(ES_ScoutScream), "CommonUpdate")] internal class Patch_ScoutScreamFix { private static bool Prefix(ES_ScoutScream __instance) { //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Expected I4, but got Unknown //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected I4, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) ScoutScreamState state; if (((ES_Base)__instance).m_enemyAgent.EnemyDataID == 20) { state = __instance.m_state; switch ((int)state) { case 0: ((ES_Base)__instance).m_enemyAgent.Appearance.InterpolateGlow(new Color(0.1f, 0.1f, 0.1f), ES_ScoutScream.s_glowLocation, 4f); ((ES_Base)__instance).m_locomotion.m_animator.applyRootMotion = true; ((ES_Base)__instance).m_locomotion.m_animator.CrossFadeInFixedTime(((Il2CppArrayBase<int>)(object)EnemyLocomotion.s_hashAbilityUse)[__instance.m_animIndex], 0.15f); __instance.m_stateDoneTimer = Clock.Time + 0.5f; __instance.m_state = (ScoutScreamState)1; AdditonalVoicelinesManager.AlertedScout(); return false; case 1: if (!(__instance.m_stateDoneTimer < Clock.Time)) { break; } ((ES_Base)__instance).m_enemyAgent.Voice.PlayVoiceEvent(3688585605u); ((ES_Base)__instance).m_enemyAgent.Appearance.InterpolateGlow(Color.white, ES_ScoutScream.s_glowLocation, 0.7f); if (SNet.IsMaster && (Object)(object)((ES_Base)__instance).m_ai.m_group != (Object)null) { Agent val = null; PlayerAgent val2 = default(PlayerAgent); if (((AgentAI)((ES_Base)__instance).m_ai).Target != null && (Object)(object)((AgentAI)((ES_Base)__instance).m_ai).Target.m_agent != (Object)null && ((AgentAI)((ES_Base)__instance).m_ai).Target.m_agent.Alive) { val = ((AgentAI)((ES_Base)__instance).m_ai).Target.m_agent; } else if (((Agent)((ES_Base)__instance).m_enemyAgent).CourseNode != null && PlayerManager.TryGetClosestAlivePlayerAgent(((Agent)((ES_Base)__instance).m_enemyAgent).CourseNode, ref val2)) { val = (Agent)(object)val2; } if ((Object)(object)val != (Object)null) { ((ES_Base)__instance).m_enemyAgent.PropagateTargetFull(val); ((AgentAI)((ES_Base)__instance).m_ai).Target.m_propagation = (AgentTargetPropagationType)0; } } GameEventManager.PostEvent((eGameEvent)44, (PlayerAgent)null, 0f, "", (Dictionary<string, string>)null); ((ES_Base)__instance).m_locomotion.m_animator.CrossFadeInFixedTime(((Il2CppArrayBase<int>)(object)EnemyLocomotion.s_hashAbilityUseOut)[__instance.m_animIndex], 0.15f); __instance.m_stateDoneTimer = Clock.Time + 1.5f; __instance.m_state = (ScoutScreamState)2; return false; case 2: if (__instance.m_stateDoneTimer < Clock.Time) { ((ES_Base)__instance).m_enemyAgent.Appearance.InterpolateGlow(new Color(0.1f, 0.1f, 0.1f), 0.5f); __instance.m_stateDoneTimer = Clock.Time + 1f; __instance.m_state = (ScoutScreamState)3; return false; } break; case 3: if (!(__instance.m_stateDoneTimer < Clock.Time)) { break; } if (SNet.IsMaster) { if (((Agent)((ES_Base)__instance).m_enemyAgent).CourseNode != null) { if (RundownManager.ActiveExpedition.Expedition.ScoutWaveSettings != 0 && RundownManager.ActiveExpedition.Expedition.ScoutWavePopulation != 0) { ushort num = default(ushort); Mastermind.Current.TriggerSurvivalWave(((Agent)((ES_Base)__instance).m_enemyAgent).CourseNode, RundownManager.ActiveExpedition.Expedition.ScoutWaveSettings, RundownManager.ActiveExpedition.Expedition.ScoutWavePopulation, ref num, (SurvivalWaveSpawnType)0, 0f, 2f, true, false, default(Vector3), ""); } else { Debug.LogError(Object.op_Implicit("ES_ScoutScream, a scout is screaming but we can't spawn a wave because the the scout settings are not set for __instance expedition! ScoutWaveSettings: " + RundownManager.ActiveExpedition.Expedition.ScoutWaveSettings + " ScoutWavePopulation: " + RundownManager.ActiveExpedition.Expedition.ScoutWavePopulation)); } } ((ES_Base)__instance).m_enemyAgent.AI.m_behaviour.ChangeState((EB_States)5); } ((MachineState<ES_Base>)(object)__instance).m_machine.ChangeState(2); __instance.m_state = (ScoutScreamState)4; break; default: return false; case 4: break; } return false; } state = __instance.m_state; switch ((int)state) { case 0: ((ES_Base)__instance).m_locomotion.m_animator.applyRootMotion = true; ((ES_Base)__instance).m_locomotion.m_animator.CrossFadeInFixedTime(((Il2CppArrayBase<int>)(object)EnemyLocomotion.s_hashAbilityUse)[__instance.m_animIndex], 2.15f); __instance.m_stateDoneTimer = Clock.Time + 0.1f; __instance.m_state = (ScoutScreamState)1; return false; case 1: if (!(__instance.m_stateDoneTimer < Clock.Time)) { break; } ((ES_Base)__instance).m_enemyAgent.Voice.PlayVoiceEvent(2820929198u); if (SNet.IsMaster && (Object)(object)((ES_Base)__instance).m_ai.m_group != (Object)null) { Agent val3 = null; PlayerAgent val4 = default(PlayerAgent); if (((AgentAI)((ES_Base)__instance).m_ai).Target != null && (Object)(object)((AgentAI)((ES_Base)__instance).m_ai).Target.m_agent != (Object)null && ((AgentAI)((ES_Base)__instance).m_ai).Target.m_agent.Alive) { val3 = ((AgentAI)((ES_Base)__instance).m_ai).Target.m_agent; } else if (((Agent)((ES_Base)__instance).m_enemyAgent).CourseNode != null && PlayerManager.TryGetClosestAlivePlayerAgent(((Agent)((ES_Base)__instance).m_enemyAgent).CourseNode, ref val4)) { val3 = (Agent)(object)val4; } if ((Object)(object)val3 != (Object)null) { ((ES_Base)__instance).m_enemyAgent.PropagateTargetFull(val3); ((AgentAI)((ES_Base)__instance).m_ai).Target.m_propagation = (AgentTargetPropagationType)0; } } GameEventManager.PostEvent((eGameEvent)44, (PlayerAgent)null, 0f, "", (Dictionary<string, string>)null); ((ES_Base)__instance).m_locomotion.m_animator.CrossFadeInFixedTime(((Il2CppArrayBase<int>)(object)EnemyLocomotion.s_hashAbilityUseOut)[__instance.m_animIndex], 1.15f); __instance.m_stateDoneTimer = Clock.Time + 0.2f; __instance.m_state = (ScoutScreamState)2; return false; case 2: if (__instance.m_stateDoneTimer < Clock.Time) { __instance.m_stateDoneTimer = Clock.Time + 0.1f; __instance.m_state = (ScoutScreamState)3; return false; } break; case 3: if (!(__instance.m_stateDoneTimer < Clock.Time)) { break; } if (SNet.IsMaster) { if (((Agent)((ES_Base)__instance).m_enemyAgent).CourseNode != null && (RundownManager.ActiveExpedition.Expedition.ScoutWaveSettings == 0 || RundownManager.ActiveExpedition.Expedition.ScoutWavePopulation == 0)) { Debug.LogError(Object.op_Implicit("ES_ScoutScream, a scout is screaming but we can't spawn a wave because the the scout settings are not set for __instance expedition! ScoutWaveSettings: " + RundownManager.ActiveExpedition.Expedition.ScoutWaveSettings + " ScoutWavePopulation: " + RundownManager.ActiveExpedition.Expedition.ScoutWavePopulation)); } ((ES_Base)__instance).m_enemyAgent.AI.m_behaviour.ChangeState((EB_States)5); } ((MachineState<ES_Base>)(object)__instance).m_machine.ChangeState(2); __instance.m_state = (ScoutScreamState)4; ((ES_Base)__instance).m_enemyAgent.Locomotion.Scream.ActivateState(); break; default: return false; case 4: break; } return false; } } [HarmonyPatch(typeof(StrikerTentacle), "Setup")] internal class Patch_TentacleCustomization2 { private static void Postfix(StrikerTentacle __instance) { ((MovingEnemyTentacleBase)__instance).m_attackHangDuration = 0.15f; ((MovingEnemyTentacleBase)__instance).m_attackOutDuration = 0.5f; ((MovingEnemyTentacleBase)__instance).m_attackInDuration = 0.9f; if (((MovingEnemyTentacleBase)__instance).m_owner.EnemyDataID == 32) { ((MovingEnemyTentacleBase)__instance).m_attackHangDuration = 0.15f; ((MovingEnemyTentacleBase)__instance).m_attackOutDuration = 1f; ((MovingEnemyTentacleBase)__instance).m_attackInDuration = 1.3f; } _ = ((MovingEnemyTentacleBase)__instance).m_owner.EnemyDataID; _ = 13; } } [HarmonyPatch(typeof(StrikerBigTentacle), "Setup")] internal class Patch_TentacleCustomization { private static void Postfix(StrikerBigTentacle __instance) { ((MovingEnemyTentacleBase)__instance).m_attackHangDuration = 0.2f; ((MovingEnemyTentacleBase)__instance).m_attackOutDuration = 0.7f; ((MovingEnemyTentacleBase)__instance).m_attackInDuration = 1.3f; } } [HarmonyPatch(typeof(PUI_WardenIntel), "PlayIntro")] internal class Patch_WardenIntelFix { public static bool Prefix(ref PUI_WardenIntel __instance) { ((Component)__instance.m_intelText).gameObject.SetActive(true); CellSound.Post(1127303501u); return false; } } [HarmonyPatch(typeof(PUI_WardenIntel), "SetWardenObjectiveText")] internal class Patch_WardenObjectiveFixer { private static void Postfix(ref PUI_WardenIntel __instance, string text) { string text2 = text.Remove(0, 19); Debug.LogWarning(Object.op_Implicit(text2)); __instance.SetIntelText("<size=50%>" + Text.Get(1063u) + "</size>\n\n" + text2 + "\n> MSGdec_STATUS::E_DONE\n> _Transmission checksum " + "\n\n<size=50%>" + Text.Get(1064u) + "</size>"); } } [HarmonyPatch(typeof(ItemEquippable), "Setup")] internal class Patch_XrayDeviceSetup { private static void Postfix(ItemEquippable __instance) { ((Component)((Component)__instance).gameObject.transform).gameObject.AddComponent<ItemEquipExtended>().baseItem = __instance; if (((GameDataBlockBase<ItemDataBlock>)(object)((Item)__instance).ItemDataBlock).persistentID == 280) { Debug.LogWarning(Object.op_Implicit("Found a valid Geo Scanner in the scene, setting up!")); if (__instance.IsFirstPerson) { Debug.LogError(Object.op_Implicit("Geoscanner is first person, no setup needed!!")); } else if ((Object)(object)((Component)__instance).gameObject.GetComponentInChildren<XRayFixer>() == (Object)null) { ((Component)((Component)__instance).gameObject.transform).gameObject.AddComponent<XRayFixer>().baseItem = __instance; Debug.LogWarning(Object.op_Implicit("Added fix to object " + ((Object)((Component)((Component)__instance).gameObject.transform).gameObject).name)); } else { Debug.LogError(Object.op_Implicit("Geoscanner already is set up, no setup needed!")); } } } } [HarmonyPatch(typeof(CellSoundPlayer))] internal class SoundReplacer { [HarmonyPrefix] [HarmonyPatch("Post", new Type[] { typeof(uint), typeof(bool) })] private static void Pre_Post(ref uint eventID) { if ((eventID == 2160274501u) | (eventID == 768503094) | (eventID == 1819299087) | (eventID == 3625472185u)) { Debug.Log(Object.op_Implicit("MH")); PlayerManager.GetLocalPlayerAgent().Sound.Post(2093701887u, true); } else { eventID = ReplaceID(eventID); } } [HarmonyPrefix] [HarmonyPatch("Post", new Type[] { typeof(uint), typeof(Vector3), typeof(uint), typeof(EventCallback), typeof(Object) })] private static void Pre_Post01(ref uint eventID) { eventID = ReplaceID(eventID); } [HarmonyPrefix] [HarmonyPatch("Post", new Type[] { typeof(uint), typeof(Vector3) })] private static void Pre_Post02(ref uint eventID) { if ((eventID == 2160274501u) | (eventID == 768503094) | (eventID == 1819299087) | (eventID == 3625472185u)) { Debug.Log(Object.op_Implicit("MH")); PlayerManager.GetLocalPlayerAgent().Sound.Post(2093701887u, true); } else { eventID = ReplaceID(eventID); } } private static uint ReplaceID(uint eventID) { switch (eventID) { case 4270998765u: eventID = 2939456325u; break; case 2919376041u: eventID = 2939456325u; break; case 2828481591u: Debug.Log(Object.op_Implicit("tried to play sentry gun")); eventID = 19025225u; break; case 717493063u: Debug.Log(Object.op_Implicit("tried to play combat start")); eventID = 90571910u; break; case 123102314u: Debug.Log(Object.op_Implicit("tried to play combat talk")); eventID = 1909330524u; break; case 774767036u: Debug.Log(Object.op_Implicit("tried to play address dauda")); eventID = 2330154291u; break; case 1127303501u: eventID = 3981670108u; break; case 2442512993u: eventID = 0u; break; } return eventID; } } [HarmonyPatch(typeof(CellSoundPlayer), "SetSwitch", new Type[] { typeof(uint), typeof(uint) })] internal class SwitchReplacer { private static void Prefix(ref uint switchGroup, ref uint switchState) { switch (switchState) { case 1245291998u: switch (MusicManagerReb.State) { case GameStateEnum.Calm: switchState = 1245291998u; break; case GameStateEnum.Tension: switchState = 2179465995u; break; case GameStateEnum.Alert: switchState = 1305779336u; break; case GameStateEnum.Panic: switchState = 2102845944u; break; } break; case 2179465995u: switch (MusicManagerReb.State) { case GameStateEnum.Calm: switchState = 1245291998u; break; case GameStateEnum.Tension: switchState = 2179465995u; break; case GameStateEnum.Alert: switchState = 1305779336u; break; case GameStateEnum.Panic: switchState = 2102845944u; break; } break; case 1305779336u: switch (MusicManagerReb.State) { case GameStateEnum.Calm: switchState = 1245291998u; break; case GameStateEnum.Tension: switchState = 2179465995u; break; case GameStateEnum.Alert: switchState = 1305779336u; break; case GameStateEnum.Panic: switchState = 2102845944u; break; } break; case 2102845944u: switch (MusicManagerReb.State) { case GameStateEnum.Calm: switchState = 1245291998u; break; case GameStateEnum.Tension: switchState = 2179465995u; break; case GameStateEnum.Alert: switchState = 1305779336u; break; case GameStateEnum.Panic: switchState = 2102845944u; break; } break; } } } } namespace Rebellion.Data { public class DestroyCellSoundPlayerData { public CellSoundPlayer Player; public float TimeToDestroy; public bool Started; public bool TimeReached => TimeToDestroy < Time.time; public void Destroy() { if (Player != null) { Player.Recycle(); } } } public enum GameStateEnum { Calm, Tension, Alert, Panic } public enum GearConfigureMenuMode { Default, MainWeaponMode, SpecialWeaponMode } public struct pScareWaveData { public int Empty; } public enum SurvivalHordeIntensity { None, Medium, High } public enum WeaponPartCompChannel { None, Pistol, Revolver, SMG, Rifle, Machinegun, ShotgunPump, Shotgun, Sniper, Bullpup } public enum WeaponPartType { Stock, Receiver, Front, Ammo } public enum WeaponReceiverFireType { NoChange, Semi, Burst, Auto } } namespace Rebellion.CoreManager { public class CoreManager { public static CoreManager Current; private GameObject m_managerObject; private List<GameManagerRebBase> m_managers; private BP_Coder m_coder; public static void Initialize() { Current = new CoreManager(); Current.Setup(); RebLogger.Current.LogMessage((object)"CoreManager initiated!!"); } private void CreateManager<T>() where T : GameManagerRebBase { T item = m_managerObject.AddIl2PPComponent<T>(); m_managers.Add(item); } private void Setup() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown m_coder = new BP_Coder(67343); m_managers = new List<GameManagerRebBase>(); m_managerObject = new GameObject(); CreateManager<LevelGenerationReb>(); CreateManager<MusicManagerReb>(); CreateManager<EnemyManagerReb>(); CreateManager<PlayerManagerReb>(); CreateManager<CellSettingsRebManager>(); CreateManager<DramaManagerReb>(); CreateManager<CellSoundManagerReb>(); CreateManager<AlarmLightsManager>(); CreateManager<AdditonalVoicelinesManager>(); CreateManager<HudTransformer>(); CreateManager<GameDirectorManager>(); CreateManager<GearCustomizerManager>(); } } } namespace Rebellion.CoreManager.ExpeditionLevelBehavior { public class ELB_Base { protected virtual void OnBuildDone() { } protected virtual void OnLevelCleanUp() { } protected virtual void Update() { } protected virtual void LateUpdate() { } } } namespace Rebellion.CoreManager.Managers { internal class AdditonalVoicelinesManager : GameManagerRebBase { public static float alertedRoomCooldown; public static bool hordeEntered; public static void AlertedScout() { if (SNet.LocalPlayer.IsMaster) { PlayerDialogManager.WantToStartDialog(46u, -1, false, true); } } public static void AlertedRoom() { if ((alertedRoomCooldown < 0f) & SNet.LocalPlayer.IsMaster) { alertedRoomCooldown = 9f; PlayerDialogManager.WantToStartDialog(45u, -1, false, true); Debug.Log(Object.op_Implicit("Tried to force alert room voicelines!")); } } public static void StartMission() { PlayerDialogManager.WantToStartDialog(87u, -1, false, true); } public static void EnterHorde() { PlayerDialogManager.WantToStartDialog(46u, -1, false, true); } public void Update() { alertedRoomCooldown -= Time.deltaTime; } } internal class AlarmLightsManager : GameManagerRebBase { private void Start() { EventAPI.OnExpeditionStarted += Init; } private void Init() { if (SNet.LocalPlayer.IsMaster) { AdditonalVoicelinesManager.StartMission(); } foreach (LG_Light item in Object.FindObjectsOfType<LG_Light>()) { _ = item; } } } public class CellSettingsRebManager : GameManagerRebBase { public static bool GameIsFocused; private RebPatcher<CellSettingsRebManager> m_patcher; private void Start() { GameIsFocused = true; m_patcher = new RebPatcher<CellSettingsRebManager>(); m_patcher.Patch<CellSettingsManager>("OnApplicationFocus", (HarmonyPatchType)2, BindingFlags.Instance | BindingFlags.Public); } private static void CellSettingsManager__OnApplicationFocus__Postfix(bool focus) { GameIsFocused = focus; } } public class CellSoundManagerReb : GameManagerRebBase { public static CellSoundManagerReb Current; private List<DestroyCellSoundPlayerData> m_datas; private void Awake() { Current = this; } private void Start() { m_datas = new List<DestroyCellSoundPlayerData>(); } private void UpdateCellSounds() { for (int num = m_datas.Count - 1; num >= 0; num--) { DestroyCellSoundPlayerData destroyCellSoundPlayerData = m_datas[num]; if (!destroyCellSoundPlayerData.Started) { destroyCellSoundPlayerData.Started = true; } else if (destroyCellSoundPlayerData.TimeReached) { destroyCellSoundPlayerData.Destroy(); m_datas.RemoveAt(num); } } } public static void AddCellSoundToDestroy(DestroyCellSoundPlayerData newData) { Current.m_datas.Add(newData); } } public class DeveloperCommandManager : GameManagerRebBase { private MainDevMenu m_mainDevMenu; private ushort m_rootEventID; private CellNode m_spawnEnemyWaveSettingsNode; private GUIStyle m_debugStyle; public static bool HasForcedDramaState; public static DRAMA_State ForcedDramaState; private RebPatcher<DeveloperCommandManager> m_patcher; private void Start() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0016: Unknown result type (might be due to invalid IL or missing references) m_debugStyle = new GUIStyle(); m_debugStyle.normal.textColor = Color.white; m_debugStyle.fontSize = 15; SetupNodes(); m_patcher = new RebPatcher<DeveloperCommandManager>(); m_patcher.Patch<DramaManager>("GoToCombat", (HarmonyPatchType)2, (MethodType)1, BindingFlags.Static | BindingFlags.Public); m_patcher.Patch<DramaManager>("GoToEncounter", (HarmonyPatchType)2, (MethodType)1, BindingFlags.Static | BindingFlags.Public); m_patcher.Patch<DramaManager>("GoToExploration", (HarmonyPatchType)2, (MethodType)1, BindingFlags.Static | BindingFlags.Public); m_patcher.Patch<DramaManager>("GoToSneaking", (HarmonyPatchType)2, (MethodType)1, BindingFlags.Static | BindingFlags.Public); m_patcher.Patch<DramaManager>("GoToAlert", (HarmonyPatchType)2, (MethodType)1, BindingFlags.Static | BindingFlags.Public); } private static void DramaManager__GoToCombat__Postfix(ref bool __result) { if (HasForcedDramaState) { __result = DramaStateIsForced((DRAMA_State)6) || DramaStateIsForced((DRAMA_State)7) || DramaStateIsForced((DRAMA_State)8); } } private static void DramaManager__GoToAlert__Postfix(ref bool __result) { if (HasForcedDramaState) { __result = DramaStateIsForced((DRAMA_State)3); } } private static void DramaManager__GoToEncounter__Postfix(ref bool __result) { if (HasForcedDramaState) { __result = DramaStateIsForced((DRAMA_State)5); } } private static void DramaManager__GoToExploration__Postfix(ref bool __result) { if (HasForcedDramaState) { __result = DramaStateIsForced((DRAMA_State)2); } } private static void DramaManager__GoToSneaking__Postfix(ref bool __result) { if (HasForcedDramaState) { __result = DramaStateIsForced((DRAMA_State)4); } } private static bool DramaStateIsForced(DRAMA_State state) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) if (HasForcedDramaState) { return ForcedDramaState == state; } return false; } private void ForceDramaState(DRAMA_State state) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) HasForcedDramaState = true; ForcedDramaState = state; if (DramaManager.CurrentStateEnum != state) { DramaManager.ChangeState(state, true); } RebLogger.Current.LogMessage((object)("<<Forcing Drama State -> " + ((object)(DRAMA_State)(ref state)).ToString() + ">>>")); } private void UnForceDramaState() { HasForcedDramaState = false; RebLogger.Current.LogMessage((object)"<<Unforcing Drama State>>"); } private void SetupNodes() { m_mainDevMenu = new MainDevMenu(); m_mainDevMenu.Init(); CellNodeMenu cellNodeMenu = m_mainDevMenu.GetCellNodeMenu(CellNodeMenuType.Main); cellNodeMenu.AddCellNode(new CellNodeButton { Name = "KillAllEnemies", Title = "Kill all enemies!", Description = "This button will kill all the enemies", OnButtonAction = KillAllEnemies }); cellNodeMenu.AddCellNode(new CellNodeButton { Name = "OpenDoor", Title = "Open Door!", Description = "Open the door on crosshair?", OnButtonAction = OpenSecurityDoor }); cellNodeMenu.AddCellNode(new CellNodeButton { Name = "SurvivalWaveStingerTest", Title = "Survival Stinger!", Description = "", OnButtonAction = delegate { MusicManager.Machine.Sound.Post(3777224378u, true); } }); cellNodeMenu.AddCellNode(new CellNodeButton { Name = "GiveAllSupllies", Title = "Give all Supplies to players!", Description = "Refull Ammo, Tool, Heath, and Disinfection", OnButtonAction = delegate { Enumerator<PlayerAgent> enumerator2 = PlayerManager.PlayerAgentsInLevel.GetEnumerator(); while (enumerator2.MoveNext()) { PlayerAgent current = enumerator2.Current; current.GiveAmmoRel(current, 10000000f, 100000f, 10000f); current.GiveHealth(current, 1000f); current.GiveDisinfection(current, 1000f); } } }); cellNodeMenu.AddCellNode(new CellNodeButton { Name = "FreeCam", Title = "Free Cam", OnButtonAction = ToggleFreeCam }); cellNodeMenu.AddCellNode(new CellNodeButton { Name = "DisableAllWaves", Title = "Disable all enemy waves.", OnButtonAction = DisableEnemyWaves }); m_mainDevMenu.GetCellNodeMenu(CellNodeMenuType.SpawnEnemyWave).AddCellNode(new CellNodeButton { Name = "SpawnWave", Title = "Spawn Wave!", OnButtonAction = delegate { SpawnEnemyWave(); } }); CellNodeMenu cellNodeMenu2 = m_mainDevMenu.GetCellNodeMenu(CellNodeMenuType.SpawnEnemies); foreach (EnemyDataBlock enemyDataBlock in GameDataBlockBase<EnemyDataBlock>.GetAllBlocks()) { cellNodeMenu2.AddCellNode(new CellNodeButton { Title = ((GameDataBlockBase<EnemyDataBlock>)(object)enemyDataBlock).persistentID + " : " + ((GameDataBlockBase<EnemyDataBlock>)(object)enemyDataBlock).name, Name = ((GameDataBlockBase<EnemyDataBlock>)(object)enemyDataBlock).persistentID + " : " + ((GameDataBlockBase<EnemyDataBlock>)(object)enemyDataBlock).name, OnButtonAction = delegate { Spawnenemycroshairs(((GameDataBlockBase<EnemyDataBlock>)(object)enemyDataBlock).persistentID); } }); } } private void TestDialog() { PlayerAgent val = default(PlayerAgent); if (PlayerManager.TryGetLocalPlayerAgent(ref val)) { PlayerDialogManager.WantToStartDialogForced(107u, val); } } private void ToggleFreeCam() { FocusStateManager.ToggleFreeflight(); } private void SpawnEnemyWave() { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) if (m_mainDevMenu.WaveSettingsID != 0 && m_mainDevMenu.WavePopulationID != 0) { CellNodeMenu cellNodeMenu = m_mainDevMenu.GetCellNodeMenu(CellNodeMenuType.SpawnEnemyWave); CellNodeSlider cellNodeSlider = cellNodeMenu.GetCellNode("SpawnDelay") as CellNodeSlider; CellNodeSlider cellNodeSlider2 = cellNodeMenu.GetCellNode("AreaDistance") as CellNodeSlider; SurvivalWave.Spawn(cellNodeSlider.Val, cellNodeSlider2.Val, (SurvivalWaveSpawnType)0, ((Agent)PlayerManager.GetLocalPlayerAgent()).CourseNode, (ushort)m_mainDevMenu.WaveSettingsID, (ushort)m_mainDevMenu.WavePopulationID, m_rootEventID, true, false, default(Vector3)); } } private void Spawnenemycroshairs(uint enemyID) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (Physics.Raycast(Camera.main.ScreenPointToRay(new Vector3((float)(Screen.width / 2), (float)(Screen.height / 2), 0f)), ref val, 1000f)) { PlayerAgent localPlayerAgent = PlayerManager.GetLocalPlayerAgent(); Vector3 val2 = ((RaycastHit)(ref val)).point; EnemyAllocator.ResetAllowedToSpawn(); AgentMode val3 = (AgentMode)4; if ((Object)(object)localPlayerAgent != (Object)null && (Object)(object)localPlayerAgent.FPSCamera.CameraRayObject != (Object)null) { val2 = localPlayerAgent.FPSCamera.CameraRayObject.transform.position; } EnemyAllocator.Current.SpawnEnemy(enemyID, ((Agent)PlayerManager.GetLocalPlayerAgent()).CourseNode, val3, val2, ((Agent)PlayerManager.GetLocalPlayerAgent()).Rotation, (EnemyGroup)null, -1); } } private void SetBreathingIntensity(uint switchID) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) PlayerAgent localPlayerAgent = PlayerManager.GetLocalPlayerAgent(); localPlayerAgent.Breathing.m_sfxBreathe.Post(806170108u, true); localPlayerAgent.Breathing.m_sfxBreathe.SetSwitch(1197021888u, switchID); } private void KillAllEnemies() { PlayerAgent val = default(PlayerAgent); if (!PlayerManager.TryGetLocalPlayerAgent(ref val) || ((Agent)val).CourseNode == null) { return; } Enumerator<EnemyAgent> enumerator = AIG_CourseGraph.GetReachableEnemiesInNodes(((Agent)val).CourseNode, 4).GetEnumerator(); while (enumerator.MoveNext()) { EnemyAgent current = enumerator.Current; if ((Object)(object)current != (Object)null && ((Agent)current).Alive) { current.Damage.InstantDead(true); } } } private void GodMode() { PlayerAgent val = default(PlayerAgent); if (PlayerManager.TryGetLocalPlayerAgent(ref val)) { val.Damage.ToggleGodMode(); } } private void PrintMaterials() { PlayerAgent val = default(PlayerAgent); if (!PlayerManager.TryGetLocalPlayerAgent(ref val) || (Object)(object)val.FPSCamera == (Object)null || (Object)(object)val.FPSCamera.CameraRayObject == (Object)null) { return; } EnemyAgent val2 = val.FPSCamera.CameraRayObject.GetComponent<EnemyAgent>(); if ((Object)(object)val2 == (Object)null) { val2 = val.FPSCamera.CameraRayObject.GetComponentInParent<EnemyAgent>(); } if ((Object)(object)val2 == (Object)null) { RebLogger.Current.LogError((object)"Couldn't get enemyAgent!"); return; } if ((Object)(object)val2.MaterialHandler == (Object)null) { RebLogger.Current.LogError((object)"Couldn't get MaterialHandler!"); return; } RebLogger.Current.LogMessage((object)(((GameDataBlockBase<EnemyDataBlock>)(object)val2.EnemyData).name + " Materials...")); Enumerator<MaterialRef> enumerator = val2.MaterialHandler.m_materialRefs.GetEnumerator(); while (enumerator.MoveNext()) { MaterialRef current = enumerator.Current; RebLogger.Current.LogMessage((object)("\tMaterial : " + ((Object)current.m_material).name)); } } private void DisableEnemyWaves() { Enumerator<MastermindEvent> enumerator = Mastermind.Current.m_events.GetEnumerator(); while (enumerator.MoveNext()) { SurvivalWave val = ((Il2CppObjectBase)enumerator.Current).TryCast<SurvivalWave>(); if ((Object)(object)val != (Object)null) { ((MastermindEvent)val).StopEvent(); } } } private void OpenSecurityDoor() { PlayerAgent val = default(PlayerAgent); if (!PlayerManager.TryGetLocalPlayerAgent(ref val) || (Object)(object)val.FPSCamera == (Object)null || (Object)(object)val.FPSCamera.CameraRayObject == (Object)null) { return; } LG_SecurityDoor val2 = val.FPSCamera.CameraRayObject.GetComponent<LG_SecurityDoor>(); if ((Object)(object)val2 == (Object)null) { val2 = val.FPSCamera.CameraRayObject.GetComponentInParent<LG_SecurityDoor>(); } if ((Object)(object)val2 != (Object)null) { val2.ForceOpenSecurityDoor(); return; } LG_WeakDoor val3 = val.FPSCamera.CameraRayObject.GetComponent<LG_WeakDoor>(); if ((Object)(object)val3 == (Object)null) { val3 = val.FPSCamera.CameraRayObject.GetComponentInParent<LG_WeakDoor>(); } if ((Object)(object)val3 != (Object)null) { val3.AttemptOpenCloseInteraction(true); } } private void Update() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Invalid comparison between Unknown and I4 if (SNet.IsMaster && Input.GetKeyDown((KeyCode)282) && (int)FocusStateManager.CurrentState == 4) { CellMenuViewer.Toggle(); } } private void OnGUI() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) Rect val = new Rect(1100f, 20f, 500f, 500f); string[] obj = new string[6] { "Drama : ", null, null, null, null, null }; DRAMA_State currentStateEnum = DramaManager.CurrentStateEnum; obj[1] = ((object)(DRAMA_State)(ref currentStateEnum)).ToString(); obj[2] = " ("; obj[3] = DramaManager.Tension.ToString(); obj[4] = ")\nMusic : "; MUS_State val2 = MusicManager.CurrentState(); obj[5] = ((object)(MUS_State)(ref val2)).ToString(); GUI.Label(val, string.Concat(obj), m_debugStyle); CellMenuViewer.OnGUI(); } public DeveloperCommandManager(IntPtr pointer) : base(pointer) { } } public class DramaManagerReb : GameManagerRebBase { public static float meleeChargeTime; public bool inTension; private bool switchedToCombat; private bool m_wardenEnabled = true; private eGameStateName m_lastGameState; private RebPatcher<DramaManagerReb> m_patcher; private DRAMA_State m_lastDramaState; private void Start() { m_patcher = new RebPatcher<DramaManagerReb>(); m_patcher.Patch<DramaManager>("DoSyncDramaState", (HarmonyPatchType)2, BindingFlags.Instance | BindingFlags.Public); MusicManager.Machine.Sound.Post(4152450218u, true); } private void Update() { UpdateDramaState(); UpdateElevatorStatus(); UpdateCombatVariables(); } private void DeprecatedMusic() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Invalid comparison between Unknown and I4 //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Invalid comparison between Unknown and I4 //IL_0141: 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) //IL_0103: 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) if (((int)MusicManager.CurrentState() == 6) | ((int)MusicManager.CurrentState() == 15)) { _ = inTension; if (PlayerManager.GetLocalPlayerAgent().m_courseNode.m_enemiesInNode.Count > 10) { if ((double)meleeChargeTime > 0.5) { MusicManager.Machine.Sound.Post(696146074u, true); } else { MusicManager.Machine.Sound.Post(3970227482u, true); } } else { MusicManager.Machine.Sound.Post(37192481u, true); } } else { MusicManager.Machine.Sound.Post(37192481u, true); inTension = false; } if (EnemyManagerReb.AlertedEnemies > 0) { if (!switchedToCombat) { switchedToCombat = true; switch (Random.RandomRangeInt(0, 2)) { case 0: MusicManager.Machine.Sound.SetSwitch("CombatSwitch", "CombatBass"); break; case 1: MusicManager.Machine.Sound.SetSwitch("CombatSwitch", "CombatBangs"); break; default: MusicManager.Machine.Sound.SetSwitch("CombatSwitch", "CombatBass"); break; } } } else if (switchedToCombat) { MusicManager.Machine.Sound.SetSwitch("CombatSwitch", "CombatNone"); switchedToCombat = false; } } private void UpdateCombatVariables() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (EnemyManagerReb.AlertedEnemies > 15) { MusicManager.Machine.Sound.SetSwitch("combat_guitar_on_or_off", "guitar_on"); } else { MusicManager.Machine.Sound.SetSwitch("combat_guitar_on_or_off", "guitar_off"); } } private void PlayWardenPropaganda(bool enabled) { if (m_wardenEnabled != enabled) { m_wardenEnabled = enabled; if (m_wardenEnabled) { MusicManager.Machine.Sound.Post(3564222683u, true); } else { MusicManager.Machine.Sound.Post(2221246261u, true); } } } private void UpdateElevatorStatus() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Invalid comparison between Unknown and I4 //IL_003e: Unknown result type (might be due to invalid IL or missing references) if (m_lastGameState != GameStateManager.CurrentStateName) { m_lastGameState = GameStateManager.CurrentStateName; uint num = (((int)m_lastGameState == 5) ? 344719510u : 344719509u); MusicManager.Machine.Sound.SetSwitch(1559867178u, num); } } private void UpdateDramaState() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Invalid comparison between Unknown and I4 if (m_lastDramaState == DramaManager.CurrentStateEnum) { return; } m_lastDramaState = DramaManager.CurrentStateEnum; DRAMA_State lastDramaState = m_lastDramaState; if ((int)lastDramaState != 0) { if ((int)lastDramaState == 1) { MusicManager.Machine.Sound.Post(1919945579u, true); } } else { MusicManager.Machine.Sound.Post(1031042672u, true); PlayWardenPropaganda(enabled: true); } PlayWardenPropaganda(enabled: false); } private static void DramaManager__DoSyncDramaState__Postfix(pDramaState data) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Invalid comparison between Unknown and I4 //IL_0045: Unknown result type (might be due to invalid IL or missing references) PlayerVoice val = ((Il2CppArrayBase<PlayerVoice>)(object)PlayerVoiceManager.Current.m_playerVoices)[data.playerID]; if ((Object)(object)val != (Object)null) { DRAMA_State val2 = (DRAMA_State)(byte)data.dramaState; uint num = 1870080949u; if (val2 - 5 <= 3) { num = 1635194332u; } val.m_sound.SetSwitch(1345584937u, num); } } public static void StealthIntensityStinger() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Invalid comparison between Unknown and I4 //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Invalid comparison between Unknown and I4 if (((int)MusicManager.CurrentState() == 6) | ((int)MusicManager.CurrentState() == 15)) { MusicManager.Machine.Sound.Post(3927832307u, true); } } public static int SurvivalWaveCheck() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Invalid comparison between Unknown and I4 int num = 0; for (int i = 0; i < Mastermind.Current.m_events.Count; i++) { if ((int)Mastermind.Current.m_events[i].EventType == 1 && ((Il2CppObjectBase)Mastermind.Current.m_events[i]).TryCast<SurvivalWave>().m_settings.m_populationPointsTotal < 0f) { num++; } } return num; } } public class EnemyManagerReb : GameManagerRebBase { public static List<EnemyAgent> alertAgentsVisibleToLocalPlayer = new List<EnemyAgent>(); public static EnemyManagerReb Current; private static float m_lastSurivalWaveStingerTimer; private static bool m_firstSurvivalStinger; private static int m_alertedBosses; private static int m_alertedEnemies; public static int AlertEnemiesVisibleToPlayer; public static int AlertEnemiesCloseToLocalPlayer; private RebPatcher<EnemyManagerReb> m_patcher; private List<uint> m_bossTypes; public static int AlertedBossed { get { return m_alertedBosses; } set { m_alertedBosses = value; } } public static int AlertedEnemies { get { return m_alertedEnemies; } set { m_alertedEnemies = value; } } public EnemyManagerReb() { } public EnemyManagerReb(IntPtr pointer) : base(pointer) { } private void Awake() { Current = this; } private void Start() { m_patcher = new RebPatcher<EnemyManagerReb>(); m_patcher.Patch<EnemyAgent>("Setup", (HarmonyPatchType)2, BindingFlags.Instance | BindingFlags.Public); m_bossTypes = new List<uint> { 37u }; m_patcher.Patch<LG_LevelInteractionManager>("DoSetWaveRoarSoundInformation", (HarmonyPatchType)2, BindingFlags.Static | BindingFlags.Public); m_patcher.Patch<ES_Hibernate>("StartBeat", (HarmonyPatchType)2, BindingFlags.Instance | BindingFlags.Public); } private static void LG_LevelInteractionManager__DoSetWaveRoarSoundInformation__Postfix(pWaveRoarSettings settings) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) Debug.Log(Object.op_Implicit("pWaveRoarSettings\n\troarSize : " + settings.roarSize)); if (settings.roarSize > 0 && (!m_firstSurvivalStinger || m_lastSurivalWaveStingerTimer < Time.time)) { m_firstSurvivalStinger = true; m_lastSurivalWaveStingerTimer = Time.time + 10f; MusicManager.Machine.Sound.Post(3777224378u, true); } } private static void ES_Hibernate__StartBeat__Postfix(ES_Hibernate __instance) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) PlayerAgent val = default(PlayerAgent); if (PlayerManager.TryGetLocalPlayerAgent(ref val)) { Vector3.Distance(((Agent)val).Position, ((ES_Base)__instance).m_enemyAgent.Position); _ = 12f; } } private static void EnemyAgent__Setup__Postfix(EnemyAgent __instance, pEnemySpawnData spawnData) { if ((Object)(object)((Component)__instance).gameObject != (Object)null) { EnemyMisc enemyMisc = ((Component)__instance).gameObject.AddIl2PPComponent<EnemyMisc>(); if ((Object)(object)enemyMisc != (Object)null) { enemyMisc.SetupEnemy(__instance); } } } public static bool IsEnemyBoss(uint enemyID) { return Current.m_bossTypes.Contains(enemyID); } } public class ExpeditionLevelBehaviorManager : MonoBehaviour { private ELB_Base m_currentExpeditionBehavior; public ExpeditionLevelBehaviorManager() { } public ExpeditionLevelBehaviorManager(IntPtr pointer) : base(pointer) { } } internal class GameDirectorManager : GameManagerRebBase { public float noActionScareWaveTime = 250f; public float scareWaveCooldown = 400f; public static bool runDirector; private float scareWaveTimer; private static bool wantToDoScareWave; private float scareWaveBuildupTimer; private float TeamAmmoPer; private float scareCooldownInternal; public void Start() { LevelAPI.OnEnterLevel += StartDirector; LevelAPI.OnLevelCleanup += StopDirector; } public void Update() { //IL_0174: 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) if (SNet.IsInLobby & SNet.IsMaster & (PlayerManager.AlivePlayerAgentsInLevel > 0) & runDirector) { scareWaveTimer += Time.deltaTime; if (EnemyManagerReb.AlertedEnemies > 1) { scareWaveTimer = 0f; } GetTotalTeamAmmo(); if (TeamAmmo