Decompiled source of Dante v0.0.14
plugins/Dante/DanteMod.dll
Decompiled 3 hours 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.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.Sword; using DanteMod.SkillStates.Dante.Skill; using DanteMod.SkillStates.Emote; using EntityStates; using EntityStates.ClayBruiser.Weapon; using EntityStates.Commando; using EntityStates.Commando.CommandoWeapon; 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.Audio; using RoR2.CameraModes; using RoR2.CharacterSpeech; using RoR2.ContentManagement; using RoR2.Navigation; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using RoR2.UI.MainMenu; 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 = "")] [assembly: AssemblyCompany("DanteMod")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [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); 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; } private static IEnumerable<float> NewTimer(float duration) { float elapsedTime = 0f; while (elapsedTime < duration) { yield return elapsedTime; elapsedTime += Time.deltaTime; if (elapsedTime >= duration) { yield return elapsedTime; } } } private static IEnumerable<float> NewCounter(int start, int end, int step) { for (int i = start; i <= end; i += step) { yield return i; } } 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); } 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) Vector3 distance = end - start; foreach (float i in driver) { yield return Ease(ease, start, distance, i, total); } } 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); } private static IEnumerable<Vector3> NewBezier<T>(Function ease, IList nodes, ToVector3<T> toVector3, float maxStep, IEnumerable<float> steps) { if (nodes.Count < 2) { yield break; } Vector3[] points = (Vector3[])(object)new Vector3[nodes.Count]; foreach (float step in steps) { for (int i = 0; i < nodes.Count; i++) { points[i] = toVector3((T)nodes[i]); } yield return Bezier(ease, points, step, maxStep); } } 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); } private static IEnumerable<Vector3> NewCatmullRom<T>(IList nodes, ToVector3<T> toVector3, int slices, bool loop) { if (nodes.Count < 2) { yield break; } yield return toVector3((T)nodes[0]); int last = nodes.Count - 1; for (int current = 0; loop || current < last; current++) { if (loop && current > last) { current = 0; } int previous = ((current != 0) ? (current - 1) : (loop ? last : current)); int start = current; int end = ((current != last) ? (current + 1) : ((!loop) ? current : 0)); int next = ((end != last) ? (end + 1) : ((!loop) ? end : 0)); int stepCount = slices + 1; for (int step = 1; step <= stepCount; step++) { yield return CatmullRom(toVector3((T)nodes[previous]), toVector3((T)nodes[start]), toVector3((T)nodes[end]), toVector3((T)nodes[next]), step, stepCount); } } } 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, Cannon } [Header("General")] public string nameToken = ""; public string descriptionToken = ""; public Sprite icon = null; public GameObject crosshairPrefab = null; [Header("Skills")] public SkillDef skillDef = null; public bool canDeflect = true; [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.canDeflect = weaponDefInfo.canDeflect; 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 bool canDeflect; 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, 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 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.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.rob.Dante", "Dante", "0.0.14")] public class MainPlugin : BaseUnityPlugin { public const string MODUID = "com.rob.Dante"; public const string MODNAME = "Dante"; public const string MODVERSION = "0.0.14"; 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 riskUIInstalled { get { if (Chainloader.PluginInfos.ContainsKey("bubbet.riskui") && RiskUIEnabled()) { return true; } return false; } } private void Awake() { 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>(); new Dante().CreateCharacter(); new Rebellion().Init(); new Queen().Init(); 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); } private IEnumerator BodyCatalog_Init(orig_Init orig) { yield return orig.Invoke(); foreach (GameObject body in BodyCatalog.allBodyPrefabs) { if (Object.op_Implicit((Object)(object)body)) { KinematicCharacterMotor motor = body.GetComponent<KinematicCharacterMotor>(); if (Object.op_Implicit((Object)(object)motor)) { motor.playerCharacter = true; } } } } 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) && self.HasBuff(Dante.devilTriggerBuff)) { self.moveSpeed += 3f; self.damage *= 1.3f; self.armor += 100f; self.regen += Util.Remap(self.healthComponent.combinedHealthFraction, 0f, 1f, 24f, 4f); } } 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_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)7; } } } 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(); PlayEmote("Taunt", "", 1.5f); } } } namespace DanteMod.SkillStates.Dante { public class BaseDanteSkillState : BaseSkillState { public enum InputDirection { None, Forward, Back, Left, Right } protected DanteController dante; 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 due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && ((EntityState)this).inputBank.moveVector == Vector3.zero) { return InputDirection.None; } if (true) { Vector3 val = ((EntityState)this).transform.position + ((EntityState)this).inputBank.aimDirection * 5f; val.y = ((EntityState)this).transform.position.y; Vector3 val2 = val - ((EntityState)this).transform.position; float num = Vector3.Angle(((EntityState)this).inputBank.moveVector, val2); if (num <= 20f) { return InputDirection.Forward; } if (num >= 135f && num <= 225f) { return InputDirection.Back; } } return InputDirection.None; } } protected virtual bool HasItem(ItemDef itemDef) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory)) { return ((EntityState)this).characterBody.inventory.GetItemCount(itemDef) > 0; } return false; } public override void OnEnter() { ValidateControllerReference(); ((BaseState)this).OnEnter(); if (!turningAllowed) { ((EntityState)this).characterDirection.turnSpeed = 0f; } if (normalizeModel) { ((EntityState)this).modelLocator.normalizeToFloor = true; } } public override void OnExit() { ((EntityState)this).OnExit(); if (!turningAllowed) { ((EntityState)this).characterDirection.turnSpeed = dante.baseTurnSpeed; } if (normalizeModel) { ((EntityState)this).modelLocator.normalizeToFloor = false; } } protected void ValidateControllerReference() { dante = ((EntityState)this).gameObject.GetComponent<DanteController>(); } } public class BaseDanteState : BaseState { protected DanteController dante; protected virtual bool HasItem(ItemDef itemDef) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory)) { return ((EntityState)this).characterBody.inventory.GetItemCount(itemDef) > 0; } return false; } public override void OnEnter() { ValidateControllerReference(); ((BaseState)this).OnEnter(); } protected void ValidateControllerReference() { dante = ((EntityState)this).gameObject.GetComponent<DanteController>(); } } public class EnemyStep : MainState { public override void OnEnter() { base.OnEnter(); ((EntityState)this).PlayAnimation("FullBody, Override", "BufferEmpty"); ((EntityState)this).characterMotor.jumpCount = 0; ((GenericCharacterMain)this).ProcessJump(); } } public class LockOn : BaseDanteSkillState { private DanteTracker tracker; private HealthComponent target; private CameraParamsOverrideHandle camOverrideHandle; private float lumStopwatch; private bool shouldDeflect = false; public override void OnEnter() { //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); tracker = ((EntityState)this).GetComponent<DanteTracker>(); dante.ReadyWeapon(); if (NetworkServer.active) { ((EntityState)this).characterBody.AddBuff(DanteMod.Content.Survivors.Dante.lockedOnBuff); } ((EntityState)this).PlayAnimation("Gesture, Override", "BufferEmpty"); ((EntityState)this).PlayAnimation("Gesture Additive, Right", "ReadySword"); Util.PlaySound(dante.weaponDef.readySoundString, ((EntityState)this).gameObject); dante.weaponDef.skillDef.mustKeyPress = true; ((EntityState)this).characterBody.hideCrosshair = true; ((EntityState)this).skillLocator.primary.SetSkillOverride((object)((EntityState)this).gameObject, dante.weaponDef.skillDef, (SkillOverridePriority)5); camOverrideHandle = CameraParams.OverrideCameraParams(((EntityState)this).cameraTargetParams, DanteCameraParams.FAR, 0.25f); dante.luminousFuckingChargeValue = 0f; shouldDeflect = dante.weaponDef.canDeflect; } public override void OnExit() { //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_004a: Unknown result type (might be due to invalid IL or missing references) base.OnExit(); dante.luminousFuckingChargeValue = 0f; dante.lockOnTarget = null; if (NetworkServer.active) { ((EntityState)this).characterBody.RemoveBuff(DanteMod.Content.Survivors.Dante.lockedOnBuff); ((EntityState)this).characterBody.SetBuffCount(Buffs.IncreasePrimaryDamageBuff.buffIndex, 0); } dante.UnreadyWeapon(); ((EntityState)this).cameraTargetParams.RemoveParamsOverride(camOverrideHandle, 0.5f); ((EntityState)this).characterBody.hideCrosshair = false; ((EntityState)this).PlayCrossfade("Gesture, Override", "ReadyGuns", 0.05f); Util.PlaySound("sfx_dante_gun_foley", ((EntityState)this).gameObject); ((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)((EntityState)this).gameObject, dante.weaponDef.skillDef, (SkillOverridePriority)5); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); ((BaseState)this).StartAimMode(0.75f, false); ((EntityState)this).characterBody.outOfCombatStopwatch = 0f; ((EntityState)this).characterBody.isSprinting = false; HandleLuminousShot(); if (Object.op_Implicit((Object)(object)target) && !target.alive) { dante.lockOnTarget = null; } if ((!Object.op_Implicit((Object)(object)target) || (Object.op_Implicit((Object)(object)target) && !target.alive)) && Object.op_Implicit((Object)(object)tracker) && Object.op_Implicit((Object)(object)dante)) { HurtBox trackingTarget = tracker.GetTrackingTarget(); if (Object.op_Implicit((Object)(object)trackingTarget)) { if (!Object.op_Implicit((Object)(object)target)) { dante.ResetCameraVector(); } target = trackingTarget.healthComponent; dante.lockOnTarget = ((Component)trackingTarget).gameObject; } } if (((EntityState)this).fixedAge > 0.05f && ((EntityState)this).isAuthority) { if (!Config.lockOnToggle.Value) { if (!((EntityState)this).inputBank.skill2.down) { ((EntityState)this).outer.SetNextStateToMain(); } } else if (((ButtonState)(ref ((EntityState)this).inputBank.skill2)).justPressed) { ((EntityState)this).skillLocator.secondary.stock = 0; ((EntityState)this).skillLocator.secondary.rechargeStopwatch = 0f; ((EntityState)this).outer.SetNextStateToMain(); } } if (NetworkServer.active && shouldDeflect && Object.op_Implicit((Object)(object)dante) && dante.deflectLockoutStopwatch <= 0f) { HandleDeflect(); } } private void HandleDeflect() { //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) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 val = ((Ray)(ref aimRay)).origin + ((Ray)(ref aimRay)).direction * 2f; Collider[] array = Physics.OverlapSphere(val, 2f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.projectile)).mask)); for (int i = 0; i < array.Length; i++) { ProjectileController componentInParent = ((Component)array[i]).GetComponentInParent<ProjectileController>(); if (Object.op_Implicit((Object)(object)componentInParent) && (Object)(object)componentInParent.owner != (Object)(object)((EntityState)this).gameObject && componentInParent.teamFilter.teamIndex != ((BaseState)this).GetTeam()) { DeflectProjectile(componentInParent); } } } protected virtual void DeflectProjectile(ProjectileController pc) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: 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_00f4: Expected O, but got Unknown //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || Object.op_Implicit((Object)(object)((Component)pc).gameObject.GetComponent<DeflectTracker>())) { return; } ((Component)pc).gameObject.AddComponent<DeflectTracker>(); dante.ServerDeflect(); Vector3 position = ((Component)pc).transform.position; position.y = ((EntityState)this).characterBody.aimOrigin.y; Vector3 origin = Vector3.Lerp(((Component)pc).transform.position, ((EntityState)this).characterBody.aimOrigin, 0.5f); Vector3 val = position - ((EntityState)this).characterBody.aimOrigin; Vector3 normalized = ((Vector3)(ref val)).normalized; normalized = Util.ApplySpread(normalized, 0f, 30f, 1f, 0f, 0f, 0f); EffectManager.SpawnEffect(DanteAssets.deflectEffect, new EffectData { origin = origin, rotation = Quaternion.identity, scale = 1f }, true); ProjectileSteerTowardTarget component = ((Component)pc).GetComponent<ProjectileSteerTowardTarget>(); if (Object.op_Implicit((Object)(object)component)) { EntityState.Destroy((Object)(object)component); } ProjectileDirectionalTargetFinder component2 = ((Component)pc).GetComponent<ProjectileDirectionalTargetFinder>(); if (Object.op_Implicit((Object)(object)component2)) { EntityState.Destroy((Object)(object)component2); } ProjectileTargetComponent component3 = ((Component)pc).GetComponent<ProjectileTargetComponent>(); if (Object.op_Implicit((Object)(object)component3)) { EntityState.Destroy((Object)(object)component3); } ProjectileSimple component4 = ((Component)pc).GetComponent<ProjectileSimple>(); if (Object.op_Implicit((Object)(object)component4)) { EntityState.Destroy((Object)(object)component4); } if (Object.op_Implicit((Object)(object)((Component)pc).GetComponent<MissileController>())) { Object.Destroy((Object)(object)((Component)pc).gameObject); } if (((Object)((Component)pc).gameObject).name == "TarSeeker(Clone)") { Object.Destroy((Object)(object)((Component)pc).gameObject); } if (Object.op_Implicit((Object)(object)pc)) { Rigidbody rigidbody = pc.rigidbody; if (Object.op_Implicit((Object)(object)rigidbody)) { rigidbody.velocity = normalized * Random.Range(30f, 50f); rigidbody.velocity = new Vector3(rigidbody.velocity.x, Random.Range(3f, 12f), rigidbody.velocity.z); rigidbody.useGravity = true; rigidbody.isKinematic = false; } } } private void HandleLuminousShot() { //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)((EntityState)this).characterBody) || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory) || ((EntityState)this).characterBody.inventory.GetItemCount(Items.IncreasePrimaryDamage) <= 0) { return; } if (dante.shouldResetLuminousShot) { lumStopwatch = 0f; dante.luminousFuckingChargeValue = 0f; if (NetworkServer.active) { ((EntityState)this).characterBody.SetBuffCount(Buffs.IncreasePrimaryDamageBuff.buffIndex, 0); } dante.shouldResetLuminousShot = false; } int num = 4 + ((EntityState)this).characterBody.inventory.GetItemCount(Items.IncreasePrimaryDamage); lumStopwatch += Time.fixedDeltaTime; if (((EntityState)this).inputBank.moveVector == Vector3.zero && ((BaseState)this).isGrounded) { lumStopwatch += Time.fixedDeltaTime; } if (lumStopwatch >= 2f) { lumStopwatch = 0f; if (((EntityState)this).characterBody.GetBuffCount(Buffs.IncreasePrimaryDamageBuff) < num && NetworkServer.active) { ((EntityState)this).characterBody.AddIncreasePrimaryDamageStack(); } } if (((EntityState)this).characterBody.GetBuffCount(Buffs.IncreasePrimaryDamageBuff) == num) { dante.luminousFuckingChargeValue = 1f; } else { dante.luminousFuckingChargeValue = Util.Remap(lumStopwatch, 0f, 2f, 0f, 1f); } } 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)1; } } public class MainState : GenericCharacterMain { private Animator animator; public LocalUser localUser; private DanteController dante; private float sprintTimer; public override void OnEnter() { ((GenericCharacterMain)this).OnEnter(); animator = ((BaseCharacterMain)this).modelAnimator; dante = ((EntityState)this).GetComponent<DanteController>(); FindLocalUser(); } public override void FixedUpdate() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) ((GenericCharacterMain)this).FixedUpdate(); if (((EntityState)this).inputBank.moveVector != Vector3.zero) { sprintTimer += Time.fixedDeltaTime; } else { sprintTimer = 0f; } if (((EntityState)this).characterBody.outOfCombatStopwatch <= 0.1f) { sprintTimer = 0f; } if (Object.op_Implicit((Object)(object)animator)) { bool flag = false; if (!((EntityState)this).characterBody.outOfDanger || !((EntityState)this).characterBody.outOfCombat) { flag = true; } animator.SetBool("inCombat", flag); if (((BaseState)this).isGrounded) { animator.SetFloat("airBlend", 0f); } else { animator.SetFloat("airBlend", 1f); } animator.SetFloat("aimDir", ((EntityState)this).inputBank.aimDirection.y); if (((EntityState)this).inputBank.moveVector != Vector3.zero || !((BaseState)this).isGrounded) { animator.SetFloat("moving", Mathf.Lerp(animator.GetFloat("moving"), 1f, Time.fixedDeltaTime * 5f)); } else { animator.SetFloat("moving", Mathf.Lerp(animator.GetFloat("moving"), 0f, Time.fixedDeltaTime * 5f)); } } } public override void Update() { ((GenericCharacterMain)this).Update(); if (((EntityState)this).isAuthority && ((EntityState)this).characterMotor.isGrounded) { CheckEmote<Rest>(Config.restKey); CheckEmote<Taunt>(Config.tauntKey); CheckEmote<Dance>(Config.danceKey); } } private bool HasItem(ItemDef itemDef) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory)) { return ((EntityState)this).characterBody.inventory.GetItemCount(itemDef) > 0; } return false; } 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); } } } 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; } } } public override void ProcessJump() { //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025c: 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_0274: Expected O, but got Unknown //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Expected O, but got Unknown //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Expected O, but got Unknown //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) if ((Object.op_Implicit((Object)(object)dante) && dante.jumpLockoutStopwatch > 0f) || !((BaseCharacterMain)this).hasCharacterMotor) { return; } bool flag = false; bool flag2 = false; if (!base.jumpInputReceived || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody) || ((EntityState)this).characterMotor.jumpCount >= ((EntityState)this).characterBody.maxJumpCount) { return; } Util.PlaySound("sfx_dante_jump", ((EntityState)this).gameObject); int itemCount = ((EntityState)this).characterBody.inventory.GetItemCount(Items.JumpBoost); float num = 1f; float num2 = 1f; if (((EntityState)this).characterMotor.jumpCount >= ((EntityState)this).characterBody.baseJumpCount) { flag = true; num = 1.5f; num2 = 1.5f; } else if (itemCount > 0 && ((EntityState)this).characterBody.isSprinting) { float num3 = ((EntityState)this).characterBody.acceleration * ((EntityState)this).characterMotor.airControl; if (((EntityState)this).characterBody.moveSpeed > 0f && num3 > 0f) { flag2 = true; float num4 = Mathf.Sqrt(10f * (float)itemCount / num3); float num5 = ((EntityState)this).characterBody.moveSpeed / num3; num = (num4 + num5) / num5; } } GenericCharacterMain.ApplyJumpVelocity(((EntityState)this).characterMotor, ((EntityState)this).characterBody, num, num2, false); if (((BaseCharacterMain)this).hasModelAnimator) { int layerIndex = ((BaseCharacterMain)this).modelAnimator.GetLayerIndex("Body"); if (layerIndex >= 0) { if (((EntityState)this).characterBody.isSprinting && flag2) { ((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("SprintJump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex); } else if (((EntityState)this).characterMotor.jumpCount == 0) { ((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("Jump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex); } else { ((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("Jump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex); } } } if (flag) { EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/FeatherEffect"), new EffectData { origin = ((EntityState)this).characterBody.footPosition }, true); } else if (((EntityState)this).characterMotor.jumpCount > 0) { EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ImpactEffects/CharacterLandImpact"), new EffectData { origin = ((EntityState)this).characterBody.footPosition, scale = ((EntityState)this).characterBody.radius }, true); } if (flag2) { EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/BoostJumpEffect"), new EffectData { origin = ((EntityState)this).characterBody.footPosition, rotation = Util.QuaternionSafeLookRotation(((EntityState)this).characterMotor.velocity) }, true); } CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.jumpCount++; if (Object.op_Implicit((Object)(object)animator)) { float num6 = ((CharacterAnimatorWalkParamCalculator)(ref ((BaseCharacterMain)this).animatorWalkParamCalculator)).animatorWalkSpeed.y; float num7 = ((CharacterAnimatorWalkParamCalculator)(ref ((BaseCharacterMain)this).animatorWalkParamCalculator)).animatorWalkSpeed.x; if ((Mathf.Abs(num6) <= 0.45f && Mathf.Abs(num7) <= 0.45f) || ((EntityState)this).inputBank.moveVector == Vector3.zero) { num6 = 0f; num7 = 0f; } if (Mathf.Abs(num6) > Mathf.Abs(num7)) { num6 = ((!(num6 > 0f)) ? (-1f) : 1f); num7 = 0f; } else if (Mathf.Abs(num6) < Mathf.Abs(num7)) { num7 = ((!(num7 > 0f)) ? (-1f) : 1f); num6 = 0f; } animator.SetFloat("forwardSpeedCached", num7); animator.SetFloat("rightSpeedCached", num6); } } } } namespace DanteMod.SkillStates.Dante.Skill { public class Dash : BaseDanteSkillState { protected Vector3 slipVector = Vector3.zero; public float duration = 0.2f; public float speedCoefficient = 8f; private bool toEnemy; private GameObject cachedTarget; private Vector3 startPoint; public override void OnEnter() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); ((EntityState)this).characterBody.isSprinting = true; ((BaseState)this).moveSpeedStat = ((EntityState)this).characterBody.moveSpeed; Vector3 val = ((((EntityState)this).inputBank.moveVector == Vector3.zero) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.moveVector); slipVector = ((Vector3)(ref val)).normalized; Animator modelAnimator = ((EntityState)this).GetModelAnimator(); Vector3 val2 = (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? ((EntityState)this).characterDirection.forward : slipVector); Vector3 val3 = Vector3.Cross(Vector3.up, val2); float num = Vector3.Dot(slipVector, val2); float num2 = Vector3.Dot(slipVector, val3); modelAnimator.SetFloat("dashF", num); modelAnimator.SetFloat("dashR", num2); ((EntityState)this).PlayCrossfade("FullBody, Override", "Dash", "Dash.playbackRate", duration, 0.05f); ((EntityState)this).PlayAnimation("Gesture, Override", "BufferEmpty"); Util.PlaySound("sfx_dante_trick", ((EntityState)this).gameObject); ApplyBuff(); CreateDashEffect(); ModelLocator component = ((EntityState)this).GetComponent<ModelLocator>(); if (Object.op_Implicit((Object)(object)component)) { Transform modelTransform = component.modelTransform; if (Object.op_Implicit((Object)(object)modelTransform)) { TemporaryOverlayInstance val4 = TemporaryOverlayManager.AddOverlay(((Component)modelTransform).gameObject); val4.duration = duration * 1.5f; val4.destroyComponentOnEnd = true; val4.originalMaterial = dante.overlayMaterial; val4.inspectorCharacterModel = ((Component)modelTransform).GetComponent<CharacterModel>(); val4.alphaCurve = AnimationCurve.EaseInOut(0f, 10f, 1f, 0f); val4.animateShaderAlpha = true; } } if (base.inputDirection == InputDirection.Forward && Object.op_Implicit((Object)(object)dante.lockOnTarget) && Config.lockOnCameraSnap.Value) { toEnemy = true; cachedTarget = dante.lockOnTarget; } startPoint = ((EntityState)this).transform.position; } public virtual void ApplyBuff() { if (NetworkServer.active) { ((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, duration); } } public virtual void CreateDashEffect() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) EffectData val = new EffectData(); val.rotation = Util.QuaternionSafeLookRotation(slipVector); val.origin = ((EntityState)this).characterBody.corePosition; EffectManager.SpawnEffect(dante.dashEffect, val, false); } public override void FixedUpdate() { //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: 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_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (toEnemy) { if (Object.op_Implicit((Object)(object)cachedTarget) && Config.lockOnCameraSnap.Value) { Vector3 position = ((EntityState)this).transform.position; Vector3 position2 = dante.lockOnTarget.transform.position; position.y = position2.y; Vector3 val = position2 - position; float num = -2f; Vector3 val2 = position2 + ((Vector3)(ref val)).normalized * num; RaycastHit val3 = default(RaycastHit); if (Physics.Raycast(new Ray(val2 + Vector3.up, Vector3.down), ref val3, 4f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)2)) { val2 = ((RaycastHit)(ref val3)).point; } val2 += new Vector3(0f, 0.5f, 0f); if (((EntityState)this).isAuthority) { ((BaseCharacterController)((EntityState)this).characterMotor).Motor.SetPosition(Vector3.Lerp(startPoint, val2, Util.Remap(((EntityState)this).fixedAge, 0f, duration, 0f, 1f)), true); } } } else if (((EntityState)this).isAuthority) { ((EntityState)this).characterMotor.velocity = Vector3.zero; ((EntityState)this).characterMotor.rootMotion = slipVector * (((BaseState)this).moveSpeedStat * speedCoefficient * Time.fixedDeltaTime) * Mathf.Cos(((EntityState)this).fixedAge / duration * (MathF.PI / 2f)); } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { if (((EntityState)this).inputBank.moveVector != Vector3.zero) { ((EntityState)this).characterMotor.velocity = slipVector * ((BaseState)this).moveSpeedStat; } ((EntityState)this).outer.SetNextStateToMain(); } } 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)5; } } public class DevilTrigger : BaseDanteSkillState { public override void OnEnter() { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_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_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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_00b3: 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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: 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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); dante.devilTriggerTickStopwatch = 0.1f; dante.devilTrigger = !dante.devilTrigger; if (!((BaseState)this).isGrounded && dante.devilTrigger) { ((BaseState)this).SmallHop(((EntityState)this).characterMotor, 8f); } if (dante.devilTrigger) { new BlastAttack { attacker = ((EntityState)this).gameObject, attackerFiltering = (AttackerFiltering)2, baseDamage = 0f, baseForce = 3000f, bonusForce = Vector3.up * 1000f, canRejectForce = false, crit = false, damageColorIndex = (DamageColorIndex)0, damageType = DamageTypeCombo.op_Implicit((DamageType)32), falloffModel = (FalloffModel)0, impactEffect = (EffectIndex)(-1), inflictor = ((EntityState)this).gameObject, losType = (LoSType)0, position = ((EntityState)this).transform.position, procCoefficient = 0f, radius = 10f, teamIndex = ((BaseState)this).GetTeam() }.Fire(); } ((EntityState)this).PlayCrossfade("FullBody, Override", "BufferEmpty", 0.05f); ((EntityState)this).PlayAnimation("Gesture, Override", "BufferEmpty"); if (dante.devilTrigger) { EffectManager.SimpleMuzzleFlash(DanteAssets.devilTriggerActivationEffect, ((EntityState)this).gameObject, "Chest", false); dante.ActivateDevilTrigger(); if (NetworkServer.active) { ((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 0.5f); } } else { dante.devilTrigger = true; dante.ExitDevilTrigger(); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= 0.5f && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } } public class Trick : BaseDanteSkillState { public float duration = 0.25f; private bool hasBlinked; public override void OnEnter() { base.OnEnter(); hasBlinked = false; ((EntityState)this).PlayAnimation("Gesture, Override", "BufferEmpty"); ((EntityState)this).PlayAnimation("Flinch, Override", "BufferEmpty"); Blink(); } public override void OnExit() { base.OnExit(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!hasBlinked && ((EntityState)this).fixedAge >= duration * 0.9f) { hasBlinked = true; } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } protected virtual void Blink() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown