Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of ProtogenSurvivor v1.0.0
plugins/ProtogenSurvivor/ProtogenSurvivor.dll
Decompiled a day 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.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.Bandit2.Weapon; using EntityStates.Captain.Weapon; using EntityStates.Engi.EngiBubbleShield; using EntityStates.Loader; using Microsoft.CodeAnalysis; using ProtogenMod.Assets; using ProtogenMod.Components; using ProtogenMod.States; using ProtogenMod.Survivor; using R2API; using RoR2; using RoR2.Orbs; using RoR2.Projectile; using RoR2.Skills; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("ProtogenSurvivor")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("ProtogenSurvivor")] [assembly: AssemblyTitle("ProtogenSurvivor")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace ProtogenMod { public static class ProtoConfig { public static ConfigEntry<int> primaryPellets; public static ConfigEntry<float> primaryDamage; public static ConfigEntry<float> primaryDuration; public static ConfigEntry<int> secondaryTargets; public static ConfigEntry<float> secondaryDamage; public static ConfigEntry<float> secondaryCooldown; public static ConfigEntry<float> utilityDamage; public static ConfigEntry<float> utilityDuration; public static ConfigEntry<float> utilityCooldown; public static ConfigEntry<bool> utilityBlocksProjectiles; public static ConfigEntry<float> specialDamage; public static ConfigEntry<float> specialDuration; public static ConfigEntry<float> specialCooldown; public static ConfigEntry<float> specialFinalBlastDamage; public static ConfigEntry<bool> debugLogging; public static void Init(ConfigFile cfg) { debugLogging = cfg.Bind<bool>("0. Debug", "Debug Logging", false, "Log extra information about skill hits (for troubleshooting)."); primaryPellets = cfg.Bind<int>("1. Static Scattergun", "Pellets", 7, "Pellets per shot."); primaryDamage = cfg.Bind<float>("1. Static Scattergun", "Damage", 0.6f, "Damage coefficient per pellet (0.6 = 60%)."); primaryDuration = cfg.Bind<float>("1. Static Scattergun", "Fire Interval", 0.85f, "Seconds between shots at base attack speed."); secondaryTargets = cfg.Bind<int>("2. Arc Discharge", "Max Targets", 10, "How many enemies the chain lightning can hit."); secondaryDamage = cfg.Bind<float>("2. Arc Discharge", "Damage", 3f, "Damage coefficient per enemy hit."); secondaryCooldown = cfg.Bind<float>("2. Arc Discharge", "Cooldown", 5f, "Cooldown in seconds."); utilityDamage = cfg.Bind<float>("3. Hardlight Barrier", "Damage", 2.5f, "Damage coefficient dealt to enemies passing through the barrier."); utilityDuration = cfg.Bind<float>("3. Hardlight Barrier", "Duration", 8f, "How long the barrier lasts."); utilityCooldown = cfg.Bind<float>("3. Hardlight Barrier", "Cooldown", 12f, "Cooldown in seconds."); utilityBlocksProjectiles = cfg.Bind<bool>("3. Hardlight Barrier", "Blocks Projectiles", true, "Whether the barrier deletes enemy projectiles."); specialDamage = cfg.Bind<float>("4. Arc Sentinel", "Zap Damage", 1.1f, "Damage coefficient per zap (each zap arcs to 2 extra enemies)."); specialDuration = cfg.Bind<float>("4. Arc Sentinel", "Duration", 25f, "How long the sentinel orb hunts enemies."); specialCooldown = cfg.Bind<float>("4. Arc Sentinel", "Cooldown", 30f, "Cooldown in seconds."); specialFinalBlastDamage = cfg.Bind<float>("4. Arc Sentinel", "Final Blast Damage", 6f, "Damage coefficient of the overload blast when the orb expires."); } } [BepInPlugin("com.protogen.survivor", "ProtogenSurvivor", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class ProtogenPlugin : BaseUnityPlugin { public const string GUID = "com.protogen.survivor"; public const string NAME = "ProtogenSurvivor"; public const string VERSION = "1.0.0"; public static ProtogenPlugin Instance { get; private set; } private void Awake() { Instance = this; Log.Init(((BaseUnityPlugin)this).Logger); try { ProtoConfig.Init(((BaseUnityPlugin)this).Config); ProtoAssets.Load(); Tokens.Register(); ProtoVfx.Init(); Projectiles.Create(); ProtogenSurvivorFactory.Create(); Log.Info("Protogen survivor loaded."); } catch (Exception ex) { Log.Error("Failed to load the Protogen survivor: " + ex); } } } internal static class Log { private static ManualLogSource source; public static void Init(ManualLogSource s) { source = s; } public static void Info(object o) { ManualLogSource obj = source; if (obj != null) { obj.LogInfo(o); } } public static void Warning(object o) { ManualLogSource obj = source; if (obj != null) { obj.LogWarning(o); } } public static void Error(object o) { ManualLogSource obj = source; if (obj != null) { obj.LogError(o); } } } public static class Tokens { public const string Prefix = "PROTOGEN_"; public static void Register() { LanguageAPI.Add("PROTOGEN_NAME", "Protogen"); LanguageAPI.Add("PROTOGEN_SUBTITLE", "Synthetic Vanguard"); LanguageAPI.Add("PROTOGEN_OUTRO_FLAVOR", "..and so it left, visor glowing with something like hope."); LanguageAPI.Add("PROTOGEN_OUTRO_FAILURE", "..and so it vanished, its last signal lost to the static."); LanguageAPI.Add("PROTOGEN_DESCRIPTION", "The Protogen is a cybernetic hunter that mixes close-range firepower with chaining electricity.<color=#CCD3E0>\n\n< ! > Static Scattergun is strongest up close - stay aggressive and let the pellets land.\n\n< ! > Arc Discharge jumps between enemies, so fire it into the thickest part of a crowd.\n\n< ! > Hardlight Barrier blocks projectiles - place it between you and ranged enemies, or across a choke point.\n\n< ! > Arc Sentinel hunts on its own for a long time. Throw it early in a fight and keep shooting.</color>\n"); LanguageAPI.Add("PROTOGEN_LORE", "Unit designation: PRT-7.\n\nOrigin: unknown. Recovered from the wreck of a colony hauler, its memory banks scrubbed except for one directive that no technician could remove: protect the crew.\n\nIts visor shows a face it was never given. Its tail sways when it thinks no one is looking. When the UES Safe Travels went down over Petrichor V, PRT-7 walked out of the escape pod with a rebuilt scattergun, a reactor humming in its chest, and the patient certainty of a machine that has decided what it is for."); LanguageAPI.Add("PROTOGEN_SKIN_DEFAULT_NAME", "Default"); LanguageAPI.Add("PROTOGEN_SKIN_CRIMSON_NAME", "Crimson Protocol"); LanguageAPI.Add("PROTOGEN_PRIMARY_NAME", "Static Scattergun"); LanguageAPI.Add("PROTOGEN_PRIMARY_DESC", $"Fire a charged shotgun blast for <style=cIsDamage>{ProtoConfig.primaryPellets.Value}x{Pct(ProtoConfig.primaryDamage.Value)} damage</style>."); LanguageAPI.Add("PROTOGEN_SECONDARY_NAME", "Arc Discharge"); LanguageAPI.Add("PROTOGEN_SECONDARY_DESC", "<style=cIsDamage>Stunning</style>. Release an electric shock that arcs between up to " + $"<style=cIsDamage>{ProtoConfig.secondaryTargets.Value}</style> enemies for <style=cIsDamage>{Pct(ProtoConfig.secondaryDamage.Value)} damage</style> each."); LanguageAPI.Add("PROTOGEN_UTILITY_NAME", "Hardlight Barrier"); LanguageAPI.Add("PROTOGEN_UTILITY_DESC", $"Project a force field wall for <style=cIsUtility>{ProtoConfig.utilityDuration.Value:0} seconds</style> that " + "<style=cIsUtility>blocks enemy projectiles</style>. Enemies passing through are <style=cIsUtility>slowed</style> and shocked for <style=cIsDamage>" + Pct(ProtoConfig.utilityDamage.Value) + " damage</style>."); LanguageAPI.Add("PROTOGEN_SPECIAL_NAME", "Arc Sentinel"); LanguageAPI.Add("PROTOGEN_SPECIAL_DESC", $"<style=cIsDamage>Shocking</style>. Throw a sentient plasma orb that hunts enemies for <style=cIsUtility>{ProtoConfig.specialDuration.Value:0} seconds</style>, " + "zapping one target after another for <style=cIsDamage>" + Pct(ProtoConfig.specialDamage.Value) + " damage</style> that arcs to nearby enemies. When it expires it overloads for <style=cIsDamage>" + Pct(ProtoConfig.specialFinalBlastDamage.Value) + " damage</style>."); static string Pct(float coef) { return (coef * 100f).ToString("0") + "%"; } } } } namespace ProtogenMod.Survivor { public static class ItemDisplays { public static void Populate(ItemDisplayRuleSet target, Transform commandoModel, Transform protogenModel, ChildLocator protogenLocator) { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_00d2: 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_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_00f3: 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_0100: 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_02b9: 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_02d1: 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_02e7: 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_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0156: 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_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: 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_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_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_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: 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_01e4: 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_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: 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_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_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_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025b: 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_0264: 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_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0272: 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_0279: 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_0286: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) ItemDisplayRuleSet val = ProtoAssets.LoadAsset<ItemDisplayRuleSet>("RoR2/Base/Commando/idrsCommando.asset"); ChildLocator val2 = (Object.op_Implicit((Object)(object)commandoModel) ? ((Component)commandoModel).GetComponent<ChildLocator>() : null); if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)val2) || val.keyAssetRuleGroups == null) { Log.Warning("Commando item displays unavailable; the protogen will have no item displays."); target.keyAssetRuleGroups = (KeyAssetRuleGroup[])(object)new KeyAssetRuleGroup[0]; return; } float num = HeightOf(commandoModel, val2.FindChild("Head")); float num2 = HeightOf(protogenModel, protogenLocator.FindChild("Head")); float num3 = ((num > 0.01f) ? (num2 / num) : 1f); List<KeyAssetRuleGroup> list = new List<KeyAssetRuleGroup>(); int num4 = 0; KeyAssetRuleGroup[] keyAssetRuleGroups = val.keyAssetRuleGroups; foreach (KeyAssetRuleGroup val3 in keyAssetRuleGroups) { if (!Object.op_Implicit(val3.keyAsset) || val3.displayRuleGroup.rules == null) { continue; } List<ItemDisplayRule> list2 = new List<ItemDisplayRule>(); ItemDisplayRule[] rules = val3.displayRuleGroup.rules; foreach (ItemDisplayRule val4 in rules) { if ((int)val4.ruleType == 0) { Transform val5 = val2.FindChild(val4.childName); string text = MapChildName(val4.childName); Transform val6 = protogenLocator.FindChild(text); if (Object.op_Implicit((Object)(object)val5) && Object.op_Implicit((Object)(object)val6)) { Matrix4x4 val7 = commandoModel.worldToLocalMatrix * val5.localToWorldMatrix; Vector3 val8 = ((Matrix4x4)(ref val7)).MultiplyPoint3x4(val4.localPos); Quaternion val9 = Quaternion.Inverse(commandoModel.rotation) * val5.rotation * Quaternion.Euler(val4.localAngles); Vector3 val10 = Div(val5.lossyScale, commandoModel.lossyScale); Vector3 val11 = commandoModel.InverseTransformPoint(val5.position); Vector3 val12 = protogenModel.InverseTransformPoint(val6.position); Vector3 val13 = val12 + (val8 - val11) * num3; Quaternion val14 = Quaternion.Inverse(protogenModel.rotation) * val6.rotation; Vector3 b = Div(val6.lossyScale, protogenModel.lossyScale); ItemDisplayRule val15 = val4; val15.childName = text; val15.localPos = Quaternion.Inverse(val14) * (val13 - val12); val15.localPos = Div(val15.localPos, b); Quaternion val16 = Quaternion.Inverse(val14) * val9; val15.localAngles = ((Quaternion)(ref val16)).eulerAngles; val15.localScale = Div(Vector3.Scale(val4.localScale, val10) * num3, b); val15.limbMask = (LimbFlags)0; list2.Add(val15); num4++; } } } if (list2.Count > 0) { list.Add(new KeyAssetRuleGroup { keyAsset = val3.keyAsset, displayRuleGroup = new DisplayRuleGroup { rules = list2.ToArray() } }); } } target.keyAssetRuleGroups = list.ToArray(); Log.Info($"Retargeted {num4} item display rules from Commando (scale {num3:0.00})."); } private static float HeightOf(Transform model, Transform head) { //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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)model) || !Object.op_Implicit((Object)(object)head)) { return 0f; } return Vector3.Scale(model.InverseTransformPoint(head.position), Vector3.one).y; } private static Vector3 Div(Vector3 a, Vector3 b) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_002a: 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) return new Vector3(a.x / Safe(b.x), a.y / Safe(b.y), a.z / Safe(b.z)); } private static float Safe(float v) { if (!(Mathf.Abs(v) < 1E-05f)) { return v; } return 1f; } public static string MapChildName(string name) { if (string.IsNullOrEmpty(name)) { return "Chest"; } string text = name.ToLowerInvariant(); bool flag = text.EndsWith("l") || text.Contains("left") || text.EndsWith(".l"); if (text.Contains("head")) { return "Head"; } if (text.Contains("neck")) { return "Neck"; } if (text.Contains("chest")) { return "Chest"; } if (text.Contains("stomach")) { return "Stomach"; } if (text.Contains("pelvis") || text == "base" || text.Contains("hip")) { return "Pelvis"; } if (text.Contains("upperarm")) { if (!flag) { return "UpperArmR"; } return "UpperArmL"; } if (text.Contains("lowerarm") || text.Contains("forearm")) { if (!flag) { return "LowerArmR"; } return "LowerArmL"; } if (text.Contains("hand") || text.Contains("gun") || text.Contains("muzzle")) { if (!flag) { return "HandR"; } return "HandL"; } if (text.Contains("thigh")) { if (!flag) { return "ThighR"; } return "ThighL"; } if (text.Contains("calf") || text.Contains("shin")) { if (!flag) { return "CalfR"; } return "CalfL"; } if (text.Contains("foot") || text.Contains("toe")) { if (!flag) { return "FootR"; } return "FootL"; } return "Chest"; } } public static class Projectiles { public static GameObject barrierPrefab; public static GameObject sentinelPrefab; public const float BarrierWidth = 11f; public const float BarrierHeight = 4.5f; public static void Create() { barrierPrefab = CreateBarrier(); sentinelPrefab = CreateSentinel(); ContentAddition.AddProjectile(barrierPrefab); ContentAddition.AddProjectile(sentinelPrefab); } private static GameObject NewProjectileBase(string name, out ProjectileController controller) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown GameObject val = new GameObject(name); val.transform.SetParent(PrefabHolder.Root, false); val.AddComponent<NetworkIdentity>(); val.AddComponent<TeamFilter>(); controller = val.AddComponent<ProjectileController>(); controller.allowPrediction = false; controller.procCoefficient = 1f; val.AddComponent<ProjectileDamage>(); Rigidbody obj = val.AddComponent<Rigidbody>(); obj.isKinematic = true; obj.useGravity = false; obj.interpolation = (RigidbodyInterpolation)0; ProjectileNetworkTransform obj2 = val.AddComponent<ProjectileNetworkTransform>(); obj2.positionTransmitInterval = 0.05f; obj2.interpolationFactor = 1f; obj2.allowClientsideCollision = false; return val; } private static GameObject Finish(GameObject template, string name) { GameObject result = PrefabAPI.InstantiateClone(template, name, true); Object.DestroyImmediate((Object)(object)template); return result; } private static GameObject CreateBarrier() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0059: 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_0070: 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_00f6: 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_011f: 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_013e: 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_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) ProjectileController controller; GameObject val = NewProjectileBase("ProtogenBarrierTemplate", out controller); controller.cannotBeDeleted = true; val.GetComponent<ProjectileNetworkTransform>().positionTransmitInterval = 0.5f; BarrierController barrierController = val.AddComponent<BarrierController>(); GameObject val2 = new GameObject("Visual"); val2.transform.SetParent(val.transform, false); barrierController.visualRoot = val2.transform; GameObject val3 = new GameObject("Field"); val3.transform.SetParent(val2.transform, false); val3.AddComponent<MeshFilter>().sharedMesh = BuildWallMesh(11f, 4.5f, 1.1f); MeshRenderer val4 = val3.AddComponent<MeshRenderer>(); ((Renderer)val4).sharedMaterial = ProtoVfx.barrierMaterial; ((Renderer)val4).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val4).receiveShadows = false; barrierController.fieldRenderer = val4; Mesh builtinResource = Resources.GetBuiltinResource<Mesh>("Cube.fbx"); for (int i = -1; i <= 1; i += 2) { GameObject val5 = new GameObject((i < 0) ? "PylonL" : "PylonR"); val5.transform.SetParent(val2.transform, false); val5.transform.localPosition = new Vector3((float)i * 11f * 0.5f, 2.25f, 0f); val5.transform.localScale = new Vector3(0.22f, 4.8f, 0.22f); val5.AddComponent<MeshFilter>().sharedMesh = builtinResource; ((Renderer)val5.AddComponent<MeshRenderer>()).sharedMaterial = ProtoVfx.emissiveCyanMaterial; } barrierController.arcs = (LineRenderer[])(object)new LineRenderer[3]; Color val8 = default(Color); for (int j = 0; j < barrierController.arcs.Length; j++) { GameObject val6 = new GameObject("Arc" + j); val6.transform.SetParent(val2.transform, false); LineRenderer val7 = val6.AddComponent<LineRenderer>(); val7.useWorldSpace = false; val7.positionCount = 10; val7.widthMultiplier = 0.18f; val7.numCapVertices = 2; ((Renderer)val7).sharedMaterial = ProtoVfx.lightningLineMaterial; ((Renderer)val7).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val7).receiveShadows = false; ((Color)(ref val8))..ctor(0.5f, 0.9f, 1f); val7.endColor = val8; val7.startColor = val8; barrierController.arcs[j] = val7; } GameObject val9 = new GameObject("Light"); val9.transform.SetParent(val2.transform, false); val9.transform.localPosition = new Vector3(0f, 2.25f, 0f); Light val10 = val9.AddComponent<Light>(); val10.type = (LightType)2; val10.color = new Color(0.3f, 0.8f, 1f); val10.range = 12f; val10.intensity = 3f; barrierController.fieldLight = val10; return Finish(val, "ProtogenBarrierProjectile"); } private static Mesh BuildWallMesh(float width, float height, float hexSize) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_00ac: 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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_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_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) float num = width / hexSize; float num2 = height / (hexSize * 1.7320508f); Mesh val = new Mesh { name = "meshProtogenBarrier" }; val.vertices = (Vector3[])(object)new Vector3[4] { new Vector3((0f - width) / 2f, 0f, 0f), new Vector3(width / 2f, 0f, 0f), new Vector3(width / 2f, height, 0f), new Vector3((0f - width) / 2f, height, 0f) }; val.uv = (Vector2[])(object)new Vector2[4] { new Vector2(0f, 0f), new Vector2(num, 0f), new Vector2(num, num2), new Vector2(0f, num2) }; val.colors = (Color[])(object)new Color[4] { Color.white, Color.white, Color.white, Color.white }; val.triangles = new int[6] { 0, 2, 1, 0, 3, 2 }; val.RecalculateNormals(); val.RecalculateBounds(); return val; } private static GameObject CreateSentinel() { //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) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) ProjectileController controller; GameObject val = NewProjectileBase("ProtogenSentinelTemplate", out controller); controller.ghostPrefab = ProtoVfx.sentinelGhost; controller.cannotBeDeleted = true; val.AddComponent<ArcSentinelController>(); GameObject val2 = new GameObject("Light"); val2.transform.SetParent(val.transform, false); Light obj = val2.AddComponent<Light>(); obj.type = (LightType)2; obj.color = new Color(0.35f, 0.8f, 1f); obj.range = 9f; obj.intensity = 4f; GameObject val3 = new GameObject("Core"); val3.transform.SetParent(val.transform, false); val3.transform.localScale = Vector3.one * 0.35f; val3.AddComponent<MeshFilter>().sharedMesh = Resources.GetBuiltinResource<Mesh>("Sphere.fbx"); MeshRenderer obj2 = val3.AddComponent<MeshRenderer>(); ((Renderer)obj2).sharedMaterial = ProtoVfx.emissiveCyanMaterial; ((Renderer)obj2).shadowCastingMode = (ShadowCastingMode)0; return Finish(val, "ProtogenSentinelProjectile"); } } public static class PrefabHolder { private static Transform root; public static Transform Root { get { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)root)) { GameObject val = new GameObject("ProtogenPrefabHolder"); val.SetActive(false); Object.DontDestroyOnLoad((Object)val); root = val.transform; } return root; } } } [DefaultExecutionOrder(1000)] public class ProtogenAnimator : MonoBehaviour { public enum Gesture { None, Zap, Sweep, Throw } public Transform[] bones; public Vector3[] restLocalPos; public Vector3[] restModelPos; public Transform gun; public Transform pump; public Vector3 pumpRestLocal; public Vector3 pumpGripGun; public Vector3 gunLocalPos; public Quaternion gunLocalRot = Quaternion.identity; public bool displayMode; public string footstepSound; public GameObject footstepDust; private static readonly Vector3 ChestPivotModel = new Vector3(0f, 1.4f, 0.03f); private static readonly Vector3 GripOffset = new Vector3(0.085f, -0.11f, 0.2f); private static readonly Vector3 SprintGripOffset = new Vector3(0.16f, -0.24f, 0.17f); private static readonly Vector3 PalmLocalL = new Vector3(-0.06f, -0.03f, 0f); private static readonly Vector3 PalmLocalR = new Vector3(0.06f, -0.03f, 0f); private int iRoot; private int iSpine; private int iSpine1; private int iSpine2; private int iNeck; private int iHead; private int iUArmL; private int iFArmL; private int iHandL; private int iUArmR; private int iFArmR; private int iHandR; private int iThighL; private int iShinL; private int iFootL; private int iToeL; private int iThighR; private int iShinR; private int iFootR; private int iToeR; private int iEar1L; private int iEar2L; private int iEar1R; private int iEar2R; private int[] iTail; private int[] iFingersL; private int[] iFingersR; private float upperLenL; private float foreLenL; private float upperLenR; private float foreLenR; private Vector3 restDirUL; private Vector3 restDirFL; private Vector3 restDirUR; private Vector3 restDirFR; private Vector3 chestPivotLocal; private Quaternion leftGripRotGun; private bool ready; private CharacterModel characterModel; private CharacterBody body; private InputBankTest input; private CharacterMotor motor; private float time; private float phase; private float moveBlend; private float airBlend; private float sprintBlend; private Vector3 lastBodyPos; private bool hasLastPos; private Vector3 smoothedVel; private Vector3 prevSmoothedVel; private Vector3 localAccel; private Vector3 moveDirLocal = Vector3.forward; private float lastCos; private bool wasGrounded = true; private float landT = 10f; private float landStrength; private float recoil; private float pumpT = 10f; private Gesture gesture; private float gestureT = 1f; private float gestureDuration = 1f; private float deathT = -1f; private float earTwitchCooldown = 3f; private float earTwitchT = 10f; private int earTwitchSide; private float fidgetCooldown = 5f; private Quaternion smoothedAimFrame = Quaternion.identity; private bool hasAimFrame; public Transform MuzzleTransform { get { if (!Object.op_Implicit((Object)(object)gun)) { return ((Component)this).transform; } return gun.Find("Muzzle"); } } private void Awake() { Setup(); } private void Setup() { //IL_0280: 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_0296: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: 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_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_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: 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_03c8: 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_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_03df: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Unknown result type (might be due to invalid IL or missing references) if (!ready && bones != null && bones.Length != 0) { iRoot = Find("Root"); iSpine = Find("spine"); iSpine1 = Find("spine.1"); iSpine2 = Find("spine.2"); iNeck = Find("Neck"); iHead = Find("Head"); iUArmL = Find("upper_arm.L"); iFArmL = Find("forearm.L"); iHandL = Find("hand.L"); iUArmR = Find("upper_arm.R"); iFArmR = Find("forearm.R"); iHandR = Find("hand.R"); iThighL = Find("thigh.L"); iShinL = Find("shin.L"); iFootL = Find("foot.L"); iToeL = Find("toe.L"); iThighR = Find("thigh.R"); iShinR = Find("shin.R"); iFootR = Find("foot.R"); iToeR = Find("toe.R"); iEar1L = Find("Ear1.L"); iEar2L = Find("Ear2.L"); iEar1R = Find("Ear1.R"); iEar2R = Find("Ear2.R"); iTail = new int[7]; iTail[0] = Find("Tail"); for (int i = 1; i < 7; i++) { iTail[i] = Find("Tail" + i); } iFingersL = new int[12]; iFingersR = new int[12]; for (int j = 0; j < 12; j++) { iFingersL[j] = Find("finger" + (j + 1) + ".L"); iFingersR[j] = Find("finger" + (j + 1) + ".R"); } restDirUL = restModelPos[iFArmL] - restModelPos[iUArmL]; restDirFL = restModelPos[iHandL] - restModelPos[iFArmL]; restDirUR = restModelPos[iFArmR] - restModelPos[iUArmR]; restDirFR = restModelPos[iHandR] - restModelPos[iFArmR]; upperLenL = ((Vector3)(ref restDirUL)).magnitude; foreLenL = ((Vector3)(ref restDirFL)).magnitude; upperLenR = ((Vector3)(ref restDirUR)).magnitude; foreLenR = ((Vector3)(ref restDirFR)).magnitude; ((Vector3)(ref restDirUL)).Normalize(); ((Vector3)(ref restDirFL)).Normalize(); ((Vector3)(ref restDirUR)).Normalize(); ((Vector3)(ref restDirFR)).Normalize(); chestPivotLocal = ChestPivotModel - restModelPos[iSpine2]; Vector3 val = new Vector3(0.55f, 0.05f, 0.83f); leftGripRotGun = FromTo(((Vector3)(ref val)).normalized, Vector3.up, Vector3.left, Vector3.down); characterModel = ((Component)this).GetComponent<CharacterModel>(); ready = true; } } private int Find(string boneName) { for (int i = 0; i < bones.Length; i++) { if (Object.op_Implicit((Object)(object)bones[i]) && ((Object)bones[i]).name == boneName) { return i; } } Log.Warning("ProtogenAnimator: missing bone " + boneName); return 0; } private static Quaternion FromTo(Vector3 targetDir, Vector3 targetUp, Vector3 restDir, Vector3 restUp) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) return Quaternion.LookRotation(targetDir, targetUp) * Quaternion.Inverse(Quaternion.LookRotation(restDir, restUp)); } public void PlayFire() { recoil = 1f; pumpT = -0.12f; } public void PlayGesture(Gesture g, float duration) { gesture = g; gestureT = 0f; gestureDuration = Mathf.Max(0.1f, duration); } public void PlayDeath() { if (deathT < 0f) { deathT = 0f; } } private void LateUpdate() { //IL_0056: 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_0067: Unknown result type (might be due to invalid IL or missing references) if (!ready) { Setup(); if (!ready) { return; } } float deltaTime = Time.deltaTime; if (!(deltaTime <= 0f)) { time += deltaTime; ResolveLinks(); UpdateInputs(deltaTime, out var aimDir, out var grounded, out var _, out var speed, out var planarDir); ResetPose(); Locomotion(deltaTime, grounded, speed, planarDir); UpperBody(deltaTime, aimDir); Arms(deltaTime, aimDir); Secondary(deltaTime, speed); if (deathT >= 0f) { DeathPose(deltaTime); } } } private void ResolveLinks() { if (!displayMode && !Object.op_Implicit((Object)(object)body)) { if (!Object.op_Implicit((Object)(object)characterModel)) { characterModel = ((Component)this).GetComponent<CharacterModel>(); } if (Object.op_Implicit((Object)(object)characterModel) && Object.op_Implicit((Object)(object)characterModel.body)) { body = characterModel.body; input = body.inputBank; motor = body.characterMotor; } } } private void UpdateInputs(float dt, out Vector3 aimDir, out bool grounded, out bool sprinting, out float speed, out Vector3 planarDir) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0026: 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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_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_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_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_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_00d2: 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_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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: 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) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: 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_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: 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_0159: 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) //IL_0072: 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_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020a: 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_01de: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: 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_02e6: Unknown result type (might be due to invalid IL or missing references) Quaternion rotation = ((Component)this).transform.rotation; Quaternion val = Quaternion.Inverse(rotation); Vector3 val2 = (Object.op_Implicit((Object)(object)body) ? ((Component)body).transform.position : ((Component)this).transform.position); Vector3 val3 = Vector3.zero; if (hasLastPos) { val3 = (val2 - lastBodyPos) / dt; if (((Vector3)(ref val3)).sqrMagnitude > 3600f) { val3 = Vector3.zero; } } lastBodyPos = val2; hasLastPos = true; prevSmoothedVel = smoothedVel; smoothedVel = Vector3.Lerp(smoothedVel, val3, 1f - Mathf.Exp(-14f * dt)); Vector3 val4 = (smoothedVel - prevSmoothedVel) / dt; localAccel = Vector3.Lerp(localAccel, val * val4, 1f - Mathf.Exp(-6f * dt)); Vector3 val5 = val * smoothedVel; Vector3 val6 = default(Vector3); ((Vector3)(ref val6))..ctor(val5.x, 0f, val5.z); speed = ((Vector3)(ref val6)).magnitude; if (speed > 0.3f) { moveDirLocal = Vector3.Slerp(moveDirLocal, val6 / speed, 1f - Mathf.Exp(-10f * dt)); } planarDir = moveDirLocal; grounded = !Object.op_Implicit((Object)(object)motor) || motor.isGrounded; sprinting = Object.op_Implicit((Object)(object)body) && body.isSprinting; if (displayMode) { grounded = true; sprinting = false; speed = 0f; } if (Object.op_Implicit((Object)(object)input) && !displayMode) { aimDir = input.aimDirection; } else { aimDir = rotation * Quaternion.Euler(8f, -12f, 0f) * Vector3.forward; } if (((Vector3)(ref aimDir)).sqrMagnitude < 0.01f) { aimDir = ((Component)this).transform.forward; } moveBlend = Mathf.MoveTowards(moveBlend, (speed > 0.4f) ? Mathf.Clamp01(speed / 3f) : 0f, dt * 5f); airBlend = Mathf.MoveTowards(airBlend, grounded ? 0f : 1f, dt * (grounded ? 10f : 5f)); sprintBlend = Mathf.MoveTowards(sprintBlend, sprinting ? 1f : 0f, dt * 6f); if (grounded && !wasGrounded && val5.y < -4f) { landT = 0f; landStrength = Mathf.Clamp01((0f - val5.y) / 20f); } wasGrounded = grounded; landT += dt; recoil = Mathf.Max(0f, recoil - dt * 5f); pumpT += dt; if (gesture != Gesture.None) { gestureT += dt / gestureDuration; if (gestureT >= 1f) { gesture = Gesture.None; } } if (deathT >= 0f) { deathT += dt; } if (displayMode) { fidgetCooldown -= dt; if (fidgetCooldown <= 0f) { fidgetCooldown = Random.Range(5f, 8f); PlayFire(); recoil = 0.25f; } } } private void ResetPose() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < bones.Length; i++) { Transform val = bones[i]; if (Object.op_Implicit((Object)(object)val)) { val.localRotation = Quaternion.identity; val.localPosition = restLocalPos[i]; } } } private void Locomotion(float dt, bool grounded, float speed, Vector3 moveDir) { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_013c: 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_0143: 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_0150: 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_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: 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_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0284: 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_029a: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: 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_02e0: 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_02f6: 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) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_045b: Unknown result type (might be due to invalid IL or missing references) //IL_04c9: Unknown result type (might be due to invalid IL or missing references) //IL_04fb: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Clamp01((speed - 2f) / 9f); float num2 = Mathf.Lerp(1.5f, 2.9f, num); if (grounded) { phase += speed * dt / num2 * (float)Math.PI * 2f; } else { phase += dt * 2f; } phase = Mathf.Repeat(phase, (float)Math.PI * 200f); float num3 = Mathf.Sin(phase); float num4 = Mathf.Cos(phase); float num5 = Mathf.Lerp(26f, 44f, num) * moveBlend; Vector3 val = Vector3.Cross(Vector3.up, moveDir); if (((Vector3)(ref val)).sqrMagnitude < 0.0001f) { val = Vector3.right; } ((Vector3)(ref val)).Normalize(); if (grounded && moveBlend > 0.5f && Mathf.Sign(num4) != Mathf.Sign(lastCos) && !displayMode) { Footstep(num4 < 0f); } lastCos = num4; float num6 = 8f * moveBlend + 4f; float num7 = Mathf.Lerp(38f, 60f, num) * moveBlend; Quaternion val2 = Quaternion.AngleAxis((0f - num5) * num3, val); Quaternion val3 = Quaternion.AngleAxis(num5 * num3, val); float num8 = num6 + num7 * Mathf.Max(0f, num4); float num9 = num6 + num7 * Mathf.Max(0f, 0f - num4); float num10 = Mathf.Clamp01(((Quaternion.Inverse(((Component)this).transform.rotation) * smoothedVel).y + 3f) / 12f); Quaternion val4 = Quaternion.AngleAxis(0f - (18f + 30f * num10), Vector3.right); Quaternion val5 = Quaternion.AngleAxis(0f - (4f + 14f * num10), Vector3.right); float num11 = 30f + 45f * num10; float num12 = 22f + 30f * num10; float num13 = ((landT < 0.35f) ? (Mathf.Sin(landT / 0.35f * (float)Math.PI) * (0.4f + landStrength)) : 0f); float knee = Mathf.Lerp(num8, num11, airBlend) + num13 * 25f; float knee2 = Mathf.Lerp(num9, num12, airBlend) + num13 * 25f; SetLeg(iThighL, iShinL, iFootL, iToeL, Quaternion.Slerp(val2, val4, airBlend) * Quaternion.AngleAxis((0f - num13) * 14f, Vector3.right), knee, grounded ? Mathf.Max(0f, num4) : 0.5f); SetLeg(iThighR, iShinR, iFootR, iToeR, Quaternion.Slerp(val3, val5, airBlend) * Quaternion.AngleAxis((0f - num13) * 14f, Vector3.right), knee2, grounded ? Mathf.Max(0f, 0f - num4) : 0.5f); float num14 = 0.045f * moveBlend * (1f - airBlend) * num3 * num3; float num15 = (1f - moveBlend) * 0.012f * Mathf.Sin(time * 0.6f); float num16 = 0.02f * moveBlend + num13 * 0.12f + 0.03f * sprintBlend; bones[iRoot].localPosition = restLocalPos[iRoot] + new Vector3(num15, 0f - num14 - num16, 0f); float num17 = 4f * moveBlend + 10f * sprintBlend + Mathf.Clamp(localAccel.z * 0.6f, -6f, 8f); float num18 = Mathf.Clamp((0f - localAccel.x) * 0.5f, -8f, 8f); bones[iSpine].localRotation = Quaternion.Euler(0f, 7f * num3 * moveBlend, 3f * num3 * moveBlend + num18 * 0.5f); float num19 = Mathf.Sin(time * 1.7f) * (1f - moveBlend * 0.7f); bones[iSpine1].localRotation = Quaternion.Euler(num17 * 0.6f + num19 * 1.2f + num13 * 8f, -9f * num3 * moveBlend, (0f - num18) * 0.3f); bones[iSpine2].localRotation = Quaternion.Euler(num17 * 0.4f + num19 * 0.8f, 0f, 0f); } private void SetLeg(int thigh, int shin, int foot, int toe, Quaternion thighRot, float knee, float liftPhase) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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) bones[thigh].localRotation = thighRot; bones[shin].localRotation = Quaternion.AngleAxis(knee, Vector3.right); bones[foot].localRotation = Quaternion.AngleAxis((0f - knee) * 1.05f, Vector3.right); Quaternion val = ((Component)this).transform.rotation * Quaternion.Euler(0f, 0f, 0f); float num = liftPhase * 22f * moveBlend + airBlend * 18f; bones[toe].rotation = Quaternion.Slerp(bones[foot].rotation, val * Quaternion.AngleAxis(num, Vector3.right), 0.75f); } private void Footstep(bool rightFoot) { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)body)) { if (!string.IsNullOrEmpty(footstepSound)) { Util.PlaySound(footstepSound, ((Component)body).gameObject); } if (Object.op_Implicit((Object)(object)footstepDust) && body.isSprinting) { Transform val = bones[rightFoot ? iToeR : iToeL]; Object.Instantiate<GameObject>(footstepDust, val.position, Quaternion.identity); } } } private void UpperBody(float dt, Vector3 aimDir) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_002f: 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_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_010c: 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_014f: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: 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_018c: Unknown result type (might be due to invalid IL or missing references) //IL_018e: 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_0195: 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_019b: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Quaternion.Inverse(((Component)this).transform.rotation) * aimDir; float num = Mathf.Atan2(val.x, val.z) * 57.29578f; float num2 = Mathf.Asin(Mathf.Clamp(val.y, -1f, 1f)) * 57.29578f; float num3 = Mathf.InverseLerp(150f, 110f, Mathf.Abs(num)); float num4 = (1f - sprintBlend * 0.8f) * num3; float num5 = Mathf.Clamp(num, -70f, 70f) * num4; float num6 = Mathf.Clamp(0f - num2, -40f, 40f) * (1f - sprintBlend) * num3; bones[iSpine1].localRotation = bones[iSpine1].localRotation * Quaternion.Euler(num6 * 0.15f, num5 * 0.4f, 0f); bones[iSpine2].localRotation = bones[iSpine2].localRotation * Quaternion.Euler(num6 * 0.25f, num5 * 0.6f, 0f); bones[iSpine2].localRotation = bones[iSpine2].localRotation * Quaternion.Euler((0f - recoil) * 4f, 0f, 0f); Quaternion rotation = bones[iSpine2].rotation; Vector3 val2 = Quaternion.Inverse(rotation) * aimDir; float num7 = Mathf.Clamp(Mathf.Atan2(val2.x, val2.z) * 57.29578f, -70f, 70f) * num3; float num8 = Mathf.Clamp(Mathf.Asin(Mathf.Clamp(val2.y, -1f, 1f)) * 57.29578f, -55f, 50f); Quaternion val3 = rotation * Quaternion.Euler(0f - num8, num7, 0f); bones[iNeck].rotation = Quaternion.Slerp(rotation, val3, 0.35f); bones[iHead].rotation = val3; } private void Arms(float dt, Vector3 aimDir) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: 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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: 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_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0111: 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_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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_019f: 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_01b5: 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_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_01c9: 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_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0214: 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_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: 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_016b: 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_0171: 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_017b: 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_017f: 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_018c: Unknown result type (might be due to invalid IL or missing references) //IL_018e: 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_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_027b: 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_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_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: 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_02cc: 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_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_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: 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_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03be: Unknown result type (might be due to invalid IL or missing references) //IL_0344: 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_0352: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) Transform obj = bones[iSpine2]; Quaternion rotation = obj.rotation; Vector3 val = obj.TransformPoint(chestPivotLocal); Vector3 val2 = Quaternion.Inverse(rotation) * aimDir; float num = Mathf.Clamp(Mathf.Atan2(val2.x, val2.z) * 57.29578f, -30f, 30f); float num2 = Mathf.Clamp(Mathf.Asin(Mathf.Clamp(val2.y, -1f, 1f)) * 57.29578f, -75f, 75f); Quaternion val3 = rotation * Quaternion.Euler(0f - num2, num, 0f); if (!hasAimFrame) { smoothedAimFrame = val3; hasAimFrame = true; } smoothedAimFrame = Quaternion.Slerp(smoothedAimFrame, val3, 1f - Mathf.Exp(-25f * dt)); val3 = smoothedAimFrame; float num3 = recoil * recoil; Quaternion val4 = val3 * Quaternion.Euler(-16f * num3, 0f, 0f); Vector3 val5 = val + val3 * (GripOffset + new Vector3(0f, 0.03f * num3, -0.07f * num3)); if (sprintBlend > 0f) { Quaternion val6 = rotation * Quaternion.Euler(-35f, -58f, 20f); Vector3 val7 = val + rotation * SprintGripOffset; val4 = Quaternion.Slerp(val4, val6, sprintBlend); val5 = Vector3.Lerp(val5, val7, sprintBlend); } Quaternion val8 = val4 * Quaternion.Inverse(gunLocalRot); Vector3 val9 = val5 - val8 * gunLocalPos; Vector3 pole = rotation * new Vector3(0.7f, -1f, -0.35f); SolveArm(iUArmR, iFArmR, iHandR, upperLenR, foreLenR, restDirUR, restDirFR, val9, val8, pole); float num4 = 0f; if (pumpT >= 0f && pumpT < 0.32f) { num4 = Mathf.Sin(pumpT / 0.32f * (float)Math.PI) * 0.075f; } if (Object.op_Implicit((Object)(object)pump)) { pump.localPosition = pumpRestLocal + Vector3.back * num4; } Vector3 val10 = (Object.op_Implicit((Object)(object)gun) ? gun.TransformPoint(pumpGripGun + Vector3.back * num4) : val9); Quaternion val11 = val4 * leftGripRotGun; Vector3 val12 = val10 - val11 * PalmLocalL; float num5 = 0f; if (gesture != Gesture.None) { float num6 = Mathf.Clamp01(gestureT); float num7 = Mathf.SmoothStep(0f, 1f, num6 / 0.18f) * (1f - Mathf.SmoothStep(0f, 1f, (num6 - 0.68f) / 0.32f)); GestureTarget(gesture, num6, val, val3, out var pos, out var rot, out var open); val12 = Vector3.Lerp(val12, pos, num7); val11 = Quaternion.Slerp(val11, rot, num7); num5 = open * num7; } Vector3 pole2 = rotation * new Vector3(-0.6f, -1f, -0.2f); SolveArm(iUArmL, iFArmL, iHandL, upperLenL, foreLenL, restDirUL, restDirFL, val12, val11, pole2); CurlFingers(iFingersR, -1f, 72f, 30f); CurlFingers(iFingersL, 1f, Mathf.Lerp(65f, 5f, num5), Mathf.Lerp(28f, 0f, num5)); } private void GestureTarget(Gesture g, float u, Vector3 pivot, Quaternion aim, out Vector3 pos, out Quaternion rot, out float open) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0043: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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_0084: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: 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_00fb: 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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: 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_0128: 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_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0191: 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_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_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: 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_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) open = 1f; Vector3 val5; switch (g) { case Gesture.Zap: { float num2 = Mathf.SmoothStep(0f, 1f, u / 0.3f); pos = pivot + aim * Vector3.Lerp(new Vector3(-0.2f, -0.06f, 0.25f), new Vector3(-0.25f, -0.01f, 0.5f), num2); val5 = new Vector3(0f, 1f, 0.3f); rot = aim * FromTo(((Vector3)(ref val5)).normalized, Vector3.forward, Vector3.left, Vector3.down); break; } case Gesture.Sweep: { float num = Mathf.SmoothStep(0f, 1f, (u - 0.1f) / 0.5f); pos = pivot + aim * Vector3.Lerp(new Vector3(-0.12f, -0.02f, 0.46f), new Vector3(-0.48f, 0.02f, 0.26f), num); Vector3 forward = Vector3.forward; val5 = new Vector3(-0.7f, 0f, 0.7f); Vector3 targetUp = Vector3.Slerp(forward, ((Vector3)(ref val5)).normalized, num); rot = aim * FromTo(Vector3.up, targetUp, Vector3.left, Vector3.down); break; } default: { Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(-0.26f, 0.22f, -0.12f); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(-0.1f, 0.12f, 0.52f); Vector3 val3 = ((u < 0.35f) ? Vector3.Lerp(new Vector3(-0.2f, 0f, 0.2f), val, Mathf.SmoothStep(0f, 1f, u / 0.35f)) : Vector3.Lerp(val, val2, Mathf.SmoothStep(0f, 1f, (u - 0.35f) / 0.2f))); pos = pivot + aim * val3; Vector3 val4 = ((u < 0.35f) ? new Vector3(0f, 1f, -0.3f) : new Vector3(0f, 0.2f, 1f)); rot = aim * FromTo(((Vector3)(ref val4)).normalized, Vector3.down + Vector3.forward * 0.3f, Vector3.left, Vector3.down); open = ((u < 0.4f) ? 0.2f : 1f); break; } } } private void SolveArm(int iUpper, int iFore, int iHand, float a, float b, Vector3 restDirU, Vector3 restDirF, Vector3 target, Quaternion handRot, Vector3 pole) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_00f0: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0100: 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) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: 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_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) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0128: 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_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_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_0143: 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_014a: 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_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: 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_00e7: 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_0178: 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_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_0199: 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_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_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) Transform val = bones[iUpper]; Transform val2 = bones[iFore]; Transform val3 = bones[iHand]; Vector3 position = val.position; Vector3 val4 = target - position; float magnitude = ((Vector3)(ref val4)).magnitude; if (!(magnitude < 0.0001f)) { Vector3 val5 = val4 / magnitude; float num = Mathf.Clamp(magnitude, Mathf.Abs(a - b) + 0.01f, a + b - 0.002f); float num2 = Mathf.Clamp((a * a + num * num - b * b) / (2f * a * num), -1f, 1f); float num3 = Mathf.Sqrt(1f - num2 * num2); Vector3 val6 = pole - val5 * Vector3.Dot(pole, val5); if (((Vector3)(ref val6)).sqrMagnitude < 1E-06f) { val6 = Vector3.Cross(val5, ((Component)this).transform.right); } ((Vector3)(ref val6)).Normalize(); Vector3 val7 = position + a * (val5 * num2 + val6 * num3); Vector3 val8 = position + val5 * num; Vector3 val9 = val7 - position; Vector3 normalized = ((Vector3)(ref val9)).normalized; val9 = val8 - val7; Vector3 normalized2 = ((Vector3)(ref val9)).normalized; Vector3 val10 = Vector3.Cross(normalized, normalized2); if (((Vector3)(ref val10)).sqrMagnitude < 1E-06f) { val10 = Vector3.Cross(normalized, val6); } ((Vector3)(ref val10)).Normalize(); val.rotation = FromTo(normalized, Vector3.Cross(val10, normalized), restDirU, Vector3.forward); val2.rotation = FromTo(normalized2, Vector3.Cross(val10, normalized2), restDirF, Vector3.forward); val3.rotation = handRot; } } private void CurlFingers(int[] fingers, float sign, float curl, float thumbCurl) { //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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < 4; i++) { for (int j = 0; j < 3; j++) { Transform val = bones[fingers[i * 3 + j]]; if (i == 0) { val.localRotation = Quaternion.AngleAxis(thumbCurl * ((j == 0) ? 1f : 0.6f), Vector3.right); } else { val.localRotation = Quaternion.AngleAxis(sign * curl * ((j == 0) ? 0.9f : 1.05f), Vector3.forward); } } } } private void Secondary(float dt, float speed) { //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: 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) float num = Mathf.Clamp01(speed / 9f); float num2 = Mathf.Clamp((0f - localAccel.x) * 1.6f, -25f, 25f); float num3 = Mathf.Clamp((0f - localAccel.y) * 0.8f, -15f, 15f); for (int i = 0; i < iTail.Length; i++) { float num4 = (float)(i + 1) / (float)iTail.Length; float num5 = ((i == 0) ? (-30f) : (-6.5f)) * (1f - 0.55f * num) + airBlend * ((i == 0) ? 12f : 2f); float num6 = (3f + (float)i * 2.2f) * Mathf.Sin(time * 2.1f - (float)i * 0.75f) * (1f - 0.4f * num); float num7 = 3f * Mathf.Sin(phase * 2f - (float)i * 0.5f) * moveBlend; bones[iTail[i]].localRotation = Quaternion.Euler(num5 + num7 + num3 * num4 * 0.4f, num6 + num2 * num4 * 0.35f, 0f); } earTwitchCooldown -= dt; if (earTwitchCooldown <= 0f) { earTwitchCooldown = Random.Range(2.5f, 6f); earTwitchT = 0f; earTwitchSide = Random.Range(0, 3); } earTwitchT += dt; float num8 = ((earTwitchT < 0.28f) ? (Mathf.Sin(earTwitchT / 0.28f * (float)Math.PI) * 18f) : 0f); float num9 = -18f * sprintBlend - 6f * moveBlend + 10f * recoil; bones[iEar1L].localRotation = Quaternion.Euler(num9, 0f, (earTwitchSide != 1) ? (0f - num8) : 0f); bones[iEar1R].localRotation = Quaternion.Euler(num9, 0f, (earTwitchSide != 0) ? num8 : 0f); float num10 = Mathf.Sin(time * 3.1f) * 3f; bones[iEar2L].localRotation = Quaternion.Euler(num9 * 0.4f + num10, 0f, 0f); bones[iEar2R].localRotation = Quaternion.Euler(num9 * 0.4f - num10, 0f, 0f); } private void DeathPose(float dt) { //IL_004d: 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: 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_00fa: 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_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: 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_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.SmoothStep(0f, 1f, deathT / 0.45f); float num2 = Mathf.SmoothStep(0f, 1f, (deathT - 0.35f) / 0.55f); Transform obj = bones[iRoot]; obj.localPosition = Vector3.Lerp(obj.localPosition, restLocalPos[iRoot] + new Vector3(0f, -0.42f, 0.15f), num); obj.localRotation = Quaternion.Slerp(obj.localRotation, Quaternion.Euler(78f, 0f, 6f), num2); int[] array = new int[2] { iThighL, iThighR }; foreach (int num3 in array) { bones[num3].localRotation = Quaternion.Slerp(bones[num3].localRotation, Quaternion.Euler(-75f, 0f, 0f), num); } array = new int[2] { iShinL, iShinR }; foreach (int num4 in array) { bones[num4].localRotation = Quaternion.Slerp(bones[num4].localRotation, Quaternion.Euler(105f, 0f, 0f), num); } array = new int[2] { iFootL, iFootR }; foreach (int num5 in array) { bones[num5].localRotation = Quaternion.Slerp(bones[num5].localRotation, Quaternion.Euler(-30f, 0f, 0f), num); } bones[iSpine1].localRotation = Quaternion.Slerp(bones[iSpine1].localRotation, Quaternion.Euler(25f, 0f, 0f), num); bones[iHead].localRotation = Quaternion.Slerp(bones[iHead].localRotation, Quaternion.Euler(35f, 15f, 0f), num); for (int j = 0; j < iTail.Length; j++) { bones[iTail[j]].localRotation = Quaternion.Slerp(bones[iTail[j]].localRotation, Quaternion.Euler(-8f, 4f, 0f), num2); } } } public static class ProtogenSurvivorFactory { public const float GunScale = 0.85f; private static readonly Vector3 FistCenterR = new Vector3(0.085f, -0.035f, 0f); private static readonly Vector3 PalmOffsetL = new Vector3(-0.07f, -0.03f, 0f); public static GameObject bodyPrefab; public static GameObject displayPrefab; public static SurvivorDef survivorDef; public static ItemDisplayRuleSet itemDisplayRuleSet; private static readonly FieldInfo skillFamilyField = typeof(GenericSkill).GetField("_skillFamily", BindingFlags.Instance | BindingFlags.NonPublic); public static void Create() { //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) GameObject obj = ProtoAssets.LoadPrefab("RoR2/Base/Commando/CommandoBody.prefab"); Transform modelTransform = obj.GetComponent<ModelLocator>().modelTransform; FootstepHandler component = ((Component)modelTransform).GetComponent<FootstepHandler>(); string footstepSound = (Object.op_Implicit((Object)(object)component) ? component.baseFootstepString : ProtoVfx.footstepSound); GameObject footstepDust = ((Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.footstepDustPrefab)) ? component.footstepDustPrefab : ProtoVfx.footstepDust); itemDisplayRuleSet = ScriptableObject.CreateInstance<ItemDisplayRuleSet>(); ((Object)itemDisplayRuleSet).name = "idrsProtogen"; bodyPrefab = PrefabAPI.InstantiateClone(obj, "ProtogenBody", true); GameObject val = BuildModel("mdlProtogen", display: false, footstepSound, footstepDust); AttachModel(bodyPrefab, val); SetupBody(bodyPrefab); SetupHurtboxes(bodyPrefab, val); SetupSkills(bodyPrefab