Decompiled source of Sandswept v1.4.2
AttackDirectionFix.dll
Decompiled 5 days agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Linq.Expressions; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using AttackDirectionFix.Patches; using AttackDirectionFix.Utils; using BepInEx; using BepInEx.Logging; using HG; using HG.Reflection; using HarmonyLib; using IL.RoR2.Projectile; using Microsoft.CodeAnalysis; using Mono.Cecil; using Mono.Cecil.Cil; using MonoMod.Cil; using MonoMod.RuntimeDetour; using MonoMod.Utils; using On.RoR2; using On.RoR2.Projectile; using R2API.Utils; using RoR2; using RoR2.ConVar; using RoR2.Projectile; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: OptIn] [assembly: NetworkCompatibility(/*Could not decode attribute arguments.*/)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("AttackDirectionFix")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+46bfe108fb0b4bcbaea65361c5eae62984080e3e")] [assembly: AssemblyProduct("AttackDirectionFix")] [assembly: AssemblyTitle("AttackDirectionFix")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } internal static class IsExternalInit { } } namespace AttackDirectionFix { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("Gorakh.AttackDirectionFix", "AttackDirectionFix", "1.2.7")] public sealed class AttackDirectionFixPlugin : BaseUnityPlugin { public const string PluginGUID = "Gorakh.AttackDirectionFix"; public const string PluginAuthor = "Gorakh"; public const string PluginName = "AttackDirectionFix"; public const string PluginVersion = "1.2.7"; private void Awake() { Stopwatch stopwatch = Stopwatch.StartNew(); Log.Init(((BaseUnityPlugin)this).Logger); AimOriginOverridePatch.Init(); ProjectileGhostOffsetPatch.Init(); PlayerAimVisualizer.Init(); stopwatch.Stop(); Log.Info_NoCallerPrefix($"Initialized in {stopwatch.Elapsed.TotalSeconds:F2} seconds"); } } internal static class Log { private static readonly StringBuilder _sharedStringBuilder; private static readonly int _cachedCallerPathPrefixLength; private static ManualLogSource _logSource; static Log() { _sharedStringBuilder = new StringBuilder(256); _cachedCallerPathPrefixLength = getCallerPathPrefixLength("X:\\Git\\RoR2\\AttackDirectionFix\\AttackDirectionFix\\Log.cs"); static int getCallerPathPrefixLength([CallerFilePath] string callerPath = null) { int num = callerPath.LastIndexOf("AttackDirectionFix\\"); if (num >= 0) { return num + "AttackDirectionFix\\".Length; } Debug.LogError((object)"[AttackDirectionFix] Logger failed to determine caller path prefix length"); return 0; } } internal static void Init(ManualLogSource logSource) { _logSource = logSource; } private static StringBuilder AppendCallerPrefix(this StringBuilder stringBuilder, string callerPath, string callerMemberName, int callerLineNumber) { return stringBuilder.Append(callerPath, _cachedCallerPathPrefixLength, callerPath.Length - _cachedCallerPathPrefixLength).Append(':').Append(callerLineNumber) .Append(" (") .Append(callerMemberName) .Append("):"); } private static StringBuilder buildCallerLogString(string callerPath, string callerMemberName, int callerLineNumber, object data) { return _sharedStringBuilder.Clear().AppendCallerPrefix(callerPath, callerMemberName, callerLineNumber).Append(' ') .Append(data); } [Conditional("DEBUG")] internal static void Debug(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogDebug((object)buildCallerLogString(callerPath, callerMemberName, callerLineNumber, data)); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [Conditional("DEBUG")] internal static void Debug_NoCallerPrefix(object data) { _logSource.LogDebug(data); } internal static void Error(object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { _logSource.LogError((object)buildCallerLogString(callerPath, callerMemberName, callerLineNumber, data)); } [MethodImpl(MethodImplOptions.AggressiveInlining)] 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)buildCallerLogString(callerPath, callerMemberName, callerLineNumber, data)); } [MethodImpl(MethodImplOptions.AggressiveInlining)] 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)buildCallerLogString(callerPath, callerMemberName, callerLineNumber, data)); } [MethodImpl(MethodImplOptions.AggressiveInlining)] 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)buildCallerLogString(callerPath, callerMemberName, callerLineNumber, data)); } [MethodImpl(MethodImplOptions.AggressiveInlining)] 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)buildCallerLogString(callerPath, callerMemberName, callerLineNumber, data)); } [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static void Warning_NoCallerPrefix(object data) { _logSource.LogWarning(data); } internal static void LogType(LogLevel level, object data, [CallerFilePath] string callerPath = "", [CallerMemberName] string callerMemberName = "", [CallerLineNumber] int callerLineNumber = -1) { //IL_0000: 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_000c: Unknown result type (might be due to invalid IL or missing references) if ((level & 0x20) == 0) { _logSource.Log(level, (object)buildCallerLogString(callerPath, callerMemberName, callerLineNumber, data)); } } [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static void LogType_NoCallerPrefix(LogLevel level, object data) { //IL_0000: 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_000c: Unknown result type (might be due to invalid IL or missing references) if ((level & 0x20) == 0) { _logSource.Log(level, data); } } } internal static class PlayerAimVisualizer { [CompilerGenerated] private static class <>O { public static SceneCameraDelegate <0>__SceneCameraPreCull; } private static GameObject _aimOriginVisualizer; private static GameObject _cameraPivotVisualizer; private static readonly BoolConVar _cvEnableAimVisualization = new BoolConVar("debug_aim_visualization", (ConVarFlags)0, "0", "Enables/Disables player aim visualization. Green=Aim Origin, Red=Camera Pivot"); public static void Init() { //IL_0034: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: 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) //IL_00c8: 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_00d3: Expected O, but got Unknown _aimOriginVisualizer = GameObject.CreatePrimitive((PrimitiveType)0); Object.DontDestroyOnLoad((Object)(object)_aimOriginVisualizer); _aimOriginVisualizer.GetComponent<Collider>().enabled = false; _aimOriginVisualizer.GetComponent<Renderer>().material.color = Color.green; _aimOriginVisualizer.transform.localScale = Vector3.one * 0.1f; _cameraPivotVisualizer = GameObject.CreatePrimitive((PrimitiveType)0); Object.DontDestroyOnLoad((Object)(object)_cameraPivotVisualizer); _cameraPivotVisualizer.GetComponent<Collider>().enabled = false; _cameraPivotVisualizer.GetComponent<Renderer>().material.color = Color.red; _cameraPivotVisualizer.transform.localScale = Vector3.one * 0.1f; object obj = <>O.<0>__SceneCameraPreCull; if (obj == null) { SceneCameraDelegate val = SceneCameraPreCull; <>O.<0>__SceneCameraPreCull = val; obj = (object)val; } SceneCamera.onSceneCameraPreCull += (SceneCameraDelegate)obj; } private static void SceneCameraPreCull(SceneCamera sceneCamera) { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)_aimOriginVisualizer)) { _aimOriginVisualizer.SetActive(false); } if (Object.op_Implicit((Object)(object)_cameraPivotVisualizer)) { _cameraPivotVisualizer.SetActive(false); } if (!_cvEnableAimVisualization.value) { return; } CameraRigController cameraRigController = sceneCamera.cameraRigController; if (Object.op_Implicit((Object)(object)cameraRigController) && cameraRigController.localUserViewer != null) { CharacterBody targetBody = cameraRigController.targetBody; if (Object.op_Implicit((Object)(object)targetBody) && Object.op_Implicit((Object)(object)_aimOriginVisualizer)) { _aimOriginVisualizer.SetActive(true); _aimOriginVisualizer.transform.position = targetBody.inputBank.aimOrigin; } CameraTargetParams targetParams = cameraRigController.targetParams; if (Object.op_Implicit((Object)(object)targetParams) && Object.op_Implicit((Object)(object)targetParams.cameraPivotTransform) && Object.op_Implicit((Object)(object)_cameraPivotVisualizer)) { _cameraPivotVisualizer.SetActive(true); _cameraPivotVisualizer.transform.position = targetParams.cameraPivotTransform.position; } } } } public static class ProjectileAttributes { private sealed class ProjectileMovementTracker : MonoBehaviour { private const float MovementEpsilon = 0.1f; private ProjectileController _projectileController; private Vector3 _startPosition; private bool _hasMoved; private void Awake() { _projectileController = ((Component)this).GetComponent<ProjectileController>(); } private void Start() { //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) _startPosition = ((Component)this).transform.position; } private void FixedUpdate() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (!_hasMoved) { Vector3 val = ((Component)this).transform.position - _startPosition; if (((Vector3)(ref val)).sqrMagnitude >= 0.010000001f) { _hasMoved = true; } } } private void OnDestroy() { int num = (Object.op_Implicit((Object)(object)_projectileController) ? _projectileController.catalogIndex : (-1)); if (num >= 0) { reportProjectileStationary(num, !_hasMoved); } } } private static HashSet<GameObject> _collectingProjectilePrefabsBlacklist = new HashSet<GameObject>(); private static HashSet<string> _collectingProjectileNamesBlacklist = new HashSet<string>(); private static int[] _projectileBlacklist = Array.Empty<int>(); private static bool[] _isStationaryLookup = Array.Empty<bool>(); [SystemInitializer(new Type[] { typeof(ProjectileCatalog) })] private static void Init() { if (ProjectileCatalog.projectilePrefabCount > 0) { _isStationaryLookup = new bool[ProjectileCatalog.projectilePrefabCount]; ProjectileSimple val = default(ProjectileSimple); BoomerangProjectile val2 = default(BoomerangProjectile); CleaverProjectile val3 = default(CleaverProjectile); DaggerController val4 = default(DaggerController); MissileController val5 = default(MissileController); ProjectileCharacterController val6 = default(ProjectileCharacterController); ProjectileOwnerOrbiter val7 = default(ProjectileOwnerOrbiter); SoulSearchController val8 = default(SoulSearchController); Rigidbody val9 = default(Rigidbody); for (int i = 0; i < ProjectileCatalog.projectilePrefabCount; i++) { GameObject projectilePrefab = ProjectileCatalog.GetProjectilePrefab(i); if (Object.op_Implicit((Object)(object)projectilePrefab)) { bool flag = (!projectilePrefab.TryGetComponent<ProjectileSimple>(ref val) || (!(val.desiredForwardSpeed > 0f) && !val.oscillate)) && (!projectilePrefab.TryGetComponent<BoomerangProjectile>(ref val2) || !(val2.travelSpeed > 0f)) && (!projectilePrefab.TryGetComponent<CleaverProjectile>(ref val3) || !(val3.travelSpeed > 0f)) && (!projectilePrefab.TryGetComponent<DaggerController>(ref val4) || !(val4.acceleration > 0f)) && (!projectilePrefab.TryGetComponent<MissileController>(ref val5) || (!(val5.maxVelocity > 0f) && !(val5.acceleration > 0f))) && (!projectilePrefab.TryGetComponent<ProjectileCharacterController>(ref val6) || !(val6.velocity > 0f)) && (!projectilePrefab.TryGetComponent<ProjectileOwnerOrbiter>(ref val7) || !(val7.degreesPerSecond > 0f)) && (!projectilePrefab.TryGetComponent<SoulSearchController>(ref val8) || !(val8.maxVelocity > 0f)) && (!projectilePrefab.TryGetComponent<Rigidbody>(ref val9) || val9.isKinematic); _isStationaryLookup[i] = flag; projectilePrefab.AddComponent<ProjectileMovementTracker>(); } } } BlacklistProjectile("DrifterJunkCubeProjectile"); BlacklistProjectile("JunkCubePrefab"); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(onLoad)); } private static void onLoad() { HashSet<int> hashSet = new HashSet<int>(); foreach (GameObject item in _collectingProjectilePrefabsBlacklist) { int projectileIndex = ProjectileCatalog.GetProjectileIndex(item); if (projectileIndex >= 0) { hashSet.Add(projectileIndex); } } foreach (string item2 in _collectingProjectileNamesBlacklist) { int num = ProjectileCatalog.FindProjectileIndex(item2); if (num >= 0) { hashSet.Add(num); } } if (hashSet.Count > 0) { _projectileBlacklist = hashSet.ToArray(); Array.Sort(_projectileBlacklist); } _collectingProjectilePrefabsBlacklist = null; _collectingProjectileNamesBlacklist = null; } public static void BlacklistProjectile(GameObject projectilePrefab) { if (_collectingProjectilePrefabsBlacklist == null) { throw new InvalidOperationException("Cannot add to blacklist after game has loaded"); } _collectingProjectilePrefabsBlacklist.Add(projectilePrefab); } public static void BlacklistProjectile(string projectileName) { if (_collectingProjectileNamesBlacklist == null) { throw new InvalidOperationException("Cannot add to blacklist after game has loaded"); } _collectingProjectileNamesBlacklist.Add(projectileName); } private static void reportProjectileStationary(int projectileIndex, bool stationary) { if (ArrayUtils.IsInBounds<bool>(_isStationaryLookup, projectileIndex) && _isStationaryLookup[projectileIndex] != stationary) { _isStationaryLookup[projectileIndex] = stationary; } GameObject projectilePrefab = ProjectileCatalog.GetProjectilePrefab(projectileIndex); ProjectileMovementTracker projectileMovementTracker = default(ProjectileMovementTracker); if (Object.op_Implicit((Object)(object)projectilePrefab) && projectilePrefab.TryGetComponent<ProjectileMovementTracker>(ref projectileMovementTracker)) { Object.Destroy((Object)(object)projectileMovementTracker); } } public static bool IsStationaryProjectile(int projectileIndex) { return ArrayUtils.GetSafe<bool>(_isStationaryLookup, projectileIndex); } public static bool IsProjectileBlacklisted(int projectileIndex) { return Array.BinarySearch(_projectileBlacklist, projectileIndex) >= 0; } public static bool ShouldModifyFireDirection(int projectileIndex) { if (!IsProjectileBlacklisted(projectileIndex)) { return !IsStationaryProjectile(projectileIndex); } return false; } } public sealed class ProjectileInitialOffset : MonoBehaviour { public float StartTime; public Vector3 InitialPositionOffset; public Quaternion InitialRotationOffset = Quaternion.identity; public float InterpolationTime; private float age => Time.time - StartTime; private float interpolationFraction => Mathf.Pow(Mathf.Clamp01(age / InterpolationTime), 1f / 3f); public Vector3 CurrentPositionOffset => Vector3.Lerp(InitialPositionOffset, Vector3.zero, interpolationFraction); public Quaternion CurrentRotationOffset => Quaternion.Lerp(InitialRotationOffset, Quaternion.identity, interpolationFraction); private void FixedUpdate() { if (age >= InterpolationTime) { Object.Destroy((Object)(object)this); } } } } namespace AttackDirectionFix.Utils { public static class CameraRigUtils { public static CameraRigController FindCameraRigControllerForBody(CharacterBody body) { return ((IEnumerable<CameraRigController>)CameraRigController.readOnlyInstancesList).FirstOrDefault((Func<CameraRigController, bool>)((CameraRigController c) => (Object)(object)c.targetBody == (Object)(object)body)); } } public static class VectorUtils { public static Vector3 ClosestPointAlongRay(Ray ray, Vector3 target) { //IL_0002: 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_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_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_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) return ((Ray)(ref ray)).origin + ((Ray)(ref ray)).direction * Vector3.Dot(((Ray)(ref ray)).direction, target - ((Ray)(ref ray)).origin); } } } namespace AttackDirectionFix.Patches { internal static class AimOriginOverridePatch { private delegate Vector3 orig_get_aimOrigin(InputBankTest self); [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_FindBestInteractableObject <>9__1_0; internal GameObject <Init>b__1_0(orig_FindBestInteractableObject orig, InteractionDriver self) { _tempDisablePatch = true; try { return orig.Invoke(self); } finally { _tempDisablePatch = false; } } } private static bool _tempDisablePatch; public static void Init() { //IL_0034: 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_0065: Expected O, but got Unknown MethodInfo methodInfo = AccessTools.DeclaredPropertyGetter(typeof(InputBankTest), "aimOrigin"); if ((object)methodInfo != null) { new Hook((MethodBase)methodInfo, (Delegate)new Func<orig_get_aimOrigin, InputBankTest, Vector3>(InputBankTest_get_aimOrigin)); } else { Log.Error_NoCallerPrefix("Unable to find InputBankTest.aimOrigin getter"); } object obj = <>c.<>9__1_0; if (obj == null) { hook_FindBestInteractableObject val = delegate(orig_FindBestInteractableObject orig, InteractionDriver self) { _tempDisablePatch = true; try { return orig.Invoke(self); } finally { _tempDisablePatch = false; } }; <>c.<>9__1_0 = val; obj = (object)val; } InteractionDriver.FindBestInteractableObject += (hook_FindBestInteractableObject)obj; } public static Vector3 GetUnalteredAimOrigin(this InputBankTest inputBankTest) { //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_0016: Unknown result type (might be due to invalid IL or missing references) _tempDisablePatch = true; try { return inputBankTest.aimOrigin; } finally { _tempDisablePatch = false; } } private static Vector3 InputBankTest_get_aimOrigin(orig_get_aimOrigin orig, InputBankTest self) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_004a: 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_0051: 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_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_005c: 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_0070: 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) Vector3 result = orig(self); if (!_tempDisablePatch) { CameraRigController val = CameraRigUtils.FindCameraRigControllerForBody(self.characterBody); if (Object.op_Implicit((Object)(object)val)) { CameraTargetParams targetParams = val.targetParams; if (Object.op_Implicit((Object)(object)targetParams) && Object.op_Implicit((Object)(object)targetParams.cameraPivotTransform)) { Vector3 position = targetParams.cameraPivotTransform.position; CameraState currentCameraState = val.currentCameraState; return VectorUtils.ClosestPointAlongRay(new Ray(currentCameraState.position, currentCameraState.rotation * Vector3.forward), position); } } } return result; } } public sealed class ProjectileDisplacementInfoProvider : MonoBehaviour { private sealed record DisplacementData(FireProjectileInfo OriginalFireProjectileInfo) { [CompilerGenerated] private bool PrintMembers(StringBuilder builder) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) RuntimeHelpers.EnsureSufficientExecutionStack(); builder.Append("OriginalFireProjectileInfo = "); FireProjectileInfo originalFireProjectileInfo = OriginalFireProjectileInfo; builder.Append(((object)(FireProjectileInfo)(ref originalFireProjectileInfo)).ToString()); return true; } } [CompilerGenerated] private static class <>O { public static Manipulator <0>__modifyFirePositionPatch; public static <>A{00000009}<FireProjectileInfo, DisplacementData> <1>__tryModifyFireInfo; public static Action<GameObject, FireProjectileInfo, DisplacementData> <2>__handleProjectileInstantiate; } public FireProjectileInfo UnmodifiedFireProjectileInfo { get; private set; } public FireProjectileInfo ModifiedFireProjectileInfo { get; private set; } [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 object obj = <>O.<0>__modifyFirePositionPatch; if (obj == null) { Manipulator val = modifyFirePositionPatch; <>O.<0>__modifyFirePositionPatch = val; obj = (object)val; } ProjectileManager.FireProjectileServer += (Manipulator)obj; object obj2 = <>O.<0>__modifyFirePositionPatch; if (obj2 == null) { Manipulator val2 = modifyFirePositionPatch; <>O.<0>__modifyFirePositionPatch = val2; obj2 = (object)val2; } ProjectileManager.FireProjectileClient += (Manipulator)obj2; static void handleProjectileInstantiate(GameObject projectile, FireProjectileInfo fireProjectileInfo, DisplacementData displacementData) { //IL_001a: 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) if (Object.op_Implicit((Object)(object)projectile) && !(displacementData == null)) { ProjectileDisplacementInfoProvider projectileDisplacementInfoProvider = projectile.AddComponent<ProjectileDisplacementInfoProvider>(); projectileDisplacementInfoProvider.UnmodifiedFireProjectileInfo = displacementData.OriginalFireProjectileInfo; projectileDisplacementInfoProvider.ModifiedFireProjectileInfo = fireProjectileInfo; } } static void modifyFirePositionPatch(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: 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_0104: Unknown result type (might be due to invalid IL or missing references) ILCursor val7 = new ILCursor(il); ParameterDefinition val8 = ((IEnumerable<ParameterDefinition>)((MethodReference)il.Method).Parameters).FirstOrDefault((Func<ParameterDefinition, bool>)((ParameterDefinition p) => Extensions.Is((MemberReference)(object)((ParameterReference)p).ParameterType, (MemberInfo)typeof(FireProjectileInfo)))); if (val8 == null) { Log.Error("Failed to find FireProjectileInfo parameter", "X:\\Git\\RoR2\\AttackDirectionFix\\AttackDirectionFix\\Patches\\ProjectileDisplacementInfoProvider.cs", "Init", 30); } else { VariableDefinition val9 = new VariableDefinition(il.Import(typeof(DisplacementData))); il.Method.Body.Variables.Add(val9); val7.Emit(OpCodes.Ldarga, val8); val7.Emit(OpCodes.Ldloca, val9); val7.EmitDelegate<<>A{00000009}<FireProjectileInfo, DisplacementData>>((<>A{00000009}<FireProjectileInfo, DisplacementData>)tryModifyFireInfo); if (val7.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)SymbolExtensions.GetMethodInfo((Expression<Action>)(() => Object.Instantiate<GameObject>((GameObject)null, default(Vector3), default(Quaternion))))) })) { val7.Emit(OpCodes.Dup); val7.Emit(OpCodes.Ldarg, val8); val7.Emit(OpCodes.Ldloc, val9); val7.EmitDelegate<Action<GameObject, FireProjectileInfo, DisplacementData>>((Action<GameObject, FireProjectileInfo, DisplacementData>)handleProjectileInstantiate); } else { Log.Error("Failed to find instantiate call", "X:\\Git\\RoR2\\AttackDirectionFix\\AttackDirectionFix\\Patches\\ProjectileDisplacementInfoProvider.cs", "Init", 101); } } } static void tryModifyFireInfo(ref FireProjectileInfo fireProjectileInfo, ref DisplacementData displacementData) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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_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_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_00a5: 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_00ac: 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) CharacterBody val3 = default(CharacterBody); if (Object.op_Implicit((Object)(object)fireProjectileInfo.owner) && fireProjectileInfo.owner.TryGetComponent<CharacterBody>(ref val3) && val3.isPlayerControlled && ProjectileAttributes.ShouldModifyFireDirection(ProjectileCatalog.GetProjectileIndex(fireProjectileInfo.projectilePrefab))) { InputBankTest inputBank = val3.inputBank; if (Object.op_Implicit((Object)(object)inputBank)) { Vector3 val4 = fireProjectileInfo.position; Vector3 val5 = val4 - inputBank.aimOrigin; if (((Vector3)(ref val5)).sqrMagnitude <= Mathf.Epsilon) { val4 = inputBank.GetUnalteredAimOrigin(); } float num = val3.bestFitRadius * 1.5f; float num2 = num * num; Vector3 val6 = val3.corePosition - val4; if (!(((Vector3)(ref val6)).sqrMagnitude > num2)) { FireProjectileInfo originalFireProjectileInfo = fireProjectileInfo; originalFireProjectileInfo.position = val4; displacementData = new DisplacementData(originalFireProjectileInfo); fireProjectileInfo.position = inputBank.aimOrigin; } } } } } } internal static class ProjectileGhostOffsetPatch { [CompilerGenerated] private static class <>O { public static Manipulator <0>__ProjectileController_Start; public static hook_LerpTransform <1>__ProjectileGhostController_LerpTransform; public static hook_CopyTransform <2>__ProjectileGhostController_CopyTransform; public static hook_TrySticking <3>__ProjectileStickOnImpact_TrySticking; public static <>A{00000490}<ProjectileController, bool, Vector3, Quaternion> <4>__getOffsets; public static Func<Vector3, Vector3, Vector3> <5>__getVisualPosition; public static Func<Quaternion, Quaternion, Quaternion> <6>__getVisualRotation; public static Action<ProjectileController, bool, Vector3, Quaternion> <7>__initializeGhostOffset; } private static readonly FloatConVar _cvProjectileInterpolationTime = new FloatConVar("projectile_visual_interp", (ConVarFlags)0, "0.7", "[Attack Direction Fix] How long projectile visuals should take to interpolate to their actual path"); public 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 //IL_0070: 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) //IL_007b: Expected O, but got Unknown object obj = <>O.<0>__ProjectileController_Start; if (obj == null) { Manipulator val = ProjectileController_Start; <>O.<0>__ProjectileController_Start = val; obj = (object)val; } ProjectileController.Start += (Manipulator)obj; object obj2 = <>O.<1>__ProjectileGhostController_LerpTransform; if (obj2 == null) { hook_LerpTransform val2 = ProjectileGhostController_LerpTransform; <>O.<1>__ProjectileGhostController_LerpTransform = val2; obj2 = (object)val2; } ProjectileGhostController.LerpTransform += (hook_LerpTransform)obj2; object obj3 = <>O.<2>__ProjectileGhostController_CopyTransform; if (obj3 == null) { hook_CopyTransform val3 = ProjectileGhostController_CopyTransform; <>O.<2>__ProjectileGhostController_CopyTransform = val3; obj3 = (object)val3; } ProjectileGhostController.CopyTransform += (hook_CopyTransform)obj3; object obj4 = <>O.<3>__ProjectileStickOnImpact_TrySticking; if (obj4 == null) { hook_TrySticking val4 = ProjectileStickOnImpact_TrySticking; <>O.<3>__ProjectileStickOnImpact_TrySticking = val4; obj4 = (object)val4; } ProjectileStickOnImpact.TrySticking += (hook_TrySticking)obj4; } private static void ProjectileController_Start(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown //IL_00a2: 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) //IL_00bb: 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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Expected O, but got Unknown //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); VariableDefinition val2 = new VariableDefinition(il.Import(typeof(bool))); il.Method.Body.Variables.Add(val2); VariableDefinition positionOffsetVar = new VariableDefinition(il.Import(typeof(Vector3))); il.Method.Body.Variables.Add(positionOffsetVar); VariableDefinition rotationOffsetVar = new VariableDefinition(il.Import(typeof(Quaternion))); il.Method.Body.Variables.Add(rotationOffsetVar); val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldloca, val2); val.Emit(OpCodes.Ldloca, positionOffsetVar); val.Emit(OpCodes.Ldloca, rotationOffsetVar); val.EmitDelegate<<>A{00000490}<ProjectileController, bool, Vector3, Quaternion>>((<>A{00000490}<ProjectileController, bool, Vector3, Quaternion>)getOffsets); VariableDefinition rotationTempVar = new VariableDefinition(il.Import(typeof(Quaternion))); il.Method.Body.Variables.Add(rotationTempVar); if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)SymbolExtensions.GetMethodInfo((Expression<Action>)(() => Object.Instantiate<GameObject>((GameObject)null, default(Vector3), default(Quaternion))))) })) { emitPositionRotationOffset(val); } else { Log.Error("Failed to find non-pooled ghost instantiate patch location", "X:\\Git\\RoR2\\AttackDirectionFix\\AttackDirectionFix\\Patches\\ProjectileGhostOffsetPatch.cs", "ProjectileController_Start", 104); } if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, (MethodBase)SymbolExtensions.GetMethodInfo((Expression<Action>)(() => EffectManager.GetAndActivatePooledEffect((GameObject)null, default(Vector3), default(Quaternion))))) })) { emitPositionRotationOffset(val); } else { Log.Error("Failed to find pooled ghost instantiate patch location", "X:\\Git\\RoR2\\AttackDirectionFix\\AttackDirectionFix\\Patches\\ProjectileGhostOffsetPatch.cs", "ProjectileController_Start", 114); } if (val.TryGotoNext((MoveType)1, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchRet(x) })) { val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldloc, val2); val.Emit(OpCodes.Ldloc, positionOffsetVar); val.Emit(OpCodes.Ldloc, rotationOffsetVar); val.EmitDelegate<Action<ProjectileController, bool, Vector3, Quaternion>>((Action<ProjectileController, bool, Vector3, Quaternion>)initializeGhostOffset); } else { Log.Error("Failed to find ret match", "X:\\Git\\RoR2\\AttackDirectionFix\\AttackDirectionFix\\Patches\\ProjectileGhostOffsetPatch.cs", "ProjectileController_Start", 156); } void emitPositionOffset(ILCursor c) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) c.Emit(OpCodes.Ldloc, positionOffsetVar); c.EmitDelegate<Func<Vector3, Vector3, Vector3>>((Func<Vector3, Vector3, Vector3>)getVisualPosition); } void emitPositionRotationOffset(ILCursor c) { //IL_0001: 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) c.Emit(OpCodes.Stloc, rotationTempVar); emitPositionOffset(c); c.Emit(OpCodes.Ldloc, rotationTempVar); emitRotationOffset(c); } void emitRotationOffset(ILCursor c) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) c.Emit(OpCodes.Ldloc, rotationOffsetVar); c.EmitDelegate<Func<Quaternion, Quaternion, Quaternion>>((Func<Quaternion, Quaternion, Quaternion>)getVisualRotation); } static void getOffsets(ProjectileController projectileController, out bool hasVisualOffset, out Vector3 positionOffset, out Quaternion rotationOffset) { //IL_0004: 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_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_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_004e: Unknown result type (might be due to invalid IL or missing references) hasVisualOffset = false; positionOffset = Vector3.zero; rotationOffset = Quaternion.identity; ProjectileDisplacementInfoProvider projectileDisplacementInfoProvider = default(ProjectileDisplacementInfoProvider); if (Object.op_Implicit((Object)(object)projectileController) && ((Component)projectileController).TryGetComponent<ProjectileDisplacementInfoProvider>(ref projectileDisplacementInfoProvider)) { FireProjectileInfo unmodifiedFireProjectileInfo = projectileDisplacementInfoProvider.UnmodifiedFireProjectileInfo; FireProjectileInfo modifiedFireProjectileInfo = projectileDisplacementInfoProvider.ModifiedFireProjectileInfo; Vector3 val3 = unmodifiedFireProjectileInfo.position - modifiedFireProjectileInfo.position; hasVisualOffset = true; positionOffset = val3; } } static Vector3 getVisualPosition(Vector3 position, Vector3 offset) { //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) return position + offset; } static Quaternion getVisualRotation(Quaternion rotation, Quaternion offset) { //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) return rotation * offset; } static void initializeGhostOffset(ProjectileController projectileController, bool hasVisualOffset, Vector3 positionOffset, Quaternion rotationOffset) { //IL_0043: 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_004a: 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)projectileController)) { ProjectileGhostController ghost = projectileController.ghost; if (Object.op_Implicit((Object)(object)ghost)) { ProjectileInitialOffset projectileInitialOffset = ((Component)ghost).GetComponent<ProjectileInitialOffset>(); if (hasVisualOffset) { if (!Object.op_Implicit((Object)(object)projectileInitialOffset)) { projectileInitialOffset = ((Component)ghost).gameObject.AddComponent<ProjectileInitialOffset>(); } projectileInitialOffset.StartTime = Time.time; projectileInitialOffset.InitialPositionOffset = positionOffset; projectileInitialOffset.InitialRotationOffset = rotationOffset; projectileInitialOffset.InterpolationTime = _cvProjectileInterpolationTime.value; } else if (Object.op_Implicit((Object)(object)projectileInitialOffset)) { Object.Destroy((Object)(object)projectileInitialOffset); } } } } } private static void ProjectileGhostController_LerpTransform(orig_LerpTransform orig, ProjectileGhostController self, Transform a, Transform b, float t) { orig.Invoke(self, a, b, t); tryApplyOffset(self); } private static void ProjectileGhostController_CopyTransform(orig_CopyTransform orig, ProjectileGhostController self, Transform src) { orig.Invoke(self, src); tryApplyOffset(self); } private static void tryApplyOffset(ProjectileGhostController ghostController) { //IL_001a: 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_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_003b: Unknown result type (might be due to invalid IL or missing references) ProjectileInitialOffset projectileInitialOffset = default(ProjectileInitialOffset); if (Object.op_Implicit((Object)(object)ghostController) && ((Component)ghostController).TryGetComponent<ProjectileInitialOffset>(ref projectileInitialOffset)) { Transform transform = ghostController.transform; transform.position += projectileInitialOffset.CurrentPositionOffset; transform.rotation *= projectileInitialOffset.CurrentRotationOffset; } } private static bool ProjectileStickOnImpact_TrySticking(orig_TrySticking orig, ProjectileStickOnImpact self, Collider hitCollider, Vector3 impactNormal) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) bool num = orig.Invoke(self, hitCollider, impactNormal); ProjectileController val = default(ProjectileController); if (num && Object.op_Implicit((Object)(object)self) && ((Component)self).TryGetComponent<ProjectileController>(ref val)) { ProjectileGhostController ghost = val.ghost; ProjectileInitialOffset projectileInitialOffset = default(ProjectileInitialOffset); if (Object.op_Implicit((Object)(object)ghost) && ((Component)ghost).TryGetComponent<ProjectileInitialOffset>(ref projectileInitialOffset)) { Object.Destroy((Object)(object)projectileInitialOffset); } } return num; } } }
Sandswept.dll
Decompiled 5 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using System.Threading.Tasks; using AttackDirectionFix; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using EmotesAPI; using EntityStates; using EntityStates.Bandit2; using EntityStates.Barrel; using EntityStates.Croco; using EntityStates.Drone.Command; using EntityStates.Engi.EngiMissilePainter; using EntityStates.Mage.Weapon; using HG; using HG.Reflection; using HarmonyLib; using IL.EntityStates.Drone; using IL.RoR2; using IL.RoR2.Orbs; using JetBrains.Annotations; using KinematicCharacterController; using LookingGlass; using LookingGlass.ItemStatsNameSpace; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using MonoMod.RuntimeDetour; using On.EntityStates; using On.EntityStates.Engi.EngiMissilePainter; using On.EntityStates.Mage.Weapon; using On.RoR2; using On.RoR2.CameraModes; using On.RoR2.Items; using On.RoR2.Orbs; using On.RoR2.UI; using ProcSolver; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using R2API.Utils; using Rebindables; using Rewired; using Rewired.ComponentControls.Effects; using RoR2; using RoR2.Achievements; using RoR2.Audio; using RoR2.CameraModes; using RoR2.CharacterAI; using RoR2.ContentManagement; using RoR2.EntitlementManagement; using RoR2.EntityLogic; using RoR2.ExpansionManagement; using RoR2.HudOverlay; using RoR2.Navigation; using RoR2.Networking; using RoR2.Orbs; using RoR2.Projectile; using RoR2.Skills; using RoR2.SolusWingGrid; using RoR2.UI; using Sandswept.Artifacts; using Sandswept.Buffs; using Sandswept.DoTs; using Sandswept.Drones; using Sandswept.Drones.Inferno; using Sandswept.Drones.Voltaic; using Sandswept.Elites; using Sandswept.Enemies; using Sandswept.Enemies.ArdentWisp.States; using Sandswept.Enemies.CannonballJellyfish; using Sandswept.Enemies.CannonballJellyfish.SkillDefs; using Sandswept.Enemies.CannonballJellyfish.States; using Sandswept.Enemies.DeltaConstruct; using Sandswept.Enemies.GammaConstruct; using Sandswept.Enemies.SwepSwepTheSandy; using Sandswept.Enemies.ThetaConstruct; using Sandswept.Equipment; using Sandswept.Equipment.Lunar; using Sandswept.Interactables; using Sandswept.Interactables.Regular; using Sandswept.Items; using Sandswept.Items.Greens; using Sandswept.Items.NoTier; using Sandswept.Items.Reds; using Sandswept.Items.VoidGreens; using Sandswept.Items.Whites; using Sandswept.Survivors; using Sandswept.Survivors.Electrician; using Sandswept.Survivors.Electrician.Achievements; using Sandswept.Survivors.Electrician.Crate; using Sandswept.Survivors.Electrician.Hooks; using Sandswept.Survivors.Electrician.Skills; using Sandswept.Survivors.Electrician.States; using Sandswept.Survivors.Electrician.VFX; using Sandswept.Survivors.Ranger; using Sandswept.Survivors.Ranger.Achievements; using Sandswept.Survivors.Ranger.Crosshairs; using Sandswept.Survivors.Ranger.Hooks; using Sandswept.Survivors.Ranger.Pod; using Sandswept.Survivors.Ranger.Projectiles; using Sandswept.Survivors.Ranger.SkillDefs.Passive; using Sandswept.Survivors.Ranger.SkillDefs.Primary; using Sandswept.Survivors.Ranger.SkillDefs.Secondary; using Sandswept.Survivors.Ranger.SkillDefs.Special; using Sandswept.Survivors.Ranger.SkillDefs.Utility; using Sandswept.Survivors.Ranger.States.Primary; using Sandswept.Survivors.Ranger.States.Secondary; using Sandswept.Survivors.Ranger.States.Special; using Sandswept.Survivors.Ranger.States.Utility; using Sandswept.Survivors.Ranger.VFX; using Sandswept.Utils; using Sandswept.Utils.Assets; using Sandswept.Utils.Components; using TMPro; using ThreeEyedGames; using UnityEngine; using UnityEngine.AI; using UnityEngine.AddressableAssets; using UnityEngine.Audio; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.Rendering.PostProcessing; using UnityEngine.SceneManagement; using UnityEngine.UI; using UnityEngine.UIElements; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Sandswept")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+bcfc8c5f9b0c405edc0f5fb373063e0889836c3a")] [assembly: AssemblyProduct("Sandswept")] [assembly: AssemblyTitle("Sandswept")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Sandswept { public static class CursedConfig { [CompilerGenerated] private static class <>O { public static hook_GiveItem_ItemIndex_int <0>__Inventory_GiveItem_ItemIndex_int; public static Action<DamageReport> <1>__GlobalEventManager_onCharacterDeathGlobal; } public static LazyIndex VoltIndex = new LazyIndex("ElectricianBody"); public static void Init() { //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Expected O, but got Unknown if (Main.cursedConfig.Value) { LanguageAPI.AddOverlay("ITEM_SANDSWEPT_SMOULDERING_DOCUMENT_NAME", "The Nefarious Smouldering Document"); LanguageAPI.AddOverlay("ITEM_SANDSWEPT_AMBER_KNIFE_NAME", "Barrier-focused item mod"); LanguageAPI.AddOverlay("ITEM_SANDSWEPT_RED_SPRING_WATER_NAME", "[CHEESE PUFF] spring water"); LanguageAPI.AddOverlay("ITEM_SANDSWEPT_CROWNS_DIAMOND_NAME", "Barrier-focused item mod"); LanguageAPI.AddOverlay("ITEM_SANDSWEPT_DRIFTING_PERCEPTION_NAME", "hifu when two music references in one item name"); LanguageAPI.AddOverlay("ITEM_SANDSWEPT_DRIFTING_PERCEPTION_LORE", "Yeah but I just don't get the point of attaching this to cloak. Cloak is a repositioning utility buff (enemies still 'see' you every couple seconds anyway) that helps you in a quick burst in the short term, whereas this effect just screams \"I hate cloak, it's a damage buff now\". Like whats the point of cloaking on entering combat other than brute forcing this 'synergy' where you incentivize ignoring the original portion of the mechanic.\r\nTake this with a grain of salt though, I am a horribly pessimistic person who is also extremely critical.\r\n\r\nno offense but I really don't understand what you're trying to mean from any of that\r\n\r\ngives you cloak when you need it to efficiently kill enemies\r\nyet in this context this is no different than it giving its own independent crit chance and damage buff; one could argue the movement speed, and yeah sure, but outside of that, the only reason cloak is doing anything for this scenario is because this item is forcing it to instead be a different buff, with a completely different goal.\r\nlets you use it for mobility outside of combat too\r\nyet it only gives you that mobility when entering combat? And on a cooldown at that? it's like if red whip was only active for 5s then went on a 15s cd \r\nplus you get a bonus synergy from it\r\nyet the only general 'synergy' gotten from implementing this, assuming only sandswept / vanilla(sandswept atm doesn't even have any other cloak items to help realize / justify this concept) is that you can deal bonus crit damage while you're more worried about staying alive when hitting 25 % health with stealthkit ?\r\nand it sets up other skills and items for that extra crit\r\nI never complained about the interactions or implications of the damage buff part itself, just that it felt really weird shoehorning this effect onto cloak\r\n\r\nIt just feels like this item had the crit chance and damage as an independent buff and then it was just moved into cloak for no good reason, or rather just a \"but what if I did.\""); LanguageAPI.AddOverlay("ITEM_SANDSWEPT_UNIVERSAL_VIP_PASS_NAME", "Universal VIP Paws"); LanguageAPI.AddOverlay("ITEM_SANDSWEPT_SACRIFICIAL_BAND_NAME", "B(r)and of Sacrifice"); LanguageAPI.AddOverlay("ITEM_SANDSWEPT_TEMPORAL_TRANSISTOR_NAME", "hrt install"); LanguageAPI.AddOverlay("ITEM_SANDSWEPT_CEREMONIAL_JAR_NAME", "The Nefarious Jar"); LanguageAPI.AddOverlay("ITEM_SANDSWEPT_TORN_FEATHER_NAME", "Respect"); SwapIcon(ItemBase<TornFeather>.instance, "respectPNG.png"); SwapIcon(ItemBase<TwistedWound>.instance, "texItemTemp.png"); SwapIcon(EquipmentBase<FlawlessDesign>.instance, "texObama.png"); LanguageAPI.AddOverlay("ITEM_SANDSWEPT_THEIR_PROMINENCE_NAME", "must take bruh :pray:"); LanguageAPI.AddOverlay("ITEM_SANDSWEPT_HALLOWED_ICHOR_NAME", "yet another terraria reference (borbo would be proud)"); LanguageAPI.AddOverlay("SS_RANGER_BODY_NAME", "gay little [CHEESE PUFF]"); LanguageAPI.AddOverlay("SS_RANGER_DESCRIPTION", "this is a [CHEESE PUFF]"); LanguageAPI.AddOverlay("RANGER_SKIN_MAJOR_NAME", "minor"); LanguageAPI.AddOverlay("RANGER_SKIN_RENEGADE_NAME", "holy shit its been more than 2 years and we still havent added renegade thagt this skin is a reference to"); LanguageAPI.AddOverlay("RANGER_SKIN_MILEZERO_NAME", "literally just Periphery 2"); LanguageAPI.AddOverlay("ACHIEVEMENT_RANGERCLEARGAMEMONSOON_NAME", "[CHEESE PUFF]: Mastery"); LanguageAPI.AddOverlay("ACHIEVEMENT_RANGERCLEARGAMEMONSOON_DESCRIPTION", "As [CHEESE PUFF], beat the game or obliterate on Monsoon."); LanguageAPI.AddOverlay("SANDSWEPT_ELECTR_NAME", "(WOKE DEI WARNING!) gay robot [CHEESE PUFF] girl"); LanguageAPI.AddOverlay("VOLT_SKIN_COVENANT_NAME", "Covenant (hifu when the <content type> name is a music reference OMG WOJAK RAISING HANDS JPEG) https://www.youtube.com/watch?v=tjcUCwe4yaY"); LanguageAPI.AddOverlay("ACHIEVEMENT_ELECTRICIANCLEARGAMEMONSOON_NAME", "(WOKE DEI WARNING!) gay robot [CHEESE PUFF] girl: Mastery"); LanguageAPI.AddOverlay("SANDSWEPT_CANNONJELLY_NAME", "[CHEESE PUFF]"); LanguageAPI.AddOverlay("SANDSWEPT_SWEPSWEP_NAME", "https://www.youtube.com/watch?v=XYCQcy76100"); LanguageAPI.AddOverlay("SANDSWEPT_VOLATILECONTEXT", "Forcefully Insert Battery~"); LanguageAPI.AddOverlay("SANDSWEPT_VOLATILEINSERT", "your life is as valuable as a <style=cDeath>summer ant</style>"); LanguageAPI.AddOverlay("SANDSWEPT_INFERNO_DRONE_BODY", "Can you find the moredrones ?"); LanguageAPI.AddOverlay("SANDSWEPT_INFERNO_DRONE_BROKEN_NAME", "Can you find the moredrones ?"); LanguageAPI.AddOverlay("SANDSWEPT_INFERNO_DRONE_CONTEXT", "Can you find the moredrones ?"); LanguageAPI.AddOverlay("SANDSWEPT_VOLTAIC_DRONE_BODY", "Can you find the moredrones ?"); LanguageAPI.AddOverlay("SANDSWEPT_VOLTAIC_DRONE_BROKEN_NAME", "Can you find the moredrones ?"); LanguageAPI.AddOverlay("SANDSWEPT_VOLTAIC_DRONE_CONTEXT", "Can you find the moredrones ?"); Main.SandsweptExpansionDef.nameToken.AddOverlay("Sandstorm 2"); Main.SandsweptExpansionDef.descriptionToken.AddOverlay("sandswept is pretty mid\r\nsorry\r\nthere are a few cool items but other than those its all just bad or mediocre\r\nthe characters lack polish"); object obj = <>O.<0>__Inventory_GiveItem_ItemIndex_int; if (obj == null) { hook_GiveItem_ItemIndex_int val = Inventory_GiveItem_ItemIndex_int; <>O.<0>__Inventory_GiveItem_ItemIndex_int = val; obj = (object)val; } Inventory.GiveItem_ItemIndex_int += (hook_GiveItem_ItemIndex_int)obj; GlobalEventManager.onCharacterDeathGlobal += GlobalEventManager_onCharacterDeathGlobal; } } private static void SwapIcon(ItemBase instance, string path) { if (ItemBase.DefaultEnabledCallback(instance)) { instance.ItemDef.pickupIconSprite = Main.hifuSandswept.LoadAsset<Sprite>(path); } } private static void SwapIcon(EquipmentBase instance, string path) { if (EquipmentBase.DefaultEnabledCallback(instance)) { instance.EquipmentDef.pickupIconSprite = Main.hifuSandswept.LoadAsset<Sprite>(path); } } private static void GlobalEventManager_onCharacterDeathGlobal(DamageReport report) { //IL_0019: 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) CharacterBody attackerBody = report.attackerBody; if (Object.op_Implicit((Object)(object)attackerBody) && attackerBody.bodyIndex == VoltIndex.Value && Util.CheckRoll(3f, 0f, (CharacterMaster)null)) { Chat.AddMessage("<color=#7D42B2>Cheese puff girl</color>: Wlasnie zabilam kiegos chlopa czy tam babe :3"); } } private static void Inventory_GiveItem_ItemIndex_int(orig_GiveItem_ItemIndex_int orig, Inventory self, ItemIndex itemIndex, int count) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, itemIndex, count); SmoulderingDocument instance = ItemBase<SmoulderingDocument>.instance; if (instance != null && itemIndex != instance.ItemDef.itemIndex) { } } } public class EggController : MonoBehaviour { private float decayStopwatch = 0.5f; private bool decaying = false; private Vector3 baseScale; private Vector3 tl; private Vector3 bl; private Vector3 tr; private Vector3 br; internal Vector3 velocity; private float boundsSize; public void Start() { //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_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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_009f: 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) baseScale = ((Component)this).transform.localScale; bl = Camera.main.ViewportToScreenPoint(new Vector3(0f, 0f)); tl = Camera.main.ViewportToScreenPoint(new Vector3(0f, 1f)); br = Camera.main.ViewportToScreenPoint(new Vector3(1f, 0f)); tr = Camera.main.ViewportToScreenPoint(new Vector3(1f, 1f)); BoxCollider2D component = ((Component)this).GetComponent<BoxCollider2D>(); Bounds bounds = ((Collider2D)component).bounds; Vector3 size = ((Bounds)(ref bounds)).size; boundsSize = ((Vector3)(ref size)).magnitude / 2f; } public void OnMouseDown() { if (!decaying) { decaying = true; } } public void Update() { //IL_0047: 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) if (decaying) { decayStopwatch -= Time.deltaTime; if (decayStopwatch <= 0f) { Object.Destroy((Object)(object)((Component)this).gameObject); } ((Component)this).transform.localScale = baseScale * (1f - decayStopwatch / 0.5f); } } public void FixedUpdate() { //IL_0008: 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_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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_008b: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: 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_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)this).transform; transform.position += velocity * Time.fixedDeltaTime; Vector3 val = Camera.main.WorldToScreenPoint(((Component)this).transform.position) + boundsSize * ((Vector3)(ref velocity)).normalized; if (val.y >= tr.y) { velocity = Vector3.Reflect(velocity, Vector3.down); } if (val.y <= br.y) { velocity = Vector3.Reflect(velocity, Vector3.up); } if (val.x >= br.x) { velocity = Vector3.Reflect(velocity, Vector3.left); } if (val.x <= bl.x) { velocity = Vector3.Reflect(velocity, Vector3.right); } } } internal static class Log { internal static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void LogDebug(object data) { _logSource.LogDebug(data); } internal static void LogError(object data) { _logSource.LogError(data); } internal static void LogFatal(object data) { _logSource.LogFatal(data); } internal static void LogInfo(object data) { _logSource.LogInfo(data); } internal static void LogMessage(object data) { _logSource.LogMessage(data); } internal static void LogWarning(object data) { _logSource.LogWarning(data); } } [BepInPlugin("com.TeamSandswept.Sandswept", "Sandswept", "1.4.0")] [BepInDependency("com.bepis.r2api.skins", "1.4.4")] [BepInDependency("com.bepis.r2api.dot", "1.1.2")] [BepInDependency("com.bepis.r2api.items", "1.0.7")] [BepInDependency("com.bepis.r2api.elites", "1.1.1")] [BepInDependency("com.bepis.r2api.damagetype", "1.1.7")] [BepInDependency("com.bepis.r2api.prefab", "1.1.1")] [BepInDependency("com.bepis.r2api.language", "1.1.0")] [BepInDependency("com.bepis.r2api.recalculatestats", "1.6.5")] [BepInDependency("com.bepis.r2api.content_management", "1.0.10")] [BepInDependency("com.bepis.r2api.networking", "1.0.4")] [BepInDependency("com.bepis.r2api.director", "2.3.8")] [BepInDependency("com.bepis.r2api.skills", "1.0.4")] [BepInDependency("com.bepis.r2api.proctype", "1.0.2")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class Main : BaseUnityPlugin { [CompilerGenerated] private static class <>O { public static AnimationChanged <0>__RangerEmotesFix; } [CompilerGenerated] private sealed class <CreateCovenantPrefab>d__89 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Main <>4__this; private Color32 <beamStartColor>5__1; private Color32 <beamEndColor>5__2; private Color32 <sphereFillColor>5__3; private Color32 <sphereOutlineColor>5__4; private Color32 <smallSphereFillColor>5__5; private GameObject <sphereVFX>5__6; private GameObject <tempestSphereIndicator>5__7; private Light <pointLight>5__8; private Material <newSphereFillMaterial>5__9; private Material <newSphereOutlineMaterial>5__10; private Material[] <newTempestSphereMaterials>5__11; private Material <newOrbCoreOutlineMaterial>5__12; private Material <newOrbCoreFillMaterial>5__13; private Material[] <newOrbCoreMaterials>5__14; private GameObject <tempestOrb>5__15; private Transform <tempestOrbPointLight>5__16; private Light <tempestOrbPointLightLight>5__17; private GameObject <sparksIn>5__18; private GameObject <sparksMisc>5__19; private EmissionModule <sparksInEmission>5__20; private MinMaxCurve <sparksInRateOverTime>5__21; private Material <sparksInMaterial>5__22; private Transform <orbCore>5__23; private RotateAroundAxis <rotateX>5__24; private RotateAroundAxis <rotateY>5__25; private ObjectScaleCurve <objectScaleCurve>5__26; private LineRenderer <lineRenderer>5__27; private DetachAndCollapse <detachAndCollapse>5__28; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <CreateCovenantPrefab>d__89(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { //IL_0068: 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) <sphereVFX>5__6 = null; <tempestSphereIndicator>5__7 = null; <pointLight>5__8 = null; <newSphereFillMaterial>5__9 = null; <newSphereOutlineMaterial>5__10 = null; <newTempestSphereMaterials>5__11 = null; <newOrbCoreOutlineMaterial>5__12 = null; <newOrbCoreFillMaterial>5__13 = null; <newOrbCoreMaterials>5__14 = null; <tempestOrb>5__15 = null; <tempestOrbPointLight>5__16 = null; <tempestOrbPointLightLight>5__17 = null; <sparksIn>5__18 = null; <sparksMisc>5__19 = null; <sparksInEmission>5__20 = default(EmissionModule); <sparksInRateOverTime>5__21 = default(MinMaxCurve); <sparksInMaterial>5__22 = null; <orbCore>5__23 = null; <rotateX>5__24 = null; <rotateY>5__25 = null; <objectScaleCurve>5__26 = null; <lineRenderer>5__27 = null; <detachAndCollapse>5__28 = null; <>1__state = -2; } private bool MoveNext() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Expected O, but got Unknown //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_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_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Expected O, but got Unknown //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Expected O, but got Unknown //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Expected O, but got Unknown //IL_0420: Unknown result type (might be due to invalid IL or missing references) //IL_043d: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Expected O, but got Unknown //IL_0469: Unknown result type (might be due to invalid IL or missing references) //IL_046e: Unknown result type (might be due to invalid IL or missing references) //IL_04d7: Unknown result type (might be due to invalid IL or missing references) //IL_04e1: Expected O, but got Unknown //IL_0503: Unknown result type (might be due to invalid IL or missing references) //IL_0508: Unknown result type (might be due to invalid IL or missing references) //IL_06cb: Unknown result type (might be due to invalid IL or missing references) //IL_06d5: Unknown result type (might be due to invalid IL or missing references) //IL_06ec: Unknown result type (might be due to invalid IL or missing references) //IL_06f1: Unknown result type (might be due to invalid IL or missing references) //IL_06fd: Unknown result type (might be due to invalid IL or missing references) //IL_0702: Unknown result type (might be due to invalid IL or missing references) //IL_071e: Unknown result type (might be due to invalid IL or missing references) //IL_0728: Expected O, but got Unknown //IL_079e: Unknown result type (might be due to invalid IL or missing references) //IL_07a4: Unknown result type (might be due to invalid IL or missing references) //IL_07b8: Unknown result type (might be due to invalid IL or missing references) //IL_07be: Unknown result type (might be due to invalid IL or missing references) //IL_07ec: Unknown result type (might be due to invalid IL or missing references) //IL_07f6: Unknown result type (might be due to invalid IL or missing references) //IL_092b: Unknown result type (might be due to invalid IL or missing references) //IL_0930: Unknown result type (might be due to invalid IL or missing references) //IL_0941: Unknown result type (might be due to invalid IL or missing references) //IL_0946: Unknown result type (might be due to invalid IL or missing references) //IL_0957: Unknown result type (might be due to invalid IL or missing references) //IL_095c: Unknown result type (might be due to invalid IL or missing references) //IL_0961: Unknown result type (might be due to invalid IL or missing references) //IL_096b: Expected O, but got Unknown //IL_0982: Unknown result type (might be due to invalid IL or missing references) //IL_098c: Expected O, but got Unknown //IL_09a7: Unknown result type (might be due to invalid IL or missing references) //IL_09b1: Unknown result type (might be due to invalid IL or missing references) //IL_0a1a: Unknown result type (might be due to invalid IL or missing references) //IL_0a30: Unknown result type (might be due to invalid IL or missing references) //IL_0a46: Unknown result type (might be due to invalid IL or missing references) //IL_0a5c: Unknown result type (might be due to invalid IL or missing references) //IL_0a9e: Unknown result type (might be due to invalid IL or missing references) //IL_0aa3: Unknown result type (might be due to invalid IL or missing references) //IL_0ab5: Unknown result type (might be due to invalid IL or missing references) //IL_0aba: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <beamStartColor>5__1 = new Color32(byte.MaxValue, (byte)0, (byte)230, byte.MaxValue); <beamEndColor>5__2 = new Color32((byte)0, (byte)0, byte.MaxValue, byte.MaxValue); <sphereFillColor>5__3 = new Color32((byte)0, (byte)12, byte.MaxValue, byte.MaxValue); <sphereOutlineColor>5__4 = new Color32((byte)129, (byte)57, (byte)176, byte.MaxValue); <smallSphereFillColor>5__5 = new Color32((byte)39, (byte)6, (byte)40, byte.MaxValue); tempestSphereCovenant = PrefabAPI.InstantiateClone(assets.LoadAsset<GameObject>("TempestSphereProjectile.prefab"), "Tempest Sphere Projectile Covenant"); ContentAddition.AddProjectile(tempestSphereCovenant); <sphereVFX>5__6 = new GameObject("Tempest Sphere VFX Holder Covenant"); <sphereVFX>5__6.transform.position = Vector3.zero; <sphereVFX>5__6.transform.localPosition = Vector3.zero; <tempestSphereIndicator>5__7 = PrefabAPI.InstantiateClone(GameObject.VagrantNovaAreaIndicator, "Tempest Sphere Indicator Covenant", false); ((Component)<tempestSphereIndicator>5__7.transform.Find("Particle System")).gameObject.SetActive(false); <pointLight>5__8 = ((Component)<tempestSphereIndicator>5__7.transform.Find("Point Light")).GetComponent<Light>(); <pointLight>5__8.color = Color32.op_Implicit(<sphereOutlineColor>5__4); <pointLight>5__8.intensity = 100f; ((Behaviour)((Component)<pointLight>5__8).GetComponent<LightIntensityCurve>()).enabled = false; ((Behaviour)((Component)<pointLight>5__8).GetComponent<LightScaleFromParent>()).enabled = false; <pointLight>5__8.range = 20f; <newSphereFillMaterial>5__9 = new Material(Material.matWarbannerSphereIndicator); <newSphereFillMaterial>5__9.SetTexture("_RemapTex", (Texture)(object)Texture2D.texRampTritone); <newSphereFillMaterial>5__9.SetColor("_TintColor", Color32.op_Implicit(<sphereFillColor>5__3)); <newSphereFillMaterial>5__9.SetFloat("_InvFade", 30f); <newSphereFillMaterial>5__9.SetFloat("_SoftPower", 0.1f); <newSphereFillMaterial>5__9.SetFloat("_Boost", 3f); <newSphereFillMaterial>5__9.SetFloat("_RimPower", 17f); <newSphereFillMaterial>5__9.SetFloat("_RimStrength", 5f); <newSphereFillMaterial>5__9.SetFloat("_AlphaBoost", 20f); <newSphereFillMaterial>5__9.SetFloat("_IntersectionStrength", 1.223287f); <newSphereOutlineMaterial>5__10 = new Material(Material.matLightningSphere); <newSphereOutlineMaterial>5__10.SetTexture("_RemapTex", (Texture)(object)Texture2D.texRampTritone3); <newSphereOutlineMaterial>5__10.SetTexture("_Cloud1Tex", (Texture)(object)Texture2D.texCloudLightning1); <newSphereOutlineMaterial>5__10.SetTexture("_Cloud2Tex", (Texture)null); <newSphereOutlineMaterial>5__10.SetColor("_TintColor", Color32.op_Implicit(<sphereOutlineColor>5__4)); <newSphereOutlineMaterial>5__10.SetFloat("_InvFade", 3f); <newSphereOutlineMaterial>5__10.SetFloat("_SoftPower", 0.85f); <newSphereOutlineMaterial>5__10.SetFloat("_Boost", 1.5f); <newSphereOutlineMaterial>5__10.SetFloat("_RimPower", 0.1f); <newSphereOutlineMaterial>5__10.SetFloat("_RimStrength", 0.052f); <newSphereOutlineMaterial>5__10.SetFloat("_AlphaBoost", 1f); <newSphereOutlineMaterial>5__10.SetFloat("_IntersectionStrength", 6.4f); <newTempestSphereMaterials>5__11 = (Material[])(object)new Material[2] { <newSphereFillMaterial>5__9, <newSphereOutlineMaterial>5__10 }; ((Renderer)<tempestSphereIndicator>5__7.GetComponent<MeshRenderer>()).sharedMaterials = <newTempestSphereMaterials>5__11; <tempestSphereIndicator>5__7.RemoveComponent<ObjectScaleCurve>(); <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; case 1: <>1__state = -1; <tempestSphereIndicator>5__7.transform.localScale = new Vector3(14f, 14f, 14f); <tempestSphereIndicator>5__7.RemoveComponent<AnimateShaderAlpha>(); <newOrbCoreOutlineMaterial>5__12 = new Material(Material.matLoaderLightningTile); <newOrbCoreOutlineMaterial>5__12.SetTexture("_RemapTex", (Texture)(object)Texture2D.texRampTritone3); <newOrbCoreOutlineMaterial>5__12.SetColor("_TintColor", Color32.op_Implicit(<sphereFillColor>5__3)); <newOrbCoreOutlineMaterial>5__12.SetFloat("_InvFade", 1.3f); <newOrbCoreOutlineMaterial>5__12.SetFloat("_Boost", 4f); <newOrbCoreOutlineMaterial>5__12.SetFloat("_AlphaBoost", 3.67f); <newOrbCoreOutlineMaterial>5__12.SetFloat("_AlphaBias", 0f); <newOrbCoreFillMaterial>5__13 = new Material(Material.matJellyfishLightningSphere); <newOrbCoreFillMaterial>5__13.SetTexture("_RemapTex", (Texture)(object)Texture2D.texRampTritone3); <newOrbCoreFillMaterial>5__13.SetColor("_TintColor", Color32.op_Implicit(<smallSphereFillColor>5__5)); <newOrbCoreFillMaterial>5__13.SetFloat("_InvFade", 0.8f); <newOrbCoreFillMaterial>5__13.SetFloat("_SoftPower", 1f); <newOrbCoreFillMaterial>5__13.SetFloat("_Boost", 1.86f); <newOrbCoreFillMaterial>5__13.SetFloat("_RimPower", 1.5f); <newOrbCoreFillMaterial>5__13.SetFloat("_RimStrength", 0.7f); <newOrbCoreFillMaterial>5__13.SetFloat("_AlphaBoost", 6f); <newOrbCoreFillMaterial>5__13.SetFloat("_AlphaBias", 2f); <newOrbCoreMaterials>5__14 = (Material[])(object)new Material[2] { <newOrbCoreOutlineMaterial>5__12, <newOrbCoreFillMaterial>5__13 }; <tempestOrb>5__15 = PrefabAPI.InstantiateClone(GameObject.VoidSurvivorChargeMegaBlaster, "Tempest Sphere Orb Covenant", false); ((Component)<tempestOrb>5__15.transform.Find("Base")).gameObject.SetActive(false); ((Component)<tempestOrb>5__15.transform.Find("Base (1)")).gameObject.SetActive(false); <tempestOrbPointLight>5__16 = <tempestOrb>5__15.transform.Find("Point light"); ((Behaviour)((Component)<tempestOrbPointLight>5__16).GetComponent<FlickerLight>()).enabled = false; ((Behaviour)((Component)<tempestOrbPointLight>5__16).GetComponent<LightIntensityCurve>()).enabled = false; <tempestOrbPointLightLight>5__17 = ((Component)<tempestOrbPointLight>5__16).GetComponent<Light>(); ((Behaviour)<tempestOrbPointLightLight>5__17).enabled = false; <sparksIn>5__18 = ((Component)<tempestOrb>5__15.transform.Find("Sparks, In")).gameObject; <sparksMisc>5__19 = ((Component)<tempestOrb>5__15.transform.Find("Sparks, Misc")).gameObject; <sparksIn>5__18.transform.localScale = Vector3.one * 2f; <sparksInEmission>5__20 = <sparksIn>5__18.GetComponent<ParticleSystem>().emission; <sparksInRateOverTime>5__21 = ((EmissionModule)(ref <sparksInEmission>5__20)).rateOverTime; ((MinMaxCurve)(ref <sparksInRateOverTime>5__21)).curveMultiplier = 2f; <sparksInMaterial>5__22 = new Material(Material.matLoaderCharging); <sparksInMaterial>5__22.SetFloat("_Boost", 15f); <sparksInMaterial>5__22.SetFloat("_AlphaBoost", 20f); <sparksInMaterial>5__22.SetFloat("_AlphaBias", 1f); ((Renderer)<sparksIn>5__18.GetComponent<ParticleSystemRenderer>()).sharedMaterial = <sparksInMaterial>5__22; ((Renderer)<sparksMisc>5__19.GetComponent<ParticleSystemRenderer>()).sharedMaterial = Material.matIceOrbCore; VFXUtils.RecolorMaterialsAndLights(<sparksIn>5__18, <beamStartColor>5__1, <beamStartColor>5__1, convertRampsToGrayscale: true); VFXUtils.RecolorMaterialsAndLights(<sparksMisc>5__19, <beamStartColor>5__1, <beamStartColor>5__1, convertRampsToGrayscale: true); <orbCore>5__23 = <tempestOrb>5__15.transform.Find("OrbCore"); <orbCore>5__23.localScale = Vector3.one * 0.5f; ((Renderer)((Component)<orbCore>5__23).GetComponent<MeshRenderer>()).sharedMaterials = <newOrbCoreMaterials>5__14; <rotateX>5__24 = ((Component)(object)<orbCore>5__23).AddComponent<RotateAroundAxis>(); <rotateX>5__24.speed = (Speed)2; <rotateX>5__24.slowRotationSpeed = 5f; <rotateX>5__24.fastRotationSpeed = 30f; <rotateX>5__24.rotateAroundAxis = (RotationAxis)0; <rotateX>5__24.relativeTo = (Space)1; <rotateX>5__24.reverse = false; <rotateY>5__25 = ((Component)(object)<orbCore>5__23).AddComponent<RotateAroundAxis>(); <rotateY>5__25.speed = (Speed)2; <rotateY>5__25.slowRotationSpeed = 5f; <rotateY>5__25.fastRotationSpeed = 45f; <rotateY>5__25.rotateAroundAxis = (RotationAxis)1; <rotateY>5__25.relativeTo = (Space)1; <rotateY>5__25.reverse = false; <objectScaleCurve>5__26 = ((Component)(object)<orbCore>5__23).AddComponent<ObjectScaleCurve>(); <objectScaleCurve>5__26.useOverallCurveOnly = true; <objectScaleCurve>5__26.timeMax = 10f; <objectScaleCurve>5__26.overallCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, 0.5f), new Keyframe(0.03f, 1f), new Keyframe(1f, 4.19f) }); ((Component)(object)<tempestOrb>5__15.transform).RemoveComponent<ObjectScaleCurve>(); <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 2; return true; case 2: <>1__state = -1; <tempestOrb>5__15.transform.localScale = Vector3.one * 3f; <tempestSphereIndicator>5__7.transform.parent = <sphereVFX>5__6.transform; <tempestOrb>5__15.transform.parent = <sphereVFX>5__6.transform; <sphereVFX>5__6.transform.SetParent(tempestSphereCovenant.transform); <tempestSphereIndicator>5__7.transform.position = Vector3.zero; <tempestSphereIndicator>5__7.transform.localPosition = Vector3.zero; <tempestOrb>5__15.transform.position = Vector3.zero; <tempestOrb>5__15.transform.localPosition = Vector3.zero; <lineRenderer>5__27 = ((Component)tempestSphereCovenant.transform.Find("LR")).GetComponent<LineRenderer>(); <lineRenderer>5__27.endWidth = 0.5f; <lineRenderer>5__27.startColor = Color32.op_Implicit(<beamStartColor>5__1); <lineRenderer>5__27.endColor = Color32.op_Implicit(<beamEndColor>5__2); ((Renderer)<lineRenderer>5__27).material = lineRendererBase; <detachAndCollapse>5__28 = tempestSphereCovenant.AddComponent<DetachAndCollapse>(); <detachAndCollapse>5__28.collapseTime = 0.4f; <detachAndCollapse>5__28.target = <sphereVFX>5__6.transform; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <CreateDefaultPrefab>d__86 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Main <>4__this; private Color32 <beamStartColor>5__1; private Color32 <beamEndColor>5__2; private Color32 <sphereFillColor>5__3; private Color32 <sphereOutlineColor>5__4; private Color32 <smallSphereFillColor>5__5; private GameObject <sphereVFX>5__6; private GameObject <tempestSphereIndicator>5__7; private Light <pointLight>5__8; private Material <newSphereFillMaterial>5__9; private Material <newSphereOutlineMaterial>5__10; private Material[] <newTempestSphereMaterials>5__11; private Material <newOrbCoreOutlineMaterial>5__12; private Material <newOrbCoreFillMaterial>5__13; private Material[] <newOrbCoreMaterials>5__14; private GameObject <tempestOrb>5__15; private Transform <tempestOrbPointLight>5__16; private Light <tempestOrbPointLightLight>5__17; private GameObject <sparksIn>5__18; private GameObject <sparksMisc>5__19; private EmissionModule <sparksInEmission>5__20; private MinMaxCurve <sparksInRateOverTime>5__21; private Material <sparksInMaterial>5__22; private Transform <orbCore>5__23; private RotateAroundAxis <rotateX>5__24; private RotateAroundAxis <rotateY>5__25; private ObjectScaleCurve <objectScaleCurve>5__26; private LineRenderer <lineRenderer>5__27; private DetachAndCollapse <detachAndCollapse>5__28; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <CreateDefaultPrefab>d__86(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { //IL_0068: 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) <sphereVFX>5__6 = null; <tempestSphereIndicator>5__7 = null; <pointLight>5__8 = null; <newSphereFillMaterial>5__9 = null; <newSphereOutlineMaterial>5__10 = null; <newTempestSphereMaterials>5__11 = null; <newOrbCoreOutlineMaterial>5__12 = null; <newOrbCoreFillMaterial>5__13 = null; <newOrbCoreMaterials>5__14 = null; <tempestOrb>5__15 = null; <tempestOrbPointLight>5__16 = null; <tempestOrbPointLightLight>5__17 = null; <sparksIn>5__18 = null; <sparksMisc>5__19 = null; <sparksInEmission>5__20 = default(EmissionModule); <sparksInRateOverTime>5__21 = default(MinMaxCurve); <sparksInMaterial>5__22 = null; <orbCore>5__23 = null; <rotateX>5__24 = null; <rotateY>5__25 = null; <objectScaleCurve>5__26 = null; <lineRenderer>5__27 = null; <detachAndCollapse>5__28 = null; <>1__state = -2; } private bool MoveNext() { //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_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_0075: 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_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_00a5: 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_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected O, but got Unknown //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Expected O, but got Unknown //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Expected O, but got Unknown //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Expected O, but got Unknown //IL_0423: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_044a: Expected O, but got Unknown //IL_046c: Unknown result type (might be due to invalid IL or missing references) //IL_0471: Unknown result type (might be due to invalid IL or missing references) //IL_04da: Unknown result type (might be due to invalid IL or missing references) //IL_04e4: Expected O, but got Unknown //IL_0506: Unknown result type (might be due to invalid IL or missing references) //IL_050b: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06d8: Unknown result type (might be due to invalid IL or missing references) //IL_06ef: Unknown result type (might be due to invalid IL or missing references) //IL_06f4: Unknown result type (might be due to invalid IL or missing references) //IL_0700: Unknown result type (might be due to invalid IL or missing references) //IL_0705: Unknown result type (might be due to invalid IL or missing references) //IL_0721: Unknown result type (might be due to invalid IL or missing references) //IL_072b: Expected O, but got Unknown //IL_07a1: Unknown result type (might be due to invalid IL or missing references) //IL_07a7: Unknown result type (might be due to invalid IL or missing references) //IL_07bb: Unknown result type (might be due to invalid IL or missing references) //IL_07c1: Unknown result type (might be due to invalid IL or missing references) //IL_07ef: Unknown result type (might be due to invalid IL or missing references) //IL_07f9: Unknown result type (might be due to invalid IL or missing references) //IL_092e: Unknown result type (might be due to invalid IL or missing references) //IL_0933: Unknown result type (might be due to invalid IL or missing references) //IL_0944: Unknown result type (might be due to invalid IL or missing references) //IL_0949: Unknown result type (might be due to invalid IL or missing references) //IL_095a: Unknown result type (might be due to invalid IL or missing references) //IL_095f: Unknown result type (might be due to invalid IL or missing references) //IL_0964: Unknown result type (might be due to invalid IL or missing references) //IL_096e: Expected O, but got Unknown //IL_0985: Unknown result type (might be due to invalid IL or missing references) //IL_098f: Expected O, but got Unknown //IL_09aa: Unknown result type (might be due to invalid IL or missing references) //IL_09b4: Unknown result type (might be due to invalid IL or missing references) //IL_0a1d: Unknown result type (might be due to invalid IL or missing references) //IL_0a33: Unknown result type (might be due to invalid IL or missing references) //IL_0a49: Unknown result type (might be due to invalid IL or missing references) //IL_0a5f: Unknown result type (might be due to invalid IL or missing references) //IL_0aa1: Unknown result type (might be due to invalid IL or missing references) //IL_0aa6: Unknown result type (might be due to invalid IL or missing references) //IL_0ab8: Unknown result type (might be due to invalid IL or missing references) //IL_0abd: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <beamStartColor>5__1 = new Color32((byte)0, (byte)77, byte.MaxValue, byte.MaxValue); <beamEndColor>5__2 = new Color32(byte.MaxValue, (byte)191, (byte)0, byte.MaxValue); <sphereFillColor>5__3 = new Color32(byte.MaxValue, (byte)165, (byte)0, byte.MaxValue); <sphereOutlineColor>5__4 = new Color32((byte)158, (byte)93, (byte)0, byte.MaxValue); <smallSphereFillColor>5__5 = new Color32((byte)0, (byte)42, byte.MaxValue, byte.MaxValue); tempestSphereDefault = PrefabAPI.InstantiateClone(assets.LoadAsset<GameObject>("TempestSphereProjectile.prefab"), "Tempest Sphere Projectile Default"); ContentAddition.AddProjectile(tempestSphereDefault); <sphereVFX>5__6 = new GameObject("Tempest Sphere VFX Holder Default"); <sphereVFX>5__6.transform.position = Vector3.zero; <sphereVFX>5__6.transform.localPosition = Vector3.zero; <tempestSphereIndicator>5__7 = PrefabAPI.InstantiateClone(GameObject.VagrantNovaAreaIndicator, "Tempest Sphere Indicator Default", false); ((Component)<tempestSphereIndicator>5__7.transform.Find("Particle System")).gameObject.SetActive(false); <pointLight>5__8 = ((Component)<tempestSphereIndicator>5__7.transform.Find("Point Light")).GetComponent<Light>(); <pointLight>5__8.color = Color32.op_Implicit(<sphereOutlineColor>5__4); <pointLight>5__8.intensity = 100f; ((Behaviour)((Component)<pointLight>5__8).GetComponent<LightIntensityCurve>()).enabled = false; ((Behaviour)((Component)<pointLight>5__8).GetComponent<LightScaleFromParent>()).enabled = false; <pointLight>5__8.range = 20f; <newSphereFillMaterial>5__9 = new Material(Material.matWarbannerSphereIndicator); <newSphereFillMaterial>5__9.SetTexture("_RemapTex", (Texture)(object)Texture2D.texRampTritone); <newSphereFillMaterial>5__9.SetColor("_TintColor", Color32.op_Implicit(<sphereFillColor>5__3)); <newSphereFillMaterial>5__9.SetFloat("_InvFade", 30f); <newSphereFillMaterial>5__9.SetFloat("_SoftPower", 0.1f); <newSphereFillMaterial>5__9.SetFloat("_Boost", 3f); <newSphereFillMaterial>5__9.SetFloat("_RimPower", 17f); <newSphereFillMaterial>5__9.SetFloat("_RimStrength", 5f); <newSphereFillMaterial>5__9.SetFloat("_AlphaBoost", 20f); <newSphereFillMaterial>5__9.SetFloat("_IntersectionStrength", 1.223287f); <newSphereOutlineMaterial>5__10 = new Material(Material.matLightningSphere); <newSphereOutlineMaterial>5__10.SetTexture("_RemapTex", (Texture)(object)Texture2D.texRampTritone3); <newSphereOutlineMaterial>5__10.SetTexture("_Cloud1Tex", (Texture)(object)Texture2D.texCloudLightning1); <newSphereOutlineMaterial>5__10.SetTexture("_Cloud2Tex", (Texture)null); <newSphereOutlineMaterial>5__10.SetColor("_TintColor", Color32.op_Implicit(<sphereOutlineColor>5__4)); <newSphereOutlineMaterial>5__10.SetFloat("_InvFade", 3f); <newSphereOutlineMaterial>5__10.SetFloat("_SoftPower", 0.85f); <newSphereOutlineMaterial>5__10.SetFloat("_Boost", 1.5f); <newSphereOutlineMaterial>5__10.SetFloat("_RimPower", 0.1f); <newSphereOutlineMaterial>5__10.SetFloat("_RimStrength", 0.052f); <newSphereOutlineMaterial>5__10.SetFloat("_AlphaBoost", 1f); <newSphereOutlineMaterial>5__10.SetFloat("_IntersectionStrength", 6.4f); <newTempestSphereMaterials>5__11 = (Material[])(object)new Material[2] { <newSphereFillMaterial>5__9, <newSphereOutlineMaterial>5__10 }; ((Renderer)<tempestSphereIndicator>5__7.GetComponent<MeshRenderer>()).sharedMaterials = <newTempestSphereMaterials>5__11; <tempestSphereIndicator>5__7.RemoveComponent<ObjectScaleCurve>(); <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; case 1: <>1__state = -1; <tempestSphereIndicator>5__7.transform.localScale = new Vector3(14f, 14f, 14f); <tempestSphereIndicator>5__7.RemoveComponent<AnimateShaderAlpha>(); <newOrbCoreOutlineMaterial>5__12 = new Material(Material.matLoaderLightningTile); <newOrbCoreOutlineMaterial>5__12.SetTexture("_RemapTex", (Texture)(object)Texture2D.texRampTritone3); <newOrbCoreOutlineMaterial>5__12.SetColor("_TintColor", Color32.op_Implicit(<sphereFillColor>5__3)); <newOrbCoreOutlineMaterial>5__12.SetFloat("_InvFade", 1.3f); <newOrbCoreOutlineMaterial>5__12.SetFloat("_Boost", 4f); <newOrbCoreOutlineMaterial>5__12.SetFloat("_AlphaBoost", 3.67f); <newOrbCoreOutlineMaterial>5__12.SetFloat("_AlphaBias", 0f); <newOrbCoreFillMaterial>5__13 = new Material(Material.matJellyfishLightningSphere); <newOrbCoreFillMaterial>5__13.SetTexture("_RemapTex", (Texture)(object)Texture2D.texRampTritone3); <newOrbCoreFillMaterial>5__13.SetColor("_TintColor", Color32.op_Implicit(<smallSphereFillColor>5__5)); <newOrbCoreFillMaterial>5__13.SetFloat("_InvFade", 0.8f); <newOrbCoreFillMaterial>5__13.SetFloat("_SoftPower", 1f); <newOrbCoreFillMaterial>5__13.SetFloat("_Boost", 1.86f); <newOrbCoreFillMaterial>5__13.SetFloat("_RimPower", 1.5f); <newOrbCoreFillMaterial>5__13.SetFloat("_RimStrength", 0.7f); <newOrbCoreFillMaterial>5__13.SetFloat("_AlphaBoost", 6f); <newOrbCoreFillMaterial>5__13.SetFloat("_AlphaBias", 2f); <newOrbCoreMaterials>5__14 = (Material[])(object)new Material[2] { <newOrbCoreOutlineMaterial>5__12, <newOrbCoreFillMaterial>5__13 }; <tempestOrb>5__15 = PrefabAPI.InstantiateClone(GameObject.VoidSurvivorChargeMegaBlaster, "Tempest Sphere Orb Default", false); ((Component)<tempestOrb>5__15.transform.Find("Base")).gameObject.SetActive(false); ((Component)<tempestOrb>5__15.transform.Find("Base (1)")).gameObject.SetActive(false); <tempestOrbPointLight>5__16 = <tempestOrb>5__15.transform.Find("Point light"); ((Behaviour)((Component)<tempestOrbPointLight>5__16).GetComponent<FlickerLight>()).enabled = false; ((Behaviour)((Component)<tempestOrbPointLight>5__16).GetComponent<LightIntensityCurve>()).enabled = false; <tempestOrbPointLightLight>5__17 = ((Component)<tempestOrbPointLight>5__16).GetComponent<Light>(); ((Behaviour)<tempestOrbPointLightLight>5__17).enabled = false; <sparksIn>5__18 = ((Component)<tempestOrb>5__15.transform.Find("Sparks, In")).gameObject; <sparksMisc>5__19 = ((Component)<tempestOrb>5__15.transform.Find("Sparks, Misc")).gameObject; <sparksIn>5__18.transform.localScale = Vector3.one * 2f; <sparksInEmission>5__20 = <sparksIn>5__18.GetComponent<ParticleSystem>().emission; <sparksInRateOverTime>5__21 = ((EmissionModule)(ref <sparksInEmission>5__20)).rateOverTime; ((MinMaxCurve)(ref <sparksInRateOverTime>5__21)).curveMultiplier = 2f; <sparksInMaterial>5__22 = new Material(Material.matLoaderCharging); <sparksInMaterial>5__22.SetFloat("_Boost", 15f); <sparksInMaterial>5__22.SetFloat("_AlphaBoost", 20f); <sparksInMaterial>5__22.SetFloat("_AlphaBias", 1f); ((Renderer)<sparksIn>5__18.GetComponent<ParticleSystemRenderer>()).sharedMaterial = <sparksInMaterial>5__22; ((Renderer)<sparksMisc>5__19.GetComponent<ParticleSystemRenderer>()).sharedMaterial = Material.matIceOrbCore; VFXUtils.RecolorMaterialsAndLights(<sparksIn>5__18, <beamStartColor>5__1, <beamStartColor>5__1, convertRampsToGrayscale: true); VFXUtils.RecolorMaterialsAndLights(<sparksMisc>5__19, <beamStartColor>5__1, <beamStartColor>5__1, convertRampsToGrayscale: true); <orbCore>5__23 = <tempestOrb>5__15.transform.Find("OrbCore"); <orbCore>5__23.localScale = Vector3.one * 0.5f; ((Renderer)((Component)<orbCore>5__23).GetComponent<MeshRenderer>()).sharedMaterials = <newOrbCoreMaterials>5__14; <rotateX>5__24 = ((Component)(object)<orbCore>5__23).AddComponent<RotateAroundAxis>(); <rotateX>5__24.speed = (Speed)2; <rotateX>5__24.slowRotationSpeed = 5f; <rotateX>5__24.fastRotationSpeed = 30f; <rotateX>5__24.rotateAroundAxis = (RotationAxis)0; <rotateX>5__24.relativeTo = (Space)1; <rotateX>5__24.reverse = false; <rotateY>5__25 = ((Component)(object)<orbCore>5__23).AddComponent<RotateAroundAxis>(); <rotateY>5__25.speed = (Speed)2; <rotateY>5__25.slowRotationSpeed = 5f; <rotateY>5__25.fastRotationSpeed = 45f; <rotateY>5__25.rotateAroundAxis = (RotationAxis)1; <rotateY>5__25.relativeTo = (Space)1; <rotateY>5__25.reverse = false; <objectScaleCurve>5__26 = ((Component)(object)<orbCore>5__23).AddComponent<ObjectScaleCurve>(); <objectScaleCurve>5__26.useOverallCurveOnly = true; <objectScaleCurve>5__26.timeMax = 10f; <objectScaleCurve>5__26.overallCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, 0.5f), new Keyframe(0.03f, 1f), new Keyframe(1f, 4.19f) }); ((Component)(object)<tempestOrb>5__15.transform).RemoveComponent<ObjectScaleCurve>(); <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 2; return true; case 2: <>1__state = -1; <tempestOrb>5__15.transform.localScale = Vector3.one * 3f; <tempestSphereIndicator>5__7.transform.parent = <sphereVFX>5__6.transform; <tempestOrb>5__15.transform.parent = <sphereVFX>5__6.transform; <sphereVFX>5__6.transform.SetParent(tempestSphereDefault.transform); <tempestSphereIndicator>5__7.transform.position = Vector3.zero; <tempestSphereIndicator>5__7.transform.localPosition = Vector3.zero; <tempestOrb>5__15.transform.position = Vector3.zero; <tempestOrb>5__15.transform.localPosition = Vector3.zero; <lineRenderer>5__27 = ((Component)tempestSphereDefault.transform.Find("LR")).GetComponent<LineRenderer>(); <lineRenderer>5__27.endWidth = 0.5f; <lineRenderer>5__27.startColor = Color32.op_Implicit(<beamStartColor>5__1); <lineRenderer>5__27.endColor = Color32.op_Implicit(<beamEndColor>5__2); ((Renderer)<lineRenderer>5__27).material = lineRendererBase; <detachAndCollapse>5__28 = tempestSphereDefault.AddComponent<DetachAndCollapse>(); <detachAndCollapse>5__28.collapseTime = 0.4f; <detachAndCollapse>5__28.target = <sphereVFX>5__6.transform; return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public const string ModGuid = "com.TeamSandswept.Sandswept"; public const string ModName = "Sandswept"; public const string ModVersion = "1.4.0"; public static AssetBundle mainAssets; public static AssetBundle assets; public static AssetBundle prodAssets; public static AssetBundle hifuSandswept; public static AssetBundle sandsweptHIFU; public static AssetBundle dgoslingAssets; public static ModdedDamageType eclipseSelfDamage = DamageAPI.ReserveDamageType(); public static ExpansionDef SOTV; public static ExpansionDef SandsweptExpansionDef; public static List<ArtifactBase> Artifacts = new List<ArtifactBase>(); public static List<ItemBase> AllItems = new List<ItemBase>(); public static List<ItemBase> EnabledItems = new List<ItemBase>(); public static List<EquipmentBase> AllEquipment = new List<EquipmentBase>(); public static List<EquipmentBase> EnabledEquipment = new List<EquipmentBase>(); public static List<BuffBase> Buffs = new List<BuffBase>(); public static List<EliteEquipmentBase> EliteEquipments = new List<EliteEquipmentBase>(); public static List<UnlockableDef> Unlocks = new List<UnlockableDef>(); public static List<GameObject> EffectPrefabs = new List<GameObject>(); public static Dictionary<BuffBase, bool> BuffStatusDictionary = new Dictionary<BuffBase, bool>(); public static ManualLogSource ModLogger; public static ConfigFile config; public static ConfigFile backupConfig; public static Main Instance; public static bool LookingGlassLoaded = false; public static bool ProcSolverLoaded = false; public static bool AttackDirectionFixLoaded = false; private static string rangerBoneMapperName; public static MPInput input; internal static List<DroneDef> droneDefs = new List<DroneDef>(); public static GameObject tempestSphereDefault; public static GameObject tempestSphereCovenant; public static bool ran = true; public static ConfigEntry<bool> enableLogging { get; set; } public ConfigEntry<bool> enableAutoConfig { get; private set; } public ConfigEntry<string> latestVersion { get; private set; } public static ConfigEntry<bool> cursedConfig { get; private set; } public static ConfigEntry<bool> enableUnfinishedContent { get; private set; } public static Material lineRendererBase => CreateLineRenderer(); public static event Action onInputAvailable; private void Awake() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown Instance = this; Stopwatch stopwatch = Stopwatch.StartNew(); DroneCatalog.SetDroneDefs += new hook_SetDroneDefs(OnSetDroneDefs); LookingGlassLoaded = Chainloader.PluginInfos.ContainsKey("droppod.lookingglass"); ProcSolverLoaded = Chainloader.PluginInfos.ContainsKey("com.RiskOfBrainrot.ProcSolver"); AttackDirectionFixLoaded = Chainloader.PluginInfos.ContainsKey("Gorakh.AttackDirectionFix"); SOTV = ExpansionDef.DLC1; ModLogger = ((BaseUnityPlugin)this).Logger; NetworkingUtils.RegisterMessages(); SetUpConfig(); SetUpAssets(); SetUpContent(); SetUpHooks(); ModLogger.LogDebug((object)"#SANDSWEEP"); ModLogger.LogDebug((object)("Initialized mod in " + stopwatch.ElapsedMilliseconds + "ms")); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, (Action)delegate { input = GameObject.Find("MPEventSystem Player0").GetComponent<MPInput>(); Main.onInputAvailable?.Invoke(); }); } private void OnSetDroneDefs(orig_SetDroneDefs orig, DroneDef[] newDroneDefs) { foreach (DroneDef droneDef in droneDefs) { DroneDef current = droneDef; ArrayUtils.ArrayAppend<DroneDef>(ref newDroneDefs, ref current); } orig.Invoke(newDroneDefs); } public void SetUpConfig() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown config = ((BaseUnityPlugin)this).Config; backupConfig = new ConfigFile(Paths.ConfigPath + "\\com.TeamSandswept.Sandswept.Backup.cfg", true); backupConfig.Bind<string>(": DO NOT MODIFY THIS FILES CONTENTS :", ": DO NOT MODIFY THIS FILES CONTENTS :", ": DO NOT MODIFY THIS FILES CONTENTS :", ": DO NOT MODIFY THIS FILES CONTENTS :"); enableAutoConfig = config.Bind<bool>("Config", "Enable Auto Config Sync", true, "Disabling this would stop Sandswept from syncing config whenever a new version is found."); bool flag = !((Dictionary<ConfigDefinition, string>)AccessTools.DeclaredPropertyGetter(typeof(ConfigFile), "OrphanedEntries").Invoke(config, null)).Keys.Any((ConfigDefinition x) => x.Key == "Latest Version"); latestVersion = config.Bind<string>("Config", "Latest Version", "1.4.0", "DO NOT CHANGE THIS"); cursedConfig = config.Bind<bool>("Config", "Enable Cursed Config?", false, "just dumb shit"); enableUnfinishedContent = config.Bind<bool>("Config", "Enable Unfinished Content?", false, "Enables some disabled content that (supposedly) works but is missing assets."); if (enableAutoConfig.Value && (flag || latestVersion.Value != "1.4.0")) { latestVersion.Value = "1.4.0"; ConfigManager.VersionChanged = true; ModLogger.LogInfo((object)"Config Autosync Enabled."); } AutoRunCollector.HandleAutoRun(); ConfigManager.HandleConfigAttributes(Assembly.GetExecutingAssembly(), ((BaseUnityPlugin)this).Config); } public void SetUpAssets() { assets = LoadAssetBundle("sandsweptassets2"); prodAssets = LoadAssetBundle("sandsweep3"); hifuSandswept = LoadAssetBundle("hifusandswept"); sandsweptHIFU = LoadAssetBundle("sandswepthifu"); dgoslingAssets = LoadAssetBundle("dgoslingstuff"); using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Sandswept.sandsweptassets")) { mainAssets = AssetBundle.LoadFromStream(stream); } SwapShaders(mainAssets); SwapShaders(assets); SwapShaders(prodAssets); SwapShaders(hifuSandswept); SwapShaders(sandsweptHIFU); SwapShaders(dgoslingAssets); } public void SetUpContent() { Decay.Init(); GenerateExpansionDef(); DamageColourHelper.Init(); SpawnAndDeath.Init(); IEnumerable<Type> enumerable = from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(ArtifactBase)) select type; foreach (Type item2 in enumerable) { ArtifactBase artifactBase = (ArtifactBase)Activator.CreateInstance(item2); if (LoadArtifact(artifactBase, Artifacts)) { artifactBase.Init(((BaseUnityPlugin)this).Config); } } IEnumerable<Type> enumerable2 = from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(ItemBase)) select type; foreach (Type item3 in enumerable2) { ItemBase item = (ItemBase)Activator.CreateInstance(item3); AllItems.Add(item); } foreach (ItemBase allItem in AllItems) { if (LoadItem(allItem, new List<ItemBase>())) { EnabledItems.Add(allItem); allItem.Init(); } } IEnumerable<Type> enumerable3 = from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(EquipmentBase)) select type; foreach (Type item4 in enumerable3) { EquipmentBase equipmentBase = (EquipmentBase)Activator.CreateInstance(item4); if (LoadEquipment(equipmentBase, AllEquipment)) { EnabledEquipment.Add(equipmentBase); equipmentBase.Init(); } } IEnumerable<Type> enumerable4 = from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(EliteEquipmentBase)) select type; foreach (Type item5 in enumerable4) { EliteEquipmentBase eliteEquipmentBase = (EliteEquipmentBase)Activator.CreateInstance(item5); if (LoadEliteEquipment(eliteEquipmentBase, EliteEquipments)) { eliteEquipmentBase.Init(); } } IEnumerable<Type> enumerable5 = from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(BuffBase)) select type; foreach (Type item6 in enumerable5) { BuffBase buffBase = (BuffBase)Activator.CreateInstance(item6); if (LoadBuff(buffBase, Buffs)) { buffBase.Init(); } } ScanTypes(delegate(SkillBase x) { x.Init(); }); ScanTypes(delegate(SurvivorBase x) { x.Initialize(); }); if (SurvivorBase.DefaultEnabledCallback(SurvivorBase<Sandswept.Survivors.Ranger.Ranger>.instance) || SurvivorBase.DefaultEnabledCallback(SurvivorBase<Electrician>.instance)) { SelfDamageHook.Init(); } if (SurvivorBase.DefaultEnabledCallback(SurvivorBase<Sandswept.Survivors.Ranger.Ranger>.instance)) { Keywords.SetupKeywords(); } Initialize.Init(); ScanTypes(delegate(EnemyBase x) { x.Create(); }); ScanTypes(delegate(InteractableBase x) { if (LoadInteractable(x, new List<InteractableBase>())) { x.Init(); } }); ScanTypes(delegate(DroneBase x) { x.Initialize(); }); ScanTypesNoInstance<EntityState>(delegate(Type x) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) bool flag = default(bool); ContentAddition.AddEntityState(x, ref flag); }); CorruptItems(); new ContentPacks().Initialize(); CursedConfig.Init(); SwepSwepTheSandy.Init(); NetworkingAPI.RegisterMessageType<CallNetworkedMethod>(); } public void SetUpHooks() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown SandsweptTemporaryEffects.ApplyHooks(); RoR2Content.Init += new hook_Init(OnWwiseInit); DeathState.OnImpactServer += new Manipulator(DroneDropFix); SurvivorCatalog.Init += new hook_Init(OnSurvivorCatalogFinished); } private void OnSurvivorCatalogFinished(orig_Init orig) { orig.Invoke(); if (Chainloader.PluginInfos.ContainsKey("com.weliveinasociety.CustomEmotesAPI") && SurvivorBase.DefaultEnabledCallback(SurvivorBase<Sandswept.Survivors.Ranger.Ranger>.instance)) { AddRangerEmotes(); } } public AssetBundle LoadAssetBundle(string assetBundleName) { return AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)Instance).Info.Location), assetBundleName)); } private static SpawnCard GetDroneCard(string str) { if (!(str == "SpawnCards/InteractableSpawnCard/iscBrokenInfernoDrone")) { if (str == "SpawnCards/InteractableSpawnCard/iscBrokenVoltaicDrone") { return (SpawnCard)(object)DroneBase<VoltaicDrone>.Instance.iscBroken; } return LegacyResourcesAPI.Load<SpawnCard>(str); } return (SpawnCard)(object)DroneBase<InfernoDrone>.Instance.iscBroken; } private void OnWwiseInit(orig_Init orig) { //IL_002d: 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_0047: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(); string text = typeof(Main).Assembly.Location.Replace("Sandswept.dll", ""); AkSoundEngine.AddBasePath(text); uint num = default(uint); AkSoundEngine.LoadBank("initsoundswept", ref num); AkSoundEngine.LoadBank("soundswept", ref num); } public void GenerateExpansionDef() { SandsweptExpansionDef = dgoslingAssets.LoadAsset<ExpansionDef>("SandSweptExpDef"); SandsweptExpansionDef.nameToken.Add("Sandswept"); SandsweptExpansionDef.descriptionToken.Add("Adds content from the 'Sandswept' expansion to the game <3. Have fun <3."); SandsweptExpansionDef.disabledIconSprite = hifuSandswept.LoadAsset<Sprite>("texUnlockIcon.png"); ContentAddition.AddExpansionDef(SandsweptExpansionDef); } internal static void ScanTypes<T>(Action<T> action) { IEnumerable<Type> enumerable = from x in Assembly.GetExecutingAssembly().GetTypes() where !x.IsAbstract && x.IsSubclassOf(typeof(T)) select x; foreach (Type item in enumerable) { T obj = (T)Activator.CreateInstance(item); action(obj); } } internal static void ScanTypesNoInstance<T>(Action<Type> action) { IEnumerable<Type> enumerable = from x in Assembly.GetExecutingAssembly().GetTypes() where !x.IsAbstract && x.IsSubclassOf(typeof(T)) select x; foreach (Type item in enumerable) { action(item); } } public bool LoadArtifact(ArtifactBase artifact, List<ArtifactBase> artifactList) { bool flag = ArtifactBase.DefaultEnabledCallback(artifact); if (flag) { artifactList.Add(artifact); } return flag; } public bool LoadItem(ItemBase item, List<ItemBase> itemList) { bool flag = ItemBase.DefaultEnabledCallback(item); if (flag) { itemList.Add(item); } return flag; } public bool LoadEquipment(EquipmentBase equipment, List<EquipmentBase> equipmentList) { if (EquipmentBase.DefaultEnabledCallback(equipment)) { equipmentList.Add(equipment); return true; } return false; } public bool LoadEliteEquipment(EliteEquipmentBase eliteEquipment, List<EliteEquipmentBase> eliteEquipmentList) { if (EliteEquipmentBase.DefaultEnabledCallback(eliteEquipment)) { eliteEquipmentList.Add(eliteEquipment); return true; } return false; } public bool LoadBuff(BuffBase buff, List<BuffBase> buffList) { BuffStatusDictionary.Add(buff, value: true); buffList.Add(buff); return true; } public bool LoadInteractable(InteractableBase interactable, List<InteractableBase> interactableList) { if (InteractableBase.DefaultEnabledCallback(interactable)) { interactableList.Add(interactable); return true; } return false; } public void SwapShaders(AssetBundle bundle) { Material[] array = bundle.LoadAllAssets<Material>(); Material[] array2 = array; foreach (Material val in array2) { switch (((Object)val.shader).name) { case "Hopoo Games/FX/Cloud Remap": val.shader = Shader.HopooGamesFXCloudRemap; break; case "Stubbed Hopoo Games/Deferred/Standard": val.shader = Resources.Load<Shader>("shaders/deferred/hgstandard"); break; case "StubbedShader/deferred/hgstandard": val.shader = Shader.HopooGamesDeferredStandard; break; case "StubbedShader/fx/hgintersectioncloudremap": val.shader = Resources.Load<Shader>("shaders/fx/hgintersectioncloudremap"); break; case "Stubbed Hopoo Games/Deferred/Snow Topped": val.shader = Resources.Load<Shader>("shaders/deferred/hgsnowtopped"); break; case "Stubbed Hopoo Games/FX/Cloud Remap": val.shader = Resources.Load<Shader>("shaders/fx/hgcloudremap"); break; case "Stubbed Hopoo Games/FX/Cloud Intersection Remap": val.shader = Resources.Load<Shader>("shaders/fx/hgintersectioncloudremap"); break; case "Stubbed Hopoo Games/FX/Opaque Cloud Remap": val.shader = Resources.Load<Shader>("shaders/fx/hgopaquecloudremap"); break; case "Stubbed Hopoo Games/FX/Distortion": val.shader = Resources.Load<Shader>("shaders/fx/hgdistortion"); break; case "Stubbed Hopoo Games/FX/Solid Parallax": val.shader = Resources.Load<Shader>("shaders/fx/hgsolidparallax"); break; case "Stubbed Hopoo Games/Environment/Distant Water": val.shader = Resources.Load<Shader>("shaders/environment/hgdistantwater"); break; case "StubbedRoR2/Base/Shaders/HGStandard": val.shader = LegacyShaderAPI.Find("Hopoo Games/Deferred/Standard"); break; case "StubbedRoR2/Base/Shaders/HGCloudRemap": val.shader = Shader.HopooGamesFXCloudRemap; break; case "StubbedRoR2/Base/Shaders/HGIntersectionCloudRemap": val.shader = LegacyShaderAPI.Find("Hopoo Games/FX/Cloud Intersection Remap"); break; case "StubbedDecalicious/Decalicious/DeferredDecal": val.shader = Shader.DecaliciousDeferredDecal; break; } } } private void CorruptItems() { //IL_007f: 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_0099: 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) ItemRelationshipProvider val = ScriptableObject.CreateInstance<ItemRelationshipProvider>(); ((Object)val).name = "SANDSWEPT_VOID_ITEM_RELATIONSHIP_PROVIDER"; val.relationshipType = ItemRelationshipType.ContagiousItem; List<Pair> list = new List<Pair>(); for (int num = EnabledItems.Count - 1; num >= 0; num--) { ItemBase itemBase = AllItems[num]; ItemDef itemDef = itemBase.ItemDef; ItemDef itemToCorrupt = itemBase.ItemToCorrupt; if (!((Object)(object)itemToCorrupt == (Object)null) && ItemBase.DefaultEnabledCallback(itemBase)) { itemDef.unlockableDef = itemToCorrupt.unlockableDef; Pair val2 = default(Pair); val2.itemDef2 = itemDef; val2.itemDef1 = itemToCorrupt; Pair item = val2; list.Add(item); } } val.relationships = list.ToArray(); ContentAddition.AddItemRelationshipProvider(val); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void AddRangerEmotes() { //IL_0051: 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: Expected O, but got Unknown GameObject val = dgoslingAssets.LoadAsset<GameObject>("mdlRangerEmote"); CustomEmotesAPI.ImportArmature(SurvivorBase<Sandswept.Survivors.Ranger.Ranger>.instance.Body, val, 0, true); BoneMapper componentInChildren = val.GetComponentInChildren<BoneMapper>(); componentInChildren.scale = 0.9f; rangerBoneMapperName = ((Object)componentInChildren).name; object obj = <>O.<0>__RangerEmotesFix; if (obj == null) { AnimationChanged val2 = RangerEmotesFix; <>O.<0>__RangerEmotesFix = val2; obj = (object)val2; } CustomEmotesAPI.animChanged += (AnimationChanged)obj; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void RangerEmotesFix(string newAnimation, BoneMapper mapper) { if (((Object)mapper).name == rangerBoneMapperName) { GameObject gameObject = ((Component)((Component)mapper).transform.parent.Find("Gun")).gameObject; if (newAnimation != "none") { gameObject.SetActive(false); } else { gameObject.SetActive(true); } } } private void DroneDropFix(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 1) }); val.Prev.Operand = typeof(Main).GetMethod("GetDroneCard", BindingFlags.Static | BindingFlags.NonPublic); } public static float GetProcRateForTotalDamageProc(DamageInfo damageInfo) { if (!ProcSolverLoaded) { return damageInfo.procCoefficient; } return _GetProcRate(damageInfo); } public static float GetProcRateForBaseDamageProc(DamageInfo damageInfo) { if (!ProcSolverLoaded) { return 1f; } return _GetProcRate(damageInfo); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static float _GetProcRate(DamageInfo damageInfo) { return ProcSolverPlugin.GetProcRateMod(damageInfo); } public void FixedUpdate() { if (!ran) { ((MonoBehaviour)this).StartCoroutine(CreateDefaultPrefab()); ((MonoBehaviour)this).StartCoroutine(CreateCovenantPrefab()); ran = true; } } [IteratorStateMachine(typeof(<CreateDefaultPrefab>d__86))] public IEnumerator CreateDefaultPrefab() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <CreateDefaultPrefab>d__86(0) { <>4__this = this }; } [IteratorStateMachine(typeof(<CreateCovenantPrefab>d__89))] public IEnumerator CreateCovenantPrefab() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <CreateCovenantPrefab>d__89(0) { <>4__this = this }; } public static Material CreateLineRenderer() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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_00fe: Unknown result type (might be due to invalid IL or missing references) Material val = new Material(Material.matLightningLongYellow); val.SetTexture("_RemapTex", (Texture)(object)Texture2D.texRampTritoneHShrine); val.SetTexture("_Cloud1Tex", (Texture)null); val.SetTexture("_Cloud2Tex", (Texture)null); val.SetColor("_TintColor", Color.white); val.SetFloat("_InvFade", 1f); val.SetFloat("_Boost", 2f); val.SetFloat("_AlphaBoost", 1f); val.SetTextureScale("_MainTex", new Vector2(0.02f, 1f)); val.SetTextureOffset("_MainTex", Vector2.zero); val.SetFloat("_AlphaBias", 0.1f); val.SetTexture("_Cloud1Tex", (Texture)(object)Texture2D.texCloudLightning1); val.SetTextureScale("_Cloud1Tex", new Vector2(0.2f, 1f)); val.SetColor("_CutoffScroll", new Color(50f, 25f, 180f, 0f)); return val; } } public class SandsweptTemporaryEffects : MonoBehaviour { [CompilerGenerated] private static class <>O { public static hook_UpdateAllTemporaryVisualEffects <0>__OnUpdateVisualEffects; } public TemporaryVisualEffect makeshiftPlate; public void UpdateTemporaryEffects(CharacterBody body) { body.UpdateSingleTemporaryVisualEffect(ref makeshiftPlate, MakeshiftPlate.platingOverlayPrefab, MathHelpers.BestBestFitRadius(body), Object.op_Implicit((Object)(object)((Component)body).GetComponent<MakeshiftPlate.PlatingManager>()) && ((Component)body).GetComponent<MakeshiftPlate.PlatingManager>().CurrentPlating > 0f && Object.op_Implicit((Object)(object)body.inventory) && body.inventory.GetItemCount(ItemBase<MakeshiftPlate>.instance.ItemDef) > 0, ""); } internal static void ApplyHooks() { //IL_0011: 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: Expected O, but got Unknown object obj = <>O.<0>__OnUpdateVisualEffects; if (obj == null) { hook_UpdateAllTemporaryVisualEffects val = OnUpdateVisualEffects; <>O.<0>__OnUpdateVisualEffects = val; obj = (object)val; } CharacterBody.UpdateAllTemporaryVisualEffects += (hook_UpdateAllTemporaryVisualEffects)obj; } private static void OnUpdateVisualEffects(orig_UpdateAllTemporaryVisualEffects orig, CharacterBody self) { orig.Invoke(self); if ((Object)(object)self != (Object)null) { SandsweptTemporaryEffects sandsweptTemporaryEffects = UnityObjectExtensions.EnsureComponent<SandsweptTemporaryEffects>((Component)(object)self); sandsweptTemporaryEffects.UpdateTemporaryEffects(self); } } } [AttributeUsage(AttributeTargets.Field, AllowMultiple = false)] public class ConfigFieldAttribute : SearchableAttribute { public string name; public string desc; public object defaultValue; public ConfigFieldAttribute(string name, string desc, object defaultValue) { this.name = name; this.desc = desc; this.defaultValue = defaultValue; } } [AttributeUsage(AttributeTargets.Class)] public class ConfigSectionAttribute : Attribute { public string name; public ConfigSectionAttribute(string name) { this.name = name; } } public class ConfigManager { internal static bool ConfigChanged; internal static bool VersionChanged; public static void HandleConfigAttributes(Assembly assembly, ConfigFile config) { //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Expected O, but got Unknown //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Expected O, but got Unknown //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Expected O, but got Unknown //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Expected O, but got Unknown //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Expected O, but got Unknown //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Expected O, but got Unknown Type[] types = assembly.GetTypes(); foreach (Type type in types) { TypeInfo typeInfo = type.GetTypeInfo(); ConfigSectionAttribute customAttribute = typeInfo.GetCustomAttribute<ConfigSectionAttribute>(); if (customAttribute == null) { continue; } FieldInfo[] fields = typeInfo.GetFields(); foreach (FieldInfo fieldInfo in fields) { if (!fieldInfo.IsStatic) { continue; } Type fieldType = fieldInfo.FieldType; ConfigFieldAttribute customAttribute2 = ((MemberInfo)fieldInfo).GetCustomAttribute<ConfigFieldAttribute>(); if (customAttribute2 != null) { MethodInfo methodInfo = (from x in typeof(ConfigFile).GetMethods() where x.Name == "Bind" select x).First(); methodInfo = methodInfo.MakeGenericMethod(fieldType); ConfigEntryBase val = (ConfigEntryBase)methodInfo.Invoke(config, new object[3] { (object)new ConfigDefinition(customAttribute.name, customAttribute2.name), customAttribute2.defaultValue, (object)new ConfigDescription(customAttribute2.desc, (AcceptableValueBase)null, Array.Empty<object>()) }); ConfigEntryBase val2 = (ConfigEntryBase)methodInfo.Invoke(Main.backupConfig, new object[3] { (object)new ConfigDefinition(Regex.Replace(config.ConfigFilePath, "\\W", "") + " : " + customAttribute.name, customAttribute2.name), val.DefaultValue, (object)new ConfigDescription(customAttribute2.desc, (AcceptableValueBase)null, Array.Empty<object>()) }); if (!ConfigEqual(val2.DefaultValue, val2.BoxedValue) && VersionChanged) { val.BoxedValue = val.DefaultValue; val2.BoxedValue = val2.DefaultValue; } if (!ConfigEqual(val.DefaultValue, val.BoxedValue)) { ConfigChanged = true; } fieldInfo.SetValue(null, val.BoxedValue); } } } } private static bool ConfigEqual(object a, object b) { if (a.Equals(b)) { return true; } if (float.TryParse(a.ToString(), out var result) && float.TryParse(b.ToString(), out var result2) && (double)Mathf.Abs(result - result2) < 0.0001) { return true; } return false; } } } namespace Sandswept.Utils { public class BasicLaserBeam { public float DamageCoefficient; public CharacterBody Owner; public Transform TargetMuzzle; private LineRenderer lr; public GameObject effectInstance; private bool firing = false; private float stopwatch = 0f; private float growthStopwatch = 0f; private float delay; private BasicLaserInfo info; private Transform origin; private Transform end; private Vector3 targetEndpoint; private float origWidth = 0f; public bool Active => firing; public BasicLaserBeam(CharacterBody owner, Transform muzzle, BasicLaserInfo info) { //IL_0070: 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) //IL_010f: 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_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) this.info = info; delay = 1f / info.TickRate; TargetMuzzle = muzzle; DamageCoefficient = info.DamageCoefficient * delay; effectInstance = Object.Instantiate<GameObject>(info.EffectPrefab, ((Component)muzzle).transform.position, Quaternion.identity); growthStopwatch = info.ChargeDelay; origin = (info.OriginIsBase ? effectInstance.transform : effectInstance.GetComponent<ChildLocator>().FindChild(info.OriginName)); end = effectInstance.GetComponent<ChildLocator>().FindChild(info.EndpointName); lr = effectInstance.GetComponent<DetachLineRendererAndFade>().line; origWidth = lr.widthMultiplier; Owner = owner; targetEndpoint = GetEndpoint(out var _); ((Component)end).transform.position = targetEndpoint; ((Component)origin).transform.position = ((Component)TargetMuzzle).transform.position; } public void Fire() { if (Object.op_Implicit((Object)(object)info.FiringMaterial)) { ((Renderer)lr).material = info.FiringMaterial; } lr.widthMultiplier = origWidth * info.FiringWidthMultiplier; firing = true; stopwatch = 0f; } public void UpdateVisual(float deltaTime) { //IL_0017: 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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) ((Component)origin).transform.position = ((Component)TargetMuzzle).transform.position; ((Component)end).transform.position = Vector3.MoveTowards(((Component)end).transform.position, targetEndpoint, 250f * deltaTime); } public void Update(float deltaTime) { //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_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_008e: 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_00a6: Expected O, but got Unknown stopwatch += deltaTime; if (stopwatch >= delay) { targetEndpoint = GetEndpoint(out var unmodified); stopwatch = 0f; if (firing && ((NetworkBehaviour)Owner).hasAuthority) { GetBulletAttack().Fire(); if (Object.op_Implicit((Object)(object)info.ImpactEffect)) { EffectManager.SpawnEffect(info.ImpactEffect, new EffectData { origin = unmodified, scale = 1f }, false); } } } if (!firing) { growthStopwatch -= deltaTime; lr.widthMultiplier = Mathf.Max(0f, growthStopwatch / info.ChargeDelay); } } public Vector3 GetEndpoint(out Vector3 unmodified) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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_0056: 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_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_005e: 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_0073: 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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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_00ae: 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_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: 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) Vector3 val = ((info.FiringMode == LaserFiringMode.TrackAim) ? Owner.inputBank.aimDirection : TargetMuzzle.forward); Vector3 val2 = ((info.FiringMode == LaserFiringMode.TrackAim) ? Owner.inputBank.aimOrigin : TargetMuzzle.position); Ray val3 = new Ray(val2, val); Vector3 point = ((Ray)(ref val3)).GetPoint(info.MaxRange); RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(val2, val, ref val4, info.MaxRange, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask))) { point = ((RaycastHit)(ref val4)).point; } unmodified = point; return point + val * 5f; } public BulletAttack GetBulletAttack() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0061: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) BulletAttack val = new BulletAttack(); val.radius = lr.startWidth * 0.75f; val.damage = Owner.damage * DamageCoefficient; val.origin = ((info.FiringMode == LaserFiringMode.TrackAim) ? Owner.inputBank.aimOrigin : TargetMuzzle.position); Vector3 val2 = ((Component)end).transform.position - TargetMuzzle.position; val.aimVector = ((Vector3)(ref val2)).normalized; val.procCoefficient = 1f; val.owner = ((Component)Owner).gameObject; val.falloffModel = (FalloffModel)0; val.isCrit = Util.CheckRoll(Owner.crit, Owner.master); val.stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask; return val; } public void Stop() { Object.Destroy((Object)(object)effectInstance); } } public class BasicLaserInfo { public GameObject EffectPrefab; public string OriginName = "Origin"; public string EndpointName = "End"; public bool OriginIsBase = true; public float TickRate = 20f; public float DamageCoefficient = 1f; public Material FiringMaterial; public float ChargeDelay = 0.5f; public float FiringWidthMultiplier = 2f; public LaserFiringMode FiringMode = LaserFiringMode.Straight; public float MaxRange = 60f; public GameObject ImpactEffect; } public enum LaserFiringMode { TrackAim, Straight } public class CoolerAntiGravityForce : MonoBehaviour { public float antiGravityCoefficient = -0.2f; public Func<float, float> lerpFunction = EaseInQuart; public float rampTime = 0.5f; private float stopwatch; private Rigidbody rb; public void Start() { rb = ((Component)this).GetComponent<Rigidbody>(); } public void FixedUpdate() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) stopwatch += Time.fixedDeltaTime; float num = lerpFunction(Mathf.Clamp(stopwatch, 0f, rampTime) / rampTime); rb.AddForce(-Physics.gravity * Mathf.Lerp(0f, antiGravityCoefficient, num), (ForceMode)5); } public static float EaseInQuad(float x) { return x * x; } public static float EaseInQuart(float x) { return x * x * x * x; } } public abstract class CoolerBasicMeleeAttack : BasicMeleeAttack { public abstract float BaseDuration { get; } public abstract float DamageCoefficient { get; } public abstract string HitboxName { get; } public abstract GameObject HitEffectPrefab { get; } public abstract float ProcCoefficient { get; } public abstract float HitPauseDuration { get; } public abstract GameObject SwingEffectPrefab { get; } public abstract string MuzzleString { get; } public virtual string MechanimHitboxParameter { get; } public virtual bool ScaleHitPauseDurationWithAttackSpeed { get; } = true; public virtual Func<bool> AlternateActiveParameter { get; } = () => true; public override void OnEnter() { base.baseDuration = BaseDuration; base.damageCoefficient = DamageCoefficient; base.hitBoxGroupName = HitboxName; base.hitEffectPrefab = HitEffectPrefab; base.procCoefficient = ProcCoefficient; base.hitPauseDuration = HitPauseDuration; base.swingEffectPrefab = SwingEffectPrefab; base.swingEffectMuzzleString = MuzzleString; if (MechanimHitboxParameter != null) { base.mecanimHitboxActiveParameter = MechanimHitboxParameter; } base.scaleHitPauseDurationAndVelocityWithAttackSpeed = ScaleHitPauseDurationWithAttackSpeed; ((BasicMeleeAttack)this).OnEnter(); } public override void FixedUpdate() { ((EntityState)this).fixedAge = ((EntityState)this).fixedAge + Time.fixedDeltaTime; if (string.IsNullOrEmpty(MechanimHitboxParameter) && AlternateActiveParameter()) { ((BasicMeleeAttack)this).BeginMeleeAttackEffect(); } else if (base.animator.GetFloat(MechanimHitboxParameter) >= 0.5f) { ((BasicMeleeAttack)this).BeginMeleeAttackEffect(); } if (((EntityState)this).isAuthority) { ((BasicMeleeAttack)this).AuthorityFixedUpdate(); } } } public class Projectile { public static void BlacklistAttackDirectionFix(GameObject projectile) { if (Main.AttackDirectionFixLoaded) { BlacklistAttackDirectionFixInternal(projectile); } } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static void BlacklistAttackDirectionFixInternal(GameObject projectile) { if (!ProjectileAttributes.IsProjectileBlacklisted(ProjectileCatalog.GetProjectileIndex(projectile))) { ProjectileAttributes.BlacklistProjectile(projectile); } } } [RequireComponent(typeof(InputBankTest))] [RequireComponent(typeof(CharacterBody))] public abstract class Tracker : MonoBehaviour { public Transform target; public Indicator indicator; public GameObject targetingIndicatorPrefab; private float stopwatch = 0f; public float searchDelay = 0.1f; public float maxSearchAngle = 40f; public float maxSearchDistance = 60f; public bool isActive = true; public InputBankTest inputBank; public CharacterBody body; public Func<bool> isActiveCallback = DefaultIsActiveCallback; public float minDot => Mathf.Cos(Mathf.Clamp(maxSearchAngle, 0f, 180f) * (MathF.PI / 180f)); private static bool DefaultIsActiveCallback() { return true; } public virtual void Start() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown indicator = new Indicator(((Component)this).gameObject, targetingIndicatorPrefab); body = ((Component)this).GetComponent<CharacterBody>(); inputBank = ((Component)this).GetComponent<InputBankTest>(); } public virtual void FixedUpdate() { if (indicator != null && !DefaultIsActiveCallback()) { indicator.active = false; return; } if (indicator != null && !Object.op_Implicit((Object)(object)target)) { indicator.active = false; } if (indicator != null && Object.op_Implicit((Object)(object)target))