Decompiled source of GooeyArtifacts v1.0.1
plugins/GooeyArtifacts/GooeyArtifacts.dll
Decompiled 3 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using EntityStates; using EntityStates.Missions.Moon; using GooeyArtifacts.Artifacts; using GooeyArtifacts.Artifacts.MonsterCopyPlayerInventories; using GooeyArtifacts.Artifacts.MovingInteractables; using GooeyArtifacts.Artifacts.PillarsEveryStage; using GooeyArtifacts.EntityStates; using GooeyArtifacts.EntityStates.MovingInteractables; using GooeyArtifacts.Items; using GooeyArtifacts.Patches; using GooeyArtifacts.Properties; using GooeyArtifacts.ThirdParty.Utils; using GooeyArtifacts.Utils; using GooeyArtifacts.Utils.Extensions; using HG; using HG.Reflection; using HarmonyLib; using Microsoft.CodeAnalysis; using MonoMod.RuntimeDetour; using On.RoR2; using On.RoR2.UI; using R2API; using R2API.Utils; using RoR2; using RoR2.ConVar; using RoR2.ContentManagement; using RoR2.Navigation; using RoR2.UI; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.UI; [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: OptIn] [assembly: NetworkCompatibility(/*Could not decode attribute arguments.*/)] [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyInformationalVersion("1.0.0+caffc357e27c734715afee63d1e70bb0a9a30551")] [assembly: AssemblyProduct("GooeyArtifacts")] [assembly: AssemblyTitle("GooeyArtifacts")] [assembly: AssemblyCompany("GooeyArtifacts")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.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 { [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] [Microsoft.CodeAnalysis.Embedded] [CompilerGenerated] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace GooeyArtifacts { public class ContentPackProvider : IContentPackProvider { private readonly ContentPack _contentPack = new ContentPack(); public string identifier => "Gorakh.GooeyArtifacts"; internal ContentPackProvider() { }//IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown internal void Register() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown ContentManager.collectContentPackProviders += (CollectContentPackProvidersDelegate)delegate(AddContentPackProviderDelegate addContentPackProvider) { addContentPackProvider.Invoke((IContentPackProvider)(object)this); }; } public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { _contentPack.identifier = identifier; ItemDefs.AddItemDefsTo(_contentPack.itemDefs); ArtifactDefs.AddArtifactDefsTo(_contentPack.artifactDefs); _contentPack.entityStateTypes.Add(EntityStateTypeAttribute.GetAllEntityStateTypes().ToArray()); args.ReportProgress(1f); yield break; } public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { ContentPack.Copy(_contentPack, args.output); args.ReportProgress(1f); yield break; } public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { args.ReportProgress(1f); yield break; } } internal static class LanguageFolderHandler { public static void Register(string searchFolder, string langFolderName = "lang") { string langFolderPath = Path.Combine(searchFolder, langFolderName); if (Directory.Exists(langFolderPath)) { Language.collectLanguageRootFolders += delegate(List<string> folders) { folders.Add(langFolderPath); }; } else { Log.Error("Lang folder not found: " + langFolderPath, "X:\\Git\\RoR2\\GooeyArtifacts\\GooeyArtifacts\\LanguageFolderHandler.cs", "Register", 23); } } } internal static class Log { internal static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } private static string getLogPrefix(string callerPath, string callerMemberName, int callerLineNumber) { int num = callerPath.LastIndexOf("GooeyArtifacts"); if (num >= 0) { callerPath = callerPath.Substring(num + "GooeyArtifacts".Length + 1); } return $"{callerPath}:{callerLineNumber} ({callerMemberName}) "; } internal static void Error(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogError((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Error_NoCallerPrefix(object data) { _logSource.LogError(data); } internal static void Fatal(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogFatal((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Fatal_NoCallerPrefix(object data) { _logSource.LogFatal(data); } internal static void Info(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogInfo((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Info_NoCallerPrefix(object data) { _logSource.LogInfo(data); } internal static void Message(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogMessage((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Message_NoCallerPrefix(object data) { _logSource.LogMessage(data); } internal static void Warning(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogWarning((object)(getLogPrefix(callerPath, callerMemberName, callerLineNumber) + data)); } internal static void Warning_NoCallerPrefix(object data) { _logSource.LogWarning(data); } } [BepInPlugin("Gorakh.GooeyArtifacts", "GooeyArtifacts", "1.0.1")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Main : BaseUnityPlugin { public const string PluginGUID = "Gorakh.GooeyArtifacts"; public const string PluginAuthor = "Gorakh"; public const string PluginName = "GooeyArtifacts"; public const string PluginVersion = "1.0.1"; private ContentPackProvider _contentPackProvider; internal static Main Instance { get; private set; } public static string PluginDirectory { get; private set; } private void Awake() { Instance = this; Stopwatch stopwatch = Stopwatch.StartNew(); Log.Init(((BaseUnityPlugin)this).Logger); _contentPackProvider = new ContentPackProvider(); _contentPackProvider.Register(); Prefabs.Init(); PluginDirectory = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location); LanguageFolderHandler.Register(PluginDirectory); stopwatch.Stop(); Log.Info_NoCallerPrefix($"Initialized in {stopwatch.Elapsed.TotalSeconds:F2} seconds"); } } public static class Prefabs { public static GameObject MonsterCopyPlayerInventoriesControllerPrefab { get; private set; } public static GameObject StagePillarChargeMissionControllerPrefab { get; private set; } public static GameObject SyncExternalNetObjectTransformPrefab { get; private set; } public static GameObject InteractableMoveControllerPrefab { get; private set; } private static GameObject createPrefab(string name, bool networked) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Expected O, but got Unknown GameObject val = new GameObject(); if (networked) { val.AddComponent<NetworkIdentity>(); } GameObject result = PrefabAPI.InstantiateClone(val, name, networked); Object.Destroy((Object)(object)val); return result; } internal static void Init() { //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) MonsterCopyPlayerInventoriesControllerPrefab = createPrefab("MonsterCopyPlayerInventoriesController", networked: true); MonsterCopyPlayerInventoriesControllerPrefab.AddComponent<SetDontDestroyOnLoad>(); MonsterCopyPlayerInventoriesControllerPrefab.AddComponent<Inventory>(); MonsterCopyPlayerInventoriesControllerPrefab.AddComponent<CopyPlayerInventories>(); MonsterCopyPlayerInventoriesControllerPrefab.AddComponent<TeamFilter>().teamIndex = (TeamIndex)(-1); MonsterCopyPlayerInventoriesControllerPrefab.AddComponent<EnemyInfoPanelInventoryProvider>(); StagePillarChargeMissionControllerPrefab = createPrefab("PillarChargeMissionController", networked: true); StagePillarChargeMissionControllerPrefab.AddComponent<StagePillarChargeMissionController>(); SyncExternalNetObjectTransformPrefab = createPrefab("SyncExternalNetObjectTransform", networked: true); NetworkTransform obj = SyncExternalNetObjectTransformPrefab.AddComponent<NetworkTransform>(); obj.transformSyncMode = (TransformSyncMode)1; obj.sendInterval = 1f / 15f; SyncExternalNetObjectTransformPrefab.AddComponent<SyncExternalNetworkedObjectTransform>(); InteractableMoveControllerPrefab = createPrefab("InteractableMoveController", networked: false); EntityStateMachine obj2 = InteractableMoveControllerPrefab.AddComponent<EntityStateMachine>(); obj2.initialStateType = new SerializableEntityStateType(typeof(MovingInteractableRestState)); obj2.mainStateType = new SerializableEntityStateType(typeof(MovingInteractableRestState)); InteractableMoveControllerPrefab.AddComponent<InteractableMoveController>(); } } } namespace GooeyArtifacts.Utils { public class IconLoader { public static Sprite LoadSpriteFromBytes(byte[] imageBytes) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(1, 1); if (ImageConversion.LoadImage(val, imageBytes)) { return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), Vector2.zero); } Log.Error("Failed to load image", "X:\\Git\\RoR2\\GooeyArtifacts\\GooeyArtifacts\\Utils\\IconLoader.cs", "LoadSpriteFromBytes", 16); return null; } } public static class NodeUtils { public static void SetNodeOccupied(NodeGraph nodeGraph, NodeIndex nodeIndex, bool occupied) { //IL_002c: 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_004b: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)nodeGraph)) { throw new ArgumentNullException("nodeGraph"); } DirectorCore instance = DirectorCore.instance; if (!Object.op_Implicit((Object)(object)instance)) { return; } ref NodeReference[] occupiedNodes = ref instance.occupiedNodes; NodeReference value = default(NodeReference); ((NodeReference)(ref value))..ctor(nodeGraph, nodeIndex); int num = Array.IndexOf(occupiedNodes, value); if (num != -1 != occupied) { if (occupied) { instance.AddOccupiedNode(nodeGraph, nodeIndex); } else { ArrayUtils.ArrayRemoveAtAndResize<NodeReference>(ref occupiedNodes, num, 1); } } } } public class PathTraveller { public readonly struct TravelData { public readonly Vector3 CurrentPosition; public readonly Vector3 Direction; public readonly Vector3 InterpolatedNormal; public readonly float RemainingTotalDistance; public readonly bool IsAtEnd; public TravelData(Path path, Waypoint start, Waypoint end, float travelFraction, float remainingTotalDistance, bool isAtEnd) { //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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: 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_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_0043: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) Vector3 val = default(Vector3); path.nodeGraph.GetNodePosition(start.nodeIndex, ref val); Vector3 val2 = default(Vector3); path.nodeGraph.GetNodePosition(end.nodeIndex, ref val2); CurrentPosition = Vector3.Lerp(val, val2, travelFraction); Vector3 val3 = val2 - val; Direction = ((Vector3)(ref val3)).normalized; Vector3 environmentNormalAtPoint = WorldUtils.GetEnvironmentNormalAtPoint(val); Vector3 environmentNormalAtPoint2 = WorldUtils.GetEnvironmentNormalAtPoint(val2); InterpolatedNormal = Quaternion.Slerp(Util.QuaternionSafeLookRotation(environmentNormalAtPoint), Util.QuaternionSafeLookRotation(environmentNormalAtPoint2), travelFraction) * Vector3.forward; RemainingTotalDistance = remainingTotalDistance; IsAtEnd = isAtEnd; } } private readonly struct WaypointTraversalData { public readonly Waypoint Start; public readonly Waypoint End; public readonly Vector3 StartPosition; public readonly Vector3 EndPosition; public readonly float TotalDistance; public WaypointTraversalData(Path path, int startIndex) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) Start = path[startIndex]; path.nodeGraph.GetNodePosition(Start.nodeIndex, ref StartPosition); End = path[startIndex + 1]; path.nodeGraph.GetNodePosition(End.nodeIndex, ref EndPosition); Vector3 val = EndPosition - StartPosition; TotalDistance = ((Vector3)(ref val)).magnitude; } } public readonly Path Path; private int _lastWaypointIndex; private float _currentWaypointDistanceTravelled; public PathTraveller(Path path) { Path = path; } public TravelData AdvancePosition(float moveDelta) { //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) _currentWaypointDistanceTravelled += moveDelta; while (_lastWaypointIndex < Path.waypointsCount - 1) { WaypointTraversalData waypointTraversalData = new WaypointTraversalData(Path, _lastWaypointIndex); if (_currentWaypointDistanceTravelled >= waypointTraversalData.TotalDistance) { _currentWaypointDistanceTravelled -= waypointTraversalData.TotalDistance; _lastWaypointIndex++; continue; } float num = waypointTraversalData.TotalDistance - _currentWaypointDistanceTravelled; for (int i = _lastWaypointIndex + 2; i < Path.waypointsCount; i++) { num += new WaypointTraversalData(Path, i - 1).TotalDistance; } float travelFraction = Mathf.Clamp01(_currentWaypointDistanceTravelled / waypointTraversalData.TotalDistance); return new TravelData(Path, waypointTraversalData.Start, waypointTraversalData.End, travelFraction, num, isAtEnd: false); } return new TravelData(Path, Path[Path.waypointsCount - 2], Path[Path.waypointsCount - 1], 1f, 0f, isAtEnd: true); } } public class SyncExternalNetworkedObjectTransform : NetworkBehaviour { [SyncVar] private GameObject _targetObject; private Transform transform; private NetworkTransform _netTransform; private Vector3 _targetPositionSmoothVelocity; private Quaternion _targetRotationSmoothVelocity; private NetworkInstanceId ____targetObjectNetId; public GameObject TargetObject { get { return _targetObject; } set { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_targetObject == (Object)(object)value)) { Network_targetObject = value; if (Object.op_Implicit((Object)(object)_targetObject)) { Transform val = _targetObject.transform; transform.SetPositionAndRotation(val.position, val.rotation); updateClientObjectTransform(); } } } } public GameObject Network_targetObject { get { return _targetObject; } [param: In] set { ((NetworkBehaviour)this).SetSyncVarGameObject(value, ref _targetObject, 1u, ref ____targetObjectNetId); } } private void Awake() { transform = ((Component)this).transform; _netTransform = ((Component)this).GetComponent<NetworkTransform>(); } public override void OnStartClient() { ((NetworkBehaviour)this).OnStartClient(); updateClientObjectTransform(); } private void Update() { //IL_0027: 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) if (NetworkServer.active) { if (Object.op_Implicit((Object)(object)_targetObject)) { Transform val = _targetObject.transform; transform.SetPositionAndRotation(val.position, val.rotation); } } else { updateClientObjectTransform(smooth: true, Time.deltaTime); } } private void updateClientObjectTransform() { updateClientObjectTransform(smooth: false, 0f); } private void updateClientObjectTransform(bool smooth, float deltaTime) { //IL_0007: 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) updateClientObjectTransform(transform.position, transform.rotation, smooth, deltaTime); } private void updateClientObjectTransform(Vector3 targetPosition, Quaternion targetRotation, bool smooth, float deltaTime) { //IL_006b: 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) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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) if (Object.op_Implicit((Object)(object)_targetObject)) { Transform val = _targetObject.transform; if (smooth) { float sendInterval = _netTransform.sendInterval; val.position = Vector3.SmoothDamp(val.position, targetPosition, ref _targetPositionSmoothVelocity, sendInterval, float.PositiveInfinity, deltaTime); val.rotation = QuaternionUtil.SmoothDamp(val.rotation, targetRotation, ref _targetRotationSmoothVelocity, sendInterval, float.PositiveInfinity, deltaTime); } else { val.SetPositionAndRotation(targetPosition, targetRotation); _targetPositionSmoothVelocity = Vector3.zero; _targetRotationSmoothVelocity = Quaternion.identity; } } } private void UNetVersion() { } public override bool OnSerialize(NetworkWriter writer, bool forceAll) { if (forceAll) { writer.Write(_targetObject); return true; } bool flag = false; if ((((NetworkBehaviour)this).syncVarDirtyBits & (true ? 1u : 0u)) != 0) { if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); flag = true; } writer.Write(_targetObject); } if (!flag) { writer.WritePackedUInt32(((NetworkBehaviour)this).syncVarDirtyBits); } return flag; } public override void OnDeserialize(NetworkReader reader, bool initialState) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (initialState) { ____targetObjectNetId = reader.ReadNetworkId(); return; } int num = (int)reader.ReadPackedUInt32(); if (((uint)num & (true ? 1u : 0u)) != 0) { _targetObject = reader.ReadGameObject(); } } public override void PreStartClient() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) if (!((NetworkInstanceId)(ref ____targetObjectNetId)).IsEmpty()) { Network_targetObject = ClientScene.FindLocalObject(____targetObjectNetId); } } } public static class WorldUtils { public static Vector3 GetEnvironmentNormalAtPoint(Vector3 position, float backtrackDistance = 1f) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: 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) return GetEnvironmentNormalAtPoint(position, Vector3.up, backtrackDistance); } public static Vector3 GetEnvironmentNormalAtPoint(Vector3 position, Vector3 up, float backtrackDistance = 1f) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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_0026: 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_0039: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (Physics.Raycast(new Ray(position + up * backtrackDistance, -up), ref val, backtrackDistance * 1.5f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask))) { return ((RaycastHit)(ref val)).normal; } return Vector3.up; } } } namespace GooeyArtifacts.Utils.Extensions { public static class NetworkExtensions { public static void WriteItemPickupTimestamps(this NetworkWriter writer, FixedTimeStamp[] itemPickupTimeStamps) { //IL_0081: Unknown result type (might be due to invalid IL or missing references) List<uint> list = new List<uint>(itemPickupTimeStamps.Length); for (uint num = 0u; num < itemPickupTimeStamps.Length; num++) { if (!((FixedTimeStamp)(ref itemPickupTimeStamps[num])).isInfinity) { list.Add(num); } } writer.WritePackedUInt32((uint)list.Count); foreach (uint item in list) { writer.WritePackedUInt32(item); } foreach (uint item2 in list) { NetworkExtensions.Write(writer, itemPickupTimeStamps[item2]); } } public static void ReadItemPickupTimestamps(this NetworkReader reader, FixedTimeStamp[] destItemPickupTimeStamps) { //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) uint num = reader.ReadPackedUInt32(); uint[] array = new uint[num]; for (int i = 0; i < num; i++) { array[i] = reader.ReadPackedUInt32(); } ArrayUtils.SetAll<FixedTimeStamp>(destItemPickupTimeStamps, ref FixedTimeStamp.positiveInfinity); uint[] array2 = array; foreach (uint num2 in array2) { destItemPickupTimeStamps[num2] = NetworkExtensions.ReadFixedTimeStamp(reader); } } } public static class TextureExtensions { } } namespace GooeyArtifacts.ThirdParty.Utils { public static class QuaternionUtil { public static Quaternion AngularVelocityToDerivative(Quaternion current, Vector3 angularVelocity) { //IL_0000: 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_000c: 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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) Quaternion val = new Quaternion(angularVelocity.x, angularVelocity.y, angularVelocity.z, 0f) * current; return new Quaternion(0.5f * val.x, 0.5f * val.y, 0.5f * val.z, 0.5f * val.w); } public static Vector3 DerivativeToAngularVelocity(Quaternion current, Quaternion derivative) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //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_000c: 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_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) Quaternion val = derivative * Quaternion.Inverse(current); return new Vector3(2f * val.x, 2f * val.y, 2f * val.z); } public static Quaternion IntegrateRotation(Quaternion rotation, Vector3 angularVelocity, float deltaTime) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0012: 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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) if (deltaTime < Mathf.Epsilon) { return rotation; } Quaternion val = AngularVelocityToDerivative(rotation, angularVelocity); Vector4 val2 = new Vector4(rotation.x + val.x * deltaTime, rotation.y + val.y * deltaTime, rotation.z + val.z * deltaTime, rotation.w + val.w * deltaTime); Vector4 normalized = ((Vector4)(ref val2)).normalized; return new Quaternion(normalized.x, normalized.y, normalized.z, normalized.w); } public static Quaternion SmoothDamp(Quaternion current, Quaternion target, ref Quaternion velocity, float smoothTime, float maxSpeed, float deltaTime) { //IL_000b: 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_0009: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) if (deltaTime < Mathf.Epsilon) { return current; } float num = ((Quaternion.Dot(current, target) > 0f) ? 1f : (-1f)); target.x *= num; target.y *= num; target.z *= num; target.w *= num; Vector4 val = new Vector4(Mathf.SmoothDamp(current.x, target.x, ref velocity.x, smoothTime, maxSpeed, deltaTime), Mathf.SmoothDamp(current.y, target.y, ref velocity.y, smoothTime, maxSpeed, deltaTime), Mathf.SmoothDamp(current.z, target.z, ref velocity.z, smoothTime, maxSpeed, deltaTime), Mathf.SmoothDamp(current.w, target.w, ref velocity.w, smoothTime, maxSpeed, deltaTime)); Vector4 normalized = ((Vector4)(ref val)).normalized; Vector4 val2 = Vector4.Project(new Vector4(velocity.x, velocity.y, velocity.z, velocity.w), normalized); velocity.x -= val2.x; velocity.y -= val2.y; velocity.z -= val2.z; velocity.w -= val2.w; return new Quaternion(normalized.x, normalized.y, normalized.z, normalized.w); } } } namespace GooeyArtifacts.Properties { [GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [DebuggerNonUserCode] [CompilerGenerated] internal class Resources { private static ResourceManager resourceMan; private static CultureInfo resourceCulture; [EditorBrowsable(EditorBrowsableState.Advanced)] internal static ResourceManager ResourceManager { get { if (resourceMan == null) { resourceMan = new ResourceManager("GooeyArtifacts.Properties.Resources", typeof(Resources).Assembly); } return resourceMan; } } [EditorBrowsable(EditorBrowsableState.Advanced)] internal static CultureInfo Culture { get { return resourceCulture; } set { resourceCulture = value; } } internal static byte[] AllItemsBreakableIconDeselected => (byte[])ResourceManager.GetObject("AllItemsBreakableIconDeselected", resourceCulture); internal static byte[] AllItemsBreakableIconSelected => (byte[])ResourceManager.GetObject("AllItemsBreakableIconSelected", resourceCulture); internal static byte[] ExpiringItemsIconDeselected => (byte[])ResourceManager.GetObject("ExpiringItemsIconDeselected", resourceCulture); internal static byte[] ExpiringItemsIconSelected => (byte[])ResourceManager.GetObject("ExpiringItemsIconSelected", resourceCulture); internal static byte[] GenericBrokenItemPickupSprite => (byte[])ResourceManager.GetObject("GenericBrokenItemPickupSprite", resourceCulture); internal static byte[] ItemExpirationTimerIcon => (byte[])ResourceManager.GetObject("ItemExpirationTimerIcon", resourceCulture); internal static byte[] MonsterCopyPlayerItemsIconDeselected => (byte[])ResourceManager.GetObject("MonsterCopyPlayerItemsIconDeselected", resourceCulture); internal static byte[] MonsterCopyPlayerItemsIconSelected => (byte[])ResourceManager.GetObject("MonsterCopyPlayerItemsIconSelected", resourceCulture); internal static byte[] MovingInteractablesIconDeselected => (byte[])ResourceManager.GetObject("MovingInteractablesIconDeselected", resourceCulture); internal static byte[] MovingInteractablesIconSelected => (byte[])ResourceManager.GetObject("MovingInteractablesIconSelected", resourceCulture); internal static byte[] PillarsEveryStageIconDeselected => (byte[])ResourceManager.GetObject("PillarsEveryStageIconDeselected", resourceCulture); internal static byte[] PillarsEveryStageIconSelected => (byte[])ResourceManager.GetObject("PillarsEveryStageIconSelected", resourceCulture); internal static byte[] PlayerItemCurseIconDeselected => (byte[])ResourceManager.GetObject("PlayerItemCurseIconDeselected", resourceCulture); internal static byte[] PlayerItemCurseIconSelected => (byte[])ResourceManager.GetObject("PlayerItemCurseIconSelected", resourceCulture); internal Resources() { } } } namespace GooeyArtifacts.Patches { internal static class MonsterInventoryItemDisplayLayoutFixPatch { [CompilerGenerated] private static class <>O { public static hook_UpdateDisplay <0>__ItemInventoryDisplay_UpdateDisplay; } [SystemInitializer(new Type[] { })] private static void Init() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown object obj = <>O.<0>__ItemInventoryDisplay_UpdateDisplay; if (obj == null) { hook_UpdateDisplay val = ItemInventoryDisplay_UpdateDisplay; <>O.<0>__ItemInventoryDisplay_UpdateDisplay = val; obj = (object)val; } ItemInventoryDisplay.UpdateDisplay += (hook_UpdateDisplay)obj; } private static void ItemInventoryDisplay_UpdateDisplay(orig_UpdateDisplay orig, ItemInventoryDisplay self) { orig.Invoke(self); LayoutRebuilder.MarkLayoutForRebuild(self.rectTransform); } } internal static class ObjectiveSourceModifierHook { public delegate void OverrideObjectiveSourceDelegate(ref ObjectiveSourceDescriptor descriptor, ref bool visible); [CompilerGenerated] private static class <>O { public static hook_GetObjectiveSources <0>__ObjectivePanelController_GetObjectiveSources; } public static event OverrideObjectiveSourceDelegate OverrideObjectiveSource; [SystemInitializer(new Type[] { })] private static void Init() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown object obj = <>O.<0>__ObjectivePanelController_GetObjectiveSources; if (obj == null) { hook_GetObjectiveSources val = ObjectivePanelController_GetObjectiveSources; <>O.<0>__ObjectivePanelController_GetObjectiveSources = val; obj = (object)val; } ObjectivePanelController.GetObjectiveSources += (hook_GetObjectiveSources)obj; } private static void ObjectivePanelController_GetObjectiveSources(orig_GetObjectiveSources orig, ObjectivePanelController self, CharacterMaster master, List<ObjectiveSourceDescriptor> output) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, master, output); if (ObjectiveSourceModifierHook.OverrideObjectiveSource == null) { return; } for (int num = output.Count - 1; num >= 0; num--) { ObjectiveSourceDescriptor descriptor = output[num]; bool visible = true; ObjectiveSourceModifierHook.OverrideObjectiveSource(ref descriptor, ref visible); if (visible) { output[num] = descriptor; } else { output.RemoveAt(num); } } } } internal static class PurchaseInteractionLockPositionSyncPatch { private delegate void orig_set_NetworklockGameObject(PurchaseInteraction self, GameObject value); private class LockObjectLocalPositionMaintainer : MonoBehaviour { private Matrix4x4 _lockObjectLocalTransform = Matrix4x4.identity; private SyncExternalNetworkedObjectTransform _lockObjectTransformSyncController; public GameObject LockObject { get { if (!Object.op_Implicit((Object)(object)_lockObjectTransformSyncController)) { return null; } return _lockObjectTransformSyncController.TargetObject; } set { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)value)) { Transform transform = value.transform; _lockObjectLocalTransform = ((Component)this).transform.worldToLocalMatrix * Matrix4x4.TRS(transform.position, transform.rotation, Vector3.one); if (!Object.op_Implicit((Object)(object)_lockObjectTransformSyncController)) { GameObject val = Object.Instantiate<GameObject>(Prefabs.SyncExternalNetObjectTransformPrefab); _lockObjectTransformSyncController = val.GetComponent<SyncExternalNetworkedObjectTransform>(); _lockObjectTransformSyncController.TargetObject = value; NetworkServer.Spawn(val); } else { _lockObjectTransformSyncController.TargetObject = value; } } else { _lockObjectLocalTransform = Matrix4x4.identity; if (Object.op_Implicit((Object)(object)_lockObjectTransformSyncController)) { NetworkServer.Destroy(((Component)_lockObjectTransformSyncController).gameObject); _lockObjectTransformSyncController = null; } } } } private void FixedUpdate() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) GameObject lockObject = LockObject; if (Object.op_Implicit((Object)(object)lockObject)) { Matrix4x4 val = ((Component)this).transform.localToWorldMatrix * _lockObjectLocalTransform; lockObject.transform.SetPositionAndRotation(Vector4.op_Implicit(((Matrix4x4)(ref val)).GetColumn(3)), ((Matrix4x4)(ref val)).rotation); } } } [SystemInitializer(new Type[] { })] private static void Init() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) MethodInfo methodInfo = AccessTools.DeclaredPropertySetter(typeof(PurchaseInteraction), "NetworklockGameObject"); if ((object)methodInfo != null) { new Hook((MethodBase)methodInfo, (Delegate)new Action<orig_set_NetworklockGameObject, PurchaseInteraction, GameObject>(PurchaseInteraction_set_NetworklockGameObject)); } else { Log.Error("Unable to find lock object setter method", "X:\\Git\\RoR2\\GooeyArtifacts\\GooeyArtifacts\\Patches\\PurchaseInteractionLockPositionSyncPatch.cs", "Init", 23); } } private static void PurchaseInteraction_set_NetworklockGameObject(orig_set_NetworklockGameObject orig, PurchaseInteraction self, GameObject value) { orig(self, value); if (!NetworkServer.active) { return; } LockObjectLocalPositionMaintainer lockObjectLocalPositionMaintainer = ((Component)self).GetComponent<LockObjectLocalPositionMaintainer>(); if (!Object.op_Implicit((Object)(object)lockObjectLocalPositionMaintainer)) { if (!Object.op_Implicit((Object)(object)value)) { return; } lockObjectLocalPositionMaintainer = ((Component)self).gameObject.AddComponent<LockObjectLocalPositionMaintainer>(); } lockObjectLocalPositionMaintainer.LockObject = value; } } internal static class ShopTerminalPositionSyncPatch { private class ShopTerminalOffsetMaintainer : MonoBehaviour { private ShopTerminalBehavior _terminalBehavior; private Matrix4x4 _terminalLocalTransform = Matrix4x4.identity; private bool _isInitialized; private void Awake() { _terminalBehavior = ((Component)this).GetComponent<ShopTerminalBehavior>(); } private void FixedUpdate() { //IL_0087: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: 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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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) if (!Object.op_Implicit((Object)(object)_terminalBehavior)) { Object.Destroy((Object)(object)this); return; } MultiShopController serverMultiShopController = _terminalBehavior.serverMultiShopController; if (!_isInitialized) { if (Object.op_Implicit((Object)(object)serverMultiShopController)) { _terminalLocalTransform = ((Component)serverMultiShopController).transform.worldToLocalMatrix * Matrix4x4.TRS(((Component)this).transform.position, ((Component)this).transform.rotation, Vector3.one); _isInitialized = true; } } else if (!Object.op_Implicit((Object)(object)serverMultiShopController)) { _isInitialized = false; } else { Matrix4x4 val = ((Component)serverMultiShopController).transform.localToWorldMatrix * _terminalLocalTransform; ((Component)this).transform.SetPositionAndRotation(Vector4.op_Implicit(((Matrix4x4)(ref val)).GetColumn(3)), ((Matrix4x4)(ref val)).rotation); } } } [CompilerGenerated] private static class <>O { public static hook_Start <0>__ShopTerminalBehavior_Start; } [SystemInitializer(new Type[] { })] private static void Init() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown object obj = <>O.<0>__ShopTerminalBehavior_Start; if (obj == null) { hook_Start val = ShopTerminalBehavior_Start; <>O.<0>__ShopTerminalBehavior_Start = val; obj = (object)val; } ShopTerminalBehavior.Start += (hook_Start)obj; } private static void ShopTerminalBehavior_Start(orig_Start orig, ShopTerminalBehavior self) { orig.Invoke(self); if (NetworkServer.active) { ((Component)self).gameObject.AddComponent<ShopTerminalOffsetMaintainer>(); GameObject obj = Object.Instantiate<GameObject>(Prefabs.SyncExternalNetObjectTransformPrefab); obj.GetComponent<SyncExternalNetworkedObjectTransform>().TargetObject = ((Component)self).gameObject; NetworkServer.Spawn(obj); } } } } namespace GooeyArtifacts.Items { public static class ItemDefs { public static readonly ItemDef GenericBrokenItem; static ItemDefs() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) GenericBrokenItem = ScriptableObject.CreateInstance<ItemDef>(); ((Object)GenericBrokenItem).name = "GenericBrokenItem"; GenericBrokenItem.deprecatedTier = (ItemTier)5; GenericBrokenItem.canRemove = false; GenericBrokenItem.nameToken = "ITEM_GENERIC_BROKEN_NAME"; GenericBrokenItem.descriptionToken = "ITEM_GENERIC_BROKEN_DESC"; GenericBrokenItem.pickupToken = "ITEM_GENERIC_BROKEN_PICKUP"; GenericBrokenItem.isConsumed = true; GenericBrokenItem.pickupIconSprite = IconLoader.LoadSpriteFromBytes(Resources.GenericBrokenItemPickupSprite); } internal static void AddItemDefsTo(NamedAssetCollection<ItemDef> itemDefs) { itemDefs.Add((ItemDef[])(object)new ItemDef[1] { GenericBrokenItem }); } } } namespace GooeyArtifacts.EntityStates { [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] internal class EntityStateTypeAttribute : SearchableAttribute { public Type target => ((SearchableAttribute)this).target as Type; public static IEnumerable<Type> GetAllEntityStateTypes() { return from EntityStateTypeAttribute a in SearchableAttribute.GetInstances<EntityStateTypeAttribute>() select a.target; } } } namespace GooeyArtifacts.EntityStates.MovingInteractables { public class MovingInteractableBaseState : EntityState { protected InteractableSpawnCard spawnCard { get; private set; } public GameObject gameObject { get; private set; } public Transform transform { get; private set; } protected GraphType nodeGraphType { get; private set; } protected HullClassification hullSize { get; private set; } protected bool occupyPosition { get; private set; } public override void OnEnter() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).OnEnter(); InteractableMoveController component = ((EntityState)this).GetComponent<InteractableMoveController>(); spawnCard = component.SpawnCardServer; gameObject = component.InteractableObject; if (Object.op_Implicit((Object)(object)gameObject)) { transform = gameObject.transform; } if (Object.op_Implicit((Object)(object)spawnCard)) { nodeGraphType = ((SpawnCard)spawnCard).nodeGraphType; hullSize = ((SpawnCard)spawnCard).hullSize; occupyPosition = ((SpawnCard)spawnCard).occupyPosition; } else { nodeGraphType = (GraphType)0; hullSize = (HullClassification)0; occupyPosition = true; } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!Object.op_Implicit((Object)(object)transform) || !Object.op_Implicit((Object)(object)gameObject)) { base.outer.SetNextStateToMain(); } } } [EntityStateType] public class MovingInteractableMoveToTargetState : MovingInteractableBaseState { private static readonly BoolConVar _cvDrawPathData = new BoolConVar("goo_draw_interactable_paths", (ConVarFlags)0, "0", ""); public Vector3 Destination; private Quaternion _startRotation; private float _moveSpeed = 10f; private float _stepHeight = 2f; private float _maxStepRotation = 35f; private Path _path; private PathTraveller _pathTraveller; private Vector3 _currentPosition; private Quaternion _currentRotation; private Vector3 _targetPosition; private Vector3 _directTargetPosition; private Quaternion _targetRotation; private bool _targetAtEnd; private bool _hasCreatedPathVisualizers; private readonly List<MeshDrawer> _pathDrawers = new List<MeshDrawer>(); private MeshDrawer _currentPositionVisualizer; private MeshDrawer _currentTargetPositionVisualizer; private bool _areVisualizersActive; public override void OnEnter() { //IL_000d: 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); _startRotation = base.transform.rotation; if (Object.op_Implicit((Object)(object)base.spawnCard)) { _moveSpeed = Mathf.Max(5f, Util.Remap((float)((SpawnCard)base.spawnCard).directorCreditCost, 0f, 50f, 10f, 7.5f)); } else { _moveSpeed = 10f; } Bounds val = default(Bounds); if (Util.GuessRenderBoundsMeshOnly(base.gameObject, ref val)) { Vector3 size = ((Bounds)(ref val)).size; float num = Mathf.Max(size.x, size.z); float y = size.y; float num2 = ((!(num > y)) ? Mathf.Sqrt(num / y) : (y / num)); _moveSpeed *= num2; _maxStepRotation *= num2; } if (!tryInitializePath()) { ((EntityState)this).outer.SetNextStateToMain(); } } private bool tryInitializePath() { //IL_0012: 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_0033: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Invalid comparison between Unknown and I4 //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) SceneInfo instance = SceneInfo.instance; if (!Object.op_Implicit((Object)(object)instance)) { return false; } NodeGraph nodeGraph = instance.GetNodeGraph(base.nodeGraphType); if (!Object.op_Implicit((Object)(object)nodeGraph)) { return false; } _path = new Path(nodeGraph); PathRequest val = new PathRequest { startPos = PathRequestPosition.op_Implicit(base.transform.position), endPos = PathRequestPosition.op_Implicit(Destination), hullClassification = base.hullSize, maxJumpHeight = float.PositiveInfinity, maxSpeed = float.PositiveInfinity, path = _path }; PathTask val2 = nodeGraph.ComputePath(val); if (!val2.wasReachable || (int)val2.status != 2) { return false; } _pathTraveller = new PathTraveller(_path); if (base.occupyPosition) { float num = HullDef.Find(base.hullSize).radius * 5f; NodeIndex val3 = nodeGraph.FindClosestNode(base.transform.position, base.hullSize, num); if (val3 != NodeIndex.invalid) { NodeUtils.SetNodeOccupied(nodeGraph, val3, occupied: false); } NodeIndex val4 = nodeGraph.FindClosestNode(Destination, base.hullSize, num); if (val4 != NodeIndex.invalid) { NodeUtils.SetNodeOccupied(nodeGraph, val4, occupied: true); } } _currentPosition = base.transform.position; _currentRotation = base.transform.rotation; return true; } public override void FixedUpdate() { //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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_021d: 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_0227: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_024a: 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_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) base.FixedUpdate(); if (!Object.op_Implicit((Object)(object)base.transform) || _pathTraveller == null) { return; } setVisualizersActive(_cvDrawPathData.value); float num = _moveSpeed * Time.fixedDeltaTime; float num2; if (!_targetAtEnd) { PathTraveller.TravelData travelData = _pathTraveller.AdvancePosition(num); _directTargetPosition = travelData.CurrentPosition; Vector3 targetPosition = _directTargetPosition; Vector3 val = travelData.InterpolatedNormal; if (tryFindProperGroundPosition(travelData.CurrentPosition, -travelData.InterpolatedNormal, out var normal, out var properPosition)) { targetPosition = properPosition; val = normal; } _targetPosition = targetPosition; _targetAtEnd = travelData.IsAtEnd; _targetRotation = Util.QuaternionSafeLookRotation(travelData.Direction, val); num2 = travelData.RemainingTotalDistance / _moveSpeed; } else { num2 = 0f; } MeshDrawer currentTargetPositionVisualizer = _currentTargetPositionVisualizer; if (currentTargetPositionVisualizer != null) { currentTargetPositionVisualizer.transform.SetPositionAndRotation(_targetPosition, _targetRotation); } float num3 = Mathf.Sqrt(Mathf.Min(1f, Util.Remap(((EntityState)this).fixedAge, 0f, 1f, 0f, 1f)) * Mathf.Clamp01(Util.Remap(num2, 0f, 2.5f, 0f, 1f))); float num4 = MathF.PI * 4f * ((EntityState)this).fixedAge; _currentPosition = Vector3.MoveTowards(_currentPosition, _targetPosition, num + 1f * Time.fixedDeltaTime); _currentRotation = Quaternion.RotateTowards(_currentRotation, _targetRotation, 135f * Time.fixedDeltaTime); MeshDrawer currentPositionVisualizer = _currentPositionVisualizer; if (currentPositionVisualizer != null) { currentPositionVisualizer.transform.SetPositionAndRotation(_currentPosition, _currentRotation); } base.transform.position = _currentPosition + _currentRotation * new Vector3(0f, Mathf.Abs(Mathf.Sin(num4)) * _stepHeight * num3, 0f); base.transform.rotation = Quaternion.AngleAxis(Mathf.Sin(num4 + MathF.PI / 2f) * _maxStepRotation * num3, _currentRotation * Vector3.forward) * _currentRotation; if (_targetAtEnd && _currentPosition == _targetPosition) { Vector3 eulerAngles = ((Quaternion)(ref _startRotation)).eulerAngles; eulerAngles.y = ((Quaternion)(ref _currentRotation)).eulerAngles.y + Random.Range(-15f, 15f); ((EntityState)this).outer.SetNextState((EntityState)(object)new MovingInteractableSettleState { TargetRotation = Quaternion.Euler(eulerAngles), TargetPosition = _directTargetPosition }); } } public override void OnExit() { ((EntityState)this).OnExit(); Path path = _path; if (path != null) { path.Dispose(); } _path = null; foreach (MeshDrawer pathDrawer in _pathDrawers) { try { pathDrawer.Dispose(); } catch (NullReferenceException) { if (Object.op_Implicit((Object)(object)pathDrawer.transform)) { EntityState.Destroy((Object)(object)((Component)pathDrawer.transform).gameObject); } } } _pathDrawers.Clear(); _currentPositionVisualizer = null; _currentTargetPositionVisualizer = null; } private bool tryFindProperGroundPosition(Vector3 position, Vector3 down, out Vector3 normal, out Vector3 properPosition) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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_005b: 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) //IL_0069: 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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) float radius = HullDef.Find(base.hullSize).radius; RaycastHit hit2; for (int i = 1; i <= 50; i++) { if (sphereCast(new Ray(position + -down * ((float)i * 0.5f), down), 0.525f, out hit2)) { normal = ((RaycastHit)(ref hit2)).normal; properPosition = ((RaycastHit)(ref hit2)).point; return true; } } if (sphereCast(new Ray(position + -down * radius, down), radius * 3.5f, out hit2)) { normal = ((RaycastHit)(ref hit2)).normal; properPosition = ((RaycastHit)(ref hit2)).point; return true; } normal = -down; properPosition = position; return false; bool isValidCollision(Transform otherTransform) { if (otherTransform.IsChildOf(base.transform)) { return false; } EntityLocator componentInParent = ((Component)otherTransform).GetComponentInParent<EntityLocator>(); if (Object.op_Implicit((Object)(object)componentInParent) && Object.op_Implicit((Object)(object)componentInParent.entity) && componentInParent.entity.transform.IsChildOf(base.transform)) { return false; } return true; } bool sphereCast(Ray ray, float maxDistance, out RaycastHit hit) { //IL_0000: 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_0033: 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_0043: 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_008c: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) RaycastHit[] array = Physics.SphereCastAll(ray, radius, maxDistance, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)); if (array.Length == 0) { hit = default(RaycastHit); return false; } float num = float.PositiveInfinity; RaycastHit val = default(RaycastHit); RaycastHit[] array2 = array; for (int j = 0; j < array2.Length; j++) { RaycastHit val2 = array2[j]; if (!(((RaycastHit)(ref val2)).distance <= 0f) && !(((RaycastHit)(ref val2)).distance >= num) && isValidCollision(((RaycastHit)(ref val2)).transform)) { val = val2; num = ((RaycastHit)(ref val2)).distance; } } hit = val; return !float.IsInfinity(num); } } private void setVisualizersActive(bool active) { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) if (_areVisualizersActive == active) { return; } _areVisualizersActive = active; if (_hasCreatedPathVisualizers) { foreach (MeshDrawer pathDrawer in _pathDrawers) { pathDrawer.enabled = active; } return; } if (!active) { return; } NodeGraph val = (Object.op_Implicit((Object)(object)SceneInfo.instance) ? SceneInfo.instance.GetNodeGraph(base.nodeGraphType) : null); if (!Object.op_Implicit((Object)(object)val)) { return; } WireMeshBuilder val2 = new WireMeshBuilder(); try { Vector3 val3 = _currentPosition; Vector3 val4 = default(Vector3); for (int i = 0; i < _path.waypointsCount; i++) { if (val.GetNodePosition(_path[i].nodeIndex, ref val4)) { val2.AddLine(val3, Color.yellow, val4, Color.yellow); val3 = val4; } } _pathDrawers.Add(createOwnerMeshDrawer(val2)); val2.Clear(); val2.AddLine(Vector3.zero, Color.green, Vector3.up, Color.green); val2.AddLine(Vector3.zero, Color.green, Vector3.forward, Color.green); val2.AddLine(Vector3.left, Color.green, Vector3.right, Color.green); _pathDrawers.Add(_currentTargetPositionVisualizer = createOwnerMeshDrawer(val2)); val2.Clear(); val2.AddLine(Vector3.zero, Color.red, Vector3.up, Color.red); val2.AddLine(Vector3.zero, Color.red, Vector3.forward, Color.red); val2.AddLine(Vector3.left, Color.red, Vector3.right, Color.red); _pathDrawers.Add(_currentPositionVisualizer = createOwnerMeshDrawer(val2)); _hasCreatedPathVisualizers = true; } finally { ((IDisposable)val2)?.Dispose(); } static MeshDrawer createOwnerMeshDrawer(WireMeshBuilder meshBuilder) { MeshDrawer meshDrawer = DebugOverlay.GetMeshDrawer(); meshDrawer.hasMeshOwnership = true; meshDrawer.mesh = meshBuilder.GenerateMesh(); return meshDrawer; } } } [EntityStateType] public class MovingInteractableRestState : MovingInteractableBaseState { private static readonly SpawnCard _fallbackPositionHelperCard; private float _waitDuration; private SpawnCard _nextPositionSelectorSpawnCard; private bool _positionSelectorIsTemporary; private float _startingMaxSearchDistance = 50f; static MovingInteractableRestState() { //IL_003e: 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_0054: 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) _fallbackPositionHelperCard = ScriptableObject.CreateInstance<SpawnCard>(); _fallbackPositionHelperCard.prefab = LegacyResourcesAPI.Load<GameObject>("SpawnCards/HelperPrefab"); _fallbackPositionHelperCard.sendOverNetwork = false; ((Object)_fallbackPositionHelperCard).name = "scPositionHelper_Fallback"; _fallbackPositionHelperCard.hullSize = (HullClassification)0; _fallbackPositionHelperCard.nodeGraphType = (GraphType)0; _fallbackPositionHelperCard.requiredFlags = (NodeFlags)0; _fallbackPositionHelperCard.forbiddenFlags = (NodeFlags)8; } public override void OnEnter() { //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); _waitDuration = Random.Range(2.5f, 7.5f); if (Object.op_Implicit((Object)(object)base.spawnCard)) { _waitDuration *= Util.Remap((float)((SpawnCard)base.spawnCard).directorCreditCost, 0f, 50f, 0.75f, 2f); _nextPositionSelectorSpawnCard = ScriptableObject.CreateInstance<SpawnCard>(); _nextPositionSelectorSpawnCard.prefab = LegacyResourcesAPI.Load<GameObject>("SpawnCards/HelperPrefab"); _nextPositionSelectorSpawnCard.sendOverNetwork = false; ((Object)_nextPositionSelectorSpawnCard).name = "scPositionHelper_" + ((Object)base.spawnCard).name; _nextPositionSelectorSpawnCard.hullSize = ((SpawnCard)base.spawnCard).hullSize; _nextPositionSelectorSpawnCard.nodeGraphType = ((SpawnCard)base.spawnCard).nodeGraphType; _nextPositionSelectorSpawnCard.requiredFlags = ((SpawnCard)base.spawnCard).requiredFlags; _nextPositionSelectorSpawnCard.forbiddenFlags = ((SpawnCard)base.spawnCard).forbiddenFlags; _positionSelectorIsTemporary = true; } else { _nextPositionSelectorSpawnCard = _fallbackPositionHelperCard; _positionSelectorIsTemporary = false; } } public override void OnExit() { ((EntityState)this).OnExit(); if (_positionSelectorIsTemporary && Object.op_Implicit((Object)(object)_nextPositionSelectorSpawnCard)) { EntityState.Destroy((Object)(object)_nextPositionSelectorSpawnCard); } } public override void FixedUpdate() { //IL_003d: 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_0062: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) base.FixedUpdate(); if (!Object.op_Implicit((Object)(object)base.transform) || !(((EntityState)this).fixedAge >= _waitDuration)) { return; } SceneInfo instance = SceneInfo.instance; if (Object.op_Implicit((Object)(object)instance)) { NodeGraph nodeGraph = instance.GetNodeGraph(_nextPositionSelectorSpawnCard.nodeGraphType); if (Object.op_Implicit((Object)(object)nodeGraph) && nodeGraph.FindClosestNode(base.transform.position, _nextPositionSelectorSpawnCard.hullSize, 50f) != NodeIndex.invalid) { Vector3? val = tryFindNextTargetPosition(); if (val.HasValue) { ((EntityState)this).outer.SetNextState((EntityState)(object)new MovingInteractableMoveToTargetState { Destination = val.Value }); } else { ((EntityState)this).outer.SetNextState((EntityState)(object)new MovingInteractableRestState { _startingMaxSearchDistance = _startingMaxSearchDistance + 25f }); } return; } } ((EntityState)this).outer.SetNextStateToMain(); } private Vector3? tryFindNextTargetPosition() { //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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) DirectorCore instance = DirectorCore.instance; if (!Object.op_Implicit((Object)(object)instance)) { return null; } DirectorPlacementRule val = new DirectorPlacementRule { position = base.transform.position, placementMode = (PlacementMode)1, minDistance = 20f, maxDistance = _startingMaxSearchDistance + Mathf.Pow(Random.value, 2.25f) * 150f }; DirectorSpawnRequest val2 = new DirectorSpawnRequest(_nextPositionSelectorSpawnCard, val, RoR2Application.rng); GameObject val3 = instance.TrySpawnObject(val2); if (!Object.op_Implicit((Object)(object)val3)) { return null; } Vector3 position = val3.transform.position; EntityState.Destroy((Object)(object)val3); return position; } } [EntityStateType] public class MovingInteractableSettleState : MovingInteractableBaseState { private const float DURATION = 0.75f; private static readonly float _jitterStrength = 0.15f; public Quaternion TargetRotation; public Vector3 TargetPosition; private Quaternion _startRotation; private Vector3 _startPosition; public override void OnEnter() { //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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0022: 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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); if (Object.op_Implicit((Object)(object)base.spawnCard) && base.spawnCard.slightlyRandomizeOrientation) { TargetPosition += base.transform.TransformDirection(Vector3.down * 0.3f); } _startPosition = base.transform.position; _startRotation = base.transform.rotation; } public override void FixedUpdate() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) base.FixedUpdate(); if (Object.op_Implicit((Object)(object)base.transform)) { if (((EntityState)this).fixedAge < 0.75f) { float num = ((EntityState)this).fixedAge / 0.75f; Vector3 val = Random.insideUnitSphere * _jitterStrength; val.y *= 0.2f; base.transform.position = Vector3.Lerp(_startPosition, TargetPosition, num) + Vector3.Lerp(val, Vector3.zero, num); base.transform.rotation = Quaternion.Slerp(_startRotation, TargetRotation, num); } else { ((EntityState)this).outer.SetNextStateToMain(); } } } public override void OnExit() { //IL_001a: 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) ((EntityState)this).OnExit(); if (Object.op_Implicit((Object)(object)base.transform)) { base.transform.position = TargetPosition; base.transform.rotation = TargetRotation; } } } } namespace GooeyArtifacts.Artifacts { public static class ArtifactDefs { public static readonly ArtifactDef MonsterCopyPlayerItems; public static readonly ArtifactDef PlayerItemCurse; public static readonly ArtifactDef PillarsEveryStage; public static readonly ArtifactDef MovingInteractables; public static readonly ArtifactDef AllItemsBreakable; public static readonly ArtifactDef ExpiringItems; static ArtifactDefs() { MonsterCopyPlayerItems = ScriptableObject.CreateInstance<ArtifactDef>(); MonsterCopyPlayerItems.cachedName = "MonsterCopyPlayerItems"; MonsterCopyPlayerItems.nameToken = "ARTIFACT_MONSTER_COPY_PLAYER_ITEMS_NAME"; MonsterCopyPlayerItems.descriptionToken = "ARTIFACT_MONSTER_COPY_PLAYER_ITEMS_DESCRIPTION"; MonsterCopyPlayerItems.smallIconSelectedSprite = IconLoader.LoadSpriteFromBytes(Resources.MonsterCopyPlayerItemsIconSelected); MonsterCopyPlayerItems.smallIconDeselectedSprite = IconLoader.LoadSpriteFromBytes(Resources.MonsterCopyPlayerItemsIconDeselected); PlayerItemCurse = ScriptableObject.CreateInstance<ArtifactDef>(); PlayerItemCurse.cachedName = "PlayerItemCurse"; PlayerItemCurse.nameToken = "ARTIFACT_PLAYER_ITEM_CURSE_NAME"; PlayerItemCurse.descriptionToken = "ARTIFACT_PLAYER_ITEM_CURSE_DESCRIPTION"; PlayerItemCurse.smallIconSelectedSprite = IconLoader.LoadSpriteFromBytes(Resources.PlayerItemCurseIconSelected); PlayerItemCurse.smallIconDeselectedSprite = IconLoader.LoadSpriteFromBytes(Resources.PlayerItemCurseIconDeselected); PillarsEveryStage = ScriptableObject.CreateInstance<ArtifactDef>(); PillarsEveryStage.cachedName = "PillarsEveryStage"; PillarsEveryStage.nameToken = "ARTIFACT_PILLARS_EVERY_STAGE_NAME"; PillarsEveryStage.descriptionToken = "ARTIFACT_PILLARS_EVERY_STAGE_DESCRIPTION"; PillarsEveryStage.smallIconSelectedSprite = IconLoader.LoadSpriteFromBytes(Resources.PillarsEveryStageIconSelected); PillarsEveryStage.smallIconDeselectedSprite = IconLoader.LoadSpriteFromBytes(Resources.PillarsEveryStageIconDeselected); MovingInteractables = ScriptableObject.CreateInstance<ArtifactDef>(); MovingInteractables.cachedName = "MovingInteractables"; MovingInteractables.nameToken = "ARTIFACT_MOVING_INTERACTABLES_NAME"; MovingInteractables.descriptionToken = "ARTIFACT_MOVING_INTERACTABLES_DESCRIPTION"; MovingInteractables.smallIconSelectedSprite = IconLoader.LoadSpriteFromBytes(Resources.MovingInteractablesIconSelected); MovingInteractables.smallIconDeselectedSprite = IconLoader.LoadSpriteFromBytes(Resources.MovingInteractablesIconDeselected); AllItemsBreakable = ScriptableObject.CreateInstance<ArtifactDef>(); AllItemsBreakable.cachedName = "AllItemsBreakable"; AllItemsBreakable.nameToken = "ARTIFACT_ALL_ITEMS_BREAKABLE_NAME"; AllItemsBreakable.descriptionToken = "ARTIFACT_ALL_ITEMS_BREAKABLE_DESCRIPTION"; AllItemsBreakable.smallIconSelectedSprite = IconLoader.LoadSpriteFromBytes(Resources.AllItemsBreakableIconSelected); AllItemsBreakable.smallIconDeselectedSprite = IconLoader.LoadSpriteFromBytes(Resources.AllItemsBreakableIconDeselected); ExpiringItems = ScriptableObject.CreateInstance<ArtifactDef>(); ExpiringItems.cachedName = "ExpiringItems"; ExpiringItems.nameToken = "ARTIFACT_EXPIRING_ITEMS_NAME"; ExpiringItems.descriptionToken = "ARTIFACT_EXPIRING_ITEMS_DESCRIPTION"; ExpiringItems.smallIconSelectedSprite = IconLoader.LoadSpriteFromBytes(Resources.ExpiringItemsIconSelected); ExpiringItems.smallIconDeselectedSprite = IconLoader.LoadSpriteFromBytes(Resources.ExpiringItemsIconDeselected); } internal static void AddArtifactDefsTo(NamedAssetCollection<ArtifactDef> collection) { collection.Add((ArtifactDef[])(object)new ArtifactDef[6] { MonsterCopyPlayerItems, PlayerItemCurse, PillarsEveryStage, MovingInteractables, AllItemsBreakable, ExpiringItems }); } } } namespace GooeyArtifacts.Artifacts.PlayerItemCurse { public static class PlayerItemCurseArtifactManager { [CompilerGenerated] private static class <>O { public static ArtifactStateChangeDelegate <0>__RunArtifactManager_onArtifactEnabledGlobal; public static ArtifactStateChangeDelegate <1>__RunArtifactManager_onArtifactDisabledGlobal; public static StatHookEventHandler <2>__RecalculateStatsAPI_GetStatCoefficients; } private static readonly float[] _tierCurseWeights; private const float EQUIPMENT_WEIGHT = 5f; static PlayerItemCurseArtifactManager() { _tierCurseWeights = new float[11]; float[] tierCurseWeights = _tierCurseWeights; float num = 1f; ArrayUtils.SetAll<float>(tierCurseWeights, ref num); _tierCurseWeights[0] = 1f; _tierCurseWeights[1] = 1.5f; _tierCurseWeights[2] = 2f; _tierCurseWeights[3] = 7f; _tierCurseWeights[4] = 7f; _tierCurseWeights[6] = 1.25f; _tierCurseWeights[7] = 1.875f; _tierCurseWeights[8] = 2.5f; _tierCurseWeights[9] = 8.75f; } [SystemInitializer(new Type[] { })] private static void Init() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0030: 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_003b: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown object obj = <>O.<0>__RunArtifactManager_onArtifactEnabledGlobal; if (obj == null) { ArtifactStateChangeDelegate val = RunArtifactManager_onArtifactEnabledGlobal; <>O.<0>__RunArtifactManager_onArtifactEnabledGlobal = val; obj = (object)val; } RunArtifactManager.onArtifactEnabledGlobal += (ArtifactStateChangeDelegate)obj; object obj2 = <>O.<1>__RunArtifactManager_onArtifactDisabledGlobal; if (obj2 == null) { ArtifactStateChangeDelegate val2 = RunArtifactManager_onArtifactDisabledGlobal; <>O.<1>__RunArtifactManager_onArtifactDisabledGlobal = val2; obj2 = (object)val2; } RunArtifactManager.onArtifactDisabledGlobal += (ArtifactStateChangeDelegate)obj2; object obj3 = <>O.<2>__RecalculateStatsAPI_GetStatCoefficients; if (obj3 == null) { StatHookEventHandler val3 = RecalculateStatsAPI_GetStatCoefficients; <>O.<2>__RecalculateStatsAPI_GetStatCoefficients = val3; obj3 = (object)val3; } RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj3; } private static void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Invalid comparison between Unknown and I4 //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected I4, but got Unknown //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Invalid comparison between Unknown and I4 if (!Object.op_Implicit((Object)(object)RunArtifactManager.instance) || !RunArtifactManager.instance.IsArtifactEnabled(ArtifactDefs.PlayerItemCurse)) { return; } Inventory inventory = sender.inventory; if (!Object.op_Implicit((Object)(object)inventory)) { return; } float num = 0f; foreach (ItemIndex item in inventory.itemAcquisitionOrder) { ItemDef itemDef = ItemCatalog.GetItemDef(item); if (Object.op_Implicit((Object)(object)itemDef) && !itemDef.hidden && (int)itemDef.tier != 5) { float num2 = num; float num3 = inventory.GetItemCount(item); float[] tierCurseWeights = _tierCurseWeights; ItemTier tier = itemDef.tier; float num4 = 1f; num = num2 + num3 * ArrayUtils.GetSafe<float>(tierCurseWeights, (int)tier, ref num4); } } int equipmentSlotCount = inventory.GetEquipmentSlotCount(); for (uint num5 = 0u; num5 < equipmentSlotCount; num5++) { if ((int)inventory.GetEquipment(num5).equipmentIndex != -1) { num += 5f; } } args.baseCurseAdd += 0.025f * num; } private static void RunArtifactManager_onArtifactEnabledGlobal(RunArtifactManager runArtifactManager, ArtifactDef artifactDef) { if ((Object)(object)artifactDef == (Object)(object)ArtifactDefs.PlayerItemCurse) { markAllPlayerStatsDirty(); } } private static void RunArtifactManager_onArtifactDisabledGlobal(RunArtifactManager runArtifactManager, ArtifactDef artifactDef) { if ((Object)(object)artifactDef == (Object)(object)ArtifactDefs.PlayerItemCurse) { markAllPlayerStatsDirty(); } } private static void markAllPlayerStatsDirty() { foreach (CharacterBody readOnlyInstances in CharacterBody.readOnlyInstancesList) { readOnlyInstances.MarkAllStatsDirty(); } } } } namespace GooeyArtifacts.Artifacts.PillarsEveryStage { public static class PillarsEveryStageArtifactManager { [CompilerGenerated] private static class <>O { public static ArtifactStateChangeDelegate <0>__RunArtifactManager_onArtifactEnabledGlobal; public static ArtifactStateChangeDelegate <1>__RunArtifactManager_onArtifactDisabledGlobal; public static hook_PlaceTeleporter <2>__SceneDirector_PlaceTeleporter; } private const int PILLAR_SPAWN_COUNT = 6; private const int REQUIRED_PILLAR_COUNT = 4; private static InteractableSpawnCard[] _pillarSpawnCards; private static StagePillarChargeMissionController _pillarChargeMissionController; [SystemInitializer(new Type[] { })] private static void Init() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0030: 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_003b: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown object obj = <>O.<0>__RunArtifactManager_onArtifactEnabledGlobal; if (obj == null) { ArtifactStateChangeDelegate val = RunArtifactManager_onArtifactEnabledGlobal; <>O.<0>__RunArtifactManager_onArtifactEnabledGlobal = val; obj = (object)val; } RunArtifactManager.onArtifactEnabledGlobal += (ArtifactStateChangeDelegate)obj; object obj2 = <>O.<1>__RunArtifactManager_onArtifactDisabledGlobal; if (obj2 == null) { ArtifactStateChangeDelegate val2 = RunArtifactManager_onArtifactDisabledGlobal; <>O.<1>__RunArtifactManager_onArtifactDisabledGlobal = val2; obj2 = (object)val2; } RunArtifactManager.onArtifactDisabledGlobal += (ArtifactStateChangeDelegate)obj2; object obj3 = <>O.<2>__SceneDirector_PlaceTeleporter; if (obj3 == null) { hook_PlaceTeleporter val3 = SceneDirector_PlaceTeleporter; <>O.<2>__SceneDirector_PlaceTeleporter = val3; obj3 = (object)val3; } SceneDirector.PlaceTeleporter += (hook_PlaceTeleporter)obj3; _pillarSpawnCards = (InteractableSpawnCard[])(object)new InteractableSpawnCard[4] { createPillarSpawnCa