Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of EchoOfProvidencePlayable v1.0.0
EchoOfProvidencePlayable.dll
Decompiled 2 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.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.Providence; using KinematicCharacterController; using Microsoft.CodeAnalysis; using On.EntityStates; using On.EntityStates.Providence; using On.RoR2; using On.RoR2.CharacterSpeech; using On.RoR2.UI; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using RoR2; using RoR2.Audio; using RoR2.CharacterAI; using RoR2.CharacterSpeech; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using RoR2.UI.MainMenu; using TMPro; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace EchoProvidencePlayable { [DefaultExecutionOrder(-50)] public class EchoAirOverlay : MonoBehaviour { private Animator animator; private CharacterModel model; private CharacterBody body; private Transform[] bones; private Vector3[] pos; private Quaternion[] rot; private readonly HashSet<Transform> keepPos = new HashSet<Transform>(); private AnimationClip idleClip; private int fullBodyLayer = -1; private static readonly int BufferEmpty = Animator.StringToHash("BufferEmpty"); private Transform thighL; private Transform thighR; private Transform calfL; private Transform calfR; private Transform footL; private Transform footR; private Transform chest; private Transform pelvis; private Transform armL; private Transform armR; private float weight; private float airTime; private float landT = 99f; private float landWeight; private bool wasAirborne; private const float FadeIn = 0.07f; private const float FadeOut = 0.1f; private const float LandDur = 0.22f; private bool loggedAir; private static readonly string[] SkillStates = new string[17] { "PrimaryStrikeRight", "PrimaryStrikeLeft", "PrimaryWindupRight", "Dash Forward, Enter", "Dash Forward, Loop", "Dash Forward, Exit", "Down Slam, Slash", "Down Slam, Smash", "Down Slam, Exit", "Down Slam, Recovery", "Teleport In", "Teleport Out", "Teleport In, Smash", "FinalCharge, Start", "FinalCharge, Pulse", "Summon Clone, Start", "Summon Clone, Exit" }; private static HashSet<int> skillHashes; private EntityStateMachine bodyEsm; private void Start() { animator = ((Component)this).GetComponentInChildren<Animator>(); model = ((Component)this).GetComponent<CharacterModel>(); body = (Object.op_Implicit((Object)(object)model) ? model.body : null); if (!Object.op_Implicit((Object)(object)animator) || !Object.op_Implicit((Object)(object)animator.runtimeAnimatorController)) { ((Behaviour)this).enabled = false; return; } idleClip = ((IEnumerable<AnimationClip>)animator.runtimeAnimatorController.animationClips).FirstOrDefault((Func<AnimationClip, bool>)((AnimationClip c) => Object.op_Implicit((Object)(object)c) && ((Object)c).name == "idle")); fullBodyLayer = animator.GetLayerIndex("FullBody, Override"); bones = (from b in ((Component)this).GetComponentsInChildren<SkinnedMeshRenderer>(true).SelectMany((SkinnedMeshRenderer s) => s.bones) where Object.op_Implicit((Object)(object)b) select b).Distinct().ToArray(); pos = (Vector3[])(object)new Vector3[bones.Length]; rot = (Quaternion[])(object)new Quaternion[bones.Length]; ChildLocator cl = ((Component)this).GetComponent<ChildLocator>(); string[] array = new string[2] { "Root", "Root2" }; for (int num = 0; num < array.Length; num++) { Transform val = F(array[num]); if (Object.op_Implicit((Object)(object)val)) { keepPos.Add(val); } } thighL = F("ThighL"); thighR = F("ThighR"); calfL = F("CalfL"); calfR = F("CalfR"); footL = F("FootL"); footR = F("FootR"); chest = F("Chest"); pelvis = F("Pelvis"); armL = F("UpperArmL"); armR = F("UpperArmR"); if (!Object.op_Implicit((Object)(object)thighL) || !Object.op_Implicit((Object)(object)thighR)) { ((Behaviour)this).enabled = false; } EchoProvidencePlugin.Log.LogInfo((object)string.Format("[air] start idle={0} fbLayer={1} thigh={2}/{3} calf={4} pelvis={5} enabled={6}", Object.op_Implicit((Object)(object)idleClip) ? ((Object)idleClip).name : "null", fullBodyLayer, Object.op_Implicit((Object)(object)thighL) ? ((Object)thighL).name : "null", Object.op_Implicit((Object)(object)thighR) ? ((Object)thighR).name : "null", Object.op_Implicit((Object)(object)calfL) ? ((Object)calfL).name : "null", Object.op_Implicit((Object)(object)pelvis) ? ((Object)pelvis).name : "null", ((Behaviour)this).enabled)); Transform F(string n) { if (!Object.op_Implicit((Object)(object)cl)) { return null; } return cl.FindChild(n); } } private string StateName(int h) { if (h == BufferEmpty) { return "BufferEmpty"; } string[] skillStates = SkillStates; foreach (string text in skillStates) { if (Animator.StringToHash(text) == h) { return text; } } return h.ToString(); } private bool SkillOwnsBody() { //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: 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) if (!Object.op_Implicit((Object)(object)bodyEsm) && Object.op_Implicit((Object)(object)body)) { bodyEsm = EntityStateMachine.FindByCustomName(((Component)body).gameObject, "Body"); } if (Object.op_Implicit((Object)(object)bodyEsm) && bodyEsm.state != null && !(bodyEsm.state is GenericCharacterMain)) { return true; } if (fullBodyLayer < 0) { return false; } if (skillHashes == null) { skillHashes = new HashSet<int>(((IEnumerable<string>)SkillStates).Select((Func<string, int>)Animator.StringToHash)); } AnimatorStateInfo val = animator.GetCurrentAnimatorStateInfo(fullBodyLayer); int shortNameHash = ((AnimatorStateInfo)(ref val)).shortNameHash; if (skillHashes.Contains(shortNameHash)) { return true; } if (animator.IsInTransition(fullBodyLayer)) { HashSet<int> hashSet = skillHashes; val = animator.GetNextAnimatorStateInfo(fullBodyLayer); return hashSet.Contains(((AnimatorStateInfo)(ref val)).shortNameHash); } return false; } private static void Bend(Transform t, Vector3 tip, Vector3 axis, float deg, Vector3 toward) { //IL_0011: 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_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)t) || deg <= 0.01f) { return; } Vector3 val = tip - t.position; if (!(((Vector3)(ref val)).sqrMagnitude < 1E-06f)) { if (Vector3.Dot(Quaternion.AngleAxis(deg, axis) * val - val, toward) < 0f) { deg = 0f - deg; } t.rotation = Quaternion.AngleAxis(deg, axis) * t.rotation; } } private static Vector3 Tip(Transform t) { //IL_0008: 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_002e: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00de: 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_006c: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)t)) { return Vector3.zero; } Transform val = null; float num = 0f; foreach (Transform item in t) { Transform val2 = item; Vector3 val3 = val2.position - t.position; float sqrMagnitude = ((Vector3)(ref val3)).sqrMagnitude; if (sqrMagnitude > num) { num = sqrMagnitude; val = val2; } foreach (Transform item2 in val2) { Transform val4 = item2; val3 = val4.position - t.position; float sqrMagnitude2 = ((Vector3)(ref val3)).sqrMagnitude; if (sqrMagnitude2 > num) { num = sqrMagnitude2; val = val4; } } } if (!Object.op_Implicit((Object)(object)val)) { return t.position; } return val.position; } private static void Rot(Transform t, Vector3 axis, float deg) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)t)) { t.rotation = Quaternion.AngleAxis(deg, axis) * t.rotation; } } private void LateUpdate() { //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: 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_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: 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_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_05b7: Unknown result type (might be due to invalid IL or missing references) //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05d4: 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_0632: Unknown result type (might be due to invalid IL or missing references) //IL_0637: Unknown result type (might be due to invalid IL or missing references) //IL_0620: Unknown result type (might be due to invalid IL or missing references) //IL_063c: Unknown result type (might be due to invalid IL or missing references) //IL_0646: Unknown result type (might be due to invalid IL or missing references) //IL_0659: Unknown result type (might be due to invalid IL or missing references) //IL_065e: Unknown result type (might be due to invalid IL or missing references) //IL_0668: Unknown result type (might be due to invalid IL or missing references) //IL_067b: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_068a: Unknown result type (might be due to invalid IL or missing references) //IL_068c: Unknown result type (might be due to invalid IL or missing references) //IL_06a2: Unknown result type (might be due to invalid IL or missing references) //IL_06a7: Unknown result type (might be due to invalid IL or missing references) //IL_06b1: Unknown result type (might be due to invalid IL or missing references) //IL_06c4: Unknown result type (might be due to invalid IL or missing references) //IL_06c9: Unknown result type (might be due to invalid IL or missing references) //IL_06d3: Unknown result type (might be due to invalid IL or missing references) //IL_06d5: Unknown result type (might be due to invalid IL or missing references) //IL_05fe: Unknown result type (might be due to invalid IL or missing references) //IL_0603: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03d4: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_0418: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_0427: Unknown result type (might be due to invalid IL or missing references) //IL_0429: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_044e: Unknown result type (might be due to invalid IL or missing references) //IL_0461: Unknown result type (might be due to invalid IL or missing references) //IL_0466: Unknown result type (might be due to invalid IL or missing references) //IL_0470: Unknown result type (might be due to invalid IL or missing references) //IL_0472: Unknown result type (might be due to invalid IL or missing references) //IL_0488: Unknown result type (might be due to invalid IL or missing references) //IL_048d: Unknown result type (might be due to invalid IL or missing references) //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_0499: Unknown result type (might be due to invalid IL or missing references) //IL_0734: Unknown result type (might be due to invalid IL or missing references) //IL_073b: Unknown result type (might be due to invalid IL or missing references) //IL_0742: Unknown result type (might be due to invalid IL or missing references) //IL_0782: Unknown result type (might be due to invalid IL or missing references) //IL_0765: Unknown result type (might be due to invalid IL or missing references) //IL_076c: Unknown result type (might be due to invalid IL or missing references) //IL_0773: Unknown result type (might be due to invalid IL or missing references) //IL_050b: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_051b: Unknown result type (might be due to invalid IL or missing references) //IL_0520: Unknown result type (might be due to invalid IL or missing references) //IL_0522: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_052b: Unknown result type (might be due to invalid IL or missing references) //IL_0530: Unknown result type (might be due to invalid IL or missing references) //IL_07d5: Unknown result type (might be due to invalid IL or missing references) //IL_053f: Unknown result type (might be due to invalid IL or missing references) //IL_0544: 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_054a: Unknown result type (might be due to invalid IL or missing references) //IL_0575: Unknown result type (might be due to invalid IL or missing references) //IL_057a: Unknown result type (might be due to invalid IL or missing references) //IL_057e: Unknown result type (might be due to invalid IL or missing references) //IL_0561: Unknown result type (might be due to invalid IL or missing references) //IL_0566: Unknown result type (might be due to invalid IL or missing references) //IL_056a: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.characterMotor) || bones == null) { return; } CharacterMotor characterMotor = body.characterMotor; bool flag = !characterMotor.isGrounded; if (flag && !wasAirborne) { airTime = 0f; loggedAir = false; } if (!flag && wasAirborne && airTime > 0.25f) { landT = 0f; } wasAirborne = flag; airTime += Time.deltaTime; landT += Time.deltaTime; bool flag2 = SkillOwnsBody(); float num = ((flag && !flag2) ? 1f : 0f); float num2 = ((num > weight) ? 14.285714f : 10f); if (flag2) { num2 = 20f; } weight = Mathf.MoveTowards(weight, num, num2 * Time.deltaTime); float num3 = ((!flag && !flag2 && landT < 0.22f) ? Mathf.Sin(Mathf.Clamp01(landT / 0.22f) * (float)Math.PI) : 0f); if (flag && airTime > 0.15f && !loggedAir) { loggedAir = true; ManualLogSource log = EchoProvidencePlugin.Log; object[] obj = new object[5] { weight, flag2, characterMotor.velocity.y, null, null }; object obj2; if (fullBodyLayer < 0) { obj2 = "-"; } else { AnimatorStateInfo currentAnimatorStateInfo = animator.GetCurrentAnimatorStateInfo(fullBodyLayer); obj2 = StateName(((AnimatorStateInfo)(ref currentAnimatorStateInfo)).shortNameHash); } obj[3] = obj2; EntityStateMachine obj3 = bodyEsm; obj[4] = ((obj3 == null) ? null : ((object)obj3.state)?.GetType().Name); log.LogInfo((object)string.Format("[air] airborne w={0:0.00} blocked={1} vy={2:0.0} fb={3} esm={4}", obj)); } if (weight <= 0.001f && num3 <= 0.001f) { return; } for (int i = 0; i < bones.Length; i++) { pos[i] = bones[i].localPosition; rot[i] = bones[i].localRotation; } Vector3 val = ((Component)body).transform.right; Vector3 forward = ((Component)body).transform.forward; Vector3 val2; if (Object.op_Implicit((Object)(object)body.characterDirection)) { forward = body.characterDirection.forward; val2 = Vector3.Cross(Vector3.up, forward); val = ((Vector3)(ref val2)).normalized; } float num10; if (weight > 0.001f) { if (Object.op_Implicit((Object)(object)idleClip)) { idleClip.SampleAnimation(((Component)animator).gameObject, 0f); } float y = characterMotor.velocity.y; float num4 = Mathf.Max(8f, body.jumpPower); float num5 = ((y > 0f) ? Mathf.Lerp(0.55f, 1f, 1f - Mathf.Clamp01(y / num4)) : Mathf.Lerp(1f, 0.3f, Mathf.Clamp01((0f - y) / 18f))); float num6 = Mathf.Clamp01(y / num4); float num7 = Mathf.Clamp01((0f - y) / 18f); Vector3 up = Vector3.up; Bend(chest, Object.op_Implicit((Object)(object)chest) ? (chest.position + up) : Vector3.zero, val, 22f * num5, forward); Bend(thighL, Tip(thighL), val, 80f * num5, forward); Bend(calfL, Tip(calfL), val, 120f * num5, -forward); Bend(footL, Tip(footL), val, 30f * num5, -up); Bend(thighR, Tip(thighR), val, 50f * num5, forward); Bend(calfR, Tip(calfR), val, 95f * num5, -forward); Bend(footR, Tip(footR), val, 25f * num5, -up); float num8 = 45f * num6; float num9 = 55f * num7; float deg = 20f + 35f * num7; Transform[] array = (Transform[])(object)new Transform[2] { armL, armR }; foreach (Transform val3 in array) { if (Object.op_Implicit((Object)(object)val3) && Object.op_Implicit((Object)(object)chest)) { val2 = Vector3.Project(val3.position - chest.position, val); Vector3 normalized = ((Vector3)(ref val2)).normalized; if (num8 > 0.5f) { Bend(val3, Tip(val3), val, num8, -forward); } if (num9 > 0.5f) { Bend(val3, Tip(val3), val, num9, forward); } Bend(val3, Tip(val3), forward, deg, normalized); } } num10 = weight; } else { if (Object.op_Implicit((Object)(object)pelvis)) { Transform obj4 = pelvis; obj4.position += Vector3.down * (0.35f * num3 * ((Component)body).transform.lossyScale.y * ((body.radius > 0f) ? 1f : 1f)); } Bend(chest, Object.op_Implicit((Object)(object)chest) ? (chest.position + Vector3.up) : Vector3.zero, val, 14f * num3, forward); Bend(thighL, Tip(thighL), val, 40f * num3, forward); Bend(calfL, Tip(calfL), val, 70f * num3, -forward); Bend(thighR, Tip(thighR), val, 40f * num3, forward); Bend(calfR, Tip(calfR), val, 70f * num3, -forward); if (Object.op_Implicit((Object)(object)body.modelLocator)) { Object.op_Implicit((Object)(object)body.modelLocator.modelBaseTransform); } num10 = 1f; } if (num10 < 0.999f) { for (int k = 0; k < bones.Length; k++) { Transform val4 = bones[k]; val4.localRotation = Quaternion.Slerp(rot[k], val4.localRotation, num10); val4.localPosition = (keepPos.Contains(val4) ? pos[k] : Vector3.Lerp(pos[k], val4.localPosition, num10)); } return; } foreach (Transform keepPo in keepPos) { int num11 = Array.IndexOf(bones, keepPo); if (num11 >= 0) { keepPo.localPosition = pos[num11]; } } } } [DefaultExecutionOrder(1000)] public class EchoWalkSpeed : MonoBehaviour { private Animator animator; private static readonly int WalkSpeed = Animator.StringToHash("walkSpeed"); private float lastWritten = float.NaN; private void Start() { animator = ((Component)this).GetComponentInChildren<Animator>(); } private void Update() { if (Object.op_Implicit((Object)(object)animator)) { float num = animator.GetFloat(WalkSpeed); if (num != lastWritten && !float.IsNaN(num) && !float.IsInfinity(num)) { lastWritten = Mathf.Clamp(num * EchoProvidencePlugin.cWalkAnimSpeed.Value, 0f, 60f); animator.SetFloat(WalkSpeed, lastWritten); } } } } public class AutoTest : MonoBehaviour { private string dir; private StreamWriter log; private int shot; private CharacterBody body; private bool aimLock; private bool holdSpecial; private Vector3? overrideAim; private Vector3? overrideMove; private void Start() { dir = Path.Combine(Path.GetDirectoryName(Paths.BepInExRootPath), "EchoTest", EchoProvidencePlugin.cAutoTestMode.Value + "_" + DateTime.Now.ToString("HHmmss")); Directory.CreateDirectory(dir); log = new StreamWriter(Path.Combine(dir, "log.txt"), append: false, Encoding.UTF8) { AutoFlush = true }; GlobalEventManager.onServerDamageDealt += OnDamage; GlobalEventManager.onCharacterDeathGlobal += delegate(DamageReport r) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)r.attackerBody) && Object.op_Implicit((Object)(object)((Component)r.attackerBody).GetComponent<EchoProvPlayerMarker>())) { CharacterBody victimBody = r.victimBody; L($"KILL {((victimBody != null) ? ((Object)victimBody).name : null)} src={r.damageInfo.damageType.damageSource}"); } }; ((MonoBehaviour)this).StartCoroutine(Main()); } private void L(string s) { log?.WriteLine($"[{Time.realtimeSinceStartup:0.00}] {s}"); EchoProvidencePlugin.Log.LogInfo((object)("[autotest] " + s)); } private void OnDamage(DamageReport r) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)r.attackerBody) && Object.op_Implicit((Object)(object)((Component)r.attackerBody).GetComponent<EchoProvPlayerMarker>())) { L(string.Format("DMG {0:0} src={1} crit={2} victim={3} t={4:0.00}", r.damageDealt, r.damageInfo.damageType.damageSource, r.damageInfo.crit, Object.op_Implicit((Object)(object)r.victimBody) ? ((Object)r.victimBody).name : "?", Time.time)); } } private IEnumerator Shot(string name) { yield return (object)new WaitForEndOfFrame(); try { Texture2D val = ScreenCapture.CaptureScreenshotAsTexture(); int num = 1280; int num2 = Mathf.RoundToInt(1280f * (float)((Texture)val).height / (float)((Texture)val).width); RenderTexture temporary = RenderTexture.GetTemporary(num, num2, 0); Graphics.Blit((Texture)(object)val, temporary); RenderTexture active = RenderTexture.active; RenderTexture.active = temporary; Texture2D val2 = new Texture2D(num, num2, (TextureFormat)3, false); val2.ReadPixels(new Rect(0f, 0f, (float)num, (float)num2), 0, 0); val2.Apply(); RenderTexture.active = active; RenderTexture.ReleaseTemporary(temporary); File.WriteAllBytes(Path.Combine(dir, $"{shot++:00}_{name}.jpg"), ImageConversion.EncodeToJPG(val2, 88)); Object.Destroy((Object)(object)val); Object.Destroy((Object)(object)val2); } catch (Exception ex) { L("shot failed " + ex.Message); } } private IEnumerator WaitFor(Func<bool> cond, float timeout, string what) { float t = 0f; while (!cond() && t < timeout) { t += Time.unscaledDeltaTime; yield return null; } L((cond() ? "ok: " : "TIMEOUT: ") + what); } private IEnumerator Main() { yield return WaitFor(() => (Object)(object)Object.FindObjectOfType<MainMenuController>() != (Object)null, 120f, "main menu"); yield return (object)new WaitForSecondsRealtime(1f); Console.instance.SubmitCmd((NetworkUser)null, "host 0", false); yield return WaitFor(() => Object.op_Implicit((Object)(object)PreGameController.instance) && NetworkUser.readOnlyLocalPlayersList.Count > 0, 60f, "lobby"); yield return (object)new WaitForSecondsRealtime(1f); NetworkUser.readOnlyLocalPlayersList[0].CallCmdSetBodyPreference(BodyCatalog.FindBodyIndex(EchoProvidencePlugin.bodyPrefab)); yield return (object)new WaitForSecondsRealtime(0.5f); Console.instance.SubmitCmd((NetworkUser)null, "pregame_start_run", false); yield return WaitFor(() => (Object)(object)(body = ((IEnumerable<CharacterBody>)CharacterBody.readOnlyInstancesList).FirstOrDefault((Func<CharacterBody, bool>)((CharacterBody b) => Object.op_Implicit((Object)(object)b) && Object.op_Implicit((Object)(object)((Component)b).GetComponent<EchoProvPlayerMarker>()) && b.hasEffectiveAuthority))) != (Object)null, 120f, "echo body in run"); if (!Object.op_Implicit((Object)(object)body)) { Quit(); yield break; } yield return (object)new WaitForSecondsRealtime(2f); body.healthComponent.godMode = true; ((MonoBehaviour)this).StartCoroutine(InputOverride()); ((MonoBehaviour)this).StartCoroutine(WatchWalk()); yield return Shot("spawned"); Vector3 fwd = body.inputBank.aimDirection; fwd.y = 0f; ((Vector3)(ref fwd)).Normalize(); if (EchoProvidencePlugin.cAutoTestMode.Value == "poses") { yield return PoseTest(); Quit(); yield break; } if (EchoProvidencePlugin.cAutoTestMode.Value == "collapse") { yield return CollapseTest(); Quit(); yield break; } if (EchoProvidencePlugin.cAutoTestMode.Value == "wurm") { yield return WurmTest(); Quit(); yield break; } if (EchoProvidencePlugin.cAutoTestMode.Value == "stun") { yield return StunTest(); Quit(); yield break; } if (EchoProvidencePlugin.cAutoTestMode.Value == "meteor") { yield return MeteorTest(); Quit(); yield break; } if (EchoProvidencePlugin.cAutoTestMode.Value == "jump") { yield return JumpTest(); Quit(); yield break; } if (EchoProvidencePlugin.cAutoTestMode.Value == "gallery") { yield return Gallery(fwd); Quit(); yield break; } if (EchoProvidencePlugin.cAutoTestMode.Value == "jumpblink") { yield return JumpTest(); } SpawnTargets(fwd); yield return (object)new WaitForSecondsRealtime(1f); yield return Shot("targets"); if (EchoProvidencePlugin.cAutoTestMode.Value == "blink" || EchoProvidencePlugin.cAutoTestMode.Value == "jumpblink") { yield return BlinkTest(fwd); Quit(); yield break; } for (int pass = 0; pass < 2; pass++) { Time.timeScale = 0.2f; overrideAim = fwd; bool flag = body.skillLocator.utility.ExecuteIfReady(); L($"cleave pass {pass} executed={flag}"); float t0 = Time.time; while (Time.time - t0 < 1.1f) { yield return Shot($"cleave{pass}_{Time.time - t0:0.00}"); yield return (object)new WaitForSecondsRealtime(0.4f); } Time.timeScale = 1f; yield return (object)new WaitForSecondsRealtime(1.5f); yield return Shot($"cleave{pass}_after"); fwd = -fwd; body.characterDirection.forward = fwd; body.skillLocator.utility.Reset(); yield return (object)new WaitForSecondsRealtime(1f); } SpawnTargets(fwd); yield return (object)new WaitForSecondsRealtime(2f); Time.timeScale = 0.3f; overrideAim = fwd; body.skillLocator.primary.ExecuteIfReady(); for (int pass = 0; pass < 5; pass++) { yield return Shot($"primary_{pass}"); yield return (object)new WaitForSecondsRealtime(0.35f); } Time.timeScale = 1f; yield return (object)new WaitForSecondsRealtime(1.5f); Time.timeScale = 0.3f; body.skillLocator.special.ExecuteIfReady(); for (int pass = 0; pass < 6; pass++) { yield return Shot($"special_{pass}"); yield return (object)new WaitForSecondsRealtime(0.4f); } Time.timeScale = 1f; yield return (object)new WaitForSecondsRealtime(1f); L("done"); Quit(); } private IEnumerator Gallery(Vector3 fwd) { //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) string[] array = new string[16] { "RoR2/DLC4/GhastlyPursuitStartSplitVFX.prefab", "RoR2/DLC4/GhastlyPursuitEndSplitVFX.prefab", "RoR2/DLC4/GhastlyPursuitShadowSplitVFX.prefab", "RoR2/DLC4/ProvDashImpVFX.prefab", "RoR2/DLC4/ProvDashStrikeTrailMeshVFX.prefab", "RoR2/DLC4/ShadCloneSpawnInVFX.prefab", "RoR2/DLC4/ProvBlinkStrikeBlinkOutVFX.prefab", "RoR2/DLC4/ProvBlinkStrikeBlinkInVFX.prefab", "RoR2/DLC4/ProvBlinkStrikeSwingVFX.prefab", "RoR2/DLC4/ProvBlinkStrikeSwordBlinkVFX.prefab", "RoR2/DLC4/ShadProvBlinkStrikeSwingVFX.prefab", "RoR2/DLC4/ShadProvDashImpVFX.prefab", "RoR2/DLC4/UmbraEyeFlashVFX.prefab", "RoR2/DLC4/Reaper/ReaperAssailSwipe.prefab", "RoR2/Base/Merc/OmniImpactVFXSlashMerc.prefab", "RoR2/DLC4/ProvBlinkDownSwingVFX.prefab" }; Vector3 right = Vector3.Cross(Vector3.up, fwd); Vector3 at = body.footPosition + fwd * 9f + Vector3.up * 1.4f; string[] array2 = array; foreach (string text in array2) { GameObject val = null; try { val = Addressables.LoadAssetAsync<GameObject>((object)text).WaitForCompletion(); } catch { } if (!Object.op_Implicit((Object)(object)val)) { L("gallery missing " + text); continue; } string n = Path.GetFileNameWithoutExtension(text); GameObject inst = Object.Instantiate<GameObject>(val, at, Quaternion.LookRotation(right)); inst.transform.localScale = val.transform.localScale * EchoProvidencePlugin.sizeScale; ParticleSystem[] componentsInChildren = inst.GetComponentsInChildren<ParticleSystem>(true); for (int j = 0; j < componentsInChildren.Length; j++) { MainModule main = componentsInChildren[j].main; ((MainModule)(ref main)).scalingMode = (ParticleSystemScalingMode)0; } EffectComponent component = inst.GetComponent<EffectComponent>(); if (Object.op_Implicit((Object)(object)component)) { component.effectData = new EffectData { origin = at, rotation = inst.transform.rotation, scale = inst.transform.localScale.x }; } Time.timeScale = 0.5f; yield return (object)new WaitForSecondsRealtime(0.06f); yield return Shot(n + "_a"); yield return (object)new WaitForSecondsRealtime(0.3f); yield return Shot(n + "_b"); yield return (object)new WaitForSecondsRealtime(0.6f); yield return Shot(n + "_c"); Time.timeScale = 1f; if (Object.op_Implicit((Object)(object)inst)) { Object.Destroy((Object)(object)inst); } yield return (object)new WaitForSecondsRealtime(1.2f); } EchoAfterimage echoAfterimage = EchoAfterimage.Create(body, body.footPosition + fwd * 7f, right, authority: false); if (Object.op_Implicit((Object)(object)echoAfterimage)) { echoAfterimage.SetEnd(body.footPosition + fwd * 7f + right * 8f); } Time.timeScale = 0.4f; for (int i = 0; i < 6; i++) { yield return Shot($"echo_{i}"); yield return (object)new WaitForSecondsRealtime(0.3f); } Time.timeScale = 1f; L("gallery done"); } private IEnumerator BlinkTest(Vector3 fwd) { //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) GenericSkill sec = body.skillLocator.secondary; L($"secondary skill = {sec.skillDef.skillName} stock={sec.stock}"); aimLock = true; ((MonoBehaviour)this).StartCoroutine(AimAtNearestMonster()); for (int pass = 0; pass < 3; pass++) { bool weak = pass == 2; ClearMonsters(); yield return (object)new WaitForSecondsRealtime(0.5f); fwd = body.inputBank.aimDirection; fwd.y = 0f; ((Vector3)(ref fwd)).Normalize(); SpawnTargets(fwd, (!weak) ? 30 : 0, (!weak) ? new float[1] { 12f } : new float[2] { 11f, 18f }); yield return (object)new WaitForSecondsRealtime(1f); sec.Reset(); Time.timeScale = 0.2f; yield return (object)new WaitForSecondsRealtime(0.3f); bool flag = sec.ExecuteIfReady(); L($"blink pass {pass} executed={flag} weak={weak}"); float t0 = Time.time; while (Time.time - t0 < 0.95f) { yield return Shot($"blink{pass}_{Time.time - t0:0.00}"); yield return (object)new WaitForSecondsRealtime(0.35f); } Time.timeScale = 1f; yield return (object)new WaitForSecondsRealtime(0.3f); L($"after pass {pass}: stock={sec.stock}"); yield return Shot($"blink{pass}_after"); if (weak && sec.stock > 0) { Time.timeScale = 0.3f; flag = sec.ExecuteIfReady(); L($"chain executed={flag}"); for (int i = 0; i < 5; i++) { yield return Shot($"chain_{i}"); yield return (object)new WaitForSecondsRealtime(0.3f); } Time.timeScale = 1f; yield return (object)new WaitForSecondsRealtime(0.6f); L($"after chain stock={sec.stock}"); } yield return (object)new WaitForSecondsRealtime(0.4f); } ClearMonsters(); yield return (object)new WaitForSecondsRealtime(0.4f); aimLock = false; yield return null; overrideAim = Vector3.up; yield return (object)new WaitForSecondsRealtime(0.3f); sec.Reset(); Vector3 before = ((Component)body).transform.position; bool fired = sec.ExecuteIfReady(); yield return (object)new WaitForSecondsRealtime(0.5f); overrideAim = null; overrideMove = null; AutoTest autoTest = this; object arg = fired; Vector3 val = ((Component)body).transform.position - before; autoTest.L($"no-target: executed={arg} moved={((Vector3)(ref val)).magnitude:0.0}m stock={sec.stock} " + (fired ? "FAIL" : "PASS")); } private IEnumerator PoseTest() { Transform mt = body.modelLocator.modelTransform; Animator anim = ((Component)mt).GetComponentInChildren<Animator>(); Dictionary<string, AnimationClip> clips = new Dictionary<string, AnimationClip>(); AnimationClip[] animationClips = anim.runtimeAnimatorController.animationClips; foreach (AnimationClip val in animationClips) { if (Object.op_Implicit((Object)(object)val) && !clips.ContainsKey(((Object)val).name)) { clips[((Object)val).name] = val; } } string[] array = new string[14] { "idle_air", "fly_forward", "FSArmature|Jump", "dash_forward_enter", "dash_forward_loop", "dash_forward_exit", "spawn_in_clone_air", "blink_in", "blink_out", "blink_strike_slash_recover_loop", "summon_clone_loop", "counter", "idle", "run" }; Camera cam = Camera.main; string[] array2 = array; foreach (string n in array2) { if (!clips.TryGetValue(n, out var clip)) { L("no clip " + n); continue; } float[] array3 = new float[3] { 0.15f, 0.5f, 0.85f }; foreach (float t in array3) { yield return (object)new WaitForEndOfFrame(); clip.SampleAnimation(((Component)anim).gameObject, t * clip.length); GameObject root = new GameObject("pose"); root.transform.SetPositionAndRotation(mt.position, mt.rotation); List<Mesh> meshes = new List<Mesh>(); SkinnedMeshRenderer[] componentsInChildren = ((Component)mt).GetComponentsInChildren<SkinnedMeshRenderer>(); foreach (SkinnedMeshRenderer val2 in componentsInChildren) { if (((Renderer)val2).enabled && Object.op_Implicit((Object)(object)val2.sharedMesh)) { Mesh val3 = new Mesh(); val2.BakeMesh(val3, true); meshes.Add(val3); GameObject val4 = new GameObject(((Object)val2).name); val4.transform.SetPositionAndRotation(((Component)val2).transform.position, ((Component)val2).transform.rotation); val4.transform.SetParent(root.transform, true); val4.AddComponent<MeshFilter>().sharedMesh = val3; ((Renderer)val4.AddComponent<MeshRenderer>()).sharedMaterials = ((Renderer)val2).sharedMaterials; } } Vector3 forward = ((Component)cam).transform.forward; forward.y = 0f; ((Vector3)(ref forward)).Normalize(); root.transform.position = ((Component)cam).transform.position + forward * 6f + ((Component)cam).transform.right * 2.2f + Vector3.down * 2.2f; root.transform.rotation = Quaternion.LookRotation(Quaternion.AngleAxis(35f, Vector3.up) * -forward); yield return null; yield return Shot($"pose_{n.Replace('|', '_')}_{t:0.00}"); Object.Destroy((Object)(object)root); foreach (Mesh item in meshes) { Object.Destroy((Object)(object)item); } } clip = null; } } private IEnumerator MeteorTest() { Vector3 fwd = body.characterDirection.forward; fwd.y = 0f; ((Vector3)(ref fwd)).Normalize(); AutoTest autoTest = this; Vector3 val = fwd * 14f + Vector3.down * 3f; autoTest.overrideAim = ((Vector3)(ref val)).normalized; EntityStateMachine esm = EntityStateMachine.FindByCustomName(((Component)body).gameObject, "Body"); float[] array = new float[2] { 0f, 3f }; foreach (float hold in array) { ClearMonsters(); SpawnTargets(fwd, 30, new float[3] { 12f, 14f, 16f }); yield return (object)new WaitForSecondsRealtime(1f); L($"meteor hold={hold}"); body.skillLocator.special.SetSkillOverride((object)this, EchoProvidencePlugin.meteorDef, (SkillOverridePriority)4); body.skillLocator.special.Reset(); holdSpecial = true; EchoMeteorCharge.TestHold = hold > 0f; yield return null; GenericSkill special = body.skillLocator.special; bool flag = special.ExecuteIfReady(); L($"execute={flag} skill={special.skillDef?.skillName} stock={special.stock} cd={special.cooldownRemaining:0.0} body={((object)esm.state)?.GetType().Name}"); float t0 = Time.time; bool shot = false; while (Time.time - t0 < hold) { if (!shot && Time.time - t0 > 1.3f) { shot = true; L("while holding: body=" + ((object)esm.state)?.GetType().Name); yield return Shot("meteor_charging"); } yield return null; } holdSpecial = false; EchoMeteorCharge.TestHold = false; float t1 = Time.time; while (Time.time - t1 < 1.4f) { yield return Shot($"meteor{hold}_{Time.time - t1:0.00}"); yield return (object)new WaitForSecondsRealtime(0.25f); } body.skillLocator.special.UnsetSkillOverride((object)this, EchoProvidencePlugin.meteorDef, (SkillOverridePriority)4); yield return (object)new WaitForSecondsRealtime(0.5f); } } private IEnumerator StunTest() { Transform coreTransform = body.coreTransform; Transform aimOriginTransform = body.aimOriginTransform; L(string.Format("foot={0} core={1} ({2}) aimOrigin={3} ({4}) top={5} radius={6} bestFit={7}", body.footPosition, body.corePosition, Object.op_Implicit((Object)(object)coreTransform) ? (((Object)coreTransform).name + " parent=" + (Object.op_Implicit((Object)(object)coreTransform.parent) ? ((Object)coreTransform.parent).name : "-")) : "none", body.aimOrigin, Object.op_Implicit((Object)(object)aimOriginTransform) ? ((Object)aimOriginTransform).name : "none", ((Component)body).transform.position + Vector3.up * body.characterMotor.capsuleHeight, body.radius, body.bestFitRadius)); HurtBox[] componentsInChildren = ((Component)body.modelLocator.modelTransform).GetComponentsInChildren<HurtBox>(true); foreach (HurtBox val in componentsInChildren) { Collider collider = val.collider; AutoTest autoTest = this; string name = ((Object)val).name; object arg = val.isBullseye; object arg2; if (!Object.op_Implicit((Object)(object)collider)) { arg2 = "-"; } else { Bounds bounds = collider.bounds; string? text = ((object)((Bounds)(ref bounds)).center/*cast due to .constrained prefix*/).ToString(); bounds = collider.bounds; arg2 = text + "/" + ((object)((Bounds)(ref bounds)).size/*cast due to .constrained prefix*/).ToString(); } autoTest.L($"hurtbox {name} main={arg} bounds={arg2}"); } body.healthComponent.AddBarrier(body.healthComponent.fullCombinedHealth * 0.5f); yield return (object)new WaitForSecondsRealtime(0.6f); L($"after: foot={body.footPosition} core={body.corePosition} bestFit={body.bestFitRadius}"); yield return Shot("barrier_check"); EntityStateMachine esm = EntityStateMachine.FindByCustomName(((Component)body).gameObject, "Body"); EntityStateMachine wesm = EntityStateMachine.FindByCustomName(((Component)body).gameObject, "Weapon"); Vector3 fwd = body.characterDirection.forward; fwd.y = 0f; ((Vector3)(ref fwd)).Normalize(); string[] array = new string[4] { "stun", "freeze", "shock", "stun-while-swinging" }; string[] array2 = array; foreach (string kind in array2) { L("--- " + kind); if (kind == "stun-while-swinging") { body.skillLocator.primary.ExecuteIfReady(); yield return (object)new WaitForSecondsRealtime(0.1f); } SetStateOnHurt component = ((Component)body).GetComponent<SetStateOnHurt>(); if (kind.StartsWith("stun")) { component.SetStun(1.5f); } else if (kind == "freeze") { component.SetFrozen(1.5f); } else { component.SetShock(1.5f); } for (int k = 0; k < 14; k++) { overrideMove = ((k > 2) ? fwd : Vector3.zero); Animator componentInChildren = ((Component)body.modelLocator.modelTransform).GetComponentInChildren<Animator>(); AutoTest autoTest2 = this; object[] obj = new object[9] { (float)k * 0.25f, ((object)esm.state)?.GetType().Name, null, null, null, null, null, null, null }; obj[2] = ((wesm == null) ? null : ((object)wesm.state)?.GetType().Name); obj[3] = body.footPosition; obj[4] = body.characterMotor.velocity; obj[5] = ((Behaviour)((BaseCharacterController)body.characterMotor).Motor).enabled; obj[6] = body.inputBank.moveVector; obj[7] = body.moveSpeed; obj[8] = (Object.op_Implicit((Object)(object)componentInChildren) ? ((Behaviour)componentInChildren).enabled.ToString() : "-"); autoTest2.L(string.Format("t={0:0.00} body={1} weapon={2} pos={3} vel={4} kcc={5} move={6} speed={7} anim={8}", obj)); if (k == 6) { yield return Shot(kind + "_moving"); } yield return (object)new WaitForSecondsRealtime(0.25f); } overrideMove = Vector3.zero; fwd = -fwd; yield return (object)new WaitForSecondsRealtime(0.5f); } } private IEnumerator WurmTest() { Vector3 forward = body.characterDirection.forward; forward.y = 0f; ((Vector3)(ref forward)).Normalize(); overrideAim = forward; SpawnTargets(forward, 30, new float[3] { 8f, 14f, 20f }); yield return (object)new WaitForSecondsRealtime(1f); EntityStateMachine esm = EntityStateMachine.FindByCustomName(((Component)body).gameObject, "Body"); for (int pass = 0; pass < 2; pass++) { Time.timeScale = 0.4f; HuntressTracker component = ((Component)body).GetComponent<HuntressTracker>(); L("casting Wurm Glaive, target=" + ((Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.GetTrackingTarget())) ? ((Object)component.GetTrackingTarget().healthComponent).name : "none")); using (Fx.Use(Fx.For(body))) { esm.SetNextState((EntityState)(object)new EchoWurmGlaive()); } float t0 = Time.time; while (Time.time - t0 < 2.6f) { WurmVisual[] array = Object.FindObjectsOfType<WurmVisual>(); foreach (WurmVisual wurmVisual in array) { SkinnedMeshRenderer componentInChildren = ((Component)wurmVisual).GetComponentInChildren<SkinnedMeshRenderer>(true); AutoTest autoTest = this; string text = $"wurm head={wurmVisual.HeadPos} root={((Component)wurmVisual).transform.position} active={((Component)wurmVisual).gameObject.activeInHierarchy} "; object obj; if (!Object.op_Implicit((Object)(object)componentInChildren)) { obj = "no renderer"; } else { object[] obj2 = new object[8] { ((Renderer)componentInChildren).enabled, ((Renderer)componentInChildren).isVisible, null, null, null, null, null, null }; Bounds bounds = ((Renderer)componentInChildren).bounds; obj2[2] = ((Bounds)(ref bounds)).center; bounds = ((Renderer)componentInChildren).bounds; obj2[3] = ((Bounds)(ref bounds)).size; obj2[4] = ((Component)componentInChildren).gameObject.layer; obj2[5] = (Object.op_Implicit((Object)(object)((Renderer)componentInChildren).sharedMaterial) ? (((Object)((Renderer)componentInChildren).sharedMaterial).name + "/" + ((Object)((Renderer)componentInChildren).sharedMaterial.shader).name) : "none"); obj2[6] = componentInChildren.bones?.Length; obj2[7] = (Object.op_Implicit((Object)(object)componentInChildren.rootBone) ? (((Object)componentInChildren.rootBone).name + "@" + ((object)componentInChildren.rootBone.position/*cast due to .constrained prefix*/).ToString()) : "none"); obj = string.Format("r.enabled={0} visible={1} bounds={2}/{3} layer={4} mat={5} bones={6} root={7}", obj2); } autoTest.L(text + (string?)obj); } L($"me={body.footPosition}"); yield return Shot($"wurm{pass}_{Time.time - t0:0.00}"); yield return (object)new WaitForSecondsRealtime(0.3f); } Time.timeScale = 1f; yield return (object)new WaitForSecondsRealtime(1f); } } private IEnumerator CollapseTest() { GenericSkill sp = body.skillLocator.special; L("special = " + sp.skillDef.skillName); for (int pass = 0; pass < 2; pass++) { Vector3 fwd = body.characterDirection.forward; fwd.y = 0f; ((Vector3)(ref fwd)).Normalize(); overrideAim = fwd; SpawnTargets(fwd, 30, new float[5] { 5f, 9f, 13f, 18f, 23f }); yield return (object)new WaitForSecondsRealtime(1f); yield return Shot($"collapse{pass}_pre"); sp.Reset(); Time.timeScale = 0.35f; float num = ((pass == 0) ? 45f : 80f); overrideAim = Vector3.RotateTowards(fwd, Vector3.up, num * ((float)Math.PI / 180f), 0f); L($"aim pitch {num}"); L($"collapse pass {pass} executed={sp.ExecuteIfReady()}"); float t0 = Time.time; while (Time.time - t0 < 1.9f) { yield return Shot($"collapse{pass}_{Time.time - t0:0.00}"); yield return (object)new WaitForSecondsRealtime(0.4f); } Time.timeScale = 1f; yield return (object)new WaitForSecondsRealtime(0.6f); ClearMonsters(); yield return (object)new WaitForSecondsRealtime(0.3f); body.characterDirection.forward = -fwd; yield return (object)new WaitForSecondsRealtime(0.5f); fwd = default(Vector3); } overrideAim = null; overrideMove = null; } private IEnumerator JumpTest() { yield return Shot("jump_ground"); for (int pass = 0; pass < 2; pass++) { Vector3 val = (Object.op_Implicit((Object)(object)Camera.main) ? ((Component)Camera.main).transform.right : body.characterDirection.forward); val.y = 0f; ((Vector3)(ref val)).Normalize(); body.characterDirection.forward = val; overrideMove = ((pass == 1) ? val : Vector3.zero); yield return (object)new WaitForSecondsRealtime(0.4f); Time.timeScale = 0.35f; GenericCharacterMain.ApplyJumpVelocity(body.characterMotor, body, 1f, 1f, false); CharacterMotor characterMotor = body.characterMotor; characterMotor.jumpCount++; float t0 = Time.time; while (Time.time - t0 < 1.4f) { yield return Shot(string.Format("jump{0}_{1:0.00}_{2}", pass, Time.time - t0, body.characterMotor.isGrounded ? "G" : "A")); yield return (object)new WaitForSecondsRealtime(0.25f); } Time.timeScale = 1f; overrideMove = Vector3.zero; yield return (object)new WaitForSecondsRealtime(0.4f); } overrideAim = null; overrideMove = null; } private IEnumerator WatchWalk() { Animator an = ((Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.modelLocator) && Object.op_Implicit((Object)(object)body.modelLocator.modelTransform)) ? ((Component)body.modelLocator.modelTransform).GetComponentInChildren<Animator>() : null); while (Object.op_Implicit((Object)(object)an)) { L(string.Format("walkSpeed={0:0.00} pos={1}", an.GetFloat("walkSpeed"), ((Component)body).transform.position)); yield return (object)new WaitForSecondsRealtime(1f); } } private IEnumerator InputOverride() { while (true) { if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.inputBank)) { if (overrideAim.HasValue) { body.inputBank.aimDirection = overrideAim.Value; } if (overrideMove.HasValue) { body.inputBank.moveVector = overrideMove.Value; } if (holdSpecial) { ((ButtonState)(ref body.inputBank.skill4)).PushState(true); } } yield return null; } } private IEnumerator AimAtNearestMonster() { while (aimLock && Object.op_Implicit((Object)(object)body)) { CharacterBody val = null; float num = float.MaxValue; Vector3 val2; foreach (CharacterBody readOnlyInstances in CharacterBody.readOnlyInstancesList) { if (Object.op_Implicit((Object)(object)readOnlyInstances) && Object.op_Implicit((Object)(object)readOnlyInstances.teamComponent) && (int)readOnlyInstances.teamComponent.teamIndex == 2 && Object.op_Implicit((Object)(object)readOnlyInstances.healthComponent) && readOnlyInstances.healthComponent.alive) { val2 = readOnlyInstances.corePosition - body.corePosition; float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude; if (sqrMagnitude < num) { num = sqrMagnitude; val = readOnlyInstances; } } } if (Object.op_Implicit((Object)(object)val)) { AutoTest autoTest = this; val2 = val.corePosition - body.inputBank.aimOrigin; autoTest.overrideAim = ((Vector3)(ref val2)).normalized; } else { overrideAim = Vector3.up; } yield return null; } } private void ClearMonsters() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Invalid comparison between Unknown and I4 //IL_0054: 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) foreach (CharacterBody item in CharacterBody.readOnlyInstancesList.ToList()) { if (Object.op_Implicit((Object)(object)item) && Object.op_Implicit((Object)(object)item.teamComponent) && (int)item.teamComponent.teamIndex == 2 && Object.op_Implicit((Object)(object)item.healthComponent)) { try { item.healthComponent.Suicide((GameObject)null, (GameObject)null, default(DamageTypeCombo)); } catch (Exception ex) { L("clear: " + ex.Message); } } } } private void SpawnTargets(Vector3 fwd) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) SpawnTargets(fwd, 30, new float[4] { 5f, 9f, 13f, 17f }); } private void SpawnTargets(Vector3 fwd, int boostHp, float[] dists) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: 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) //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_00ef: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) GameObject val = MasterCatalog.FindMasterPrefab("LemurianMaster"); if (!Object.op_Implicit((Object)(object)val)) { L("no lemurian master"); return; } Vector3 val2 = Vector3.Cross(Vector3.up, fwd); RaycastHit val5 = default(RaycastHit); for (int i = 0; i < dists.Length; i++) { Vector3 val3 = body.footPosition + fwd * dists[i] + val2 * ((i % 2 == 0) ? 1.2f : (-1.2f)) + Vector3.up * 3f; Vector3 val4 = val3; Vector3 down = Vector3.down; LayerIndex world = LayerIndex.world; if (Physics.Raycast(val4, down, ref val5, 20f, LayerMask.op_Implicit(((LayerIndex)(ref world)).mask))) { val3 = ((RaycastHit)(ref val5)).point + Vector3.up * 0.5f; } CharacterMaster val6 = new MasterSummon { masterPrefab = val, position = val3, rotation = Quaternion.LookRotation(-fwd), teamIndexOverride = (TeamIndex)2, ignoreTeamMemberLimit = true, useAmbientLevel = true }.Perform(); if (Object.op_Implicit((Object)(object)val6)) { BaseAI[] components = ((Component)val6).GetComponents<BaseAI>(); for (int j = 0; j < components.Length; j++) { Object.Destroy((Object)(object)components[j]); } AISkillDriver[] components2 = ((Component)val6).GetComponents<AISkillDriver>(); for (int j = 0; j < components2.Length; j++) { Object.Destroy((Object)(object)components2[j]); } if (boostHp > 0) { val6.inventory.GiveItemPermanent(Items.BoostHp, boostHp); } } } L("targets spawned"); } private void Quit() { L("quitting"); Time.timeScale = 1f; log?.Flush(); Application.Quit(); } } public class EchoBlinkStrike : BaseSkillState { private enum Phase { Vanish, Hang, Slash, Recover } private const float VanishDur = 0.14f; private const float HangDur = 0.17f; private const float SlashMaxDur = 0.2f; private const float RecoverDur = 0.3f; private const float NoTargetRecover = 0.12f; private Phase phase; private float phaseAge; private CharacterBody target; private bool hasTarget; private bool hidden; private bool impacted; private Vector3 slashStart; private Vector3 slashEnd; private CharacterModel model; private HurtBoxGroup hurtBoxes; private float hitstop; public override void OnEnter() { //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); HuntressTracker component = ((EntityState)this).GetComponent<HuntressTracker>(); HurtBox val = (Object.op_Implicit((Object)(object)component) ? component.GetTrackingTarget() : null); target = ((Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.healthComponent) && val.healthComponent.alive) ? val.healthComponent.body : null); hasTarget = Object.op_Implicit((Object)(object)target); if (((EntityState)this).isAuthority && hasTarget) { (((EntityState)this).GetComponent<BlinkRefundTracker>() ?? ((EntityState)this).gameObject.AddComponent<BlinkRefundTracker>()).castId++; } if (!hasTarget) { if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator) && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator.secondary)) { ((EntityState)this).skillLocator.secondary.AddOneStock(); } if (((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } return; } Transform modelTransform = ((EntityState)this).GetModelTransform(); if (Object.op_Implicit((Object)(object)modelTransform)) { model = ((Component)modelTransform).GetComponent<CharacterModel>(); hurtBoxes = ((Component)modelTransform).GetComponent<HurtBoxGroup>(); } ((EntityState)this).PlayCrossfade("FullBody, Override", "Teleport Out", "Teleport.playbackRate", 0.196f, 0.04f); Util.PlaySound("Play_Boss_Providence_Primary_Desperation_Vanish", ((EntityState)this).gameObject); Fx.Spawn(Fx.blinkOut, ((EntityState)this).characterBody.corePosition, ((EntityState)this).transform.rotation); EchoAfterimage.CreateFading(((EntityState)this).characterBody); if (NetworkServer.active) { ((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 0.61f); } if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } } private void Hide(bool h) { if (h != hidden) { hidden = h; int num = (h ? 1 : (-1)); if (Object.op_Implicit((Object)(object)model)) { CharacterModel obj = model; obj.invisibilityCount += num; } if (Object.op_Implicit((Object)(object)hurtBoxes)) { HurtBoxGroup obj2 = hurtBoxes; obj2.hurtBoxesDeactivatorCounter += num; } } } private void Next(Phase p) { phase = p; phaseAge = 0f; Trace("phase " + p); } private static void Trace(string m) { EchoProvidencePlugin.Log.LogInfo((object)("[blinktrace] " + m)); } public override void FixedUpdate() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0256: 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_0261: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0207: 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) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: 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) ((EntityState)this).FixedUpdate(); if (!hasTarget) { return; } float deltaTime = ((EntityState)this).GetDeltaTime(); if (hitstop > 0f) { hitstop -= deltaTime; if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).isAuthority) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } return; } phaseAge += deltaTime; if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && phase != Phase.Recover) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } switch (phase) { case Phase.Vanish: if (phaseAge >= 0.077f) { Hide(h: true); } if (phaseAge >= 0.14f) { if (((EntityState)this).isAuthority) { Teleport(); } Appear(); Next(hasTarget ? Phase.Hang : Phase.Recover); } break; case Phase.Hang: FaceTarget(); if (phaseAge >= 0.17f) { Next(Phase.Slash); ((EntityState)this).PlayAnimation("FullBody, Override", "Down Slam, Slash", "DownSlam.playbackRate", 0.44000003f, 0f); Util.PlaySound("Play_Boss_Providence_Primary_SwordLunge_SwordSwingRight", ((EntityState)this).gameObject); Fx.Spawn(Fx.downSwing, ((EntityState)this).characterBody.corePosition, Quaternion.LookRotation(Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).transform.forward)); slashStart = ((EntityState)this).transform.position; Vector3 val2 = ((EntityState)this).transform.position - ((EntityState)this).characterBody.footPosition; slashEnd = GroundBelow((Object.op_Implicit((Object)(object)target) && target.healthComponent.alive) ? target.footPosition : (((EntityState)this).characterBody.footPosition + Vector3.down * 4f)) + val2 + Vector3.up * 0.05f; } break; case Phase.Slash: if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { float num = Mathf.Clamp01(phaseAge / 0.2f); float num2 = num * num; Vector3 val = Vector3.Lerp(slashStart, slashEnd, num2); ((BaseCharacterController)((EntityState)this).characterMotor).Motor.SetPosition(val, true); } if (!impacted && phaseAge >= 0.2f) { impacted = true; Impact(); hitstop = 0.09f; Next(Phase.Recover); ((EntityState)this).PlayCrossfade("FullBody, Override", "Down Slam, Exit", "DownSlam.playbackRate", 0.39000002f, 0.05f); } break; case Phase.Recover: if (((EntityState)this).isAuthority && phaseAge >= (hasTarget ? 0.3f : 0.12f)) { ((EntityState)this).outer.SetNextStateToMain(); } break; } } private void FaceTarget() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) && Object.op_Implicit((Object)(object)target)) { Vector3 val = target.corePosition - ((EntityState)this).transform.position; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude > 0.01f) { ((EntityState)this).characterDirection.forward = ((Vector3)(ref val)).normalized; } } } private static Vector3 GroundBelow(Vector3 p) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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_0029: 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_003d: Unknown result type (might be due to invalid IL or missing references) Vector3 val = p + Vector3.up * 2f; Vector3 down = Vector3.down; LayerIndex world = LayerIndex.world; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(val, down, ref val2, 12f, LayerMask.op_Implicit(((LayerIndex)(ref world)).mask), (QueryTriggerInteraction)1)) { return ((RaycastHit)(ref val2)).point; } return p; } private void Teleport() { //IL_0010: 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_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020f: 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) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: 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_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) Trace("teleport"); Vector3 val = ((EntityState)this).transform.position - ((EntityState)this).characterBody.footPosition; Vector3 val3; LayerIndex world; if (Object.op_Implicit((Object)(object)target) && target.healthComponent.alive) { Vector3 val2 = target.corePosition - ((EntityState)this).characterBody.corePosition; val2.y = 0f; if (((Vector3)(ref val2)).sqrMagnitude < 0.01f) { val2 = ((EntityState)this).transform.forward; } ((Vector3)(ref val2)).Normalize(); float num = Mathf.Max(1f, target.radius); bool flag = (Object)(object)target.characterMotor == (Object)null || !target.characterMotor.isGrounded; val3 = (flag ? target.corePosition : target.footPosition) + val2 * (2.2f + num) + Vector3.up * (flag ? 2.5f : (4f + num * 0.5f)); Vector3 corePosition = target.corePosition; Vector3 val4 = val3 - corePosition; Vector3 normalized = ((Vector3)(ref val4)).normalized; float magnitude = ((Vector3)(ref val4)).magnitude; world = LayerIndex.world; RaycastHit val5 = default(RaycastHit); if (Physics.SphereCast(corePosition, 0.6f, normalized, ref val5, magnitude, LayerMask.op_Implicit(((LayerIndex)(ref world)).mask), (QueryTriggerInteraction)1)) { val3 = corePosition + ((Vector3)(ref val4)).normalized * Mathf.Max(0f, ((RaycastHit)(ref val5)).distance - 0.5f); } } else { Ray aimRay = ((BaseState)this).GetAimRay(); float num2 = EchoProvidencePlugin.cBlinkRange.Value; Vector3 origin = ((Ray)(ref aimRay)).origin; Vector3 direction = ((Ray)(ref aimRay)).direction; float num3 = num2; world = LayerIndex.world; RaycastHit val6 = default(RaycastHit); if (Physics.SphereCast(origin, 0.6f, direction, ref val6, num3, LayerMask.op_Implicit(((LayerIndex)(ref world)).mask), (QueryTriggerInteraction)1)) { num2 = Mathf.Max(0f, ((RaycastHit)(ref val6)).distance - 0.8f); } val3 = ((Ray)(ref aimRay)).origin + ((Ray)(ref aimRay)).direction * num2 - (((EntityState)this).characterBody.corePosition - ((EntityState)this).characterBody.footPosition); } ((BaseCharacterController)((EntityState)this).characterMotor).Motor.SetPositionAndRotation(val3 + val, Quaternion.identity, true); FaceTarget(); } private void Appear() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) Trace("appear"); Hide(h: false); Util.PlaySound("Play_Boss_Providence_Primary_Desperation_Appearance", ((EntityState)this).gameObject); Fx.Spawn(Fx.blinkIn, ((EntityState)this).characterBody.corePosition, ((EntityState)this).transform.rotation); Fx.FlashOverlay(model, 0.35f); if (hasTarget) { ((EntityState)this).PlayCrossfade("FullBody, Override", "Teleport In", "Teleport.playbackRate", 0.306f, 0.03f); } else { ((EntityState)this).PlayCrossfade("FullBody, Override", "BufferEmpty", 0.15f); } } private void Impact() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016a: 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_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Expected O, but got Unknown //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: 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_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_020b: 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) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_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_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) Trace("impact"); Vector3 position = ((EntityState)this).transform.position; Util.PlaySound("Play_Boss_Providence_Primary_Desperation_SwordGroundImpact", ((EntityState)this).gameObject); Fx.Spawn(Fx.smashExplosion, position, Quaternion.identity); EchoProvidencePlugin.Shake(position, 1.8f, 0.35f); if (((EntityState)this).isAuthority) { bool crit = ((BaseState)this).RollCrit(); Vector3 position2 = ((Object.op_Implicit((Object)(object)target) && target.healthComponent.alive) ? target.corePosition : (((EntityState)this).characterBody.corePosition + ((EntityState)this).characterDirection.forward * 2f)); BlastAttack val = new BlastAttack { attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject, teamIndex = ((BaseState)this).GetTeam(), position = position2, radius = 2.5f + (Object.op_Implicit((Object)(object)target) ? (target.radius * 0.5f) : 0f), baseDamage = ((BaseState)this).damageStat * EchoProvidencePlugin.cBlinkSlashDamage.Value, baseForce = 600f, bonusForce = Vector3.down * 800f, crit = crit, procCoefficient = 1f, falloffModel = (FalloffModel)0, attackerFiltering = (AttackerFiltering)2, damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)0), (DamageTypeExtended)0, (DamageSource)2), impactEffect = EffectCatalog.FindEffectIndexFromPrefab(EchoProvidencePlugin.slashHitEffect) }; DamageAPI.AddModdedDamageType(val, BlinkRefund.SlashType); val.Fire(); new BlastAttack { attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject, teamIndex = ((BaseState)this).GetTeam(), position = position + Vector3.up * 0.5f, radius = EchoProvidencePlugin.cBlinkExplosionRadius.Value, baseDamage = ((BaseState)this).damageStat * EchoProvidencePlugin.cBlinkExplosionDamage.Value, baseForce = 1400f, bonusForce = Vector3.up * 900f, crit = crit, procCoefficient = 0.8f, falloffModel = (FalloffModel)0, attackerFiltering = (AttackerFiltering)2, damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)0), (DamageTypeExtended)0, (DamageSource)2) }.Fire(); } } public override void OnExit() { Hide(h: false); if (!((EntityState)this).outer.destroying && phase != Phase.Recover) { ((EntityState)this).PlayCrossfade("FullBody, Override", "BufferEmpty", 0.15f); } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { if (phase == Phase.Recover && phaseAge > 0.135f) { return (InterruptPriority)1; } return (InterruptPriority)7; } } public class BlinkRefundTracker : MonoBehaviour { public int castId; public int refundedCastId = -1; } internal static class BlinkRefund { internal class RefundMessage : INetMessage, ISerializableObject { public NetworkInstanceId bodyNetId; public void Serialize(NetworkWriter w) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) w.Write(bodyNetId); } public void Deserialize(NetworkReader r) { //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) bodyNetId = r.ReadNetworkId(); } public void OnReceived() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) GameObject val = Util.FindNetworkObject(bodyNetId); CharacterBody val2 = (Object.op_Implicit((Object)(object)val) ? val.GetComponent<CharacterBody>() : null); EchoProvidencePlugin.Log.LogInfo((object)string.Format("[blink] refund msg body={0} auth={1}", Object.op_Implicit((Object)(object)val2) ? ((Object)val2).name : "null", Object.op_Implicit((Object)(object)val2) && val2.hasEffectiveAuthority)); if (!Object.op_Implicit((Object)(object)val2) || !val2.hasEffectiveAuthority || !Object.op_Implicit((Object)(object)val2.skillLocator)) { return; } GenericSkill secondary = val2.skillLocator.secondary; EchoProvidencePlugin.Log.LogInfo((object)$"[blink] stock {((secondary != null) ? new int?(secondary.stock) : ((int?)null))}/{((secondary != null) ? new int?(secondary.maxStock) : ((int?)null))}"); if (!Object.op_Implicit((Object)(object)secondary) || secondary.stock >= secondary.maxStock) { return; } BlinkRefundTracker blinkRefundTracker = ((Component)val2).GetComponent<BlinkRefundTracker>() ?? ((Component)val2).gameObject.AddComponent<BlinkRefundTracker>(); if (blinkRefundTracker.castId != blinkRefundTracker.refundedCastId) { blinkRefundTracker.refundedCastId = blinkRefundTracker.castId; float num = Mathf.Max(0f, secondary.cooldownRemaining); secondary.rechargeStopwatch += num * EchoProvidencePlugin.cBlinkKillCooldownCut.Value; EchoProvidencePlugin.Log.LogInfo((object)$"[blink] cooldown cut: {num:0.0}s -> {secondary.cooldownRemaining:0.0}s"); Util.PlaySound("Play_Boss_Providence_ShadowClone_Spawn", ((Component)val2).gameObject); Transform val3 = (Object.op_Implicit((Object)(object)val2.modelLocator) ? val2.modelLocator.modelTransform : null); using (Fx.Use(Fx.For(val2))) { Fx.FlashOverlay(Object.op_Implicit((Object)(object)val3) ? ((Component)val3).GetComponent<CharacterModel>() : null, 0.5f); } EchoProvidencePlugin.Log.LogDebug((object)"Blink Strike refunded"); } } } internal static ModdedDamageType SlashType; internal static void Init() { //IL_0000: 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) SlashType = DamageAPI.ReserveDamageType(); NetworkingAPI.RegisterMessageType<RefundMessage>(); GlobalEventManager.onCharacterDeathGlobal += OnDeath; } private static void OnDeath(DamageReport r) { //IL_003c: 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_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active && r?.damageInfo != null && Object.op_Implicit((Object)(object)r.attackerBody) && Object.op_Implicit((Object)(object)((Component)r.attackerBody).GetComponent<EchoProvPlayerMarker>())) { bool flag = DamageAPI.HasModdedDamageType(r.damageInfo, SlashType); ManualLogSource log = EchoProvidencePlugin.Log; CharacterBody victimBody = r.victimBody; log.LogInfo((object)$"[blink] kill {((victimBody != null) ? ((Object)victimBody).name : null)} src={r.damageInfo.damageType.damageSource} slashType={flag}"); if (flag) { NetMessageExtensions.Send((INetMessage)(object)new RefundMessage { bodyNetId = r.attackerBody.networkIdentity.netId }, (NetworkDestination)1); } } } } public class EchoCleave : BaseSkillState { public const float DashDuration = 0.2f; private Vector3 dir; private Vector3 startPos; private EchoAfterimage echo; private OverlapAttack contact; private TrailRenderer trail; private GameObject trailHolder; private uint loopSound; private int oldGoLayer; private bool layersChanged; public override void OnEnter() { //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_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_006f: 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_00da: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: 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_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Expected O, but got Unknown ((BaseState)this).OnEnter(); Ray aimRay = ((BaseState)this).GetAimRay(); dir = ((Ray)(ref aimRay)).direction; if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).characterMotor.isGrounded && dir.y < 0f) { dir.y = 0f; } if (((Vector3)(ref dir)).sqrMagnitude < 0.01f) { dir = ((EntityState)this).transform.forward; } ((Vector3)(ref dir)).Normalize(); startPos = ((EntityState)this).characterBody.footPosition; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(dir.x, 0f, dir.z); if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) && ((Vector3)(ref val)).sqrMagnitude > 0.01f) { ((EntityState)this).characterDirection.forward = ((Vector3)(ref val)).normalized; } if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((BaseCharacterController)((EntityState)this).characterMotor).Motor)) { oldGoLayer = ((EntityState)this).gameObject.layer; ((EntityState)this).gameObject.layer = LayerIndex.GetAppropriateFakeLayerForTeam(((EntityState)this).teamComponent.teamIndex).intVal; ((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers(); KinematicCharacterMotor motor = ((BaseCharacterController)((EntityState)this).characterMotor).Motor; int num = LayerMask.op_Implicit(motor.CollidableLayers); LayerIndex val2 = LayerIndex.enemyBody; int num2 = LayerMask.op_Implicit(((LayerIndex)(ref val2)).mask); val2 = LayerIndex.playerBody; int num3 = num2 | LayerMask.op_Implicit(((LayerIndex)(ref val2)).mask); val2 = LayerIndex.fakeActor; motor.CollidableLayers = LayerMask.op_Implicit(num & ~(num3 | LayerMask.op_Implicit(((LayerIndex)(ref val2)).mask))); layersChanged = true; } ((EntityState)this).PlayCrossfade("FullBody, Override", "Dash Forward, Enter", "GhastlyPursuit.playbackRate", 0.1f, 0.03f); echo = EchoAfterimage.Create(((EntityState)this).characterBody, startPos, dir, ((EntityState)this).isAuthority); Util.PlaySound("Play_Boss_Providence_Utility_GhastlyPursuit_Dash_Start", ((EntityState)this).gameObject); loopSound = Util.PlaySound("Play_Boss_Providence_Utility_GhastlyPursuit_Dash_Loop", ((EntityState)this).gameObject); Fx.Spawn(Fx.startSplit, ((EntityState)this).characterBody.corePosition, Util.QuaternionSafeLookRotation(dir)); AddRimOverlay(0.55f); AttachTrail(); if (NetworkServer.active) { ((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 0.3f); } if (((EntityState)this).isAuthority) { HitBoxGroup val3 = ((BaseState)this).FindHitBoxGroup("EchoSwing"); if (Object.op_Implicit((Object)(object)val3)) { contact = new OverlapAttack { attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject, teamIndex = ((BaseState)this).GetTeam(), damage = ((BaseState)this).damageSt