using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using AH64.Modules; using AH64.Modules.Achievements; using AH64.Modules.Characters; using AH64.Survivors; using AH64.Survivors.Components; using AH64.Survivors.SkillStates; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.AI.Walker; using EntityStates.Commando; using EntityStates.Engi.EngiMissilePainter; using HG; using HG.BlendableTypes; using KinematicCharacterController; using On.RoR2; using R2API; using R2API.Utils; using RoR2; using RoR2.Achievements; using RoR2.Audio; using RoR2.CharacterAI; using RoR2.ContentManagement; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.UI; [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("AH64")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+3ba2ef4fdfcc1514feaffa75da42acd451961ef7")] [assembly: AssemblyProduct("AH64")] [assembly: AssemblyTitle("AH64")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace AH64 { [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.JohnstonStu.AH64", "AH64", "1.0.0")] public class AH64Plugin : BaseUnityPlugin { public const string MODUID = "com.JohnstonStu.AH64"; public const string MODNAME = "AH64"; public const string MODVERSION = "1.0.0"; public static AH64Plugin instance; private void Awake() { instance = this; Log.Init(((BaseUnityPlugin)this).Logger); AH64PlaytestConfig.Init(((BaseUnityPlugin)this).Config); Language.Init(); new AH64Survivor().Initialize(); new ContentPacks().Initialize(); } } internal static class Log { internal static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object data) { _logSource.LogDebug(data); } internal static void Error(object data) { _logSource.LogError(data); } internal static void ErrorAssetBundle(string assetName, string bundleName) { Error("failed to load asset, " + assetName + ", because it does not exist in asset bundle, " + bundleName); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } } namespace AH64.Modules { internal static class Asset { internal static Dictionary loadedBundles = new Dictionary(); internal static AssetBundle LoadAssetBundle(string bundleName) { if (loadedBundles.ContainsKey(bundleName)) { return loadedBundles[bundleName]; } AssetBundle val = null; try { val = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)AH64Plugin.instance).Info.Location), "AssetBundles", bundleName)); } catch (Exception arg) { Log.Error($"Error loading asset bundle, {bundleName}. Your asset bundle must be in a folder next to your mod dll called 'AssetBundles'. Follow the guide to build and install your mod correctly!\n{arg}"); } loadedBundles[bundleName] = val; return val; } internal static GameObject CloneTracer(string originalTracerName, string newTracerName) { if ((Object)(object)LegacyResourcesAPI.Load("Prefabs/Effects/Tracers/" + originalTracerName) == (Object)null) { return null; } GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/Effects/Tracers/" + originalTracerName), newTracerName, true); if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } val.GetComponent().speed = 250f; val.GetComponent().length = 50f; Content.CreateAndAddEffectDef(val); return val; } internal static void ConvertAllRenderersToHopooShader(GameObject objectToConvert) { if (!Object.op_Implicit((Object)(object)objectToConvert)) { return; } MeshRenderer[] componentsInChildren = objectToConvert.GetComponentsInChildren(); foreach (MeshRenderer val in componentsInChildren) { if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)((Renderer)val).sharedMaterial)) { ((Renderer)val).sharedMaterial.ConvertDefaultShaderToHopoo(); } } SkinnedMeshRenderer[] componentsInChildren2 = objectToConvert.GetComponentsInChildren(); foreach (SkinnedMeshRenderer val2 in componentsInChildren2) { if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)((Renderer)val2).sharedMaterial)) { ((Renderer)val2).sharedMaterial.ConvertDefaultShaderToHopoo(); } } } internal static GameObject LoadCrosshair(string crosshairName) { GameObject val = LegacyResourcesAPI.Load("Prefabs/Crosshair/" + crosshairName + "Crosshair"); if ((Object)(object)val == (Object)null) { Log.Error("could not load crosshair with the name " + crosshairName + ". defaulting to Standard"); return LegacyResourcesAPI.Load("Prefabs/Crosshair/StandardCrosshair"); } return val; } internal static GameObject LoadEffect(this AssetBundle assetBundle, string resourceName, bool parentToTransform) { return assetBundle.LoadEffect(resourceName, "", parentToTransform); } internal static GameObject LoadEffect(this AssetBundle assetBundle, string resourceName, string soundName = "", bool parentToTransform = false) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) GameObject val = assetBundle.LoadAsset(resourceName); if (!Object.op_Implicit((Object)(object)val)) { Log.ErrorAssetBundle(resourceName, ((Object)assetBundle).name); return null; } val.AddComponent().duration = 12f; val.AddComponent(); val.AddComponent().vfxPriority = (VFXPriority)2; EffectComponent obj = val.AddComponent(); obj.applyScale = false; obj.effectIndex = (EffectIndex)(-1); obj.parentToReferencedTransform = parentToTransform; obj.positionAtReferencedTransform = true; obj.soundName = soundName; Content.CreateAndAddEffectDef(val); return val; } internal static GameObject CreateProjectileGhostPrefab(this AssetBundle assetBundle, string ghostName) { GameObject val = assetBundle.LoadAsset(ghostName); if ((Object)(object)val == (Object)null) { Log.Error("Failed to load ghost prefab " + ghostName); } if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } if (!Object.op_Implicit((Object)(object)val.GetComponent())) { val.AddComponent(); } ConvertAllRenderersToHopooShader(val); return val; } internal static GameObject CloneProjectilePrefab(string prefabName, string newPrefabName) { return PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/Projectiles/" + prefabName), newPrefabName); } internal static GameObject LoadAndAddProjectilePrefab(this AssetBundle assetBundle, string newPrefabName) { GameObject val = assetBundle.LoadAsset(newPrefabName); if ((Object)(object)val == (Object)null) { Log.ErrorAssetBundle(newPrefabName, ((Object)assetBundle).name); return null; } Content.AddProjectilePrefab(val); return val; } } public static class Config { public static ConfigFile MyConfig = ((BaseUnityPlugin)AH64Plugin.instance).Config; public static ConfigEntry CharacterEnableConfig(string section, string characterName, string description = "", bool enabledByDefault = true) { if (string.IsNullOrEmpty(description)) { description = "Set to false to disable this character and as much of its code and content as possible"; } return BindAndOptions(section, "Enable " + characterName, enabledByDefault, description, restartRequired: true); } public static ConfigEntry BindAndOptions(string section, string name, T defaultValue, string description = "", bool restartRequired = false) { return BindAndOptions(section, name, defaultValue, 0f, 20f, description, restartRequired); } public static ConfigEntry BindAndOptions(string section, string name, T defaultValue, float min, float max, string description = "", bool restartRequired = false) { if (string.IsNullOrEmpty(description)) { description = name; } if (restartRequired) { description += " (restart required)"; } ConfigEntry result = MyConfig.Bind(section, name, defaultValue, description); Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"); return result; } public static ConfigEntry BindAndOptionsSlider(string section, string name, float defaultValue, string description, float min = 0f, float max = 20f, bool restartRequired = false) { return BindAndOptions(section, name, defaultValue, min, max, description, restartRequired); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static void TryRegisterOption(ConfigEntry entry, float min, float max, bool restartRequired) { } public static bool GetKeyPressed(KeyboardShortcut entry) { //IL_0010: 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) foreach (KeyCode modifier in ((KeyboardShortcut)(ref entry)).Modifiers) { if (!Input.GetKey(modifier)) { return false; } } return Input.GetKeyDown(((KeyboardShortcut)(ref entry)).MainKey); } } internal class Content { internal static void AddCharacterBodyPrefab(GameObject bprefab) { ContentPacks.bodyPrefabs.Add(bprefab); } internal static void AddMasterPrefab(GameObject prefab) { ContentPacks.masterPrefabs.Add(prefab); } internal static void AddProjectilePrefab(GameObject prefab) { ContentPacks.projectilePrefabs.Add(prefab); } internal static void AddSurvivorDef(SurvivorDef survivorDef) { ContentPacks.survivorDefs.Add(survivorDef); } internal static void CreateSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) CreateSurvivor(bodyPrefab, displayPrefab, charColor, tokenPrefix, null, 100f); } internal static void CreateSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, float sortPosition) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) CreateSurvivor(bodyPrefab, displayPrefab, charColor, tokenPrefix, null, sortPosition); } internal static void CreateSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, UnlockableDef unlockableDef) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) CreateSurvivor(bodyPrefab, displayPrefab, charColor, tokenPrefix, unlockableDef, 100f); } internal static void CreateSurvivor(GameObject bodyPrefab, GameObject displayPrefab, Color charColor, string tokenPrefix, UnlockableDef unlockableDef, float sortPosition) { //IL_0014: 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) SurvivorDef obj = ScriptableObject.CreateInstance(); obj.bodyPrefab = bodyPrefab; obj.displayPrefab = displayPrefab; obj.primaryColor = charColor; obj.cachedName = ((Object)bodyPrefab).name.Replace("Body", ""); obj.displayNameToken = tokenPrefix + "NAME"; obj.descriptionToken = tokenPrefix + "DESCRIPTION"; obj.outroFlavorToken = tokenPrefix + "OUTRO_FLAVOR"; obj.mainEndingEscapeFailureFlavorToken = tokenPrefix + "OUTRO_FAILURE"; obj.desiredSortPosition = sortPosition; obj.unlockableDef = unlockableDef; AddSurvivorDef(obj); } internal static void AddUnlockableDef(UnlockableDef unlockableDef) { ContentPacks.unlockableDefs.Add(unlockableDef); } internal static UnlockableDef CreateAndAddUnlockbleDef(string identifier, string nameToken, Sprite achievementIcon) { UnlockableDef obj = ScriptableObject.CreateInstance(); obj.cachedName = identifier; obj.nameToken = nameToken; obj.achievementIcon = achievementIcon; AddUnlockableDef(obj); return obj; } internal static void AddSkillDef(SkillDef skillDef) { ContentPacks.skillDefs.Add(skillDef); } internal static void AddSkillFamily(SkillFamily skillFamily) { ContentPacks.skillFamilies.Add(skillFamily); } internal static void AddEntityState(Type entityState) { ContentPacks.entityStates.Add(entityState); } internal static void AddBuffDef(BuffDef buffDef) { ContentPacks.buffDefs.Add(buffDef); } internal static BuffDef CreateAndAddBuff(string buffName, Sprite buffIcon, Color buffColor, bool canStack, bool isDebuff) { //IL_000d: 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) BuffDef obj = ScriptableObject.CreateInstance(); ((Object)obj).name = buffName; obj.buffColor = buffColor; obj.canStack = canStack; obj.isDebuff = isDebuff; obj.eliteDef = null; obj.iconSprite = buffIcon; AddBuffDef(obj); return obj; } internal static void AddEffectDef(EffectDef effectDef) { ContentPacks.effectDefs.Add(effectDef); } internal static EffectDef CreateAndAddEffectDef(GameObject effectPrefab) { //IL_0001: 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_000c: Expected O, but got Unknown //IL_000d: Expected O, but got Unknown EffectDef val = new EffectDef(effectPrefab); AddEffectDef(val); return val; } internal static void AddNetworkSoundEventDef(NetworkSoundEventDef networkSoundEventDef) { ContentPacks.networkSoundEventDefs.Add(networkSoundEventDef); } internal static NetworkSoundEventDef CreateAndAddNetworkSoundEventDef(string eventName) { NetworkSoundEventDef obj = ScriptableObject.CreateInstance(); obj.akId = AkSoundEngine.GetIDFromString(eventName); obj.eventName = eventName; AddNetworkSoundEventDef(obj); return obj; } } internal class ContentPacks : IContentPackProvider { internal ContentPack contentPack = new ContentPack(); public static List bodyPrefabs = new List(); public static List masterPrefabs = new List(); public static List projectilePrefabs = new List(); public static List survivorDefs = new List(); public static List unlockableDefs = new List(); public static List skillFamilies = new List(); public static List skillDefs = new List(); public static List entityStates = new List(); public static List buffDefs = new List(); public static List effectDefs = new List(); public static List networkSoundEventDefs = new List(); public string identifier => "com.JohnstonStu.AH64"; public void Initialize() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders); } private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider) { addContentPackProvider.Invoke((IContentPackProvider)(object)this); } public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { contentPack.identifier = identifier; contentPack.bodyPrefabs.Add(bodyPrefabs.ToArray()); contentPack.masterPrefabs.Add(masterPrefabs.ToArray()); contentPack.projectilePrefabs.Add(projectilePrefabs.ToArray()); contentPack.survivorDefs.Add(survivorDefs.ToArray()); contentPack.unlockableDefs.Add(unlockableDefs.ToArray()); contentPack.skillDefs.Add(skillDefs.ToArray()); contentPack.skillFamilies.Add(skillFamilies.ToArray()); contentPack.entityStateTypes.Add(entityStates.ToArray()); contentPack.buffDefs.Add(buffDefs.ToArray()); contentPack.effectDefs.Add(effectDefs.ToArray()); contentPack.networkSoundEventDefs.Add(networkSoundEventDefs.ToArray()); args.ReportProgress(1f); yield break; } public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { ContentPack.Copy(contentPack, args.output); args.ReportProgress(1f); yield break; } public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { args.ReportProgress(1f); yield break; } } internal static class ItemDisplayCheck { public static List allDisplayedItems; public static void PrintUnused(ItemDisplayRuleSet itemDisplayRuleSet, string bodyName = "") { PrintUnused((IEnumerable)itemDisplayRuleSet.keyAssetRuleGroups.ToList(), bodyName); } public static void PrintUnused(IEnumerable ruleSet = null, string bodyName = "") { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_004d: 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_0064: Unknown result type (might be due to invalid IL or missing references) string text = "generating item displays for " + bodyName; if (allDisplayedItems == null) { LazyGatherAllItems(); } List list = new List(allDisplayedItems); string text2 = ""; if (ruleSet != null) { foreach (KeyAssetRuleGroup item in ruleSet) { if (item.displayRuleGroup.rules.Length != 0) { list.Remove(item.keyAsset); if (string.IsNullOrEmpty(text2)) { text2 = item.displayRuleGroup.rules[0].childName; } } } } if (string.IsNullOrEmpty(text2)) { text2 = "Chest"; } foreach (Object item2 in list) { string text3 = ""; if (ItemDisplays.KeyAssetDisplayPrefabs.ContainsKey(item2)) { text3 += SpitOutNewRule(item2, text2, ItemDisplays.KeyAssetDisplayPrefabs[item2]); } else { Log.Error($"COULD NOT FIND DISPLAY PREFABS FOR KEYASSET {item2}"); } text += text3; } Log.Message(text); } private static void LazyGatherAllItems() { allDisplayedItems = new List(ItemDisplays.KeyAssetDisplayPrefabs.Keys); allDisplayedItems.Sort(delegate(Object item1, Object item2) { if (item1 is ItemDef && item2 is ItemDef) { return item1.name.CompareTo(item2.name); } if (item1 is EquipmentDef && item2 is EquipmentDef) { return item1.name.CompareTo(item2.name); } if (item1 is ItemDef && item2 is EquipmentDef) { return -1; } return (item1 is EquipmentDef && item2 is ItemDef) ? 1 : 0; }); } private static string SpitOutNewRule(Object asset, string firstCompatibleChild, ItemDisplayRule[] displayRules) { //IL_0031: 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) if (displayRules.Length == 0) { return $"\n[NO DISPLAY RULES FOUND FOR THE KEYASSET {asset}"; } string text = "\n itemDisplayRules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(ItemDisplays.KeyAssets[\"" + asset.name + "\"]"; for (int i = 0; i < displayRules.Length; i++) { text = (((int)displayRules[i].limbMask != 0) ? (text + ",\n" + $" ItemDisplays.CreateLimbMaskDisplayRule(LimbFlags.{displayRules[i].limbMask})") : (text + ",\n ItemDisplays.CreateDisplayRule(ItemDisplays.LoadDisplay(\"" + ((Object)displayRules[i].followerPrefab).name + "\"),\n \"" + firstCompatibleChild + "\",\n new Vector3(2, 2, 2),\n new Vector3(0, 0, 0),\n new Vector3(1, 1, 1)\n )")); } return text + "\n ));"; } } internal static class ItemDisplays { private static Dictionary itemDisplayPrefabs = new Dictionary(); public static Dictionary KeyAssetDisplayPrefabs = new Dictionary(); public static Dictionary KeyAssets = new Dictionary(); public static int queuedDisplays; public static bool initialized = false; public static void LazyInit() { if (!initialized) { initialized = true; PopulateDisplays(); } } internal static void DisposeWhenDone() { queuedDisplays--; if (queuedDisplays <= 0 && initialized) { initialized = false; itemDisplayPrefabs = null; KeyAssetDisplayPrefabs = null; KeyAssets = null; } } internal static void PopulateDisplays() { PopulateFromBody("LoaderBody"); } private static void PopulateFromBody(string bodyName) { KeyAssetRuleGroup[] keyAssetRuleGroups = ((Component)LegacyResourcesAPI.Load("Prefabs/CharacterBodies/" + bodyName).GetComponent().modelTransform).GetComponent().itemDisplayRuleSet.keyAssetRuleGroups; for (int i = 0; i < keyAssetRuleGroups.Length; i++) { ItemDisplayRule[] rules = keyAssetRuleGroups[i].displayRuleGroup.rules; KeyAssetDisplayPrefabs[keyAssetRuleGroups[i].keyAsset] = rules; KeyAssets[keyAssetRuleGroups[i].keyAsset.name] = keyAssetRuleGroups[i].keyAsset; for (int j = 0; j < rules.Length; j++) { GameObject followerPrefab = rules[j].followerPrefab; if (Object.op_Implicit((Object)(object)followerPrefab)) { string key = ((Object)followerPrefab).name?.ToLowerInvariant(); if (!itemDisplayPrefabs.ContainsKey(key)) { itemDisplayPrefabs[key] = followerPrefab; } } } } } private static void PopulateCustomLightningArm() { GameObject val = PrefabAPI.InstantiateClone(itemDisplayPrefabs["displaylightningarmright"], "DisplayLightningCustom", false); LimbMatcher component = val.GetComponent(); component.limbPairs[0].targetChildLimb = "LightningArm1"; component.limbPairs[1].targetChildLimb = "LightningArm2"; component.limbPairs[2].targetChildLimb = "LightningArmEnd"; itemDisplayPrefabs["displaylightningarmcustom"] = val; } public static GameObject LoadDisplay(string name) { if (itemDisplayPrefabs.ContainsKey(name.ToLowerInvariant()) && Object.op_Implicit((Object)(object)itemDisplayPrefabs[name.ToLowerInvariant()])) { return itemDisplayPrefabs[name.ToLowerInvariant()]; } Log.Error("item display " + name + " returned null"); return null; } public static KeyAssetRuleGroup CreateDisplayRuleGroupWithRules(string itemName, params ItemDisplayRule[] rules) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) return CreateDisplayRuleGroupWithRules(GetKeyAssetFromString(itemName), rules); } public static KeyAssetRuleGroup CreateDisplayRuleGroupWithRules(Object keyAsset_, params ItemDisplayRule[] rules) { //IL_0015: 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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (keyAsset_ == (Object)null) { Log.Error("could not find keyasset"); } return new KeyAssetRuleGroup { keyAsset = keyAsset_, displayRuleGroup = new DisplayRuleGroup { rules = rules } }; } public static ItemDisplayRule CreateDisplayRule(string prefabName, string childName, Vector3 position, Vector3 rotation, Vector3 scale) { //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_000b: Unknown result type (might be due to invalid IL or missing references) return CreateDisplayRule(LoadDisplay(prefabName), childName, position, rotation, scale); } public static ItemDisplayRule CreateDisplayRule(GameObject itemPrefab, string childName, Vector3 position, Vector3 rotation, Vector3 scale) { //IL_0002: 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_0023: 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_002b: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) return new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, childName = childName, followerPrefab = itemPrefab, limbMask = (LimbFlags)0, localPos = position, localAngles = rotation, localScale = scale }; } public static ItemDisplayRule CreateLimbMaskDisplayRule(LimbFlags limb) { //IL_0002: 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_0012: 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_002c: Unknown result type (might be due to invalid IL or missing references) return new ItemDisplayRule { ruleType = (ItemDisplayRuleType)1, limbMask = limb, childName = "", followerPrefab = null }; } private static Object GetKeyAssetFromString(string itemName) { Object val = (Object)(object)LegacyResourcesAPI.Load("ItemDefs/" + itemName); if (val == (Object)null) { val = (Object)(object)LegacyResourcesAPI.Load("EquipmentDefs/" + itemName); } if (val == (Object)null) { Log.Error("Could not load keyasset for " + itemName); } return val; } } internal static class Language { public static string TokensOutput = ""; public static bool usingLanguageFolder = false; public static bool printingEnabled = false; public static void Init() { if (usingLanguageFolder) { Language.collectLanguageRootFolders += Language_collectLanguageRootFolders; } } private static void Language_collectLanguageRootFolders(List obj) { string text = Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)AH64Plugin.instance).Info.Location), "Language"); if (Directory.Exists(text)) { obj.Add(text); } } public static void Add(string token, string text) { if (!usingLanguageFolder) { LanguageAPI.Add(token, text); } if (printingEnabled) { TokensOutput = TokensOutput + "\n \"" + token + "\" : \"" + text.Replace(Environment.NewLine, "\\n").Replace("\n", "\\n") + "\","; } } public static void PrintOutput(string fileName = "") { if (printingEnabled) { string text = "{\n strings:\n {" + TokensOutput + "\n }\n}"; Log.Message(fileName + ": \n" + text); if (!string.IsNullOrEmpty(fileName)) { File.WriteAllText(Path.Combine(Directory.GetParent(((BaseUnityPlugin)AH64Plugin.instance).Info.Location).FullName, "Language", "en", fileName), text); } TokensOutput = ""; } } } internal static class Materials { private static List cachedMaterials = new List(); internal static Shader hotpoo = LegacyResourcesAPI.Load("Shaders/Deferred/HGStandard"); public static Material LoadMaterial(this AssetBundle assetBundle, string materialName) { return assetBundle.CreateHopooMaterialFromBundle(materialName); } public static Material CreateHopooMaterialFromBundle(this AssetBundle assetBundle, string materialName) { //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown Material val = cachedMaterials.Find(delegate(Material mat) { materialName.Replace(" (Instance)", ""); return ((Object)mat).name.Contains(materialName); }); if (Object.op_Implicit((Object)(object)val)) { Log.Debug(((Object)val).name + " has already been loaded. returning cached"); return val; } val = assetBundle.LoadAsset(materialName); if (!Object.op_Implicit((Object)(object)val)) { Log.ErrorAssetBundle(materialName, ((Object)assetBundle).name); return new Material(hotpoo); } return val.ConvertDefaultShaderToHopoo(); } public static Material SetHopooMaterial(this Material tempMat) { return tempMat.ConvertDefaultShaderToHopoo(); } public static Material ConvertDefaultShaderToHopoo(this Material tempMat) { //IL_00aa: 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) if (cachedMaterials.Contains(tempMat)) { Log.Debug(((Object)tempMat).name + " has already been converted. returning cached"); return tempMat; } string text = ((Object)tempMat.shader).name.ToLowerInvariant(); if (!text.StartsWith("standard") && !text.StartsWith("autodesk")) { Log.Debug(((Object)tempMat).name + " is not unity standard shader. aborting material conversion"); return tempMat; } float? num = null; Color? val = null; if (tempMat.IsKeywordEnabled("_NORMALMAP")) { num = tempMat.GetFloat("_BumpScale"); } if (tempMat.IsKeywordEnabled("_EMISSION")) { val = tempMat.GetColor("_EmissionColor"); } tempMat.shader = hotpoo; tempMat.SetTexture("_EmTex", tempMat.GetTexture("_EmissionMap")); tempMat.EnableKeyword("DITHER"); if (num.HasValue) { tempMat.SetFloat("_NormalStrength", num.Value); tempMat.SetTexture("_NormalTex", tempMat.GetTexture("_BumpMap")); } if (val.HasValue) { tempMat.SetColor("_EmColor", val.Value); tempMat.SetFloat("_EmPower", 1f); } if (tempMat.IsKeywordEnabled("NOCULL")) { tempMat.SetInt("_Cull", 0); } if (tempMat.IsKeywordEnabled("LIMBREMOVAL")) { tempMat.SetInt("_LimbRemovalOn", 1); } cachedMaterials.Add(tempMat); return tempMat; } public static Material MakeUnique(this Material material) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected O, but got Unknown if (cachedMaterials.Contains(material)) { return new Material(material); } return material; } public static Material SetColor(this Material material, Color color) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) material.SetColor("_Color", color); return material; } public static Material SetNormal(this Material material, float normalStrength = 1f) { material.SetFloat("_NormalStrength", normalStrength); return material; } public static Material SetEmission(this Material material) { return material.SetEmission(1f); } public static Material SetEmission(this Material material, float emission) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return material.SetEmission(emission, Color.white); } public static Material SetEmission(this Material material, float emission, Color emissionColor) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) material.SetFloat("_EmPower", emission); material.SetColor("_EmColor", emissionColor); return material; } public static Material SetCull(this Material material, bool cull = false) { material.SetInt("_Cull", cull ? 1 : 0); return material; } public static Material SetSpecular(this Material material, float strength) { material.SetFloat("_SpecularStrength", strength); return material; } public static Material SetSpecular(this Material material, float strength, float exponent) { material.SetFloat("_SpecularStrength", strength); material.SetFloat("_SpecularExponent", exponent); return material; } } internal static class Prefabs { private static PhysicMaterial ragdollMaterial; public static GameObject CreateDisplayPrefab(AssetBundle assetBundle, string displayPrefabName, GameObject prefab) { GameObject val = assetBundle.LoadAsset(displayPrefabName); if ((Object)(object)val == (Object)null) { Log.Error("could not load display prefab " + displayPrefabName + ". Make sure this prefab exists in assetbundle " + ((Object)assetBundle).name); return null; } CharacterModel val2 = val.GetComponent(); if (!Object.op_Implicit((Object)(object)val2)) { val2 = val.AddComponent(); } if (val2.baseRendererInfos == null || val2.baseRendererInfos.Length == 0) { val2.baseRendererInfos = prefab.GetComponentInChildren().baseRendererInfos; } Asset.ConvertAllRenderersToHopooShader(val); return val; } public static GameObject LoadCharacterModel(AssetBundle assetBundle, string modelName) { GameObject val = assetBundle.LoadAsset(modelName); if ((Object)(object)val == (Object)null) { Log.Error("could not load model prefab " + modelName + ". Make sure this prefab exists in assetbundle " + ((Object)assetBundle).name); return null; } return val; } public static GameObject LoadCharacterBody(AssetBundle assetBundle, string bodyName) { GameObject val = assetBundle.LoadAsset(bodyName); if ((Object)(object)val == (Object)null) { Log.Error("could not load body prefab " + bodyName + ". Make sure this prefab exists in assetbundle " + ((Object)assetBundle).name); return null; } return val; } public static GameObject CloneCharacterBody(BodyInfo bodyInfo) { GameObject val = LegacyResourcesAPI.Load("Prefabs/CharacterBodies/" + bodyInfo.bodyNameToClone + "Body"); if (!Object.op_Implicit((Object)(object)val)) { Log.Error(bodyInfo.bodyNameToClone + " Body to clone is not a valid body, character creation failed"); return null; } GameObject val2 = PrefabAPI.InstantiateClone(val, bodyInfo.bodyName); for (int num = val2.transform.childCount - 1; num >= 0; num--) { Object.DestroyImmediate((Object)(object)((Component)val2.transform.GetChild(num)).gameObject); } return val2; } public static GameObject CreateBodyPrefab(AssetBundle assetBundle, string modelPrefabName, BodyInfo bodyInfo) { return CreateBodyPrefab(LoadCharacterModel(assetBundle, modelPrefabName), bodyInfo); } public static GameObject CreateBodyPrefab(GameObject model, BodyInfo bodyInfo) { return CreateBodyPrefab(CloneCharacterBody(bodyInfo), model, bodyInfo); } public static GameObject CreateBodyPrefab(GameObject newBodyPrefab, AssetBundle assetBundle, string modelName, BodyInfo bodyInfo) { return CreateBodyPrefab(newBodyPrefab, LoadCharacterModel(assetBundle, modelName), bodyInfo); } public static GameObject CreateBodyPrefab(AssetBundle assetBundle, string bodyPrefabName, string modelPrefabName, BodyInfo bodyInfo) { return CreateBodyPrefab(LoadCharacterBody(assetBundle, bodyPrefabName), LoadCharacterModel(assetBundle, modelPrefabName), bodyInfo); } public static GameObject CreateBodyPrefab(GameObject newBodyPrefab, GameObject model, BodyInfo bodyInfo) { if ((Object)(object)model == (Object)null || (Object)(object)newBodyPrefab == (Object)null) { Log.Error($"Character creation failed. Model: {model}, Body: {newBodyPrefab}"); return null; } SetupCharacterBody(newBodyPrefab, bodyInfo); Transform modelBaseTransform = AddCharacterModelToSurvivorBody(newBodyPrefab, model.transform, bodyInfo); SetupModelLocator(newBodyPrefab, modelBaseTransform, model.transform); SetupCharacterDirection(newBodyPrefab, modelBaseTransform, model.transform); SetupCameraTargetParams(newBodyPrefab, bodyInfo); SetupCapsuleCollider(newBodyPrefab, bodyInfo); Content.AddCharacterBodyPrefab(newBodyPrefab); return newBodyPrefab; } private static void SetupCharacterBody(GameObject newBodyPrefab, BodyInfo bodyInfo) { //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) //IL_01f6: 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) CharacterBody component = newBodyPrefab.GetComponent(); component.baseNameToken = bodyInfo.bodyNameToken; component.subtitleNameToken = bodyInfo.subtitleNameToken; component.portraitIcon = bodyInfo.characterPortrait; component.bodyColor = bodyInfo.bodyColor; component._defaultCrosshairPrefab = bodyInfo.crosshair; component.hideCrosshair = false; component.preferredPodPrefab = bodyInfo.podPrefab; component.baseMaxHealth = bodyInfo.maxHealth; component.baseRegen = bodyInfo.healthRegen; component.baseArmor = bodyInfo.armor; component.baseMaxShield = bodyInfo.shield; component.baseDamage = bodyInfo.damage; component.baseAttackSpeed = bodyInfo.attackSpeed; component.baseCrit = bodyInfo.crit; component.baseMoveSpeed = bodyInfo.moveSpeed; component.baseJumpPower = bodyInfo.jumpPower; component.autoCalculateLevelStats = bodyInfo.autoCalculateLevelStats; if (bodyInfo.autoCalculateLevelStats) { component.levelMaxHealth = Mathf.Round(component.baseMaxHealth * 0.3f); component.levelMaxShield = Mathf.Round(component.baseMaxShield * 0.3f); component.levelRegen = component.baseRegen * 0.2f; component.levelMoveSpeed = 0f; component.levelJumpPower = 0f; component.levelDamage = component.baseDamage * 0.2f; component.levelAttackSpeed = 0f; component.levelCrit = 0f; component.levelArmor = 0f; } else { component.levelMaxHealth = bodyInfo.healthGrowth; component.levelMaxShield = bodyInfo.shieldGrowth; component.levelRegen = bodyInfo.regenGrowth; component.levelMoveSpeed = bodyInfo.moveSpeedGrowth; component.levelJumpPower = bodyInfo.jumpPowerGrowth; component.levelDamage = bodyInfo.damageGrowth; component.levelAttackSpeed = bodyInfo.attackSpeedGrowth; component.levelCrit = bodyInfo.critGrowth; component.levelArmor = bodyInfo.armorGrowth; } component.baseAcceleration = bodyInfo.acceleration; component.baseJumpCount = bodyInfo.jumpCount; component.sprintingSpeedMultiplier = 1.45f; component.bodyFlags = (BodyFlags)16; component.rootMotionInMainState = false; component.hullClassification = (HullClassification)0; component.isChampion = false; } private static Transform AddCharacterModelToSurvivorBody(GameObject bodyPrefab, Transform modelTransform, BodyInfo bodyInfo) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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_0043: 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_00a4: 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_00d7: 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_00fb: Unknown result type (might be due to invalid IL or missing references) Transform val = bodyPrefab.transform.Find("ModelBase"); if ((Object)(object)val == (Object)null) { val = new GameObject("ModelBase").transform; val.parent = bodyPrefab.transform; val.localPosition = bodyInfo.modelBasePosition; val.localRotation = Quaternion.identity; } modelTransform.parent = ((Component)val).transform; modelTransform.localPosition = Vector3.zero; modelTransform.localRotation = Quaternion.identity; if ((Object)(object)bodyPrefab.transform.Find("CameraPivot") == (Object)null) { Transform transform = new GameObject("CameraPivot").transform; transform.parent = bodyPrefab.transform; transform.localPosition = bodyInfo.cameraPivotPosition; transform.localRotation = Quaternion.identity; } Transform val2 = bodyPrefab.transform.Find("AimOrigin"); if ((Object)(object)val2 == (Object)null) { val2 = new GameObject("AimOrigin").transform; val2.parent = bodyPrefab.transform; val2.localPosition = bodyInfo.aimOriginPosition; val2.localRotation = Quaternion.identity; } bodyPrefab.GetComponent().aimOriginTransform = val2; return ((Component)val).transform; } private static void SetupCharacterDirection(GameObject prefab, Transform modelBaseTransform, Transform modelTransform) { if (Object.op_Implicit((Object)(object)prefab.GetComponent())) { CharacterDirection component = prefab.GetComponent(); component.targetTransform = modelBaseTransform; component.overrideAnimatorForwardTransform = null; component.rootMotionAccumulator = null; component.modelAnimator = ((Component)modelTransform).GetComponent(); component.driveFromRootRotation = false; component.turnSpeed = 720f; } } private static void SetupCameraTargetParams(GameObject prefab, BodyInfo bodyInfo) { CameraTargetParams component = prefab.GetComponent(); component.cameraParams = bodyInfo.cameraParams; component.cameraPivotTransform = prefab.transform.Find("CameraPivot"); } private static void SetupModelLocator(GameObject prefab, Transform modelBaseTransform, Transform modelTransform) { ModelLocator component = prefab.GetComponent(); component.modelTransform = modelTransform; component.modelBaseTransform = modelBaseTransform; } private static void SetupCapsuleCollider(GameObject prefab, BodyInfo bodyInfo) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) CapsuleCollider component = prefab.GetComponent(); component.center = bodyInfo.capsuleCenter; component.radius = bodyInfo.capsuleRadius; component.height = bodyInfo.capsuleHeight; component.direction = 1; } public static CharacterModel SetupCharacterModel(GameObject bodyPrefab, CustomRendererInfo[] customInfos = null) { CharacterModel val = ((Component)bodyPrefab.GetComponent().modelTransform).gameObject.GetComponent(); bool flag = (Object)(object)val != (Object)null; Log.Info($"SetupCharacterModel({((Object)bodyPrefab).name}) preattached: {flag}"); if (!flag) { val = ((Component)bodyPrefab.GetComponent().modelTransform).gameObject.AddComponent(); } val.body = bodyPrefab.GetComponent(); val.autoPopulateLightInfos = true; val.invisibilityCount = 0; val.temporaryOverlays = new List(); if (!flag) { SetupCustomRendererInfos(val, customInfos); } else { SetupPreAttachedRendererInfos(val); } SetupHurtboxGroup(bodyPrefab, ((Component)val).gameObject); SetupAimAnimator(bodyPrefab, ((Component)val).gameObject); SetupFootstepController(((Component)val).gameObject); SetupRagdoll(((Component)val).gameObject); return val; } public static void SetupPreAttachedRendererInfos(CharacterModel characterModel) { for (int i = 0; i < characterModel.baseRendererInfos.Length; i++) { if ((Object)(object)characterModel.baseRendererInfos[i].defaultMaterial == (Object)null) { characterModel.baseRendererInfos[i].defaultMaterial = characterModel.baseRendererInfos[i].renderer.sharedMaterial; } if ((Object)(object)characterModel.baseRendererInfos[i].defaultMaterial == (Object)null) { Log.Error($"no material for rendererinfo of this renderer: {characterModel.baseRendererInfos[i].renderer}"); } characterModel.baseRendererInfos[i].defaultMaterial.ConvertDefaultShaderToHopoo(); } } public static void SetupCustomRendererInfos(CharacterModel characterModel, CustomRendererInfo[] customInfos) { //IL_00ac: 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_00da: Unknown result type (might be due to invalid IL or missing references) ChildLocator component = ((Component)characterModel).GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { Log.Error("Failed CharacterModel setup: ChildLocator component does not exist on the model"); return; } List list = new List(); for (int i = 0; i < customInfos.Length; i++) { if (!Object.op_Implicit((Object)(object)component.FindChild(customInfos[i].childName))) { Log.Error("Trying to add a RendererInfo for a renderer that does not exist: " + customInfos[i].childName); continue; } Renderer component2 = ((Component)component.FindChild(customInfos[i].childName)).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { Material val = customInfos[i].material; if ((Object)(object)val == (Object)null) { val = ((!customInfos[i].dontHotpoo) ? component2.sharedMaterial.ConvertDefaultShaderToHopoo() : component2.sharedMaterial); } list.Add(new RendererInfo { renderer = component2, defaultMaterial = val, ignoreOverlays = customInfos[i].ignoreOverlays, defaultShadowCastingMode = (ShadowCastingMode)1 }); } } characterModel.baseRendererInfos = list.ToArray(); } private static void SetupHurtboxGroup(GameObject bodyPrefab, GameObject model) { SetupMainHurtboxesFromChildLocator(bodyPrefab, model); SetHurtboxesHealthComponents(bodyPrefab); } private static void SetupMainHurtboxesFromChildLocator(GameObject bodyPrefab, GameObject model) { //IL_00fd: 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) if ((Object)(object)bodyPrefab.GetComponent() != (Object)null) { Log.Debug("Hitboxgroup already exists on model prefab. aborting code setup"); return; } ChildLocator component = model.GetComponent(); if (string.IsNullOrEmpty(component.FindChildNameInsensitive("MainHurtbox"))) { Log.Error("Could not set up main hurtbox: make sure you have a transform pair in your prefab's ChildLocator called 'MainHurtbox'"); return; } HurtBoxGroup val = model.AddComponent(); HurtBox val2 = null; GameObject val3 = component.FindChildGameObjectInsensitive("HeadHurtbox"); if (Object.op_Implicit((Object)(object)val3)) { Log.Debug("HeadHurtboxFound. Setting up"); val2 = val3.AddComponent(); ((Component)val2).gameObject.layer = LayerIndex.entityPrecise.intVal; val2.healthComponent = bodyPrefab.GetComponent(); val2.isBullseye = false; val2.isSniperTarget = true; val2.damageModifier = (DamageModifier)0; val2.hurtBoxGroup = val; val2.indexInGroup = 1; } HurtBox val4 = component.FindChildGameObjectInsensitive("MainHurtbox").AddComponent(); ((Component)val4).gameObject.layer = LayerIndex.entityPrecise.intVal; val4.healthComponent = bodyPrefab.GetComponent(); val4.isBullseye = true; val4.isSniperTarget = (Object)(object)val2 == (Object)null; val4.damageModifier = (DamageModifier)0; val4.hurtBoxGroup = val; val4.indexInGroup = 0; if (Object.op_Implicit((Object)(object)val2)) { val.hurtBoxes = (HurtBox[])(object)new HurtBox[2] { val4, val2 }; } else { val.hurtBoxes = (HurtBox[])(object)new HurtBox[1] { val4 }; } val.mainHurtBox = val4; val.bullseyeCount = 1; } private static string FindChildNameInsensitive(this ChildLocator childLocator, string child) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) return childLocator.transformPairs.Where((NameTransformPair pair) => pair.name.ToLowerInvariant() == child.ToLowerInvariant()).FirstOrDefault().name; } private static Transform FindChildInsensitive(this ChildLocator childLocator, string child) { return childLocator.FindChild(childLocator.FindChildNameInsensitive(child)); } private static GameObject FindChildGameObjectInsensitive(this ChildLocator childLocator, string child) { return childLocator.FindChildGameObject(childLocator.FindChildNameInsensitive(child)); } public static void SetHurtboxesHealthComponents(GameObject bodyPrefab) { HealthComponent component = bodyPrefab.GetComponent(); HurtBoxGroup[] componentsInChildren = bodyPrefab.GetComponentsInChildren(); foreach (HurtBoxGroup val in componentsInChildren) { val.mainHurtBox.healthComponent = component; for (int j = 0; j < val.hurtBoxes.Length; j++) { val.hurtBoxes[j].healthComponent = component; } } } private static void SetupFootstepController(GameObject model) { FootstepHandler obj = model.AddComponent(); obj.baseFootstepString = "Play_player_footstep"; obj.sprintFootstepOverrideString = ""; obj.enableFootstepDust = true; obj.footstepDustPrefab = LegacyResourcesAPI.Load("Prefabs/GenericFootstepDust"); } private static void SetupRagdoll(GameObject model) { RagdollController component = model.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return; } if ((Object)(object)ragdollMaterial == (Object)null) { ragdollMaterial = ((Component)LegacyResourcesAPI.Load("Prefabs/CharacterBodies/CommandoBody").GetComponentInChildren().bones[1]).GetComponent().material; } Transform[] bones = component.bones; foreach (Transform val in bones) { if (Object.op_Implicit((Object)(object)val)) { ((Component)val).gameObject.layer = LayerIndex.ragdoll.intVal; Collider component2 = ((Component)val).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.sharedMaterial = ragdollMaterial; } else { Log.Error($"Ragdoll bone {((Component)val).gameObject} doesn't have a collider. Ragdoll will break."); } } } } private static void SetupAimAnimator(GameObject prefab, GameObject model) { AimAnimator obj = model.AddComponent(); obj.directionComponent = prefab.GetComponent(); obj.pitchRangeMax = 60f; obj.pitchRangeMin = -60f; obj.yawRangeMin = -80f; obj.yawRangeMax = 80f; obj.pitchGiveupRange = 30f; obj.yawGiveupRange = 10f; obj.giveupDuration = 3f; obj.inputBank = prefab.GetComponent(); } public static void CreateGenericDoppelganger(GameObject bodyPrefab, string masterName, string masterToCopy) { CloneDopplegangerMaster(bodyPrefab, masterName, masterToCopy); } public static GameObject CloneDopplegangerMaster(GameObject bodyPrefab, string masterName, string masterToCopy) { GameObject obj = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/CharacterMasters/" + masterToCopy + "MonsterMaster"), masterName, true); obj.GetComponent().bodyPrefab = bodyPrefab; Content.AddMasterPrefab(obj); return obj; } public static GameObject CreateBlankMasterPrefab(GameObject bodyPrefab, string masterName) { GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load("Prefabs/CharacterMasters/CommandoMonsterMaster"), masterName, true); ContentPacks.masterPrefabs.Add(val); val.GetComponent().bodyPrefab = bodyPrefab; AISkillDriver[] components = val.GetComponents(); for (int i = 0; i < components.Length; i++) { Object.Destroy((Object)(object)components[i]); } return val; } public static GameObject LoadMaster(this AssetBundle assetBundle, GameObject bodyPrefab, string assetName) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) GameObject val = assetBundle.LoadAsset(assetName); BaseAI val2 = val.GetComponent(); if ((Object)(object)val2 == (Object)null) { val2 = val.AddComponent(); val2.aimVectorDampTime = 0.1f; val2.aimVectorMaxSpeed = 360f; } val2.scanState = new SerializableEntityStateType(typeof(Wander)); EntityStateMachine component = val.GetComponent(); if ((Object)(object)component == (Object)null) { AddEntityStateMachine(val, "AI", typeof(Wander), typeof(Wander)); } val2.stateMachine = component; CharacterMaster val3 = val.GetComponent(); if ((Object)(object)val3 == (Object)null) { val3 = val.AddComponent(); } val3.bodyPrefab = bodyPrefab; val3.teamIndex = (TeamIndex)2; Content.AddMasterPrefab(val); return val; } public static void ClearEntityStateMachines(GameObject bodyPrefab) { EntityStateMachine[] components = bodyPrefab.GetComponents(); for (int num = components.Length - 1; num >= 0; num--) { Object.DestroyImmediate((Object)(object)components[num]); } bodyPrefab.GetComponent().stateMachines = Array.Empty(); CharacterDeathBehavior component = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.idleStateMachine = Array.Empty(); } SetStateOnHurt component2 = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.idleStateMachine = Array.Empty(); } CharacterBody component3 = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component3)) { component3.vehicleIdleStateMachine = Array.Empty(); } } public static EntityStateMachine AddEntityStateMachine(GameObject prefab, string machineName, Type mainStateType = null, Type initalStateType = null, bool addToHurt = true, bool addToDeath = true) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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) EntityStateMachine val = EntityStateMachine.FindByCustomName(prefab, machineName); if ((Object)(object)val == (Object)null) { val = prefab.AddComponent(); } else { Log.Message("An Entity State Machine already exists with the name " + machineName + ". replacing."); } val.customName = machineName; if (mainStateType == null) { mainStateType = typeof(Idle); } val.mainStateType = new SerializableEntityStateType(mainStateType); if (initalStateType == null) { initalStateType = typeof(Idle); } val.initialStateType = new SerializableEntityStateType(initalStateType); NetworkStateMachine component = prefab.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.stateMachines = component.stateMachines.Append(val).ToArray(); } CharacterDeathBehavior component2 = prefab.GetComponent(); if (Object.op_Implicit((Object)(object)component2) && addToDeath) { component2.idleStateMachine = component2.idleStateMachine.Append(val).ToArray(); } SetStateOnHurt component3 = prefab.GetComponent(); if (Object.op_Implicit((Object)(object)component3) && addToHurt) { component3.idleStateMachine = component3.idleStateMachine.Append(val).ToArray(); } CharacterBody component4 = prefab.GetComponent(); if (Object.op_Implicit((Object)(object)component4)) { component4.vehicleIdleStateMachine = component4.vehicleIdleStateMachine.Append(val).ToArray(); } return val; } public static EntityStateMachine AddMainEntityStateMachine(GameObject bodyPrefab, string machineName = "Body", Type mainStateType = null, Type initalStateType = null) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_006e: 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) EntityStateMachine val = EntityStateMachine.FindByCustomName(bodyPrefab, machineName); if ((Object)(object)val == (Object)null) { val = bodyPrefab.AddComponent(); } else { Log.Message("An Entity State Machine already exists with the name " + machineName + ". replacing."); } val.customName = machineName; if (mainStateType == null) { mainStateType = typeof(GenericCharacterMain); } val.mainStateType = new SerializableEntityStateType(mainStateType); if (initalStateType == null) { initalStateType = typeof(SpawnTeleporterState); } val.initialStateType = new SerializableEntityStateType(initalStateType); NetworkStateMachine component = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.stateMachines = component.stateMachines.Append(val).ToArray(); } CharacterDeathBehavior component2 = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.deathStateMachine = val; } SetStateOnHurt component3 = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component3)) { component3.targetStateMachine = val; } return val; } public static void SetupHitBoxGroup(GameObject modelPrefab, string hitBoxGroupName, params string[] hitboxChildNames) { ChildLocator component = modelPrefab.GetComponent(); Transform[] array = (Transform[])(object)new Transform[hitboxChildNames.Length]; for (int i = 0; i < hitboxChildNames.Length; i++) { array[i] = component.FindChild(hitboxChildNames[i]); if ((Object)(object)array[i] == (Object)null) { Log.Error("missing hitbox for " + hitboxChildNames[i]); } } SetupHitBoxGroup(modelPrefab, hitBoxGroupName, array); } public static void SetupHitBoxGroup(GameObject prefab, string hitBoxGroupName, params Transform[] hitBoxTransforms) { List list = new List(); foreach (Transform val in hitBoxTransforms) { if ((Object)(object)val == (Object)null) { Log.Error("Error setting up hitboxGroup for " + hitBoxGroupName + ": hitbox transform was null"); continue; } HitBox item = ((Component)val).gameObject.AddComponent(); ((Component)val).gameObject.layer = LayerIndex.projectile.intVal; list.Add(item); } if (list.Count == 0) { Log.Error("No hitboxes were set up. aborting setting up hitboxGroup for " + hitBoxGroupName); return; } HitBoxGroup obj = prefab.AddComponent(); obj.hitBoxes = list.ToArray(); obj.groupName = hitBoxGroupName; } } public class CustomRendererInfo { public string childName; public Material material; public bool dontHotpoo; public bool ignoreOverlays; } internal static class Skills { public static void CreateSkillFamilies(GameObject targetPrefab) { SkillSlot[] array = new SkillSlot[4]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); CreateSkillFamilies(targetPrefab, (SkillSlot[])(object)array); } public static void CreateSkillFamilies(GameObject targetPrefab, params SkillSlot[] slots) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected I4, but got Unknown SkillLocator component = targetPrefab.GetComponent(); foreach (SkillSlot val in slots) { switch (val - -1) { case 1: component.primary = CreateGenericSkillWithSkillFamily(targetPrefab, "Primary"); break; case 2: component.secondary = CreateGenericSkillWithSkillFamily(targetPrefab, "Secondary"); break; case 3: component.utility = CreateGenericSkillWithSkillFamily(targetPrefab, "Utility"); break; case 4: component.special = CreateGenericSkillWithSkillFamily(targetPrefab, "Special"); break; } } } public static void ClearGenericSkills(GameObject targetPrefab) { GenericSkill[] componentsInChildren = targetPrefab.GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren[i]); } } public static GenericSkill CreateGenericSkillWithSkillFamily(GameObject targetPrefab, SkillSlot skillSlot, bool hidden = false) { //IL_0007: 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_0023: Expected I4, but got Unknown SkillLocator component = targetPrefab.GetComponent(); switch (skillSlot - -1) { case 1: return component.primary = CreateGenericSkillWithSkillFamily(targetPrefab, "Primary", hidden); case 2: return component.secondary = CreateGenericSkillWithSkillFamily(targetPrefab, "Secondary", hidden); case 3: return component.utility = CreateGenericSkillWithSkillFamily(targetPrefab, "Utility", hidden); case 4: return component.special = CreateGenericSkillWithSkillFamily(targetPrefab, "Special", hidden); case 0: Log.Error("Failed to create GenericSkill with skillslot None. If making a GenericSkill outside of the main 4, specify a familyName, and optionally a genericSkillName"); return null; default: return null; } } public static GenericSkill CreateGenericSkillWithSkillFamily(GameObject targetPrefab, string familyName, bool hidden = false) { return CreateGenericSkillWithSkillFamily(targetPrefab, familyName, familyName, hidden); } public static GenericSkill CreateGenericSkillWithSkillFamily(GameObject targetPrefab, string genericSkillName, string familyName, bool hidden = false) { GenericSkill obj = targetPrefab.AddComponent(); obj.skillName = genericSkillName; obj.hideInCharacterSelect = hidden; SkillFamily val = ScriptableObject.CreateInstance(); ((Object)val).name = ((Object)targetPrefab).name + familyName + "Family"; val.variants = (Variant[])(object)new Variant[0]; obj._skillFamily = val; Content.AddSkillFamily(val); return obj; } public static void AddSkillToFamily(SkillFamily skillFamily, SkillDef skillDef, UnlockableDef unlockableDef = null) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1); Variant[] variants = skillFamily.variants; int num = skillFamily.variants.Length - 1; Variant val = new Variant { skillDef = skillDef, unlockableDef = unlockableDef }; ((Variant)(ref val)).viewableNode = new Node(skillDef.skillNameToken, false, (Node)null); variants[num] = val; } public static void AddSkillsToFamily(SkillFamily skillFamily, params SkillDef[] skillDefs) { foreach (SkillDef skillDef in skillDefs) { AddSkillToFamily(skillFamily, skillDef); } } public static void AddPrimarySkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent().primary.skillFamily, skillDefs); } public static void AddSecondarySkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent().secondary.skillFamily, skillDefs); } public static void AddUtilitySkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent().utility.skillFamily, skillDefs); } public static void AddSpecialSkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent().special.skillFamily, skillDefs); } public static void AddUnlockablesToFamily(SkillFamily skillFamily, params UnlockableDef[] unlockableDefs) { //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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < unlockableDefs.Length; i++) { Variant val = skillFamily.variants[i]; val.unlockableDef = unlockableDefs[i]; skillFamily.variants[i] = val; } } public static SkillDef CreateSkillDef(SkillDefInfo skillDefInfo) { return Skills.CreateSkillDef(skillDefInfo); } public static T CreateSkillDef(SkillDefInfo skillDefInfo) where T : SkillDef { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_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) T val = ScriptableObject.CreateInstance(); ((SkillDef)val).skillName = skillDefInfo.skillName; ((Object)(object)val).name = skillDefInfo.skillName; ((SkillDef)val).skillNameToken = skillDefInfo.skillNameToken; ((SkillDef)val).skillDescriptionToken = skillDefInfo.skillDescriptionToken; ((SkillDef)val).icon = skillDefInfo.skillIcon; ((SkillDef)val).activationState = skillDefInfo.activationState; ((SkillDef)val).activationStateMachineName = skillDefInfo.activationStateMachineName; ((SkillDef)val).interruptPriority = skillDefInfo.interruptPriority; ((SkillDef)val).baseMaxStock = skillDefInfo.baseMaxStock; ((SkillDef)val).baseRechargeInterval = skillDefInfo.baseRechargeInterval; ((SkillDef)val).rechargeStock = skillDefInfo.rechargeStock; ((SkillDef)val).requiredStock = skillDefInfo.requiredStock; ((SkillDef)val).stockToConsume = skillDefInfo.stockToConsume; ((SkillDef)val).dontAllowPastMaxStocks = skillDefInfo.dontAllowPastMaxStocks; ((SkillDef)val).beginSkillCooldownOnSkillEnd = skillDefInfo.beginSkillCooldownOnSkillEnd; ((SkillDef)val).canceledFromSprinting = skillDefInfo.canceledFromSprinting; ((SkillDef)val).forceSprintDuringState = skillDefInfo.forceSprintDuringState; ((SkillDef)val).fullRestockOnAssign = skillDefInfo.fullRestockOnAssign; ((SkillDef)val).resetCooldownTimerOnUse = skillDefInfo.resetCooldownTimerOnUse; ((SkillDef)val).isCombatSkill = skillDefInfo.isCombatSkill; ((SkillDef)val).mustKeyPress = skillDefInfo.mustKeyPress; ((SkillDef)val).cancelSprintingOnActivation = skillDefInfo.cancelSprintingOnActivation; ((SkillDef)val).keywordTokens = skillDefInfo.keywordTokens; Content.AddSkillDef((SkillDef)(object)val); return val; } } internal class SkillDefInfo { public string skillName; public string skillNameToken; public string skillDescriptionToken; public string[] keywordTokens = Array.Empty(); public Sprite skillIcon; public SerializableEntityStateType activationState; public string activationStateMachineName; public InterruptPriority interruptPriority; public float baseRechargeInterval; public int baseMaxStock = 1; public int rechargeStock = 1; public int requiredStock = 1; public int stockToConsume = 1; public bool resetCooldownTimerOnUse; public bool fullRestockOnAssign = true; public bool dontAllowPastMaxStocks; public bool beginSkillCooldownOnSkillEnd; public bool mustKeyPress; public bool isCombatSkill = true; public bool canceledFromSprinting; public bool cancelSprintingOnActivation = true; public bool forceSprintDuringState; public SkillDefInfo() { } public SkillDefInfo(string skillName, string skillNameToken, string skillDescriptionToken, Sprite skillIcon, SerializableEntityStateType activationState, string activationStateMachineName = "Weapon", bool agile = false) { //IL_0060: 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_0094: Unknown result type (might be due to invalid IL or missing references) this.skillName = skillName; this.skillNameToken = skillNameToken; this.skillDescriptionToken = skillDescriptionToken; this.skillIcon = skillIcon; this.activationState = activationState; this.activationStateMachineName = activationStateMachineName; cancelSprintingOnActivation = !agile; if (agile) { keywordTokens = new string[1] { "KEYWORD_AGILE" }; } interruptPriority = (InterruptPriority)0; isCombatSkill = true; baseRechargeInterval = 0f; requiredStock = 0; stockToConsume = 0; } } internal static class Skins { internal struct SkinDefInfo { internal SkinDef[] BaseSkins; internal Sprite Icon; internal string NameToken; internal UnlockableDef UnlockableDef; internal GameObject RootObject; internal RendererInfo[] RendererInfos; internal MeshReplacement[] MeshReplacements; internal GameObjectActivation[] GameObjectActivations; internal ProjectileGhostReplacement[] ProjectileGhostReplacements; internal MinionSkinReplacement[] MinionSkinReplacements; internal string Name; } internal static SkinDef CreateSkinDef(string skinName, Sprite skinIcon, RendererInfo[] defaultRendererInfos, GameObject root, UnlockableDef unlockableDef = null) { //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Expected O, but got Unknown SkinDefInfo skinDefInfo = new SkinDefInfo { BaseSkins = Array.Empty(), GameObjectActivations = (GameObjectActivation[])(object)new GameObjectActivation[0], Icon = skinIcon, MeshReplacements = (MeshReplacement[])(object)new MeshReplacement[0], MinionSkinReplacements = (MinionSkinReplacement[])(object)new MinionSkinReplacement[0], Name = skinName, NameToken = skinName, ProjectileGhostReplacements = (ProjectileGhostReplacement[])(object)new ProjectileGhostReplacement[0], RendererInfos = (RendererInfo[])(object)new RendererInfo[defaultRendererInfos.Length], RootObject = root, UnlockableDef = unlockableDef }; SkinDef.Awake += new hook_Awake(DoNothing); SkinDef obj = ScriptableObject.CreateInstance(); obj.baseSkins = skinDefInfo.BaseSkins; obj.icon = skinDefInfo.Icon; obj.unlockableDef = skinDefInfo.UnlockableDef; obj.rootObject = skinDefInfo.RootObject; defaultRendererInfos.CopyTo(skinDefInfo.RendererInfos, 0); obj.rendererInfos = skinDefInfo.RendererInfos; obj.gameObjectActivations = skinDefInfo.GameObjectActivations; obj.meshReplacements = skinDefInfo.MeshReplacements; obj.projectileGhostReplacements = skinDefInfo.ProjectileGhostReplacements; obj.minionSkinReplacements = skinDefInfo.MinionSkinReplacements; obj.nameToken = skinDefInfo.NameToken; ((Object)obj).name = skinDefInfo.Name; obj.skinDefParams = SkinDefParams.FromSkinDef(obj); SkinDef.Awake -= new hook_Awake(DoNothing); return obj; } private static void DoNothing(orig_Awake orig, SkinDef self) { } internal static void CreateDisplaySkinController(GameObject displayPrefab, SkinDef[] bodySkins) { if (!Object.op_Implicit((Object)(object)displayPrefab) || bodySkins == null || bodySkins.Length == 0) { return; } CharacterModel component = displayPrefab.GetComponent(); if (!Object.op_Implicit((Object)(object)component) || component.baseRendererInfos == null || component.baseRendererInfos.Length == 0) { Log.Warning("display prefab has no CharacterModel renderer infos; leaving its skins to R2API's fallback"); return; } ModelSkinController val = displayPrefab.GetComponent(); if (!Object.op_Implicit((Object)(object)val)) { val = displayPrefab.AddComponent(); } SkinDef[] array = (SkinDef[])(object)new SkinDef[bodySkins.Length]; for (int i = 0; i < bodySkins.Length; i++) { SkinDef val2 = bodySkins[i]; SkinDef val3 = CreateSkinDef(((Object)val2).name, val2.icon, component.baseRendererInfos, displayPrefab, val2.unlockableDef); val3.nameToken = val2.nameToken; array[i] = val3; } val.skins = array; } private static RendererInfo[] getRendererMaterials(RendererInfo[] defaultRenderers, params Material[] materials) { RendererInfo[] array = (RendererInfo[])(object)new RendererInfo[defaultRenderers.Length]; defaultRenderers.CopyTo(array, 0); for (int i = 0; i < array.Length; i++) { try { array[i].defaultMaterial = materials[i]; } catch { Log.Error("error adding skin rendererinfo material. make sure you're not passing in too many"); } } return array; } internal static MeshReplacement[] getMeshReplacements(AssetBundle assetBundle, RendererInfo[] defaultRendererInfos, params string[] meshes) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) List list = new List(); for (int i = 0; i < defaultRendererInfos.Length; i++) { if (!string.IsNullOrEmpty(meshes[i])) { list.Add(new MeshReplacement { renderer = defaultRendererInfos[i].renderer, mesh = assetBundle.LoadAsset(meshes[i]) }); } } return list.ToArray(); } } internal static class Tokens { public const string agilePrefix = "Agile."; public static string DamageText(string text) { return "" + text + ""; } public static string DamageValueText(float value) { return $"{value * 100f}% damage"; } public static string UtilityText(string text) { return "" + text + ""; } public static string RedText(string text) { return HealthText(text); } public static string HealthText(string text) { return "" + text + ""; } public static string KeywordText(string keyword, string sub) { return "" + keyword + "" + sub + ""; } public static string ScepterDescription(string desc) { return "\nSCEPTER: " + desc + ""; } public static string GetAchievementNameToken(string identifier) { return "ACHIEVEMENT_" + identifier.ToUpperInvariant() + "_NAME"; } public static string GetAchievementDescriptionToken(string identifier) { return "ACHIEVEMENT_" + identifier.ToUpperInvariant() + "_DESCRIPTION"; } } } namespace AH64.Modules.Characters { public abstract class CharacterBase where T : CharacterBase, new() { public abstract string assetBundleName { get; } public abstract string bodyName { get; } public abstract string modelPrefabName { get; } public abstract BodyInfo bodyInfo { get; } public virtual CustomRendererInfo[] customRendererInfos { get; } public virtual ItemDisplaysBase itemDisplays { get; } public static T instance { get; private set; } public abstract AssetBundle assetBundle { get; protected set; } public abstract GameObject bodyPrefab { get; protected set; } public abstract CharacterBody prefabCharacterBody { get; protected set; } public abstract GameObject characterModelObject { get; protected set; } public abstract CharacterModel prefabCharacterModel { get; protected set; } public virtual void Initialize() { instance = this as T; assetBundle = Asset.LoadAssetBundle(assetBundleName); InitializeCharacter(); } public virtual void InitializeCharacter() { InitializeCharacterBodyPrefab(); InitializeItemDisplays(); } protected virtual void InitializeCharacterBodyPrefab() { characterModelObject = Prefabs.LoadCharacterModel(assetBundle, modelPrefabName); bodyPrefab = Prefabs.CreateBodyPrefab(characterModelObject, bodyInfo); prefabCharacterBody = bodyPrefab.GetComponent(); prefabCharacterModel = Prefabs.SetupCharacterModel(bodyPrefab, customRendererInfos); } public virtual void InitializeItemDisplays() { ItemDisplayRuleSet val = ScriptableObject.CreateInstance(); ((Object)val).name = "idrs" + bodyName; prefabCharacterModel.itemDisplayRuleSet = val; if (itemDisplays != null) { ItemDisplays.queuedDisplays++; ContentManager.onContentPacksAssigned += SetItemDisplays; } } public void SetItemDisplays(ReadOnlyArray obj) { itemDisplays.SetItemDisplays(prefabCharacterModel.itemDisplayRuleSet); } public abstract void InitializeEntityStateMachines(); public abstract void InitializeSkills(); public abstract void InitializeSkins(); public abstract void InitializeCharacterMaster(); } public class BodyInfo { public string bodyName = ""; public string bodyNameToken = ""; public string subtitleNameToken = ""; public string bodyNameToClone = "Commando"; public Color bodyColor = Color.white; public Texture characterPortrait; public float sortPosition = 100f; public GameObject crosshair; public GameObject podPrefab; public float maxHealth = 100f; public float healthRegen = 1f; public float armor; public float shield; public int jumpCount = 1; public float damage = 12f; public float attackSpeed = 1f; public float crit = 1f; public float moveSpeed = 7f; public float acceleration = 80f; public float jumpPower = 15f; public bool autoCalculateLevelStats = true; public float healthGrowth = 30.000002f; public float regenGrowth = 0.2f; public float armorGrowth; public float shieldGrowth; public float damageGrowth = 2.4f; public float attackSpeedGrowth; public float critGrowth; public float moveSpeedGrowth; public float jumpPowerGrowth; public float capsuleRadius = 0.5f; public float capsuleHeight = 1.82f; public Vector3 capsuleCenter = Vector3.zero; public Vector3 aimOriginPosition = new Vector3(0f, 1.6f, 0f); public Vector3 modelBasePosition = new Vector3(0f, -0.92f, 0f); public Vector3 cameraPivotPosition = new Vector3(0f, 0.8f, 0f); public float cameraParamsVerticalOffset = 1.37f; public float cameraParamsDepth = -10f; private CharacterCameraParams _cameraParams; public CharacterCameraParams cameraParams { get { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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) if ((Object)(object)_cameraParams == (Object)null) { _cameraParams = ScriptableObject.CreateInstance(); _cameraParams.data.minPitch = BlendableFloat.op_Implicit(-70f); _cameraParams.data.maxPitch = BlendableFloat.op_Implicit(70f); _cameraParams.data.wallCushion = BlendableFloat.op_Implicit(0.1f); _cameraParams.data.pivotVerticalOffset = BlendableFloat.op_Implicit(cameraParamsVerticalOffset); _cameraParams.data.idealLocalCameraPos = BlendableVector3.op_Implicit(new Vector3(0f, 0f, cameraParamsDepth)); } return _cameraParams; } set { _cameraParams = value; } } } public abstract class ItemDisplaysBase { public void SetItemDisplays(ItemDisplayRuleSet itemDisplayRuleSet) { List list = new List(); ItemDisplays.LazyInit(); SetItemDisplayRules(list); itemDisplayRuleSet.keyAssetRuleGroups = list.ToArray(); ItemDisplays.DisposeWhenDone(); } protected abstract void SetItemDisplayRules(List itemDisplayRules); } public abstract class SurvivorBase : CharacterBase where T : SurvivorBase, new() { public abstract string masterName { get; } public abstract string displayPrefabName { get; } public abstract string survivorTokenPrefix { get; } public abstract UnlockableDef characterUnlockableDef { get; } public abstract GameObject displayPrefab { get; protected set; } public override void InitializeCharacter() { base.InitializeCharacter(); InitializeDisplayPrefab(); InitializeSurvivor(); } protected virtual void InitializeDisplayPrefab() { displayPrefab = Prefabs.CreateDisplayPrefab(assetBundle, displayPrefabName, bodyPrefab); } protected virtual void InitializeSurvivor() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) Content.CreateSurvivor(bodyPrefab, displayPrefab, bodyInfo.bodyColor, survivorTokenPrefix, characterUnlockableDef, bodyInfo.sortPosition); } protected virtual void AddCssPreviewSkill(int indexFromEditor, SkillFamily skillFamily, SkillDef skillDef) { CharacterSelectSurvivorPreviewDisplayController component = displayPrefab.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { Log.Error("trying to add skillChangeResponse to null CharacterSelectSurvivorPreviewDisplayController.\nMake sure you created one on your Display prefab in editor"); return; } component.skillChangeResponses[indexFromEditor].triggerSkillFamily = skillFamily; component.skillChangeResponses[indexFromEditor].triggerSkill = skillDef; } protected virtual void AddCssPreviewSkin(int indexFromEditor, SkinDef skinDef) { CharacterSelectSurvivorPreviewDisplayController component = displayPrefab.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { Log.Error("trying to add skinChangeResponse to null CharacterSelectSurvivorPreviewDisplayController.\nMake sure you created one on your Display prefab in editor"); } else { component.skinChangeResponses[indexFromEditor].triggerSkin = skinDef; } } protected virtual void FinalizeCSSPreviewDisplayController() { //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)displayPrefab)) { return; } CharacterSelectSurvivorPreviewDisplayController component = displayPrefab.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { return; } component.bodyPrefab = bodyPrefab; List list = new List(); for (int i = 0; i < component.skillChangeResponses.Length; i++) { if ((Object)(object)component.skillChangeResponses[i].triggerSkillFamily != (Object)null) { list.Add(component.skillChangeResponses[i]); } } component.skillChangeResponses = list.ToArray(); } } } namespace AH64.Modules.BaseStates { public abstract class BaseMeleeAttack : BaseSkillState, IStepSetter { public int swingIndex; protected string hitboxGroupName = "SwordGroup"; protected DamageTypeCombo damageType = DamageTypeCombo.op_Implicit((DamageType)0); protected float damageCoefficient = 3.5f; protected float procCoefficient = 1f; protected float pushForce = 300f; protected Vector3 bonusForce = Vector3.zero; protected float baseDuration = 1f; protected float attackStartPercentTime = 0.2f; protected float attackEndPercentTime = 0.4f; protected float earlyExitPercentTime = 0.4f; protected float hitStopDuration = 0.012f; protected float attackRecoil = 0.75f; protected float hitHopVelocity = 4f; protected string swingSoundString = ""; protected string hitSoundString = ""; protected string muzzleString = "SwingCenter"; protected string playbackRateParam = "Slash.playbackRate"; protected GameObject swingEffectPrefab; protected GameObject hitEffectPrefab; protected NetworkSoundEventIndex impactSound = (NetworkSoundEventIndex)(-1); protected OverlapAttack attack; public float duration; private bool hasFired; private float hitPauseTimer; protected bool inHitPause; private bool hasHopped; protected float stopwatch; protected Animator animator; private HitStopCachedState hitStopCachedState; private Vector3 storedVelocity; public override void OnEnter() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; animator = ((EntityState)this).GetModelAnimator(); ((BaseState)this).StartAimMode(0.5f + duration, false); PlayAttackAnimation(); attack = new OverlapAttack(); attack.damageType = damageType; attack.attacker = ((EntityState)this).gameObject; attack.inflictor = ((EntityState)this).gameObject; attack.teamIndex = ((BaseState)this).GetTeam(); attack.damage = damageCoefficient * ((BaseState)this).damageStat; attack.procCoefficient = procCoefficient; attack.hitEffectPrefab = hitEffectPrefab; attack.forceVector = bonusForce; attack.pushAwayForce = pushForce; attack.hitBoxGroup = ((BaseState)this).FindHitBoxGroup(hitboxGroupName); attack.isCrit = ((BaseState)this).RollCrit(); attack.impactSound = impactSound; ModifyOverlapAttack(attack); } protected virtual void ModifyOverlapAttack(OverlapAttack attack) { } protected virtual void PlayAttackAnimation() { ((EntityState)this).PlayCrossfade("Gesture, Override", "Slash" + (1 + swingIndex), playbackRateParam, duration, 0.05f); } public override void OnExit() { if (inHitPause) { RemoveHitstop(); } ((EntityState)this).OnExit(); } protected virtual void PlaySwingEffect() { EffectManager.SimpleMuzzleFlash(swingEffectPrefab, ((EntityState)this).gameObject, muzzleString, false); } protected virtual void OnHitEnemyAuthority() { Util.PlaySound(hitSoundString, ((EntityState)this).gameObject); if (!hasHopped) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded && hitHopVelocity > 0f) { ((BaseState)this).SmallHop(((EntityState)this).characterMotor, hitHopVelocity); } hasHopped = true; } ApplyHitstop(); } protected void ApplyHitstop() { //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_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) if (!inHitPause && hitStopDuration > 0f) { storedVelocity = ((EntityState)this).characterMotor.velocity; hitStopCachedState = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, playbackRateParam); hitPauseTimer = hitStopDuration / ((BaseState)this).attackSpeedStat; inHitPause = true; } } private void FireAttack() { if (((EntityState)this).isAuthority && attack.Fire((List)null)) { OnHitEnemyAuthority(); } } private void EnterAttack() { hasFired = true; Util.PlayAttackSpeedSound(swingSoundString, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat); PlaySwingEffect(); if (((EntityState)this).isAuthority) { ((BaseState)this).AddRecoil(-1f * attackRecoil, -2f * attackRecoil, -0.5f * attackRecoil, 0.5f * attackRecoil); } } public override void FixedUpdate() { //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) ((EntityState)this).FixedUpdate(); hitPauseTimer -= Time.deltaTime; if (hitPauseTimer <= 0f && inHitPause) { RemoveHitstop(); } if (!inHitPause) { stopwatch += Time.deltaTime; } else { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } if (Object.op_Implicit((Object)(object)animator)) { animator.SetFloat(playbackRateParam, 0f); } } bool flag = stopwatch >= duration * attackStartPercentTime; bool flag2 = stopwatch >= duration * attackEndPercentTime; if ((flag && !flag2) || (flag && flag2 && !hasFired)) { if (!hasFired) { EnterAttack(); } FireAttack(); } if (stopwatch >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void RemoveHitstop() { //IL_0002: 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_002b: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).ConsumeHitStopCachedState(hitStopCachedState, ((EntityState)this).characterMotor, animator); inHitPause = false; ((EntityState)this).characterMotor.velocity = storedVelocity; } public override InterruptPriority GetMinimumInterruptPriority() { if (!(stopwatch >= duration * earlyExitPercentTime)) { return (InterruptPriority)1; } return (InterruptPriority)0; } public override void OnSerialize(NetworkWriter writer) { ((BaseSkillState)this).OnSerialize(writer); writer.Write(swingIndex); } public override void OnDeserialize(NetworkReader reader) { ((BaseSkillState)this).OnDeserialize(reader); swingIndex = reader.ReadInt32(); } public void SetStep(int i) { swingIndex = i; } } public abstract class BaseTimedSkillState : BaseSkillState { protected float duration; protected float castStartTime; protected float castEndTime; protected bool hasFired; protected bool isFiring; protected bool hasExited; public abstract float TimedBaseDuration { get; } public abstract float TimedBaseCastStartPercentTime { get; } public virtual float TimedBaseCastEndPercentTime => 1f; public override void OnEnter() { InitDurationValues(); ((BaseState)this).OnEnter(); } protected virtual void InitDurationValues() { duration = TimedBaseDuration / ((BaseState)this).attackSpeedStat; castStartTime = TimedBaseCastStartPercentTime * duration; castEndTime = TimedBaseCastEndPercentTime * duration; } protected virtual void OnCastEnter() { } protected virtual void OnCastFixedUpdate() { } protected virtual void OnCastUpdate() { } protected virtual void OnCastExit() { } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); bool flag = ((EntityState)this).fixedAge >= castStartTime; bool flag2 = ((EntityState)this).fixedAge >= castEndTime; isFiring = false; if ((flag && !flag2) || (flag && flag2 && !hasFired)) { isFiring = true; OnCastFixedUpdate(); if (!hasFired) { OnCastEnter(); hasFired = true; } } if (flag2 && !hasExited) { hasExited = true; OnCastExit(); } if (((EntityState)this).fixedAge > duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void Update() { ((EntityState)this).Update(); if (isFiring) { OnCastUpdate(); } } } public class ExampleTimedSkillState : BaseTimedSkillState { public override float TimedBaseDuration => 1.5f; public override float TimedBaseCastStartPercentTime => 0.2f; public override float TimedBaseCastEndPercentTime => 0.9f; protected override void OnCastEnter() { } protected override void OnCastFixedUpdate() { } protected override void OnCastExit() { } } public class ExampleDelayedSkillState : BaseTimedSkillState { public override float TimedBaseDuration => 1.5f; public override float TimedBaseCastStartPercentTime => 0.2f; protected override void OnCastEnter() { } } } namespace AH64.Modules.Achievements { public abstract class BaseMasteryAchievement : BaseAchievement { public abstract string RequiredCharacterBody { get; } public abstract float RequiredDifficultyCoefficient { get; } public override BodyIndex LookUpRequiredBodyIndex() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex(RequiredCharacterBody); } public override void OnBodyRequirementMet() { ((BaseAchievement)this).OnBodyRequirementMet(); Run.onClientGameOverGlobal += OnClientGameOverGlobal; } public override void OnBodyRequirementBroken() { Run.onClientGameOverGlobal -= OnClientGameOverGlobal; ((BaseAchievement)this).OnBodyRequirementBroken(); } private void OnClientGameOverGlobal(Run run, RunReport runReport) { //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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Invalid comparison between Unknown and I4 //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Invalid comparison between Unknown and I4 if (!Object.op_Implicit((Object)(object)runReport.gameEnding) || !runReport.gameEnding.isWin) { return; } DifficultyIndex val = runReport.ruleBook.FindDifficulty(); DifficultyDef difficultyDef = DifficultyCatalog.GetDifficultyDef(val); if (difficultyDef != null) { bool num = difficultyDef.countsAsHardMode && difficultyDef.scalingValue >= RequiredDifficultyCoefficient; bool flag = difficultyDef.nameToken == "INFERNO_NAME"; bool flag2 = (int)val >= 3 && (int)val <= 10; if (num || flag || flag2) { ((BaseAchievement)this).Grant(); } } } } } namespace AH64.Survivors { public class AH64Survivor : SurvivorBase { public const string AH64_PREFIX = "AH64_"; public override string assetBundleName => "ah64"; public override string bodyName => "AH64Body"; public override string masterName => "AH64Monster"; public override string modelPrefabName => "mdlAH64"; public override string displayPrefabName => "AH64Display"; public override string survivorTokenPrefix => "AH64_"; public override BodyInfo bodyInfo => new BodyInfo { bodyName = bodyName, bodyNameToken = "AH64_NAME", subtitleNameToken = "AH64_SUBTITLE", characterPortrait = assetBundle.LoadAsset("texAH64Icon"), bodyColor = new Color(0.22f, 0.28f, 0.18f), sortPosition = 100f, crosshair = Asset.LoadCrosshair("Standard"), podPrefab = LegacyResourcesAPI.Load("Prefabs/NetworkedObjects/SurvivorPod"), maxHealth = 155f, healthRegen = 1.5f, armor = 0f, moveSpeed = AH64PlaytestConfig.BaseMoveSpeed, acceleration = AH64PlaytestConfig.Acceleration, jumpCount = 1, capsuleRadius = 1f, capsuleHeight = 2.2f, capsuleCenter = Vector3.zero, modelBasePosition = new Vector3(0f, -1.1f, 0f), aimOriginPosition = new Vector3(0f, 1.45f, 0.8f), cameraPivotPosition = new Vector3(0f, 1.2f, 0f), cameraParamsVerticalOffset = 1.6f, cameraParamsDepth = -14f }; public override CustomRendererInfo[] customRendererInfos => new CustomRendererInfo[23] { new CustomRendererInfo { childName = "Airframe" }, new CustomRendererInfo { childName = "AirframeDark" }, new CustomRendererInfo { childName = "Canopy", ignoreOverlays = true }, new CustomRendererInfo { childName = "AirframeMarkings" }, new CustomRendererInfo { childName = "NoseOptics", ignoreOverlays = true }, new CustomRendererInfo { childName = "MainRotor" }, new CustomRendererInfo { childName = "TailRotor" }, new CustomRendererInfo { childName = "ChinTurret" }, new CustomRendererInfo { childName = "ChinBarrel" }, new CustomRendererInfo { childName = "ChinGatling" }, new CustomRendererInfo { childName = "PodRocketL" }, new CustomRendererInfo { childName = "PodRocketR" }, new CustomRendererInfo { childName = "PodMissileL" }, new CustomRendererInfo { childName = "PodMissileR" }, new CustomRendererInfo { childName = "MissileL0" }, new CustomRendererInfo { childName = "MissileL1" }, new CustomRendererInfo { childName = "MissileL2" }, new CustomRendererInfo { childName = "MissileL3" }, new CustomRendererInfo { childName = "MissileR0" }, new CustomRendererInfo { childName = "MissileR1" }, new CustomRendererInfo { childName = "MissileR2" }, new CustomRendererInfo { childName = "MissileR3" }, new CustomRendererInfo { childName = "RadarDome", ignoreOverlays = true } }; public override UnlockableDef characterUnlockableDef => AH64Unlockables.characterUnlockableDef; public override ItemDisplaysBase itemDisplays => new AH64ItemDisplays(); public override AssetBundle assetBundle { get; protected set; } public override GameObject bodyPrefab { get; protected set; } public override CharacterBody prefabCharacterBody { get; protected set; } public override GameObject characterModelObject { get; protected set; } public override CharacterModel prefabCharacterModel { get; protected set; } public override GameObject displayPrefab { get; protected set; } public override void Initialize() { base.Initialize(); } public override void InitializeCharacter() { AH64Unlockables.Init(); base.InitializeCharacter(); AH64States.Init(); AH64Tokens.Init(); AH64Assets.Init(assetBundle); AH64Buffs.Init(assetBundle); InitializeEntityStateMachines(); InitializeSkills(); InitializeSkins(); InitializeCharacterMaster(); AdditionalBodySetup(); AddHooks(); } private void AdditionalBodySetup() { bodyPrefab.AddComponent(); Interactor component = bodyPrefab.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.maxInteractionDistance = 12f; } bodyPrefab.AddComponent(); bodyPrefab.AddComponent(); bodyPrefab.AddComponent(); bodyPrefab.AddComponent(); bodyPrefab.AddComponent(); bodyPrefab.AddComponent(); bodyPrefab.AddComponent(); bodyPrefab.AddComponent(); PolishAirframeMaterials(Object.op_Implicit((Object)(object)characterModelObject) ? characterModelObject.GetComponent() : null, lobbyReadability: false); } private static void PolishAirframeMaterials(CharacterModel characterModel, bool lobbyReadability) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)characterModel) || characterModel.baseRendererInfos == null) { return; } RendererInfo[] baseRendererInfos = characterModel.baseRendererInfos; for (int i = 0; i < baseRendererInfos.Length; i++) { RendererInfo val = baseRendererInfos[i]; Material defaultMaterial = val.defaultMaterial; if (!Object.op_Implicit((Object)(object)defaultMaterial)) { continue; } Material val2 = defaultMaterial; if (lobbyReadability) { val2 = Object.Instantiate(defaultMaterial); ((Object)val2).name = ((Object)defaultMaterial).name.Replace(" (Instance)", ""); val.defaultMaterial = val2; if (Object.op_Implicit((Object)(object)val.renderer)) { val.renderer.sharedMaterial = val2; } } ApplyAirframeMaterialPolish(val2, lobbyReadability); baseRendererInfos[i] = val; } characterModel.baseRendererInfos = baseRendererInfos; } private static void ApplyAirframeMaterialPolish(Material mat, bool lobbyReadability) { //IL_0169: 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_0206: 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_01f0: 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_00c2: 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_021a: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03b9: 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_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_0268: 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_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0433: Unknown result type (might be due to invalid IL or missing references) string name = ((Object)mat).name; if (name.Contains("matAH64Dark")) { Color val = default(Color); ((Color)(ref val))..ctor(0.25f, 0.29f, 0.2f); if (name.Contains("Rotor")) { ((Color)(ref val))..ctor(0.18f, 0.21f, 0.16f); } else if (name.Contains("Gun")) { ((Color)(ref val))..ctor(0.3f, 0.33f, 0.25f); } else if (name.Contains("RocketPod")) { ((Color)(ref val))..ctor(0.32f, 0.38f, 0.18f); } else if (name.Contains("Hellfire")) { ((Color)(ref val))..ctor(0.25f, 0.28f, 0.2f); } if (lobbyReadability) { val = LiftLobbyColor(val, 2.35f, 0.32f); } if (mat.HasProperty("_Color")) { mat.SetColor("_Color", val); } mat.SetFloat("_Smoothness", lobbyReadability ? 0.38f : 0.25f); mat.SetFloat("_SpecularStrength", lobbyReadability ? 0.3f : 0.12f); mat.SetFloat("_SpecularExponent", 3f); if (lobbyReadability) { SetLobbyFillEmission(mat, val, 0.7f); } } else if (name.Contains("matAH64Markings")) { Color val2 = default(Color); ((Color)(ref val2))..ctor(0.52f, 0.31f, 0.065f); if (lobbyReadability) { val2 = LiftLobbyColor(val2, 2f, 0.28f); } if (mat.HasProperty("_Color")) { mat.SetColor("_Color", val2); } mat.SetFloat("_Smoothness", 0.34f); mat.SetFloat("_SpecularStrength", lobbyReadability ? 0.32f : 0.16f); mat.SetFloat("_SpecularExponent", 4f); } else if (name.Contains("matAH64Radar")) { Color val3 = (Color)(lobbyReadability ? LiftLobbyColor(new Color(0.18f, 0.24f, 0.28f), 1.9f, 0.24f) : new Color(0.07f, 0.09f, 0.1f)); mat.SetFloat("_Smoothness", 0.55f); mat.SetFloat("_SpecularStrength", lobbyReadability ? 0.55f : 0.35f); mat.SetFloat("_SpecularExponent", 6f); if (mat.HasProperty("_Color")) { mat.SetColor("_Color", val3); } if (mat.HasProperty("_EmColor")) { mat.SetColor("_EmColor", lobbyReadability ? new Color(0.1f, 0.16f, 0.18f) : new Color(0.02f, 0.05f, 0.06f)); } if (mat.HasProperty("_EmPower")) { mat.SetFloat("_EmPower", lobbyReadability ? 0.85f : 0.25f); } } else if (name.Contains("matAH64Glass")) { mat.SetFloat("_Smoothness", 0.85f); mat.SetFloat("_SpecularStrength", lobbyReadability ? 0.7f : 0.55f); mat.SetFloat("_SpecularExponent", 8f); if (lobbyReadability && mat.HasProperty("_Color")) { Color color = mat.GetColor("_Color"); mat.SetColor("_Color", LiftLobbyColor(color, 1.7f, 0.16f)); } } else if (name.Contains("matAH64Body") || name.Contains("matAH64Optics")) { Color val4 = (name.Contains("Optics") ? new Color(0.05f, 0.16f, 0.24f) : new Color(0.48f, 0.56f, 0.32f)); if (lobbyReadability) { val4 = LiftLobbyColor(val4, 2.25f, 0.38f); } if (mat.HasProperty("_Color")) { mat.SetColor("_Color", val4); } mat.SetFloat("_Smoothness", lobbyReadability ? 0.52f : 0.4f); mat.SetFloat("_SpecularStrength", lobbyReadability ? 0.5f : 0.28f); mat.SetFloat("_SpecularExponent", 5f); if (lobbyReadability) { SetLobbyFillEmission(mat, val4, 0.95f); } } } private static Color LiftLobbyColor(Color color, float multiply, float floor) { //IL_0000: 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_0026: 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_003f: Unknown result type (might be due to invalid IL or missing references) return new Color(Mathf.Clamp01(Mathf.Max(color.r * multiply, floor)), Mathf.Clamp01(Mathf.Max(color.g * multiply, floor)), Mathf.Clamp01(Mathf.Max(color.b * multiply, floor)), color.a); } private static void SetLobbyFillEmission(Material mat, Color tint, float power) { //IL_0013: 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) if (mat.HasProperty("_EmColor")) { mat.SetColor("_EmColor", tint * 0.45f); } if (mat.HasProperty("_EmPower")) { mat.SetFloat("_EmPower", power); } } public override void InitializeEntityStateMachines() { Prefabs.ClearEntityStateMachines(bodyPrefab); Prefabs.AddMainEntityStateMachine(bodyPrefab, "Body", typeof(AH64Main), typeof(SpawnTeleporterState)); Prefabs.AddEntityStateMachine(bodyPrefab, "Weapon"); Prefabs.AddEntityStateMachine(bodyPrefab, "Weapon2"); Prefabs.AddEntityStateMachine(bodyPrefab, "Weapon3"); } public override void InitializeSkills() { Skills.ClearGenericSkills(bodyPrefab); AddPassiveSkill(); AddPrimarySkills(); AddSecondarySkills(); AddUtilitySkills(); AddSpecialSkills(); } private void AddPassiveSkill() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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) bodyPrefab.GetComponent().passiveSkill = new PassiveSkill { enabled = true, skillNameToken = "AH64_PASSIVE_NAME", skillDescriptionToken = "AH64_PASSIVE_DESCRIPTION", keywordToken = "", icon = assetBundle.LoadAsset("texAH64PassiveIcon") }; } private void AddPrimarySkills() { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) Skills.CreateGenericSkillWithSkillFamily(bodyPrefab, (SkillSlot)0); SkillDefInfo skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = "AH64Chaingun"; skillDefInfo.skillNameToken = "AH64_PRIMARY_CHAINGUN_NAME"; skillDefInfo.skillDescriptionToken = "AH64_PRIMARY_CHAINGUN_DESCRIPTION"; skillDefInfo.keywordTokens = new string[1] { "KEYWORD_AGILE" }; skillDefInfo.skillIcon = assetBundle.LoadAsset("texAH64PrimaryIcon"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(FireChaingun)); skillDefInfo.activationStateMachineName = "Weapon"; skillDefInfo.interruptPriority = (InterruptPriority)0; skillDefInfo.baseMaxStock = 30; skillDefInfo.rechargeStock = 30; skillDefInfo.baseRechargeInterval = AH64PlaytestConfig.ChaingunReload; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 1; skillDefInfo.resetCooldownTimerOnUse = true; skillDefInfo.fullRestockOnAssign = true; skillDefInfo.dontAllowPastMaxStocks = false; skillDefInfo.mustKeyPress = false; skillDefInfo.beginSkillCooldownOnSkillEnd = false; skillDefInfo.isCombatSkill = true; skillDefInfo.canceledFromSprinting = false; skillDefInfo.cancelSprintingOnActivation = false; skillDefInfo.forceSprintDuringState = false; SkillDef val = Skills.CreateSkillDef(skillDefInfo); val.attackSpeedBuffsRestockSpeed = true; val.attackSpeedBuffsRestockSpeed_Multiplier = 0.35f; skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = "AH64Gatling"; skillDefInfo.skillNameToken = "AH64_PRIMARY_GATLING_NAME"; skillDefInfo.skillDescriptionToken = "AH64_PRIMARY_GATLING_DESCRIPTION"; skillDefInfo.keywordTokens = new string[1] { "KEYWORD_AGILE" }; skillDefInfo.skillIcon = assetBundle.LoadAsset("texAH64GatlingIcon"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(FireGatling)); skillDefInfo.activationStateMachineName = "Weapon"; skillDefInfo.interruptPriority = (InterruptPriority)0; skillDefInfo.baseMaxStock = 60; skillDefInfo.rechargeStock = 60; skillDefInfo.baseRechargeInterval = AH64PlaytestConfig.GatlingReload; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 1; skillDefInfo.resetCooldownTimerOnUse = true; skillDefInfo.fullRestockOnAssign = true; skillDefInfo.dontAllowPastMaxStocks = false; skillDefInfo.mustKeyPress = false; skillDefInfo.beginSkillCooldownOnSkillEnd = false; skillDefInfo.isCombatSkill = true; skillDefInfo.canceledFromSprinting = false; skillDefInfo.cancelSprintingOnActivation = false; skillDefInfo.forceSprintDuringState = false; SkillDef val2 = Skills.CreateSkillDef(skillDefInfo); val2.attackSpeedBuffsRestockSpeed = true; val2.attackSpeedBuffsRestockSpeed_Multiplier = 0.35f; AH64Assets.gatlingSkillDef = val2; skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = "AH64Cannon"; skillDefInfo.skillNameToken = "AH64_PRIMARY_CANNON_NAME"; skillDefInfo.skillDescriptionToken = "AH64_PRIMARY_CANNON_DESCRIPTION"; skillDefInfo.keywordTokens = new string[1] { "KEYWORD_AGILE" }; skillDefInfo.skillIcon = assetBundle.LoadAsset("texAH64CannonIcon"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(FireCannon)); skillDefInfo.activationStateMachineName = "Weapon"; skillDefInfo.interruptPriority = (InterruptPriority)0; skillDefInfo.baseMaxStock = 8; skillDefInfo.rechargeStock = 8; skillDefInfo.baseRechargeInterval = AH64PlaytestConfig.CannonReload; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 1; skillDefInfo.resetCooldownTimerOnUse = true; skillDefInfo.fullRestockOnAssign = true; skillDefInfo.dontAllowPastMaxStocks = false; skillDefInfo.mustKeyPress = false; skillDefInfo.beginSkillCooldownOnSkillEnd = false; skillDefInfo.isCombatSkill = true; skillDefInfo.canceledFromSprinting = false; skillDefInfo.cancelSprintingOnActivation = false; skillDefInfo.forceSprintDuringState = false; SkillDef val3 = Skills.CreateSkillDef(skillDefInfo); val3.attackSpeedBuffsRestockSpeed = true; val3.attackSpeedBuffsRestockSpeed_Multiplier = 0.35f; Skills.AddPrimarySkills(bodyPrefab, val, val2, val3); } private void AddSecondarySkills() { Skills.CreateGenericSkillWithSkillFamily(bodyPrefab, (SkillSlot)1); Skills.AddSecondarySkills(bodyPrefab, BuildRocketPodsSkillDef()); } private SkillDef BuildRocketPodsSkillDef() { //IL_0047: 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_005e: Unknown result type (might be due to invalid IL or missing references) return Skills.CreateSkillDef(new SkillDefInfo { skillName = "AH64RocketPods", skillNameToken = "AH64_SECONDARY_ROCKETPODS_NAME", skillDescriptionToken = "AH64_SECONDARY_ROCKETPODS_DESCRIPTION", skillIcon = assetBundle.LoadAsset("texAH64SecondaryIcon"), activationState = new SerializableEntityStateType(typeof(FireRocketPods)), activationStateMachineName = "Weapon3", interruptPriority = (InterruptPriority)0, baseMaxStock = 6, rechargeStock = 6, baseRechargeInterval = 5.5f, requiredStock = 1, stockToConsume = 1, resetCooldownTimerOnUse = true, fullRestockOnAssign = true, dontAllowPastMaxStocks = false, mustKeyPress = false, beginSkillCooldownOnSkillEnd = false, isCombatSkill = true, canceledFromSprinting = false, cancelSprintingOnActivation = false, forceSprintDuringState = false }); } private void AddUtilitySkills() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: 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) Skills.CreateGenericSkillWithSkillFamily(bodyPrefab, (SkillSlot)2); SkillDef val = Skills.CreateSkillDef(new SkillDefInfo { skillName = "AH64EvasiveJink", skillNameToken = "AH64_UTILITY_DASH_NAME", skillDescriptionToken = "AH64_UTILITY_DASH_DESCRIPTION", skillIcon = assetBundle.LoadAsset("texAH64UtilityIcon"), activationState = new SerializableEntityStateType(typeof(ServoDash)), activationStateMachineName = "Body", interruptPriority = (InterruptPriority)2, baseRechargeInterval = AH64PlaytestConfig.DashCooldown, baseMaxStock = 1, rechargeStock = 1, requiredStock = 1, stockToConsume = 1, resetCooldownTimerOnUse = false, fullRestockOnAssign = true, dontAllowPastMaxStocks = false, mustKeyPress = false, beginSkillCooldownOnSkillEnd = false, isCombatSkill = false, canceledFromSprinting = false, cancelSprintingOnActivation = false, forceSprintDuringState = true }); SkillDef val2 = Skills.CreateSkillDef(new SkillDefInfo { skillName = "AH64SmokeBackflip", skillNameToken = "AH64_UTILITY_BACKFLIP_NAME", skillDescriptionToken = "AH64_UTILITY_BACKFLIP_DESCRIPTION", skillIcon = assetBundle.LoadAsset("texAH64UtilityIcon"), activationState = new SerializableEntityStateType(typeof(SmokeBackflip)), activationStateMachineName = "Body", interruptPriority = (InterruptPriority)2, baseRechargeInterval = 6.5f, baseMaxStock = 1, rechargeStock = 1, requiredStock = 1, stockToConsume = 1, resetCooldownTimerOnUse = false, fullRestockOnAssign = true, dontAllowPastMaxStocks = false, mustKeyPress = true, beginSkillCooldownOnSkillEnd = false, isCombatSkill = false, canceledFromSprinting = false, cancelSprintingOnActivation = false, forceSprintDuringState = false }); Skills.AddUtilitySkills(bodyPrefab, val, val2); } private void AddSpecialSkills() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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_011b: 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) Skills.CreateGenericSkillWithSkillFamily(bodyPrefab, (SkillSlot)3); SkillDef val = Skills.CreateSkillDef(new SkillDefInfo { skillName = "AH64Longbow", skillNameToken = "AH64_SPECIAL_LONGBOW_NAME", skillDescriptionToken = "AH64_SPECIAL_LONGBOW_DESCRIPTION", skillIcon = assetBundle.LoadAsset("texAH64SpecialIcon"), activationState = new SerializableEntityStateType(typeof(PaintLongbow)), activationStateMachineName = "Weapon2", interruptPriority = (InterruptPriority)1, baseMaxStock = 6, rechargeStock = 1, baseRechargeInterval = 3.5f, requiredStock = 1, stockToConsume = 0, resetCooldownTimerOnUse = false, fullRestockOnAssign = true, dontAllowPastMaxStocks = true, isCombatSkill = true, mustKeyPress = false, canceledFromSprinting = false, cancelSprintingOnActivation = false }); SkillDef val2 = Skills.CreateSkillDef(new SkillDefInfo { skillName = "AH64Hellfire", skillNameToken = "AH64_SPECIAL_HELLFIRE_NAME", skillDescriptionToken = "AH64_SPECIAL_HELLFIRE_DESCRIPTION", skillIcon = assetBundle.LoadAsset("texAH64SecondaryIcon"), activationState = new SerializableEntityStateType(typeof(FireHellfire)), activationStateMachineName = "Weapon2", interruptPriority = (InterruptPriority)1, baseMaxStock = 1, baseRechargeInterval = 8f, isCombatSkill = true, mustKeyPress = true }); Skills.AddSpecialSkills(bodyPrefab, val, val2); } public override void InitializeSkins() { ModelSkinController val = ((Component)prefabCharacterModel).gameObject.AddComponent(); ((Component)prefabCharacterModel).GetComponent(); RendererInfo[] baseRendererInfos = prefabCharacterModel.baseRendererInfos; List list = new List(); SkinDef item = Skins.CreateSkinDef("DEFAULT_SKIN", assetBundle.LoadAsset("texMainSkin"), baseRendererInfos, ((Component)prefabCharacterModel).gameObject); list.Add(item); val.skins = list.ToArray(); if (Object.op_Implicit((Object)(object)displayPrefab)) { PolishAirframeMaterials(displayPrefab.GetComponent(), lobbyReadability: true); if (!Object.op_Implicit((Object)(object)displayPrefab.GetComponent())) { displayPrefab.AddComponent(); } } Skins.CreateDisplaySkinController(displayPrefab, val.skins); } public override void InitializeCharacterMaster() { AH64AI.Init(bodyPrefab, masterName); } private void AddHooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { AH64PassiveComponent aH64PassiveComponent = (Object.op_Implicit((Object)(object)sender) ? ((Component)sender).GetComponent() : null); if (Object.op_Implicit((Object)(object)aH64PassiveComponent)) { if (aH64PassiveComponent.FacingPainted) { args.moveSpeedMultAdd += AH64PlaytestConfig.RadarFacingSpeedBonus; } if (aH64PassiveComponent.CloseToPainted) { args.armorAdd += 60f; } if (sender.HasBuff(AH64Buffs.platingBuff)) { args.armorAdd += 300f; } } } } public class AH64HeatVisuals : MonoBehaviour { private const float smokeScale = 0.18f; private static readonly Color glowColor = new Color(1f, 0.08f, 0.03f); private const string heatRendererName = "ChinTurret"; private const string ventStartSound = "Play_railgunner_m2_reload_basic"; private const string ventFinishSound = "Play_railgunner_m2_reload_pass"; private SkillLocator skillLocator; private ChildLocator childLocator; private Material wristMaterial; private bool wasReloading; private void Start() { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown skillLocator = ((Component)this).GetComponent(); ModelLocator component = ((Component)this).GetComponent(); Transform val = (Object.op_Implicit((Object)(object)component) ? component.modelTransform : null); if (!Object.op_Implicit((Object)(object)val)) { return; } childLocator = ((Component)val).GetComponent(); CharacterModel component2 = ((Component)val).GetComponent(); if ((Object)(object)component2 == (Object)null || component2.baseRendererInfos == null) { return; } for (int i = 0; i < component2.baseRendererInfos.Length; i++) { Renderer renderer = component2.baseRendererInfos[i].renderer; if (Object.op_Implicit((Object)(object)renderer) && ((Object)renderer).name == "ChinTurret") { wristMaterial = new Material(component2.baseRendererInfos[i].defaultMaterial); component2.baseRendererInfos[i].defaultMaterial = wristMaterial; } } } private void Update() { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown GenericSkill val = (Object.op_Implicit((Object)(object)skillLocator) ? skillLocator.primary : null); if ((Object)(object)val == (Object)null || (Object)(object)wristMaterial == (Object)null) { return; } bool flag = val.stock <= 0; float num = ((!flag) ? ((val.maxStock > 0) ? (1f - (float)val.stock / (float)val.maxStock) : 0f) : Mathf.Clamp01(((val.finalRechargeInterval > 0f) ? Mathf.Clamp01(val.cooldownRemaining / val.finalRechargeInterval) : 1f) * 2f)); wristMaterial.SetColor("_EmColor", glowColor * num); wristMaterial.SetFloat("_EmPower", 4f * num); if (flag == wasReloading) { return; } wasReloading = flag; Util.PlaySound(flag ? "Play_railgunner_m2_reload_basic" : "Play_railgunner_m2_reload_pass", ((Component)this).gameObject); GameObject smokePuffEffect = AH64Assets.SmokePuffEffect; if (flag && Object.op_Implicit((Object)(object)smokePuffEffect)) { Transform val2 = (Object.op_Implicit((Object)(object)childLocator) ? childLocator.FindChild("Muzzle") : null); if (Object.op_Implicit((Object)(object)val2)) { EffectManager.SpawnEffect(smokePuffEffect, new EffectData { origin = val2.position, scale = 0.18f }, false); } } } private void OnDestroy() { if (Object.op_Implicit((Object)(object)wristMaterial)) { Object.Destroy((Object)(object)wristMaterial); } } } public static class AH64AI { public static void Init(GameObject bodyPrefab, string masterName) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_00f9: 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_0170: 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_019e: 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_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0218: 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_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0288: 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_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) GameObject obj = Prefabs.CreateBlankMasterPrefab(bodyPrefab, masterName); BaseAI component = obj.GetComponent(); component.aimVectorDampTime = 0.1f; component.aimVectorMaxSpeed = 360f; AISkillDriver obj2 = obj.AddComponent(); obj2.customName = "Use Utility Evasive Roll"; obj2.skillSlot = (SkillSlot)2; obj2.requiredSkill = null; obj2.requireSkillReady = true; obj2.requireEquipmentReady = false; obj2.minUserHealthFraction = float.NegativeInfinity; obj2.maxUserHealthFraction = float.PositiveInfinity; obj2.minTargetHealthFraction = float.NegativeInfinity; obj2.maxTargetHealthFraction = float.PositiveInfinity; obj2.minDistance = 12f; obj2.maxDistance = 40f; obj2.selectionRequiresTargetLoS = true; obj2.selectionRequiresOnGround = false; obj2.selectionRequiresAimTarget = false; obj2.maxTimesSelected = -1; obj2.moveTargetType = (TargetType)0; obj2.activationRequiresTargetLoS = false; obj2.activationRequiresAimTargetLoS = false; obj2.activationRequiresAimConfirmation = false; obj2.movementType = (MovementType)1; obj2.moveInputScale = 1f; obj2.aimType = (AimType)1; obj2.ignoreNodeGraph = false; obj2.shouldSprint = true; obj2.shouldFireEquipment = false; obj2.buttonPressType = (ButtonPressType)0; obj2.driverUpdateTimerOverride = -1f; obj2.resetCurrentEnemyOnNextDriverSelection = false; obj2.noRepeat = false; obj2.nextHighPriorityOverride = null; AISkillDriver obj3 = obj.AddComponent(); obj3.customName = "Use Special"; obj3.skillSlot = (SkillSlot)3; obj3.requireSkillReady = true; obj3.minDistance = 14f; obj3.maxDistance = 70f; obj3.selectionRequiresTargetLoS = true; obj3.selectionRequiresOnGround = false; obj3.selectionRequiresAimTarget = false; obj3.maxTimesSelected = -1; obj3.moveTargetType = (TargetType)0; obj3.activationRequiresTargetLoS = true; obj3.activationRequiresAimTargetLoS = false; obj3.activationRequiresAimConfirmation = true; obj3.movementType = (MovementType)2; obj3.moveInputScale = 1f; obj3.aimType = (AimType)1; obj3.buttonPressType = (ButtonPressType)2; AISkillDriver obj4 = obj.AddComponent(); obj4.customName = "Use Secondary Hydra-70 Pods"; obj4.skillSlot = (SkillSlot)1; obj4.requireSkillReady = true; obj4.minDistance = 8f; obj4.maxDistance = 55f; obj4.selectionRequiresTargetLoS = true; obj4.selectionRequiresOnGround = false; obj4.selectionRequiresAimTarget = false; obj4.maxTimesSelected = -1; obj4.moveTargetType = (TargetType)0; obj4.activationRequiresTargetLoS = true; obj4.activationRequiresAimTargetLoS = false; obj4.activationRequiresAimConfirmation = true; obj4.movementType = (MovementType)2; obj4.moveInputScale = 1f; obj4.aimType = (AimType)1; obj4.buttonPressType = (ButtonPressType)0; AISkillDriver obj5 = obj.AddComponent(); obj5.customName = "Use Primary M230 Chain Gun"; obj5.skillSlot = (SkillSlot)0; obj5.requireSkillReady = false; obj5.minDistance = 0f; obj5.maxDistance = 60f; obj5.selectionRequiresTargetLoS = true; obj5.selectionRequiresOnGround = false; obj5.selectionRequiresAimTarget = false; obj5.maxTimesSelected = -1; obj5.moveTargetType = (TargetType)0; obj5.activationRequiresTargetLoS = true; obj5.activationRequiresAimTargetLoS = false; obj5.activationRequiresAimConfirmation = true; obj5.movementType = (MovementType)2; obj5.moveInputScale = 1f; obj5.aimType = (AimType)1; obj5.buttonPressType = (ButtonPressType)0; AISkillDriver obj6 = obj.AddComponent(); obj6.customName = "Chase"; obj6.skillSlot = (SkillSlot)(-1); obj6.requireSkillReady = false; obj6.minDistance = 0f; obj6.maxDistance = float.PositiveInfinity; obj6.moveTargetType = (TargetType)0; obj6.activationRequiresTargetLoS = false; obj6.activationRequiresAimTargetLoS = false; obj6.activationRequiresAimConfirmation = false; obj6.movementType = (MovementType)1; obj6.moveInputScale = 1f; obj6.aimType = (AimType)1; obj6.shouldSprint = true; obj6.buttonPressType = (ButtonPressType)0; } } public static class AH64Assets { public static GameObject hellfireMuzzleFlashEffect; public static GameObject hellfireExplosionEffect; public static GameObject longbowExplosionEffect; public static GameObject hydraMuzzleFlashEffect; public static GameObject hydraExplosionEffect; public static GameObject chaingunTracerEffect; public static GameObject chaingunMuzzleFlashEffect; public static GameObject chaingunHitEffect; public static GameObject chaingunShellEjectEffect; public static GameObject dashThrusterEffect; public static GameObject dashDustEffect; public static GameObject dashFlareEffect; public static GameObject chaingunSplashEffect; public static GameObject gatlingSplashEffect; public static GameObject cannonSplashEffect; public static SkillDef gatlingSkillDef; public static AudioClip rotorHoverLoop; public static AudioClip rotorInFlightLoop; public static AudioClip rotorClimbLoop; public static GameObject hellfireProjectilePrefab; public static GameObject hydraRocketProjectilePrefab; private static AssetBundle _assetBundle; private static GameObject _smokePuffEffect; private static GameObject _rotorWashEffect; private static GameObject _longbowProjectile; private static GameObject _longbowLockIndicatorPrefab; private static GameObject _radarPaintIndicatorPrefab; private static GameObject _longbowCrosshair; public static GameObject radarPulseEffect; public static GameObject radarPaintPingEffect; public static readonly Color32 RadarEffectColor = new Color32(byte.MaxValue, (byte)55, (byte)40, byte.MaxValue); private static readonly string[] SmokeRingPaths = new string[2] { "Prefabs/Effects/MuzzleFlashes/MuzzleflashSmokeRing", "Assets/RoR2/Base/Common/VFX/MuzzleFlashes/MuzzleflashSmokeRing.prefab" }; public static GameObject SmokePuffEffect { get { if (!Object.op_Implicit((Object)(object)_smokePuffEffect)) { _smokePuffEffect = LoadLegacy("Prefabs/Effects/ImpactEffects/ExplosionLunarGolem") ?? LoadLegacy("Prefabs/Effects/OmniExplosionVFX"); } return _smokePuffEffect; } } public static GameObject DustEffect => _rotorWashEffect; public static GameObject RotorWashEffect => _rotorWashEffect; public static GameObject LongbowProjectile { get { if (!Object.op_Implicit((Object)(object)_longbowProjectile)) { _longbowProjectile = Fire.projectilePrefab; if (!Object.op_Implicit((Object)(object)_longbowProjectile)) { _longbowProjectile = LoadLegacy("Prefabs/Projectiles/EngiHarpoon"); } if (!Object.op_Implicit((Object)(object)_longbowProjectile)) { Log.Error("LongbowProjectile failed to load from Engi Fire.projectilePrefab and LegacyResources. Special will not fire."); } } return _longbowProjectile; } } public static GameObject LongbowLockIndicatorPrefab { get { if (!Object.op_Implicit((Object)(object)_longbowLockIndicatorPrefab)) { _longbowLockIndicatorPrefab = LoadLegacy("Prefabs/EngiMissileTrackingIndicator"); if (!Object.op_Implicit((Object)(object)_longbowLockIndicatorPrefab)) { _longbowLockIndicatorPrefab = Paint.stickyTargetIndicatorPrefab; } } return _longbowLockIndicatorPrefab; } } public static GameObject RadarPaintIndicatorPrefab { get { if (!Object.op_Implicit((Object)(object)_radarPaintIndicatorPrefab)) { _radarPaintIndicatorPrefab = LoadLegacy("Prefabs/HuntressTrackingIndicator"); if (!Object.op_Implicit((Object)(object)_radarPaintIndicatorPrefab)) { _radarPaintIndicatorPrefab = LongbowLockIndicatorPrefab; } } return _radarPaintIndicatorPrefab; } } public static GameObject LongbowCrosshair { get { if (!Object.op_Implicit((Object)(object)_longbowCrosshair)) { _longbowCrosshair = Paint.crosshairOverridePrefab; if (!Object.op_Implicit((Object)(object)_longbowCrosshair)) { _longbowCrosshair = LoadLegacy("Prefabs/Crosshair/EngiPaintCrosshair"); } } return _longbowCrosshair; } } public static GameObject RadarPulseEffect { get { if (Object.op_Implicit((Object)(object)radarPulseEffect)) { return radarPulseEffect; } return LoadLegacy("Prefabs/Effects/ImpactEffects/BootShockwave") ?? LoadLegacy("Prefabs/Effects/OmniImpactVFX") ?? SmokePuffEffect; } } public static GameObject RadarPaintPingEffect { get { if (Object.op_Implicit((Object)(object)radarPaintPingEffect)) { return radarPaintPingEffect; } return LoadLegacy("Prefabs/Effects/OmniImpactVFX") ?? RadarPulseEffect; } } private static GameObject LoadLegacy(string legacyPath) { return LegacyResourcesAPI.Load(legacyPath); } private static GameObject CreateChaingunTracer() { //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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_00ad: 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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) Color val = default(Color); ((Color)(ref val))..ctor(0.52f, 0.36f, 0.12f, 0.55f); GameObject val2 = Asset.CloneTracer("TracerCommandoShotgun", "AH64ChaingunTracer") ?? Asset.CloneTracer("TracerCommandoDefault", "AH64ChaingunTracer"); if (!Object.op_Implicit((Object)(object)val2)) { Log.Warning("Could not clone a vanilla tracer — falling back to the untinted vanilla prefab."); return LoadVanilla("Prefabs/Effects/Tracers/TracerCommandoShotgun", "Prefabs/Effects/Tracers/TracerCommandoDefault"); } LineRenderer[] componentsInChildren = val2.GetComponentsInChildren(true); foreach (LineRenderer val3 in componentsInChildren) { val3.startColor = val; val3.endColor = new Color(val.r, val.g * 0.6f, val.b * 0.35f, 0f); if (Object.op_Implicit((Object)(object)((Renderer)val3).sharedMaterial)) { Material val4 = Object.Instantiate(((Renderer)val3).sharedMaterial); if (val4.HasProperty("_TintColor")) { val4.SetColor("_TintColor", val); } if (val4.HasProperty("_Color")) { val4.SetColor("_Color", val); } ((Renderer)val3).material = val4; } } TintVfxHierarchy(val2, val); return val2; } private static GameObject CreateRegisteredDustEffect() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) GameObject val = LoadVanilla("Prefabs/GenericFootstepDust", "Assets/RoR2/Base/Common/VFX/Footstep/GenericFootstepDust.prefab", "Prefabs/GenericLargeFootstepDust"); if (!Object.op_Implicit((Object)(object)val)) { return null; } GameObject val2 = PrefabAPI.InstantiateClone(val, "AH64RotorWash", false); if (!Object.op_Implicit((Object)(object)val2.GetComponent())) { val2.AddComponent(); } VFXAttributes val3 = val2.GetComponent(); if (!Object.op_Implicit((Object)(object)val3)) { val3 = val2.AddComponent(); } val3.vfxPriority = (VFXPriority)1; EffectComponent val4 = val2.GetComponent(); if (!Object.op_Implicit((Object)(object)val4)) { val4 = val2.AddComponent(); } val4.applyScale = true; val4.effectIndex = (EffectIndex)(-1); val4.parentToReferencedTransform = false; val4.positionAtReferencedTransform = false; Content.CreateAndAddEffectDef(val2); return val2; } private static GameObject LoadVanilla(params string[] paths) { foreach (string text in paths) { GameObject val = null; val = ((!text.StartsWith("Prefabs/", StringComparison.Ordinal) && !text.StartsWith("Shaders/", StringComparison.Ordinal)) ? LoadAddressable(text) : LoadLegacy(text)); if (Object.op_Implicit((Object)(object)val)) { return val; } } Log.Error("Failed to load vanilla prefab. Tried: " + string.Join(" | ", paths)); return null; } private static GameObject LoadAddressable(string addressablePath) { //IL_0001: 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) try { GameObject val = Addressables.LoadAssetAsync((object)addressablePath).WaitForCompletion(); if (Object.op_Implicit((Object)(object)val)) { return val; } } catch (Exception) { } return null; } public static void Init(AssetBundle assetBundle) { _assetBundle = assetBundle; rotorHoverLoop = _assetBundle.LoadAsset("sfxAH64RotorHoverGrounded"); if (!Object.op_Implicit((Object)(object)rotorHoverLoop)) { Log.Warning("Approved grounded rotor hover clip was not found in the ah64 bundle; flight audio will stay silent."); } rotorInFlightLoop = _assetBundle.LoadAsset("sfxAH64RotorInFlight"); if (!Object.op_Implicit((Object)(object)rotorInFlightLoop)) { Log.Warning("Rotor in-flight layer clip was not found in the ah64 bundle; forward-speed layer will stay silent."); } rotorClimbLoop = _assetBundle.LoadAsset("sfxAH64RotorClimb"); if (!Object.op_Implicit((Object)(object)rotorClimbLoop)) { Log.Warning("Rotor climb layer clip was not found in the ah64 bundle; collective layer will stay silent."); } CreateEffects(); CreateProjectiles(); } private static void CreateEffects() { LoadWeaponEffects(); CreateRocketExplosionEffect(); CreateChaingunSplashEffect(); hydraExplosionEffect = CreateHydraExplosionEffect(); CreateGatlingSplashEffect(); CreateCannonSplashEffect(); CreateLongbowExplosionEffect(); radarPulseEffect = CreateRadarPulseEffect(); radarPaintPingEffect = CreateRadarPaintPingEffect(); } private static void LoadWeaponEffects() { chaingunTracerEffect = CreateChaingunTracer(); chaingunHitEffect = LoadVanilla("Prefabs/Effects/ImpactEffects/Hitspark1", "Prefabs/Effects/OmniImpactVFX"); chaingunMuzzleFlashEffect = CreateChaingunMuzzleFlash(); chaingunShellEjectEffect = LoadVanilla("Prefabs/Effects/MuzzleFlashes/MuzzleflashBandit2", "Assets/RoR2/Base/Characters/Bandit2/VFX/MuzzleflashBandit2.prefab"); hydraMuzzleFlashEffect = LoadVanilla(SmokeRingPaths); hellfireMuzzleFlashEffect = LoadWarmMuzzleFlash(); if (!Object.op_Implicit((Object)(object)hellfireMuzzleFlashEffect)) { hellfireMuzzleFlashEffect = _assetBundle.LoadEffect("AH64HellfireMuzzleFlash", parentToTransform: true); } dashThrusterEffect = LoadVanilla(SmokeRingPaths); _rotorWashEffect = CreateRegisteredDustEffect(); dashDustEffect = _rotorWashEffect; dashFlareEffect = LoadVanilla("Prefabs/Effects/ImpactEffects/ExplosionFirework", "Prefabs/Effects/ImpactEffects/CritsparkHeavy", "Prefabs/Effects/OmniExplosionVFX"); } private static GameObject LoadWarmMuzzleFlash() { return LoadVanilla("Prefabs/Effects/MuzzleFlashes/Muzzleflash1", "Assets/RoR2/Base/Common/VFX/MuzzleFlashes/Muzzleflash1.prefab", "Prefabs/Effects/MuzzleFlashes/MuzzleflashFMJ", "Assets/RoR2/Base/Characters/Commando/Skills/MuzzleflashFMJ.prefab"); } private static GameObject CreateChaingunMuzzleFlash() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) GameObject val = LoadWarmMuzzleFlash(); if (!Object.op_Implicit((Object)(object)val)) { Log.Error("AH64ChaingunMuzzleFlash: no warm muzzle flash loaded (FMJ/Muzzleflash1). Primary will fire without a barrel flash."); return null; } GameObject obj = PrefabAPI.InstantiateClone(val, "AH64ChaingunMuzzleFlash", false); ShakeEmitter obj2 = obj.AddComponent(); obj2.amplitudeTimeDecay = true; obj2.duration = 0.08f; obj2.radius = 12f; obj2.scaleShakeRadiusWithLocalScale = false; obj2.wave = new Wave { amplitude = 0.5f, frequency = 22f, cycleOffset = 0f }; Content.CreateAndAddEffectDef(obj); return obj; } private static GameObject CreateRadarPulseEffect() { GameObject val = LoadLegacy("Prefabs/Effects/ImpactEffects/BootShockwave") ?? LoadLegacy("Prefabs/Effects/TreebotShockwaveEffect") ?? LoadLegacy("Prefabs/Effects/OmniImpactVFX") ?? LoadLegacy("Prefabs/Effects/OmniExplosionVFX"); if (!Object.op_Implicit((Object)(object)val)) { Log.Error("AH64RadarPulse: no donor shockwave/impact VFX found."); return null; } GameObject obj = PrefabAPI.InstantiateClone(val, "AH64RadarPulse", false); StripEffectFeedback(obj); EffectComponent component = obj.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.parentToReferencedTransform = true; component.positionAtReferencedTransform = true; component.applyScale = true; } Content.CreateAndAddEffectDef(obj); return obj; } private static GameObject CreateRadarPaintPingEffect() { GameObject val = LoadLegacy("Prefabs/Effects/OmniImpactVFX") ?? LoadLegacy("Prefabs/Effects/ImpactEffects/OmniImpactVFX") ?? LoadLegacy("Prefabs/Effects/ImpactEffects/BootShockwave"); if (!Object.op_Implicit((Object)(object)val)) { Log.Error("AH64RadarPaintPing: no donor impact VFX found."); return null; } GameObject obj = PrefabAPI.InstantiateClone(val, "AH64RadarPaintPing", false); StripEffectFeedback(obj); EffectComponent component = obj.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.applyScale = true; } Content.CreateAndAddEffectDef(obj); return obj; } private static void StripEffectFeedback(GameObject root) { if (Object.op_Implicit((Object)(object)root)) { ShakeEmitter[] componentsInChildren = root.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { Object.Destroy((Object)(object)componentsInChildren[i]); } EffectComponent component = root.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.soundName = string.Empty; } } } private static GameObject CreateHydraExplosionEffect() { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) GameObject val = _assetBundle.LoadEffect("AH64HydraExplosion", "Play_engi_M1_explo"); if (Object.op_Implicit((Object)(object)val)) { EffectComponent component = val.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.applyScale = false; } DestroyOnTimer component2 = val.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.duration = 1.4f; } return val; } Log.Warning("AH64HydraExplosion missing from bundle — falling back to scaled Hellfire warhead."); if (!Object.op_Implicit((Object)(object)hellfireExplosionEffect)) { return null; } val = PrefabAPI.InstantiateClone(hellfireExplosionEffect, "AH64HydraExplosionFallback", false); ScaleVfxHierarchy(val, 0.28f); TintVfxHierarchy(val, new Color(1f, 0.75f, 0.35f, 1f)); ShakeEmitter[] components = val.GetComponents(); for (int i = 0; i < components.Length; i++) { Object.DestroyImmediate((Object)(object)components[i]); } EffectComponent component3 = val.GetComponent(); if (Object.op_Implicit((Object)(object)component3)) { component3.soundName = "Play_engi_M1_explo"; component3.applyScale = false; } val.transform.localScale = Vector3.one * 0.55f; Content.CreateAndAddEffectDef(val); return val; } private static void CreateCannonSplashEffect() { GameObject val = _assetBundle.LoadEffect("AH64CannonExplosion", string.Empty); if (!Object.op_Implicit((Object)(object)val)) { Log.Warning("AH64CannonExplosion missing from bundle — reusing the M230 splash."); cannonSplashEffect = chaingunSplashEffect; return; } EffectComponent component = val.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.soundName = string.Empty; component.applyScale = true; } DestroyOnTimer component2 = val.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.duration = 1.8f; } cannonSplashEffect = val; } private static void CreateGatlingSplashEffect() { GameObject val = _assetBundle.LoadEffect("AH64GatlingExplosion", string.Empty); if (!Object.op_Implicit((Object)(object)val)) { Log.Warning("AH64GatlingExplosion missing from bundle — reusing the M230 splash."); gatlingSplashEffect = chaingunSplashEffect; return; } EffectComponent component = val.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.soundName = string.Empty; component.applyScale = true; } DestroyOnTimer component2 = val.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.duration = 1f; } gatlingSplashEffect = val; } private static void CreateChaingunSplashEffect() { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) GameObject val = _assetBundle.LoadEffect("AH64HeExplosion", string.Empty); if (Object.op_Implicit((Object)(object)val)) { EffectComponent component = val.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.soundName = string.Empty; component.applyScale = true; } DestroyOnTimer component2 = val.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.duration = 1.2f; } chaingunSplashEffect = val; return; } Log.Warning("AH64HeExplosion missing from bundle — falling back to tinted Hellfire clone."); if (Object.op_Implicit((Object)(object)hellfireExplosionEffect)) { val = PrefabAPI.InstantiateClone(hellfireExplosionEffect, "AH64ChaingunSplash", false); ScaleVfxHierarchy(val, 0.42f); TintVfxHierarchy(val, new Color(1f, 0.72f, 0.28f, 1f)); ShakeEmitter[] components = val.GetComponents(); for (int i = 0; i < components.Length; i++) { Object.DestroyImmediate((Object)(object)components[i]); } EffectComponent component3 = val.GetComponent(); if (Object.op_Implicit((Object)(object)component3)) { component3.soundName = string.Empty; component3.applyScale = true; } Content.CreateAndAddEffectDef(val); chaingunSplashEffect = val; } else { chaingunSplashEffect = hydraExplosionEffect; } } private static GameObject CreateScaledExplosionEffect(string cloneName, float particleMult, bool ignoreBlastRadiusScale, float fixedScale, params string[] legacyPaths) { //IL_004e: 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) GameObject val = LoadVanilla(legacyPaths); if (!Object.op_Implicit((Object)(object)val)) { return null; } GameObject val2 = PrefabAPI.InstantiateClone(val, cloneName, false); ScaleVfxHierarchy(val2, particleMult); StripDebrisChildren(val2); EffectComponent val3 = val2.GetComponent(); if (!Object.op_Implicit((Object)(object)val3)) { val3 = val2.AddComponent(); } if (ignoreBlastRadiusScale) { val3.applyScale = false; val2.transform.localScale = Vector3.one * Mathf.Max(fixedScale, 0.01f); } else { val3.applyScale = true; } Content.CreateAndAddEffectDef(val2); return val2; } private static void ScaleVfxHierarchy(GameObject root, float mult) { //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) if (Object.op_Implicit((Object)(object)root) && !Mathf.Approximately(mult, 1f)) { ParticleSystem[] componentsInChildren = root.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { MainModule main = componentsInChildren[i].main; ((MainModule)(ref main)).startSizeMultiplier = ((MainModule)(ref main)).startSizeMultiplier * mult; ((MainModule)(ref main)).startSpeedMultiplier = ((MainModule)(ref main)).startSpeedMultiplier * mult; } TrailRenderer[] componentsInChildren2 = root.GetComponentsInChildren(true); foreach (TrailRenderer obj in componentsInChildren2) { obj.startWidth *= mult; obj.endWidth *= mult; } } } private static void TintVfxHierarchy(GameObject root, Color tint) { //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_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) if (Object.op_Implicit((Object)(object)root)) { ParticleSystem[] componentsInChildren = root.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { MainModule main = componentsInChildren[i].main; ((MainModule)(ref main)).startColor = new MinMaxGradient(tint); } } } private static void StripDebrisChildren(GameObject root) { if (!Object.op_Implicit((Object)(object)root)) { return; } Transform[] componentsInChildren = root.GetComponentsInChildren(true); foreach (Transform val in componentsInChildren) { if (Object.op_Implicit((Object)(object)val) && !((Object)(object)val == (Object)(object)root.transform)) { string name = ((Object)val).name; if (name.IndexOf("debris", StringComparison.OrdinalIgnoreCase) >= 0 || name.IndexOf("rubble", StringComparison.OrdinalIgnoreCase) >= 0 || name.IndexOf("rock", StringComparison.OrdinalIgnoreCase) >= 0 || name.IndexOf("chunk", StringComparison.OrdinalIgnoreCase) >= 0 || name.IndexOf("shard", StringComparison.OrdinalIgnoreCase) >= 0 || name.IndexOf("flare", StringComparison.OrdinalIgnoreCase) >= 0 || name.IndexOf("spark", StringComparison.OrdinalIgnoreCase) >= 0 || name.IndexOf("ember", StringComparison.OrdinalIgnoreCase) >= 0 || name.IndexOf("firework", StringComparison.OrdinalIgnoreCase) >= 0 || name.IndexOf("shrapnel", StringComparison.OrdinalIgnoreCase) >= 0 || name.IndexOf("fragment", StringComparison.OrdinalIgnoreCase) >= 0 || name.IndexOf("gravel", StringComparison.OrdinalIgnoreCase) >= 0) { ((Component)val).gameObject.SetActive(false); } } } } private static GameObject CreateHydraRocketGhost() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_assetBundle.LoadAsset("AH64HellfireGhost") == (Object)null) { return null; } GameObject val = _assetBundle.CreateProjectileGhostPrefab("AH64HellfireGhost"); if (!Object.op_Implicit((Object)(object)val)) { return null; } GameObject obj = PrefabAPI.InstantiateClone(val, "AH64HydraRocketGhost", false); float num = 0.38f; obj.transform.localScale = Vector3.one * num; ScaleVfxHierarchy(obj, num); return obj; } private static void CreateRocketExplosionEffect() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) hellfireExplosionEffect = _assetBundle.LoadEffect("AH64HellfireExplosion", "Play_clayboss_M1_explo"); if (Object.op_Implicit((Object)(object)hellfireExplosionEffect)) { ShakeEmitter obj = hellfireExplosionEffect.AddComponent(); obj.amplitudeTimeDecay = true; obj.duration = 0.5f; obj.radius = 200f; obj.scaleShakeRadiusWithLocalScale = false; obj.wave = new Wave { amplitude = 1f, frequency = 40f, cycleOffset = 0f }; } } private static void CreateLongbowExplosionEffect() { //IL_0132: 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_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)hellfireExplosionEffect)) { longbowExplosionEffect = PrefabAPI.InstantiateClone(hellfireExplosionEffect, "AH64LongbowExplosion", false); EffectComponent component = longbowExplosionEffect.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.soundName = "Play_commando_M2_grenade_explo"; } ShakeEmitter component2 = longbowExplosionEffect.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.duration = 0.4f; component2.wave = new Wave { amplitude = 0.75f, frequency = 36f, cycleOffset = 0f }; } Content.CreateAndAddEffectDef(longbowExplosionEffect); return; } longbowExplosionEffect = CreateScaledExplosionEffect("AH64LongbowExplosion", 2.4f, true, 1.35f, "Prefabs/Effects/ImpactEffects/ExplosionFirework", "Prefabs/Effects/OmniExplosionVFX", "Prefabs/Effects/OmniImpactVFX"); if (Object.op_Implicit((Object)(object)longbowExplosionEffect)) { EffectComponent component3 = longbowExplosionEffect.GetComponent(); if (Object.op_Implicit((Object)(object)component3)) { component3.soundName = "Play_commando_M2_grenade_explo"; } ShakeEmitter obj = longbowExplosionEffect.AddComponent(); obj.amplitudeTimeDecay = true; obj.duration = 0.4f; obj.radius = 160f; obj.scaleShakeRadiusWithLocalScale = false; obj.wave = new Wave { amplitude = 0.75f, frequency = 36f, cycleOffset = 0f }; } } private static void CreateProjectiles() { CreateHellfireProjectile(); if (Object.op_Implicit((Object)(object)hellfireProjectilePrefab)) { Content.AddProjectilePrefab(hellfireProjectilePrefab); } CreateLongbowProjectile(); if (Object.op_Implicit((Object)(object)_longbowProjectile)) { Content.AddProjectilePrefab(_longbowProjectile); } CreateHydraRocketProjectile(); if (Object.op_Implicit((Object)(object)hydraRocketProjectilePrefab)) { Content.AddProjectilePrefab(hydraRocketProjectilePrefab); } } private static void CreateLongbowProjectile() { //IL_012d: Unknown result type (might be due to invalid IL or missing references) GameObject val = LoadLegacy("Prefabs/Projectiles/EngiHarpoon"); if (!Object.op_Implicit((Object)(object)val)) { val = Fire.projectilePrefab; } if (!Object.op_Implicit((Object)(object)val)) { Log.Error("AH64LongbowProjectile: EngiHarpoon source was not available."); return; } _longbowProjectile = PrefabAPI.InstantiateClone(val, "AH64LongbowProjectile", false); ProjectileController val2 = (Object.op_Implicit((Object)(object)_longbowProjectile) ? _longbowProjectile.GetComponent() : null); ProjectileController val3 = (Object.op_Implicit((Object)(object)hellfireProjectilePrefab) ? hellfireProjectilePrefab.GetComponent() : null); if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val3) && Object.op_Implicit((Object)(object)val3.ghostPrefab)) { val2.ghostPrefab = val3.ghostPrefab; } if (Object.op_Implicit((Object)(object)val2)) { val2.startSound = string.Empty; } ProjectileImpactExplosion[] components = _longbowProjectile.GetComponents(); for (int i = 0; i < components.Length; i++) { if (Object.op_Implicit((Object)(object)components[i])) { Object.DestroyImmediate((Object)(object)components[i]); } } ProjectileSingleTargetImpact component = _longbowProjectile.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { Object.DestroyImmediate((Object)(object)component); } ProjectileImpactExplosion val4 = _longbowProjectile.AddComponent(); ((ProjectileExplosion)val4).blastRadius = 8f; ((ProjectileExplosion)val4).blastDamageCoefficient = 1f; ((ProjectileExplosion)val4).blastProcCoefficient = 1f; ((ProjectileExplosion)val4).falloffModel = (FalloffModel)1; val4.destroyOnEnemy = true; val4.destroyOnWorld = true; val4.timerAfterImpact = false; ((ProjectileExplosion)val4).fireChildren = false; val4.explodeOnLifeTimeExpiration = true; val4.impactEffect = (Object.op_Implicit((Object)(object)longbowExplosionEffect) ? longbowExplosionEffect : hellfireExplosionEffect); ((ProjectileExplosion)val4).blastImpactEffect = null; val4.lifetimeExpiredSound = Content.CreateAndAddNetworkSoundEventDef("Play_commando_M2_grenade_explo"); val4.offsetForLifetimeExpiredSound = 0f; if (val4.lifetime <= 0f) { val4.lifetime = 15f; } } private static GameObject CreateFlatFlyingRocket(string newPrefabName, float speed, float lifetime) { GameObject val = Asset.CloneProjectilePrefab("CommandoGrenadeProjectile", newPrefabName); if (!Object.op_Implicit((Object)(object)val)) { Log.Error("Failed to clone CommandoGrenadeProjectile for " + newPrefabName + ". That skill will not fire."); return null; } Rigidbody component = val.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.useGravity = false; } ApplyTorqueOnStart component2 = val.GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { Object.Destroy((Object)(object)component2); } ProjectileSimple val2 = val.GetComponent(); if (!Object.op_Implicit((Object)(object)val2)) { val2 = val.AddComponent(); } val2.desiredForwardSpeed = speed; val2.lifetime = lifetime; val2.updateAfterFiring = true; return val; } private static void CreateHellfireProjectile() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) hellfireProjectilePrefab = CreateFlatFlyingRocket("AH64HellfireProjectile", 140f, 6f); if (Object.op_Implicit((Object)(object)hellfireProjectilePrefab)) { Object.Destroy((Object)(object)hellfireProjectilePrefab.GetComponent()); ProjectileImpactExplosion obj = hellfireProjectilePrefab.AddComponent(); ((ProjectileExplosion)obj).blastRadius = 12f; ((ProjectileExplosion)obj).blastDamageCoefficient = 1f; ((ProjectileExplosion)obj).falloffModel = (FalloffModel)0; obj.destroyOnEnemy = true; obj.destroyOnWorld = true; obj.lifetime = 6f; obj.impactEffect = hellfireExplosionEffect; obj.lifetimeExpiredSound = Content.CreateAndAddNetworkSoundEventDef("Play_clayboss_M1_explo"); obj.timerAfterImpact = false; ProjectileController component = hellfireProjectilePrefab.GetComponent(); if ((Object)(object)_assetBundle.LoadAsset("AH64HellfireGhost") != (Object)null) { component.ghostPrefab = _assetBundle.CreateProjectileGhostPrefab("AH64HellfireGhost"); } component.startSound = ""; component.procCoefficient = 1f; } } private static void CreateHydraRocketProjectile() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) hydraRocketProjectilePrefab = CreateFlatFlyingRocket("AH64HydraRocketProjectile", 120f, 3f); if (Object.op_Implicit((Object)(object)hydraRocketProjectilePrefab)) { Object.Destroy((Object)(object)hydraRocketProjectilePrefab.GetComponent()); ProjectileImpactExplosion obj = hydraRocketProjectilePrefab.AddComponent(); ((ProjectileExplosion)obj).blastRadius = 5f; ((ProjectileExplosion)obj).blastDamageCoefficient = 1f; ((ProjectileExplosion)obj).falloffModel = (FalloffModel)0; obj.destroyOnEnemy = true; obj.destroyOnWorld = true; obj.lifetime = 3f; if (!Object.op_Implicit((Object)(object)hydraExplosionEffect)) { Log.Error("AH64HydraExplosion failed to build; Hydra impacts will have no VFX."); } obj.impactEffect = hydraExplosionEffect; ((ProjectileExplosion)obj).blastImpactEffect = null; ((ProjectileExplosion)obj).fireChildren = false; obj.timerAfterImpact = false; ProjectileController component = hydraRocketProjectilePrefab.GetComponent(); GameObject val = CreateHydraRocketGhost(); if (Object.op_Implicit((Object)(object)val)) { component.ghostPrefab = val; } else if ((Object)(object)_assetBundle.LoadAsset("AH64HellfireGhost") != (Object)null) { component.ghostPrefab = _assetBundle.CreateProjectileGhostPrefab("AH64HellfireGhost"); } component.startSound = ""; component.procCoefficient = 0.5f; } } } public static class AH64Buffs { public static BuffDef platingBuff; public static BuffDef radarPaintedBuff; public static void Init(AssetBundle assetBundle) { //IL_0014: 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) platingBuff = Content.CreateAndAddBuff("AH64PlatingBuff", LegacyResourcesAPI.Load("BuffDefs/HiddenInvincibility").iconSprite, Color.white, canStack: false, isDebuff: false); Sprite val = null; if (Object.op_Implicit((Object)(object)Equipment.Scanner)) { val = Equipment.Scanner.pickupIconSprite; } if (!Object.op_Implicit((Object)(object)val)) { BuffDef val2 = LegacyResourcesAPI.Load("BuffDefs/Cloak"); if (Object.op_Implicit((Object)(object)val2)) { val = val2.iconSprite; } } radarPaintedBuff = Content.CreateAndAddBuff("AH64RadarPainted", val, new Color(1f, 0.22f, 0.15f), canStack: false, isDebuff: true); } } public class AH64ItemDisplays : ItemDisplaysBase { protected override void SetItemDisplayRules(List itemDisplayRules) { //IL_001f: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_013b: 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_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0196: 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_01c9: 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_01e7: 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_0224: 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_0257: 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_0275: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_034a: 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_0387: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03d8: Unknown result type (might be due to invalid IL or missing references) //IL_0401: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_0448: Unknown result type (might be due to invalid IL or missing references) //IL_045c: Unknown result type (might be due to invalid IL or missing references) //IL_0466: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_04a3: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_04d6: Unknown result type (might be due to invalid IL or missing references) //IL_04ea: Unknown result type (might be due to invalid IL or missing references) //IL_04f4: Unknown result type (might be due to invalid IL or missing references) //IL_051d: Unknown result type (might be due to invalid IL or missing references) //IL_0531: Unknown result type (might be due to invalid IL or missing references) //IL_053b: Unknown result type (might be due to invalid IL or missing references) //IL_0564: Unknown result type (might be due to invalid IL or missing references) //IL_0578: Unknown result type (might be due to invalid IL or missing references) //IL_0582: Unknown result type (might be due to invalid IL or missing references) //IL_05ab: Unknown result type (might be due to invalid IL or missing references) //IL_05bf: Unknown result type (might be due to invalid IL or missing references) //IL_05c9: Unknown result type (might be due to invalid IL or missing references) //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_0606: Unknown result type (might be due to invalid IL or missing references) //IL_0610: Unknown result type (might be due to invalid IL or missing references) //IL_0639: Unknown result type (might be due to invalid IL or missing references) //IL_064d: Unknown result type (might be due to invalid IL or missing references) //IL_0657: Unknown result type (might be due to invalid IL or missing references) //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_0694: Unknown result type (might be due to invalid IL or missing references) //IL_069e: Unknown result type (might be due to invalid IL or missing references) //IL_06c7: Unknown result type (might be due to invalid IL or missing references) //IL_06db: Unknown result type (might be due to invalid IL or missing references) //IL_06e5: Unknown result type (might be due to invalid IL or missing references) //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0722: Unknown result type (might be due to invalid IL or missing references) //IL_072c: Unknown result type (might be due to invalid IL or missing references) //IL_0755: Unknown result type (might be due to invalid IL or missing references) //IL_0769: Unknown result type (might be due to invalid IL or missing references) //IL_0773: Unknown result type (might be due to invalid IL or missing references) //IL_079c: Unknown result type (might be due to invalid IL or missing references) //IL_07b0: Unknown result type (might be due to invalid IL or missing references) //IL_07ba: Unknown result type (might be due to invalid IL or missing references) //IL_07e3: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_0801: Unknown result type (might be due to invalid IL or missing references) //IL_082a: Unknown result type (might be due to invalid IL or missing references) //IL_083e: Unknown result type (might be due to invalid IL or missing references) //IL_0848: Unknown result type (might be due to invalid IL or missing references) //IL_0871: Unknown result type (might be due to invalid IL or missing references) //IL_0885: Unknown result type (might be due to invalid IL or missing references) //IL_088f: Unknown result type (might be due to invalid IL or missing references) //IL_08b8: Unknown result type (might be due to invalid IL or missing references) //IL_08cc: Unknown result type (might be due to invalid IL or missing references) //IL_08d6: Unknown result type (might be due to invalid IL or missing references) //IL_08ff: Unknown result type (might be due to invalid IL or missing references) //IL_0913: Unknown result type (might be due to invalid IL or missing references) //IL_091d: Unknown result type (might be due to invalid IL or missing references) //IL_0946: Unknown result type (might be due to invalid IL or missing references) //IL_095a: Unknown result type (might be due to invalid IL or missing references) //IL_0964: Unknown result type (might be due to invalid IL or missing references) //IL_098d: Unknown result type (might be due to invalid IL or missing references) //IL_09a1: Unknown result type (might be due to invalid IL or missing references) //IL_09ab: Unknown result type (might be due to invalid IL or missing references) //IL_09d4: Unknown result type (might be due to invalid IL or missing references) //IL_09e8: Unknown result type (might be due to invalid IL or missing references) //IL_09f2: Unknown result type (might be due to invalid IL or missing references) //IL_0a1b: Unknown result type (might be due to invalid IL or missing references) //IL_0a2f: Unknown result type (might be due to invalid IL or missing references) //IL_0a39: Unknown result type (might be due to invalid IL or missing references) //IL_0a62: Unknown result type (might be due to invalid IL or missing references) //IL_0a76: Unknown result type (might be due to invalid IL or missing references) //IL_0a80: Unknown result type (might be due to invalid IL or missing references) //IL_0aa9: Unknown result type (might be due to invalid IL or missing references) //IL_0abd: Unknown result type (might be due to invalid IL or missing references) //IL_0ac7: Unknown result type (might be due to invalid IL or missing references) //IL_0af0: Unknown result type (might be due to invalid IL or missing references) //IL_0b04: Unknown result type (might be due to invalid IL or missing references) //IL_0b0e: Unknown result type (might be due to invalid IL or missing references) //IL_0b37: Unknown result type (might be due to invalid IL or missing references) //IL_0b4b: Unknown result type (might be due to invalid IL or missing references) //IL_0b55: Unknown result type (might be due to invalid IL or missing references) //IL_0b7e: Unknown result type (might be due to invalid IL or missing references) //IL_0b92: Unknown result type (might be due to invalid IL or missing references) //IL_0b9c: Unknown result type (might be due to invalid IL or missing references) //IL_0bc5: Unknown result type (might be due to invalid IL or missing references) //IL_0bd9: Unknown result type (might be due to invalid IL or missing references) //IL_0be3: Unknown result type (might be due to invalid IL or missing references) //IL_0c0c: Unknown result type (might be due to invalid IL or missing references) //IL_0c20: Unknown result type (might be due to invalid IL or missing references) //IL_0c2a: Unknown result type (might be due to invalid IL or missing references) //IL_0c53: Unknown result type (might be due to invalid IL or missing references) //IL_0c67: Unknown result type (might be due to invalid IL or missing references) //IL_0c71: Unknown result type (might be due to invalid IL or missing references) //IL_0c9a: Unknown result type (might be due to invalid IL or missing references) //IL_0cae: Unknown result type (might be due to invalid IL or missing references) //IL_0cb8: Unknown result type (might be due to invalid IL or missing references) //IL_0ce1: Unknown result type (might be due to invalid IL or missing references) //IL_0cf5: Unknown result type (might be due to invalid IL or missing references) //IL_0cff: Unknown result type (might be due to invalid IL or missing references) //IL_0d28: Unknown result type (might be due to invalid IL or missing references) //IL_0d3c: Unknown result type (might be due to invalid IL or missing references) //IL_0d46: Unknown result type (might be due to invalid IL or missing references) //IL_0d6f: Unknown result type (might be due to invalid IL or missing references) //IL_0d83: Unknown result type (might be due to invalid IL or missing references) //IL_0d8d: Unknown result type (might be due to invalid IL or missing references) //IL_0db6: Unknown result type (might be due to invalid IL or missing references) //IL_0dca: Unknown result type (might be due to invalid IL or missing references) //IL_0dd4: Unknown result type (might be due to invalid IL or missing references) //IL_0dfd: Unknown result type (might be due to invalid IL or missing references) //IL_0e11: Unknown result type (might be due to invalid IL or missing references) //IL_0e1b: Unknown result type (might be due to invalid IL or missing references) //IL_0e44: Unknown result type (might be due to invalid IL or missing references) //IL_0e58: Unknown result type (might be due to invalid IL or missing references) //IL_0e62: Unknown result type (might be due to invalid IL or missing references) Add(itemDisplayRules, "CritGlasses", "DisplayGlasses", "Head", new Vector3(0f, 0.05f, 0.12f), new Vector3(0f, 0f, 0f), S(0.28f)); Add(itemDisplayRules, "CritGlassesVoid", "DisplayGlassesVoid", "Head", new Vector3(0f, 0.05f, 0.12f), new Vector3(0f, 0f, 0f), S(0.28f)); Add(itemDisplayRules, "AttackSpeedOnCrit", "DisplayWolfPelt", "Head", new Vector3(0f, 0.18f, -0.05f), new Vector3(-20f, 0f, 0f), S(0.35f)); Add(itemDisplayRules, "Crowbar", "DisplayCrowbar", "Head", new Vector3(0.2f, 0f, 0.05f), new Vector3(0f, 90f, -20f), S(0.35f)); Add(itemDisplayRules, "AlienHead", "DisplayAlienHead", "NoseTip", new Vector3(0f, 0f, 0.05f), new Vector3(-90f, 0f, 0f), S(0.55f)); Add(itemDisplayRules, "BleedOnHit", "DisplayTriTip", "NoseTip", new Vector3(0f, -0.08f, 0f), new Vector3(0f, 0f, 0f), S(0.4f)); Add(itemDisplayRules, "BleedOnHitVoid", "DisplayTriTipVoid", "NoseTip", new Vector3(0f, -0.08f, 0f), new Vector3(0f, 0f, 0f), S(0.4f)); Add(itemDisplayRules, "NearbyDamageBonus", "DisplayDiamond", "NoseTip", new Vector3(0f, 0.06f, 0.02f), new Vector3(0f, 0f, 0f), S(0.2f)); Add(itemDisplayRules, "Bear", "DisplayBear", "Chest", new Vector3(-0.45f, 0.05f, 0.35f), new Vector3(0f, 90f, 0f), S(0.22f)); Add(itemDisplayRules, "BearVoid", "DisplayBearVoid", "Chest", new Vector3(0.45f, 0.05f, 0.35f), new Vector3(0f, -90f, 0f), S(0.22f)); Add(itemDisplayRules, "ArmorPlate", "DisplayRepulsionArmorPlate", "Chest", new Vector3(-0.55f, 0f, 0f), new Vector3(0f, 90f, 0f), S(0.4f)); Add(itemDisplayRules, "BarrierOnOverHeal", "DisplayAegis", "Chest", new Vector3(0.55f, 0.05f, 0.1f), new Vector3(0f, -90f, 0f), S(0.28f)); Add(itemDisplayRules, "BarrierOnKill", "DisplayBrooch", "Chest", new Vector3(0f, 0.15f, 0.55f), new Vector3(-90f, 0f, 0f), S(0.35f)); Add(itemDisplayRules, "PersonalShield", "DisplayShieldGenerator", "Chest", new Vector3(0f, -0.15f, 0.1f), new Vector3(0f, 0f, 0f), S(0.2f)); Add(itemDisplayRules, "Infusion", "DisplayInfusion", "Chest", new Vector3(0.35f, 0.1f, -0.2f), new Vector3(0f, 0f, 0f), S(0.35f)); Add(itemDisplayRules, "Medkit", "DisplayMedkit", "Chest", new Vector3(-0.35f, 0.05f, -0.25f), new Vector3(0f, 90f, 0f), S(0.35f)); Add(itemDisplayRules, "Bandolier", "DisplayBandolier", "Chest", new Vector3(0f, 0.05f, 0f), new Vector3(-90f, 0f, 0f), S(0.35f)); Add(itemDisplayRules, "FlatHealth", "DisplaySteakCurved", "Chest", new Vector3(0.4f, -0.05f, 0.25f), new Vector3(0f, 0f, 0f), S(0.18f)); Add(itemDisplayRules, "Knurl", "DisplayKnurl", "Chest", new Vector3(-0.25f, 0.2f, -0.1f), new Vector3(0f, 0f, 0f), S(0.12f)); Add(itemDisplayRules, "Pearl", "DisplayPearl", "Chest", new Vector3(0.2f, 0.22f, 0.2f), new Vector3(0f, 0f, 0f), S(0.12f)); Add(itemDisplayRules, "ShinyPearl", "DisplayShinyPearl", "Chest", new Vector3(-0.15f, 0.22f, 0.25f), new Vector3(0f, 0f, 0f), S(0.12f)); Add(itemDisplayRules, "Behemoth", "DisplayBehemoth", "WingR", new Vector3(0f, -0.12f, 0f), new Vector3(0f, 0f, 0f), S(0.18f)); Add(itemDisplayRules, "Missile", "DisplayMissileLauncher", "WingL", new Vector3(0f, -0.1f, 0.05f), new Vector3(0f, 0f, 90f), S(0.12f)); Add(itemDisplayRules, "MissileVoid", "DisplayMissileLauncherVoid", "WingL", new Vector3(0f, -0.1f, -0.1f), new Vector3(0f, 0f, 90f), S(0.12f)); Add(itemDisplayRules, "MoreMissile", "DisplayICBM", "WingR", new Vector3(0.05f, -0.08f, 0.1f), new Vector3(0f, 0f, 0f), S(0.15f)); Add(itemDisplayRules, "BossDamageBonus", "DisplayAPRound", "WingR", new Vector3(0f, -0.05f, -0.15f), new Vector3(0f, 0f, 0f), S(0.35f)); Add(itemDisplayRules, "Firework", "DisplayFirework", "WingL", new Vector3(0f, -0.05f, 0.15f), new Vector3(0f, 0f, 0f), S(0.25f)); Add(itemDisplayRules, "ExplodeOnDeath", "DisplayWilloWisp", "WingR", new Vector3(0.1f, -0.15f, 0f), new Vector3(0f, 0f, 0f), S(0.12f)); Add(itemDisplayRules, "ExplodeOnDeathVoid", "DisplayWillowWispVoid", "WingR", new Vector3(0.1f, -0.15f, -0.12f), new Vector3(0f, 0f, 0f), S(0.12f)); Add(itemDisplayRules, "ChainLightning", "DisplayUkulele", "WingL", new Vector3(0f, 0.05f, 0f), new Vector3(0f, 90f, 40f), S(0.35f)); Add(itemDisplayRules, "FireballsOnHit", "DisplayFireballsOnHit", "WingR", new Vector3(0f, -0.18f, 0.05f), new Vector3(0f, 0f, 0f), S(0.12f)); Add(itemDisplayRules, "LightningStrikeOnHit", "DisplayChargedPerforator", "WingL", new Vector3(0f, -0.18f, -0.05f), new Vector3(0f, 0f, 0f), S(0.18f)); Add(itemDisplayRules, "PrimarySkillShuriken", "DisplayShuriken", "WingL", new Vector3(0.05f, 0.08f, 0f), new Vector3(0f, 0f, 0f), S(0.3f)); Add(itemDisplayRules, "LaserTurbine", "DisplayLaserTurbine", "WingR", new Vector3(0f, 0.1f, 0f), new Vector3(0f, 0f, 0f), S(0.2f)); Add(itemDisplayRules, "GoldGat", "DisplayGoldGat", "WingR", new Vector3(0.15f, 0.05f, 0.1f), new Vector3(0f, -90f, 40f), S(0.12f)); Add(itemDisplayRules, "Clover", "DisplayClover", "TailTip", new Vector3(0f, -0.1f, 0f), new Vector3(0f, 0f, 0f), S(0.35f)); Add(itemDisplayRules, "CloverVoid", "DisplayCloverVoid", "TailTip", new Vector3(0.08f, -0.1f, 0f), new Vector3(0f, 0f, 0f), S(0.35f)); Add(itemDisplayRules, "ExtraLife", "DisplayHippo", "TailTip", new Vector3(0f, -0.2f, 0.05f), new Vector3(0f, 0f, 0f), S(0.2f)); Add(itemDisplayRules, "ExtraLifeVoid", "DisplayHippoVoid", "TailTip", new Vector3(0f, -0.2f, -0.05f), new Vector3(0f, 0f, 0f), S(0.2f)); Add(itemDisplayRules, "Feather", "DisplayFeather", "TailTip", new Vector3(-0.1f, 0.05f, 0f), new Vector3(0f, 0f, 20f), S(0.2f)); Add(itemDisplayRules, "Icicle", "DisplayFrostRelic", "TailTip", new Vector3(0f, 0.12f, 0f), new Vector3(0f, 0f, 0f), S(0.2f)); Add(itemDisplayRules, "BleedOnHitAndExplode", "DisplayBleedOnHitAndExplode", "TailTip", new Vector3(0.12f, -0.05f, 0f), new Vector3(0f, 0f, 0f), S(0.12f)); Add(itemDisplayRules, "CommandMissile", "DisplayMissileRack", "WingL", new Vector3(0f, -0.22f, 0f), new Vector3(0f, 0f, 0f), S(0.35f)); Add(itemDisplayRules, "Blackhole", "DisplayGravCube", "Chest", new Vector3(0f, -0.35f, -0.15f), new Vector3(0f, 0f, 0f), S(0.35f)); Add(itemDisplayRules, "BFG", "DisplayBFG", "WingR", new Vector3(0.1f, -0.25f, 0f), new Vector3(0f, 0f, 0f), S(0.3f)); Add(itemDisplayRules, "QuestVolatileBattery", "DisplayBatteryArray", "Chest", new Vector3(0f, 0.05f, -0.55f), new Vector3(0f, 0f, 0f), S(0.25f)); Add(itemDisplayRules, "Recycle", "DisplayRecycler", "Chest", new Vector3(-0.5f, -0.1f, -0.2f), new Vector3(0f, 90f, 0f), S(0.12f)); Add(itemDisplayRules, "Cleanse", "DisplayWaterPack", "Chest", new Vector3(0.45f, -0.05f, -0.35f), new Vector3(0f, 0f, 0f), S(0.2f)); Add(itemDisplayRules, "TeamWarCry", "DisplayTeamWarCry", "Head", new Vector3(0f, 0.25f, -0.15f), new Vector3(0f, 0f, 0f), S(0.12f)); Add(itemDisplayRules, "DeathMark", "DisplayDeathMark", "NoseTip", new Vector3(0.12f, 0f, 0f), new Vector3(0f, 0f, 0f), S(0.08f)); Add(itemDisplayRules, "LifestealOnHit", "DisplayLifestealOnHit", "Chest", new Vector3(-0.4f, 0.15f, 0.15f), new Vector3(0f, 0f, 0f), S(0.12f)); Add(itemDisplayRules, "Jetpack", "DisplayBugWings", "Chest", new Vector3(0f, 0.25f, -0.3f), new Vector3(0f, 0f, 0f), S(0.15f)); } private static Vector3 S(float s) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) return new Vector3(s, s, s); } private static void Add(List rules, string keyAssetName, string displayPrefabName, string childName, Vector3 localPos, Vector3 localAngles, Vector3 localScale) { //IL_000c: 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_0010: 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_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) rules.Add(ItemDisplays.CreateDisplayRuleGroupWithRules(keyAssetName, ItemDisplays.CreateDisplayRule(displayPrefabName, childName, localPos, localAngles, localScale))); } } internal static class AH64PlaytestConfig { private const string Movement = "AH-64 Playtest - Movement"; private const string Chaingun = "AH-64 Playtest - M230"; private const string Gatling = "AH-64 Playtest - XM301 Gatling"; private const string Cannon = "AH-64 Playtest - M789 Cannon"; private const string Utility = "AH-64 Playtest - Utility"; private const string Presentation = "AH-64 Playtest - Presentation"; private static ConfigEntry baseMoveSpeed; private static ConfigEntry acceleration; private static ConfigEntry radarFacingSpeedBonus; private static ConfigEntry chaingunDamage; private static ConfigEntry chaingunMaxSpread; private static ConfigEntry chaingunBloom; private static ConfigEntry chaingunReload; private static ConfigEntry chaingunSplashDamage; private static ConfigEntry chaingunSplashRadius; private static ConfigEntry chaingunSplashVfxScale; private static ConfigEntry gatlingDamage; private static ConfigEntry gatlingSpooledDuration; private static ConfigEntry gatlingMaxSpread; private static ConfigEntry gatlingBloom; private static ConfigEntry gatlingReload; private static ConfigEntry gatlingSplashDamage; private static ConfigEntry gatlingSplashRadius; private static ConfigEntry gatlingSplashVfxScale; private static ConfigEntry cannonDamage; private static ConfigEntry cannonDuration; private static ConfigEntry cannonReload; private static ConfigEntry cannonSplashDamage; private static ConfigEntry cannonSplashRadius; private static ConfigEntry cannonSplashVfxScale; private static ConfigEntry dashCooldown; private static ConfigEntry dashPeakSpeed; private static ConfigEntry dashClimbHeight; private static ConfigEntry dashRampFraction; private static ConfigEntry rotorWashEnabled; private static ConfigEntry rotorHoverVolume; private static ConfigEntry rotorInFlightVolume; private static ConfigEntry rotorClimbVolume; internal static float BaseMoveSpeed => baseMoveSpeed.Value; internal static float Acceleration => acceleration.Value; internal static float RadarFacingSpeedBonus => radarFacingSpeedBonus.Value; internal static float ChaingunDamage => chaingunDamage.Value; internal static float ChaingunMaxSpread => chaingunMaxSpread.Value; internal static float ChaingunBloom => chaingunBloom.Value; internal static float ChaingunReload => chaingunReload.Value; internal static float ChaingunSplashDamage => chaingunSplashDamage.Value; internal static float ChaingunSplashRadius => chaingunSplashRadius.Value; internal static float ChaingunSplashVfxScale => chaingunSplashVfxScale.Value; internal static float GatlingDamage => gatlingDamage.Value; internal static float GatlingSpooledDuration => gatlingSpooledDuration.Value; internal static float GatlingMaxSpread => gatlingMaxSpread.Value; internal static float GatlingBloom => gatlingBloom.Value; internal static float GatlingReload => gatlingReload.Value; internal static float GatlingSplashDamage => gatlingSplashDamage.Value; internal static float GatlingSplashRadius => gatlingSplashRadius.Value; internal static float GatlingSplashVfxScale => gatlingSplashVfxScale.Value; internal static float CannonDamage => cannonDamage.Value; internal static float CannonDuration => cannonDuration.Value; internal static float CannonReload => cannonReload.Value; internal static float CannonSplashDamage => cannonSplashDamage.Value; internal static float CannonSplashRadius => cannonSplashRadius.Value; internal static float CannonSplashVfxScale => cannonSplashVfxScale.Value; internal static float DashCooldown => dashCooldown.Value; internal static float DashPeakSpeed => dashPeakSpeed.Value; internal static float DashClimbHeight => dashClimbHeight.Value; internal static float DashRampFraction => dashRampFraction.Value; internal static bool RotorWashEnabled => rotorWashEnabled.Value; internal static float RotorHoverVolume => rotorHoverVolume.Value; internal static float RotorInFlightVolume => rotorInFlightVolume.Value; internal static float RotorClimbVolume => rotorClimbVolume.Value; internal static void Init(ConfigFile config) { baseMoveSpeed = Bind(config, "AH-64 Playtest - Movement", "Base speed", 10f, 7f, 14f, "Horizontal cruise speed. Test this before changing hover mechanics."); acceleration = Bind(config, "AH-64 Playtest - Movement", "Acceleration", 110f, 60f, 180f, "How quickly the helicopter starts, stops, and reverses while hovering."); radarFacingSpeedBonus = Bind(config, "AH-64 Playtest - Movement", "Radar facing speed bonus", 0.15f, 0f, 0.35f, "Extra movement multiplier while facing the painted target (0.15 = +15%)."); chaingunDamage = Bind(config, "AH-64 Playtest - M230", "Direct damage coefficient", 0.62f, 0.3f, 1f, "Per-round direct damage. Keep the cadence and proc coefficient unchanged while testing."); chaingunMaxSpread = Bind(config, "AH-64 Playtest - M230", "Maximum spread", 2.25f, 0.5f, 5f, "Maximum held-fire spread in degrees."); chaingunBloom = Bind(config, "AH-64 Playtest - M230", "Spread bloom", 0.08f, 0f, 0.25f, "Spread added per M230 round."); chaingunReload = Bind(config, "AH-64 Playtest - M230", "Drum reload seconds", 1.7f, 0.5f, 4f, "Time to refill the 30-round drum after firing stops or it empties."); chaingunSplashDamage = Bind(config, "AH-64 Playtest - M230", "HE splash coefficient", 0.34f, 0f, 0.75f, "Damage at the centre of each 30mm HE impact. Splash proc remains hard-locked at zero."); chaingunSplashRadius = Bind(config, "AH-64 Playtest - M230", "HE splash radius", 6f, 0f, 12f, "World-space radius of each 30mm HE impact."); chaingunSplashVfxScale = Bind(config, "AH-64 Playtest - M230", "HE impact visual scale", 2.5f, 0.5f, 5f, "Visual-only size of the 30mm impact flash and dust. Does not change damage or radius."); gatlingDamage = Bind(config, "AH-64 Playtest - XM301 Gatling", "Direct damage coefficient", 0.39f, 0.1f, 0.6f, "Per-round direct damage at any spool speed. Well under the M230's by design — the gatling trades weight per round for rate."); gatlingSpooledDuration = Bind(config, "AH-64 Playtest - XM301 Gatling", "Seconds per round at full spool", 0.055f, 0.03f, 0.1f, "Lower is faster. 0.055 is ~18 rounds/sec. The cold rate ramps up to this over the spool."); gatlingMaxSpread = Bind(config, "AH-64 Playtest - XM301 Gatling", "Maximum spread", 3.4f, 0.5f, 6f, "Maximum held-fire spread in degrees. Wider than the M230 on purpose."); gatlingBloom = Bind(config, "AH-64 Playtest - XM301 Gatling", "Spread bloom", 0.055f, 0f, 0.25f, "Spread added per round."); gatlingReload = Bind(config, "AH-64 Playtest - XM301 Gatling", "Drum reload seconds", 2.4f, 0.5f, 5f, "Time to refill the 60-round drum after firing stops or it empties."); gatlingSplashDamage = Bind(config, "AH-64 Playtest - XM301 Gatling", "Splash coefficient", 0.135f, 0f, 0.4f, "Damage at the centre of each impact. Splash proc remains hard-locked at zero."); gatlingSplashRadius = Bind(config, "AH-64 Playtest - XM301 Gatling", "Splash radius", 3.2f, 0f, 8f, "World-space radius of each impact. Much smaller than the M230's; the cadence is far higher."); gatlingSplashVfxScale = Bind(config, "AH-64 Playtest - XM301 Gatling", "Impact visual scale", 1f, 0.3f, 4f, "Visual-only size of the impact flash. Does not change damage or radius."); cannonDamage = Bind(config, "AH-64 Playtest - M789 Cannon", "Direct damage coefficient", 2.9f, 1f, 5f, "Per-round direct damage. Very high — there are only 8 of them and every miss costs."); cannonDuration = Bind(config, "AH-64 Playtest - M789 Cannon", "Seconds per round", 0.4f, 0.2f, 1f, "Lower is faster. 0.40 is 2.5 rounds/sec. Drop this far and it stops reading as a cannon and starts competing with Hydra."); cannonReload = Bind(config, "AH-64 Playtest - M789 Cannon", "Drum reload seconds", 2.8f, 1f, 6f, "Time to refill the 8-round drum after firing stops or it empties."); cannonSplashDamage = Bind(config, "AH-64 Playtest - M789 Cannon", "Splash coefficient", 1f, 0f, 2f, "Damage at the centre of each blast. This is where the cannon beats the other two primaries against packs. Splash proc remains hard-locked at zero."); cannonSplashRadius = Bind(config, "AH-64 Playtest - M789 Cannon", "Splash radius", 9f, 0f, 16f, "World-space radius of each blast. The largest of the three primaries."); cannonSplashVfxScale = Bind(config, "AH-64 Playtest - M789 Cannon", "Impact visual scale", 2.2f, 0.5f, 5f, "Visual-only size of the impact. Does not change damage or radius."); dashCooldown = Bind(config, "AH-64 Playtest - Utility", "Evasive Roll cooldown", 4f, 1f, 10f, "Seconds between Evasive Rolls."); dashPeakSpeed = Bind(config, "AH-64 Playtest - Utility", "Evasive Roll peak speed multiplier", 2.35f, 1f, 4f, "Peak horizontal speed relative to the speed at roll entry."); dashClimbHeight = Bind(config, "AH-64 Playtest - Utility", "Evasive Roll climb height", 10f, 0f, 12f, "Net altitude gained by the roll. Keep this below the collective ceiling."); dashRampFraction = Bind(config, "AH-64 Playtest - Utility", "Evasive Roll peak ramp", 0.28f, 0.1f, 0.6f, "Fraction of the roll spent building to peak speed. Lower values bite sooner."); rotorWashEnabled = config.Bind("AH-64 Playtest - Presentation", "Low-hover rotor wash", true, "Enable restrained rotor wash while near the ground, including stationary hover."); rotorHoverVolume = Bind(config, "AH-64 Playtest - Presentation", "Grounded rotor volume", 0.75f, 0f, 1f, "Volume of the CC0 grounded rotor bed. It should sit under combat, not dominate it."); rotorInFlightVolume = Bind(config, "AH-64 Playtest - Presentation", "In-flight rotor volume", 0.42f, 0f, 1f, "Peak volume of the fuller engine+rotor layer, reached at full horizontal speed."); rotorClimbVolume = Bind(config, "AH-64 Playtest - Presentation", "Climb rotor volume", 0.07f, 0f, 1f, "Peak volume of the collective/climb layer, reached at full ascent intent."); AH64RiskOfOptions.Register(baseMoveSpeed, acceleration, radarFacingSpeedBonus, chaingunDamage, chaingunMaxSpread, chaingunBloom, chaingunReload, chaingunSplashDamage, chaingunSplashRadius, chaingunSplashVfxScale, dashCooldown, dashPeakSpeed, dashClimbHeight, dashRampFraction, rotorWashEnabled, rotorHoverVolume, rotorInFlightVolume, rotorClimbVolume); } private static ConfigEntry Bind(ConfigFile config, string section, string name, float value, float min, float max, string description) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown return config.Bind(section, name, value, new ConfigDescription(description, (AcceptableValueBase)(object)new AcceptableValueRange(min, max), Array.Empty())); } } internal static class AH64RiskOfOptions { private const string PluginGuid = "com.rune580.riskofoptions"; internal static void Register(ConfigEntry baseMoveSpeed, ConfigEntry acceleration, ConfigEntry radarFacingSpeedBonus, ConfigEntry chaingunDamage, ConfigEntry chaingunMaxSpread, ConfigEntry chaingunBloom, ConfigEntry chaingunReload, ConfigEntry chaingunSplashDamage, ConfigEntry chaingunSplashRadius, ConfigEntry chaingunSplashVfxScale, ConfigEntry dashCooldown, ConfigEntry dashPeakSpeed, ConfigEntry dashClimbHeight, ConfigEntry dashRampFraction, ConfigEntry rotorWashEnabled, ConfigEntry rotorHoverVolume, ConfigEntry rotorInFlightVolume, ConfigEntry rotorClimbVolume) { if (!Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions")) { return; } try { RegisterSlider(baseMoveSpeed, 7f, 14f); RegisterSlider(acceleration, 60f, 180f, "{0:0}"); RegisterSlider(radarFacingSpeedBonus, 0f, 0.35f, "{0:0%}"); RegisterSlider(chaingunDamage, 0.3f, 1f); RegisterSlider(chaingunMaxSpread, 0.5f, 5f); RegisterSlider(chaingunBloom, 0f, 0.25f); RegisterSlider(chaingunReload, 0.5f, 4f); RegisterSlider(chaingunSplashDamage, 0f, 0.75f); RegisterSlider(chaingunSplashRadius, 0f, 12f); RegisterSlider(chaingunSplashVfxScale, 0.5f, 3f); RegisterSlider(dashCooldown, 1f, 10f); RegisterSlider(dashPeakSpeed, 1f, 4f); RegisterSlider(dashClimbHeight, 0f, 12f); RegisterSlider(dashRampFraction, 0.1f, 0.6f); RegisterToggle(rotorWashEnabled); RegisterSlider(rotorHoverVolume, 0f, 0.15f); RegisterSlider(rotorInFlightVolume, 0f, 0.15f); RegisterSlider(rotorClimbVolume, 0f, 0.15f); } catch (Exception ex) { Log.Warning("AH-64 could not register Risk Of Options playtest controls: " + ex.Message); } } private static void RegisterSlider(ConfigEntry entry, float min, float max, string format = "{0:0.00}") { Type? type = Type.GetType("RiskOfOptions.OptionConfigs.SliderConfig, RiskOfOptions"); Type type2 = Type.GetType("RiskOfOptions.Options.SliderOption, RiskOfOptions"); object obj = Activator.CreateInstance(type); SetField(obj, "min", min); SetField(obj, "max", max); SetField(obj, "formatString", format); AddOption(Activator.CreateInstance(type2, entry, obj)); } private static void RegisterToggle(ConfigEntry entry) { Type? type = Type.GetType("RiskOfOptions.OptionConfigs.CheckBoxConfig, RiskOfOptions"); Type type2 = Type.GetType("RiskOfOptions.Options.CheckBoxOption, RiskOfOptions"); object obj = Activator.CreateInstance(type); AddOption(Activator.CreateInstance(type2, entry, obj)); } private static void AddOption(object option) { Type.GetType("RiskOfOptions.ModSettingsManager, RiskOfOptions").GetMethod("AddOption", new Type[3] { option.GetType().BaseType, typeof(string), typeof(string) }).Invoke(null, new object[3] { option, "com.JohnstonStu.AH64", "AH64" }); } private static void SetField(object instance, string name, object value) { instance.GetType().GetField(name).SetValue(instance, value); } } public static class AH64States { public static void Init() { Content.AddEntityState(typeof(AH64Main)); Content.AddEntityState(typeof(FireChaingun)); Content.AddEntityState(typeof(FireGatling)); Content.AddEntityState(typeof(FireCannon)); Content.AddEntityState(typeof(FireRocketPods)); Content.AddEntityState(typeof(ServoDash)); Content.AddEntityState(typeof(SmokeBackflip)); Content.AddEntityState(typeof(FireHellfire)); Content.AddEntityState(typeof(PaintLongbow)); Content.AddEntityState(typeof(FireLongbow)); } } public static class AH64StaticValues { public const float hoverHeight = 3f; public const float hoverStiffness = 6.5f; public const float hoverDamping = 1.15f; public const float hoverMaxClimbSpeed = 16f; public const float hoverMaxDescendSpeed = 14f; public const float hoverProbeDistance = 60f; public const float hoverProbeOriginLift = 0.5f; public const float voidDescendSpeed = 12f; public const float voidRecoveryDelay = 3f; public const float collectiveMaxRise = 10f; public const float collectiveRisePerExtraJump = 4f; public const float collectiveClimbRate = 14f; public const float collectiveSettleRate = 7f; public const float collectiveCrouchSettleMult = 2.2f; public const float collectiveLead = 5f; public const float collectiveAscentNosePitch = -16f; public const float collectiveDescentNosePitch = 8f; public const float collectivePitchSmoothTime = 0.18f; public const float collectiveAscentLead = 5f; public const float collectiveAscentMaxClimbSpeed = 16f; public const float collectiveAscentCompleteSlack = 0.6f; public const float collectiveJumpFloatSettleMult = 1f; public const float collectiveAscentPitchFadeSpeed = 4f; public const float hoverSpawnGrace = 0.75f; public const float hoverProbeMissHold = 0.35f; public const float hoverAirControl = 1f; public const float interactionDistance = 12f; public const float leanMaxPitch = 14f; public const float leanMaxRoll = 20f; public const float leanInputBlend = 0.55f; public const float leanPitchPerSpeed = 0.5f; public const float leanRollPerSpeed = 0.85f; public const float leanClimbPitchPerSpeed = 0.4f; public const float leanPitchPerInput = 12f; public const float leanRollPerInput = 16f; public const float leanSmoothing = 7f; public const float rotorWashMaxHeight = 8f; public const float rotorWashInterval = 0.18f; public const float rotorWashIdleInterval = 0.45f; public const float rotorWashFullSpeed = 10f; public const float rotorWashScale = 1.35f; public const float rotorHoverVolume = 0.75f; public const float rotorHoverMinDistance = 20f; public const float rotorHoverMaxDistance = 70f; public const float rotorHoverDoppler = 0f; public const float rotorInFlightMaxVolume = 0.42f; public const float rotorClimbMaxVolume = 0.07f; public const float rotorLayerFadeTime = 0.6f; public const float rotorHoverPitch = 1.045f; public const float rotorInFlightPitch = 1.106f; public const float rotorClimbPitch = 1.02f; public const float rotorBlurFullSpeed = 14f; public const float rotorBlurCollectiveBoost = 0.55f; public const float rotorBlurMinEffort = 0.18f; public const float rotorBlurMaxAlpha = 0.17f; public const float rotorBlurSmoothing = 5f; public const float chinTurretTurnSpeed = 200f; public const float chinTurretMaxPitch = 35f; public const float chinTurretMinPitch = -30f; public const float chinTurretMaxYaw = 80f; public const float chinTurretMinYaw = -80f; public const float chinTurretKickDistance = 0.06f; public const float chinTurretKickRecoverPerSecond = 0.55f; public const float radarSearchRadius = 90f; public const float radarRetargetInterval = 8f; public const float radarPulseScale = 5.5f; public const float radarPaintPingScale = 1.6f; public const float radarDomeIdleSpinSpeed = 40f; public const float radarDomePaintedSpinSpeed = 140f; public const float radarDomeGlowIdle = 0.25f; public const float radarDomeGlowPainted = 0.55f; public const float radarPaintedDamageMult = 1.12f; public const float radarFacingMoveSpeedMult = 0.15f; public const float radarFacingDotMin = 0.65f; public const float radarCloseArmor = 60f; public const float radarCloseRange = 25f; public const float primaryReloadAttackSpeedMultiplier = 0.35f; public const float chaingunBaseDuration = 0.09f; public const float chaingunDamageCoefficient = 0.62f; public const float chaingunRange = 220f; public const float chaingunForce = 100f; public const float chaingunBulletRadius = 0.4f; public const float chaingunRecoil = 1f; public const float chaingunShakeDuration = 0.08f; public const float chaingunShakeRadius = 12f; public const float chaingunShakeAmplitude = 0.5f; public const float chaingunShakeFrequency = 22f; public const float chaingunSplashDamageCoefficient = 0.34f; public const float chaingunSplashRadius = 6f; public const float chaingunSplashProcCoefficient = 0f; public const float chaingunSplashForce = 40f; public const float chaingunSplashVfxScale = 2.5f; public const float chaingunSplashParticleMult = 0.42f; public const float chaingunProcCoefficient = 0.35f; public const float chaingunMinSpread = 0.5f; public const float chaingunMaxSpread = 2.25f; public const float chaingunSpreadBloom = 0.08f; public const int chaingunMagazineSize = 30; public const float chaingunReloadDuration = 1.7f; public const float gatlingDamageCoefficient = 0.39f; public const float gatlingRange = 190f; public const float gatlingForce = 55f; public const float gatlingBulletRadius = 0.35f; public const float gatlingRecoil = 0.45f; public const float gatlingSpooledDuration = 0.055f; public const float gatlingUnspooledDuration = 0.115f; public const float gatlingMinSpread = 0.9f; public const float gatlingMaxSpread = 3.4f; public const float gatlingSpreadBloom = 0.055f; public const float gatlingProcCoefficient = 0.2f; public const float gatlingSplashDamageCoefficient = 0.135f; public const float gatlingSplashRadius = 3.2f; public const float gatlingSplashProcCoefficient = 0f; public const float gatlingSplashForce = 18f; public const float gatlingSplashVfxScale = 1f; public const int gatlingMagazineSize = 60; public const float gatlingReloadDuration = 2.4f; public const float cannonDamageCoefficient = 2.9f; public const float cannonRange = 250f; public const float cannonForce = 900f; public const float cannonBulletRadius = 0.6f; public const float cannonRecoil = 4f; public const float cannonBaseDuration = 0.4f; public const float cannonMinSpread = 0.2f; public const float cannonMaxSpread = 0.8f; public const float cannonSpreadBloom = 0.35f; public const float cannonProcCoefficient = 1f; public const float cannonSplashDamageCoefficient = 1f; public const float cannonSplashRadius = 9f; public const float cannonSplashProcCoefficient = 0f; public const float cannonSplashForce = 400f; public const float cannonSplashVfxScale = 2.2f; public const float cannonShakeDuration = 0.18f; public const float cannonShakeRadius = 24f; public const float cannonShakeAmplitude = 1.6f; public const float cannonShakeFrequency = 14f; public const int cannonMagazineSize = 8; public const float cannonReloadDuration = 2.8f; public const int hydraRocketCount = 6; public const float hydraFireInterval = 0.1f; public const float hydraDamageCoefficient = 1.8f; public const float hydraReloadDuration = 5.5f; public const float hydraCooldown = 5.5f; public const float hydraBlastRadius = 5f; public const float hydraSpeed = 120f; public const float hydraLifetime = 3f; public const float hydraForce = 200f; public const float hydraExplosionVfxScale = 0.85f; public const float hydraExplosionParticleMult = 1.15f; public const float hydraGhostScale = 0.38f; public const float hydraProcCoefficient = 0.5f; public const float hydraSpreadAngle = 2.5f; public const float dashDuration = 0.95f; public const float dashCooldown = 4f; public const float dashRampFraction = 0.28f; public const float dashPeakSpeedMult = 2.35f; public const float dashExitCarry = 0.3f; public const float dashMinEntrySpeedFraction = 0.8f; public const float dashInitialSpeedCoefficient = 2.35f; public const float dashFinalSpeedCoefficient = 1.405f; public const float dashBarrelRollDegrees = 360f; public const float dashClimbHeight = 10f; public const float dashDiagonalBlend = 0.7f; public const float dashArmorBonus = 300f; public const float dashArmorDurationCoefficient = 3f; public const float dashInvincibilityDurationCoefficient = 0.5f; public const float dashFlareInterval = 0.38f; public const float dashFlareScale = 0.12f; public const float dashFlareTrailDistance = 1.1f; public const float dashFlareScatter = 0.35f; public const float backflipDuration = 1.65f; public const float backflipCooldown = 6.5f; public const float backflipRampFraction = 0.28f; public const float backflipPeakSpeedMult = 2.35f; public const float backflipExitCarry = 0.28f; public const float backflipMinEntrySpeedFraction = 0.75f; public const float backflipClimbHeight = 14f; public const float backflipPitchDegrees = 360f; public const float backflipCloakDuration = 2f; public const float backflipInvincibilityDurationCoefficient = 0.5f; public const float backflipSmokeInterval = 0.16f; public const float backflipSmokeScale = 1.55f; public const float hellfireDamageCoefficient = 13.5f; public const float hellfireCooldown = 8f; public const float hellfireBlastRadius = 12f; public const float hellfireSpeed = 140f; public const float hellfireLifetime = 6f; public const float hellfireProcCoefficient = 1f; public const int longbowMaxLocks = 6; public const float longbowDamageBase = 4f; public const float longbowDamagePerLock = 0.55f; public const float longbowDamageCoefficient = 5.375f; public const float longbowRechargeInterval = 3.5f; public const float longbowLockInterval = 0.25f; public const float longbowLockAngle = 20f; public const float longbowLockDistance = 150f; public const float longbowFireInterval = 0.15f; public const float longbowMaxPaintDuration = 12f; public const float longbowBlastRadius = 8f; } public static class AH64Tokens { public static void Init() { AddTokens(); } public static void AddTokens() { string text = "AH64_"; string text2 = "The AH-64 is a gunship that never lands, trading footspeed for altitude and a full weapons load." + Environment.NewLine + Environment.NewLine + "< ! > The M230 carries a fixed drum and reloads all at once — tap it at range to keep the burst tight, and hose the whole drum up close where the spread doesn't matter. The reload runs whether you emptied it or not, so top up before you commit." + Environment.NewLine + Environment.NewLine + "< ! > The rocket pods ripple over most of a second, so hold your aim through the salvo. They run on their own cooldown and stay available mid-reload." + Environment.NewLine + Environment.NewLine + "< ! > Evasive Roll is a climbing forward-diagonal barrel roll — stick snaps forward, left, or right with i-frames on the way through. Hold jump for altitude; hold move-down/back to dump height faster." + Environment.NewLine + Environment.NewLine + "< ! > Fire Control Radar paints the strongest nearby threat. Hold Longbow to paint locks while you keep firing the gun and Hydra; release to launch. Hellfire stays as a loadout variant." + Environment.NewLine + Environment.NewLine; string text3 = "..and so it left, airframe scorched, directives intact."; string text4 = "..and so it went down, another airframe lost to the Provinces."; string text5 = "Recovered airframe log, partial. Timestamps inconsistent." + Environment.NewLine + Environment.NewLine + "CYCLE 0041 — Escort detail, low pass over the wreck line. No contacts. Rotor bed nominal." + Environment.NewLine + Environment.NewLine + "CYCLE 0042 — Contact. Contact. Nothing in the threat library matches. Expended the drum, reloaded, expended it again. Radar kept painting new returns faster than the launcher could clear them." + Environment.NewLine + Environment.NewLine + "CYCLE 0058 — Requested relief. No response on any band. Requested landing clearance. No response." + Environment.NewLine + Environment.NewLine + "CYCLE 0061 — Field expedient: skids removed. Ninety kilos saved and nothing left to land on anyway. Endurance is no longer a fuel question." + Environment.NewLine + Environment.NewLine + "CYCLE 0103 — The gun runs. The pods run. The radar still finds the biggest thing on the field and holds onto it. Whatever the mission was, it has been replaced by the part of it that still works." + Environment.NewLine + Environment.NewLine + "Log continues. Entry count exceeds airframe rated service life by a factor of nine."; Language.Add(text + "NAME", "AH-64"); Language.Add(text + "DESCRIPTION", text2); Language.Add(text + "SUBTITLE", "The Gunship"); Language.Add(text + "LORE", text5); Language.Add(text + "OUTRO_FLAVOR", text3); Language.Add(text + "OUTRO_FAILURE", text4); Language.Add(text + "MASTERY_SKIN_NAME", "Alternate"); Language.Add(text + "PASSIVE_NAME", "Fire Control Radar"); Language.Add(text + "PASSIVE_DESCRIPTION", "The mast radar paints the " + Tokens.UtilityText("strongest nearby enemy") + ". Deal " + Tokens.UtilityText($"{12f:0}% increased damage") + " to the painted target, gain " + Tokens.UtilityText($"{15.000001f:0}% movement speed") + " while facing them, and " + Tokens.UtilityText($"{60f} armor") + " while close."); Language.Add(text + "RADAR_TARGET_ACQUIRED", "TARGET ACQUIRED"); Language.Add(text + "RADAR_TARGET_ACQUIRED_DESC", "Fire Control Radar"); Language.Add(text + "PRIMARY_CHAINGUN_NAME", "M230 Chain Gun"); Language.Add(text + "PRIMARY_CHAINGUN_DESCRIPTION", "Agile.Fire the chin turret for " + Tokens.DamageValueText(0.62f) + " per round, with a small HE blast for " + Tokens.DamageValueText(0.34f) + ". Holds " + Tokens.UtilityText($"{30} rounds") + ", then reloads over " + Tokens.UtilityText($"{1.7f}s") + ". Accuracy degrades while held."); Language.Add(text + "PRIMARY_GATLING_NAME", "XM301 Rotary Cannon"); Language.Add(text + "PRIMARY_GATLING_DESCRIPTION", "Agile.Spin up a six-barrel rotary cannon for " + Tokens.DamageValueText(0.39f) + " per round, with a light blast for " + Tokens.DamageValueText(0.135f) + ". " + Tokens.UtilityText("Rate of fire climbs as the barrels spool up") + ". Holds " + Tokens.UtilityText($"{60} rounds") + ", then reloads over " + Tokens.UtilityText($"{2.4f}s") + ". Less accurate than the M230."); Language.Add(text + "PRIMARY_CANNON_NAME", "M789 Heavy Cannon"); Language.Add(text + "PRIMARY_CANNON_DESCRIPTION", "Agile.Fire slow, heavy shells for " + Tokens.DamageValueText(2.9f) + " each, with a " + Tokens.UtilityText("large") + " blast for " + Tokens.DamageValueText(1f) + ". Holds " + Tokens.UtilityText($"{8} shells") + ", then reloads over " + Tokens.UtilityText($"{2.8f}s") + ". Highly accurate, but every shot counts."); Language.Add(text + "SECONDARY_ROCKETPODS_NAME", "Hydra-70 Pods"); Language.Add(text + "SECONDARY_ROCKETPODS_DESCRIPTION", "Agile.Ripple-fire unguided rockets from the wing pylons for " + Tokens.DamageValueText(1.8f) + " each. Holds " + Tokens.UtilityText($"{6} rockets") + ", then reloads over " + Tokens.UtilityText($"{5.5f}s") + ". Each " + Tokens.UtilityText("Backup Magazine") + " adds one rocket to the pods."); Language.Add(text + "UTILITY_DASH_NAME", "Evasive Roll"); Language.Add(text + "UTILITY_DASH_DESCRIPTION", "Barrel-roll " + Tokens.UtilityText("forward, left, or right") + " on a climbing diagonal from your move input, bracing the plating for " + Tokens.UtilityText($"{300f} armor") + ". " + Tokens.UtilityText("You cannot be hit during the first half of the roll.") + " Hold jump afterward for altitude — the roll only hops."); Language.Add(text + "UTILITY_BACKFLIP_NAME", "Smoke Backflip"); Language.Add(text + "UTILITY_BACKFLIP_DESCRIPTION", "Kick into an aerobatic " + Tokens.UtilityText("backflip") + " — surge rearward and climb through a pitch loop while dumping smoke. " + Tokens.UtilityText("Cloak") + " briefly as you fade back into the fight."); Language.Add(text + "SPECIAL_HELLFIRE_NAME", "AGM-114 Hellfire"); Language.Add(text + "SPECIAL_HELLFIRE_DESCRIPTION", "Launch a missile from a wing rail that flies straight and detonates on contact for " + Tokens.DamageValueText(13.5f) + "."); Language.Add(text + "SPECIAL_LONGBOW_NAME", "AGM-114L Longbow"); Language.Add(text + "SPECIAL_LONGBOW_DESCRIPTION", Tokens.UtilityText("Hold") + " to paint enemies under the reticle, then " + Tokens.UtilityText("release to launch") + " up to " + Tokens.UtilityText($"{6} guided missiles") + " from alternating inboard rails. Primary and secondary stay available while painting. Later locks hit harder (" + Tokens.DamageValueText(4f) + "–" + Tokens.DamageValueText(6.75f) + ")."); Language.Add(Tokens.GetAchievementNameToken("AH64_masteryAchievement"), "AH-64: Mastery"); Language.Add(Tokens.GetAchievementDescriptionToken("AH64_masteryAchievement"), "As the AH-64, beat the game or obliterate on Monsoon."); } } public static class AH64Unlockables { public static UnlockableDef characterUnlockableDef; public static UnlockableDef masterySkinUnlockableDef; public static void Init() { masterySkinUnlockableDef = Content.CreateAndAddUnlockbleDef("AH64_masteryUnlockable", Tokens.GetAchievementNameToken("AH64_masteryAchievement"), CharacterBase.instance.assetBundle.LoadAsset("texMasteryAchievement")); } } } namespace AH64.Survivors.SkillStates { public class AH64Main : GenericCharacterMain { private AH64HoverController hoverController; public override void OnEnter() { ((GenericCharacterMain)this).OnEnter(); hoverController = ((EntityState)this).gameObject.GetComponent(); } public override void HandleMovements() { ((GenericCharacterMain)this).HandleMovements(); if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)hoverController)) { bool jumpHeld = Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && ((EntityState)this).inputBank.jump.down; bool descendHeld = Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && ((EntityState)this).inputBank.rawMoveDown.down; hoverController.ApplyHover(jumpHeld, descendHeld, Time.fixedDeltaTime); } } public override void ProcessJump() { base.jumpInputReceived = false; } } internal static class AH64Muzzles { public const string Gun = "Muzzle"; public const string ChinBarrel = "ChinBarrel"; public const string RocketL = "MuzzleRocketL"; public const string RocketR = "MuzzleRocketR"; public const string MissileL = "MuzzleMissileL"; public const string MissileR = "MuzzleMissileR"; private const float BarrelTipLocalY = 1.3f; public static Vector3 GunOrigin(ChildLocator childLocator, Ray aimRay) { //IL_0050: 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_003a: Unknown result type (might be due to invalid IL or missing references) Transform val = (Object.op_Implicit((Object)(object)childLocator) ? (childLocator.FindChild("ChinBarrel") ?? FindDeep(((Component)childLocator).transform, "ChinBarrel")) : null); if (!Object.op_Implicit((Object)(object)val)) { return Origin(childLocator, "Muzzle", aimRay); } return val.TransformPoint(0f, 1.3f, 0f); } public static Transform Find(ChildLocator childLocator, string muzzleName) { if (!Object.op_Implicit((Object)(object)childLocator)) { return null; } Transform val = childLocator.FindChild(muzzleName); if (Object.op_Implicit((Object)(object)val)) { return val; } Transform transform = ((Component)childLocator).transform; val = FindDeep(transform, muzzleName); if (Object.op_Implicit((Object)(object)val)) { return val; } if (muzzleName != "Muzzle") { val = childLocator.FindChild("Muzzle") ?? FindDeep(transform, "Muzzle"); if (Object.op_Implicit((Object)(object)val)) { return val; } } return childLocator.FindChild("ChinBarrel") ?? FindDeep(transform, "ChinBarrel"); } public static Vector3 Origin(ChildLocator childLocator, string muzzleName, Ray aimRay) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) Transform val = Find(childLocator, muzzleName); if (!Object.op_Implicit((Object)(object)val)) { return ((Ray)(ref aimRay)).origin; } if (((Object)val).name == "ChinBarrel") { return val.TransformPoint(0f, 1.3f, 0f); } return val.position; } public static string ResolveName(ChildLocator childLocator, string muzzleName) { if (!Object.op_Implicit((Object)(object)childLocator)) { return "Muzzle"; } if (Object.op_Implicit((Object)(object)childLocator.FindChild(muzzleName))) { return muzzleName; } if (Object.op_Implicit((Object)(object)childLocator.FindChild("Muzzle"))) { return "Muzzle"; } if (Object.op_Implicit((Object)(object)childLocator.FindChild("ChinBarrel"))) { return "ChinBarrel"; } return "Muzzle"; } public static Vector3 AimDirection(ChildLocator childLocator, string muzzleName, Ray aimRay, float convergeDistance = 40f) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: 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_000a: Unknown result type (might be due to invalid IL or missing references) return AimDirection(Origin(childLocator, muzzleName, aimRay), aimRay, convergeDistance); } public static Vector3 AimDirection(Vector3 origin, Ray aimRay, float convergeDistance = 40f) { //IL_0003: 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_0027: 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) Vector3 val = ((Ray)(ref aimRay)).GetPoint(convergeDistance) - origin; if (((Vector3)(ref val)).sqrMagnitude < 0.0001f) { return ((Ray)(ref aimRay)).direction; } return ((Vector3)(ref val)).normalized; } private static Transform FindDeep(Transform root, string name) { if (!Object.op_Implicit((Object)(object)root) || string.IsNullOrEmpty(name)) { return null; } if (((Object)root).name == name) { return root; } for (int i = 0; i < root.childCount; i++) { Transform val = FindDeep(root.GetChild(i), name); if (Object.op_Implicit((Object)(object)val)) { return val; } } return null; } } public class FireCannon : BaseSkillState { public static float range = 250f; public static float force = 900f; public static float minSpread = 0.2f; public static float maxSpread = 0.8f; public static float spreadBloom = 0.35f; public static float procCoefficient = 1f; public static float bulletRadius = 0.6f; public static float recoil = 4f; public static float splashProcCoefficient = 0f; public static float splashForce = 400f; private const string fireCrackSoundString = "Play_clayBruiser_attack1_shoot_bullet"; private const string fireBodySoundString = "Play_clayboss_m2_explo"; private float duration; private AH64ChinTurret chinTurret; private float splashDamage; public static float damageCoefficient => AH64PlaytestConfig.CannonDamage; public static float baseDuration => AH64PlaytestConfig.CannonDuration; public static float splashDamageCoefficient => AH64PlaytestConfig.CannonSplashDamage; public static float splashRadius => AH64PlaytestConfig.CannonSplashRadius; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; ((EntityState)this).characterBody.SetAimTimer(2f); chinTurret = ((EntityState)this).GetComponent(); splashDamage = splashDamageCoefficient * ((BaseState)this).damageStat; Fire(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } private void Fire() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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) //IL_0014: 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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0157: 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_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0173: 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_017d: 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_019b: 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_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: 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_01d0: 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_01e2: 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_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: 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_0215: Unknown result type (might be due to invalid IL or missing references) //IL_0217: 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_0227: 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_0239: Expected O, but got Unknown ChildLocator modelChildLocator = ((EntityState)this).GetModelChildLocator(); Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 val = AH64Muzzles.GunOrigin(modelChildLocator, aimRay); Vector3 val2 = AH64Muzzles.AimDirection(val, aimRay); ((EntityState)this).characterBody.AddSpreadBloom(spreadBloom); SpawnBarrelFlash(AH64Assets.chaingunMuzzleFlashEffect, val, val2); SpawnBarrelFlash(AH64Assets.chaingunShellEjectEffect, val, val2); Util.PlaySound("Play_clayBruiser_attack1_shoot_bullet", ((EntityState)this).gameObject); Util.PlaySound("Play_clayboss_m2_explo", ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)chinTurret)) { chinTurret.NotifyFired(); } ShakeEmitter val3 = ShakeEmitter.CreateSimpleShakeEmitter(val, new Wave { amplitude = 1.6f, frequency = 14f, cycleOffset = 0f }, 0.18f, 24f, true); if (Object.op_Implicit((Object)(object)val3)) { val3.amplitudeTimeDecay = true; } if (((EntityState)this).isAuthority) { ((BaseState)this).AddRecoil(-2.4f * recoil, -3.6f * recoil, -0.8f * recoil, 0.8f * recoil); bool isCrit = ((BaseState)this).RollCrit(); new BulletAttack { bulletCount = 1u, aimVector = val2, origin = val, damage = damageCoefficient * ((BaseState)this).damageStat, damageColorIndex = (DamageColorIndex)0, damageType = DamageTypeCombo.GenericPrimary, falloffModel = (FalloffModel)0, maxDistance = range, force = force, hitMask = CommonMasks.bullet, minSpread = minSpread, maxSpread = maxSpread, isCrit = isCrit, owner = ((EntityState)this).gameObject, muzzleName = string.Empty, smartCollision = true, procChainMask = default(ProcChainMask), procCoefficient = procCoefficient, radius = bulletRadius, sniper = false, stopperMask = CommonMasks.bullet, weapon = null, tracerEffectPrefab = AH64Assets.chaingunTracerEffect, spreadPitchScale = 1f, spreadYawScale = 1f, queryTriggerInteraction = (QueryTriggerInteraction)0, hitEffectPrefab = AH64Assets.chaingunHitEffect, hitCallback = new HitCallback(CannonHitCallback) }.Fire(); } } private void SpawnBarrelFlash(GameObject effectPrefab, Vector3 muzzleOrigin, Vector3 muzzleAim) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_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_0028: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)effectPrefab)) { EffectManager.SpawnEffect(effectPrefab, new EffectData { origin = muzzleOrigin, rotation = Util.QuaternionSafeLookRotation(muzzleAim) }, false); } } private bool CannonHitCallback(BulletAttack bulletAttack, ref BulletHit hitInfo) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown //IL_009a: 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_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_00b1: 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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_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_00e8: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: 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_0118: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_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_013d: Unknown result type (might be due to invalid IL or missing references) bool result = BulletAttack.defaultHitCallback.Invoke(bulletAttack, ref hitInfo); if (Object.op_Implicit((Object)(object)AH64Assets.cannonSplashEffect)) { EffectManager.SpawnEffect(AH64Assets.cannonSplashEffect, new EffectData { origin = hitInfo.point + hitInfo.surfaceNormal * 0.1f, rotation = Util.QuaternionSafeLookRotation(hitInfo.surfaceNormal), scale = AH64PlaytestConfig.CannonSplashVfxScale }, true); } if (splashDamage <= 0f || splashRadius <= 0f) { return result; } TeamIndex teamIndex = (TeamIndex)((!Object.op_Implicit((Object)(object)((EntityState)this).teamComponent)) ? (-1) : ((int)((EntityState)this).teamComponent.teamIndex)); new BlastAttack { attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject, teamIndex = teamIndex, baseDamage = splashDamage, baseForce = splashForce, position = hitInfo.point, radius = splashRadius, falloffModel = (FalloffModel)1, crit = bulletAttack.isCrit, damageColorIndex = (DamageColorIndex)0, damageType = DamageTypeCombo.GenericPrimary, procCoefficient = splashProcCoefficient, procChainMask = default(ProcChainMask), attackerFiltering = (AttackerFiltering)2, losType = (LoSType)1 }.Fire(); return result; } } public class FireChaingun : BaseSkillState { public static float baseDuration = 0.09f; public static float range = 220f; public static float force = 100f; public static float minSpread = 0.5f; public static float procCoefficient = 0.35f; public static float bulletRadius = 0.4f; public static float recoil = 1f; public static float splashProcCoefficient = 0f; public static float splashForce = 40f; private const string fireSoundString = "Play_clayBruiser_attack1_shoot_bullet"; private float duration; private AH64ChinTurret chinTurret; private float splashDamage; public static float damageCoefficient => AH64PlaytestConfig.ChaingunDamage; public static float maxSpread => AH64PlaytestConfig.ChaingunMaxSpread; public static float spreadBloom => AH64PlaytestConfig.ChaingunBloom; public static float splashDamageCoefficient => AH64PlaytestConfig.ChaingunSplashDamage; public static float splashRadius => AH64PlaytestConfig.ChaingunSplashRadius; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; ((EntityState)this).characterBody.SetAimTimer(2f); chinTurret = ((EntityState)this).GetComponent(); splashDamage = splashDamageCoefficient * ((BaseState)this).damageStat; Fire(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } private void Fire() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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) //IL_0014: 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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_00c2: 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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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_0132: 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_0145: 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_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015d: 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_016e: 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_0180: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: 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_019d: 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_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_01ba: 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_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Expected O, but got Unknown ChildLocator modelChildLocator = ((EntityState)this).GetModelChildLocator(); Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 val = AH64Muzzles.GunOrigin(modelChildLocator, aimRay); Vector3 val2 = AH64Muzzles.AimDirection(val, aimRay); ((EntityState)this).characterBody.AddSpreadBloom(spreadBloom); SpawnBarrelFlash(AH64Assets.chaingunMuzzleFlashEffect, val, val2); SpawnBarrelFlash(AH64Assets.chaingunShellEjectEffect, val, val2); Util.PlaySound("Play_clayBruiser_attack1_shoot_bullet", ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)chinTurret)) { chinTurret.NotifyFired(); } if (((EntityState)this).isAuthority) { ((BaseState)this).AddRecoil(-1f * recoil, -2f * recoil, -0.5f * recoil, 0.5f * recoil); bool isCrit = ((BaseState)this).RollCrit(); new BulletAttack { bulletCount = 1u, aimVector = val2, origin = val, damage = damageCoefficient * ((BaseState)this).damageStat, damageColorIndex = (DamageColorIndex)0, damageType = DamageTypeCombo.GenericPrimary, falloffModel = (FalloffModel)0, maxDistance = range, force = force, hitMask = CommonMasks.bullet, minSpread = minSpread, maxSpread = maxSpread, isCrit = isCrit, owner = ((EntityState)this).gameObject, muzzleName = string.Empty, smartCollision = true, procChainMask = default(ProcChainMask), procCoefficient = procCoefficient, radius = bulletRadius, sniper = false, stopperMask = CommonMasks.bullet, weapon = null, tracerEffectPrefab = AH64Assets.chaingunTracerEffect, spreadPitchScale = 1f, spreadYawScale = 1f, queryTriggerInteraction = (QueryTriggerInteraction)0, hitEffectPrefab = AH64Assets.chaingunHitEffect, hitCallback = new HitCallback(ChaingunHitCallback) }.Fire(); } } private void SpawnBarrelFlash(GameObject effectPrefab, Vector3 muzzleOrigin, Vector3 muzzleAim) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_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_0028: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)effectPrefab)) { EffectManager.SpawnEffect(effectPrefab, new EffectData { origin = muzzleOrigin, rotation = Util.QuaternionSafeLookRotation(muzzleAim) }, false); } } private bool ChaingunHitCallback(BulletAttack bulletAttack, ref BulletHit hitInfo) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //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_0092: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: 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_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_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_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //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_0172: 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_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_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_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) bool result = BulletAttack.defaultHitCallback.Invoke(bulletAttack, ref hitInfo); if (Object.op_Implicit((Object)(object)AH64Assets.chaingunHitEffect)) { EffectManager.SpawnEffect(AH64Assets.chaingunHitEffect, new EffectData { origin = hitInfo.point + hitInfo.surfaceNormal * 0.06f, rotation = Util.QuaternionSafeLookRotation(hitInfo.surfaceNormal), scale = Mathf.Max(1.8f, AH64PlaytestConfig.ChaingunSplashVfxScale * 0.75f) }, true); } if (Object.op_Implicit((Object)(object)AH64Assets.chaingunSplashEffect)) { EffectManager.SpawnEffect(AH64Assets.chaingunSplashEffect, new EffectData { origin = hitInfo.point + hitInfo.surfaceNormal * 0.08f, rotation = Util.QuaternionSafeLookRotation(hitInfo.surfaceNormal), scale = AH64PlaytestConfig.ChaingunSplashVfxScale }, true); } if (splashDamage <= 0f || splashRadius <= 0f) { return result; } TeamIndex teamIndex = (TeamIndex)((!Object.op_Implicit((Object)(object)((EntityState)this).teamComponent)) ? (-1) : ((int)((EntityState)this).teamComponent.teamIndex)); new BlastAttack { attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject, teamIndex = teamIndex, baseDamage = splashDamage, baseForce = splashForce, position = hitInfo.point, radius = splashRadius, falloffModel = (FalloffModel)1, crit = bulletAttack.isCrit, damageColorIndex = (DamageColorIndex)0, damageType = DamageTypeCombo.GenericPrimary, procCoefficient = splashProcCoefficient, procChainMask = default(ProcChainMask), attackerFiltering = (AttackerFiltering)2, losType = (LoSType)0 }.Fire(); return result; } } public class FireGatling : BaseSkillState { public static float unspooledDuration = 0.115f; public static float range = 190f; public static float force = 55f; public static float minSpread = 0.9f; public static float procCoefficient = 0.2f; public static float bulletRadius = 0.35f; public static float recoil = 0.45f; public static float splashProcCoefficient = 0f; public static float splashForce = 18f; private const string fireSoundString = "Play_clayBruiser_attack1_shoot_bullet"; private float duration; private AH64ChinTurret chinTurret; private AH64GatlingSpin gatlingSpin; private float splashDamage; public static float damageCoefficient => AH64PlaytestConfig.GatlingDamage; public static float spooledDuration => AH64PlaytestConfig.GatlingSpooledDuration; public static float maxSpread => AH64PlaytestConfig.GatlingMaxSpread; public static float spreadBloom => AH64PlaytestConfig.GatlingBloom; public static float splashDamageCoefficient => AH64PlaytestConfig.GatlingSplashDamage; public static float splashRadius => AH64PlaytestConfig.GatlingSplashRadius; public override void OnEnter() { ((BaseState)this).OnEnter(); ((EntityState)this).characterBody.SetAimTimer(2f); chinTurret = ((EntityState)this).GetComponent(); gatlingSpin = ((EntityState)this).GetComponent(); splashDamage = splashDamageCoefficient * ((BaseState)this).damageStat; if (Object.op_Implicit((Object)(object)gatlingSpin)) { gatlingSpin.NotifyFiring(); } float num = (Object.op_Implicit((Object)(object)gatlingSpin) ? gatlingSpin.SpoolFraction : 1f); duration = Mathf.Lerp(unspooledDuration, spooledDuration, num) / ((BaseState)this).attackSpeedStat; Fire(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } private void Fire() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: 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) //IL_0014: 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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: 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_00c2: 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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: 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_0132: 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_0145: 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_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015d: 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_016e: 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_0180: 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_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: 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_019d: 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_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_01ba: 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_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Expected O, but got Unknown ChildLocator modelChildLocator = ((EntityState)this).GetModelChildLocator(); Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 val = AH64Muzzles.GunOrigin(modelChildLocator, aimRay); Vector3 val2 = AH64Muzzles.AimDirection(val, aimRay); ((EntityState)this).characterBody.AddSpreadBloom(spreadBloom); SpawnBarrelFlash(AH64Assets.chaingunMuzzleFlashEffect, val, val2); SpawnBarrelFlash(AH64Assets.chaingunShellEjectEffect, val, val2); Util.PlaySound("Play_clayBruiser_attack1_shoot_bullet", ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)chinTurret)) { chinTurret.NotifyFired(); } if (((EntityState)this).isAuthority) { ((BaseState)this).AddRecoil(-0.6f * recoil, -1.2f * recoil, -0.4f * recoil, 0.4f * recoil); bool isCrit = ((BaseState)this).RollCrit(); new BulletAttack { bulletCount = 1u, aimVector = val2, origin = val, damage = damageCoefficient * ((BaseState)this).damageStat, damageColorIndex = (DamageColorIndex)0, damageType = DamageTypeCombo.GenericPrimary, falloffModel = (FalloffModel)0, maxDistance = range, force = force, hitMask = CommonMasks.bullet, minSpread = minSpread, maxSpread = maxSpread, isCrit = isCrit, owner = ((EntityState)this).gameObject, muzzleName = string.Empty, smartCollision = true, procChainMask = default(ProcChainMask), procCoefficient = procCoefficient, radius = bulletRadius, sniper = false, stopperMask = CommonMasks.bullet, weapon = null, tracerEffectPrefab = AH64Assets.chaingunTracerEffect, spreadPitchScale = 1f, spreadYawScale = 1f, queryTriggerInteraction = (QueryTriggerInteraction)0, hitEffectPrefab = AH64Assets.chaingunHitEffect, hitCallback = new HitCallback(GatlingHitCallback) }.Fire(); } } private void SpawnBarrelFlash(GameObject effectPrefab, Vector3 muzzleOrigin, Vector3 muzzleAim) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_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_0028: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)effectPrefab)) { EffectManager.SpawnEffect(effectPrefab, new EffectData { origin = muzzleOrigin, rotation = Util.QuaternionSafeLookRotation(muzzleAim) }, false); } } private bool GatlingHitCallback(BulletAttack bulletAttack, ref BulletHit hitInfo) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown //IL_009a: 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_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_00b1: 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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_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_00e8: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: 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_0118: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_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_013d: Unknown result type (might be due to invalid IL or missing references) bool result = BulletAttack.defaultHitCallback.Invoke(bulletAttack, ref hitInfo); if (Object.op_Implicit((Object)(object)AH64Assets.gatlingSplashEffect)) { EffectManager.SpawnEffect(AH64Assets.gatlingSplashEffect, new EffectData { origin = hitInfo.point + hitInfo.surfaceNormal * 0.08f, rotation = Util.QuaternionSafeLookRotation(hitInfo.surfaceNormal), scale = AH64PlaytestConfig.GatlingSplashVfxScale }, true); } if (splashDamage <= 0f || splashRadius <= 0f) { return result; } TeamIndex teamIndex = (TeamIndex)((!Object.op_Implicit((Object)(object)((EntityState)this).teamComponent)) ? (-1) : ((int)((EntityState)this).teamComponent.teamIndex)); new BlastAttack { attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject, teamIndex = teamIndex, baseDamage = splashDamage, baseForce = splashForce, position = hitInfo.point, radius = splashRadius, falloffModel = (FalloffModel)1, crit = bulletAttack.isCrit, damageColorIndex = (DamageColorIndex)0, damageType = DamageTypeCombo.GenericPrimary, procCoefficient = splashProcCoefficient, procChainMask = default(ProcChainMask), attackerFiltering = (AttackerFiltering)2, losType = (LoSType)0 }.Fire(); return result; } } public class FireHellfire : GenericProjectileBaseState { public static float BaseDuration = 0.7f; public static float BaseDelayDuration = 0f; public static float DamageCoefficient = 13.5f; private static int launchCount; private string railMuzzle; private const string fireSoundString = "Play_engi_seekerMissile_shoot"; public override void OnEnter() { string muzzleName = ((launchCount++ % 2 == 0) ? "MuzzleMissileL" : "MuzzleMissileR"); railMuzzle = AH64Muzzles.ResolveName(((EntityState)this).GetModelChildLocator(), muzzleName); base.projectilePrefab = AH64Assets.hellfireProjectilePrefab; base.effectPrefab = AH64Assets.hellfireMuzzleFlashEffect; base.targetMuzzle = railMuzzle; base.attackSoundString = "Play_engi_seekerMissile_shoot"; base.baseDuration = BaseDuration; base.baseDelayBeforeFiringProjectile = BaseDelayDuration; base.damageCoefficient = DamageCoefficient; base.force = 20f; base.recoilAmplitude = 1.5f; base.bloom = 8f; ((GenericProjectileBaseState)this).OnEnter(); } public override void ModifyProjectileInfo(ref FireProjectileInfo fireProjectileInfo) { //IL_0008: 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_002f: Unknown result type (might be due to invalid IL or missing references) ((GenericProjectileBaseState)this).ModifyProjectileInfo(ref fireProjectileInfo); fireProjectileInfo.damageTypeOverride = DamageTypeCombo.GenericSpecial; fireProjectileInfo.position = AH64Muzzles.Origin(((EntityState)this).GetModelChildLocator(), railMuzzle, ((BaseState)this).GetAimRay()); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } public class FireLongbow : BaseSkillState { public static float baseFireInterval = 0.15f; private const string fireSoundString = "Play_item_proc_missile_fire"; public List targets; public GenericSkill launcher; private float fireInterval; private float stopwatch; private int fireIndex; public override void OnEnter() { ((BaseState)this).OnEnter(); fireInterval = baseFireInterval / ((BaseState)this).attackSpeedStat; stopwatch = fireInterval; } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); ((EntityState)this).characterBody.SetAimTimer(1f); if (!((EntityState)this).isAuthority) { return; } stopwatch += ((EntityState)this).GetDeltaTime(); if (stopwatch >= fireInterval) { stopwatch -= fireInterval; while (targets != null && fireIndex < targets.Count) { HurtBox val = targets[fireIndex]; int lockIndex = fireIndex; fireIndex++; if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)val.healthComponent) || !val.healthComponent.alive) { GenericSkill obj = launcher; if (obj != null) { obj.AddOneStock(); } continue; } FireMissile(val, lockIndex); break; } } if (targets == null || fireIndex >= targets.Count) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { if (((EntityState)this).isAuthority && targets != null) { for (int i = fireIndex; i < targets.Count; i++) { GenericSkill obj = launcher; if (obj != null) { obj.AddOneStock(); } } } ((EntityState)this).OnExit(); } private void FireMissile(HurtBox target, int lockIndex) { //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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: 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_00bc: 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_00cf: 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) if (!Object.op_Implicit((Object)(object)AH64Assets.LongbowProjectile)) { GenericSkill obj = launcher; if (obj != null) { obj.AddOneStock(); } Log.Error("FireLongbow: LongbowProjectile is null; refunding stock."); return; } ChildLocator modelChildLocator = ((EntityState)this).GetModelChildLocator(); string muzzleName = ((lockIndex % 2 == 0) ? "MuzzleMissileL" : "MuzzleMissileR"); string text = AH64Muzzles.ResolveName(modelChildLocator, muzzleName); if (Object.op_Implicit((Object)(object)AH64Assets.hellfireMuzzleFlashEffect)) { EffectManager.SimpleMuzzleFlash(AH64Assets.hellfireMuzzleFlashEffect, ((EntityState)this).gameObject, text, true); } if (Object.op_Implicit((Object)(object)AH64Assets.hydraMuzzleFlashEffect)) { EffectManager.SimpleMuzzleFlash(AH64Assets.hydraMuzzleFlashEffect, ((EntityState)this).gameObject, text, true); } Util.PlaySound("Play_item_proc_missile_fire", ((EntityState)this).gameObject); float num = 4f + (float)lockIndex * 0.55f; Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 val = AH64Muzzles.AimDirection(modelChildLocator, muzzleName, aimRay, 150f); MissileUtils.FireMissile(AH64Muzzles.Origin(modelChildLocator, muzzleName, aimRay), ((EntityState)this).characterBody, default(ProcChainMask), ((Component)target).gameObject, ((BaseState)this).damageStat * num, ((BaseState)this).RollCrit(), AH64Assets.LongbowProjectile, (DamageColorIndex)0, val, 0f, false); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public class FireRocketPods : BaseSkillState { public static float damageCoefficient = 1.8f; public static float fireInterval = 0.1f; public static float spreadAngle = 2.5f; public static float force = 200f; public static float recoil = 0.6f; private const string fireSoundString = "Play_item_proc_missile_fire"; private float duration; private int pylonIndex; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = fireInterval / ((BaseState)this).attackSpeedStat; ((EntityState)this).characterBody.SetAimTimer(2f); pylonIndex = ((Object.op_Implicit((Object)(object)((EntityState)this).skillLocator) && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator.secondary)) ? ((EntityState)this).skillLocator.secondary.stock : 0); FireOneRocket(pylonIndex); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } private void FireOneRocket(int index) { //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_00a1: 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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_013d: 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_0155: Unknown result type (might be due to invalid IL or missing references) ChildLocator modelChildLocator = ((EntityState)this).GetModelChildLocator(); string muzzleName = ((index % 2 == 0) ? "MuzzleRocketL" : "MuzzleRocketR"); string text = AH64Muzzles.ResolveName(modelChildLocator, muzzleName); if (Object.op_Implicit((Object)(object)AH64Assets.hydraMuzzleFlashEffect)) { EffectManager.SimpleMuzzleFlash(AH64Assets.hydraMuzzleFlashEffect, ((EntityState)this).gameObject, text, false); } Util.PlaySound("Play_item_proc_missile_fire", ((EntityState)this).gameObject); if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)AH64Assets.hydraRocketProjectilePrefab)) { Ray aimRay = ((BaseState)this).GetAimRay(); ((BaseState)this).AddRecoil(-1f * recoil, -2f * recoil, -0.5f * recoil, 0.5f * recoil); Vector3 val = Util.ApplySpread(AH64Muzzles.AimDirection(modelChildLocator, muzzleName, aimRay), 0f, spreadAngle, 1f, 1f, 0f, 0f); FireProjectileInfo val2 = new FireProjectileInfo { projectilePrefab = AH64Assets.hydraRocketProjectilePrefab, position = AH64Muzzles.Origin(modelChildLocator, muzzleName, aimRay), rotation = Util.QuaternionSafeLookRotation(val), owner = ((EntityState)this).gameObject, damage = damageCoefficient * ((BaseState)this).damageStat, force = force, crit = ((BaseState)this).RollCrit(), damageTypeOverride = DamageTypeCombo.GenericSecondary }; ProjectileManager.instance.FireProjectile(val2); } } } internal class LongbowLockIndicator : Indicator { public int missileCount; private readonly List dots = new List(); private Transform dotOrigin; private Transform dotTemplate; private int builtCount = -1; public LongbowLockIndicator(GameObject owner, GameObject visualizerPrefab) : base(owner, visualizerPrefab) { } public override void UpdateVisualizer() { //IL_013e: Unknown result type (might be due to invalid IL or missing references) ((Indicator)this).UpdateVisualizer(); if (builtCount == missileCount || !Object.op_Implicit((Object)(object)((Indicator)this).visualizerTransform)) { return; } if (!Object.op_Implicit((Object)(object)dotOrigin)) { dotOrigin = ((Indicator)this).visualizerTransform.Find("DotOrigin"); dotTemplate = (Object.op_Implicit((Object)(object)((Indicator)this).visualizerPrefab) ? ((Indicator)this).visualizerPrefab.transform.Find("DotOrigin/DotTemplate") : null); } if (!Object.op_Implicit((Object)(object)dotOrigin) || !Object.op_Implicit((Object)(object)dotTemplate)) { return; } while (dots.Count < missileCount) { GameObject val = Object.Instantiate(((Component)dotTemplate).gameObject, dotOrigin); ((Indicator)this).FindRenderers(val.transform); dots.Add(val.transform); } float num = 360f / (float)Mathf.Max(missileCount, 1); float num2 = (float)(missileCount - 1) * 90f; for (int i = 0; i < dots.Count; i++) { ((Component)dots[i]).gameObject.SetActive(i < missileCount); if (i < missileCount) { dots[i].localRotation = Quaternion.Euler(0f, 0f, num2 + (float)i * num); } } builtCount = missileCount; } public override void OnDestroyVisualizer() { ((Indicator)this).OnDestroyVisualizer(); dots.Clear(); dotOrigin = null; dotTemplate = null; builtCount = -1; } } public class PaintLongbow : BaseSkillState { public static float lockInterval = 0.25f; public static float maxLockAngle = 20f; public static float maxLockDistance = 150f; public static float maxPaintDuration = 12f; private const string openSoundString = "Play_engi_seekerMissile_HUD_open"; private const string closeSoundString = "Play_engi_seekerMissile_HUD_close"; private const string loopSoundString = "Play_engi_seekerMissile_HUD_loop"; private const string stopLoopSoundString = "Stop_engi_seekerMissile_HUD_loop"; private const string lockOnSoundString = "Play_engi_seekerMissile_lockOn"; private List targets; private Dictionary indicators; private Indicator stickyTargetIndicator; private BullseyeSearch search; private OverrideRequest crosshairOverrideRequest; private float lockStopwatch; private float paintStopwatch; private bool handedOff; private bool sawButtonDown; private HealthComponent previousHighlightTargetHealthComponent; private HurtBox previousHighlightTargetHurtBox; public override void OnEnter() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown ((BaseState)this).OnEnter(); if (((EntityState)this).isAuthority) { targets = new List(); indicators = new Dictionary(); search = new BullseyeSearch(); if (Object.op_Implicit((Object)(object)AH64Assets.LongbowLockIndicatorPrefab)) { stickyTargetIndicator = new Indicator(((EntityState)this).gameObject, AH64Assets.LongbowLockIndicatorPrefab); } } Util.PlaySound("Play_engi_seekerMissile_HUD_open", ((EntityState)this).gameObject); Util.PlaySound("Play_engi_seekerMissile_HUD_loop", ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)AH64Assets.LongbowCrosshair)) { crosshairOverrideRequest = CrosshairUtils.RequestOverrideForBody(((EntityState)this).characterBody, AH64Assets.LongbowCrosshair, (OverridePriority)1); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); ((EntityState)this).characterBody.SetAimTimer(3f); paintStopwatch += ((EntityState)this).GetDeltaTime(); if (((EntityState)this).isAuthority) { if (paintStopwatch >= maxPaintDuration) { Salvo(); } else { AuthorityFixedUpdate(); } } } public override void OnExit() { if (((EntityState)this).isAuthority && !handedOff) { RefundAll(); } if (indicators != null) { foreach (KeyValuePair indicator in indicators) { ((Indicator)indicator.Value).active = false; } } if (stickyTargetIndicator != null) { stickyTargetIndicator.active = false; } OverrideRequest obj = crosshairOverrideRequest; if (obj != null) { obj.Dispose(); } Util.PlaySound("Play_engi_seekerMissile_HUD_close", ((EntityState)this).gameObject); Util.PlaySound("Stop_engi_seekerMissile_HUD_loop", ((EntityState)this).gameObject); ((EntityState)this).OnExit(); } private void AuthorityFixedUpdate() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) DropDeadLocks(); HurtBox val = FindTarget(); ButtonState skill = ((EntityState)this).inputBank.skill4; if (skill.down) { sawButtonDown = true; if (Object.op_Implicit((Object)(object)val)) { lockStopwatch += ((EntityState)this).GetDeltaTime(); bool flag = (Object)(object)previousHighlightTargetHealthComponent == (Object)(object)val.healthComponent; if (Object.op_Implicit((Object)(object)((BaseSkillState)this).activatorSkillSlot) && ((BaseSkillState)this).activatorSkillSlot.stock > 0 && (!flag || lockStopwatch >= lockInterval / ((BaseState)this).attackSpeedStat || ((ButtonState)(ref skill)).justPressed)) { lockStopwatch = 0f; AddLock(val); } } } else if (sawButtonDown) { Salvo(); return; } if (val != previousHighlightTargetHurtBox) { previousHighlightTargetHurtBox = val; previousHighlightTargetHealthComponent = (Object.op_Implicit((Object)(object)val) ? val.healthComponent : null); if (stickyTargetIndicator != null) { stickyTargetIndicator.targetTransform = ((Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)((BaseSkillState)this).activatorSkillSlot) && ((BaseSkillState)this).activatorSkillSlot.stock > 0) ? ((Component)val).transform : null); } lockStopwatch = 0f; } if (stickyTargetIndicator != null) { stickyTargetIndicator.active = Object.op_Implicit((Object)(object)stickyTargetIndicator.targetTransform); } } private HurtBox FindTarget() { //IL_0001: 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_0078: 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_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_009b: 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_00b1: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = ((BaseState)this).GetAimRay(); search.filterByDistinctEntity = true; search.filterByLoS = true; search.minDistanceFilter = 0f; search.maxDistanceFilter = maxLockDistance; search.minAngleFilter = 0f; search.maxAngleFilter = maxLockAngle; search.viewer = ((EntityState)this).characterBody; search.searchOrigin = ((Ray)(ref aimRay)).origin; search.searchDirection = ((Ray)(ref aimRay)).direction; search.sortMode = (SortMode)3; search.teamMaskFilter = TeamMask.GetUnprotectedTeams(((BaseState)this).GetTeam()); search.RefreshCandidates(); search.FilterOutGameObject(((EntityState)this).gameObject); foreach (HurtBox result in search.GetResults()) { if (Object.op_Implicit((Object)(object)result) && Object.op_Implicit((Object)(object)result.healthComponent) && result.healthComponent.alive) { return result; } } return null; } private void AddLock(HurtBox hurtBox) { targets.Add(hurtBox); ((BaseSkillState)this).activatorSkillSlot.DeductStock(1); Util.PlaySound("Play_engi_seekerMissile_lockOn", ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)AH64Assets.LongbowLockIndicatorPrefab)) { if (!indicators.TryGetValue(hurtBox, out var value)) { LongbowLockIndicator obj = new LongbowLockIndicator(((EntityState)this).gameObject, AH64Assets.LongbowLockIndicatorPrefab) { targetTransform = ((Component)hurtBox).transform }; ((Indicator)obj).active = true; value = obj; indicators[hurtBox] = value; } value.missileCount++; } } private void DropDeadLocks() { for (int num = targets.Count - 1; num >= 0; num--) { HurtBox val = targets[num]; if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)val.healthComponent) || !val.healthComponent.alive) { targets.RemoveAt(num); if (Object.op_Implicit((Object)(object)val) && indicators.TryGetValue(val, out var value)) { value.missileCount--; if (value.missileCount <= 0) { ((Indicator)value).active = false; indicators.Remove(val); } } GenericSkill activatorSkillSlot = ((BaseSkillState)this).activatorSkillSlot; if (activatorSkillSlot != null) { activatorSkillSlot.AddOneStock(); } } } } private void Salvo() { if (targets == null || targets.Count == 0) { ((EntityState)this).outer.SetNextStateToMain(); return; } handedOff = true; ((EntityState)this).outer.SetNextState((EntityState)(object)new FireLongbow { targets = targets, launcher = ((BaseSkillState)this).activatorSkillSlot }); } private void RefundAll() { if (targets != null && !((Object)(object)((BaseSkillState)this).activatorSkillSlot == (Object)null)) { for (int i = 0; i < targets.Count; i++) { ((BaseSkillState)this).activatorSkillSlot.AddOneStock(); } targets.Clear(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public class ServoDash : BaseSkillState { public static float duration = 0.95f; public static float initialSpeedCoefficient = 2.35f; public static float finalSpeedCoefficient = 1.405f; public static string dodgeSoundString = "Play_loader_m2_launch"; private const string travelLoopPlay = "Play_loader_m2_travel_loop"; private const string travelLoopStop = "Stop_loader_m2_travel_loop"; public static float dodgeFOV = DodgeState.dodgeFOV; private const float thrusterSmokeScale = 0.35f; private const float thrusterSpacing = 0.55f; private float dashSpeed; private float entrySpeed; private float peakSpeed; private float exitSpeed; private Vector3 forwardDirection; private Vector3 previousPosition; private float flareTimer; private float rollSign; public override void OnEnter() { //IL_00b9: 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_007a: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { ResolveRollDirection(out forwardDirection, out rollSign); } CaptureEntrySpeed(); RecalculateDashSpeed(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { if (((EntityState)this).characterMotor.isGrounded) { ((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f); } float num = ClimbVelocityAt(0f); ((EntityState)this).characterMotor.velocity = forwardDirection * dashSpeed + Vector3.up * num; } Vector3 val = (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) ? ((EntityState)this).characterMotor.velocity : Vector3.zero); previousPosition = ((EntityState)this).transform.position - val; Util.PlaySound(dodgeSoundString, ((EntityState)this).gameObject); Util.PlaySound("Play_loader_m2_travel_loop", ((EntityState)this).gameObject); PlayThrusterBurst(); AH64FlightVisuals component = ((EntityState)this).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.PlayBarrelRoll(rollSign, 0.95f); } AH64HoverController component2 = ((EntityState)this).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.BumpTargetHeight(AH64PlaytestConfig.DashClimbHeight); } if (NetworkServer.active) { ((EntityState)this).characterBody.AddTimedBuff(AH64Buffs.platingBuff, 3f * duration); ((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 0.5f * duration); } } private void ResolveRollDirection(out Vector3 direction, out float bankSign) { //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_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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_0124: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: 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_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) Vector3 forward = ((EntityState)this).characterDirection.forward; forward.y = 0f; if (((Vector3)(ref forward)).sqrMagnitude < 0.0001f) { forward = ((EntityState)this).transform.forward; } ((Vector3)(ref forward)).Normalize(); Vector3 val = Vector3.Cross(Vector3.up, forward); Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = ((Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && ((EntityState)this).inputBank.moveVector != Vector3.zero) ? ((EntityState)this).inputBank.moveVector : forward); val2.y = 0f; if (((Vector3)(ref val2)).sqrMagnitude < 0.0001f) { val2 = forward; } ((Vector3)(ref val2)).Normalize(); float num = Vector3.Dot(val2, forward); float num2 = Vector3.Dot(val2, normalized); float num3 = 0.7f; if (Mathf.Abs(num2) > Mathf.Abs(num) && Mathf.Abs(num2) > 0.35f) { Vector3 val3 = ((num2 >= 0f) ? normalized : (-normalized)); val = forward * num3 + val3; direction = ((Vector3)(ref val)).normalized; bankSign = ((num2 >= 0f) ? 1f : (-1f)); } else { direction = forward; bankSign = ((Mathf.Abs(num2) > 0.1f) ? Mathf.Sign(num2) : 1f); } } private void CaptureEntrySpeed() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) float num = ((BaseState)this).moveSpeedStat * 0.8f; float num2 = 0f; if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { Vector3 velocity = ((EntityState)this).characterMotor.velocity; velocity.y = 0f; num2 = ((Vector3)(ref velocity)).magnitude; } entrySpeed = Mathf.Max(num2, num); peakSpeed = entrySpeed * AH64PlaytestConfig.DashPeakSpeed; exitSpeed = Mathf.Lerp(entrySpeed, peakSpeed, 0.3f); } private static float ClimbVelocityAt(float age) { float num = Mathf.Clamp01(age / duration); return AH64PlaytestConfig.DashClimbHeight * (MathF.PI / 2f / duration) * Mathf.Cos(MathF.PI / 2f * num); } private void PlayThrusterBurst() { //IL_0001: 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_0013: 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_0023: 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_0033: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Expected O, but got Unknown //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_0116: 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_0131: Expected O, but got Unknown //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014b: 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_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Expected O, but got Unknown //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_017a: 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_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: 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_01a1: Expected O, but got Unknown if (forwardDirection == Vector3.zero) { return; } Vector3 val = Vector3.Cross(Vector3.up, forwardDirection); Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = ((EntityState)this).transform.position + Vector3.up * 0.7f - forwardDirection * 0.55f; GameObject dashThrusterEffect = AH64Assets.dashThrusterEffect; if (Object.op_Implicit((Object)(object)dashThrusterEffect)) { EffectManager.SpawnEffect(dashThrusterEffect, new EffectData { origin = val2 + normalized * 0.55f, rotation = Util.QuaternionSafeLookRotation(-forwardDirection), scale = 0.35f }, false); EffectManager.SpawnEffect(dashThrusterEffect, new EffectData { origin = val2 - normalized * 0.55f, rotation = Util.QuaternionSafeLookRotation(-forwardDirection), scale = 0.35f }, false); } GameObject dashDustEffect = AH64Assets.dashDustEffect; if (Object.op_Implicit((Object)(object)dashDustEffect)) { EffectManager.SpawnEffect(dashDustEffect, new EffectData { origin = ((EntityState)this).transform.position, scale = 1.35f }, false); return; } GameObject smokePuffEffect = AH64Assets.SmokePuffEffect; if (Object.op_Implicit((Object)(object)smokePuffEffect)) { EffectManager.SpawnEffect(smokePuffEffect, new EffectData { origin = val2 + normalized * 0.55f, scale = 0.35f }, false); EffectManager.SpawnEffect(smokePuffEffect, new EffectData { origin = val2 - normalized * 0.55f, scale = 0.35f }, false); } } private void PopFlare() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: 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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Expected O, but got Unknown GameObject dashFlareEffect = AH64Assets.dashFlareEffect; if (Object.op_Implicit((Object)(object)dashFlareEffect) && !(forwardDirection == Vector3.zero)) { Vector3 origin = ((EntityState)this).transform.position + Vector3.up * 0.9f - forwardDirection * 1.1f + Random.insideUnitSphere * 0.35f; EffectManager.SpawnEffect(dashFlareEffect, new EffectData { origin = origin, rotation = Util.QuaternionSafeLookRotation(-forwardDirection), scale = 0.12f }, false); } } private void RecalculateDashSpeed() { float num = Mathf.Clamp01(((EntityState)this).fixedAge / duration); float num2 = Mathf.Clamp(AH64PlaytestConfig.DashRampFraction, 0.05f, 0.9f); if (num <= num2) { float num3 = SmoothStep(num / num2); dashSpeed = Mathf.Lerp(entrySpeed, peakSpeed, num3); } else { float num4 = SmoothStep((num - num2) / (1f - num2)); dashSpeed = Mathf.Lerp(peakSpeed, exitSpeed, num4); } } private static float SmoothStep(float x) { x = Mathf.Clamp01(x); return x * x * (3f - 2f * x); } public override void FixedUpdate() { //IL_0051: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0120: 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_00ec: 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_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: 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_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_013f: 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) ((EntityState)this).FixedUpdate(); RecalculateDashSpeed(); flareTimer -= ((EntityState)this).GetDeltaTime(); if (flareTimer <= 0f) { flareTimer = 0.38f; PopFlare(); } if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { ((EntityState)this).characterDirection.forward = forwardDirection; } if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams)) { ((EntityState)this).cameraTargetParams.fovOverride = Mathf.Lerp(dodgeFOV, 60f, ((EntityState)this).fixedAge / duration); } float y = ClimbVelocityAt(((EntityState)this).fixedAge); Vector3 val = ((EntityState)this).transform.position - previousPosition; val.y = 0f; if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { Vector3 val2; if (((Vector3)(ref val)).sqrMagnitude > 0.0001f) { ((Vector3)(ref val)).Normalize(); val2 = val * dashSpeed; float num = Mathf.Max(Vector3.Dot(val2, forwardDirection), 0f); val2 = forwardDirection * num; } else { val2 = forwardDirection * dashSpeed; } val2.y = y; ((EntityState)this).characterMotor.velocity = val2; } previousPosition = ((EntityState)this).transform.position; if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { //IL_0053: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) Util.PlaySound("Stop_loader_m2_travel_loop", ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams)) { ((EntityState)this).cameraTargetParams.fovOverride = -1f; } if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((Vector3)(ref forwardDirection)).sqrMagnitude > 0.0001f) { Vector3 velocity = ((Vector3)(ref forwardDirection)).normalized * exitSpeed; velocity.y = ((EntityState)this).characterMotor.velocity.y; ((EntityState)this).characterMotor.velocity = velocity; } ((EntityState)this).OnExit(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.disableAirControlUntilCollision = false; } } public override void OnSerialize(NetworkWriter writer) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) ((BaseSkillState)this).OnSerialize(writer); writer.Write(forwardDirection); writer.Write(rollSign); writer.Write(entrySpeed); writer.Write(peakSpeed); writer.Write(exitSpeed); } public override void OnDeserialize(NetworkReader reader) { //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) ((BaseSkillState)this).OnDeserialize(reader); forwardDirection = reader.ReadVector3(); rollSign = reader.ReadSingle(); entrySpeed = reader.ReadSingle(); peakSpeed = reader.ReadSingle(); exitSpeed = reader.ReadSingle(); } } public class SmokeBackflip : BaseSkillState { public static float duration = 1.65f; private const string launchSound = "Play_loader_m2_launch"; private const string travelLoopPlay = "Play_loader_m2_travel_loop"; private const string travelLoopStop = "Stop_loader_m2_travel_loop"; private static readonly float dodgeFOV = DodgeState.dodgeFOV; private float dashSpeed; private float entrySpeed; private float peakSpeed; private float exitSpeed; private Vector3 rearwardDirection; private Vector3 previousPosition; private float smokeTimer; public override void OnEnter() { //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_008c: 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_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_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) ((BaseState)this).OnEnter(); if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { ResolveRearwardDirection(); } CaptureEntrySpeed(); RecalculateDashSpeed(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { if (((EntityState)this).characterMotor.isGrounded) { ((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f); } ((EntityState)this).characterMotor.velocity = rearwardDirection * dashSpeed + Vector3.up * ClimbVelocityAt(0f); } Vector3 val = (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) ? ((EntityState)this).characterMotor.velocity : Vector3.zero); previousPosition = ((EntityState)this).transform.position - val; Util.PlaySound("Play_loader_m2_launch", ((EntityState)this).gameObject); Util.PlaySound("Play_loader_m2_travel_loop", ((EntityState)this).gameObject); PopSmokeBurst(); AH64FlightVisuals component = ((EntityState)this).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.PlayBackflip(1.65f); } AH64HoverController component2 = ((EntityState)this).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { component2.BumpTargetHeight(14f); } if (NetworkServer.active) { ((EntityState)this).characterBody.AddTimedBuff(Buffs.Cloak, 2f); ((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 0.5f * duration); } } private void ResolveRearwardDirection() { //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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) Vector3 forward = ((EntityState)this).characterDirection.forward; forward.y = 0f; if (((Vector3)(ref forward)).sqrMagnitude < 0.0001f) { forward = ((EntityState)this).transform.forward; } ((Vector3)(ref forward)).Normalize(); rearwardDirection = -forward; } private void CaptureEntrySpeed() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) float num = ((BaseState)this).moveSpeedStat * 0.75f; float num2 = 0f; if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { Vector3 velocity = ((EntityState)this).characterMotor.velocity; velocity.y = 0f; num2 = ((Vector3)(ref velocity)).magnitude; } entrySpeed = Mathf.Max(num2, num); peakSpeed = entrySpeed * 2.35f; exitSpeed = Mathf.Lerp(entrySpeed, peakSpeed, 0.28f); } private static float ClimbVelocityAt(float age) { float num = Mathf.Clamp01(age / duration); return 14f * (MathF.PI / 2f / duration) * Mathf.Cos(MathF.PI / 2f * num); } private void RecalculateDashSpeed() { float num = Mathf.Clamp01(((EntityState)this).fixedAge / duration); float num2 = Mathf.Clamp(0.28f, 0.05f, 0.9f); if (num <= num2) { float num3 = SmoothStep(num / num2); dashSpeed = Mathf.Lerp(entrySpeed, peakSpeed, num3); } else { float num4 = SmoothStep((num - num2) / (1f - num2)); dashSpeed = Mathf.Lerp(peakSpeed, exitSpeed, num4); } } private static float SmoothStep(float x) { x = Mathf.Clamp01(x); return x * x * (3f - 2f * x); } private void PopSmokeBurst() { //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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_0068: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Expected O, but got Unknown //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Expected O, but got Unknown //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Expected O, but got Unknown GameObject val = AH64Assets.SmokePuffEffect; if (!Object.op_Implicit((Object)(object)val)) { val = AH64Assets.dashDustEffect; } if (Object.op_Implicit((Object)(object)val) && !(rearwardDirection == Vector3.zero)) { Vector3 val2 = Vector3.Cross(Vector3.up, rearwardDirection); Vector3 normalized = ((Vector3)(ref val2)).normalized; Vector3 val3 = ((EntityState)this).transform.position + Vector3.up * 0.85f - rearwardDirection * 0.35f; EffectManager.SpawnEffect(val, new EffectData { origin = val3, scale = 1.55f }, false); EffectManager.SpawnEffect(val, new EffectData { origin = val3 + normalized * 0.55f, scale = 1.3175f }, false); EffectManager.SpawnEffect(val, new EffectData { origin = val3 - normalized * 0.55f, scale = 1.3175f }, false); } } public override void FixedUpdate() { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: 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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: 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_00f0: 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) ((EntityState)this).FixedUpdate(); RecalculateDashSpeed(); smokeTimer -= ((EntityState)this).GetDeltaTime(); if (smokeTimer <= 0f) { smokeTimer = 0.16f; PopSmokeBurst(); } if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) && ((Vector3)(ref rearwardDirection)).sqrMagnitude > 0.0001f) { ((EntityState)this).characterDirection.forward = -rearwardDirection; } if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams)) { ((EntityState)this).cameraTargetParams.fovOverride = Mathf.Lerp(dodgeFOV, 60f, ((EntityState)this).fixedAge / duration); } float y = ClimbVelocityAt(((EntityState)this).fixedAge); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((Vector3)(ref rearwardDirection)).sqrMagnitude > 0.0001f) { Vector3 velocity = rearwardDirection * dashSpeed; velocity.y = y; ((EntityState)this).characterMotor.velocity = velocity; } previousPosition = ((EntityState)this).transform.position; if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { //IL_0053: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) Util.PlaySound("Stop_loader_m2_travel_loop", ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams)) { ((EntityState)this).cameraTargetParams.fovOverride = -1f; } if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((Vector3)(ref rearwardDirection)).sqrMagnitude > 0.0001f) { Vector3 velocity = ((Vector3)(ref rearwardDirection)).normalized * exitSpeed; velocity.y = ((EntityState)this).characterMotor.velocity.y; ((EntityState)this).characterMotor.velocity = velocity; } ((EntityState)this).OnExit(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.disableAirControlUntilCollision = false; } } public override void OnSerialize(NetworkWriter writer) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) ((BaseSkillState)this).OnSerialize(writer); writer.Write(rearwardDirection); writer.Write(entrySpeed); writer.Write(peakSpeed); writer.Write(exitSpeed); } public override void OnDeserialize(NetworkReader reader) { //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) ((BaseSkillState)this).OnDeserialize(reader); rearwardDirection = reader.ReadVector3(); entrySpeed = reader.ReadSingle(); peakSpeed = reader.ReadSingle(); exitSpeed = reader.ReadSingle(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } } namespace AH64.Survivors.Components { [DefaultExecutionOrder(250)] public class AH64ChinTurret : MonoBehaviour { private const float MinAimSqr = 0.0001f; private InputBankTest inputBank; private Transform chinTurret; private Transform chinBarrel; private Quaternion turretRestLocalRotation; private Quaternion barrelRestLocalRotation; private Vector3 barrelRestLocalPosition; private float kickOffset; private void Start() { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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) inputBank = ((Component)this).GetComponent(); ModelLocator component = ((Component)this).GetComponent(); if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.modelTransform)) { return; } ChildLocator component2 = ((Component)component.modelTransform).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { chinTurret = component2.FindChild("ChinTurret"); chinBarrel = component2.FindChild("ChinBarrel"); if (Object.op_Implicit((Object)(object)chinTurret)) { turretRestLocalRotation = chinTurret.localRotation; } if (Object.op_Implicit((Object)(object)chinBarrel)) { barrelRestLocalRotation = chinBarrel.localRotation; barrelRestLocalPosition = chinBarrel.localPosition; } else if (Object.op_Implicit((Object)(object)chinTurret)) { chinBarrel = chinTurret; barrelRestLocalRotation = turretRestLocalRotation; barrelRestLocalPosition = chinTurret.localPosition; } } } public void NotifyFired() { kickOffset = 0.06f; } private void LateUpdate() { //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_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019e: 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_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_0111: 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_0124: 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_0133: 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_014d: 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_0164: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)chinTurret) || !Object.op_Implicit((Object)(object)inputBank)) { return; } Vector3 aimDirection = inputBank.aimDirection; if (((Vector3)(ref aimDirection)).sqrMagnitude >= 0.0001f) { Vector3 val = (Object.op_Implicit((Object)(object)chinTurret.parent) ? chinTurret.parent : ((Component)this).transform).InverseTransformDirection(((Vector3)(ref aimDirection)).normalized); float num = Mathf.Atan2(val.x, val.z) * 57.29578f; num = Mathf.Clamp(num, -80f, 80f); float num2 = (0f - Mathf.Asin(Mathf.Clamp(val.y, -1f, 1f))) * 57.29578f; num2 = Mathf.Clamp(num2, -30f, 35f); float num3 = 200f * Time.deltaTime; if (Object.op_Implicit((Object)(object)chinBarrel) && (Object)(object)chinBarrel != (Object)(object)chinTurret) { Quaternion val2 = turretRestLocalRotation * Quaternion.Euler(0f, num, 0f); chinTurret.localRotation = Quaternion.RotateTowards(chinTurret.localRotation, val2, num3); Quaternion val3 = barrelRestLocalRotation * Quaternion.Euler(num2, 0f, 0f); chinBarrel.localRotation = Quaternion.RotateTowards(chinBarrel.localRotation, val3, num3); } else { Quaternion val4 = turretRestLocalRotation * Quaternion.Euler(num2, num, 0f); chinTurret.localRotation = Quaternion.RotateTowards(chinTurret.localRotation, val4, num3); } } if (Object.op_Implicit((Object)(object)chinBarrel)) { kickOffset = Mathf.MoveTowards(kickOffset, 0f, 0.55f * Time.deltaTime); chinBarrel.localPosition = barrelRestLocalPosition + Vector3.back * kickOffset; } } } public class AH64FlightAudio : MonoBehaviour { private const string collectiveChirp = "Play_captain_drone_quick_move"; private InputBankTest inputBank; private CharacterMotor motor; private CharacterBody body; private AH64HoverController hoverController; private AudioSource rotorSource; private AudioSource inFlightSource; private AudioSource climbSource; private float inFlightVolumeVelocity; private float climbVolumeVelocity; private bool collectiveWasHeld; private void Start() { inputBank = ((Component)this).GetComponent(); motor = ((Component)this).GetComponent(); body = ((Component)this).GetComponent(); hoverController = ((Component)this).GetComponent(); rotorSource = CreateLoopSource(AH64Assets.rotorHoverLoop, "Approved grounded rotor hover clip"); inFlightSource = CreateLoopSource(AH64Assets.rotorInFlightLoop, "Rotor in-flight layer clip"); climbSource = CreateLoopSource(AH64Assets.rotorClimbLoop, "Rotor climb layer clip"); if (Object.op_Implicit((Object)(object)rotorSource)) { rotorSource.volume = AH64PlaytestConfig.RotorHoverVolume; } } private AudioSource CreateLoopSource(AudioClip clip, string missingClipLabel) { if (!Object.op_Implicit((Object)(object)clip)) { Log.Warning(missingClipLabel + " was not found in the ah64 bundle; that layer will stay silent."); return null; } AudioSource obj = ((Component)this).gameObject.AddComponent(); obj.clip = clip; obj.loop = true; obj.playOnAwake = false; obj.spatialBlend = 1f; obj.rolloffMode = (AudioRolloffMode)0; obj.minDistance = 20f; obj.maxDistance = 70f; obj.dopplerLevel = 0f; obj.volume = 0f; obj.time = Random.Range(0f, clip.length); obj.Play(); return obj; } private void ApplyBasePitches() { if (Object.op_Implicit((Object)(object)rotorSource)) { rotorSource.pitch = 1.045f; } if (Object.op_Implicit((Object)(object)climbSource)) { climbSource.pitch = 1.02f; } } private void Update() { if (Object.op_Implicit((Object)(object)rotorSource)) { rotorSource.volume = AH64PlaytestConfig.RotorHoverVolume; } ApplyBasePitches(); UpdateMovementLayers(); bool flag = Object.op_Implicit((Object)(object)inputBank) && inputBank.jump.down; if (flag && !collectiveWasHeld) { Util.PlaySound("Play_captain_drone_quick_move", ((Component)this).gameObject); } collectiveWasHeld = flag; } private void UpdateMovementLayers() { //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) float deltaTime = Time.deltaTime; if (Object.op_Implicit((Object)(object)inFlightSource)) { float num = 0f; if (Object.op_Implicit((Object)(object)motor) && Object.op_Implicit((Object)(object)body) && body.moveSpeed > 0.01f) { Vector3 velocity = motor.velocity; velocity.y = 0f; num = Mathf.Clamp01(((Vector3)(ref velocity)).magnitude / body.moveSpeed); } float num2 = num * AH64PlaytestConfig.RotorInFlightVolume; inFlightSource.volume = Mathf.SmoothDamp(inFlightSource.volume, num2, ref inFlightVolumeVelocity, 0.6f, float.PositiveInfinity, deltaTime); inFlightSource.pitch = 1.106f; } if (Object.op_Implicit((Object)(object)climbSource)) { float num3 = (Object.op_Implicit((Object)(object)hoverController) ? Mathf.Clamp01(hoverController.AscentPitchWeight) : 0f) * AH64PlaytestConfig.RotorClimbVolume; climbSource.volume = Mathf.SmoothDamp(climbSource.volume, num3, ref climbVolumeVelocity, 0.6f, float.PositiveInfinity, deltaTime); } } private void OnDisable() { StopRotor(); } private void OnDestroy() { StopRotor(); } private void StopRotor() { if (Object.op_Implicit((Object)(object)rotorSource)) { rotorSource.Stop(); } if (Object.op_Implicit((Object)(object)inFlightSource)) { inFlightSource.Stop(); } if (Object.op_Implicit((Object)(object)climbSource)) { climbSource.Stop(); } } } [DefaultExecutionOrder(200)] public class AH64FlightVisuals : MonoBehaviour { private static readonly int TintColorId = Shader.PropertyToID("_TintColor"); private CharacterMotor motor; private CharacterDirection characterDirection; private ModelLocator modelLocator; private AH64HoverController hover; private InputBankTest inputBank; private Transform model; private Transform modelBase; private float washCooldown; private Renderer blurMain; private Renderer blurTail; private MaterialPropertyBlock blurBlock; private Color blurTint; private float blurEffort; private float barrelRollSign; private float barrelRollTimer; private float barrelRollDuration; private float backflipTimer; private float backflipDuration; private Quaternion leanLocal = Quaternion.identity; public void PlayBarrelRoll(float rollSign, float duration) { //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) EnsureModelRefs(); backflipTimer = 0f; barrelRollSign = ((Mathf.Sign(rollSign) >= 0f) ? 1f : (-1f)); barrelRollDuration = Mathf.Max(duration, 0.01f); barrelRollTimer = barrelRollDuration; leanLocal = Quaternion.identity; } public void PlayBackflip(float duration) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) EnsureModelRefs(); barrelRollTimer = 0f; backflipDuration = Mathf.Max(duration, 0.01f); backflipTimer = backflipDuration; leanLocal = Quaternion.identity; } private void Start() { motor = ((Component)this).GetComponent(); characterDirection = ((Component)this).GetComponent(); modelLocator = ((Component)this).GetComponent(); hover = ((Component)this).GetComponent(); inputBank = ((Component)this).GetComponent(); EnsureModelRefs(); if (Object.op_Implicit((Object)(object)model)) { modelLocator.autoUpdateModelTransform = false; ChildLocator component = ((Component)model).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { blurMain = BindBlurDisc(component, "RotorBlurMain"); blurTail = BindBlurDisc(component, "RotorBlurTail"); } } } private void OnDestroy() { if (Object.op_Implicit((Object)(object)modelLocator)) { modelLocator.autoUpdateModelTransform = true; } } private void EnsureModelRefs() { if (!Object.op_Implicit((Object)(object)modelLocator)) { modelLocator = ((Component)this).GetComponent(); } if (Object.op_Implicit((Object)(object)modelLocator)) { model = modelLocator.modelTransform; modelBase = modelLocator.modelBaseTransform; } } private Renderer BindBlurDisc(ChildLocator locator, string childName) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_006b: 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_007d: Unknown result type (might be due to invalid IL or missing references) Transform val = locator.FindChild(childName); Renderer val2 = (Object.op_Implicit((Object)(object)val) ? ((Component)val).GetComponent() : null); if (!Object.op_Implicit((Object)(object)val2)) { return null; } if (blurBlock == null) { blurBlock = new MaterialPropertyBlock(); blurTint = (Color)((Object.op_Implicit((Object)(object)val2.sharedMaterial) && val2.sharedMaterial.HasProperty(TintColorId)) ? val2.sharedMaterial.GetColor(TintColorId) : new Color(0.24f, 0.25f, 0.27f, 0.17f)); } return val2; } private void LateUpdate() { //IL_002a: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_006b: 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_009e: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: 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_00c9: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)model) && Object.op_Implicit((Object)(object)motor)) { if (backflipTimer > 0f) { leanLocal = EvaluateBackflipLean(); } else if (barrelRollTimer > 0f) { leanLocal = EvaluateBarrelRollLean(); } else { leanLocal = EvaluateFlightLean(); } Quaternion val = (Object.op_Implicit((Object)(object)modelBase) ? modelBase.rotation : YawBasisFallback()); Vector3 val2 = (Object.op_Implicit((Object)(object)modelBase) ? modelBase.position : ((Component)this).transform.position); model.SetPositionAndRotation(val2, val * leanLocal); TryRotorWash(); UpdateRotorBlur(motor.velocity); } } private Quaternion YawBasisFallback() { //IL_0020: 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_0025: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (Object.op_Implicit((Object)(object)characterDirection) ? characterDirection.forward : ((Component)this).transform.forward); val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 0.0001f) { val = ((Component)this).transform.forward; } return Util.QuaternionSafeLookRotation(((Vector3)(ref val)).normalized, Vector3.up); } private Quaternion EvaluateBarrelRollLean() { //IL_00c4: Unknown result type (might be due to invalid IL or missing references) barrelRollTimer -= Time.deltaTime; float num = 1f - Mathf.Clamp01(barrelRollTimer / barrelRollDuration); float num2 = barrelRollSign * 360f * num; float num3 = ((num < 0.25f) ? (-28f * (num / 0.25f)) : ((num < 0.55f) ? Mathf.Lerp(-28f, 4f, (num - 0.25f) / 0.3f) : ((!(num < 0.85f)) ? Mathf.Lerp(12f, 0f, (num - 0.85f) / 0.15f) : Mathf.Lerp(4f, 12f, (num - 0.55f) / 0.3f)))); return Quaternion.Euler(num3, 0f, num2); } private Quaternion EvaluateBackflipLean() { //IL_005d: Unknown result type (might be due to invalid IL or missing references) backflipTimer -= Time.deltaTime; float num = 1f - Mathf.Clamp01(backflipTimer / backflipDuration); float num2 = num * num * (3f - 2f * num); float num3 = 360f * num2; float num4 = Mathf.Sin(num2 * MathF.PI) * 10f; return Quaternion.Euler(num3, 0f, num4); } private Quaternion EvaluateFlightLean() { //IL_0020: 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_0025: 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_0058: 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_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_006e: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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_00b1: 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_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018c: 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_01a9: Unknown result type (might be due to invalid IL or missing references) Vector3 val = (Object.op_Implicit((Object)(object)characterDirection) ? characterDirection.forward : ((Component)this).transform.forward); val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 0.0001f) { val = ((Component)this).transform.forward; } ((Vector3)(ref val)).Normalize(); Vector3 val2 = Vector3.Cross(Vector3.up, val); Vector3 normalized = ((Vector3)(ref val2)).normalized; Vector3 velocity = motor.velocity; float num = Vector3.Dot(velocity, val); float num2 = Vector3.Dot(velocity, normalized); float y = velocity.y; float num3 = 0f; float num4 = 0f; if (Object.op_Implicit((Object)(object)inputBank)) { Vector3 moveVector = inputBank.moveVector; num3 = Vector3.Dot(moveVector, val); num4 = Vector3.Dot(moveVector, normalized); } float num5 = 0.55f; float num6 = 1f - num5; float num7 = Mathf.Clamp(num6 * ((0f - num) * 0.5f + y * 0.4f) + num5 * ((0f - num3) * 12f), -14f, 14f); if (Object.op_Implicit((Object)(object)hover)) { float ascentPitchWeight = hover.AscentPitchWeight; num7 = ((!(ascentPitchWeight >= 0f)) ? (num7 + (0f - ascentPitchWeight) * 8f) : (num7 + ascentPitchWeight * -16f)); } num7 = Mathf.Clamp(num7, -18f, 22f); float num8 = Mathf.Clamp(num6 * ((0f - num2) * 0.85f) + num5 * ((0f - num4) * 16f), -20f, 20f); Quaternion val3 = Quaternion.Euler(num7, 0f, num8); return Quaternion.Slerp(leanLocal, val3, 1f - Mathf.Exp(-7f * Time.deltaTime)); } private void UpdateRotorBlur(Vector3 velocity) { if (Object.op_Implicit((Object)(object)blurMain) || Object.op_Implicit((Object)(object)blurTail)) { float num = Mathf.Clamp01(((Vector3)(ref velocity)).magnitude / 14f); if (Object.op_Implicit((Object)(object)inputBank) && inputBank.jump.down) { num = Mathf.Clamp01(num + 0.55f); } else if (Object.op_Implicit((Object)(object)hover) && hover.IsAscending) { num = Mathf.Clamp01(num + 0.385f); } if (barrelRollTimer > 0f || backflipTimer > 0f) { num = Mathf.Clamp01(num + 0.45f); } blurEffort = Mathf.Lerp(blurEffort, num, 1f - Mathf.Exp(-5f * Time.deltaTime)); bool flag = blurEffort > 0.18f; float alpha = (flag ? (0.17f * Mathf.InverseLerp(0.18f, 1f, blurEffort)) : 0f); ApplyBlur(blurMain, flag, alpha); ApplyBlur(blurTail, flag, alpha); } } private void ApplyBlur(Renderer renderer, bool visible, float alpha) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)renderer)) { if (((Component)renderer).gameObject.activeSelf != visible) { ((Component)renderer).gameObject.SetActive(visible); } if (visible) { blurBlock.SetColor(TintColorId, new Color(blurTint.r, blurTint.g, blurTint.b, alpha)); renderer.SetPropertyBlock(blurBlock); } } } private void TryRotorWash() { //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_0107: 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_011e: Expected O, but got Unknown washCooldown -= Time.deltaTime; if (!(washCooldown > 0f) && AH64PlaytestConfig.RotorWashEnabled && Object.op_Implicit((Object)(object)hover) && Object.op_Implicit((Object)(object)AH64Assets.RotorWashEffect) && !(hover.GroundDistance < 0f) && !(hover.GroundDistance > 8f)) { float num = Mathf.Clamp01(((Vector3)(ref motor.velocity)).magnitude / 10f); if (hover.IsAscending) { num = Mathf.Clamp01(num + 0.35f); } washCooldown = Mathf.Lerp(0.45f, 0.18f, num); float num2 = 1f - Mathf.Clamp01(hover.GroundDistance / 8f); float scale = Mathf.Lerp(0.55f, 1.4f, num2) * Mathf.Lerp(0.8f, 1.15f, num) * 1.35f; EffectManager.SpawnEffect(AH64Assets.RotorWashEffect, new EffectData { origin = ((Component)this).transform.position, scale = scale }, false); } } } public class AH64GatlingSpin : MonoBehaviour { private const float MaxRpm = 640f; private const float SpoolUpRpmPerSecond = 1500f; private const float SpoolDownRpmPerSecond = 520f; private const string SpoolUpSound = "Play_clayBruiser_attack1_windUp"; private const string FireLoopSound = "Play_clayBruiser_attack1_shootLoop"; private const string FireLoopStopSound = "Stop_clayBruiser_attack1_shootLoop"; private const string SpoolDownSound = "Play_clayBruiser_attack1_windDown"; private const float LoopEnterFraction = 0.45f; private Transform gatling; private Vector3 spinAxis = Vector3.up; private Renderer gatlingRenderer; private Renderer barrelRenderer; private float currentRpm; private bool firing; private bool loopPlaying; private bool spoolUpPlayed; private bool gatlingEquipped; private bool appliedOnce; private float lastFireTime = -99f; private const float FiringHoldTime = 0.18f; public float SpoolFraction => currentRpm / 640f; public void NotifyFiring() { firing = true; lastFireTime = Time.time; } private void Start() { //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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) ModelLocator component = ((Component)this).GetComponent(); if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.modelTransform)) { return; } ChildLocator component2 = ((Component)component.modelTransform).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { gatling = component2.FindChild("ChinGatling"); if (Object.op_Implicit((Object)(object)gatling)) { gatlingRenderer = ((Component)gatling).GetComponent(); Vector3 val = gatling.InverseTransformDirection(component.modelTransform.forward); spinAxis = ((((Vector3)(ref val)).sqrMagnitude > 0.001f) ? ((Vector3)(ref val)).normalized : Vector3.up); } Transform val2 = component2.FindChild("ChinBarrel"); if (Object.op_Implicit((Object)(object)val2)) { barrelRenderer = ((Component)val2).GetComponent(); } RefreshEquippedWeapon(); } } private void RefreshEquippedWeapon() { SkillLocator component = ((Component)this).GetComponent(); bool flag = Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.primary) && (Object)(object)component.primary.skillDef == (Object)(object)AH64Assets.gatlingSkillDef; if (!appliedOnce || flag != gatlingEquipped) { appliedOnce = true; gatlingEquipped = flag; if (Object.op_Implicit((Object)(object)gatlingRenderer)) { gatlingRenderer.forceRenderingOff = !flag; } if (Object.op_Implicit((Object)(object)barrelRenderer)) { barrelRenderer.forceRenderingOff = flag; } if (!flag) { StopLoop(); currentRpm = 0f; firing = false; spoolUpPlayed = false; } } } private void Update() { //IL_013e: Unknown result type (might be due to invalid IL or missing references) RefreshEquippedWeapon(); if (!gatlingEquipped || !Object.op_Implicit((Object)(object)gatling)) { return; } float deltaTime = Time.deltaTime; if (firing && Time.time - lastFireTime > 0.18f) { firing = false; } if (firing) { if (!spoolUpPlayed) { Util.PlaySound("Play_clayBruiser_attack1_windUp", ((Component)this).gameObject); spoolUpPlayed = true; } currentRpm = Mathf.Min(640f, currentRpm + 1500f * deltaTime); } else { if (spoolUpPlayed && currentRpm > 0f) { Util.PlaySound("Play_clayBruiser_attack1_windDown", ((Component)this).gameObject); spoolUpPlayed = false; } currentRpm = Mathf.Max(0f, currentRpm - 520f * deltaTime); } bool flag = firing && SpoolFraction >= 0.45f; if (flag && !loopPlaying) { Util.PlaySound("Play_clayBruiser_attack1_shootLoop", ((Component)this).gameObject); loopPlaying = true; } else if (!flag && loopPlaying) { StopLoop(); } if (!(currentRpm <= 0f)) { gatling.Rotate(spinAxis, currentRpm * 6f * deltaTime, (Space)1); } } private void StopLoop() { if (loopPlaying) { Util.PlaySound("Stop_clayBruiser_attack1_shootLoop", ((Component)this).gameObject); loopPlaying = false; } } private void OnDisable() { StopLoop(); currentRpm = 0f; firing = false; spoolUpPlayed = false; } } internal class AH64HoverController : MonoBehaviour { private CharacterMotor motor; private CharacterBody body; private float timeWithoutGround; private float spawnGrace; private float lastValidGroundDistance; private float probeMissTimer; private float pitchWeightVelocity; public float TargetHeight { get; private set; } public bool IsAscending { get; private set; } public float AscentPitchWeight { get; private set; } public float GroundDistance { get; private set; } public void BumpTargetHeight(float amount) { if (!(amount <= 0f)) { TargetHeight = Mathf.Min(TargetHeight + amount, GetCeiling()); } } private void Awake() { motor = ((Component)this).GetComponent(); body = ((Component)this).GetComponent(); } private void Start() { ConfigureMotor(); TargetHeight = 3f; lastValidGroundDistance = 3f; GroundDistance = lastValidGroundDistance; spawnGrace = 0.75f; } private void ConfigureMotor() { //IL_0016: 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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)motor)) { motor.flightParameters = new CharacterFlightParameters { channeledFlightGranterCount = 1 }; motor.gravityParameters = new CharacterGravityParameters { channeledAntiGravityGranterCount = 1 }; motor.airControl = 1f; } } public float GetCeiling() { return 3f + GetMaxRise(); } public float GetMaxRise() { int num = ((!Object.op_Implicit((Object)(object)body)) ? 1 : Mathf.Max(body.maxJumpCount, 1)); return 10f + (float)(num - 1) * 4f; } public void ApplyHover(bool jumpHeld, bool descendHeld, float deltaTime) { //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)motor) || !Object.op_Implicit((Object)(object)body)) { return; } if (!motor.isFlying || motor.useGravity) { ConfigureMotor(); } ResolveGroundDistance(deltaTime); UpdateTargetHeight(jumpHeld, descendHeld, deltaTime); UpdateAscentPitch(deltaTime); if (spawnGrace > 0f) { spawnGrace -= deltaTime; } float num = 16f; float num2 = 14f; if (descendHeld) { num2 *= 2.2f; } float num3; if (GroundDistance < 0f && spawnGrace <= 0f) { num3 = -12f; timeWithoutGround += deltaTime; if (timeWithoutGround >= 3f) { RecoverFromVoid(); } } else if (GroundDistance < 0f) { num3 = 0f; timeWithoutGround = 0f; } else { timeWithoutGround = 0f; float num4 = TargetHeight - GroundDistance; float y = motor.velocity.y; num3 = num4 * 6.5f - y * 1.15f; num3 = Mathf.Clamp(num3, 0f - num2, num); } if (num3 > 0f && motor.isGrounded) { ((BaseCharacterController)motor).Motor.ForceUnground(0.1f); } float moveSpeed = body.moveSpeed; if (!(moveSpeed <= 0f)) { Vector3 moveDirection = motor.moveDirection; moveDirection.y = num3 / moveSpeed; motor.moveDirection = moveDirection; } } private void ResolveGroundDistance(float deltaTime) { float num = ProbeGround(); if (num >= 0f) { lastValidGroundDistance = num; probeMissTimer = 0f; GroundDistance = num; return; } probeMissTimer += deltaTime; if (probeMissTimer <= 0.35f && lastValidGroundDistance >= 0f) { GroundDistance = lastValidGroundDistance; } else { GroundDistance = -1f; } } private void UpdateTargetHeight(bool jumpHeld, bool descendHeld, float deltaTime) { float ceiling = GetCeiling(); if (jumpHeld) { TargetHeight = Mathf.MoveTowards(TargetHeight, ceiling, 14f * deltaTime); } else { float num = 7f; if (descendHeld) { num *= 2.2f; } TargetHeight = Mathf.MoveTowards(TargetHeight, 3f, num * deltaTime); } if (GroundDistance >= 0f) { TargetHeight = Mathf.Min(TargetHeight, GroundDistance + 5f); } TargetHeight = Mathf.Clamp(TargetHeight, 3f, ceiling); IsAscending = jumpHeld && TargetHeight > 3.25f && (GroundDistance < 0f || GroundDistance < ceiling - 0.35f); } private void UpdateAscentPitch(float deltaTime) { float num = 0f; if (GroundDistance >= 0f) { num = TargetHeight - GroundDistance; } float num2 = (Object.op_Implicit((Object)(object)motor) ? motor.velocity.y : 0f); float num3 = Mathf.Clamp(num * 0.35f + num2 * 0.12f, -1f, 1f); AscentPitchWeight = Mathf.SmoothDamp(AscentPitchWeight, num3, ref pitchWeightVelocity, 0.18f, 20f, deltaTime); } private void RecoverFromVoid() { //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_0090: 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_00b2: Unknown result type (might be due to invalid IL or missing references) timeWithoutGround = 0f; probeMissTimer = 0f; lastValidGroundDistance = 3f; spawnGrace = 0.75f; TargetHeight = 3f; IsAscending = false; AscentPitchWeight = 0f; pitchWeightVelocity = 0f; if (Object.op_Implicit((Object)(object)Run.instance) && Object.op_Implicit((Object)(object)body)) { Vector3 val = Run.instance.FindSafeTeleportPosition(body, (Transform)null, 0f, 0f); TeleportHelper.TeleportBody(body, val, false); GameObject teleportEffectPrefab = Run.instance.GetTeleportEffectPrefab(((Component)this).gameObject); if (Object.op_Implicit((Object)(object)teleportEffectPrefab)) { EffectManager.SimpleEffect(teleportEffectPrefab, val, Quaternion.identity, true); } } } private float ProbeGround() { //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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; position.y += motor.capsuleYOffset - motor.capsuleHeight * 0.5f; position.y += 0.5f; float num = 60.5f; RaycastHit val = default(RaycastHit); if (!Physics.Raycast(position, Vector3.down, ref val, num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { return -1f; } return Mathf.Max(((RaycastHit)(ref val)).distance - 0.5f, 0f); } } public class AH64LobbyDisplayBoost : MonoBehaviour { private static bool loggedOnce; private void OnEnable() { Apply(); } private void Start() { Apply(); } private void Apply() { //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) Renderer[] componentsInChildren = ((Component)this).GetComponentsInChildren(true); int num = 0; foreach (Renderer val in componentsInChildren) { if (!Object.op_Implicit((Object)(object)val) || val is ParticleSystemRenderer) { continue; } Material[] sharedMaterials = val.sharedMaterials; if (sharedMaterials == null || sharedMaterials.Length == 0) { continue; } Material[] array = null; for (int j = 0; j < sharedMaterials.Length; j++) { Material val2 = sharedMaterials[j]; if (!Object.op_Implicit((Object)(object)val2)) { continue; } Material val3 = val2; if (!((Object)val3).name.EndsWith(" (Lobby)")) { val3 = Object.Instantiate(val2); ((Object)val3).name = ((Object)val2).name.Replace(" (Instance)", "") + " (Lobby)"; if (array == null) { array = (Material[])(object)new Material[sharedMaterials.Length]; for (int k = 0; k < sharedMaterials.Length; k++) { array[k] = sharedMaterials[k]; } } array[j] = val3; } BoostMaterial(val3); num++; } if (array != null) { val.sharedMaterials = array; } } CharacterModel component = ((Component)this).GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.baseRendererInfos != null) { RendererInfo[] baseRendererInfos = component.baseRendererInfos; for (int l = 0; l < baseRendererInfos.Length; l++) { RendererInfo val4 = baseRendererInfos[l]; if (Object.op_Implicit((Object)(object)val4.renderer)) { Material sharedMaterial = val4.renderer.sharedMaterial; if (Object.op_Implicit((Object)(object)sharedMaterial)) { val4.defaultMaterial = sharedMaterial; baseRendererInfos[l] = val4; } } } component.baseRendererInfos = baseRendererInfos; } if (!loggedOnce) { loggedOnce = true; Log.Info($"AH64LobbyDisplayBoost: brightened {num} lobby material slot(s)."); } } private static void BoostMaterial(Material mat) { //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) string name = ((Object)mat).name; bool num = name.Contains("matAH64Body") || name.Contains("matAH64Markings"); bool flag = name.Contains("Glass") || name.Contains("Optics"); bool flag2 = name.Contains("matAH64Dark") || name.Contains("Radar") || name.Contains("Rotor"); Color val = default(Color); float num2; if (num) { ((Color)(ref val))..ctor(0.7f, 0.76f, 0.52f, 1f); num2 = 0.85f; } else if (flag) { ((Color)(ref val))..ctor(0.28f, 0.42f, 0.5f, 1f); num2 = 0.45f; } else if (flag2) { ((Color)(ref val))..ctor(0.42f, 0.46f, 0.36f, 1f); num2 = 0.65f; } else { ((Color)(ref val))..ctor(0.62f, 0.68f, 0.5f, 1f); num2 = 0.7f; } if (mat.HasProperty("_Color")) { mat.SetColor("_Color", val); } if (mat.HasProperty("_EmColor")) { mat.SetColor("_EmColor", val * 0.4f); } if (mat.HasProperty("_EmPower")) { mat.SetFloat("_EmPower", num2); } if (mat.HasProperty("_SpecularStrength")) { mat.SetFloat("_SpecularStrength", Mathf.Max(mat.GetFloat("_SpecularStrength"), 0.4f)); } if (mat.HasProperty("_Smoothness")) { mat.SetFloat("_Smoothness", Mathf.Max(mat.GetFloat("_Smoothness"), 0.38f)); } } } internal class AH64PassiveComponent : MonoBehaviour { private static readonly int EmColorId = Shader.PropertyToID("_EmColor"); private static readonly int EmPowerId = Shader.PropertyToID("_EmPower"); private CharacterBody body; private TeamComponent teamComponent; private InputBankTest inputBank; private CharacterDirection characterDirection; private BullseyeSearch search; private Indicator paintIndicator; private EntityStateMachine weapon2Machine; private Transform radarDome; private Renderer radarDomeRenderer; private MaterialPropertyBlock domeBlock; private Color domeEmColor = new Color(0.03f, 0.06f, 0.07f); private float retargetStopwatch; private bool lastFacing; private bool lastClose; public CharacterBody PaintedBody { get; private set; } public bool FacingPainted { get; private set; } public bool CloseToPainted { get; private set; } private void Awake() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown body = ((Component)this).GetComponent(); teamComponent = ((Component)this).GetComponent(); inputBank = ((Component)this).GetComponent(); characterDirection = ((Component)this).GetComponent(); search = new BullseyeSearch(); weapon2Machine = EntityStateMachine.FindByCustomName(((Component)this).gameObject, "Weapon2"); domeBlock = new MaterialPropertyBlock(); } private void Start() { ResolveRadarDome(); if (Object.op_Implicit((Object)(object)AH64Assets.RadarPaintIndicatorPrefab)) { paintIndicator = (Indicator)(object)new RadarPaintIndicator(((Component)this).gameObject, AH64Assets.RadarPaintIndicatorPrefab); } retargetStopwatch = 6.8f; } private void OnEnable() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage); } private void OnDisable() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown HealthComponent.TakeDamage -= new hook_TakeDamage(HealthComponent_TakeDamage); ClearPaint(); } private void OnDestroy() { ClearPaint(); } private void Update() { UpdateDomeVisuals(); } private void FixedUpdate() { if (Object.op_Implicit((Object)(object)body)) { retargetStopwatch += Time.fixedDeltaTime; if (retargetStopwatch >= 8f) { retargetStopwatch = 0f; Retarget(); } else if (Object.op_Implicit((Object)(object)PaintedBody) && (!Object.op_Implicit((Object)(object)PaintedBody.healthComponent) || !PaintedBody.healthComponent.alive)) { ClearPaint(); } UpdateFacingAndClose(); UpdatePaintVisibility(); } } private void ResolveRadarDome() { //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown //IL_00d3: 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) ModelLocator component = ((Component)this).GetComponent(); Transform val = (Object.op_Implicit((Object)(object)component) ? component.modelTransform : null); ChildLocator val2 = (Object.op_Implicit((Object)(object)val) ? ((Component)val).GetComponent() : null); if (!Object.op_Implicit((Object)(object)val2)) { return; } radarDome = val2.FindChild("RadarDome"); if (Object.op_Implicit((Object)(object)radarDome)) { radarDomeRenderer = ((Component)radarDome).GetComponent(); return; } Transform val3 = val2.FindChild("Head"); if (!Object.op_Implicit((Object)(object)val3)) { val3 = val; } GameObject val4 = new GameObject("RadarDome"); val4.transform.SetParent(Object.op_Implicit((Object)(object)val3) ? val3 : val, false); val4.transform.localPosition = (Object.op_Implicit((Object)(object)val3) ? new Vector3(0f, 0.35f, 0f) : new Vector3(0f, 1.6f, 0.2f)); radarDome = val4.transform; } private void UpdateDomeVisuals() { //IL_00b7: 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) if (Object.op_Implicit((Object)(object)radarDome)) { bool flag = Object.op_Implicit((Object)(object)PaintedBody); float num = (flag ? 140f : 40f); radarDome.Rotate(0f, num * Time.deltaTime, 0f, (Space)1); if (Object.op_Implicit((Object)(object)radarDomeRenderer)) { float num2 = (flag ? 0.55f : 0.25f); num2 *= 0.85f + 0.15f * (0.5f + 0.5f * Mathf.Sin(Time.time * (flag ? 8f : 3f))); radarDomeRenderer.GetPropertyBlock(domeBlock); domeBlock.SetColor(EmColorId, domeEmColor * num2); domeBlock.SetFloat(EmPowerId, num2); radarDomeRenderer.SetPropertyBlock(domeBlock); } } } private void Retarget() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a1: 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_00b2: 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_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_0182: 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_0197: Unknown result type (might be due to invalid IL or missing references) TeamIndex val = (TeamIndex)((!Object.op_Implicit((Object)(object)teamComponent)) ? (-1) : ((int)teamComponent.teamIndex)); search.filterByDistinctEntity = true; search.filterByLoS = false; search.minDistanceFilter = 0f; search.maxDistanceFilter = 90f; search.minAngleFilter = 0f; search.maxAngleFilter = 180f; search.viewer = body; search.searchOrigin = body.corePosition; search.searchDirection = Vector3.forward; search.sortMode = (SortMode)1; search.teamMaskFilter = TeamMask.GetUnprotectedTeams(val); search.RefreshCandidates(); search.FilterOutGameObject(((Component)this).gameObject); HurtBox val2 = null; float num = -1f; bool flag = false; float num2 = float.MaxValue; foreach (HurtBox result in search.GetResults()) { if (!Object.op_Implicit((Object)(object)result) || !Object.op_Implicit((Object)(object)result.healthComponent) || !result.healthComponent.alive) { continue; } CharacterBody val3 = result.healthComponent.body; if (!Object.op_Implicit((Object)(object)val3)) { continue; } float fullCombinedHealth = val3.healthComponent.fullCombinedHealth; bool flag2 = val3.isElite || val3.isBoss; Vector3 val4 = val3.corePosition - body.corePosition; float sqrMagnitude = ((Vector3)(ref val4)).sqrMagnitude; bool flag3 = false; if (fullCombinedHealth > num + 0.5f) { flag3 = true; } else if (Mathf.Abs(fullCombinedHealth - num) <= 0.5f) { if (flag2 && !flag) { flag3 = true; } else if (flag2 == flag && sqrMagnitude < num2) { flag3 = true; } } if (flag3) { val2 = result; num = fullCombinedHealth; flag = flag2; num2 = sqrMagnitude; } } PlayScanPulse(); if (!Object.op_Implicit((Object)(object)val2)) { ClearPaint(); return; } CharacterBody val5 = val2.healthComponent.body; if ((Object)(object)val5 != (Object)(object)PaintedBody) { RemovePaintBuff(PaintedBody); PaintedBody = val5; ApplyPaintBuff(PaintedBody); PlayPaintPing(PaintedBody); ShowTargetAcquiredNotification(PaintedBody); body.MarkAllStatsDirty(); } RefreshIndicator(); } private void RefreshIndicator() { if (paintIndicator != null) { if (Object.op_Implicit((Object)(object)PaintedBody) && !IsLongbowTargeting()) { paintIndicator.targetTransform = (Object.op_Implicit((Object)(object)PaintedBody.mainHurtBox) ? ((Component)PaintedBody.mainHurtBox).transform : PaintedBody.transform); paintIndicator.active = true; } else { paintIndicator.active = false; } } } private void UpdatePaintVisibility() { if (paintIndicator != null) { if (IsLongbowTargeting()) { paintIndicator.active = false; } else if (Object.op_Implicit((Object)(object)PaintedBody)) { RefreshIndicator(); } } } private bool IsLongbowTargeting() { if (!Object.op_Implicit((Object)(object)weapon2Machine) || weapon2Machine.state == null) { return false; } Type type = ((object)weapon2Machine.state).GetType(); if (!(type == typeof(PaintLongbow))) { return type == typeof(FireLongbow); } return true; } private void ClearPaint() { if ((Object)(object)PaintedBody != (Object)null) { RemovePaintBuff(PaintedBody); PaintedBody = null; if (Object.op_Implicit((Object)(object)body)) { body.MarkAllStatsDirty(); } } if (paintIndicator != null) { paintIndicator.active = false; } FacingPainted = false; CloseToPainted = false; lastFacing = false; lastClose = false; } private void ApplyPaintBuff(CharacterBody target) { if (NetworkServer.active && Object.op_Implicit((Object)(object)target) && Object.op_Implicit((Object)(object)AH64Buffs.radarPaintedBuff) && !target.HasBuff(AH64Buffs.radarPaintedBuff)) { target.AddBuff(AH64Buffs.radarPaintedBuff); } } private void RemovePaintBuff(CharacterBody target) { if (NetworkServer.active && Object.op_Implicit((Object)(object)target) && Object.op_Implicit((Object)(object)AH64Buffs.radarPaintedBuff) && target.HasBuff(AH64Buffs.radarPaintedBuff)) { target.RemoveBuff(AH64Buffs.radarPaintedBuff); } } private void UpdateFacingAndClose() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: 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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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_00d5: Unknown result type (might be due to invalid IL or missing references) bool flag = false; bool flag2 = false; if (Object.op_Implicit((Object)(object)PaintedBody) && Object.op_Implicit((Object)(object)body)) { Vector3 val = PaintedBody.corePosition - body.corePosition; flag2 = ((Vector3)(ref val)).sqrMagnitude <= 625f; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude > 0.0001f) { ((Vector3)(ref val)).Normalize(); Vector3 val2 = (Object.op_Implicit((Object)(object)inputBank) ? inputBank.aimDirection : (Object.op_Implicit((Object)(object)characterDirection) ? characterDirection.forward : ((Component)this).transform.forward)); val2.y = 0f; if (((Vector3)(ref val2)).sqrMagnitude > 0.0001f) { ((Vector3)(ref val2)).Normalize(); flag = Vector3.Dot(val2, val) >= 0.65f; } } } FacingPainted = flag; CloseToPainted = flag2; if (flag != lastFacing || flag2 != lastClose) { lastFacing = flag; lastClose = flag2; if (Object.op_Implicit((Object)(object)body)) { body.MarkAllStatsDirty(); } } } private void PlayScanPulse() { //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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) GameObject radarPulseEffect = AH64Assets.RadarPulseEffect; if (!Object.op_Implicit((Object)(object)radarPulseEffect)) { return; } Vector3 origin = (Object.op_Implicit((Object)(object)radarDome) ? radarDome.position : (Object.op_Implicit((Object)(object)body) ? (body.corePosition + Vector3.up * 1.5f) : ((Component)this).transform.position)); EffectData val = new EffectData { origin = origin, scale = 5.5f, color = AH64Assets.RadarEffectColor }; if (Object.op_Implicit((Object)(object)radarDome)) { ModelLocator component = ((Component)this).GetComponent(); ChildLocator val2 = ((Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.modelTransform)) ? ((Component)component.modelTransform).GetComponent() : null); int num = (Object.op_Implicit((Object)(object)val2) ? val2.FindChildIndex("RadarDome") : (-1)); if (num >= 0) { val.SetChildLocatorTransformReference(((Component)this).gameObject, num); } else { val.SetNetworkedObjectReference(((Component)radarDome).gameObject); } } EffectManager.SpawnEffect(radarPulseEffect, val, false); Util.PlaySound("Play_UI_menuHover", ((Component)this).gameObject); } private void PlayPaintPing(CharacterBody target) { //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_0020: 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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)target)) { GameObject radarPaintPingEffect = AH64Assets.RadarPaintPingEffect; if (Object.op_Implicit((Object)(object)radarPaintPingEffect)) { EffectManager.SpawnEffect(radarPaintPingEffect, new EffectData { origin = target.corePosition, scale = 1.6f, color = AH64Assets.RadarEffectColor }, false); Util.PlaySound("Play_UI_xp_gain", ((Component)this).gameObject); } } } private void ShowTargetAcquiredNotification(CharacterBody target) { //IL_0074: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.master) && ((NetworkBehaviour)body.master).hasAuthority && Object.op_Implicit((Object)(object)target)) { string text = Language.GetString("AH64_RADAR_TARGET_ACQUIRED"); string text2 = Util.GetBestBodyName(((Component)target).gameObject); if (string.IsNullOrEmpty(text2)) { text2 = Language.GetString("AH64_RADAR_TARGET_ACQUIRED_DESC"); } Chat.AddMessage("" + text + " — " + text2); } } private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { if (NetworkServer.active && damageInfo != null && Object.op_Implicit((Object)(object)damageInfo.attacker) && (Object)(object)damageInfo.attacker == (Object)(object)((Component)this).gameObject && Object.op_Implicit((Object)(object)PaintedBody) && Object.op_Implicit((Object)(object)self) && (Object)(object)self.body == (Object)(object)PaintedBody && damageInfo.damage > 0f) { damageInfo.damage *= 1.12f; } orig.Invoke(self, damageInfo); } } public class AH64PlasmaVisuals : MonoBehaviour { } public class AH64PylonMissiles : MonoBehaviour { private static readonly string[] MissileNames = new string[8] { "MissileL3", "MissileR3", "MissileL2", "MissileR2", "MissileL1", "MissileR1", "MissileL0", "MissileR0" }; private Renderer[] missiles; private SkillLocator skillLocator; private int lastShown = -1; private void Start() { skillLocator = ((Component)this).GetComponent(); ModelLocator component = ((Component)this).GetComponent(); if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.modelTransform)) { return; } ChildLocator component2 = ((Component)component.modelTransform).GetComponent(); if (!Object.op_Implicit((Object)(object)component2)) { return; } missiles = (Renderer[])(object)new Renderer[MissileNames.Length]; for (int i = 0; i < MissileNames.Length; i++) { Transform val = component2.FindChild(MissileNames[i]); if (Object.op_Implicit((Object)(object)val)) { missiles[i] = ((Component)val).GetComponent(); } } } private void Update() { if (missiles == null || (Object)(object)skillLocator == (Object)null || !Object.op_Implicit((Object)(object)skillLocator.special)) { return; } GenericSkill special = skillLocator.special; int num = Mathf.Max(1, special.maxStock); int num2 = Mathf.Clamp(special.stock, 0, num); int num3 = Mathf.CeilToInt((float)missiles.Length * ((float)num2 / (float)num)); if (num2 > 0) { num3 = Mathf.Max(1, num3); } if (num3 == lastShown) { return; } lastShown = num3; for (int i = 0; i < missiles.Length; i++) { if (Object.op_Implicit((Object)(object)missiles[i])) { missiles[i].forceRenderingOff = i >= num3; } } } } public class AH64RotorSpin : MonoBehaviour { private const float MainRotorRpm = 280f; private const float TailRotorRpm = 1200f; private Transform mainRotor; private Transform tailRotor; private void Start() { ModelLocator component = ((Component)this).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.modelTransform)) { ChildLocator component2 = ((Component)component.modelTransform).GetComponent(); if (Object.op_Implicit((Object)(object)component2)) { mainRotor = component2.FindChild("MainRotor"); tailRotor = component2.FindChild("TailRotor"); } } } private void Update() { //IL_0019: 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) float deltaTime = Time.deltaTime; if (Object.op_Implicit((Object)(object)mainRotor)) { mainRotor.Rotate(Vector3.up, 1680f * deltaTime, (Space)1); } if (Object.op_Implicit((Object)(object)tailRotor)) { tailRotor.Rotate(Vector3.up, 7200f * deltaTime, (Space)1); } } } internal class RadarPaintIndicator : Indicator { public static readonly Color PaintTint = new Color(1f, 0.18f, 0.12f, 1f); private bool tinted; public RadarPaintIndicator(GameObject owner, GameObject visualizerPrefab) : base(owner, visualizerPrefab) { } public override void UpdateVisualizer() { ((Indicator)this).UpdateVisualizer(); if (!tinted && Object.op_Implicit((Object)(object)((Indicator)this).visualizerInstance)) { TintHierarchy(((Indicator)this).visualizerInstance.transform); tinted = true; } } public override void OnDestroyVisualizer() { ((Indicator)this).OnDestroyVisualizer(); tinted = false; } private static void TintHierarchy(Transform root) { //IL_000f: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_009b: 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) SpriteRenderer[] componentsInChildren = ((Component)root).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].color = PaintTint; } Graphic[] componentsInChildren2 = ((Component)root).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren2.Length; i++) { componentsInChildren2[i].color = PaintTint; } Renderer[] componentsInChildren3 = ((Component)root).GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren3) { if (!(val is SpriteRenderer)) { MaterialPropertyBlock val2 = new MaterialPropertyBlock(); val.GetPropertyBlock(val2); if (Object.op_Implicit((Object)(object)val.sharedMaterial) && val.sharedMaterial.HasProperty("_Color")) { val2.SetColor("_Color", PaintTint); } if (Object.op_Implicit((Object)(object)val.sharedMaterial) && val.sharedMaterial.HasProperty("_TintColor")) { val2.SetColor("_TintColor", PaintTint); } val.SetPropertyBlock(val2); } } } } } namespace AH64.Survivors.Achievements { [RegisterAchievement("AH64_masteryAchievement", "AH64_masteryUnlockable", null, 10u, null)] public class AH64MasteryAchievement : BaseMasteryAchievement { public const string identifier = "AH64_masteryAchievement"; public const string unlockableIdentifier = "AH64_masteryUnlockable"; public override string RequiredCharacterBody => "AH64Body"; public override float RequiredDifficultyCoefficient => 3f; } }