using 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 Enabled; public static ConfigEntry BulletMultiplier; public static ConfigEntry PlasmaMultiplier; public static ConfigEntry 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("General", "Enabled", true, "Enable mecha spread shot functionality"); BulletMultiplier = ((BaseUnityPlugin)this).Config.Bind("Multipliers", "BulletMultiplier", 10, new ConfigDescription("Number of bullets to fire per shot", (AcceptableValueBase)(object)new AcceptableValueRange(1, 50), Array.Empty())); PlasmaMultiplier = ((BaseUnityPlugin)this).Config.Bind("Multipliers", "PlasmaMultiplier", 10, new ConfigDescription("Number of plasma shots to fire per shot", (AcceptableValueBase)(object)new AcceptableValueRange(1, 50), Array.Empty())); SpreadAngle = ((BaseUnityPlugin)this).Config.Bind("Spread", "SpreadAngle", 15f, new ConfigDescription("Maximum spread angle in degrees from aim direction", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 45f), Array.Empty())); _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; } } }