Decompiled source of ClusterBomb v1.1.1
MechaSpread.dll
Decompiled 2 months agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.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 MechaSpread { [BepInPlugin("com.lll.mechaspread", "MechaSpread", "1.0.0")] public class MechaSpreadPlugin : BaseUnityPlugin { public const string GUID = "com.lll.mechaspread"; public const string NAME = "MechaSpread"; public const string VERSION = "1.0.0"; public static ConfigEntry<bool> Enabled; public static ConfigEntry<int> BulletMultiplier; public static ConfigEntry<int> PlasmaMultiplier; public static ConfigEntry<float> SpreadAngle; public static ManualLogSource Log; private Harmony _harmony; private void Awake() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Expected O, but got Unknown //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; Enabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enabled", true, "Enable mecha spread shot functionality"); BulletMultiplier = ((BaseUnityPlugin)this).Config.Bind<int>("Multipliers", "BulletMultiplier", 10, new ConfigDescription("Number of bullets to fire per shot", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 50), Array.Empty<object>())); PlasmaMultiplier = ((BaseUnityPlugin)this).Config.Bind<int>("Multipliers", "PlasmaMultiplier", 10, new ConfigDescription("Number of plasma shots to fire per shot", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 50), Array.Empty<object>())); SpreadAngle = ((BaseUnityPlugin)this).Config.Bind<float>("Spread", "SpreadAngle", 15f, new ConfigDescription("Maximum spread angle in degrees from aim direction", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 45f), Array.Empty<object>())); _harmony = new Harmony("com.lll.mechaspread"); _harmony.PatchAll(typeof(MechaSpreadPatch)); ((BaseUnityPlugin)this).Logger.LogInfo((object)"MechaSpread 1.0.0 loaded!"); } private void OnDestroy() { Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } } [HarmonyPatch] public static class MechaSpreadPatch { private static readonly Random rand = new Random(); [HarmonyPatch(typeof(PlayerAction_Combat), "Shoot_Gauss_Local")] [HarmonyPostfix] public static void Shoot_Gauss_Local_Postfix(PlayerAction_Combat __instance, ref EnemyData enemy, int actualDamage) { //IL_00a0: 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_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_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_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0127: 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_0130: 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_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_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0175: 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_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_011b: 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) if (!MechaSpreadPlugin.Enabled.Value) { return; } int num = MechaSpreadPlugin.BulletMultiplier.Value - 1; if (num <= 0) { return; } SkillSystem skillSystem = __instance.skillSystem; Mecha mecha = __instance.mecha; PlanetData localPlanet = GameMain.localPlanet; int astroId = ((localPlanet != null) ? localPlanet.astroId : 0); float value = MechaSpreadPlugin.SpreadAngle.Value; int ammoBulletCount = mecha.ammoBulletCount; int num2 = Math.Min(num, ammoBulletCount); if (num2 <= 0) { return; } mecha.ammoBulletCount -= num2; for (int i = 0; i < num2; i++) { ref LocalGeneralProjectile reference = ref skillSystem.mechaLocalGaussProjectiles.Add(); reference.astroId = astroId; reference.hitIndex = 19; reference.target.type = (ETargetType)4; reference.target.id = enemy.id; reference.caster.type = (ETargetType)15; reference.caster.id = 1; reference.speed = 2.5f; reference.pos = mecha.skillCastLeftL; Vector3 val = VectorLF3.op_Implicit(enemy.pos); if (!enemy.dynamic) { val += ((Vector3)(ref val)).normalized * (SkillSystem.RoughHeightByModelIndex[enemy.modelIndex] * 0.5f); } Vector3 val2 = val - reference.pos; Vector3 dir = ApplySpread(((Vector3)(ref val2)).normalized, value); reference.dir = dir; reference.damage = actualDamage; reference.life = 36; reference.lifemax = 36; reference.mask = (ETargetTypeMask)16; SkillTarget val3 = default(SkillTarget); val3.type = reference.target.type; val3.id = reference.target.id; val3.astroId = reference.astroId; reference.damageIncoming = skillSystem.CalculateDamageIncoming(ref val3, reference.damage, 1); int targetCombatStatId = skillSystem.AddCombatStatHPIncoming(ref val3, -reference.damageIncoming); reference.targetCombatStatId = targetCombatStatId; } } [HarmonyPatch(typeof(PlayerAction_Combat), "Shoot_Gauss_Space")] [HarmonyPostfix] public static void Shoot_Gauss_Space_Postfix(PlayerAction_Combat __instance, ref EnemyData enemy, int actualDamage) { //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: 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_01ba: 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_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: 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_0304: 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_0346: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) if (!MechaSpreadPlugin.Enabled.Value) { return; } int num = MechaSpreadPlugin.BulletMultiplier.Value - 1; if (num <= 0) { return; } SkillSystem skillSystem = __instance.skillSystem; Mecha mecha = __instance.mecha; Player player = ((PlayerAction)__instance).player; SpaceSector spaceSector = __instance.spaceSector; GameData data = GameMain.data; PlanetFactory val = ((data == null) ? null : data.localPlanet?.factory); StarData localStar = GameMain.localStar; int? obj; if (val == null) { obj = null; } else { PlanetData planet = val.planet; obj = ((planet != null) ? new int?(planet.astroId) : null); } int? num2 = obj; int valueOrDefault = num2.GetValueOrDefault(); float value = MechaSpreadPlugin.SpreadAngle.Value; int ammoBulletCount = mecha.ammoBulletCount; int num3 = Math.Min(num, ammoBulletCount); if (num3 <= 0) { return; } mecha.ammoBulletCount -= num3; VectorLF3 val2 = default(VectorLF3); Vector3 val3 = default(Vector3); for (int i = 0; i < num3; i++) { ref GeneralProjectile reference = ref skillSystem.mechaSpaceGaussProjectiles.Add(); if (val != null) { reference.astroId = valueOrDefault; } else if (localStar != null) { reference.astroId = localStar.astroId; } else { reference.astroId = 0; } reference.hitIndex = 19; reference.target.type = (ETargetType)4; reference.target.id = enemy.id; reference.target.astroId = enemy.originAstroId; reference.caster.type = (ETargetType)15; reference.caster.id = 1; reference.uPos = mecha.skillCastLeftU - player.uVelocity * 0.01666666753590107; skillSystem.GetObjectUPositionAndVelocity(ref reference.target, ref val2, ref val3); Vector3 val4 = VectorLF3.op_Implicit(val2 - reference.uPos); double d = val4.x * val4.x + val4.y * val4.y + val4.z * val4.z; double num4 = Math.Sqrt(d) * 5.0; if (num4 < 200.0) { num4 = 200.0; } else if (num4 > 20000.0) { num4 = 20000.0; } float num5 = (float)(Math.Sqrt(d) / num4) - 1f / 60f; Vector3 val5 = VectorLF3.op_Implicit(val2 - reference.uPos); Vector3 val7; if (enemy.astroId > 1000000) { EnemyDFHiveSystem val6 = spaceSector.dfHivesByAstro[enemy.astroId - 1000000]; val7 = VectorLF3.op_Implicit(val6.starData.uPosition - val2); Vector3 normalized = ((Vector3)(ref val7)).normalized; val5 += normalized * val6.hiveAstroOrbit.GetEstimatePointOffset(num5); } val7 = (val5 + val3 * num5) / num5; Vector3 val8 = ApplySpread(((Vector3)(ref val7)).normalized, value); reference.uVel = val8 * (float)num4; reference.uVelObj = reference.uVel - VectorLF3.op_Implicit(player.uVelocity); reference.damage = actualDamage; reference.damageRange = 0f; reference.damageFalloff = 0f; reference.mask = (ETargetTypeMask)16; reference.life = 120; reference.lifemax = 120; SkillTarget val9 = default(SkillTarget); val9.type = reference.target.type; val9.id = reference.target.id; val9.astroId = reference.target.astroId; reference.damageIncoming = skillSystem.CalculateDamageIncoming(ref val9, reference.damage, 1); reference.targetCombatStatId = skillSystem.AddCombatStatHPIncoming(ref val9, -reference.damageIncoming); } } [HarmonyPatch(typeof(PlayerAction_Combat), "Shoot_Plasma")] [HarmonyPostfix] public static void Shoot_Plasma_Postfix(PlayerAction_Combat __instance, ref EnemyData enemy, int actualDamage) { //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: 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_01ba: 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_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: 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_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Unknown result type (might be due to invalid IL or missing references) if (!MechaSpreadPlugin.Enabled.Value) { return; } int num = MechaSpreadPlugin.PlasmaMultiplier.Value - 1; if (num <= 0) { return; } SkillSystem skillSystem = __instance.skillSystem; Mecha mecha = __instance.mecha; Player player = ((PlayerAction)__instance).player; SpaceSector spaceSector = __instance.spaceSector; GameData data = GameMain.data; PlanetFactory val = ((data == null) ? null : data.localPlanet?.factory); StarData localStar = GameMain.localStar; int? obj; if (val == null) { obj = null; } else { PlanetData planet = val.planet; obj = ((planet != null) ? new int?(planet.astroId) : null); } int? num2 = obj; int valueOrDefault = num2.GetValueOrDefault(); float value = MechaSpreadPlugin.SpreadAngle.Value; int ammoBulletCount = mecha.ammoBulletCount; int num3 = Math.Min(num, ammoBulletCount); if (num3 <= 0) { return; } mecha.ammoBulletCount -= num3; VectorLF3 val2 = default(VectorLF3); Vector3 val3 = default(Vector3); for (int i = 0; i < num3; i++) { ref GeneralProjectile reference = ref skillSystem.mechaPlasmas.Add(); if (val != null) { reference.astroId = valueOrDefault; } else if (localStar != null) { reference.astroId = localStar.astroId; } else { reference.astroId = 0; } reference.hitIndex = 23; reference.target.type = (ETargetType)4; reference.target.id = enemy.id; reference.target.astroId = enemy.originAstroId; reference.caster.type = (ETargetType)15; reference.caster.id = 1; reference.uPos = mecha.skillCastLeftU - player.uVelocity * 0.01666666753590107; skillSystem.GetObjectUPositionAndVelocity(ref reference.target, ref val2, ref val3); Vector3 val4 = VectorLF3.op_Implicit(val2 - reference.uPos); double d = val4.x * val4.x + val4.y * val4.y + val4.z * val4.z; double num4 = Math.Sqrt(d) * 5.0; if (num4 < 200.0) { num4 = 200.0; } else if (num4 > 20000.0) { num4 = 20000.0; } float num5 = (float)(Math.Sqrt(d) / num4) - 1f / 60f; if (enemy.astroId > 1000000) { EnemyDFHiveSystem val5 = spaceSector.dfHivesByAstro[enemy.astroId - 1000000]; Vector3 val6 = VectorLF3.op_Implicit(val5.starData.uPosition - val2); Vector3 normalized = ((Vector3)(ref val6)).normalized; val4 += normalized * val5.hiveAstroOrbit.GetEstimatePointOffset(num5); } Vector3 val7 = (val4 + val3 * num5) / num5; Vector3 uVel = ApplySpread(((Vector3)(ref val7)).normalized, value) * ((Vector3)(ref val7)).magnitude; reference.uVel = uVel; reference.uVelObj = reference.uVel - VectorLF3.op_Implicit(player.uVelocity); int num6 = ((Proto)(mecha.activeAmmoProto?)).ID ?? 0; reference.damage = actualDamage; reference.damageRange = num6 switch { 1608 => SkillSystem.antimatterDamageRadius1, 1607 => SkillSystem.plasmaDamageRadius1, _ => 0f, }; reference.damageFalloff = num6 switch { 1608 => SkillSystem.antimatterDamageFalloff, 1607 => SkillSystem.plasmaDamageFalloff, _ => 0f, }; reference.mask = (ETargetTypeMask)16; reference.life = 120; reference.lifemax = 120; reference.damageIncoming = skillSystem.CalculateDamageIncoming(ref reference.target, reference.damage, 1); reference.targetCombatStatId = skillSystem.AddCombatStatHPIncoming(ref reference.target, -reference.damageIncoming); } } private static Vector3 ApplySpread(Vector3 direction, float maxAngle) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) float num = maxAngle * ((float)Math.PI / 180f); float num2 = (float)(rand.NextDouble() * (double)num); float num3 = (float)(rand.NextDouble() * Math.PI * 2.0); Vector3 val = Vector3.Cross(direction, Vector3.up); Vector3 normalized = ((Vector3)(ref val)).normalized; if (((Vector3)(ref normalized)).magnitude < 0.1f) { val = Vector3.Cross(direction, Vector3.right); normalized = ((Vector3)(ref val)).normalized; } Quaternion val2 = Quaternion.AngleAxis(num2 * 57.29578f, normalized); val = Quaternion.AngleAxis(num3 * 57.29578f, direction) * val2 * direction; return ((Vector3)(ref val)).normalized; } } }
ClusterBomb.dll
Decompiled 2 months agousing 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 BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.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 ClusterBomb { public enum EBombType { Explosive, Liquid, EMCapsule } public class BombProfile { public ConfigEntry<bool> Enabled; public ConfigEntry<string> ClusterWaves; public ConfigEntry<float> RadiusPerWave; public ConfigEntry<int> DelayBetweenWaves; public ConfigEntry<float> DamageMultiplier; public ConfigEntry<float> HeightOffset; public int[] GetWaveCounts() { try { string[] array = ClusterWaves.Value.Split(new char[1] { ',' }); int[] array2 = new int[array.Length]; for (int i = 0; i < array.Length; i++) { array2[i] = int.Parse(array[i].Trim()); } return array2; } catch { return new int[3] { 5, 10, 15 }; } } } [BepInPlugin("com.lll.clusterbomb", "ClusterBomb", "1.1.0")] public class ClusterBombPlugin : BaseUnityPlugin { public const string GUID = "com.lll.clusterbomb"; public const string NAME = "ClusterBomb"; public const string VERSION = "1.1.0"; public static BombProfile ExplosiveProfile; public static BombProfile LiquidProfile; public static BombProfile EMCapsuleProfile; public static ManualLogSource Log; private Harmony _harmony; private void Awake() { //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; ExplosiveProfile = CreateProfile("Explosive", "5,10,15", 20f, 10, 1f, 2f); LiquidProfile = CreateProfile("Liquid", "6,6,6,6,6,12,12,12,12,12", 4f, 8, 1f, 2f); EMCapsuleProfile = CreateProfile("EMCapsule", "4", 50f, 12, 1f, 2f); _harmony = new Harmony("com.lll.clusterbomb"); _harmony.PatchAll(typeof(ClusterBombPatch)); ((BaseUnityPlugin)this).Logger.LogInfo((object)"ClusterBomb 1.1.0 loaded!"); } private BombProfile CreateProfile(string section, string defaultWaves, float defaultRadius, int defaultDelay, float defaultDamage, float defaultHeightOffset) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Expected O, but got Unknown //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Expected O, but got Unknown return new BombProfile { Enabled = ((BaseUnityPlugin)this).Config.Bind<bool>(section, "Enabled", true, "Enable cluster effect for " + section + " bombs"), ClusterWaves = ((BaseUnityPlugin)this).Config.Bind<string>(section, "ClusterWaves", defaultWaves, "Comma-separated list of bomb counts per wave (e.g., '5,10,15' means 5 bombs in wave 1, 10 in wave 2, 15 in wave 3)"), RadiusPerWave = ((BaseUnityPlugin)this).Config.Bind<float>(section, "RadiusPerWave", defaultRadius, new ConfigDescription("Radius expansion per wave (wave 1 = 1x, wave 2 = 2x, etc.)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 100f), Array.Empty<object>())), DelayBetweenWaves = ((BaseUnityPlugin)this).Config.Bind<int>(section, "DelayBetweenWaves", defaultDelay, new ConfigDescription("Delay in game ticks between each wave (60 ticks = 1 second)", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 120), Array.Empty<object>())), DamageMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>(section, "DamageMultiplier", defaultDamage, new ConfigDescription("Damage multiplier for cluster bombs (1.0 = same as original)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 10f), Array.Empty<object>())), HeightOffset = ((BaseUnityPlugin)this).Config.Bind<float>(section, "HeightOffset", defaultHeightOffset, new ConfigDescription("Height offset above ground for cluster explosions", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 5f), Array.Empty<object>())) }; } private void OnDestroy() { Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } public static BombProfile GetProfile(EBombType type) { return type switch { EBombType.Explosive => ExplosiveProfile, EBombType.Liquid => LiquidProfile, EBombType.EMCapsule => EMCapsuleProfile, _ => ExplosiveProfile, }; } } [HarmonyPatch] public static class ClusterBombPatch { private struct PendingClusterWave { public long triggerTick; public Vector3 centerLocalPos; public int nearStarId; public int nearPlanetAstroId; public int protoId; public int abilityValue; public ETargetTypeMask mask; public SkillTarget caster; public float radius; public int bombCount; public float blastRadius0; public float blastRadius1; public float blastFalloff; public int hitIndex; public int bombModelId; public EBombType bombType; public float heightOffset; } private static readonly List<PendingClusterWave> pendingWaves = new List<PendingClusterWave>(); private static readonly Dictionary<(EBombType, int), Vector3> bombTargetPositions = new Dictionary<(EBombType, int), Vector3>(); [HarmonyPatch(typeof(PlayerAction_Combat), "Bombing")] [HarmonyPostfix] public static void Bombing_Postfix(PlayerAction_Combat __instance) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Invalid comparison between Unknown and I4 //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Invalid comparison between Unknown and I4 //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Invalid comparison between Unknown and I4 //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) if (__instance.curvePointsCursor <= 0) { return; } VectorLF3 val = __instance.curvePoints[__instance.curvePointsCursor - 1]; SkillSystem skillSystem = GameMain.data.spaceSector.skillSystem; Player player = ((PlayerAction)__instance).player; Mecha val2 = ((player != null) ? player.mecha : null); if (val2 == null || val2.bombStorage == null || val2.bombStorage.size == 0) { return; } int itemId = val2.bombStorage.grids[0].itemId; if (itemId <= 0) { return; } ItemProto val3 = ((ProtoSet<ItemProto>)(object)LDB.items).Select(itemId); if (val3 == null) { return; } int num; EBombType eBombType; if ((int)val3.BombType == 2) { num = skillSystem.explosiveUnitBombs.cursor - 1; eBombType = EBombType.Explosive; } else if ((int)val3.BombType == 1) { num = skillSystem.liquidBombs.cursor - 1; eBombType = EBombType.Liquid; } else { if ((int)val3.BombType != 3) { return; } num = skillSystem.emCapsuleBombs.cursor - 1; eBombType = EBombType.EMCapsule; } if (num > 0) { bombTargetPositions[(eBombType, num)] = VectorLF3.op_Implicit(val); ClusterBombPlugin.Log.LogInfo((object)$"Captured target for {eBombType} bomb {num}: {val}"); } } [HarmonyPatch(typeof(Bomb_Explosive), "TickSkillLogic")] [HarmonyPrefix] public static void Explosive_TickSkillLogic_Prefix(ref Bomb_Explosive __instance, out int __state) { __state = __instance.life; } [HarmonyPatch(typeof(Bomb_Explosive), "TickSkillLogic")] [HarmonyPostfix] public static void Explosive_TickSkillLogic_Postfix(ref Bomb_Explosive __instance, SkillSystem skillSystem, long time, int __state) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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) BombProfile explosiveProfile = ClusterBombPlugin.ExplosiveProfile; if (explosiveProfile.Enabled.Value && __state > 0 && __instance.life == 0 && __instance.id > 0) { Vector3 targetPosition = GetTargetPosition(EBombType.Explosive, __instance.id, __instance.nearPlanetAstroId, __instance.uPos, skillSystem); ScheduleClusterWaves(EBombType.Explosive, explosiveProfile, __instance.nearStarId, __instance.nearPlanetAstroId, __instance.protoId, __instance.abilityValue, __instance.mask, __instance.caster, __instance.blastRadius0, __instance.blastRadius1, __instance.blastFalloff, __instance.hitIndex, __instance.bombModelId, time, targetPosition); } } [HarmonyPatch(typeof(Bomb_Liquid), "TickSkillLogic")] [HarmonyPrefix] public static void Liquid_TickSkillLogic_Prefix(ref Bomb_Liquid __instance, out int __state) { __state = __instance.life; } [HarmonyPatch(typeof(Bomb_Liquid), "TickSkillLogic")] [HarmonyPostfix] public static void Liquid_TickSkillLogic_Postfix(ref Bomb_Liquid __instance, SkillSystem skillSystem, long time, int __state) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) BombProfile liquidProfile = ClusterBombPlugin.LiquidProfile; if (liquidProfile.Enabled.Value && __state > 0 && __instance.life == 0 && __instance.id > 0) { Vector3 targetPosition = GetTargetPosition(EBombType.Liquid, __instance.id, __instance.nearPlanetAstroId, __instance.uPos, skillSystem); ScheduleClusterWaves(EBombType.Liquid, liquidProfile, __instance.nearStarId, __instance.nearPlanetAstroId, __instance.protoId, 0, (ETargetTypeMask)0, __instance.caster, __instance.blastRadius0, __instance.blastRadius1, __instance.blastFalloff, __instance.hitIndex, __instance.bombModelId, time, targetPosition); } } [HarmonyPatch(typeof(Bomb_EMCapsule), "TickSkillLogic")] [HarmonyPrefix] public static void EMCapsule_TickSkillLogic_Prefix(ref Bomb_EMCapsule __instance, out int __state) { __state = __instance.life; } [HarmonyPatch(typeof(Bomb_EMCapsule), "TickSkillLogic")] [HarmonyPostfix] public static void EMCapsule_TickSkillLogic_Postfix(ref Bomb_EMCapsule __instance, SkillSystem skillSystem, long time, int __state) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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) BombProfile eMCapsuleProfile = ClusterBombPlugin.EMCapsuleProfile; if (eMCapsuleProfile.Enabled.Value && __state > 0 && __instance.life == 0 && __instance.id > 0) { Vector3 targetPosition = GetTargetPosition(EBombType.EMCapsule, __instance.id, __instance.nearPlanetAstroId, __instance.uPos, skillSystem); ScheduleClusterWaves(EBombType.EMCapsule, eMCapsuleProfile, __instance.nearStarId, __instance.nearPlanetAstroId, __instance.protoId, __instance.abilityValue, __instance.mask, __instance.caster, __instance.blastRadius0, __instance.blastRadius1, __instance.blastFalloff, __instance.hitIndex, __instance.bombModelId, time, targetPosition); } } [HarmonyPatch(typeof(SkillSystem), "GameTick")] [HarmonyPostfix] public static void GameTick_Postfix(SkillSystem __instance, long time) { for (int num = pendingWaves.Count - 1; num >= 0; num--) { PendingClusterWave wave = pendingWaves[num]; if (time >= wave.triggerTick) { ClusterBombPlugin.Log.LogInfo((object)$"Spawning {wave.bombType} wave with {wave.bombCount} bombs at radius {wave.radius}"); SpawnClusterBombs(__instance, ref wave); pendingWaves.RemoveAt(num); } } } private static Vector3 GetTargetPosition(EBombType type, int bombId, int astroId, VectorLF3 uPos, SkillSystem skillSystem) { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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_004d: Unknown result type (might be due to invalid IL or missing references) if (bombTargetPositions.TryGetValue((type, bombId), out var value)) { ClusterBombPlugin.Log.LogInfo((object)$"{type} bomb {bombId} exploded, using designated target {value}"); bombTargetPositions.Remove((type, bombId)); return value; } VectorLF3 val = default(VectorLF3); skillSystem.sector.InverseTransformToAstro_ref(astroId, ref uPos, ref val); ClusterBombPlugin.Log.LogInfo((object)$"{type} bomb {bombId} exploded, using explosion pos {val}"); return VectorLF3.op_Implicit(val); } private static void ScheduleClusterWaves(EBombType bombType, BombProfile profile, int nearStarId, int nearPlanetAstroId, int protoId, int abilityValue, ETargetTypeMask mask, SkillTarget caster, float blastRadius0, float blastRadius1, float blastFalloff, int hitIndex, int bombModelId, long currentTime, Vector3 targetLocalPos) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_007d: 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_0086: 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) int[] waveCounts = profile.GetWaveCounts(); float value = profile.RadiusPerWave.Value; int value2 = profile.DelayBetweenWaves.Value; float value3 = profile.DamageMultiplier.Value; for (int i = 0; i < waveCounts.Length; i++) { PendingClusterWave pendingClusterWave = default(PendingClusterWave); pendingClusterWave.triggerTick = currentTime + (i + 1) * value2; pendingClusterWave.centerLocalPos = targetLocalPos; pendingClusterWave.nearStarId = nearStarId; pendingClusterWave.nearPlanetAstroId = nearPlanetAstroId; pendingClusterWave.protoId = protoId; pendingClusterWave.abilityValue = (int)((float)abilityValue * value3); pendingClusterWave.mask = mask; pendingClusterWave.caster = caster; pendingClusterWave.radius = value * (float)(i + 1); pendingClusterWave.bombCount = waveCounts[i]; pendingClusterWave.blastRadius0 = blastRadius0; pendingClusterWave.blastRadius1 = blastRadius1; pendingClusterWave.blastFalloff = blastFalloff; pendingClusterWave.hitIndex = hitIndex; pendingClusterWave.bombModelId = bombModelId; pendingClusterWave.bombType = bombType; pendingClusterWave.heightOffset = profile.HeightOffset.Value; PendingClusterWave item = pendingClusterWave; pendingWaves.Add(item); } } private static void SpawnClusterBombs(SkillSystem skillSystem, ref PendingClusterWave wave) { //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_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_00b8: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: 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_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_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0115: 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_0127: 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_0131: 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_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: 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_0147: 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_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) Random random = new Random((int)(wave.triggerTick & 0x7FFFFFFF)); if (wave.nearPlanetAstroId <= 0) { ClusterBombPlugin.Log.LogWarning((object)"Skipping wave - no planet astro ID"); return; } PlanetData val = GameMain.galaxy.PlanetById(wave.nearPlanetAstroId); if (val == null || val.data == null) { ClusterBombPlugin.Log.LogWarning((object)"Skipping wave - planet data not available"); return; } PlanetRawData data = val.data; Vector3 centerLocalPos = wave.centerLocalPos; for (int i = 0; i < wave.bombCount; i++) { double num = random.NextDouble() * Math.PI * 2.0; double num2 = (double)wave.radius * (0.5 + random.NextDouble() * 0.5); Vector3 normalized = ((Vector3)(ref centerLocalPos)).normalized; Vector3 val2 = Vector3.Cross(normalized, Vector3.up); Vector3 normalized2 = ((Vector3)(ref val2)).normalized; if (((Vector3)(ref normalized2)).magnitude < 0.1f) { val2 = Vector3.Cross(normalized, Vector3.right); normalized2 = ((Vector3)(ref val2)).normalized; } val2 = Vector3.Cross(normalized2, normalized); Vector3 normalized3 = ((Vector3)(ref val2)).normalized; Vector3 val3 = normalized2 * (float)(Math.Cos(num) * num2) + normalized3 * (float)(Math.Sin(num) * num2); Vector3 lPos = centerLocalPos + val3; Vector3 normalized4 = ((Vector3)(ref lPos)).normalized; float num3 = data.QueryHeight(normalized4) + wave.heightOffset; lPos = normalized4 * num3; float height = num3; switch (wave.bombType) { case EBombType.Explosive: SpawnExplosiveEffect(skillSystem, ref wave, height, ref lPos); break; case EBombType.Liquid: SpawnLiquidEffect(skillSystem, ref wave, height, ref lPos); break; case EBombType.EMCapsule: SpawnEMCapsuleEffect(skillSystem, ref wave, height, ref lPos); break; } if (wave.nearPlanetAstroId == skillSystem.localAstroId && wave.hitIndex > 0) { ref ParticleData reference = ref skillSystem.hitEffects[wave.hitIndex].Add(); reference.duration = 120; reference.astroId = wave.nearPlanetAstroId; reference.pos = lPos; reference.size = 1f; } } } private static void SpawnExplosiveEffect(SkillSystem skillSystem, ref PendingClusterWave wave, float height, ref Vector3 lPos) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) Bomb_Explosive val = default(Bomb_Explosive); val.nearStarId = wave.nearStarId; val.nearPlanetAstroId = wave.nearPlanetAstroId; val.uPos = VectorLF3.zero; val.mask = wave.mask; val.abilityValue = wave.abilityValue; val.caster = wave.caster; val.protoId = wave.protoId; val.blastRadius0 = wave.blastRadius0; val.blastRadius1 = wave.blastRadius1; val.blastFalloff = wave.blastFalloff; val.hitIndex = wave.hitIndex; Bomb_Explosive val2 = val; SkillTarget val3 = default(SkillTarget); ((Bomb_Explosive)(ref val2)).BombFactoryObjects(skillSystem, height, ref val3, ref lPos); } private static void SpawnLiquidEffect(SkillSystem skillSystem, ref PendingClusterWave wave, float height, ref Vector3 lPos) { } private static void SpawnEMCapsuleEffect(SkillSystem skillSystem, ref PendingClusterWave wave, float height, ref Vector3 lPos) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) Bomb_EMCapsule val = default(Bomb_EMCapsule); val.nearStarId = wave.nearStarId; val.nearPlanetAstroId = wave.nearPlanetAstroId; val.uPos = VectorLF3.zero; val.mask = wave.mask; val.abilityValue = wave.abilityValue; val.caster = wave.caster; val.protoId = wave.protoId; val.blastRadius0 = wave.blastRadius0; val.blastRadius1 = wave.blastRadius1; val.blastFalloff = wave.blastFalloff; val.hitIndex = wave.hitIndex; Bomb_EMCapsule val2 = val; ((Bomb_EMCapsule)(ref val2)).BombFactoryObjects(skillSystem, height, ref lPos); } } }