Decompiled source of V2Overhaul v1.0.0
HarderV2Boss4.0.dll
Decompiled a month ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyCompany("V2Overhaul")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("Modifie V2 pour le rendre plus fort en supprimant le cooldown de la pièce rouge")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("V2Overhaul")] [assembly: AssemblyTitle("V2Overhaul")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace V2Overhaul { public static class V2ExtendedPatches { private static Vector3 lastPlayerPosition; private static Vector3 playerVelocity; private static float lastPositionUpdateTime; private static float yellowBulletSpeed = 75f; private static float blueBulletSpeed = 75f; private static void UpdatePlayerVelocity() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002d: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) try { NewMovement instance = MonoSingleton<NewMovement>.Instance; if ((Object)instance != (Object)null) { Vector3 position = ((Component)instance).transform.position; float time = Time.time; float num = time - lastPositionUpdateTime; playerVelocity = (position - lastPlayerPosition) / num; lastPlayerPosition = position; lastPositionUpdateTime = time; } } catch (Exception) { } } [HarmonyPatch(typeof(Projectile), "Start")] [HarmonyPostfix] public static void Projectile_Start_Postfix(Projectile __instance) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0060: 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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Expected O, but got Unknown //IL_0188: 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_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_0198: 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_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_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_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: 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_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_0218: 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) try { if (IsEnemyProjectile(__instance) && (IsYellowProjectile(__instance) || IsBlueProjectile(__instance)) && !V2Patches.IsCoinShotProjectile(__instance)) { float projectileSpeed = GetProjectileSpeed(__instance); float num = Vector3.Distance(((Component)__instance).transform.position, ((Component)MonoSingleton<NewMovement>.Instance).transform.position); float num2 = num / projectileSpeed; Vector3 val = ((Component)MonoSingleton<NewMovement>.Instance).transform.position + MonoSingleton<NewMovement>.Instance.rb.velocity * num2 * 1f - ((Component)__instance).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(((Component)__instance).transform.position, normalized, ref val2, num, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)1)))) { val = ((RaycastHit)(ref val2)).point - normalized * 0.5f - ((Component)__instance).transform.position; normalized = ((Vector3)(ref val)).normalized; } __instance.speed = projectileSpeed; string text = ((Object)((Component)__instance).gameObject).name.ToLower(); if (text.Contains("shotgun") || text.Contains("pump") || text.Contains("spread") || text.Contains("pellet")) { Vector3 val3 = new Vector3(Random.Range(-1f, 1f), Random.Range(-1f, 1f), Random.Range(-1f, 1f)); Vector3 val4 = ((Vector3)(ref val3)).normalized; val4 -= Vector3.Dot(val4, normalized) * normalized; val4 = ((Vector3)(ref val4)).normalized; float num3 = Mathf.Tan(5f * (MathF.PI / 180f)) * Random.Range(0f, 1f); val3 = normalized + val4 * num3; normalized = ((Vector3)(ref val3)).normalized; } ((Component)__instance).transform.forward = normalized; Rigidbody component = ((Component)__instance).GetComponent<Rigidbody>(); if ((Object)component != (Object)null) { component.velocity = normalized * projectileSpeed; } } } catch (Exception ex) { Debug.Log((object)("V2 Overhaul: Error in Projectile_Start_Postfix: " + ex.Message)); } } private static bool IsEnemyProjectile(Projectile projectile) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown try { string text = LayerMask.LayerToName(((Component)projectile).gameObject.layer); if (text.Contains("Enemy") || text == "EnemyProjectile") { return true; } if ((Object)((Component)projectile).GetComponentInParent<V2>() != (Object)null) { return true; } string name = ((Object)((Component)projectile).gameObject).name; if (name.Contains("Enemy") || name.Contains("V2") || name.Contains("Machine")) { return true; } return false; } catch (Exception) { return false; } } private static bool IsYellowProjectile(Projectile projectile) { try { string text = ((Object)((Component)projectile).gameObject).name.ToLower(); if (text.Contains("shotgun") || text.Contains("pump") || text.Contains("spread") || text.Contains("pellet")) { return false; } if (text.Contains("yellow") || text.Contains("revolver") || text.Contains("pistol") || text.Contains("v2proj") || text.Contains("bullet") || text.Contains("shot")) { return true; } float projectileSpeed = GetProjectileSpeed(projectile); if (projectileSpeed > 80f && projectileSpeed < 150f) { return true; } return false; } catch (Exception) { return false; } } private static bool IsBlueProjectile(Projectile projectile) { try { string text = ((Object)((Component)projectile).gameObject).name.ToLower(); if (text.Contains("blue") || text.Contains("shotgun") || text.Contains("pump") || text.Contains("spread") || text.Contains("pellet")) { return true; } if (GetProjectileSpeed(projectile) < 40f) { return true; } return false; } catch (Exception) { return false; } } private static float GetProjectileSpeed(Projectile projectile) { if (IsYellowProjectile(projectile)) { if (yellowBulletSpeed <= 0f) { yellowBulletSpeed = projectile.speed; } return yellowBulletSpeed; } if (IsBlueProjectile(projectile)) { if (blueBulletSpeed <= 0f) { blueBulletSpeed = projectile.speed; } return blueBulletSpeed; } return projectile.speed; } [HarmonyPatch(typeof(V2), "Start")] [HarmonyPostfix] public static void V2_Start_Postfix(V2 __instance) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown try { Debug.Log((object)"V2 Overhaul: Applying health and attack speed modifications to V2"); EnemyIdentifier component = ((Component)__instance).GetComponent<EnemyIdentifier>(); if ((Object)component != (Object)null) { _ = component.health; component.health *= 4f; FieldInfo field = typeof(EnemyIdentifier).GetField("maxHealth", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null) { float num = (float)field.GetValue(component); field.SetValue(component, num * 4f); } else { Debug.LogWarning((object)"V2 Overhaul: Could not find maxHealth field"); } } else { Debug.LogWarning((object)"V2 Overhaul: Could not find EnemyIdentifier component"); } string[] array = new string[5] { "attackCooldown", "pistolCooldown", "shotgunCooldown", "coinCooldown", "redCoinCooldown" }; foreach (string name in array) { FieldInfo field2 = typeof(V2).GetField(name, BindingFlags.Instance | BindingFlags.NonPublic); if (field2 != null) { float num2 = (float)field2.GetValue(__instance); field2.SetValue(__instance, num2 * 0.1f); } } } catch (Exception) { } } } [BepInPlugin("v2overhaul.extended", "V2 Overhaul Extended", "1.0.0")] public class V2OverhaulExtendedPlugin : BaseUnityPlugin { private static Harmony harmony; private void Awake() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Expected O, but got Unknown try { harmony = new Harmony("com.yourname.v2overhaul.extended"); harmony.PatchAll(typeof(V2ExtendedPatches)); ((BaseUnityPlugin)this).Logger.LogInfo((object)"V2 Overhaul Extended initialized"); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogError((object)("Error initializing V2 Overhaul Extended: " + ex.Message)); } } } [BepInPlugin("v2overhaul", "V2 Overhaul", "1.0.0")] public class V2OverhaulPlugin : BaseUnityPlugin { private static Harmony harmony; private void Awake() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Expected O, but got Unknown try { harmony = new Harmony("com.yourname.v2overhaul"); harmony.PatchAll(typeof(V2Patches)); ((BaseUnityPlugin)this).Logger.LogInfo((object)"V2 Overhaul initialized"); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogError((object)("Error initializing V2 Overhaul: " + ex.Message)); } } } public static class V2Patches { private static MethodInfo shootMethod; private static MethodInfo shootAtPlayerMethod; private static FieldInfo stateField; private static FieldInfo timerField; private static Type coinStateType; private static FieldInfo superField; private static FieldInfo afterChargeStateField; private static bool initialized = false; private static NewMovement cachedPlayer; private static CameraController cachedCamera; private static Transform cachedPlayerTransform; private static Rigidbody cachedPlayerRigidbody; private static List<V2> cachedV2s = new List<V2>(); private static float lastV2CacheTime = 0f; private static Dictionary<Type, Dictionary<string, FieldInfo>> cachedFields = new Dictionary<Type, Dictionary<string, FieldInfo>>(); private static Dictionary<Type, Dictionary<string, MethodInfo>> cachedMethods = new Dictionary<Type, Dictionary<string, MethodInfo>>(); private static Vector3 lastPlayerPosition; private static Vector3 playerVelocity; private static Vector3 playerVerticalVelocity; private static float lastPositionUpdateTime; private static float gravity = -9.81f; private static float coinThrowTimer = 0f; private static bool shouldThrowCoin = false; private static Dictionary<V2, float> v2DodgeCooldowns = new Dictionary<V2, float>(); private static Dictionary<V2, float> v2LastDodgeTime = new Dictionary<V2, float>(); private static float minTimeBetweenDodges = 0.5f; private static Dictionary<Projectile, bool> coinShotProjectiles = new Dictionary<Projectile, bool>(); private static GameObject cachedProjectilePrefab; private static GameObject cachedRocketPrefab; private static Coin[] cachedCoins = (Coin[])(object)new Coin[0]; private static float lastCoinCacheTime = 0f; private static Dictionary<V2, float> v2CoinShootCooldowns = new Dictionary<V2, float>(); private static float coinShootCooldown = 0.3f; private static Dictionary<V2, float> v2RocketCooldowns = new Dictionary<V2, float>(); private static float rocketCooldown = 4f; private static void Initialize() { //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Expected O, but got Unknown //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) if (initialized) { return; } try { shootMethod = GetCachedMethod(typeof(Coin), "Shoot"); shootAtPlayerMethod = GetCachedMethod(typeof(Coin), "ShootAtPlayer"); stateField = GetCachedField(typeof(Coin), "state"); timerField = GetCachedField(typeof(Coin), "timer"); superField = GetCachedField(typeof(Coin), "super"); Type[] nestedTypes = typeof(Coin).GetNestedTypes(BindingFlags.NonPublic); foreach (Type type in nestedTypes) { if (type.IsEnum && type.Name.Contains("State")) { coinStateType = type; break; } } if (coinStateType != null) { FieldInfo[] fields = coinStateType.GetFields(); foreach (FieldInfo fieldInfo in fields) { if (fieldInfo.Name.Contains("Charged") || fieldInfo.Name.Contains("Active") || fieldInfo.Name.Contains("Shoot")) { afterChargeStateField = fieldInfo; break; } } } UpdateCachedReferences(); if ((Object)cachedPlayerTransform != (Object)null) { lastPlayerPosition = cachedPlayerTransform.position; lastPositionUpdateTime = Time.time; } initialized = true; LogDebug("Initialization successful"); } catch (Exception ex) { LogDebug("Error initializing reflection: " + ex.Message); } } private static void UpdateCachedReferences() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown try { if ((Object)cachedPlayer == (Object)null) { cachedPlayer = MonoSingleton<NewMovement>.Instance; if ((Object)cachedPlayer != (Object)null) { cachedPlayerTransform = ((Component)cachedPlayer).transform; cachedPlayerRigidbody = ((Component)cachedPlayer).GetComponent<Rigidbody>(); } } if ((Object)cachedCamera == (Object)null) { cachedCamera = MonoSingleton<CameraController>.Instance; } if (Time.time - lastV2CacheTime > 1f) { lastV2CacheTime = Time.time; cachedV2s.Clear(); cachedV2s.AddRange(Object.FindObjectsOfType<V2>()); } if (Time.time - lastCoinCacheTime > 0.5f) { lastCoinCacheTime = Time.time; cachedCoins = Object.FindObjectsOfType<Coin>(); } } catch (Exception ex) { LogDebug("Error updating cached references: " + ex.Message); } } private static FieldInfo GetCachedField(Type type, string fieldName) { if (!cachedFields.ContainsKey(type)) { cachedFields[type] = new Dictionary<string, FieldInfo>(); } if (!cachedFields[type].ContainsKey(fieldName)) { cachedFields[type][fieldName] = type.GetField(fieldName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } return cachedFields[type][fieldName]; } private static MethodInfo GetCachedMethod(Type type, string methodName) { if (!cachedMethods.ContainsKey(type)) { cachedMethods[type] = new Dictionary<string, MethodInfo>(); } if (!cachedMethods[type].ContainsKey(methodName)) { cachedMethods[type][methodName] = type.GetMethod(methodName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } return cachedMethods[type][methodName]; } private static void LogDebug(string message) { } private static bool GetFieldValueBool(object obj, string fieldName) { FieldInfo cachedField = GetCachedField(obj.GetType(), fieldName); if (cachedField != null) { return (bool)cachedField.GetValue(obj); } return false; } private static float GetFieldValueFloat(object obj, string fieldName) { FieldInfo cachedField = GetCachedField(obj.GetType(), fieldName); if (!(cachedField != null)) { return 0f; } return (float)cachedField.GetValue(obj); } private static void SetFieldValue(object obj, string fieldName, object value) { FieldInfo cachedField = GetCachedField(obj.GetType(), fieldName); if (cachedField != null) { cachedField.SetValue(obj, value); } } private static void InvokeMethod(object obj, string methodName, object[] parameters = null) { MethodInfo cachedMethod = GetCachedMethod(obj.GetType(), methodName); if (cachedMethod != null) { cachedMethod.Invoke(obj, parameters); } } [HarmonyPatch(typeof(V2), "Start")] [HarmonyPostfix] public static void V2_Start_Postfix(V2 __instance) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown try { LogDebug("V2_Start_Postfix exécuté pour " + ((Object)__instance).name); if ((Object)cachedProjectilePrefab == (Object)null) { TryFindProjectilePrefab(__instance); } if ((Object)cachedRocketPrefab == (Object)null) { TryFindRocketPrefab(__instance); } try { string[] obj = new string[8] { "speed", "moveSpeed", "maxSpeed", "runSpeed", "walkSpeed", "baseSpeed", "chaseSpeed", "movementSpeed" }; bool flag = false; string[] array = obj; foreach (string text in array) { FieldInfo field = typeof(V2).GetField(text, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null) { try { float num = (float)field.GetValue(__instance); field.SetValue(__instance, num * 1.25f); LogDebug($"Increased {text} from {num} to {num * 1.25f}"); flag = true; } catch (Exception) { } } } if (!flag) { Rigidbody component = ((Component)__instance).GetComponent<Rigidbody>(); if ((Object)component != (Object)null) { LogDebug("Rigidbody trouvé, modification de la vitesse"); if (component.drag > 0f) { float drag = component.drag; component.drag /= 1.25f; LogDebug($"Decreased Rigidbody drag from {drag} to {component.drag}"); flag = true; } } if (!flag) { MethodInfo[] methods = typeof(V2).GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); foreach (MethodInfo methodInfo in methods) { if (methodInfo.Name.Contains("Move") || methodInfo.Name.Contains("Speed") || methodInfo.Name.Contains("Velocity") || methodInfo.Name.Contains("Chase")) { LogDebug("Méthode liée au mouvement trouvée: " + methodInfo.Name); } } LogDebug("Tentative de patching direct des méthodes de mouvement"); flag = true; } } } catch (Exception ex2) { LogDebug("Erreur lors de la modification de la vitesse: " + ex2.Message); } FieldInfo field2 = typeof(V2).GetField("coinCooldown", BindingFlags.Instance | BindingFlags.NonPublic); if (field2 != null) { field2.SetValue(__instance, 0f); } FieldInfo field3 = typeof(V2).GetField("redCoinCooldown", BindingFlags.Instance | BindingFlags.NonPublic); if (field3 != null) { field3.SetValue(__instance, 0f); } LogDebug("V2 coin cooldown has been set to 0"); } catch (Exception ex3) { LogDebug("Error modifying V2 cooldown: " + ex3.Message); LogDebug("Stack trace: " + ex3.StackTrace); } } private static bool IsEnemyProjectile(Projectile projectile) { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected O, but got Unknown //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Expected O, but got Unknown //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) try { string text = LayerMask.LayerToName(((Component)projectile).gameObject.layer); if (text.Contains("Enemy") || text == "EnemyProjectile") { return true; } string text2 = ((Object)((Component)projectile).gameObject).name.ToLower(); if (text2.Contains("enemy") || text2.Contains("v2") || text2.Contains("machine")) { return true; } Transform parent = ((Component)projectile).transform.parent; if ((Object)parent != (Object)null && (((Object)parent).name.Contains("Enemy") || ((Object)parent).name.Contains("V2"))) { return true; } if ((Object)((Component)projectile).GetComponentInParent<V2>() != (Object)null) { return true; } foreach (V2 cachedV in cachedV2s) { if (!((Object)cachedV == (Object)null) && Vector3.Distance(((Component)cachedV).transform.position, ((Component)projectile).transform.position) < 4f) { return true; } } return false; } catch (Exception) { return false; } } [HarmonyPatch(typeof(V2), "Update")] [HarmonyPostfix] public static void V2_Update_Postfix(V2 __instance) { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Expected O, but got Unknown //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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_0101: 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_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_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_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Expected O, but got Unknown //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Expected O, but got Unknown //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) try { UpdateCachedReferences(); bool fieldValueBool = GetFieldValueBool(__instance, "active"); bool fieldValueBool2 = GetFieldValueBool(__instance, "escaping"); bool flag = false; MethodInfo cachedMethod = GetCachedMethod(typeof(V2), "get_isEnraged"); if (cachedMethod != null) { flag = (bool)cachedMethod.Invoke(__instance, null); } if (!v2DodgeCooldowns.ContainsKey(__instance)) { v2DodgeCooldowns[__instance] = 0f; } if (!v2LastDodgeTime.ContainsKey(__instance)) { v2LastDodgeTime[__instance] = 0f; } if (fieldValueBool && !fieldValueBool2 && Time.frameCount % 3 == 0 && (Object)cachedPlayerTransform != (Object)null && (Object)cachedCamera != (Object)null) { Vector3 position = cachedPlayerTransform.position; Vector3 forward = ((Component)cachedCamera).transform.forward; Vector3 val = ((Component)__instance).transform.position - position; Vector3 normalized = ((Vector3)(ref val)).normalized; if (Vector3.Angle(forward, normalized) < 5f) { float time = Time.time; if (time >= v2DodgeCooldowns[__instance] && time - v2LastDodgeTime[__instance] >= minTimeBetweenDodges) { val = Vector3.Cross(forward, Vector3.up); Vector3 val2 = ((Vector3)(ref val)).normalized; if (Random.Range(0, 2) == 0) { val2 = -val2; } MethodInfo cachedMethod2 = GetCachedMethod(typeof(V2), "ForceDodge"); if (cachedMethod2 != null) { cachedMethod2.Invoke(__instance, new object[1] { val2 }); v2DodgeCooldowns[__instance] = time + 0.2f; v2LastDodgeTime[__instance] = time; LogDebug("V2 a esquivé!"); } } } } if (fieldValueBool && !fieldValueBool2) { if (coinThrowTimer <= 0f) { shouldThrowCoin = true; coinThrowTimer = Random.Range(1f, 6f); LogDebug($"Prochaine pièce dans {coinThrowTimer} secondes"); } else { coinThrowTimer -= Time.deltaTime; } if (shouldThrowCoin && flag) { MethodInfo cachedMethod3 = GetCachedMethod(typeof(V2), "ThrowCoins"); if (cachedMethod3 != null) { SetFieldValue(__instance, "coinsToThrow", 1); cachedMethod3.Invoke(__instance, null); shouldThrowCoin = false; LogDebug("V2 a lancé une pièce"); } } if (Time.frameCount % 5 == 0 && cachedCoins != null && cachedCoins.Length != 0) { Coin val3 = null; float num = float.MaxValue; int num2 = Mathf.Min(cachedCoins.Length, 10); for (int i = 0; i < num2; i++) { Coin val4 = cachedCoins[i]; if ((Object)val4 != (Object)null && !GetFieldValueBool(val4, "shot")) { float num3 = Vector3.Distance(((Component)val4).transform.position, ((Component)__instance).transform.position); if (num3 < num) { num = num3; val3 = val4; } } } if ((Object)val3 != (Object)null) { if (!v2CoinShootCooldowns.ContainsKey(__instance)) { v2CoinShootCooldowns[__instance] = 0f; } if (Time.time >= v2CoinShootCooldowns[__instance]) { CreateInstantProjectileToCoin(__instance, val3); v2CoinShootCooldowns[__instance] = Time.time + coinShootCooldown; LogDebug("Projectile instantané créé vers la pièce!"); } } } } if (fieldValueBool && !fieldValueBool2 && flag) { if (!v2RocketCooldowns.ContainsKey(__instance)) { v2RocketCooldowns[__instance] = 0f; } if (Time.time >= v2RocketCooldowns[__instance] && Time.frameCount % 5 == 0 && Random.Range(0f, 1f) < 0.2f) { FireRocketAtPlayer(__instance); v2RocketCooldowns[__instance] = Time.time + rocketCooldown; LogDebug("V2 a tiré une roquette!"); } } if (Time.frameCount % 6 == 0) { if (GetFieldValueFloat(__instance, "coinCooldown") > 0f) { SetFieldValue(__instance, "coinCooldown", 0f); } if (GetFieldValueFloat(__instance, "redCoinCooldown") > 0f) { SetFieldValue(__instance, "redCoinCooldown", 0f); } } if (Time.frameCount % 2 == 0) { UpdatePlayerVelocity(); } } catch (Exception ex) { LogDebug("Error in V2_Update_Postfix: " + ex.Message); } } private static void UpdatePlayerVelocity() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) try { UpdateCachedReferences(); if (!((Object)cachedPlayer == (Object)null) && !((Object)cachedPlayerRigidbody == (Object)null)) { playerVelocity = cachedPlayerRigidbody.velocity; LogDebug($"Vitesse du joueur (Rigidbody): {playerVelocity}"); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(playerVelocity.x, 0f, playerVelocity.z); LogDebug($"Vitesse horizontale: {((Vector3)(ref val)).magnitude}"); LogDebug($"Vitesse verticale: {playerVelocity.y}"); } } catch (Exception) { } } private static bool IsPlayerGrounded() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)cachedPlayer == (Object)null) { return true; } FieldInfo cachedField = GetCachedField(typeof(NewMovement), "gc"); if (cachedField != null) { object value = cachedField.GetValue(cachedPlayer); if (value != null) { FieldInfo cachedField2 = GetCachedField(value.GetType(), "onGround"); if (cachedField2 != null) { return (bool)cachedField2.GetValue(value); } } } if ((Object)cachedPlayerRigidbody != (Object)null) { return Mathf.Abs(cachedPlayerRigidbody.velocity.y) < 0.1f; } return true; } catch (Exception) { return true; } } [HarmonyPatch(typeof(Nail), "Start")] [HarmonyPostfix] public static void Nail_Start_Postfix(Nail __instance) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_00a3: 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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: 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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_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_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0137: 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_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_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: 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_0155: 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_0176: 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_0188: 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_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) try { if (!__instance.enemy) { return; } UpdateCachedReferences(); if ((Object)cachedPlayerTransform == (Object)null || (Object)cachedPlayerRigidbody == (Object)null) { return; } Rigidbody val = __instance.rb; if ((Object)val == (Object)null) { val = ((Component)__instance).GetComponent<Rigidbody>(); } if (!((Object)val == (Object)null)) { Vector3 val2 = val.velocity; float magnitude = ((Vector3)(ref val2)).magnitude; if (!(magnitude <= 0f)) { Vector3 position = ((Component)__instance).transform.position; Vector3 position2 = cachedPlayerTransform.position; Vector3 velocity = cachedPlayerRigidbody.velocity; float num = Vector3.Distance(position, position2) / magnitude; Vector3 val3 = position2 + velocity * num * 1f; val3.y += 0.85f; val2 = val3 - position; Vector3 normalized = ((Vector3)(ref val2)).normalized; val2 = new Vector3(Random.Range(-1f, 1f), Random.Range(-1f, 1f), Random.Range(-1f, 1f)); Vector3 val4 = ((Vector3)(ref val2)).normalized; val4 -= Vector3.Dot(val4, normalized) * normalized; val4 = ((Vector3)(ref val4)).normalized; float num2 = Mathf.Tan(3f * (MathF.PI / 180f)) * Random.Range(0f, 1f); val2 = normalized + val4 * num2; normalized = ((Vector3)(ref val2)).normalized; val.velocity = normalized * magnitude; LogDebug($"Nail prediction: speed={magnitude}, travelTime={num}s"); } } } catch (Exception ex) { LogDebug("Error in Nail_Start_Postfix: " + ex.Message); } } [HarmonyPatch(typeof(Coin), "Start")] [HarmonyPostfix] public static void Coin_Start_Postfix(Coin __instance) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown try { if (!((Object)__instance.sourceWeapon == (Object)null)) { return; } Initialize(); if (stateField != null) { if (coinStateType != null && afterChargeStateField != null) { stateField.SetValue(__instance, afterChargeStateField.GetValue(null)); LogDebug("Forced coin to charged state!"); } if (timerField != null) { timerField.SetValue(__instance, 999f); LogDebug("Set coin timer to max value!"); } if (superField != null) { superField.SetValue(__instance, true); LogDebug("Set coin to super mode!"); } } } catch (Exception ex) { LogDebug("Error modifying coin behavior: " + ex.Message); } } [HarmonyPatch(typeof(Coin), "Update")] [HarmonyPostfix] public static void Coin_Update_Postfix(Coin __instance) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown try { if (!((Object)__instance.sourceWeapon == (Object)null)) { return; } if (!initialized) { Initialize(); } if (!(stateField != null)) { return; } object value = stateField.GetValue(__instance); if (value == null) { return; } string text = value.ToString(); if (text.Contains("Charging") || text.Contains("Ready") || text.Contains("Wait")) { if (afterChargeStateField != null) { stateField.SetValue(__instance, afterChargeStateField.GetValue(null)); } LogDebug("Forced coin state transition from " + text + "!"); } } catch (Exception) { } } public static bool IsCoinShotProjectile(Projectile proj) { return coinShotProjectiles.ContainsKey(proj); } [HarmonyPatch(typeof(Coin), "EnemyReflect")] [HarmonyPostfix] public static void EnemyReflect_Postfix(Coin __instance) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown try { if (!((Object)__instance.sourceWeapon != (Object)null) && ((MonoBehaviour)__instance).IsInvoking("ShootAtPlayer")) { ((MonoBehaviour)__instance).CancelInvoke("ShootAtPlayer"); ((MonoBehaviour)__instance).Invoke("ShootAtPlayer", 0.05f); LogDebug("Reduced coin shine delay from 0.5s to 0.05s!"); } } catch (Exception ex) { LogDebug("Error in EnemyReflect postfix: " + ex.Message); } } [HarmonyPatch(typeof(Coin), "DelayedReflectRevolver")] [HarmonyPostfix] public static void DelayedReflectRevolver_Postfix(Coin __instance) { try { if (((MonoBehaviour)__instance).IsInvoking("ReflectRevolver")) { ((MonoBehaviour)__instance).CancelInvoke("ReflectRevolver"); ((MonoBehaviour)__instance).Invoke("ReflectRevolver", 0.01f); } } catch (Exception) { } } [HarmonyPatch(typeof(Projectile), "Start")] [HarmonyPostfix] public static void Projectile_Start_Postfix(Projectile __instance) { //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Expected O, but got Unknown //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Expected O, but got Unknown //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_0319: 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_0320: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0326: 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_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Expected O, but got Unknown //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: 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_0147: Expected O, but got Unknown //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Expected O, but got Unknown //IL_0610: Unknown result type (might be due to invalid IL or missing references) //IL_0612: Unknown result type (might be due to invalid IL or missing references) //IL_0614: Unknown result type (might be due to invalid IL or missing references) //IL_0619: Unknown result type (might be due to invalid IL or missing references) //IL_061d: Unknown result type (might be due to invalid IL or missing references) //IL_0622: Unknown result type (might be due to invalid IL or missing references) //IL_0624: Unknown result type (might be due to invalid IL or missing references) //IL_0626: Unknown result type (might be due to invalid IL or missing references) //IL_0631: 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_0639: Unknown result type (might be due to invalid IL or missing references) //IL_0640: Unknown result type (might be due to invalid IL or missing references) //IL_0430: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_0446: Unknown result type (might be due to invalid IL or missing references) //IL_0448: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_0653: Unknown result type (might be due to invalid IL or missing references) //IL_0658: 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_065b: Unknown result type (might be due to invalid IL or missing references) //IL_0660: Unknown result type (might be due to invalid IL or missing references) //IL_0664: Unknown result type (might be due to invalid IL or missing references) //IL_0669: Unknown result type (might be due to invalid IL or missing references) //IL_066b: Unknown result type (might be due to invalid IL or missing references) //IL_0672: Unknown result type (might be due to invalid IL or missing references) //IL_0677: Unknown result type (might be due to invalid IL or missing references) //IL_067c: Unknown result type (might be due to invalid IL or missing references) //IL_067e: Unknown result type (might be due to invalid IL or missing references) //IL_0683: Unknown result type (might be due to invalid IL or missing references) //IL_0687: 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_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Expected O, but got Unknown //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Expected O, but got Unknown //IL_050b: Unknown result type (might be due to invalid IL or missing references) //IL_050d: Unknown result type (might be due to invalid IL or missing references) //IL_0741: Unknown result type (might be due to invalid IL or missing references) //IL_0752: Unknown result type (might be due to invalid IL or missing references) //IL_075d: Expected O, but got Unknown //IL_06d1: Unknown result type (might be due to invalid IL or missing references) //IL_06d6: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06df: Unknown result type (might be due to invalid IL or missing references) //IL_06e1: Unknown result type (might be due to invalid IL or missing references) //IL_06e3: Unknown result type (might be due to invalid IL or missing references) //IL_06e5: Unknown result type (might be due to invalid IL or missing references) //IL_06ec: Unknown result type (might be due to invalid IL or missing references) //IL_06ee: Unknown result type (might be due to invalid IL or missing references) //IL_06f3: Unknown result type (might be due to invalid IL or missing references) //IL_06f8: Unknown result type (might be due to invalid IL or missing references) //IL_06fc: Unknown result type (might be due to invalid IL or missing references) //IL_0701: Unknown result type (might be due to invalid IL or missing references) //IL_0720: Unknown result type (might be due to invalid IL or missing references) //IL_0722: Unknown result type (might be due to invalid IL or missing references) //IL_0726: Unknown result type (might be due to invalid IL or missing references) //IL_072b: Unknown result type (might be due to invalid IL or missing references) //IL_0730: 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_0739: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_0761: 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_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_0586: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_058c: Unknown result type (might be due to invalid IL or missing references) //IL_0591: Unknown result type (might be due to invalid IL or missing references) //IL_0596: Unknown result type (might be due to invalid IL or missing references) //IL_059d: Unknown result type (might be due to invalid IL or missing references) //IL_053d: 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_0543: Unknown result type (might be due to invalid IL or missing references) //IL_0548: Unknown result type (might be due to invalid IL or missing references) //IL_0552: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_055b: Unknown result type (might be due to invalid IL or missing references) //IL_0562: Unknown result type (might be due to invalid IL or missing references) //IL_0567: Unknown result type (might be due to invalid IL or missing references) //IL_056c: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_05ae: Unknown result type (might be due to invalid IL or missing references) //IL_05b0: 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_05d3: Unknown result type (might be due to invalid IL or missing references) //IL_05e9: Unknown result type (might be due to invalid IL or missing references) //IL_05ff: Unknown result type (might be due to invalid IL or missing references) try { LogDebug("Projectile détecté - " + ((Object)((Component)__instance).gameObject).name); if (coinShotProjectiles.ContainsKey(__instance)) { coinShotProjectiles.Remove(__instance); LogDebug("Projectile créé par le mod pour viser une pièce - skip prediction override"); return; } bool flag = IsEnemyProjectile(__instance); LogDebug($"Est un projectile ennemi? {flag}"); if (!flag) { return; } string text = ((Object)((Component)__instance).gameObject).name.ToLower(); bool flag2 = text.Contains("coin"); bool flag3 = text.Contains("shotgun") || text.Contains("pump") || text.Contains("spread") || text.Contains("pellet") || text.Contains("buckshot") || text.Contains("shell"); bool flag4 = false; Coin val = null; if (!flag2) { UpdateCachedReferences(); Coin val2 = null; foreach (V2 cachedV in cachedV2s) { if (!((Object)cachedV == (Object)null) && GetFieldValueBool(cachedV, "shootingForCoin")) { Transform val3 = (Transform)(GetCachedField(typeof(V2), "overrideTarget")?.GetValue(cachedV)); if ((Object)val3 != (Object)null && ((Component)val3).TryGetComponent<Coin>(ref val2)) { flag4 = true; val = val2; LogDebug("V2 tire explicitement sur une pièce"); break; } } } if (!flag4 && cachedCoins != null && cachedCoins.Length != 0) { float num = float.MaxValue; Coin[] array = cachedCoins; foreach (Coin val4 in array) { if (!((Object)val4 == (Object)null) && !GetFieldValueBool(val4, "shot")) { float num2 = Vector3.Distance(((Component)__instance).transform.position, ((Component)val4).transform.position); if (num2 < num && num2 < 500f) { num = num2; val = val4; } } } if ((Object)val != (Object)null) { flag4 = true; LogDebug("Pièce détectée à proximité, forçant V2 à viser"); } } } if (flag2 || (!flag3 && !IsYellowProjectile(__instance)) || (Object)cachedPlayerTransform == (Object)null || (Object)cachedPlayerRigidbody == (Object)null) { return; } Vector3 velocity = cachedPlayerRigidbody.velocity; float projectileSpeed = GetProjectileSpeed(__instance); LogDebug($"Vitesse du projectile: {projectileSpeed}"); if (!(projectileSpeed > 0f)) { return; } Vector3 position = ((Component)__instance).transform.position; Vector3 val5; Vector3 val6; if (flag4 && (Object)val != (Object)null) { val5 = ((Component)val).transform.position; val6 = val5; LogDebug("Visant la pièce: " + ((object)val6).ToString()); } else { Vector3 position2 = cachedPlayerTransform.position; Vector3 val7 = position; Vector3 val8 = position2 - val7; bool num3 = IsPlayerGrounded(); Vector3 zero = Vector3.zero; if (!num3) { zero = Physics.gravity; LogDebug($"Joueur en l'air, gravité appliquée: {zero}"); } else { LogDebug("Joueur au sol, pas de gravité appliquée"); } float num4 = 0f; if (((Vector3)(ref zero)).magnitude > 0.1f) { float num5 = 0f; float num6 = float.MaxValue; for (float num7 = 0f; num7 < 3f; num7 += 0.05f) { Vector3 val9 = position2 + velocity * num7 + 0.5f * zero * num7 * num7; float num8 = projectileSpeed * num7; float num9 = Vector3.Distance(val7, val9); float num10 = Mathf.Abs(num8 - num9); if (num10 < num6) { num6 = num10; num5 = num7; } if (num10 < 0.1f) { break; } } num4 = num5; LogDebug($"Temps d'interception avec gravité: {num4}s (erreur: {num6})"); } else { float num11 = Vector3.Dot(velocity, velocity) - projectileSpeed * projectileSpeed; float num12 = 2f * Vector3.Dot(velocity, val8); float num13 = Vector3.Dot(val8, val8); float num14 = num12 * num12 - 4f * num11 * num13; if (num14 >= 0f) { float num15 = Mathf.Sqrt(num14); float num16 = (0f - num12 + num15) / (2f * num11); float num17 = (0f - num12 - num15) / (2f * num11); if (num16 > 0f && num17 > 0f) { num4 = Mathf.Min(num16, num17); } else if (num16 > 0f) { num4 = num16; } else if (num17 > 0f) { num4 = num17; } LogDebug($"Temps d'interception calculé: {num4}s (discriminant: {num14})"); } else { num4 = Vector3.Distance(position2, position) / projectileSpeed; LogDebug($"Pas de solution quadratique, estimation: {num4}s"); } } Vector3 val10; if (((Vector3)(ref zero)).magnitude > 0.1f) { val10 = position2 + velocity * num4 + 0.5f * zero * num4 * num4; LogDebug($"Position prédite avec gravité: {val10}"); } else { val10 = position2 + velocity * num4; LogDebug($"Position prédite sans gravité: {val10}"); } val5 = Vector3.Lerp(position2, val10, 1f); val5.y += 0.85f; LogDebug($"Position actuelle du joueur: {position2}"); LogDebug($"Vélocité du joueur: {velocity}"); LogDebug($"Position finale ciblée: {val5}"); } val6 = val5 - position; Vector3 normalized = ((Vector3)(ref val6)).normalized; float num18 = Vector3.Distance(position, val5); RaycastHit val11 = default(RaycastHit); if (Physics.Raycast(position, normalized, ref val11, num18, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)1)))) { Vector3 point = ((RaycastHit)(ref val11)).point; val6 = point - position; Vector3 normalized2 = ((Vector3)(ref val6)).normalized; val6 = point - normalized2 * 0.5f - position; normalized = ((Vector3)(ref val6)).normalized; LogDebug("Mur détecté, ajustement de la trajectoire"); } if (flag3) { Vector3 val12 = new Vector3(Random.Range(-1f, 1f), Random.Range(-1f, 1f), Random.Range(-1f, 1f)); Vector3 val13 = ((Vector3)(ref val12)).normalized; val13 -= Vector3.Dot(val13, normalized) * normalized; val13 = ((Vector3)(ref val13)).normalized; float num19 = Mathf.Tan(5f * (MathF.PI / 180f)) * Random.Range(0f, 1f); val12 = normalized + val13 * num19; normalized = ((Vector3)(ref val12)).normalized; } ((Component)__instance).transform.forward = normalized; Rigidbody component = ((Component)__instance).GetComponent<Rigidbody>(); if ((Object)component != (Object)null) { component.velocity = normalized * projectileSpeed; } } catch (Exception ex) { LogDebug("Error applying aim prediction: " + ex.Message); } } private static float GetProjectileSpeed(Projectile projectile) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_0016: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) try { Rigidbody component = ((Component)projectile).GetComponent<Rigidbody>(); if ((Object)component != (Object)null) { Vector3 velocity = component.velocity; if (((Vector3)(ref velocity)).magnitude > 0f) { velocity = component.velocity; return ((Vector3)(ref velocity)).magnitude; } } FieldInfo cachedField = GetCachedField(typeof(Projectile), "speed"); if (cachedField != null) { return (float)cachedField.GetValue(projectile); } } catch (Exception) { } return 80f; } private static bool IsYellowProjectile(Projectile projectile) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) try { string text = ((Object)((Component)projectile).gameObject).name.ToLower(); if (text.Contains("yellow") || text.Contains("revolver") || text.Contains("pistol") || text.Contains("v2proj") || text.Contains("bullet") || text.Contains("shot")) { return true; } if ((Object)((Component)projectile).GetComponentInParent<V2>() != (Object)null && !text.Contains("coin")) { Rigidbody component = ((Component)projectile).GetComponent<Rigidbody>(); if ((Object)component != (Object)null) { Vector3 velocity = component.velocity; if (((Vector3)(ref velocity)).magnitude > 50f) { return true; } } } float projectileSpeed = GetProjectileSpeed(projectile); if (projectileSpeed > 50f && projectileSpeed < 150f) { return true; } return false; } catch (Exception) { return false; } } [HarmonyPatch(typeof(Revolver), "Shoot")] [HarmonyPrefix] public static bool V2_Dodge_Check(Revolver __instance) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: 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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_014f: 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_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: 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_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Expected O, but got Unknown //IL_017b: Expected O, but got Unknown //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Expected O, but got Unknown //IL_019a: Expected O, but got Unknown //IL_0210: Unknown result type (might be due to invalid IL or missing references) try { UpdateCachedReferences(); if ((Object)cachedPlayerTransform == (Object)null || (Object)cachedCamera == (Object)null || cachedV2s.Count == 0) { return true; } Vector3 position = cachedPlayerTransform.position; Vector3 forward = ((Component)cachedCamera).transform.forward; int num = 0; RaycastHit val = default(RaycastHit); foreach (V2 cachedV in cachedV2s) { try { if (!v2DodgeCooldowns.ContainsKey(cachedV)) { v2DodgeCooldowns[cachedV] = 0f; } if (Time.time < v2DodgeCooldowns[cachedV]) { continue; } bool fieldValueBool = GetFieldValueBool(cachedV, "active"); bool fieldValueBool2 = GetFieldValueBool(cachedV, "dodging"); if (!fieldValueBool || fieldValueBool2) { continue; } float num2 = Vector3.Distance(position, ((Component)cachedV).transform.position); if (num2 > 50f) { continue; } Vector3 val2 = ((Component)cachedV).transform.position - position; Vector3 normalized = ((Vector3)(ref val2)).normalized; float num3 = Vector3.Angle(forward, normalized); if (!(num3 < 20f)) { continue; } int mask = LayerMask.GetMask(new string[2] { "Environment", "Default" }); if (!Physics.Raycast(position, normalized, ref val, num2, mask) || !((Object)((Component)((RaycastHit)(ref val)).transform).GetComponentInParent<V2>() != (Object)cachedV) || !((Object)((Component)((RaycastHit)(ref val)).transform).GetComponent<V2>() != (Object)cachedV)) { LogDebug($"V2 va esquiver (angle: {num3}, distance: {num2})"); val2 = Vector3.Cross(forward, Vector3.up); Vector3 val3 = ((Vector3)(ref val2)).normalized; if (Random.Range(0, 2) == 0) { val3 = -val3; } MethodInfo cachedMethod = GetCachedMethod(typeof(V2), "ForceDodge"); if (cachedMethod != null) { cachedMethod.Invoke(cachedV, new object[1] { val3 }); v2DodgeCooldowns[cachedV] = Time.time + 0.2f; LogDebug("V2 a esquivé!"); num++; } } } catch (Exception ex) { LogDebug("Erreur lors de l'esquive pour un V2: " + ex.Message); } } return true; } catch (Exception ex2) { LogDebug("Erreur dans V2_Dodge_Check: " + ex2.Message); return true; } } [HarmonyPatch(typeof(EnemyIdentifier), "DeliverDamage")] [HarmonyPrefix] public static bool EnemyIdentifier_DeliverDamage_Prefix(EnemyIdentifier __instance, GameObject target, Vector3 force, Vector3 hitPoint, float multiplier, bool tryForExplode, float critMultiplier, GameObject sourceWeapon) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Expected O, but got Unknown //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: 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_0158: 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_015f: Unknown result type (might be due to invalid IL or missing references) try { V2 component = ((Component)__instance).GetComponent<V2>(); if ((Object)component == (Object)null) { return true; } bool flag = false; if ((Object)sourceWeapon != (Object)null) { if ((Object)sourceWeapon.GetComponent<Coin>() != (Object)null) { flag = true; LogDebug("Dégâts détectés venant d'une pièce (via sourceWeapon)"); } string text = ((Object)sourceWeapon).name.ToLower(); if (text.Contains("coin") || text.Contains("ricochet")) { flag = true; LogDebug("Dégâts détectés venant d'une pièce (via nom de l'arme)"); } } if (multiplier > 2f || critMultiplier > 1f) { Coin[] array = cachedCoins; foreach (Coin val in array) { if ((Object)val != (Object)null && Vector3.Distance(((Component)val).transform.position, hitPoint) < 1.5f && GetFieldValueBool(val, "shot")) { flag = true; LogDebug("Dégâts détectés venant d'une pièce (via proximité et multiplicateur)"); break; } } } if (flag && Random.Range(0f, 1f) < 0.7f) { MethodInfo cachedMethod = GetCachedMethod(typeof(V2), "ForceDodge"); if (cachedMethod != null) { Vector3 val2 = Vector3.Cross(((Vector3)(ref force)).normalized, Vector3.up); Vector3 val3 = ((Vector3)(ref val2)).normalized; if (Random.Range(0, 2) == 0) { val3 = -val3; } cachedMethod.Invoke(component, new object[1] { val3 }); } return false; } return true; } catch (Exception ex) { LogDebug("Erreur dans EnemyIdentifier_DeliverDamage_Prefix: " + ex.Message); return true; } } private static void CreateInstantProjectileToCoin(V2 v2Instance, Coin targetCoin) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_0096: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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_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_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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_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_012f: 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_014d: Expected O, but got Unknown //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Expected O, but got Unknown //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Expected O, but got Unknown //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: 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_024a: 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) try { if ((Object)cachedProjectilePrefab == (Object)null) { TryFindProjectilePrefab(v2Instance); } if ((Object)cachedProjectilePrefab != (Object)null) { Vector3 val = ((Component)v2Instance).transform.position + ((Component)v2Instance).transform.forward * 1.5f + Vector3.up * 1.5f; float num = 110f; Vector3 position = ((Component)targetCoin).transform.position; Rigidbody component = ((Component)targetCoin).GetComponent<Rigidbody>(); Vector3 val2 = (((Object)component != (Object)null) ? component.velocity : Vector3.zero); float num2 = 0.253f; float num3 = Vector3.Distance(val, position) / num; Vector3 val3 = position + val2 * num3 * num2; num3 = Vector3.Distance(val, val3) / num; val3 = position + val2 * num3 * num2 + 0.5f * Physics.gravity * num3 * num3 * num2; Vector3 val4 = val3 - val; Vector3 normalized = ((Vector3)(ref val4)).normalized; GameObject val5 = Object.Instantiate<GameObject>(cachedProjectilePrefab, val, Quaternion.LookRotation(normalized)); if (!((Object)val5.GetComponent<Projectile>() != (Object)null)) { return; } Rigidbody component2 = val5.GetComponent<Rigidbody>(); if ((Object)component2 != (Object)null) { component2.velocity = normalized * num; } Projectile component3 = val5.GetComponent<Projectile>(); if ((Object)component3 != (Object)null) { coinShotProjectiles[component3] = true; } LogDebug($"Projectile avec prédiction: coin à {position}, vélocité {val2}, prédit à {val3}"); int num4 = LayerMask.NameToLayer("EnemyProjectile"); if (num4 >= 0 && num4 <= 31) { val5.layer = num4; LogDebug($"Layer EnemyProjectile assigné: {num4}"); } else { int layer = cachedProjectilePrefab.layer; if (layer >= 0 && layer <= 31) { val5.layer = layer; LogDebug($"Layer original du prefab utilisé: {layer}"); } else { val5.layer = 0; LogDebug("Layer Default (0) utilisé par défaut"); } } LogDebug($"Projectile créé à {val} vers la pièce à {((Component)targetCoin).transform.position}"); } else { LogDebug("Impossible de trouver le prefab de projectile"); } } catch (Exception ex) { LogDebug("Erreur lors de la création du projectile instantané: " + ex.Message); } } private static void TryFindProjectilePrefab(V2 v2Instance) { //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Expected O, but got Unknown //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown //IL_04f3: Unknown result type (might be due to invalid IL or missing references) //IL_04fe: Expected O, but got Unknown //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Expected O, but got Unknown try { LogDebug("=== RECHERCHE DU PREFAB DE PROJECTILE ==="); LogDebug("--- Méthode 1: Recherche dans les armes de V2 ---"); string[] array = new string[5] { "revolver", "revolverWeapon", "primaryWeapon", "currentWeapon", "weapons" }; foreach (string text in array) { FieldInfo cachedField = GetCachedField(typeof(V2), text); if (!(cachedField != null)) { continue; } object value = cachedField.GetValue(v2Instance); if (value != null) { LogDebug("[ARME TROUVÉE] Champ: " + text + ", Type: " + value.GetType().Name); string[] array2 = new string[6] { "projectile", "revolverBeam", "beam", "bullet", "shot", "yellowProjectile" }; foreach (string text2 in array2) { FieldInfo cachedField2 = GetCachedField(value.GetType(), text2); if (cachedField2 != null) { object value2 = cachedField2.GetValue(value); if (value2 is GameObject) { GameObject val = (GameObject)value2; LogDebug("[PREFAB TROUVÉ] Via " + text + "." + text2 + ": " + ((Object)val).name); cachedProjectilePrefab = val; return; } if (value2 != null) { LogDebug("[CHAMP TROUVÉ] " + text + "." + text2 + " existe mais n'est pas un GameObject (Type: " + value2.GetType().Name + ")"); } } } } else { LogDebug("[ARME NULL] Champ " + text + " existe mais est null"); } } LogDebug("--- Méthode 2: Recherche dans les enfants de V2 ---"); Transform[] componentsInChildren = ((Component)v2Instance).GetComponentsInChildren<Transform>(true); LogDebug($"Nombre d'enfants trouvés: {componentsInChildren.Length}"); Transform[] array3 = componentsInChildren; foreach (Transform val2 in array3) { string text3 = ((Object)val2).name.ToLower(); if (!text3.Contains("revolver") && !text3.Contains("weapon") && !text3.Contains("gun")) { continue; } LogDebug("[ENFANT D'ARME] Nom: " + ((Object)val2).name); Component[] components = ((Component)val2).GetComponents<Component>(); LogDebug($" Composants sur {((Object)val2).name}: {components.Length}"); Component[] array4 = components; foreach (Component val3 in array4) { if ((Object)val3 == (Object)null) { continue; } LogDebug(" [COMPOSANT] Type: " + ((object)val3).GetType().Name); array = new string[5] { "projectile", "revolverBeam", "beam", "bullet", "shot" }; foreach (string text4 in array) { FieldInfo cachedField3 = GetCachedField(((object)val3).GetType(), text4); if (cachedField3 != null) { object value3 = cachedField3.GetValue(val3); if (value3 is GameObject) { GameObject val4 = (GameObject)value3; LogDebug("[PREFAB TROUVÉ] Via enfant " + ((Object)val2).name + "." + ((object)val3).GetType().Name + "." + text4 + ": " + ((Object)val4).name); cachedProjectilePrefab = val4; return; } if (value3 != null) { LogDebug(" [CHAMP] " + text4 + " existe (Type: " + value3.GetType().Name + ")"); } } } } } LogDebug("--- Méthode 3: Recherche dans Resources ---"); GameObject[] array5 = Resources.FindObjectsOfTypeAll<GameObject>(); LogDebug($"Nombre total d'objets dans Resources: {array5.Length}"); int num = 0; GameObject[] array6 = array5; foreach (GameObject val5 in array6) { string text5 = ((Object)val5).name.ToLower(); if ((text5.Contains("yellow") || text5.Contains("revolver") || text5.Contains("v2proj") || text5.Contains("bullet")) && (text5.Contains("projectile") || text5.Contains("beam") || text5.Contains("shot"))) { num++; if ((Object)val5.GetComponent<Projectile>() != (Object)null) { LogDebug("[PREFAB TROUVÉ] Via Resources: " + ((Object)val5).name + " (a un composant Projectile)"); cachedProjectilePrefab = val5; return; } LogDebug("[OBJET TROUVÉ] Via Resources: " + ((Object)val5).name + " (pas de composant Projectile)"); } } LogDebug($"Nombre d'objets correspondants dans Resources: {num}"); LogDebug("--- Méthode 4: Recherche de projectiles existants dans la scène ---"); Projectile[] array7 = Object.FindObjectsOfType<Projectile>(); LogDebug($"Nombre de projectiles dans la scène: {array7.Length}"); Projectile[] array8 = array7; foreach (Projectile val6 in array8) { string text6 = ((Object)((Component)val6).gameObject).name.ToLower(); LogDebug("[PROJECTILE EXISTANT] Nom: " + ((Object)((Component)val6).gameObject).name + ", Layer: " + LayerMask.LayerToName(((Component)val6).gameObject.layer)); if (text6.Contains("yellow") || text6.Contains("revolver") || text6.Contains("v2proj")) { LogDebug("[PREFAB TROUVÉ] Via projectile existant: " + ((Object)((Component)val6).gameObject).name); cachedProjectilePrefab = ((Component)val6).gameObject; return; } } LogDebug("=== AUCUN PREFAB DE PROJECTILE TROUVÉ ==="); } catch (Exception ex) { LogDebug("Erreur lors de la recherche du prefab: " + ex.Message); LogDebug("Stack trace: " + ex.StackTrace); } } private static void TryFindRocketPrefab(V2 v2Instance) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Expected O, but got Unknown //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Expected O, but got Unknown try { LogDebug("=== RECHERCHE DU PREFAB DE ROQUETTE ==="); LogDebug("--- Méthode 1: Recherche de prefabs spécifiques ---"); GameObject[] array = Resources.FindObjectsOfTypeAll<GameObject>(); string[] array2 = new string[4] { "RocketEnemy", "Rocket", "GuttertankRocket", "Cannonball" }; GameObject[] array3; foreach (string text in array2) { array3 = array; foreach (GameObject val in array3) { if ((Object)val == (Object)null || (!(((Object)val).name == text) && !((Object)val).name.Contains(text))) { continue; } string text2 = ((Object)val).name.ToLower(); if (!text2.Contains("shotgun") && !text2.Contains("pump") && !text2.Contains("pellet") && !text2.Contains("grenade")) { string text3 = LayerMask.LayerToName(val.layer); LogDebug("[PREFAB PRIORITAIRE TROUVÉ] Nom: " + ((Object)val).name + ", Layer: " + text3); if (text3 == "Projectile" || text3 == "Default") { LogDebug("[PREFAB SÉLECTIONNÉ] " + ((Object)val).name + " avec layer " + text3); cachedRocketPrefab = val; return; } } } } LogDebug("--- Méthode 2: Recherche large avec filtrage par layer ---"); array3 = array; foreach (GameObject val2 in array3) { if ((Object)val2 == (Object)null) { continue; } string text4 = ((Object)val2).name.ToLower(); if (!text4.Contains("shotgun") && !text4.Contains("pump") && !text4.Contains("pellet") && !text4.Contains("grenade") && (text4.Contains("rocket") || text4.Contains("missile") || text4.Contains("cannonball"))) { string text5 = LayerMask.LayerToName(val2.layer); if (text5 == "Projectile" || text5 == "Default") { LogDebug("[PREFAB TROUVÉ] Nom: " + ((Object)val2).name + ", Layer: " + text5); cachedRocketPrefab = val2; return; } } } LogDebug("--- Méthode 3: Recherche de projectiles explosifs dans la scène ---"); Projectile[] array4 = Object.FindObjectsOfType<Projectile>(); LogDebug($"Nombre de projectiles dans la scène: {array4.Length}"); Projectile[] array5 = array4; foreach (Projectile val3 in array5) { if (!((Object)val3 == (Object)null)) { string text6 = ((Object)((Component)val3).gameObject).name.ToLower(); if (!text6.Contains("shotgun") && !text6.Contains("grenade") && !text6.Contains("pump") && !text6.Contains("pellet") && (text6.Contains("rocket") || text6.Contains("missile") || text6.Contains("cannonball"))) { LogDebug("[PREFAB TROUVÉ] Via projectile existant: " + ((Object)((Component)val3).gameObject).name); cachedRocketPrefab = ((Component)val3).gameObject; return; } } } LogDebug("=== AUCUN PREFAB DE ROQUETTE TROUVÉ ==="); } catch (Exception ex) { LogDebug("Erreur lors de la recherche du prefab de roquette: " + ex.Message); LogDebug("Stack trace: " + ex.StackTrace); } } private static void FireRocketAtPlayer(V2 v2Instance) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: 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_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0135: 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_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: 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_0157: 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_0300: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: 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_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: 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_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Expected O, but got Unknown //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Expected O, but got Unknown //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)cachedRocketPrefab == (Object)null) { LogDebug("Impossible de tirer une roquette: prefab non trouvé"); return; } UpdateCachedReferences(); if ((Object)cachedPlayerTransform == (Object)null || (Object)cachedPlayerRigidbody == (Object)null) { LogDebug("Impossible de tirer une roquette: joueur non trouvé"); return; } Vector3 val = ((Component)v2Instance).transform.position + ((Component)v2Instance).transform.forward * 4f + Vector3.up * 2.5f; Vector3 velocity = cachedPlayerRigidbody.velocity; Vector3 position = cachedPlayerTransform.position; float num = 150f; Vector3 val2 = val; Vector3 val3 = position - val2; bool num2 = IsPlayerGrounded(); Vector3 zero = Vector3.zero; if (!num2) { zero = Physics.gravity; LogDebug($"Roquette: Joueur en l'air, gravité appliquée: {zero}"); } else { LogDebug("Roquette: Joueur au sol, pas de gravité appliquée"); } float num3 = 0f; if (((Vector3)(ref zero)).magnitude > 0.1f) { float num4 = 0f; float num5 = float.MaxValue; for (float num6 = 0f; num6 < 3f; num6 += 0.05f) { Vector3 val4 = position + velocity * num6 + 0.5f * zero * num6 * num6; float num7 = num * num6; float num8 = Vector3.Distance(val2, val4); float num9 = Mathf.Abs(num7 - num8); if (num9 < num5) { num5 = num9; num4 = num6; } if (num9 < 0.1f) { break; } } num3 = num4; LogDebug($"Roquette: Temps d'interception avec gravité: {num3}s (erreur: {num5})"); } else { float num10 = Vector3.Dot(velocity, velocity) - num * num; float num11 = 2f * Vector3.Dot(velocity, val3); float num12 = Vector3.Dot(val3, val3); float num13 = num11 * num11 - 4f * num10 * num12; if (num13 >= 0f) { float num14 = Mathf.Sqrt(num13); float num15 = (0f - num11 + num14) / (2f * num10); float num16 = (0f - num11 - num14) / (2f * num10); if (num15 > 0f && num16 > 0f) { num3 = Mathf.Min(num15, num16); } else if (num15 > 0f) { num3 = num15; } else if (num16 > 0f) { num3 = num16; } LogDebug($"Roquette: Temps d'interception calculé: {num3}s"); } else { num3 = Vector3.Distance(position, val) / num; LogDebug($"Roquette: Pas de solution quadratique, estimation: {num3}s"); } } Vector3 val5; if (((Vector3)(ref zero)).magnitude > 0.1f) { val5 = position + velocity * num3 + 0.5f * zero * num3 * num3; LogDebug($"Roquette: Position prédite avec gravité: {val5}"); } else { val5 = position + velocity * num3; LogDebug($"Roquette: Position prédite sans gravité: {val5}"); } Vector3 val6 = Vector3.Lerp(position, val5, 1f); Vector3 val7 = val6 - val; Vector3 normalized = ((Vector3)(ref val7)).normalized; GameObject val8 = Object.Instantiate<GameObject>(cachedRocketPrefab, val, Quaternion.LookRotation(normalized)); if (!((Object)val8.GetComponent<Projectile>() != (Object)null)) { return; } Rigidbody component = val8.GetComponent<Rigidbody>(); if ((Object)component != (Object)null) { component.velocity = normalized * num; } int num17 = LayerMask.NameToLayer("EnemyProjectile")