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 MinerUnearthed v1.10.0
plugins/EnforcerGang-DiggerUnearthed/DiggerUnearthed.dll
Decompiled 10 months 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.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 Aetherium.Equipment; using Aetherium.Items; using AncientScepter; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using DiggerPlugin; using DiggerPlugin.Achievements; using DiggerUnearthed.Module; using DireseekerMod.Modules; using EntityStates; using EntityStates.Commando; using EntityStates.Croco; using EntityStates.Digger; using EntityStates.Direseeker; using EntityStates.LemurianBruiserMonster; using EntityStates.Loader; using EntityStates.Merc; using EntityStates.Treebot.TreebotFlower; using GoldenCoastPlus; using HG; using HG.BlendableTypes; using KinematicCharacterController; using Modules; using On.RoR2; using R2API; using R2API.Utils; using RoR2; using RoR2.Achievements; using RoR2.ContentManagement; using RoR2.Navigation; using RoR2.Projectile; using RoR2.Skills; using RoR2BepInExPack.GameAssetPaths; using SivsItemsRoR2; using SupplyDrop.Items; using TILER2; using ThinkInvisible.ClassicItems; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("DiggerUnearthed")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+9db9d56de29bb15b73d9aac2a99474b48d453ad7")] [assembly: AssemblyProduct("DiggerUnearthed")] [assembly: AssemblyTitle("DiggerUnearthed")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: UnverifiableCode] [module: UnverifiableCode] namespace DiggerUnearthed.Module { internal static class Files { public static PluginInfo PluginInfo; internal static string assemblyDir => Path.GetDirectoryName(PluginInfo.Location); internal static void Init(PluginInfo info) { PluginInfo = info; } internal static string GetPathToFile(string folderName, string fileName) { return Path.Combine(assemblyDir, folderName, fileName); } } public class LanguageTokens { internal static string languageRoot => Path.Combine(assemblyDir, "language"); internal static string assemblyDir => Path.GetDirectoryName(Files.PluginInfo.Location); public static void RegisterLanguageTokens() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown Language.SetFolders += new hook_SetFolders(fixme); } private static void fixme(orig_SetFolders orig, Language self, IEnumerable<string> newFolders) { if (Directory.Exists(languageRoot)) { IEnumerable<string> second = Directory.EnumerateDirectories(Path.Combine(languageRoot), self.name); orig.Invoke(self, newFolders.Union(second)); } else { orig.Invoke(self, newFolders); } } } internal static class SoundBanks { private static bool initialized; public static string SoundBankDirectory => Path.Combine(Files.assemblyDir, "SoundBanks"); public static void Init() { if (initialized) { return; } initialized = true; using Stream stream = new FileStream(SoundBankDirectory + "\\DiggerBank.bnk", FileMode.Open); byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); SoundBanks.Add(array); } } } namespace Modules { public class Content { public static void AddBody(GameObject prefab) { AddCharacterBodyPrefab(prefab); } public static void AddCharacterBodyPrefab(params GameObject[] prefabs) { foreach (GameObject item in prefabs) { ContentPacks.bodyPrefabs.Add(item); } } public static void AddMaster(GameObject prefab) { AddMasterPrefab(prefab); } public static void AddMasterPrefab(params GameObject[] prefabs) { foreach (GameObject item in prefabs) { ContentPacks.masterPrefabs.Add(item); } } public static void AddProjectile(GameObject prefab) { AddProjectilePrefab(prefab); } public static void AddProjectilePrefab(params GameObject[] prefabs) { foreach (GameObject item in prefabs) { ContentPacks.projectilePrefabs.Add(item); } } public static void AddSurvivorDef(SurvivorDef survivorDef) { ContentPacks.survivorDefs.Add(survivorDef); } public static void AddUnlockableDef(UnlockableDef unlockableDef) { ContentPacks.unlockableDefs.Add(unlockableDef); } public static void AddSkillDef(SkillDef skillDef) { if (!ContentPacks.skillDefs.Contains(skillDef)) { ContentPacks.skillDefs.Add(skillDef); } } public static void AddSkillFamily(SkillFamily skillFamily) { ContentPacks.skillFamilies.Add(skillFamily); } public static void AddEntityState<T>(out bool wasAdded) where T : EntityState { wasAdded = true; AddEntityState(typeof(T)); } public static void AddEntityState(params Type[] entityStates) { foreach (Type item in entityStates) { ContentPacks.entityStates.Add(item); } } public static void AddBuffDef(BuffDef buffDef) { ContentPacks.buffDefs.Add(buffDef); } internal static void AddEffect(GameObject effectPrefab) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown EffectDef val = new EffectDef(); val.prefab = effectPrefab; val.prefabEffectComponent = effectPrefab.GetComponent<EffectComponent>(); val.prefabName = ((Object)effectPrefab).name; val.prefabVfxAttributes = effectPrefab.GetComponent<VFXAttributes>(); val.spawnSoundEventName = ((Object)effectPrefab).name; AddEffectDef(val); } public static void AddEffect(EffectDef def) { AddEffectDef(def); } public static void AddEffectDef(params EffectDef[] effectDefs) { foreach (EffectDef item in effectDefs) { ContentPacks.effectDefs.Add(item); } } public static void AddNetworkSoundEventDef(NetworkSoundEventDef networkSoundEventDef) { ContentPacks.networkSoundEventDefs.Add(networkSoundEventDef); } } public class ContentPacks : IContentPackProvider { private static ContentPack contentPack = new ContentPack(); internal static List<GameObject> bodyPrefabs = new List<GameObject>(); internal static List<GameObject> masterPrefabs = new List<GameObject>(); internal static List<GameObject> projectilePrefabs = new List<GameObject>(); internal static List<SurvivorDef> survivorDefs = new List<SurvivorDef>(); internal static List<UnlockableDef> unlockableDefs = new List<UnlockableDef>(); internal static List<SkillFamily> skillFamilies = new List<SkillFamily>(); internal static List<SkillDef> skillDefs = new List<SkillDef>(); internal static List<Type> entityStates = new List<Type>(); internal static List<BuffDef> buffDefs = new List<BuffDef>(); internal static List<EffectDef> effectDefs = new List<EffectDef>(); internal static List<NetworkSoundEventDef> networkSoundEventDefs = new List<NetworkSoundEventDef>(); public string identifier => "DiggerUnearthed.DiggerContent"; public void Initialize() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders); } private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider) { addContentPackProvider.Invoke((IContentPackProvider)(object)this); } public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { args.ReportProgress(1f); yield break; } public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { ContentPack.Copy(contentPack, args.output); yield break; } public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { contentPack.bodyPrefabs.Add(bodyPrefabs.ToArray()); contentPack.buffDefs.Add(buffDefs.ToArray()); contentPack.effectDefs.Add(effectDefs.ToArray()); contentPack.entityStateTypes.Add(entityStates.ToArray()); contentPack.masterPrefabs.Add(masterPrefabs.ToArray()); contentPack.networkSoundEventDefs.Add(networkSoundEventDefs.ToArray()); contentPack.projectilePrefabs.Add(projectilePrefabs.ToArray()); contentPack.skillDefs.Add(skillDefs.ToArray()); contentPack.skillFamilies.Add(skillFamilies.ToArray()); contentPack.survivorDefs.Add(survivorDefs.ToArray()); args.ReportProgress(1f); yield break; } } internal static class Materials { private static List<Material> cachedMaterials = new List<Material>(); public static Material CreateHotpooMaterial(string materialName) { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown Material val = cachedMaterials.Find(delegate(Material mat) { materialName.Replace(" (Instance)", ""); return ((Object)mat).name == materialName; }); if (Object.op_Implicit((Object)(object)val)) { return val; } val = Assets.mainAssetBundle.LoadAsset<Material>(materialName); if (!Object.op_Implicit((Object)(object)val)) { Debug.LogError((object)("Failed to load material: " + materialName + " - Check to see that the name in your Unity project matches the one in this code")); return new Material(Assets.hotpoo); } return val.SetHotpooMaterial(); } private static Material CreateHotpooMaterial(Material tempMat) { if (cachedMaterials.Contains(tempMat)) { return tempMat; } return tempMat.SetHotpooMaterial(); } public static Material SetHotpooMaterial(this Material tempMat) { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) if (cachedMaterials.Contains(tempMat)) { 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 = Assets.hotpoo; tempMat.SetColor("_Color", tempMat.GetColor("_Color")); tempMat.SetTexture("_MainTex", tempMat.GetTexture("_MainTex")); tempMat.SetTexture("_EmTex", tempMat.GetTexture("_EmissionMap")); tempMat.EnableKeyword("DITHER"); tempMat.EnableKeyword("LIMBREMOVAL"); tempMat.SetInt("_LimbRemovalOn", 1); if (num.HasValue) { tempMat.SetFloat("_NormalStrength", num.Value); } if (val.HasValue) { tempMat.SetColor("_EmColor", val.Value); tempMat.SetFloat("_EmPower", 1f); } if (tempMat.IsKeywordEnabled("_CULL")) { tempMat.SetInt("_Cull", 0); } cachedMaterials.Add(tempMat); return tempMat; } public static Material MakeUnique(this Material material) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown if (cachedMaterials.Contains(material)) { return new Material(material); } return material; } public static Material SetColor(this Material material, Color color) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) material.SetColor("_Color", color); return material; } public static Material SetNormal(this Material material, float normalStrength = 1f) { material.SetFloat("_NormalStrength", normalStrength); return material; } public static Material SetEmission(this Material material) { return material.SetEmission(1f); } public static Material SetEmission(this Material material, float emission) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return material.SetEmission(emission, Color.white); } public static Material SetEmission(this Material material, float emission, Color emissionColor) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) material.SetFloat("_EmPower", emission); material.SetColor("_EmColor", emissionColor); return material; } public static Material SetCull(this Material material, bool cull = false) { material.SetInt("_Cull", cull ? 1 : 0); return material; } } internal static class Skills { public static void CreateSkillFamilies(GameObject targetPrefab, int families = 15, bool destroyExisting = true) { if (destroyExisting) { GenericSkill[] componentsInChildren = targetPrefab.GetComponentsInChildren<GenericSkill>(); foreach (GenericSkill val in componentsInChildren) { Object.DestroyImmediate((Object)(object)val); } } SkillLocator component = targetPrefab.GetComponent<SkillLocator>(); if (((uint)families & (true ? 1u : 0u)) != 0) { component.primary = CreateGenericSkillWithSkillFamily(targetPrefab, "Primary"); } if (((uint)families & 2u) != 0) { component.secondary = CreateGenericSkillWithSkillFamily(targetPrefab, "Secondary"); } if (((uint)families & 4u) != 0) { component.utility = CreateGenericSkillWithSkillFamily(targetPrefab, "Utility"); } if (((uint)families & 8u) != 0) { component.special = CreateGenericSkillWithSkillFamily(targetPrefab, "Special"); } } public static GenericSkill CreateGenericSkillWithSkillFamily(GameObject targetPrefab, string familyName, bool hidden = false) { GenericSkill val = targetPrefab.AddComponent<GenericSkill>(); val.skillName = familyName; val.hideInCharacterSelect = hidden; SkillFamily val2 = ScriptableObject.CreateInstance<SkillFamily>(); ((Object)val2).name = ((Object)targetPrefab).name + familyName + "SkillFamily"; val2.variants = (Variant[])(object)new Variant[0]; val._skillFamily = val2; Content.AddSkillFamily(val2); return val; } public static void AddSkillToFamily(SkillFamily skillFamily, SkillDef skillDef, UnlockableDef unlockableDef = null) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_0061: 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) Array.Resize(ref skillFamily.variants, skillFamily.variants.Length + 1); ((Object)skillDef).name = skillDef.skillName; 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; Content.AddSkillDef(skillDef); } 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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < unlockableDefs.Length; i++) { Variant val = skillFamily.variants[i]; val.unlockableDef = unlockableDefs[i]; skillFamily.variants[i] = val; } } } } namespace EntityStates.Direseeker { public class ChargeUltraFireball : BaseState { public static float baseDuration = 2f; private float duration; private GameObject chargeInstance; public override void OnEnter() { //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / base.attackSpeedStat; Object modelAnimator = (Object)(object)((EntityState)this).GetModelAnimator(); Transform modelTransform = ((EntityState)this).GetModelTransform(); Util.PlayAttackSpeedSound(ChargeMegaFireball.attackString, ((EntityState)this).gameObject, base.attackSpeedStat); if (Object.op_Implicit((Object)(object)modelTransform)) { ChildLocator component = ((Component)modelTransform).GetComponent<ChildLocator>(); if (Object.op_Implicit((Object)(object)component)) { Transform val = component.FindChild("MuzzleMouth"); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)ChargeMegaFireball.chargeEffectPrefab)) { chargeInstance = Object.Instantiate<GameObject>(ChargeMegaFireball.chargeEffectPrefab, val.position, val.rotation); chargeInstance.transform.parent = val; ScaleParticleSystemDuration component2 = chargeInstance.GetComponent<ScaleParticleSystemDuration>(); if (Object.op_Implicit((Object)(object)component2)) { component2.newDuration = duration; } } } } if (Object.op_Implicit(modelAnimator)) { ((EntityState)this).PlayCrossfade("Gesture, Additive", "ChargeMegaFireball", "ChargeMegaFireball.playbackRate", duration, 0.1f); } } public override void OnExit() { ((EntityState)this).OnExit(); if (Object.op_Implicit((Object)(object)chargeInstance)) { EntityState.Destroy((Object)(object)chargeInstance); } } public override void Update() { ((EntityState)this).Update(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { FireUltraFireball nextState = new FireUltraFireball(); ((EntityState)this).outer.SetNextState((EntityState)(object)nextState); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } public class FireUltraFireball : BaseState { public static int projectileCount = 15; public static float totalYawSpread = 25f; public static float baseDuration = 1.5f; public static float baseFireDuration = 0.25f; public static float damageCoefficient = 2.5f; public static float projectileSpeed = 80f; public static float force = 1200f; private float duration; private float fireDuration; private int projectilesFired; private DireseekerController direController; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / base.attackSpeedStat; fireDuration = baseFireDuration / base.attackSpeedStat; direController = ((EntityState)this).GetComponent<DireseekerController>(); if (Object.op_Implicit((Object)(object)direController)) { direController.FlameBurst(); } ((EntityState)this).PlayAnimation("Gesture, Additive", "FireMegaFireball", "FireMegaFireball.playbackRate", duration, 0f); Util.PlaySound(FireMegaFireball.attackString, ((EntityState)this).gameObject); } public override void OnExit() { ((EntityState)this).OnExit(); } public override void FixedUpdate() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); string text = "MuzzleMouth"; if (((EntityState)this).isAuthority) { int num = Mathf.FloorToInt(((EntityState)this).fixedAge / fireDuration * (float)projectileCount); if (projectilesFired <= num && projectilesFired < projectileCount) { if (Object.op_Implicit((Object)(object)FireMegaFireball.muzzleflashEffectPrefab)) { EffectManager.SimpleMuzzleFlash(FireMegaFireball.muzzleflashEffectPrefab, ((EntityState)this).gameObject, text, false); } Ray aimRay = ((BaseState)this).GetAimRay(); float num2 = projectileSpeed; float num3 = (float)Mathf.FloorToInt((float)projectilesFired - (float)(projectileCount - 1) / 2f) / (float)(projectileCount - 1) * totalYawSpread; Vector3 val = Util.ApplySpread(((Ray)(ref aimRay)).direction, 0f, 0f, 1f, 1f, num3, 0f); ProjectileManager.instance.FireProjectile(DiggerPlugin.Direseeker.fireballPrefab, ((Ray)(ref aimRay)).origin, Util.QuaternionSafeLookRotation(val), ((EntityState)this).gameObject, base.damageStat * damageCoefficient, force, ((BaseState)this).RollCrit(), (DamageColorIndex)0, (GameObject)null, num2, (DamageTypeCombo?)null); projectilesFired++; } } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } public class SpawnState : EntityState { public static float duration = 2.5f; public override void OnEnter() { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown ((EntityState)this).OnEnter(); ((EntityState)this).GetModelAnimator(); Util.PlaySound(SpawnState.spawnSoundString, ((EntityState)this).gameObject); ((EntityState)this).PlayAnimation("Body", "Spawn", "Spawn.playbackRate", duration, 0f); if (Object.op_Implicit((Object)(object)SpawnState.spawnEffectPrefab)) { EffectManager.SimpleMuzzleFlash(SpawnState.spawnEffectPrefab, ((EntityState)this).gameObject, "SpawnEffectOrigin", false); for (int i = 5; i <= 64; i += 2) { GameObject spawnEffectPrefab = SpawnState.spawnEffectPrefab; EffectData val = new EffectData(); Vector3 position = ((EntityState)this).transform.position; float num = i; Vector3 forward = ((EntityState)this).characterDirection.forward; val.origin = position + num * ((Vector3)(ref forward)).normalized - 1.8f * Vector3.up; val.scale = 2.5f; EffectManager.SpawnEffect(spawnEffectPrefab, val, true); } } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { base.outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)7; } } } namespace EntityStates.Digger { public class BaseEmote : BaseState { public string soundString; public string animString; public float duration; public float animDuration; public bool explosive; private bool hasExploded; private Animator animator; private ChildLocator childLocator; public LocalUser localUser; private CharacterCameraParamsData emoteCameraParams = new CharacterCameraParamsData { maxPitch = BlendableFloat.op_Implicit(70f), minPitch = BlendableFloat.op_Implicit(-70f), pivotVerticalOffset = BlendableFloat.op_Implicit(1f), idealLocalCameraPos = BlendableVector3.op_Implicit(emoteCameraPosition), wallCushion = BlendableFloat.op_Implicit(0.1f) }; public static Vector3 emoteCameraPosition = new Vector3(0f, 0f, -7.9f); private CameraParamsOverrideHandle camOverrideHandle; public override void OnEnter() { //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); animator = ((EntityState)this).GetModelAnimator(); childLocator = ((EntityState)this).GetModelChildLocator(); localUser = LocalUserManager.readOnlyLocalUsersList[0]; ((EntityState)this).characterBody.hideCrosshair = true; if (Object.op_Implicit((Object)(object)((EntityState)this).GetAimAnimator())) { ((Behaviour)((EntityState)this).GetAimAnimator()).enabled = false; } animator.SetLayerWeight(animator.GetLayerIndex("AimPitch"), 0f); animator.SetLayerWeight(animator.GetLayerIndex("AimYaw"), 0f); if (animDuration == 0f && duration != 0f) { animDuration = duration; } if (duration > 0f) { ((EntityState)this).PlayAnimation("FullBody, Override", animString, "Emote.playbackRate", duration, 0f); } else { ((EntityState)this).PlayAnimation("FullBody, Override", animString, "Emote.playbackRate", animDuration, 0f); } Util.PlaySound(soundString, ((EntityState)this).gameObject); CameraParamsOverrideRequest val = default(CameraParamsOverrideRequest); val.cameraParamsData = emoteCameraParams; val.priority = 0f; CameraParamsOverrideRequest val2 = val; camOverrideHandle = ((EntityState)this).cameraTargetParams.AddParamsOverride(val2, 0.5f); } public override void OnExit() { //IL_0093: 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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).OnExit(); ((EntityState)this).characterBody.hideCrosshair = false; if (Object.op_Implicit((Object)(object)((EntityState)this).GetAimAnimator())) { ((Behaviour)((EntityState)this).GetAimAnimator()).enabled = true; } animator.SetLayerWeight(animator.GetLayerIndex("AimPitch"), 1f); animator.SetLayerWeight(animator.GetLayerIndex("AimYaw"), 1f); ((EntityState)this).PlayAnimation("FullBody, Override", "BufferEmpty"); childLocator.FindChild("PickL").localScale = Vector3.one; childLocator.FindChild("PickR").localScale = Vector3.one; ((EntityState)this).cameraTargetParams.RemoveParamsOverride(camOverrideHandle, 0.5f); } private void Explode() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Expected O, but got Unknown //IL_00ec: Unknown result type (might be due to invalid IL or missing references) if (!hasExploded) { hasExploded = true; BlastAttack val = new BlastAttack(); val.radius = 8f; val.procCoefficient = 1f; val.position = ((EntityState)this).characterBody.corePosition + 0.5f * ((EntityState)this).characterDirection.forward + Vector3.up * -0.25f; val.attacker = null; val.crit = ((BaseState)this).RollCrit(); val.baseDamage = ((EntityState)this).characterBody.damage * 100f; val.falloffModel = (FalloffModel)2; val.baseForce = 8000f; val.teamIndex = TeamComponent.GetObjectTeam(val.attacker); val.damageType = DamageTypeCombo.op_Implicit((DamageType)262144); val.attackerFiltering = (AttackerFiltering)1; val.Fire(); EffectData val2 = new EffectData(); val2.origin = ((EntityState)this).characterBody.footPosition; val2.scale = 32f; EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/OmniEffect/OmniExplosionVFX"), val2, false); Util.PlaySound(Sounds.ToTheStarsExplosion, ((EntityState)this).gameObject); Util.PlaySound(Sounds.Beep, ((EntityState)this).gameObject); } } public override void FixedUpdate() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); bool flag = false; if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { if (!((EntityState)this).characterMotor.isGrounded) { flag = true; } if (((EntityState)this).characterMotor.velocity != Vector3.zero) { flag = true; } } if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank)) { if (((EntityState)this).inputBank.skill1.down) { flag = true; } if (((EntityState)this).inputBank.skill2.down) { flag = true; } if (((EntityState)this).inputBank.skill3.down) { flag = true; } if (((EntityState)this).inputBank.skill4.down) { flag = true; } if (((EntityState)this).inputBank.jump.down) { flag = true; } if (((EntityState)this).inputBank.moveVector != Vector3.zero) { flag = true; } } if (((EntityState)this).isAuthority && ((EntityState)this).characterMotor.isGrounded && !localUser.isUIFocused) { if (Input.GetKeyDown(global::DiggerPlugin.DiggerPlugin.restKeybind.Value)) { ((EntityState)this).outer.SetInterruptState((EntityState)(object)new Rest(), (InterruptPriority)0); return; } if (Input.GetKeyDown(global::DiggerPlugin.DiggerPlugin.tauntKeybind.Value)) { ((EntityState)this).outer.SetInterruptState((EntityState)(object)new Taunt(), (InterruptPriority)0); return; } if (Input.GetKeyDown(global::DiggerPlugin.DiggerPlugin.jokeKeybind.Value)) { ((EntityState)this).outer.SetInterruptState((EntityState)(object)new Joke(), (InterruptPriority)0); return; } } if (duration > 0f && ((EntityState)this).fixedAge >= duration) { flag = true; } if (explosive && ((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { Explode(); } if (flag) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)0; } } public class Rest : BaseEmote { public override void OnEnter() { animString = "Rest"; animDuration = 2.5f; explosive = false; base.OnEnter(); } } public class Taunt : BaseEmote { public override void OnEnter() { animString = "Taunt"; animDuration = 2f; explosive = false; base.OnEnter(); } } public class Joke : BaseEmote { public override void OnEnter() { animString = "Joke"; animDuration = 3.5f; duration = 3.5f; explosive = true; base.OnEnter(); } } public class DiggerMain : GenericCharacterMain { private float origEmision; private Color origColor; public static float maxEmission = 25f; private float adrenalineGainBuffer; private bool isMainSkin; private float adrenalineCap; private Material bodyMat; private Animator animator; private AdrenalineParticleTimer adrenalineParticles; private float adrenalineSmooth; private int moneyTracker; private float residue; private int buffCounter; private float[] secretTimers = new float[6]; private float lastUpdateTime; private bool gotJunkie; public LocalUser localUser; public static event Action<float> rallypoint; public static event Action<Run> SecretAchieved; public static event Action<bool> JunkieAchieved; public override void OnEnter() { //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) ((GenericCharacterMain)this).OnEnter(); lastUpdateTime = Time.time; isMainSkin = false; animator = ((EntityState)this).GetModelAnimator(); adrenalineGainBuffer = 0.3f; moneyTracker = (int)((EntityState)this).characterBody.master.money; gotJunkie = false; localUser = null; if (LocalUserManager.readOnlyLocalUsersList.Count > 0) { localUser = LocalUserManager.readOnlyLocalUsersList[0]; } if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { Transform modelTransform = ((EntityState)this).GetModelTransform(); if (Object.op_Implicit((Object)(object)modelTransform)) { bodyMat = ((Component)modelTransform).GetComponent<CharacterModel>().baseRendererInfos[0].defaultMaterial; if (Object.op_Implicit((Object)(object)bodyMat)) { origColor = bodyMat.GetColor("_EmColor"); origEmision = bodyMat.GetFloat("_EmPower"); } } if (((EntityState)this).characterBody.skinIndex == 0) { isMainSkin = true; } else if (((EntityState)this).characterBody.skinIndex == 2) { isMainSkin = true; } else if (((EntityState)this).characterBody.skinIndex == 4) { isMainSkin = true; } } adrenalineCap = global::DiggerPlugin.DiggerPlugin.adrenalineCap; adrenalineParticles = ((EntityState)this).GetComponent<AdrenalineParticleTimer>(); Scene activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name == "frozenwall") { DiggerMain.rallypoint?.Invoke(Run.instance.GetRunStopwatch()); } } public override void Update() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) ((GenericCharacterMain)this).Update(); if (((EntityState)this).isAuthority && ((EntityState)this).characterMotor.isGrounded && localUser != null && !localUser.isUIFocused) { if (Input.GetKeyDown(global::DiggerPlugin.DiggerPlugin.restKeybind.Value)) { ((EntityState)this).outer.SetInterruptState((EntityState)(object)new Rest(), (InterruptPriority)0); return; } if (Input.GetKeyDown(global::DiggerPlugin.DiggerPlugin.tauntKeybind.Value)) { ((EntityState)this).outer.SetInterruptState((EntityState)(object)new Taunt(), (InterruptPriority)0); return; } if (Input.GetKeyDown(global::DiggerPlugin.DiggerPlugin.jokeKeybind.Value)) { ((EntityState)this).outer.SetInterruptState((EntityState)(object)new Joke(), (InterruptPriority)0); return; } } if (((EntityState)this).isAuthority) { HandleSecret(); } } public override void FixedUpdate() { ((GenericCharacterMain)this).FixedUpdate(); float num = Time.time - lastUpdateTime; lastUpdateTime = Time.time; adrenalineGainBuffer -= num; if (adrenalineGainBuffer <= 0f && NetworkServer.active) { UpdatePassiveBuff(); } else { buffCounter = ((BaseState)this).GetBuffCount(Buffs.goldRushBuff); } if (Object.op_Implicit((Object)(object)animator)) { adrenalineSmooth = Mathf.Lerp(adrenalineSmooth, (float)buffCounter, 1.5f * num); animator.SetFloat("adrenaline", Util.Remap(adrenalineSmooth, 0f, adrenalineCap, 0f, 1f)); } if (!gotJunkie && (float)buffCounter >= adrenalineCap && DiggerMain.JunkieAchieved != null) { gotJunkie = true; DiggerMain.JunkieAchieved(obj: true); } } public override void OnExit() { ((GenericCharacterMain)this).OnExit(); } private void UpdatePassiveBuff() { int buffCount = ((EntityState)this).characterBody.GetBuffCount(Buffs.goldRushBuff); int money = (int)((EntityState)this).characterBody.master.money; if (moneyTracker < money) { RefreshExistingStacks(buffCount); GiveNewStacks(money); } moneyTracker = money; HandleStackDecay(buffCount); } private void RefreshExistingStacks(int currentCount) { ((EntityState)this).characterBody.ClearTimedBuffs(Buffs.goldRushBuff); for (int i = 0; i < currentCount; i++) { if ((float)((EntityState)this).characterBody.GetBuffCount(Buffs.goldRushBuff) <= adrenalineCap) { ((EntityState)this).characterBody.AddTimedBuff(Buffs.goldRushBuff, 5f); } } } private void GiveNewStacks(int newMoney) { float num = (float)(newMoney - moneyTracker) / Mathf.Pow(Run.instance.difficultyCoefficient, 1.25f); residue = (num + residue) % 5f; float num2 = (num + residue) / 5f; for (int i = 1; (float)i <= num2; i++) { if ((float)((EntityState)this).characterBody.GetBuffCount(Buffs.goldRushBuff) <= adrenalineCap) { ((EntityState)this).characterBody.AddTimedBuff(Buffs.goldRushBuff, 5f); } } if (Object.op_Implicit((Object)(object)adrenalineParticles)) { adrenalineParticles.updateAdrenaline(num2, refreshCombo: true); } UpdateEmission(); } private void HandleStackDecay(int currentCount) { if (buffCounter != 0 && currentCount == 0) { for (int i = 1; (double)i < (double)buffCounter * 0.5; i++) { if ((float)((EntityState)this).characterBody.GetBuffCount(Buffs.goldRushBuff) <= adrenalineCap) { ((EntityState)this).characterBody.AddTimedBuff(Buffs.goldRushBuff, 1f); } } } buffCounter = ((EntityState)this).characterBody.GetBuffCount(Buffs.goldRushBuff); if (Object.op_Implicit((Object)(object)adrenalineParticles)) { adrenalineParticles.updateAdrenaline(buffCounter); } UpdateEmission(); } private void UpdateEmission() { //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) if (isMainSkin && Object.op_Implicit((Object)(object)bodyMat)) { float num = Mathf.Min(1f, adrenalineSmooth / adrenalineCap); Color val = default(Color); ((Color)(ref val))..ctor(1f, origColor.g * 0.4f, origColor.b * 0.4f); bodyMat.SetFloat("_EmPower", Mathf.Lerp(origEmision, maxEmission, num)); bodyMat.SetColor("_EmColor", Color.Lerp(origColor, val, num)); } } private void HandleSecret() { if (Input.GetKeyDown((KeyCode)103)) { secretTimers[0] = Time.fixedTime; } if (Input.GetKeyDown((KeyCode)110)) { secretTimers[1] = Time.fixedTime; } if (Input.GetKeyDown((KeyCode)111)) { secretTimers[2] = Time.fixedTime; } if (Input.GetKeyDown((KeyCode)109)) { secretTimers[3] = Time.fixedTime; } if (Input.GetKeyDown((KeyCode)101)) { secretTimers[4] = Time.fixedTime; } bool flag = true; for (int i = 0; i < 5; i++) { flag = flag && (double)(Time.fixedTime - secretTimers[i]) < 0.5; } if (flag && Time.fixedTime - secretTimers[5] > 3f) { Chat.AddMessage("Gnome loves you"); DiggerMain.SecretAchieved(Run.instance); secretTimers[5] = Time.fixedTime; } } static DiggerMain() { DiggerMain.rallypoint = delegate { }; DiggerMain.SecretAchieved = delegate { }; DiggerMain.JunkieAchieved = delegate { }; } } public class Crush : BaseSkillState { public static float damageCoefficient = global::DiggerPlugin.DiggerPlugin.crushDamage.Value; public float baseDuration = 0.72f; public static float attackRecoil = 0.75f; public static float hitHopVelocity = 5f; public static float styleCoefficient = 0.7f; private float duration; public GameObject explodePrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/omnieffect/OmniExplosionVFX"); public GameObject slashPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/omnieffect/OmniImpactVFXSlash"); public GameObject swingPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/lemurianbitetrail"); private bool hasFired; private bool hasFiredSound; private float hitPauseTimer; private OverlapAttack attack; private bool inHitPause; private bool hasHopped; private float stopwatch; private Animator animator; private HitStopCachedState hitStopCachedState; private float lastUpdateTime; public override void OnEnter() { //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Expected O, but got Unknown //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); lastUpdateTime = Time.time; duration = baseDuration / ((BaseState)this).attackSpeedStat; hasFired = false; animator = ((EntityState)this).GetModelAnimator(); ((BaseState)this).StartAimMode(0.5f + duration, false); ((EntityState)this).PlayCrossfade("Gesture, Override", "Crush", "Crush.playbackRate", duration, 0.05f); HitBoxGroup hitBoxGroup = null; Transform modelTransform = ((EntityState)this).GetModelTransform(); if (Object.op_Implicit((Object)(object)modelTransform)) { hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "Crush"); } attack = new OverlapAttack(); attack.attacker = ((EntityState)this).gameObject; attack.inflictor = ((EntityState)this).gameObject; attack.teamIndex = ((BaseState)this).GetTeam(); attack.damage = damageCoefficient * ((BaseState)this).damageStat; attack.procCoefficient = 1f; attack.hitEffectPrefab = LoaderMeleeAttack.overchargeImpactEffectPrefab; attack.forceVector = Vector3.zero; attack.pushAwayForce = 1f; attack.impactSound = Assets.pickHitEventDef.index; attack.hitBoxGroup = hitBoxGroup; attack.isCrit = ((BaseState)this).RollCrit(); attack.damageType.damageSource = (DamageSource)1; } public override void OnExit() { ((EntityState)this).OnExit(); } public void FireSound() { Util.PlayAttackSpeedSound(Sounds.Crush, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat); } public void FireAttack() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Expected O, but got Unknown //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) float num = 0.7f * Mathf.Sqrt(3.5f * ((BaseState)this).attackSpeedStat); float num2 = 1.1f * Mathf.Sqrt(num - 0.31f); if (((EntityState)this).isAuthority) { ((Component)((EntityState)this).GetModelChildLocator().FindChild("SwingCenter")).transform.localScale = Vector3.one * num2; if (attack.Fire((List<HurtBox>)null)) { if (!hasHopped) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded) { ((BaseState)this).SmallHop(((EntityState)this).characterMotor, hitHopVelocity / Mathf.Sqrt(((BaseState)this).attackSpeedStat)); } hasHopped = true; } if (!inHitPause) { hitStopCachedState = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, "Crush.playbackRate"); hitPauseTimer = 0.6f * GroundLight.hitPauseDuration / ((BaseState)this).attackSpeedStat; inHitPause = true; } } } if (!hasFired) { hasFired = true; ((BaseState)this).AddRecoil(-1f * attackRecoil * num, -2f * attackRecoil * num, -0.5f * attackRecoil * num, 0.5f * attackRecoil * num); if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); Transform transform = ((Component)((EntityState)this).GetModelChildLocator().FindChild("CrushMuzzleExplosion")).transform; EffectData val = new EffectData(); val.origin = transform.position; val.scale = num2 * 2.69f; EffectManager.SpawnEffect(explodePrefab, val, false); val.scale = 0.1f; Vector3 val2 = Vector3.Cross(((Ray)(ref aimRay)).direction, Vector3.up); Vector3 normalized = ((Vector3)(ref val2)).normalized; val.origin = ((Ray)(ref aimRay)).origin - 0.5f * normalized; EffectManager.SpawnEffect(swingPrefab, val, false); val.origin = ((Ray)(ref aimRay)).origin + normalized; EffectManager.SpawnEffect(swingPrefab, val, false); } } } public override void FixedUpdate() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); float num = Time.time - lastUpdateTime; lastUpdateTime = Time.time; hitPauseTimer -= num; if (hitPauseTimer <= 0f && inHitPause) { ((BaseState)this).ConsumeHitStopCachedState(hitStopCachedState, ((EntityState)this).characterMotor, animator); inHitPause = false; } if (!inHitPause) { stopwatch += num; } else { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } if (Object.op_Implicit((Object)(object)animator)) { animator.SetFloat("Crush.playbackRate", 0f); } } if (stopwatch >= duration * 0.27f && !hasFiredSound) { FireSound(); hasFiredSound = true; } if (stopwatch >= duration * 0.341f && (!hasFired || stopwatch <= duration * 0.5f)) { FireAttack(); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } public class Gouge : BaseSkillState { public static float damageCoefficient = global::DiggerPlugin.DiggerPlugin.gougeDamage.Value; public float baseDuration = 1f; public static float attackRecoil = 0.5f; public static float hitHopVelocity = 5f; public static float styleCoefficient = 1.2f; public static float attackRadius = 1.2f; public static float baseEarlyExit = 0.4f; public int swingIndex; private float lastUpdateTime; private bool firstSwing = true; private bool isSlash; private float earlyExitDuration; private float duration; private bool hasFired; private bool hasFiredSound; private float hitPauseTimer; private OverlapAttack attack; private bool inHitPause; private bool hasHopped; private float stopwatch; private Animator animator; private HitStopCachedState hitStopCachedState; public override void OnEnter() { //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Expected O, but got Unknown //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); lastUpdateTime = Time.time; if (!firstSwing && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator) && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator.primary)) { ((EntityState)this).characterBody.OnSkillActivated(((EntityState)this).skillLocator.primary); } duration = baseDuration / ((BaseState)this).attackSpeedStat; earlyExitDuration = baseEarlyExit / ((BaseState)this).attackSpeedStat; hasFired = false; animator = ((EntityState)this).GetModelAnimator(); ((BaseState)this).StartAimMode(0.5f + duration, false); if (((EntityState)this).characterBody.skinIndex == global::DiggerPlugin.DiggerPlugin.blacksmithSkinIndex && swingIndex == 0) { isSlash = true; } else { isSlash = false; } HitBoxGroup hitBoxGroup = null; Transform modelTransform = ((EntityState)this).GetModelTransform(); if (Object.op_Implicit((Object)(object)modelTransform)) { hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "Crush"); } if (swingIndex == 0) { ((EntityState)this).PlayCrossfade("Pick, Override", "Swing1", "Swing.playbackRate", duration, 0.05f); } else { ((EntityState)this).PlayCrossfade("Pick, Override", "Swing2", "Swing.playbackRate", duration, 0.05f); } attack = new OverlapAttack(); attack.damageType = DamageTypeCombo.op_Implicit((DamageType)0); DamageAPI.AddModdedDamageType(attack, global::DiggerPlugin.DiggerPlugin.CleaveDamage); attack.attacker = ((EntityState)this).gameObject; attack.inflictor = ((EntityState)this).gameObject; attack.teamIndex = ((BaseState)this).GetTeam(); attack.damage = damageCoefficient * ((BaseState)this).damageStat; attack.procCoefficient = 1f; if (isSlash) { attack.hitEffectPrefab = Assets.slashFX; } else { attack.hitEffectPrefab = Assets.hitFX; } attack.forceVector = Vector3.zero; attack.pushAwayForce = 1f; attack.hitBoxGroup = hitBoxGroup; attack.isCrit = ((BaseState)this).RollCrit(); attack.impactSound = Assets.pickHitEventDef.index; attack.damageType.damageSource = (DamageSource)1; if (isSlash) { attack.impactSound = LegacyResourcesAPI.Load<NetworkSoundEventDef>("NetworkSoundEventDefs/nseMercSwordImpact").index; } } public override void OnExit() { ((EntityState)this).OnExit(); } public void FireSound() { Util.PlayAttackSpeedSound(Sounds.Swing, ((EntityState)this).gameObject, ((BaseState)this).attackSpeedStat); } public void FireAttack() { //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) if (!hasFired) { hasFired = true; if (((EntityState)this).isAuthority) { string text = ((swingIndex != 0) ? "SwingLeft" : "SwingRight"); GameObject val = Assets.swingFX; if ((float)((EntityState)this).characterBody.GetBuffCount(Buffs.goldRushBuff) >= 0.8f * global::DiggerPlugin.DiggerPlugin.adrenalineCap) { val = Assets.empoweredSwingFX; } EffectManager.SimpleMuzzleFlash(val, ((EntityState)this).gameObject, text, true); ((BaseState)this).AddRecoil(-1f * attackRecoil, -2f * attackRecoil, -0.5f * attackRecoil, 0.5f * attackRecoil); } } if (!((EntityState)this).isAuthority || !attack.Fire((List<HurtBox>)null)) { return; } if (!hasHopped) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded) { ((BaseState)this).SmallHop(((EntityState)this).characterMotor, hitHopVelocity / Mathf.Sqrt(((BaseState)this).attackSpeedStat)); } hasHopped = true; } if (!inHitPause) { hitStopCachedState = ((BaseState)this).CreateHitStopCachedState(((EntityState)this).characterMotor, animator, "Swing.playbackRate"); hitPauseTimer = 0.6f * GroundLight.hitPauseDuration / ((BaseState)this).attackSpeedStat; inHitPause = true; } } public override void FixedUpdate() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); float num = Time.time - lastUpdateTime; lastUpdateTime = Time.time; hitPauseTimer -= num; if (hitPauseTimer <= 0f && inHitPause) { ((BaseState)this).ConsumeHitStopCachedState(hitStopCachedState, ((EntityState)this).characterMotor, animator); inHitPause = false; } if (!inHitPause) { stopwatch += num; } else { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } if (Object.op_Implicit((Object)(object)animator)) { animator.SetFloat("Swing.playbackRate", 0f); } } if (stopwatch >= duration * 0.189f && !hasFiredSound) { FireSound(); hasFiredSound = true; } if (stopwatch >= duration * 0.245f && (!hasFired || stopwatch <= duration * 0.469f)) { FireAttack(); } if (((EntityState)this).fixedAge >= duration - earlyExitDuration && ((EntityState)this).isAuthority && ((EntityState)this).inputBank.skill1.down) { int num2 = ((swingIndex == 0) ? 1 : 0); ((EntityState)this).outer.SetNextState((EntityState)(object)new Gouge { swingIndex = num2, firstSwing = false }); if (!hasFired) { FireAttack(); } } else if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } public override void OnSerialize(NetworkWriter writer) { ((BaseSkillState)this).OnSerialize(writer); writer.Write(swingIndex); } public override void OnDeserialize(NetworkReader reader) { ((BaseSkillState)this).OnDeserialize(reader); swingIndex = reader.ReadInt32(); } } public class DrillChargeStart : BaseSkillState { private GameObject chargePrefab = ChargeMegaFireball.chargeEffectPrefab; private GameObject chargeInstance; private float chargeDuration = 0.6f; private int charge = 0; private Vector3 left = new Vector3(0f, 0f, 1f); private float lastUpdateTime; private float chargeTimer; private const float chargeTickDuration = 1f / 60f; protected bool ShouldKeepChargingAuthority() { return ((EntityState)this).fixedAge < chargeDuration && ((BaseSkillState)this).IsKeyDownAuthority() && (float)charge * (0.8f + 0.2f * ((BaseState)this).attackSpeedStat) <= 38f; } protected EntityState GetNextStateAuthority() { return (EntityState)(object)new DrillCharge { charged = charge }; } public override void OnEnter() { //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); chargeTimer = 0f; lastUpdateTime = Time.time; ((BaseState)this).StartAimMode(0.6f, false); Transform modelTransform = ((EntityState)this).GetModelTransform(); if (Object.op_Implicit((Object)(object)modelTransform)) { CharacterModel component = ((Component)modelTransform).GetComponent<CharacterModel>(); if (Object.op_Implicit((Object)(object)component)) { TemporaryOverlayInstance val = TemporaryOverlayManager.AddOverlay(((Component)component).gameObject); val.duration = chargeDuration; val.animateShaderAlpha = true; val.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); val.destroyComponentOnEnd = true; val.originalMaterial = LegacyResourcesAPI.Load<Material>("Materials/matOnFire"); val.AddToCharacterModel(component); val.Start(); } Ray aimRay = ((BaseState)this).GetAimRay(); if (((EntityState)this).isAuthority) { Vector3 direction = ((Ray)(ref aimRay)).direction; Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(((EntityState)this).characterMotor.moveDirection.x, ((EntityState)this).characterMotor.moveDirection.z); Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(((Ray)(ref aimRay)).direction.x, ((Ray)(ref aimRay)).direction.z); float num = Vector2.Dot(val2, ((Vector2)(ref val3)).normalized); Vector2 val4 = default(Vector2); ((Vector2)(ref val4))..ctor(((Ray)(ref aimRay)).direction.z, -1f * ((Ray)(ref aimRay)).direction.x); float num2 = Vector2.Dot(val2, ((Vector2)(ref val4)).normalized); Quaternion val5 = Quaternion.FromToRotation(left, direction); chargeInstance = Object.Instantiate<GameObject>(chargePrefab, ((Ray)(ref aimRay)).origin, ((EntityState)this).transform.rotation * val5); Transform transform = chargeInstance.transform; transform.localScale *= 0.0125f; } ((EntityState)this).PlayAnimation("Gesture, Override", "DrillChargeStart"); Util.PlaySound(Sounds.DrillChargeStart, ((EntityState)this).gameObject); } } public override void OnExit() { if (Object.op_Implicit((Object)(object)chargeInstance)) { EntityState.Destroy((Object)(object)chargeInstance); } ((EntityState)this).PlayAnimation("Gesture, Override", "BufferEmpty"); ((EntityState)this).OnExit(); } public override void FixedUpdate() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); float num = Time.time - lastUpdateTime; lastUpdateTime = Time.time; if (!ShouldKeepChargingAuthority()) { ((EntityState)this).outer.SetNextState(GetNextStateAuthority()); return; } Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 direction = ((Ray)(ref aimRay)).direction; Quaternion val = Quaternion.FromToRotation(left, direction); chargeInstance.transform.rotation = ((EntityState)this).transform.rotation * val; chargeInstance.transform.position = ((Ray)(ref aimRay)).origin; if (chargeTimer <= 0f) { charge++; chargeTimer += 1f / 60f; } chargeTimer -= num; } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } public class DrillCharge : BaseSkillState { public static float damageCoefficient = global::DiggerPlugin.DiggerPlugin.drillChargeDamage.Value; public float baseDuration = 0.4f; public static float styleCoefficient = 0.4f; private float duration; public GameObject explodePrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/VFX/OmniExplosionVFX.prefab").WaitForCompletion(); private EffectData effectData; private float lastUpdateTime; private float frameTimer; private const float frameDuration = 1f / 60f; private int frameCounter = 0; public int charged; private int type; private BlastAttack blastAttack; public override void OnEnter() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Expected O, but got Unknown //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Expected O, but got Unknown //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); lastUpdateTime = Time.time; frameTimer = 0f; duration = baseDuration; Ray aimRay = ((BaseState)this).GetAimRay(); ((EntityState)this).characterMotor.disableAirControlUntilCollision = false; ((Component)((EntityState)this).GetModelChildLocator().FindChild("DrillChargeEffect")).GetComponent<ParticleSystem>().Play(); Transform modelTransform = ((EntityState)this).GetModelTransform(); if (Object.op_Implicit((Object)(object)modelTransform)) { CharacterModel component = ((Component)modelTransform).GetComponent<CharacterModel>(); if (Object.op_Implicit((Object)(object)component)) { TemporaryOverlayInstance val = TemporaryOverlayManager.AddOverlay(((Component)component).gameObject); val.duration = duration; val.animateShaderAlpha = true; val.alphaCurve = AnimationCurve.EaseInOut(0f, 15f, 1f, 0f); val.destroyComponentOnEnd = true; val.originalMaterial = LegacyResourcesAPI.Load<Material>("Materials/matOnFire"); val.AddToCharacterModel(component); val.Start(); } } type = 0; if (charged > 8) { type = 1; ((EntityState)this).GetModelAnimator().SetFloat("DrillCharge.offset", Util.Remap(((EntityState)this).characterMotor.velocity.y, -70f, 70f, -1f, 1f)); ((EntityState)this).PlayAnimation("FullBody, Override", "DrillCharge"); } else { ((EntityState)this).PlayAnimation("FullBody, Override", "DrillChargeShort"); } if (NetworkServer.active) { ((EntityState)this).characterBody.AddBuff(Buffs.HiddenInvincibility); } Util.PlaySound(Sounds.DrillCharge, ((EntityState)this).gameObject); if (((EntityState)this).isAuthority) { blastAttack = new BlastAttack { radius = 10f, procCoefficient = 1f, position = ((Ray)(ref aimRay)).origin, attacker = ((EntityState)this).gameObject, crit = Util.CheckRoll(((EntityState)this).characterBody.crit, ((EntityState)this).characterBody.master), baseDamage = ((EntityState)this).characterBody.damage * damageCoefficient, falloffModel = (FalloffModel)0, baseForce = 3f, damageType = DamageTypeCombo.op_Implicit((DamageType)0), attackerFiltering = (AttackerFiltering)2 }; blastAttack.damageType.damageSource = (DamageSource)2; blastAttack.teamIndex = TeamComponent.GetObjectTeam(blastAttack.attacker); effectData = new EffectData(); effectData.scale = 1.5f; effectData.color = new Color32((byte)234, (byte)234, (byte)127, (byte)100); CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.velocity += 75f * ((Ray)(ref aimRay)).direction; } } public override void OnExit() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { ((EntityState)this).characterBody.RemoveBuff(Buffs.HiddenInvincibility); ((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 0.5f); } if (!((EntityState)this).characterMotor.disableAirControlUntilCollision) { CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.velocity *= 0.4f; } if (type == 0) { ((EntityState)this).PlayAnimation("FullBody, Override", "DrillChargeShortEnd"); } else if (!((BaseState)this).isGrounded) { ((EntityState)this).PlayAnimation("FullBody, Override", "Flip", "Flip.playbackRate", 0.3f, 0f); } else { ((EntityState)this).PlayAnimation("FullBody, Override", "BufferEmpty"); } ((EntityState)this).OnExit(); } public override void FixedUpdate() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); float num = Time.time - lastUpdateTime; lastUpdateTime = Time.time; if (!((EntityState)this).isAuthority) { return; } Ray aimRay = ((BaseState)this).GetAimRay(); blastAttack.position = ((Ray)(ref aimRay)).origin; effectData.origin = ((Ray)(ref aimRay)).origin; if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); return; } float num2 = (float)charged * (0.8f + 0.2f * ((BaseState)this).attackSpeedStat); int num3 = Mathf.FloorToInt(num2); int num4 = Mathf.Max(2, 40 - num3); if (frameCounter % num4 == 0) { Result val = blastAttack.Fire(); int hitCount = val.hitCount; EffectManager.SpawnEffect(explodePrefab, effectData, false); } if (frameTimer <= 0f) { frameCounter++; frameTimer += 1f / 60f; } frameTimer -= num; } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } public class DrillBreakStart : BaseSkillState { private GameObject chargePrefab = ChargeMegaFireball.chargeEffectPrefab; private GameObject chargeInstance; private float chargeDuration = 0.6f; private int charge = 0; private Vector3 left = new Vector3(0f, 0f, 1f); protected bool ShouldKeepChargingAuthority() { return false; } protected EntityState GetNextStateAuthority() { return (EntityState)(object)new DrillBreak(); } public override void OnEnter() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); ((BaseState)this).StartAimMode(0.6f, false); Ray aimRay = ((BaseState)this).GetAimRay(); if (((EntityState)this).isAuthority) { Vector3 direction = ((Ray)(ref aimRay)).direction; Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(((EntityState)this).characterMotor.moveDirection.x, ((EntityState)this).characterMotor.moveDirection.z); Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(((Ray)(ref aimRay)).direction.x, ((Ray)(ref aimRay)).direction.z); float num = Vector2.Dot(val, ((Vector2)(ref val2)).normalized); Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(((Ray)(ref aimRay)).direction.z, -1f * ((Ray)(ref aimRay)).direction.x); float num2 = Vector2.Dot(val, ((Vector2)(ref val3)).normalized); Quaternion val4 = Quaternion.FromToRotation(left, direction); chargeInstance = Object.Instantiate<GameObject>(chargePrefab, ((Ray)(ref aimRay)).origin, ((EntityState)this).transform.rotation * val4); Transform transform = chargeInstance.transform; transform.localScale *= 0.0125f; } ((EntityState)this).PlayAnimation("Gesture, Override", "DrillChargeStart"); Util.PlaySound(Sounds.DrillChargeStart, ((EntityState)this).gameObject); Transform modelTransform = ((EntityState)this).GetModelTransform(); if (Object.op_Implicit((Object)(object)modelTransform)) { CharacterModel component = ((Component)modelTransform).GetComponent<CharacterModel>(); if (Object.op_Implicit((Object)(object)component)) { TemporaryOverlayInstance val5 = TemporaryOverlayManager.AddOverlay(((Component)component).gameObject); val5.duration = chargeDuration; val5.animateShaderAlpha = true; val5.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); val5.destroyComponentOnEnd = true; val5.originalMaterial = LegacyResourcesAPI.Load<Material>("Materials/matOnFire"); val5.AddToCharacterModel(component); val5.Start(); } } } public override void OnExit() { if (Object.op_Implicit((Object)(object)chargeInstance)) { EntityState.Destroy((Object)(object)chargeInstance); } ((EntityState)this).PlayAnimation("Gesture, Override", "BufferEmpty"); ((EntityState)this).OnExit(); } public override void FixedUpdate() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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) ((EntityState)this).FixedUpdate(); if (!ShouldKeepChargingAuthority()) { ((EntityState)this).outer.SetNextState(GetNextStateAuthority()); return; } Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 direction = ((Ray)(ref aimRay)).direction; Quaternion val = Quaternion.FromToRotation(left, direction); chargeInstance.transform.rotation = ((EntityState)this).transform.rotation * val; chargeInstance.transform.position = ((Ray)(ref aimRay)).origin; charge++; } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } public class DrillBreak : BaseSkillState { public static float damageCoefficient = 2.4f; public float baseDuration = 0.5f; private float duration; private OverlapAttack attack; public override void OnEnter() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Expected O, but got Unknown //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Expected O, but got Unknown //IL_01ca: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration; Ray aimRay = ((BaseState)this).GetAimRay(); ((EntityState)this).characterMotor.disableAirControlUntilCollision = false; ((EntityState)this).PlayAnimation("FullBody, Override", "DrillChargeShort"); if (NetworkServer.active) { ((EntityState)this).characterBody.AddBuff(Buffs.HiddenInvincibility); } Util.PlaySound(Sounds.DrillCharge, ((EntityState)this).gameObject); CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.velocity += 75f * ((Ray)(ref aimRay)).direction; HitBoxGroup hitBoxGroup = null; Transform modelTransform = ((EntityState)this).GetModelTransform(); ((Component)((EntityState)this).GetModelChildLocator().FindChild("DrillBreakEffect")).GetComponent<ParticleSystem>().Play(); if (Object.op_Implicit((Object)(object)modelTransform)) { hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "Crush"); } attack = new OverlapAttack(); attack.attacker = ((EntityState)this).gameObject; attack.inflictor = ((EntityState)this).gameObject; attack.teamIndex = ((BaseState)this).GetTeam(); attack.damage = damageCoefficient * ((BaseState)this).damageStat; attack.procCoefficient = 1f; attack.hitEffectPrefab = Assets.heavyHitFX; attack.forceVector = Vector3.zero; attack.pushAwayForce = 1f; attack.hitBoxGroup = hitBoxGroup; attack.isCrit = ((BaseState)this).RollCrit(); attack.impactSound = Assets.pickHitEventDef.index; if (((EntityState)this).isAuthority) { EffectData val = new EffectData(); val.origin = ((EntityState)this).transform.position; val.scale = 8f; EffectManager.SpawnEffect(global::DiggerPlugin.DiggerPlugin.backblastEffect, val, true); } if (Object.op_Implicit((Object)(object)modelTransform)) { CharacterModel component = ((Component)modelTransform).GetComponent<CharacterModel>(); if (Object.op_Implicit((Object)(object)component)) { TemporaryOverlayInstance val2 = TemporaryOverlayManager.AddOverlay(((Component)component).gameObject); val2.duration = duration; val2.animateShaderAlpha = true; val2.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); val2.destroyComponentOnEnd = true; val2.originalMaterial = LegacyResourcesAPI.Load<Material>("Materials/matOnFire"); val2.AddToCharacterModel(component); val2.Start(); } } } public override void OnExit() { if (NetworkServer.active) { ((EntityState)this).characterBody.RemoveBuff(Buffs.HiddenInvincibility); ((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, 0.5f); } ((EntityState)this).PlayAnimation("FullBody, Override", "DrillChargeShortEnd"); ((EntityState)this).OnExit(); } public override void FixedUpdate() { //IL_003d: 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_004c: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Expected O, but got Unknown //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Expected O, but got Unknown //IL_018f: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { if (!((EntityState)this).characterMotor.disableAirControlUntilCollision) { CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.velocity *= 0.4f; } ((EntityState)this).outer.SetNextStateToMain(); } else if (((EntityState)this).isAuthority && attack.Fire((List<HurtBox>)null)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded) { ((BaseState)this).SmallHop(((EntityState)this).characterMotor, 18f); } BlastAttack val = new BlastAttack(); val.radius = 12f; val.procCoefficient = 1f; val.position = ((EntityState)this).characterBody.corePosition; val.attacker = ((EntityState)this).gameObject; val.crit = ((BaseState)this).RollCrit(); val.baseDamage = ((EntityState)this).characterBody.damage * damageCoefficient; val.falloffModel = (FalloffModel)0; val.baseForce = 3f; val.teamIndex = TeamComponent.GetObjectTeam(val.attacker); val.damageType = DamageTypeCombo.op_Implicit((DamageType)0); val.attackerFiltering = (AttackerFiltering)2; val.damageType.damageSource = (DamageSource)2; val.Fire(); EffectData val2 = new EffectData(); val2.origin = ((EntityState)this).characterBody.corePosition; val2.scale = 6f; EffectManager.SpawnEffect(global::DiggerPlugin.DiggerPlugin.backblastEffect, val2, false); ((EntityState)this).PlayAnimation("FullBody, Override", "Flip", "Flip.playbackRate", 0.4f, 0f); ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } public class ToTheStars : BaseSkillState { public float baseDuration = 0.45f; public static float damageCoefficient = 1.6f; private float duration; public GameObject hitEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/impacteffects/MissileExplosionVFX"); public GameObject tracerEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/tracers/tracerembers"); public GameObject smokeEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/muzzleflashes/muzzleflashLoader"); public GameObject flashEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/muzzleflashes/muzzleflashfire"); private Quaternion major = Quaternion.FromToRotation(Vector3.forward, Vector3.down); public override void OnEnter() { //IL_0026: 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_0035: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration; if (((EntityState)this).isAuthority) { CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.velocity *= 0.2f; ((EntityState)this).characterMotor.rootMotion.y += 0.5f; ((EntityState)this).characterMotor.velocity.y = 25f; ((EntityState)this).gameObject.layer = LayerIndex.fakeActor.intVal; ((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers(); } ((EntityState)this).PlayAnimation("FullBody, Override", "ToTheStarsStart", "ToTheStars.playbackRate", 1f, 0f); Util.PlayAttackSpeedSound("Play_commando_shift", ((EntityState)this).gameObject, 1.8f); } public override void OnExit() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Expected O, but got Unknown //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams)) { ((EntityState)this).cameraTargetParams.fovOverride = -1f; } if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 down = Vector3.down; BulletAttack val = new BulletAttack { owner = ((EntityState)this).gameObject, weapon = ((EntityState)this).gameObject, muzzleName = "Chest", origin = ((Ray)(ref aimRay)).origin, aimVector = down, minSpread = 0f, maxSpread = ((EntityState)this).characterBody.spreadBloomAngle, radius = 0.7f, bulletCount = 1u, procCoefficient = 0.7f, damage = ((EntityState)this).characterBody.damage * damageCoefficient, force = 3f, falloffModel = (FalloffModel)0, tracerEffectPrefab = tracerEffectPrefab, hitEffectPrefab = hitEffectPrefab, isCrit = ((BaseState)this).RollCrit(), HitEffectNormal = false, stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask, smartCollision = true, maxDistance = 300f }; val.damageType.damageSource = (DamageSource)8; for (int i = 0; i < 3; i++) { for (int j = 0; j <= 4; j++) { float num = Random.Range(0f, 6.28f); float num2 = Mathf.Cos(num); float num3 = Mathf.Sin(num); float num4 = (float)j * 0.7555f; num4 *= 1f / 12f; down.x += num4 * num2; down.z += num4 * num3; val.aimVector = down; val.Fire(); down = Vector3.down; } } EffectData val2 = new EffectData(); val2.origin = ((Ray)(ref aimRay)).origin + 1f * Vector3.down; val2.scale = 8f; val2.rotation = major; EffectManager.SpawnEffect(smokeEffectPrefab, val2, true); val2.scale = 16f; EffectManager.SpawnEffect(flashEffectPrefab, val2, true); } Util.PlaySound(Sounds.ToTheStars, ((EntityState)this).gameObject); ((EntityState)this).gameObject.layer = LayerIndex.defaultLayer.intVal; ((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers(); ((EntityState)this).PlayAnimation("FullBody, Override", "ToTheStarsEnd"); ((EntityState)this).OnExit(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams)) { ((EntityState)this).cameraTargetParams.fovOverride = Mathf.Lerp(DodgeState.dodgeFOV, 60f, ((EntityState)this).fixedAge / duration); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } public class ToTheStarsClassic : BaseSkillState { public float baseDuration = 0.45f; public static float damageCoefficient = 3f; private float duration; public GameObject tracerEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/tracers/tracerembers"); public GameObject smokeEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/muzzleflashes/muzzleflashLoader"); public GameObject flashEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/muzzleflashes/muzzleflashfire"); public GameObject ToTheStarsClassicEffectPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/OmniEffect/OmniExplosionVFXQuick"); private Quaternion major = Quaternion.FromToRotation(Vector3.forward, Vector3.down); public override void OnEnter() { //IL_0026: Unknown result type (might be due