Decompiled source of Dante v0.0.70
plugins/Dante/DanteMod.dll
Decompiled a month 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.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using DanteMod.Content; using DanteMod.Content.Achievements; using DanteMod.Content.Components; using DanteMod.Content.Misc; using DanteMod.Content.Survivors; using DanteMod.Content.Weapons; using DanteMod.Modules; using DanteMod.SkillStates; using DanteMod.SkillStates.BaseStates; using DanteMod.SkillStates.Dante; using DanteMod.SkillStates.Dante.Gun; using DanteMod.SkillStates.Dante.Melee.Queen; using DanteMod.SkillStates.Dante.Melee.Sword; using DanteMod.SkillStates.Dante.Melee.Titan; using DanteMod.SkillStates.Dante.Melee.Yamato; using DanteMod.SkillStates.Dante.Skill; using DanteMod.SkillStates.Emote; using EntityStates; using EntityStates.BeetleGuardMonster; using EntityStates.Bison; using EntityStates.ClayBruiser.Weapon; using EntityStates.Commando; using EntityStates.Commando.CommandoWeapon; using EntityStates.ImpMonster; using GaleShockTrooper.Characters.Survivors.GaleShockTrooper.Components; using Grumpy; using HG; using HG.BlendableTypes; using JetBrains.Annotations; using KinematicCharacterController; using MaterialHud; using On.RoR2; using On.RoR2.CameraModes; using On.RoR2.CharacterSpeech; using On.RoR2.UI; using On.RoR2.UI.MainMenu; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using R2API.Utils; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using RoR2; using RoR2.Achievements; using RoR2.Audio; using RoR2.CameraModes; using RoR2.CharacterAI; using RoR2.CharacterSpeech; using RoR2.ContentManagement; using RoR2.Navigation; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using RoR2.UI.MainMenu; using TMPro; using ThreeEyedGames; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.Rendering.PostProcessing; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("DanteMod")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+c739618e863cfc3a1c0dc2d71495a0a295994f3d")] [assembly: AssemblyProduct("DanteMod")] [assembly: AssemblyTitle("DanteMod")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: UnverifiableCode] public class DeflectTracker : MonoBehaviour { } public class Interpolate { public enum EaseType { Linear, EaseInQuad, EaseOutQuad, EaseInOutQuad, EaseInCubic, EaseOutCubic, EaseInOutCubic, EaseInQuart, EaseOutQuart, EaseInOutQuart, EaseInQuint, EaseOutQuint, EaseInOutQuint, EaseInSine, EaseOutSine, EaseInOutSine, EaseInExpo, EaseOutExpo, EaseInOutExpo, EaseInCirc, EaseOutCirc, EaseInOutCirc } public delegate Vector3 ToVector3<T>(T v); public delegate float Function(float a, float b, float c, float d); [CompilerGenerated] private sealed class <NewBezier>d__16<T> : IEnumerable<Vector3>, IEnumerable, IEnumerator<Vector3>, IEnumerator, IDisposable { private int <>1__state; private Vector3 <>2__current; private int <>l__initialThreadId; private Function ease; public Function <>3__ease; private IList nodes; public IList <>3__nodes; private ToVector3<T> toVector3; public ToVector3<T> <>3__toVector3; private float maxStep; public float <>3__maxStep; private IEnumerable<float> steps; public IEnumerable<float> <>3__steps; private Vector3[] <points>5__1; private IEnumerator<float> <>s__2; private float <step>5__3; private int <i>5__4; Vector3 IEnumerator<Vector3>.Current { [DebuggerHidden] get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return <>2__current; } } [DebuggerHidden] public <NewBezier>d__16(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 1) { try { } finally { <>m__Finally1(); } } <points>5__1 = null; <>s__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_00ba: 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_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) try { int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -3; } else { <>1__state = -1; if (nodes.Count < 2) { goto IL_014b; } <points>5__1 = (Vector3[])(object)new Vector3[nodes.Count]; <>s__2 = steps.GetEnumerator(); <>1__state = -3; } if (<>s__2.MoveNext()) { <step>5__3 = <>s__2.Current; <i>5__4 = 0; while (<i>5__4 < nodes.Count) { <points>5__1[<i>5__4] = toVector3((T)nodes[<i>5__4]); <i>5__4++; } <>2__current = Bezier(ease, <points>5__1, <step>5__3, maxStep); <>1__state = 1; return true; } <>m__Finally1(); <>s__2 = null; <points>5__1 = null; goto IL_014b; IL_014b: return false; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; if (<>s__2 != null) { <>s__2.Dispose(); } } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator<Vector3> IEnumerable<Vector3>.GetEnumerator() { <NewBezier>d__16<T> <NewBezier>d__; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; <NewBezier>d__ = this; } else { <NewBezier>d__ = new <NewBezier>d__16<T>(0); } <NewBezier>d__.ease = <>3__ease; <NewBezier>d__.nodes = <>3__nodes; <NewBezier>d__.toVector3 = <>3__toVector3; <NewBezier>d__.maxStep = <>3__maxStep; <NewBezier>d__.steps = <>3__steps; return <NewBezier>d__; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable<Vector3>)this).GetEnumerator(); } } [CompilerGenerated] private sealed class <NewCatmullRom>d__20<T> : IEnumerable<Vector3>, IEnumerable, IEnumerator<Vector3>, IEnumerator, IDisposable { private int <>1__state; private Vector3 <>2__current; private int <>l__initialThreadId; private IList nodes; public IList <>3__nodes; private ToVector3<T> toVector3; public ToVector3<T> <>3__toVector3; private int slices; public int <>3__slices; private bool loop; public bool <>3__loop; private int <last>5__1; private int <current>5__2; private int <previous>5__3; private int <start>5__4; private int <end>5__5; private int <next>5__6; private int <stepCount>5__7; private int <step>5__8; Vector3 IEnumerator<Vector3>.Current { [DebuggerHidden] get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return <>2__current; } } [DebuggerHidden] public <NewCatmullRom>d__20(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (nodes.Count >= 2) { <>2__current = toVector3((T)nodes[0]); <>1__state = 1; return true; } break; case 1: <>1__state = -1; <last>5__1 = nodes.Count - 1; <current>5__2 = 0; goto IL_025b; case 2: { <>1__state = -1; <step>5__8++; goto IL_0230; } IL_025b: if (!loop && <current>5__2 >= <last>5__1) { break; } if (loop && <current>5__2 > <last>5__1) { <current>5__2 = 0; } <previous>5__3 = ((<current>5__2 != 0) ? (<current>5__2 - 1) : (loop ? <last>5__1 : <current>5__2)); <start>5__4 = <current>5__2; <end>5__5 = ((<current>5__2 != <last>5__1) ? (<current>5__2 + 1) : ((!loop) ? <current>5__2 : 0)); <next>5__6 = ((<end>5__5 != <last>5__1) ? (<end>5__5 + 1) : ((!loop) ? <end>5__5 : 0)); <stepCount>5__7 = slices + 1; <step>5__8 = 1; goto IL_0230; IL_0230: if (<step>5__8 <= <stepCount>5__7) { <>2__current = CatmullRom(toVector3((T)nodes[<previous>5__3]), toVector3((T)nodes[<start>5__4]), toVector3((T)nodes[<end>5__5]), toVector3((T)nodes[<next>5__6]), <step>5__8, <stepCount>5__7); <>1__state = 2; return true; } <current>5__2++; goto IL_025b; } 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(); } [DebuggerHidden] IEnumerator<Vector3> IEnumerable<Vector3>.GetEnumerator() { <NewCatmullRom>d__20<T> <NewCatmullRom>d__; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; <NewCatmullRom>d__ = this; } else { <NewCatmullRom>d__ = new <NewCatmullRom>d__20<T>(0); } <NewCatmullRom>d__.nodes = <>3__nodes; <NewCatmullRom>d__.toVector3 = <>3__toVector3; <NewCatmullRom>d__.slices = <>3__slices; <NewCatmullRom>d__.loop = <>3__loop; return <NewCatmullRom>d__; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable<Vector3>)this).GetEnumerator(); } } [CompilerGenerated] private sealed class <NewCounter>d__6 : IEnumerable<float>, IEnumerable, IEnumerator<float>, IEnumerator, IDisposable { private int <>1__state; private float <>2__current; private int <>l__initialThreadId; private int start; public int <>3__start; private int end; public int <>3__end; private int step; public int <>3__step; private int <i>5__1; float IEnumerator<float>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <NewCounter>d__6(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <i>5__1 = start; break; case 1: <>1__state = -1; <i>5__1 += step; break; } if (<i>5__1 <= end) { <>2__current = <i>5__1; <>1__state = 1; return true; } 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(); } [DebuggerHidden] IEnumerator<float> IEnumerable<float>.GetEnumerator() { <NewCounter>d__6 <NewCounter>d__; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; <NewCounter>d__ = this; } else { <NewCounter>d__ = new <NewCounter>d__6(0); } <NewCounter>d__.start = <>3__start; <NewCounter>d__.end = <>3__end; <NewCounter>d__.step = <>3__step; return <NewCounter>d__; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable<float>)this).GetEnumerator(); } } [CompilerGenerated] private sealed class <NewEase>d__9 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Function ease; public Vector3 start; public Vector3 end; public float total; public IEnumerable<float> driver; private Vector3 <distance>5__1; private IEnumerator<float> <>s__2; private float <i>5__3; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <NewEase>d__9(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 1) { try { } finally { <>m__Finally1(); } } <>s__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_002a: 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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0075: 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_008c: Unknown result type (might be due to invalid IL or missing references) try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <distance>5__1 = end - start; <>s__2 = driver.GetEnumerator(); <>1__state = -3; break; case 1: <>1__state = -3; break; } if (<>s__2.MoveNext()) { <i>5__3 = <>s__2.Current; <>2__current = Ease(ease, start, <distance>5__1, <i>5__3, total); <>1__state = 1; return true; } <>m__Finally1(); <>s__2 = null; return false; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; if (<>s__2 != null) { <>s__2.Dispose(); } } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <NewTimer>d__3 : IEnumerable<float>, IEnumerable, IEnumerator<float>, IEnumerator, IDisposable { private int <>1__state; private float <>2__current; private int <>l__initialThreadId; private float duration; public float <>3__duration; private float <elapsedTime>5__1; float IEnumerator<float>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <NewTimer>d__3(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <elapsedTime>5__1 = 0f; break; case 1: <>1__state = -1; <elapsedTime>5__1 += Time.deltaTime; if (<elapsedTime>5__1 >= duration) { <>2__current = <elapsedTime>5__1; <>1__state = 2; return true; } break; case 2: <>1__state = -1; break; } if (<elapsedTime>5__1 < duration) { <>2__current = <elapsedTime>5__1; <>1__state = 1; return true; } 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(); } [DebuggerHidden] IEnumerator<float> IEnumerable<float>.GetEnumerator() { <NewTimer>d__3 <NewTimer>d__; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; <NewTimer>d__ = this; } else { <NewTimer>d__ = new <NewTimer>d__3(0); } <NewTimer>d__.duration = <>3__duration; return <NewTimer>d__; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable<float>)this).GetEnumerator(); } } private static Vector3 Identity(Vector3 v) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return v; } private static Vector3 TransformDotPosition(Transform t) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) return t.position; } [IteratorStateMachine(typeof(<NewTimer>d__3))] private static IEnumerable<float> NewTimer(float duration) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <NewTimer>d__3(-2) { <>3__duration = duration }; } [IteratorStateMachine(typeof(<NewCounter>d__6))] private static IEnumerable<float> NewCounter(int start, int end, int step) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <NewCounter>d__6(-2) { <>3__start = start, <>3__end = end, <>3__step = step }; } public static IEnumerator NewEase(Function ease, Vector3 start, Vector3 end, float duration) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) IEnumerable<float> driver = NewTimer(duration); return NewEase(ease, start, end, duration, driver); } public static IEnumerator NewEase(Function ease, Vector3 start, Vector3 end, int slices) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) IEnumerable<float> driver = NewCounter(0, slices + 1, 1); return NewEase(ease, start, end, slices + 1, driver); } [IteratorStateMachine(typeof(<NewEase>d__9))] private static IEnumerator NewEase(Function ease, Vector3 start, Vector3 end, float total, IEnumerable<float> driver) { //IL_000e: 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_0015: 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) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <NewEase>d__9(0) { ease = ease, start = start, end = end, total = total, driver = driver }; } private static Vector3 Ease(Function ease, Vector3 start, Vector3 distance, float elapsedTime, float duration) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_0059: Unknown result type (might be due to invalid IL or missing references) start.x = ease(start.x, distance.x, elapsedTime, duration); start.y = ease(start.y, distance.y, elapsedTime, duration); start.z = ease(start.z, distance.z, elapsedTime, duration); return start; } public static Function Ease(EaseType type) { Function result = null; switch (type) { case EaseType.Linear: result = Linear; break; case EaseType.EaseInQuad: result = EaseInQuad; break; case EaseType.EaseOutQuad: result = EaseOutQuad; break; case EaseType.EaseInOutQuad: result = EaseInOutQuad; break; case EaseType.EaseInCubic: result = EaseInCubic; break; case EaseType.EaseOutCubic: result = EaseOutCubic; break; case EaseType.EaseInOutCubic: result = EaseInOutCubic; break; case EaseType.EaseInQuart: result = EaseInQuart; break; case EaseType.EaseOutQuart: result = EaseOutQuart; break; case EaseType.EaseInOutQuart: result = EaseInOutQuart; break; case EaseType.EaseInQuint: result = EaseInQuint; break; case EaseType.EaseOutQuint: result = EaseOutQuint; break; case EaseType.EaseInOutQuint: result = EaseInOutQuint; break; case EaseType.EaseInSine: result = EaseInSine; break; case EaseType.EaseOutSine: result = EaseOutSine; break; case EaseType.EaseInOutSine: result = EaseInOutSine; break; case EaseType.EaseInExpo: result = EaseInExpo; break; case EaseType.EaseOutExpo: result = EaseOutExpo; break; case EaseType.EaseInOutExpo: result = EaseInOutExpo; break; case EaseType.EaseInCirc: result = EaseInCirc; break; case EaseType.EaseOutCirc: result = EaseOutCirc; break; case EaseType.EaseInOutCirc: result = EaseInOutCirc; break; } return result; } public static IEnumerable<Vector3> NewBezier(Function ease, Transform[] nodes, float duration) { IEnumerable<float> steps = NewTimer(duration); return NewBezier<Transform>(ease, nodes, TransformDotPosition, duration, steps); } public static IEnumerable<Vector3> NewBezier(Function ease, Transform[] nodes, int slices) { IEnumerable<float> steps = NewCounter(0, slices + 1, 1); return NewBezier<Transform>(ease, nodes, TransformDotPosition, slices + 1, steps); } public static IEnumerable<Vector3> NewBezier(Function ease, Vector3[] points, float duration) { IEnumerable<float> steps = NewTimer(duration); return NewBezier<Vector3>(ease, points, Identity, duration, steps); } public static IEnumerable<Vector3> NewBezier(Function ease, Vector3[] points, int slices) { IEnumerable<float> steps = NewCounter(0, slices + 1, 1); return NewBezier<Vector3>(ease, points, Identity, slices + 1, steps); } [IteratorStateMachine(typeof(<NewBezier>d__16<>))] private static IEnumerable<Vector3> NewBezier<T>(Function ease, IList nodes, ToVector3<T> toVector3, float maxStep, IEnumerable<float> steps) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <NewBezier>d__16<T>(-2) { <>3__ease = ease, <>3__nodes = nodes, <>3__toVector3 = toVector3, <>3__maxStep = maxStep, <>3__steps = steps }; } private static Vector3 Bezier(Function ease, Vector3[] points, float elapsedTime, float duration) { //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) for (int num = points.Length - 1; num > 0; num--) { for (int i = 0; i < num; i++) { points[i].x = ease(points[i].x, points[i + 1].x - points[i].x, elapsedTime, duration); points[i].y = ease(points[i].y, points[i + 1].y - points[i].y, elapsedTime, duration); points[i].z = ease(points[i].z, points[i + 1].z - points[i].z, elapsedTime, duration); } } return points[0]; } public static IEnumerable<Vector3> NewCatmullRom(Transform[] nodes, int slices, bool loop) { return NewCatmullRom<Transform>(nodes, TransformDotPosition, slices, loop); } public static IEnumerable<Vector3> NewCatmullRom(Vector3[] points, int slices, bool loop) { return NewCatmullRom<Vector3>(points, Identity, slices, loop); } [IteratorStateMachine(typeof(<NewCatmullRom>d__20<>))] private static IEnumerable<Vector3> NewCatmullRom<T>(IList nodes, ToVector3<T> toVector3, int slices, bool loop) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <NewCatmullRom>d__20<T>(-2) { <>3__nodes = nodes, <>3__toVector3 = toVector3, <>3__slices = slices, <>3__loop = loop }; } private static Vector3 CatmullRom(Vector3 previous, Vector3 start, Vector3 end, Vector3 next, float elapsedTime, float duration) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_0085: Unknown result type (might be due to invalid IL or missing references) float num = elapsedTime / duration; float num2 = num * num; float num3 = num2 * num; return previous * (-0.5f * num3 + num2 - 0.5f * num) + start * (1.5f * num3 + -2.5f * num2 + 1f) + end * (-1.5f * num3 + 2f * num2 + 0.5f * num) + next * (0.5f * num3 - 0.5f * num2); } private static float Linear(float start, float distance, float elapsedTime, float duration) { if (elapsedTime > duration) { elapsedTime = duration; } return distance * (elapsedTime / duration) + start; } private static float EaseInQuad(float start, float distance, float elapsedTime, float duration) { elapsedTime = ((elapsedTime > duration) ? 1f : (elapsedTime / duration)); return distance * elapsedTime * elapsedTime + start; } private static float EaseOutQuad(float start, float distance, float elapsedTime, float duration) { elapsedTime = ((elapsedTime > duration) ? 1f : (elapsedTime / duration)); return (0f - distance) * elapsedTime * (elapsedTime - 2f) + start; } private static float EaseInOutQuad(float start, float distance, float elapsedTime, float duration) { elapsedTime = ((elapsedTime > duration) ? 2f : (elapsedTime / (duration / 2f))); if (elapsedTime < 1f) { return distance / 2f * elapsedTime * elapsedTime + start; } elapsedTime -= 1f; return (0f - distance) / 2f * (elapsedTime * (elapsedTime - 2f) - 1f) + start; } private static float EaseInCubic(float start, float distance, float elapsedTime, float duration) { elapsedTime = ((elapsedTime > duration) ? 1f : (elapsedTime / duration)); return distance * elapsedTime * elapsedTime * elapsedTime + start; } private static float EaseOutCubic(float start, float distance, float elapsedTime, float duration) { elapsedTime = ((elapsedTime > duration) ? 1f : (elapsedTime / duration)); elapsedTime -= 1f; return distance * (elapsedTime * elapsedTime * elapsedTime + 1f) + start; } private static float EaseInOutCubic(float start, float distance, float elapsedTime, float duration) { elapsedTime = ((elapsedTime > duration) ? 2f : (elapsedTime / (duration / 2f))); if (elapsedTime < 1f) { return distance / 2f * elapsedTime * elapsedTime * elapsedTime + start; } elapsedTime -= 2f; return distance / 2f * (elapsedTime * elapsedTime * elapsedTime + 2f) + start; } private static float EaseInQuart(float start, float distance, float elapsedTime, float duration) { elapsedTime = ((elapsedTime > duration) ? 1f : (elapsedTime / duration)); return distance * elapsedTime * elapsedTime * elapsedTime * elapsedTime + start; } private static float EaseOutQuart(float start, float distance, float elapsedTime, float duration) { elapsedTime = ((elapsedTime > duration) ? 1f : (elapsedTime / duration)); elapsedTime -= 1f; return (0f - distance) * (elapsedTime * elapsedTime * elapsedTime * elapsedTime - 1f) + start; } private static float EaseInOutQuart(float start, float distance, float elapsedTime, float duration) { elapsedTime = ((elapsedTime > duration) ? 2f : (elapsedTime / (duration / 2f))); if (elapsedTime < 1f) { return distance / 2f * elapsedTime * elapsedTime * elapsedTime * elapsedTime + start; } elapsedTime -= 2f; return (0f - distance) / 2f * (elapsedTime * elapsedTime * elapsedTime * elapsedTime - 2f) + start; } private static float EaseInQuint(float start, float distance, float elapsedTime, float duration) { elapsedTime = ((elapsedTime > duration) ? 1f : (elapsedTime / duration)); return distance * elapsedTime * elapsedTime * elapsedTime * elapsedTime * elapsedTime + start; } private static float EaseOutQuint(float start, float distance, float elapsedTime, float duration) { elapsedTime = ((elapsedTime > duration) ? 1f : (elapsedTime / duration)); elapsedTime -= 1f; return distance * (elapsedTime * elapsedTime * elapsedTime * elapsedTime * elapsedTime + 1f) + start; } private static float EaseInOutQuint(float start, float distance, float elapsedTime, float duration) { elapsedTime = ((elapsedTime > duration) ? 2f : (elapsedTime / (duration / 2f))); if (elapsedTime < 1f) { return distance / 2f * elapsedTime * elapsedTime * elapsedTime * elapsedTime * elapsedTime + start; } elapsedTime -= 2f; return distance / 2f * (elapsedTime * elapsedTime * elapsedTime * elapsedTime * elapsedTime + 2f) + start; } private static float EaseInSine(float start, float distance, float elapsedTime, float duration) { if (elapsedTime > duration) { elapsedTime = duration; } return (0f - distance) * Mathf.Cos(elapsedTime / duration * (MathF.PI / 2f)) + distance + start; } private static float EaseOutSine(float start, float distance, float elapsedTime, float duration) { if (elapsedTime > duration) { elapsedTime = duration; } return distance * Mathf.Sin(elapsedTime / duration * (MathF.PI / 2f)) + start; } private static float EaseInOutSine(float start, float distance, float elapsedTime, float duration) { if (elapsedTime > duration) { elapsedTime = duration; } return (0f - distance) / 2f * (Mathf.Cos(MathF.PI * elapsedTime / duration) - 1f) + start; } private static float EaseInExpo(float start, float distance, float elapsedTime, float duration) { if (elapsedTime > duration) { elapsedTime = duration; } return distance * Mathf.Pow(2f, 10f * (elapsedTime / duration - 1f)) + start; } private static float EaseOutExpo(float start, float distance, float elapsedTime, float duration) { if (elapsedTime > duration) { elapsedTime = duration; } return distance * (0f - Mathf.Pow(2f, -10f * elapsedTime / duration) + 1f) + start; } private static float EaseInOutExpo(float start, float distance, float elapsedTime, float duration) { elapsedTime = ((elapsedTime > duration) ? 2f : (elapsedTime / (duration / 2f))); if (elapsedTime < 1f) { return distance / 2f * Mathf.Pow(2f, 10f * (elapsedTime - 1f)) + start; } elapsedTime -= 1f; return distance / 2f * (0f - Mathf.Pow(2f, -10f * elapsedTime) + 2f) + start; } private static float EaseInCirc(float start, float distance, float elapsedTime, float duration) { elapsedTime = ((elapsedTime > duration) ? 1f : (elapsedTime / duration)); return (0f - distance) * (Mathf.Sqrt(1f - elapsedTime * elapsedTime) - 1f) + start; } private static float EaseOutCirc(float start, float distance, float elapsedTime, float duration) { elapsedTime = ((elapsedTime > duration) ? 1f : (elapsedTime / duration)); elapsedTime -= 1f; return distance * Mathf.Sqrt(1f - elapsedTime * elapsedTime) + start; } private static float EaseInOutCirc(float start, float distance, float elapsedTime, float duration) { elapsedTime = ((elapsedTime > duration) ? 2f : (elapsedTime / (duration / 2f))); if (elapsedTime < 1f) { return (0f - distance) / 2f * (Mathf.Sqrt(1f - elapsedTime * elapsedTime) - 1f) + start; } elapsedTime -= 2f; return distance / 2f * (Mathf.Sqrt(1f - elapsedTime * elapsedTime) + 1f) + start; } } public class MeleeWeaponTrail : MonoBehaviour { [Serializable] public class Point { public float timeCreated = 0f; public Vector3 basePosition; public Vector3 tipPosition; } public bool _emit = true; private bool _use = true; public float _emitTime = 0f; public Material _material; public float _lifeTime = 1f; public Color[] _colors; public float[] _sizes; [SerializeField] private float _minVertexDistance = 0.01f; [SerializeField] private float _maxVertexDistance = 10f; private float _minVertexDistanceSqr = 0f; private float _maxVertexDistanceSqr = 0f; [SerializeField] private float _maxAngle = 3f; [SerializeField] private bool _autoDestruct = false; [SerializeField] private int subdivisions = 8; public Transform _base; public Transform _tip; private List<Point> _points = new List<Point>(); private List<Point> _smoothedPoints = new List<Point>(); private GameObject _trailObject; private Mesh _trailMesh; private Vector3 _lastPosition; public bool Emit { set { _emit = value; } } public bool Use { set { _use = value; } } public Color mainColor { get; private set; } public void Init(Color trailColor, float length, float lifetime, Material mat) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0041: Unknown result type (might be due to invalid IL or missing references) _material = mat; _tip.position = ((Component)_base).transform.position + ((Component)_base).transform.forward * length; mainColor = trailColor; _trailObject.GetComponent<Renderer>().material = _material; _lifeTime = lifetime; } private 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_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_003f: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown _lastPosition = ((Component)this).transform.position; _trailObject = new GameObject("Trail"); _trailObject.transform.parent = null; _trailObject.transform.position = Vector3.zero; _trailObject.transform.rotation = Quaternion.identity; _trailObject.transform.localScale = Vector3.one; _trailObject.AddComponent(typeof(MeshFilter)); _trailObject.AddComponent(typeof(MeshRenderer)); _trailObject.GetComponent<Renderer>().material = _material; _trailMesh = new Mesh(); ((Object)_trailMesh).name = ((Object)this).name + "TrailMesh"; _trailObject.GetComponent<MeshFilter>().mesh = _trailMesh; _minVertexDistanceSqr = _minVertexDistance * _minVertexDistance; _maxVertexDistanceSqr = _maxVertexDistance * _maxVertexDistance; } private void OnDisable() { Object.Destroy((Object)(object)_trailObject); } private void Update() { //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0600: Unknown result type (might be due to invalid IL or missing references) //IL_0605: Unknown result type (might be due to invalid IL or missing references) //IL_0628: Unknown result type (might be due to invalid IL or missing references) //IL_062d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: 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_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_0666: Unknown result type (might be due to invalid IL or missing references) //IL_066b: Unknown result type (might be due to invalid IL or missing references) //IL_068e: Unknown result type (might be due to invalid IL or missing references) //IL_0693: Unknown result type (might be due to invalid IL or missing references) //IL_0543: Unknown result type (might be due to invalid IL or missing references) //IL_0548: Unknown result type (might be due to invalid IL or missing references) //IL_056b: Unknown result type (might be due to invalid IL or missing references) //IL_0570: Unknown result type (might be due to invalid IL or missing references) //IL_0593: Unknown result type (might be due to invalid IL or missing references) //IL_0598: Unknown result type (might be due to invalid IL or missing references) //IL_05bb: Unknown result type (might be due to invalid IL or missing references) //IL_05c0: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_077b: Unknown result type (might be due to invalid IL or missing references) //IL_0780: Unknown result type (might be due to invalid IL or missing references) //IL_0787: Unknown result type (might be due to invalid IL or missing references) //IL_078c: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_0985: Unknown result type (might be due to invalid IL or missing references) //IL_098c: Unknown result type (might be due to invalid IL or missing references) //IL_0991: Unknown result type (might be due to invalid IL or missing references) //IL_0996: Unknown result type (might be due to invalid IL or missing references) //IL_09a0: Unknown result type (might be due to invalid IL or missing references) //IL_09a5: Unknown result type (might be due to invalid IL or missing references) //IL_09af: 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_09b9: Unknown result type (might be due to invalid IL or missing references) //IL_09c8: Unknown result type (might be due to invalid IL or missing references) //IL_09cd: Unknown result type (might be due to invalid IL or missing references) //IL_09d7: Unknown result type (might be due to invalid IL or missing references) //IL_09dc: Unknown result type (might be due to invalid IL or missing references) //IL_09e1: Unknown result type (might be due to invalid IL or missing references) //IL_09f4: Unknown result type (might be due to invalid IL or missing references) //IL_09f6: Unknown result type (might be due to invalid IL or missing references) //IL_09f7: Unknown result type (might be due to invalid IL or missing references) //IL_09f9: Unknown result type (might be due to invalid IL or missing references) //IL_09fe: Unknown result type (might be due to invalid IL or missing references) //IL_0a00: Unknown result type (might be due to invalid IL or missing references) //IL_0a1f: Unknown result type (might be due to invalid IL or missing references) //IL_0a24: Unknown result type (might be due to invalid IL or missing references) //IL_0a38: Unknown result type (might be due to invalid IL or missing references) //IL_0a3d: Unknown result type (might be due to invalid IL or missing references) //IL_086c: Unknown result type (might be due to invalid IL or missing references) //IL_087a: Unknown result type (might be due to invalid IL or missing references) //IL_0881: Unknown result type (might be due to invalid IL or missing references) //IL_0886: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Unknown result type (might be due to invalid IL or missing references) //IL_04c0: Unknown result type (might be due to invalid IL or missing references) //IL_04cb: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Unknown result type (might be due to invalid IL or missing references) if (!_use) { return; } if (_emit && _emitTime != 0f) { _emitTime -= Time.deltaTime; if (_emitTime == 0f) { _emitTime = -1f; } if (_emitTime < 0f) { _emit = false; } } if (!_emit && _points.Count == 0 && _autoDestruct) { Object.Destroy((Object)(object)_trailObject); Object.Destroy((Object)(object)((Component)this).gameObject); } if (!Object.op_Implicit((Object)(object)Camera.main)) { return; } Vector3 val = _lastPosition - ((Component)this).transform.position; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (_emit) { if (sqrMagnitude > _minVertexDistanceSqr) { bool flag = false; if (_points.Count < 3) { flag = true; } else { Vector3 val2 = _points[_points.Count - 2].tipPosition - _points[_points.Count - 3].tipPosition; Vector3 val3 = _points[_points.Count - 1].tipPosition - _points[_points.Count - 2].tipPosition; if (Vector3.Angle(val2, val3) > _maxAngle || sqrMagnitude > _maxVertexDistanceSqr) { flag = true; } } if (flag) { Point point = new Point(); point.basePosition = _base.position; point.tipPosition = _tip.position; point.timeCreated = Time.time; _points.Add(point); _lastPosition = ((Component)this).transform.position; if (_points.Count == 1) { _smoothedPoints.Add(point); } else if (_points.Count > 1) { for (int i = 0; i < 1 + subdivisions; i++) { _smoothedPoints.Add(point); } } if (_points.Count >= 4) { IEnumerable<Vector3> collection = Interpolate.NewCatmullRom((Vector3[])(object)new Vector3[4] { _points[_points.Count - 4].tipPosition, _points[_points.Count - 3].tipPosition, _points[_points.Count - 2].tipPosition, _points[_points.Count - 1].tipPosition }, subdivisions, loop: false); IEnumerable<Vector3> collection2 = Interpolate.NewCatmullRom((Vector3[])(object)new Vector3[4] { _points[_points.Count - 4].basePosition, _points[_points.Count - 3].basePosition, _points[_points.Count - 2].basePosition, _points[_points.Count - 1].basePosition }, subdivisions, loop: false); List<Vector3> list = new List<Vector3>(collection); List<Vector3> list2 = new List<Vector3>(collection2); float timeCreated = _points[_points.Count - 4].timeCreated; float timeCreated2 = _points[_points.Count - 1].timeCreated; for (int j = 0; j < list.Count; j++) { int num = _smoothedPoints.Count - (list.Count - j); if (num > -1 && num < _smoothedPoints.Count) { Point point2 = new Point(); point2.basePosition = list2[j]; point2.tipPosition = list[j]; point2.timeCreated = Mathf.Lerp(timeCreated, timeCreated2, (float)j / (float)list.Count); _smoothedPoints[num] = point2; } } } } else { _points[_points.Count - 1].basePosition = _base.position; _points[_points.Count - 1].tipPosition = _tip.position; _smoothedPoints[_smoothedPoints.Count - 1].basePosition = _base.position; _smoothedPoints[_smoothedPoints.Count - 1].tipPosition = _tip.position; } } else { if (_points.Count > 0) { _points[_points.Count - 1].basePosition = _base.position; _points[_points.Count - 1].tipPosition = _tip.position; } if (_smoothedPoints.Count > 0) { _smoothedPoints[_smoothedPoints.Count - 1].basePosition = _base.position; _smoothedPoints[_smoothedPoints.Count - 1].tipPosition = _tip.position; } } } RemoveOldPoints(_points); if (_points.Count == 0) { _trailMesh.Clear(); } RemoveOldPoints(_smoothedPoints); if (_smoothedPoints.Count == 0) { _trailMesh.Clear(); } List<Point> smoothedPoints = _smoothedPoints; if (smoothedPoints.Count <= 1) { return; } Vector3[] array = (Vector3[])(object)new Vector3[smoothedPoints.Count * 2]; Vector2[] array2 = (Vector2[])(object)new Vector2[smoothedPoints.Count * 2]; int[] array3 = new int[(smoothedPoints.Count - 1) * 6]; Color[] array4 = (Color[])(object)new Color[smoothedPoints.Count * 2]; for (int k = 0; k < smoothedPoints.Count; k++) { Point point3 = smoothedPoints[k]; float num2 = (Time.time - point3.timeCreated) / _lifeTime; Color val4 = Color.Lerp(mainColor, Color.clear, num2); if (_colors != null && _colors.Length != 0) { float num3 = num2 * (float)(_colors.Length - 1); float num4 = Mathf.Floor(num3); float num5 = Mathf.Clamp(Mathf.Ceil(num3), 1f, (float)(_colors.Length - 1)); float num6 = Mathf.InverseLerp(num4, num5, num3); if (num4 >= (float)_colors.Length) { num4 = _colors.Length - 1; } if (num4 < 0f) { num4 = 0f; } if (num5 >= (float)_colors.Length) { num5 = _colors.Length - 1; } if (num5 < 0f) { num5 = 0f; } val4 = Color.Lerp(_colors[(int)num4], _colors[(int)num5], num6); } float num7 = 0f; if (_sizes != null && _sizes.Length != 0) { float num8 = num2 * (float)(_sizes.Length - 1); float num9 = Mathf.Floor(num8); float num10 = Mathf.Clamp(Mathf.Ceil(num8), 1f, (float)(_sizes.Length - 1)); float num11 = Mathf.InverseLerp(num9, num10, num8); if (num9 >= (float)_sizes.Length) { num9 = _sizes.Length - 1; } if (num9 < 0f) { num9 = 0f; } if (num10 >= (float)_sizes.Length) { num10 = _sizes.Length - 1; } if (num10 < 0f) { num10 = 0f; } num7 = Mathf.Lerp(_sizes[(int)num9], _sizes[(int)num10], num11); } Vector3 val5 = point3.tipPosition - point3.basePosition; array[k * 2] = point3.basePosition - val5 * (num7 * 0.5f); array[k * 2 + 1] = point3.tipPosition + val5 * (num7 * 0.5f); array4[k * 2] = (array4[k * 2 + 1] = val4); float num12 = (float)k / (float)smoothedPoints.Count; array2[k * 2] = new Vector2(num12, 0f); array2[k * 2 + 1] = new Vector2(num12, 1f); if (k > 0) { array3[(k - 1) * 6] = k * 2 - 2; array3[(k - 1) * 6 + 1] = k * 2 - 1; array3[(k - 1) * 6 + 2] = k * 2; array3[(k - 1) * 6 + 3] = k * 2 + 1; array3[(k - 1) * 6 + 4] = k * 2; array3[(k - 1) * 6 + 5] = k * 2 - 1; } } _trailMesh.Clear(); _trailMesh.vertices = array; _trailMesh.colors = array4; _trailMesh.uv = array2; _trailMesh.triangles = array3; } private void RemoveOldPoints(List<Point> pointList) { List<Point> list = new List<Point>(); foreach (Point point in pointList) { if (Time.time - point.timeCreated > _lifeTime) { list.Add(point); } } foreach (Point item in list) { pointList.Remove(item); } } } public class RocketRotation : MonoBehaviour { private Rigidbody rb; private void Awake() { rb = ((Component)this).GetComponent<Rigidbody>(); } private void FixedUpdate() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)this).transform; Vector3 velocity = rb.velocity; transform.rotation = Util.QuaternionSafeLookRotation(((Vector3)(ref velocity)).normalized); } } public class StupidFuckingBullshit : MonoBehaviour { public ParticleSystem faggot; private void Awake() { faggot = ((Component)this).GetComponentInChildren<ParticleSystem>(); ((Component)faggot).transform.SetParent((Transform)null); } private void FixedUpdate() { //IL_0012: 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) ((Component)faggot).transform.SetPositionAndRotation(((Component)this).transform.position, ((Component)this).transform.rotation); } } [CreateAssetMenu(fileName = "wpn", menuName = "ScriptableObjects/WeaponDef", order = 1)] public class DanteWeaponDef : ScriptableObject { public enum AnimationSet { Sword, Greatshield, Gauntlets, Hammer, Katana } public enum DeflectType { None, Deflect, AlwaysPerfect, OnlyPerfect, Destroy } [Header("General")] public string nameToken = ""; public string descriptionToken = ""; public Sprite icon = null; public GameObject crosshairPrefab = null; [Header("Skills")] public SkillDef skillDef = null; public DeflectType deflectType = DeflectType.Deflect; public float power = 1f; [Header("Upgrade")] public DanteWeaponDef baseWeaponDef; [Header("Visuals")] public Mesh mesh = null; public Mesh meshSheathed = null; public Material material = null; public AnimationSet animationSet = AnimationSet.Sword; public string readySoundString = ""; [HideInInspector] public ushort index; [HideInInspector] public ItemDef itemDef; public static DanteWeaponDef CreateWeaponDefFromInfo(DanteWeaponDefInfo weaponDefInfo) { DanteWeaponDef danteWeaponDef = (DanteWeaponDef)(object)ScriptableObject.CreateInstance(typeof(DanteWeaponDef)); ((Object)danteWeaponDef).name = weaponDefInfo.nameToken; danteWeaponDef.nameToken = weaponDefInfo.nameToken; danteWeaponDef.descriptionToken = weaponDefInfo.descriptionToken; danteWeaponDef.icon = weaponDefInfo.icon; danteWeaponDef.crosshairPrefab = weaponDefInfo.crosshairPrefab; danteWeaponDef.skillDef = weaponDefInfo.skillDef; danteWeaponDef.deflectType = weaponDefInfo.deflectType; danteWeaponDef.power = weaponDefInfo.power; danteWeaponDef.baseWeaponDef = weaponDefInfo.baseWeaponDef; danteWeaponDef.mesh = weaponDefInfo.mesh; danteWeaponDef.meshSheathed = weaponDefInfo.meshSheathed; danteWeaponDef.material = weaponDefInfo.material; danteWeaponDef.animationSet = weaponDefInfo.animationSet; danteWeaponDef.readySoundString = weaponDefInfo.readySoundString; return danteWeaponDef; } } [Serializable] public struct DanteWeaponDefInfo { public string nameToken; public string descriptionToken; public Sprite icon; public GameObject crosshairPrefab; public SkillDef skillDef; public DanteWeaponDef.DeflectType deflectType; public float power; public DanteWeaponDef baseWeaponDef; public Mesh mesh; public Mesh meshSheathed; public Material material; public DanteWeaponDef.AnimationSet animationSet; public string readySoundString; } internal static class Log { internal static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object data) { _logSource.LogDebug(data); } internal static void Error(object data) { _logSource.LogError(data); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } internal enum DanteCameraParams { DEFAULT, AIM, EMOTE, CLOSE, FAR } internal class BodyInfo { internal string sourceBody = ""; internal string bodyName = ""; internal string bodyNameToken = ""; internal string subtitleNameToken = ""; internal Color bodyColor = Color.white; public Vector3 modelBasePosition = new Vector3(0f, -0.9f, 0f); public Vector3 aimOrigin = new Vector3(0f, 1.4f, 0f); public Vector3 cameraPivot = new Vector3(0f, 1.59f, 0f); internal Texture characterPortrait = null; internal GameObject crosshair = null; internal GameObject podPrefab = null; internal float maxHealth = 100f; internal float healthGrowth = 2f; internal float healthRegen = 0f; internal float shield = 0f; internal float shieldGrowth = 0f; internal float moveSpeed = 7f; internal float moveSpeedGrowth = 0f; internal float acceleration = 80f; internal float jumpPower = 15f; internal float jumpPowerGrowth = 0f; internal float damage = 12f; internal float attackSpeed = 1f; internal float attackSpeedGrowth = 0f; internal float armor = 0f; internal float armorGrowth = 0f; internal float crit = 1f; internal float critGrowth = 0f; internal int jumpCount = 1; } internal class CustomRendererInfo { internal string childName; internal Material material; internal bool ignoreOverlays; } internal class SkillDefInfo { public string skillName; public string skillNameToken; public string skillDescriptionToken; public string[] keywordTokens = new string[0]; public Sprite icon; public SerializableEntityStateType activationState; public InterruptPriority interruptPriority; public string activationStateMachineName; public float baseRechargeInterval; public int baseMaxStock = 1; public int rechargeStock = 1; public int requiredStock = 1; public int stockToConsume = 1; public bool isCombatSkill = true; public bool canceledFromSprinting; public bool forceSprintDuringState; public bool cancelSprintingOnActivation = true; public bool beginSkillCooldownOnSkillEnd; public bool fullRestockOnAssign = true; public bool resetCooldownTimerOnUse; public bool mustKeyPress; public SkillDefInfo() { } public SkillDefInfo(string skillName, string skillNameToken, string skillDescriptionToken, Sprite skillIcon, SerializableEntityStateType activationState, string activationStateMachineName, InterruptPriority interruptPriority, bool isCombatSkill, float baseRechargeInterval) { //IL_0063: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) this.skillName = skillName; this.skillNameToken = skillNameToken; this.skillDescriptionToken = skillDescriptionToken; icon = skillIcon; this.activationState = activationState; this.activationStateMachineName = activationStateMachineName; this.interruptPriority = interruptPriority; this.isCombatSkill = isCombatSkill; this.baseRechargeInterval = baseRechargeInterval; } public SkillDefInfo(string skillName, string skillNameToken, string skillDescriptionToken, Sprite skillIcon, SerializableEntityStateType activationState, string activationStateMachineName = "Weapon", bool agile = false) { //IL_0063: 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_0074: Unknown result type (might be due to invalid IL or missing references) this.skillName = skillName; this.skillNameToken = skillNameToken; this.skillDescriptionToken = skillDescriptionToken; icon = skillIcon; this.activationState = activationState; this.activationStateMachineName = activationStateMachineName; interruptPriority = (InterruptPriority)0; isCombatSkill = true; baseRechargeInterval = 0f; requiredStock = 0; stockToConsume = 0; cancelSprintingOnActivation = !agile; if (agile) { keywordTokens = new string[1] { "KEYWORD_AGILE" }; } } } namespace GaleShockTrooper.Characters.Survivors.GaleShockTrooper.Components { public class TrailerCameraComponent : MonoBehaviour { public CharacterBody body; public CharacterDirection direction; public Transform camTrans; public Transform trackTrans; public Transform demonCamTrans; public Transform demonTrackTrans; private CameraTargetParams camParams; private CameraRigController cameraRig; private UIController ui; private bool baseAIPresent = false; public GameObject camObject; public Transform previousParent; public CameraParamsOverrideHandle handle; public float smoothDampTime = 0.2f; public float maxSmoothDampSpeed = 50f; public float fov = 50f; public Vector3 smoothDampVelocity; public bool shouldRotateCamera; public float stopwatch; public Quaternion startRotation; public static float lerpTime; public float demonStopwatch; public float demonTime = 0f; private bool inDemonCam = false; private bool inCam = false; public bool parentToCharacter = false; public bool useFeetAnim = false; public GameObject camParentObj; public bool activatePan = false; private bool inDebug = false; public Quaternion baseRotation; public Vector3 debugPosition = Vector3.zero; public float panAmount = 60f; public float panDuration = 1f; public bool up = false; public bool down = false; public bool left = false; public bool right = false; public bool zoomIn = false; public bool zoomOut = false; private float debugStopwatch = 0f; public void Awake() { } public void Start() { //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) body = ((Component)this).gameObject.GetComponent<CharacterBody>(); direction = ((Component)this).gameObject.GetComponent<CharacterDirection>(); camParams = ((Component)this).GetComponent<CameraTargetParams>(); ui = ((Component)this).GetComponent<UIController>(); cameraRig = body.master.playerCharacterMasterController.networkUser.cameraRigController; CharacterMaster master = body.master; BaseAI component = ((Component)master).GetComponent<BaseAI>(); baseAIPresent = Object.op_Implicit((Object)(object)component); if (!Object.op_Implicit((Object)(object)master)) { baseAIPresent = true; } try { camObject = ((Component)Camera.main).gameObject; previousParent = camObject.transform.parent; } catch (NullReferenceException arg) { Debug.Log((object)$"Should be alright: {arg}"); } baseRotation = camObject.transform.rotation; } public void SetCam() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_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_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) if (baseAIPresent) { return; } smoothDampTime = 0.001f; maxSmoothDampSpeed = 9999999f; Transform coreTransform = body.coreTransform; if (Object.op_Implicit((Object)(object)coreTransform)) { camParentObj = new GameObject("CameraParent"); if (parentToCharacter) { camParentObj.transform.parent = coreTransform; } camParentObj.transform.position = coreTransform.position; camParentObj.transform.rotation = coreTransform.rotation; camTrans = camParentObj.transform; } if ((Object)(object)camTrans != (Object)null) { camObject.transform.SetParent(camTrans, true); } if (parentToCharacter) { camObject.transform.localRotation = Quaternion.identity; } shouldRotateCamera = false; inCam = true; CharacterCameraParamsData currentCameraParamsData = camParams.currentCameraParamsData; currentCameraParamsData.fov = BlendableFloat.op_Implicit(fov); CameraParamsOverrideRequest val = default(CameraParamsOverrideRequest); val.cameraParamsData = currentCameraParamsData; val.priority = 0f; CameraParamsOverrideRequest val2 = val; ui.SetRORUIActiveState(state: false); handle = camParams.AddParamsOverride(val2, 0.05f); } public void UnsetCam() { //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_006a: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Invalid comparison between Unknown and I4 if (baseAIPresent) { return; } smoothDampTime = 0.5f; maxSmoothDampSpeed = 50f; shouldRotateCamera = true; inCam = false; startRotation = camObject.transform.localRotation; camObject.transform.SetParent(previousParent, true); camParams.RemoveParamsOverride(handle, 1f); foreach (CharacterModel instances in InstanceTracker.GetInstancesList<CharacterModel>()) { if ((int)instances.visibility > 0) { for (int i = 0; i < instances.baseRendererInfos.Length; i++) { instances.baseRendererInfos[i].renderer.enabled = true; } } } if (Object.op_Implicit((Object)(object)camParentObj)) { Object.Destroy((Object)(object)camParentObj); } ui.SetRORUIActiveState(state: true); } public void Update() { //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_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_0414: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)camObject)) { camObject = ((Component)Camera.main).gameObject; previousParent = camObject.transform.parent; cameraRig = camObject.GetComponent<CameraRigController>(); } if (Object.op_Implicit((Object)(object)camObject) && !inDebug) { camObject.transform.localPosition = Vector3.SmoothDamp(camObject.transform.localPosition, Vector3.zero, ref smoothDampVelocity, smoothDampTime, maxSmoothDampSpeed, Time.deltaTime); } if (shouldRotateCamera) { stopwatch += Time.deltaTime; camObject.transform.localRotation = Quaternion.Slerp(startRotation, Quaternion.identity, stopwatch / lerpTime); if (stopwatch >= lerpTime) { stopwatch = 0f; shouldRotateCamera = false; } } if (activatePan && !inDebug) { inDebug = true; SetCam(); } if (inDebug) { debugStopwatch += Time.deltaTime; if (debugStopwatch >= panDuration) { debugStopwatch = 0f; } camObject.transform.localPosition = debugPosition; Quaternion localRotation = baseRotation; Vector3 localPosition = debugPosition; if (up) { float num = panAmount / 2f; Quaternion val = baseRotation * Quaternion.AngleAxis(num, Vector3.right); Quaternion val2 = baseRotation * Quaternion.AngleAxis(num, Vector3.left); localRotation = Quaternion.Slerp(val, val2, debugStopwatch / panDuration); } if (down) { float num2 = panAmount / 2f; Quaternion val3 = baseRotation * Quaternion.AngleAxis(num2, Vector3.left); Quaternion val4 = baseRotation * Quaternion.AngleAxis(num2, Vector3.right); localRotation = Quaternion.Slerp(val3, val4, debugStopwatch / panDuration); } if (left) { float num3 = panAmount / 2f; Quaternion val5 = baseRotation * Quaternion.AngleAxis(num3, Vector3.up); Quaternion val6 = baseRotation * Quaternion.AngleAxis(num3, Vector3.down); localRotation = Quaternion.Slerp(val5, val6, debugStopwatch / panDuration); } if (right) { float num4 = panAmount / 2f; Quaternion val7 = baseRotation * Quaternion.AngleAxis(num4, Vector3.down); Quaternion val8 = baseRotation * Quaternion.AngleAxis(num4, Vector3.up); localRotation = Quaternion.Slerp(val7, val8, debugStopwatch / panDuration); } if (zoomIn) { float num5 = panAmount / 20f; float num6 = debugPosition.z - num5; float num7 = debugPosition.z + num5; float z = Mathf.Lerp(num6, num7, debugStopwatch / panDuration); localPosition.z = z; } if (zoomOut) { float num8 = panAmount / 20f; float num9 = debugPosition.z + num8; float num10 = debugPosition.z - num8; float z2 = Mathf.Lerp(num9, num10, debugStopwatch / panDuration); localPosition.z = z2; } camObject.transform.localRotation = localRotation; camObject.transform.localPosition = localPosition; } if (!activatePan && inDebug) { inDebug = false; UnsetCam(); } } private void LateUpdate() { //IL_0054: 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_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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: 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_00d9: 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_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)camObject) || !inCam) { return; } float num = ((cameraRig.localUserViewer == null) ? 1f : cameraRig.localUserViewer.userProfile.screenShakeScale); Vector3 position = camObject.transform.position; Vector3 val = ShakeEmitter.ComputeTotalShakeAtPoint(camObject.transform.position); Vector3 val2 = val * num; Vector3 val3 = position + val2; if (val2 != Vector3.zero) { Vector3 val4 = val2; RaycastHit val5 = default(RaycastHit); if (Physics.SphereCast(position, Camera.main.nearClipPlane, val4, ref val5, ((Vector3)(ref val2)).magnitude, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { val3 = position + ((Vector3)(ref val2)).normalized * ((RaycastHit)(ref val5)).distance; val3 *= 0.5f; } } camObject.transform.SetPositionAndRotation(val3, camObject.transform.rotation); } } public class UIController : MonoBehaviour { private GameObject RoRHUDObject; public void Start() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown HUD.Update += new hook_Update(HUD_Update); } public void OnDestroy() { Unhook(); } public void SetRORUIActiveState(bool state) { if (Object.op_Implicit((Object)(object)RoRHUDObject)) { RoRHUDObject.SetActive(state); } } private void HUD_Update(orig_Update orig, HUD self) { orig.Invoke(self); if (!Object.op_Implicit((Object)(object)RoRHUDObject)) { RoRHUDObject = ((Component)self).gameObject; } } public void Unhook() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown HUD.Update -= new hook_Update(HUD_Update); } } } namespace DanteMod { public static class DanteWeaponCatalog { public static Dictionary<string, DanteWeaponDef> weaponDrops = new Dictionary<string, DanteWeaponDef>(); public static DanteWeaponDef[] weaponDefs = new DanteWeaponDef[0]; public static List<ItemDef> itemDefs = new List<ItemDef>(0); public static void AddWeapon(DanteWeaponDef weaponDef, bool addItem = true) { Array.Resize(ref weaponDefs, weaponDefs.Length + 1); int num = weaponDefs.Length - 1; weaponDef.index = (ushort)num; weaponDefs[num] = weaponDef; weaponDef.index = (ushort)num; if (addItem) { itemDefs.Add(weaponDef.itemDef); } Debug.Log((object)("Added " + weaponDef.nameToken + " to Dante weapon catalog with index: " + weaponDef.index)); } public static void AddWeaponDrop(string bodyName, DanteWeaponDef weaponDef, bool autoComplete = true) { if (autoComplete) { if (!bodyName.Contains("Body")) { bodyName += "Body"; } if (!bodyName.Contains("(Clone)")) { bodyName += "(Clone)"; } } weaponDrops.Add(bodyName, weaponDef); } public static DanteWeaponDef GetWeaponFromIndex(int index) { return weaponDefs[index]; } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.rob.Dante", "Dante", "0.0.70")] public class MainPlugin : BaseUnityPlugin { [CompilerGenerated] private sealed class <BodyCatalog_Init>d__21 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public orig_Init orig; public MainPlugin <>4__this; private IEnumerator<GameObject> <>s__1; private GameObject <body>5__2; private KinematicCharacterMotor <motor>5__3; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <BodyCatalog_Init>d__21(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>s__1 = null; <body>5__2 = null; <motor>5__3 = null; <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = orig.Invoke(); <>1__state = 1; return true; case 1: <>1__state = -1; <>s__1 = BodyCatalog.allBodyPrefabs.GetEnumerator(); try { while (<>s__1.MoveNext()) { <body>5__2 = <>s__1.Current; if (Object.op_Implicit((Object)(object)<body>5__2)) { <motor>5__3 = <body>5__2.GetComponent<KinematicCharacterMotor>(); if (Object.op_Implicit((Object)(object)<motor>5__3)) { <motor>5__3.playerCharacter = true; } <motor>5__3 = null; } <body>5__2 = null; } } finally { if (<>s__1 != null) { <>s__1.Dispose(); } } <>s__1 = null; 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 MODUID = "com.rob.Dante"; public const string MODNAME = "Dante"; public const string MODVERSION = "0.0.70"; public const string developerPrefix = "ROB"; public static MainPlugin instance; public static List<HurtBox> hurtboxesList = new List<HurtBox>(); public static bool scepterInstalled => Chainloader.PluginInfos.ContainsKey("com.DestroyedClone.AncientScepter"); public static bool rooInstalled => Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"); public static bool hunkInstalled => Chainloader.PluginInfos.ContainsKey("com.rob.Hunk"); public static bool greenAlienHeadInstalled => Chainloader.PluginInfos.ContainsKey("com.Borbo.GreenAlienHead"); public static bool enemiesReturnsInstalled => Chainloader.PluginInfos.ContainsKey("com.Viliger.EnemiesReturns"); public static bool riskUIInstalled { get { if (Chainloader.PluginInfos.ContainsKey("bubbet.riskui") && RiskUIEnabled()) { return true; } return false; } } private void Awake() { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_00ba: 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) instance = this; Files.PluginInfo = ((BaseUnityPlugin)this).Info; Config.myConfig = ((BaseUnityPlugin)this).Config; Log.Init(((BaseUnityPlugin)this).Logger); Config.ReadConfig(); DanteAssets.PopulateAssets(); CameraParams.InitializeParams(); States.RegisterStates(); Projectiles.RegisterProjectiles(); new LanguageTokens(); ItemDisplays.PopulateDisplays(); NetworkingAPI.RegisterMessageType<SyncGainGauge>(); NetworkingAPI.RegisterMessageType<SyncDeflect>(); NetworkingAPI.RegisterMessageType<SyncHeal>(); Dante.devilArmTier = Object.Instantiate<ItemTierDef>(Addressables.LoadAssetAsync<ItemTierDef>((object)"RoR2/Base/Common/BossTierDef.asset").WaitForCompletion()); ((Object)Dante.devilArmTier).name = "DevilArmTierDef"; Dante.devilArmTier.pickupRules = (PickupRules)2; Dante.devilArmTier.isDroppable = false; Dante.devilArmTier.colorIndex = (ColorIndex)27; Dante.devilArmTier.darkColorIndex = (ColorIndex)27; Dante.devilArmTier.canScrap = false; Dante.devilArmTier.canRestack = false; Dante.devilArmTier.tier = (ItemTier)11; Dante.devilArmTier._tier = (ItemTier)11; new Rebellion().Init(); new Queen().Init(); new Titan().Init(); new Colossus().Init(); new Overlord().Init(); if (Config.cinema2.Value) { new Yamato().Init(); new MirageEdge().Init(); } new Dante().CreateCharacter(); Hook(); new ContentPacks().Initialize(); ContentManager.onContentPacksAssigned += LateSetup; } private void LateSetup(ReadOnlyArray<ReadOnlyContentPack> obj) { Dante.SetItemDisplays(); } private void Hook() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats); HurtBox.OnEnable += new hook_OnEnable(HurtBox_OnEnable); HurtBox.OnDisable += new hook_OnDisable(HurtBox_OnDisable); BodyCatalog.Init += new hook_Init(BodyCatalog_Init); } [IteratorStateMachine(typeof(<BodyCatalog_Init>d__21))] private IEnumerator BodyCatalog_Init(orig_Init orig) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <BodyCatalog_Init>d__21(0) { <>4__this = this, orig = orig }; } private void HurtBox_OnEnable(orig_OnEnable orig, HurtBox self) { orig.Invoke(self); hurtboxesList.Add(self); } private void HurtBox_OnDisable(orig_OnDisable orig, HurtBox self) { orig.Invoke(self); hurtboxesList.Remove(self); } private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self) { orig.Invoke(self); if (Object.op_Implicit((Object)(object)self)) { if (self.HasBuff(Dante.devilTriggerBuff)) { self.moveSpeed += 5f; self.attackSpeed *= 1.25f; self.armor += 50f + self.level * 5f; self.regen += 5f + self.level * 3f; } if (self.HasBuff(Dante.superSprintBuff) && self.isSprinting) { self.moveSpeed += 5f; } } } public static float GetICBMDamageMult(CharacterBody body) { float num = 1f; if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.inventory)) { int itemCount = body.inventory.GetItemCount(Items.MoreMissile); int num2 = itemCount - 1; if (num2 > 0) { num += (float)num2 * 0.5f; } } return num; } private static bool RiskUIEnabled() { return RiskUIPlugin.Enabled.Value; } } } namespace DanteMod.SkillStates { public class FuckMyAss : GenericCharacterDeath { public override bool shouldAutoDestroy => false; public override void OnEnter() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) ((GenericCharacterDeath)this).OnEnter(); Vector3 val = Vector3.up * 3f; if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { val += ((EntityState)this).characterMotor.velocity; ((Behaviour)((EntityState)this).characterMotor).enabled = false; } if (!Object.op_Implicit((Object)(object)((GenericCharacterDeath)this).cachedModelTransform)) { return; } RagdollController component = ((Component)((GenericCharacterDeath)this).cachedModelTransform).GetComponent<RagdollController>(); if (!Object.op_Implicit((Object)(object)component)) { return; } Transform[] bones = component.bones; foreach (Transform val2 in bones) { if (Object.op_Implicit((Object)(object)val2)) { ((Component)val2).gameObject.layer = LayerIndex.ragdoll.intVal; ((Component)val2).gameObject.SetActive(true); } } component.BeginRagdoll(val); } public override void PlayDeathAnimation(float crossfadeDuration = 0.1f) { } public override void FixedUpdate() { ((GenericCharacterDeath)this).FixedUpdate(); if (NetworkServer.active && ((EntityState)this).fixedAge > 4f) { EntityState.Destroy((Object)(object)((EntityState)this).gameObject); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)9; } } } namespace DanteMod.SkillStates.Emote { public class BaseEmote : BaseState { private CameraParamsOverrideHandle camOverrideHandle; private Animator animator; private ChildLocator childLocator; private float duration; private uint activePlayID; public LocalUser localUser; public override void OnEnter() { //IL_0040: 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) ((BaseState)this).OnEnter(); animator = ((EntityState)this).GetModelAnimator(); childLocator = ((EntityState)this).GetModelChildLocator(); FindLocalUser(); ((EntityState)this).characterBody.hideCrosshair = true; camOverrideHandle = CameraParams.OverrideCameraParams(((EntityState)this).cameraTargetParams, DanteCameraParams.EMOTE); } private void FindLocalUser() { if (localUser != null || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { return; } foreach (LocalUser readOnlyLocalUsers in LocalUserManager.readOnlyLocalUsersList) { if ((Object)(object)readOnlyLocalUsers.cachedBody == (Object)(object)((EntityState)this).characterBody) { localUser = readOnlyLocalUsers; break; } } } protected void PlayEmote(string animString, string soundString = "", float animDuration = 0f) { PlayEmote(animString, soundString, ((EntityState)this).GetModelAnimator(), animDuration); } protected void PlayEmote(string animString, string soundString, Animator animator, float animDuration = 0f) { if (animDuration >= 0f && duration != 0f) { animDuration = duration; } if (duration > 0f) { EntityState.PlayAnimationOnAnimator(animator, "Emote, Override", animString, "Emote.playbackRate", animDuration, 0f); } else { animator.SetFloat("Emote.playbackRate", 1f); EntityState.PlayAnimationOnAnimator(animator, "Emote, Override", animString); } if (!string.IsNullOrEmpty(soundString)) { activePlayID = Util.PlaySound(soundString, ((EntityState)this).gameObject); } } public override void Update() { ((EntityState)this).Update(); if (((EntityState)this).isAuthority) { CheckEmote<Rest>(Config.restKey); CheckEmote<Taunt>(Config.tauntKey); CheckEmote<Dance>(Config.danceKey); } } private void CheckEmote(KeyCode keybind, EntityState state) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (Input.GetKeyDown(keybind) && !localUser.isUIFocused) { ((EntityState)this).outer.SetInterruptState(state, (InterruptPriority)0); } } private void CheckEmote<T>(ConfigEntry<KeyboardShortcut> keybind) where T : EntityState, new() { if (Config.GetKeyPressed(keybind)) { FindLocalUser(); if (localUser != null && !localUser.isUIFocused) { ((EntityState)this).outer.SetInterruptState((EntityState)(object)new T(), (InterruptPriority)0); } } } public override void FixedUpdate() { //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) ((EntityState)this).FixedUpdate(); bool flag = false; if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded) { flag = true; } if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank)) { if (((EntityState)this).inputBank.skill1.down) { flag = true; } if (((EntityState)this).inputBank.skill2.down) { flag = true; } if (((EntityState)this).inputBank.skill3.down) { flag = true; } if (((EntityState)this).inputBank.skill4.down) { flag = true; } if (((EntityState)this).inputBank.moveVector != Vector3.zero) { flag = true; } } if (duration > 0f && ((EntityState)this).fixedAge >= duration) { flag = true; } if (flag && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { //IL_0045: 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) ((EntityState)this).OnExit(); ((EntityState)this).characterBody.hideCrosshair = false; ((EntityState)this).PlayAnimation("Emote, Override", "BufferEmpty"); if (activePlayID != 0) { AkSoundEngine.StopPlayingID(activePlayID); } ((EntityState)this).cameraTargetParams.RemoveParamsOverride(camOverrideHandle, 0.5f); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)0; } } public class Dance : BaseEmote { public override void OnEnter() { base.OnEnter(); PlayEmote("Dance"); } public override void OnExit() { base.OnExit(); if (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator) && Object.op_Implicit((Object)(object)((EntityState)this).modelLocator.modelTransform)) { DanteAnimationEvents component = ((Component)((EntityState)this).modelLocator.modelTransform).GetComponent<DanteAnimationEvents>(); if (Object.op_Implicit((Object)(object)component)) { component.EndTrails(); } } } } public class Rest : BaseEmote { public override void OnEnter() { base.OnEnter(); PlayEmote("Rest", "", 1.5f); } } public class Taunt : BaseEmote { public override void OnEnter() { base.OnEnter(); ((EntityState)this).GetComponent<DanteController>().ReadyWeapon(); Util.PlaySound("sfx_dante_sword_foley_04", ((EntityState)this).gameObject); PlayEmote("Taunt", "", ((EntityState)this).GetComponent<DanteController>().impaleDuration); } public override void OnExit() { base.OnExit(); ((EntityState)this).GetComponent<DanteController>().UnreadyWeapon(); } } public class ToggleMusic : BaseState { private float duration = 0.6f; private bool boom = false; private int rng; public override void OnEnter() { rng = Mathf.RoundToInt(Random.value * 100f); ((BaseState)this).OnEnter(); ((EntityState)this).PlayCrossfade("Gesture Additive, Left", "ToggleMusic", "Emote.playbackRate", duration, 0.05f); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!boom && ((EntityState)this).fixedAge >= 0.25f * duration) { boom = true; TryToggleMusic(); Util.PlaySound("sfx_hunk_button_click", ((EntityState)this).gameObject); } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } private void TryToggleMusic() { MusicPlayer component = ((EntityState)this).GetComponent<MusicPlayer>(); if (Object.op_Implicit((Object)(object)component)) { EntityState.Destroy((Object)(object)component); ((Component)((BaseState)this).FindModelChild("HeadphonesModel")).gameObject.SetActive(false); return; } ((Component)((BaseState)this).FindModelChild("HeadphonesModel")).gameObject.SetActive(true); if (!Config.cinema.Value) { if (((EntityState)this).isAuthority) { component = ((EntityState)this).gameObject.AddComponent<MusicPlayer>(); if (rng < 6) { component.bgmString = "Sin_Devil_Trigger"; } else if (rng < 50) { component.bgmString = "Bury_The_Light_System"; } else { component.bgmString = "Devil_Trigger"; } } else if (rng < 6) { component = ((EntityState)this).gameObject.AddComponent<MusicPlayer>(); component.bgmString = "sfx_fetty_wap"; } } else { component = ((EntityState)this).gameObject.AddComponent<MusicPlayer>(); } } public override void OnSerialize(NetworkWriter writer) { writer.Write(rng); } public override void OnDeserialize(NetworkReader reader) { rng = reader.ReadInt32(); } } } namespace DanteMod.SkillStates.Dante { public class BaseDanteSkillState : BaseSkillState { public enum InputDirection { None, Forward, Back, Left, Right } protected DanteController dante; private Animator _animator; protected virtual bool turningAllowed => true; protected virtual bool normalizeModel => false; protected InputDirection inputDirection { get { //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_0042: 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_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_0061: 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_007a: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be du