Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of The Helldiver v1.0.1
plugins/HelldiversMod.dll
Decompiled 5 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; 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 BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using CleanestHud.HudChanges; using EmotesAPI; using EntityStates; using EntityStates.AI; using EntityStates.Commando.CommandoWeapon; using EntityStates.Engi.EngiBubbleShield; using EntityStates.SurvivorPod; using HG; using HG.BlendableTypes; using HelldiversMod.Modules; using HelldiversMod.Modules.Characters; using HelldiversMod.Survivors.Helldiver; using HelldiversMod.Survivors.Helldiver.Components; using HelldiversMod.Survivors.Helldiver.SkillStates; using KinematicCharacterController; using On.EntityStates.AI; using On.RoR2; using On.RoR2.UI; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using R2API.Utils; using Rewired; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using RoR2; using RoR2.Achievements; using RoR2.Audio; using RoR2.CharacterAI; using RoR2.ContentManagement; using RoR2.Projectile; using RoR2.Skills; using RoR2.Stats; using RoR2.UI; using RoR2BepInExPack.GameAssetPathsBetter; using RoR2BepInExPack.VanillaFixes; using TMPro; using ThreeEyedGames; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.Playables; using UnityEngine.Rendering; using UnityEngine.SceneManagement; 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("HelldiversMod")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("HelldiversMod")] [assembly: AssemblyTitle("HelldiversMod")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace HelldiversMod { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.Gobo.HelldiversMod", "HelldiversMod", "1.0.0")] public class HelldiversPlugin : BaseUnityPlugin { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func<Type, RegisterAchievementAttribute, RegisterAchievementAttribute> <>9__6_0; public static hook_Awake <>9__6_1; internal RegisterAchievementAttribute <Awake>b__6_0(Type type, RegisterAchievementAttribute attribute) { if (!(type.Assembly == typeof(HelldiversPlugin).Assembly)) { return attribute; } return null; } internal void <Awake>b__6_1(orig_Awake orig, HUD self) { orig.Invoke(self); ((Component)self).gameObject.AddComponent<StratagemDialHud>(); } } public const string MODUID = "com.Gobo.HelldiversMod"; public const string MODNAME = "HelldiversMod"; public const string MODVERSION = "1.0.0"; public const string DEVELOPER_PREFIX = "GOBO"; public const string BundleName = "helldiverbundle"; public static HelldiversPlugin instance; private void Awake() { //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_00d1: Expected O, but got Unknown instance = this; Log.Init(((BaseUnityPlugin)this).Logger); HelldiversStats.Init(); if ((Object)(object)Asset.LoadAssetBundle("helldiverbundle") == (Object)null) { Log.Error("asset bundle helldiverbundle not found, the mod is not loaded"); SaferAchievementManager.OnRegisterAchievementAttributeFound += (Type type, RegisterAchievementAttribute attribute) => (!(type.Assembly == typeof(HelldiversPlugin).Assembly)) ? attribute : null; return; } TrueDemocracy.Init(); HelldiversConfig.Init(((BaseUnityPlugin)this).Config); new HelldiversSurvivor().Initialize(); StratagemHeroNet.Init(); HelldiverVoice.Init(); ProjectileLandedNet.Init(); StratagemLoadoutRows.Init(); MissionControlRadio.Init(); EmoteSync.Init(); RagdollControlBoneFix.Init(); SuperDestroyerSky.Init(); IntroSwap.Init(); RescueShipSwap.Init(); ServiceRecord.Init(); StratagemHeroInteractable.Init(); HelldiversAssets.HookAmmoPacks(); object obj = <>c.<>9__6_1; if (obj == null) { hook_Awake val = delegate(orig_Awake orig, HUD self) { orig.Invoke(self); ((Component)self).gameObject.AddComponent<StratagemDialHud>(); }; <>c.<>9__6_1 = val; obj = (object)val; } HUD.Awake += (hook_Awake)obj; StratagemDialer.Init(); SkillGate.Init(); StratagemDialHud.Init(); new ContentPacks().Initialize(); } } internal static class Log { internal static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Error(object data) { _logSource.LogError(data); } internal static void ErrorAssetBundle(string assetName, string bundleName) { Error("asset '" + assetName + "' not found in bundle '" + bundleName + "'"); } internal static void Warning(object data) { _logSource.LogWarning(data); } } } namespace HelldiversMod.Modules { internal static class Asset { internal static Dictionary<string, AssetBundle> loadedBundles = new Dictionary<string, AssetBundle>(); 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)HelldiversPlugin.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 void ConvertAllRenderersToHopooShader(GameObject objectToConvert) { if (!Object.op_Implicit((Object)(object)objectToConvert)) { return; } MeshRenderer[] componentsInChildren = objectToConvert.GetComponentsInChildren<MeshRenderer>(); 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<SkinnedMeshRenderer>(); 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 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, Action<GameObject> prepare = null) { //IL_0051: 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) GameObject val = assetBundle.LoadAsset<GameObject>(resourceName); if (!Object.op_Implicit((Object)(object)val)) { Log.ErrorAssetBundle(resourceName, ((Object)assetBundle).name); return null; } if (prepare != null) { val = PrefabAPI.InstantiateClone(val, resourceName, false); prepare(val); } val.AddComponent<DestroyOnTimer>().duration = 12f; val.AddComponent<NetworkIdentity>(); val.AddComponent<VFXAttributes>().vfxPriority = (VFXPriority)2; EffectComponent obj = val.AddComponent<EffectComponent>(); 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<GameObject>(ghostName); if ((Object)(object)val == (Object)null) { Log.Error("Failed to load ghost prefab " + ghostName); } if (!Object.op_Implicit((Object)(object)val.GetComponent<NetworkIdentity>())) { val.AddComponent<NetworkIdentity>(); } if (!Object.op_Implicit((Object)(object)val.GetComponent<ProjectileGhostController>())) { val.AddComponent<ProjectileGhostController>(); } ConvertAllRenderersToHopooShader(val); return val; } } public static class Config { 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); } public static bool Typing() { ReadOnlyCollection<MPEventSystem> readOnlyInstancesList = MPEventSystem.readOnlyInstancesList; for (int i = 0; i < readOnlyInstancesList.Count; i++) { GameObject val = (((Object)(object)readOnlyInstancesList[i] != (Object)null) ? ((EventSystem)readOnlyInstancesList[i]).currentSelectedGameObject : null); if ((Object)(object)val != (Object)null && (Object)(object)val.GetComponent<TMP_InputField>() != (Object)null) { return true; } } return false; } } 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<SurvivorDef>(); 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 void AddArtifactDef(ArtifactDef artifactDef) { ContentPacks.artifactDefs.Add(artifactDef); } internal static UnlockableDef CreateAndAddUnlockbleDef(string identifier, string nameToken, Sprite achievementIcon) { UnlockableDef obj = ScriptableObject.CreateInstance<UnlockableDef>(); 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<BuffDef>(); ((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 AddNetworkedObjectPrefab(GameObject prefab) { ContentPacks.networkedObjectPrefabs.Add(prefab); } internal static void AddNetworkSoundEventDef(NetworkSoundEventDef networkSoundEventDef) { ContentPacks.networkSoundEventDefs.Add(networkSoundEventDef); } internal static NetworkSoundEventDef CreateAndAddNetworkSoundEventDef(string eventName) { NetworkSoundEventDef obj = ScriptableObject.CreateInstance<NetworkSoundEventDef>(); obj.akId = AkSoundEngine.GetIDFromString(eventName); obj.eventName = eventName; AddNetworkSoundEventDef(obj); return obj; } } internal class ContentPacks : IContentPackProvider { internal ContentPack contentPack = new ContentPack(); public static List<GameObject> bodyPrefabs = new List<GameObject>(); public static List<GameObject> masterPrefabs = new List<GameObject>(); public static List<GameObject> projectilePrefabs = new List<GameObject>(); public static List<SurvivorDef> survivorDefs = new List<SurvivorDef>(); public static List<UnlockableDef> unlockableDefs = new List<UnlockableDef>(); public static List<ArtifactDef> artifactDefs = new List<ArtifactDef>(); public static List<SkillFamily> skillFamilies = new List<SkillFamily>(); public static List<SkillDef> skillDefs = new List<SkillDef>(); public static List<Type> entityStates = new List<Type>(); public static List<BuffDef> buffDefs = new List<BuffDef>(); public static List<EffectDef> effectDefs = new List<EffectDef>(); public static List<NetworkSoundEventDef> networkSoundEventDefs = new List<NetworkSoundEventDef>(); public static List<GameObject> networkedObjectPrefabs = new List<GameObject>(); public string identifier => "com.Gobo.HelldiversMod"; 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.artifactDefs.Add(artifactDefs.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()); contentPack.networkedObjectPrefabs.Add(networkedObjectPrefabs.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 ItemDisplays { private static Dictionary<string, GameObject> itemDisplayPrefabs = new Dictionary<string, GameObject>(); public static Dictionary<Object, ItemDisplayRule[]> KeyAssetDisplayPrefabs = new Dictionary<Object, ItemDisplayRule[]>(); public static Dictionary<string, Object> KeyAssets = new Dictionary<string, Object>(); 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<GameObject>("Prefabs/CharacterBodies/" + bodyName).GetComponent<ModelLocator>().modelTransform).GetComponent<CharacterModel>().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; } } } } } 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 CreateDisplayRuleByGuid(string prefabGuid, 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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_0028: 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_0030: 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_003f: 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_0046: Unknown result type (might be due to invalid IL or missing references) return new ItemDisplayRule { ruleType = (ItemDisplayRuleType)0, childName = childName, followerPrefabAddress = new AssetReferenceGameObject(prefabGuid), 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<ItemDef>("ItemDefs/" + itemName); if (val == (Object)null) { val = (Object)(object)LegacyResourcesAPI.Load<EquipmentDef>("EquipmentDefs/" + itemName); } if (val == (Object)null) { Log.Error("Could not load keyasset for " + itemName); } return val; } } internal static class Language { public static void Add(string token, string text) { LanguageAPI.Add(token, text); } } internal static class Materials { private static List<Material> cachedMaterials = new List<Material>(); internal static Shader hotpoo = LegacyResourcesAPI.Load<Shader>("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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown materialName = materialName.Replace(" (Instance)", ""); Material val = cachedMaterials.Find((Material mat) => ((Object)mat).name.Replace(" (Instance)", "") == materialName); if (Object.op_Implicit((Object)(object)val)) { return val; } val = assetBundle.LoadAsset<Material>(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_0080: 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) if (cachedMaterials.Contains(tempMat)) { return tempMat; } string text = ((Object)tempMat.shader).name.ToLowerInvariant(); if (!text.StartsWith("standard") && !text.StartsWith("autodesk")) { 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 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 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; } } internal static class Prefabs { private static PhysicMaterial ragdollMaterial; public static GameObject CreateDisplayPrefab(AssetBundle assetBundle, string displayPrefabName, GameObject prefab) { GameObject val = assetBundle.LoadAsset<GameObject>(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<CharacterModel>(); if (!Object.op_Implicit((Object)(object)val2)) { val2 = val.AddComponent<CharacterModel>(); } val2.baseRendererInfos = prefab.GetComponentInChildren<CharacterModel>().baseRendererInfos; Asset.ConvertAllRenderersToHopooShader(val); return val; } public static GameObject LoadCharacterModel(AssetBundle assetBundle, string modelName) { GameObject val = assetBundle.LoadAsset<GameObject>(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<GameObject>(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<GameObject>("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); 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<CharacterBody>(); 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<CharacterBody>().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>())) { CharacterDirection component = prefab.GetComponent<CharacterDirection>(); component.targetTransform = modelBaseTransform; component.overrideAnimatorForwardTransform = null; component.rootMotionAccumulator = null; component.modelAnimator = ((Component)modelTransform).GetComponent<Animator>(); component.driveFromRootRotation = false; component.turnSpeed = 720f; } } private static void SetupCameraTargetParams(GameObject prefab, BodyInfo bodyInfo) { CameraTargetParams component = prefab.GetComponent<CameraTargetParams>(); component.cameraParams = bodyInfo.cameraParams; component.cameraPivotTransform = prefab.transform.Find("CameraPivot"); } private static void SetupModelLocator(GameObject prefab, Transform modelBaseTransform, Transform modelTransform) { ModelLocator component = prefab.GetComponent<ModelLocator>(); component.modelTransform = modelTransform; component.modelBaseTransform = modelBaseTransform; } private static void SetupCapsuleCollider(GameObject prefab) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) CapsuleCollider component = prefab.GetComponent<CapsuleCollider>(); component.center = new Vector3(0f, 0f, 0f); component.radius = 0.5f; component.height = 1.82f; component.direction = 1; } public static CharacterModel SetupCharacterModel(GameObject bodyPrefab, CustomRendererInfo[] customInfos = null) { CharacterModel val = ((Component)bodyPrefab.GetComponent<ModelLocator>().modelTransform).gameObject.GetComponent<CharacterModel>(); bool num = (Object)(object)val != (Object)null; if (!num) { val = ((Component)bodyPrefab.GetComponent<ModelLocator>().modelTransform).gameObject.AddComponent<CharacterModel>(); } val.body = bodyPrefab.GetComponent<CharacterBody>(); val.autoPopulateLightInfos = true; val.invisibilityCount = 0; val.temporaryOverlays = new List<TemporaryOverlayInstance>(); if (!num) { 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<ChildLocator>(); if (!Object.op_Implicit((Object)(object)component)) { Log.Error("Failed CharacterModel setup: ChildLocator component does not exist on the model"); return; } List<RendererInfo> list = new List<RendererInfo>(); 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<Renderer>(); 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_00e9: 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) if ((Object)(object)bodyPrefab.GetComponent<HurtBoxGroup>() != (Object)null) { return; } ChildLocator component = model.GetComponent<ChildLocator>(); 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<HurtBoxGroup>(); HurtBox val2 = null; GameObject val3 = component.FindChildGameObjectInsensitive("HeadHurtbox"); if (Object.op_Implicit((Object)(object)val3)) { val2 = val3.AddComponent<HurtBox>(); ((Component)val2).gameObject.layer = LayerIndex.entityPrecise.intVal; val2.healthComponent = bodyPrefab.GetComponent<HealthComponent>(); val2.isBullseye = false; val2.isSniperTarget = true; val2.damageModifier = (DamageModifier)0; val2.hurtBoxGroup = val; val2.indexInGroup = 1; } HurtBox val4 = component.FindChildGameObjectInsensitive("MainHurtbox").AddComponent<HurtBox>(); ((Component)val4).gameObject.layer = LayerIndex.entityPrecise.intVal; val4.healthComponent = bodyPrefab.GetComponent<HealthComponent>(); 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 GameObject FindChildGameObjectInsensitive(this ChildLocator childLocator, string child) { return childLocator.FindChildGameObject(childLocator.FindChildNameInsensitive(child)); } public static void SetHurtboxesHealthComponents(GameObject bodyPrefab) { HealthComponent component = bodyPrefab.GetComponent<HealthComponent>(); HurtBoxGroup[] componentsInChildren = bodyPrefab.GetComponentsInChildren<HurtBoxGroup>(); 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<FootstepHandler>(); obj.baseFootstepString = "Play_player_footstep"; obj.sprintFootstepOverrideString = ""; obj.enableFootstepDust = true; obj.footstepDustPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/GenericFootstepDust"); } private static void SetupRagdoll(GameObject model) { RagdollController component = model.GetComponent<RagdollController>(); if (!Object.op_Implicit((Object)(object)component)) { return; } if ((Object)(object)ragdollMaterial == (Object)null) { ragdollMaterial = ((Component)LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/CommandoBody").GetComponentInChildren<RagdollController>().bones[1]).GetComponent<Collider>().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<Collider>(); 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<AimAnimator>(); obj.directionComponent = prefab.GetComponent<CharacterDirection>(); 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<InputBankTest>(); } public static GameObject CreateBlankMasterPrefab(GameObject bodyPrefab, string masterName) { GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterMasters/CommandoMonsterMaster"), masterName, true); ContentPacks.masterPrefabs.Add(val); val.GetComponent<CharacterMaster>().bodyPrefab = bodyPrefab; AISkillDriver[] components = val.GetComponents<AISkillDriver>(); for (int i = 0; i < components.Length; i++) { Object.Destroy((Object)(object)components[i]); } return val; } public static void ClearEntityStateMachines(GameObject bodyPrefab) { EntityStateMachine[] components = bodyPrefab.GetComponents<EntityStateMachine>(); for (int num = components.Length - 1; num >= 0; num--) { Object.DestroyImmediate((Object)(object)components[num]); } bodyPrefab.GetComponent<NetworkStateMachine>().stateMachines = Array.Empty<EntityStateMachine>(); CharacterDeathBehavior component = bodyPrefab.GetComponent<CharacterDeathBehavior>(); if (Object.op_Implicit((Object)(object)component)) { component.idleStateMachine = Array.Empty<EntityStateMachine>(); } SetStateOnHurt component2 = bodyPrefab.GetComponent<SetStateOnHurt>(); if (Object.op_Implicit((Object)(object)component2)) { component2.idleStateMachine = Array.Empty<EntityStateMachine>(); } CharacterBody component3 = bodyPrefab.GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component3)) { component3.vehicleIdleStateMachine = Array.Empty<EntityStateMachine>(); } } public static EntityStateMachine AddEntityStateMachine(GameObject prefab, string machineName, Type mainStateType = null, Type initalStateType = null, bool addToHurt = true, bool addToDeath = true) { //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_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) EntityStateMachine val = EntityStateMachine.FindByCustomName(prefab, machineName); if ((Object)(object)val == (Object)null) { val = prefab.AddComponent<EntityStateMachine>(); } 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<NetworkStateMachine>(); if (Object.op_Implicit((Object)(object)component)) { component.stateMachines = component.stateMachines.Append(val).ToArray(); } CharacterDeathBehavior component2 = prefab.GetComponent<CharacterDeathBehavior>(); if (Object.op_Implicit((Object)(object)component2) && addToDeath) { component2.idleStateMachine = component2.idleStateMachine.Append(val).ToArray(); } SetStateOnHurt component3 = prefab.GetComponent<SetStateOnHurt>(); if (Object.op_Implicit((Object)(object)component3) && addToHurt) { component3.idleStateMachine = component3.idleStateMachine.Append(val).ToArray(); } CharacterBody component4 = prefab.GetComponent<CharacterBody>(); 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_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_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) EntityStateMachine val = EntityStateMachine.FindByCustomName(bodyPrefab, machineName); if ((Object)(object)val == (Object)null) { val = bodyPrefab.AddComponent<EntityStateMachine>(); } 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<NetworkStateMachine>(); if (Object.op_Implicit((Object)(object)component)) { component.stateMachines = component.stateMachines.Append(val).ToArray(); } CharacterDeathBehavior component2 = bodyPrefab.GetComponent<CharacterDeathBehavior>(); if (Object.op_Implicit((Object)(object)component2)) { component2.deathStateMachine = val; } SetStateOnHurt component3 = bodyPrefab.GetComponent<SetStateOnHurt>(); 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<ChildLocator>(); 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<HitBox> list = new List<HitBox>(); 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<HitBox>(); ((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<HitBoxGroup>(); 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<SkillLocator>(); 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<GenericSkill>(); 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<SkillLocator>(); 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<GenericSkill>(); obj.skillName = genericSkillName; obj.hideInCharacterSelect = hidden; SkillFamily val = ScriptableObject.CreateInstance<SkillFamily>(); ((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<SkillLocator>().primary.skillFamily, skillDefs); } public static void AddSecondarySkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent<SkillLocator>().secondary.skillFamily, skillDefs); } public static void AddUtilitySkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent<SkillLocator>().utility.skillFamily, skillDefs); } public static void AddSpecialSkills(GameObject targetPrefab, params SkillDef[] skillDefs) { AddSkillsToFamily(targetPrefab.GetComponent<SkillLocator>().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<SkillDef>(skillDefInfo); } public static T CreateSkillDef<T>(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<T>(); ((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<string>(); 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 static SkinDef CreateSkinDef(string skinName, Sprite skinIcon, RendererInfo[] rendererInfos, GameObject root, UnlockableDef unlockableDef = null) { SkinDef obj = ScriptableObject.CreateInstance<SkinDef>(); ((Object)obj).name = skinName; obj.nameToken = skinName; obj.icon = skinIcon; obj.unlockableDef = unlockableDef; obj.rootObject = root; obj.skinDefParams = ScriptableObject.CreateInstance<SkinDefParams>(); obj.skinDefParams.rendererInfos = rendererInfos; return obj; } } internal static class Tokens { public static string GetAchievementNameToken(string identifier) { return "ACHIEVEMENT_" + identifier.ToUpperInvariant() + "_NAME"; } public static string GetAchievementDescriptionToken(string identifier) { return "ACHIEVEMENT_" + identifier.ToUpperInvariant() + "_DESCRIPTION"; } } } namespace HelldiversMod.Modules.Characters { public abstract class CharacterBase<T> where T : CharacterBase<T>, 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<CharacterBody>(); prefabCharacterModel = Prefabs.SetupCharacterModel(bodyPrefab, customRendererInfos); } public virtual void InitializeItemDisplays() { ItemDisplayRuleSet val = ScriptableObject.CreateInstance<ItemDisplayRuleSet>(); ((Object)val).name = "idrs" + bodyName; prefabCharacterModel.itemDisplayRuleSet = val; if (itemDisplays != null) { ItemDisplays.queuedDisplays++; ContentManager.onContentPacksAssigned += SetItemDisplays; } } public void SetItemDisplays(ReadOnlyArray<ReadOnlyContentPack> 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 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<CharacterCameraParams>(); _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<KeyAssetRuleGroup> list = new List<KeyAssetRuleGroup>(); ItemDisplays.LazyInit(); SetItemDisplayRules(list); itemDisplayRuleSet.keyAssetRuleGroups = list.ToArray(); ItemDisplays.DisposeWhenDone(); } protected abstract void SetItemDisplayRules(List<KeyAssetRuleGroup> itemDisplayRules); } public abstract class SurvivorBase<T> : CharacterBase<T> where T : SurvivorBase<T>, 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); } } } namespace HelldiversMod.Survivors.Helldiver { internal static class CleanestHudCompat { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static void OnStructureFinished(Action handler) { HudStructure.OnHudStructureEditsFinished += handler; } } internal static class EmoteCompat { [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] internal static void Init(GameObject bodyPrefab, GameObject rigPrefab) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown GameObject val = Object.Instantiate<GameObject>(rigPrefab); ((Object)val).name = ((Object)rigPrefab).name; CustomEmotesAPI.ImportArmature(bodyPrefab, val, 0, true); CustomEmotesAPI.animChanged += new AnimationChanged(OnAnimChanged); } private static void OnAnimChanged(string newAnimation, BoneMapper mapper) { if (!((Object)(object)mapper == (Object)null) && !((Object)(object)mapper.model == (Object)null)) { HelldiverCapeSim component = mapper.model.GetComponent<HelldiverCapeSim>(); if (!((Object)(object)component == (Object)null)) { component.emoteActive = !string.IsNullOrEmpty(newAnimation) && newAnimation != "none"; } } } } public class GunSkillDef : SkillDef { private class InstanceData : BaseSkillInstanceData { public float idle; public float pace = 1f; } public SerializableEntityStateType reloadState; public float graceDuration; public override BaseSkillInstanceData OnAssigned(GenericSkill skillSlot) { skillSlot.characterBody.MarkAllStatsDirty(); return (BaseSkillInstanceData)(object)new InstanceData(); } public override void OnUnassigned(GenericSkill skillSlot) { if (Object.op_Implicit((Object)(object)skillSlot.characterBody)) { skillSlot.characterBody.MarkAllStatsDirty(); } ((SkillDef)this).OnUnassigned(skillSlot); } public override void OnFixedUpdate(GenericSkill skillSlot, float deltaTime) { EntityStateMachine stateMachine = skillSlot.stateMachine; if (((object)stateMachine.state).GetType() == ((SerializableEntityStateType)(ref reloadState)).stateType) { ((SkillDef)this).OnFixedUpdate(skillSlot, deltaTime); } else { if (!skillSlot.characterBody.hasEffectiveAuthority) { return; } InstanceData instanceData = (InstanceData)(object)skillSlot.skillInstanceData; if (skillSlot.stock >= skillSlot.maxStock || !stateMachine.IsInMainState() || stateMachine.HasPendingState()) { instanceData.idle = 0f; return; } instanceData.idle += deltaTime; if (instanceData.idle >= graceDuration || skillSlot.stock == 0) { instanceData.idle = 0f; stateMachine.SetNextState(EntityStateCatalog.InstantiateState(ref reloadState)); } } } public void SetPace(GenericSkill skillSlot, float pace) { if (skillSlot.skillInstanceData is InstanceData instanceData) { instanceData.pace = pace; } } public override float GetRechargeRate(GenericSkill skillSlot) { return ((SkillDef)this).GetRechargeRate(skillSlot) * ((InstanceData)(object)skillSlot.skillInstanceData).pace; } public float ReloadSpeed(GenericSkill skillSlot) { return base.baseRechargeInterval * ((SkillDef)this).GetRechargeRate(skillSlot) / skillSlot.GetFinalRechargeInterval(); } } public static class HelldiversAI { public static void Init(GameObject bodyPrefab, string masterName) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a9: 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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0131: 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_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) GameObject obj = Prefabs.CreateBlankMasterPrefab(bodyPrefab, masterName); BaseAI component = obj.GetComponent<BaseAI>(); component.aimVectorDampTime = 0.1f; component.aimVectorMaxSpeed = 360f; AISkillDriver obj2 = obj.AddComponent<AISkillDriver>(); obj2.customName = "Use Primary"; obj2.skillSlot = (SkillSlot)0; obj2.requireSkillReady = false; obj2.minDistance = 0f; obj2.maxDistance = 60f; obj2.selectionRequiresTargetLoS = false; obj2.selectionRequiresOnGround = false; obj2.selectionRequiresAimTarget = false; obj2.maxTimesSelected = -1; obj2.moveTargetType = (TargetType)0; obj2.activationRequiresTargetLoS = false; obj2.activationRequiresAimTargetLoS = false; obj2.activationRequiresAimConfirmation = true; obj2.movementType = (MovementType)1; obj2.moveInputScale = 1f; obj2.aimType = (AimType)1; obj2.buttonPressType = (ButtonPressType)0; AISkillDriver obj3 = obj.AddComponent<AISkillDriver>(); obj3.customName = "Use Utility Dive"; obj3.skillSlot = (SkillSlot)2; obj3.requireSkillReady = true; obj3.minUserHealthFraction = 0f; obj3.maxUserHealthFraction = 0.5f; obj3.minDistance = 0f; obj3.maxDistance = 20f; obj3.moveTargetType = (TargetType)0; obj3.movementType = (MovementType)2; obj3.moveInputScale = 1f; obj3.aimType = (AimType)1; obj3.buttonPressType = (ButtonPressType)2; AISkillDriver obj4 = obj.AddComponent<AISkillDriver>(); obj4.customName = "Chase"; obj4.skillSlot = (SkillSlot)(-1); obj4.requireSkillReady = false; obj4.minDistance = 0f; obj4.maxDistance = float.PositiveInfinity; obj4.moveTargetType = (TargetType)0; obj4.activationRequiresTargetLoS = false; obj4.activationRequiresAimTargetLoS = false; obj4.activationRequiresAimConfirmation = false; obj4.movementType = (MovementType)1; obj4.moveInputScale = 1f; obj4.aimType = (AimType)1; obj4.buttonPressType = (ButtonPressType)0; } } public static class HelldiversAssets { private class Sentry { public GameObject body; public GameObject master; public GameObject beacon; public CharacterBody stats; public TurretAimController aim; public AISkillDriver shoot; public AISkillDriver idle; public void Stats(float health, float healthPerLevel, float damage, float damagePerLevel, float armor) { stats.baseMaxHealth = health; stats.levelMaxHealth = healthPerLevel; stats.baseDamage = damage; stats.levelDamage = damagePerLevel; stats.baseArmor = armor; } } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_ApplyAmmoPack <>9__80_0; public static Action<GameObject> <>9__104_0; public static Action<GameObject> <>9__104_1; internal void <HookAmmoPacks>b__80_0(orig_ApplyAmmoPack orig, GenericSkill self) { if (!IsStratagemSkillDef(self.skillDef)) { orig.Invoke(self); if (self.skillDef is GunSkillDef gunSkillDef && ((SerializableEntityStateType)(ref gunSkillDef.reloadState)).stateType == typeof(Reload)) { self.stock = self.maxStock; } } else if (self.stock < self.maxStock) { self.rechargeStopwatch += self.finalRechargeInterval * 0.05f; } } internal void <Init>b__104_0(GameObject fx) { ScorchDecal.Install(fx, 9f, 5f, 0.8f); } internal void <Init>b__104_1(GameObject fx) { ScorchDecal.Install(fx, 56f, 5f); } } public static GameObject fragGrenadeProjectilePrefab; public static GameObject smokeGrenadeProjectilePrefab; public static GameObject stunGrenadeProjectilePrefab; public static NetworkSoundEventDef stratagemExplosionSound; public static NetworkSoundEventDef eagle500kgSound; public static NetworkSoundEventDef precisionImpactSound; public static NetworkSoundEventDef precisionWhistleSound; public static NetworkSoundEventDef orbital120ImpactSound; public static NetworkSoundEventDef orbital120WhistleSound; public static NetworkSoundEventDef eagleFlybySound; public static NetworkSoundEventDef eagle500kgWhistleSound; public static NetworkSoundEventDef eagle500kgThumpSound; public static NetworkSoundEventDef gatlingDroneSound; public static NetworkSoundEventDef gatlingImpactSound; public static NetworkSoundEventDef strafingStartSound; public static NetworkSoundEventDef strafingEndSound; public static NetworkSoundEventDef strafingRoundSound; public static NetworkSoundEventDef hellpodStreakSound; public static NetworkSoundEventDef hellpodSlamSound; public static NetworkSoundEventDef podDoorSound; public static NetworkSoundEventDef weaponPickupSound; public static NetworkSoundEventDef smokePopSound; public static NetworkSoundEventDef stunBurstSound; public static NetworkSoundEventDef emsImpactSound; public static NetworkSoundEventDef emsWhistleSound; public static NetworkSoundEventDef emsFieldSound; public static NetworkSoundEventDef laserEndSound; public static NetworkSoundEventDef airstrikeWhistleSound; public static NetworkSoundEventDef airstrikeImpactSound; public static GameObject orbitalPrecisionBeaconPrefab; public static GameObject orbital120mmBeaconPrefab; public static GameObject orbitalGatlingBeaconPrefab; public static GameObject orbitalEMSBeaconPrefab; public static GameObject eagleAirstrikeBeaconPrefab; public static GameObject eagleStrafingBeaconPrefab; public static GameObject eagle500kgBeaconPrefab; public static GameObject mgTurretBeaconPrefab; public static GameObject mgTurretBodyPrefab; public static GameObject mgTurretMasterPrefab; public static GameObject acTurretBodyPrefab; public static GameObject acTurretMasterPrefab; public static GameObject acTurretBeaconPrefab; public static GameObject mortarTurretBodyPrefab; public static GameObject mortarTurretMasterPrefab; public static GameObject mortarShellPrefab; public static GameObject mortarTurretBeaconPrefab; public static GameObject flameTurretBodyPrefab; public static GameObject flameTurretMasterPrefab; public static GameObject flameTurretBeaconPrefab; public static GameObject flameImpactVFXPrefab; public static GameObject acTurretProjectilePrefab; public static GameObject supplyDropPrefab; public static GameObject emsFieldPrefab; public static GameObject supplyDropBeaconPrefab; public static GameObject seafBeaconPrefab; public static GameObject pelicanPrefab; public static GameObject eaglePrefab; public static GameObject eagleBombPrefab; public static GameObject eagleFlaresPrefab; public static GameObject shieldRelayPrefab; public static GameObject shieldRelayEndEffect; public static GameObject shieldRelayBeaconPrefab; public static GameObject orbitalLaserPrefab; public static GameObject orbitalLaserBeaconPrefab; public static GameObject smokeFxPrefab; public static GameObject stunSmokeFxPrefab; public static GameObject dominatorBoltPrefab; public static SkillDef recoillessSkillDef; public static SkillDef autocannonSkillDef; public static SkillDef lexingtonSkillDef; public static GameObject recoillessProjectilePrefab; public static GameObject recoillessBeaconPrefab; public static GameObject recoillessPickupPrefab; public static GameObject autocannonProjectilePrefab; public static GameObject autocannonBeaconPrefab; public static GameObject autocannonPickupPrefab; public static GameObject lexingtonBeaconPrefab; public static GameObject lexingtonPickupPrefab; private static bool ammoPackHooked; private static AssetBundle assetBundle; public static GameObject stratagemBeamRedPrefab; public static GameObject stratagemBeamBluePrefab; public static GameObject dangerSpherePrefab; public static GameObject stratagemLandingVFXPrefab; public static GameObject eagle500kgLandingVFXPrefab; public static GameObject eagle500kgExplosionVFXPrefab; public static GameObject[] randomExplosionVFXPrefabs; public static GameObject smallShellExplosionVFXPrefab; public static GameObject mediumShellExplosionVFXPrefab; public static GameObject largeShellExplosionVFXPrefab; public static GameObject fragExplosionVFXPrefab; public static GameObject gatlingExplosionVFXPrefab; public static GameObject gatlingTracerPrefab; public static GameObject bulletTracerPrefab; public static GameObject beaconGhostPrefab; public static GameObject shellGhostACPrefab; public static GameObject shellGhostDominatorPrefab; public static GameObject shellGhostRRPrefab; public static GameObject shellFallPrefab; public const float shellSizePrecision = 7f; public const float shellSize120mm = 5f; public const float shellSizeGatling = 2.2f; private static Material pristineSkullMat; private static readonly Quaternion PickupTilt = Quaternion.Euler(0f, 0f, 55f); public const float supplyPodScale = 1.15f; private static readonly Color RelayYellow = new Color(1f, 0.82f, 0.15f, 1f); public const float relayModelScale = 1.4f; public static bool IsStratagemSkillDef(SkillDef skillDef) { return StratagemCatalog.IsStratagem(skillDef); } internal static void HookAmmoPacks() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown if (ammoPackHooked) { return; } ammoPackHooked = true; object obj = <>c.<>9__80_0; if (obj == null) { hook_ApplyAmmoPack val = delegate(orig_ApplyAmmoPack orig, GenericSkill self) { if (!IsStratagemSkillDef(self.skillDef)) { orig.Invoke(self); if (self.skillDef is GunSkillDef gunSkillDef && ((SerializableEntityStateType)(ref gunSkillDef.reloadState)).stateType == typeof(Reload)) { self.stock = self.maxStock; } } else if (self.stock < self.maxStock) { self.rechargeStopwatch += self.finalRechargeInterval * 0.05f; } }; <>c.<>9__80_0 = val; obj = (object)val; } GenericSkill.ApplyAmmoPack += (hook_ApplyAmmoPack)obj; } public static void Init(AssetBundle assetBundle) { //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Invalid comparison between Unknown and I4 //IL_0347: Unknown result type (might be due to invalid IL or missing references) HelldiversAssets.assetBundle = assetBundle; CreateShellsAndBall(); stratagemBeamRedPrefab = HelldiversAssets.assetBundle.LoadAsset<GameObject>("stratagem_beamred_part"); stratagemBeamBluePrefab = HelldiversAssets.assetBundle.LoadAsset<GameObject>("stratagem_beamblue_part"); dangerSpherePrefab = HelldiversAssets.assetBundle.LoadAsset<GameObject>("StratagemAOE_Ind"); smokeFxPrefab = HelldiversAssets.assetBundle.LoadAsset<GameObject>("HelldiverSmokeFX"); stunSmokeFxPrefab = HelldiversAssets.assetBundle.LoadAsset<GameObject>("HelldiverStunSmokeFX"); if (Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions")) { RoOCompat.SetIcon(HelldiversAssets.assetBundle.LoadAsset<Sprite>("texHelldiversIcon")); } stratagemLandingVFXPrefab = HelldiversAssets.assetBundle.LoadEffect("Stratagem_Landing_VFX", "", parentToTransform: false, delegate(GameObject fx) { ScorchDecal.Install(fx, 9f, 5f, 0.8f); }); ((Component)stratagemLandingVFXPrefab.transform.Find("Hellpod_mesh")).gameObject.AddComponent<HideRendererAfterDelay>().delay = 0.8f; eagle500kgLandingVFXPrefab = HelldiversAssets.assetBundle.LoadEffect("500kg_landing_VFX"); eagle500kgExplosionVFXPrefab = HelldiversAssets.assetBundle.LoadEffect("500kg_Explosion_VFX", "", parentToTransform: false, delegate(GameObject fx) { ScorchDecal.Install(fx, 56f, 5f); }); HideRendererAfterDelay hideRendererAfterDelay = ((Component)eagle500kgLandingVFXPrefab.transform.Find("500kg")).gameObject.AddComponent<HideRendererAfterDelay>(); hideRendererAfterDelay.delay = 2f; hideRendererAfterDelay.showAfter = 1.02f; randomExplosionVFXPrefabs = (GameObject[])(object)new GameObject[3] { HelldiversAssets.assetBundle.LoadEffect("Orbital_Explosion_1"), HelldiversAssets.assetBundle.LoadEffect("Orbital_Explosion_2"), HelldiversAssets.assetBundle.LoadEffect("Orbital_Explosion_3") }; smallShellExplosionVFXPrefab = ShellExplosion(randomExplosionVFXPrefabs[0], "Shell_Explosion_S", 0.12f, 1.8f, "Play_Shell_Impact"); mediumShellExplosionVFXPrefab = ShellExplosion(randomExplosionVFXPrefabs[1], "Shell_Explosion_M", 0.24f, 1.5f, "Play_Shell_Impact"); largeShellExplosionVFXPrefab = ShellExplosion(randomExplosionVFXPrefabs[2], "Shell_Explosion_L", 0.48f, 1.2f, "Play_Shell_Impact"); fragExplosionVFXPrefab = ShellExplosion(randomExplosionVFXPrefabs[2], "Frag_Explosion", 0.48f, 1.2f, "Play_Frag_Explosion"); gatlingExplosionVFXPrefab = PrefabAPI.InstantiateClone(randomExplosionVFXPrefabs[0], "Gatling_Explosion", false); gatlingExplosionVFXPrefab.transform.localScale = Vector3.one * 0.12f; Content.CreateAndAddEffectDef(gatlingExplosionVFXPrefab); flameImpactVFXPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ImpactEffects/ImpactMageFire"); bulletTracerPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/TracerCommandoDefault"); GameObject val = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/TracerToolbotRebar"); if ((Object)(object)val != (Object)null) { gatlingTracerPrefab = PrefabAPI.InstantiateClone(val, "GatlingSkyTracer", false); MeshRenderer[] componentsInChildren = gatlingTracerPrefab.GetComponentsInChildren<MeshRenderer>(true); for (int num = 0; num < componentsInChildren.Length; num++) { Object.Destroy((Object)(object)componentsInChildren[num]); } ParticleSystemRenderer[] componentsInChildren2 = gatlingTracerPrefab.GetComponentsInChildren<ParticleSystemRenderer>(true); foreach (ParticleSystemRenderer val2 in componentsInChildren2) { if ((int)val2.renderMode == 4) { ((Renderer)val2).enabled = false; } } gatlingTracerPrefab.AddComponent<VFXAttributes>().vfxPriority = (VFXPriority)2; Content.CreateAndAddEffectDef(gatlingTracerPrefab); } stratagemExplosionSound = Content.CreateAndAddNetworkSoundEventDef("Play_item_proc_missile_explo"); eagle500kgSound = Content.CreateAndAddNetworkSoundEventDef("Play_Eagle500kg_Explosion"); precisionImpactSound = Content.CreateAndAddNetworkSoundEventDef("Play_Precision_Impact"); precisionWhistleSound = Content.CreateAndAddNetworkSoundEventDef("Play_Precision_Whistle"); orbital120ImpactSound = Content.CreateAndAddNetworkSoundEventDef("Play_Orbital120_Impact"); orbital120WhistleSound = Content.CreateAndAddNetworkSoundEventDef("Play_Orbital120_Whistle"); eagleFlybySound = Content.CreateAndAddNetworkSoundEventDef("Play_Eagle_Flyby"); eagle500kgWhistleSound = Content.CreateAndAddNetworkSoundEventDef("Play_Eagle500kg_Whistle"); eagle500kgThumpSound = Content.CreateAndAddNetworkSoundEventDef("Play_Eagle500kg_Thump"); gatlingDroneSound = Content.CreateAndAddNetworkSoundEventDef("Play_Gatling_Drone"); gatlingImpactSound = Content.CreateAndAddNetworkSoundEventDef("Play_Gatling_Impact"); strafingStartSound = Content.CreateAndAddNetworkSoundEventDef("Play_Strafing_Start"); strafingEndSound = Content.CreateAndAddNetworkSoundEventDef("Play_Strafing_End"); strafingRoundSound = Content.CreateAndAddNetworkSoundEventDef("Play_Strafing_Round"); hellpodStreakSound = Content.CreateAndAddNetworkSoundEventDef("Play_Hellpod_Streak"); hellpodSlamSound = Content.CreateAndAddNetworkSoundEventDef("Play_Hellpod_Slam"); podDoorSound = Content.CreateAndAddNetworkSoundEventDef("Play_Pod_Door"); weaponPickupSound = Content.CreateAndAddNetworkSoundEventDef("Play_Weapon_Pickup"); smokePopSound = Content.CreateAndAddNetworkSoundEventDef("Play_Smoke_Pop"); stunBurstSound = Content.CreateAndAddNetworkSoundEventDef("Play_Stun_Burst"); emsImpactSound = Content.CreateAndAddNetworkSoundEventDef("Play_EMS_Impact"); emsWhistleSound = Content.CreateAndAddNetworkSoundEventDef("Play_EMS_Whistle"); emsFieldSound = Content.CreateAndAddNetworkSoundEventDef("Play_EMS_Field"); laserEndSound = Content.CreateAndAddNetworkSoundEventDef("Play_Laser_End"); airstrikeWhistleSound = Content.CreateAndAddNetworkSoundEventDef("Play_Airstrike_Whistle"); airstrikeImpactSound = Content.CreateAndAddNetworkSoundEventDef("Play_Airstrike_Impact"); HelldiverVoice.RegisterSoundEvents(); CreateProjectiles(); CreateDominatorPrefabs(); CreateMGTurretPrefabs(); CreateACTurretPrefabs(); CreateMortarTurretPrefabs(); CreateFlameTurretPrefabs(); CreateRecoillessPrefabs(); CreateAutocannonWeaponPrefabs(); CreateLexingtonWeaponPrefabs(); CreateEMSFieldPrefab(); CreateSupplyDropPrefabs(); CreateShieldRelayPrefabs(); CreateOrbitalLaserPrefabs(); } private static GameObject ShellExplosion(GameObject source, string name, float scale, float speed, string sound) { //IL_000f: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) GameObject val = PrefabAPI.InstantiateClone(source, name, false); val.transform.localScale = Vector3.one * scale; ParticleSystem[] componentsInChildren = val.GetComponentsInChildren<ParticleSystem>(true); for (int i = 0; i < componentsInChildren.Length; i++) { MainModule main = componentsInChildren[i].main; ((MainModule)(ref main)).simulationSpeed = speed; } val.GetComponent<EffectComponent>().soundName = sound; Content.CreateAndAddEffectDef(val); return val; } private static BuffWard AddWard(GameObject prefab, BuffDef buff, float radius, float buffDuration) { BuffWard obj = prefab.AddComponent<BuffWard>(); obj.buffDef = buff; obj.radius = radius; obj.interval = 0.5f; obj.buffDuration = buffDuration; return obj; } private static void CreateProjectiles() { CreateFragGrenadeProjectile(); Content.AddProjectilePrefab(fragGrenadeProjectilePrefab); CreateSmokeGrenadeProjectile(); Content.AddProjectilePrefab(smokeGrenadeProjectilePrefab); CreateStunGrenadeProjectile(); Content.AddProjectilePrefab(stunGrenadeProjectilePrefab); CreateStratagemBeacons(); } private static void CreateFragGrenadeProjectile() { //IL_0051: Unknown result type (might be due to invalid IL or missing references) fragGrenadeProjectilePrefab = Projectiles.New("HelldiversFragGrenadeProjectile", Projectiles.GrenadeGhost, Projectiles.Flight.Lobbed, 50f, 5f); ProjectileImpactExplosion obj = fragGrenadeProjectilePrefab.AddComponent<ProjectileImpactExplosion>(); ((ProjectileExplosion)obj).explosionEffect = fragExplosionVFXPrefab; ((ProjectileExplosion)obj).blastRadius = 15f; ((ProjectileExplosion)obj).blastDamageCoefficient = 1f; ((ProjectileExplosion)obj).falloffModel = (FalloffModel)2; obj.destroyOnEnemy = false; obj.destroyOnWorld = false; obj.timerAfterImpact = false; obj.lifetime = 3f; ProjectileStickOnImpact obj2 = fragGrenadeProjectilePrefab.AddComponent<ProjectileStickOnImpact>(); obj2.ignoreCharacters = true; obj2.ignoreWorld = false; } private static void CreateSmokeGrenadeProjectile() { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) smokeGrenadeProjectilePrefab = Projectiles.New("HelldiversSmokeGrenadeProjectile", Projectiles.GrenadeGhost, Projectiles.Flight.Lobbed, 50f, 15f); ProjectileImpactExplosion obj = smokeGrenadeProjectilePrefab.AddComponent<ProjectileImpactExplosion>(); ((ProjectileExplosion)obj).explosionEffect = null; ((ProjectileExplosion)obj).blastRadius = 0f; ((ProjectileExplosion)obj).blastDamageCoefficient = 0f; ((ProjectileExplosion)obj).falloffModel = (FalloffModel)0; obj.destroyOnEnemy = false; obj.destroyOnWorld = false; obj.timerAfterImpact = false; obj.lifetime = 8f; SmokeZone smokeZone = smokeGrenadeProjectilePrefab.AddComponent<SmokeZone>(); smokeZone.radius = 12f; BuffDef buff = Addressables.LoadAssetAsync<BuffDef>((object)RoR2_Base_Common.bdCloak_asset).WaitForCompletion(); ((Behaviour)AddWard(smokeGrenadeProjectilePrefab, buff, smokeZone.radius, 2f)).enabled = false; } private static void CreateStunGrenadeProjectile() { //IL_004d: 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) stunGrenadeProjectilePrefab = Projectiles.New("HelldiversStunGrenadeProjectile", Projectiles.GrenadeGhost, Projectiles.Flight.Lobbed, 50f, 15f); ProjectileImpactExplosion obj = stunGrenadeProjectilePrefab.AddComponent<ProjectileImpactExplosion>(); ((ProjectileExplosion)obj).explosionEffect = null; ((ProjectileExplosion)obj).blastRadius = 0f; ((ProjectileExplosion)obj).blastDamageCoefficient = 0f; ((ProjectileExplosion)obj).falloffModel = (FalloffModel)0; obj.destroyOnEnemy = false; obj.destroyOnWorld = false; obj.timerAfterImpact = false; obj.lifetime = 10f; StunZone stunZone = stunGrenadeProjectilePrefab.AddComponent<StunZone>(); stunZone.radius = 18f; stunZone.stunDuration = 4f; BuffDef buff = Addressables.LoadAssetAsync<BuffDef>((object)RoR2_Base_Common.bdSlow80_asset).WaitForCompletion(); BuffWard obj2 = AddWard(stunGrenadeProjectilePrefab, buff, stunZone.radius, 0.7f); obj2.invertTeamFilter = true; ((Behaviour)obj2).enabled = false; } private static void CreateStratagemBeacons() { orbitalPrecisionBeaconPrefab = CreateBeacon("HelldiversOrbitalPrecisionBeacon", StratagemType.OrbitalPrecision, 4f, 0f); orbital120mmBeaconPrefab = CreateBeacon("HelldiversOrbital120mmBeacon", StratagemType.Orbital120mm, 5f, 20f); orbitalGatlingBeaconPrefab = CreateBeacon("HelldiversOrbitalGatlingBeacon", StratagemType.OrbitalGatling, 4f, 15f); eagleAirstrikeBeaconPrefab = CreateBeacon("HelldiversEagleAirstrikeBeacon", StratagemType.EagleAirstrike, 3f, 0f); orbitalEMSBeaconPrefab = CreateBeacon("HelldiversOrbitalEMSBeacon", StratagemType.OrbitalEMS, 4f, 0f); eagleStrafingBeaconPrefab = CreateBeacon("HelldiversEagleStrafingBeacon", StratagemType.EagleStrafing, 2.5f, 0f); eagle500kgBeaconPrefab = CreateBeacon("HelldiversEagle500kgBeacon", StratagemType.Eagle500kg, 5.5f, 0f); Content.AddProjectilePrefab(orbitalPrecisionBeaconPrefab); Content.AddProjectilePrefab(orbital120mmBeaconPrefab); Content.AddProjectilePrefab(orbitalGatlingBeaconPrefab); Content.AddProjectilePrefab(orbitalEMSBeaconPrefab); Content.AddProjectilePrefab(eagleAirstrikeBeaconPrefab); Content.AddProjectilePrefab(eagleStrafingBeaconPrefab); Content.AddProjectilePrefab(eagle500kgBeaconPrefab); } private static void CreateShe